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
|
---|---|---|---|---|---|---|---|
1,300 | https://:@bitbucket.org/suprocktech/asphodel_py.git | ccc31dcfd872553cef4cee7f6790ce6d41ed564f | @@ -309,7 +309,7 @@ def create_subproxy_util(device, func, proxy_id, identifier, *args, **kwargs):
subproxy_device = func(device, *args, **kwargs)
proxy_ids[proxy_id] = subproxy_device
- subproxy_sn = device.get_serial_number()
+ subproxy_sn = subproxy_device.get_serial_number()
subproxy_identifier = "{}->{}".format(identifier, subproxy_sn)
device_identifiers[subproxy_device] = subproxy_identifier
| asphodel/proxy.py | ReplaceText(target='subproxy_device' @(312,22)->(312,28)) | def create_subproxy_util(device, func, proxy_id, identifier, *args, **kwargs):
subproxy_device = func(device, *args, **kwargs)
proxy_ids[proxy_id] = subproxy_device
subproxy_sn = device.get_serial_number()
subproxy_identifier = "{}->{}".format(identifier, subproxy_sn)
device_identifiers[subproxy_device] = subproxy_identifier
| def create_subproxy_util(device, func, proxy_id, identifier, *args, **kwargs):
subproxy_device = func(device, *args, **kwargs)
proxy_ids[proxy_id] = subproxy_device
subproxy_sn = subproxy_device.get_serial_number()
subproxy_identifier = "{}->{}".format(identifier, subproxy_sn)
device_identifiers[subproxy_device] = subproxy_identifier
|
1,301 | https://:@github.com/Erotemic/dtool_ibeis.git | 1be0ef6a963f9ec3409ccbe129b72669a153e222 | @@ -240,7 +240,7 @@ class DependencyCache(object):
for args_, kwargs_ in reg_preproc:
depc._register_prop(*args_, **kwargs_)
print(' * regsitering %d global algos ' % len(reg_algos))
- for args_, kwargs_ in reg_preproc:
+ for args_, kwargs_ in reg_algos:
depc._register_algo(*args_, **kwargs_)
ut.ensuredir(depc.cache_dpath)
| dtool/depcache_control.py | ReplaceText(target='reg_algos' @(243,34)->(243,45)) | class DependencyCache(object):
for args_, kwargs_ in reg_preproc:
depc._register_prop(*args_, **kwargs_)
print(' * regsitering %d global algos ' % len(reg_algos))
for args_, kwargs_ in reg_preproc:
depc._register_algo(*args_, **kwargs_)
ut.ensuredir(depc.cache_dpath) | class DependencyCache(object):
for args_, kwargs_ in reg_preproc:
depc._register_prop(*args_, **kwargs_)
print(' * regsitering %d global algos ' % len(reg_algos))
for args_, kwargs_ in reg_algos:
depc._register_algo(*args_, **kwargs_)
ut.ensuredir(depc.cache_dpath) |
1,302 | https://:@github.com/Erotemic/dtool_ibeis.git | e94087b05c09fc2ebbaba09d55556eb467c77924 | @@ -2586,7 +2586,7 @@ class SQLDatabaseController(object):
superkey_index = superkey_colnames_list.index(primary_superkey)
superkey_paramx = superkey_paramxs_list[superkey_index]
superkey_colnames = superkey_colnames_list[superkey_index]
- elif len(superkey_colnames) == 1:
+ elif len(superkey_colnames_list) == 1:
superkey_paramx = superkey_paramxs_list[0]
superkey_colnames = superkey_colnames_list[0]
else:
| dtool/sql_control.py | ReplaceText(target='superkey_colnames_list' @(2589,21)->(2589,38)) | class SQLDatabaseController(object):
superkey_index = superkey_colnames_list.index(primary_superkey)
superkey_paramx = superkey_paramxs_list[superkey_index]
superkey_colnames = superkey_colnames_list[superkey_index]
elif len(superkey_colnames) == 1:
superkey_paramx = superkey_paramxs_list[0]
superkey_colnames = superkey_colnames_list[0]
else: | class SQLDatabaseController(object):
superkey_index = superkey_colnames_list.index(primary_superkey)
superkey_paramx = superkey_paramxs_list[superkey_index]
superkey_colnames = superkey_colnames_list[superkey_index]
elif len(superkey_colnames_list) == 1:
superkey_paramx = superkey_paramxs_list[0]
superkey_colnames = superkey_colnames_list[0]
else: |
1,303 | https://:@github.com/m-laniakea/st_spin.git | 0f3afc49b40a459947da9c45dc8f715b896f75a1 | @@ -91,7 +91,7 @@ class SpinDevice:
:return: Response bytes as int
"""
# payload and payload_size must be either both present, or both absent
- assert((payload is None) != (payload_size is None))
+ assert((payload is None) == (payload_size is None))
response = self._write(command)
| stspin/spin_device.py | ReplaceText(target='==' @(94,33)->(94,35)) | class SpinDevice:
:return: Response bytes as int
"""
# payload and payload_size must be either both present, or both absent
assert((payload is None) != (payload_size is None))
response = self._write(command)
| class SpinDevice:
:return: Response bytes as int
"""
# payload and payload_size must be either both present, or both absent
assert((payload is None) == (payload_size is None))
response = self._write(command)
|
1,304 | https://:@github.com/pbromwelljr/gnewcash.git | 340c6ca3b08b6389cc369878c960e2398b7f444a | @@ -38,7 +38,7 @@ class Slot:
slot_value_node.text = str(self.value)
elif type(self.value) is list and self.value:
for sub_slot in self.value:
- slot_node.append(sub_slot.as_xml)
+ slot_value_node.append(sub_slot.as_xml)
elif self.type == 'frame':
pass # Empty frame element, just leave it
else:
| gnewcash/slot.py | ReplaceText(target='slot_value_node' @(41,16)->(41,25)) | class Slot:
slot_value_node.text = str(self.value)
elif type(self.value) is list and self.value:
for sub_slot in self.value:
slot_node.append(sub_slot.as_xml)
elif self.type == 'frame':
pass # Empty frame element, just leave it
else: | class Slot:
slot_value_node.text = str(self.value)
elif type(self.value) is list and self.value:
for sub_slot in self.value:
slot_value_node.append(sub_slot.as_xml)
elif self.type == 'frame':
pass # Empty frame element, just leave it
else: |
1,305 | https://:@github.com/skibblenybbles/django-grunt.git | 51fa1ede65b294e4610c85329293af6280be3783 | @@ -14,4 +14,4 @@ class GruntConfigMixin(object):
def grunt_config(self, config=None, key=None):
return grunt_conf(
config={} if config is None else config,
- key=key if key is None else self.grunt_config_key)
+ key=key if key is not None else self.grunt_config_key)
| grunt/views/mixins.py | ReplaceText(target=' is not ' @(17,26)->(17,30)) | class GruntConfigMixin(object):
def grunt_config(self, config=None, key=None):
return grunt_conf(
config={} if config is None else config,
key=key if key is None else self.grunt_config_key) | class GruntConfigMixin(object):
def grunt_config(self, config=None, key=None):
return grunt_conf(
config={} if config is None else config,
key=key if key is not None else self.grunt_config_key) |
1,306 | https://:@github.com/blixt/py-starbound.git | 3563ff68b92dcf675adb5a861c61b02fc9e34b23 | @@ -103,7 +103,7 @@ class LeafReader(object):
def read(self, length):
offset = self._offset
- if offset + length < len(self._leaf.data):
+ if offset + length <= len(self._leaf.data):
self._offset += length
return self._leaf.data[offset:offset + length]
| sbbf02.py | ReplaceText(target='<=' @(106,27)->(106,28)) | class LeafReader(object):
def read(self, length):
offset = self._offset
if offset + length < len(self._leaf.data):
self._offset += length
return self._leaf.data[offset:offset + length]
| class LeafReader(object):
def read(self, length):
offset = self._offset
if offset + length <= len(self._leaf.data):
self._offset += length
return self._leaf.data[offset:offset + length]
|
1,307 | https://:@github.com/chrisrink10/basilisp.git | fbbc1c14b1e223aa22530a27d1013d97c61469c7 | @@ -61,7 +61,7 @@ def bootstrap_repl(which_ns: str) -> types.ModuleType:
assert core_ns is not None
ns.refer_all(core_ns)
repl_module = importlib.import_module(REPL_NS)
- ns.add_alias(sym.symbol(REPL_NS), repl_ns)
+ ns.add_alias(repl_ns, sym.symbol(REPL_NS))
ns.refer_all(repl_ns)
return repl_module
| src/basilisp/cli.py | ArgSwap(idxs=0<->1 @(64,4)->(64,16)) | def bootstrap_repl(which_ns: str) -> types.ModuleType:
assert core_ns is not None
ns.refer_all(core_ns)
repl_module = importlib.import_module(REPL_NS)
ns.add_alias(sym.symbol(REPL_NS), repl_ns)
ns.refer_all(repl_ns)
return repl_module
| def bootstrap_repl(which_ns: str) -> types.ModuleType:
assert core_ns is not None
ns.refer_all(core_ns)
repl_module = importlib.import_module(REPL_NS)
ns.add_alias(repl_ns, sym.symbol(REPL_NS))
ns.refer_all(repl_ns)
return repl_module
|
1,308 | https://:@github.com/chrisrink10/basilisp.git | fbbc1c14b1e223aa22530a27d1013d97c61469c7 | @@ -420,7 +420,7 @@ class TestResolveAlias:
foo_ns_sym = sym.symbol("zux.bar.foo")
foo_ns = get_or_create_ns(foo_ns_sym)
- ns.add_alias(sym.symbol("foo"), foo_ns)
+ ns.add_alias(foo_ns, sym.symbol("foo"))
assert sym.symbol(
"aliased-var", ns=foo_ns_sym.name
) == runtime.resolve_alias(sym.symbol("aliased-var", ns="foo"), ns=ns)
| tests/basilisp/runtime_test.py | ArgSwap(idxs=0<->1 @(423,12)->(423,24)) | class TestResolveAlias:
foo_ns_sym = sym.symbol("zux.bar.foo")
foo_ns = get_or_create_ns(foo_ns_sym)
ns.add_alias(sym.symbol("foo"), foo_ns)
assert sym.symbol(
"aliased-var", ns=foo_ns_sym.name
) == runtime.resolve_alias(sym.symbol("aliased-var", ns="foo"), ns=ns) | class TestResolveAlias:
foo_ns_sym = sym.symbol("zux.bar.foo")
foo_ns = get_or_create_ns(foo_ns_sym)
ns.add_alias(foo_ns, sym.symbol("foo"))
assert sym.symbol(
"aliased-var", ns=foo_ns_sym.name
) == runtime.resolve_alias(sym.symbol("aliased-var", ns="foo"), ns=ns) |
1,309 | https://:@github.com/Blaok/haoda.git | 66f4f1324648468e2e541ffb9ff37816490a4aca | @@ -365,7 +365,7 @@ def print_kernel_xml(name: str, args: Iterable[Arg], kernel_xml: TextIO):
size=size,
offset=0 if is_stream else offset,
host_size=host_size).rstrip('\n')
- if is_stream:
+ if not is_stream:
offset += size + 4
hw_ctrl_protocol = 'ap_ctrl_none'
if has_s_axi_control:
| haoda/backend/xilinx.py | ReplaceText(target='not ' @(368,7)->(368,7)) | def print_kernel_xml(name: str, args: Iterable[Arg], kernel_xml: TextIO):
size=size,
offset=0 if is_stream else offset,
host_size=host_size).rstrip('\n')
if is_stream:
offset += size + 4
hw_ctrl_protocol = 'ap_ctrl_none'
if has_s_axi_control: | def print_kernel_xml(name: str, args: Iterable[Arg], kernel_xml: TextIO):
size=size,
offset=0 if is_stream else offset,
host_size=host_size).rstrip('\n')
if not is_stream:
offset += size + 4
hw_ctrl_protocol = 'ap_ctrl_none'
if has_s_axi_control: |
1,310 | https://:@github.com/domokane/FinancePy.git | 0d71c33594ac248aeb473165ebfd0ae73dea5cab | @@ -155,7 +155,7 @@ class FinCalendar(object):
m = dt._m
d = dt._d
- startDate = FinDate(y, 1, 1)
+ startDate = FinDate(1, 1, y)
dd = dt._excelDate - startDate._excelDate + 1
weekday = dt._weekday
| financepy/finutils/FinCalendar.py | ArgSwap(idxs=0<->2 @(158,20)->(158,27)) | class FinCalendar(object):
m = dt._m
d = dt._d
startDate = FinDate(y, 1, 1)
dd = dt._excelDate - startDate._excelDate + 1
weekday = dt._weekday
| class FinCalendar(object):
m = dt._m
d = dt._d
startDate = FinDate(1, 1, y)
dd = dt._excelDate - startDate._excelDate + 1
weekday = dt._weekday
|
1,311 | https://:@github.com/domokane/FinancePy.git | e4edf39a2f8aa1caa804a63d7058c66dc458aefc | @@ -94,7 +94,7 @@ def buildIborCurve(tradeDate):
dcType)
swaps.append(swap5)
- liborCurve = FinIborSingleCurve(settlementDate, depos, fras, swaps)
+ liborCurve = FinIborSingleCurve(valuationDate, depos, fras, swaps)
return liborCurve
| tests/TestFinCDSBasket.py | ReplaceText(target='valuationDate' @(97,36)->(97,50)) | def buildIborCurve(tradeDate):
dcType)
swaps.append(swap5)
liborCurve = FinIborSingleCurve(settlementDate, depos, fras, swaps)
return liborCurve
| def buildIborCurve(tradeDate):
dcType)
swaps.append(swap5)
liborCurve = FinIborSingleCurve(valuationDate, depos, fras, swaps)
return liborCurve
|
1,312 | https://:@github.com/pypr/automan.git | 55ada630a37e2dfcecebd69fef20d62eddb8d402 | @@ -310,7 +310,7 @@ class TestScheduler(unittest.TestCase):
# Then
self.assertEqual(len(s.workers), 2)
count = 0
- while proxy.status() != 'done' and count < 10:
+ while proxy1.status() != 'done' and count < 10:
time.sleep(0.1)
count += 1
| automan/tests/test_jobs.py | ReplaceText(target='proxy1' @(313,14)->(313,19)) | class TestScheduler(unittest.TestCase):
# Then
self.assertEqual(len(s.workers), 2)
count = 0
while proxy.status() != 'done' and count < 10:
time.sleep(0.1)
count += 1
| class TestScheduler(unittest.TestCase):
# Then
self.assertEqual(len(s.workers), 2)
count = 0
while proxy1.status() != 'done' and count < 10:
time.sleep(0.1)
count += 1
|
1,313 | https://:@github.com/pyfarm/pyfarm-agent.git | 66dacd9725338a5f49d12ccee0e0ec8f9e5f8068 | @@ -68,7 +68,7 @@ class Task(TaskModel):
def __init__(self, job, frame, parent_task=None, state=None,
priority=None, attempts=None, agent=None):
# build parent job id
- if not modelfor(job, TABLE_JOB):
+ if modelfor(job, TABLE_JOB):
jobid = job.jobid
if jobid is None:
raise ValueError("`job` with null id provided")
| models/task.py | ReplaceText(target='' @(71,11)->(71,15)) | class Task(TaskModel):
def __init__(self, job, frame, parent_task=None, state=None,
priority=None, attempts=None, agent=None):
# build parent job id
if not modelfor(job, TABLE_JOB):
jobid = job.jobid
if jobid is None:
raise ValueError("`job` with null id provided") | class Task(TaskModel):
def __init__(self, job, frame, parent_task=None, state=None,
priority=None, attempts=None, agent=None):
# build parent job id
if modelfor(job, TABLE_JOB):
jobid = job.jobid
if jobid is None:
raise ValueError("`job` with null id provided") |
1,314 | https://:@github.com/pyfarm/pyfarm-agent.git | 47a4cc9232a09974dea7f246b96d0338a4a4339b | @@ -116,5 +116,5 @@ class Task(TaskModel):
if priority is not None:
self.priority = priority
- if attempts is None:
+ if attempts is not None:
self.attempts = attempts
| models/task.py | ReplaceText(target=' is not ' @(119,19)->(119,23)) | class Task(TaskModel):
if priority is not None:
self.priority = priority
if attempts is None:
self.attempts = attempts | class Task(TaskModel):
if priority is not None:
self.priority = priority
if attempts is not None:
self.attempts = attempts |
1,315 | https://:@github.com/pyfarm/pyfarm-agent.git | 10b2c473daa02e8feed96c41cd929a8861b39286 | @@ -88,7 +88,7 @@ def skip(should_skip, reason):
def wrapper(func):
@wraps(func)
def wrapped_func(*args, **kwargs):
- if not should_skip:
+ if should_skip:
raise SkipTest(reason)
return func(*args, **kwargs)
return wrapped_func
| pyfarm/agent/testutil.py | ReplaceText(target='' @(91,15)->(91,19)) | def skip(should_skip, reason):
def wrapper(func):
@wraps(func)
def wrapped_func(*args, **kwargs):
if not should_skip:
raise SkipTest(reason)
return func(*args, **kwargs)
return wrapped_func | def skip(should_skip, reason):
def wrapper(func):
@wraps(func)
def wrapped_func(*args, **kwargs):
if should_skip:
raise SkipTest(reason)
return func(*args, **kwargs)
return wrapped_func |
1,316 | https://:@github.com/pyfarm/pyfarm-agent.git | 1f7a8e553f328860c1f268a668b1d216311e017e | @@ -337,7 +337,7 @@ class TypeChecks(object):
if not isinstance(value, STRING_TYPES):
raise TypeError("Expected a string for `value`")
- if environment is not None or not isinstance(environment, dict):
+ if environment is not None and not isinstance(environment, dict):
raise TypeError("Expected None or a dictionary for `environment`")
def _check_map_path_inputs(self, path):
| pyfarm/jobtypes/core/internals.py | ReplaceText(target='and' @(340,35)->(340,37)) | class TypeChecks(object):
if not isinstance(value, STRING_TYPES):
raise TypeError("Expected a string for `value`")
if environment is not None or not isinstance(environment, dict):
raise TypeError("Expected None or a dictionary for `environment`")
def _check_map_path_inputs(self, path): | class TypeChecks(object):
if not isinstance(value, STRING_TYPES):
raise TypeError("Expected a string for `value`")
if environment is not None and not isinstance(environment, dict):
raise TypeError("Expected None or a dictionary for `environment`")
def _check_map_path_inputs(self, path): |
1,317 | https://:@github.com/pyfarm/pyfarm-agent.git | 01522e772abfd9c63be8afe679b4293454c1d3fb | @@ -214,6 +214,6 @@ class Assign(APIResource):
# are handled internally in this case.
jobtype_loader = JobType.load(request_data)
jobtype_loader.addCallback(loaded_jobtype, assignment_uuid)
- jobtype_loader.addErrback(assignment_stopped, assignment_uuid)
+ jobtype_loader.addErrback(assignment_failed, assignment_uuid)
return NOT_DONE_YET
| pyfarm/agent/http/api/assign.py | ReplaceText(target='assignment_failed' @(217,34)->(217,52)) | class Assign(APIResource):
# are handled internally in this case.
jobtype_loader = JobType.load(request_data)
jobtype_loader.addCallback(loaded_jobtype, assignment_uuid)
jobtype_loader.addErrback(assignment_stopped, assignment_uuid)
return NOT_DONE_YET | class Assign(APIResource):
# are handled internally in this case.
jobtype_loader = JobType.load(request_data)
jobtype_loader.addCallback(loaded_jobtype, assignment_uuid)
jobtype_loader.addErrback(assignment_failed, assignment_uuid)
return NOT_DONE_YET |
1,318 | https://:@github.com/pyfarm/pyfarm-agent.git | 0a73697606f24b15de2a83cbbe226e399a4a9fb7 | @@ -348,7 +348,7 @@ class TestCase(_TestCase):
msg, '%s not less than or equal to %s' % (a, b)))
def assertGreaterEqual(self, a, b, msg=None):
- if not a <= b:
+ if not a >= b:
self.fail(
self._formatMessage(
msg, '%s not greater than or equal to %s' % (a, b)))
| pyfarm/agent/testutil.py | ReplaceText(target='>=' @(351,21)->(351,23)) | class TestCase(_TestCase):
msg, '%s not less than or equal to %s' % (a, b)))
def assertGreaterEqual(self, a, b, msg=None):
if not a <= b:
self.fail(
self._formatMessage(
msg, '%s not greater than or equal to %s' % (a, b))) | class TestCase(_TestCase):
msg, '%s not less than or equal to %s' % (a, b)))
def assertGreaterEqual(self, a, b, msg=None):
if not a >= b:
self.fail(
self._formatMessage(
msg, '%s not greater than or equal to %s' % (a, b))) |
1,319 | https://:@github.com/pyfarm/pyfarm-agent.git | 8e2efd42e030089ef0afa266c89e34ed3d2b7a87 | @@ -158,7 +158,7 @@ class Assign(APIResource):
request.finish()
return NOT_DONE_YET
# If there is only a partial overlap
- elif existing_task_ids ^ new_task_ids:
+ elif existing_task_ids & new_task_ids:
logger.error("Rejecting assignment with partial overlap with "
"existing assignment.")
unknown_task_ids = new_task_ids - existing_task_ids
| pyfarm/agent/http/api/assign.py | ReplaceText(target='&' @(161,35)->(161,36)) | class Assign(APIResource):
request.finish()
return NOT_DONE_YET
# If there is only a partial overlap
elif existing_task_ids ^ new_task_ids:
logger.error("Rejecting assignment with partial overlap with "
"existing assignment.")
unknown_task_ids = new_task_ids - existing_task_ids | class Assign(APIResource):
request.finish()
return NOT_DONE_YET
# If there is only a partial overlap
elif existing_task_ids & new_task_ids:
logger.error("Rejecting assignment with partial overlap with "
"existing assignment.")
unknown_task_ids = new_task_ids - existing_task_ids |
1,320 | https://:@github.com/aliok/trnltk.git | 025fc45d062d902d8c5567b36eaf3b832c5a296e | @@ -218,7 +218,7 @@ class DoesntHaveRootAttributes(SuffixFormCondition):
transitions = filter(lambda transition : not isinstance(transition.suffix_form_application.suffix_form.suffix, ZeroTransitionSuffix), transitions)
transitions = filter(lambda transition : transition.suffix_form_application.applied_suffix_form, transitions)
- if not transitions:
+ if transitions:
return True
if not parse_token.stem.dictionary_item.attributes:
| trnltk/suffixgraph/suffixconditions.py | ReplaceText(target='' @(221,11)->(221,15)) | class DoesntHaveRootAttributes(SuffixFormCondition):
transitions = filter(lambda transition : not isinstance(transition.suffix_form_application.suffix_form.suffix, ZeroTransitionSuffix), transitions)
transitions = filter(lambda transition : transition.suffix_form_application.applied_suffix_form, transitions)
if not transitions:
return True
if not parse_token.stem.dictionary_item.attributes: | class DoesntHaveRootAttributes(SuffixFormCondition):
transitions = filter(lambda transition : not isinstance(transition.suffix_form_application.suffix_form.suffix, ZeroTransitionSuffix), transitions)
transitions = filter(lambda transition : transition.suffix_form_application.applied_suffix_form, transitions)
if transitions:
return True
if not parse_token.stem.dictionary_item.attributes: |
1,321 | https://:@github.com/aliok/trnltk.git | 46c9051f744ef8ce1b9f001281da68257693e20a | @@ -89,7 +89,7 @@ class MockMorphemeContainerBuilder(object):
def lexeme(self, lemma_root_str, lemma_root_syntactic_category=None, lemma_root_secondary_syntactic_category=None):
self.lemma_root_str = lemma_root_str
self.lemma_root_syntactic_category = lemma_root_syntactic_category
- self.lemma_root_secondary_syntactic_category = lemma_root_syntactic_category
+ self.lemma_root_secondary_syntactic_category = lemma_root_secondary_syntactic_category
return self
| trnltk/morphology/contextful/variantcontiguity/parsecontext.py | ReplaceText(target='lemma_root_secondary_syntactic_category' @(92,55)->(92,84)) | class MockMorphemeContainerBuilder(object):
def lexeme(self, lemma_root_str, lemma_root_syntactic_category=None, lemma_root_secondary_syntactic_category=None):
self.lemma_root_str = lemma_root_str
self.lemma_root_syntactic_category = lemma_root_syntactic_category
self.lemma_root_secondary_syntactic_category = lemma_root_syntactic_category
return self
| class MockMorphemeContainerBuilder(object):
def lexeme(self, lemma_root_str, lemma_root_syntactic_category=None, lemma_root_secondary_syntactic_category=None):
self.lemma_root_str = lemma_root_str
self.lemma_root_syntactic_category = lemma_root_syntactic_category
self.lemma_root_secondary_syntactic_category = lemma_root_secondary_syntactic_category
return self
|
1,322 | https://:@github.com/dgaston/ddbio-ngsflow.git | fb220e0eba9a51929c032b6801c2c626f084dc3f | @@ -151,7 +151,7 @@ def sambamba_coverage_summary(job, config, samples, outfile):
for sample in samples:
output.write("\t{samp_reads}"
"\t{s_perc1}"
- "\t{s_perc1}".format(samp_reads=amplicon[amplicon][sample],
+ "\t{s_perc1}".format(samp_reads=amplicon_coverage[amplicon][sample],
s_perc1=amplicon_coverage[amplicon]["{}_percent_{}".format(sample, config['coverage_threshold'])],
s_perc2=amplicon_coverage[amplicon]["{}_percent_{}".format(sample, config['coverage_threshold1'])]))
| ddb_ngsflow/utils/utilities.py | ReplaceText(target='amplicon_coverage' @(154,61)->(154,69)) | def sambamba_coverage_summary(job, config, samples, outfile):
for sample in samples:
output.write("\t{samp_reads}"
"\t{s_perc1}"
"\t{s_perc1}".format(samp_reads=amplicon[amplicon][sample],
s_perc1=amplicon_coverage[amplicon]["{}_percent_{}".format(sample, config['coverage_threshold'])],
s_perc2=amplicon_coverage[amplicon]["{}_percent_{}".format(sample, config['coverage_threshold1'])]))
| def sambamba_coverage_summary(job, config, samples, outfile):
for sample in samples:
output.write("\t{samp_reads}"
"\t{s_perc1}"
"\t{s_perc1}".format(samp_reads=amplicon_coverage[amplicon][sample],
s_perc1=amplicon_coverage[amplicon]["{}_percent_{}".format(sample, config['coverage_threshold'])],
s_perc2=amplicon_coverage[amplicon]["{}_percent_{}".format(sample, config['coverage_threshold1'])]))
|
1,323 | https://:@github.com/dlamotte/statsd-ostools.git | 531f3f6f2704fc5fa52d0316a5e00e4abfecf6d1 | @@ -64,7 +64,7 @@ def main():
for workerklass in worker.workers:
pid = os.fork()
kids.append(pid)
- if pid != 0:
+ if pid == 0:
sys.exit(workerklass(statsd, opts.interval).run())
while not SIGNALED:
| statsd_ostools/cmd.py | ReplaceText(target='==' @(67,15)->(67,17)) | def main():
for workerklass in worker.workers:
pid = os.fork()
kids.append(pid)
if pid != 0:
sys.exit(workerklass(statsd, opts.interval).run())
while not SIGNALED: | def main():
for workerklass in worker.workers:
pid = os.fork()
kids.append(pid)
if pid == 0:
sys.exit(workerklass(statsd, opts.interval).run())
while not SIGNALED: |
1,324 | https://:@github.com/ipal0/modbus.git | 19458ca84601917e7d7721b03dce8aa647d20065 | @@ -60,7 +60,7 @@ class client:
if FC == 5 or FC == 15:
LEN = len(VAL) * 8
else:
- LEN = len(VAL) / 2
+ LEN = len(VAL) // 2
lLEN = LEN & 0x00FF
mLEN = LEN >> 8
if self.TID < 255:
| client.py | ReplaceText(target='//' @(63,18)->(63,19)) | class client:
if FC == 5 or FC == 15:
LEN = len(VAL) * 8
else:
LEN = len(VAL) / 2
lLEN = LEN & 0x00FF
mLEN = LEN >> 8
if self.TID < 255: | class client:
if FC == 5 or FC == 15:
LEN = len(VAL) * 8
else:
LEN = len(VAL) // 2
lLEN = LEN & 0x00FF
mLEN = LEN >> 8
if self.TID < 255: |
1,325 | https://:@github.com/CTPUG/pyntnclick.git | cde45aba4aee72d730343a89cc4975c29f2a4059 | @@ -37,7 +37,7 @@ class Widget(object):
def event(self, ev):
"Don't override this without damn good reason"
if self.disabled or not self.visible:
- return True
+ return False
type_ = ev.type
if type_ == USEREVENT:
| pyntnclick/widgets/base.py | ReplaceText(target='False' @(40,19)->(40,23)) | class Widget(object):
def event(self, ev):
"Don't override this without damn good reason"
if self.disabled or not self.visible:
return True
type_ = ev.type
if type_ == USEREVENT: | class Widget(object):
def event(self, ev):
"Don't override this without damn good reason"
if self.disabled or not self.visible:
return False
type_ = ev.type
if type_ == USEREVENT: |
1,326 | https://:@github.com/MakersF/LoLScraper.git | b2435d9938a6cc7e0cf49ace811f353cfd7e648c | @@ -82,7 +82,7 @@ def download_matches(store_callback, seed_players, minimum_tier = Tier.bronze,
# Iterate until matches_in_time_slice is big enough, and stop anyways after matches_per_time_slice iterations
# this ensures the script will always terminate even in strange situations
# (like when all our seeds have no matches in the time slice)
- for _ in takewhile(lambda x: matches_in_time_slice >= matches_per_time_slice, range(matches_per_time_slice)):
+ for _ in takewhile(lambda x: matches_in_time_slice <= matches_per_time_slice, range(matches_per_time_slice)):
for tier in Tier:
for player_id, _ in zip(players_to_analyze.consume(tier), range(10)):
match_list = get_match_list(player_id, begin_time=time_slice.begin, end_time=time_slice.end, ranked_queues=queue.name)
| TeamComp/main.py | ReplaceText(target='<=' @(85,63)->(85,65)) | def download_matches(store_callback, seed_players, minimum_tier = Tier.bronze,
# Iterate until matches_in_time_slice is big enough, and stop anyways after matches_per_time_slice iterations
# this ensures the script will always terminate even in strange situations
# (like when all our seeds have no matches in the time slice)
for _ in takewhile(lambda x: matches_in_time_slice >= matches_per_time_slice, range(matches_per_time_slice)):
for tier in Tier:
for player_id, _ in zip(players_to_analyze.consume(tier), range(10)):
match_list = get_match_list(player_id, begin_time=time_slice.begin, end_time=time_slice.end, ranked_queues=queue.name) | def download_matches(store_callback, seed_players, minimum_tier = Tier.bronze,
# Iterate until matches_in_time_slice is big enough, and stop anyways after matches_per_time_slice iterations
# this ensures the script will always terminate even in strange situations
# (like when all our seeds have no matches in the time slice)
for _ in takewhile(lambda x: matches_in_time_slice <= matches_per_time_slice, range(matches_per_time_slice)):
for tier in Tier:
for player_id, _ in zip(players_to_analyze.consume(tier), range(10)):
match_list = get_match_list(player_id, begin_time=time_slice.begin, end_time=time_slice.end, ranked_queues=queue.name) |
1,327 | https://:@github.com/MakersF/LoLScraper.git | 9f39aab22be4783620f0d458f13e0b782d65bd2b | @@ -205,7 +205,7 @@ def download_matches(match_downloaded_callback, end_of_time_slice_callback, conf
random.random() < EVICTION_RATE}
# When a new patch is released, we can clear all the analyzed players and downloaded_matches if minimum_patch == 'latest'
- if conf['minimum_patch'].lower() != LATEST and get_patch_changed():
+ if conf['minimum_patch'].lower() == LATEST and get_patch_changed():
analyzed_players = set()
downloaded_matches = set()
| lol_scraper/match_downloader.py | ReplaceText(target='==' @(208,53)->(208,55)) | def download_matches(match_downloaded_callback, end_of_time_slice_callback, conf
random.random() < EVICTION_RATE}
# When a new patch is released, we can clear all the analyzed players and downloaded_matches if minimum_patch == 'latest'
if conf['minimum_patch'].lower() != LATEST and get_patch_changed():
analyzed_players = set()
downloaded_matches = set()
| def download_matches(match_downloaded_callback, end_of_time_slice_callback, conf
random.random() < EVICTION_RATE}
# When a new patch is released, we can clear all the analyzed players and downloaded_matches if minimum_patch == 'latest'
if conf['minimum_patch'].lower() == LATEST and get_patch_changed():
analyzed_players = set()
downloaded_matches = set()
|
1,328 | https://:@gitlab.com/claudiop/CLIPy.git | cf2bbbfc3877368c493ba97e8ffe3cd0d8e0875d | @@ -55,7 +55,7 @@ def get_course_activity_years(page):
year = int(urls.YEAR_EXP.findall(year_link.attrs['href'])[0])
if first is None or year < first:
first = year
- if last is None or year < last:
+ if last is None or year > last:
last = year
return first, last
| CLIPy/parser.py | ReplaceText(target='>' @(58,32)->(58,33)) | def get_course_activity_years(page):
year = int(urls.YEAR_EXP.findall(year_link.attrs['href'])[0])
if first is None or year < first:
first = year
if last is None or year < last:
last = year
return first, last
| def get_course_activity_years(page):
year = int(urls.YEAR_EXP.findall(year_link.attrs['href'])[0])
if first is None or year < first:
first = year
if last is None or year > last:
last = year
return first, last
|
1,329 | https://:@github.com/pyserial/pyparallel.git | 14213e1c7dda2d62d952305ce0a116f86f77bae2 | @@ -221,7 +221,7 @@ class Win32Serial(SerialBase):
if n > 0:
buf = ctypes.create_string_buffer(n)
rc = win32.DWORD()
- err = win32.ReadFile(self.hComPort, buf, size, ctypes.byref(rc), ctypes.byref(self._overlappedRead))
+ err = win32.ReadFile(self.hComPort, buf, n, ctypes.byref(rc), ctypes.byref(self._overlappedRead))
if not err and win32.GetLastError() != win32.ERROR_IO_PENDING:
raise SerialException("ReadFile failed (%s)" % ctypes.WinError())
err = win32.WaitForSingleObject(self._overlappedRead.hEvent, win32.INFINITE)
| pyserial/serial/serialwin32.py | ReplaceText(target='n' @(224,61)->(224,65)) | class Win32Serial(SerialBase):
if n > 0:
buf = ctypes.create_string_buffer(n)
rc = win32.DWORD()
err = win32.ReadFile(self.hComPort, buf, size, ctypes.byref(rc), ctypes.byref(self._overlappedRead))
if not err and win32.GetLastError() != win32.ERROR_IO_PENDING:
raise SerialException("ReadFile failed (%s)" % ctypes.WinError())
err = win32.WaitForSingleObject(self._overlappedRead.hEvent, win32.INFINITE) | class Win32Serial(SerialBase):
if n > 0:
buf = ctypes.create_string_buffer(n)
rc = win32.DWORD()
err = win32.ReadFile(self.hComPort, buf, n, ctypes.byref(rc), ctypes.byref(self._overlappedRead))
if not err and win32.GetLastError() != win32.ERROR_IO_PENDING:
raise SerialException("ReadFile failed (%s)" % ctypes.WinError())
err = win32.WaitForSingleObject(self._overlappedRead.hEvent, win32.INFINITE) |
1,330 | https://:@github.com/dschick/udkm1Dsim.git | 1760819d1df4cb50af1f925c1c3df39c9b7ee020 | @@ -94,7 +94,7 @@ def finderb_nest(key, vector):
# if the key is smaller than the first element of the
# vector we return 1
if key < vector[0]:
- return 1
+ return 0
while (b-a) > 1: # loop until the intervall is larger than 1
c = int(np.floor((a+b)/2)) # center of intervall
| udkm1Dsim/helpers.py | ReplaceText(target='0' @(97,15)->(97,16)) | def finderb_nest(key, vector):
# if the key is smaller than the first element of the
# vector we return 1
if key < vector[0]:
return 1
while (b-a) > 1: # loop until the intervall is larger than 1
c = int(np.floor((a+b)/2)) # center of intervall | def finderb_nest(key, vector):
# if the key is smaller than the first element of the
# vector we return 1
if key < vector[0]:
return 0
while (b-a) > 1: # loop until the intervall is larger than 1
c = int(np.floor((a+b)/2)) # center of intervall |
1,331 | https://:@github.com/orsinium/pros.git | 9ba4c47e7b9283e5dfe209a31ddcda0bc3b1bfbf | @@ -70,7 +70,7 @@ class Catalog:
if command:
return self._register(name, command)
else:
- return partial(self._register, command)
+ return partial(self._register, name)
def _register(self, name, command):
if name in self.commands:
| pipecli/core.py | ReplaceText(target='name' @(73,43)->(73,50)) | class Catalog:
if command:
return self._register(name, command)
else:
return partial(self._register, command)
def _register(self, name, command):
if name in self.commands: | class Catalog:
if command:
return self._register(name, command)
else:
return partial(self._register, name)
def _register(self, name, command):
if name in self.commands: |
1,332 | https://:@github.com/ShaneKent/PyEventLogViewer.git | f97696fbe0a5bb94461ccfa2951667ab788aefd5 | @@ -53,7 +53,7 @@ def xml_convert(records, file_hash, recovered=True):
sys = d['Event']['System']
- dictionary = parser(record, {
+ dictionary = parser(d, {
'timestamp_utc': sys['TimeCreated']['@SystemTime'],
'event_id': sys['EventID'],
'description': '',
| winlogtimeline/collector/collect.py | ReplaceText(target='d' @(56,28)->(56,34)) | def xml_convert(records, file_hash, recovered=True):
sys = d['Event']['System']
dictionary = parser(record, {
'timestamp_utc': sys['TimeCreated']['@SystemTime'],
'event_id': sys['EventID'],
'description': '', | def xml_convert(records, file_hash, recovered=True):
sys = d['Event']['System']
dictionary = parser(d, {
'timestamp_utc': sys['TimeCreated']['@SystemTime'],
'event_id': sys['EventID'],
'description': '', |
1,333 | https://:@github.com/BlackEarth/bsql.git | 76eb385fb3dd8774e2689e2d661ae1338754525c | @@ -58,7 +58,7 @@ class Database(Dict):
elif isinstance(self.adaptor, str):
self.adaptor = importlib.import_module(self.adaptor)
- if self.connection_string is None:
+ if self.connection_string is not None:
if self.adaptor.__name__ == 'psycopg2':
self.pool = importlib.import_module('psycopg2.pool').ThreadedConnectionPool(
self.minconn or 1, self.maxconn or 1, self.connection_string or ''
| bsql/database.py | ReplaceText(target=' is not ' @(61,37)->(61,41)) | class Database(Dict):
elif isinstance(self.adaptor, str):
self.adaptor = importlib.import_module(self.adaptor)
if self.connection_string is None:
if self.adaptor.__name__ == 'psycopg2':
self.pool = importlib.import_module('psycopg2.pool').ThreadedConnectionPool(
self.minconn or 1, self.maxconn or 1, self.connection_string or '' | class Database(Dict):
elif isinstance(self.adaptor, str):
self.adaptor = importlib.import_module(self.adaptor)
if self.connection_string is not None:
if self.adaptor.__name__ == 'psycopg2':
self.pool = importlib.import_module('psycopg2.pool').ThreadedConnectionPool(
self.minconn or 1, self.maxconn or 1, self.connection_string or '' |
1,334 | https://:@github.com/Pushkar-Singh-14/Polygon-Analysis.git | b66ac7e004c04178e8a0e84fd2363b4057b4a878 | @@ -50,7 +50,7 @@ def polygon_analysis(file_name,
background = Image.new('RGBA', (bigside, bigside), (255, 255, 255, 255))
offset = (0,0)
background.paste(image, offset)
- file_name2=f'{width_old*2}X{height_old*2}_{file_name}.png'
+ file_name2=f'{width_old*2}X{height_old*2}_{name_file}.png'
save_image=os.path.join(cwd,file_name2)
save_image_in_data=os.path.join(path_save,file_name2)
| py2pyPolygonAnalysis.py | ReplaceText(target='name_file' @(53,47)->(53,56)) | def polygon_analysis(file_name,
background = Image.new('RGBA', (bigside, bigside), (255, 255, 255, 255))
offset = (0,0)
background.paste(image, offset)
file_name2=f'{width_old*2}X{height_old*2}_{file_name}.png'
save_image=os.path.join(cwd,file_name2)
save_image_in_data=os.path.join(path_save,file_name2)
| def polygon_analysis(file_name,
background = Image.new('RGBA', (bigside, bigside), (255, 255, 255, 255))
offset = (0,0)
background.paste(image, offset)
file_name2=f'{width_old*2}X{height_old*2}_{name_file}.png'
save_image=os.path.join(cwd,file_name2)
save_image_in_data=os.path.join(path_save,file_name2)
|
1,335 | https://:@github.com/awiddersheim/github-release-cicd.git | 05ba9a8f3fea49778cf729dbd82594437b5db5e0 | @@ -89,7 +89,7 @@ def create(repo, tag, name, message, draft, prerelease, target, assets):
release = repo.create_git_release(
tag=tag,
- name=tag,
+ name=name,
message=message,
target_commitish=target,
prerelease=prerelease,
| github_release_cicd/cli.py | ReplaceText(target='name' @(92,13)->(92,16)) | def create(repo, tag, name, message, draft, prerelease, target, assets):
release = repo.create_git_release(
tag=tag,
name=tag,
message=message,
target_commitish=target,
prerelease=prerelease, | def create(repo, tag, name, message, draft, prerelease, target, assets):
release = repo.create_git_release(
tag=tag,
name=name,
message=message,
target_commitish=target,
prerelease=prerelease, |
1,336 | https://:@github.com/jeiros/msmadapter.git | 92a42219549fa6cab93250d4c961a72c0fc3de20 | @@ -289,7 +289,7 @@ class App(object):
def run_local_GPU(self, folders_glob):
bash_cmd = "export CUDA_VISIBLE_DEVICES=0"
- if len(glob(folders_glob)) != (self.ngpus - self.gpus_in_use):
+ if len(glob(folders_glob)) > (self.ngpus - self.gpus_in_use):
raise ValueError("Cannot run jobs of {} folders as only {} GPUs are available".format(len(glob(folders_glob)), self.ngpus - self.gpus_in_use))
for folder in glob(folders_glob):
| msmadapter/adaptive.py | ReplaceText(target='>' @(292,35)->(292,37)) | class App(object):
def run_local_GPU(self, folders_glob):
bash_cmd = "export CUDA_VISIBLE_DEVICES=0"
if len(glob(folders_glob)) != (self.ngpus - self.gpus_in_use):
raise ValueError("Cannot run jobs of {} folders as only {} GPUs are available".format(len(glob(folders_glob)), self.ngpus - self.gpus_in_use))
for folder in glob(folders_glob): | class App(object):
def run_local_GPU(self, folders_glob):
bash_cmd = "export CUDA_VISIBLE_DEVICES=0"
if len(glob(folders_glob)) > (self.ngpus - self.gpus_in_use):
raise ValueError("Cannot run jobs of {} folders as only {} GPUs are available".format(len(glob(folders_glob)), self.ngpus - self.gpus_in_use))
for folder in glob(folders_glob): |
1,337 | https://:@github.com/thoth-station/build-analysers.git | 7bd3caaf26018c4fd5fea647a53c82aa7919e25a | @@ -167,7 +167,7 @@ def build_breaker_predict(
if reverse_scores: # reverse the scores
scores = 1 / (scores * np.max(1 / scores))
- return np.vstack([winner_scores, winner_indices])
+ return np.vstack([scores, winner_indices])
def build_breaker_analyze(log: str, *, colorize: bool = True):
| thoth/build_analysers/analysis.py | ReplaceText(target='scores' @(170,22)->(170,35)) | def build_breaker_predict(
if reverse_scores: # reverse the scores
scores = 1 / (scores * np.max(1 / scores))
return np.vstack([winner_scores, winner_indices])
def build_breaker_analyze(log: str, *, colorize: bool = True): | def build_breaker_predict(
if reverse_scores: # reverse the scores
scores = 1 / (scores * np.max(1 / scores))
return np.vstack([scores, winner_indices])
def build_breaker_analyze(log: str, *, colorize: bool = True): |
1,338 | https://:@github.com/lcvriend/humannotator.git | e39c518621d12bd7e91e9847a05df1c0b75ff0eb | @@ -280,6 +280,6 @@ if __name__ == '__main__':
)
# run annotator
- annotator = Annotator([task1, task2], data)
+ annotator = Annotator(data, [task1, task2])
annotator(data.ids)
print(annotator.annotated)
| humannotator/humannotator.py | ArgSwap(idxs=0<->1 @(283,16)->(283,25)) | if __name__ == '__main__':
)
# run annotator
annotator = Annotator([task1, task2], data)
annotator(data.ids)
print(annotator.annotated) | if __name__ == '__main__':
)
# run annotator
annotator = Annotator(data, [task1, task2])
annotator(data.ids)
print(annotator.annotated) |
1,339 | https://:@github.com/paulsbond/autocoord.git | 688d05f50a4c1ded44fdd3d0309fbeaadf762807 | @@ -88,7 +88,7 @@ class Pipeline():
def refmac(self, cycles):
directory = self.job_directory("refmac")
use_phases = self.args.unbiased and self.min_rwork > 0.35
- job = Refmac(self.args, directory, self.current_xyz, use_phases, cycles)
+ job = Refmac(self.args, directory, self.current_xyz, cycles, use_phases)
self.jobs[self.cycle].append(job)
self.current_hkl = job.hklout
self.current_xyz = job.xyzout
| modelcraft/pipeline.py | ArgSwap(idxs=3<->4 @(91,14)->(91,20)) | class Pipeline():
def refmac(self, cycles):
directory = self.job_directory("refmac")
use_phases = self.args.unbiased and self.min_rwork > 0.35
job = Refmac(self.args, directory, self.current_xyz, use_phases, cycles)
self.jobs[self.cycle].append(job)
self.current_hkl = job.hklout
self.current_xyz = job.xyzout | class Pipeline():
def refmac(self, cycles):
directory = self.job_directory("refmac")
use_phases = self.args.unbiased and self.min_rwork > 0.35
job = Refmac(self.args, directory, self.current_xyz, cycles, use_phases)
self.jobs[self.cycle].append(job)
self.current_hkl = job.hklout
self.current_xyz = job.xyzout |
1,340 | https://:@github.com/cyril-s/aptly-ctl.git | b7e01c735809dca6ff0ed428d6f3062f5a2c1b86 | @@ -54,7 +54,7 @@ class PackageRef:
@property
def dir_ref(self):
- return "{}_{}_{}".format(self.name, self.arch, self.version)
+ return "{}_{}_{}".format(self.name, self.version, self.arch)
def __repr__(self):
| didww_aptly_ctl/utils/PackageRef.py | ArgSwap(idxs=1<->2 @(57,15)->(57,32)) | class PackageRef:
@property
def dir_ref(self):
return "{}_{}_{}".format(self.name, self.arch, self.version)
def __repr__(self): | class PackageRef:
@property
def dir_ref(self):
return "{}_{}_{}".format(self.name, self.version, self.arch)
def __repr__(self): |
1,341 | https://:@github.com/south-coast-science/scs_analysis.git | fd6148dff62ed13b561cddcce7fe9fd3fbc62532 | @@ -244,7 +244,7 @@ if __name__ == '__main__':
while cmd.fill:
filler = generator.next_localised_datetime(filler)
- if filler == checkpoint:
+ if filler >= checkpoint:
break
print(JSONify.dumps(aggregate.report(filler)))
| src/scs_analysis/sample_aggregate.py | ReplaceText(target='>=' @(247,30)->(247,32)) | if __name__ == '__main__':
while cmd.fill:
filler = generator.next_localised_datetime(filler)
if filler == checkpoint:
break
print(JSONify.dumps(aggregate.report(filler))) | if __name__ == '__main__':
while cmd.fill:
filler = generator.next_localised_datetime(filler)
if filler >= checkpoint:
break
print(JSONify.dumps(aggregate.report(filler))) |
1,342 | https://:@github.com/txels/incywincy.git | cf0cdbbf2a52ee70b8369f503d3983bd97d8db03 | @@ -14,7 +14,7 @@ THRESHOLD = 1
def log(page, message, level=WARNING):
- if level > THRESHOLD:
+ if level >= THRESHOLD:
print(">> {0}: {1} | {2}".format(CRITICALITY[level], message, page.url))
| incywincy/report.py | ReplaceText(target='>=' @(17,13)->(17,14)) | THRESHOLD = 1
def log(page, message, level=WARNING):
if level > THRESHOLD:
print(">> {0}: {1} | {2}".format(CRITICALITY[level], message, page.url))
| THRESHOLD = 1
def log(page, message, level=WARNING):
if level >= THRESHOLD:
print(">> {0}: {1} | {2}".format(CRITICALITY[level], message, page.url))
|
1,343 | https://:@github.com/oakeyc/azure-cli-interactive-shell.git | 10de31097e20cab16a5edce1b043416cc0932d69 | @@ -171,7 +171,7 @@ def create_layout(lex, examLex, toolbarLex):
Window(
content=BufferControl(
buffer_name='symbols',
- lexer=lexer
+ lexer=examLex
)
),
filter=ShowSymbol()
| azclishell/layout.py | ReplaceText(target='examLex' @(174,30)->(174,35)) | def create_layout(lex, examLex, toolbarLex):
Window(
content=BufferControl(
buffer_name='symbols',
lexer=lexer
)
),
filter=ShowSymbol() | def create_layout(lex, examLex, toolbarLex):
Window(
content=BufferControl(
buffer_name='symbols',
lexer=examLex
)
),
filter=ShowSymbol() |
1,344 | https://:@github.com/sage-home/sage-analysis.git | 4fb6b2ca074cc5afc8d993ba63ce77f685065351 | @@ -129,7 +129,7 @@ def generate_func_dict(
# No extra arguments for this.
key_args = {}
- func_dict[func_name] = (func, key_args)
+ func_dict[toggle] = (func, key_args)
return func_dict
| sage_analysis/utils.py | ReplaceText(target='toggle' @(132,22)->(132,31)) | def generate_func_dict(
# No extra arguments for this.
key_args = {}
func_dict[func_name] = (func, key_args)
return func_dict
| def generate_func_dict(
# No extra arguments for this.
key_args = {}
func_dict[toggle] = (func, key_args)
return func_dict
|
1,345 | https://:@github.com/dhess/lobbyists.git | 8877cfa738b78dc77ed40533e5f4c7f2b14d95b7 | @@ -785,7 +785,7 @@ def _import_list(entities, id, filing, cur):
importer, entity_id = _list_importers[id]
db_keys = list()
for entity in entities:
- db_keys.append(importer(entity[entity_id], id, filing, cur))
+ db_keys.append(importer(entity[entity_id], entity_id, filing, cur))
return db_keys
| lobbyists/lobbyists.py | ReplaceText(target='entity_id' @(788,51)->(788,53)) | def _import_list(entities, id, filing, cur):
importer, entity_id = _list_importers[id]
db_keys = list()
for entity in entities:
db_keys.append(importer(entity[entity_id], id, filing, cur))
return db_keys
| def _import_list(entities, id, filing, cur):
importer, entity_id = _list_importers[id]
db_keys = list()
for entity in entities:
db_keys.append(importer(entity[entity_id], entity_id, filing, cur))
return db_keys
|
1,346 | https://:@github.com/yedivanseven/PLSA.git | 12eeb77e941cb7153b009f07104eb3b6f1c99911 | @@ -76,7 +76,7 @@ class BasePLSA:
def __rel_change(self, new: float) -> float:
if self._likelihoods:
old = self._likelihoods[-1]
- return abs((new - old) / old)
+ return abs((new - old) / new)
return inf
def _result(self) -> PlsaResult:
| plsa/algorithms/base.py | ReplaceText(target='new' @(79,37)->(79,40)) | class BasePLSA:
def __rel_change(self, new: float) -> float:
if self._likelihoods:
old = self._likelihoods[-1]
return abs((new - old) / old)
return inf
def _result(self) -> PlsaResult: | class BasePLSA:
def __rel_change(self, new: float) -> float:
if self._likelihoods:
old = self._likelihoods[-1]
return abs((new - old) / new)
return inf
def _result(self) -> PlsaResult: |
1,347 | https://:@github.com/omarryhan/sanic-cookies.git | 93f915b30b664918ed0877e2ca75c66922fb1c72 | @@ -29,7 +29,7 @@ class MockApp:
if attach_to == 'request':
self.req_middleware.append(middleware)
elif attach_to == 'response':
- self.res_middleware = [attach_to] + self.res_middleware
+ self.res_middleware = [middleware] + self.res_middleware
class MockSession(Session):
def __init__(self, app=MockApp(), master_interface=MockInterface(), *args, **kwargs):
| tests/common.py | ReplaceText(target='middleware' @(32,35)->(32,44)) | class MockApp:
if attach_to == 'request':
self.req_middleware.append(middleware)
elif attach_to == 'response':
self.res_middleware = [attach_to] + self.res_middleware
class MockSession(Session):
def __init__(self, app=MockApp(), master_interface=MockInterface(), *args, **kwargs): | class MockApp:
if attach_to == 'request':
self.req_middleware.append(middleware)
elif attach_to == 'response':
self.res_middleware = [middleware] + self.res_middleware
class MockSession(Session):
def __init__(self, app=MockApp(), master_interface=MockInterface(), *args, **kwargs): |
1,348 | https://:@github.com/Warths/pyTwitchIRC.git | 8095007fc0d6eb1242b7f845b95b44d77349a2cc | @@ -350,7 +350,7 @@ class IRC:
# request channel join
def join(self, channel: str):
channels = list(self.channels)
- if channel in channels:
+ if channel not in channels:
self.__to_join.append((channel, 0, time.time()))
else:
self.__warning('Already connected to channel {}, connection aborted'.format(channel))
| irc.py | ReplaceText(target=' not in ' @(353,18)->(353,22)) | class IRC:
# request channel join
def join(self, channel: str):
channels = list(self.channels)
if channel in channels:
self.__to_join.append((channel, 0, time.time()))
else:
self.__warning('Already connected to channel {}, connection aborted'.format(channel)) | class IRC:
# request channel join
def join(self, channel: str):
channels = list(self.channels)
if channel not in channels:
self.__to_join.append((channel, 0, time.time()))
else:
self.__warning('Already connected to channel {}, connection aborted'.format(channel)) |
1,349 | https://:@github.com/Warths/pyTwitchIRC.git | 0088b156487239166a21466917d36b6b61e83bc8 | @@ -412,7 +412,7 @@ class IRC:
# send a packet and log it[, obfuscate after a certain index][, ignore the throttling cap]
def __send(self, packet, obfuscate_after=None, ignore_throttle=0):
# verify throttling status
- if self.__anti_throttle() or ignore_throttle:
+ if self.__anti_throttle() or not ignore_throttle:
# verify socket instance
if self.__wait_for_status(0):
self.__socket.send(packet.encode('UTF-8'))
| irc.py | ReplaceText(target='not ' @(415,37)->(415,37)) | class IRC:
# send a packet and log it[, obfuscate after a certain index][, ignore the throttling cap]
def __send(self, packet, obfuscate_after=None, ignore_throttle=0):
# verify throttling status
if self.__anti_throttle() or ignore_throttle:
# verify socket instance
if self.__wait_for_status(0):
self.__socket.send(packet.encode('UTF-8')) | class IRC:
# send a packet and log it[, obfuscate after a certain index][, ignore the throttling cap]
def __send(self, packet, obfuscate_after=None, ignore_throttle=0):
# verify throttling status
if self.__anti_throttle() or not ignore_throttle:
# verify socket instance
if self.__wait_for_status(0):
self.__socket.send(packet.encode('UTF-8')) |
1,350 | https://:@github.com/Warths/pyTwitchIRC.git | 6321f5177fa2b2f54f40f77a1aaed486f28cd6da | @@ -451,7 +451,7 @@ class IRC:
# send a message to a channel and prevent sending to disconnected channels
def __send_message(self) -> None:
# if there is message to send and socket ready and socket not throttling
- if len(self.__to_send) > 0 and self.__wait_for_status() and not self.__anti_throttle():
+ if len(self.__to_send) > 0 and self.__wait_for_status() and self.__anti_throttle():
# retrieve the first message to send
item = self.__to_send.pop(0)
channel = item[0]
| irc.py | ReplaceText(target='' @(454,68)->(454,72)) | class IRC:
# send a message to a channel and prevent sending to disconnected channels
def __send_message(self) -> None:
# if there is message to send and socket ready and socket not throttling
if len(self.__to_send) > 0 and self.__wait_for_status() and not self.__anti_throttle():
# retrieve the first message to send
item = self.__to_send.pop(0)
channel = item[0] | class IRC:
# send a message to a channel and prevent sending to disconnected channels
def __send_message(self) -> None:
# if there is message to send and socket ready and socket not throttling
if len(self.__to_send) > 0 and self.__wait_for_status() and self.__anti_throttle():
# retrieve the first message to send
item = self.__to_send.pop(0)
channel = item[0] |
1,351 | https://:@github.com/All-less/trace-generator.git | 54a30158f1a22cbe8195a921495592e39875159c | @@ -36,5 +36,5 @@ def iter_job(task_file, instance_file):
while next_task[JOB_ID] != '':
arrive_at, task_lines, instance_lines = next_task[ARR_TIME], [ next_task[REST] ], [ next_instance[REST] ]
next_task = read_lines(task_file, next_task[JOB_ID], task_lines)
- next_instance = read_lines(instance_file, next_task[JOB_ID], instance_lines)
+ next_instance = read_lines(instance_file, next_instance[JOB_ID], instance_lines)
yield float(arrive_at), { 'tasks': task_lines, 'instances': instance_lines }
| spar/io.py | ReplaceText(target='next_instance' @(39,50)->(39,59)) | def iter_job(task_file, instance_file):
while next_task[JOB_ID] != '':
arrive_at, task_lines, instance_lines = next_task[ARR_TIME], [ next_task[REST] ], [ next_instance[REST] ]
next_task = read_lines(task_file, next_task[JOB_ID], task_lines)
next_instance = read_lines(instance_file, next_task[JOB_ID], instance_lines)
yield float(arrive_at), { 'tasks': task_lines, 'instances': instance_lines } | def iter_job(task_file, instance_file):
while next_task[JOB_ID] != '':
arrive_at, task_lines, instance_lines = next_task[ARR_TIME], [ next_task[REST] ], [ next_instance[REST] ]
next_task = read_lines(task_file, next_task[JOB_ID], task_lines)
next_instance = read_lines(instance_file, next_instance[JOB_ID], instance_lines)
yield float(arrive_at), { 'tasks': task_lines, 'instances': instance_lines } |
1,352 | https://:@github.com/brandonschabell/models.git | d0b6a34bb0dbd981e3785661f04f04cde9c4222b | @@ -107,7 +107,7 @@ def run_mnist_eager(flags_obj):
# Automatically determine device and data_format
(device, data_format) = ('/gpu:0', 'channels_first')
- if flags_obj.no_gpu or tf.test.is_gpu_available():
+ if flags_obj.no_gpu or not tf.test.is_gpu_available():
(device, data_format) = ('/cpu:0', 'channels_last')
# If data_format is defined in FLAGS, overwrite automatically set value.
if flags_obj.data_format is not None:
| official/mnist/mnist_eager.py | ReplaceText(target='not ' @(110,25)->(110,25)) | def run_mnist_eager(flags_obj):
# Automatically determine device and data_format
(device, data_format) = ('/gpu:0', 'channels_first')
if flags_obj.no_gpu or tf.test.is_gpu_available():
(device, data_format) = ('/cpu:0', 'channels_last')
# If data_format is defined in FLAGS, overwrite automatically set value.
if flags_obj.data_format is not None: | def run_mnist_eager(flags_obj):
# Automatically determine device and data_format
(device, data_format) = ('/gpu:0', 'channels_first')
if flags_obj.no_gpu or not tf.test.is_gpu_available():
(device, data_format) = ('/cpu:0', 'channels_last')
# If data_format is defined in FLAGS, overwrite automatically set value.
if flags_obj.data_format is not None: |
1,353 | https://:@github.com/hoh/Billabong.git | 43e4c8a9a42662dde86057a4cdb5d44ab577bd1a | @@ -46,7 +46,7 @@ def copy_and_encrypt(filepath, key):
source_file.close()
dest_file.close()
- storage.import_blob(open(tmp_destination, 'rb'), id_)
+ storage.import_blob(id_, open(tmp_destination, 'rb'))
os.remove(tmp_destination)
return enc_hash.hexdigest()
| diss/encryption.py | ArgSwap(idxs=0<->1 @(49,4)->(49,23)) | def copy_and_encrypt(filepath, key):
source_file.close()
dest_file.close()
storage.import_blob(open(tmp_destination, 'rb'), id_)
os.remove(tmp_destination)
return enc_hash.hexdigest() | def copy_and_encrypt(filepath, key):
source_file.close()
dest_file.close()
storage.import_blob(id_, open(tmp_destination, 'rb'))
os.remove(tmp_destination)
return enc_hash.hexdigest() |
1,354 | https://:@github.com/mkirchner/pockyll.git | fa6b9fb6f2e939e9cbe551db3c7fb4b7b2bf2637 | @@ -133,7 +133,7 @@ def get_list(config):
def create_linkpost(config, item_id, title, url, timestamp, is_draft=True):
path = ''
- if is_draft:
+ if not is_draft:
path = config.get("linkpost_post_dir", "_posts/linkposts")
else:
path = config.get("linkpost_draft_dir", "_drafts/linkposts")
| pockyll.py | ReplaceText(target='not ' @(136,7)->(136,7)) | def get_list(config):
def create_linkpost(config, item_id, title, url, timestamp, is_draft=True):
path = ''
if is_draft:
path = config.get("linkpost_post_dir", "_posts/linkposts")
else:
path = config.get("linkpost_draft_dir", "_drafts/linkposts") | def get_list(config):
def create_linkpost(config, item_id, title, url, timestamp, is_draft=True):
path = ''
if not is_draft:
path = config.get("linkpost_post_dir", "_posts/linkposts")
else:
path = config.get("linkpost_draft_dir", "_drafts/linkposts") |
1,355 | https://:@github.com/ArunTejCh/python-driver.git | 6d34a00cee5b033bf285994af739a09419e447a2 | @@ -89,8 +89,8 @@ class Metadata(object):
if keyspace in cf_def_rows:
for table_row in cf_def_rows[keyspace]:
table_meta = self._build_table_metadata(
- keyspace_meta, table_row, col_def_rows[keyspace])
- keyspace.tables[table_meta.name] = table_meta
+ keyspace_meta, table_row, col_def_rows[keyspace])
+ keyspace_meta.tables[table_meta.name] = table_meta
def _build_keyspace_metadata(self, row):
name = row["keyspace_name"]
| cassandra/metadata.py | ReplaceText(target='keyspace_meta' @(93,20)->(93,28)) | class Metadata(object):
if keyspace in cf_def_rows:
for table_row in cf_def_rows[keyspace]:
table_meta = self._build_table_metadata(
keyspace_meta, table_row, col_def_rows[keyspace])
keyspace.tables[table_meta.name] = table_meta
def _build_keyspace_metadata(self, row):
name = row["keyspace_name"] | class Metadata(object):
if keyspace in cf_def_rows:
for table_row in cf_def_rows[keyspace]:
table_meta = self._build_table_metadata(
keyspace_meta, table_row, col_def_rows[keyspace])
keyspace_meta.tables[table_meta.name] = table_meta
def _build_keyspace_metadata(self, row):
name = row["keyspace_name"] |
1,356 | https://:@github.com/ArunTejCh/python-driver.git | c7a77b8862551e73fd09b749316c422eee7a2308 | @@ -26,7 +26,7 @@ class RoundRobinPolicy(LoadBalancingPolicy):
def populate(self, cluster, hosts):
self._live_hosts = set(hosts)
- if len(hosts) == 1:
+ if len(hosts) <= 1:
self._position = 0
else:
self._position = randint(0, len(hosts) - 1)
| cassandra/policies.py | ReplaceText(target='<=' @(29,22)->(29,24)) | class RoundRobinPolicy(LoadBalancingPolicy):
def populate(self, cluster, hosts):
self._live_hosts = set(hosts)
if len(hosts) == 1:
self._position = 0
else:
self._position = randint(0, len(hosts) - 1) | class RoundRobinPolicy(LoadBalancingPolicy):
def populate(self, cluster, hosts):
self._live_hosts = set(hosts)
if len(hosts) <= 1:
self._position = 0
else:
self._position = randint(0, len(hosts) - 1) |
1,357 | https://:@github.com/ArunTejCh/python-driver.git | 2984ba71634e5c3d4b23bb42a977401ca60ffc01 | @@ -230,7 +230,7 @@ class BaseModel(object):
'unrecognized polymorphic key {} for class {}'.format(poly_key, poly_base.__name__)
)
- if not issubclass(klass, poly_base):
+ if not issubclass(klass, cls):
raise PolyMorphicModelException(
'{} is not a subclass of {}'.format(klass.__name__, poly_base.__name__)
)
| cqlengine/models.py | ReplaceText(target='cls' @(233,37)->(233,46)) | class BaseModel(object):
'unrecognized polymorphic key {} for class {}'.format(poly_key, poly_base.__name__)
)
if not issubclass(klass, poly_base):
raise PolyMorphicModelException(
'{} is not a subclass of {}'.format(klass.__name__, poly_base.__name__)
) | class BaseModel(object):
'unrecognized polymorphic key {} for class {}'.format(poly_key, poly_base.__name__)
)
if not issubclass(klass, cls):
raise PolyMorphicModelException(
'{} is not a subclass of {}'.format(klass.__name__, poly_base.__name__)
) |
1,358 | https://:@github.com/ArunTejCh/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__)
)
field_dict = {k: v for k, v in field_dict.items() if k in klass._columns.keys()}
| 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.keys()} | 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()} |
1,359 | https://:@github.com/ArunTejCh/python-driver.git | c40a1aa79e4721f7892be787eef3c3fe0f324959 | @@ -772,7 +772,7 @@ class DowngradingConsistencyRetryPolicy(RetryPolicy):
received_responses, data_retrieved, retry_num):
if retry_num != 0:
return (self.RETHROW, None)
- elif received_responses < required_responses:
+ elif received_responses <= required_responses:
return self._pick_consistency(received_responses)
elif not data_retrieved:
return (self.RETRY, consistency)
| cassandra/policies.py | ReplaceText(target='<=' @(775,32)->(775,33)) | class DowngradingConsistencyRetryPolicy(RetryPolicy):
received_responses, data_retrieved, retry_num):
if retry_num != 0:
return (self.RETHROW, None)
elif received_responses < required_responses:
return self._pick_consistency(received_responses)
elif not data_retrieved:
return (self.RETRY, consistency) | class DowngradingConsistencyRetryPolicy(RetryPolicy):
received_responses, data_retrieved, retry_num):
if retry_num != 0:
return (self.RETHROW, None)
elif received_responses <= required_responses:
return self._pick_consistency(received_responses)
elif not data_retrieved:
return (self.RETRY, consistency) |
1,360 | https://:@github.com/ArunTejCh/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 = MultipleObjectsReturnedBase or attrs.pop('MultipleObjectsReturned', BaseModel.MultipleObjectsReturned)
attrs['MultipleObjectsReturned'] = type('MultipleObjectsReturned', (MultipleObjectsReturnedBase,), {})
# create the class and add a QuerySet to it
| 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', (MultipleObjectsReturnedBase,), {})
# create the class and add a QuerySet to it | class ModelMetaClass(type):
if MultipleObjectsReturnedBase is not None:
break
MultipleObjectsReturnedBase = MultipleObjectsReturnedBase or attrs.pop('MultipleObjectsReturned', BaseModel.MultipleObjectsReturned)
attrs['MultipleObjectsReturned'] = type('MultipleObjectsReturned', (MultipleObjectsReturnedBase,), {})
# create the class and add a QuerySet to it |
1,361 | https://:@github.com/unixpickle/mazenv-py.git | e1e12b285e2e366c19b99583d934e46cda3798e2 | @@ -17,7 +17,7 @@ def parse_2d_maze(maze_str):
start_pos = None
end_pos = None
for row, row_str in enumerate(lines):
- if len(row) != num_cols:
+ if len(row_str) != num_cols:
raise ValueError('row length should be %d but got %d' %
(num_cols, len(row)))
sub_walls = []
| mazenv/maze.py | ReplaceText(target='row_str' @(20,15)->(20,18)) | def parse_2d_maze(maze_str):
start_pos = None
end_pos = None
for row, row_str in enumerate(lines):
if len(row) != num_cols:
raise ValueError('row length should be %d but got %d' %
(num_cols, len(row)))
sub_walls = [] | def parse_2d_maze(maze_str):
start_pos = None
end_pos = None
for row, row_str in enumerate(lines):
if len(row_str) != num_cols:
raise ValueError('row length should be %d but got %d' %
(num_cols, len(row)))
sub_walls = [] |
1,362 | https://:@github.com/JGoutin/rfs.git | 0f3baf03774e56ccdb3177ba5150b79446f84308 | @@ -122,7 +122,7 @@ def test_s3_raw_io():
s3object = S3RawIO(path)
assert s3object._client_kwargs == client_args
- assert s3object.name == url
+ assert s3object.name == path
# Tests _head
check_head_methods(s3object, m_time)
| tests/test_s3.py | ReplaceText(target='path' @(125,32)->(125,35)) | def test_s3_raw_io():
s3object = S3RawIO(path)
assert s3object._client_kwargs == client_args
assert s3object.name == url
# Tests _head
check_head_methods(s3object, m_time) | def test_s3_raw_io():
s3object = S3RawIO(path)
assert s3object._client_kwargs == client_args
assert s3object.name == path
# Tests _head
check_head_methods(s3object, m_time) |
1,363 | https://:@github.com/JGoutin/rfs.git | 9997aa65673b3f42439ff5b46e1fd4f7bb42524a | @@ -27,7 +27,7 @@ def _copy(src, dst, src_is_storage, dst_is_storage):
if system is get_instance(dst):
# Checks if same file
- if system.relpath(src) != system.relpath(dst):
+ if system.relpath(src) == system.relpath(dst):
raise same_file_error(
"'%s' and '%s' are the same file" % (src, dst))
| pycosio/_core/functions_shutil.py | ReplaceText(target='==' @(30,35)->(30,37)) | def _copy(src, dst, src_is_storage, dst_is_storage):
if system is get_instance(dst):
# Checks if same file
if system.relpath(src) != system.relpath(dst):
raise same_file_error(
"'%s' and '%s' are the same file" % (src, dst))
| def _copy(src, dst, src_is_storage, dst_is_storage):
if system is get_instance(dst):
# Checks if same file
if system.relpath(src) == system.relpath(dst):
raise same_file_error(
"'%s' and '%s' are the same file" % (src, dst))
|
1,364 | https://:@github.com/JGoutin/rfs.git | 76ae1f2720567a6121b264da9fbada3c49e4378b | @@ -574,7 +574,7 @@ class SystemBase(ABC):
stat[key] = S_IFREG
# Add storage specific keys
- for key, value in tuple(stat.items()):
+ for key, value in tuple(header.items()):
stat['st_' + key.lower().replace('-', '_')] = value
# Convert to "os.stat_result" like object
| pycosio/_core/io_system.py | ReplaceText(target='header' @(577,32)->(577,36)) | class SystemBase(ABC):
stat[key] = S_IFREG
# Add storage specific keys
for key, value in tuple(stat.items()):
stat['st_' + key.lower().replace('-', '_')] = value
# Convert to "os.stat_result" like object | class SystemBase(ABC):
stat[key] = S_IFREG
# Add storage specific keys
for key, value in tuple(header.items()):
stat['st_' + key.lower().replace('-', '_')] = value
# Convert to "os.stat_result" like object |
1,365 | https://:@github.com/ishikota/kyoka.git | 3f844dec3d6320e376176eb8ff82227deb5ee164 | @@ -54,7 +54,7 @@ class BaseRLAlgorithmTest(BaseUnitTest):
task = self.__setup_stub_task()
policy = GreedyPolicy()
value_func = self.__setup_stub_value_function()
- episode = generate_episode(task, value_func, policy)
+ episode = generate_episode(task, policy, value_func)
self.eq(3, len(episode))
self.eq((0, 1, 1, 1), episode[0])
self.eq((1, 2, 3, 9), episode[1])
| tests/kyoka/algorithm_/rl_algorithm_test.py | ArgSwap(idxs=1<->2 @(57,18)->(57,34)) | class BaseRLAlgorithmTest(BaseUnitTest):
task = self.__setup_stub_task()
policy = GreedyPolicy()
value_func = self.__setup_stub_value_function()
episode = generate_episode(task, value_func, policy)
self.eq(3, len(episode))
self.eq((0, 1, 1, 1), episode[0])
self.eq((1, 2, 3, 9), episode[1]) | class BaseRLAlgorithmTest(BaseUnitTest):
task = self.__setup_stub_task()
policy = GreedyPolicy()
value_func = self.__setup_stub_value_function()
episode = generate_episode(task, policy, value_func)
self.eq(3, len(episode))
self.eq((0, 1, 1, 1), episode[0])
self.eq((1, 2, 3, 9), episode[1]) |
1,366 | https://:@bitbucket.org/batterio/regulome_web.git | 1872e4fca0b62b46fea9e60f8e15729c37f39fb9 | @@ -12,7 +12,7 @@ def mark_as_active(pathname):
"""Mark the active page in the navbar"""
for id_page in ('home', 'data', 'credits', 'contact', 'info'):
if id_page in pathname:
- document[pathname].class_name = 'active'
+ document[id_page].class_name = 'active'
else:
document[id_page].class_name = ''
if 'show' in pathname:
| regulome_app/webapp/static/python/utils.py | ReplaceText(target='id_page' @(15,21)->(15,29)) | def mark_as_active(pathname):
"""Mark the active page in the navbar"""
for id_page in ('home', 'data', 'credits', 'contact', 'info'):
if id_page in pathname:
document[pathname].class_name = 'active'
else:
document[id_page].class_name = ''
if 'show' in pathname: | def mark_as_active(pathname):
"""Mark the active page in the navbar"""
for id_page in ('home', 'data', 'credits', 'contact', 'info'):
if id_page in pathname:
document[id_page].class_name = 'active'
else:
document[id_page].class_name = ''
if 'show' in pathname: |
1,367 | https://:@github.com/Mmodarre/pyfujitsu.git | 956c0d2f02ee05c3312d5472f3921a59b7780ea4 | @@ -45,7 +45,7 @@ class splitAC:
def changeTemperature(self,newTemperature):
## set temperature for degree C
- if not isinstance(newTemperature,int) or not isinstance(newTemperature,float):
+ if not isinstance(newTemperature,int) and not isinstance(newTemperature,float):
raise Exception('Wrong usage of method')
## Fixing temps if not given as multiplies of 10 less than 180
if newTemperature < 180:
| pyfujitsu/splitAC.py | ReplaceText(target='and' @(48,46)->(48,48)) | class splitAC:
def changeTemperature(self,newTemperature):
## set temperature for degree C
if not isinstance(newTemperature,int) or not isinstance(newTemperature,float):
raise Exception('Wrong usage of method')
## Fixing temps if not given as multiplies of 10 less than 180
if newTemperature < 180: | class splitAC:
def changeTemperature(self,newTemperature):
## set temperature for degree C
if not isinstance(newTemperature,int) and not isinstance(newTemperature,float):
raise Exception('Wrong usage of method')
## Fixing temps if not given as multiplies of 10 less than 180
if newTemperature < 180: |
1,368 | https://:@github.com/pushrbx/python3-mal.git | 9c5710647f2486e53bc8853c71185349312a857a | @@ -240,7 +240,7 @@ class Anime(Base):
related_type = None
while True:
if not curr_elt:
- raise MalformedAnimePageError(self, html, message="Prematurely reached end of related anime listing")
+ raise MalformedAnimePageError(self, related_elt, message="Prematurely reached end of related anime listing")
if isinstance(curr_elt, bs4.NavigableString):
type_match = re.match('(?P<type>[a-zA-Z\ \-]+):', curr_elt)
if type_match:
| myanimelist/anime.py | ReplaceText(target='related_elt' @(243,48)->(243,52)) | class Anime(Base):
related_type = None
while True:
if not curr_elt:
raise MalformedAnimePageError(self, html, message="Prematurely reached end of related anime listing")
if isinstance(curr_elt, bs4.NavigableString):
type_match = re.match('(?P<type>[a-zA-Z\ \-]+):', curr_elt)
if type_match: | class Anime(Base):
related_type = None
while True:
if not curr_elt:
raise MalformedAnimePageError(self, related_elt, message="Prematurely reached end of related anime listing")
if isinstance(curr_elt, bs4.NavigableString):
type_match = re.match('(?P<type>[a-zA-Z\ \-]+):', curr_elt)
if type_match: |
1,369 | https://:@github.com/pushrbx/python3-mal.git | 36024bc1b0cfa62c59ce9528bed097079f144d1b | @@ -38,7 +38,7 @@ class MediaList(Base, collections.Mapping):
def __init__(self, session, user_name):
super(MediaList, self).__init__(session)
self.username = user_name
- if not isinstance(self.username, unicode) or len(self.username) < 2:
+ if not isinstance(self.username, unicode) or len(self.username) < 1:
raise InvalidMediaListError(self.username)
self._list = None
self._stats = None
| myanimelist/media_list.py | ReplaceText(target='1' @(41,70)->(41,71)) | class MediaList(Base, collections.Mapping):
def __init__(self, session, user_name):
super(MediaList, self).__init__(session)
self.username = user_name
if not isinstance(self.username, unicode) or len(self.username) < 2:
raise InvalidMediaListError(self.username)
self._list = None
self._stats = None | class MediaList(Base, collections.Mapping):
def __init__(self, session, user_name):
super(MediaList, self).__init__(session)
self.username = user_name
if not isinstance(self.username, unicode) or len(self.username) < 1:
raise InvalidMediaListError(self.username)
self._list = None
self._stats = None |
1,370 | https://:@github.com/DrLuke/effigy.git | c970d945fc22787bd6b95ec2f1dfd317876ef4dc | @@ -41,7 +41,7 @@ class QNodeScene(QGraphicsScene):
nodes = [x for x in selectedItems if issubclass(type(x), QNodeSceneNode) and not issubclass(type(x), QNodeSceneNodeUndeletable)]
#remainder = [x for x in selectedItems if not issubclass(type(x), (QNodeSceneNode, NodeLink))]
- if links and nodes:
+ if links or nodes:
self.undostack.beginMacro("Delete Stuff")
for link in links:
self.undostack.push(type(link.startIO).DeleteLinkCommand(link.startIO))
| effigy/QNodeScene.py | ReplaceText(target='or' @(44,17)->(44,20)) | class QNodeScene(QGraphicsScene):
nodes = [x for x in selectedItems if issubclass(type(x), QNodeSceneNode) and not issubclass(type(x), QNodeSceneNodeUndeletable)]
#remainder = [x for x in selectedItems if not issubclass(type(x), (QNodeSceneNode, NodeLink))]
if links and nodes:
self.undostack.beginMacro("Delete Stuff")
for link in links:
self.undostack.push(type(link.startIO).DeleteLinkCommand(link.startIO)) | class QNodeScene(QGraphicsScene):
nodes = [x for x in selectedItems if issubclass(type(x), QNodeSceneNode) and not issubclass(type(x), QNodeSceneNodeUndeletable)]
#remainder = [x for x in selectedItems if not issubclass(type(x), (QNodeSceneNode, NodeLink))]
if links or nodes:
self.undostack.beginMacro("Delete Stuff")
for link in links:
self.undostack.push(type(link.startIO).DeleteLinkCommand(link.startIO)) |
1,371 | https://:@github.com/carlosefr/python-kyototycoon-ng.git | 0a988c311c7858eaa909a50f19d44a3cdf023aa0 | @@ -124,7 +124,7 @@ class Cursor(object):
'''Jump the cursor to a record (last record if "None") for forward scan.'''
db = str(db) if isinstance(db, int) else quote(db.encode('utf-8'))
- path += '/rpc/cur_jump_back?DB=' + db
+ path = '/rpc/cur_jump_back?DB=' + db
request_dict = {'CUR': self.cursor_id}
if key:
| kyototycoon/kt_http.py | ReplaceText(target='=' @(127,13)->(127,15)) | class Cursor(object):
'''Jump the cursor to a record (last record if "None") for forward scan.'''
db = str(db) if isinstance(db, int) else quote(db.encode('utf-8'))
path += '/rpc/cur_jump_back?DB=' + db
request_dict = {'CUR': self.cursor_id}
if key: | class Cursor(object):
'''Jump the cursor to a record (last record if "None") for forward scan.'''
db = str(db) if isinstance(db, int) else quote(db.encode('utf-8'))
path = '/rpc/cur_jump_back?DB=' + db
request_dict = {'CUR': self.cursor_id}
if key: |
1,372 | https://:@github.com/uuazed/numerai_reports.git | 923f6acc29faff293c02abb7f2b8d39ed9f4dae6 | @@ -184,7 +184,7 @@ def fetch_one(round_num, tournament):
if 'nmr_returned' in df:
df['nmr_returned'] = df['nmr_returned'].astype(float)
if round_num == 158:
- df['nmr_bonus'] = bonus_nmr_only.where(df['usd_staking'].isna(), bonus_nmr_only)
+ df['nmr_bonus'] = bonus_nmr_only.where(df['usd_staking'].isna(), bonus_split)
df['usd_bonus'] = df['usd_staking'] - df['usd_staking'] / (1 + staking_bonus_perc)
df['usd_staking'] = df['usd_staking'] - df['usd_bonus']
df['nmr_returned'] -= bonus_nmr_only
| numerai_reports/data.py | ReplaceText(target='bonus_split' @(187,85)->(187,99)) | def fetch_one(round_num, tournament):
if 'nmr_returned' in df:
df['nmr_returned'] = df['nmr_returned'].astype(float)
if round_num == 158:
df['nmr_bonus'] = bonus_nmr_only.where(df['usd_staking'].isna(), bonus_nmr_only)
df['usd_bonus'] = df['usd_staking'] - df['usd_staking'] / (1 + staking_bonus_perc)
df['usd_staking'] = df['usd_staking'] - df['usd_bonus']
df['nmr_returned'] -= bonus_nmr_only | def fetch_one(round_num, tournament):
if 'nmr_returned' in df:
df['nmr_returned'] = df['nmr_returned'].astype(float)
if round_num == 158:
df['nmr_bonus'] = bonus_nmr_only.where(df['usd_staking'].isna(), bonus_split)
df['usd_bonus'] = df['usd_staking'] - df['usd_staking'] / (1 + staking_bonus_perc)
df['usd_staking'] = df['usd_staking'] - df['usd_bonus']
df['nmr_returned'] -= bonus_nmr_only |
1,373 | https://:@github.com/internetimagery/surface.git | ebdcb1f548d4db39fa3e6fac087aeaf49272543b | @@ -149,7 +149,7 @@ class ArgMapper(Mapper):
def get_comment(func): # type: (Any) -> Optional[Tuple[Dict[str, str], str]]
- if not inspect.isfunction(func) or not inspect.ismethod(func):
+ if not inspect.isfunction(func) and not inspect.ismethod(func):
# Classes should be handled, but are not yet...
# Handling them would involve determining if they use __new__ or __init__
# and using that as the function itself.
| surface/_comment.py | ReplaceText(target='and' @(152,36)->(152,38)) | class ArgMapper(Mapper):
def get_comment(func): # type: (Any) -> Optional[Tuple[Dict[str, str], str]]
if not inspect.isfunction(func) or not inspect.ismethod(func):
# Classes should be handled, but are not yet...
# Handling them would involve determining if they use __new__ or __init__
# and using that as the function itself. | class ArgMapper(Mapper):
def get_comment(func): # type: (Any) -> Optional[Tuple[Dict[str, str], str]]
if not inspect.isfunction(func) and not inspect.ismethod(func):
# Classes should be handled, but are not yet...
# Handling them would involve determining if they use __new__ or __init__
# and using that as the function itself. |
1,374 | https://:@github.com/internetimagery/surface.git | ebdcb1f548d4db39fa3e6fac087aeaf49272543b | @@ -12,7 +12,7 @@ from surface._utils import normalize_type
def parse_docstring(func): # type: (Any) -> Optional[Tuple[Dict[str, str], str]]
""" Parse out typing information from docstring """
- if not inspect.isfunction(func) or not inspect.ismethod(func):
+ if not inspect.isfunction(func) and not inspect.ismethod(func):
# Classes should be handled, but are not yet...
# Handling them would involve determining if they use __new__ or __init__
# and using that as the function itself.
| surface/_doc.py | ReplaceText(target='and' @(15,36)->(15,38)) | from surface._utils import normalize_type
def parse_docstring(func): # type: (Any) -> Optional[Tuple[Dict[str, str], str]]
""" Parse out typing information from docstring """
if not inspect.isfunction(func) or not inspect.ismethod(func):
# Classes should be handled, but are not yet...
# Handling them would involve determining if they use __new__ or __init__
# and using that as the function itself. | from surface._utils import normalize_type
def parse_docstring(func): # type: (Any) -> Optional[Tuple[Dict[str, str], str]]
""" Parse out typing information from docstring """
if not inspect.isfunction(func) and not inspect.ismethod(func):
# Classes should be handled, but are not yet...
# Handling them would involve determining if they use __new__ or __init__
# and using that as the function itself. |
1,375 | https://:@github.com/Amper/opyum.git | 444ce0427ba68f5a0d1f49dc039510476c978c2e | @@ -47,6 +47,6 @@ class ConstantFolding(ASTOptimization):
node = ast.copy_location(ast.Num(n = val), node)
elif all(isinstance(value, ast.Str) for value in (left, right)):
if isinstance(node.op, ast.Add):
- val = left.s + left.s
+ val = left.s + right.s
node = ast.copy_location(ast.Str(s = val), node)
return node
| opyum/optimizations/constant_folding.py | ReplaceText(target='right' @(50,32)->(50,36)) | class ConstantFolding(ASTOptimization):
node = ast.copy_location(ast.Num(n = val), node)
elif all(isinstance(value, ast.Str) for value in (left, right)):
if isinstance(node.op, ast.Add):
val = left.s + left.s
node = ast.copy_location(ast.Str(s = val), node)
return node | class ConstantFolding(ASTOptimization):
node = ast.copy_location(ast.Num(n = val), node)
elif all(isinstance(value, ast.Str) for value in (left, right)):
if isinstance(node.op, ast.Add):
val = left.s + right.s
node = ast.copy_location(ast.Str(s = val), node)
return node |
1,376 | https://:@gitlab.com/lbartoletti/portsgraph.git | 3e9e2cae7cc559fdaf062d18a7f6bd2fb0b25fed | @@ -96,7 +96,7 @@ class portgraph:
portname = self.__flavorname2port(ports)
- self.__addnode(portname)
+ self.__addnode(ports)
proc = subprocess.Popen(['make', '-C',
portname,
| portgraph/portgraph.py | ReplaceText(target='ports' @(99,23)->(99,31)) | class portgraph:
portname = self.__flavorname2port(ports)
self.__addnode(portname)
proc = subprocess.Popen(['make', '-C',
portname, | class portgraph:
portname = self.__flavorname2port(ports)
self.__addnode(ports)
proc = subprocess.Popen(['make', '-C',
portname, |
1,377 | https://:@github.com/biolab/orange3-recommendation.git | 55f4a56c940175a50cd6ccf73783bf66cda42a92 | @@ -26,7 +26,7 @@ def ReciprocalRank(results, query):
rank = np.where(results[i] == j)[0]
if len(rank) == 0: # Check values not found
- rank = len(query[i])
+ rank = len(results[i])
else:
rank = rank[0]
all_rr.append(rank)
| orangecontrib/recommendation/evaluation/ranking.py | ReplaceText(target='results' @(29,27)->(29,32)) | def ReciprocalRank(results, query):
rank = np.where(results[i] == j)[0]
if len(rank) == 0: # Check values not found
rank = len(query[i])
else:
rank = rank[0]
all_rr.append(rank) | def ReciprocalRank(results, query):
rank = np.where(results[i] == j)[0]
if len(rank) == 0: # Check values not found
rank = len(results[i])
else:
rank = rank[0]
all_rr.append(rank) |
1,378 | https://:@github.com/biolab/orange3-recommendation.git | 971301a39ce26450ac6bdeee8c9028699b9a240e | @@ -157,7 +157,7 @@ class TestSVDPlusPlus(unittest.TestCase):
recommender.compute_objective(data=data, P=recommender.P,
Q=recommender.Q,
Y=recommender.Y,
- bias=learner.bias,
+ bias=recommender.bias,
beta=learner.beta))
# Assert objective values decrease
| orangecontrib/recommendation/tests/test_svdplusplus.py | ReplaceText(target='recommender' @(160,51)->(160,58)) | class TestSVDPlusPlus(unittest.TestCase):
recommender.compute_objective(data=data, P=recommender.P,
Q=recommender.Q,
Y=recommender.Y,
bias=learner.bias,
beta=learner.beta))
# Assert objective values decrease | class TestSVDPlusPlus(unittest.TestCase):
recommender.compute_objective(data=data, P=recommender.P,
Q=recommender.Q,
Y=recommender.Y,
bias=recommender.bias,
beta=learner.beta))
# Assert objective values decrease |
1,379 | https://:@github.com/silvacms/silva.core.conf.git | 306ed54d4a7497da3c21d172e5e00215a4746f7d | @@ -53,7 +53,7 @@ class ExtensionGrokker(martian.GlobalGrokker):
module_directory = extension.module_directory
# Register Silva Views directory
if os.path.exists(os.path.join(module_directory, 'views')):
- registerDirectory(module_directory, 'views')
+ registerDirectory('views', module_directory)
return True
| silva/core/conf/martiansupport/extension.py | ArgSwap(idxs=0<->1 @(56,16)->(56,33)) | class ExtensionGrokker(martian.GlobalGrokker):
module_directory = extension.module_directory
# Register Silva Views directory
if os.path.exists(os.path.join(module_directory, 'views')):
registerDirectory(module_directory, 'views')
return True
| class ExtensionGrokker(martian.GlobalGrokker):
module_directory = extension.module_directory
# Register Silva Views directory
if os.path.exists(os.path.join(module_directory, 'views')):
registerDirectory('views', module_directory)
return True
|
1,380 | https://:@github.com/ryneches/pique.git | 18e98cd6fcbf957012114313f108b7262fc5199d | @@ -72,7 +72,7 @@ def detect( name, ipfile, bgfile, mapfile, alpha, l_thresh, pickle_file ) :
# log inputs
pique.msg( logfile, ' -> IP file : ' + ipfile )
- pique.msg( logfile, ' -> BG file : ' + ipfile )
+ pique.msg( logfile, ' -> BG file : ' + bgfile )
pique.msg( logfile, ' -> map file : ' + mapfile )
pique.msg( logfile, ' -> alpha : ' + str(alpha) )
pique.msg( logfile, ' -> l_thresh : ' + str(l_thresh) )
| pique/runtime.py | ReplaceText(target='bgfile' @(75,45)->(75,51)) | def detect( name, ipfile, bgfile, mapfile, alpha, l_thresh, pickle_file ) :
# log inputs
pique.msg( logfile, ' -> IP file : ' + ipfile )
pique.msg( logfile, ' -> BG file : ' + ipfile )
pique.msg( logfile, ' -> map file : ' + mapfile )
pique.msg( logfile, ' -> alpha : ' + str(alpha) )
pique.msg( logfile, ' -> l_thresh : ' + str(l_thresh) ) | def detect( name, ipfile, bgfile, mapfile, alpha, l_thresh, pickle_file ) :
# log inputs
pique.msg( logfile, ' -> IP file : ' + ipfile )
pique.msg( logfile, ' -> BG file : ' + bgfile )
pique.msg( logfile, ' -> map file : ' + mapfile )
pique.msg( logfile, ' -> alpha : ' + str(alpha) )
pique.msg( logfile, ' -> l_thresh : ' + str(l_thresh) ) |
1,381 | https://:@github.com/smok-serwis/coolamqp.git | e4c86dec8d84545d9616859290377338bf159df5 | @@ -87,7 +87,7 @@ class Order(object):
"""Return whether the operation failed, ie. completed but with an error code.
Cancelled and discarded ops are considered failed.
This assumes that this order has been .wait()ed upon"""
- return self._result is True
+ return self._result is not True
def result(self):
"""Wait until this is completed and return a response"""
| coolamqp/orders.py | ReplaceText(target=' is not ' @(90,27)->(90,31)) | class Order(object):
"""Return whether the operation failed, ie. completed but with an error code.
Cancelled and discarded ops are considered failed.
This assumes that this order has been .wait()ed upon"""
return self._result is True
def result(self):
"""Wait until this is completed and return a response""" | class Order(object):
"""Return whether the operation failed, ie. completed but with an error code.
Cancelled and discarded ops are considered failed.
This assumes that this order has been .wait()ed upon"""
return self._result is not True
def result(self):
"""Wait until this is completed and return a response""" |
1,382 | https://:@github.com/smok-serwis/coolamqp.git | 2aadc44e07e1d6f23cecaf3c65a29807a1fa602c | @@ -140,7 +140,7 @@ class Connection(object):
(self.node_definition.host, self.node_definition.port))
except socket.error as e:
time.sleep(0.5) # Connection refused? Very bad things?
- if monotonic.monotonic() - start_at < timeout:
+ if monotonic.monotonic() - start_at > timeout:
raise ConnectionDead()
else:
break
| coolamqp/uplink/connection/connection.py | ReplaceText(target='>' @(143,52)->(143,53)) | class Connection(object):
(self.node_definition.host, self.node_definition.port))
except socket.error as e:
time.sleep(0.5) # Connection refused? Very bad things?
if monotonic.monotonic() - start_at < timeout:
raise ConnectionDead()
else:
break | class Connection(object):
(self.node_definition.host, self.node_definition.port))
except socket.error as e:
time.sleep(0.5) # Connection refused? Very bad things?
if monotonic.monotonic() - start_at > timeout:
raise ConnectionDead()
else:
break |
1,383 | https://:@github.com/smok-serwis/coolamqp.git | a0e62d972ed89ad3a43838caf2f8c8dde438b151 | @@ -85,7 +85,7 @@ class Operation(object):
self.enqueued_span = None
def span_finished(self):
- if self.processing_span is None:
+ if self.processing_span is not None:
self.processing_span.finish()
self.processing_span = None
| coolamqp/attaches/declarer.py | ReplaceText(target=' is not ' @(88,31)->(88,35)) | class Operation(object):
self.enqueued_span = None
def span_finished(self):
if self.processing_span is None:
self.processing_span.finish()
self.processing_span = None
| class Operation(object):
self.enqueued_span = None
def span_finished(self):
if self.processing_span is not None:
self.processing_span.finish()
self.processing_span = None
|
1,384 | https://:@github.com/ryogrid/Over-NAT-Lib.git | 86f4eca56bb460e898441cc13c55c663de9d8932 | @@ -323,7 +323,7 @@ async def sender_server_handler(reader, writer):
while True:
# if flag backed to False, end this handler because it means receiver side client disconnected
- if remote_stdout_connected == False or file_transfer_mode == False:
+ if remote_stdout_connected == False and file_transfer_mode == False:
# clear bufferd data
if sender_fifo_q.empty() == False:
print("reset sender_fifo_q because it is not empty")
| tools/p2p_com_local_server.py | ReplaceText(target='and' @(326,48)->(326,50)) | async def sender_server_handler(reader, writer):
while True:
# if flag backed to False, end this handler because it means receiver side client disconnected
if remote_stdout_connected == False or file_transfer_mode == False:
# clear bufferd data
if sender_fifo_q.empty() == False:
print("reset sender_fifo_q because it is not empty") | async def sender_server_handler(reader, writer):
while True:
# if flag backed to False, end this handler because it means receiver side client disconnected
if remote_stdout_connected == False and file_transfer_mode == False:
# clear bufferd data
if sender_fifo_q.empty() == False:
print("reset sender_fifo_q because it is not empty") |
1,385 | https://:@github.com/bitcaster-io/bitcaster.git | d02b5489dc239a6da6324aa62274ed1311808a15 | @@ -619,7 +619,7 @@ if DEBUG:
if request.user.is_authenticated:
if request.path in ignored:
return False
- return True
+ return False
INSTALLED_APPS = INSTALLED_APPS + ['debug_toolbar']
MIDDLEWARE = MIDDLEWARE + ['debug_toolbar.middleware.DebugToolbarMiddleware', ]
| src/bitcaster/config/settings.py | ReplaceText(target='False' @(622,15)->(622,19)) | if DEBUG:
if request.user.is_authenticated:
if request.path in ignored:
return False
return True
INSTALLED_APPS = INSTALLED_APPS + ['debug_toolbar']
MIDDLEWARE = MIDDLEWARE + ['debug_toolbar.middleware.DebugToolbarMiddleware', ] | if DEBUG:
if request.user.is_authenticated:
if request.path in ignored:
return False
return False
INSTALLED_APPS = INSTALLED_APPS + ['debug_toolbar']
MIDDLEWARE = MIDDLEWARE + ['debug_toolbar.middleware.DebugToolbarMiddleware', ] |
1,386 | https://:@github.com/bitcaster-io/bitcaster.git | 8e32c0ae2bf35f2f7a959eeb34adfb80c4bf865a | @@ -619,7 +619,7 @@ if DEBUG:
if request.user.is_authenticated:
if request.path in ignored:
return False
- return False
+ return True
INSTALLED_APPS = INSTALLED_APPS + ['debug_toolbar']
MIDDLEWARE = MIDDLEWARE + ['debug_toolbar.middleware.DebugToolbarMiddleware', ]
| src/bitcaster/config/settings.py | ReplaceText(target='True' @(622,15)->(622,20)) | if DEBUG:
if request.user.is_authenticated:
if request.path in ignored:
return False
return False
INSTALLED_APPS = INSTALLED_APPS + ['debug_toolbar']
MIDDLEWARE = MIDDLEWARE + ['debug_toolbar.middleware.DebugToolbarMiddleware', ] | if DEBUG:
if request.user.is_authenticated:
if request.path in ignored:
return False
return True
INSTALLED_APPS = INSTALLED_APPS + ['debug_toolbar']
MIDDLEWARE = MIDDLEWARE + ['debug_toolbar.middleware.DebugToolbarMiddleware', ] |
1,387 | https://:@github.com/cescalara/fancy.git | 416c970b7b88aa138d2b288b0a9aa1a163334126 | @@ -57,7 +57,7 @@ class Corner():
N = np.shape(data_frame)[1]
for j in range(N):
for k in range(N):
- if i != k:
+ if j != k:
pairgrid.axes[i, k].spines['right'].set_visible(True)
pairgrid.axes[i, k].spines['top'].set_visible(True)
else:
| fancy/plotting/corner.py | ReplaceText(target='j' @(60,23)->(60,24)) | class Corner():
N = np.shape(data_frame)[1]
for j in range(N):
for k in range(N):
if i != k:
pairgrid.axes[i, k].spines['right'].set_visible(True)
pairgrid.axes[i, k].spines['top'].set_visible(True)
else: | class Corner():
N = np.shape(data_frame)[1]
for j in range(N):
for k in range(N):
if j != k:
pairgrid.axes[i, k].spines['right'].set_visible(True)
pairgrid.axes[i, k].spines['top'].set_visible(True)
else: |
1,388 | https://:@github.com/cescalara/fancy.git | a05d109c3e85debb19ed2d3051fb178f2c19f409 | @@ -58,7 +58,7 @@ class Corner():
for i in range(N):
for j in range(N):
for k in range(N):
- if j != k:
+ if i != k:
pairgrid.axes[i, k].spines['right'].set_visible(True)
pairgrid.axes[i, k].spines['top'].set_visible(True)
else:
| fancy/plotting/corner.py | ReplaceText(target='i' @(61,27)->(61,28)) | class Corner():
for i in range(N):
for j in range(N):
for k in range(N):
if j != k:
pairgrid.axes[i, k].spines['right'].set_visible(True)
pairgrid.axes[i, k].spines['top'].set_visible(True)
else: | class Corner():
for i in range(N):
for j in range(N):
for k in range(N):
if i != k:
pairgrid.axes[i, k].spines['right'].set_visible(True)
pairgrid.axes[i, k].spines['top'].set_visible(True)
else: |
1,389 | https://:@github.com/bbernhard/imagemonkey-libs.git | d393bd724b9531963bef3a6d8da74e9bcaae047b | @@ -45,7 +45,7 @@ class PolyPoints(object):
if p.y < 0:
y = 0
elif p.y > rect.height:
- x = rect.height
+ y = rect.height
else:
y = p.y
| python/pyimagemonkey/api.py | ReplaceText(target='y' @(48,4)->(48,5)) | class PolyPoints(object):
if p.y < 0:
y = 0
elif p.y > rect.height:
x = rect.height
else:
y = p.y
| class PolyPoints(object):
if p.y < 0:
y = 0
elif p.y > rect.height:
y = rect.height
else:
y = p.y
|
1,390 | https://:@github.com/bbernhard/imagemonkey-libs.git | 0cce51ce916ffb8f42ff0492bf91937a65cdb78b | @@ -221,7 +221,7 @@ class TensorflowTrainer(object):
if self._statistics is not None:
self._statistics.output_path = self._statistics_dir + os.path.sep + "statistics.json"
- self._statistics.generate(d)
+ self._statistics.generate(data)
self._statistics.save()
self._train_object_detection(labels, data, learning_rate)
| python/pyimagemonkey/utils.py | ReplaceText(target='data' @(224,30)->(224,31)) | class TensorflowTrainer(object):
if self._statistics is not None:
self._statistics.output_path = self._statistics_dir + os.path.sep + "statistics.json"
self._statistics.generate(d)
self._statistics.save()
self._train_object_detection(labels, data, learning_rate) | class TensorflowTrainer(object):
if self._statistics is not None:
self._statistics.output_path = self._statistics_dir + os.path.sep + "statistics.json"
self._statistics.generate(data)
self._statistics.save()
self._train_object_detection(labels, data, learning_rate) |
1,391 | https://:@github.com/OSSOS/MOP.git | 2b9c4af87e1b899b7589cfb04aa272540d2e8a04 | @@ -61,7 +61,7 @@ class GeneralModelTest(FileReadingTestCase, DirectoryCleaningTestCase):
# Put a real fits image on the first source, first observation
apcor_str = "4 15 0.19 0.01"
with open(self.get_abs_path(path), "rb") as fh:
- self.first_image = DownloadedFitsImage(fh.read(), apcor_str, Mock(), in_memory=True)
+ self.first_image = DownloadedFitsImage(fh.read(), Mock(), apcor_str, in_memory=True)
first_reading = self.model.get_current_workunit().get_sources()[0].get_readings()[0]
self.model._on_image_loaded(first_reading, self.first_image)
| src/ossos-pipeline/tests/test_integration/test_models.py | ArgSwap(idxs=1<->2 @(64,31)->(64,50)) | class GeneralModelTest(FileReadingTestCase, DirectoryCleaningTestCase):
# Put a real fits image on the first source, first observation
apcor_str = "4 15 0.19 0.01"
with open(self.get_abs_path(path), "rb") as fh:
self.first_image = DownloadedFitsImage(fh.read(), apcor_str, Mock(), in_memory=True)
first_reading = self.model.get_current_workunit().get_sources()[0].get_readings()[0]
self.model._on_image_loaded(first_reading, self.first_image)
| class GeneralModelTest(FileReadingTestCase, DirectoryCleaningTestCase):
# Put a real fits image on the first source, first observation
apcor_str = "4 15 0.19 0.01"
with open(self.get_abs_path(path), "rb") as fh:
self.first_image = DownloadedFitsImage(fh.read(), Mock(), apcor_str, in_memory=True)
first_reading = self.model.get_current_workunit().get_sources()[0].get_readings()[0]
self.model._on_image_loaded(first_reading, self.first_image)
|
1,392 | https://:@github.com/robofit/arcor2.git | 08ed34b3a85635a6617ac785b067c3415227a6ce | @@ -158,7 +158,7 @@ def object_actions(plugins: Dict[Type, Type[ParameterPlugin]], type_def: Union[T
data = ObjectAction(name=method_name, meta=meta)
- if method_def in type_def.CANCEL_MAPPING:
+ if method_name in type_def.CANCEL_MAPPING:
meta.cancellable = True
doc = parse_docstring(method_def.__doc__)
| arcor2/object_types_utils.py | ReplaceText(target='method_name' @(161,11)->(161,21)) | def object_actions(plugins: Dict[Type, Type[ParameterPlugin]], type_def: Union[T
data = ObjectAction(name=method_name, meta=meta)
if method_def in type_def.CANCEL_MAPPING:
meta.cancellable = True
doc = parse_docstring(method_def.__doc__) | def object_actions(plugins: Dict[Type, Type[ParameterPlugin]], type_def: Union[T
data = ObjectAction(name=method_name, meta=meta)
if method_name in type_def.CANCEL_MAPPING:
meta.cancellable = True
doc = parse_docstring(method_def.__doc__) |
1,393 | https://:@github.com/YoSTEALTH/Liburing.git | 35981679eadc569fb31d154d245aeeeef086fff4 | @@ -81,7 +81,7 @@ def timespec(seconds=0, nanoseconds=0):
>>> io_uring_wait_cqes(..., ts=timespec(), ...)
>>> io_uring_wait_cqes(..., ts=timespec(None), ...)
'''
- if not seconds or nanoseconds:
+ if seconds or nanoseconds:
ts = ffi.new('struct __kernel_timespec[1]')
ts[0].tv_sec = seconds or 0
ts[0].tv_nsec = nanoseconds or 0
| liburing/helper.py | ReplaceText(target='' @(84,7)->(84,11)) | def timespec(seconds=0, nanoseconds=0):
>>> io_uring_wait_cqes(..., ts=timespec(), ...)
>>> io_uring_wait_cqes(..., ts=timespec(None), ...)
'''
if not seconds or nanoseconds:
ts = ffi.new('struct __kernel_timespec[1]')
ts[0].tv_sec = seconds or 0
ts[0].tv_nsec = nanoseconds or 0 | def timespec(seconds=0, nanoseconds=0):
>>> io_uring_wait_cqes(..., ts=timespec(), ...)
>>> io_uring_wait_cqes(..., ts=timespec(None), ...)
'''
if seconds or nanoseconds:
ts = ffi.new('struct __kernel_timespec[1]')
ts[0].tv_sec = seconds or 0
ts[0].tv_nsec = nanoseconds or 0 |
1,394 | https://:@github.com/shaldengeki/python-mal.git | 9c5710647f2486e53bc8853c71185349312a857a | @@ -240,7 +240,7 @@ class Anime(Base):
related_type = None
while True:
if not curr_elt:
- raise MalformedAnimePageError(self, html, message="Prematurely reached end of related anime listing")
+ raise MalformedAnimePageError(self, related_elt, message="Prematurely reached end of related anime listing")
if isinstance(curr_elt, bs4.NavigableString):
type_match = re.match('(?P<type>[a-zA-Z\ \-]+):', curr_elt)
if type_match:
| myanimelist/anime.py | ReplaceText(target='related_elt' @(243,48)->(243,52)) | class Anime(Base):
related_type = None
while True:
if not curr_elt:
raise MalformedAnimePageError(self, html, message="Prematurely reached end of related anime listing")
if isinstance(curr_elt, bs4.NavigableString):
type_match = re.match('(?P<type>[a-zA-Z\ \-]+):', curr_elt)
if type_match: | class Anime(Base):
related_type = None
while True:
if not curr_elt:
raise MalformedAnimePageError(self, related_elt, message="Prematurely reached end of related anime listing")
if isinstance(curr_elt, bs4.NavigableString):
type_match = re.match('(?P<type>[a-zA-Z\ \-]+):', curr_elt)
if type_match: |
1,395 | https://:@github.com/elastic-infra/kenetsu.git | 03c7835bf88602e6fb8ab4d149338ed1cde30dba | @@ -15,7 +15,7 @@ locale.setlocale(locale.LC_ALL, "C")
def main():
- if len(sys.argv) <= 2:
+ if len(sys.argv) < 2:
usage(sys.argv[0])
sys.exit(1)
duration = int(sys.argv[1])
| kenetsu/cli.py | ReplaceText(target='<' @(18,21)->(18,23)) | locale.setlocale(locale.LC_ALL, "C")
def main():
if len(sys.argv) <= 2:
usage(sys.argv[0])
sys.exit(1)
duration = int(sys.argv[1]) | locale.setlocale(locale.LC_ALL, "C")
def main():
if len(sys.argv) < 2:
usage(sys.argv[0])
sys.exit(1)
duration = int(sys.argv[1]) |
1,396 | https://:@github.com/Quansight-Labs/python-moa.git | 5a344b476cee3d51e450d405f4b085eb05758358 | @@ -152,7 +152,7 @@ def _shape_plus_minus_divide_times(symbol_table, node):
shape = shape + (left_element,)
elif is_symbolic_element(left_element): # only left is symbolic
array_name = generate_unique_array_name(symbol_table)
- symbol_table = add_symbol(symbol_table, array_name, MOANodeTypes.ARRAY, (), (left_element,))
+ symbol_table = add_symbol(symbol_table, array_name, MOANodeTypes.ARRAY, (), (right_element,))
conditions.append(BinaryNode(MOANodeTypes.EQUAL, (), left_element, ArrayNode(MOANodeTypes.ARRAY, (), array_name)))
shape = shape + (right_element,)
elif is_symbolic_element(right_element): # only right is symbolic
| moa/shape.py | ReplaceText(target='right_element' @(155,93)->(155,105)) | def _shape_plus_minus_divide_times(symbol_table, node):
shape = shape + (left_element,)
elif is_symbolic_element(left_element): # only left is symbolic
array_name = generate_unique_array_name(symbol_table)
symbol_table = add_symbol(symbol_table, array_name, MOANodeTypes.ARRAY, (), (left_element,))
conditions.append(BinaryNode(MOANodeTypes.EQUAL, (), left_element, ArrayNode(MOANodeTypes.ARRAY, (), array_name)))
shape = shape + (right_element,)
elif is_symbolic_element(right_element): # only right is symbolic | def _shape_plus_minus_divide_times(symbol_table, node):
shape = shape + (left_element,)
elif is_symbolic_element(left_element): # only left is symbolic
array_name = generate_unique_array_name(symbol_table)
symbol_table = add_symbol(symbol_table, array_name, MOANodeTypes.ARRAY, (), (right_element,))
conditions.append(BinaryNode(MOANodeTypes.EQUAL, (), left_element, ArrayNode(MOANodeTypes.ARRAY, (), array_name)))
shape = shape + (right_element,)
elif is_symbolic_element(right_element): # only right is symbolic |
1,397 | https://:@github.com/Quansight-Labs/python-moa.git | a7983c3d549207db15510ccbfc24a07dbb7fa442 | @@ -116,7 +116,7 @@ def _shape_psi(symbol_table, node):
conditions.append(BinaryNode(MOANodeTypes.LESSTHAN, (), left_element, right_element))
elif is_symbolic_element(left_element): # only left is symbolic
array_name = generate_unique_array_name(symbol_table)
- symbol_table = add_symbol(symbol_table, array_name, MOANodeTypes.ARRAY, (), (left_element,))
+ symbol_table = add_symbol(symbol_table, array_name, MOANodeTypes.ARRAY, (), (right_element,))
conditions.append(BinaryNode(MOANodeTypes.LESSTHAN, (), left_element, ArrayNode(MOANodeTypes.ARRAY, (), array_name)))
elif is_symbolic_element(right_element): # only right is symbolic
array_name = generate_unique_array_name(symbol_table)
| moa/shape.py | ReplaceText(target='right_element' @(119,89)->(119,101)) | def _shape_psi(symbol_table, node):
conditions.append(BinaryNode(MOANodeTypes.LESSTHAN, (), left_element, right_element))
elif is_symbolic_element(left_element): # only left is symbolic
array_name = generate_unique_array_name(symbol_table)
symbol_table = add_symbol(symbol_table, array_name, MOANodeTypes.ARRAY, (), (left_element,))
conditions.append(BinaryNode(MOANodeTypes.LESSTHAN, (), left_element, ArrayNode(MOANodeTypes.ARRAY, (), array_name)))
elif is_symbolic_element(right_element): # only right is symbolic
array_name = generate_unique_array_name(symbol_table) | def _shape_psi(symbol_table, node):
conditions.append(BinaryNode(MOANodeTypes.LESSTHAN, (), left_element, right_element))
elif is_symbolic_element(left_element): # only left is symbolic
array_name = generate_unique_array_name(symbol_table)
symbol_table = add_symbol(symbol_table, array_name, MOANodeTypes.ARRAY, (), (right_element,))
conditions.append(BinaryNode(MOANodeTypes.LESSTHAN, (), left_element, ArrayNode(MOANodeTypes.ARRAY, (), array_name)))
elif is_symbolic_element(right_element): # only right is symbolic
array_name = generate_unique_array_name(symbol_table) |
1,398 | https://:@github.com/felipeochoa/minecart.git | 66e29717bab0079029db839a8868c2b7a1878873 | @@ -48,7 +48,7 @@ class DeviceLoader(pdfminer.pdfdevice.PDFTextDevice):
device_path.append(
(segment[0],)
+ pdfminer.utils.apply_matrix_pt(self.ctm, (x, y)))
- self.page.add_shape(content.Shape(stroke, fill, evenodd, path))
+ self.page.add_shape(content.Shape(stroke, fill, evenodd, device_path))
def render_image(self, name, stream):
self.page.add_image(content.Image(self.ctm, stream))
| src/miner.py | ReplaceText(target='device_path' @(51,65)->(51,69)) | class DeviceLoader(pdfminer.pdfdevice.PDFTextDevice):
device_path.append(
(segment[0],)
+ pdfminer.utils.apply_matrix_pt(self.ctm, (x, y)))
self.page.add_shape(content.Shape(stroke, fill, evenodd, path))
def render_image(self, name, stream):
self.page.add_image(content.Image(self.ctm, stream)) | class DeviceLoader(pdfminer.pdfdevice.PDFTextDevice):
device_path.append(
(segment[0],)
+ pdfminer.utils.apply_matrix_pt(self.ctm, (x, y)))
self.page.add_shape(content.Shape(stroke, fill, evenodd, device_path))
def render_image(self, name, stream):
self.page.add_image(content.Image(self.ctm, stream)) |
1,399 | https://:@bitbucket.org/creminslab/lib5c.git | 9562f0ce961bd4ddadb3171783c27eedc8bcf577 | @@ -158,7 +158,7 @@ def joint_express_normalize(obs_matrices, exp_matrices, max_iter=1000,
# apply optimized bias to observed
log_corr_obs_matrices = [(log_obs_matrix.T - bias_factors).T - bias_factors
- for log_obs_matrix in log_exp_matrices]
+ for log_obs_matrix in log_obs_matrices]
# undo log transform
normalized_matrices = [np.exp(log_corr_obs_matrix) - 1
| lib5c/algorithms/express.py | ReplaceText(target='log_obs_matrices' @(161,51)->(161,67)) | def joint_express_normalize(obs_matrices, exp_matrices, max_iter=1000,
# apply optimized bias to observed
log_corr_obs_matrices = [(log_obs_matrix.T - bias_factors).T - bias_factors
for log_obs_matrix in log_exp_matrices]
# undo log transform
normalized_matrices = [np.exp(log_corr_obs_matrix) - 1 | def joint_express_normalize(obs_matrices, exp_matrices, max_iter=1000,
# apply optimized bias to observed
log_corr_obs_matrices = [(log_obs_matrix.T - bias_factors).T - bias_factors
for log_obs_matrix in log_obs_matrices]
# undo log transform
normalized_matrices = [np.exp(log_corr_obs_matrix) - 1 |
Subsets and Splits