Unnamed: 0
int64
0
2.44k
repo
stringlengths
32
81
hash
stringlengths
40
40
diff
stringlengths
113
1.17k
old_path
stringlengths
5
84
rewrite
stringlengths
34
79
initial_state
stringlengths
75
980
final_state
stringlengths
76
980
2,200
https://:@github.com/YugaByte/cassandra-python-driver.git
5dc9e971267c2072c60ae9271c6e230813f72e15
@@ -232,7 +232,7 @@ class BaseModel(object): if not issubclass(klass, cls): raise PolyMorphicModelException( - '{} is not a subclass of {}'.format(klass.__name__, poly_base.__name__) + '{} is not a subclass of {}'.format(klass.__name__, cls.__name__)...
cqlengine/models.py
ReplaceText(target='cls' @(235,72)->(235,81))
class BaseModel(object): if not issubclass(klass, cls): raise PolyMorphicModelException( '{} is not a subclass of {}'.format(klass.__name__, poly_base.__name__) ) field_dict = {k: v for k, v in field_dict.items() if k in klass._columns...
class BaseModel(object): if not issubclass(klass, cls): raise PolyMorphicModelException( '{} is not a subclass of {}'.format(klass.__name__, cls.__name__) ) field_dict = {k: v for k, v in field_dict.items() if k in klass._columns.keys(...
2,201
https://:@github.com/YugaByte/cassandra-python-driver.git
21081fb30673a52506de2ef2b3c38ae519afef99
@@ -895,7 +895,7 @@ class ModelMetaClass(type): if MultipleObjectsReturnedBase is not None: break - MultipleObjectsReturnedBase = DoesNotExistBase or attrs.pop('MultipleObjectsReturned', BaseModel.MultipleObjectsReturned) + MultipleObjectsReturnedBase = MultipleObjectsRetur...
cassandra/cqlengine/models.py
ReplaceText(target='MultipleObjectsReturnedBase' @(898,38)->(898,54))
class ModelMetaClass(type): if MultipleObjectsReturnedBase is not None: break MultipleObjectsReturnedBase = DoesNotExistBase or attrs.pop('MultipleObjectsReturned', BaseModel.MultipleObjectsReturned) attrs['MultipleObjectsReturned'] = type('MultipleObjectsReturned', (Mu...
class ModelMetaClass(type): if MultipleObjectsReturnedBase is not None: break MultipleObjectsReturnedBase = MultipleObjectsReturnedBase or attrs.pop('MultipleObjectsReturned', BaseModel.MultipleObjectsReturned) attrs['MultipleObjectsReturned'] = type('MultipleObjectsRet...
2,202
https://:@github.com/redvox/piranha.git
94ece99f61f2c12e57b36d3bf00e9260304cee67
@@ -14,7 +14,7 @@ def assume_role(account, role): sts = boto3.client('sts') response = sts.assume_role(RoleArn=f'arn:aws:iam::{account}:role/{role}', RoleSessionName=f'{role}-session-{account}') - if not response and not response['ResponseMetadata']['HTTPStatusCode'] == 200:...
piranha/client.py
ReplaceText(target='or' @(17,20)->(17,23))
def assume_role(account, role): sts = boto3.client('sts') response = sts.assume_role(RoleArn=f'arn:aws:iam::{account}:role/{role}', RoleSessionName=f'{role}-session-{account}') if not response and not response['ResponseMetadata']['HTTPStatusCode'] == 200: raise Ex...
def assume_role(account, role): sts = boto3.client('sts') response = sts.assume_role(RoleArn=f'arn:aws:iam::{account}:role/{role}', RoleSessionName=f'{role}-session-{account}') if not response or not response['ResponseMetadata']['HTTPStatusCode'] == 200: raise Exc...
2,203
https://:@github.com/NeuralSandwich/stone.git
f51cc62e6b9fed63302e585294a3790e4eef5b1d
@@ -51,7 +51,7 @@ def create_add_page(site: Site, source: str, target: str, data=None, content=None): """Create a Page() and file on disk""" init_content = '# Hello, World!' - if content is None and not isinstance(str, content): + if content is None and not isinstance(content, str):...
stone/stone.py
ArgSwap(idxs=0<->1 @(54,31)->(54,41))
def create_add_page(site: Site, source: str, target: str, data=None, content=None): """Create a Page() and file on disk""" init_content = '# Hello, World!' if content is None and not isinstance(str, content): content = init_content try:
def create_add_page(site: Site, source: str, target: str, data=None, content=None): """Create a Page() and file on disk""" init_content = '# Hello, World!' if content is None and not isinstance(content, str): content = init_content try:
2,204
https://:@github.com/legoktm/wdapi.git
b7b1335a06b92c9b5182d54db8f8d1ba46c2cbe5
@@ -94,7 +94,7 @@ def canClaimBeAdded(item, claim, checkDupe=True): if not claim.getTarget().getID() in prop.constraints()['oneof']: return False, 'oneof' if 'single' in prop.constraints(): - if item.getID() in item.claims: + if claim.getID() in item.claims: return ...
wdapi/main.py
ReplaceText(target='claim' @(97,11)->(97,15))
def canClaimBeAdded(item, claim, checkDupe=True): if not claim.getTarget().getID() in prop.constraints()['oneof']: return False, 'oneof' if 'single' in prop.constraints(): if item.getID() in item.claims: return False, 'single' #TODO: target, unique, item, reciproc...
def canClaimBeAdded(item, claim, checkDupe=True): if not claim.getTarget().getID() in prop.constraints()['oneof']: return False, 'oneof' if 'single' in prop.constraints(): if claim.getID() in item.claims: return False, 'single' #TODO: target, unique, item, recipro...
2,205
https://:@github.com/rileyjmurray/sageopt.git
61205194a6127bf10cc751efa5dfdf8f180967e6
@@ -355,7 +355,7 @@ class Polynomial(Signomial): vec = self.alpha[j, :].copy() c = self.c[j] * vec[i] vec[i] -= 1 - d[tuple(vec.tolist())] = c + d[tuple(vec.tolist())] += c d[self.n * (0,)] += 0 p = Polynomial(d) ...
sageopt/symbolic/polynomials.py
ReplaceText(target='+=' @(358,39)->(358,40))
class Polynomial(Signomial): vec = self.alpha[j, :].copy() c = self.c[j] * vec[i] vec[i] -= 1 d[tuple(vec.tolist())] = c d[self.n * (0,)] += 0 p = Polynomial(d) return p
class Polynomial(Signomial): vec = self.alpha[j, :].copy() c = self.c[j] * vec[i] vec[i] -= 1 d[tuple(vec.tolist())] += c d[self.n * (0,)] += 0 p = Polynomial(d) return p
2,206
https://:@github.com/adammhaile/dotconfig.git
2fec17b2aa23c329b0570f73cf86c082a914d2cd
@@ -76,7 +76,7 @@ class Config(object): # finally, override with given cli args for k, v in cli_args.iteritems(): - if k not in self._data or k is not None: + if k not in self._data or v is not None: self._data[k] = v def __getitem__(...
dotconfig/__init__.py
ReplaceText(target='v' @(79,42)->(79,43))
class Config(object): # finally, override with given cli args for k, v in cli_args.iteritems(): if k not in self._data or k is not None: self._data[k] = v def __getitem__(self, item):
class Config(object): # finally, override with given cli args for k, v in cli_args.iteritems(): if k not in self._data or v is not None: self._data[k] = v def __getitem__(self, item):
2,207
https://:@github.com/ralphje/pesigcheck.git
a043237a56b6e55a6e8250dde8811883d4ce9d03
@@ -125,7 +125,7 @@ class VerificationContext(object): intermediates, trust_roots = [], [] for store in self.stores: for cert in store: - asn1cert = certificate.to_asn1crypto + asn1cert = cert.to_asn1crypto (trust_roots if store.trusted else ...
signify/context.py
ReplaceText(target='cert' @(128,27)->(128,38))
class VerificationContext(object): intermediates, trust_roots = [], [] for store in self.stores: for cert in store: asn1cert = certificate.to_asn1crypto (trust_roots if store.trusted else intermediates).append(asn1cert) all_certs[asn1cert...
class VerificationContext(object): intermediates, trust_roots = [], [] for store in self.stores: for cert in store: asn1cert = cert.to_asn1crypto (trust_roots if store.trusted else intermediates).append(asn1cert) all_certs[asn1cert] = cer...
2,208
https://:@github.com/fritzprix/jconfigpy.git
535f34af57ff0e5c9673de43f00ded78c17d2347
@@ -762,7 +762,7 @@ def prompt_int(item): def prompt_hex(item): if not isinstance(item, JConfigHex): return - if item.is_visible(): + if not item.is_visible(): return print('\nCONFIG_{0}'.format(item.get_name())) val = 'h'
jconfigpy.py
ReplaceText(target='not ' @(765,7)->(765,7))
def prompt_int(item): def prompt_hex(item): if not isinstance(item, JConfigHex): return if item.is_visible(): return print('\nCONFIG_{0}'.format(item.get_name())) val = 'h'
def prompt_int(item): def prompt_hex(item): if not isinstance(item, JConfigHex): return if not item.is_visible(): return print('\nCONFIG_{0}'.format(item.get_name())) val = 'h'
2,209
https://:@github.com/radimsuckr/onesignal-client.git
55031d8ffb8b2c9ebd96a5b19f8ecb5daf4035f8
@@ -75,7 +75,7 @@ class OneSignal: notification.id = response["id"] - return response + return notification def cancel(self, notification): """Cancel a notification
onesignal/core.py
ReplaceText(target='notification' @(78,15)->(78,23))
class OneSignal: notification.id = response["id"] return response def cancel(self, notification): """Cancel a notification
class OneSignal: notification.id = response["id"] return notification def cancel(self, notification): """Cancel a notification
2,210
https://:@github.com/dmonroy/schema-migrations.git
c70624818776029230bfe6438c121fcbcfde2f26
@@ -82,7 +82,7 @@ class MigrationController(object): if not os.path.isdir(migration_folder): continue - if migration_folder == '__pycache__': + if migration == '__pycache__': continue migration_info = self.migr...
schema_migrations/__init__.py
ReplaceText(target='migration' @(85,19)->(85,35))
class MigrationController(object): if not os.path.isdir(migration_folder): continue if migration_folder == '__pycache__': continue migration_info = self.migration_info(
class MigrationController(object): if not os.path.isdir(migration_folder): continue if migration == '__pycache__': continue migration_info = self.migration_info(
2,211
https://:@github.com/EnigmaCurry/nose-test-select.git
815e528ec9a2772bddf672b888456154fafbb817
@@ -79,7 +79,7 @@ class NoseTestSelect(Plugin): for pattern in self.patterns['exclude']: file_pattern, method_pattern = pattern.split(':', 1) if fnmatch.fnmatch(method_file, file_pattern) and \ - fnmatch.fnmatch(method_name, method_pattern): + fnmatch.fnmat...
nose_test_select/nose_test_select.py
ReplaceText(target='class_method_name' @(82,31)->(82,42))
class NoseTestSelect(Plugin): for pattern in self.patterns['exclude']: file_pattern, method_pattern = pattern.split(':', 1) if fnmatch.fnmatch(method_file, file_pattern) and \ fnmatch.fnmatch(method_name, method_pattern): return False return...
class NoseTestSelect(Plugin): for pattern in self.patterns['exclude']: file_pattern, method_pattern = pattern.split(':', 1) if fnmatch.fnmatch(method_file, file_pattern) and \ fnmatch.fnmatch(class_method_name, method_pattern): return False ...
2,212
https://:@github.com/jiwoncpark/baobab.git
a6a56166079636e36467522f1854976980648167
@@ -49,7 +49,7 @@ class TestDistributions(unittest.TestCase): exp_kurtosis = gamma(5/p) * gamma(1/p) / gamma(3/p)**2.0 - 3.0 #exp_entropy = 1/p - np.log(p / (2 * alpha * gamma(1/p))) precision = 2 - np.testing.assert_almost_equal(sample_mean, mu, precision) + np.testing.assert_a...
baobab/tests/test_distributions/test_distributions.py
ReplaceText(target='exp_mean' @(52,52)->(52,54))
class TestDistributions(unittest.TestCase): exp_kurtosis = gamma(5/p) * gamma(1/p) / gamma(3/p)**2.0 - 3.0 #exp_entropy = 1/p - np.log(p / (2 * alpha * gamma(1/p))) precision = 2 np.testing.assert_almost_equal(sample_mean, mu, precision) np.testing.assert_almost_equal(sample...
class TestDistributions(unittest.TestCase): exp_kurtosis = gamma(5/p) * gamma(1/p) / gamma(3/p)**2.0 - 3.0 #exp_entropy = 1/p - np.log(p / (2 * alpha * gamma(1/p))) precision = 2 np.testing.assert_almost_equal(sample_mean, exp_mean, precision) np.testing.assert_almost_equal(...
2,213
https://:@github.com/andrewlorente/catsnap.git
eec5e151ce2751dbd8ceeded16137e7db353c63b
@@ -48,8 +48,8 @@ def view_album(request_format, album_id): if request_format == 'html': return render_template('view_album.html.jinja', - images = image_structs, + images=image_structs, album=album) else: - return images + return image_s...
catsnap/web/controllers/album.py
ReplaceText(target='image_structs' @(54,15)->(54,21))
def view_album(request_format, album_id): if request_format == 'html': return render_template('view_album.html.jinja', images = image_structs, album=album) else: return images
def view_album(request_format, album_id): if request_format == 'html': return render_template('view_album.html.jinja', images=image_structs, album=album) else: return image_structs
2,214
https://:@github.com/d9pouces/DebTools.git
fa678ba16208c0725036f0e5c407b3e39a2cf60e
@@ -140,7 +140,7 @@ def main(): package_names = [x for x in packages_to_create] package_names.sort() for package_name in package_names: - package_version = package_names[package_name] + package_version = packages_to_create[package_name] if normalize_package_name(package_name) in ex...
debtools/multideb.py
ReplaceText(target='packages_to_create' @(143,26)->(143,39))
def main(): package_names = [x for x in packages_to_create] package_names.sort() for package_name in package_names: package_version = package_names[package_name] if normalize_package_name(package_name) in excluded_packages: print('%s is excluded' % package_name) ...
def main(): package_names = [x for x in packages_to_create] package_names.sort() for package_name in package_names: package_version = packages_to_create[package_name] if normalize_package_name(package_name) in excluded_packages: print('%s is excluded' % package_name) ...
2,215
https://:@github.com/shiroyuki/passerine.git
c9ac93750b7b09b440c8cd53654264d52135c005
@@ -79,7 +79,7 @@ class Collection(object): update_instruction = {'$set': changeset} - self.api.update({'_id': document.id}, changeset, upsert=upsert) + self.api.update({'_id': document.id}, update_instruction, upsert=upsert) document.reset_bits()
tori/db/odm/collection.py
ReplaceText(target='update_instruction' @(82,46)->(82,55))
class Collection(object): update_instruction = {'$set': changeset} self.api.update({'_id': document.id}, changeset, upsert=upsert) document.reset_bits()
class Collection(object): update_instruction = {'$set': changeset} self.api.update({'_id': document.id}, update_instruction, upsert=upsert) document.reset_bits()
2,216
https://:@github.com/mattian7741/ergo.git
13ce6ef335f20303dfa0fac363deebeff08641b6
@@ -20,7 +20,7 @@ class VerifyVersionCommand(install): def run(self): tag = os.getenv('CIRCLE_TAG') - if tag != VERSION: + if tag == VERSION: info = "Git tag: {0} does not match the version of this app: {1}".format( tag, VERSION )
setup.py
ReplaceText(target='==' @(23,15)->(23,17))
class VerifyVersionCommand(install): def run(self): tag = os.getenv('CIRCLE_TAG') if tag != VERSION: info = "Git tag: {0} does not match the version of this app: {1}".format( tag, VERSION )
class VerifyVersionCommand(install): def run(self): tag = os.getenv('CIRCLE_TAG') if tag == VERSION: info = "Git tag: {0} does not match the version of this app: {1}".format( tag, VERSION )
2,217
https://:@github.com/wallento/riscv-python-model.git
e62d687b72d75f6d5e6037963c1e533b00cbc1d8
@@ -30,7 +30,7 @@ class InstructionAUIPC(InstructionUType): class InstructionJAL(InstructionJType): def execute(self, model: Model): model.state.intreg[self.rd] = model.state.pc + 4 - model.state.pc = self.imm + model.state.pc += self.imm @isa("jalr", RV32I, opcode=0b1100111, funct3=0b...
riscvmodel/insn.py
ReplaceText(target='+=' @(33,23)->(33,24))
class InstructionAUIPC(InstructionUType): class InstructionJAL(InstructionJType): def execute(self, model: Model): model.state.intreg[self.rd] = model.state.pc + 4 model.state.pc = self.imm @isa("jalr", RV32I, opcode=0b1100111, funct3=0b000)
class InstructionAUIPC(InstructionUType): class InstructionJAL(InstructionJType): def execute(self, model: Model): model.state.intreg[self.rd] = model.state.pc + 4 model.state.pc += self.imm @isa("jalr", RV32I, opcode=0b1100111, funct3=0b000)
2,218
https://:@github.com/wojtekwanczyk/easy_manage.git
4b06119cd0c88ad6bdac965479e49b9170163956
@@ -125,7 +125,7 @@ class RedfishTools: to_find = name_list[0] found = None for key, value in data.items(): - if in_or_eq(to_find, key): + if in_or_eq(key, to_find): found = self.find(name_list[1:], strict, value, misses) else: ...
easy_manage/tools/redfish_tools.py
ArgSwap(idxs=0<->1 @(128,15)->(128,23))
class RedfishTools: to_find = name_list[0] found = None for key, value in data.items(): if in_or_eq(to_find, key): found = self.find(name_list[1:], strict, value, misses) else: found = self.find(name_list, strict, value, misses-1)
class RedfishTools: to_find = name_list[0] found = None for key, value in data.items(): if in_or_eq(key, to_find): found = self.find(name_list[1:], strict, value, misses) else: found = self.find(name_list, strict, value, misses-1)
2,219
https://:@github.com/CTSNE/NodeDefender.git
62a1dbb0099406b2e1d6e254d69c4d2b764b8ae7
@@ -43,7 +43,7 @@ def Current(node): ret_data.append(sensor_data) ret_data.append(node_data) - return ret_data + return node_data def Average(node): node = db.session.query(NodeModel).filter(NodeModel.name ==
NodeDefender/models/manage/data/node/heat.py
ReplaceText(target='node_data' @(46,11)->(46,19))
def Current(node): ret_data.append(sensor_data) ret_data.append(node_data) return ret_data def Average(node): node = db.session.query(NodeModel).filter(NodeModel.name ==
def Current(node): ret_data.append(sensor_data) ret_data.append(node_data) return node_data def Average(node): node = db.session.query(NodeModel).filter(NodeModel.name ==
2,220
https://:@github.com/CTSNE/NodeDefender.git
cd60da0847ef6b05456608f19d7235ecb6a53e52
@@ -9,7 +9,7 @@ from geopy.geocoders import Nominatim def create(name, group, location): NodeDefender.db.node.create(name) NodeDefender.db.group.add_node(group, name) - NodeDefender.db.node.set_location(group, **location) + NodeDefender.db.node.set_location(name, **location) NodeDefender.mail.node...
NodeDefender/frontend/sockets/node.py
ReplaceText(target='name' @(12,38)->(12,43))
from geopy.geocoders import Nominatim def create(name, group, location): NodeDefender.db.node.create(name) NodeDefender.db.group.add_node(group, name) NodeDefender.db.node.set_location(group, **location) NodeDefender.mail.node.new_node(name) url = url_for('NodeView.NodesNode', name = serialize...
from geopy.geocoders import Nominatim def create(name, group, location): NodeDefender.db.node.create(name) NodeDefender.db.group.add_node(group, name) NodeDefender.db.node.set_location(name, **location) NodeDefender.mail.node.new_node(name) url = url_for('NodeView.NodesNode', name = serializer...
2,221
https://:@github.com/ShixiangWang/loon.git
73ed4c8148e5f4ae188eb76453fee0a2f84133d5
@@ -15,7 +15,7 @@ def batch(input, cmds, sep=',', header=False, dry_run=False, _logger=None): sys.exit(1) data = read_csv(input, sep=sep, rm_comment=True) - if not header: + if header: # Remove header _ = data.pop(0)
src/loon/tool.py
ReplaceText(target='' @(18,7)->(18,11))
def batch(input, cmds, sep=',', header=False, dry_run=False, _logger=None): sys.exit(1) data = read_csv(input, sep=sep, rm_comment=True) if not header: # Remove header _ = data.pop(0)
def batch(input, cmds, sep=',', header=False, dry_run=False, _logger=None): sys.exit(1) data = read_csv(input, sep=sep, rm_comment=True) if header: # Remove header _ = data.pop(0)
2,222
https://:@github.com/colemanja91/pyeloqua.git
30aaf05072a734ac40836ae4542844b05c6abb25
@@ -384,7 +384,7 @@ class Eloqua(object): try: test1 = datetime.strptime(start, '%Y-%m-%d %H:%M:%S') - test2 = datetime.strptime(start, '%Y-%m-%d %H:%M:%S') + test2 = datetime.strptime(end, '%Y-%m-%d %H:%M:%S') except: raise ValueError("Invalid datetim...
pyeloqua/pyeloqua.py
ReplaceText(target='end' @(387,38)->(387,43))
class Eloqua(object): try: test1 = datetime.strptime(start, '%Y-%m-%d %H:%M:%S') test2 = datetime.strptime(start, '%Y-%m-%d %H:%M:%S') except: raise ValueError("Invalid datetime format; use 'YYYY-MM-DD hh:mm:ss'")
class Eloqua(object): try: test1 = datetime.strptime(start, '%Y-%m-%d %H:%M:%S') test2 = datetime.strptime(end, '%Y-%m-%d %H:%M:%S') except: raise ValueError("Invalid datetime format; use 'YYYY-MM-DD hh:mm:ss'")
2,223
https://:@github.com/colemanja91/pyeloqua.git
aa8d74f801c77ed45e1dda75a4a5008584f5a7ee
@@ -388,7 +388,7 @@ class Eloqua(object): except: raise ValueError("Invalid datetime format; use 'YYYY-MM-DD hh:mm:ss'") - if (entity!='activities' or (entity in ['contacts', 'accounts'] and field in ['createdAt', 'updatedAt'])): + if (entity!='activities' or (entity in ['contacts'...
pyeloqua/pyeloqua.py
ReplaceText(target=' not in ' @(391,81)->(391,85))
class Eloqua(object): except: raise ValueError("Invalid datetime format; use 'YYYY-MM-DD hh:mm:ss'") if (entity!='activities' or (entity in ['contacts', 'accounts'] and field in ['createdAt', 'updatedAt'])): fieldDef = self.GetFields(entity=entity, fields=[field], cdoID=cdo...
class Eloqua(object): except: raise ValueError("Invalid datetime format; use 'YYYY-MM-DD hh:mm:ss'") if (entity!='activities' or (entity in ['contacts', 'accounts'] and field not in ['createdAt', 'updatedAt'])): fieldDef = self.GetFields(entity=entity, fields=[field], cdoID...
2,224
https://:@github.com/catalogicsoftware/kubedrctl.git
c63739163b5305947daf5bb0fc8c36e6f69f9e30
@@ -25,7 +25,7 @@ def cli(ctx, accesskey, secretkey, repopwd, endpoint, bucket, targetdir, snapid) """ - if not accesskey or not secretkey or not repopwd or not endpoint or not bucket and not targetdir: + if not accesskey or not secretkey or not repopwd or not endpoint or not bucket or not targetdir: ...
kubedrctl/cli/commands/cmd_restore.py
ReplaceText(target='or' @(28,83)->(28,86))
def cli(ctx, accesskey, secretkey, repopwd, endpoint, bucket, targetdir, snapid) """ if not accesskey or not secretkey or not repopwd or not endpoint or not bucket and not targetdir: raise Exception('One of the required parameters (accesskey, secretkey, repopwd, endpoint, bucket, targetdir) is mi...
def cli(ctx, accesskey, secretkey, repopwd, endpoint, bucket, targetdir, snapid) """ if not accesskey or not secretkey or not repopwd or not endpoint or not bucket or not targetdir: raise Exception('One of the required parameters (accesskey, secretkey, repopwd, endpoint, bucket, targetdir) is mis...
2,225
https://:@github.com/celliern/energy_plus_wrapper.git
4dcb0b83b81bcaed91696567caea30c80a01ca5c
@@ -85,7 +85,7 @@ def _build_command_line(tmp, idd_file, idf_file, weather_file, "-w", tmp / weather_file.basename(), "-p", prefix, "-d", tmp.abspath()] + - (["-i", tmp / idf_file.basename()] + (["-i", tmp / idd_file.base...
src/energyplus_wrapper/main.py
ReplaceText(target='idd_file' @(88,33)->(88,41))
def _build_command_line(tmp, idd_file, idf_file, weather_file, "-w", tmp / weather_file.basename(), "-p", prefix, "-d", tmp.abspath()] + (["-i", tmp / idf_file.basename()] if idd_file is not None else []) + ...
def _build_command_line(tmp, idd_file, idf_file, weather_file, "-w", tmp / weather_file.basename(), "-p", prefix, "-d", tmp.abspath()] + (["-i", tmp / idd_file.basename()] if idd_file is not None else []) + ...
2,226
https://:@github.com/shuoli84/gevent_socketio2.git
7eed4169f86cd7522cab0ef7552da0f2187d7b6c
@@ -228,7 +228,7 @@ class Socket(EventEmitter): def ping_timeout(): pass - self.ping_timeout_job = gevent.spawn_later(ping_timeout, self.ping_timeout) + self.ping_timeout_job = gevent.spawn_later(self.ping_timeout, ping_timeout) if 'open' == self.ready_st...
socketio_client/engine/socket.py
ArgSwap(idxs=0<->1 @(231,36)->(231,54))
class Socket(EventEmitter): def ping_timeout(): pass self.ping_timeout_job = gevent.spawn_later(ping_timeout, self.ping_timeout) if 'open' == self.ready_state or 'opening' == self.ready_state: self.ping_job = gevent.spawn_later(self.ping_interval/1000...
class Socket(EventEmitter): def ping_timeout(): pass self.ping_timeout_job = gevent.spawn_later(self.ping_timeout, ping_timeout) if 'open' == self.ready_state or 'opening' == self.ready_state: self.ping_job = gevent.spawn_later(self.ping_interval/1000...
2,227
https://:@bitbucket.org/berkeleylab/pypixie16.git
f7202b4fe9fa06ce4a176f5c694ab0210ab43630
@@ -70,7 +70,7 @@ def read_list_mode_data(filename, progress=False, keep_trace=False): # about 300x faster than multiple f.read(2) trace = np.fromfile(f, '({},2)<u2'.format(event_length-header_length), count=1)[0, :, :] # need to swap columns and flatten array - ...
read.py
ReplaceText(target='' @(73,19)->(73,23))
def read_list_mode_data(filename, progress=False, keep_trace=False): # about 300x faster than multiple f.read(2) trace = np.fromfile(f, '({},2)<u2'.format(event_length-header_length), count=1)[0, :, :] # need to swap columns and flatten array if not ke...
def read_list_mode_data(filename, progress=False, keep_trace=False): # about 300x faster than multiple f.read(2) trace = np.fromfile(f, '({},2)<u2'.format(event_length-header_length), count=1)[0, :, :] # need to swap columns and flatten array if keep_t...
2,228
https://:@bitbucket.org/berkeleylab/pypixie16.git
9a9d982f2880a48b4a723f395589a491d673daf5
@@ -90,7 +90,7 @@ def calculate_CFD(traces, t=None, CFD_threshold=None, w=1, B=5, D=5, L=1, Nbkgd= CFD = CFD[0] errors = errors[0] - return CFD, cfdtime, errors + return CFD, cfdtrigger, errors def calculate_CFD_using_FF(traces, t=None, CFD_threshold=None, w=1, B=5, D=5, L=1, Nbkgd=100):
analyze.py
ReplaceText(target='cfdtrigger' @(93,16)->(93,23))
def calculate_CFD(traces, t=None, CFD_threshold=None, w=1, B=5, D=5, L=1, Nbkgd= CFD = CFD[0] errors = errors[0] return CFD, cfdtime, errors def calculate_CFD_using_FF(traces, t=None, CFD_threshold=None, w=1, B=5, D=5, L=1, Nbkgd=100):
def calculate_CFD(traces, t=None, CFD_threshold=None, w=1, B=5, D=5, L=1, Nbkgd= CFD = CFD[0] errors = errors[0] return CFD, cfdtrigger, errors def calculate_CFD_using_FF(traces, t=None, CFD_threshold=None, w=1, B=5, D=5, L=1, Nbkgd=100):
2,229
https://:@github.com/toros-astro/corral.git
51ffc50bbb290899fb9e64f5719903c1ba987e3d
@@ -15,7 +15,7 @@ import importlib def to_namedtuple(name, d): keys = list(d.keys()) - namedtuple = collections.namedtuple(name, d) + namedtuple = collections.namedtuple(name, keys) return namedtuple(**d)
corral/util.py
ReplaceText(target='keys' @(18,46)->(18,47))
import importlib def to_namedtuple(name, d): keys = list(d.keys()) namedtuple = collections.namedtuple(name, d) return namedtuple(**d)
import importlib def to_namedtuple(name, d): keys = list(d.keys()) namedtuple = collections.namedtuple(name, keys) return namedtuple(**d)
2,230
https://:@github.com/karimbahgat/PyAgg.git
23867f72529c5843bd585a0124a9b67099bd8ed9
@@ -11,7 +11,7 @@ def test_smoothline(): smooth=True, fillcolor=(222,0,0), fillsize=2) - canvas.draw_text((50,50), "Hello", textfont="segoe print bold", textsize=55) + canvas.draw_text("Hello", (50,50), textfont="segoe print bold", textsize=55) ...
graph_tester.py
ArgSwap(idxs=0<->1 @(14,4)->(14,20))
def test_smoothline(): smooth=True, fillcolor=(222,0,0), fillsize=2) canvas.draw_text((50,50), "Hello", textfont="segoe print bold", textsize=55) return canvas def test_histogram():
def test_smoothline(): smooth=True, fillcolor=(222,0,0), fillsize=2) canvas.draw_text("Hello", (50,50), textfont="segoe print bold", textsize=55) return canvas def test_histogram():
2,231
https://:@github.com/nikist97/Python-DataStructures.git
c6621b3e0914f635762da1e16298441534b5758c
@@ -1345,7 +1345,7 @@ class DuplicatePriorityQueue(PriorityQueue): if self.type() is not None and type(element) != self.type(): raise TypeError("Type of the parameter is not " + str(self.type())) - if self.has_duplicates(): + if not self.has_duplicates(): return super(...
ADTs/AbstractDataStructures.py
ReplaceText(target='not ' @(1348,11)->(1348,11))
class DuplicatePriorityQueue(PriorityQueue): if self.type() is not None and type(element) != self.type(): raise TypeError("Type of the parameter is not " + str(self.type())) if self.has_duplicates(): return super().contains_element(element) for test_element in se...
class DuplicatePriorityQueue(PriorityQueue): if self.type() is not None and type(element) != self.type(): raise TypeError("Type of the parameter is not " + str(self.type())) if not self.has_duplicates(): return super().contains_element(element) for test_element i...
2,232
https://:@github.com/heewinkim/hian.git
2c199eaf141fc1fa049c3c7b9eaf56731b8d4694
@@ -62,7 +62,7 @@ class PyAlgorithm(object): intersection = intersection.intersection(box_) if intersection.area == box_list[0].area: - if intersection.area == PyAlgorithm.unionRects(rect_list).area: + if intersection.area <= PyAlgorithm.unionRects(rect_list).area: ...
utilpack/core/algorithm.py
ReplaceText(target='<=' @(65,33)->(65,35))
class PyAlgorithm(object): intersection = intersection.intersection(box_) if intersection.area == box_list[0].area: if intersection.area == PyAlgorithm.unionRects(rect_list).area: return intersection else: return box(0,0,0,0)
class PyAlgorithm(object): intersection = intersection.intersection(box_) if intersection.area == box_list[0].area: if intersection.area <= PyAlgorithm.unionRects(rect_list).area: return intersection else: return box(0,0,0,0)
2,233
https://:@bitbucket.org/whatshap/whatshap.git
e6a843308297d2a4b170ea9feffc33159a40ea91
@@ -365,7 +365,7 @@ def run_whatshap(phase_input_files, variant_file, reference=None, # for each family. for representative_sample, family in families.items(): if len(family) == 1: - logger.info('---- Processing individual %s', sample) + logger.info('---- Processing individual %s', representative_s...
whatshap/phase.py
ReplaceText(target='representative_sample' @(368,50)->(368,56))
def run_whatshap(phase_input_files, variant_file, reference=None, # for each family. for representative_sample, family in families.items(): if len(family) == 1: logger.info('---- Processing individual %s', sample) else: logger.info('---- Processing family with individuals: %s', ','.join(fa...
def run_whatshap(phase_input_files, variant_file, reference=None, # for each family. for representative_sample, family in families.items(): if len(family) == 1: logger.info('---- Processing individual %s', representative_sample) else: logger.info('---- Processing family with individuals: %...
2,234
https://:@bitbucket.org/whatshap/whatshap.git
cd3f978e88fe07fb886ad4026b35979962bf0d14
@@ -163,7 +163,7 @@ def eval_overlap(n1, n2): overlap = zip(n1['sites'][hang1:], n2['sites']) match, mismatch = (0, 0) for (c1, c2) in overlap: - if c1 in ['A', 'C', 'G', 'T'] and c1 in ['A', 'C', 'G', 'T']: + if c1 in ['A', 'C', 'G', 'T'] and c2 in ['A', 'C', 'G', 'T']: if c1 == c2: match += 1 els...
whatshap/cli/phase.py
ReplaceText(target='c2' @(166,36)->(166,38))
def eval_overlap(n1, n2): overlap = zip(n1['sites'][hang1:], n2['sites']) match, mismatch = (0, 0) for (c1, c2) in overlap: if c1 in ['A', 'C', 'G', 'T'] and c1 in ['A', 'C', 'G', 'T']: if c1 == c2: match += 1 else:
def eval_overlap(n1, n2): overlap = zip(n1['sites'][hang1:], n2['sites']) match, mismatch = (0, 0) for (c1, c2) in overlap: if c1 in ['A', 'C', 'G', 'T'] and c2 in ['A', 'C', 'G', 'T']: if c1 == c2: match += 1 else:
2,235
https://:@github.com/zach-king/oink.git
4580509c05ac17322f1ac19cffbee9dde781e902
@@ -114,7 +114,7 @@ def route(command): arg_index = command_args_length - given_args_length if arg_index >= len(comm['required_args']): arg_index = 0 - error = colorize(comm['required_args'][arg_index], 'blue') + ' is required' + error...
oink/router.py
ReplaceText(target='given_args_length' @(117,55)->(117,64))
def route(command): arg_index = command_args_length - given_args_length if arg_index >= len(comm['required_args']): arg_index = 0 error = colorize(comm['required_args'][arg_index], 'blue') + ' is required' elif given_args_length > max_...
def route(command): arg_index = command_args_length - given_args_length if arg_index >= len(comm['required_args']): arg_index = 0 error = colorize(comm['required_args'][given_args_length], 'blue') + ' is required' elif given_args_lengt...
2,236
https://:@github.com/Mordred/certbot-plugin-websupport.git
b170de9b1db0678ac502540948f1cd062d2f84b9
@@ -95,7 +95,7 @@ class _WebsupportClient(object): } logger.debug('Attempting to add record to zone %s: %s', zone_id, data) - response = self._send_request('POST', '/v1/user/self/zone/{0}/record'.format(domain), data) + response = self._send_request('POST', '/v1/user/self/zone/{0}/reco...
certbot_plugin_websupport/dns.py
ReplaceText(target='zone_id' @(98,85)->(98,91))
class _WebsupportClient(object): } logger.debug('Attempting to add record to zone %s: %s', zone_id, data) response = self._send_request('POST', '/v1/user/self/zone/{0}/record'.format(domain), data) if response.status_code != 200 and response.status_code != 201: raise...
class _WebsupportClient(object): } logger.debug('Attempting to add record to zone %s: %s', zone_id, data) response = self._send_request('POST', '/v1/user/self/zone/{0}/record'.format(zone_id), data) if response.status_code != 200 and response.status_code != 201: rais...
2,237
https://:@github.com/riot-appstore/memory_map_manager.git
4a4ea7729853b223ad080495226a2dbae5082e29
@@ -12,7 +12,7 @@ from gen_helpers import to_underscore_case def _parse_filename(f_arg, d_arg, name_contains): - if f_arg is None: + if f_arg is not None: for file in os.listdir(os.path.join(os.path.dirname(__file__), d_arg)): if file.endswith(".json"): if name_contains...
memory_map_manager/code_gen.py
ReplaceText(target=' is not ' @(15,12)->(15,16))
from gen_helpers import to_underscore_case def _parse_filename(f_arg, d_arg, name_contains): if f_arg is None: for file in os.listdir(os.path.join(os.path.dirname(__file__), d_arg)): if file.endswith(".json"): if name_contains in file:
from gen_helpers import to_underscore_case def _parse_filename(f_arg, d_arg, name_contains): if f_arg is not None: for file in os.listdir(os.path.join(os.path.dirname(__file__), d_arg)): if file.endswith(".json"): if name_contains in file:
2,238
https://:@github.com/PlaceDevs/place-scraper.git
c13614931c14e05a2cf8efcc0ef70706f9f56315
@@ -142,7 +142,7 @@ class PlaceScraper(object): def handle_batch_place(self, frame): for x in frame['payload']: - self.handle_place(frame) + self.handle_place(x) def main():
placescraper/base.py
ReplaceText(target='x' @(145,30)->(145,35))
class PlaceScraper(object): def handle_batch_place(self, frame): for x in frame['payload']: self.handle_place(frame) def main():
class PlaceScraper(object): def handle_batch_place(self, frame): for x in frame['payload']: self.handle_place(x) def main():
2,239
https://:@github.com/niklasf/python-agentspeak.git
e102065b7df1fd92c539be5c3bd2a012edcec740
@@ -165,7 +165,7 @@ def _member(env, agent, term, intention): choicepoint = object() for member in pyson.evaluate(term.args[1], intention.scope): - agent.stack.append(choicepoint) + intention.stack.append(choicepoint) if pyson.unify(term.args[0], member, intention.scope, intention.s...
pyson/stdlib.py
ReplaceText(target='intention' @(168,8)->(168,13))
def _member(env, agent, term, intention): choicepoint = object() for member in pyson.evaluate(term.args[1], intention.scope): agent.stack.append(choicepoint) if pyson.unify(term.args[0], member, intention.scope, intention.stack): yield
def _member(env, agent, term, intention): choicepoint = object() for member in pyson.evaluate(term.args[1], intention.scope): intention.stack.append(choicepoint) if pyson.unify(term.args[0], member, intention.scope, intention.stack): yield
2,240
https://:@github.com/thepinkowl/tuyaha-float.git
8c48c10d8d8bda1f996551e16820d6c9cc1ea82f
@@ -165,7 +165,7 @@ class TuyaApi: json = data ) if not response.ok: - _LOGGER.warning("request error, status code is %d, device %s", devId, response.status_code) + _LOGGER.warning("request error, status code is %d, device %s", response.status_code, devId) ...
tuyaha/tuyaapi.py
ArgSwap(idxs=1<->2 @(168,12)->(168,27))
class TuyaApi: json = data ) if not response.ok: _LOGGER.warning("request error, status code is %d, device %s", devId, response.status_code) return response_json = response.json() if response_json['header']['code'] != 'SUCCESS':
class TuyaApi: json = data ) if not response.ok: _LOGGER.warning("request error, status code is %d, device %s", response.status_code, devId) return response_json = response.json() if response_json['header']['code'] != 'SUCCESS':
2,241
https://:@github.com/shane-breeze/atuproot.git
206e736a62c914f577717679adc3f16b9fa1d6b7
@@ -36,7 +36,7 @@ class EventSumsProducer(object): event.METnoX_diMuonParaProjPt_Minus_DiMuon_pt = dimu_para - dimu_pt event.METnoX_diMuonPerpProjPt_Plus_DiMuon_pt = dimu_perp + dimu_pt event.METnoX_diMuonParaProjPt_Div_DiMuon_pt = dimu_para / dimu_pt - event.METnoX_diMuonPerpProjPt_Pl...
sequence/Readers/EventSumsProducer.py
ReplaceText(target='dimu_perp' @(39,70)->(39,79))
class EventSumsProducer(object): event.METnoX_diMuonParaProjPt_Minus_DiMuon_pt = dimu_para - dimu_pt event.METnoX_diMuonPerpProjPt_Plus_DiMuon_pt = dimu_perp + dimu_pt event.METnoX_diMuonParaProjPt_Div_DiMuon_pt = dimu_para / dimu_pt event.METnoX_diMuonPerpProjPt_Plus_DiMuon_pt_Div_D...
class EventSumsProducer(object): event.METnoX_diMuonParaProjPt_Minus_DiMuon_pt = dimu_para - dimu_pt event.METnoX_diMuonPerpProjPt_Plus_DiMuon_pt = dimu_perp + dimu_pt event.METnoX_diMuonParaProjPt_Div_DiMuon_pt = dimu_para / dimu_pt event.METnoX_diMuonPerpProjPt_Plus_DiMuon_pt_Div_D...
2,242
https://:@github.com/lpryszcz/redundans.git
4a62bd283b434b2faebbab9b82fd6a333bfad8ea
@@ -65,7 +65,7 @@ def get_libraries(fastq, fasta, mapq, threads, verbose, limit=0): # add libraries strating from lowest insert size for fq1, fq2, ismedian, ismean, isstd, pairs in sorted(libdata, key=lambda x: x[3]): # add new library set if - if not libraries or ismedian > 1.5*libraries[-1]...
redundans.py
ReplaceText(target='ismean' @(68,28)->(68,36))
def get_libraries(fastq, fasta, mapq, threads, verbose, limit=0): # add libraries strating from lowest insert size for fq1, fq2, ismedian, ismean, isstd, pairs in sorted(libdata, key=lambda x: x[3]): # add new library set if if not libraries or ismedian > 1.5*libraries[-1][4][0]: ...
def get_libraries(fastq, fasta, mapq, threads, verbose, limit=0): # add libraries strating from lowest insert size for fq1, fq2, ismedian, ismean, isstd, pairs in sorted(libdata, key=lambda x: x[3]): # add new library set if if not libraries or ismean > 1.5*libraries[-1][4][0]: ...
2,243
https://:@github.com/hammerlab/epitopes.git
0d8477a0e957f316d6005ba87853d1699307e0f5
@@ -223,7 +223,7 @@ def mutate_protein_from_transcript( seq = str(seq_region), start = start_pos, stop = end_pos, - mutation_start = aa_position, + mutation_start = mutation_start_pos_in_region, n_removed = n_aa_deleted, n_inserted = n_aa_inserted, ann...
epitopes/mutate.py
ReplaceText(target='mutation_start_pos_in_region' @(226,25)->(226,36))
def mutate_protein_from_transcript( seq = str(seq_region), start = start_pos, stop = end_pos, mutation_start = aa_position, n_removed = n_aa_deleted, n_inserted = n_aa_inserted, annot = annot)
def mutate_protein_from_transcript( seq = str(seq_region), start = start_pos, stop = end_pos, mutation_start = mutation_start_pos_in_region, n_removed = n_aa_deleted, n_inserted = n_aa_inserted, annot = annot)
2,244
https://:@gitlab.com/pjbecotte/settingscascade.git
390778a0958c04c13ef365b4c0c159f7d353ba3e
@@ -45,7 +45,7 @@ class Item: self.items.add(val) count[key] += 1 if key == "el": - self.el = key + self.el = val self.score = Score(count["id"], count["class"], count["el"])
src/settingscascade/selector.py
ReplaceText(target='val' @(48,26)->(48,29))
class Item: self.items.add(val) count[key] += 1 if key == "el": self.el = key self.score = Score(count["id"], count["class"], count["el"])
class Item: self.items.add(val) count[key] += 1 if key == "el": self.el = val self.score = Score(count["id"], count["class"], count["el"])
2,245
https://:@github.com/Javinator9889/ServiceCreator.git
f874aa280e7860ed7603d182fca0c62997debbb4
@@ -81,7 +81,7 @@ def makeBashScript(filename: str, new_sh_file: str): pprint(script_content) pprint(script_content[0].rstrip()) pprint(script_content[0].strip()) - if (script_content[0].rstrip() != OP_BASH_HEADER) or (script_content[0].rstrip() != OP_SH_HEADER): + if (script_content[0].rstrip() !=...
service_creator/utils/__init__.py
ReplaceText(target='and' @(84,54)->(84,56))
def makeBashScript(filename: str, new_sh_file: str): pprint(script_content) pprint(script_content[0].rstrip()) pprint(script_content[0].strip()) if (script_content[0].rstrip() != OP_BASH_HEADER) or (script_content[0].rstrip() != OP_SH_HEADER): script_content.insert(0, OP_SH_HEADER + "\n\n")...
def makeBashScript(filename: str, new_sh_file: str): pprint(script_content) pprint(script_content[0].rstrip()) pprint(script_content[0].strip()) if (script_content[0].rstrip() != OP_BASH_HEADER) and (script_content[0].rstrip() != OP_SH_HEADER): script_content.insert(0, OP_SH_HEADER + "\n\n"...
2,246
https://:@github.com/AlexeyTrekin/pansharpen.git
ab65f7248e7b2fbac5f5ac43ff0af7c8902766e3
@@ -54,7 +54,7 @@ def scale(img, dtype, if np.issubdtype(dtype, np.integer): if out_min is None: out_min = np.iinfo(dtype).min - if in_max is None: + if out_max is None: out_max = np.iinfo(dtype).max # default range for float is 0:1 else:
pysharpen/preprocessing/type_conversion.py
ReplaceText(target='out_max' @(57,11)->(57,17))
def scale(img, dtype, if np.issubdtype(dtype, np.integer): if out_min is None: out_min = np.iinfo(dtype).min if in_max is None: out_max = np.iinfo(dtype).max # default range for float is 0:1 else:
def scale(img, dtype, if np.issubdtype(dtype, np.integer): if out_min is None: out_min = np.iinfo(dtype).min if out_max is None: out_max = np.iinfo(dtype).max # default range for float is 0:1 else:
2,247
https://:@github.com/hendrikx-itc/python-minerva.git
6044f69ae630756a5e2ba468cc1da4f1ea904725
@@ -64,7 +64,7 @@ def names_to_entity_ids(cursor, entity_type: str, names: List[str]) -> List[int] for name, entity_id in rows: if entity_id is None: - entity_id = create_entity_from_name(cursor, entity_type, name) + entity_id = create_entity_from_name(cursor, entity_type_name, nam...
src/minerva/directory/helpers.py
ReplaceText(target='entity_type_name' @(67,56)->(67,67))
def names_to_entity_ids(cursor, entity_type: str, names: List[str]) -> List[int] for name, entity_id in rows: if entity_id is None: entity_id = create_entity_from_name(cursor, entity_type, name) entity_ids.append(entity_id)
def names_to_entity_ids(cursor, entity_type: str, names: List[str]) -> List[int] for name, entity_id in rows: if entity_id is None: entity_id = create_entity_from_name(cursor, entity_type_name, name) entity_ids.append(entity_id)
2,248
https://:@github.com/maykinmedia/django-better-admin-arrayfield.git
4ff331cf5b11f24e87e5573d36960802603a5773
@@ -30,7 +30,7 @@ class DynamicArrayField(forms.Field): ) if errors: raise forms.ValidationError(list(chain.from_iterable(errors))) - if cleaned_data and self.required: + if not cleaned_data and self.required: raise forms.ValidationError(self.error_messa...
django_better_admin_arrayfield/forms/fields.py
ReplaceText(target='not ' @(33,11)->(33,11))
class DynamicArrayField(forms.Field): ) if errors: raise forms.ValidationError(list(chain.from_iterable(errors))) if cleaned_data and self.required: raise forms.ValidationError(self.error_messages["required"]) return cleaned_data
class DynamicArrayField(forms.Field): ) if errors: raise forms.ValidationError(list(chain.from_iterable(errors))) if not cleaned_data and self.required: raise forms.ValidationError(self.error_messages["required"]) return cleaned_data
2,249
https://:@github.com/gsanhueza/BlastSight.git
e569ea39b5e97a60abf3e0d8a75eb4f7299b00b9
@@ -22,7 +22,7 @@ class NormalMode(Mode): self.set_z_rotation(widget, widget.zWorldRot + dx) elif event.buttons() == Qt.RightButton: self.set_x_rotation(widget, widget.xWorldRot + dy) - self.set_y_rotation(widget, widget.yWorldRot - dx) + self.set_y_rotation(widg...
libraries/Controller/normalmode.py
ReplaceText(target='+' @(25,57)->(25,58))
class NormalMode(Mode): self.set_z_rotation(widget, widget.zWorldRot + dx) elif event.buttons() == Qt.RightButton: self.set_x_rotation(widget, widget.xWorldRot + dy) self.set_y_rotation(widget, widget.yWorldRot - dx) elif event.buttons() == Qt.MiddleButton: ...
class NormalMode(Mode): self.set_z_rotation(widget, widget.zWorldRot + dx) elif event.buttons() == Qt.RightButton: self.set_x_rotation(widget, widget.xWorldRot + dy) self.set_y_rotation(widget, widget.yWorldRot + dx) elif event.buttons() == Qt.MiddleButton: ...
2,250
https://:@github.com/gsanhueza/BlastSight.git
ba4c91b6850cb04fec7d049d0f20e7ea86b79454
@@ -34,7 +34,7 @@ class LineGL(GLDrawable): # Fill buffers (see GLDrawable) self.fill_buffer(_POSITION, 3, vertices, GLfloat, GL_FLOAT, self.vbos[_POSITION]) - self.fill_buffer(_COLOR, 4, colors, GLfloat, GL_FLOAT, self.vbos[_POSITION]) + self.fill_buffer(_COLOR, 4, colors, GLfloat, GL...
blastsight/view/drawables/linegl.py
ReplaceText(target='_COLOR' @(37,73)->(37,82))
class LineGL(GLDrawable): # Fill buffers (see GLDrawable) self.fill_buffer(_POSITION, 3, vertices, GLfloat, GL_FLOAT, self.vbos[_POSITION]) self.fill_buffer(_COLOR, 4, colors, GLfloat, GL_FLOAT, self.vbos[_POSITION]) glVertexAttribDivisor(_COLOR, 1)
class LineGL(GLDrawable): # Fill buffers (see GLDrawable) self.fill_buffer(_POSITION, 3, vertices, GLfloat, GL_FLOAT, self.vbos[_POSITION]) self.fill_buffer(_COLOR, 4, colors, GLfloat, GL_FLOAT, self.vbos[_COLOR]) glVertexAttribDivisor(_COLOR, 1)
2,251
https://:@github.com/clemsciences/comparison_sigurdr_siegfried.git
1d6a62eda93744950d2959abd1c2389b12d70d97
@@ -57,7 +57,7 @@ def read_txt(main_link: str) -> List: """ retrieved_texts = [] directory = "extracted_" + main_link.split("/")[-1].split(".")[0][:-3] - if os.path.exists(directory): + if not os.path.exists(directory): nib_scripts.extract_tei_from_html() for i in range(1, len(os.list...
sigurd/nib_augsburg/nib_reader.py
ReplaceText(target='not ' @(60,7)->(60,7))
def read_txt(main_link: str) -> List: """ retrieved_texts = [] directory = "extracted_" + main_link.split("/")[-1].split(".")[0][:-3] if os.path.exists(directory): nib_scripts.extract_tei_from_html() for i in range(1, len(os.listdir(directory))): filename = os.path.join(direct...
def read_txt(main_link: str) -> List: """ retrieved_texts = [] directory = "extracted_" + main_link.split("/")[-1].split(".")[0][:-3] if not os.path.exists(directory): nib_scripts.extract_tei_from_html() for i in range(1, len(os.listdir(directory))): filename = os.path.join(di...
2,252
https://:@github.com/cfhamlet/os-3m-engine.git
b6a8890df08b38e6201e3b8cc18e870a7f61fda4
@@ -89,7 +89,7 @@ def create(frontend_cls='os_m3_engine.ootb.StdinFrontend', default_engine_transport_config = ENGINE_TRANSPORT_BRIDGE_CONFIG \ if backend_cls is not None else ENGINE_TRANSPORT_CONFIG - e_transport_config = engine_backend_config + e_transport_config = engine_transport_config i...
src/os_m3_engine/launcher.py
ReplaceText(target='engine_transport_config' @(92,25)->(92,46))
def create(frontend_cls='os_m3_engine.ootb.StdinFrontend', default_engine_transport_config = ENGINE_TRANSPORT_BRIDGE_CONFIG \ if backend_cls is not None else ENGINE_TRANSPORT_CONFIG e_transport_config = engine_backend_config if engine_transport_config in (ENGINE_TRANSPORT_CONFIG, ENGINE_TRANSP...
def create(frontend_cls='os_m3_engine.ootb.StdinFrontend', default_engine_transport_config = ENGINE_TRANSPORT_BRIDGE_CONFIG \ if backend_cls is not None else ENGINE_TRANSPORT_CONFIG e_transport_config = engine_transport_config if engine_transport_config in (ENGINE_TRANSPORT_CONFIG, ENGINE_TRAN...
2,253
https://:@github.com/dstegelman/python-usps.git
88e04fab6f7c4b8024558de10796513b6b355333
@@ -57,7 +57,7 @@ class USPSAddressService(object): if root.tag == 'Error': raise USPSXMLError(root) error = root.find('.//Error') - if error is None: + if error is not None: raise USPSXMLError(error) return root
usps/addressinformation/base.py
ReplaceText(target=' is not ' @(60,16)->(60,20))
class USPSAddressService(object): if root.tag == 'Error': raise USPSXMLError(root) error = root.find('.//Error') if error is None: raise USPSXMLError(error) return root
class USPSAddressService(object): if root.tag == 'Error': raise USPSXMLError(root) error = root.find('.//Error') if error is not None: raise USPSXMLError(error) return root
2,254
https://:@github.com/NiklasRosenstein/upython.git
9ccceff81d433a6220665e53a1938522df4fdf0c
@@ -120,7 +120,7 @@ def _check_include_file(filename, include_patterns, exclude_patterns): def is_virtualenv(): - return hasattr(sys, 'real_prefix') or (sys.prefix == sys.base_prefix) + return hasattr(sys, 'real_prefix') or (sys.prefix != sys.base_prefix) class PackageNotFound(Exception):
lib/install.py
ReplaceText(target='!=' @(123,52)->(123,54))
def _check_include_file(filename, include_patterns, exclude_patterns): def is_virtualenv(): return hasattr(sys, 'real_prefix') or (sys.prefix == sys.base_prefix) class PackageNotFound(Exception):
def _check_include_file(filename, include_patterns, exclude_patterns): def is_virtualenv(): return hasattr(sys, 'real_prefix') or (sys.prefix != sys.base_prefix) class PackageNotFound(Exception):
2,255
https://:@github.com/NYTimes/kaichu.git
357040e9a665e2eb1cf99654a220741c625b347e
@@ -53,7 +53,7 @@ class KaichuManager(object): else: return True else: - return True + return False def __init__(self, tissue, options, noseconfig):
kaichu/kaichu/interface.py
ReplaceText(target='False' @(56,19)->(56,23))
class KaichuManager(object): else: return True else: return True def __init__(self, tissue, options, noseconfig):
class KaichuManager(object): else: return True else: return False def __init__(self, tissue, options, noseconfig):
2,256
https://:@github.com/jflaherty/phishnet_api_v3.git
738aa8a756f8f816459af12dc10d8763dfb1136c
@@ -24,7 +24,7 @@ def check_apikey(f): def check_authkey(f): def wrapper(*args, **kwargs): - if not args[0].authkey and not args[0].uid == args[1]: + if not args[0].authkey or not args[0].uid == args[1]: args[0].authorize(args[1]) return f(*args, **kwargs) return wrapper...
phishnet_api_v3/decorators.py
ReplaceText(target='or' @(27,31)->(27,34))
def check_apikey(f): def check_authkey(f): def wrapper(*args, **kwargs): if not args[0].authkey and not args[0].uid == args[1]: args[0].authorize(args[1]) return f(*args, **kwargs) return wrapper
def check_apikey(f): def check_authkey(f): def wrapper(*args, **kwargs): if not args[0].authkey or not args[0].uid == args[1]: args[0].authorize(args[1]) return f(*args, **kwargs) return wrapper
2,257
https://:@github.com/gxx/pathresolver.git
9ff96ef6ac8c6fe324fb2007cc769016b9a0f085
@@ -10,7 +10,7 @@ MATCH_ALL = '*' # ---- Basic Resolvers ---- # # Resolve by Attribute -attribute_resolver = KeyResolver(lambda k, v: getattr(k, v), (AttributeError, TypeError)) +attribute_resolver = KeyResolver(lambda k, v: getattr(v, k), (AttributeError, TypeError)) # Resolve by Key (i.e. dictionary) key_look...
pathresolver/resolver/resolvers.py
ArgSwap(idxs=0<->1 @(13,46)->(13,53))
MATCH_ALL = '*' # ---- Basic Resolvers ---- # # Resolve by Attribute attribute_resolver = KeyResolver(lambda k, v: getattr(k, v), (AttributeError, TypeError)) # Resolve by Key (i.e. dictionary) key_lookup_resolver = KeyResolver(lambda k, v: v[k], (KeyError, TypeError))
MATCH_ALL = '*' # ---- Basic Resolvers ---- # # Resolve by Attribute attribute_resolver = KeyResolver(lambda k, v: getattr(v, k), (AttributeError, TypeError)) # Resolve by Key (i.e. dictionary) key_lookup_resolver = KeyResolver(lambda k, v: v[k], (KeyError, TypeError))
2,258
https://:@github.com/frank2/schizophrenia.git
443bfd84c89aa270ba30bdeb303a616354959d34
@@ -305,7 +305,7 @@ class Manager(object): def launch_task(self, task_obj, *args, **kwargs): tid_obj = self.register_task(task_obj) task_obj.run(*args, **kwargs) - return tid_obj + return task_obj def spawn_task(self, task_name, *args, **kwargs): return self.launch_t...
schizophrenia/manager.py
ReplaceText(target='task_obj' @(308,15)->(308,22))
class Manager(object): def launch_task(self, task_obj, *args, **kwargs): tid_obj = self.register_task(task_obj) task_obj.run(*args, **kwargs) return tid_obj def spawn_task(self, task_name, *args, **kwargs): return self.launch_task(self.create_task(task_name), *args, **kwa...
class Manager(object): def launch_task(self, task_obj, *args, **kwargs): tid_obj = self.register_task(task_obj) task_obj.run(*args, **kwargs) return task_obj def spawn_task(self, task_name, *args, **kwargs): return self.launch_task(self.create_task(task_name), *args, **kw...
2,259
https://:@github.com/hibtc/madqt.git
f832813972a0b40d95237d0c645157c550772e0d
@@ -410,7 +410,7 @@ class Model: # shortcut for thin elements: if float(self.elements[ix].length) == 0: - return y[x] + return y[ix] lo = x.start-1 if x.start > 0 else x.start hi = x.stop+1
src/madgui/model/madx.py
ReplaceText(target='ix' @(413,21)->(413,22))
class Model: # shortcut for thin elements: if float(self.elements[ix].length) == 0: return y[x] lo = x.start-1 if x.start > 0 else x.start hi = x.stop+1
class Model: # shortcut for thin elements: if float(self.elements[ix].length) == 0: return y[ix] lo = x.start-1 if x.start > 0 else x.start hi = x.stop+1
2,260
https://:@github.com/soulhave/woven-gutter-gae.git
33b93fde1ae059d1ad2911ef221eb0131ffebcff
@@ -100,7 +100,7 @@ class SwitchManager(ModelDict): conditions = self.get(key) if not conditions: # XXX: option to have default return value? - return False + return True conditions = conditions.value if conditions.get('global'):
gargoyle/models.py
ReplaceText(target='True' @(103,19)->(103,24))
class SwitchManager(ModelDict): conditions = self.get(key) if not conditions: # XXX: option to have default return value? return False conditions = conditions.value if conditions.get('global'):
class SwitchManager(ModelDict): conditions = self.get(key) if not conditions: # XXX: option to have default return value? return True conditions = conditions.value if conditions.get('global'):
2,261
https://:@github.com/soulhave/woven-gutter-gae.git
a2b6a601ae849f4c610967c28fe469b02fd8f730
@@ -6,4 +6,4 @@ class SwitchAdmin(admin.ModelAdmin): list_filter = ('status',) search_fields = ('label', 'key', 'value') -admin.site.register(SwitchAdmin, Switch) \ No newline at end of file +admin.site.register(Switch, SwitchAdmin) \ No newline at end of file
gargoyle/admin.py
ArgSwap(idxs=0<->1 @(9,0)->(9,19))
class SwitchAdmin(admin.ModelAdmin): list_filter = ('status',) search_fields = ('label', 'key', 'value') admin.site.register(SwitchAdmin, Switch) \ No newline at end of file \ No newline at end of file
class SwitchAdmin(admin.ModelAdmin): list_filter = ('status',) search_fields = ('label', 'key', 'value') \ No newline at end of file admin.site.register(Switch, SwitchAdmin) \ No newline at end of file
2,262
https://:@github.com/combatopera/aridity.git
46f2e7adf7dace0001676c27a9811a55183e53f1
@@ -72,7 +72,7 @@ class AbstractContext(Resolvable): # TODO LATER: Some methods should probably be c = self for name in path[:-1]: that = self.resolvables.get(name) - that = Context(c) if that is None else that.resolve(c) + c = Context(c) if that is None else that.re...
aridimpl/context.py
ReplaceText(target='c' @(75,12)->(75,16))
class AbstractContext(Resolvable): # TODO LATER: Some methods should probably be c = self for name in path[:-1]: that = self.resolvables.get(name) that = Context(c) if that is None else that.resolve(c) del c
class AbstractContext(Resolvable): # TODO LATER: Some methods should probably be c = self for name in path[:-1]: that = self.resolvables.get(name) c = Context(c) if that is None else that.resolve(c) del c
2,263
https://:@github.com/hudora/huDjango.git
874df198c5508223ff55fd96539fda603f660a81
@@ -50,7 +50,7 @@ class ClientTrackMiddleware(object): request.clienttrack_last_visit = request.clienttrack_first_visit = None def process_response(self, request, response): - if (not getattr('clienttrack_prohibit', request, False)) or not request.clienttrack_first_visit: + if (not...
hudjango/middleware/clienttrack.py
ArgSwap(idxs=0<->1 @(53,16)->(53,23))
class ClientTrackMiddleware(object): request.clienttrack_last_visit = request.clienttrack_first_visit = None def process_response(self, request, response): if (not getattr('clienttrack_prohibit', request, False)) or not request.clienttrack_first_visit: # even if clienttrack...
class ClientTrackMiddleware(object): request.clienttrack_last_visit = request.clienttrack_first_visit = None def process_response(self, request, response): if (not getattr(request, 'clienttrack_prohibit', False)) or not request.clienttrack_first_visit: # even if clienttrack...
2,264
https://:@gitlab.com/cossartlab/cicada.git
f25250e95ffb716ac3e8bc60be839b9b1e10497d
@@ -453,7 +453,7 @@ class CicadaTransientAmplitudeAnalysis(CicadaAnalysis): ax1.set_facecolor(background_color) fig.patch.set_facecolor(background_color) - svm = sns.catplot(x=x_axis_name, y="MeanProminence", hue=hue, data=gobal_amplitude_data_table, + svm = sns.catplot(x=x_axis_name, ...
src/cicada/analysis/cicada_transient_amplitude_analysis.py
ReplaceText(target='data_table' @(456,75)->(456,101))
class CicadaTransientAmplitudeAnalysis(CicadaAnalysis): ax1.set_facecolor(background_color) fig.patch.set_facecolor(background_color) svm = sns.catplot(x=x_axis_name, y="MeanProminence", hue=hue, data=gobal_amplitude_data_table, hue_order=None, ...
class CicadaTransientAmplitudeAnalysis(CicadaAnalysis): ax1.set_facecolor(background_color) fig.patch.set_facecolor(background_color) svm = sns.catplot(x=x_axis_name, y="MeanProminence", hue=hue, data=data_table, hue_order=None, kind=kin...
2,265
https://:@github.com/gtoonstra/sqlineage.git
cb395147b4f4c81248642228da9739995db2bb71
@@ -15,7 +15,7 @@ class TestSimpleInsert(unittest.TestCase): self.result = [] def verify_result(self, expected): - self.assertEqual(self.result, expected) + self.assertEqual(expected, self.result) def run_test(self, filename, expected): self.clear_result()
tests/test_simple_insert.py
ArgSwap(idxs=0<->1 @(18,8)->(18,24))
class TestSimpleInsert(unittest.TestCase): self.result = [] def verify_result(self, expected): self.assertEqual(self.result, expected) def run_test(self, filename, expected): self.clear_result()
class TestSimpleInsert(unittest.TestCase): self.result = [] def verify_result(self, expected): self.assertEqual(expected, self.result) def run_test(self, filename, expected): self.clear_result()
2,266
https://:@github.com/iamjli/keggx.git
c311827d187f2f04dbe6389ed3f274c8b978d703
@@ -386,6 +386,6 @@ def output_DiGraph_as_graphml(graph, path): for source,target in list(graph_out.edges): if graph_out.has_edge(target, source): graph_out.remove_edge(source, target) - nx.write_graphml(graph, path) + nx.write_graphml(graph_out, path) return path
src/KEGGX.py
ReplaceText(target='graph_out' @(389,18)->(389,23))
def output_DiGraph_as_graphml(graph, path): for source,target in list(graph_out.edges): if graph_out.has_edge(target, source): graph_out.remove_edge(source, target) nx.write_graphml(graph, path) return path
def output_DiGraph_as_graphml(graph, path): for source,target in list(graph_out.edges): if graph_out.has_edge(target, source): graph_out.remove_edge(source, target) nx.write_graphml(graph_out, path) return path
2,267
https://:@github.com/sgammon/canteen.git
a08718c0c160e698968f8cbebb367ba22df0370a
@@ -569,7 +569,7 @@ class RedisAdapter(DirectedGraphAdapter): elif cls.EngineConfig.mode == RedisMode.hashkey_blob: # build key and extract group - desired_key = model.Key.from_raw(flattened) + desired_key = model.Key.from_raw(joined) root = (ancestor for ancestor in desired_key...
canteen/model/adapter/redis.py
ReplaceText(target='joined' @(572,41)->(572,50))
class RedisAdapter(DirectedGraphAdapter): elif cls.EngineConfig.mode == RedisMode.hashkey_blob: # build key and extract group desired_key = model.Key.from_raw(flattened) root = (ancestor for ancestor in desired_key.ancestry).next() tail = ( desired_key.flatten(Tru...
class RedisAdapter(DirectedGraphAdapter): elif cls.EngineConfig.mode == RedisMode.hashkey_blob: # build key and extract group desired_key = model.Key.from_raw(joined) root = (ancestor for ancestor in desired_key.ancestry).next() tail = ( desired_key.flatten(True)[...
2,268
https://:@github.com/prateek3211/statsmodels.git
5b5665a3859f663e8709e16e5e8207344716ecfd
@@ -50,7 +50,7 @@ def plot_corr(dcorr, xnames=None, ynames=None, title=None, normcolor=False, if ax is None: create_colorbar = True else: - create_colorbar = True + create_colorbar = False fig, ax = utils.create_mpl_ax(ax) from matplotlib import cm
scikits/statsmodels/graphics/correlation.py
ReplaceText(target='False' @(53,26)->(53,30))
def plot_corr(dcorr, xnames=None, ynames=None, title=None, normcolor=False, if ax is None: create_colorbar = True else: create_colorbar = True fig, ax = utils.create_mpl_ax(ax) from matplotlib import cm
def plot_corr(dcorr, xnames=None, ynames=None, title=None, normcolor=False, if ax is None: create_colorbar = True else: create_colorbar = False fig, ax = utils.create_mpl_ax(ax) from matplotlib import cm
2,269
https://:@github.com/prateek3211/statsmodels.git
e2e40c4c53e8e87c98423da5c648c25d1ed24799
@@ -69,5 +69,5 @@ def bkfilter(X, low=6, high=32, K=12): bweights -= bweights.mean() # make sure weights sum to zero if X.ndim == 2: bweights = bweights[:,None] - return fftconvolve(bweights, X, mode='valid') # get a centered moving avg/ + return fftconvolve(X, bweights, mode='valid') # get a c...
statsmodels/tsa/filters/bk_filter.py
ArgSwap(idxs=0<->1 @(72,11)->(72,22))
def bkfilter(X, low=6, high=32, K=12): bweights -= bweights.mean() # make sure weights sum to zero if X.ndim == 2: bweights = bweights[:,None] return fftconvolve(bweights, X, mode='valid') # get a centered moving avg/ # convolution
def bkfilter(X, low=6, high=32, K=12): bweights -= bweights.mean() # make sure weights sum to zero if X.ndim == 2: bweights = bweights[:,None] return fftconvolve(X, bweights, mode='valid') # get a centered moving avg/ # convolution
2,270
https://:@github.com/prateek3211/statsmodels.git
38a7e8ec399169b49185265450c1a6dbdf423c2f
@@ -99,7 +99,7 @@ class QuantReg(RegressionModel): beta = np.ones(rank) # TODO: better start diff = 10 - while itrat < 1000 or diff > 1e-6: + while itrat < 1000 and diff > 1e-6: itrat += 1 beta0 = beta beta = dot(pinv(dot(xstar.T, exog)), xstar.T...
statsmodels/regression/quantreg.py
ReplaceText(target='and' @(102,27)->(102,29))
class QuantReg(RegressionModel): beta = np.ones(rank) # TODO: better start diff = 10 while itrat < 1000 or diff > 1e-6: itrat += 1 beta0 = beta beta = dot(pinv(dot(xstar.T, exog)), xstar.T, endog)
class QuantReg(RegressionModel): beta = np.ones(rank) # TODO: better start diff = 10 while itrat < 1000 and diff > 1e-6: itrat += 1 beta0 = beta beta = dot(pinv(dot(xstar.T, exog)), xstar.T, endog)
2,271
https://:@github.com/prateek3211/statsmodels.git
d9b699a35e1c148891fe77831cb840c3a8410c35
@@ -158,7 +158,7 @@ def lowess(endog, exog, frac=2.0/3.0, it=3, delta=0.0, is_sorted=False, if not is_sorted: # Sort both inputs according to the ascending order of x values - sort_index = np.argsort(exog) + sort_index = np.argsort(x) x = np.array(x[sort_index]) y = np.ar...
statsmodels/nonparametric/smoothers_lowess.py
ReplaceText(target='x' @(161,32)->(161,36))
def lowess(endog, exog, frac=2.0/3.0, it=3, delta=0.0, is_sorted=False, if not is_sorted: # Sort both inputs according to the ascending order of x values sort_index = np.argsort(exog) x = np.array(x[sort_index]) y = np.array(y[sort_index])
def lowess(endog, exog, frac=2.0/3.0, it=3, delta=0.0, is_sorted=False, if not is_sorted: # Sort both inputs according to the ascending order of x values sort_index = np.argsort(x) x = np.array(x[sort_index]) y = np.array(y[sort_index])
2,272
https://:@github.com/prateek3211/statsmodels.git
7b29fa27d738c9c60f2a79df77b3b523a2d78028
@@ -171,7 +171,7 @@ def lowess(endog, exog, frac=2.0/3.0, it=3, delta=0.0, is_sorted=False, # rebuild yfitted with original indices # a bit messy: y might have been selected twice if not is_sorted: - yfitted_ = np.empty_like(endog) + yfitted_ = np.empty_like(y) ...
statsmodels/nonparametric/smoothers_lowess.py
ReplaceText(target='y' @(174,37)->(174,42))
def lowess(endog, exog, frac=2.0/3.0, it=3, delta=0.0, is_sorted=False, # rebuild yfitted with original indices # a bit messy: y might have been selected twice if not is_sorted: yfitted_ = np.empty_like(endog) yfitted_.fill(np.nan) yfitted_[sort_index] =...
def lowess(endog, exog, frac=2.0/3.0, it=3, delta=0.0, is_sorted=False, # rebuild yfitted with original indices # a bit messy: y might have been selected twice if not is_sorted: yfitted_ = np.empty_like(y) yfitted_.fill(np.nan) yfitted_[sort_index] = yfi...
2,273
https://:@github.com/prateek3211/statsmodels.git
d1ed308fa17c86b94a41ee568e896751a4ca6f26
@@ -433,7 +433,7 @@ class VARMAX(MLEModel): if self.measurement_error: # Force these to be positive constrained[self._params_obs_cov] = ( - constrained[self._params_obs_cov]**2) + unconstrained[self._params_obs_cov]**2) return constrained
statsmodels/tsa/statespace/varmax.py
ReplaceText(target='unconstrained' @(436,16)->(436,27))
class VARMAX(MLEModel): if self.measurement_error: # Force these to be positive constrained[self._params_obs_cov] = ( constrained[self._params_obs_cov]**2) return constrained
class VARMAX(MLEModel): if self.measurement_error: # Force these to be positive constrained[self._params_obs_cov] = ( unconstrained[self._params_obs_cov]**2) return constrained
2,274
https://:@github.com/prateek3211/statsmodels.git
8a0a1a18dcbb5701937c4466a7724813cc870b60
@@ -815,7 +815,7 @@ class GLM(base.LikelihoodModel): """ if (max_start_irls > 0) and (start_params is None): - irls_rslt = self._fit_irls(start_params=start_params, maxiter=maxiter, + irls_rslt = self._fit_irls(start_params=start_params, maxiter=max_start_irls, ...
statsmodels/genmod/generalized_linear_model.py
ReplaceText(target='max_start_irls' @(818,74)->(818,81))
class GLM(base.LikelihoodModel): """ if (max_start_irls > 0) and (start_params is None): irls_rslt = self._fit_irls(start_params=start_params, maxiter=maxiter, tol=tol, scale=scale, cov_type=cov_type, cov_kw...
class GLM(base.LikelihoodModel): """ if (max_start_irls > 0) and (start_params is None): irls_rslt = self._fit_irls(start_params=start_params, maxiter=max_start_irls, tol=tol, scale=scale, cov_type=cov_type, ...
2,275
https://:@github.com/prateek3211/statsmodels.git
6882e53d5cfd5d2b3dc2d08f480f6529ac0883d7
@@ -158,7 +158,7 @@ class Model(object): if len(cols) < len(exog.columns): exog = exog[cols] cols = list(design_info.term_names) - for col in cols: + for col in drop_cols: try: cols.remove(col) ...
statsmodels/base/model.py
ReplaceText(target='drop_cols' @(161,27)->(161,31))
class Model(object): if len(cols) < len(exog.columns): exog = exog[cols] cols = list(design_info.term_names) for col in cols: try: cols.remove(col) except ValueError:
class Model(object): if len(cols) < len(exog.columns): exog = exog[cols] cols = list(design_info.term_names) for col in drop_cols: try: cols.remove(col) except ValueError:
2,276
https://:@github.com/prateek3211/statsmodels.git
2f20e7e54fc4afcc367a8b858f107eacd5ff607f
@@ -1998,7 +1998,7 @@ class MixedLM(base.LikelihoodModel): for meth in method: if meth.lower() in ["newton", "ncg"]: raise ValueError( - "method %s not available for MixedLM" % method) + "method %s not available for MixedLM" % meth) ...
statsmodels/regression/mixed_linear_model.py
ReplaceText(target='meth' @(2001,60)->(2001,66))
class MixedLM(base.LikelihoodModel): for meth in method: if meth.lower() in ["newton", "ncg"]: raise ValueError( "method %s not available for MixedLM" % method) self.reml = reml self.cov_pen = cov_pen
class MixedLM(base.LikelihoodModel): for meth in method: if meth.lower() in ["newton", "ncg"]: raise ValueError( "method %s not available for MixedLM" % meth) self.reml = reml self.cov_pen = cov_pen
2,277
https://:@github.com/prateek3211/statsmodels.git
b35f775ec7358aae763f23c6dc7a9f158680b234
@@ -1869,7 +1869,7 @@ class GLMResults(base.LikelihoodModelResults): ] if hasattr(self, 'cov_type'): - top_right.append(('Covariance Type:', [self.cov_type])) + top_left.append(('Covariance Type:', [self.cov_type])) if title is None: title =...
statsmodels/genmod/generalized_linear_model.py
ReplaceText(target='top_left' @(1872,12)->(1872,21))
class GLMResults(base.LikelihoodModelResults): ] if hasattr(self, 'cov_type'): top_right.append(('Covariance Type:', [self.cov_type])) if title is None: title = "Generalized Linear Model Regression Results"
class GLMResults(base.LikelihoodModelResults): ] if hasattr(self, 'cov_type'): top_left.append(('Covariance Type:', [self.cov_type])) if title is None: title = "Generalized Linear Model Regression Results"
2,278
https://:@github.com/prateek3211/statsmodels.git
fa6a59297eda1a12e834a621ba34df48ccfca314
@@ -32,7 +32,7 @@ def _check_wts(weights, wts): warnings.warn('`wts` method is deprecated. Use `weights` instead', DeprecationWarning) weights = weights if weights is not None else wts - return wts + return weights class Penalty(object):
statsmodels/base/_penalties.py
ReplaceText(target='weights' @(35,11)->(35,14))
def _check_wts(weights, wts): warnings.warn('`wts` method is deprecated. Use `weights` instead', DeprecationWarning) weights = weights if weights is not None else wts return wts class Penalty(object):
def _check_wts(weights, wts): warnings.warn('`wts` method is deprecated. Use `weights` instead', DeprecationWarning) weights = weights if weights is not None else wts return weights class Penalty(object):
2,279
https://:@github.com/chiffa/BioFlow.git
b5cb03eaa3f4c00494581e4b1583b5189a40b387
@@ -63,5 +63,5 @@ def wipe_dir(path): else: logger.debug('performing a rmtree') - rmtree(path) + rmtree(directory_name) return True
BioFlow/utils/general_utils/high_level_os_io.py
ReplaceText(target='directory_name' @(66,15)->(66,19))
def wipe_dir(path): else: logger.debug('performing a rmtree') rmtree(path) return True
def wipe_dir(path): else: logger.debug('performing a rmtree') rmtree(directory_name) return True
2,280
https://:@github.com/scottstanie/apertools.git
e3c2d04bf6e3d5469c1d4e799bcec8ca85bccf1d
@@ -117,6 +117,6 @@ def combine_complex(img_list): img_out += next_img # Now only on overlap, take the previous's pixels overlap_idxs = (img_out != 0) & (next_img != 0) - img_out[overlap_idxs] = img_out[overlap_idxs] + img_out[overlap_idxs] = next_img[overlap_idxs] return...
apertools/stitching.py
ReplaceText(target='next_img' @(120,32)->(120,39))
def combine_complex(img_list): img_out += next_img # Now only on overlap, take the previous's pixels overlap_idxs = (img_out != 0) & (next_img != 0) img_out[overlap_idxs] = img_out[overlap_idxs] return img_out
def combine_complex(img_list): img_out += next_img # Now only on overlap, take the previous's pixels overlap_idxs = (img_out != 0) & (next_img != 0) img_out[overlap_idxs] = next_img[overlap_idxs] return img_out
2,281
https://:@github.com/ihfazhillah/qaamus-python.git
fb2343f4524f9b5817e794936444edfbad66da67
@@ -37,7 +37,7 @@ class IndAraParser(object): dengan arti utama dengan **kata-kunci** *ind* adalah indonesia *ara* adalah arti arabnya.""" - if soup is not None: + if soup is None: soup = self.soup ind = [x.text for x in soup.select("td > a")]
qaamus/ind_ara_parser.py
ReplaceText(target=' is ' @(40,15)->(40,23))
class IndAraParser(object): dengan arti utama dengan **kata-kunci** *ind* adalah indonesia *ara* adalah arti arabnya.""" if soup is not None: soup = self.soup ind = [x.text for x in soup.select("td > a")]
class IndAraParser(object): dengan arti utama dengan **kata-kunci** *ind* adalah indonesia *ara* adalah arti arabnya.""" if soup is None: soup = self.soup ind = [x.text for x in soup.select("td > a")]
2,282
https://:@github.com/thautwarm/Linq.py.git
c58d2c116f1addfb74225139011eda70b5313883
@@ -23,7 +23,7 @@ def Extend(self: Flow, *others): @extension_class(list) def Sort(self: Flow, by): - if not is_to_destruct(by): + if is_to_destruct(by): by = destruct_func(by) self.stream.sort(key=by) return self
linq/standard/list.py
ReplaceText(target='' @(26,7)->(26,11))
def Extend(self: Flow, *others): @extension_class(list) def Sort(self: Flow, by): if not is_to_destruct(by): by = destruct_func(by) self.stream.sort(key=by) return self
def Extend(self: Flow, *others): @extension_class(list) def Sort(self: Flow, by): if is_to_destruct(by): by = destruct_func(by) self.stream.sort(key=by) return self
2,283
https://:@github.com/jlevy44/PathFlowAI.git
7ff099037b829dd952bc9148248639ffeaf25300
@@ -277,7 +277,7 @@ def save_dataset(arr, masks, out_zarr, out_pkl, no_zarr): out_pkl:str Pickle output file. """ - if no_zarr: + if not no_zarr: arr.astype('uint8').to_zarr(out_zarr, overwrite=True) pickle.dump(masks,open(out_pkl,'wb'))
pathflowai/utils.py
ReplaceText(target='not ' @(280,4)->(280,4))
def save_dataset(arr, masks, out_zarr, out_pkl, no_zarr): out_pkl:str Pickle output file. """ if no_zarr: arr.astype('uint8').to_zarr(out_zarr, overwrite=True) pickle.dump(masks,open(out_pkl,'wb'))
def save_dataset(arr, masks, out_zarr, out_pkl, no_zarr): out_pkl:str Pickle output file. """ if not no_zarr: arr.astype('uint8').to_zarr(out_zarr, overwrite=True) pickle.dump(masks,open(out_pkl,'wb'))
2,284
https://:@github.com/jlevy44/PathFlowAI.git
2076c33a19501c7b2fd778d86da7f66558e5b1de
@@ -694,7 +694,7 @@ def modify_patch_info(input_info_db='patch_info.db', slide_labels=pd.DataFrame() included_annotations = copy.deepcopy(pos_annotation_class) included_annotations.extend(other_annotations) print(df.shape,included_annotations) - if not modify_patches: + if modify_patches: df=df[np...
pathflowai/utils.py
ReplaceText(target='' @(697,6)->(697,10))
def modify_patch_info(input_info_db='patch_info.db', slide_labels=pd.DataFrame() included_annotations = copy.deepcopy(pos_annotation_class) included_annotations.extend(other_annotations) print(df.shape,included_annotations) if not modify_patches: df=df[np.isin(df['annotation'],included_annotations...
def modify_patch_info(input_info_db='patch_info.db', slide_labels=pd.DataFrame() included_annotations = copy.deepcopy(pos_annotation_class) included_annotations.extend(other_annotations) print(df.shape,included_annotations) if modify_patches: df=df[np.isin(df['annotation'],included_annotations)] ...
2,285
https://:@github.com/roma-guru/ricksay.git
d2c761b3274df3d042f0f94a559f4c7dc4f3f5be
@@ -782,7 +782,7 @@ class Setup(): targets = target.split('/') dests = dest.split('/') - while (len(targets) > 1) and (len(target) > 1) and (targets[0] == dests[0]): + while (len(targets) > 1) and (len(dests) > 1) and (targets[0] == dests[0]): ...
setup.py
ReplaceText(target='dests' @(785,46)->(785,52))
class Setup(): targets = target.split('/') dests = dest.split('/') while (len(targets) > 1) and (len(target) > 1) and (targets[0] == dests[0]): targets = targets[1:] dests = dests[1:]
class Setup(): targets = target.split('/') dests = dest.split('/') while (len(targets) > 1) and (len(dests) > 1) and (targets[0] == dests[0]): targets = targets[1:] dests = dests[1:]
2,286
https://:@github.com/roma-guru/ricksay.git
c38b34a000395d8e5082d2b0b3dfc5e0e594f227
@@ -375,7 +375,7 @@ class Backend(): self.output = self.output.replace(AUTO_PUSH, '').replace(AUTO_POP, '') - if self.balloon is not None: + if self.balloon is None: if (self.balloontop > 0) or (self.balloonbottom > 0): self.output = self.output.s...
src/backend.py
ReplaceText(target=' is ' @(378,23)->(378,31))
class Backend(): self.output = self.output.replace(AUTO_PUSH, '').replace(AUTO_POP, '') if self.balloon is not None: if (self.balloontop > 0) or (self.balloonbottom > 0): self.output = self.output.split('\n') self.output = self.output[...
class Backend(): self.output = self.output.replace(AUTO_PUSH, '').replace(AUTO_POP, '') if self.balloon is None: if (self.balloontop > 0) or (self.balloonbottom > 0): self.output = self.output.split('\n') self.output = self.output[self...
2,287
https://:@github.com/roma-guru/ricksay.git
de5f9c9d5a30aa94131d0af7d659cb4aeb330521
@@ -509,7 +509,7 @@ class Ponysay(): ponies = {} for ponydir in ponydirs: for pony in Metadata.restrictedPonies(ponydir, logic): - if (pony in ponies) and not (pony in ponies): # XXX and (pony not in passed) + if (pony ...
src/ponysay.py
ReplaceText(target='oldponies' @(512,36)->(512,42))
class Ponysay(): ponies = {} for ponydir in ponydirs: for pony in Metadata.restrictedPonies(ponydir, logic): if (pony in ponies) and not (pony in ponies): # XXX and (pony not in passed) ponies[pony] = ponydir + ...
class Ponysay(): ponies = {} for ponydir in ponydirs: for pony in Metadata.restrictedPonies(ponydir, logic): if (pony in oldponies) and not (pony in ponies): # XXX and (pony not in passed) ponies[pony] = ponydir...
2,288
https://:@github.com/roma-guru/ricksay.git
d234ee6c6cbefbd31ef763692c9f8bc39aeff832
@@ -826,7 +826,7 @@ class Ponysay(): for (opt, ponies, quotes) in [('-f', standard, False), ('+f', extra, False), ('-F', both, False), ('-q', standard, True)]: if args.opts[opt] is not None: for pony in args.opts[opt]: - selection.append((opt, ponies, quotes)) +...
src/ponysay.py
ReplaceText(target='pony' @(829,38)->(829,41))
class Ponysay(): for (opt, ponies, quotes) in [('-f', standard, False), ('+f', extra, False), ('-F', both, False), ('-q', standard, True)]: if args.opts[opt] is not None: for pony in args.opts[opt]: selection.append((opt, ponies, quotes)) ## TODO +q -...
class Ponysay(): for (opt, ponies, quotes) in [('-f', standard, False), ('+f', extra, False), ('-F', both, False), ('-q', standard, True)]: if args.opts[opt] is not None: for pony in args.opts[opt]: selection.append((pony, ponies, quotes)) ## TODO +q ...
2,289
https://:@github.com/roma-guru/ricksay.git
5125dd6400ca89a64f536be824a1de905f8a0920
@@ -140,7 +140,7 @@ def linklist(ponydirs = None, quoters = [], ucsiser = None): for ponydir in ponydirs: # Loop ponydirs ## Get all pony files in the directory - ponies = _get_file_list(ponydirs, '.pony') + ponies = _get_file_list(ponydir, '.pony') ## If there are n...
src/lists.py
ReplaceText(target='ponydir' @(143,32)->(143,40))
def linklist(ponydirs = None, quoters = [], ucsiser = None): for ponydir in ponydirs: # Loop ponydirs ## Get all pony files in the directory ponies = _get_file_list(ponydirs, '.pony') ## If there are no ponies in the directory skip to next directory, otherwise, print the ...
def linklist(ponydirs = None, quoters = [], ucsiser = None): for ponydir in ponydirs: # Loop ponydirs ## Get all pony files in the directory ponies = _get_file_list(ponydir, '.pony') ## If there are no ponies in the directory skip to next directory, otherwise, print the d...
2,290
https://:@github.com/CMakerA/WiSync.git
2a61dc7bcac9acd62f122e90ec78a41297b045b3
@@ -19,7 +19,7 @@ class Button(InteractableUIElement): else: self.size = size - super().__init__(self.size, self.__idle, self.__hover, self.__click, position, on_click, on_hover, on_leave) + super().__init__(position, self.__idle, self.__hover, self.__click, self.size, on_click, on...
elements/Button.py
ArgSwap(idxs=0<->4 @(22,8)->(22,24))
class Button(InteractableUIElement): else: self.size = size super().__init__(self.size, self.__idle, self.__hover, self.__click, position, on_click, on_hover, on_leave) self.id = Iders.btnIdler.add(self)
class Button(InteractableUIElement): else: self.size = size super().__init__(position, self.__idle, self.__hover, self.__click, self.size, on_click, on_hover, on_leave) self.id = Iders.btnIdler.add(self)
2,291
https://:@github.com/cmayes/md_utils.git
ea173c3c2052fc62697ae5af0cc4cbc2e7f25eb7
@@ -93,7 +93,7 @@ def calc_pka(file_data, kbt, coord_ts): logger.info("Found local max '%f' at coordinate '%f'", cur_corr, cur_coord) return -math.log10(inv_C_0 / sum_for_pka), cur_corr, cur_coord else: - if cur_corr >= coord_ts: + if cur_coord >= coord_t...
md_utils/calc_pka.py
ReplaceText(target='cur_coord' @(96,15)->(96,23))
def calc_pka(file_data, kbt, coord_ts): logger.info("Found local max '%f' at coordinate '%f'", cur_corr, cur_coord) return -math.log10(inv_C_0 / sum_for_pka), cur_corr, cur_coord else: if cur_corr >= coord_ts: logger.info("Integrating to input TS ...
def calc_pka(file_data, kbt, coord_ts): logger.info("Found local max '%f' at coordinate '%f'", cur_corr, cur_coord) return -math.log10(inv_C_0 / sum_for_pka), cur_corr, cur_coord else: if cur_coord >= coord_ts: logger.info("Integrating to input TS...
2,292
https://:@github.com/pozytywnie/django-facebook-auth.git
54f877d7cd262204abc1bf41a95e043a58431f44
@@ -34,7 +34,7 @@ class UserFactory(object): copy_field('email', True) copy_field('first_name') copy_field('last_name') - if access_token is None: + if access_token is not None: user.access_token = access_token user.save()
facebook_auth/backends.py
ReplaceText(target=' is not ' @(37,23)->(37,27))
class UserFactory(object): copy_field('email', True) copy_field('first_name') copy_field('last_name') if access_token is None: user.access_token = access_token user.save()
class UserFactory(object): copy_field('email', True) copy_field('first_name') copy_field('last_name') if access_token is not None: user.access_token = access_token user.save()
2,293
https://:@github.com/pozytywnie/django-facebook-auth.git
5301679f7ff26baab5b635204d309e89e907a47f
@@ -254,5 +254,5 @@ def debug_all_tokens_for_user(user_id): logger.info('Deleting user tokens except best one.') tokens_to_delete = sorted(processed_user_tokens) tokens_to_delete.remove(best_token.id) - for token_id in processed_user_tokens: + for token_id in...
facebook_auth/models.py
ReplaceText(target='tokens_to_delete' @(257,28)->(257,49))
def debug_all_tokens_for_user(user_id): logger.info('Deleting user tokens except best one.') tokens_to_delete = sorted(processed_user_tokens) tokens_to_delete.remove(best_token.id) for token_id in processed_user_tokens: UserToken.objects.filter(id=tok...
def debug_all_tokens_for_user(user_id): logger.info('Deleting user tokens except best one.') tokens_to_delete = sorted(processed_user_tokens) tokens_to_delete.remove(best_token.id) for token_id in tokens_to_delete: UserToken.objects.filter(id=token_id...
2,294
https://:@github.com/mc3/DSKM.git
dfe280d538e627d15b6058a7806290a8d09dbd4b
@@ -620,7 +620,7 @@ def nsAliveTest(theZone): # query all authoritative NS for SOA of zone nameservers = misc.authNS(theZone) for nameserver in nameservers[:]: try: - l.logDebug('Querying {} for SOA of {} via TCP'.format(theZone, nameserver)) + l.logDebug('Querying {} fo...
DSKM/zone.py
ArgSwap(idxs=0<->1 @(623,23)->(623,65))
def nsAliveTest(theZone): # query all authoritative NS for SOA of zone nameservers = misc.authNS(theZone) for nameserver in nameservers[:]: try: l.logDebug('Querying {} for SOA of {} via TCP'.format(theZone, nameserver)) response = dns.query.tcp(request, nameserver, ...
def nsAliveTest(theZone): # query all authoritative NS for SOA of zone nameservers = misc.authNS(theZone) for nameserver in nameservers[:]: try: l.logDebug('Querying {} for SOA of {} via TCP'.format(nameserver, theZone)) response = dns.query.tcp(request, nameserver, ...
2,295
https://:@github.com/AppImageCrafters/AppImageBuilder.git
dc91ba9d15ad0a470ae3a5c0e677d1616ced3fd0
@@ -61,7 +61,7 @@ class IconBundler: return os.path.join(root, svg_icon_name) if png_icon_name in files: - new_path = os.path.join(root, svg_icon_name) + new_path = os.path.join(root, png_icon_name) new_size = self._extract_icon_size_from_pa...
AppImageBuilder/app_dir/metadata/icon_bundler.py
ReplaceText(target='png_icon_name' @(64,46)->(64,59))
class IconBundler: return os.path.join(root, svg_icon_name) if png_icon_name in files: new_path = os.path.join(root, svg_icon_name) new_size = self._extract_icon_size_from_path(new_path) if new_size > size:
class IconBundler: return os.path.join(root, svg_icon_name) if png_icon_name in files: new_path = os.path.join(root, png_icon_name) new_size = self._extract_icon_size_from_path(new_path) if new_size > size:
2,296
https://:@github.com/jeticg/datatool.git
5fa4adc2522957fb89ef2d22974602ce4ed5047b
@@ -58,7 +58,7 @@ class DataLoader(): for filePattern in file: files += matchPattern(filePattern) elif isinstance(file, str): - files = matchPattern(filePattern) + files = matchPattern(file) else: raise RuntimeError("natlang.dataLoader.l...
natlang/loader.py
ReplaceText(target='file' @(61,33)->(61,44))
class DataLoader(): for filePattern in file: files += matchPattern(filePattern) elif isinstance(file, str): files = matchPattern(filePattern) else: raise RuntimeError("natlang.dataLoader.load [ERROR]: parameter " + ...
class DataLoader(): for filePattern in file: files += matchPattern(filePattern) elif isinstance(file, str): files = matchPattern(file) else: raise RuntimeError("natlang.dataLoader.load [ERROR]: parameter " + "type"...
2,297
https://:@github.com/robinandeer/cosmid.git
77c83d4f1a1835ca7d52d6b20272d126b5d3fb47
@@ -123,7 +123,7 @@ class Registry(object): options = resource.versions() version = self.matchOne(target, options) - if resource is None: + if version is None: message = ("Couldn't match version '{v}' to '{id}'; options: {vers}" .format(v=target, id=resource.id, vers=", "....
cosmid/core.py
ReplaceText(target='version' @(126,7)->(126,15))
class Registry(object): options = resource.versions() version = self.matchOne(target, options) if resource is None: message = ("Couldn't match version '{v}' to '{id}'; options: {vers}" .format(v=target, id=resource.id, vers=", ".join(options)))
class Registry(object): options = resource.versions() version = self.matchOne(target, options) if version is None: message = ("Couldn't match version '{v}' to '{id}'; options: {vers}" .format(v=target, id=resource.id, vers=", ".join(options)))
2,298
https://:@github.com/haata/pycapnp-async.git
11543b7abfb898e84c9412a7b5563e4481ffcf9b
@@ -22,7 +22,7 @@ def example_simple_rpc(): write_stream = capnp.FdAsyncIoStream(write.fileno()) restorer = capnp.Restorer(capability.TestSturdyRefObjectId, _restore) - server = capnp.RpcServer(loop, restorer, write_stream) + server = capnp.RpcServer(loop, write_stream, restorer) client = capnp.R...
examples/example_capability.py
ArgSwap(idxs=1<->2 @(25,13)->(25,28))
def example_simple_rpc(): write_stream = capnp.FdAsyncIoStream(write.fileno()) restorer = capnp.Restorer(capability.TestSturdyRefObjectId, _restore) server = capnp.RpcServer(loop, restorer, write_stream) client = capnp.RpcClient(loop, read_stream) ref = capability.TestSturdyRefObjectId.new_...
def example_simple_rpc(): write_stream = capnp.FdAsyncIoStream(write.fileno()) restorer = capnp.Restorer(capability.TestSturdyRefObjectId, _restore) server = capnp.RpcServer(loop, write_stream, restorer) client = capnp.RpcClient(loop, read_stream) ref = capability.TestSturdyRefObjectId.new_...
2,299
https://:@github.com/bwhmather/flask-libsass.git
c6f0e9cfdad73cc77a364c95d2070d723d2c89e8
@@ -55,7 +55,7 @@ class Sass(object): rebuild = current_app.config.get('SASS_REBUILD', False) - if rebuild: + if not rebuild: if not hasattr(stack.top, 'sass_cache'): stack.top.sass_cache = {} cache = stack.top.sass_cache
flask_libsass.py
ReplaceText(target='not ' @(58,11)->(58,11))
class Sass(object): rebuild = current_app.config.get('SASS_REBUILD', False) if rebuild: if not hasattr(stack.top, 'sass_cache'): stack.top.sass_cache = {} cache = stack.top.sass_cache
class Sass(object): rebuild = current_app.config.get('SASS_REBUILD', False) if not rebuild: if not hasattr(stack.top, 'sass_cache'): stack.top.sass_cache = {} cache = stack.top.sass_cache