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,600
https://:@github.com/scipion-em/scipion-pyworkflow.git
3be24fd9b6a88e9983b36276a227cabd26477c08
@@ -419,7 +419,7 @@ class ImageHandler(object): def createEmptyImage(cls, fnOut, xDim=1, yDim=1, zDim=1, nDim=1, dataType=None): dt = dataType or cls.DT_FLOAT - xmippLib.createEmptyFile(fnOut, xDim, yDim, zDim, nDim, dataType) + xmippLib.createEmptyFile(fnOut, xDim, yDim, zDim, nDim, dt) @classmethod def isImageFile(cls, imgFn):
pyworkflow/em/convert/image_handler.py
ReplaceText(target='dt' @(422,64)->(422,72))
class ImageHandler(object): def createEmptyImage(cls, fnOut, xDim=1, yDim=1, zDim=1, nDim=1, dataType=None): dt = dataType or cls.DT_FLOAT xmippLib.createEmptyFile(fnOut, xDim, yDim, zDim, nDim, dataType) @classmethod def isImageFile(cls, imgFn):
class ImageHandler(object): def createEmptyImage(cls, fnOut, xDim=1, yDim=1, zDim=1, nDim=1, dataType=None): dt = dataType or cls.DT_FLOAT xmippLib.createEmptyFile(fnOut, xDim, yDim, zDim, nDim, dt) @classmethod def isImageFile(cls, imgFn):
1,601
https://:@github.com/ai4socialscience/synthetic.git
219d17b6e2d94230c0ae4f0040cb7684afe8a98c
@@ -21,7 +21,7 @@ class Const(Command): edges = arg_with_default(args, 'edges', DEFAULT_EDGES) gentype = arg_with_default(args, 'gentype', DEFAULT_GEN_TYPE) - generator = load_generator(prog, gentype, directed) + generator = load_generator(prog, directed, gentype) generator.run(nodes, edges, sr) print('is constant? %s' % generator.is_constant())
netgens/commands/const.py
ArgSwap(idxs=1<->2 @(24,20)->(24,34))
class Const(Command): edges = arg_with_default(args, 'edges', DEFAULT_EDGES) gentype = arg_with_default(args, 'gentype', DEFAULT_GEN_TYPE) generator = load_generator(prog, gentype, directed) generator.run(nodes, edges, sr) print('is constant? %s' % generator.is_constant())
class Const(Command): edges = arg_with_default(args, 'edges', DEFAULT_EDGES) gentype = arg_with_default(args, 'gentype', DEFAULT_GEN_TYPE) generator = load_generator(prog, directed, gentype) generator.run(nodes, edges, sr) print('is constant? %s' % generator.is_constant())
1,602
https://:@github.com/ai4socialscience/synthetic.git
219d17b6e2d94230c0ae4f0040cb7684afe8a98c
@@ -29,7 +29,7 @@ class Evolve(Command): net = load_net(netfile, directed) # create base generator - base_generator = create_generator(gen_type, directed) + base_generator = create_generator(directed, gen_type) if base_generator is None: self.error_msg = 'unknown generator type: %s' % gen_type return False
netgens/commands/evo.py
ArgSwap(idxs=0<->1 @(32,25)->(32,41))
class Evolve(Command): net = load_net(netfile, directed) # create base generator base_generator = create_generator(gen_type, directed) if base_generator is None: self.error_msg = 'unknown generator type: %s' % gen_type return False
class Evolve(Command): net = load_net(netfile, directed) # create base generator base_generator = create_generator(directed, gen_type) if base_generator is None: self.error_msg = 'unknown generator type: %s' % gen_type return False
1,603
https://:@github.com/ai4socialscience/synthetic.git
219d17b6e2d94230c0ae4f0040cb7684afe8a98c
@@ -26,7 +26,7 @@ class Gen(Command): print('edges: %s' % edges) # load and run generator - gen = load_generator(prog, gentype, directed) + gen = load_generator(prog, directed, gentype) net = gen.run(nodes, edges, sr) # write net
netgens/commands/gen.py
ArgSwap(idxs=1<->2 @(29,14)->(29,28))
class Gen(Command): print('edges: %s' % edges) # load and run generator gen = load_generator(prog, gentype, directed) net = gen.run(nodes, edges, sr) # write net
class Gen(Command): print('edges: %s' % edges) # load and run generator gen = load_generator(prog, directed, gentype) net = gen.run(nodes, edges, sr) # write net
1,604
https://:@github.com/marinang/SimulationProduction.git
ec512dd8aa1a4eaec590b1642a9f0fa91fe06ea7
@@ -199,7 +199,7 @@ def main( **kwargs ): execname = execname.split("/")[-1] for arg in infiles : - os.system("cp " + arg + " " + copyto ) + os.system("cp " + arg + " " + dirname ) ######################################################################################## ## Create the run.sh file containing the information about how the executable is run
scripts/submit.py
ReplaceText(target='dirname' @(202,38)->(202,44))
def main( **kwargs ): execname = execname.split("/")[-1] for arg in infiles : os.system("cp " + arg + " " + copyto ) ######################################################################################## ## Create the run.sh file containing the information about how the executable is run
def main( **kwargs ): execname = execname.split("/")[-1] for arg in infiles : os.system("cp " + arg + " " + dirname ) ######################################################################################## ## Create the run.sh file containing the information about how the executable is run
1,605
https://:@github.com/cocolab-projects/reference-game-exploration.git
c2b4f90165598f92c40c531cb689724c614ce82a
@@ -73,7 +73,7 @@ class Engine(object): self.seed = self.parsed['seed'] - if path.exists(DIR+ 'seeds_save/' + 'seed.txt'): + if not path.exists(DIR+ 'seeds_save/' + 'seed.txt'): seedNew = random.randint(1,1000001) self.seed = seedNew # val.write(str(val.read()) + "\n" + str(seedNew))
Engine.py
ReplaceText(target='not ' @(76,11)->(76,11))
class Engine(object): self.seed = self.parsed['seed'] if path.exists(DIR+ 'seeds_save/' + 'seed.txt'): seedNew = random.randint(1,1000001) self.seed = seedNew # val.write(str(val.read()) + "\n" + str(seedNew))
class Engine(object): self.seed = self.parsed['seed'] if not path.exists(DIR+ 'seeds_save/' + 'seed.txt'): seedNew = random.randint(1,1000001) self.seed = seedNew # val.write(str(val.read()) + "\n" + str(seedNew))
1,606
https://:@github.com/kwgoodman/numerox.git
97e4991c848c67c09302962a87e9cdbff58e418f
@@ -19,7 +19,7 @@ def test_run(): nx.run(model, splitter, tournament=2, verbosity=0) nx.run(model, splitter, tournament='bernie', verbosity=0) p = nx.run(model, splitter, tournament=None, verbosity=0) - ok_(p.shape[1] != 5, 'wrong number of tournaments') + ok_(p.shape[1] == 5, 'wrong number of tournaments') def test_backtest_production():
numerox/tests/test_run.py
ReplaceText(target='==' @(22,27)->(22,29))
def test_run(): nx.run(model, splitter, tournament=2, verbosity=0) nx.run(model, splitter, tournament='bernie', verbosity=0) p = nx.run(model, splitter, tournament=None, verbosity=0) ok_(p.shape[1] != 5, 'wrong number of tournaments') def test_backtest_production():
def test_run(): nx.run(model, splitter, tournament=2, verbosity=0) nx.run(model, splitter, tournament='bernie', verbosity=0) p = nx.run(model, splitter, tournament=None, verbosity=0) ok_(p.shape[1] == 5, 'wrong number of tournaments') def test_backtest_production():
1,607
https://:@github.com/kwgoodman/numerox.git
600643704da6879ae87d7bc31d9d606eae1be7e7
@@ -144,7 +144,7 @@ def calc_metrics_arrays(y, yhat, columns): m = np.nan elif col == 'corr_pass': try: - m = spearmanr(y, yhat).correlation < CORR_BENCHMARK + m = spearmanr(y, yhat).correlation > CORR_BENCHMARK except ValueError: m = np.nan elif col == 'mse':
numerox/metrics.py
ReplaceText(target='>' @(147,51)->(147,52))
def calc_metrics_arrays(y, yhat, columns): m = np.nan elif col == 'corr_pass': try: m = spearmanr(y, yhat).correlation < CORR_BENCHMARK except ValueError: m = np.nan elif col == 'mse':
def calc_metrics_arrays(y, yhat, columns): m = np.nan elif col == 'corr_pass': try: m = spearmanr(y, yhat).correlation > CORR_BENCHMARK except ValueError: m = np.nan elif col == 'mse':
1,608
https://:@github.com/gillesdami/python-sc2.git
c3f5b0de304727914a2a59d5cfde6dda04071686
@@ -381,7 +381,7 @@ class BotAI(object): return ActionResult.CantFindPlacementLocation unit = unit or self.select_build_worker(p) - if unit is None or self.can_afford(building): + if unit is None or not self.can_afford(building): return ActionResult.Error return await self.do(unit.build(building, p))
sc2/bot_ai.py
ReplaceText(target='not ' @(384,27)->(384,27))
class BotAI(object): return ActionResult.CantFindPlacementLocation unit = unit or self.select_build_worker(p) if unit is None or self.can_afford(building): return ActionResult.Error return await self.do(unit.build(building, p))
class BotAI(object): return ActionResult.CantFindPlacementLocation unit = unit or self.select_build_worker(p) if unit is None or not self.can_afford(building): return ActionResult.Error return await self.do(unit.build(building, p))
1,609
https://:@github.com/HPAC/linnea.git
2e7be444fab1d09db0c5547398f348fcd4c3f552
@@ -231,7 +231,7 @@ class StorageFormatArgument(Argument): except KeyError: raise memory_module.OperandNotInMemory() - if self.storage_format == storage_format: + if self.storage_format <= storage_format: replacement = self.values[0] else: replacement = self.values[1]
linnea/kernels/utils/general.py
ReplaceText(target='<=' @(234,31)->(234,33))
class StorageFormatArgument(Argument): except KeyError: raise memory_module.OperandNotInMemory() if self.storage_format == storage_format: replacement = self.values[0] else: replacement = self.values[1]
class StorageFormatArgument(Argument): except KeyError: raise memory_module.OperandNotInMemory() if self.storage_format <= storage_format: replacement = self.values[0] else: replacement = self.values[1]
1,610
https://:@github.com/HPAC/linnea.git
1ec8de0939ac74ccf968c49d182478276392a1d9
@@ -237,7 +237,7 @@ def main(): linnea.config.set_verbosity(2) for strategy_str in strategy_strs: - dir = os.path.join(linnea.config.results_path, args.experiment, strategy_str, "intensity") + dir = os.path.join(linnea.config.results_path, args.experiment, "intensity", strategy_str) if not os.path.exists(dir): os.makedirs(dir)
experiments/experiments.py
ArgSwap(idxs=2<->3 @(240,18)->(240,30))
def main(): linnea.config.set_verbosity(2) for strategy_str in strategy_strs: dir = os.path.join(linnea.config.results_path, args.experiment, strategy_str, "intensity") if not os.path.exists(dir): os.makedirs(dir)
def main(): linnea.config.set_verbosity(2) for strategy_str in strategy_strs: dir = os.path.join(linnea.config.results_path, args.experiment, "intensity", strategy_str) if not os.path.exists(dir): os.makedirs(dir)
1,611
https://:@github.com/HPAC/linnea.git
55a7820be6ca6194fbdcf3a2f93db212c59d2958
@@ -49,7 +49,7 @@ def measure(experiment, example, name, merging): subdir_name="time_generation") t_end = time.perf_counter() - df_code_gen_time = pd.DataFrame([t_end-t_start], index=[example], columns=["time"]) + df_code_gen_time = pd.DataFrame([t_end-t_start], index=[name], columns=["time"]) if merging: subdir = "merging"
experiments/experiments.py
ReplaceText(target='name' @(52,60)->(52,67))
def measure(experiment, example, name, merging): subdir_name="time_generation") t_end = time.perf_counter() df_code_gen_time = pd.DataFrame([t_end-t_start], index=[example], columns=["time"]) if merging: subdir = "merging"
def measure(experiment, example, name, merging): subdir_name="time_generation") t_end = time.perf_counter() df_code_gen_time = pd.DataFrame([t_end-t_start], index=[name], columns=["time"]) if merging: subdir = "merging"
1,612
https://:@github.com/HPAC/linnea.git
995f46df7a908fb7ed28ff78c05ca8db30e8a220
@@ -306,7 +306,7 @@ class DerivationGraphBase(base.GraphBase): generate_experiment_code(output_name, self.input, algorithm_name, [1, 24], k_best, number_of_algorithms) - return number_of_algorithms + return algorithms def optimal_algorithm_to_str(self): matched_kernels, cost, final_equations = self.optimal_algorithm()
linnea/derivation/graph/base/derivation.py
ReplaceText(target='algorithms' @(309,15)->(309,35))
class DerivationGraphBase(base.GraphBase): generate_experiment_code(output_name, self.input, algorithm_name, [1, 24], k_best, number_of_algorithms) return number_of_algorithms def optimal_algorithm_to_str(self): matched_kernels, cost, final_equations = self.optimal_algorithm()
class DerivationGraphBase(base.GraphBase): generate_experiment_code(output_name, self.input, algorithm_name, [1, 24], k_best, number_of_algorithms) return algorithms def optimal_algorithm_to_str(self): matched_kernels, cost, final_equations = self.optimal_algorithm()
1,613
https://:@github.com/CCI-MOC/k2k-proxy.git
ffc701e40c06720548219eed3a88455b99ac30da
@@ -63,4 +63,4 @@ def get_sp_auth(service_provider, user_token, remote_project_id=None): project_domain_id=project_domain_id ) - return session.Session(auth=local_auth) + return session.Session(auth=remote_auth)
mixmatch/auth.py
ReplaceText(target='remote_auth' @(66,32)->(66,42))
def get_sp_auth(service_provider, user_token, remote_project_id=None): project_domain_id=project_domain_id ) return session.Session(auth=local_auth)
def get_sp_auth(service_provider, user_token, remote_project_id=None): project_domain_id=project_domain_id ) return session.Session(auth=remote_auth)
1,614
https://:@github.com/kraiz/nusbot.git
c4490897ca4610ce62c52d5e28c99197cff3a024
@@ -88,7 +88,7 @@ class _FileListHandler(object): def iter_changes_since(self, since): for change in self.news['changes']: - if change['time'] < since: + if change['time'] > since: yield change def is_filelist_update_needed(self, cid):
nusbot/filelist.py
ReplaceText(target='>' @(91,30)->(91,31))
class _FileListHandler(object): def iter_changes_since(self, since): for change in self.news['changes']: if change['time'] < since: yield change def is_filelist_update_needed(self, cid):
class _FileListHandler(object): def iter_changes_since(self, since): for change in self.news['changes']: if change['time'] > since: yield change def is_filelist_update_needed(self, cid):
1,615
https://:@github.com/andsor/pydevs.git
1ef835aee49f536a5a499db71927deac87f4152e
@@ -71,7 +71,7 @@ def versions_from_parentdir(parentdir_prefix, root, verbose=False): return None ret = dirname[len(parentdir_prefix):] if ret.find('-py') != -1: - ret = dirname[:ret.find('-py')] + ret = ret[:ret.find('-py')] return {"version": ret, "full": ""}
devs/_version.py
ReplaceText(target='ret' @(74,14)->(74,21))
def versions_from_parentdir(parentdir_prefix, root, verbose=False): return None ret = dirname[len(parentdir_prefix):] if ret.find('-py') != -1: ret = dirname[:ret.find('-py')] return {"version": ret, "full": ""}
def versions_from_parentdir(parentdir_prefix, root, verbose=False): return None ret = dirname[len(parentdir_prefix):] if ret.find('-py') != -1: ret = ret[:ret.find('-py')] return {"version": ret, "full": ""}
1,616
https://:@github.com/sayoun/wandex.git
b89ff8dbdcd4e9fc0b85d8af1eb66006618fc3a8
@@ -371,7 +371,7 @@ class Drawing(Resource): raise exc('x must be a natural number, not ' + repr(x)) elif not isinstance(y, numbers.Integral) or y < 0: exc = ValueError if y < 0 else TypeError - raise exc('y must be a natural number, not ' + repr(x)) + raise exc('y must be a natural number, not ' + repr(y)) elif not isinstance(body, basestring): raise TypeError('body must be a string, not ' + repr(body)) elif not body:
wand/drawing.py
ReplaceText(target='y' @(374,64)->(374,65))
class Drawing(Resource): raise exc('x must be a natural number, not ' + repr(x)) elif not isinstance(y, numbers.Integral) or y < 0: exc = ValueError if y < 0 else TypeError raise exc('y must be a natural number, not ' + repr(x)) elif not isinstance(body, basestring): raise TypeError('body must be a string, not ' + repr(body)) elif not body:
class Drawing(Resource): raise exc('x must be a natural number, not ' + repr(x)) elif not isinstance(y, numbers.Integral) or y < 0: exc = ValueError if y < 0 else TypeError raise exc('y must be a natural number, not ' + repr(y)) elif not isinstance(body, basestring): raise TypeError('body must be a string, not ' + repr(body)) elif not body:
1,617
https://:@github.com/Bob-Du/scrapy3.git
d87f979d2a16b3bb6d7ef0adf6439001914b0038
@@ -58,7 +58,7 @@ class MediaPipeline(object): wad = request.deferred or defer.Deferred() fp = request.fingerprint() - if fp not in info.downloaded: + if fp in info.downloaded: cached = info.downloaded[fp] defer_result(cached).chainDeferred(wad) else:
scrapy/trunk/scrapy/contrib/pipeline/media.py
ReplaceText(target=' in ' @(61,13)->(61,21))
class MediaPipeline(object): wad = request.deferred or defer.Deferred() fp = request.fingerprint() if fp not in info.downloaded: cached = info.downloaded[fp] defer_result(cached).chainDeferred(wad) else:
class MediaPipeline(object): wad = request.deferred or defer.Deferred() fp = request.fingerprint() if fp in info.downloaded: cached = info.downloaded[fp] defer_result(cached).chainDeferred(wad) else:
1,618
https://:@github.com/Bob-Du/scrapy3.git
1cc5cba69b3d8a5ac1fc26168e047a17604c55bc
@@ -208,7 +208,7 @@ class Scraper(object): else: log.err(output, 'Error processing %s' % item, spider=spider) else: - log.msg(log.formatter.passed(item, spider), log.INFO, spider=spider) + log.msg(log.formatter.passed(output, spider), log.INFO, spider=spider) return send_catch_log_deferred(signal=signals.item_passed, \ item=item, spider=spider, output=output)
scrapy/core/scraper.py
ReplaceText(target='output' @(211,41)->(211,45))
class Scraper(object): else: log.err(output, 'Error processing %s' % item, spider=spider) else: log.msg(log.formatter.passed(item, spider), log.INFO, spider=spider) return send_catch_log_deferred(signal=signals.item_passed, \ item=item, spider=spider, output=output)
class Scraper(object): else: log.err(output, 'Error processing %s' % item, spider=spider) else: log.msg(log.formatter.passed(output, spider), log.INFO, spider=spider) return send_catch_log_deferred(signal=signals.item_passed, \ item=item, spider=spider, output=output)
1,619
https://:@github.com/Bob-Du/scrapy3.git
d207c0afe4a82ac1b0299cc85a47914db6d409f5
@@ -177,7 +177,7 @@ class ExecutionEngine(object): return self.scheduler.enqueue_request(spider, request) def download(self, request, spider): - slot = self.slots[request] + slot = self.slots[spider] slot.add_request(request) if isinstance(request, Response): return request
scrapy/core/engine.py
ReplaceText(target='spider' @(180,26)->(180,33))
class ExecutionEngine(object): return self.scheduler.enqueue_request(spider, request) def download(self, request, spider): slot = self.slots[request] slot.add_request(request) if isinstance(request, Response): return request
class ExecutionEngine(object): return self.scheduler.enqueue_request(spider, request) def download(self, request, spider): slot = self.slots[spider] slot.add_request(request) if isinstance(request, Response): return request
1,620
https://:@github.com/Bob-Du/scrapy3.git
a583e4d531306b7628b42f8a32c7db892ad86cf1
@@ -328,7 +328,7 @@ class FilesystemCacheStorage(object): metapath = os.path.join(rpath, 'pickled_meta') if not os.path.exists(metapath): return # not found - mtime = os.stat(rpath).st_mtime + mtime = os.stat(metapath).st_mtime if 0 < self.expiration_secs < time() - mtime: return # expired with self._open(metapath, 'rb') as f:
scrapy/extensions/httpcache.py
ReplaceText(target='metapath' @(331,24)->(331,29))
class FilesystemCacheStorage(object): metapath = os.path.join(rpath, 'pickled_meta') if not os.path.exists(metapath): return # not found mtime = os.stat(rpath).st_mtime if 0 < self.expiration_secs < time() - mtime: return # expired with self._open(metapath, 'rb') as f:
class FilesystemCacheStorage(object): metapath = os.path.join(rpath, 'pickled_meta') if not os.path.exists(metapath): return # not found mtime = os.stat(metapath).st_mtime if 0 < self.expiration_secs < time() - mtime: return # expired with self._open(metapath, 'rb') as f:
1,621
https://:@github.com/ashat1701/rts-game.git
0c6b0a6b9ed044984d23a6003752cc4a0f7fd126
@@ -33,7 +33,7 @@ def test_damage_deal(): logic.damage_system.deal_damage(0, 2) enemy_start_health = world.get_health(2) player_damage = world.get_damage(0) - if player_damage > enemy_start_health: + if player_damage < enemy_start_health: assert len(world.dead_entities) == 1 else: assert world.get_health(2) == enemy_start_health - player_damage
tests/test_logic_unit_tests.py
ReplaceText(target='<' @(36,21)->(36,22))
def test_damage_deal(): logic.damage_system.deal_damage(0, 2) enemy_start_health = world.get_health(2) player_damage = world.get_damage(0) if player_damage > enemy_start_health: assert len(world.dead_entities) == 1 else: assert world.get_health(2) == enemy_start_health - player_damage
def test_damage_deal(): logic.damage_system.deal_damage(0, 2) enemy_start_health = world.get_health(2) player_damage = world.get_damage(0) if player_damage < enemy_start_health: assert len(world.dead_entities) == 1 else: assert world.get_health(2) == enemy_start_health - player_damage
1,622
https://:@github.com/qcha41/autolab.git
7be2d1a18b93ecef4ea9912dfecba3f9d0d8ce3e
@@ -77,7 +77,7 @@ class Driver_GPIB(Driver): def __init__(self,address=2,board_index=0,**kwargs): import Gpib - self.inst = Gpib.Gpib(int(address),int(board_index)) + self.inst = Gpib.Gpib(int(board_index),int(address)) Driver.__init__(self) def query(self,query):
autolab/drivers/More/Templates/OSA.py
ArgSwap(idxs=0<->1 @(80,20)->(80,29))
class Driver_GPIB(Driver): def __init__(self,address=2,board_index=0,**kwargs): import Gpib self.inst = Gpib.Gpib(int(address),int(board_index)) Driver.__init__(self) def query(self,query):
class Driver_GPIB(Driver): def __init__(self,address=2,board_index=0,**kwargs): import Gpib self.inst = Gpib.Gpib(int(board_index),int(address)) Driver.__init__(self) def query(self,query):
1,623
https://:@github.com/stenskjaer/lbp_print.git
859c8517e4d516b6d69142997d7f0f02f4d4452f
@@ -283,7 +283,7 @@ def clean_tex(tex_file): logging.warning("Could not delete temp file. Continuing...") logging.info('Whitespace removed.') - return fname + return fo def compile_tex(tex_file, output_dir=False):
lbp_print.py
ReplaceText(target='fo' @(286,11)->(286,16))
def clean_tex(tex_file): logging.warning("Could not delete temp file. Continuing...") logging.info('Whitespace removed.') return fname def compile_tex(tex_file, output_dir=False):
def clean_tex(tex_file): logging.warning("Could not delete temp file. Continuing...") logging.info('Whitespace removed.') return fo def compile_tex(tex_file, output_dir=False):
1,624
https://:@github.com/hammerlab/pepnet.git
285ab2bab7ff7b0503d64332071d908fa1c66971
@@ -22,6 +22,6 @@ def positive_only_mse(y_true, y_pred): of explicitly passing an output mask as an Input to a keras model. """ diff = y_pred - y_true - mask = y_pred < 0 + mask = y_pred >= 0 diff *= mask return K.mean(K.square(diff), axis=-1)
pepnet/losses.py
ReplaceText(target='>=' @(25,18)->(25,19))
def positive_only_mse(y_true, y_pred): of explicitly passing an output mask as an Input to a keras model. """ diff = y_pred - y_true mask = y_pred < 0 diff *= mask return K.mean(K.square(diff), axis=-1)
def positive_only_mse(y_true, y_pred): of explicitly passing an output mask as an Input to a keras model. """ diff = y_pred - y_true mask = y_pred >= 0 diff *= mask return K.mean(K.square(diff), axis=-1)
1,625
https://:@github.com/fergusfettes/lattice.git
42bc1e43e455fb41d42ee4171afea608828bcb92
@@ -44,7 +44,7 @@ def initVars(): 'NEWARR':1, 'STOCHASTIC':True } - return DEF + return TST #if __name__ == '__main__':
latticeEXECUTE.py
ReplaceText(target='TST' @(47,11)->(47,14))
def initVars(): 'NEWARR':1, 'STOCHASTIC':True } return DEF #if __name__ == '__main__':
def initVars(): 'NEWARR':1, 'STOCHASTIC':True } return TST #if __name__ == '__main__':
1,626
https://:@github.com/braingram/atlas_to_mesh.git
a1cd9960c1191eeccef56a60465f67730ab026fc
@@ -40,7 +40,7 @@ def get_points(areas, sections=None): pts[area] += [[p.x, p.y, s.get_ap()] for p \ in s.find_area(area, 'skull')] if len(areas) == 1: - return pts[area[0]] + return pts[areas[0]] return pts
atlas/construct.py
ReplaceText(target='areas' @(43,19)->(43,23))
def get_points(areas, sections=None): pts[area] += [[p.x, p.y, s.get_ap()] for p \ in s.find_area(area, 'skull')] if len(areas) == 1: return pts[area[0]] return pts
def get_points(areas, sections=None): pts[area] += [[p.x, p.y, s.get_ap()] for p \ in s.find_area(area, 'skull')] if len(areas) == 1: return pts[areas[0]] return pts
1,627
https://:@github.com/albanie/slurm_gpustat.git
8b8c35863c5c9f040edd6f81d79879791a498350
@@ -543,7 +543,7 @@ def all_info(color): active user. """ divider, slurm_str = "---------------------------------", "SLURM" - if not color: + if color: colors = sns.color_palette("hls", 8).as_hex() divider = colored.stylize(divider, colored.fg(colors[7])) slurm_str = colored.stylize(slurm_str, colored.fg(colors[0]))
slurm_gpustat/slurm_gpustat.py
ReplaceText(target='' @(546,7)->(546,11))
def all_info(color): active user. """ divider, slurm_str = "---------------------------------", "SLURM" if not color: colors = sns.color_palette("hls", 8).as_hex() divider = colored.stylize(divider, colored.fg(colors[7])) slurm_str = colored.stylize(slurm_str, colored.fg(colors[0]))
def all_info(color): active user. """ divider, slurm_str = "---------------------------------", "SLURM" if color: colors = sns.color_palette("hls", 8).as_hex() divider = colored.stylize(divider, colored.fg(colors[7])) slurm_str = colored.stylize(slurm_str, colored.fg(colors[0]))
1,628
https://:@github.com/deathbybandaid/Sopel-OSD.git
065146d94ac05bc8ef4db266926ea1290e541be6
@@ -62,7 +62,7 @@ def parse_event_005(bot, trigger): parameters = trigger.args[1:-1] for param in parameters: if '=' in param: - if not param.startswith("TARGMAX"): + if param.startswith("TARGMAX"): stderr(param) param = str(param).split('=')[1] settings = str(param).split(',')
sopel_modules/osd/__init__.py
ReplaceText(target='' @(65,15)->(65,19))
def parse_event_005(bot, trigger): parameters = trigger.args[1:-1] for param in parameters: if '=' in param: if not param.startswith("TARGMAX"): stderr(param) param = str(param).split('=')[1] settings = str(param).split(',')
def parse_event_005(bot, trigger): parameters = trigger.args[1:-1] for param in parameters: if '=' in param: if param.startswith("TARGMAX"): stderr(param) param = str(param).split('=')[1] settings = str(param).split(',')
1,629
https://:@github.com/Cjkkkk/Pyflow.git
4f887ab51a4d27112e9d9991aef61baed0898c98
@@ -150,7 +150,7 @@ class MaxPool2d(autograd.Function): for h in range(0, height - kernel_size[0] + 1, stride[0]): for w in range(0, width - kernel_size[1] + 1, stride[1]): mask = (data[i, j, h : h + kernel_size[0], w : w + kernel_size[1]] == np.max(data[i, j, h : h + kernel_size[0], w : w + kernel_size[1]])) - grad[i, j, h : h + kernel_size[0], w : w + kernel_size[1]] = mask * grad_output[i, j, h // stride[0], w // stride[1]] + grad[i, j, h : h + kernel_size[0], w : w + kernel_size[1]] += mask * grad_output[i, j, h // stride[0], w // stride[1]] return grad[:, :, padding[0]: height-padding[0], padding[1]: width-padding[1]], None, None, None
flow/function.py
ReplaceText(target='+=' @(153,83)->(153,84))
class MaxPool2d(autograd.Function): for h in range(0, height - kernel_size[0] + 1, stride[0]): for w in range(0, width - kernel_size[1] + 1, stride[1]): mask = (data[i, j, h : h + kernel_size[0], w : w + kernel_size[1]] == np.max(data[i, j, h : h + kernel_size[0], w : w + kernel_size[1]])) grad[i, j, h : h + kernel_size[0], w : w + kernel_size[1]] = mask * grad_output[i, j, h // stride[0], w // stride[1]] return grad[:, :, padding[0]: height-padding[0], padding[1]: width-padding[1]], None, None, None
class MaxPool2d(autograd.Function): for h in range(0, height - kernel_size[0] + 1, stride[0]): for w in range(0, width - kernel_size[1] + 1, stride[1]): mask = (data[i, j, h : h + kernel_size[0], w : w + kernel_size[1]] == np.max(data[i, j, h : h + kernel_size[0], w : w + kernel_size[1]])) grad[i, j, h : h + kernel_size[0], w : w + kernel_size[1]] += mask * grad_output[i, j, h // stride[0], w // stride[1]] return grad[:, :, padding[0]: height-padding[0], padding[1]: width-padding[1]], None, None, None
1,630
https://:@github.com/Cjkkkk/Pyflow.git
3ea0e017864bc88327be6752a258de6bafa464d1
@@ -237,7 +237,7 @@ class View(autograd.Function): @staticmethod def backward(ctx, grad_output): original_shape = ctx.saved_tensors()[0] - grad = grad_output.reshape(grad_output) + grad = grad_output.reshape(original_shape) return grad class LogSoftmax(autograd.Function):
flow/function.py
ReplaceText(target='original_shape' @(240,35)->(240,46))
class View(autograd.Function): @staticmethod def backward(ctx, grad_output): original_shape = ctx.saved_tensors()[0] grad = grad_output.reshape(grad_output) return grad class LogSoftmax(autograd.Function):
class View(autograd.Function): @staticmethod def backward(ctx, grad_output): original_shape = ctx.saved_tensors()[0] grad = grad_output.reshape(original_shape) return grad class LogSoftmax(autograd.Function):
1,631
https://:@github.com/trufont/defconQt.git
9ec6c3d4df1c6f708f1d18721774145ea09ff1d9
@@ -139,7 +139,7 @@ def drawTextAtPoint(painter, text, x, y, scale, xAlign="left", yAlign="bottom", lines = text.splitlines() lineSpacing = fM.lineSpacing() if xAlign != "left" or yAlign != "bottom": - width = scale * max(fM.width(line) for line in text) + width = scale * max(fM.width(line) for line in lines) height = scale * len(lines) * lineSpacing if xAlign == "center": x -= width / 2
Lib/defconQt/tools/drawing.py
ReplaceText(target='lines' @(142,55)->(142,59))
def drawTextAtPoint(painter, text, x, y, scale, xAlign="left", yAlign="bottom", lines = text.splitlines() lineSpacing = fM.lineSpacing() if xAlign != "left" or yAlign != "bottom": width = scale * max(fM.width(line) for line in text) height = scale * len(lines) * lineSpacing if xAlign == "center": x -= width / 2
def drawTextAtPoint(painter, text, x, y, scale, xAlign="left", yAlign="bottom", lines = text.splitlines() lineSpacing = fM.lineSpacing() if xAlign != "left" or yAlign != "bottom": width = scale * max(fM.width(line) for line in lines) height = scale * len(lines) * lineSpacing if xAlign == "center": x -= width / 2
1,632
https://:@github.com/ecks0/lura.git
5ad632ce26a1e4469d588e932507e9412ded5182
@@ -32,7 +32,7 @@ class Pickle(Format): 'Write dict ``data`` as pickle to file ``dst``.' with open(dst, mode='wb', encoding=encoding) as fd: - self.dumpfd(fd, data) + self.dumpfd(data, fd) def dumpfd(self, data, fd): 'Write dict ``data`` as pickle to file descriptor ``fd``.'
lura/formats/pickle.py
ArgSwap(idxs=0<->1 @(35,6)->(35,17))
class Pickle(Format): 'Write dict ``data`` as pickle to file ``dst``.' with open(dst, mode='wb', encoding=encoding) as fd: self.dumpfd(fd, data) def dumpfd(self, data, fd): 'Write dict ``data`` as pickle to file descriptor ``fd``.'
class Pickle(Format): 'Write dict ``data`` as pickle to file ``dst``.' with open(dst, mode='wb', encoding=encoding) as fd: self.dumpfd(data, fd) def dumpfd(self, data, fd): 'Write dict ``data`` as pickle to file descriptor ``fd``.'
1,633
https://:@github.com/ecks0/lura.git
e2892f4648ffbc71f815c2d1eef00d55a4d72009
@@ -51,7 +51,7 @@ class Format: return self.dumpf(patch, path, encoding=encoding) data = self.loadf(path) data_hash = hashs(self.dumps(data)) - merged = merge(data, patch) + merged = merge(patch, data) merged_str = self.dumps(merged) merged_hash = hashs(merged_str) if data_hash == merged_hash:
lura/formats/base.py
ArgSwap(idxs=0<->1 @(54,13)->(54,18))
class Format: return self.dumpf(patch, path, encoding=encoding) data = self.loadf(path) data_hash = hashs(self.dumps(data)) merged = merge(data, patch) merged_str = self.dumps(merged) merged_hash = hashs(merged_str) if data_hash == merged_hash:
class Format: return self.dumpf(patch, path, encoding=encoding) data = self.loadf(path) data_hash = hashs(self.dumps(data)) merged = merge(patch, data) merged_str = self.dumps(merged) merged_hash = hashs(merged_str) if data_hash == merged_hash:
1,634
https://:@github.com/a1fred/carnival.git
9abc77bc7908cedfd90d94074f40720e968252f2
@@ -32,7 +32,7 @@ def get_task_full_name(carnival_tasks_module: str, task_class: Type[Task]) -> st task_full_name = f"{task_mod}.{task_name}" - if task_mod.startswith(f"{carnival_tasks_module}"): + if task_full_name.startswith(f"{carnival_tasks_module}"): task_full_name = task_full_name[len(carnival_tasks_module) + 1:] return task_full_name
carnival/tasks_loader.py
ReplaceText(target='task_full_name' @(35,7)->(35,15))
def get_task_full_name(carnival_tasks_module: str, task_class: Type[Task]) -> st task_full_name = f"{task_mod}.{task_name}" if task_mod.startswith(f"{carnival_tasks_module}"): task_full_name = task_full_name[len(carnival_tasks_module) + 1:] return task_full_name
def get_task_full_name(carnival_tasks_module: str, task_class: Type[Task]) -> st task_full_name = f"{task_mod}.{task_name}" if task_full_name.startswith(f"{carnival_tasks_module}"): task_full_name = task_full_name[len(carnival_tasks_module) + 1:] return task_full_name
1,635
https://:@github.com/thimic/twicorder-search.git
9b1abe096a208e9056e52ecccff4ad315e3e7ce9
@@ -98,7 +98,7 @@ def backfill(path=None, db_name='slpng_giants', collection_name='tweets'): paths = glob.glob(os.path.join(save_dir, '**', '*.t*'), recursive=True) t0 = datetime.now() for idx, path in enumerate(paths): - if os.path.basename(os.path.dirname(path)) == 'stream': + if os.path.basename(os.path.dirname(path)) != 'stream': continue try: for lidx, line in enumerate(utils.readlines(path)):
python/twicorder/mongo.py
ReplaceText(target='!=' @(101,51)->(101,53))
def backfill(path=None, db_name='slpng_giants', collection_name='tweets'): paths = glob.glob(os.path.join(save_dir, '**', '*.t*'), recursive=True) t0 = datetime.now() for idx, path in enumerate(paths): if os.path.basename(os.path.dirname(path)) == 'stream': continue try: for lidx, line in enumerate(utils.readlines(path)):
def backfill(path=None, db_name='slpng_giants', collection_name='tweets'): paths = glob.glob(os.path.join(save_dir, '**', '*.t*'), recursive=True) t0 = datetime.now() for idx, path in enumerate(paths): if os.path.basename(os.path.dirname(path)) != 'stream': continue try: for lidx, line in enumerate(utils.readlines(path)):
1,636
https://:@bitbucket.org/Manfre/django-mssql.git
11eaef8b51110a9871846f979a0bce4cf0baad01
@@ -351,7 +351,7 @@ where """ cursor.execute(sql,[table_name]) for constraint, column in list(cursor.fetchall()): - if column not in constraint: + if column not in constraints: constraints[constraint] = { "columns": [], "primary_key": False,
sqlserver_ado/introspection.py
ReplaceText(target='constraints' @(354,29)->(354,39))
where """ cursor.execute(sql,[table_name]) for constraint, column in list(cursor.fetchall()): if column not in constraint: constraints[constraint] = { "columns": [], "primary_key": False,
where """ cursor.execute(sql,[table_name]) for constraint, column in list(cursor.fetchall()): if column not in constraints: constraints[constraint] = { "columns": [], "primary_key": False,
1,637
https://:@github.com/dictget/ecce-homo.git
ffc928d90cb7d938558df8fef15555ec5594ee6d
@@ -24,7 +24,7 @@ def get_image(filename, **kwargs): return send_from_directory(MEDIA_ROOT, resized_filename) if create_image(absolute_path, resized_absolute_path, **kwargs): - return send_from_directory(MEDIA_ROOT, resized_absolute_path) + return send_from_directory(MEDIA_ROOT, resized_filename) abort(500)
eccehomo/app.py
ReplaceText(target='resized_filename' @(27,47)->(27,68))
def get_image(filename, **kwargs): return send_from_directory(MEDIA_ROOT, resized_filename) if create_image(absolute_path, resized_absolute_path, **kwargs): return send_from_directory(MEDIA_ROOT, resized_absolute_path) abort(500)
def get_image(filename, **kwargs): return send_from_directory(MEDIA_ROOT, resized_filename) if create_image(absolute_path, resized_absolute_path, **kwargs): return send_from_directory(MEDIA_ROOT, resized_filename) abort(500)
1,638
https://:@github.com/GEMPACKsoftware/HARPY.git
2f3193f5f588515adffc480f635c4cc147a5bf39
@@ -198,6 +198,6 @@ class SL4(object): if nshk == nexo: varInd=j else: - varInd = shockList.array[j, 0] - 1 + varInd = shockList.array[shkInd, 0] - 1 flatData[varInd] = shockVal.array[shkInd, 0]
harpy/sl4.py
ReplaceText(target='shkInd' @(201,45)->(201,46))
class SL4(object): if nshk == nexo: varInd=j else: varInd = shockList.array[j, 0] - 1 flatData[varInd] = shockVal.array[shkInd, 0]
class SL4(object): if nshk == nexo: varInd=j else: varInd = shockList.array[shkInd, 0] - 1 flatData[varInd] = shockVal.array[shkInd, 0]
1,639
https://:@github.com/Dreem-Organization/benderopt.git
7e935344ab04365a98b65778c40c30ffa0a49074
@@ -4,7 +4,7 @@ import numpy as np def validate_categorical(value, values, **kwargs): test = True - if value not in value: + if value not in values: test = False return test
benderopt/validation/parameter_value.py
ReplaceText(target='values' @(7,20)->(7,25))
import numpy as np def validate_categorical(value, values, **kwargs): test = True if value not in value: test = False return test
import numpy as np def validate_categorical(value, values, **kwargs): test = True if value not in values: test = False return test
1,640
https://:@github.com/Dreem-Organization/benderopt.git
b8bf16fd862af629c28d654dcd6c05a21497aa79
@@ -34,7 +34,7 @@ def validate_lognormal(search_space): raise ValueError("High bound must be strictly positive") if "high" in search_space.keys() and "low" in search_space.keys(): - if search_space["high"] >= search_space["low"]: + if search_space["high"] <= search_space["low"]: raise ValueError("low <= high") if search_space.get("base") and type(search_space.get("base")) not in (float, int,):
benderopt/validation/lognormal.py
ReplaceText(target='<=' @(37,32)->(37,34))
def validate_lognormal(search_space): raise ValueError("High bound must be strictly positive") if "high" in search_space.keys() and "low" in search_space.keys(): if search_space["high"] >= search_space["low"]: raise ValueError("low <= high") if search_space.get("base") and type(search_space.get("base")) not in (float, int,):
def validate_lognormal(search_space): raise ValueError("High bound must be strictly positive") if "high" in search_space.keys() and "low" in search_space.keys(): if search_space["high"] <= search_space["low"]: raise ValueError("low <= high") if search_space.get("base") and type(search_space.get("base")) not in (float, int,):
1,641
https://:@github.com/umit-iace/tool-pywisp.git
ea8491fda2af3d354e137085365807aa04194128
@@ -1592,7 +1592,7 @@ class MainGui(QMainWindow): if wid.module == widget.module and wid.parameter == widget.parameter: wid.setValue(float(value)) wid.valueOn = value - wid.label.setText(wid.widgetName + ': ' + "{:.3f}".format(widget.value)) + wid.label.setText(wid.widgetName + ': ' + "{:.3f}".format(wid.value)) else: widget.valueOn = value widget.label.setText(widget.widgetName + ': ' + "{:.3f}".format(widget.value))
pywisp/gui.py
ReplaceText(target='wid' @(1595,82)->(1595,88))
class MainGui(QMainWindow): if wid.module == widget.module and wid.parameter == widget.parameter: wid.setValue(float(value)) wid.valueOn = value wid.label.setText(wid.widgetName + ': ' + "{:.3f}".format(widget.value)) else: widget.valueOn = value widget.label.setText(widget.widgetName + ': ' + "{:.3f}".format(widget.value))
class MainGui(QMainWindow): if wid.module == widget.module and wid.parameter == widget.parameter: wid.setValue(float(value)) wid.valueOn = value wid.label.setText(wid.widgetName + ': ' + "{:.3f}".format(wid.value)) else: widget.valueOn = value widget.label.setText(widget.widgetName + ': ' + "{:.3f}".format(widget.value))
1,642
https://:@github.com/silvacms/Products.SilvaMetadata.git
9ca8b85908725e4413333cc5b42796f1a97a9c7e
@@ -146,7 +146,7 @@ class ObjectMetadataExporter: if not check(k): continue - print >> out, ' <%s:%s>%s</%s:%s>'%(prefix, k, serialize(v), sid, k) + print >> out, ' <%s:%s>%s</%s:%s>'%(prefix, k, serialize(v), prefix, k) print >> out, '</metadata>'
Export.py
ReplaceText(target='prefix' @(149,82)->(149,85))
class ObjectMetadataExporter: if not check(k): continue print >> out, ' <%s:%s>%s</%s:%s>'%(prefix, k, serialize(v), sid, k) print >> out, '</metadata>'
class ObjectMetadataExporter: if not check(k): continue print >> out, ' <%s:%s>%s</%s:%s>'%(prefix, k, serialize(v), prefix, k) print >> out, '</metadata>'
1,643
https://:@github.com/softasap/ansible-container.git
44e87c64e477b54f2c9f923a1ad226d1801a8cb1
@@ -732,7 +732,7 @@ class Engine(BaseEngine): for filename in ['ansible.cfg', 'ansible-requirements.txt', 'requirements.yml']: file_path = os.path.join(source_dir, filename) - if os.path.exists(filename): + if os.path.exists(file_path): tarball.add(file_path, arcname=os.path.join('build-src', filename)) # Make an empty file just to make sure the build-src dir has something
container/docker/engine.py
ReplaceText(target='file_path' @(735,34)->(735,42))
class Engine(BaseEngine): for filename in ['ansible.cfg', 'ansible-requirements.txt', 'requirements.yml']: file_path = os.path.join(source_dir, filename) if os.path.exists(filename): tarball.add(file_path, arcname=os.path.join('build-src', filename)) # Make an empty file just to make sure the build-src dir has something
class Engine(BaseEngine): for filename in ['ansible.cfg', 'ansible-requirements.txt', 'requirements.yml']: file_path = os.path.join(source_dir, filename) if os.path.exists(file_path): tarball.add(file_path, arcname=os.path.join('build-src', filename)) # Make an empty file just to make sure the build-src dir has something
1,644
https://:@github.com/softasap/ansible-container.git
3f46ae33bc3a1d2d529b2a4b29e4bc144cbccd77
@@ -937,7 +937,7 @@ class Engine(BaseEngine, DockerSecretsMixin): container.__version__ ) if not self.get_image_id_by_tag(conductor_base): - conductor_base = 'ansible/%s' % base_image + conductor_base = 'ansible/%s' % conductor_base else: conductor_base = 'container-conductor-%s:%s' % ( base_image.replace(':', '-'),
container/docker/engine.py
ReplaceText(target='conductor_base' @(940,48)->(940,58))
class Engine(BaseEngine, DockerSecretsMixin): container.__version__ ) if not self.get_image_id_by_tag(conductor_base): conductor_base = 'ansible/%s' % base_image else: conductor_base = 'container-conductor-%s:%s' % ( base_image.replace(':', '-'),
class Engine(BaseEngine, DockerSecretsMixin): container.__version__ ) if not self.get_image_id_by_tag(conductor_base): conductor_base = 'ansible/%s' % conductor_base else: conductor_base = 'container-conductor-%s:%s' % ( base_image.replace(':', '-'),
1,645
https://:@github.com/Skydipper/Skydipper.git
abd7e5a3a0d4e6f5fdaf2798647adb88c490cd6b
@@ -557,5 +557,5 @@ class Layer: # confirm update # update other layer - target_layer.update(update_params=payload, token=token) + target_layer.update(update_params=filtered_payload, token=token)
LMIPy/layer.py
ReplaceText(target='filtered_payload' @(560,42)->(560,49))
class Layer: # confirm update # update other layer target_layer.update(update_params=payload, token=token)
class Layer: # confirm update # update other layer target_layer.update(update_params=filtered_payload, token=token)
1,646
https://:@github.com/artur-deluca/psopt.git
01d77851c4d96b219af9b1e1dee558128eb7ec69
@@ -107,7 +107,7 @@ class Optimizer: def _optimize(self): start = time.time() - if self._n_jobs == 1: + if self._n_jobs > 1: pool = multiprocess.Pool(self._n_jobs) else: pool = MockPool()
psopt/commons/optimizer.py
ReplaceText(target='>' @(110,24)->(110,26))
class Optimizer: def _optimize(self): start = time.time() if self._n_jobs == 1: pool = multiprocess.Pool(self._n_jobs) else: pool = MockPool()
class Optimizer: def _optimize(self): start = time.time() if self._n_jobs > 1: pool = multiprocess.Pool(self._n_jobs) else: pool = MockPool()
1,647
https://:@github.com/rainwoodman/kdcount.git
b02359b5419fe9e145c4d49e0238d488ac8e656a
@@ -101,7 +101,7 @@ def bootstrap(nside, rand, nbar, *data): r0 = numpy.concatenate((r0, r), axis=-1) else: heapq.heappush(heap, (a, j, r, d)) - heapq.heappush(heap, (a0, j, r0, d0)) + heapq.heappush(heap, (a0, j0, r0, d0)) for i in range(len(heap)): area, j, r, d = heapq.heappop(heap)
kdcount/sphere.py
ReplaceText(target='j0' @(104,38)->(104,39))
def bootstrap(nside, rand, nbar, *data): r0 = numpy.concatenate((r0, r), axis=-1) else: heapq.heappush(heap, (a, j, r, d)) heapq.heappush(heap, (a0, j, r0, d0)) for i in range(len(heap)): area, j, r, d = heapq.heappop(heap)
def bootstrap(nside, rand, nbar, *data): r0 = numpy.concatenate((r0, r), axis=-1) else: heapq.heappush(heap, (a, j, r, d)) heapq.heappush(heap, (a0, j0, r0, d0)) for i in range(len(heap)): area, j, r, d = heapq.heappop(heap)
1,648
https://:@github.com/federico123579/Trading212-API.git
1fa06ddf7fd1ed97607a2e2d4d701dfcdcd16490
@@ -96,7 +96,7 @@ class API(object): self.logger.debug("logged in") if mode == "demo" and self._elCss(path['alert-box']): self._css(path['alert-box']).click() - return 0 + return 1 except Exception: self.logger.critical("login failed") return 0
tradingAPI/api.py
ReplaceText(target='1' @(99,19)->(99,20))
class API(object): self.logger.debug("logged in") if mode == "demo" and self._elCss(path['alert-box']): self._css(path['alert-box']).click() return 0 except Exception: self.logger.critical("login failed") return 0
class API(object): self.logger.debug("logged in") if mode == "demo" and self._elCss(path['alert-box']): self._css(path['alert-box']).click() return 1 except Exception: self.logger.critical("login failed") return 0
1,649
https://:@github.com/zeburek/cattrs-3.8.git
416f032481f9eca1867a85a0efa989595d7e44bf
@@ -347,7 +347,7 @@ class Converter(object): # Check the union registry first. handler = self._union_registry.get(union) if handler is not None: - return handler(union, obj) + return handler(obj, union) # Unions with NoneType in them are basically optionals. union_params = union.__args__
cattr/converters.py
ArgSwap(idxs=0<->1 @(350,19)->(350,26))
class Converter(object): # Check the union registry first. handler = self._union_registry.get(union) if handler is not None: return handler(union, obj) # Unions with NoneType in them are basically optionals. union_params = union.__args__
class Converter(object): # Check the union registry first. handler = self._union_registry.get(union) if handler is not None: return handler(obj, union) # Unions with NoneType in them are basically optionals. union_params = union.__args__
1,650
https://:@github.com/yaojiach/red-panda.git
cc378fc1ff9ba3303b219e480d42f669db8d271c
@@ -245,7 +245,7 @@ class RedPanda: {null_option} ignoreheader {ignoreheader} dateformat '{dateformat}' - timeformat '{dateformat}' + timeformat '{timeformat}' access_key_id '{self.s3_config.get("aws_access_key_id")}' secret_access_key '{self.s3_config.get("aws_secret_access_key")}' {aws_token_option}
red_panda/red_panda.py
ReplaceText(target='timeformat' @(248,21)->(248,31))
class RedPanda: {null_option} ignoreheader {ignoreheader} dateformat '{dateformat}' timeformat '{dateformat}' access_key_id '{self.s3_config.get("aws_access_key_id")}' secret_access_key '{self.s3_config.get("aws_secret_access_key")}' {aws_token_option}
class RedPanda: {null_option} ignoreheader {ignoreheader} dateformat '{dateformat}' timeformat '{timeformat}' access_key_id '{self.s3_config.get("aws_access_key_id")}' secret_access_key '{self.s3_config.get("aws_secret_access_key")}' {aws_token_option}
1,651
https://:@github.com/anibali/pytorch-stacked-hourglass.git
dc9a7266ed6693f9a835ab411f85fa56e77065a8
@@ -57,7 +57,7 @@ def draw_gaussian(img, pt, sigma): # Check that any part of the gaussian is in-bounds ul = [int(pt[0] - 3 * sigma), int(pt[1] - 3 * sigma)] br = [int(pt[0] + 3 * sigma + 1), int(pt[1] + 3 * sigma + 1)] - if (ul[0] > img.shape[1] or ul[1] >= img.shape[0] or + if (ul[0] >= img.shape[1] or ul[1] >= img.shape[0] or br[0] < 0 or br[1] < 0): # If not, just return the image as is return to_torch(img)
pose/utils/imutils.py
ReplaceText(target='>=' @(60,14)->(60,15))
def draw_gaussian(img, pt, sigma): # Check that any part of the gaussian is in-bounds ul = [int(pt[0] - 3 * sigma), int(pt[1] - 3 * sigma)] br = [int(pt[0] + 3 * sigma + 1), int(pt[1] + 3 * sigma + 1)] if (ul[0] > img.shape[1] or ul[1] >= img.shape[0] or br[0] < 0 or br[1] < 0): # If not, just return the image as is return to_torch(img)
def draw_gaussian(img, pt, sigma): # Check that any part of the gaussian is in-bounds ul = [int(pt[0] - 3 * sigma), int(pt[1] - 3 * sigma)] br = [int(pt[0] + 3 * sigma + 1), int(pt[1] + 3 * sigma + 1)] if (ul[0] >= img.shape[1] or ul[1] >= img.shape[0] or br[0] < 0 or br[1] < 0): # If not, just return the image as is return to_torch(img)
1,652
https://:@github.com/mobiusklein/psims.git
50ffd519e75df03bc268f87d5654e3efd018e0ba
@@ -26,7 +26,7 @@ def pretty_xml(path, outpath=None, encoding=b'utf-8'): if hasattr(outpath, 'write'): outstream = outpath else: - opener = compression.get(outpath) + opener = compression.get(path) outstream = opener(outpath, 'wb') with outstream: outstream.write(b'<?xml version="1.0" encoding="' + encoding + b'"?>\n')
psims/utils.py
ReplaceText(target='path' @(29,33)->(29,40))
def pretty_xml(path, outpath=None, encoding=b'utf-8'): if hasattr(outpath, 'write'): outstream = outpath else: opener = compression.get(outpath) outstream = opener(outpath, 'wb') with outstream: outstream.write(b'<?xml version="1.0" encoding="' + encoding + b'"?>\n')
def pretty_xml(path, outpath=None, encoding=b'utf-8'): if hasattr(outpath, 'write'): outstream = outpath else: opener = compression.get(path) outstream = opener(outpath, 'wb') with outstream: outstream.write(b'<?xml version="1.0" encoding="' + encoding + b'"?>\n')
1,653
https://:@github.com/mobiusklein/psims.git
b93998c7e42ef5ef04c43bd2b0b59a31f01be3a6
@@ -35,7 +35,7 @@ log.enable() def differ(a, b): - if issubclass(type(a), type(b)): + if not issubclass(type(a), type(b)): return False if isinstance(a, dict): return dict_diff(a, b)
psims/transform/utils.py
ReplaceText(target='not ' @(38,7)->(38,7))
log.enable() def differ(a, b): if issubclass(type(a), type(b)): return False if isinstance(a, dict): return dict_diff(a, b)
log.enable() def differ(a, b): if not issubclass(type(a), type(b)): return False if isinstance(a, dict): return dict_diff(a, b)
1,654
https://:@github.com/patchboard/patchboard-py.git
0bd7da5b765f2b87bf92404b3c56c411790b3daa
@@ -52,7 +52,7 @@ class Action(object): raw = self.patchboard.session.request( self.method, url, - args + options ) response = Response(raw) if response.status != self.success_status:
patchboard/action.py
ReplaceText(target='options' @(55,12)->(55,16))
class Action(object): raw = self.patchboard.session.request( self.method, url, args ) response = Response(raw) if response.status != self.success_status:
class Action(object): raw = self.patchboard.session.request( self.method, url, options ) response = Response(raw) if response.status != self.success_status:
1,655
https://:@github.com/quantastica/qiskit-toaster.git
179f1e1ffea7ac084b6d94775ac71f326339894c
@@ -96,7 +96,7 @@ class ToasterHttpInterface: txt = response.read().decode("utf8") break - return res + return txt def _fetch_last_response(self, timeout, job_id): req = request.Request("%s/pollresult/%s" % (self.toaster_url, job_id))
quantastica/qiskit_toaster/ToasterHttpInterface.py
ReplaceText(target='txt' @(99,15)->(99,18))
class ToasterHttpInterface: txt = response.read().decode("utf8") break return res def _fetch_last_response(self, timeout, job_id): req = request.Request("%s/pollresult/%s" % (self.toaster_url, job_id))
class ToasterHttpInterface: txt = response.read().decode("utf8") break return txt def _fetch_last_response(self, timeout, job_id): req = request.Request("%s/pollresult/%s" % (self.toaster_url, job_id))
1,656
https://:@github.com/rcosnita/fantastico.git
0b94c55189d36b41866e822eecc605319f483594
@@ -43,7 +43,7 @@ class Router(object): if len(conf_loaders) == 0: raise FantasticoNoRoutesError("No loaders configured.") - if self._loader_lock is not None and len(self._loaders) == 0: + if self._loader_lock is None and len(self._loaders) == 0: self._loader_lock = threading.Lock() self._loaders = []
fantastico/routing_engine/router.py
ReplaceText(target=' is ' @(46,28)->(46,36))
class Router(object): if len(conf_loaders) == 0: raise FantasticoNoRoutesError("No loaders configured.") if self._loader_lock is not None and len(self._loaders) == 0: self._loader_lock = threading.Lock() self._loaders = []
class Router(object): if len(conf_loaders) == 0: raise FantasticoNoRoutesError("No loaders configured.") if self._loader_lock is None and len(self._loaders) == 0: self._loader_lock = threading.Lock() self._loaders = []
1,657
https://:@github.com/rcosnita/fantastico.git
b64cd9293ff05d184f1a3945b30a0821d8721ff0
@@ -71,7 +71,7 @@ class SdkCommandActivateExtension(SdkCommand): root_folder = instantiator.get_component_path_data(SettingsFacade().get_config().__class__)[1] comp_root_folder = contrib_path.replace(contrib_path, "%s%s/%s" % (root_folder, self._arguments.comp_root, comp_name)) - if os_lib.path.exists(comp_root_folder): + if not os_lib.path.exists(comp_root_folder): os_lib.mkdir(comp_root_folder) instantiator.scan_folder_by_criteria(
fantastico/sdk/commands/command_activate_extension.py
ReplaceText(target='not ' @(74,11)->(74,11))
class SdkCommandActivateExtension(SdkCommand): root_folder = instantiator.get_component_path_data(SettingsFacade().get_config().__class__)[1] comp_root_folder = contrib_path.replace(contrib_path, "%s%s/%s" % (root_folder, self._arguments.comp_root, comp_name)) if os_lib.path.exists(comp_root_folder): os_lib.mkdir(comp_root_folder) instantiator.scan_folder_by_criteria(
class SdkCommandActivateExtension(SdkCommand): root_folder = instantiator.get_component_path_data(SettingsFacade().get_config().__class__)[1] comp_root_folder = contrib_path.replace(contrib_path, "%s%s/%s" % (root_folder, self._arguments.comp_root, comp_name)) if not os_lib.path.exists(comp_root_folder): os_lib.mkdir(comp_root_folder) instantiator.scan_folder_by_criteria(
1,658
https://:@github.com/bjherger/auto_dl.git
76c7d4e84069ae0aeeb8a796db40c7c797f81437
@@ -58,7 +58,7 @@ class TestAutomater(unittest.TestCase): # A single numerical data = {'numerical_vars': ['n1']} input_mapper, output_mapper = Automater()._create_mappers(data) - self.assertEqual(1, len(output_mapper.features)) + self.assertEqual(1, len(input_mapper.features)) # Two numerical data = {'numerical_vars': ['n1', 'n2']}
tests/testautomater.py
ReplaceText(target='input_mapper' @(61,32)->(61,45))
class TestAutomater(unittest.TestCase): # A single numerical data = {'numerical_vars': ['n1']} input_mapper, output_mapper = Automater()._create_mappers(data) self.assertEqual(1, len(output_mapper.features)) # Two numerical data = {'numerical_vars': ['n1', 'n2']}
class TestAutomater(unittest.TestCase): # A single numerical data = {'numerical_vars': ['n1']} input_mapper, output_mapper = Automater()._create_mappers(data) self.assertEqual(1, len(input_mapper.features)) # Two numerical data = {'numerical_vars': ['n1', 'n2']}
1,659
https://:@github.com/NSLS-II/doct.git
c14ceb3c14d88e2a0f747b5f96ef56260e13832e
@@ -87,7 +87,7 @@ class Document(dict): try: return vstr(self) except ImportError: - return super(self, Document).__str__() + return super(Document, self).__str__() def to_name_dict_pair(self): """Convert to (name, dict) pair
doc.py
ArgSwap(idxs=0<->1 @(90,19)->(90,24))
class Document(dict): try: return vstr(self) except ImportError: return super(self, Document).__str__() def to_name_dict_pair(self): """Convert to (name, dict) pair
class Document(dict): try: return vstr(self) except ImportError: return super(Document, self).__str__() def to_name_dict_pair(self): """Convert to (name, dict) pair
1,660
https://:@github.com/pmrowla/pylivemaker.git
d62510b20bc650220570cbb619cfaf9efb685bd6
@@ -797,7 +797,7 @@ class LMArchive(object): if self.mode != 'w': raise ValueError('Cannot write to archive opened for reading.') if arcname is None: - arcpath = PureWindowsPath(filename) + arcpath = PureWindowsPath(packname) else: arcpath = PureWindowsPath(arcname) # strip drive and leading pathsep
livemaker/archive.py
ReplaceText(target='packname' @(800,38)->(800,46))
class LMArchive(object): if self.mode != 'w': raise ValueError('Cannot write to archive opened for reading.') if arcname is None: arcpath = PureWindowsPath(filename) else: arcpath = PureWindowsPath(arcname) # strip drive and leading pathsep
class LMArchive(object): if self.mode != 'w': raise ValueError('Cannot write to archive opened for reading.') if arcname is None: arcpath = PureWindowsPath(packname) else: arcpath = PureWindowsPath(arcname) # strip drive and leading pathsep
1,661
https://:@github.com/pmrowla/pylivemaker.git
6b562c3a400595dc1da0e467a4c3348365be1333
@@ -671,7 +671,7 @@ class LMScript(BaseSerializable): for line_no in replacement_choices: try: index, _ = self.get_command(line_no) - menu = make_menu(self, line_no) + menu = make_menu(self, index) except LiveMakerException: raise BadTextIdentifierError(f"invalid text block: LSB command '{line_no}' is not start of a menu")
livemaker/lsb/lmscript.py
ReplaceText(target='index' @(674,39)->(674,46))
class LMScript(BaseSerializable): for line_no in replacement_choices: try: index, _ = self.get_command(line_no) menu = make_menu(self, line_no) except LiveMakerException: raise BadTextIdentifierError(f"invalid text block: LSB command '{line_no}' is not start of a menu")
class LMScript(BaseSerializable): for line_no in replacement_choices: try: index, _ = self.get_command(line_no) menu = make_menu(self, index) except LiveMakerException: raise BadTextIdentifierError(f"invalid text block: LSB command '{line_no}' is not start of a menu")
1,662
https://:@github.com/costular/flask-restbolt.git
4dfe49f1de3dfd9598b4ae92b9e6b6644fa999f7
@@ -338,7 +338,7 @@ class APITestCase(unittest.TestCase): def record(sender, exception): recorded.append(exception) - got_request_exception.connect(record, api) + got_request_exception.connect(record, app) try: with app.test_request_context("/foo"): api.handle_error(exception)
tests/test_api.py
ReplaceText(target='app' @(341,46)->(341,49))
class APITestCase(unittest.TestCase): def record(sender, exception): recorded.append(exception) got_request_exception.connect(record, api) try: with app.test_request_context("/foo"): api.handle_error(exception)
class APITestCase(unittest.TestCase): def record(sender, exception): recorded.append(exception) got_request_exception.connect(record, app) try: with app.test_request_context("/foo"): api.handle_error(exception)
1,663
https://:@github.com/chrisrycx/DataBear.git
dc8bf94fea026fd5666be235bafa0cfc613c21fc
@@ -86,7 +86,7 @@ class dyaconTPH: savedata = [] data = self.data[name] for val in data: - if (val[0]<startdt) and (val[0]>=enddt): + if (val[0]<startdt) or (val[0]>=enddt): savedata.append(val) self.data[name] = savedata
databear/sensors/dyaconTPH1.py
ReplaceText(target='or' @(89,32)->(89,35))
class dyaconTPH: savedata = [] data = self.data[name] for val in data: if (val[0]<startdt) and (val[0]>=enddt): savedata.append(val) self.data[name] = savedata
class dyaconTPH: savedata = [] data = self.data[name] for val in data: if (val[0]<startdt) or (val[0]>=enddt): savedata.append(val) self.data[name] = savedata
1,664
https://:@gitlab.com/slumber/replication.git
efb33c3dc01fcd928c2251a42987fc1c69beae41
@@ -302,7 +302,7 @@ class Session(object): """ assert(uuid and new_owner) - if uuid in self._graph.keys() and self._graph[uuid].owner == self._id: + if uuid in self._graph.keys() and self._graph[uuid].owner != self._id: for node in self._node_deps(node=uuid): self.change_owner(uuid=node,new_owner=new_owner)
replication/interface.py
ReplaceText(target='!=' @(305,66)->(305,68))
class Session(object): """ assert(uuid and new_owner) if uuid in self._graph.keys() and self._graph[uuid].owner == self._id: for node in self._node_deps(node=uuid): self.change_owner(uuid=node,new_owner=new_owner)
class Session(object): """ assert(uuid and new_owner) if uuid in self._graph.keys() and self._graph[uuid].owner != self._id: for node in self._node_deps(node=uuid): self.change_owner(uuid=node,new_owner=new_owner)
1,665
https://:@github.com/akrog/ember-csi.git
4fc79e94918db66a40c319fa4497575bca633f4b
@@ -561,7 +561,7 @@ class NodeBase(IdentityBase): if persistence_config: cinderlib_extra_config = ember_config.copy() cinderlib_extra_config.pop('disabled') - ember_config['fail_on_missing_backend'] = False + cinderlib_extra_config['fail_on_missing_backend'] = False cinderlib.setup(persistence_config=persistence_config, **cinderlib_extra_config) IdentityBase.__init__(self, server, ember_config)
ember_csi/base.py
ReplaceText(target='cinderlib_extra_config' @(564,12)->(564,24))
class NodeBase(IdentityBase): if persistence_config: cinderlib_extra_config = ember_config.copy() cinderlib_extra_config.pop('disabled') ember_config['fail_on_missing_backend'] = False cinderlib.setup(persistence_config=persistence_config, **cinderlib_extra_config) IdentityBase.__init__(self, server, ember_config)
class NodeBase(IdentityBase): if persistence_config: cinderlib_extra_config = ember_config.copy() cinderlib_extra_config.pop('disabled') cinderlib_extra_config['fail_on_missing_backend'] = False cinderlib.setup(persistence_config=persistence_config, **cinderlib_extra_config) IdentityBase.__init__(self, server, ember_config)
1,666
https://:@github.com/akrog/ember-csi.git
52a690250873a10850e51ca9ee1a6fe90f6847f1
@@ -305,7 +305,7 @@ class ControllerBase(IdentityBase): cinderlib_extra_config = ember_config.copy() cinderlib_extra_config.pop('disabled') cinderlib.setup(persistence_config=persistence_config, - **ember_config) + **cinderlib_extra_config) self.backend = cinderlib.Backend(**backend_config) IdentityBase.__init__(self, server, ember_config) self.CSI.add_ControllerServicer_to_server(self, server)
ember_csi/base.py
ReplaceText(target='cinderlib_extra_config' @(308,26)->(308,38))
class ControllerBase(IdentityBase): cinderlib_extra_config = ember_config.copy() cinderlib_extra_config.pop('disabled') cinderlib.setup(persistence_config=persistence_config, **ember_config) self.backend = cinderlib.Backend(**backend_config) IdentityBase.__init__(self, server, ember_config) self.CSI.add_ControllerServicer_to_server(self, server)
class ControllerBase(IdentityBase): cinderlib_extra_config = ember_config.copy() cinderlib_extra_config.pop('disabled') cinderlib.setup(persistence_config=persistence_config, **cinderlib_extra_config) self.backend = cinderlib.Backend(**backend_config) IdentityBase.__init__(self, server, ember_config) self.CSI.add_ControllerServicer_to_server(self, server)
1,667
https://:@github.com/guysv/ilua.git
d433be2f47da572bef7ca39ce15a1e6b59aeecd2
@@ -110,7 +110,7 @@ class ILuaKernel(KernelBase): "payload": code}) if result["payload"]["success"]: - if result['payload']['returned'] == "" and not silent: + if result['payload']['returned'] != "" and not silent: self.send_update("execute_result", { 'execution_count': self.execution_count, 'data': {
ilua/kernel.py
ReplaceText(target='!=' @(113,45)->(113,47))
class ILuaKernel(KernelBase): "payload": code}) if result["payload"]["success"]: if result['payload']['returned'] == "" and not silent: self.send_update("execute_result", { 'execution_count': self.execution_count, 'data': {
class ILuaKernel(KernelBase): "payload": code}) if result["payload"]["success"]: if result['payload']['returned'] != "" and not silent: self.send_update("execute_result", { 'execution_count': self.execution_count, 'data': {
1,668
https://:@github.com/guysv/ilua.git
c7532fb945aa964e4eedff2ec0d5f90e96d7ca13
@@ -94,7 +94,7 @@ class Win32NamedPipe(abstract.FileDescriptor): def writeSequence(self, data): for chunk in data: - self.write(data) + self.write(chunk) def pipeWrite(self): try:
ilua/_win32namedpipe.py
ReplaceText(target='chunk' @(97,23)->(97,27))
class Win32NamedPipe(abstract.FileDescriptor): def writeSequence(self, data): for chunk in data: self.write(data) def pipeWrite(self): try:
class Win32NamedPipe(abstract.FileDescriptor): def writeSequence(self, data): for chunk in data: self.write(chunk) def pipeWrite(self): try:
1,669
https://:@bitbucket.org/jairhul/pyg4ometry.git
3627d9e0b48c213bddb00de3750b0f28c71eaa8b
@@ -60,7 +60,7 @@ class EllipticalCone(_SolidBase) : n = d else: n = _Vector(norm) - vertices.append(_Vertex(c.plus(d), d)) + vertices.append(_Vertex(c.plus(d), n)) for j0 in range(slices):
geant4/solid/EllipticalCone.py
ReplaceText(target='n' @(63,47)->(63,48))
class EllipticalCone(_SolidBase) : n = d else: n = _Vector(norm) vertices.append(_Vertex(c.plus(d), d)) for j0 in range(slices):
class EllipticalCone(_SolidBase) : n = d else: n = _Vector(norm) vertices.append(_Vertex(c.plus(d), n)) for j0 in range(slices):
1,670
https://:@bitbucket.org/jairhul/pyg4ometry.git
12f7b6ffabc83cc931529e55ae1adb33a8207696
@@ -32,7 +32,7 @@ class Scaled(_SolidBase): self.varNames = ["pX", "pY", "pZ"] self.dependents = [] - if registry: + if addRegistry: registry.addSolid(self) self.registry = registry
pyg4ometry/geant4/solid/Scaled.py
ReplaceText(target='addRegistry' @(35,11)->(35,19))
class Scaled(_SolidBase): self.varNames = ["pX", "pY", "pZ"] self.dependents = [] if registry: registry.addSolid(self) self.registry = registry
class Scaled(_SolidBase): self.varNames = ["pX", "pY", "pZ"] self.dependents = [] if addRegistry: registry.addSolid(self) self.registry = registry
1,671
https://:@bitbucket.org/jairhul/pyg4ometry.git
e6a4a4fd0df7b10f548a5553ba2bdf63e661c0f1
@@ -41,7 +41,7 @@ def Test(vis = False, interactive = False, type = normal) : # solids ws = _g4.solid.Box("ws",wx,wy,wz, reg, "mm") - ps = _g4.solid.GenericPolyhedra("ps",psphi,pdphi,pnsid,pz,pr,reg,"mm","rad") + ps = _g4.solid.GenericPolyhedra("ps",psphi,pdphi,pnsid,pr,pz,reg,"mm","rad") # structure wl = _g4.LogicalVolume(ws, wm, "wl", reg)
pyg4ometry/test/pythonGeant4/T014_GenericPolyhedra.py
ArgSwap(idxs=4<->5 @(44,9)->(44,35))
def Test(vis = False, interactive = False, type = normal) : # solids ws = _g4.solid.Box("ws",wx,wy,wz, reg, "mm") ps = _g4.solid.GenericPolyhedra("ps",psphi,pdphi,pnsid,pz,pr,reg,"mm","rad") # structure wl = _g4.LogicalVolume(ws, wm, "wl", reg)
def Test(vis = False, interactive = False, type = normal) : # solids ws = _g4.solid.Box("ws",wx,wy,wz, reg, "mm") ps = _g4.solid.GenericPolyhedra("ps",psphi,pdphi,pnsid,pr,pz,reg,"mm","rad") # structure wl = _g4.LogicalVolume(ws, wm, "wl", reg)
1,672
https://:@github.com/fineartdev/superset.git
299ad095760f1ed6d1f43549a4c979df508bd624
@@ -926,7 +926,7 @@ class Datasource(Model, AuditMixinNullable, Queryable): cols += ['timestamp'] cols += [col for col in groupby if col in df.columns] cols += [col for col in metrics if col in df.columns] - cols += [col for col in df.columns if col in cols] + cols += [col for col in df.columns if col not in cols] df = df[cols] return QueryResult( df=df,
panoramix/models.py
ReplaceText(target=' not in ' @(929,49)->(929,53))
class Datasource(Model, AuditMixinNullable, Queryable): cols += ['timestamp'] cols += [col for col in groupby if col in df.columns] cols += [col for col in metrics if col in df.columns] cols += [col for col in df.columns if col in cols] df = df[cols] return QueryResult( df=df,
class Datasource(Model, AuditMixinNullable, Queryable): cols += ['timestamp'] cols += [col for col in groupby if col in df.columns] cols += [col for col in metrics if col in df.columns] cols += [col for col in df.columns if col not in cols] df = df[cols] return QueryResult( df=df,
1,673
https://:@github.com/fineartdev/superset.git
efaef8fe0924ff39e77edbe8fe5e2ed337adccf3
@@ -628,7 +628,7 @@ class Database(Model, AuditMixinNullable): self, 'table', force=force) return tables_dict.get("", []) return sorted( - self.db_engine_spec.get_table_names(self.inspector, schema)) + self.db_engine_spec.get_table_names(schema, self.inspector)) def all_view_names(self, schema=None, force=False): if not schema:
superset/models/core.py
ArgSwap(idxs=0<->1 @(631,12)->(631,47))
class Database(Model, AuditMixinNullable): self, 'table', force=force) return tables_dict.get("", []) return sorted( self.db_engine_spec.get_table_names(self.inspector, schema)) def all_view_names(self, schema=None, force=False): if not schema:
class Database(Model, AuditMixinNullable): self, 'table', force=force) return tables_dict.get("", []) return sorted( self.db_engine_spec.get_table_names(schema, self.inspector)) def all_view_names(self, schema=None, force=False): if not schema:
1,674
https://:@github.com/lucas-flowers/snutree.git
9eb126d822088e241c8c42c58d792919f698c25b
@@ -209,7 +209,7 @@ def compile_pdf(source): ) except OSError as exception: msg = f'had a problem compiling to PDF:\n{exception}' - raise SnutreeError(exception) + raise SnutreeError(msg) return result.stdout
snutree/snutree.py
ReplaceText(target='msg' @(212,27)->(212,36))
def compile_pdf(source): ) except OSError as exception: msg = f'had a problem compiling to PDF:\n{exception}' raise SnutreeError(exception) return result.stdout
def compile_pdf(source): ) except OSError as exception: msg = f'had a problem compiling to PDF:\n{exception}' raise SnutreeError(msg) return result.stdout
1,675
https://:@github.com/Nanco-L/simple-nn.git
c5fb2c51f0304d630addad93be0c206be54ce93e
@@ -569,7 +569,7 @@ class Neural_network(object): test_save['DFT_F'].append(test_elem['F']) test_save['NN_F'].append(tmp_nnf) - test_tot_struc += num_batch_atom + test_tot_atom += num_batch_atom else: test_elem, tmp_nne, tmp_eloss = \ sess.run([self.next_elem, self.E, self.e_loss], feed_dict=test_fdict)
simple_nn/models/neural_network.py
ReplaceText(target='test_tot_atom' @(572,28)->(572,42))
class Neural_network(object): test_save['DFT_F'].append(test_elem['F']) test_save['NN_F'].append(tmp_nnf) test_tot_struc += num_batch_atom else: test_elem, tmp_nne, tmp_eloss = \ sess.run([self.next_elem, self.E, self.e_loss], feed_dict=test_fdict)
class Neural_network(object): test_save['DFT_F'].append(test_elem['F']) test_save['NN_F'].append(tmp_nnf) test_tot_atom += num_batch_atom else: test_elem, tmp_nne, tmp_eloss = \ sess.run([self.next_elem, self.E, self.e_loss], feed_dict=test_fdict)
1,676
https://:@github.com/Nanco-L/simple-nn.git
394b60e6ad7c24579dac407adbf0078b48cdcb89
@@ -390,7 +390,7 @@ class Symmetry_function(object): self._write_tfrecords(tmp_res, writer, use_force=use_force, atomic_weights=aw_tag) if not self.inputs['remain_pickle']: - os.remove(item) + os.remove(ptem) writer.close() self.parent.logfile.write('{} file saved in {}\n'.format((i%self.inputs['data_per_tfrecord'])+1, record_name))
simple_nn/features/symmetry_function/__init__.py
ReplaceText(target='ptem' @(393,30)->(393,34))
class Symmetry_function(object): self._write_tfrecords(tmp_res, writer, use_force=use_force, atomic_weights=aw_tag) if not self.inputs['remain_pickle']: os.remove(item) writer.close() self.parent.logfile.write('{} file saved in {}\n'.format((i%self.inputs['data_per_tfrecord'])+1, record_name))
class Symmetry_function(object): self._write_tfrecords(tmp_res, writer, use_force=use_force, atomic_weights=aw_tag) if not self.inputs['remain_pickle']: os.remove(ptem) writer.close() self.parent.logfile.write('{} file saved in {}\n'.format((i%self.inputs['data_per_tfrecord'])+1, record_name))
1,677
https://:@gitlab.com/dhke/py-exim-utils.git
707d1de5e000094a0f277960fb35190ad3d65ddf
@@ -324,7 +324,7 @@ class LFileParser(object): source_name = source_name or s intermediate_encoding = intermediate_encoding or 'utf-8' source = s.encode(intermediate_encoding) - return self.parse_bytes(source, source_name=s) + return self.parse_bytes(source, source_name=source_name) def parse_comment(self, context): token = LFileParserToken('comment', None, context.lineno)
src/exim/db/lsearch.py
ReplaceText(target='source_name' @(327,52)->(327,53))
class LFileParser(object): source_name = source_name or s intermediate_encoding = intermediate_encoding or 'utf-8' source = s.encode(intermediate_encoding) return self.parse_bytes(source, source_name=s) def parse_comment(self, context): token = LFileParserToken('comment', None, context.lineno)
class LFileParser(object): source_name = source_name or s intermediate_encoding = intermediate_encoding or 'utf-8' source = s.encode(intermediate_encoding) return self.parse_bytes(source, source_name=source_name) def parse_comment(self, context): token = LFileParserToken('comment', None, context.lineno)
1,678
https://:@gitlab.com/abompard/rhizom.git
18cb3b4727aa3731289879c0187be8ac3f77c212
@@ -37,7 +37,7 @@ def upgrade(): creation=datetime.utcnow(), last_access=datetime.utcnow())) conn.execute(users_table.update().values( creation=datetime.utcnow(), last_connection=datetime.utcnow())) - if is_sqlite(conn): + if not is_sqlite(conn): op.alter_column('graphs', 'creation', nullable=False) op.alter_column('graphs', 'last_access', nullable=False) op.alter_column('users', 'creation', nullable=False)
rhizom/migrations/versions/b331d042fca_creation_and_access_times.py
ReplaceText(target='not ' @(40,7)->(40,7))
def upgrade(): creation=datetime.utcnow(), last_access=datetime.utcnow())) conn.execute(users_table.update().values( creation=datetime.utcnow(), last_connection=datetime.utcnow())) if is_sqlite(conn): op.alter_column('graphs', 'creation', nullable=False) op.alter_column('graphs', 'last_access', nullable=False) op.alter_column('users', 'creation', nullable=False)
def upgrade(): creation=datetime.utcnow(), last_access=datetime.utcnow())) conn.execute(users_table.update().values( creation=datetime.utcnow(), last_connection=datetime.utcnow())) if not is_sqlite(conn): op.alter_column('graphs', 'creation', nullable=False) op.alter_column('graphs', 'last_access', nullable=False) op.alter_column('users', 'creation', nullable=False)
1,679
https://:@github.com/frenzymadness/compileall2.git
59df6aeae3eb4a67c3fa783c403cea81def8a557
@@ -104,8 +104,8 @@ class CompileallTestsBase: self.source_path3 = os.path.join(self.subdirectory, '_test3.py') shutil.copyfile(self.source_path, self.source_path3) many_directories = [str(number) for number in range(1, 100)] - self.long_path = os.path.join("long", - self.directory, + self.long_path = os.path.join(self.directory, + "long", *many_directories) os.makedirs(self.long_path) self.source_path_long = os.path.join(self.long_path, '_test4.py')
test_compileall_original.py
ArgSwap(idxs=0<->1 @(107,25)->(107,37))
class CompileallTestsBase: self.source_path3 = os.path.join(self.subdirectory, '_test3.py') shutil.copyfile(self.source_path, self.source_path3) many_directories = [str(number) for number in range(1, 100)] self.long_path = os.path.join("long", self.directory, *many_directories) os.makedirs(self.long_path) self.source_path_long = os.path.join(self.long_path, '_test4.py')
class CompileallTestsBase: self.source_path3 = os.path.join(self.subdirectory, '_test3.py') shutil.copyfile(self.source_path, self.source_path3) many_directories = [str(number) for number in range(1, 100)] self.long_path = os.path.join(self.directory, "long", *many_directories) os.makedirs(self.long_path) self.source_path_long = os.path.join(self.long_path, '_test4.py')
1,680
https://:@github.com/nandoflorestan/keepluggable.git
576d342dc8a5f8d4c20d780766b556ca6c91935e
@@ -274,6 +274,6 @@ class ImageAction(BaseFilesAction): """Omit the main *href* if we are not storing original images.""" metadata = super()._complement(metadata) # Add main *href* if we are storing original images or if not image - if metadata.get('image_width') or not self.config.store_original: + if not metadata.get('image_width') or not self.config.store_original: del metadata['href'] return metadata
keepluggable/image_actions.py
ReplaceText(target='not ' @(277,11)->(277,11))
class ImageAction(BaseFilesAction): """Omit the main *href* if we are not storing original images.""" metadata = super()._complement(metadata) # Add main *href* if we are storing original images or if not image if metadata.get('image_width') or not self.config.store_original: del metadata['href'] return metadata
class ImageAction(BaseFilesAction): """Omit the main *href* if we are not storing original images.""" metadata = super()._complement(metadata) # Add main *href* if we are storing original images or if not image if not metadata.get('image_width') or not self.config.store_original: del metadata['href'] return metadata
1,681
https://:@github.com/rocksclusters/FingerPrint.git
ab31be4ea3ac33422656d36d635e30c0e9235757
@@ -44,7 +44,7 @@ class Swirl(object): p = os.readlink(fileName) if not os.path.isabs(p): p = os.path.join( os.path.dirname(fileName), p) - links.append(p) + links.append(fileName) fileName = p for swirlFile in self.swirlFiles: if swirlFile.path == fileName:
FingerPrint/swirl.py
ReplaceText(target='fileName' @(47,25)->(47,26))
class Swirl(object): p = os.readlink(fileName) if not os.path.isabs(p): p = os.path.join( os.path.dirname(fileName), p) links.append(p) fileName = p for swirlFile in self.swirlFiles: if swirlFile.path == fileName:
class Swirl(object): p = os.readlink(fileName) if not os.path.isabs(p): p = os.path.join( os.path.dirname(fileName), p) links.append(fileName) fileName = p for swirlFile in self.swirlFiles: if swirlFile.path == fileName:
1,682
https://:@github.com/all-umass/superman.git
2431684dc60312c6bba81f940511c5f608b696a3
@@ -36,7 +36,7 @@ def crop_resample(bands, intensities, crops): # check that each chunk is valid and doesn't overlap with any other prev_ub = float('-inf') for lb, ub, step in crops: - if ub >= lb: + if ub <= lb: raise ValueError('Invalid crop region') if lb < prev_ub: raise ValueError('Overlapping crop regions')
superman/preprocess.py
ReplaceText(target='<=' @(39,10)->(39,12))
def crop_resample(bands, intensities, crops): # check that each chunk is valid and doesn't overlap with any other prev_ub = float('-inf') for lb, ub, step in crops: if ub >= lb: raise ValueError('Invalid crop region') if lb < prev_ub: raise ValueError('Overlapping crop regions')
def crop_resample(bands, intensities, crops): # check that each chunk is valid and doesn't overlap with any other prev_ub = float('-inf') for lb, ub, step in crops: if ub <= lb: raise ValueError('Invalid crop region') if lb < prev_ub: raise ValueError('Overlapping crop regions')
1,683
https://:@github.com/jvamvas/rhymediscovery.git
74b6c37b1a8ddae99edbf14a6db7307d00437734
@@ -127,7 +127,7 @@ def post_prob_scheme(t_table, words, stanza, scheme): for i, w in enumerate(rhymelist): r = words.index(w) if i == 0: # first word, use P(w|x) - myprob = t_table[r, n] + myprob *= t_table[r, n] else: for v in rhymelist[:i]: # history c = words.index(v)
findschemes.py
ReplaceText(target='*=' @(130,23)->(130,24))
def post_prob_scheme(t_table, words, stanza, scheme): for i, w in enumerate(rhymelist): r = words.index(w) if i == 0: # first word, use P(w|x) myprob = t_table[r, n] else: for v in rhymelist[:i]: # history c = words.index(v)
def post_prob_scheme(t_table, words, stanza, scheme): for i, w in enumerate(rhymelist): r = words.index(w) if i == 0: # first word, use P(w|x) myprob *= t_table[r, n] else: for v in rhymelist[:i]: # history c = words.index(v)
1,684
https://:@github.com/bensondaled/pyfluo.git
a9e2640fe3e0316dba2917dfbf9bd01d43afd1ce
@@ -175,7 +175,7 @@ class Movie(TSBase): roi_flat = roi3.reshape((len(roi3),-1)) self_flat = self.reshape((len(self),-1)).T dp = (roi_flat.dot(self_flat)).T - return Trace(dp/len(self_flat), time=self.time, Ts=self.Ts) + return Trace(dp/len(roi_flat), time=self.time, Ts=self.Ts) def motion_correct(self, *params, **kwargs): """A convenience method for pyfluo.motion.motion_correct
pyfluo/movies.py
ReplaceText(target='roi_flat' @(178,28)->(178,37))
class Movie(TSBase): roi_flat = roi3.reshape((len(roi3),-1)) self_flat = self.reshape((len(self),-1)).T dp = (roi_flat.dot(self_flat)).T return Trace(dp/len(self_flat), time=self.time, Ts=self.Ts) def motion_correct(self, *params, **kwargs): """A convenience method for pyfluo.motion.motion_correct
class Movie(TSBase): roi_flat = roi3.reshape((len(roi3),-1)) self_flat = self.reshape((len(self),-1)).T dp = (roi_flat.dot(self_flat)).T return Trace(dp/len(roi_flat), time=self.time, Ts=self.Ts) def motion_correct(self, *params, **kwargs): """A convenience method for pyfluo.motion.motion_correct
1,685
https://:@github.com/wkschwartz/wrapitup.git
6d13bf58cc29d07edcf5e86221cd676a81a04776
@@ -180,7 +180,7 @@ class catch_signals: 'callback is not a callable with two positional arguments: %r' % (callback,)) if os.name == 'nt': - if not (set(signals) <= set(self._DEFAULT_SIGS)): + if not (set(signals_tmp) <= set(self._DEFAULT_SIGS)): raise ValueError( "Windows does not support one of the signals: %r" % (signals,)) self._signals = tuple(signals_tmp) # type: typing.Tuple[signal.Signals, ...]
wrapitup/_catch_signals.py
ReplaceText(target='signals_tmp' @(183,15)->(183,22))
class catch_signals: 'callback is not a callable with two positional arguments: %r' % (callback,)) if os.name == 'nt': if not (set(signals) <= set(self._DEFAULT_SIGS)): raise ValueError( "Windows does not support one of the signals: %r" % (signals,)) self._signals = tuple(signals_tmp) # type: typing.Tuple[signal.Signals, ...]
class catch_signals: 'callback is not a callable with two positional arguments: %r' % (callback,)) if os.name == 'nt': if not (set(signals_tmp) <= set(self._DEFAULT_SIGS)): raise ValueError( "Windows does not support one of the signals: %r" % (signals,)) self._signals = tuple(signals_tmp) # type: typing.Tuple[signal.Signals, ...]
1,686
https://:@github.com/hugobessa/django-shared-schema-tenants.git
0438cf26353f4b6955f9c7e62e2a37e71b05f019
@@ -2,7 +2,7 @@ from django.contrib.sites.models import Site from shared_schema_tenants.settings import DEFAULT_SITE_DOMAIN def creates_default_site(sender, instance, created, *args, **kwargs): - if created: + if not created: try: site = Site.objects.get(domain__icontains=DEFAULT_SITE_DOMAIN, tenant_site__tenant=instance)
shared_schema_tenants/signals.py
ReplaceText(target='not ' @(5,7)->(5,7))
from django.contrib.sites.models import Site from shared_schema_tenants.settings import DEFAULT_SITE_DOMAIN def creates_default_site(sender, instance, created, *args, **kwargs): if created: try: site = Site.objects.get(domain__icontains=DEFAULT_SITE_DOMAIN, tenant_site__tenant=instance)
from django.contrib.sites.models import Site from shared_schema_tenants.settings import DEFAULT_SITE_DOMAIN def creates_default_site(sender, instance, created, *args, **kwargs): if not created: try: site = Site.objects.get(domain__icontains=DEFAULT_SITE_DOMAIN, tenant_site__tenant=instance)
1,687
https://:@github.com/pmichel31415/dynn.git
d17306ada100763a7b72fe7bc5bd6bc3bbb5ae13
@@ -121,5 +121,5 @@ class CompactLSTM(layers.Layer): else: gates = dy.vanilla_lstm_gates(x,h,self.Whx, self.Whh,self.bh) new_c = dy.vanilla_lstm_c(c, gates) - new_h = dy.vanilla_lstm_h(c, gates) + new_h = dy.vanilla_lstm_h(new_c, gates) return new_h, new_c \ No newline at end of file
lstm.py
ReplaceText(target='new_c' @(124,34)->(124,35))
class CompactLSTM(layers.Layer): else: gates = dy.vanilla_lstm_gates(x,h,self.Whx, self.Whh,self.bh) new_c = dy.vanilla_lstm_c(c, gates) new_h = dy.vanilla_lstm_h(c, gates) return new_h, new_c \ No newline at end of file
class CompactLSTM(layers.Layer): else: gates = dy.vanilla_lstm_gates(x,h,self.Whx, self.Whh,self.bh) new_c = dy.vanilla_lstm_c(c, gates) new_h = dy.vanilla_lstm_h(new_c, gates) return new_h, new_c \ No newline at end of file
1,688
https://:@github.com/pmichel31415/dynn.git
644f1b8a3e59e8855ac04417290c2172c2b5fa88
@@ -146,7 +146,7 @@ def _test_recurrent_layer_bidirectional_transduction( dy.esum([dy.sum_elems(state[0]) for state in fwd_states]) ) bwd_z = dy.mean_batches( - dy.esum([dy.sum_elems(state[0]) for state in fwd_states]) + dy.esum([dy.sum_elems(state[0]) for state in bwd_states]) ) z = fwd_z + bwd_z z.forward()
tests/layers/test_transduction_layers.py
ReplaceText(target='bwd_states' @(149,53)->(149,63))
def _test_recurrent_layer_bidirectional_transduction( dy.esum([dy.sum_elems(state[0]) for state in fwd_states]) ) bwd_z = dy.mean_batches( dy.esum([dy.sum_elems(state[0]) for state in fwd_states]) ) z = fwd_z + bwd_z z.forward()
def _test_recurrent_layer_bidirectional_transduction( dy.esum([dy.sum_elems(state[0]) for state in fwd_states]) ) bwd_z = dy.mean_batches( dy.esum([dy.sum_elems(state[0]) for state in bwd_states]) ) z = fwd_z + bwd_z z.forward()
1,689
https://:@github.com/drachlyznardh/githistorian.git
f1a798d26572977769f2d02ece24cf0ed35170b1
@@ -44,6 +44,6 @@ class NodeDB: result = [] for name in names: target = self.store[name] - if target.has_column() and target.column <= column: continue + if target.has_column() and target.column < column: continue result.append(target.row) return result
db.py
ReplaceText(target='<' @(47,44)->(47,46))
class NodeDB: result = [] for name in names: target = self.store[name] if target.has_column() and target.column <= column: continue result.append(target.row) return result
class NodeDB: result = [] for name in names: target = self.store[name] if target.has_column() and target.column < column: continue result.append(target.row) return result
1,690
https://:@github.com/benselme/babel.git
b9efb7e3624af2bb64b663d6c9908c597cf09a23
@@ -99,7 +99,7 @@ def _validate_format(format, alternative): result = [] for match in PYTHON_FORMAT.finditer(string): name, format, typechar = match.groups() - if typechar == '%' and name is not None: + if typechar == '%' and name is None: continue result.append((name, str(typechar))) return result
babel/messages/checkers.py
ReplaceText(target=' is ' @(102,39)->(102,47))
def _validate_format(format, alternative): result = [] for match in PYTHON_FORMAT.finditer(string): name, format, typechar = match.groups() if typechar == '%' and name is not None: continue result.append((name, str(typechar))) return result
def _validate_format(format, alternative): result = [] for match in PYTHON_FORMAT.finditer(string): name, format, typechar = match.groups() if typechar == '%' and name is None: continue result.append((name, str(typechar))) return result
1,691
https://:@github.com/martinchristen/pyRT.git
8d97666dc6103f6b86c6698ce3f6c7064983a443
@@ -104,7 +104,7 @@ class BBox(Shape): tmax = min(min(tmax, tymax), tzmax) tmin = (self[ray.sign[0]].x - ray.start.x) * ray.invdir.x - return tmin > tmax + return tmin < tmax def surfaceArea(self) -> float:
pyrt/geometry/bbox.py
ReplaceText(target='<' @(107,20)->(107,21))
class BBox(Shape): tmax = min(min(tmax, tymax), tzmax) tmin = (self[ray.sign[0]].x - ray.start.x) * ray.invdir.x return tmin > tmax def surfaceArea(self) -> float:
class BBox(Shape): tmax = min(min(tmax, tymax), tzmax) tmin = (self[ray.sign[0]].x - ray.start.x) * ray.invdir.x return tmin < tmax def surfaceArea(self) -> float:
1,692
https://:@github.com/zxdavb/intouch-client.git
72bb566cb7c42dbd995e3e4f5151e6a59736fe5b
@@ -204,7 +204,7 @@ class InTouchHeater(InTouchObject): @property def rooms(self) -> list: return [InTouchRoom(r, self) for r in ['1', '2'] - if True and _convert( + if True or _convert( self._data['room_temp_{}_msb'.format(r)], self._data['room_temp_{}_lsb'.format(r)]) is not None]
intouchclient/__init__.py
ReplaceText(target='or' @(207,24)->(207,27))
class InTouchHeater(InTouchObject): @property def rooms(self) -> list: return [InTouchRoom(r, self) for r in ['1', '2'] if True and _convert( self._data['room_temp_{}_msb'.format(r)], self._data['room_temp_{}_lsb'.format(r)]) is not None]
class InTouchHeater(InTouchObject): @property def rooms(self) -> list: return [InTouchRoom(r, self) for r in ['1', '2'] if True or _convert( self._data['room_temp_{}_msb'.format(r)], self._data['room_temp_{}_lsb'.format(r)]) is not None]
1,693
https://:@github.com/ralphbean/gnome-shell-search-github-repositories.git
582174cccd6ee618d89c25d9d22350fb6797489d
@@ -73,7 +73,7 @@ class FedmsgNotifyService(dbus.service.Object, fedmsg.consumers.FedmsgConsumer): icon_file)) self._icon_cache[icon] = icon_file icon = icon_file - note = Notify.Notification.new("fedmsg", pretty_text, icon_file) + note = Notify.Notification.new("fedmsg", pretty_text, icon) note.show() @dbus.service.method(bus_name)
fedmsg_notify/daemon.py
ReplaceText(target='icon' @(76,62)->(76,71))
class FedmsgNotifyService(dbus.service.Object, fedmsg.consumers.FedmsgConsumer): icon_file)) self._icon_cache[icon] = icon_file icon = icon_file note = Notify.Notification.new("fedmsg", pretty_text, icon_file) note.show() @dbus.service.method(bus_name)
class FedmsgNotifyService(dbus.service.Object, fedmsg.consumers.FedmsgConsumer): icon_file)) self._icon_cache[icon] = icon_file icon = icon_file note = Notify.Notification.new("fedmsg", pretty_text, icon) note.show() @dbus.service.method(bus_name)
1,694
https://:@github.com/strongles/ervin.git
56b38758e5b38eee76dd4af6682f797f9b83c428
@@ -96,7 +96,7 @@ def find_probes_recursively(file_list, tail=None): if len(file_list) == 2: return find_probes(first_probe_data, second_probe_data) - elif len(file_list) < 2: + elif len(file_list) > 2: return find_probes_recursively(file_list[2:], tail=find_probes(first_probe_data, second_probe_data)) else: probe_data = read_probe_records_from_file(file_list[0])
src/probe_finder.py
ReplaceText(target='>' @(99,28)->(99,29))
def find_probes_recursively(file_list, tail=None): if len(file_list) == 2: return find_probes(first_probe_data, second_probe_data) elif len(file_list) < 2: return find_probes_recursively(file_list[2:], tail=find_probes(first_probe_data, second_probe_data)) else: probe_data = read_probe_records_from_file(file_list[0])
def find_probes_recursively(file_list, tail=None): if len(file_list) == 2: return find_probes(first_probe_data, second_probe_data) elif len(file_list) > 2: return find_probes_recursively(file_list[2:], tail=find_probes(first_probe_data, second_probe_data)) else: probe_data = read_probe_records_from_file(file_list[0])
1,695
https://:@github.com/keybase/saltpack-python.git
3a68d9c1fe736602a71ce17671595c1bb5720ce1
@@ -276,7 +276,7 @@ def get_recipients(args): recipients = [] for recipient in args['<recipients>']: key = binascii.unhexlify(recipient) - assert len(recipient) == 32 + assert len(key) == 32 recipients.append(key) return recipients else:
encrypt.py
ReplaceText(target='key' @(279,23)->(279,32))
def get_recipients(args): recipients = [] for recipient in args['<recipients>']: key = binascii.unhexlify(recipient) assert len(recipient) == 32 recipients.append(key) return recipients else:
def get_recipients(args): recipients = [] for recipient in args['<recipients>']: key = binascii.unhexlify(recipient) assert len(key) == 32 recipients.append(key) return recipients else:
1,696
https://:@github.com/mike-perdide/gitbuster.git
8ad19a783bfe71c7b3ac9edf60c8c9bb067c23c6
@@ -226,7 +226,7 @@ class MainWindow(QMainWindow): date_edit_widgets = (self._ui.afterDateFilterDateEdit, self._ui.beforeDateFilterDateEdit) - for widget in time_edit_widgets: + for widget in date_edit_widgets: self.connect(widget, SIGNAL("dateChanged (const QDate&)"), self.apply_filters)
qGitFilterBranch/main_window.py
ReplaceText(target='date_edit_widgets' @(229,22)->(229,39))
class MainWindow(QMainWindow): date_edit_widgets = (self._ui.afterDateFilterDateEdit, self._ui.beforeDateFilterDateEdit) for widget in time_edit_widgets: self.connect(widget, SIGNAL("dateChanged (const QDate&)"), self.apply_filters)
class MainWindow(QMainWindow): date_edit_widgets = (self._ui.afterDateFilterDateEdit, self._ui.beforeDateFilterDateEdit) for widget in date_edit_widgets: self.connect(widget, SIGNAL("dateChanged (const QDate&)"), self.apply_filters)
1,697
https://:@bitbucket.org/wyleyr/schoolutils.git
026584c7774cac6eb15d8d7697f9c9bc2453dbc3
@@ -821,7 +821,7 @@ def date(s): y, m, d = s.strip().split('-') y = year(y) m = month(m) - d = day(m) + d = day(d) return datetime.date(y, m, d) def sid(s):
schoolutils/grading/db.py
ReplaceText(target='d' @(824,12)->(824,13))
def date(s): y, m, d = s.strip().split('-') y = year(y) m = month(m) d = day(m) return datetime.date(y, m, d) def sid(s):
def date(s): y, m, d = s.strip().split('-') y = year(y) m = month(m) d = day(d) return datetime.date(y, m, d) def sid(s):
1,698
https://:@github.com/panoptes/piaa.git
c3e81501289525d1eeb40edf892a8139b030cc5f
@@ -534,7 +534,7 @@ class Observation(object): ls='dashed', edgecolor='blue', )) - ax3.add_patch(patches.Rectangle( + ax2.add_patch(patches.Rectangle( (0, 0), 9, 9, fill=False,
piaa/observation.py
ReplaceText(target='ax2' @(537,8)->(537,11))
class Observation(object): ls='dashed', edgecolor='blue', )) ax3.add_patch(patches.Rectangle( (0, 0), 9, 9, fill=False,
class Observation(object): ls='dashed', edgecolor='blue', )) ax2.add_patch(patches.Rectangle( (0, 0), 9, 9, fill=False,
1,699
https://:@github.com/jenzopr/pydemult.git
f28f2da5e86f205887c7431ee6ea583440a47ad7
@@ -92,7 +92,7 @@ def demultiplex(): q_bc_dict = dict((k, barcode_dict[k]) for k in chunk) writer_pool.apply_async(_writer, (q, q_bc_dict), callback = lambda x: print(x)) queue_list.append(q) - for bc in chunk.values(): + for bc in q_bc_dict.values(): queues[bc] = q zcat = subprocess.Popen(['zcat', args.fastq], stdout=subprocess.PIPE, bufsize = bufsize)
pydemult/pydemult.py
ReplaceText(target='q_bc_dict' @(95,18)->(95,23))
def demultiplex(): q_bc_dict = dict((k, barcode_dict[k]) for k in chunk) writer_pool.apply_async(_writer, (q, q_bc_dict), callback = lambda x: print(x)) queue_list.append(q) for bc in chunk.values(): queues[bc] = q zcat = subprocess.Popen(['zcat', args.fastq], stdout=subprocess.PIPE, bufsize = bufsize)
def demultiplex(): q_bc_dict = dict((k, barcode_dict[k]) for k in chunk) writer_pool.apply_async(_writer, (q, q_bc_dict), callback = lambda x: print(x)) queue_list.append(q) for bc in q_bc_dict.values(): queues[bc] = q zcat = subprocess.Popen(['zcat', args.fastq], stdout=subprocess.PIPE, bufsize = bufsize)