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
700
https://:@github.com/MushroomRL/mushroom-rl.git
00f820f10d492257264eb0587aac92193ba65650
@@ -78,7 +78,7 @@ def experiment(n_epochs, n_steps, n_steps_test): n_actions=mdp.info.action_space.n) # Agent - agent = DQN(TorchApproximator, pi, mdp.info, + agent = DQN(mdp.info, pi, TorchApproximator, approximator_params=approximator_params, batch_size=batch_size, n_approximators=1, initial_replay_size=initial_replay_size, max_replay_size=max_replay_size,
examples/acrobot_dqn.py
ArgSwap(idxs=0<->2 @(81,12)->(81,15))
def experiment(n_epochs, n_steps, n_steps_test): n_actions=mdp.info.action_space.n) # Agent agent = DQN(TorchApproximator, pi, mdp.info, approximator_params=approximator_params, batch_size=batch_size, n_approximators=1, initial_replay_size=initial_replay_size, max_replay_size=max_replay_size,
def experiment(n_epochs, n_steps, n_steps_test): n_actions=mdp.info.action_space.n) # Agent agent = DQN(mdp.info, pi, TorchApproximator, approximator_params=approximator_params, batch_size=batch_size, n_approximators=1, initial_replay_size=initial_replay_size, max_replay_size=max_replay_size,
701
https://:@github.com/MushroomRL/mushroom-rl.git
00f820f10d492257264eb0587aac92193ba65650
@@ -37,7 +37,7 @@ def experiment(): # Agent algorithm_params = dict(n_iterations=20) - agent = FQI(approximator, pi, mdp.info, + agent = FQI(mdp.info, pi, approximator, approximator_params=approximator_params, **algorithm_params) # Algorithm
examples/car_on_hill_fqi.py
ArgSwap(idxs=0<->2 @(40,12)->(40,15))
def experiment(): # Agent algorithm_params = dict(n_iterations=20) agent = FQI(approximator, pi, mdp.info, approximator_params=approximator_params, **algorithm_params) # Algorithm
def experiment(): # Agent algorithm_params = dict(n_iterations=20) agent = FQI(mdp.info, pi, approximator, approximator_params=approximator_params, **algorithm_params) # Algorithm
702
https://:@github.com/MushroomRL/mushroom-rl.git
00f820f10d492257264eb0587aac92193ba65650
@@ -33,7 +33,7 @@ def experiment(algorithm_class, exp): # Agent learning_rate = ExponentialParameter(value=1., exp=exp, size=mdp.info.size) algorithm_params = dict(learning_rate=learning_rate) - agent = algorithm_class(pi, mdp.info, **algorithm_params) + agent = algorithm_class(mdp.info, pi, **algorithm_params) # Algorithm collect_Q = CollectQ(agent.approximator)
examples/double_chain_q_learning/double_chain.py
ArgSwap(idxs=0<->1 @(36,12)->(36,27))
def experiment(algorithm_class, exp): # Agent learning_rate = ExponentialParameter(value=1., exp=exp, size=mdp.info.size) algorithm_params = dict(learning_rate=learning_rate) agent = algorithm_class(pi, mdp.info, **algorithm_params) # Algorithm collect_Q = CollectQ(agent.approximator)
def experiment(algorithm_class, exp): # Agent learning_rate = ExponentialParameter(value=1., exp=exp, size=mdp.info.size) algorithm_params = dict(learning_rate=learning_rate) agent = algorithm_class(mdp.info, pi, **algorithm_params) # Algorithm collect_Q = CollectQ(agent.approximator)
703
https://:@github.com/MushroomRL/mushroom-rl.git
00f820f10d492257264eb0587aac92193ba65650
@@ -38,7 +38,7 @@ def experiment(algorithm_class, exp): # Agent learning_rate = ExponentialParameter(value=1, exp=exp, size=mdp.info.size) algorithm_params = dict(learning_rate=learning_rate) - agent = algorithm_class(pi, mdp.info, **algorithm_params) + agent = algorithm_class(mdp.info, pi, **algorithm_params) # Algorithm start = mdp.convert_to_int(mdp._start, mdp._width)
examples/grid_world_td.py
ArgSwap(idxs=0<->1 @(41,12)->(41,27))
def experiment(algorithm_class, exp): # Agent learning_rate = ExponentialParameter(value=1, exp=exp, size=mdp.info.size) algorithm_params = dict(learning_rate=learning_rate) agent = algorithm_class(pi, mdp.info, **algorithm_params) # Algorithm start = mdp.convert_to_int(mdp._start, mdp._width)
def experiment(algorithm_class, exp): # Agent learning_rate = ExponentialParameter(value=1, exp=exp, size=mdp.info.size) algorithm_params = dict(learning_rate=learning_rate) agent = algorithm_class(mdp.info, pi, **algorithm_params) # Algorithm start = mdp.convert_to_int(mdp._start, mdp._width)
704
https://:@github.com/MushroomRL/mushroom-rl.git
3644c74bf5069331dfd80f1b65e281460fefab21
@@ -191,7 +191,7 @@ class TRPO(Agent): new_loss = self._compute_loss(obs, act, adv, old_log_prob) kl = self._compute_kl(obs, old_pol_dist) improve = new_loss - prev_loss - if kl <= self._max_kl * 1.5 or improve >= 0: + if kl <= self._max_kl * 1.5 and improve >= 0: violation = False break stepsize *= .5
mushroom_rl/algorithms/actor_critic/deep_actor_critic/trpo.py
ReplaceText(target='and' @(194,40)->(194,42))
class TRPO(Agent): new_loss = self._compute_loss(obs, act, adv, old_log_prob) kl = self._compute_kl(obs, old_pol_dist) improve = new_loss - prev_loss if kl <= self._max_kl * 1.5 or improve >= 0: violation = False break stepsize *= .5
class TRPO(Agent): new_loss = self._compute_loss(obs, act, adv, old_log_prob) kl = self._compute_kl(obs, old_pol_dist) improve = new_loss - prev_loss if kl <= self._max_kl * 1.5 and improve >= 0: violation = False break stepsize *= .5
705
https://:@github.com/ska-sa/katsdpimager.git
9606d1eefd02b2fe7039fe09e6bf7647d0b6c30b
@@ -20,7 +20,7 @@ def parse_quantity(str_value): """Parse a string into an astropy Quantity. Rather than trying to guess where the split occurs, we try every position from the back until we succeed.""" - for i in range(len(str_value), -1, 0): + for i in range(len(str_value), 0, -1): try: value = float(str_value[:i]) unit = units.Unit(str_value[i:])
scripts/imager.py
ArgSwap(idxs=1<->2 @(23,13)->(23,18))
def parse_quantity(str_value): """Parse a string into an astropy Quantity. Rather than trying to guess where the split occurs, we try every position from the back until we succeed.""" for i in range(len(str_value), -1, 0): try: value = float(str_value[:i]) unit = units.Unit(str_value[i:])
def parse_quantity(str_value): """Parse a string into an astropy Quantity. Rather than trying to guess where the split occurs, we try every position from the back until we succeed.""" for i in range(len(str_value), 0, -1): try: value = float(str_value[:i]) unit = units.Unit(str_value[i:])
706
https://:@github.com/ska-sa/katsdpimager.git
87edf0d372e8b40702cc72cc96c07ddb62fe19cc
@@ -479,7 +479,7 @@ class Weights(accel.OperationSequence): self.ensure_all_bound() # If self._fill is set, it is not necessary to clear first because # finalize will set all relevant values. - if self._fill is not None: + if self._fill is None: self.buffer('grid').zero(self.command_queue) def grid(self, uv, weights):
katsdpimager/weight.py
ReplaceText(target=' is ' @(482,21)->(482,29))
class Weights(accel.OperationSequence): self.ensure_all_bound() # If self._fill is set, it is not necessary to clear first because # finalize will set all relevant values. if self._fill is not None: self.buffer('grid').zero(self.command_queue) def grid(self, uv, weights):
class Weights(accel.OperationSequence): self.ensure_all_bound() # If self._fill is set, it is not necessary to clear first because # finalize will set all relevant values. if self._fill is None: self.buffer('grid').zero(self.command_queue) def grid(self, uv, weights):
707
https://:@github.com/ska-sa/katsdpimager.git
c1790fa1bf597a5fb592ee05ff7205b17fbcc85e
@@ -134,7 +134,7 @@ class Image(object): # TODO: should use the WCS transformation slices[i - 3] = 'IQUV'.find(stokes) elif axis_type == 'VOPT': - slices[i - 3] = channel + slices[i - 3] = rel_channel self._render_thumb(output_dir, filename, slices, mode, stokes, channel) self._render_full(output_dir, filename, slices, mode, stokes, channel)
tests/images_report.py
ReplaceText(target='rel_channel' @(137,36)->(137,43))
class Image(object): # TODO: should use the WCS transformation slices[i - 3] = 'IQUV'.find(stokes) elif axis_type == 'VOPT': slices[i - 3] = channel self._render_thumb(output_dir, filename, slices, mode, stokes, channel) self._render_full(output_dir, filename, slices, mode, stokes, channel)
class Image(object): # TODO: should use the WCS transformation slices[i - 3] = 'IQUV'.find(stokes) elif axis_type == 'VOPT': slices[i - 3] = rel_channel self._render_thumb(output_dir, filename, slices, mode, stokes, channel) self._render_full(output_dir, filename, slices, mode, stokes, channel)
708
https://:@github.com/gdoumenc/coworks.git
4a24754388adcf2fb8b878fb6a97cce8bf443e55
@@ -53,7 +53,7 @@ def invoke(initial, ctx): handler = get_handler(project_dir, module, service) cmd = project_config.get_command(handler, module, service, workspace) if not cmd: - raise CwsClientError(f"Undefined command {cmd}.\n") + raise CwsClientError(f"Undefined command {cmd_name}.\n") # Defines the proxy command with all user options def call_execute(**command_options):
coworks/cws/client.py
ReplaceText(target='cmd_name' @(56,58)->(56,61))
def invoke(initial, ctx): handler = get_handler(project_dir, module, service) cmd = project_config.get_command(handler, module, service, workspace) if not cmd: raise CwsClientError(f"Undefined command {cmd}.\n") # Defines the proxy command with all user options def call_execute(**command_options):
def invoke(initial, ctx): handler = get_handler(project_dir, module, service) cmd = project_config.get_command(handler, module, service, workspace) if not cmd: raise CwsClientError(f"Undefined command {cmd_name}.\n") # Defines the proxy command with all user options def call_execute(**command_options):
709
https://:@github.com/geokrety/geokrety-api.git
402a0659cc311fcb296865db0a8303130cb85f92
@@ -9,5 +9,5 @@ def dasherize(text): def require_relationship(resource_list, data): for resource in resource_list: if resource not in data: - raise UnprocessableEntity({'pointer': '/data/relationships/{}'.format(resource)}, - "A valid relationship with {} resource is required".format(resource)) + raise UnprocessableEntity("A valid relationship with {} resource is required".format(resource), + {'pointer': '/data/relationships/{}'.format(resource)})
app/api/helpers/utilities.py
ArgSwap(idxs=0<->1 @(12,18)->(12,37))
def dasherize(text): def require_relationship(resource_list, data): for resource in resource_list: if resource not in data: raise UnprocessableEntity({'pointer': '/data/relationships/{}'.format(resource)}, "A valid relationship with {} resource is required".format(resource))
def dasherize(text): def require_relationship(resource_list, data): for resource in resource_list: if resource not in data: raise UnprocessableEntity("A valid relationship with {} resource is required".format(resource), {'pointer': '/data/relationships/{}'.format(resource)})
710
https://:@github.com/troylar/mike-brady.git
51ac87ab42555fcea332280f21425fd0398ad22a
@@ -43,7 +43,7 @@ def render_templates(target_path, replace_values, file_types): template = env.get_template(f) rendered = template.render(replace_values) with open(full_path, "w") as fh: - print('Writing {}'.format(f)) + print('Writing {}'.format(full_path)) fh.write(rendered)
src/main.py
ReplaceText(target='full_path' @(46,42)->(46,43))
def render_templates(target_path, replace_values, file_types): template = env.get_template(f) rendered = template.render(replace_values) with open(full_path, "w") as fh: print('Writing {}'.format(f)) fh.write(rendered)
def render_templates(target_path, replace_values, file_types): template = env.get_template(f) rendered = template.render(replace_values) with open(full_path, "w") as fh: print('Writing {}'.format(full_path)) fh.write(rendered)
711
https://:@github.com/timwhite/greg.git
0a729af52a7ca3d66cefa89513f97fb5cd932b8e
@@ -756,7 +756,7 @@ def sync(args): feed.fix_linkdate(entry) # Sort entries_to_download, but only if you want to download as # many as there are - if stop < len(entries_to_download): + if stop >= len(entries_to_download): entries_to_download.sort(key=operator.attrgetter("linkdate"), reverse=False) for entry in entries_to_download:
greg/greg.py
ReplaceText(target='>=' @(759,20)->(759,21))
def sync(args): feed.fix_linkdate(entry) # Sort entries_to_download, but only if you want to download as # many as there are if stop < len(entries_to_download): entries_to_download.sort(key=operator.attrgetter("linkdate"), reverse=False) for entry in entries_to_download:
def sync(args): feed.fix_linkdate(entry) # Sort entries_to_download, but only if you want to download as # many as there are if stop >= len(entries_to_download): entries_to_download.sort(key=operator.attrgetter("linkdate"), reverse=False) for entry in entries_to_download:
712
https://:@github.com/yeago/question-stack.git
71958e8a2745787aacd5bf8b07867a4710b2bb4b
@@ -61,7 +61,7 @@ def accepted_answer(request,slug,comment): if not instance == comment.content_object: raise Http404 - if not request.user.has_perm('stack.change_question') or not request.user == instance.comment.user: + if not request.user.has_perm('stack.change_question') and not request.user == instance.comment.user: raise Http404 if instance.accepted_answer:
views.py
ReplaceText(target='and' @(64,55)->(64,57))
def accepted_answer(request,slug,comment): if not instance == comment.content_object: raise Http404 if not request.user.has_perm('stack.change_question') or not request.user == instance.comment.user: raise Http404 if instance.accepted_answer:
def accepted_answer(request,slug,comment): if not instance == comment.content_object: raise Http404 if not request.user.has_perm('stack.change_question') and not request.user == instance.comment.user: raise Http404 if instance.accepted_answer:
713
https://:@github.com/jtbish/piecewise.git
5f227f50d16d04d756045804b21ca5bd18c83597
@@ -14,7 +14,7 @@ class FuzzyXCSFLinearPredictionCreditAssignment: ] total_matching_degrees = sum(matching_degrees) assert total_matching_degrees > 0.0 - for (classifier, matching_degree) in zip(matching_degrees, action_set): + for (classifier, matching_degree) in zip(action_set, matching_degrees): credit_weight = (matching_degree / total_matching_degrees) self._update_experience(classifier, credit_weight) payoff_diff = payoff - classifier.get_prediction(situation)
piecewise/fuzzy/credit_assignment.py
ArgSwap(idxs=0<->1 @(17,45)->(17,48))
class FuzzyXCSFLinearPredictionCreditAssignment: ] total_matching_degrees = sum(matching_degrees) assert total_matching_degrees > 0.0 for (classifier, matching_degree) in zip(matching_degrees, action_set): credit_weight = (matching_degree / total_matching_degrees) self._update_experience(classifier, credit_weight) payoff_diff = payoff - classifier.get_prediction(situation)
class FuzzyXCSFLinearPredictionCreditAssignment: ] total_matching_degrees = sum(matching_degrees) assert total_matching_degrees > 0.0 for (classifier, matching_degree) in zip(action_set, matching_degrees): credit_weight = (matching_degree / total_matching_degrees) self._update_experience(classifier, credit_weight) payoff_diff = payoff - classifier.get_prediction(situation)
714
https://:@github.com/Clinical-Genomics/cg.git
f65fa404f3761f726a5bd32e3794e3c3d6771a26
@@ -110,7 +110,7 @@ def update(context, answered_out, case_id): if delivery_date is None: log.warn("sample not delivered: %s", hk_sample.lims_id) context.abort() - delivery_dates.append(delivery_dates) + delivery_dates.append(delivery_date) latest_date = sorted(delivery_dates)[-1] log.debug("fillin answered out date in HK") hk_run.answeredout_at = datetime.combine(latest_date, datetime.min.time())
cg/commands.py
ReplaceText(target='delivery_date' @(113,34)->(113,48))
def update(context, answered_out, case_id): if delivery_date is None: log.warn("sample not delivered: %s", hk_sample.lims_id) context.abort() delivery_dates.append(delivery_dates) latest_date = sorted(delivery_dates)[-1] log.debug("fillin answered out date in HK") hk_run.answeredout_at = datetime.combine(latest_date, datetime.min.time())
def update(context, answered_out, case_id): if delivery_date is None: log.warn("sample not delivered: %s", hk_sample.lims_id) context.abort() delivery_dates.append(delivery_date) latest_date = sorted(delivery_dates)[-1] log.debug("fillin answered out date in HK") hk_run.answeredout_at = datetime.combine(latest_date, datetime.min.time())
715
https://:@github.com/Clinical-Genomics/cg.git
a9c45156e08953c30b15eccd7431e76ce0809ac3
@@ -174,7 +174,7 @@ def start(lims_api, customer_id, family_name): log.debug("%s has status %s", sample.sample_id, sample_status) statuses.add(sample_status) - if len(is_externals) == 0: + if len(is_externals) == 1: data = dict(is_external=is_externals.pop()) else: # mix of internal and external samples
cg/apps/lims.py
ReplaceText(target='1' @(177,28)->(177,29))
def start(lims_api, customer_id, family_name): log.debug("%s has status %s", sample.sample_id, sample_status) statuses.add(sample_status) if len(is_externals) == 0: data = dict(is_external=is_externals.pop()) else: # mix of internal and external samples
def start(lims_api, customer_id, family_name): log.debug("%s has status %s", sample.sample_id, sample_status) statuses.add(sample_status) if len(is_externals) == 1: data = dict(is_external=is_externals.pop()) else: # mix of internal and external samples
716
https://:@github.com/Clinical-Genomics/cg.git
ea94c447cec22ba9e9a5febcf78f1816f0b2de5d
@@ -90,7 +90,7 @@ def family(context: click.Context, customer: str, name: bool, samples: bool, families.append(family_obj) for family_obj in families: - LOG.debug(f"{family_id.internal_id}: get info about family") + LOG.debug(f"{family_obj.internal_id}: get info about family") row = [ family_obj.internal_id, family_obj.name,
cg/cli/get.py
ReplaceText(target='family_obj' @(93,21)->(93,30))
def family(context: click.Context, customer: str, name: bool, samples: bool, families.append(family_obj) for family_obj in families: LOG.debug(f"{family_id.internal_id}: get info about family") row = [ family_obj.internal_id, family_obj.name,
def family(context: click.Context, customer: str, name: bool, samples: bool, families.append(family_obj) for family_obj in families: LOG.debug(f"{family_obj.internal_id}: get info about family") row = [ family_obj.internal_id, family_obj.name,
717
https://:@github.com/Clinical-Genomics/cg.git
097837f7aeded32f7792fd77ede05c006732e06b
@@ -18,7 +18,7 @@ class BackupApi(): """Check if there's too many flowcells already "ondisk".""" ondisk_flowcells = self.status.flowcells(status='ondisk').count() LOG.debug(f"ondisk flowcells: {ondisk_flowcells}") - return ondisk_flowcells < max_flowcells + return ondisk_flowcells > max_flowcells def check_processing(self, max_flowcells: int=3) -> bool: """Check if the processing queue for flowcells is not full."""
cg/meta/backup.py
ReplaceText(target='>' @(21,32)->(21,33))
class BackupApi(): """Check if there's too many flowcells already "ondisk".""" ondisk_flowcells = self.status.flowcells(status='ondisk').count() LOG.debug(f"ondisk flowcells: {ondisk_flowcells}") return ondisk_flowcells < max_flowcells def check_processing(self, max_flowcells: int=3) -> bool: """Check if the processing queue for flowcells is not full."""
class BackupApi(): """Check if there's too many flowcells already "ondisk".""" ondisk_flowcells = self.status.flowcells(status='ondisk').count() LOG.debug(f"ondisk flowcells: {ondisk_flowcells}") return ondisk_flowcells > max_flowcells def check_processing(self, max_flowcells: int=3) -> bool: """Check if the processing queue for flowcells is not full."""
718
https://:@github.com/codesyntax/Products.Bitakora.git
c9af30f2114b45151a57d527b6d87150d17ec226
@@ -23,7 +23,7 @@ __version__ = "$Revision$" def manage_addComment(self, author, body, url='', email='', date=None, bitakora_cpt='', random_cpt='', captcha_zz=0, REQUEST=None): """ Called from HTML form when commenting """ from utils import checkCaptchaValue, isCommentSpam - if not captcha_zz: + if captcha_zz: if not checkCaptchaValue(random_cpt, bitakora_cpt): if REQUEST is not None: return REQUEST.RESPONSE.redirect(self.absolute_url()+u'?msg=%s&body=%s&comment_author=%s&comment_email=%s&comment_url=%s#bitakora_cpt_control' % (self.gettext('Are you a bot? Please try again...'), url_quote(body.encode('utf-8')), url_quote(author.encode('utf-8')), url_quote(email.encode('utf-8')), url_quote(url.encode('utf-8'))))
Comment.py
ReplaceText(target='' @(26,7)->(26,11))
__version__ = "$Revision$" def manage_addComment(self, author, body, url='', email='', date=None, bitakora_cpt='', random_cpt='', captcha_zz=0, REQUEST=None): """ Called from HTML form when commenting """ from utils import checkCaptchaValue, isCommentSpam if not captcha_zz: if not checkCaptchaValue(random_cpt, bitakora_cpt): if REQUEST is not None: return REQUEST.RESPONSE.redirect(self.absolute_url()+u'?msg=%s&body=%s&comment_author=%s&comment_email=%s&comment_url=%s#bitakora_cpt_control' % (self.gettext('Are you a bot? Please try again...'), url_quote(body.encode('utf-8')), url_quote(author.encode('utf-8')), url_quote(email.encode('utf-8')), url_quote(url.encode('utf-8'))))
__version__ = "$Revision$" def manage_addComment(self, author, body, url='', email='', date=None, bitakora_cpt='', random_cpt='', captcha_zz=0, REQUEST=None): """ Called from HTML form when commenting """ from utils import checkCaptchaValue, isCommentSpam if captcha_zz: if not checkCaptchaValue(random_cpt, bitakora_cpt): if REQUEST is not None: return REQUEST.RESPONSE.redirect(self.absolute_url()+u'?msg=%s&body=%s&comment_author=%s&comment_email=%s&comment_url=%s#bitakora_cpt_control' % (self.gettext('Are you a bot? Please try again...'), url_quote(body.encode('utf-8')), url_quote(author.encode('utf-8')), url_quote(email.encode('utf-8')), url_quote(url.encode('utf-8'))))
719
https://:@gitlab.com/saltspiro/spiro-deploy.git
660c01a080bb7c82a593146ca85c3d04f237881a
@@ -112,7 +112,7 @@ def main(argv=sys.argv[1:]): print(event, pprint.pformat(data), flush=True) if event == 'highstate-start': - minions += set(data['minions']) + minions |= set(data['minions']) elif event == 'highstate': minions.discard(data['minion'])
spirodeploy/cli.py
ReplaceText(target='|=' @(115,20)->(115,22))
def main(argv=sys.argv[1:]): print(event, pprint.pformat(data), flush=True) if event == 'highstate-start': minions += set(data['minions']) elif event == 'highstate': minions.discard(data['minion'])
def main(argv=sys.argv[1:]): print(event, pprint.pformat(data), flush=True) if event == 'highstate-start': minions |= set(data['minions']) elif event == 'highstate': minions.discard(data['minion'])
720
https://:@github.com/ymoch/preacher.git
5b49e834eb2c9ea03ba9619b9fb0cb2120ff68a7
@@ -142,7 +142,7 @@ class Case: response_verification = self._response.verify( response, - ValueContext(origin_datetime=response.starts), + ValueContext(origin_datetime=execution.starts), ) return CaseResult( label=self._label,
preacher/core/scenario/case.py
ReplaceText(target='execution' @(145,41)->(145,49))
class Case: response_verification = self._response.verify( response, ValueContext(origin_datetime=response.starts), ) return CaseResult( label=self._label,
class Case: response_verification = self._response.verify( response, ValueContext(origin_datetime=execution.starts), ) return CaseResult( label=self._label,
721
https://:@gitlab.com/socco/GliderTools.git
c0a6ae0924dabda3ddd6c03947a4038554e90eb1
@@ -468,7 +468,7 @@ def savitzky_golay(arr, window_size, order, deriv=0, rate=1, interpolate=True): # allow to interpolate for half the window size if interpolate: - ser = Series(arr).interpolate(limit=half_window) + ser = Series(arr).interpolate(limit=window_size) y = array(ser) else: y = array(arr)
buoyancy_glider_utils/cleaning.py
ReplaceText(target='window_size' @(471,44)->(471,55))
def savitzky_golay(arr, window_size, order, deriv=0, rate=1, interpolate=True): # allow to interpolate for half the window size if interpolate: ser = Series(arr).interpolate(limit=half_window) y = array(ser) else: y = array(arr)
def savitzky_golay(arr, window_size, order, deriv=0, rate=1, interpolate=True): # allow to interpolate for half the window size if interpolate: ser = Series(arr).interpolate(limit=window_size) y = array(ser) else: y = array(arr)
722
https://:@github.com/hattya/scmver.git
9fc6568b7fc7814e4659e4140da9ffcfe69321ca
@@ -95,7 +95,7 @@ def _is_wc_root(root, info): p = os.path.dirname(root) return (p == root or not os.path.isdir(os.path.join(p, '.svn')) - or _info(p).get('Repository UUID') == info['Repository UUID']) + or _info(p).get('Repository UUID') != info['Repository UUID']) return False
scmver/subversion.py
ReplaceText(target='!=' @(98,51)->(98,53))
def _is_wc_root(root, info): p = os.path.dirname(root) return (p == root or not os.path.isdir(os.path.join(p, '.svn')) or _info(p).get('Repository UUID') == info['Repository UUID']) return False
def _is_wc_root(root, info): p = os.path.dirname(root) return (p == root or not os.path.isdir(os.path.join(p, '.svn')) or _info(p).get('Repository UUID') != info['Repository UUID']) return False
723
https://:@github.com/h0m3/python-mprint.git
782bec1d992d0ee19c8f0128d83ad4b9069bee3f
@@ -82,7 +82,7 @@ def markup(string): ) newString += string.split(">", 1)[1] string = newString - return newString + return string # Print markup characters to screen
mprint/mprint.py
ReplaceText(target='string' @(85,11)->(85,20))
def markup(string): ) newString += string.split(">", 1)[1] string = newString return newString # Print markup characters to screen
def markup(string): ) newString += string.split(">", 1)[1] string = newString return string # Print markup characters to screen
724
https://:@github.com/brettviren/worch.git
7941cffa22b2e9933e57139329e3c9d9cf555623
@@ -31,7 +31,7 @@ def feature_command(tgen): cmd_dir = tgen.make_node(tgen.worch.command_dir) cmd_node = cmd_dir.make_node(tgen.worch.command_cmd) cmd_target = \ - map(cmd_dir.make_node, tgen.to_list(tgen.worch.command_target)) + map(tgen.make_node, tgen.to_list(tgen.worch.command_target)) cmd_rule = '{command_cmd_prefix}{command_cmd} {command_cmd_options} {command_cmd_postfix}' tgen.step('command', rule = tgen.worch.format(cmd_rule),
orch/features/feature_command.py
ReplaceText(target='tgen' @(34,12)->(34,19))
def feature_command(tgen): cmd_dir = tgen.make_node(tgen.worch.command_dir) cmd_node = cmd_dir.make_node(tgen.worch.command_cmd) cmd_target = \ map(cmd_dir.make_node, tgen.to_list(tgen.worch.command_target)) cmd_rule = '{command_cmd_prefix}{command_cmd} {command_cmd_options} {command_cmd_postfix}' tgen.step('command', rule = tgen.worch.format(cmd_rule),
def feature_command(tgen): cmd_dir = tgen.make_node(tgen.worch.command_dir) cmd_node = cmd_dir.make_node(tgen.worch.command_cmd) cmd_target = \ map(tgen.make_node, tgen.to_list(tgen.worch.command_target)) cmd_rule = '{command_cmd_prefix}{command_cmd} {command_cmd_options} {command_cmd_postfix}' tgen.step('command', rule = tgen.worch.format(cmd_rule),
725
https://:@github.com/slipguru/icing.git
a292074640464c3c407850db151595153d28cf0f
@@ -109,7 +109,7 @@ def sim_function(ig1, ig2, method='jaccard', model='ham', correction = correction_function(max(ig1.mut, ig2.mut)) # ss = 1 - ((1 - ss) * max(correction, 0)) # ss = 1 - ((1 - ss) * correction) - ss *= correction + ss += correction # return min(max(ss, 0), 1) return max(ss, 0)
icing/core/cloning.py
ReplaceText(target='+=' @(112,11)->(112,13))
def sim_function(ig1, ig2, method='jaccard', model='ham', correction = correction_function(max(ig1.mut, ig2.mut)) # ss = 1 - ((1 - ss) * max(correction, 0)) # ss = 1 - ((1 - ss) * correction) ss *= correction # return min(max(ss, 0), 1) return max(ss, 0)
def sim_function(ig1, ig2, method='jaccard', model='ham', correction = correction_function(max(ig1.mut, ig2.mut)) # ss = 1 - ((1 - ss) * max(correction, 0)) # ss = 1 - ((1 - ss) * correction) ss += correction # return min(max(ss, 0), 1) return max(ss, 0)
726
https://:@github.com/slipguru/icing.git
7179403bf32d1f649ef7ea63a060ecd4ffb5a9e6
@@ -109,7 +109,7 @@ def sim_function(ig1, ig2, method='jaccard', model='ham', correction = correction_function(max(ig1.mut, ig2.mut)) # ss = 1 - ((1 - ss) * max(correction, 0)) # ss = 1 - ((1 - ss) * correction) - ss += (1. - correction) + ss *= (1. - correction) # return min(max(ss, 0), 1) return max(ss, 0)
icing/core/cloning.py
ReplaceText(target='*=' @(112,11)->(112,13))
def sim_function(ig1, ig2, method='jaccard', model='ham', correction = correction_function(max(ig1.mut, ig2.mut)) # ss = 1 - ((1 - ss) * max(correction, 0)) # ss = 1 - ((1 - ss) * correction) ss += (1. - correction) # return min(max(ss, 0), 1) return max(ss, 0)
def sim_function(ig1, ig2, method='jaccard', model='ham', correction = correction_function(max(ig1.mut, ig2.mut)) # ss = 1 - ((1 - ss) * max(correction, 0)) # ss = 1 - ((1 - ss) * correction) ss *= (1. - correction) # return min(max(ss, 0), 1) return max(ss, 0)
727
https://:@github.com/jojoduquartier/dsdbmanager.git
d074b1099d1bb9b729760d42e36aaae1944c64c7
@@ -246,7 +246,7 @@ class DbMiddleware(object): def __init__(self, engine, connect_only, schema): self.engine = engine - if connect_only: + if not connect_only: inspection = reflection.Inspector.from_engine(self.engine) views = inspection.get_view_names(schema=schema) tables = inspection.get_table_names(schema=schema)
dsdbmanager/dbobject.py
ReplaceText(target='not ' @(249,11)->(249,11))
class DbMiddleware(object): def __init__(self, engine, connect_only, schema): self.engine = engine if connect_only: inspection = reflection.Inspector.from_engine(self.engine) views = inspection.get_view_names(schema=schema) tables = inspection.get_table_names(schema=schema)
class DbMiddleware(object): def __init__(self, engine, connect_only, schema): self.engine = engine if not connect_only: inspection = reflection.Inspector.from_engine(self.engine) views = inspection.get_view_names(schema=schema) tables = inspection.get_table_names(schema=schema)
728
https://:@gitlab.com/HartkopfF/Purple.git
d8b25ebbe423fb005169913d63410713eb5a49ec
@@ -414,7 +414,7 @@ def print_result(peps, print_peps,threshold): # prints flagged peptides in console, if print_peps == True # peptides are flagged, if they are greater than the average of all positive scores scores = list(peps.values()) - scores_in_tens = [int(round(i, -1)) if i >= threshold else -1 for i in scores] # only round positiv scores + scores_in_tens = [int(round(i, -1)) if i <= threshold else -1 for i in scores] # only round positiv scores freq_scores = {x: scores_in_tens.count(x) for x in scores_in_tens} # Dictionary Comprehension if print_peps == 1:
src/Purple_methods.py
ReplaceText(target='<=' @(417,45)->(417,47))
def print_result(peps, print_peps,threshold): # prints flagged peptides in console, if print_peps == True # peptides are flagged, if they are greater than the average of all positive scores scores = list(peps.values()) scores_in_tens = [int(round(i, -1)) if i >= threshold else -1 for i in scores] # only round positiv scores freq_scores = {x: scores_in_tens.count(x) for x in scores_in_tens} # Dictionary Comprehension if print_peps == 1:
def print_result(peps, print_peps,threshold): # prints flagged peptides in console, if print_peps == True # peptides are flagged, if they are greater than the average of all positive scores scores = list(peps.values()) scores_in_tens = [int(round(i, -1)) if i <= threshold else -1 for i in scores] # only round positiv scores freq_scores = {x: scores_in_tens.count(x) for x in scores_in_tens} # Dictionary Comprehension if print_peps == 1:
729
https://:@github.com/bjoernricks/python-quilt.git
2a4e97b554669b95bb1d22f220ac2d7ba6df9012
@@ -46,7 +46,7 @@ class Import(Command): """ Import patch into the patch queue The patch is inserted after the current top applied patch """ - if not new_name: + if new_name: dir_name = os.path.dirname(new_name) name = os.path.basename(new_name) dest_dir = self.quilt_patches + Directory(dir_name)
quilt/patchimport.py
ReplaceText(target='' @(49,11)->(49,15))
class Import(Command): """ Import patch into the patch queue The patch is inserted after the current top applied patch """ if not new_name: dir_name = os.path.dirname(new_name) name = os.path.basename(new_name) dest_dir = self.quilt_patches + Directory(dir_name)
class Import(Command): """ Import patch into the patch queue The patch is inserted after the current top applied patch """ if new_name: dir_name = os.path.dirname(new_name) name = os.path.basename(new_name) dest_dir = self.quilt_patches + Directory(dir_name)
730
https://:@github.com/bjoernricks/python-quilt.git
1c2a80d50b73cf182574c0e1f0d7aa5b6ab91631
@@ -93,7 +93,7 @@ class Push(Command): applied = self.db.applied_patches() for patch in applied: if patch in patches: - patches.remove(applied) + patches.remove(patch) if not patches: raise AllPatchesApplied(self.series, self.db.top_patch())
quilt/push.py
ReplaceText(target='patch' @(96,31)->(96,38))
class Push(Command): applied = self.db.applied_patches() for patch in applied: if patch in patches: patches.remove(applied) if not patches: raise AllPatchesApplied(self.series, self.db.top_patch())
class Push(Command): applied = self.db.applied_patches() for patch in applied: if patch in patches: patches.remove(patch) if not patches: raise AllPatchesApplied(self.series, self.db.top_patch())
731
https://:@github.com/HypothesisWorks/hypothesis-python.git
7d201f06333b185a25a5d77df7a01d08790655cb
@@ -69,7 +69,7 @@ def test_a_verifier_saves_any_failing_examples_in_its_database(): def test_a_verifier_retrieves_previous_failing_examples_from_the_database(): database = ExampleDatabase() verifier = Verifier(settings=hs.Settings(database=database)) - verifier.falsify(lambda x: x != 11, int) + verifier.falsify(lambda x: x < 11, int) called = [] def save_calls(t):
tests/test_database.py
ReplaceText(target='<' @(72,33)->(72,35))
def test_a_verifier_saves_any_failing_examples_in_its_database(): def test_a_verifier_retrieves_previous_failing_examples_from_the_database(): database = ExampleDatabase() verifier = Verifier(settings=hs.Settings(database=database)) verifier.falsify(lambda x: x != 11, int) called = [] def save_calls(t):
def test_a_verifier_saves_any_failing_examples_in_its_database(): def test_a_verifier_retrieves_previous_failing_examples_from_the_database(): database = ExampleDatabase() verifier = Verifier(settings=hs.Settings(database=database)) verifier.falsify(lambda x: x < 11, int) called = [] def save_calls(t):
732
https://:@github.com/HypothesisWorks/hypothesis-python.git
b5a59b2e474f1f2bcff898aeeba9cc3ca2e5d186
@@ -89,7 +89,7 @@ class TestRunner(object): raise RunIsComplete() self.examples_considered += 1 if ( - buffer[:self.last_data.index] == + buffer[:self.last_data.index] >= self.last_data.buffer[:self.last_data.index] ): return False
src/hypothesis/internal/conjecture/engine.py
ReplaceText(target='>=' @(92,42)->(92,44))
class TestRunner(object): raise RunIsComplete() self.examples_considered += 1 if ( buffer[:self.last_data.index] == self.last_data.buffer[:self.last_data.index] ): return False
class TestRunner(object): raise RunIsComplete() self.examples_considered += 1 if ( buffer[:self.last_data.index] >= self.last_data.buffer[:self.last_data.index] ): return False
733
https://:@github.com/HypothesisWorks/hypothesis-python.git
5f990a2d351ad02ac698375428c54c86b907f505
@@ -686,7 +686,7 @@ def characters(whitelist_categories=None, blacklist_categories=None, if ( whitelist_characters is not None and blacklist_characters is not None and - set(whitelist_characters).intersection(set(whitelist_characters)) + set(blacklist_characters).intersection(set(whitelist_characters)) ): raise InvalidArgument( 'Cannot have characters in both whitelist_characters=%r, '
src/hypothesis/strategies.py
ReplaceText(target='blacklist_characters' @(689,12)->(689,32))
def characters(whitelist_categories=None, blacklist_categories=None, if ( whitelist_characters is not None and blacklist_characters is not None and set(whitelist_characters).intersection(set(whitelist_characters)) ): raise InvalidArgument( 'Cannot have characters in both whitelist_characters=%r, '
def characters(whitelist_categories=None, blacklist_categories=None, if ( whitelist_characters is not None and blacklist_characters is not None and set(blacklist_characters).intersection(set(whitelist_characters)) ): raise InvalidArgument( 'Cannot have characters in both whitelist_characters=%r, '
734
https://:@github.com/HypothesisWorks/hypothesis-python.git
5bd4086b1be92933cef2bb61f98770df1114ed7a
@@ -691,7 +691,7 @@ def characters(whitelist_categories=None, blacklist_categories=None, raise InvalidArgument( 'Cannot have characters in both whitelist_characters=%r, ' 'and blacklist_characters=%r' % ( - whitelist_characters, blacklist_categories, + whitelist_characters, blacklist_characters, ) )
src/hypothesis/strategies.py
ReplaceText(target='blacklist_characters' @(694,38)->(694,58))
def characters(whitelist_categories=None, blacklist_categories=None, raise InvalidArgument( 'Cannot have characters in both whitelist_characters=%r, ' 'and blacklist_characters=%r' % ( whitelist_characters, blacklist_categories, ) )
def characters(whitelist_categories=None, blacklist_categories=None, raise InvalidArgument( 'Cannot have characters in both whitelist_characters=%r, ' 'and blacklist_characters=%r' % ( whitelist_characters, blacklist_characters, ) )
735
https://:@github.com/HypothesisWorks/hypothesis-python.git
a10d8cf98473dbdaedf1d317c8ad2d51b38699fe
@@ -30,7 +30,7 @@ if __name__ == '__main__': if ( os.environ['CIRCLE_BRANCH'] != 'master' and - os.environ['CI_PULL_REQUEST'] != '' + os.environ['CI_PULL_REQUEST'] == '' ): print('We only run CI builds on the master branch or in pull requests') sys.exit(0)
scripts/run_circle.py
ReplaceText(target='==' @(33,38)->(33,40))
if __name__ == '__main__': if ( os.environ['CIRCLE_BRANCH'] != 'master' and os.environ['CI_PULL_REQUEST'] != '' ): print('We only run CI builds on the master branch or in pull requests') sys.exit(0)
if __name__ == '__main__': if ( os.environ['CIRCLE_BRANCH'] != 'master' and os.environ['CI_PULL_REQUEST'] == '' ): print('We only run CI builds on the master branch or in pull requests') sys.exit(0)
736
https://:@github.com/HypothesisWorks/hypothesis-python.git
8f9b8211e5c7b3d6e791bc9203e12b494eba9d64
@@ -1119,7 +1119,7 @@ def find(specifier, condition, settings=None, random=None, database_key=None): if success: successful_examples[0] += 1 - if settings.verbosity == Verbosity.verbose: + if settings.verbosity >= Verbosity.verbose: if not successful_examples[0]: report( u'Tried non-satisfying example %s' % (nicerepr(result),))
hypothesis-python/src/hypothesis/core.py
ReplaceText(target='>=' @(1122,30)->(1122,32))
def find(specifier, condition, settings=None, random=None, database_key=None): if success: successful_examples[0] += 1 if settings.verbosity == Verbosity.verbose: if not successful_examples[0]: report( u'Tried non-satisfying example %s' % (nicerepr(result),))
def find(specifier, condition, settings=None, random=None, database_key=None): if success: successful_examples[0] += 1 if settings.verbosity >= Verbosity.verbose: if not successful_examples[0]: report( u'Tried non-satisfying example %s' % (nicerepr(result),))
737
https://:@github.com/HypothesisWorks/hypothesis-python.git
8a912d3d94dbd45ada80476bfbf11eea334ec48d
@@ -119,7 +119,7 @@ def assert_can_release(): def has_travis_secrets(): - return os.environ.get('TRAVIS_SECURE_ENV_VARS', None) != 'true' + return os.environ.get('TRAVIS_SECURE_ENV_VARS', None) == 'true' def build_jobs():
tooling/src/hypothesistooling/__init__.py
ReplaceText(target='==' @(122,58)->(122,60))
def assert_can_release(): def has_travis_secrets(): return os.environ.get('TRAVIS_SECURE_ENV_VARS', None) != 'true' def build_jobs():
def assert_can_release(): def has_travis_secrets(): return os.environ.get('TRAVIS_SECURE_ENV_VARS', None) == 'true' def build_jobs():
738
https://:@github.com/HypothesisWorks/hypothesis-python.git
3dba57307b412696b30f86eb7d0fdb189421b5c7
@@ -2209,7 +2209,7 @@ class Shrinker(object): u, v = self.blocks[i] b = int_from_bytes(self.shrink_target.buffer[u:v]) lowered = b - offset - if lowered <= 0: + if lowered < 0: continue attempt = bytearray(self.shrink_target.buffer) attempt[u:v] = int_to_bytes(lowered, v - u)
hypothesis-python/src/hypothesis/internal/conjecture/engine.py
ReplaceText(target='<' @(2212,27)->(2212,29))
class Shrinker(object): u, v = self.blocks[i] b = int_from_bytes(self.shrink_target.buffer[u:v]) lowered = b - offset if lowered <= 0: continue attempt = bytearray(self.shrink_target.buffer) attempt[u:v] = int_to_bytes(lowered, v - u)
class Shrinker(object): u, v = self.blocks[i] b = int_from_bytes(self.shrink_target.buffer[u:v]) lowered = b - offset if lowered < 0: continue attempt = bytearray(self.shrink_target.buffer) attempt[u:v] = int_to_bytes(lowered, v - u)
739
https://:@github.com/HypothesisWorks/hypothesis-python.git
a55eeda06ec2650b446a3ef0885a4f765d0c5513
@@ -317,7 +317,7 @@ class settings( bits = [] for name, setting in all_settings.items(): value = getattr(self, name) - if value != setting.default or not setting.hide_repr: + if value != setting.default and not setting.hide_repr: bits.append('%s=%r' % (name, value)) return 'settings(%s)' % ', '.join(sorted(bits))
hypothesis-python/src/hypothesis/_settings.py
ReplaceText(target='and' @(320,40)->(320,42))
class settings( bits = [] for name, setting in all_settings.items(): value = getattr(self, name) if value != setting.default or not setting.hide_repr: bits.append('%s=%r' % (name, value)) return 'settings(%s)' % ', '.join(sorted(bits))
class settings( bits = [] for name, setting in all_settings.items(): value = getattr(self, name) if value != setting.default and not setting.hide_repr: bits.append('%s=%r' % (name, value)) return 'settings(%s)' % ', '.join(sorted(bits))
740
https://:@github.com/HypothesisWorks/hypothesis-python.git
feaa70b9ee7e4659bb31bcbd0bd6077c179516bf
@@ -439,7 +439,7 @@ class StepCounter(RuleBasedStateMachine): self.step_count += 1 def teardown(self): - assert self.step_count == settings_step_count + assert self.step_count <= settings_step_count test_settings_decorator_applies_to_rule_based_state_machine_class = \
hypothesis-python/tests/cover/test_settings.py
ReplaceText(target='<=' @(442,31)->(442,33))
class StepCounter(RuleBasedStateMachine): self.step_count += 1 def teardown(self): assert self.step_count == settings_step_count test_settings_decorator_applies_to_rule_based_state_machine_class = \
class StepCounter(RuleBasedStateMachine): self.step_count += 1 def teardown(self): assert self.step_count <= settings_step_count test_settings_decorator_applies_to_rule_based_state_machine_class = \
741
https://:@github.com/HypothesisWorks/hypothesis-python.git
012cdca96f6f3887bc5a93f5a1efaf4f58cde27d
@@ -656,7 +656,7 @@ def sampled_from(elements): return sets(sampled_from(values), min_size=1).map( lambda s: reduce(operator.or_, s) ) - return SampledFromStrategy(values) + return SampledFromStrategy(elements) @cacheable
hypothesis-python/src/hypothesis/strategies/_internal/core.py
ReplaceText(target='elements' @(659,31)->(659,37))
def sampled_from(elements): return sets(sampled_from(values), min_size=1).map( lambda s: reduce(operator.or_, s) ) return SampledFromStrategy(values) @cacheable
def sampled_from(elements): return sets(sampled_from(values), min_size=1).map( lambda s: reduce(operator.or_, s) ) return SampledFromStrategy(elements) @cacheable
742
https://:@github.com/HypothesisWorks/hypothesis-python.git
a9c5902f94250156d80baff42da96e9d08778d26
@@ -1842,7 +1842,7 @@ def complex_numbers( # Order of conditions carefully tuned so that for a given pair of # magnitude arguments, we always either draw or do not draw the bool # (crucial for good shrinking behaviour) but only invert when needed. - if min_magnitude != 0 and draw(booleans()) and math.fabs(zi) <= min_magnitude: + if min_magnitude > 0 and draw(booleans()) and math.fabs(zi) <= min_magnitude: zr = -zr return complex(zr, zi)
hypothesis-python/src/hypothesis/strategies/_internal/core.py
ReplaceText(target='>' @(1845,25)->(1845,27))
def complex_numbers( # Order of conditions carefully tuned so that for a given pair of # magnitude arguments, we always either draw or do not draw the bool # (crucial for good shrinking behaviour) but only invert when needed. if min_magnitude != 0 and draw(booleans()) and math.fabs(zi) <= min_magnitude: zr = -zr return complex(zr, zi)
def complex_numbers( # Order of conditions carefully tuned so that for a given pair of # magnitude arguments, we always either draw or do not draw the bool # (crucial for good shrinking behaviour) but only invert when needed. if min_magnitude > 0 and draw(booleans()) and math.fabs(zi) <= min_magnitude: zr = -zr return complex(zr, zi)
743
https://:@github.com/pyfa-org/eos.git
4a87a594d189c71e916538d04026dc470cc12313
@@ -418,7 +418,7 @@ class InfoBuilder: # Negate condition for else clause processing # We do not need to recombine it with conditions passed to our method, # as condition being reverted is part of combined tree - self.__invertCondition(currentConditions) + self.__invertCondition(newConditions) self.__generic(elseClause, deepcopy(currentConditions)) def __makeConditionRouter(self, element):
data/effect/builder/builder.py
ReplaceText(target='newConditions' @(421,31)->(421,48))
class InfoBuilder: # Negate condition for else clause processing # We do not need to recombine it with conditions passed to our method, # as condition being reverted is part of combined tree self.__invertCondition(currentConditions) self.__generic(elseClause, deepcopy(currentConditions)) def __makeConditionRouter(self, element):
class InfoBuilder: # Negate condition for else clause processing # We do not need to recombine it with conditions passed to our method, # as condition being reverted is part of combined tree self.__invertCondition(newConditions) self.__generic(elseClause, deepcopy(currentConditions)) def __makeConditionRouter(self, element):
744
https://:@github.com/pyfa-org/eos.git
23c14ff52c9ab1a52ca35887ca043680046dcaf7
@@ -38,7 +38,7 @@ class TestSkillUniqueness(RestrictionTestCase): restrictionError1 = fit.getRestrictionError(skill1, Restriction.skillUniqueness) self.assertIsNotNone(restrictionError1) self.assertEqual(restrictionError1.skill, 56) - restrictionError2 = fit.getRestrictionError(skill1, Restriction.skillUniqueness) + restrictionError2 = fit.getRestrictionError(skill2, Restriction.skillUniqueness) self.assertIsNotNone(restrictionError2) self.assertEqual(restrictionError2.skill, 56) fit.items.remove(skill1)
tests/restrictionTracker/restrictions/testSkillUniqueness.py
ReplaceText(target='skill2' @(41,52)->(41,58))
class TestSkillUniqueness(RestrictionTestCase): restrictionError1 = fit.getRestrictionError(skill1, Restriction.skillUniqueness) self.assertIsNotNone(restrictionError1) self.assertEqual(restrictionError1.skill, 56) restrictionError2 = fit.getRestrictionError(skill1, Restriction.skillUniqueness) self.assertIsNotNone(restrictionError2) self.assertEqual(restrictionError2.skill, 56) fit.items.remove(skill1)
class TestSkillUniqueness(RestrictionTestCase): restrictionError1 = fit.getRestrictionError(skill1, Restriction.skillUniqueness) self.assertIsNotNone(restrictionError1) self.assertEqual(restrictionError1.skill, 56) restrictionError2 = fit.getRestrictionError(skill2, Restriction.skillUniqueness) self.assertIsNotNone(restrictionError2) self.assertEqual(restrictionError2.skill, 56) fit.items.remove(skill1)
745
https://:@github.com/pyfa-org/eos.git
ec16898d0f6e700159a14af551196f3d7e31aa43
@@ -52,7 +52,7 @@ class SlotIndexRegister(RestrictionRegister): def registerHolder(self, holder): # Skip items which don't have index specifier slotIndex = holder.item.attributes.get(self.__slotIndexAttr) - if slotIndex is not None: + if slotIndex is None: return self.__slottedHolders.addData(slotIndex, holder)
fit/restrictionTracker/restriction/slotIndex.py
ReplaceText(target=' is ' @(55,20)->(55,28))
class SlotIndexRegister(RestrictionRegister): def registerHolder(self, holder): # Skip items which don't have index specifier slotIndex = holder.item.attributes.get(self.__slotIndexAttr) if slotIndex is not None: return self.__slottedHolders.addData(slotIndex, holder)
class SlotIndexRegister(RestrictionRegister): def registerHolder(self, holder): # Skip items which don't have index specifier slotIndex = holder.item.attributes.get(self.__slotIndexAttr) if slotIndex is None: return self.__slottedHolders.addData(slotIndex, holder)
746
https://:@github.com/pyfa-org/eos.git
e8ea4b04ff260c186d55ece03df22dbd6aa509e9
@@ -61,7 +61,7 @@ class ResourceRegister(RestrictionRegister): # Can be None, so fall back to 0 in this case output = stats.output or 0 # If we're not out of resource, do nothing - if totalUse > output: + if totalUse <= output: return taintedHolders = {} for holder in self.__resourceUsers:
fit/restrictionTracker/restriction/resource.py
ReplaceText(target='<=' @(64,20)->(64,21))
class ResourceRegister(RestrictionRegister): # Can be None, so fall back to 0 in this case output = stats.output or 0 # If we're not out of resource, do nothing if totalUse > output: return taintedHolders = {} for holder in self.__resourceUsers:
class ResourceRegister(RestrictionRegister): # Can be None, so fall back to 0 in this case output = stats.output or 0 # If we're not out of resource, do nothing if totalUse <= output: return taintedHolders = {} for holder in self.__resourceUsers:
747
https://:@github.com/pyfa-org/eos.git
700a4414cab25efe4e306e64c9cee28250f7363a
@@ -151,7 +151,7 @@ class MsgHelper: # Unapply effects from targets tgt_getter = getattr(item, '_get_effects_tgts', None) if tgt_getter: - effects_tgts = tgt_getter(start_ids) + effects_tgts = tgt_getter(stop_ids) for effect_id, tgt_items in effects_tgts.items(): msgs.append(EffectUnapplied(item, effect_id, tgt_items)) # Stop effects
eos/pubsub/message/helper.py
ReplaceText(target='stop_ids' @(154,42)->(154,51))
class MsgHelper: # Unapply effects from targets tgt_getter = getattr(item, '_get_effects_tgts', None) if tgt_getter: effects_tgts = tgt_getter(start_ids) for effect_id, tgt_items in effects_tgts.items(): msgs.append(EffectUnapplied(item, effect_id, tgt_items)) # Stop effects
class MsgHelper: # Unapply effects from targets tgt_getter = getattr(item, '_get_effects_tgts', None) if tgt_getter: effects_tgts = tgt_getter(stop_ids) for effect_id, tgt_items in effects_tgts.items(): msgs.append(EffectUnapplied(item, effect_id, tgt_items)) # Stop effects
748
https://:@github.com/Hasenpfote/fpq.git
8220505c7830967477a5502c061d9efd91d66ae8
@@ -58,7 +58,7 @@ def encode_fp_to_snorm(x, *, dtype=np.uint8, nbits=None): if nbits is None: nbits = max_nbits assert (0 < nbits <= max_nbits), '`nbits` value is out of range.' - mask = np.invert(dtype(np.iinfo(nbits).max) << dtype(nbits)) + mask = np.invert(dtype(np.iinfo(dtype).max) << dtype(nbits)) return dtype(np.around(x * x.dtype.type((1 << (nbits-1)) - 1))) & mask def decode_snorm_to_fp(x, *, dtype=np.float32, nbits=None):
fpq/d3d.py
ReplaceText(target='dtype' @(61,36)->(61,41))
def encode_fp_to_snorm(x, *, dtype=np.uint8, nbits=None): if nbits is None: nbits = max_nbits assert (0 < nbits <= max_nbits), '`nbits` value is out of range.' mask = np.invert(dtype(np.iinfo(nbits).max) << dtype(nbits)) return dtype(np.around(x * x.dtype.type((1 << (nbits-1)) - 1))) & mask def decode_snorm_to_fp(x, *, dtype=np.float32, nbits=None):
def encode_fp_to_snorm(x, *, dtype=np.uint8, nbits=None): if nbits is None: nbits = max_nbits assert (0 < nbits <= max_nbits), '`nbits` value is out of range.' mask = np.invert(dtype(np.iinfo(dtype).max) << dtype(nbits)) return dtype(np.around(x * x.dtype.type((1 << (nbits-1)) - 1))) & mask def decode_snorm_to_fp(x, *, dtype=np.float32, nbits=None):
749
https://:@github.com/theodo/flask-restful.git
4dfe49f1de3dfd9598b4ae92b9e6b6644fa999f7
@@ -338,7 +338,7 @@ class APITestCase(unittest.TestCase): def record(sender, exception): recorded.append(exception) - got_request_exception.connect(record, api) + got_request_exception.connect(record, app) try: with app.test_request_context("/foo"): api.handle_error(exception)
tests/test_api.py
ReplaceText(target='app' @(341,46)->(341,49))
class APITestCase(unittest.TestCase): def record(sender, exception): recorded.append(exception) got_request_exception.connect(record, api) try: with app.test_request_context("/foo"): api.handle_error(exception)
class APITestCase(unittest.TestCase): def record(sender, exception): recorded.append(exception) got_request_exception.connect(record, app) try: with app.test_request_context("/foo"): api.handle_error(exception)
750
https://:@github.com/askholme/django_minifiedstorage.git
0f7821618021d7fb4497a0ddd4312fbbc4e41262
@@ -45,7 +45,7 @@ class MinifiedManifestStaticFilesStorage(ManifestStaticFilesStorage): # save gziped file as fell, we overwrite the content_file variable to save a tiny bit memory try: content = zlib_compress(content) - super(MinifiedManifestStaticFilesStorage, self)._save("%s.gz" % hashed_name,ContentFile(content)) + super(MinifiedManifestStaticFilesStorage, self)._save("%s.gz" % saved_name,ContentFile(content)) except Exception as e: raise MinifiedStorageException("Could not gzip file %s, error: %s" % (hashed_name,e,)) return saved_name \ No newline at end of file
minifiedstorage/storages.py
ReplaceText(target='saved_name' @(48,80)->(48,91))
class MinifiedManifestStaticFilesStorage(ManifestStaticFilesStorage): # save gziped file as fell, we overwrite the content_file variable to save a tiny bit memory try: content = zlib_compress(content) super(MinifiedManifestStaticFilesStorage, self)._save("%s.gz" % hashed_name,ContentFile(content)) except Exception as e: raise MinifiedStorageException("Could not gzip file %s, error: %s" % (hashed_name,e,)) return saved_name \ No newline at end of file
class MinifiedManifestStaticFilesStorage(ManifestStaticFilesStorage): # save gziped file as fell, we overwrite the content_file variable to save a tiny bit memory try: content = zlib_compress(content) super(MinifiedManifestStaticFilesStorage, self)._save("%s.gz" % saved_name,ContentFile(content)) except Exception as e: raise MinifiedStorageException("Could not gzip file %s, error: %s" % (hashed_name,e,)) return saved_name \ No newline at end of file
751
https://:@github.com/SiLab-Bonn/pymosa.git
07741f8afef86a85bf61c13aa8733f6f211195ae
@@ -133,7 +133,7 @@ class TluTuning(m26): # Determine best delay setting (center of working delay settings) good_indices = np.where(np.logical_and(data_array['error_rate'][:-1] == 0, np.diff(data_array['error_rate']) == 0))[0] - best_index = good_indices[good_indices.shape[0] / 2] + best_index = good_indices[good_indices.shape[0] // 2] best_delay_setting = data_array['TRIGGER_DATA_DELAY'][best_index] logging.info('The best delay setting for this setup is %d', best_delay_setting)
pymosa/tune_tlu.py
ReplaceText(target='//' @(136,68)->(136,69))
class TluTuning(m26): # Determine best delay setting (center of working delay settings) good_indices = np.where(np.logical_and(data_array['error_rate'][:-1] == 0, np.diff(data_array['error_rate']) == 0))[0] best_index = good_indices[good_indices.shape[0] / 2] best_delay_setting = data_array['TRIGGER_DATA_DELAY'][best_index] logging.info('The best delay setting for this setup is %d', best_delay_setting)
class TluTuning(m26): # Determine best delay setting (center of working delay settings) good_indices = np.where(np.logical_and(data_array['error_rate'][:-1] == 0, np.diff(data_array['error_rate']) == 0))[0] best_index = good_indices[good_indices.shape[0] // 2] best_delay_setting = data_array['TRIGGER_DATA_DELAY'][best_index] logging.info('The best delay setting for this setup is %d', best_delay_setting)
752
https://:@github.com/dripton/Slugathon.git
641fc1e43403827b046dc1fe69cb6da162d9a83c
@@ -70,7 +70,7 @@ class Marker(object): label = str(self.height) text_width, text_height = draw.textsize(label, font=font) x = 0.65 * leng - 0.5 * text_width - y = 0.55 * leng - 0.5 * text_width + y = 0.55 * leng - 0.5 * text_height draw.rectangle(((x + 0.1 * text_width, y + 0.1 * text_height), (x + 0.9 * text_width, y + 0.9 * text_height)), fill=white) draw.text((x, y), label, fill=black, font=font)
slugathon/Marker.py
ReplaceText(target='text_height' @(73,32)->(73,42))
class Marker(object): label = str(self.height) text_width, text_height = draw.textsize(label, font=font) x = 0.65 * leng - 0.5 * text_width y = 0.55 * leng - 0.5 * text_width draw.rectangle(((x + 0.1 * text_width, y + 0.1 * text_height), (x + 0.9 * text_width, y + 0.9 * text_height)), fill=white) draw.text((x, y), label, fill=black, font=font)
class Marker(object): label = str(self.height) text_width, text_height = draw.textsize(label, font=font) x = 0.65 * leng - 0.5 * text_width y = 0.55 * leng - 0.5 * text_height draw.rectangle(((x + 0.1 * text_width, y + 0.1 * text_height), (x + 0.9 * text_width, y + 0.9 * text_height)), fill=white) draw.text((x, y), label, fill=black, font=font)
753
https://:@github.com/dripton/Slugathon.git
d6957007cf4968b383c258c9894eb638fedb290a
@@ -265,7 +265,7 @@ class Creature(object): skill1 -= 1 elif border == "Wall": skill1 += 1 - elif border2 == "Slope" and not self.is_native(border): + elif border2 == "Slope" and not self.is_native(border2): skill1 -= 1 elif border2 == "Wall": skill1 -= 1
slugathon/Creature.py
ReplaceText(target='border2' @(268,59)->(268,65))
class Creature(object): skill1 -= 1 elif border == "Wall": skill1 += 1 elif border2 == "Slope" and not self.is_native(border): skill1 -= 1 elif border2 == "Wall": skill1 -= 1
class Creature(object): skill1 -= 1 elif border == "Wall": skill1 += 1 elif border2 == "Slope" and not self.is_native(border2): skill1 -= 1 elif border2 == "Wall": skill1 -= 1
754
https://:@github.com/dripton/Slugathon.git
f2bfd2d2c6429dfaa37c5844a52e13124690df13
@@ -238,7 +238,7 @@ class Creature(object): elif border == "Dune" and self.is_native(border): dice += 2 border2 = hex1.opposite_border(hexside) - if border2 == "Dune" and not self.is_native(border): + if border2 == "Dune" and not self.is_native(border2): dice -= 1 elif target in self.rangestrike_targets: dice = int(self.power / 2)
slugathon/Creature.py
ReplaceText(target='border2' @(241,56)->(241,62))
class Creature(object): elif border == "Dune" and self.is_native(border): dice += 2 border2 = hex1.opposite_border(hexside) if border2 == "Dune" and not self.is_native(border): dice -= 1 elif target in self.rangestrike_targets: dice = int(self.power / 2)
class Creature(object): elif border == "Dune" and self.is_native(border): dice += 2 border2 = hex1.opposite_border(hexside) if border2 == "Dune" and not self.is_native(border2): dice -= 1 elif target in self.rangestrike_targets: dice = int(self.power / 2)
755
https://:@github.com/dripton/Slugathon.git
b971ac13adfde83f63ff75be45cc6851d769b86e
@@ -267,7 +267,7 @@ class CleverBot(DimBot.DimBot): max_mean_hits = max(mean_hits, max_mean_hits) # Don't encourage titans to charge early. - if creature.name != "Titan" or game.battle_turn > 4: + if creature.name != "Titan" or game.battle_turn >= 4: score += HIT_BONUS * max_mean_hits score += KILL_BONUS * probable_kill score -= DAMAGE_PENALTY * total_mean_damage_taken
slugathon/ai/CleverBot.py
ReplaceText(target='>=' @(270,60)->(270,61))
class CleverBot(DimBot.DimBot): max_mean_hits = max(mean_hits, max_mean_hits) # Don't encourage titans to charge early. if creature.name != "Titan" or game.battle_turn > 4: score += HIT_BONUS * max_mean_hits score += KILL_BONUS * probable_kill score -= DAMAGE_PENALTY * total_mean_damage_taken
class CleverBot(DimBot.DimBot): max_mean_hits = max(mean_hits, max_mean_hits) # Don't encourage titans to charge early. if creature.name != "Titan" or game.battle_turn >= 4: score += HIT_BONUS * max_mean_hits score += KILL_BONUS * probable_kill score -= DAMAGE_PENALTY * total_mean_damage_taken
756
https://:@github.com/dripton/Slugathon.git
13e968722e4cf18f662d5405ee3bc895929300ec
@@ -173,7 +173,7 @@ class GUIBattleHex(object): if not os.path.exists(border_path): sliceborder.slice_border_image(image_path, border_path, hexsides) - input_surface = cairo.ImageSurface.create_from_png(image_path) + input_surface = cairo.ImageSurface.create_from_png(border_path) input_width = input_surface.get_width() input_height = input_surface.get_height() output_width = myboxsize[0]
slugathon/gui/GUIBattleHex.py
ReplaceText(target='border_path' @(176,67)->(176,77))
class GUIBattleHex(object): if not os.path.exists(border_path): sliceborder.slice_border_image(image_path, border_path, hexsides) input_surface = cairo.ImageSurface.create_from_png(image_path) input_width = input_surface.get_width() input_height = input_surface.get_height() output_width = myboxsize[0]
class GUIBattleHex(object): if not os.path.exists(border_path): sliceborder.slice_border_image(image_path, border_path, hexsides) input_surface = cairo.ImageSurface.create_from_png(border_path) input_width = input_surface.get_width() input_height = input_surface.get_height() output_width = myboxsize[0]
757
https://:@bitbucket.org/fchampalimaud/pythonvideoannotator-models.git
cde08126d01f0e218cf5450cc39caa1bdeb689b6
@@ -47,4 +47,4 @@ class Object2dIO(Object2dBase): func = getattr(self, dataset_conf['factory-function']) dataset = func() dataset.name = name - dataset.load(data, dataset_path) \ No newline at end of file + dataset.load(dataset_conf, dataset_path) \ No newline at end of file
pythonvideoannotator_models/models/video/objects/object2d/object2d_io.py
ReplaceText(target='dataset_conf' @(50,17)->(50,21))
class Object2dIO(Object2dBase): func = getattr(self, dataset_conf['factory-function']) dataset = func() dataset.name = name dataset.load(data, dataset_path) \ No newline at end of file \ No newline at end of file
class Object2dIO(Object2dBase): func = getattr(self, dataset_conf['factory-function']) dataset = func() dataset.name = name \ No newline at end of file dataset.load(dataset_conf, dataset_path) \ No newline at end of file
758
https://:@bitbucket.org/fchampalimaud/pythonvideoannotator-models.git
b567c052b952ce719e2974564f8b6cefb1a1a753
@@ -64,7 +64,7 @@ class PathBase(Dataset): def interpolate_range(self, begin, end, interpolation_mode=None): positions = [[i, self.get_position(i)] for i in range(begin, end+1) if self.get_position(i) is not None] - if len(positions)>2: + if len(positions)>=2: positions = interpolate_positions(positions, begin, end, interpolation_mode) for frame, pos in positions: self.set_position(frame, pos[0], pos[1]) self._tmp_points= []
pythonvideoannotator_models/models/video/objects/object2d/datasets/path/path_base.py
ReplaceText(target='>=' @(67,19)->(67,20))
class PathBase(Dataset): def interpolate_range(self, begin, end, interpolation_mode=None): positions = [[i, self.get_position(i)] for i in range(begin, end+1) if self.get_position(i) is not None] if len(positions)>2: positions = interpolate_positions(positions, begin, end, interpolation_mode) for frame, pos in positions: self.set_position(frame, pos[0], pos[1]) self._tmp_points= []
class PathBase(Dataset): def interpolate_range(self, begin, end, interpolation_mode=None): positions = [[i, self.get_position(i)] for i in range(begin, end+1) if self.get_position(i) is not None] if len(positions)>=2: positions = interpolate_positions(positions, begin, end, interpolation_mode) for frame, pos in positions: self.set_position(frame, pos[0], pos[1]) self._tmp_points= []
759
https://:@bitbucket.org/fchampalimaud/pythonvideoannotator-models.git
190b462c6df6128fd6ffffb055d84a093a07d381
@@ -57,7 +57,7 @@ class VideoIO(VideoBase): dataset_conf = json.load(infile) func = getattr(self, dataset_conf['factory-function']) dataset = func() - dataset.load(data, obj_dir) + dataset.load(dataset_conf, obj_dir) dataset.name = name super(VideoIO, self).load(data, video_path) \ No newline at end of file
pythonvideoannotator_models/models/video/video_io.py
ReplaceText(target='dataset_conf' @(60,17)->(60,21))
class VideoIO(VideoBase): dataset_conf = json.load(infile) func = getattr(self, dataset_conf['factory-function']) dataset = func() dataset.load(data, obj_dir) dataset.name = name super(VideoIO, self).load(data, video_path) \ No newline at end of file
class VideoIO(VideoBase): dataset_conf = json.load(infile) func = getattr(self, dataset_conf['factory-function']) dataset = func() dataset.load(dataset_conf, obj_dir) dataset.name = name super(VideoIO, self).load(data, video_path) \ No newline at end of file
760
https://:@github.com/ch3pjw/junction.git
97f897e1fe41e165333f7a5248c951f686a13a89
@@ -4,7 +4,7 @@ import blessings class Terminal(blessings.Terminal): def draw_block(self, block, x, y): for y, line in enumerate(block, start=y): - self.stream.write(self.move(x, y)) + self.stream.write(self.move(y, x)) self.stream.write(line) _terminal = Terminal()
junction/terminal.py
ArgSwap(idxs=0<->1 @(7,30)->(7,39))
import blessings class Terminal(blessings.Terminal): def draw_block(self, block, x, y): for y, line in enumerate(block, start=y): self.stream.write(self.move(x, y)) self.stream.write(line) _terminal = Terminal()
import blessings class Terminal(blessings.Terminal): def draw_block(self, block, x, y): for y, line in enumerate(block, start=y): self.stream.write(self.move(y, x)) self.stream.write(line) _terminal = Terminal()
761
https://:@gitlab.com/kamichal/renew.git
88823f6ffb58d69e34338f50893049c23739c42c
@@ -90,7 +90,7 @@ class ArgsInspect(object): msg = "Variadic arg has to be stored as a tuple, list or OrderedDict, got {}" raise TypeError(msg.format(type(object_instance).__name__)) - if isinstance(object_instance, OrderedDict): + if isinstance(variadic_arg, OrderedDict): variadic_arg = variadic_arg.items() for attribute_object in variadic_arg:
renew/_inspection.py
ReplaceText(target='variadic_arg' @(93,26)->(93,41))
class ArgsInspect(object): msg = "Variadic arg has to be stored as a tuple, list or OrderedDict, got {}" raise TypeError(msg.format(type(object_instance).__name__)) if isinstance(object_instance, OrderedDict): variadic_arg = variadic_arg.items() for attribute_object in variadic_arg:
class ArgsInspect(object): msg = "Variadic arg has to be stored as a tuple, list or OrderedDict, got {}" raise TypeError(msg.format(type(object_instance).__name__)) if isinstance(variadic_arg, OrderedDict): variadic_arg = variadic_arg.items() for attribute_object in variadic_arg:
762
https://:@github.com/DataIntegrationAlliance/DIRestInvoker.git
968df11afd78a42bb3294d90a0b73a2ae8777ab7
@@ -32,7 +32,7 @@ class WindRestInvoker: ret_dic = None if ret_data.status_code != 200: - if ret_dic is None and 'error_code' in ret_dic and ret_dic['error_code'] == -4001: + if ret_dic is not None and 'error_code' in ret_dic and ret_dic['error_code'] == -4001: logger.error('%s post %s got error\n%s', self._url(path), req_data, ret_dic) return None else:
direstinvoker/iwind.py
ReplaceText(target=' is not ' @(35,22)->(35,26))
class WindRestInvoker: ret_dic = None if ret_data.status_code != 200: if ret_dic is None and 'error_code' in ret_dic and ret_dic['error_code'] == -4001: logger.error('%s post %s got error\n%s', self._url(path), req_data, ret_dic) return None else:
class WindRestInvoker: ret_dic = None if ret_data.status_code != 200: if ret_dic is not None and 'error_code' in ret_dic and ret_dic['error_code'] == -4001: logger.error('%s post %s got error\n%s', self._url(path), req_data, ret_dic) return None else:
763
https://:@github.com/tlevine/blargparse.git
05ce9594f89b154fee2f25a0ece74867756a51ea
@@ -109,7 +109,7 @@ def test_multiple_subparsers(): b = sps.add_parser('b') b.add_argument('--bbb', '-b') - a.add_aggregate('BBB', lambda args:args.bbb.upper()) + b.add_aggregate('BBB', lambda args:args.bbb.upper()) assert bp.parse_args([]) == argparse.Namespace(command = None) assert bp.parse_args(['a', '--aaa', 'tom']) == argparse.Namespace(command = None, aaa = 'tom', AAA = 'TOM')
test_blargparse.py
ReplaceText(target='b' @(112,4)->(112,5))
def test_multiple_subparsers(): b = sps.add_parser('b') b.add_argument('--bbb', '-b') a.add_aggregate('BBB', lambda args:args.bbb.upper()) assert bp.parse_args([]) == argparse.Namespace(command = None) assert bp.parse_args(['a', '--aaa', 'tom']) == argparse.Namespace(command = None, aaa = 'tom', AAA = 'TOM')
def test_multiple_subparsers(): b = sps.add_parser('b') b.add_argument('--bbb', '-b') b.add_aggregate('BBB', lambda args:args.bbb.upper()) assert bp.parse_args([]) == argparse.Namespace(command = None) assert bp.parse_args(['a', '--aaa', 'tom']) == argparse.Namespace(command = None, aaa = 'tom', AAA = 'TOM')
764
https://:@gitlab.com/larsyunker/unithandler.git
db31d7adb35e6ff60a6a719dbe9f7966eee8ab07
@@ -151,7 +151,7 @@ def interpret_unit_block(unitblock: str) -> dict: if char.isdigit(): # if a digit, increase counter num += char elif char == '-' or char == MINUS: # if a negative sign, change sign - sign = -1 + sign *= -1 elif char in [' ', DOT, '*']: # if a separator, ignore pass else: # otherwise add to unit
unithandler/base.py
ReplaceText(target='*=' @(154,17)->(154,18))
def interpret_unit_block(unitblock: str) -> dict: if char.isdigit(): # if a digit, increase counter num += char elif char == '-' or char == MINUS: # if a negative sign, change sign sign = -1 elif char in [' ', DOT, '*']: # if a separator, ignore pass else: # otherwise add to unit
def interpret_unit_block(unitblock: str) -> dict: if char.isdigit(): # if a digit, increase counter num += char elif char == '-' or char == MINUS: # if a negative sign, change sign sign *= -1 elif char in [' ', DOT, '*']: # if a separator, ignore pass else: # otherwise add to unit
765
https://:@github.com/egtaonline/quiesce.git
9cfe8094d875d54dae3bddd8560e5010cd8bf6e8
@@ -70,7 +70,7 @@ async def deviation_payoffs(sched, mix, num, *, boots=0, chunk_size=None): n = num while 0 < n: new_profs = sched.random_deviation_profiles( - min(num, chunk_size), mix).reshape((-1, mix.size)) + min(n, chunk_size), mix).reshape((-1, mix.size)) n -= chunk_size new_futures = [asyncio.ensure_future(sched.sample_payoffs(prof)) for prof in new_profs]
egta/bootstrap.py
ReplaceText(target='n' @(73,16)->(73,19))
async def deviation_payoffs(sched, mix, num, *, boots=0, chunk_size=None): n = num while 0 < n: new_profs = sched.random_deviation_profiles( min(num, chunk_size), mix).reshape((-1, mix.size)) n -= chunk_size new_futures = [asyncio.ensure_future(sched.sample_payoffs(prof)) for prof in new_profs]
async def deviation_payoffs(sched, mix, num, *, boots=0, chunk_size=None): n = num while 0 < n: new_profs = sched.random_deviation_profiles( min(n, chunk_size), mix).reshape((-1, mix.size)) n -= chunk_size new_futures = [asyncio.ensure_future(sched.sample_payoffs(prof)) for prof in new_profs]
766
https://:@github.com/benlindsay/job_tree.git
fd96b394a96e1eb0aac3e2d4df91505e41a4c604
@@ -22,7 +22,7 @@ job_file_list = ['params.input', 'sub.sh'] # Generate a flat job tree submit the jobs. # Add 'submit = False' to prevent submission. -job_tree(tier_list, job_file_list) +job_tree(job_file_list, tier_list) # Running this script should generate a directory tree that looks like this:
samples/flat_sample/test.py
ArgSwap(idxs=0<->1 @(25,0)->(25,8))
job_file_list = ['params.input', 'sub.sh'] # Generate a flat job tree submit the jobs. # Add 'submit = False' to prevent submission. job_tree(tier_list, job_file_list) # Running this script should generate a directory tree that looks like this:
job_file_list = ['params.input', 'sub.sh'] # Generate a flat job tree submit the jobs. # Add 'submit = False' to prevent submission. job_tree(job_file_list, tier_list) # Running this script should generate a directory tree that looks like this:
767
https://:@github.com/lampwins/orangengine.git
27a79be91e8fe3dd41b02ca7e943a21e2bd2b12d
@@ -189,7 +189,7 @@ class BaseDriver(object): if len(set_list) == 0 or len(target_element) > 1: # no valid matches or more than one target element identified (meaning this will have to be a new policy) - return CandidatePolicy(target_dict=target_element) + return CandidatePolicy(target_dict=param_dict) else: # found valid matches # the intersection of all match sets is the set of all policies that the target element can to appended to
orangengine/drivers/base.py
ReplaceText(target='param_dict' @(192,47)->(192,61))
class BaseDriver(object): if len(set_list) == 0 or len(target_element) > 1: # no valid matches or more than one target element identified (meaning this will have to be a new policy) return CandidatePolicy(target_dict=target_element) else: # found valid matches # the intersection of all match sets is the set of all policies that the target element can to appended to
class BaseDriver(object): if len(set_list) == 0 or len(target_element) > 1: # no valid matches or more than one target element identified (meaning this will have to be a new policy) return CandidatePolicy(target_dict=param_dict) else: # found valid matches # the intersection of all match sets is the set of all policies that the target element can to appended to
768
https://:@github.com/korijn/git-lfs-azure-transfer.git
f3d7d7992adb676929d29d12c213d5169d12ccdc
@@ -48,7 +48,7 @@ def report_error(code, message, event=None, oid=None): } if event: payload['event'] = event - if event: + if oid: payload['oid'] = oid write(payload)
git_lfs_azure_transfer.py
ReplaceText(target='oid' @(51,7)->(51,12))
def report_error(code, message, event=None, oid=None): } if event: payload['event'] = event if event: payload['oid'] = oid write(payload)
def report_error(code, message, event=None, oid=None): } if event: payload['event'] = event if oid: payload['oid'] = oid write(payload)
769
https://:@github.com/danielfrg/datasciencebox.git
74ca80ebb2ecf33b71e1926b4c2c6094179aa893
@@ -31,7 +31,7 @@ class Project(object): if not os.path.exists(os.path.join(dir_, 'dsbfile')): raise DSBException('"{}" not found on ""{}" or its parents'.format(settingsfile, path)) - return cls.from_file(filepath=os.path.join(settingsfile, dir_)) + return cls.from_file(filepath=os.path.join(dir_, settingsfile)) @classmethod def from_file(cls, filepath):
datasciencebox/core/project.py
ArgSwap(idxs=0<->1 @(34,38)->(34,50))
class Project(object): if not os.path.exists(os.path.join(dir_, 'dsbfile')): raise DSBException('"{}" not found on ""{}" or its parents'.format(settingsfile, path)) return cls.from_file(filepath=os.path.join(settingsfile, dir_)) @classmethod def from_file(cls, filepath):
class Project(object): if not os.path.exists(os.path.join(dir_, 'dsbfile')): raise DSBException('"{}" not found on ""{}" or its parents'.format(settingsfile, path)) return cls.from_file(filepath=os.path.join(dir_, settingsfile)) @classmethod def from_file(cls, filepath):
770
https://:@github.com/nick-youngblut/SIPSim.git
f11ace61e1ba5fdb7afc8a9ec4409cb37e643558
@@ -146,7 +146,7 @@ class SimFrags(object): # draw from fragment size distribution fragSize = int(self.fld(size=1)) - if fragSize < readTempSize: + if fragSize <= readTempSize: tryCnt += 1 continue
lib/SimFrags.py
ReplaceText(target='<=' @(149,24)->(149,25))
class SimFrags(object): # draw from fragment size distribution fragSize = int(self.fld(size=1)) if fragSize < readTempSize: tryCnt += 1 continue
class SimFrags(object): # draw from fragment size distribution fragSize = int(self.fld(size=1)) if fragSize <= readTempSize: tryCnt += 1 continue
771
https://:@github.com/Akuli/pythotk.git
c16149611fdeb7017bf65828c54d4c5bdf9edcc4
@@ -132,7 +132,7 @@ class Widget: # use some_widget.to_tcl() to access the _widget_path self._widget_path = '%s.%s%d' % ( - parentpath, safe_class_name, next(counts[widgetname])) + parentpath, safe_class_name, next(counts[safe_class_name])) # TODO: some config options can only be given when the widget is # created, add support for them
pythotk/_widgets.py
ReplaceText(target='safe_class_name' @(135,53)->(135,63))
class Widget: # use some_widget.to_tcl() to access the _widget_path self._widget_path = '%s.%s%d' % ( parentpath, safe_class_name, next(counts[widgetname])) # TODO: some config options can only be given when the widget is # created, add support for them
class Widget: # use some_widget.to_tcl() to access the _widget_path self._widget_path = '%s.%s%d' % ( parentpath, safe_class_name, next(counts[safe_class_name])) # TODO: some config options can only be given when the widget is # created, add support for them
772
https://:@github.com/claird/PyPDF4.git
d5738dccbca3cf4d2eaf7e307a853dc31baf4a53
@@ -117,7 +117,7 @@ class FlateDecode(object): rowlength = columns + 1 assert len(data) % rowlength == 0 prev_rowdata = (0,) * rowlength - for row in range(len(data) / rowlength): + for row in range(len(data) // rowlength): rowdata = [ord(x) for x in data[(row*rowlength):((row+1)*rowlength)]] filterByte = rowdata[0] if filterByte == 0:
PyPDF2/filters.py
ReplaceText(target='//' @(120,43)->(120,44))
class FlateDecode(object): rowlength = columns + 1 assert len(data) % rowlength == 0 prev_rowdata = (0,) * rowlength for row in range(len(data) / rowlength): rowdata = [ord(x) for x in data[(row*rowlength):((row+1)*rowlength)]] filterByte = rowdata[0] if filterByte == 0:
class FlateDecode(object): rowlength = columns + 1 assert len(data) % rowlength == 0 prev_rowdata = (0,) * rowlength for row in range(len(data) // rowlength): rowdata = [ord(x) for x in data[(row*rowlength):((row+1)*rowlength)]] filterByte = rowdata[0] if filterByte == 0:
773
https://:@github.com/HUJI-Deep/FlowKet.git
cfb8f9d326ceeeb03c9daa2a4be25e9a1e74064d
@@ -42,7 +42,7 @@ class ExactVariational(object): if self.num_of_states % batch_size != 0: raise Exception('In exact the batch size must divide the total number of states in the system') self.batch_size = batch_size - self.num_of_batch_until_full_cycle = self.num_of_states / self.batch_size + self.num_of_batch_until_full_cycle = self.num_of_states // self.batch_size self.batch_complex_local_energies = np.zeros((self.batch_size, ), dtype=np.complex128) self.batch_naive_complex_local_energies = np.zeros((self.batch_size, ), dtype=np.complex128)
src/pyket/optimization/exact_variational.py
ReplaceText(target='//' @(45,64)->(45,65))
class ExactVariational(object): if self.num_of_states % batch_size != 0: raise Exception('In exact the batch size must divide the total number of states in the system') self.batch_size = batch_size self.num_of_batch_until_full_cycle = self.num_of_states / self.batch_size self.batch_complex_local_energies = np.zeros((self.batch_size, ), dtype=np.complex128) self.batch_naive_complex_local_energies = np.zeros((self.batch_size, ), dtype=np.complex128)
class ExactVariational(object): if self.num_of_states % batch_size != 0: raise Exception('In exact the batch size must divide the total number of states in the system') self.batch_size = batch_size self.num_of_batch_until_full_cycle = self.num_of_states // self.batch_size self.batch_complex_local_energies = np.zeros((self.batch_size, ), dtype=np.complex128) self.batch_naive_complex_local_energies = np.zeros((self.batch_size, ), dtype=np.complex128)
774
https://:@github.com/eriknyquist/text_game_maker.git
a890d63064b801645a425df5d2d69ad4a9056d8f
@@ -61,7 +61,7 @@ def craft(name, word, inventory): item = None if name in craftables: - items, item = craftables[item] + items, item = craftables[name] else: for k in craftables: if k.startswith(name) or k.endswith(name) or (k in name):
text_game_maker/crafting/crafting.py
ReplaceText(target='name' @(64,33)->(64,37))
def craft(name, word, inventory): item = None if name in craftables: items, item = craftables[item] else: for k in craftables: if k.startswith(name) or k.endswith(name) or (k in name):
def craft(name, word, inventory): item = None if name in craftables: items, item = craftables[name] else: for k in craftables: if k.startswith(name) or k.endswith(name) or (k in name):
775
https://:@github.com/eriknyquist/text_game_maker.git
2868976cf5790d39282843924148eae25102c6be
@@ -55,7 +55,7 @@ def help_text(): def _find_item(item, items): for i in items: if (i.name == item.name) and isinstance(i, item.__class__): - return item + return i return None
text_game_maker/crafting/crafting.py
ReplaceText(target='i' @(58,19)->(58,23))
def help_text(): def _find_item(item, items): for i in items: if (i.name == item.name) and isinstance(i, item.__class__): return item return None
def help_text(): def _find_item(item, items): for i in items: if (i.name == item.name) and isinstance(i, item.__class__): return i return None
776
https://:@github.com/SkyTruth/gpsd_format.git
07dd93add6bd9e448eb4ac87ed6fdc43cc94f5d2
@@ -92,6 +92,6 @@ def etl(ctx, infile, outfile, filter_expr, sort_field, do=output_driver_opts, co=output_compression_opts) as dst: - iterator = gpsdio.filter(src, filter_expr) if filter_expr else src + iterator = gpsdio.filter(filter_expr, src) if filter_expr else src for msg in gpsdio.sort(iterator, sort_field) if sort_field else iterator: dst.write(msg)
gpsdio/cli/etl.py
ArgSwap(idxs=0<->1 @(95,23)->(95,36))
def etl(ctx, infile, outfile, filter_expr, sort_field, do=output_driver_opts, co=output_compression_opts) as dst: iterator = gpsdio.filter(src, filter_expr) if filter_expr else src for msg in gpsdio.sort(iterator, sort_field) if sort_field else iterator: dst.write(msg)
def etl(ctx, infile, outfile, filter_expr, sort_field, do=output_driver_opts, co=output_compression_opts) as dst: iterator = gpsdio.filter(filter_expr, src) if filter_expr else src for msg in gpsdio.sort(iterator, sort_field) if sort_field else iterator: dst.write(msg)
777
https://:@github.com/barry-lab/openEPhys_DACQ.git
14df7f0f939a8dace7020265f1695e06451d7f87
@@ -67,7 +67,7 @@ def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_lengt sys.stdout.write('%s |%s| %s%s %s\r' % (prefix, bar, percents, '%', suffix)), - if iteration == total: + if iteration >= total: sys.stdout.write('\n') sys.stdout.flush() # #
HelperFunctions.py
ReplaceText(target='>=' @(70,17)->(70,19))
def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_lengt sys.stdout.write('%s |%s| %s%s %s\r' % (prefix, bar, percents, '%', suffix)), if iteration == total: sys.stdout.write('\n') sys.stdout.flush() # #
def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_lengt sys.stdout.write('%s |%s| %s%s %s\r' % (prefix, bar, percents, '%', suffix)), if iteration >= total: sys.stdout.write('\n') sys.stdout.flush() # #
778
https://:@github.com/fy0/mapi.git
3c322eb25527f719a55a7de8eec82bd6620546d2
@@ -530,7 +530,7 @@ class AbstractSQLView(BaseView): logger.debug('set data: %s' % values) code, data = await self._sql.update(info, values) if code == RETCODE.SUCCESS: - await async_call(self.after_update, data) + await async_call(self.after_update, values) self.finish(code, data) async def new(self):
slim/base/view.py
ReplaceText(target='values' @(533,48)->(533,52))
class AbstractSQLView(BaseView): logger.debug('set data: %s' % values) code, data = await self._sql.update(info, values) if code == RETCODE.SUCCESS: await async_call(self.after_update, data) self.finish(code, data) async def new(self):
class AbstractSQLView(BaseView): logger.debug('set data: %s' % values) code, data = await self._sql.update(info, values) if code == RETCODE.SUCCESS: await async_call(self.after_update, values) self.finish(code, data) async def new(self):
779
https://:@github.com/fy0/mapi.git
d340368fbcf91c1c9377fabcb5722ffdef798501
@@ -15,7 +15,7 @@ def require_role(role=None): def request_role(role=None): def _(func): async def __(view: AbstractSQLView, *args, **kwargs): - if role == view.current_request_role: + if role != view.current_request_role: return view.finish(RETCODE.INVALID_ROLE) return await func(view, *args, **kwargs) return __
slim/ext/decorator.py
ReplaceText(target='!=' @(18,20)->(18,22))
def require_role(role=None): def request_role(role=None): def _(func): async def __(view: AbstractSQLView, *args, **kwargs): if role == view.current_request_role: return view.finish(RETCODE.INVALID_ROLE) return await func(view, *args, **kwargs) return __
def require_role(role=None): def request_role(role=None): def _(func): async def __(view: AbstractSQLView, *args, **kwargs): if role != view.current_request_role: return view.finish(RETCODE.INVALID_ROLE) return await func(view, *args, **kwargs) return __
780
https://:@github.com/Gurbert/micawber_bs4_classes.git
7a07d3b013c907c11a54cf2cedc7954c554770de
@@ -164,7 +164,7 @@ def _is_standalone(soup_elem): def _inside_skip(soup_elem): parent = soup_elem.parent while parent is not None: - if parent.name not in skip_elements: + if parent.name in skip_elements: return True parent = parent.parent return False
micawber/parsers.py
ReplaceText(target=' in ' @(167,22)->(167,30))
def _is_standalone(soup_elem): def _inside_skip(soup_elem): parent = soup_elem.parent while parent is not None: if parent.name not in skip_elements: return True parent = parent.parent return False
def _is_standalone(soup_elem): def _inside_skip(soup_elem): parent = soup_elem.parent while parent is not None: if parent.name in skip_elements: return True parent = parent.parent return False
781
https://:@github.com/pgeurin/autoregression.git
dc4b2c89e719c6a94f3a4e0ab632aec2a5990c35
@@ -488,7 +488,7 @@ def compare_predictions(df, y_var_name, percent_data=None, timeit(plot_rocs, models, df_X, y) plt.show() print(f'MAKE SUBSAMPLE TIME: {time() - starttotal}') - return names, results, models, pipeline, df_X + return names, results, fit_models, pipeline, df_X def bootstrap_train_premade(model, X, y, bootstraps=1000, **kwargs): """Train a (linear) model on multiple bootstrap samples of some data and
autoregression/autoregression.py
ReplaceText(target='fit_models' @(491,27)->(491,33))
def compare_predictions(df, y_var_name, percent_data=None, timeit(plot_rocs, models, df_X, y) plt.show() print(f'MAKE SUBSAMPLE TIME: {time() - starttotal}') return names, results, models, pipeline, df_X def bootstrap_train_premade(model, X, y, bootstraps=1000, **kwargs): """Train a (linear) model on multiple bootstrap samples of some data and
def compare_predictions(df, y_var_name, percent_data=None, timeit(plot_rocs, models, df_X, y) plt.show() print(f'MAKE SUBSAMPLE TIME: {time() - starttotal}') return names, results, fit_models, pipeline, df_X def bootstrap_train_premade(model, X, y, bootstraps=1000, **kwargs): """Train a (linear) model on multiple bootstrap samples of some data and
782
https://:@github.com/xRodney/suds-sw.git
8b72570029cb884a8b5bf46aa00deedadb150c3c
@@ -130,7 +130,7 @@ class UMBase: return content.data lang = attributes.lang() if not len(node.children) and content.text is None: - if self.nillable(content.data) and content.node.isnil(): + if self.nillable(content.data) or content.node.isnil(): return None else: return xlstr.string('', lang)
suds/bindings/unmarshaller.py
ReplaceText(target='or' @(133,43)->(133,46))
class UMBase: return content.data lang = attributes.lang() if not len(node.children) and content.text is None: if self.nillable(content.data) and content.node.isnil(): return None else: return xlstr.string('', lang)
class UMBase: return content.data lang = attributes.lang() if not len(node.children) and content.text is None: if self.nillable(content.data) or content.node.isnil(): return None else: return xlstr.string('', lang)
783
https://:@github.com/xRodney/suds-sw.git
c2ef63c56cdb827e47426ce8debd547275122cc6
@@ -113,6 +113,6 @@ class Options(Skin): Definition('retxml', bool, False), Definition('autoblend', bool, False), Definition('cachingpolicy', int, 0), - Definition('plugins', [], (list, tuple)), + Definition('plugins', (list, tuple), []), ] Skin.__init__(self, domain, definitions, kwargs)
suds/options.py
ArgSwap(idxs=1<->2 @(116,12)->(116,22))
class Options(Skin): Definition('retxml', bool, False), Definition('autoblend', bool, False), Definition('cachingpolicy', int, 0), Definition('plugins', [], (list, tuple)), ] Skin.__init__(self, domain, definitions, kwargs)
class Options(Skin): Definition('retxml', bool, False), Definition('autoblend', bool, False), Definition('cachingpolicy', int, 0), Definition('plugins', (list, tuple), []), ] Skin.__init__(self, domain, definitions, kwargs)
784
https://:@gitlab.com/frkl/bring.git
ccb052917ef3d193526ee99eec8968df96a1c199
@@ -306,7 +306,7 @@ class Bring(SimpleTing): ctx: BringDynamicContextTing = self._tingistry_obj.create_ting( # type: ignore "bring_dynamic_context_ting", f"{BRING_CONTEXT_NAMESPACE}.{context_name}" ) - indexes = [folder] + indexes = [_path] ctx.input.set_values( # type: ignore ting_dict={"indexes": indexes} )
src/bring/bring.py
ReplaceText(target='_path' @(309,19)->(309,25))
class Bring(SimpleTing): ctx: BringDynamicContextTing = self._tingistry_obj.create_ting( # type: ignore "bring_dynamic_context_ting", f"{BRING_CONTEXT_NAMESPACE}.{context_name}" ) indexes = [folder] ctx.input.set_values( # type: ignore ting_dict={"indexes": indexes} )
class Bring(SimpleTing): ctx: BringDynamicContextTing = self._tingistry_obj.create_ting( # type: ignore "bring_dynamic_context_ting", f"{BRING_CONTEXT_NAMESPACE}.{context_name}" ) indexes = [_path] ctx.input.set_values( # type: ignore ting_dict={"indexes": indexes} )
785
https://:@gitlab.com/frkl/bring.git
8e4f6b2742ec941ab386856234415827f8f77429
@@ -10,7 +10,7 @@ app_name = "bring" _hi = load_modules(BRINGISTRY_PRELOAD_MODULES) # type: ignore pyinstaller = {"hiddenimports": [x.__name__ for x in _hi]} -if os.name != "nt": +if os.name == "nt": import pkgutil import jinxed.terminfo
src/bring/_meta.py
ReplaceText(target='==' @(13,11)->(13,13))
app_name = "bring" _hi = load_modules(BRINGISTRY_PRELOAD_MODULES) # type: ignore pyinstaller = {"hiddenimports": [x.__name__ for x in _hi]} if os.name != "nt": import pkgutil import jinxed.terminfo
app_name = "bring" _hi = load_modules(BRINGISTRY_PRELOAD_MODULES) # type: ignore pyinstaller = {"hiddenimports": [x.__name__ for x in _hi]} if os.name == "nt": import pkgutil import jinxed.terminfo
786
https://:@gitlab.com/frkl/bring.git
d67c17a6b4f41c01764315a5f6205a1264b6d3f0
@@ -242,4 +242,4 @@ class BringContextTing(InheriTing, SimpleTing): _all_values["_bring_metadata_timestamp"] = str(arrow.now()) - return all_values + return _all_values
src/bring/context/__init__.py
ReplaceText(target='_all_values' @(245,15)->(245,25))
class BringContextTing(InheriTing, SimpleTing): _all_values["_bring_metadata_timestamp"] = str(arrow.now()) return all_values
class BringContextTing(InheriTing, SimpleTing): _all_values["_bring_metadata_timestamp"] = str(arrow.now()) return _all_values
787
https://:@gitlab.com/frkl/bring.git
112f00eaba6972dab7ead12bea4ca077f4ef5a6c
@@ -110,7 +110,7 @@ def create_table_from_pkg_args( _allowed_strings = [] for _arg, _aliases in _allowed.items(): - if not aliases: + if not _aliases: a = _arg elif len(_aliases) == 1: a = f"{_arg} (alias: {_aliases[0]})"
src/bring/display/args.py
ReplaceText(target='_aliases' @(113,23)->(113,30))
def create_table_from_pkg_args( _allowed_strings = [] for _arg, _aliases in _allowed.items(): if not aliases: a = _arg elif len(_aliases) == 1: a = f"{_arg} (alias: {_aliases[0]})"
def create_table_from_pkg_args( _allowed_strings = [] for _arg, _aliases in _allowed.items(): if not _aliases: a = _arg elif len(_aliases) == 1: a = f"{_arg} (alias: {_aliases[0]})"
788
https://:@gitlab.com/frkl/bring.git
6ebf8d8d3c86da43d5fe0505544d7329e4c6abf5
@@ -135,7 +135,7 @@ class BringInstallGroup(FrklBaseCommand): install_args = {} if target: install_args["target"] = target - if install_args: + if target_config: install_args["target_config"] = target_config # install_args["merge_strategy"] = merge_strategy
src/bring/interfaces/cli/install.py
ReplaceText(target='target_config' @(138,11)->(138,23))
class BringInstallGroup(FrklBaseCommand): install_args = {} if target: install_args["target"] = target if install_args: install_args["target_config"] = target_config # install_args["merge_strategy"] = merge_strategy
class BringInstallGroup(FrklBaseCommand): install_args = {} if target: install_args["target"] = target if target_config: install_args["target_config"] = target_config # install_args["merge_strategy"] = merge_strategy
789
https://:@github.com/glyph/twitter-text-py.git
197cbd58689e6f12f0b2e931c615eb816b6a8051
@@ -60,7 +60,7 @@ class HitHighlighter(object): if index % 2: # we're inside a <tag> continue - chunk_start = len(u''.join(text_chunks[0:index / 2])) + chunk_start = len(u''.join(text_chunks[0:index // 2])) chunk_end = chunk_start + len(chunk) if hit_start >= chunk_start and hit_start < chunk_end: chunk = chunk[:hit_start - chunk_start] + tags[0] + chunk[hit_start - chunk_start:]
twitter_text/highlighter.py
ReplaceText(target='//' @(63,63)->(63,64))
class HitHighlighter(object): if index % 2: # we're inside a <tag> continue chunk_start = len(u''.join(text_chunks[0:index / 2])) chunk_end = chunk_start + len(chunk) if hit_start >= chunk_start and hit_start < chunk_end: chunk = chunk[:hit_start - chunk_start] + tags[0] + chunk[hit_start - chunk_start:]
class HitHighlighter(object): if index % 2: # we're inside a <tag> continue chunk_start = len(u''.join(text_chunks[0:index // 2])) chunk_end = chunk_start + len(chunk) if hit_start >= chunk_start and hit_start < chunk_end: chunk = chunk[:hit_start - chunk_start] + tags[0] + chunk[hit_start - chunk_start:]
790
https://:@github.com/lbovet/yglu.git
73ec7a7721281cf2ab16b00be2a64da5ba43697f
@@ -42,7 +42,7 @@ def import_definition(context, root): errors = root.doc.errors else: errors = None - result = build(file, filename, errors) + result = build(file, filepath, errors) return Holder(result) context['$import'] = import_function
yglu/functions.py
ReplaceText(target='filepath' @(45,33)->(45,41))
def import_definition(context, root): errors = root.doc.errors else: errors = None result = build(file, filename, errors) return Holder(result) context['$import'] = import_function
def import_definition(context, root): errors = root.doc.errors else: errors = None result = build(file, filepath, errors) return Holder(result) context['$import'] = import_function
791
https://:@github.com/inforian/django-password-manager.git
5e7e6c14fa393d7e814556c9b02869d9f3adcd84
@@ -77,7 +77,7 @@ def check_password_expired(user): # get latest password info latest = user.password_history.latest("pk") except PasswordHistory.DoesNotExist: - return False + return True now = datetime.now(tz=pytz.UTC) expiration = latest.timestamp + timedelta(days=expiry)
pass_manager/utils.py
ReplaceText(target='True' @(80,15)->(80,20))
def check_password_expired(user): # get latest password info latest = user.password_history.latest("pk") except PasswordHistory.DoesNotExist: return False now = datetime.now(tz=pytz.UTC) expiration = latest.timestamp + timedelta(days=expiry)
def check_password_expired(user): # get latest password info latest = user.password_history.latest("pk") except PasswordHistory.DoesNotExist: return True now = datetime.now(tz=pytz.UTC) expiration = latest.timestamp + timedelta(days=expiry)
792
https://:@github.com/koriavinash1/DeepBrainSeg.git
a09812c3f5b8348b1bbfc0e06669490c9a204ec7
@@ -109,7 +109,7 @@ def GenerateCSV(model, dataset_path, logs_root, iteration = 0): spath['seg'] = os.path.join(subject_path, subject + '_seg.nii.gz') spath['t1'] = os.path.join(subject_path, subject + '_t1.nii.gz') spath['t2'] = os.path.join(subject_path, subject + '_t2.nii.gz') - spath['mask'] = os.path.join(dataset_path, 'mask.nii.gz') + spath['mask'] = os.path.join(subject_path, 'mask.nii.gz') vol, seg, affine = nii_loader(spath) predictions = _GenerateSegmentation_(subject_path, vol, seg, size = 64, nclasses = 5)
DeepBrainSeg/tumor/finetune/generateCSV.py
ReplaceText(target='subject_path' @(112,42)->(112,54))
def GenerateCSV(model, dataset_path, logs_root, iteration = 0): spath['seg'] = os.path.join(subject_path, subject + '_seg.nii.gz') spath['t1'] = os.path.join(subject_path, subject + '_t1.nii.gz') spath['t2'] = os.path.join(subject_path, subject + '_t2.nii.gz') spath['mask'] = os.path.join(dataset_path, 'mask.nii.gz') vol, seg, affine = nii_loader(spath) predictions = _GenerateSegmentation_(subject_path, vol, seg, size = 64, nclasses = 5)
def GenerateCSV(model, dataset_path, logs_root, iteration = 0): spath['seg'] = os.path.join(subject_path, subject + '_seg.nii.gz') spath['t1'] = os.path.join(subject_path, subject + '_t1.nii.gz') spath['t2'] = os.path.join(subject_path, subject + '_t2.nii.gz') spath['mask'] = os.path.join(subject_path, 'mask.nii.gz') vol, seg, affine = nii_loader(spath) predictions = _GenerateSegmentation_(subject_path, vol, seg, size = 64, nclasses = 5)
793
https://:@github.com/codepost-io/codePost-python.git
00320258dd53e987c66c9af2d021fb93b38ac20c
@@ -812,7 +812,7 @@ def remove_comments(api_key, submission_id=None, file_id=None): headers=auth_headers ) - if r.status_code != 204: + if r.status_code == 204: comments_to_delete += r.json().get("comments", list()) deleted_comments += 1 except:
codePost_api/helpers.py
ReplaceText(target='==' @(815,29)->(815,31))
def remove_comments(api_key, submission_id=None, file_id=None): headers=auth_headers ) if r.status_code != 204: comments_to_delete += r.json().get("comments", list()) deleted_comments += 1 except:
def remove_comments(api_key, submission_id=None, file_id=None): headers=auth_headers ) if r.status_code == 204: comments_to_delete += r.json().get("comments", list()) deleted_comments += 1 except:
794
https://:@github.com/yuvipanda/python-mwapi.git
908d0cbc6945c46acc6f9536d95ad78dc3e157e9
@@ -16,7 +16,7 @@ import sys import os -sys.path.insert("..", 0) +sys.path.insert(0, "..") import mwapi
doc/conf.py
ArgSwap(idxs=0<->1 @(19,0)->(19,15))
-16,7 +16,7 @@ import sys import os sys.path.insert("..", 0) import mwapi
-16,7 +16,7 @@ import sys import os sys.path.insert(0, "..") import mwapi
795
https://:@github.com/jplusplus/thenmap-python.git
70432b792f441d2bac26c2da2744fa5d67f47af3
@@ -26,7 +26,7 @@ def point_from_coordinates(input_): for sep in [",", ";", "|"]: if len(input_.split(sep)) in range(2, 3): t = input_.split(sep) - if isinstance(input_, string_types): + if isinstance(t, string_types): raise Exception("Invalid coordinates: %s" % input_) elif isinstance(input_, Iterable):
thenmap/thenmap.py
ReplaceText(target='t' @(29,22)->(29,28))
def point_from_coordinates(input_): for sep in [",", ";", "|"]: if len(input_.split(sep)) in range(2, 3): t = input_.split(sep) if isinstance(input_, string_types): raise Exception("Invalid coordinates: %s" % input_) elif isinstance(input_, Iterable):
def point_from_coordinates(input_): for sep in [",", ";", "|"]: if len(input_.split(sep)) in range(2, 3): t = input_.split(sep) if isinstance(t, string_types): raise Exception("Invalid coordinates: %s" % input_) elif isinstance(input_, Iterable):
796
https://:@github.com/cardsurf/xcrawler.git
79aaaca3e4cbf7f79efa5f3a9168fb9089b73d40
@@ -13,4 +13,4 @@ class UrlInfo: def is_relative(self, url): domain = self.url_splitter.get_domain(url) - return len(domain) > 0 + return len(domain) == 0
xcrawler/http/urls/url_info.py
ReplaceText(target='==' @(16,27)->(16,28))
class UrlInfo: def is_relative(self, url): domain = self.url_splitter.get_domain(url) return len(domain) > 0
class UrlInfo: def is_relative(self, url): domain = self.url_splitter.get_domain(url) return len(domain) == 0
797
https://:@github.com/asafpr/pro_clash.git
f487619296c37a989d4dc647d1c204c1acc15e44
@@ -898,7 +898,7 @@ def get_names(gname, uid_names, annotations): p1_desc = '-' p0_desc += ' : %s'%p1_desc - elif len(gname)>2: + elif len(gname)>=2: p0_name += '_%s'%gname[1] return p0_name, p0_desc
pro_clash/__init__.py
ReplaceText(target='>=' @(901,19)->(901,20))
def get_names(gname, uid_names, annotations): p1_desc = '-' p0_desc += ' : %s'%p1_desc elif len(gname)>2: p0_name += '_%s'%gname[1] return p0_name, p0_desc
def get_names(gname, uid_names, annotations): p1_desc = '-' p0_desc += ' : %s'%p1_desc elif len(gname)>=2: p0_name += '_%s'%gname[1] return p0_name, p0_desc
798
https://:@github.com/asafpr/pro_clash.git
fcb3edb3acefd3224f0e5473495435d197989c81
@@ -525,7 +525,7 @@ def read_bam_file(bamfile, chrnames_bam, max_NM=0): for al in alt_list: apos = int(al[1][1:]) # test this alternative only if its NM is as the original one - if int(apos[3])>nm_num: + if int(al[3])>nm_num: continue if apos < min_pos: min_pos = apos
pro_clash/__init__.py
ReplaceText(target='al' @(528,23)->(528,27))
def read_bam_file(bamfile, chrnames_bam, max_NM=0): for al in alt_list: apos = int(al[1][1:]) # test this alternative only if its NM is as the original one if int(apos[3])>nm_num: continue if apos < min_pos: min_pos = apos
def read_bam_file(bamfile, chrnames_bam, max_NM=0): for al in alt_list: apos = int(al[1][1:]) # test this alternative only if its NM is as the original one if int(al[3])>nm_num: continue if apos < min_pos: min_pos = apos
799
https://:@github.com/Anastadev/anastasia.git
03a356f19a8c995ff2dec074b8b133244fab1c2c
@@ -21,7 +21,7 @@ steam_handler.setLevel(logging.DEBUG) steam_handler.setFormatter(formatter) log.addHandler(steam_handler) -updater = Updater(token=sys.argv[0]) +updater = Updater(token=sys.argv[1]) dispatcher = updater.dispatcher
Main.py
ReplaceText(target='1' @(24,33)->(24,34))
steam_handler.setLevel(logging.DEBUG) steam_handler.setFormatter(formatter) log.addHandler(steam_handler) updater = Updater(token=sys.argv[0]) dispatcher = updater.dispatcher
steam_handler.setLevel(logging.DEBUG) steam_handler.setFormatter(formatter) log.addHandler(steam_handler) updater = Updater(token=sys.argv[1]) dispatcher = updater.dispatcher