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,100
https://:@github.com/jor-/measurements.git
7d2c45bf498b709aa6ff903f87122e24bf02ef06
@@ -25,7 +25,7 @@ def npy_or_save_dop_and_po4(npy_file, dop_function, po4_function): po4 = po4.reshape((1,) + po4.shape) data = np.append(dop, po4, axis=0) - util.io.save_npy(npy_file, data, make_read_only=True, create_path_if_not_exists=True) + util.io.save_npy(data, npy_file, make_read_only=True, create_path_if_not_exists=True) return data
all/woa/data.py
ArgSwap(idxs=0<->1 @(28,8)->(28,24))
def npy_or_save_dop_and_po4(npy_file, dop_function, po4_function): po4 = po4.reshape((1,) + po4.shape) data = np.append(dop, po4, axis=0) util.io.save_npy(npy_file, data, make_read_only=True, create_path_if_not_exists=True) return data
def npy_or_save_dop_and_po4(npy_file, dop_function, po4_function): po4 = po4.reshape((1,) + po4.shape) data = np.append(dop, po4, axis=0) util.io.save_npy(data, npy_file, make_read_only=True, create_path_if_not_exists=True) return data
1,101
https://:@github.com/jor-/measurements.git
a7a2d0f753fae4e81297af835aad164120937629
@@ -73,7 +73,7 @@ class Cruise(): z = z_var.data assert po4_var.units == measurements.po4.wod.constants.PO4_UNIT - po4 = z_var.data + po4 = po4_var.data z_flag = z_flag_var.data po4_flag = po4_flag_var.data
measurements/po4/wod/cruise.py
ReplaceText(target='po4_var' @(76,22)->(76,27))
class Cruise(): z = z_var.data assert po4_var.units == measurements.po4.wod.constants.PO4_UNIT po4 = z_var.data z_flag = z_flag_var.data po4_flag = po4_flag_var.data
class Cruise(): z = z_var.data assert po4_var.units == measurements.po4.wod.constants.PO4_UNIT po4 = po4_var.data z_flag = z_flag_var.data po4_flag = po4_flag_var.data
1,102
https://:@github.com/jor-/measurements.git
859a296a6e70664de2e7ff4970b80f311735ef19
@@ -678,7 +678,7 @@ class LandSeaMask(): # plot cm = matplotlib.pyplot.cm.winter_r - util.plot.data(data, file, land_value=0, power_limit=10, colormap=cm) + util.plot.data(file, data, land_value=0, power_limit=10, colormap=cm) # copy def copy(self):
measurements/land_sea_mask/lsm.py
ArgSwap(idxs=0<->1 @(681,8)->(681,22))
class LandSeaMask(): # plot cm = matplotlib.pyplot.cm.winter_r util.plot.data(data, file, land_value=0, power_limit=10, colormap=cm) # copy def copy(self):
class LandSeaMask(): # plot cm = matplotlib.pyplot.cm.winter_r util.plot.data(file, data, land_value=0, power_limit=10, colormap=cm) # copy def copy(self):
1,103
https://:@github.com/jor-/measurements.git
859a296a6e70664de2e7ff4970b80f311735ef19
@@ -68,7 +68,7 @@ def _plot_map(data, lsm, file, layer=None, v_min=None, v_max=None, use_log_scale data = data[:, :, :, layer] data = data.reshape(data.shape + (1,)) file = _prepare_filename(file, lsm) - util.plot.data(data, file, no_data_value=np.inf, v_min=v_min, v_max=v_max, use_log_scale=use_log_scale, contours=False, colorbar=True, power_limit=0, colorbar_kwargs=colorbar_kwargs) + util.plot.data(file, data, no_data_value=np.inf, v_min=v_min, v_max=v_max, use_log_scale=use_log_scale, contours=False, colorbar=True, power_limit=0, colorbar_kwargs=colorbar_kwargs) def _plot_histogram(data, lsm, file, bins=None, step_size=None, v_min=None, v_max=None, use_log_scale=False, tick_power=None): file = _prepare_filename(file, lsm, 'histogram')
measurements/util/plot.py
ArgSwap(idxs=0<->1 @(71,4)->(71,18))
def _plot_map(data, lsm, file, layer=None, v_min=None, v_max=None, use_log_scale data = data[:, :, :, layer] data = data.reshape(data.shape + (1,)) file = _prepare_filename(file, lsm) util.plot.data(data, file, no_data_value=np.inf, v_min=v_min, v_max=v_max, use_log_scale=use_log_scale, contours=False, colorbar=True, power_limit=0, colorbar_kwargs=colorbar_kwargs) def _plot_histogram(data, lsm, file, bins=None, step_size=None, v_min=None, v_max=None, use_log_scale=False, tick_power=None): file = _prepare_filename(file, lsm, 'histogram')
def _plot_map(data, lsm, file, layer=None, v_min=None, v_max=None, use_log_scale data = data[:, :, :, layer] data = data.reshape(data.shape + (1,)) file = _prepare_filename(file, lsm) util.plot.data(file, data, no_data_value=np.inf, v_min=v_min, v_max=v_max, use_log_scale=use_log_scale, contours=False, colorbar=True, power_limit=0, colorbar_kwargs=colorbar_kwargs) def _plot_histogram(data, lsm, file, bins=None, step_size=None, v_min=None, v_max=None, use_log_scale=False, tick_power=None): file = _prepare_filename(file, lsm, 'histogram')
1,104
https://:@github.com/yeago/django-nonrel-enuff.git
77f985134934ef571ea04e9fe6629fffa0bc276d
@@ -18,7 +18,7 @@ class EnuffManager(models.Manager): def push_to_list(self, queue, instance, trim=500, redis_conn=None, bump=True, site=None): backend = RedisBackend(conn=redis_conn) key = self.get_key(queue, site=site) - current_list = backend.get_ids(queue) + current_list = backend.get_ids(key) known_length = len(current_list) + 1 if bump: if instance.pk in current_list:
enuff/managers.py
ReplaceText(target='key' @(21,39)->(21,44))
class EnuffManager(models.Manager): def push_to_list(self, queue, instance, trim=500, redis_conn=None, bump=True, site=None): backend = RedisBackend(conn=redis_conn) key = self.get_key(queue, site=site) current_list = backend.get_ids(queue) known_length = len(current_list) + 1 if bump: if instance.pk in current_list:
class EnuffManager(models.Manager): def push_to_list(self, queue, instance, trim=500, redis_conn=None, bump=True, site=None): backend = RedisBackend(conn=redis_conn) key = self.get_key(queue, site=site) current_list = backend.get_ids(key) known_length = len(current_list) + 1 if bump: if instance.pk in current_list:
1,105
https://:@gitlab.com/ViDA-NYU/reproserver.git
4dea7214ea920d07375abefc9b6cafd6be72a418
@@ -23,7 +23,7 @@ class OSF(BaseRepository): url = url[8:] else: raise RepositoryError("Invalid URL") - if url.lower().startswith('osf.io/'): + if not url.lower().startswith('osf.io/'): raise RepositoryError("Not OSF URL") path = url[7:]
reproserver/repositories/osf.py
ReplaceText(target='not ' @(26,11)->(26,11))
class OSF(BaseRepository): url = url[8:] else: raise RepositoryError("Invalid URL") if url.lower().startswith('osf.io/'): raise RepositoryError("Not OSF URL") path = url[7:]
class OSF(BaseRepository): url = url[8:] else: raise RepositoryError("Invalid URL") if not url.lower().startswith('osf.io/'): raise RepositoryError("Not OSF URL") path = url[7:]
1,106
https://:@github.com/bmeyers/StatisticalClearSky.git
34c593a9d8f1be450f20fe5d3bbd411cf5cef692
@@ -399,7 +399,7 @@ class IterativeFitting(SerializationMixin, PlotMixin): Since it's used in constructor, TimeShift is injected through constructor. """ - if time_shift is not None: + if time_shift is None: return ClusteringTimeShift(power_signals_d) else: return time_shift
statistical_clear_sky/algorithm/iterative_fitting.py
ReplaceText(target=' is ' @(402,21)->(402,29))
class IterativeFitting(SerializationMixin, PlotMixin): Since it's used in constructor, TimeShift is injected through constructor. """ if time_shift is not None: return ClusteringTimeShift(power_signals_d) else: return time_shift
class IterativeFitting(SerializationMixin, PlotMixin): Since it's used in constructor, TimeShift is injected through constructor. """ if time_shift is None: return ClusteringTimeShift(power_signals_d) else: return time_shift
1,107
https://:@github.com/dccs-tech/mcmi.git
64aa5041a581b2f11782f09dedae15a0d188e5cd
@@ -176,7 +176,7 @@ class DataMixin(object, metaclass = MetaDataMixin): else: method_name = "{}_name".format(name) - relations[name] = getattr(self, method_name, None) + relations[field_name] = getattr(self, method_name, None) return relations
app/systems/command/mixins/base.py
ReplaceText(target='field_name' @(179,22)->(179,26))
class DataMixin(object, metaclass = MetaDataMixin): else: method_name = "{}_name".format(name) relations[name] = getattr(self, method_name, None) return relations
class DataMixin(object, metaclass = MetaDataMixin): else: method_name = "{}_name".format(name) relations[field_name] = getattr(self, method_name, None) return relations
1,108
https://:@github.com/rbwinslow/hq.git
6417c2446670e67868162190254759a483b894ab
@@ -69,7 +69,7 @@ def _cmp_nodes_to_value(base_op, first, second): def _cmp_value_to_nodes(base_op, first, second): node_values = set([number(node) for node in second]) first = number(first) - verbose_print('Comparing {0} nodes in node set to value "{1}"'.format(len(node_values), second)) + verbose_print('Comparing {0} nodes in node set to value "{1}"'.format(len(node_values), first)) for node_value in node_values: if base_op(first, node_value):
hq/xpath/relational_operators.py
ReplaceText(target='first' @(72,92)->(72,98))
def _cmp_nodes_to_value(base_op, first, second): def _cmp_value_to_nodes(base_op, first, second): node_values = set([number(node) for node in second]) first = number(first) verbose_print('Comparing {0} nodes in node set to value "{1}"'.format(len(node_values), second)) for node_value in node_values: if base_op(first, node_value):
def _cmp_nodes_to_value(base_op, first, second): def _cmp_value_to_nodes(base_op, first, second): node_values = set([number(node) for node in second]) first = number(first) verbose_print('Comparing {0} nodes in node set to value "{1}"'.format(len(node_values), first)) for node_value in node_values: if base_op(first, node_value):
1,109
https://:@github.com/PennWhartonBudgetModel/Utilities.git
dc85c81ce99f0290069d261bdacc675a40e67756
@@ -114,7 +114,7 @@ class InterfaceReader(PWBMTask): if not exists(destination_folder): makedirs(destination_folder) - if self.filename == "": + if self.filename != "": file_location = join( server_location,
pwbmutils/interface_reader.py
ReplaceText(target='!=' @(117,29)->(117,31))
class InterfaceReader(PWBMTask): if not exists(destination_folder): makedirs(destination_folder) if self.filename == "": file_location = join( server_location,
class InterfaceReader(PWBMTask): if not exists(destination_folder): makedirs(destination_folder) if self.filename != "": file_location = join( server_location,
1,110
https://:@github.com/wtrdrnkr/pyrecon.git
2055f9cddf60e78a7012ec7dbe9900cd59151e67
@@ -288,7 +288,7 @@ def prepare_frontend_payload(session, section, grouped): # Add uniques to payload unique_ids_query = prepare_unique_query(session, section) for unique_id in unique_ids_query: - db_contour_unique = session.query(Contour).get(contour_A_id) + db_contour_unique = session.query(Contour).get(unique_id) unique_reconstruct_contour = section.contours[db_contour_unique.index] unique_dict = prepare_contour_dict_for_frontend( unique_reconstruct_contour,
pyrecon/tools/mergetool/backend.py
ReplaceText(target='unique_id' @(291,55)->(291,67))
def prepare_frontend_payload(session, section, grouped): # Add uniques to payload unique_ids_query = prepare_unique_query(session, section) for unique_id in unique_ids_query: db_contour_unique = session.query(Contour).get(contour_A_id) unique_reconstruct_contour = section.contours[db_contour_unique.index] unique_dict = prepare_contour_dict_for_frontend( unique_reconstruct_contour,
def prepare_frontend_payload(session, section, grouped): # Add uniques to payload unique_ids_query = prepare_unique_query(session, section) for unique_id in unique_ids_query: db_contour_unique = session.query(Contour).get(unique_id) unique_reconstruct_contour = section.contours[db_contour_unique.index] unique_dict = prepare_contour_dict_for_frontend( unique_reconstruct_contour,
1,111
https://:@github.com/chili-epfl/pyrobots.git
146de875a3a4cdea20c0778bd454e7255d0ff78d
@@ -57,7 +57,7 @@ with robots.PR2(knowledge = pyoro.Oro(), init = False) as pr2: for t in e: text = pr2.knowledge["%s verbalisesTo *" % t][0] logger.warning("New verbalization from Dialogs: <%s>" % text) - pr2.say(t) + pr2.say(text) if "--init" in sys.argv:
scripts/handover.py
ReplaceText(target='text' @(60,20)->(60,21))
with robots.PR2(knowledge = pyoro.Oro(), init = False) as pr2: for t in e: text = pr2.knowledge["%s verbalisesTo *" % t][0] logger.warning("New verbalization from Dialogs: <%s>" % text) pr2.say(t) if "--init" in sys.argv:
with robots.PR2(knowledge = pyoro.Oro(), init = False) as pr2: for t in e: text = pr2.knowledge["%s verbalisesTo *" % t][0] logger.warning("New verbalization from Dialogs: <%s>" % text) pr2.say(text) if "--init" in sys.argv:
1,112
https://:@github.com/raviqqe/tensorflow-extenteten.git
7d6a40a3bd15292c762e919d1411e8da06791329
@@ -19,7 +19,7 @@ def get_attentions(): def add_metric(tensor, name=None): return tf.add_to_collection( METRICS, - tensor if name is None else util.rename(name, tensor)) + tensor if name is None else util.rename(tensor, name)) def get_metrics(): return tf.get_collection(METRICS)
nn/collections.py
ArgSwap(idxs=0<->1 @(22,34)->(22,45))
def get_attentions(): def add_metric(tensor, name=None): return tf.add_to_collection( METRICS, tensor if name is None else util.rename(name, tensor)) def get_metrics(): return tf.get_collection(METRICS)
def get_attentions(): def add_metric(tensor, name=None): return tf.add_to_collection( METRICS, tensor if name is None else util.rename(tensor, name)) def get_metrics(): return tf.get_collection(METRICS)
1,113
https://:@github.com/raviqqe/tensorflow-extenteten.git
f34e283077d1899902e276dff397defed16537f7
@@ -60,7 +60,7 @@ def classify(logits, return (predictions, loss + l2_regularization_loss(regularization_scale), train.minimize(loss), - _evaluate(predictions, true_label)) + _evaluate(predicted_labels, true_label)) @func_scope()
extenteten/classification.py
ReplaceText(target='predicted_labels' @(63,22)->(63,33))
def classify(logits, return (predictions, loss + l2_regularization_loss(regularization_scale), train.minimize(loss), _evaluate(predictions, true_label)) @func_scope()
def classify(logits, return (predictions, loss + l2_regularization_loss(regularization_scale), train.minimize(loss), _evaluate(predicted_labels, true_label)) @func_scope()
1,114
https://:@github.com/Gulats/playmate.git
e7b2dc953d5117abdbf2d0821bb6991ed0fd26b1
@@ -333,7 +333,7 @@ class PlayScraper(object): results = s.DEV_RESULTS if results is None else results page = 0 if page is None else page page_num = (results // 20) * page - if not 0 < page_num <= 12: + if not 0 <= page_num <= 12: raise ValueError('Page out of range. (results // 20) * page must be between 0 - 12') pagtok = self._pagtok[page_num]
play_scraper/scraper.py
ReplaceText(target='<=' @(336,17)->(336,18))
class PlayScraper(object): results = s.DEV_RESULTS if results is None else results page = 0 if page is None else page page_num = (results // 20) * page if not 0 < page_num <= 12: raise ValueError('Page out of range. (results // 20) * page must be between 0 - 12') pagtok = self._pagtok[page_num]
class PlayScraper(object): results = s.DEV_RESULTS if results is None else results page = 0 if page is None else page page_num = (results // 20) * page if not 0 <= page_num <= 12: raise ValueError('Page out of range. (results // 20) * page must be between 0 - 12') pagtok = self._pagtok[page_num]
1,115
https://:@github.com/Acrisel/sshpipe.git
d87836437f14330751667874ae8ee4bbb257289c
@@ -21,7 +21,7 @@ class MySSHPipeHandler(SSHPipeHandler): def atstart(self, received): file = "{}{}".format(__file__, ".remote.log") - if hasattr(self, 'mlogger'): + if not hasattr(self, 'mlogger'): raise RuntimeError("Self missing mlogger method.") self.mlogger.debug("Opening file: {}.".format(file)) self.file = open(file, 'w')
sshpipe/examples/ssh_remote_handler.py
ReplaceText(target='not ' @(24,11)->(24,11))
class MySSHPipeHandler(SSHPipeHandler): def atstart(self, received): file = "{}{}".format(__file__, ".remote.log") if hasattr(self, 'mlogger'): raise RuntimeError("Self missing mlogger method.") self.mlogger.debug("Opening file: {}.".format(file)) self.file = open(file, 'w')
class MySSHPipeHandler(SSHPipeHandler): def atstart(self, received): file = "{}{}".format(__file__, ".remote.log") if not hasattr(self, 'mlogger'): raise RuntimeError("Self missing mlogger method.") self.mlogger.debug("Opening file: {}.".format(file)) self.file = open(file, 'w')
1,116
https://:@github.com/NREL/tracknodes.git
38a736a18b767b24a883698f15618bc160dceb5e
@@ -124,7 +124,7 @@ class TrackNodes: for line in Popen([self.nodes_cmd, '--version'], stdout=PIPE, stderr=PIPE).communicate()[1].strip().split("\n"): fields = line.split() - if len(fields) > 0: + if len(fields) < 0: raise Exception("Unable to determine PBSpro or Torque") if fields[0] == "pbs_version":
lib/tracknodes/tracknodes.py
ReplaceText(target='<' @(127,27)->(127,28))
class TrackNodes: for line in Popen([self.nodes_cmd, '--version'], stdout=PIPE, stderr=PIPE).communicate()[1].strip().split("\n"): fields = line.split() if len(fields) > 0: raise Exception("Unable to determine PBSpro or Torque") if fields[0] == "pbs_version":
class TrackNodes: for line in Popen([self.nodes_cmd, '--version'], stdout=PIPE, stderr=PIPE).communicate()[1].strip().split("\n"): fields = line.split() if len(fields) < 0: raise Exception("Unable to determine PBSpro or Torque") if fields[0] == "pbs_version":
1,117
https://:@github.com/podhmo/metafanstatic.git
3c8e226e19bc4d3e0ad0c41f0f09da0183a4fd0f
@@ -67,7 +67,7 @@ def dependencies_iterator(xs): yield k, v else: for e in xs: - yield k, None + yield e, None class TotalComplement(object):
metafanstatic/complement.py
ReplaceText(target='e' @(70,18)->(70,19))
def dependencies_iterator(xs): yield k, v else: for e in xs: yield k, None class TotalComplement(object):
def dependencies_iterator(xs): yield k, v else: for e in xs: yield e, None class TotalComplement(object):
1,118
https://:@github.com/podhmo/metafanstatic.git
335a4deac8f721341e4983fab547082fb926b7e9
@@ -58,7 +58,7 @@ def creation(args): if "skip" not in params[c]: sys.stderr.write("create package: {}? (y or n)\n".format(c)) sys.stderr.flush() - skip = "y" == sys.stdin.readline().strip().lower() + skip = "y" != sys.stdin.readline().strip().lower() else: skip = params[c]["skip"] if skip:
metafanstatic/command.py
ReplaceText(target='!=' @(61,23)->(61,25))
def creation(args): if "skip" not in params[c]: sys.stderr.write("create package: {}? (y or n)\n".format(c)) sys.stderr.flush() skip = "y" == sys.stdin.readline().strip().lower() else: skip = params[c]["skip"] if skip:
def creation(args): if "skip" not in params[c]: sys.stderr.write("create package: {}? (y or n)\n".format(c)) sys.stderr.flush() skip = "y" != sys.stdin.readline().strip().lower() else: skip = params[c]["skip"] if skip:
1,119
https://:@github.com/rte-france/Grid2Op.git
a5f67c567a5dda60a015e9c06802927eadd6f5df
@@ -57,7 +57,7 @@ if __name__ == "__main__": old_version = re.sub("version=", "", old_version) old_version = re.sub("'", "", old_version) old_version = re.sub('"', "", old_version) - if version <= old_version: + if version < old_version: raise RuntimeError("You provided the \"new\" version \"{}\" which is older (or equal) to the current version " "found: \"{}\".".format(version, old_version))
utils/make_release.py
ReplaceText(target='<' @(60,15)->(60,17))
if __name__ == "__main__": old_version = re.sub("version=", "", old_version) old_version = re.sub("'", "", old_version) old_version = re.sub('"', "", old_version) if version <= old_version: raise RuntimeError("You provided the \"new\" version \"{}\" which is older (or equal) to the current version " "found: \"{}\".".format(version, old_version))
if __name__ == "__main__": old_version = re.sub("version=", "", old_version) old_version = re.sub("'", "", old_version) old_version = re.sub('"', "", old_version) if version < old_version: raise RuntimeError("You provided the \"new\" version \"{}\" which is older (or equal) to the current version " "found: \"{}\".".format(version, old_version))
1,120
https://:@bitbucket.org/berkeleylab/als.milo.git
e60d005d389cb31b6e99f937e35adbe3fccb7aaf
@@ -131,7 +131,7 @@ def get_versions(): pass return_key_values = _get_versions() - return_key_values["authors"] = pieces["authors"] + return_key_values["authors"] = default_keys_values["authors"] return return_key_values
milo/version.py
ReplaceText(target='default_keys_values' @(134,35)->(134,41))
def get_versions(): pass return_key_values = _get_versions() return_key_values["authors"] = pieces["authors"] return return_key_values
def get_versions(): pass return_key_values = _get_versions() return_key_values["authors"] = default_keys_values["authors"] return return_key_values
1,121
https://:@github.com/astroJeff/dart_board.git
1e34f160c6865ba41d49a6261bd56b5ecdb3aa28
@@ -42,7 +42,7 @@ def ln_prior(x, dart): if key == 'kick_sigma': kick_sigma = value if key == 'M1_alpha': M1_alpha = value if key == 'M1_min': M1_min = value - if key == 'M1_max': M1_min = value + if key == 'M1_max': M1_max = value if key == 'M2_min': M2_min = value if key == 'a_min': a_min = value if key == 'a_max': a_max = value
dart_board/priors.py
ReplaceText(target='M1_max' @(45,28)->(45,34))
def ln_prior(x, dart): if key == 'kick_sigma': kick_sigma = value if key == 'M1_alpha': M1_alpha = value if key == 'M1_min': M1_min = value if key == 'M1_max': M1_min = value if key == 'M2_min': M2_min = value if key == 'a_min': a_min = value if key == 'a_max': a_max = value
def ln_prior(x, dart): if key == 'kick_sigma': kick_sigma = value if key == 'M1_alpha': M1_alpha = value if key == 'M1_min': M1_min = value if key == 'M1_max': M1_max = value if key == 'M2_min': M2_min = value if key == 'a_min': a_min = value if key == 'a_max': a_max = value
1,122
https://:@github.com/astroJeff/dart_board.git
6362e24414b5056aea5b50b99e7a446b9e9a9625
@@ -156,7 +156,7 @@ class DartBoard(): print("You must include a binary evolution scheme, e.g. pybse.evolv_wrapper") sys.exit(-1) - if ntemps != 1 or ntemps is not None: + if ntemps != 1 and ntemps is not None: if ln_likelihood_function is None: print("You must include a likelihood function when using the parallel tempering MCMC method.") sys.exit(-1)
dart_board/darts.py
ReplaceText(target='and' @(159,23)->(159,25))
class DartBoard(): print("You must include a binary evolution scheme, e.g. pybse.evolv_wrapper") sys.exit(-1) if ntemps != 1 or ntemps is not None: if ln_likelihood_function is None: print("You must include a likelihood function when using the parallel tempering MCMC method.") sys.exit(-1)
class DartBoard(): print("You must include a binary evolution scheme, e.g. pybse.evolv_wrapper") sys.exit(-1) if ntemps != 1 and ntemps is not None: if ln_likelihood_function is None: print("You must include a likelihood function when using the parallel tempering MCMC method.") sys.exit(-1)
1,123
https://:@github.com/celskeggs/themis.git
7f075e9140cb32cd691ca4725fa6a1789226ad23
@@ -19,7 +19,7 @@ def generate_prebuilt_files(build_lib): shutil.copyfile(os.path.join(builddir, SO_NAME), os.path.join(build_lib, "themis", SO_NAME)) - shutil.copyfile(os.path.join(builddir, HEADER_NAME), + shutil.copyfile(os.path.join(source_dir, HEADER_NAME), os.path.join(build_lib, "themis", os.path.basename(HEADER_NAME))) print("finished compiling frc hal")
setup.py
ReplaceText(target='source_dir' @(22,37)->(22,45))
def generate_prebuilt_files(build_lib): shutil.copyfile(os.path.join(builddir, SO_NAME), os.path.join(build_lib, "themis", SO_NAME)) shutil.copyfile(os.path.join(builddir, HEADER_NAME), os.path.join(build_lib, "themis", os.path.basename(HEADER_NAME))) print("finished compiling frc hal")
def generate_prebuilt_files(build_lib): shutil.copyfile(os.path.join(builddir, SO_NAME), os.path.join(build_lib, "themis", SO_NAME)) shutil.copyfile(os.path.join(source_dir, HEADER_NAME), os.path.join(build_lib, "themis", os.path.basename(HEADER_NAME))) print("finished compiling frc hal")
1,124
https://:@github.com/LanjiaoGong/chinese_province_city_area_mapper.git
ef285ed737310b53eb8e44362f5239cd9e9414fe
@@ -58,7 +58,7 @@ class Location: def __city_and_province(self): if self.city.isNotEmpty() and self.province.isNotEmpty(): if not self.city.isBlong(self.province.name): - if self.city.precision > self.province.precision: + if self.city.precision >= self.province.precision: self.province.name = self.city.belong else: self.city.reset()
chinese_province_city_area_mapper/domain.py
ReplaceText(target='>=' @(61,39)->(61,40))
class Location: def __city_and_province(self): if self.city.isNotEmpty() and self.province.isNotEmpty(): if not self.city.isBlong(self.province.name): if self.city.precision > self.province.precision: self.province.name = self.city.belong else: self.city.reset()
class Location: def __city_and_province(self): if self.city.isNotEmpty() and self.province.isNotEmpty(): if not self.city.isBlong(self.province.name): if self.city.precision >= self.province.precision: self.province.name = self.city.belong else: self.city.reset()
1,125
https://:@github.com/rkokkelk/python-athom-api.git
705215f6ce4bb02de2838e0298baeb70d51897ba
@@ -56,7 +56,7 @@ class AthomSession(Session): text = response.text if status_code in range(200, 299): - return text + return response if status_code in (400, 401): error = AthomCloudAuthenticationError(text)
athom/common/net.py
ReplaceText(target='response' @(59,19)->(59,23))
class AthomSession(Session): text = response.text if status_code in range(200, 299): return text if status_code in (400, 401): error = AthomCloudAuthenticationError(text)
class AthomSession(Session): text = response.text if status_code in range(200, 299): return response if status_code in (400, 401): error = AthomCloudAuthenticationError(text)
1,126
https://:@github.com/lambdaloop/calligator.git
c427e036073748ec86466ecff89e10211567c7fe
@@ -719,7 +719,7 @@ class CameraGroup: t2 = time.time() - if init_progress: + if verbose: print('optimization took {:.2f} seconds'.format(t2 - t1)) return p3ds_new2
calligator/cameras.py
ReplaceText(target='verbose' @(722,11)->(722,24))
class CameraGroup: t2 = time.time() if init_progress: print('optimization took {:.2f} seconds'.format(t2 - t1)) return p3ds_new2
class CameraGroup: t2 = time.time() if verbose: print('optimization took {:.2f} seconds'.format(t2 - t1)) return p3ds_new2
1,127
https://:@github.com/lambdaloop/calligator.git
a6503f793a664d7687ed61ba2166ffe16bf47c87
@@ -995,7 +995,7 @@ class CameraGroup: t1 = time.time() x0 = self._initialize_params_triangulation( - p3ds_med, constraints, constraints_weak) + p3ds_intp, constraints, constraints_weak) jac = self._jac_sparsity_triangulation( points, constraints, constraints_weak, n_deriv_smooth)
calligator/cameras.py
ReplaceText(target='p3ds_intp' @(998,12)->(998,20))
class CameraGroup: t1 = time.time() x0 = self._initialize_params_triangulation( p3ds_med, constraints, constraints_weak) jac = self._jac_sparsity_triangulation( points, constraints, constraints_weak, n_deriv_smooth)
class CameraGroup: t1 = time.time() x0 = self._initialize_params_triangulation( p3ds_intp, constraints, constraints_weak) jac = self._jac_sparsity_triangulation( points, constraints, constraints_weak, n_deriv_smooth)
1,128
https://:@github.com/European-XFEL/EXtra-data.git
732de23488baae986f89f9f1e6f63f38d160011e
@@ -181,7 +181,7 @@ class VirtualStack: try: mod_data = self._data[modno] except KeyError: - if modno > self._nmodules: + if modno >= self._nmodules: raise IndexError(modno) mod_data = np.full(self._mod_shape, self._fillvalue, self.dtype)
karabo_data/stacking.py
ReplaceText(target='>=' @(184,21)->(184,22))
class VirtualStack: try: mod_data = self._data[modno] except KeyError: if modno > self._nmodules: raise IndexError(modno) mod_data = np.full(self._mod_shape, self._fillvalue, self.dtype)
class VirtualStack: try: mod_data = self._data[modno] except KeyError: if modno >= self._nmodules: raise IndexError(modno) mod_data = np.full(self._mod_shape, self._fillvalue, self.dtype)
1,129
https://:@github.com/spohara79/estreamer.git
d5bdd807c9d421adb77111aad0d584c0dc26a68a
@@ -37,7 +37,7 @@ class eStreamerConnection(object): except IOError: raise eStreamerKeyError("Unable to locate key file {}".format(pkey_path)) except crypto.Error: - raise eStreamerKeyError("Invalid key file or bad passphrase {}".format(cert_path)) + raise eStreamerKeyError("Invalid key file or bad passphrase {}".format(pkey_path)) try: self.cert = crypto.load_certificate(crypto.FILETYPE_PEM, open(cert_path, 'rb').read()) except IOError:
estreamer/streamer.py
ReplaceText(target='pkey_path' @(40,83)->(40,92))
class eStreamerConnection(object): except IOError: raise eStreamerKeyError("Unable to locate key file {}".format(pkey_path)) except crypto.Error: raise eStreamerKeyError("Invalid key file or bad passphrase {}".format(cert_path)) try: self.cert = crypto.load_certificate(crypto.FILETYPE_PEM, open(cert_path, 'rb').read()) except IOError:
class eStreamerConnection(object): except IOError: raise eStreamerKeyError("Unable to locate key file {}".format(pkey_path)) except crypto.Error: raise eStreamerKeyError("Invalid key file or bad passphrase {}".format(pkey_path)) try: self.cert = crypto.load_certificate(crypto.FILETYPE_PEM, open(cert_path, 'rb').read()) except IOError:
1,130
https://:@gitlab.com/mihaicristianpirvu/neural-wrappers.git
ee31c3e9b05a3f5bedc923f7bdd5a3243b6d1450
@@ -19,7 +19,7 @@ class CityScapesReader(DatasetReader): assert not data == "rgb_first_frame", "RGB First frame is not available for sequential dataset" # Only skipFrames=5 is supported now - if dataDimensions: + if sequentialData: dataDimensions = list(map(lambda x : "seq_%s_5" % (x), dataDimensions)) self.datasetPath = datasetPath
neural_wrappers/readers/cityscapes_reader.py
ReplaceText(target='sequentialData' @(22,5)->(22,19))
class CityScapesReader(DatasetReader): assert not data == "rgb_first_frame", "RGB First frame is not available for sequential dataset" # Only skipFrames=5 is supported now if dataDimensions: dataDimensions = list(map(lambda x : "seq_%s_5" % (x), dataDimensions)) self.datasetPath = datasetPath
class CityScapesReader(DatasetReader): assert not data == "rgb_first_frame", "RGB First frame is not available for sequential dataset" # Only skipFrames=5 is supported now if sequentialData: dataDimensions = list(map(lambda x : "seq_%s_5" % (x), dataDimensions)) self.datasetPath = datasetPath
1,131
https://:@gitlab.com/mihaicristianpirvu/neural-wrappers.git
79eeed7ae20989498e3377d4173a7fbca7501530
@@ -115,7 +115,7 @@ class NetworkSerializer: Str += "\t- %s in current, not in loaded"% (key) continue if current[key] != loaded[key]: - Str += "\t- current[%s]=%s. loaded[%s]=%s" % (key, current[key], key, current[key]) + Str += "\t- current[%s]=%s. loaded[%s]=%s" % (key, current[key], key, loaded[key]) raise Exception(Str) for key in stateKeys:
neural_wrappers/pytorch/network_serializer.py
ReplaceText(target='loaded' @(118,75)->(118,82))
class NetworkSerializer: Str += "\t- %s in current, not in loaded"% (key) continue if current[key] != loaded[key]: Str += "\t- current[%s]=%s. loaded[%s]=%s" % (key, current[key], key, current[key]) raise Exception(Str) for key in stateKeys:
class NetworkSerializer: Str += "\t- %s in current, not in loaded"% (key) continue if current[key] != loaded[key]: Str += "\t- current[%s]=%s. loaded[%s]=%s" % (key, current[key], key, loaded[key]) raise Exception(Str) for key in stateKeys:
1,132
https://:@bitbucket.org/fenics-project/ffc.git
f32ac6fb766df1abbb613d85e598953dc8122fa5
@@ -186,7 +186,7 @@ class TensorRepresentation: "Fancy printing of progress" if facet0 == facet1 == None: debug("Computing tensor representation for term %d..." % i) - elif facet0 == None: + elif facet1 == None: debug("Computing tensor representation for term %d, facet %d..." % (i, facet0)) else: debug("Computing tensor representation for term %d, facets (%d, %d)..." % (i, facet0, facet1))
src/ffc/compiler/representation/tensor/tensorrepresentation.py
ReplaceText(target='facet1' @(189,13)->(189,19))
class TensorRepresentation: "Fancy printing of progress" if facet0 == facet1 == None: debug("Computing tensor representation for term %d..." % i) elif facet0 == None: debug("Computing tensor representation for term %d, facet %d..." % (i, facet0)) else: debug("Computing tensor representation for term %d, facets (%d, %d)..." % (i, facet0, facet1))
class TensorRepresentation: "Fancy printing of progress" if facet0 == facet1 == None: debug("Computing tensor representation for term %d..." % i) elif facet1 == None: debug("Computing tensor representation for term %d, facet %d..." % (i, facet0)) else: debug("Computing tensor representation for term %d, facets (%d, %d)..." % (i, facet0, facet1))
1,133
https://:@bitbucket.org/fenics-project/ffc.git
68950e19d417ccaf80328da6afd1c52dda61856d
@@ -151,7 +151,7 @@ def _generate_tensor_contraction(terms, options, g_set): a0 = A0.A0[tuple(i + a)] # Skip small values - if abs(a0) > epsilon: continue + if abs(a0) < epsilon: continue # Compute value if value and a0 < 0.0:
ffc/tensor/tensorgenerator.py
ReplaceText(target='<' @(154,27)->(154,28))
def _generate_tensor_contraction(terms, options, g_set): a0 = A0.A0[tuple(i + a)] # Skip small values if abs(a0) > epsilon: continue # Compute value if value and a0 < 0.0:
def _generate_tensor_contraction(terms, options, g_set): a0 = A0.A0[tuple(i + a)] # Skip small values if abs(a0) < epsilon: continue # Compute value if value and a0 < 0.0:
1,134
https://:@bitbucket.org/fenics-project/ffc.git
eda9a71a896b15096615e51c4567692e36672192
@@ -77,7 +77,7 @@ def analyze_forms(forms, object_names, parameters, common_cell=None): element_numbers = _compute_element_numbers(unique_elements) # Get common cell - common_cell = form_data[0].cell + common_cell = form_datas[0].cell # Compute element cells and degrees (when cell or degree is undefined) element_cells = _auto_select_cells(unique_elements, common_cell)
ffc/analysis.py
ReplaceText(target='form_datas' @(80,18)->(80,27))
def analyze_forms(forms, object_names, parameters, common_cell=None): element_numbers = _compute_element_numbers(unique_elements) # Get common cell common_cell = form_data[0].cell # Compute element cells and degrees (when cell or degree is undefined) element_cells = _auto_select_cells(unique_elements, common_cell)
def analyze_forms(forms, object_names, parameters, common_cell=None): element_numbers = _compute_element_numbers(unique_elements) # Get common cell common_cell = form_datas[0].cell # Compute element cells and degrees (when cell or degree is undefined) element_cells = _auto_select_cells(unique_elements, common_cell)
1,135
https://:@bitbucket.org/fenics-project/ffc.git
834ccde04aa1d690b5cd293fcd2a83cad320d13d
@@ -148,7 +148,7 @@ def _evaluate_basis(data): # coordinates from physical element to the FIAT reference element. # FIXME: KBO: Change this when supporting R^2 in R^3 elements. code += [format["jacobian and inverse"](geometric_dimension, topological_dimension)] - code += ["", format["fiat coordinate map"](element_cell_domain, topological_dimension)] + code += ["", format["fiat coordinate map"](element_cell_domain, geometric_dimension)] # Get value shape and reset values. This should also work for TensorElement, # scalar are empty tuples, therefore (1,) in which case value_shape = 1.
ffc/evaluatebasis.py
ReplaceText(target='geometric_dimension' @(151,68)->(151,89))
def _evaluate_basis(data): # coordinates from physical element to the FIAT reference element. # FIXME: KBO: Change this when supporting R^2 in R^3 elements. code += [format["jacobian and inverse"](geometric_dimension, topological_dimension)] code += ["", format["fiat coordinate map"](element_cell_domain, topological_dimension)] # Get value shape and reset values. This should also work for TensorElement, # scalar are empty tuples, therefore (1,) in which case value_shape = 1.
def _evaluate_basis(data): # coordinates from physical element to the FIAT reference element. # FIXME: KBO: Change this when supporting R^2 in R^3 elements. code += [format["jacobian and inverse"](geometric_dimension, topological_dimension)] code += ["", format["fiat coordinate map"](element_cell_domain, geometric_dimension)] # Get value shape and reset values. This should also work for TensorElement, # scalar are empty tuples, therefore (1,) in which case value_shape = 1.
1,136
https://:@bitbucket.org/fenics-project/ffc.git
dad40f5d3192ffe0fb614ecf0d4a9d443956dde5
@@ -81,7 +81,7 @@ def generate_xi_from_x_snippets(cell, restriction): name_x = "x%s" % restriction name_y = "vertex_coordinates%s" % restriction name_z = "xi%s" % restriction - return generate_z_Axmy_snippets(name_z, name_A, name_x, name_y, gd, td) + return generate_z_Axmy_snippets(name_z, name_A, name_x, name_y, td, gd) class test_geometry_snippets(CodegenTestCase):
tests/py/test_geometry_snippets.py
ArgSwap(idxs=4<->5 @(84,11)->(84,35))
def generate_xi_from_x_snippets(cell, restriction): name_x = "x%s" % restriction name_y = "vertex_coordinates%s" % restriction name_z = "xi%s" % restriction return generate_z_Axmy_snippets(name_z, name_A, name_x, name_y, gd, td) class test_geometry_snippets(CodegenTestCase):
def generate_xi_from_x_snippets(cell, restriction): name_x = "x%s" % restriction name_y = "vertex_coordinates%s" % restriction name_z = "xi%s" % restriction return generate_z_Axmy_snippets(name_z, name_A, name_x, name_y, td, gd) class test_geometry_snippets(CodegenTestCase):
1,137
https://:@bitbucket.org/fenics-project/ffc.git
38550e99392b3c6bec52e45364351bd967baf714
@@ -650,7 +650,7 @@ def _compute_reference_derivatives(data, dof_data): for k in range(tdim)], [f_transform("JINV", k, l, tdim, gdim, None) for k in range(tdim)])) - name = f_component(f_derivatives+_p, f_matrix_index(i, f_r, f_num_derivs(_t))) + name = f_component(f_derivatives+_p, f_matrix_index(p, f_r, f_num_derivs(_t))) lines += [f_assign(name, value)] else: error("Unknown mapping: %s" % mapping)
ffc/evaluatebasisderivatives.py
ReplaceText(target='p' @(653,64)->(653,65))
def _compute_reference_derivatives(data, dof_data): for k in range(tdim)], [f_transform("JINV", k, l, tdim, gdim, None) for k in range(tdim)])) name = f_component(f_derivatives+_p, f_matrix_index(i, f_r, f_num_derivs(_t))) lines += [f_assign(name, value)] else: error("Unknown mapping: %s" % mapping)
def _compute_reference_derivatives(data, dof_data): for k in range(tdim)], [f_transform("JINV", k, l, tdim, gdim, None) for k in range(tdim)])) name = f_component(f_derivatives+_p, f_matrix_index(p, f_r, f_num_derivs(_t))) lines += [f_assign(name, value)] else: error("Unknown mapping: %s" % mapping)
1,138
https://:@bitbucket.org/fenics-project/ffc.git
e6ee433c0854c86b4e38fedf725097c31d9744d5
@@ -703,7 +703,7 @@ class IntegralGenerator(object): weights = self.backend.symbols.custom_weights_table() weight = weights[iq] else: - weight = self.backend.symbols.weights_table(num_points) + weights = self.backend.symbols.weights_table(num_points) weight = weights[iq] # Fetch code to access modified arguments
ffc/uflacs/integralgenerator.py
ReplaceText(target='weights' @(706,12)->(706,18))
class IntegralGenerator(object): weights = self.backend.symbols.custom_weights_table() weight = weights[iq] else: weight = self.backend.symbols.weights_table(num_points) weight = weights[iq] # Fetch code to access modified arguments
class IntegralGenerator(object): weights = self.backend.symbols.custom_weights_table() weight = weights[iq] else: weights = self.backend.symbols.weights_table(num_points) weight = weights[iq] # Fetch code to access modified arguments
1,139
https://:@github.com/Kitware/kwiver.git
19cfcc52be6863217fe227448b8dbfd19d6f63e9
@@ -209,7 +209,7 @@ def test_datum(): test_error("Could not initialize pipeline: '%s'" % str(e)) continue - s = sreg.create_schedule(sched_type, c, p) + s = sreg.create_schedule(sched_type, p, c) try: s.start()
tests/bindings/python/image/test-vil.py
ArgSwap(idxs=1<->2 @(212,12)->(212,32))
def test_datum(): test_error("Could not initialize pipeline: '%s'" % str(e)) continue s = sreg.create_schedule(sched_type, c, p) try: s.start()
def test_datum(): test_error("Could not initialize pipeline: '%s'" % str(e)) continue s = sreg.create_schedule(sched_type, p, c) try: s.start()
1,140
https://:@github.com/Jincheng-Sun/Kylearn-pytorch.git
c4772f2db257170a0c6a456cd71896f6e393f7f5
@@ -63,7 +63,7 @@ class TextualDataloader(): valid_sampler = SubsetRandomSampler(eval_indices) self.train_loader = DataLoader(train_set, batch_size, sampler=train_sampler, num_workers=4) - self.val_loader = DataLoader(train_set, batch_size, sampler=valid_sampler, num_workers=4) + self.val_loader = DataLoader(test_set, batch_size, sampler=valid_sampler, num_workers=4) self.test_loader = DataLoader(test_set, batch_size, num_workers=4)
Implementation/nlp_smart_dispatching/dataloader.py
ReplaceText(target='test_set' @(66,37)->(66,46))
class TextualDataloader(): valid_sampler = SubsetRandomSampler(eval_indices) self.train_loader = DataLoader(train_set, batch_size, sampler=train_sampler, num_workers=4) self.val_loader = DataLoader(train_set, batch_size, sampler=valid_sampler, num_workers=4) self.test_loader = DataLoader(test_set, batch_size, num_workers=4)
class TextualDataloader(): valid_sampler = SubsetRandomSampler(eval_indices) self.train_loader = DataLoader(train_set, batch_size, sampler=train_sampler, num_workers=4) self.val_loader = DataLoader(test_set, batch_size, sampler=valid_sampler, num_workers=4) self.test_loader = DataLoader(test_set, batch_size, num_workers=4)
1,141
https://:@github.com/itxaka/pychef.git
ef4b72b7d13dab406b21c020a24fefe531f4b859
@@ -153,7 +153,7 @@ class Key(object): size = RSA_size(self.key) output = create_string_buffer(size) ret = RSA_private_encrypt(len(buf), buf, output, self.key, padding) - if ret == 0: + if ret <= 0: raise SSLError('Unable to encrypt data') return output.raw[:ret]
chef/rsa.py
ReplaceText(target='<=' @(156,15)->(156,17))
class Key(object): size = RSA_size(self.key) output = create_string_buffer(size) ret = RSA_private_encrypt(len(buf), buf, output, self.key, padding) if ret == 0: raise SSLError('Unable to encrypt data') return output.raw[:ret]
class Key(object): size = RSA_size(self.key) output = create_string_buffer(size) ret = RSA_private_encrypt(len(buf), buf, output, self.key, padding) if ret <= 0: raise SSLError('Unable to encrypt data') return output.raw[:ret]
1,142
https://:@github.com/hugobranq/ines.git
1d4af72308bfe0bbe63ec9292583805e26823f0f
@@ -115,7 +115,7 @@ class PostmanCollection(object): response_key = camelcase(response_key) tests.append( 'if (answer.%s){ postman.setEnvironmentVariable("%s", answer.%s); }' - % (environment_key, environment_key, response_key)) + % (response_key, environment_key, response_key)) if tests: tests.insert(0, 'var answer = JSON.parse(responseBody);')
ines/views/postman.py
ReplaceText(target='response_key' @(118,39)->(118,54))
class PostmanCollection(object): response_key = camelcase(response_key) tests.append( 'if (answer.%s){ postman.setEnvironmentVariable("%s", answer.%s); }' % (environment_key, environment_key, response_key)) if tests: tests.insert(0, 'var answer = JSON.parse(responseBody);')
class PostmanCollection(object): response_key = camelcase(response_key) tests.append( 'if (answer.%s){ postman.setEnvironmentVariable("%s", answer.%s); }' % (response_key, environment_key, response_key)) if tests: tests.insert(0, 'var answer = JSON.parse(responseBody);')
1,143
https://:@github.com/hugobranq/ines.git
d0374fc9f5a5003d09c8137a14adb2eb66d3fd30
@@ -58,7 +58,7 @@ class BaseCoreSessionManager(BaseSessionManager): def not_inactives_filter(column): return and_( or_(column.start_date <= func.now(), column.start_date.is_(None)), - or_(column.end_date >= func.now(), column.end_date.is_(None))) + or_(column.end_date > func.now(), column.end_date.is_(None))) def table_type(table):
ines/api/core/__init__.py
ReplaceText(target='>' @(61,28)->(61,30))
class BaseCoreSessionManager(BaseSessionManager): def not_inactives_filter(column): return and_( or_(column.start_date <= func.now(), column.start_date.is_(None)), or_(column.end_date >= func.now(), column.end_date.is_(None))) def table_type(table):
class BaseCoreSessionManager(BaseSessionManager): def not_inactives_filter(column): return and_( or_(column.start_date <= func.now(), column.start_date.is_(None)), or_(column.end_date > func.now(), column.end_date.is_(None))) def table_type(table):
1,144
https://:@github.com/brews/proxysiphon.git
f1acb73417edcbe4011f468ab66f6c53d6d02fcd
@@ -413,7 +413,7 @@ def lmr_da_dfs(sitegrp=None, agemodel_iter=None, find_modern_seasonality=True): cut_deep = float(sitegrp['chronology'].cut_deep) cut_shallow = -np.inf if hasattr(sitegrp['chronology'], 'cut_shallow'): - cut_deep = float(sitegrp['chronology'].cut_shallow) + cut_shallow = float(sitegrp['chronology'].cut_shallow) depth = sitegrp['data'].variables['depth'][:] cutoff_msk = (depth >= cut_shallow) & (depth <= cut_deep)
proxysiphon/lmr_hdf5/__init__.py
ReplaceText(target='cut_shallow' @(416,12)->(416,20))
def lmr_da_dfs(sitegrp=None, agemodel_iter=None, find_modern_seasonality=True): cut_deep = float(sitegrp['chronology'].cut_deep) cut_shallow = -np.inf if hasattr(sitegrp['chronology'], 'cut_shallow'): cut_deep = float(sitegrp['chronology'].cut_shallow) depth = sitegrp['data'].variables['depth'][:] cutoff_msk = (depth >= cut_shallow) & (depth <= cut_deep)
def lmr_da_dfs(sitegrp=None, agemodel_iter=None, find_modern_seasonality=True): cut_deep = float(sitegrp['chronology'].cut_deep) cut_shallow = -np.inf if hasattr(sitegrp['chronology'], 'cut_shallow'): cut_shallow = float(sitegrp['chronology'].cut_shallow) depth = sitegrp['data'].variables['depth'][:] cutoff_msk = (depth >= cut_shallow) & (depth <= cut_deep)
1,145
https://:@github.com/voytekresearch/bycycle.git
8b521e89226a75f9563a92395e1dfd280cda2e02
@@ -75,7 +75,7 @@ def find_flank_zerox(sig, flank): """ assert flank in ['rise', 'decay'] - pos = sig <= 0 if flank == 'rise' else sig >= 0 + pos = sig <= 0 if flank == 'rise' else sig > 0 zero_xs = (pos[:-1] & ~pos[1:]).nonzero()[0]
bycycle/cyclepoints/zerox.py
ReplaceText(target='>' @(78,47)->(78,49))
def find_flank_zerox(sig, flank): """ assert flank in ['rise', 'decay'] pos = sig <= 0 if flank == 'rise' else sig >= 0 zero_xs = (pos[:-1] & ~pos[1:]).nonzero()[0]
def find_flank_zerox(sig, flank): """ assert flank in ['rise', 'decay'] pos = sig <= 0 if flank == 'rise' else sig > 0 zero_xs = (pos[:-1] & ~pos[1:]).nonzero()[0]
1,146
https://:@github.com/webcube/django-dockit.git
32c8adda7e11c6bc7e53cabea92e880cc291937f
@@ -21,7 +21,7 @@ class PrimitiveListWidget(Widget): output = [] final_attrs = self.build_attrs(attrs) id_ = final_attrs.get('id', None) - i = 0 + i = -1 for i, widget_value in enumerate(value): if id_: final_attrs = dict(final_attrs, id='%s_%s' % (id_, i))
dockit/forms/widgets.py
ReplaceText(target='-1' @(24,12)->(24,13))
class PrimitiveListWidget(Widget): output = [] final_attrs = self.build_attrs(attrs) id_ = final_attrs.get('id', None) i = 0 for i, widget_value in enumerate(value): if id_: final_attrs = dict(final_attrs, id='%s_%s' % (id_, i))
class PrimitiveListWidget(Widget): output = [] final_attrs = self.build_attrs(attrs) id_ = final_attrs.get('id', None) i = -1 for i, widget_value in enumerate(value): if id_: final_attrs = dict(final_attrs, id='%s_%s' % (id_, i))
1,147
https://:@github.com/dimchat/sdk-py.git
e0752d614d145ba0a77f87ae06334b891f916c69
@@ -295,7 +295,7 @@ class Facebook(Barrack): # decrypt key not found, use the same with sign key? key = self.private_key_for_signature(identifier) if key is not None: - keys = [keys] + keys = [key] return keys def contacts(self, identifier: ID) -> Optional[list]:
dimsdk/facebook.py
ReplaceText(target='key' @(298,24)->(298,28))
class Facebook(Barrack): # decrypt key not found, use the same with sign key? key = self.private_key_for_signature(identifier) if key is not None: keys = [keys] return keys def contacts(self, identifier: ID) -> Optional[list]:
class Facebook(Barrack): # decrypt key not found, use the same with sign key? key = self.private_key_for_signature(identifier) if key is not None: keys = [key] return keys def contacts(self, identifier: ID) -> Optional[list]:
1,148
https://:@github.com/tnewman/pat.git
ebc0ce494872d7f90e82ca2052d06252a3a0a952
@@ -15,7 +15,7 @@ def play(audio_path: str): """ pat_error = _libpat.pat_play(_pat, c_char_p(audio_path.encode('ascii'))) - if pat_error != _PATError.PAT_SUCCESS: + if pat_error == _PATError.PAT_SUCCESS: return elif pat_error == _PATError.PAT_INTERRUPTED_ERROR: os.kill(os.getpid(), signal.SIGINT)
pypat/pypat/__init__.py
ReplaceText(target='==' @(18,17)->(18,19))
def play(audio_path: str): """ pat_error = _libpat.pat_play(_pat, c_char_p(audio_path.encode('ascii'))) if pat_error != _PATError.PAT_SUCCESS: return elif pat_error == _PATError.PAT_INTERRUPTED_ERROR: os.kill(os.getpid(), signal.SIGINT)
def play(audio_path: str): """ pat_error = _libpat.pat_play(_pat, c_char_p(audio_path.encode('ascii'))) if pat_error == _PATError.PAT_SUCCESS: return elif pat_error == _PATError.PAT_INTERRUPTED_ERROR: os.kill(os.getpid(), signal.SIGINT)
1,149
https://:@github.com/openp2pdesign/platform_analysis.git
526eb0afcc35b076c1860aad48b9a733681e13c7
@@ -52,7 +52,7 @@ def graph_to_pandas_time_series(graph): ]) # Iterate over edges to create a DataFrame of actions - for i in time_dataframe.edges_iter(data=True): + for i in graph.edges_iter(data=True): if "node" in i[2]: node = i[2]["node"] else:
platform_analysis/sna.py
ReplaceText(target='graph' @(55,13)->(55,27))
def graph_to_pandas_time_series(graph): ]) # Iterate over edges to create a DataFrame of actions for i in time_dataframe.edges_iter(data=True): if "node" in i[2]: node = i[2]["node"] else:
def graph_to_pandas_time_series(graph): ]) # Iterate over edges to create a DataFrame of actions for i in graph.edges_iter(data=True): if "node" in i[2]: node = i[2]["node"] else:
1,150
https://:@github.com/jun-harashima/pott.git
31942b58f1aad8a32969c7a1e6ea4184a4f52d4b
@@ -28,7 +28,7 @@ class Assistant: original_start = self.option.start self.option.start += increment papers = self._search() - if papers: + if not papers: self.option.start = original_start return papers
pott/assistants/assistant.py
ReplaceText(target='not ' @(31,11)->(31,11))
class Assistant: original_start = self.option.start self.option.start += increment papers = self._search() if papers: self.option.start = original_start return papers
class Assistant: original_start = self.option.start self.option.start += increment papers = self._search() if not papers: self.option.start = original_start return papers
1,151
https://:@github.com/Zerostack-open/zs-preflight.git
1a0cc81f539606040222ceb11b7974cd48a30cd7
@@ -45,7 +45,7 @@ class network_check(): nic_speed = int(speed.read().strip()) if(nic_speed == 1000): nic.append({'nic_name':o,'nic_speed':nic_speed,'nic_brand':nic_brand,'text':'NIC minimum config'}) - elif(nic_speed == 10000): + elif(nic_speed >= 10000): nic.append({'nic_name':o,'nic_speed':nic_speed,'nic_brand':nic_brand,'text':'NIC recommended config'}) except Exception as e: nic.append({'nic_name':o,'nic_speed':'Unknown','nic_brand':nic_brand,'text':'NIC Unknown'})
zspreflight/network.py
ReplaceText(target='>=' @(48,39)->(48,41))
class network_check(): nic_speed = int(speed.read().strip()) if(nic_speed == 1000): nic.append({'nic_name':o,'nic_speed':nic_speed,'nic_brand':nic_brand,'text':'NIC minimum config'}) elif(nic_speed == 10000): nic.append({'nic_name':o,'nic_speed':nic_speed,'nic_brand':nic_brand,'text':'NIC recommended config'}) except Exception as e: nic.append({'nic_name':o,'nic_speed':'Unknown','nic_brand':nic_brand,'text':'NIC Unknown'})
class network_check(): nic_speed = int(speed.read().strip()) if(nic_speed == 1000): nic.append({'nic_name':o,'nic_speed':nic_speed,'nic_brand':nic_brand,'text':'NIC minimum config'}) elif(nic_speed >= 10000): nic.append({'nic_name':o,'nic_speed':nic_speed,'nic_brand':nic_brand,'text':'NIC recommended config'}) except Exception as e: nic.append({'nic_name':o,'nic_speed':'Unknown','nic_brand':nic_brand,'text':'NIC Unknown'})
1,152
https://:@github.com/inkstitch/pyembroidery.git
03f6fded69fc431b28cade51f008de235b09390e
@@ -9,7 +9,7 @@ MAX_STITCH_DISTANCE = float('inf') def write(pattern, f, settings=None): - if settings is not None: + if settings is None: settings = {} flip_x = settings.get('flip_x', True)
pyembroidery/GcodeWriter.py
ReplaceText(target=' is ' @(12,15)->(12,23))
MAX_STITCH_DISTANCE = float('inf') def write(pattern, f, settings=None): if settings is not None: settings = {} flip_x = settings.get('flip_x', True)
MAX_STITCH_DISTANCE = float('inf') def write(pattern, f, settings=None): if settings is None: settings = {} flip_x = settings.get('flip_x', True)
1,153
https://:@github.com/mass-project/mass_api_client.git
aca9dd7184b27be9c14df9d361b8120fd00f40b0
@@ -34,7 +34,7 @@ class SwitchConnection: @classmethod def _create_instance_from_data(cls, data): subcls = cls._unmodified_cls._search_subclass(data['_cls']) - return subcls(subcls.connection_alias, **data) + return subcls(cls.connection_alias, **data) @classmethod def _deserialize(cls, data, many=False):
mass_api_client/switch_connection.py
ReplaceText(target='cls' @(37,30)->(37,36))
class SwitchConnection: @classmethod def _create_instance_from_data(cls, data): subcls = cls._unmodified_cls._search_subclass(data['_cls']) return subcls(subcls.connection_alias, **data) @classmethod def _deserialize(cls, data, many=False):
class SwitchConnection: @classmethod def _create_instance_from_data(cls, data): subcls = cls._unmodified_cls._search_subclass(data['_cls']) return subcls(cls.connection_alias, **data) @classmethod def _deserialize(cls, data, many=False):
1,154
https://:@github.com/pwitab/dlms-cosem.git
6d5eec88b05e0020b437aa13f11f5f807334356a
@@ -81,4 +81,4 @@ class DlmsUdpMessage: raise ValueError(( f'Length of data in UDP message ({body_length}) does not match ' f'the length parameter in the UDP Wrapper Header ({length})')) - return cls(source_wport, destination_wport, in_data, version) + return cls(source_wport, destination_wport, body, version)
dlms_cosem/wrappers.py
ReplaceText(target='body' @(84,52)->(84,59))
class DlmsUdpMessage: raise ValueError(( f'Length of data in UDP message ({body_length}) does not match ' f'the length parameter in the UDP Wrapper Header ({length})')) return cls(source_wport, destination_wport, in_data, version)
class DlmsUdpMessage: raise ValueError(( f'Length of data in UDP message ({body_length}) does not match ' f'the length parameter in the UDP Wrapper Header ({length})')) return cls(source_wport, destination_wport, body, version)
1,155
https://:@github.com/Heiss/connexion-plus.git
df1489bdff879ba6cee2ea7456d503c55e545599
@@ -26,7 +26,7 @@ class MultipleResourceResolver(RestyResolver): for s in split: # find the parameter, where a variable was defined to exlude it in resource_name pattern = re.compile(r"\{[a-zA-Z-_]+\}") - if not s and pattern.search(s) is None: + if s and pattern.search(s) is None: resource_name += s.title() if x_router_controller:
connexion_plus/MultipleResourceResolver.py
ReplaceText(target='' @(29,19)->(29,23))
class MultipleResourceResolver(RestyResolver): for s in split: # find the parameter, where a variable was defined to exlude it in resource_name pattern = re.compile(r"\{[a-zA-Z-_]+\}") if not s and pattern.search(s) is None: resource_name += s.title() if x_router_controller:
class MultipleResourceResolver(RestyResolver): for s in split: # find the parameter, where a variable was defined to exlude it in resource_name pattern = re.compile(r"\{[a-zA-Z-_]+\}") if s and pattern.search(s) is None: resource_name += s.title() if x_router_controller:
1,156
https://:@github.com/kgaughan/imageproxy.git
bfab82a641baf3ecfe4f616a9acad6b05178ff41
@@ -79,7 +79,7 @@ def is_subpath(base, path, sep=os.path.sep): """ Check if the given path is a proper subpath of a base path. """ - if path.startswith(path): + if path.startswith(base): trailing = base[len(base):] return trailing == '' or trailing[0] == sep return False
imageproxy.py
ReplaceText(target='base' @(82,23)->(82,27))
def is_subpath(base, path, sep=os.path.sep): """ Check if the given path is a proper subpath of a base path. """ if path.startswith(path): trailing = base[len(base):] return trailing == '' or trailing[0] == sep return False
def is_subpath(base, path, sep=os.path.sep): """ Check if the given path is a proper subpath of a base path. """ if path.startswith(base): trailing = base[len(base):] return trailing == '' or trailing[0] == sep return False
1,157
https://:@github.com/johnlees/glmnet_python.git
c9b08ed3713f2448017bc041e78324add75196b7
@@ -117,7 +117,7 @@ def plotCoef(beta, norm, lambdau, df, dev, label, xvar, xlab, ylab, **options): ax2.xaxis.tick_top() xlim1 = ax1.get_xlim() - ylim1 = ax2.get_ylim() + ylim1 = ax1.get_ylim() atdf = ax1.get_xticks() indat = scipy.ones(atdf.shape, dtype = scipy.integer)
lib/glmnetPlot.py
ReplaceText(target='ax1' @(120,12)->(120,15))
def plotCoef(beta, norm, lambdau, df, dev, label, xvar, xlab, ylab, **options): ax2.xaxis.tick_top() xlim1 = ax1.get_xlim() ylim1 = ax2.get_ylim() atdf = ax1.get_xticks() indat = scipy.ones(atdf.shape, dtype = scipy.integer)
def plotCoef(beta, norm, lambdau, df, dev, label, xvar, xlab, ylab, **options): ax2.xaxis.tick_top() xlim1 = ax1.get_xlim() ylim1 = ax1.get_ylim() atdf = ax1.get_xticks() indat = scipy.ones(atdf.shape, dtype = scipy.integer)
1,158
https://:@github.com/matheusmoreira/multihash.py.git
57a6c7b3f6fb79e72fac08e39d32202cfd7b5b35
@@ -24,7 +24,7 @@ class LengthMismatchError(Exception): def __init__(self, multihash_length: int, digest_length: int) -> None: template = "length from data ({}) and metadata ({}) don't match" - super().__init__(template.format(multihash_length, digest_length)) + super().__init__(template.format(digest_length, multihash_length)) self.multihash_length = multihash_length self.digest_length = digest_length
multihash/__init__.py
ArgSwap(idxs=0<->1 @(27,25)->(27,40))
class LengthMismatchError(Exception): def __init__(self, multihash_length: int, digest_length: int) -> None: template = "length from data ({}) and metadata ({}) don't match" super().__init__(template.format(multihash_length, digest_length)) self.multihash_length = multihash_length self.digest_length = digest_length
class LengthMismatchError(Exception): def __init__(self, multihash_length: int, digest_length: int) -> None: template = "length from data ({}) and metadata ({}) don't match" super().__init__(template.format(digest_length, multihash_length)) self.multihash_length = multihash_length self.digest_length = digest_length
1,159
https://:@github.com/pytest-buildkite/pipefish.git
4ba4918fbd000b6c8f8c7d266d79b0e09b85dd11
@@ -39,7 +39,7 @@ def read_version(): for line in fobj: mobj = regex.match(line) if mobj: - return regex.group(1) + return mobj.group(1) raise Exception('Failed to read version')
app/setup.py
ReplaceText(target='mobj' @(42,23)->(42,28))
def read_version(): for line in fobj: mobj = regex.match(line) if mobj: return regex.group(1) raise Exception('Failed to read version')
def read_version(): for line in fobj: mobj = regex.match(line) if mobj: return mobj.group(1) raise Exception('Failed to read version')
1,160
https://:@github.com/kmarilleau/pytest-django-model.git
31fa2011c76bd1581d24bef19f422cebf644b03d
@@ -237,7 +237,7 @@ class ModelGenerator: # Ignore Special Methods. or is_dunder(attr) # Ignore Functions. - or inspect.isfunction(attr) + or inspect.isfunction(value) # Ignore Django Model Attributes. or attr in ("objects", "id", "_meta") # Ignore Fields.
pytest_django_model/objects.py
ReplaceText(target='value' @(240,34)->(240,38))
class ModelGenerator: # Ignore Special Methods. or is_dunder(attr) # Ignore Functions. or inspect.isfunction(attr) # Ignore Django Model Attributes. or attr in ("objects", "id", "_meta") # Ignore Fields.
class ModelGenerator: # Ignore Special Methods. or is_dunder(attr) # Ignore Functions. or inspect.isfunction(value) # Ignore Django Model Attributes. or attr in ("objects", "id", "_meta") # Ignore Fields.
1,161
https://:@github.com/innolitics/hdat.git
536b4c0b60a57b2a0d7aa95bf3a8e0a484a2a0c2
@@ -31,7 +31,7 @@ class Archive: results_sorted = sorted(results, key=lambda r: r['ran_on']) - return results + return results_sorted def insert(self, result): suite_id = result['suite_id']
store.py
ReplaceText(target='results_sorted' @(34,15)->(34,22))
class Archive: results_sorted = sorted(results, key=lambda r: r['ran_on']) return results def insert(self, result): suite_id = result['suite_id']
class Archive: results_sorted = sorted(results, key=lambda r: r['ran_on']) return results_sorted def insert(self, result): suite_id = result['suite_id']
1,162
https://:@github.com/innolitics/hdat.git
37beec7e4e98b5787f87cb083d512c872a9a2ae6
@@ -26,7 +26,7 @@ def main(): golden_store_location = os.path.join(repo_directory, 'golden_results') golden_store = GoldenStore(golden_store_location) - suites = collect_suites(cwd) + suites = collect_suites(repo_directory) hdat_cli(sys.argv[1:], suites, golden_store, archive, git_info)
hdat/main.py
ReplaceText(target='repo_directory' @(29,32)->(29,35))
def main(): golden_store_location = os.path.join(repo_directory, 'golden_results') golden_store = GoldenStore(golden_store_location) suites = collect_suites(cwd) hdat_cli(sys.argv[1:], suites, golden_store, archive, git_info)
def main(): golden_store_location = os.path.join(repo_directory, 'golden_results') golden_store = GoldenStore(golden_store_location) suites = collect_suites(repo_directory) hdat_cli(sys.argv[1:], suites, golden_store, archive, git_info)
1,163
https://:@github.com/innolitics/hdat.git
1756c0c9966de2746b1775521771d820004ae859
@@ -26,7 +26,7 @@ def main(): golden_store_location = os.path.join(repo_directory, 'golden_results') golden_store = GoldenStore(golden_store_location) - suites = collect_suites(cwd) + suites = collect_suites(repo_directory) hdat_cli(sys.argv[1:], suites, golden_store, archive, git_info)
hdat/main.py
ReplaceText(target='repo_directory' @(29,32)->(29,35))
def main(): golden_store_location = os.path.join(repo_directory, 'golden_results') golden_store = GoldenStore(golden_store_location) suites = collect_suites(cwd) hdat_cli(sys.argv[1:], suites, golden_store, archive, git_info)
def main(): golden_store_location = os.path.join(repo_directory, 'golden_results') golden_store = GoldenStore(golden_store_location) suites = collect_suites(repo_directory) hdat_cli(sys.argv[1:], suites, golden_store, archive, git_info)
1,164
https://:@github.com/reversefold/celery.git
e16932c6b10a0c3fa1b8eda202d857b7e8157f4a
@@ -71,7 +71,7 @@ def _get(name, default=None, compat=None): compat = [name] + compat for i, alias in enumerate(compat): try: - value = getattr(settings, name) + value = getattr(settings, alias) i > 0 and warnings.warn(DeprecationWarning(_DEPRECATION_FMT % ( alias, name))) return value
celery/conf.py
ReplaceText(target='alias' @(74,38)->(74,42))
def _get(name, default=None, compat=None): compat = [name] + compat for i, alias in enumerate(compat): try: value = getattr(settings, name) i > 0 and warnings.warn(DeprecationWarning(_DEPRECATION_FMT % ( alias, name))) return value
def _get(name, default=None, compat=None): compat = [name] + compat for i, alias in enumerate(compat): try: value = getattr(settings, alias) i > 0 and warnings.warn(DeprecationWarning(_DEPRECATION_FMT % ( alias, name))) return value
1,165
https://:@github.com/reversefold/celery.git
b0f42919f173005265e9880d30d166db734ff9c7
@@ -43,7 +43,7 @@ class Router(object): route = self.lookup_route(task, args, kwargs) if route: # Also expand "queue" keys in route. - return merge(options, self.expand_destination(route)) + return merge(self.expand_destination(route), options) return options def expand_destination(self, route):
celery/routes.py
ArgSwap(idxs=0<->1 @(46,23)->(46,28))
class Router(object): route = self.lookup_route(task, args, kwargs) if route: # Also expand "queue" keys in route. return merge(options, self.expand_destination(route)) return options def expand_destination(self, route):
class Router(object): route = self.lookup_route(task, args, kwargs) if route: # Also expand "queue" keys in route. return merge(self.expand_destination(route), options) return options def expand_destination(self, route):
1,166
https://:@github.com/reversefold/celery.git
d47ae1389c4cb679a13057e24c82ede7581b4ab1
@@ -155,7 +155,7 @@ class Namespace(object): return self.close(parent) self.state = CLOSE - self.restart(parent, what, 'terminate' if terminate else 'stop') + self.restart(parent, 'terminate' if terminate else 'stop', what) if self.on_stopped: self.on_stopped()
celery/bootsteps.py
ArgSwap(idxs=1<->2 @(158,8)->(158,20))
class Namespace(object): return self.close(parent) self.state = CLOSE self.restart(parent, what, 'terminate' if terminate else 'stop') if self.on_stopped: self.on_stopped()
class Namespace(object): return self.close(parent) self.state = CLOSE self.restart(parent, 'terminate' if terminate else 'stop', what) if self.on_stopped: self.on_stopped()
1,167
https://:@github.com/reversefold/celery.git
551546ceaecb5afdf3a848604faa57117e0a2c1a
@@ -182,7 +182,7 @@ class test_Tasks(AppCase): tasks = Tasks(c) self.assertIsNone(c.task_consumer) self.assertIsNone(c.qos) - self.assertEqual(tasks.initial_prefetch_count, 2) + self.assertEqual(c.initial_prefetch_count, 2) c.task_consumer = Mock() tasks.stop(c)
celery/tests/worker/test_consumer.py
ReplaceText(target='c' @(185,25)->(185,30))
class test_Tasks(AppCase): tasks = Tasks(c) self.assertIsNone(c.task_consumer) self.assertIsNone(c.qos) self.assertEqual(tasks.initial_prefetch_count, 2) c.task_consumer = Mock() tasks.stop(c)
class test_Tasks(AppCase): tasks = Tasks(c) self.assertIsNone(c.task_consumer) self.assertIsNone(c.qos) self.assertEqual(c.initial_prefetch_count, 2) c.task_consumer = Mock() tasks.stop(c)
1,168
https://:@github.com/reversefold/celery.git
1ac10f3b8f2bc0a21b7e418ee6c967df614bd106
@@ -91,7 +91,7 @@ class RiakBackend(KeyValueStoreBackend): self.host = uhost or config.get('host', self.host) self.port = int(uport or config.get('port', self.port)) self.bucket_name = ubucket or config.get('bucket', self.bucket_name) - self.protocol = uprot or config.get('protocol', self.protocol) + self.protocol = protocol or config.get('protocol', self.protocol) # riak bucket must be ascii letters or numbers only if not Validators.validate_riak_bucket_name(self.bucket_name):
celery/backends/riak.py
ReplaceText(target='protocol' @(94,24)->(94,29))
class RiakBackend(KeyValueStoreBackend): self.host = uhost or config.get('host', self.host) self.port = int(uport or config.get('port', self.port)) self.bucket_name = ubucket or config.get('bucket', self.bucket_name) self.protocol = uprot or config.get('protocol', self.protocol) # riak bucket must be ascii letters or numbers only if not Validators.validate_riak_bucket_name(self.bucket_name):
class RiakBackend(KeyValueStoreBackend): self.host = uhost or config.get('host', self.host) self.port = int(uport or config.get('port', self.port)) self.bucket_name = ubucket or config.get('bucket', self.bucket_name) self.protocol = protocol or config.get('protocol', self.protocol) # riak bucket must be ascii letters or numbers only if not Validators.validate_riak_bucket_name(self.bucket_name):
1,169
https://:@github.com/reversefold/celery.git
51592a86a35998d40098db72524ba70299c5c489
@@ -273,7 +273,7 @@ class Celery(object): if not module_name: if silent: return False - raise ImproperlyConfigured(ERR_ENVVAR_NOT_SET.format(module_name)) + raise ImproperlyConfigured(ERR_ENVVAR_NOT_SET.format(variable_name)) return self.config_from_object(module_name, silent=silent, force=force) def config_from_cmdline(self, argv, namespace='celery'):
celery/app/base.py
ReplaceText(target='variable_name' @(276,65)->(276,76))
class Celery(object): if not module_name: if silent: return False raise ImproperlyConfigured(ERR_ENVVAR_NOT_SET.format(module_name)) return self.config_from_object(module_name, silent=silent, force=force) def config_from_cmdline(self, argv, namespace='celery'):
class Celery(object): if not module_name: if silent: return False raise ImproperlyConfigured(ERR_ENVVAR_NOT_SET.format(variable_name)) return self.config_from_object(module_name, silent=silent, force=force) def config_from_cmdline(self, argv, namespace='celery'):
1,170
https://:@github.com/reversefold/celery.git
d5029501ab762c4fb6b7baab7af4ecf96b106fbe
@@ -174,7 +174,7 @@ def create_module(name, attrs, cls_attrs=None, pkg=None, attr_name: (prepare_attr(attr) if prepare_attr else attr) for attr_name, attr in items(attrs) } - module = sys.modules[fqdn] = type(modname, (base, ), cls_attrs)(fqdn) + module = sys.modules[fqdn] = type(modname, (base, ), cls_attrs)(name) module.__dict__.update(attrs) return module
celery/five.py
ReplaceText(target='name' @(177,68)->(177,72))
def create_module(name, attrs, cls_attrs=None, pkg=None, attr_name: (prepare_attr(attr) if prepare_attr else attr) for attr_name, attr in items(attrs) } module = sys.modules[fqdn] = type(modname, (base, ), cls_attrs)(fqdn) module.__dict__.update(attrs) return module
def create_module(name, attrs, cls_attrs=None, pkg=None, attr_name: (prepare_attr(attr) if prepare_attr else attr) for attr_name, attr in items(attrs) } module = sys.modules[fqdn] = type(modname, (base, ), cls_attrs)(name) module.__dict__.update(attrs) return module
1,171
https://:@github.com/reversefold/celery.git
86e7eed314a167ec0f2fa377f36f0f373a334d77
@@ -303,7 +303,7 @@ class Request(object): task_ready(self) if soft: warn('Soft time limit (%ss) exceeded for %s[%s]', - soft, self.name, self.id) + timeout, self.name, self.id) exc = SoftTimeLimitExceeded(soft) else: error('Hard time limit (%ss) exceeded for %s[%s]',
celery/worker/request.py
ReplaceText(target='timeout' @(306,17)->(306,21))
class Request(object): task_ready(self) if soft: warn('Soft time limit (%ss) exceeded for %s[%s]', soft, self.name, self.id) exc = SoftTimeLimitExceeded(soft) else: error('Hard time limit (%ss) exceeded for %s[%s]',
class Request(object): task_ready(self) if soft: warn('Soft time limit (%ss) exceeded for %s[%s]', timeout, self.name, self.id) exc = SoftTimeLimitExceeded(soft) else: error('Hard time limit (%ss) exceeded for %s[%s]',
1,172
https://:@gitlab.com/elad.noor/optslope.git
c810fd18febb83e0212b5a5404dcc82758322541
@@ -79,7 +79,7 @@ def create_extended_core_model( for ki in knockins: add_cytoplasmic_reaction(model, ki, 0, 1000) - if knockins is not None: + if carbon_sources is not None: for cs in carbon_sources: add_metabolite_exchange(model, cs)
optslope/models.py
ReplaceText(target='carbon_sources' @(82,7)->(82,15))
def create_extended_core_model( for ki in knockins: add_cytoplasmic_reaction(model, ki, 0, 1000) if knockins is not None: for cs in carbon_sources: add_metabolite_exchange(model, cs)
def create_extended_core_model( for ki in knockins: add_cytoplasmic_reaction(model, ki, 0, 1000) if carbon_sources is not None: for cs in carbon_sources: add_metabolite_exchange(model, cs)
1,173
https://:@github.com/jamesjiang52/Bitwise.git
796301ae466d418612c6ac291ea9838d7a51ce70
@@ -7,7 +7,7 @@ class TestTristateBuffer: switch = bw.wire.Wire() output = bw.wire.Wire() - bw.wire.TristateBuffer(input_1, switch, output) + bw.wire.TristateBuffer(switch, input_1, output) switch.value = 0 input_1.value = 0
tests/wire/test_TristateBuffer.py
ArgSwap(idxs=0<->1 @(10,8)->(10,30))
class TestTristateBuffer: switch = bw.wire.Wire() output = bw.wire.Wire() bw.wire.TristateBuffer(input_1, switch, output) switch.value = 0 input_1.value = 0
class TestTristateBuffer: switch = bw.wire.Wire() output = bw.wire.Wire() bw.wire.TristateBuffer(switch, input_1, output) switch.value = 0 input_1.value = 0
1,174
https://:@github.com/jamesjiang52/Bitwise.git
e7fb994abf6b7e9d85cf5b8f3d2b199a717d281b
@@ -82,7 +82,7 @@ class FullAdder: self.carry_in = carry_in self.a = a - self.b = a + self.b = b self.carry_out = carry_out self.sum = sum
bitwise/arithmetic/ADD.py
ReplaceText(target='b' @(85,17)->(85,18))
class FullAdder: self.carry_in = carry_in self.a = a self.b = a self.carry_out = carry_out self.sum = sum
class FullAdder: self.carry_in = carry_in self.a = a self.b = b self.carry_out = carry_out self.sum = sum
1,175
https://:@github.com/sethmurphy/BrubeckOAuth.git
62f218940e723171c3d32115389d3c07c86effb5
@@ -269,7 +269,7 @@ class OAuthMixin(object): initial_args = json.loads(self.oauth_request_model.initial_request_args) self.message.arguments.update(initial_args) logging.debug('Merged arguments: %s' % json.dumps(self.message.arguments)); - if self.oauth_error != None and self.oauth_token != None or self.state != None: + if self.oauth_error == None and self.oauth_token != None or self.state != None: self._oauth_request_model = oauth_object.callback( provider_settings, self.oauth_request_model,
brubeckoauth/handlers.py
ReplaceText(target='==' @(272,36)->(272,38))
class OAuthMixin(object): initial_args = json.loads(self.oauth_request_model.initial_request_args) self.message.arguments.update(initial_args) logging.debug('Merged arguments: %s' % json.dumps(self.message.arguments)); if self.oauth_error != None and self.oauth_token != None or self.state != None: self._oauth_request_model = oauth_object.callback( provider_settings, self.oauth_request_model,
class OAuthMixin(object): initial_args = json.loads(self.oauth_request_model.initial_request_args) self.message.arguments.update(initial_args) logging.debug('Merged arguments: %s' % json.dumps(self.message.arguments)); if self.oauth_error == None and self.oauth_token != None or self.state != None: self._oauth_request_model = oauth_object.callback( provider_settings, self.oauth_request_model,
1,176
https://:@bitbucket.org/mosaik/mosaik-pypower.git
d05f00ae723c45cccabf1ffc75317f96f74176c5
@@ -185,7 +185,7 @@ def _get_branches(loader, raw_case, entity_map, grid_idx): tbus = make_eid(tbus, grid_idx) assert fbus in entity_map, fbus - assert tbus in entity_map, fbus + assert tbus in entity_map, tbus f_idx = entity_map[fbus]['idx'] t_idx = entity_map[tbus]['idx']
mosaik_pypower/model.py
ReplaceText(target='tbus' @(188,35)->(188,39))
def _get_branches(loader, raw_case, entity_map, grid_idx): tbus = make_eid(tbus, grid_idx) assert fbus in entity_map, fbus assert tbus in entity_map, fbus f_idx = entity_map[fbus]['idx'] t_idx = entity_map[tbus]['idx']
def _get_branches(loader, raw_case, entity_map, grid_idx): tbus = make_eid(tbus, grid_idx) assert fbus in entity_map, fbus assert tbus in entity_map, tbus f_idx = entity_map[fbus]['idx'] t_idx = entity_map[tbus]['idx']
1,177
https://:@bitbucket.org/mosaik/mosaik-pypower.git
8440caae0cc2ac9f18087171866abcf2ee1783b6
@@ -131,7 +131,7 @@ def get_cache_entries(cases, entity_map): # Use side with higher voltage to calculate I if fbus_v >= tbus_v: ir = branch[idx_brch.PF] / fbus_v - ii = branch[idx_brch.QF] / tbus_v + ii = branch[idx_brch.QF] / fbus_v else: ir = branch[idx_brch.PT] / tbus_v ii = branch[idx_brch.QT] / tbus_v
mosaik_pypower/model.py
ReplaceText(target='fbus_v' @(134,51)->(134,57))
def get_cache_entries(cases, entity_map): # Use side with higher voltage to calculate I if fbus_v >= tbus_v: ir = branch[idx_brch.PF] / fbus_v ii = branch[idx_brch.QF] / tbus_v else: ir = branch[idx_brch.PT] / tbus_v ii = branch[idx_brch.QT] / tbus_v
def get_cache_entries(cases, entity_map): # Use side with higher voltage to calculate I if fbus_v >= tbus_v: ir = branch[idx_brch.PF] / fbus_v ii = branch[idx_brch.QF] / fbus_v else: ir = branch[idx_brch.PT] / tbus_v ii = branch[idx_brch.QT] / tbus_v
1,178
https://:@github.com/moble/sxs.git
4b224cf7771980d6817413d8d218858ea972a94e
@@ -34,7 +34,7 @@ def test_xmb_format(): with tempfile.TemporaryDirectory() as temp_dir: file = pathlib.Path(temp_dir) / 'horizons.h5' - sxs.horizons.xor_multishuffle_bzip2.save(file, horizons_spec) + sxs.horizons.xor_multishuffle_bzip2.save(horizons_spec, file) with pytest.raises(ValueError): horizons_error = sxs.horizons.spec_horizons_h5.load(file) horizons_xmb = sxs.horizons.xor_multishuffle_bzip2.load(file)
tests/test_horizons.py
ArgSwap(idxs=0<->1 @(37,8)->(37,48))
def test_xmb_format(): with tempfile.TemporaryDirectory() as temp_dir: file = pathlib.Path(temp_dir) / 'horizons.h5' sxs.horizons.xor_multishuffle_bzip2.save(file, horizons_spec) with pytest.raises(ValueError): horizons_error = sxs.horizons.spec_horizons_h5.load(file) horizons_xmb = sxs.horizons.xor_multishuffle_bzip2.load(file)
def test_xmb_format(): with tempfile.TemporaryDirectory() as temp_dir: file = pathlib.Path(temp_dir) / 'horizons.h5' sxs.horizons.xor_multishuffle_bzip2.save(horizons_spec, file) with pytest.raises(ValueError): horizons_error = sxs.horizons.spec_horizons_h5.load(file) horizons_xmb = sxs.horizons.xor_multishuffle_bzip2.load(file)
1,179
https://:@github.com/inkenbrandt/loggerloader.git
4a64ce022708c6e5c93124cf250d59bded529624
@@ -80,7 +80,7 @@ def fix_drift(well, manualfile, meas='Level', manmeas='MeasuredDTW', outcolname= wellbarofixed.set_index(dtnm, inplace=True) drift_info = pd.DataFrame(drift_features).T - return wellbarofixed, drift_info + return wellbarofixed, drift def correct_be(site_number, well_table, welldata, be = None, meas = 'corrwl', baro = 'barometer'):
loggerloader/data_fixers.py
ReplaceText(target='drift' @(83,26)->(83,36))
def fix_drift(well, manualfile, meas='Level', manmeas='MeasuredDTW', outcolname= wellbarofixed.set_index(dtnm, inplace=True) drift_info = pd.DataFrame(drift_features).T return wellbarofixed, drift_info def correct_be(site_number, well_table, welldata, be = None, meas = 'corrwl', baro = 'barometer'):
def fix_drift(well, manualfile, meas='Level', manmeas='MeasuredDTW', outcolname= wellbarofixed.set_index(dtnm, inplace=True) drift_info = pd.DataFrame(drift_features).T return wellbarofixed, drift def correct_be(site_number, well_table, welldata, be = None, meas = 'corrwl', baro = 'barometer'):
1,180
https://:@gitlab.com/Plasticity/supersqlite.git
e6dbaa2a00df2020b62ce72329b5b294762c23a4
@@ -119,7 +119,7 @@ def get_modules(THIRD_PARTY, INTERNAL, PROJ_PATH, else: libraries.append(ICU_UNIX) includes.append(ICU_UNIX) - link_args.append('-L' + ICU_WIN32) + link_args.append('-L' + ICU_UNIX) SQLITE_PRE = os.path.relpath( os.path.join(SQLITE3, 'sqlite3.c.pre.c'), PROJ_PATH)
setup.py
ReplaceText(target='ICU_UNIX' @(122,32)->(122,41))
def get_modules(THIRD_PARTY, INTERNAL, PROJ_PATH, else: libraries.append(ICU_UNIX) includes.append(ICU_UNIX) link_args.append('-L' + ICU_WIN32) SQLITE_PRE = os.path.relpath( os.path.join(SQLITE3, 'sqlite3.c.pre.c'), PROJ_PATH)
def get_modules(THIRD_PARTY, INTERNAL, PROJ_PATH, else: libraries.append(ICU_UNIX) includes.append(ICU_UNIX) link_args.append('-L' + ICU_UNIX) SQLITE_PRE = os.path.relpath( os.path.join(SQLITE3, 'sqlite3.c.pre.c'), PROJ_PATH)
1,181
https://:@github.com/jboes/decaf-espresso.git
807549a48404ee3028f5935b8ddfa665378add29
@@ -384,7 +384,7 @@ class SiteConfig(): state = subprocess.call(command, stdout=f) if state != 0: - if grepy(outfile, 'JOB DONE.'): + if grepy('JOB DONE.', outfile): pass else: raise RuntimeError(
espresso/siteconfig.py
ArgSwap(idxs=0<->1 @(387,15)->(387,20))
class SiteConfig(): state = subprocess.call(command, stdout=f) if state != 0: if grepy(outfile, 'JOB DONE.'): pass else: raise RuntimeError(
class SiteConfig(): state = subprocess.call(command, stdout=f) if state != 0: if grepy('JOB DONE.', outfile): pass else: raise RuntimeError(
1,182
https://:@github.com/Aareon/rtv.git
3e6b7c98d529668d5cab946485bd7c3be843574c
@@ -126,7 +126,7 @@ class SubredditPage(BasePage): return # Open the submission window - submission_info = SUBMISSION_FILE.format(name=sub, content='') + submission_info = SUBMISSION_FILE.format(name=subreddit, content='') curses.endwin() submission_text = open_editor(submission_info) curses.doupdate()
rtv/subreddit.py
ReplaceText(target='subreddit' @(129,54)->(129,57))
class SubredditPage(BasePage): return # Open the submission window submission_info = SUBMISSION_FILE.format(name=sub, content='') curses.endwin() submission_text = open_editor(submission_info) curses.doupdate()
class SubredditPage(BasePage): return # Open the submission window submission_info = SUBMISSION_FILE.format(name=subreddit, content='') curses.endwin() submission_text = open_editor(submission_info) curses.doupdate()
1,183
https://:@github.com/Aareon/rtv.git
f5dab8dd560dc319cf23724653de376bdc850e10
@@ -813,7 +813,7 @@ class Terminal(object): # Prune empty lines at the bottom of the textbox. for item in stack[::-1]: - if item: + if not item: stack.pop() else: break
rtv/terminal.py
ReplaceText(target='not ' @(816,15)->(816,15))
class Terminal(object): # Prune empty lines at the bottom of the textbox. for item in stack[::-1]: if item: stack.pop() else: break
class Terminal(object): # Prune empty lines at the bottom of the textbox. for item in stack[::-1]: if not item: stack.pop() else: break
1,184
https://:@github.com/kgdunn/process_improve.git
098e24ca8653f3b94be6f8efcc584f149bb9d8db
@@ -143,7 +143,7 @@ def pareto_plot(model, ("Full name", "@full_names"), ("Magnitude and sign", "@original_magnitude_with_sign"), ] - if len(alias_strings) == 0: + if len(alias_strings) != 0: TOOLTIPS.append(("Aliasing", "@alias_strings"),) p = figure(plot_width=plot_width,
process_improve/plotting.py
ReplaceText(target='!=' @(146,26)->(146,28))
def pareto_plot(model, ("Full name", "@full_names"), ("Magnitude and sign", "@original_magnitude_with_sign"), ] if len(alias_strings) == 0: TOOLTIPS.append(("Aliasing", "@alias_strings"),) p = figure(plot_width=plot_width,
def pareto_plot(model, ("Full name", "@full_names"), ("Magnitude and sign", "@original_magnitude_with_sign"), ] if len(alias_strings) != 0: TOOLTIPS.append(("Aliasing", "@alias_strings"),) p = figure(plot_width=plot_width,
1,185
https://:@github.com/gforcada/flake8-plone-api.git
dd24cd9846350da8e176296f0c5e51d285c101b6
@@ -35,7 +35,7 @@ class PloneAPIChecker(object): return found next_character_position = found + len(old_approach) + 1 - if next_character_position > len(line): + if next_character_position >= len(line): return found # check that the method is not a substring of another
flake8_plone_api.py
ReplaceText(target='>=' @(38,35)->(38,36))
class PloneAPIChecker(object): return found next_character_position = found + len(old_approach) + 1 if next_character_position > len(line): return found # check that the method is not a substring of another
class PloneAPIChecker(object): return found next_character_position = found + len(old_approach) + 1 if next_character_position >= len(line): return found # check that the method is not a substring of another
1,186
https://:@github.com/prymatex/prymatex.git
1b830e8afa9b956c4a603f2f44c20d7ce87f2fb9
@@ -779,7 +779,7 @@ class PMXSnippet(PMXBundleItem): return hash def __deepcopy__(self, memo): - snippet = PMXSnippet(self.hash, self.namespace) + snippet = PMXSnippet(self.namespace, self.hash) memo["snippet"] = deepcopy(self.snippet, memo) snippet.bundle = self.bundle return snippet
src/prymatex/bundles/snippet.py
ArgSwap(idxs=0<->1 @(782,18)->(782,28))
class PMXSnippet(PMXBundleItem): return hash def __deepcopy__(self, memo): snippet = PMXSnippet(self.hash, self.namespace) memo["snippet"] = deepcopy(self.snippet, memo) snippet.bundle = self.bundle return snippet
class PMXSnippet(PMXBundleItem): return hash def __deepcopy__(self, memo): snippet = PMXSnippet(self.namespace, self.hash) memo["snippet"] = deepcopy(self.snippet, memo) snippet.bundle = self.bundle return snippet
1,187
https://:@github.com/prymatex/prymatex.git
1595b520a888b1d6635d2bb64c99024ef06d0d7e
@@ -43,7 +43,7 @@ class PMXBundleTreeProxyModel(QtGui.QSortFilterProxyModel): return self.sourceModel().node(sIndex) def setFilterNamespace(self, namespace): - if namespace: + if not namespace: self.namespacesFilter = [ "prymatex", "user" ] else: self.namespacesFilter = namespace.split()
prymatex/gui/support/proxies.py
ReplaceText(target='not ' @(46,11)->(46,11))
class PMXBundleTreeProxyModel(QtGui.QSortFilterProxyModel): return self.sourceModel().node(sIndex) def setFilterNamespace(self, namespace): if namespace: self.namespacesFilter = [ "prymatex", "user" ] else: self.namespacesFilter = namespace.split()
class PMXBundleTreeProxyModel(QtGui.QSortFilterProxyModel): return self.sourceModel().node(sIndex) def setFilterNamespace(self, namespace): if not namespace: self.namespacesFilter = [ "prymatex", "user" ] else: self.namespacesFilter = namespace.split()
1,188
https://:@github.com/prymatex/prymatex.git
8bc4aeccf489096d05f1b8fb2a6ad57d75a3f7fd
@@ -359,7 +359,7 @@ class CodeEditor(TextEditWidget, PMXBaseEditor): cls.SCOPES[scopeHash] = CodeEditorScope( name = scopeName, path = scopeStack, - settings = cls.application.supportManager.getPreferenceSettings(scopeName), + settings = cls.application.supportManager.getPreferenceSettings(scopeStack), group = PMXSyntax.findGroup(scopeStack[::-1]) ) return scopeHash
prymatex/gui/codeeditor/editor.py
ReplaceText(target='scopeStack' @(362,80)->(362,89))
class CodeEditor(TextEditWidget, PMXBaseEditor): cls.SCOPES[scopeHash] = CodeEditorScope( name = scopeName, path = scopeStack, settings = cls.application.supportManager.getPreferenceSettings(scopeName), group = PMXSyntax.findGroup(scopeStack[::-1]) ) return scopeHash
class CodeEditor(TextEditWidget, PMXBaseEditor): cls.SCOPES[scopeHash] = CodeEditorScope( name = scopeName, path = scopeStack, settings = cls.application.supportManager.getPreferenceSettings(scopeStack), group = PMXSyntax.findGroup(scopeStack[::-1]) ) return scopeHash
1,189
https://:@github.com/prymatex/prymatex.git
5e2aeb256ab658a0ef392096ae4c6cea383e4fff
@@ -61,7 +61,7 @@ class CodeEditorBlockUserData(QtGui.QTextBlockUserData): def tokenAtPosition(self, pos): for token in self.__tokens[::-1]: - if token.start <= pos <= token.end: + if token.start <= pos < token.end: return token # ------------------- Cache Handle
prymatex/gui/codeeditor/userdata.py
ReplaceText(target='<' @(64,34)->(64,36))
class CodeEditorBlockUserData(QtGui.QTextBlockUserData): def tokenAtPosition(self, pos): for token in self.__tokens[::-1]: if token.start <= pos <= token.end: return token # ------------------- Cache Handle
class CodeEditorBlockUserData(QtGui.QTextBlockUserData): def tokenAtPosition(self, pos): for token in self.__tokens[::-1]: if token.start <= pos < token.end: return token # ------------------- Cache Handle
1,190
https://:@github.com/prymatex/prymatex.git
4aaa53c919b90ec7d094d6861b9c229fd282c26d
@@ -72,7 +72,7 @@ class CodeEditorSyntaxProcessor(CodeEditorBaseProcessor, SyntaxProcessorMixin): self.stacks[user_data.revision] = (self.stack[:], self.scope.clone()) def blockRevision(self, block): - return _revision(block.text() + "\n", self.scope_name, block.previous().userState()) + return _revision(self.scope_name, block.text() + "\n", block.previous().userState()) def testRevision(self, block): return block.userData() is not None and block.userData().revision == self.blockRevision(block)
prymatex/gui/codeeditor/processors/syntax.py
ArgSwap(idxs=0<->1 @(75,15)->(75,24))
class CodeEditorSyntaxProcessor(CodeEditorBaseProcessor, SyntaxProcessorMixin): self.stacks[user_data.revision] = (self.stack[:], self.scope.clone()) def blockRevision(self, block): return _revision(block.text() + "\n", self.scope_name, block.previous().userState()) def testRevision(self, block): return block.userData() is not None and block.userData().revision == self.blockRevision(block)
class CodeEditorSyntaxProcessor(CodeEditorBaseProcessor, SyntaxProcessorMixin): self.stacks[user_data.revision] = (self.stack[:], self.scope.clone()) def blockRevision(self, block): return _revision(self.scope_name, block.text() + "\n", block.previous().userState()) def testRevision(self, block): return block.userData() is not None and block.userData().revision == self.blockRevision(block)
1,191
https://:@github.com/cdeitrick/muller_diagrams.git
fd5e9df63b9a5c558c6d88f646a5003e3d959402
@@ -58,7 +58,7 @@ DF = pandas.DataFrame def workflow(trajectories_filename: Path, goptions:calculate_genotypes.GenotypeOptions) -> Tuple[DF, DF, Any]: trajectory_table, _ = import_trajectory_table(trajectories_filename) - genotype_table = calculate_genotypes.workflow(trajectories_filename, options = goptions) + genotype_table = calculate_genotypes.workflow(trajectory_table, options = goptions) # return trajectory_table, genotype_table cache:List[Tuple[DF, DF]] = [(trajectory_table.copy(), genotype_table.copy())]
muller/genotype_filters.py
ReplaceText(target='trajectory_table' @(61,47)->(61,68))
DF = pandas.DataFrame def workflow(trajectories_filename: Path, goptions:calculate_genotypes.GenotypeOptions) -> Tuple[DF, DF, Any]: trajectory_table, _ = import_trajectory_table(trajectories_filename) genotype_table = calculate_genotypes.workflow(trajectories_filename, options = goptions) # return trajectory_table, genotype_table cache:List[Tuple[DF, DF]] = [(trajectory_table.copy(), genotype_table.copy())]
DF = pandas.DataFrame def workflow(trajectories_filename: Path, goptions:calculate_genotypes.GenotypeOptions) -> Tuple[DF, DF, Any]: trajectory_table, _ = import_trajectory_table(trajectories_filename) genotype_table = calculate_genotypes.workflow(trajectory_table, options = goptions) # return trajectory_table, genotype_table cache:List[Tuple[DF, DF]] = [(trajectory_table.copy(), genotype_table.copy())]
1,192
https://:@github.com/MacKey-255/GoodByeCatpcha.git
39bd93f737d90c82906fdd388a9f8d2e5939bfa5
@@ -64,7 +64,7 @@ class Launcher(launcher.Launcher): def waitForChromeToClose(self): """Terminate chrome.""" - if self.proc.returncode is not None and not self.chromeClosed: + if self.proc.returncode is None and not self.chromeClosed: self.chromeClosed = True if psutil.pid_exists(self.proc.pid): self.proc.terminate()
nonocaptcha/solver.py
ReplaceText(target=' is ' @(67,31)->(67,39))
class Launcher(launcher.Launcher): def waitForChromeToClose(self): """Terminate chrome.""" if self.proc.returncode is not None and not self.chromeClosed: self.chromeClosed = True if psutil.pid_exists(self.proc.pid): self.proc.terminate()
class Launcher(launcher.Launcher): def waitForChromeToClose(self): """Terminate chrome.""" if self.proc.returncode is None and not self.chromeClosed: self.chromeClosed = True if psutil.pid_exists(self.proc.pid): self.proc.terminate()
1,193
https://:@gitlab.com/bz1/peempy.git
7cbb4d659093bab5848fd3796f059e8ae759466f
@@ -54,7 +54,7 @@ def drift(ctx, folder_id, verbose, norm_id, save_xmcd, save_drift, ppath = ctx.obj["ppath"] if norm_id is not None: - normfolder = ppath.basedir + "{}_{}".format(norm_id, folder_suffix) + normfolder = ppath.basedir / "{}_{}".format(norm_id, folder_suffix) norm = get_normalisation(fdname=normfolder, name=norm_name) else: import numpy as np
peempy/cmdline/cmd_batch.py
ReplaceText(target='/' @(57,35)->(57,36))
def drift(ctx, folder_id, verbose, norm_id, save_xmcd, save_drift, ppath = ctx.obj["ppath"] if norm_id is not None: normfolder = ppath.basedir + "{}_{}".format(norm_id, folder_suffix) norm = get_normalisation(fdname=normfolder, name=norm_name) else: import numpy as np
def drift(ctx, folder_id, verbose, norm_id, save_xmcd, save_drift, ppath = ctx.obj["ppath"] if norm_id is not None: normfolder = ppath.basedir / "{}_{}".format(norm_id, folder_suffix) norm = get_normalisation(fdname=normfolder, name=norm_name) else: import numpy as np
1,194
https://:@github.com/termie/farmboy.git
35950d1e384b4ea70d2698544aec6652521a1dc1
@@ -63,7 +63,7 @@ def update(d, path='farmboy.yaml'): doc = {} doc.update(d) - yaml.dump(d, + yaml.dump(doc, stream=open(path, 'w'), default_flow_style=False, indent=2,
farmboy/util.py
ReplaceText(target='doc' @(66,14)->(66,15))
def update(d, path='farmboy.yaml'): doc = {} doc.update(d) yaml.dump(d, stream=open(path, 'w'), default_flow_style=False, indent=2,
def update(d, path='farmboy.yaml'): doc = {} doc.update(d) yaml.dump(doc, stream=open(path, 'w'), default_flow_style=False, indent=2,
1,195
https://:@github.com/Mariocj89/hubsync.git
47076ad24664e140ce104a11a2845395ae40da27
@@ -41,7 +41,7 @@ def zip_pairs(xs, ys, key=lambda x: x): yield None, ys.pop() elif key(xs[-1]) == key(ys[-1]): yield xs.pop(), ys.pop() - elif key(xs[-1]) > key(ys[-1]): + elif key(xs[-1]) < key(ys[-1]): yield xs.pop(), None else: yield None, ys.pop()
hubsync/sync.py
ReplaceText(target='<' @(44,25)->(44,26))
def zip_pairs(xs, ys, key=lambda x: x): yield None, ys.pop() elif key(xs[-1]) == key(ys[-1]): yield xs.pop(), ys.pop() elif key(xs[-1]) > key(ys[-1]): yield xs.pop(), None else: yield None, ys.pop()
def zip_pairs(xs, ys, key=lambda x: x): yield None, ys.pop() elif key(xs[-1]) == key(ys[-1]): yield xs.pop(), ys.pop() elif key(xs[-1]) < key(ys[-1]): yield xs.pop(), None else: yield None, ys.pop()
1,196
https://:@github.com/andrewsanchez/NCBITK.git
233aa289b2674bf0d2880acb45f7b1f832eceee7
@@ -41,7 +41,7 @@ def update(genbank_mirror, genbank_status, path_vars, assembly_summary, species_ curate.create_species_dirs(genbank_mirror, assembly_summary, logger, species_list) local_genomes, new_genomes, old_genomes, sketch_files, missing_sketch_files = genbank_status - curate.remove_old_genomes(genbank_mirror, assembly_summary, local_genomes, logger) + curate.remove_old_genomes(genbank_mirror, assembly_summary, old_genomes, logger) sync.sync_latest_genomes(genbank_mirror, assembly_summary, new_genomes, logger) curate.unzip_genbank_mirror(genbank_mirror) rename.rename(genbank_mirror, assembly_summary)
run.py
ReplaceText(target='old_genomes' @(44,64)->(44,77))
def update(genbank_mirror, genbank_status, path_vars, assembly_summary, species_ curate.create_species_dirs(genbank_mirror, assembly_summary, logger, species_list) local_genomes, new_genomes, old_genomes, sketch_files, missing_sketch_files = genbank_status curate.remove_old_genomes(genbank_mirror, assembly_summary, local_genomes, logger) sync.sync_latest_genomes(genbank_mirror, assembly_summary, new_genomes, logger) curate.unzip_genbank_mirror(genbank_mirror) rename.rename(genbank_mirror, assembly_summary)
def update(genbank_mirror, genbank_status, path_vars, assembly_summary, species_ curate.create_species_dirs(genbank_mirror, assembly_summary, logger, species_list) local_genomes, new_genomes, old_genomes, sketch_files, missing_sketch_files = genbank_status curate.remove_old_genomes(genbank_mirror, assembly_summary, old_genomes, logger) sync.sync_latest_genomes(genbank_mirror, assembly_summary, new_genomes, logger) curate.unzip_genbank_mirror(genbank_mirror) rename.rename(genbank_mirror, assembly_summary)
1,197
https://:@github.com/williamjameshandley/spherical_kde.git
690bedc85f0d7c0fcf419609fbf05f34fe3cd419
@@ -68,7 +68,7 @@ class SphericalKDE(object): "shape as weights ({}!={})".format( len(self.phi), len(self.weights))) - sigmahat = VonMises_std(self.theta, self.phi) + sigmahat = VonMises_std(self.phi, self.theta) self.suggested_bandwidth = 1.06*sigmahat*len(weights)**-0.2 def __call__(self, phi, theta):
spherical_kde/__init__.py
ArgSwap(idxs=0<->1 @(71,19)->(71,31))
class SphericalKDE(object): "shape as weights ({}!={})".format( len(self.phi), len(self.weights))) sigmahat = VonMises_std(self.theta, self.phi) self.suggested_bandwidth = 1.06*sigmahat*len(weights)**-0.2 def __call__(self, phi, theta):
class SphericalKDE(object): "shape as weights ({}!={})".format( len(self.phi), len(self.weights))) sigmahat = VonMises_std(self.phi, self.theta) self.suggested_bandwidth = 1.06*sigmahat*len(weights)**-0.2 def __call__(self, phi, theta):
1,198
https://:@github.com/mmcdermo/pressurize.git
a5373cd338db37c225d15c61e3531fae1dc3b8ef
@@ -33,7 +33,7 @@ class ModelServer(object): self._pipe = pipe self._resources = ModelServer.acquire_resources(config, model_conf, resource_path) self._model_class = ModelServer.import_model(model_conf['path'], source_path) - self._model = self._model_class(self._resources, config=config) + self._model = self._model_class(self._resources, config=model_conf) def run(self): handler = logging.handlers.WatchedFileHandler(
pressurize/model/model_server.py
ReplaceText(target='model_conf' @(36,64)->(36,70))
class ModelServer(object): self._pipe = pipe self._resources = ModelServer.acquire_resources(config, model_conf, resource_path) self._model_class = ModelServer.import_model(model_conf['path'], source_path) self._model = self._model_class(self._resources, config=config) def run(self): handler = logging.handlers.WatchedFileHandler(
class ModelServer(object): self._pipe = pipe self._resources = ModelServer.acquire_resources(config, model_conf, resource_path) self._model_class = ModelServer.import_model(model_conf['path'], source_path) self._model = self._model_class(self._resources, config=model_conf) def run(self): handler = logging.handlers.WatchedFileHandler(
1,199
https://:@github.com/ladybug-tools/dragonfly.git
8c336e3b05084859242d393c51ceab66e56491cf
@@ -929,7 +929,7 @@ class Room2D(_BaseGeometry): seg_1.distance_to_point(seg_2.p2) <= tolerance: # set the boundary conditions of the segments room_1.set_adjacency(room_2, j, k) - adj_info.append(((room_1, k), (room_2, k))) + adj_info.append(((room_1, j), (room_2, k))) break except IndexError: pass # we have reached the end of the list of zones
dragonfly/room2d.py
ReplaceText(target='j' @(932,62)->(932,63))
class Room2D(_BaseGeometry): seg_1.distance_to_point(seg_2.p2) <= tolerance: # set the boundary conditions of the segments room_1.set_adjacency(room_2, j, k) adj_info.append(((room_1, k), (room_2, k))) break except IndexError: pass # we have reached the end of the list of zones
class Room2D(_BaseGeometry): seg_1.distance_to_point(seg_2.p2) <= tolerance: # set the boundary conditions of the segments room_1.set_adjacency(room_2, j, k) adj_info.append(((room_1, j), (room_2, k))) break except IndexError: pass # we have reached the end of the list of zones