commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
1d4d6862429d472ae4269004d1e6fe57aa428cc1 | Bump to version 0.15.2 | app/setup.py | app/setup.py | try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
with open('../requirements.txt') as file:
requirements = file.read()
config = {
'name': 'prometheus',
'description': 'a global asset allocation tool',
'long_description': open('README.rst', 'rt... | Python | 0 | @@ -545,17 +545,17 @@
: '0.15.
-1
+2
',%0A%09'ins
|
eb31c9db7e2bf083b42141e6149fc65fd26ebf17 | Use Flask 0.11.1 | app/setup.py | app/setup.py | from setuptools import setup, find_packages
# @see https://github.com/pypa/sampleproject/blob/master/setup.py
setup(
name='wbc',
version='0.0.0',
author='Maciej Brencz',
author_email='maciej.brencz@gmail.com',
description='Flask app providing WBC archives API',
url='https://github.com/macbre/wb... | Python | 0.000119 | @@ -427,17 +427,17 @@
ask==0.1
-0
+1
.1',%0A
|
8faf87b4a7dda38493fa1a4e758543b36c506195 | Remove six from manage.py | manage.py | manage.py | #!/usr/bin/env python
import os
import sys
import attr
from gevent import monkey
from psycogreen.gevent import patch_psycopg
@attr.s
class GeventCommand(object):
command = attr.ib()
contains = attr.ib(default=None)
http_adapter_pool_size = attr.ib(default=None)
def _set_source_root_parent(source_root_p... | Python | 0.000001 | @@ -4345,52 +4345,17 @@
ort
-six%0A import unittest%0A if six.PY3:%0A
+unittest%0A
|
8536e100fd734d7293f559c890a73b527f5ab03c | fix typo | manage.py | manage.py | #!/usr/bin/env python333
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_site.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure t... | Python | 0.999991 | @@ -15,18 +15,16 @@
python3
-33
%0Aimport
|
73ea57be5bef36277a164a2cb7691e6ccc16df7b | Add threaded option to Server | manage.py | manage.py | #!/usr/bin/env python
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
import os.path as p
from subprocess import call, check_call
from flask import current_app as app
from flask.ext.script import Server, Manager
from app import create_app, db
manager =... | Python | 0.000001 | @@ -707,24 +707,115 @@
fault=None)%0A
+@manager.option(%0A '-t', '--threaded', help='Run multiple threads', action='store_true')%0A
def runserve
@@ -816,26 +816,24 @@
nserver(
-host, port
+**kwargs
):%0A #
@@ -963,19 +963,58 @@
-host =
+skwargs = %7B%0A 'host': kwargs.get('
host
+')
or
@... |
30275d0677414220409e5d9fc1c9b5a8e1138955 | update info to db | app/utils.py | app/utils.py | from flask import url_for
from app.models import IdlingIncident
def register_template_utils(app):
"""Register Jinja 2 helpers (called from __init__.py)."""
@app.template_test()
def equalto(value, other):
return value == other
@app.template_global()
def is_hidden_field(field):
fro... | Python | 0 | @@ -649,10 +649,37 @@
x =
-7;
+8%0A license_plate_index = 9
%0A
@@ -696,18 +696,17 @@
index =
-3;
+4
%0A dat
@@ -716,17 +716,16 @@
ndex = 0
-;
%0A age
@@ -737,17 +737,16 @@
ndex = 6
-;
%0A pic
@@ -760,17 +760,16 @@
dex = 13
-;
%0A des
@@ -791,9 +791,8 @@
= 11
-;
%0A
@@ -977,20 +977,16... |
6d933d9f6ef7f70d4c3bb8d4a4df4942c5f0aec6 | Set manage.py executable | manage.py | manage.py | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "laboite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| Python | 0.000001 | |
005ebdf83d2ad23d6dc7c3326da4ad72f101f8db | test debug=true on new project tree | manage.py | manage.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from importd import d
import os
import sys
def get_sentry_apps():
if 'SENTRY_DSN' in os.environ:
return ('raven.contrib.django.raven_compat',)
else:
return ()
if 'gunicorn' in sys.argv[0]:
DEBUG = False
else:
DEBUG = True
d(
DEBUG=DEBUG... | Python | 0.000002 | @@ -293,16 +293,27 @@
G = True
+%0ADEBUG=True
%0A%0Ad(%0A
|
a9e2092722d37cbc448e796230ad7b21e77259b1 | Set execute permissions on manage.py | manage.py | manage.py | #!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... | Python | 0.000001 | |
ce7c31f3dd97716051b72951c7c745dd2c63efcd | Include timestamp in audit logs | plugins/audit_logs/server/__init__.py | plugins/audit_logs/server/__init__.py | import cherrypy
import logging
from girder import auditLogger
from girder.models.model_base import Model
from girder.api.rest import getCurrentUser
class Record(Model):
def initialize(self):
self.name = 'audit_log_record'
def validate(self, doc):
return doc
class AuditLogHandler(logging.Han... | Python | 0.000001 | @@ -9,16 +9,32 @@
herrypy%0A
+import datetime%0A
import l
@@ -581,16 +581,64 @@
r%5B'_id'%5D
+,%0A 'when': datetime.datetime.utcnow()
%0A
|
fc4d76fc60cbb929665449b461bb99fcc470acd2 | Remove second create_admin function | manage.py | manage.py | import datetime
from project import app, db
from project import models
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
@manager.command
def create_db():
"""Creates the db table... | Python | 0.000001 | @@ -65,16 +65,48 @@
models%0A
+from project.models import User%0A
from fla
@@ -460,153 +460,8 @@
)%0A%0A%0A
-@manager.command%0Adef create_admin():%0A %22%22%22Creates the admin user.%22%22%22%0A db.session.add(User(%22ad@min.com%22, %22admin%22))%0A db.session.commit()%0A%0A%0A
@man
|
f334a9c008eb7fada006ea1a2471c3ba97cfafb3 | fix python2 syntax | tensorboardX/graph.py | tensorboardX/graph.py | from .src.graph_pb2 import GraphDef
from .src.node_def_pb2 import NodeDef
from .src.versions_pb2 import VersionDef
from .src.attr_value_pb2 import AttrValue
from .src.tensor_shape_pb2 import TensorShapeProto
import torch
def replace(name, scope):
print(type(name), name)
return '/'.join([scope[name], name])
... | Python | 0.999772 | @@ -601,18 +601,12 @@
'',
-print(n, '
+'%7B%7D
has
@@ -622,16 +622,25 @@
pe name'
+.format(n
)%0A
|
d2f2b5867acab1f4659173dc761f938ced4112cb | Change download location to storage.googleapis.com | appengine.py | appengine.py | #!/usr/bin/env python
from __future__ import with_statement
from cStringIO import StringIO
import itertools
import logging
import optparse
import os
import stat
import sys
import urllib2
import urlparse
import zipfile
__version__ = '0.2'
USER_AGENT = 'appengine.py/' + __version__
VERSION_URL = 'https://appengine.goo... | Python | 0 | @@ -362,33 +362,26 @@
http
+s
://
-googleappengin
+storag
e.google
code
@@ -380,22 +380,40 @@
ogle
-code
+apis
.com/
-files
+appengine-sdks/featured
/goo
@@ -430,10 +430,11 @@
ine_
-%25s
+%7B0%7D
.zip
|
3453b7961fae365f833199c88c7395428fcdf788 | Set default max threads for multithreading to 3 | tensorpy/constants.py | tensorpy/constants.py | """ Defining constants for tensorpy use """
DOWNLOADS_FOLDER = "downloads_folder" # Folder created for downloaded files
MIN_W_H = 50 # Minimum width/height for classifying images on a page
MAX_THREADS = 4 # Total threads to spin up for classifying images on a page
MAX_IMAGES_PER_PAGE = 15 # Limit of image classifi... | Python | 0.000001 | @@ -203,9 +203,9 @@
S =
-4
+3
#
|
749f5159eb14be492dc76624f03c3a3c863b4582 | add comment matching to sb regex | tellurium/teconverters/antimony_regex.py | tellurium/teconverters/antimony_regex.py | from __future__ import print_function, division, absolute_import
def getModelStartRegex():
""" Return the regex string for Antimony model start. Matches whole line. """
return r'^\s*\*?\s*model\s*[^()\s]+\s*(\([^)]*\))?\s*$'
def getFunctionStartRegex():
""" Return the regex string for Antimony model start... | Python | 0 | @@ -216,32 +216,39 @@
*(%5C(%5B%5E)%5D*%5C))?%5Cs*
+(//.*)?
$'%0A%0Adef getFunct
|
12afaf5e52d640379dd26e659ed20b488803a3aa | Bump version | oeem_energy_datastore/__init__.py | oeem_energy_datastore/__init__.py | from __future__ import absolute_import
from .celery import app as celery_app
__title__ = 'Open Energy Efficiency Meter Datastore'
__version__ = '0.1.1'
__author__ = 'Phil Ngo'
__license__ = 'MIT'
__copyright__ = 'Copyright 2011-2016 Open Energy Efficiency'
# Version synonym
VERSION = __version__
| Python | 0 | @@ -144,17 +144,17 @@
= '0.1.
-1
+2
'%0A__auth
|
b687d169b273f7804af4fe6ec2144ca82f3afc56 | FIX calcolo costo degli spostamenti | Backend/application/costi.py | Backend/application/costi.py | import datetime
NUMERO_SETTIMANE = 52
def calcolo_abitazione_costi(data):
#il dato puo' essere quello inserito dall'utente come
#costo dell'affitto, o quello calcolato come costo m^2*numero_m^2
return float(data["abitazione"]["cost_med"])*12
def calcolo_spostamenti_auto_costi(data):
costo = 0
try:
automobili ... | Python | 0.000001 | @@ -921,10 +921,8 @@
ANE*
-4*
(2*(
|
baf469bd3cebddd33952b37067a3dee7267f7649 | Add test for validating argparse works with tf.flags. | tensorflow/python/platform/flags_test.py | tensorflow/python/platform/flags_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0.000009 | @@ -835,16 +835,32 @@
nction%0A%0A
+import argparse%0A
import s
@@ -2642,11 +2642,440 @@
ain(
-_):
+argv):%0A # Test that argparse can parse flags that aren't registered%0A # with tf.flags.%0A parser = argparse.ArgumentParser()%0A parser.add_argument(%22--argparse_val%22, type=int, default=1000,%0A ... |
b2069b2b4a07d82cc6831dde0e396d7dae79d23e | Set an initial size and disallow resizing | autopidact/view.py | autopidact/view.py | from gi.repository import Gtk, GdkPixbuf, GLib
import cv2
class View(Gtk.Window):
def __init__(self, title, camera, interval=200):
Gtk.Window.__init__(self)
self.set_title(title)
self.cam = camera
self.img = Gtk.Image()
self.add(self.img)
GLib.timeout_add(interval, self.update)
def update(self):
if se... | Python | 0.000001 | @@ -178,16 +178,78 @@
(title)%0A
+%09%09self.set_size_request(640, 480)%0A%09%09self.set_resizable(False)%0A
%09%09self.c
|
79a88b1866227542731ff555925557fb22a900d4 | bump version to 0.2.10 | awsmfa/_version.py | awsmfa/_version.py | """0.2.9"""
VERSION = __doc__
| Python | 0 | @@ -4,9 +4,10 @@
0.2.
-9
+10
%22%22%22%0A
|
47a764c12a3c1882e93322e68bbc75469d5e9099 | Fix migration 001 | payload/db/sqlalchemy/migrate_repo/versions/001_add_initial_tables.py | payload/db/sqlalchemy/migrate_repo/versions/001_add_initial_tables.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 PolyBeacon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | Python | 0.000001 | @@ -2717,23 +2717,16 @@
ueue
-_member
s, queue
s%5D%0A%0A
@@ -2721,16 +2721,23 @@
s, queue
+_member
s%5D%0A%0A
@@ -2977,64 +2977,311 @@
-# Operations to reverse the above upgrade go here.%0A pass
+meta = MetaData()%0A meta.bind = migrate_engine%0A%0A agents = Table('agents', meta, autoload=True)... |
9404f91e913d16ec7473af05b0042c148218ea52 | keyword must be IN the word, not exaclty the word | mentio.py | mentio.py | from helpers import *
from re import compile as reg_compile
from traceback import format_exc as print_traceback
mentions = open_json_file("mentio", {}) # contains a list of keywords for each player (uuid)
max_amount = 3
arrow = colorify(u"&r&7\u2192&r")
colors_reg = reg_compile(u"\u00A7[\\da-fk-or]") # finds c... | Python | 0.999742 | @@ -1060,72 +1060,100 @@
-if word.lower() in keywords: # is the word in the keywords list%0A
+for keyword in keywords:%0A if keyword in word.lower(): # is the keyword mentioned%0A
|
8c624d5a03cfb37ac7280b7f99c025739dadfb7e | fix Python 2.7 compatibility | basil/TL/Serial.py | basil/TL/Serial.py | #
# ------------------------------------------------------------
# Copyright (c) All rights reserved
# SiLab, Institute of Physics, University of Bonn
# ------------------------------------------------------------
#
import logging
import serial
from basil.TL.TransferLayer import TransferLayer
logger = logging.getLog... | Python | 0.000003 | @@ -1651,32 +1651,46 @@
xcept TypeError:
+ # Python 2.7
%0A
@@ -1860,16 +1860,30 @@
peError:
+ # Python 2.7
%0A
@@ -1943,25 +1943,16 @@
mination
-, 'utf-8'
))%0A%0A
|
499ff491a6f2d6448ff8b5238c1182cdadea2876 | Fix logging | backdrop/collector/write.py | backdrop/collector/write.py | import datetime
import logging
import pytz
import requests
import json
class JsonEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
if obj.tzinfo is None:
obj = obj.replace(tzinfo=pytz.UTC)
return obj.isoformat()
return... | Python | 0.000007 | @@ -863,17 +863,18 @@
kdrop%5D %22
-,
+ +
respons
|
d393ecfc8298bc90388f82ce6d65d43922dd7378 | fix silly bug with datetime.now() | battle_notifier.py | battle_notifier.py | import logging
import json
import sys
import datetime as dt
import os
import time
from urllib.error import HTTPError
import slack_webhooks as slack
import worldoftanks_requests as wot
from itertools import dropwhile
from math import log2, ceil
class BattleNotifier:
def __init__(self, config_path='config.json', lo... | Python | 0.000001 | @@ -1052,16 +1052,19 @@
ow().min
+ute
== 0:%0A
@@ -1097,16 +1097,101 @@
eep(90)%0A
+ if dt.datetime.now().minute == 1:%0A time.sleep(30)%0A
|
4897e20f2c7ef665cef6418975cbb574e76678a2 | Remove file created when command fail | backup/mysqldump_command.py | backup/mysqldump_command.py | import subprocess
import os
from datetime import datetime
from backup.mysqldump_command_result import MysqlDumpCommandResult
class MysqlDumpCommand(object):
""" Represents a mysqldump command """
binary_root_path = '/usr/bin'
binary_name = 'mysqldump'
binary_path = os.path.join(binary_root_path... | Python | 0.000001 | @@ -1969,16 +1969,255 @@
nd_args)
+%0A %0A # Sometime, when the command failed, an empty dump file is created.%0A # If so, we need to delete this unused file.%0A if os.path.isfile(file_path) :%0A os.remove(file_path)
%0A
|
1cc36d42707a3f2ec7b52c91704a7eeb6e47163b | Tweak names to better represent param role. | behave/matchers.py | behave/matchers.py | from __future__ import with_statement
import re
import parse
from behave import model
class Matcher(object):
'''Pull parameters out of step names.
.. attribute:: string
The match pattern attached to the step function.
.. attribute:: func
The step function the pattern is being attached t... | Python | 0 | @@ -2203,19 +2203,21 @@
index,
-arg
+value
in enum
@@ -2350,19 +2350,21 @@
t:end%5D,
-arg
+value
))%0A
@@ -2376,19 +2376,21 @@
r name,
-arg
+value
in resu
@@ -2519,19 +2519,21 @@
t:end%5D,
-arg
+value
, name))
|
63a0e47e27c33027e0ba02b2a553853c12790321 | Add the key parameter when getting entries | base/modules/arp_handler.py | base/modules/arp_handler.py | """
CSIT test tools.
Authors: Baohua Yang@IBM, Denghui Huang@IBM
Updated: 2013-11-01
"""
import sys
sys.path.append('..')
from restlib import *
from testmodule import TestModule
sys.path.remove('..')
class ArpHandler(TestModule):
"""
Test for the arp handler.
Start 2-layer tree topology network. e.g., ... | Python | 0.000002 | @@ -929,16 +929,31 @@
subnets'
+,'subnetConfig'
)%0A%0A d
@@ -1704,9 +1704,8 @@
handler'
-%0A
|
867b45a5089b4c92f9f44eb77f85a792bbd3b55f | Handle properly escaped html tags. | obcy/management/commands/extras.py | obcy/management/commands/extras.py | from datetime import datetime
from html.parser import HTMLParser
import re
def compare(set1, set2):
len1 = len(set1)
len2 = len(set2)
if len1 < len2:
count = count_number(set1, set2)
else:
count = count_number(set2, set1)
if count / min(len1, len2) > 0.8:
return True
... | Python | 0 | @@ -23,16 +23,28 @@
atetime%0A
+import html%0A
from htm
@@ -1540,18 +1540,18 @@
.text =
-%22%22
+''
%0A%0A de
@@ -1604,16 +1604,96 @@
= data%0A%0A
+ def handle_entityref(self, name):%0A self.text += '&%7B%7D;'.format(name)%0A%0A
def
@@ -1723,16 +1723,30 @@
return
+html.unescape(
self.tex
@@... |
fb01aa54032b7ab73dcd5a3e73d4ece5f36517e2 | Add comment to explain pagination handling | locations/tasks.py | locations/tasks.py | from future.standard_library import install_aliases
install_aliases() # noqa
from urllib.parse import urlparse
from celery.task import Task
from django.conf import settings
from seed_services_client import IdentityStoreApiClient
from .models import Parish
class SyncLocations(Task):
"""
Has a look at all th... | Python | 0 | @@ -770,16 +770,90 @@
dentity%0A
+ # If there is a next page, extract the querystring and get it%0A
|
a9c8741e07e2eadfd0cdebcb51922e15209c740c | add LoadTestShape to __all__ in order to fix warning "'LoadTestShape' is not declared in __all__" raised by pycharm code->inspect | locust/__init__.py | locust/__init__.py | from gevent import monkey
monkey.patch_all()
from .user.sequential_taskset import SequentialTaskSet
from .user import wait_time
from .user.task import task, tag, TaskSet
from .user.users import HttpUser, User
from .user.wait_time import between, constant, constant_pacing
from .shape import LoadTestShape
from .event ... | Python | 0.000001 | @@ -557,16 +557,37 @@
vents%22,%0A
+ %22LoadTestShape%22,%0A
)%0A%0A# Use
|
c8fbf939d3a2d3d11eb54fc3b89eef1b546551a8 | add new program urls | main/urls.py | main/urls.py | from django.conf.urls import url
from django.contrib import admin
from . import views
app_name = 'main'
admin.site.site_header = 'OK!Thess administration'
urlpatterns = [
# /
url(r'^$', views.get_index, name='index'),
# /about/
url(r'^about/$', views.get_about, name='about'),
# /program/
ur... | Python | 0.000001 | @@ -325,24 +325,97 @@
%5Eprogram/$',
+ views.program_redir, name='program_redir'),%0A url(r'%5Eprogram/teams/$',
views.get_p
@@ -420,16 +420,22 @@
_program
+_teams
, name='
@@ -441,16 +441,185 @@
'program
+_teams'),%0A url(r'%5Eprogram/mentors/$', views.get_program_mentors, name='program_mentors'),%0A ur... |
89206879c447613d1c780de0be089b00eb187ed3 | Remove debugging code inadvertently left in place | filter_plugins/netaddr.py | filter_plugins/netaddr.py | # Copyright (c) 2017, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditio... | Python | 0 | @@ -1903,43 +1903,8 @@
dr)%0A
- import XXX%0A XXX.file(%22XXX%22)%0A
|
f8463f256df20ab2777cd2df65906305d834a11d | bring back DLSVolumePredictor unit test on small cells. The only way to bring this test <5 seconds is to reduce distance cutoff on small cells, which produces the same results in much less time. | pymatgen/analysis/structure_prediction/tests/test_volume_predictor.py | pymatgen/analysis/structure_prediction/tests/test_volume_predictor.py | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import os
from pymatgen.analysis.structure_prediction.volume_predictor import DLSVolumePredictor, \
RLSVolumePredictor
from pymatgen.util.testing import PymatgenTest
from pymatgen.core impor... | Python | 0 | @@ -3902,16 +3902,97 @@
dictor()
+%0A p_fast = DLSVolumePredictor(cutoff=0.0) # for speed on compressed cells
%0A%0A
@@ -4473,18 +4473,16 @@
%0A
- #
lfpo.sc
@@ -4505,18 +4505,16 @@
%0A
- #
self.as
@@ -4522,32 +4522,37 @@
ertAlmostEqual(p
+_fast
.predict(lfpo),
|
f1951b6b62ae2cd0e01683bb8e61c6628330258f | remove useless print.. | test/test_base.py | test/test_base.py | """Unit tests for git_credit.base."""
import os
import sys
import pytest
from mock import Mock, patch
from git_credit import base
@pytest.fixture(params=(
["fname"],
["fname", "/fake/dir/not/real"],
["fname", "/fake/dir/not/real", "/totes/fake/not/even/real"],
["fname", "/fake/dir",... | Python | 0 | @@ -702,48 +702,8 @@
:%5D:%0A
- print(%22testing %7B%7D%22.format(arg))%0A
|
6c3c03b4f9f1cd0f3fd23ebaddc007b162fdb1c2 | Update P2_phoneAndEmail.py changed pyperclip import to ATBS Ch8 | pythontutorials/books/AutomateTheBoringStuff/Ch07/P2_phoneAndEmail.py | pythontutorials/books/AutomateTheBoringStuff/Ch07/P2_phoneAndEmail.py | #! python3
"""Phone and email
Finds phone numbers and email addresses in the clipboard using :py:mod:`re` and
:py:mod:`pythontutorials.books.CrackingCodesWithPython.pyperclip`.
Attributes:
phoneRegex (re.compile): Regular expression object representing a phone number pattern.
emailRegex (re.compile): Regular ... | Python | 0 | @@ -376,16 +376,24 @@
%0Aimport
+re%0Afrom
pythontu
@@ -410,32 +410,43 @@
oks.
-CrackingCodesWithPython.
+AutomateTheBoringStuff.Ch08 import
pype
@@ -450,20 +450,16 @@
yperclip
-, re
%0A%0AphoneR
@@ -1411,54 +1411,8 @@
str(
-pythontutorials.books.CrackingCodesWithPython.
pype
@@ -1809,54 +1809,8 @@
-py... |
5123cf157375da497397a3a411edf0a2e0aaa161 | remove unused import statement | miapy/data/indexexpression.py | miapy/data/indexexpression.py | import typing as t
import pickle
# could maybe be replaced or wrapper with numpy.s_
class IndexExpression:
def __init__(self, indexing: t.Union[int, tuple, t.List[int], t.List[tuple]]=None,
axis: t.Union[int, tuple]=None) -> None:
self.expression = None
self.set_indexing(indexing... | Python | 0.000013 | @@ -16,22 +16,8 @@
s t%0A
-import pickle%0A
%0A%0A#
|
dacf30febca4a35d5cefe1ee9e8dad8e8d45b527 | FIX title for read filtering bar chart | rpbp/analysis/profile_construction/visualize_read_filtering_counts.py | rpbp/analysis/profile_construction/visualize_read_filtering_counts.py | #! /usr/bin/env python3
import argparse
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import seaborn as sns; sns.set(style='white')
import misc.mpl_utils as mpl_utils
import logging
import misc.logging_utils as logging_utils
logger = logging.getLogger(__name... | Python | 0 | @@ -2069,24 +2069,104 @@
ore_true')%0A%0A
+ parser.add_argument('--title', help=%22The title of the plot%22, default=None)%0A%0A
parser.a
@@ -4776,24 +4776,113 @@
.fontsize)%0A%0A
+ if args.title is not None:%0A ax.set_title(args.title, fontsize=args.fontsize)%0A%0A
msg = %22W
|
4cbd14f8bc4fdf919b9daea4bfd729e1cb84ff89 | Epublication dates; fix it | apps/references/autoref.py | apps/references/autoref.py | import os.path
import string
import urllib, re
from datetime import datetime
from xml.dom.minidom import parse, parseString
# Django
from django.core import serializers
from django.conf import settings
from django.db import models
# Methodmint
def pubmed(keywords, latest_query=None):
# Get matching publications f... | Python | 0.999982 | @@ -670,41 +670,29 @@
%25s%22%5B
-Date - Epub%5D : %223000%22%5BDate - Epub
+EPDAT%5D : %223000%22%5BEPDAT
%5D)'
|
7540dacd37bbeb2f7aeda1e6247505e4206a6bad | Fix isort/pylint | test/test_heap.py | test/test_heap.py | import copy, random, operator, pytest
from src.heap import Heap
class TestHeap:
def test_len_0(self):
h = Heap()
assert len(h) == 0
def test_len_1(self):
h = Heap([42])
assert len(h) == 1
def test_getitem_0(self):
with pytest.raises(IndexError):
Heap... | Python | 0.000002 | @@ -4,38 +4,28 @@
ort
-copy, random, operator, pytest
+pytest%0Aimport random
%0A%0Afr
@@ -49,16 +49,17 @@
t Heap%0A%0A
+%0A
class Te
|
24a9c7d2c3d09968962a8e29255f4cd75d39cea7 | The `color.ui` setting isn't a boolean | gitless/cli/gl.py | gitless/cli/gl.py | # -*- coding: utf-8 -*-
# Gitless - a version control system built on top of Git.
# Licensed under GNU GPL v2.
"""gl - Main Gitless's command. Dispatcher to the other cmds."""
from __future__ import unicode_literals
import argparse
import traceback
import pygit2
from sh import ErrorReturnCode
from clint.textui imp... | Python | 0.994077 | @@ -814,20 +814,17 @@
COLOR =
-not
+(
repo.con
@@ -830,28 +830,87 @@
nfig
-.get_bool('color.ui'
+%5B'color.ui'%5D in%0A %5B'false', '0', 'off', 'no', 'never'%5D
)%0Aex
|
dd2b0e2d29dd7e3af2e7b85de6d2674d16bcacfa | Remove Python 3.5 requirement in unittest. | test/test_util.py | test/test_util.py | # vim: set fileencoding=utf-8 :
from ykman.util import (b2len, derive_key, format_code, generate_static_pw,
hmac_shorten_key, modhex_decode, modhex_encode,
parse_tlvs, parse_truncated, time_challenge, Tlv)
import unittest
if not getattr(unittest.TestCase, 'assertRegex'... | Python | 0.000001 | @@ -1834,17 +1834,110 @@
UV%5D%7B
-%25d%7D$' %25 l
+' +%0A '%7B:d%7D'.format(l).encode('ascii') +%0A b'%7D$'
)%0A%0A
|
b2746eb257aaac7191781db71610073d6de9d0e3 | fix docstring for mocked_urls test helper | test/test_util.py | test/test_util.py | import contextlib
import os
import os.path
import re
import shutil
import tempfile
from httpretty import HTTPretty
import mock
def get_test_file_path(file_path):
"""translates a file path to be relative to the test files directory"""
return os.path.join(os.path.dirname(__file__), 'files', file_path)
@conte... | Python | 0.000001 | @@ -2194,21 +2194,8 @@
rls
-and matching
if t
@@ -2226,24 +2226,16 @@
will be
-%0A
used.%0A%0A
|
cfa85287e205d78da7c6a658d61f6708b6d34dbe | Format code | fcm_django/api/rest_framework.py | fcm_django/api/rest_framework.py | from django.db.models import Q
from rest_framework import permissions, status
from rest_framework.mixins import CreateModelMixin
from rest_framework.response import Response
from rest_framework.serializers import ModelSerializer, Serializer, ValidationError
from rest_framework.viewsets import GenericViewSet, ModelViewS... | Python | 0.000002 | @@ -3532,32 +3532,46 @@
alse%0A if
+(%0A
SETTINGS.get('UP
@@ -3567,17 +3567,17 @@
NGS.get(
-'
+%22
UPDATE_O
@@ -3598,16 +3598,28 @@
G_ID
-')
+%22)%0A
and
-'
+%22
regi
@@ -3629,17 +3629,17 @@
ation_id
-'
+%22
in requ
@@ -3646,16 +3646,26 @@
est.data
+%0A )
:%0A
@... |
e9f0b29993939e0855fe5bc5a1a1f417e6ca0497 | fix bug in weights | federatedml/framework/weights.py | federatedml/framework/weights.py | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 0.000001 | @@ -846,27 +846,37 @@
elf, weights
+, cls=None
):%0A
-
self
@@ -890,24 +890,48 @@
ts = weights
+%0A self._cls = cls
%0A%0A @prope
@@ -1039,22 +1039,24 @@
return
-Weight
+self._cl
s(self._
@@ -1162,32 +1162,32 @@
r_remote(self):%0A
-
return T
@@ -1218,16 +1218,32 @@
_weights
+, self... |
a5b4faa22c77e9b4aca334eba9938ef37ce68f87 | Add a second field to test with. | examples/forms.py | examples/forms.py | try:
import _path
except NameError:
pass
import spyral
import sys
SIZE = (640, 480)
BG_COLOR = (0, 0, 0)
class Game(spyral.Scene):
"""
A Scene represents a distinct state of your game. They could be menus,
different subgames, or any other things which are mostly distinct.
A Scene should d... | Python | 0 | @@ -1495,16 +1495,139 @@
(30,30)%0A
+ email_entry = spyral.TextInputWidget('acbart@vt.edu', style=spyral.FormStyle())%0A email_entry.pos = (30, 60)%0A
@@ -1831,16 +1831,92 @@
_entry)%0A
+ form.add_widget(%22email_entry%22,%0A email_entry)%0A
|
e0665dd33ee3953e1e20a9115c86210e5b6fcd32 | Update __init__.py | miniprobe/sensors/__init__.py | miniprobe/sensors/__init__.py | __all__ = ['Ping', 'HTTP', 'Port', 'SNMPCustom', 'CPULoad', 'Memory', 'Diskspace', 'SNMPTraffic', 'CPUTemp', 'Probehealth', 'ExternalIP', 'ADNS', 'APT', 'NMAP']
| Python | 0.000072 | @@ -152,10 +152,19 @@
, 'NMAP'
+, 'MDADM'
%5D%0A
|
6e260ea961201a8ee9bdae40a9b2af3665fb612a | Add end of test message in stop_acquisition | misura/canon/milang/objenv.py | misura/canon/milang/objenv.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Misura Language or Mini Language.
Secure minimal Python language subset for conditional evaluation of numerical datasets."""
import exceptions
from dataenv import DataEnvironment
class InterfaceEnvironment(DataEnvironment):
"""Interface object providing access to a... | Python | 0.000002 | @@ -71,17 +71,16 @@
anguage.
-
%0ASecure
@@ -694,17 +694,16 @@
nteface.
-
%0A
@@ -2369,16 +2369,42 @@
obj = r%0A
+ ie.hdf = self.hdf%0A
@@ -2502,16 +2502,20 @@
lf,
+mes
sa
-ve=Tru
+ge=Fals
e):%0A
@@ -2742,13 +2742,54 @@
root
-.set(
+%5B'endStatus'%5D = message%0A self.obj.roo... |
2eae046dfc311fe81a46ac3da250450440eae63f | Fix test case. | test/services/appmanager/test_service.py | test/services/appmanager/test_service.py | import os
import time
import requests
from weavelib.http import AppHTTPServer
from weavelib.messaging import Receiver
from weavelib.rpc import RPCServer, ServerAPI, RPCClient
from weavelib.services import BaseService
from weaveserver.core.services import ServiceManager
from weaveserver.services.appmanager import Appl... | Python | 0.000011 | @@ -892,26 +892,33 @@
ttp.
-add_url
+register_folder
(%22test
-.json
+_dir
%22)%0A%0A
@@ -2171,16 +2171,21 @@
+base_
url = %22h
@@ -2240,24 +2240,25 @@
ive_url%0A
+%0A
assert r
@@ -2253,61 +2253,352 @@
-assert requests.get(url).json() == %7B%22hello%22: %22world%22%7D
+url = base_url + %... |
69dedf2096fe61813f9732dbe1d74deea0b208ff | fix first pixel when negative | examples/ratio.py | examples/ratio.py | #!/usr/bin/env python
"""
Stacks boss spectra.
"""
import argparse
import numpy as np
import h5py
import qusp
import itertools
def main():
# parse command-line arguments
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("-i", "--input",... | Python | 0.998852 | @@ -3030,33 +3030,33 @@
combined.npixels
--
++
first_pixel, alt
|
d19cc9677e570969b8cab73c0dd03ebeb3959c70 | Make database creation on intialization optional | flask_influxdb/flask_influxdb.py | flask_influxdb/flask_influxdb.py | import influxdb
from flask import current_app, _app_ctx_stack, Flask
from flask.globals import _app_ctx_err_msg
from typing import Generator
_no_influx_msg = """\
No Influx connection is present.
This means that something has overwritten _app_ctx_stack.top.influxdb_db.
"""
class InfluxDB(object):
def __init__(s... | Python | 0 | @@ -1432,16 +1432,80 @@
ZE%22, 10)
+%0A app.config.setdefault(%22INFLUXDB_CREATE_DATABASE%22, True)
%0A%0A
@@ -1633,16 +1633,85 @@
ABASE%22%5D%0A
+ create_database = app.config%5B%22INFLUXDB_CREATE_DATABASE%22%5D%0A
@@ -1729,32 +1729,52 @@
base is not None
+ and create_database
:%... |
9f9bf9b9cccd2e39c3d567d4768d03c1a4a2c4b1 | Remove description key as it's already on README.rst | account_due_list/__openerp__.py | account_due_list/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# Copyright (C) 2011-2013 Agile Business Group sagl
# (<http://www.agilebg.com>)
# @author Jordi Esteve <jesteve@zikzakmedia.com>
# @autho... | Python | 0 | @@ -1420,167 +1420,8 @@
t',%0A
- 'description': %22%22%22%0AA due list of pending payments. The list contains every expected payment,%0Agenerated by invoices. The list is fully filterable.%0A %22%22%22,%0A
|
4832123a1c418b02b7261c0956892bcc2b0dcef4 | Create products not shared in correct context | product_multi_company/tests/common.py | product_multi_company/tests/common.py | # Copyright 2015-2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2021 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
class ProductMultiCompanyCommon(object):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env... | Python | 0 | @@ -940,32 +940,60 @@
cls.product_obj.
+with_company(cls.company_1).
create(%0A
@@ -1172,32 +1172,60 @@
cls.product_obj.
+with_company(cls.company_2).
create(%0A
|
2696e71ac88276a2291732d98caade883ea8963e | clean up | external/score.py | external/score.py | import cPickle as pickle
import os
import sys
sys.path.append('../../coco-caption')
sys.path.append('../coco-caption')
from pycocoevalcap.bleu.bleu import Bleu
from pycocoevalcap.rouge.rouge import Rouge
from pycocoevalcap.cider.cider import Cider
from pycocoevalcap.meteor.meteor import Meteor
def get_score(ref, hypo)... | Python | 0.000001 | @@ -1,12 +1,86 @@
+# see https://github.com/tylin/coco-caption/%0A# standard evaluation code%0A#%0A
import cPick
|
cf2fa1ef4c2f7b4677cbd17202d6703cdcc8cc0d | Use optparse style argument parsing. Implement a 'wait-for-pid' option on xsend, to delay sending a message until after the specified process id exits | benderjab/xsend.py | benderjab/xsend.py | #!/usr/bin/env python
#
# Copyright 2007 Diane Trout
# This software is covered by the GNU Lesser Public License 2.1
#
import os
import random
import sys
import time
import xmpp
from xmpp import simplexml
from benderjab.util import get_config, toJID
def connect(profile=None):
"""
Connect to the server for our ja... | Python | 0 | @@ -112,16 +112,32 @@
e 2.1%0A#%0A
+import optparse%0A
import o
@@ -1850,157 +1850,908 @@
t()%0A
- %0Adef main(args=None):%0A if args is None:%0A args = sys.argv%0A%0A if len(args) %3C 2:%0A print %22Syntax: xsend JID text%22%0A return 1
+%0Adef wait_for_pid(pid, timeout=10):%0A %22%... |
e9fc291faca8af35398b958d046e951aa8471cbf | Fix broken test since models new default ordering | apps/core/tests/test_factories.py | apps/core/tests/test_factories.py | from .. import factories
from . import CoreFixturesTestCase
class AnalysisFactoryTestCase(CoreFixturesTestCase):
def test_new_factory_with_Experiments(self):
experiments = factories.ExperimentFactory.create_batch(3)
# build
analysis = factories.AnalysisFactory.build(experiments=experime... | Python | 0.000002 | @@ -17,16 +17,24 @@
actories
+, models
%0Afrom .
@@ -502,26 +502,8 @@
ds =
- list(%0A
ana
@@ -532,16 +532,29 @@
es_list(
+%0A
'id', fl
@@ -560,17 +560,16 @@
lat=True
-)
%0A
@@ -610,78 +610,163 @@
s =
-%5Be.id for e in experiments%5D%0A self.assertEqual(experiments_ids,
... |
c2f9f17894e7980e6ea57397f0cb0c13480d205e | Version bump for release 0.2.3 | bespin/__init__.py | bespin/__init__.py | VERSION="0.2.2"
| Python | 0 | @@ -6,11 +6,11 @@
ON=%220.2.
-2
+3
%22%0A
|
bd0f94b8a1af1f4232c7dbc09aa0bb32bf431d80 | check that multiline string literals don't expand as magic | IPython/core/tests/test_prefilter.py | IPython/core/tests/test_prefilter.py | """Tests for input manipulation machinery."""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import nose.tools as nt
from IPython.testing import tools as tt, decorators as dec
#-------------------... | Python | 0 | @@ -291,16 +291,68 @@
s as dec
+%0Afrom IPython.testing.globalipapp import get_ipython
%0A%0A#-----
@@ -1177,17 +1177,16 @@
rrect)%0A%0A
-%0A
@dec.par
@@ -1583,17 +1583,318 @@
ns%5B'f'%5D%0A
-
+%0A@dec.parametric%0Adef test_issue114():%0A %22%22%22Check that multiline string literals don't expand as mag... |
c5a9d65e37b98c894f42287f3ca3adefa7cc9457 | remove folder contents not folder itself | perfrunner/utils/cluster.py | perfrunner/utils/cluster.py | from optparse import OptionParser
from fabric.api import run
from perfrunner.helpers import Helper
from perfrunner.helpers.rest import RestHelper
from perfrunner.helpers.remote import RemoteHelper, all_hosts
class ClusterManager(Helper):
def __init__(self, cluster_spec, test_config):
super(ClusterManag... | Python | 0.000001 | @@ -541,16 +541,18 @@
-fr %7B0%7D
+/*
'.format
|
ae99f3b3e2dae482292492ae1ddab512549f2e7b | Improve formatting (attempt 2) | mopidy_alarmclock/__init__.py | mopidy_alarmclock/__init__.py | import os
from mopidy import config, ext
from .alarm_manager import AlarmManager
from .http import MessageStore, factory_decorator
__version__ = '0.1.7'
class Extension(ext.Extension):
dist_name = 'Mopidy-AlarmClock'
ext_name = 'alarmclock'
version = __version__
def get_default_config(self):
... | Python | 0.000001 | @@ -3,16 +3,17 @@
port os%0A
+%0A
from mop
|
e91c634c654addef2f306f756373d474f60c9910 | Fix division by zero in ProgressBar | permuta/misc/progressbar.py | permuta/misc/progressbar.py | import time
import sys
import math
class ProgressBar(object):
@staticmethod
def create(mx, mn=0):
ProgressBar.mn = mn
ProgressBar.mx = mx
ProgressBar.at = mn
ProgressBar.start = time.time()
ProgressBar.last = 0
sys.stderr.write('\n')
ProgressBar.progress... | Python | 0.000011 | @@ -733,16 +733,59 @@
prog =
+ 1 if ProgressBar.mn == ProgressBar.mx else
float(p
@@ -859,55 +859,8 @@
rs =
- width if ProgressBar.mn == ProgressBar.mx else
int
|
1726295eab3de3759729d18d17fdbe0baba77c40 | Enable easier import | mousetracking/hpc/__init__.py | mousetracking/hpc/__init__.py | Python | 0 | @@ -0,0 +1,30 @@
+from slurm import SlurmProject
| |
96f9d8828934f61c4f1a623b7feecb9712dc83ea | Add id of Antorus raid. | battlenet/enums.py | battlenet/enums.py | RACE = {
1: 'Human',
2: 'Orc',
3: 'Dwarf',
4: 'Night Elf',
5: 'Undead',
6: 'Tauren',
7: 'Gnome',
8: 'Troll',
9: 'Goblin',
10: 'Blood Elf',
11: 'Draenei',
22: 'Worgen',
24: 'Pandaren',
25: 'Pandaren',
26: 'Pandaren',
}
CLASS = {
1: 'Warrior',
2: 'Palad... | Python | 0 | @@ -1528,13 +1528,19 @@
25, 8524
+, 8638
),%0A%7D%0A
|
2eaca459e2c79bd07b3c27c21bc69384f9430612 | make MAILGUN_* environment vars optional | mysite/deployment_settings.py | mysite/deployment_settings.py | # This settings file contains custom settings used for the
# main OpenHatch deployment.
#
# The live site needs some slightly different settings.
#
# So we start by loading the settings module in the same directory...
from settings import *
# ...and then we override some values.
DATABASES = {'default': dj_database_url... | Python | 0 | @@ -2559,33 +2559,37 @@
OST = os.environ
-%5B
+.get(
'MAILGUN_SMTP_SE
@@ -2593,17 +2593,30 @@
_SERVER'
-%5D
+, '127.0.0.1')
%0AEMAIL_P
@@ -2623,33 +2623,37 @@
ORT = os.environ
-%5B
+.get(
'MAILGUN_SMTP_PO
@@ -2655,17 +2655,21 @@
TP_PORT'
-%5D
+, 25)
%0AEMAIL_H
@@ -2681,33 +2681,37 @@
SER = os.environ
-%5B
+.ge... |
50c91595f47b323081dfc44d9fdf16fbc4ba6f59 | add comment | nba_data/data/season_range.py | nba_data/data/season_range.py | from nba_data.data.season import Season
class SeasonRange:
def __init__(self, start, end):
assert isinstance(start, Season)
assert isinstance(end, Season)
self.start = start
self.end = end
| Python | 0 | @@ -34,16 +34,75 @@
Season%0A%0A
+# TODO: @jbradley add assertions to compare start and end%0A%0A
%0Aclass S
|
12e0d117554cb9aa0c0ebf61fe3b1e71a7f9c19a | Convert image from RGB color space to CMYK and split the channels. | plantcv/plantcv/__init__.py | plantcv/plantcv/__init__.py | import os
import matplotlib
from plantcv.plantcv.fatal_error import fatal_error
from plantcv.plantcv.classes import Params
from plantcv.plantcv.classes import Outputs
from plantcv.plantcv.classes import Spectral_data
# Initialize an instance of the Params and Outputs class with default values
# params and outputs are a... | Python | 0.000023 | @@ -697,16 +697,72 @@
ray_lab%0A
+from plantcv.plantcv.rgb2gray_cmyk import rgb2gray_cmyk%0A
from pla
@@ -5043,16 +5043,33 @@
ay_lab',
+ 'rgb2gray_cmyk',
%0A
|
52138e9ea4bcc0c2136293769f0743ae01e4ac87 | change latex representation of Jupiter from Jup to J | astropy/units/astrophys.py | astropy/units/astrophys.py | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package defines the astrophysics-specific units. They are also
available in the `astropy.units` namespace.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
... | Python | 0 | @@ -2170,19 +2170,21 @@
': r'M_%7B
-Jup
+%5Crm J
%7D', 'uni
|
98cec4827160ec668c309692eddbcdad78b1baa5 | Fix Django 1.7 call with `get_model(.., only_installed=False)` | fluent_blogs/models/db.py | fluent_blogs/models/db.py | from django.conf import settings
from django.db import models
from django.db.models import get_model
from django.utils.translation import ugettext_lazy as _
from fluent_blogs.base_models import CommentsEntryMixin, AbstractTranslatableEntry, AbstractTranslatedFieldsEntry
from fluent_blogs import appsettings
class Entr... | Python | 0.000037 | @@ -1,20 +1,34 @@
+import django%0A
from django.conf imp
@@ -2265,24 +2265,67 @@
lit('.', 1)%0A
+ if django.VERSION %3C (1.7):%0A
@@ -2393,16 +2393,98 @@
=False)%0A
+ else:%0A _EntryModel = get_model(app_label, model_name)%0A%0A
|
fcf8fa3368386dee3ede4575f58aa9cb57cb0649 | bump to 0.8.3 | feaas/__init__.py | feaas/__init__.py | # Copyright 2014 varnishapi authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__version__ = "0.8.2"
| Python | 0.000084 | @@ -173,11 +173,11 @@
= %220.8.
-2
+3
%22%0A
|
e9e264301bb8b4ccfe5b23a32c3e361cc140cdba | Make more power-keys available | atomic/electron_cooling.py | atomic/electron_cooling.py | import numpy as np
import matplotlib.pyplot as plt
from .atomic_data import ZeroCoefficient
from .radiation import Radiation
from functools import reduce
# This class is almost a copy of Radiation; only
# _get_staging_coeffs / _get_power_coeffs and _compute_power are different.
class ElectronCooling(object):
"""
... | Python | 0.000004 | @@ -2208,37 +2208,89 @@
-for k in 'rad_total', 'total'
+specific_power = self.specific_power%0A for k in list(specific_power.keys())
:%0A
@@ -2308,21 +2308,16 @@
ps%5Bk%5D =
-self.
specific
@@ -5226,16 +5226,154 @@
ad_total
+%0A cooling_power%5B'ionisation'%5D = staging_power%5B'ionisation'%5... |
a484f7140a8c02db300f66c295ebe2fc5b62baba | read tks with h, b, j | femagtools/tks.py | femagtools/tks.py | """
femagtools.tks
~~~~~~~~~~~~~~
Manage TKS magnetizing curve data files
"""
import sys
import numpy as np
import os
import re
import codecs
import femagtools.losscoeffs as lc
import femagtools.mcv
import json
import logging
logger = logging.getLogger(__name__)
MUE0 = 4e-7*np.pi # 1.2566371E-06
fo =... | Python | 0.000033 | @@ -1752,54 +1752,10 @@
-if 'J(T)' in l:%0A h, b,
+hb
j =
@@ -1782,89 +1782,8 @@
:%5D)%0A
- else:%0A h, b = readlist(content%5Bi+1:%5D)%0A
@@ -1821,16 +1821,21 @@
hi'%5D = h
+bj%5B0%5D
%0A
@@ -1869,17 +1869,22 @@
'bi'%5D =
-b
+h... |
00098eba6daca0a0655f703dd5becee2f5dcbaf6 | fix ' ' print | corpkit/textprogressbar.py | corpkit/textprogressbar.py | #!/usr/bin/python
from __future__ import print_function
class TextProgressBar:
"""a text progress bar for CLI operations
no need for user to call"""
from time import localtime, strftime
try:
from IPython.display import display, clear_output
have_ipython = True
except ImportError... | Python | 0.999996 | @@ -1157,17 +1157,16 @@
', end='
-
')%0A
|
bab3bfb70a1da30134a0e020be31257f08a2e709 | Remove a vestige of the old zeromq implementation where we specified a callback port as a decorated parameter to the overall test case | awx/api/tests/job_tasks.py | awx/api/tests/job_tasks.py | # Copyright (c) 2014 Ansible, Inc.
# All Rights Reserved.
from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
from django.test.utils import override_settings
from rest_framew... | Python | 0 | @@ -610,54 +610,8 @@
ue,%0A
- CALLBACK_CONSUMER_PORT='',%0A
|
ff6460b92e1baf5e1ca955fd6593230fda0e8cd6 | Fix IRC message parameter escape | nemubot/server/message/IRC.py | nemubot/server/message/IRC.py | # Nemubot is a smart and modulable IM bot.
# Copyright (C) 2012-2015 Mercier Pierre-Olivier
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... | Python | 0.000008 | @@ -6082,17 +6082,17 @@
f arg%5B0:
-1
+2
%5D == '%5C%5C
|
8d67f4ab225165ea25df1a66e34904e8210c4cc6 | Change round to _round | backend/breach/strategy.py | backend/breach/strategy.py | from django.utils import timezone
from django.db.models import Max
from breach.analyzer import decide_next_world_state
from breach.models import SampleSet, Round
from breach.sniffer import Sniffer
SAMPLES_PER_SAMPLESET = 100
class Strategy(object):
def __init__(self, victim):
self._victim = victim
... | Python | 0.999992 | @@ -5071,32 +5071,33 @@
alphabet': self.
+_
round.knownalpha
@@ -5133,16 +5133,17 @@
': self.
+_
round.kn
|
ae464d02a71c4d7e6c1fa4d13b5948b65f4a02aa | Use staticfiles storage again | backend/settings/common.py | backend/settings/common.py | """
Django settings for project on Heroku. For more info, see:
https://github.com/heroku/heroku-django-template
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
i... | Python | 0 | @@ -4063,18 +4063,16 @@
enoise/%0A
-#
STATICFI
|
1bc24b6c12abe64345dd4550c5bb791c3037be40 | test commit from mac | src/mainloop.py | src/mainloop.py | '''
Line added from chromebook
Outline of the algorithm
# get the parameters from the input file, and store them as nested dictionaries
parameters_parser = ParametersParser(path_to_input_file)
dict_of_parameters = parameters_parser.parse()
# create objects that will be used throughout the search by passing the appro... | Python | 0 | @@ -1,35 +1,8 @@
'''%0A
-Line added from chromebook%0A
Outl
|
acbbbec99b1edf1806bb27fef3d0faf6a41775d6 | Populate proper inputs/outputs from block | nio_cli/commands/buildspec.py | nio_cli/commands/buildspec.py | import json, os, sys
from collections import OrderedDict
from nio.block.base import Block
from nio.util.discovery import is_class_discoverable as _is_class_discoverable
from niocore.core.loader.discover import Discover
from .base import Base
def is_class_discoverable(_class, default_discoverability=True):
return ... | Python | 0.999999 | @@ -212,16 +212,71 @@
iscover%0A
+from nio.block.terminals import Terminal, TerminalType%0A
from .ba
@@ -3682,32 +3682,173 @@
)%5B%22properties%22%5D%0A
+ # *********WORKS********* #%0A # print('@@@@@@@@@@@', block.outputs()%5B1%5D.get_description())%0A # *********************** #%0A
bl... |
9d6d3c5a6f72253eef94fc73f47a61e12ef622a1 | tweak posizioni badge | documents/badge/pycon5/conf.py | documents/badge/pycon5/conf.py | # -*- coding: UTF-8 -*-
from PIL import Image, ImageFont
_FONT_INFO = 'Ubuntu-Title.ttf'
_FONT_NAME = 'Ubuntu-Title.ttf'
_FONTS = {
'name': ImageFont.truetype(_FONT_NAME, 20 * 8),
'name_small': ImageFont.truetype(_FONT_NAME, 15 * 8),
'info': ImageFont.truetype(_FONT_INFO, 6 * 8),
}
PY_LOGO = {
'all': I... | Python | 0 | @@ -2446,19 +2446,16 @@
else:
-
%0A
@@ -2743,17 +2743,17 @@
= 460, 5
-4
+6
0%0A el
@@ -2804,17 +2804,17 @@
me_y = 5
-5
+0
0, 680%0A%0A
|
04f584ff8a6d71ef8e6397aed297eb517eb814d1 | no sqlite3 formspypersona | apps/atencion/forms/PersonaForm.py | apps/atencion/forms/PersonaForm.py | from django import forms
from crispy_forms.helper import FormHelper, Layout
from crispy_forms.layout import Field, Div, Row, HTML
from crispy_forms.bootstrap import FormActions, TabHolder, Tab
from django.utils.translation import ugettext_lazy as _
from apps.utils.forms import smtSave, btnCancel, btnReset
from django.u... | Python | 0.998876 | @@ -550,26 +550,16 @@
('edad',
-'distrito'
)%0A
|
9a470f41174c617787a8f06e003709f1f7ba6310 | Update file.py | apps/bigdata/file_download/file.py | apps/bigdata/file_download/file.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import numpy as np
import json
import time
import datetime
import os.path
import sys
def inputfile_chck(fname):
if os.path.isfile('./'+_internet_file_name_):
with open("./"+_internet_file_name_) as data_file:
data = json.load(data_file)
... | Python | 0.000001 | @@ -41,16 +41,61 @@
-8 -*-%0A%0A
+# Author : https://github.com/jeonghoonkang%0A%0A
import n
|
fa64140abdbaaff15b11ef3310fb0ea41762bd9e | Test refct | numba/tests/test_dyn_array.py | numba/tests/test_dyn_array.py | from __future__ import print_function, absolute_import, division
import numpy as np
from numba import unittest_support as unittest
from numba import njit
class TestDynArray(unittest.TestCase):
def test_empty_1d(self):
@njit
def foo(n):
arr = np.empty(n)
for i in range(n):... | Python | 0.000001 | @@ -59,16 +59,27 @@
vision%0A%0A
+import sys%0A
import n
@@ -3365,35 +3365,164 @@
-cfunc = njit(pyfunc
+initrefct = sys.getrefcount(arr)%0A%0A cfunc = njit(pyfunc)%0A got = cfunc(arr)%0A self.assertEqual(initrefct + 1, sys.getrefcount(arr)
)%0A
@@ -3526,33 +3526,34 @@
expec... |
28749b35e5e4241c744256a7d64fc696bf4eac97 | Remove debug print. | apps/package/handlers/launchpad.py | apps/package/handlers/launchpad.py | import os
from django.conf import settings
from launchpadlib.launchpad import Launchpad
from package.handlers.base_handler import BaseHandler
class LaunchpadHandler(BaseHandler):
title = 'Launchpad'
url = 'https://code.launchpad.net'
user_url = 'https://launchpad.net/~%s'
repo_regex = r'https://code... | Python | 0.000001 | @@ -728,54 +728,8 @@
name
-%0A print %22DEBUG: repo_name =%22, repo_name
%0A%0A
|
db86d691f4fe4693173fd5c3026586b766ab8f9c | remove unecessary functions | src/mod_imap.py | src/mod_imap.py | '''
Created on Jan 6, 2012
@author: guillaume.aubert@gmail.com
Contains the class monkey patching IMAPClient and imaplib
'''
import zlib
import time
import imaplib #for the exception
from imapclient import IMAPClient
#monkey patching add compress in COMMANDS of imap
imaplib.Commands['COMPRESS'] = ('AUTH', 'SELECTE... | Python | 0.998294 | @@ -2476,372 +2476,8 @@
ata)
-%0A %0A%0Adef datetime_to_imap(dt):%0A %22%22%22Convert a datetime instance to a IMAP datetime string.%0A %0A If timezone information is missing the current system%0A timezone is used.%0A %22%22%22%0A #if not dt.tzinfo:%0A # dt = dt.replace(tzinfo=FixedOffse... |
f8589bd46b61a37f646d6a2021c74d3c1d21af61 | Add new leak | dom/automation/detect_leaks.py | dom/automation/detect_leaks.py | #!/usr/bin/env python
def ath(array):
hash = {}
for s in array:
hash[s] = True
return hash
knownHash = ath([
# bug 391976
"nsMathMLContainerFrame",
"nsMathMLmtableOuterFrame",
"nsMathMLmtdInnerFrame",
"nsMathMLmactionFrame",
# Bug 398462
"nsBaseAppShell",
"nsRunnable",
# Bug 403199
"nsSimpleN... | Python | 0 | @@ -820,24 +820,56 @@
Resolver%22,%0A%0A
+# Bug 470418%0A%22nsStyleContext%22,%0A%0A
# Bug 424418
|
17e8ead8cc1950779dca5614d24fc89f6606de9c | Remove unnecessary print from get_tlds | domain_parser/domain_parser.py | domain_parser/domain_parser.py | """Parses a URL using the publicsuffix.org TLD list."""
try:
import cPickle as pickle
except:
import pickle
import urllib2
from urlparse import urlparse
TLD_URL = 'https://publicsuffix.org/list/effective_tld_names.dat'
def get_tlds():
"""Return a list of top-level domains as maintained by Mozilla and
... | Python | 0 | @@ -975,50 +975,8 @@
e)%0A%0A
- import pprint%0A pprint.pprint(tlds)%0A
|
c6b633a1afa0b41b40819d55a4465c2bd26a0f87 | set computing element once job is submitted | pandaharvester/harvestermonitor/act_monitor.py | pandaharvester/harvestermonitor/act_monitor.py | from pandaharvester.harvestercore import core_utils
from pandaharvester.harvestercore.work_spec import WorkSpec
from pandaharvester.harvestercore.plugin_base import PluginBase
from act.common.aCTConfig import aCTConfigARC
from act.atlas.aCTDBPanda import aCTDBPanda
# logger
baseLogger = core_utils.setup_logger('act_m... | Python | 0 | @@ -1183,32 +1183,52 @@
', 'pandastatus'
+, 'computingElement'
%5D%0A
@@ -2365,16 +2365,140 @@
tatus))%0A
+%0A if actjobs%5B0%5D%5B'computingElement'%5D:%0A workSpec.computingElement = actjobs%5B0%5D%5B'computingElement'%5D%0A%0A
|
04eb362b245103f7c65bfb22a3b7bb64d0f87b59 | Fix get_image_name for light chutes. | paradrop/daemon/paradrop/core/chute/service.py | paradrop/daemon/paradrop/core/chute/service.py | class Service(object):
"""
A service is a long-running process that provides chute functionality.
"""
def __init__(self,
chute=None,
name=None,
type="normal",
image=None,
command=None,
dockerfile=None,... | Python | 0 | @@ -1660,77 +1660,200 @@
-if self.image is not None:%0A return self.image%0A else
+# Light chute services have a shorthand image name like %22python2%22 that%0A # should not be interpreted as an actual Docker image name.%0A if self.image is None or self.type == %22light%22
:%0A
... |
c4753b200359774aff966c4e47ba67b176f80dc3 | add missing sys import | pip/backwardcompat/socket_create_connection.py | pip/backwardcompat/socket_create_connection.py | """
patch for py25 socket to work with http://pypi.python.org/pypi/ssl/
copy-paste from py2.6 stdlib socket.py
https://gist.github.com/zed/1347055
"""
import socket
_GLOBAL_DEFAULT_TIMEOUT = getattr(socket, '_GLOBAL_DEFAULT_TIMEOUT', object())
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
... | Python | 0.000007 | @@ -157,16 +157,27 @@
t socket
+%0Aimport sys
%0A%0A_GLOBA
|
b578a944fcccff0598de8b05f62bda68a0dd04bc | Debug on and shit. | base/settings/production.py | base/settings/production.py | # -*- coding: utf-8 -*-
import os
import sys
from celery.schedules import crontab
from configurations import values
from postgresify import postgresify
from redisify import redisify
from .base import Base as Settings
class Production(Settings):
# Installed Applications (featuring Production).
# ------------... | Python | 0 | @@ -1284,20 +1284,19 @@
anValue(
-Fals
+Tru
e)%0A%0A
|
e444dcc3abd0d5e9fa04f63314b847a0c087ce38 | remove uneeded helpers, change method name to something more suitable | moviemood.py | moviemood.py | from uuid import uuid4
from telegram.ext import Updater, InlineQueryHandler, CommandHandler
from telegram.ext import MessageHandler, Filters
from telegram import InlineQueryResultPhoto, InputTextMessageContent
import logging
import config
# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelnam... | Python | 0 | @@ -811,26 +811,26 @@
')%0A%0Adef
-ghostworld
+justkillme
(bot, up
@@ -1985,121 +1985,8 @@
rs%0A%0A
-echo_handler = MessageHandler(%5BFilters.text%5D, echo)%0Acaps_handler = CommandHandler('caps', caps, pass_args=True)%0A%0A
upda
@@ -2368,31 +2368,31 @@
er('
-ghostworld', ghostworld
+justkillme', justkillme
))%0... |
fdd5b05a18f9ff32f161495fd86454a6796272a8 | version bump to 0.0.4 | pagesext/__init__.py | pagesext/__init__.py | VERSION = (0, 0, 3)
def get_version():
"""Returns the version as a human-format string."""
return '.'.join([str(i) for i in VERSION])
__author__ = 'dlancer'
__docformat__ = 'restructuredtext en'
__copyright__ = 'Copyright 2015, dlancer'
__license__ = 'BSD'
__version__ = get_version()
__maintainer__ = 'dlance... | Python | 0.000001 | @@ -14,9 +14,9 @@
0,
-3
+4
)%0A%0A%0A
|
8d3ffefe6c72f5d143d6b5a1bba6177f03bfc4f2 | clean up, do ties | 2018/23b.py | 2018/23b.py | #!/usr/bin/env python2
# z3 might have python 3 bindings but they weren't on my laptop from
# the install of z3 left over from grad school so back to python 2 it
# is!
from __future__ import print_function
from z3 import *
import sys
sys.setrecursionlimit(3000)
from collections import defaultdict, deque
import sy... | Python | 0 | @@ -1075,106 +1075,243 @@
-cost = Int('cost')%0A opt.add(cost == cost_expr)%0A print(%22let's go%22)%0A h =
+print(%22let's go%22)%0A opt.maximize(cost_expr)%0A # I didn't do this step in my initial #2 ranking solution but I%0A # suppose you should.%0A # z3 does them lexicographically by defa... |
11e6879d5f6d35687dd2b3d8053c406dc49f1d75 | update version | grizli/version.py | grizli/version.py | # git describe --tags
__version__ = "0.6.0-46-g0580c1c"
| Python | 0 | @@ -40,17 +40,17 @@
6.0-
-46-g0580c1
+52-gdb6bc8
c%22%0A
|
53415c4f8aabb70e83ea59d4e35ad2c3ee57f905 | add xlim for the lod figure | asmvar/vqsr/VariantRecalibrator.py | asmvar/vqsr/VariantRecalibrator.py | """
===============================================
===============================================
Author: Shujia Huang
Date : 2014-05-23 11:21:53
"""
import sys
import matplotlib.pyplot as plt
# My own class
import VariantDataManager as vdm
import VariantRecalibratorEngine as vre
import VariantRecalibratorArgumentC... | Python | 0.000001 | @@ -3912,16 +3912,42 @@
0, 1.0)%0A
+ plt.xlim(-10, 10)%0A
|
d877463818b7a88d50cc3e71552c2919b32e3206 | add object_search to WATCHED_REPOS | mc/config.py | mc/config.py | GITHUB_SIGNATURE_HEADER = 'X-Hub-Signature'
GITHUB_SECRET = 'redacted'
GITHUB_COMMIT_API = 'https://api.github.com/repos/adsabs/{repo}/git/commits/{hash}'
GITHUB_TAG_FIND_API = 'https://api.github.com/repos/adsabs/{repo}/git/refs/tags/{tag}'
GITHUB_TAG_GET_API = 'https://api.github.com/repos/adsabs/{repo}/git/tags/{has... | Python | 0.000009 | @@ -653,16 +653,36 @@
myads',%0A
+ 'object_search'%0A
%5D%0A%0A# Loc
|
5abf5b657cd5ae7cfa94f3085fbe1121f7ea49c1 | Improve cli | grout/cli.py | grout/cli.py | # -*- coding: utf-8 -*-
import os
import click
from typing import Tuple
import grout.core
import grout.core.backend
@click.command()
@click.option('--path', default=None, help='Path to project')
@click.option('--project-file', default='project.yaml', help='Project declaration file')
@click.option('--skip', 'skip_j... | Python | 0.000017 | @@ -153,133 +153,84 @@
'--p
-ath', default=None, help='Path to project')%0A@click.option('--project-file', default='project.yaml', help='Project declaration
+roject', type=click.Path(dir_okay=False, exists=True), help='Path to project
fil
@@ -260,21 +260,8 @@
ip',
- 'skip_jobs',
def
@@ -356,28 +356,8 @@
nt',
- '... |
e8691b4d545cf78fda08a61a47a33e0a13259911 | allow get_print and attach print in server scripts | frappe/utils/safe_exec.py | frappe/utils/safe_exec.py |
import os, json, inspect
import mimetypes
from html2text import html2text
from RestrictedPython import compile_restricted, safe_globals
import RestrictedPython.Guards
import frappe
import frappe.utils
import frappe.utils.data
from frappe.website.utils import (get_shade, get_toc, get_next_link)
from frappe.modules impo... | Python | 0 | @@ -2256,16 +2256,88 @@
endmail,
+%0A%09%09%09get_print = frappe.get_print,%0A%09%09%09attach_print = frappe.attach_print,
%0A%0A%09%09%09use
|
131cdaf337e3bfa6524443668e67835c3ecd9e80 | Bump version to 0.3.0 | paperpal/__init__.py | paperpal/__init__.py | #!/usr/bin/env python
# -*- encoding: UTF-8 -*-
# Copyright 2016 Eddie Antonio Santos <easantos@ualberta.ca>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... | Python | 0.000001 | @@ -713,17 +713,17 @@
__ = '0.
-2
+3
.0'%0A__al
|
a8806c54d7554716487001ef5ffd06af32f16c3a | Version bump to 0.8.8 | namebench.py | namebench.py | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Python | 0 | @@ -1018,17 +1018,17 @@
= '0.8.
-7
+8
'%0A%0Aclass
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.