diff --git "a/PyPiBugs.csv" "b/PyPiBugs.csv"
new file mode 100644--- /dev/null
+++ "b/PyPiBugs.csv"
@@ -0,0 +1,57781 @@
+,repo,hash,diff,old_path,rewrite,initial_state,final_state
+0,https://:@github.com/emedvedev/attention-ocr.git,291042e7cb623c8a908e9badd132c1fa2360288c,"@@ -465,7 +465,7 @@ class Model(object):
+ mh = 32
+ mw = math.floor(1. * w / h * mh)
+ img = img.resize(
+- (mw, h),
++ (mw, mh),
+ Image.ANTIALIAS)
+ img_data = np.asarray(img, dtype=np.uint8)
+ for idx in xrange(len(output)):
+",aocr/model/model.py,"ReplaceText(target='mh' @(468,25)->(468,26))","class Model(object):
+ mh = 32
+ mw = math.floor(1. * w / h * mh)
+ img = img.resize(
+ (mw, h),
+ Image.ANTIALIAS)
+ img_data = np.asarray(img, dtype=np.uint8)
+ for idx in xrange(len(output)):","class Model(object):
+ mh = 32
+ mw = math.floor(1. * w / h * mh)
+ img = img.resize(
+ (mw, mh),
+ Image.ANTIALIAS)
+ img_data = np.asarray(img, dtype=np.uint8)
+ for idx in xrange(len(output)):"
+1,https://:@github.com/emedvedev/attention-ocr.git,6e6593c27fe0e63118adadf11562b1c4699b14e3,"@@ -477,7 +477,7 @@ class Model(object):
+ attention_orig[i] = attention[int(i/4)-1]
+ attention_orig = np.convolve(attention_orig, [0.199547, 0.200226, 0.200454, 0.200226, 0.199547], mode='same')
+ attention_orig = np.maximum(attention_orig, 0.3)
+- attention_out = np.zeros((h, mw))
++ attention_out = np.zeros((mh, mw))
+ for i in xrange(mw):
+ attention_out[:, i] = attention_orig[i]
+ if len(img_data.shape) == 3:
+",aocr/model/model.py,"ReplaceText(target='mh' @(480,42)->(480,43))","class Model(object):
+ attention_orig[i] = attention[int(i/4)-1]
+ attention_orig = np.convolve(attention_orig, [0.199547, 0.200226, 0.200454, 0.200226, 0.199547], mode='same')
+ attention_orig = np.maximum(attention_orig, 0.3)
+ attention_out = np.zeros((h, mw))
+ for i in xrange(mw):
+ attention_out[:, i] = attention_orig[i]
+ if len(img_data.shape) == 3:","class Model(object):
+ attention_orig[i] = attention[int(i/4)-1]
+ attention_orig = np.convolve(attention_orig, [0.199547, 0.200226, 0.200454, 0.200226, 0.199547], mode='same')
+ attention_orig = np.maximum(attention_orig, 0.3)
+ attention_out = np.zeros((mh, mw))
+ for i in xrange(mw):
+ attention_out[:, i] = attention_orig[i]
+ if len(img_data.shape) == 3:"
+2,https://:@github.com/emedvedev/attention-ocr.git,e741baf7170e72a974754908d323cacc0bd55247,"@@ -133,7 +133,7 @@ class Model(object):
+ self.target_weights = []
+ for i in xrange(self.decoder_size + 1):
+ self.decoder_inputs.append(
+- tf.tile([0], [num_images])
++ tf.tile([1], [num_images])
+ )
+ if i < self.decoder_size:
+ self.target_weights.append(tf.tile([1.], [num_images]))
+",aocr/model/model.py,"ReplaceText(target='1' @(136,29)->(136,30))","class Model(object):
+ self.target_weights = []
+ for i in xrange(self.decoder_size + 1):
+ self.decoder_inputs.append(
+ tf.tile([0], [num_images])
+ )
+ if i < self.decoder_size:
+ self.target_weights.append(tf.tile([1.], [num_images]))","class Model(object):
+ self.target_weights = []
+ for i in xrange(self.decoder_size + 1):
+ self.decoder_inputs.append(
+ tf.tile([1], [num_images])
+ )
+ if i < self.decoder_size:
+ self.target_weights.append(tf.tile([1.], [num_images]))"
+3,https://:@github.com/matthewdowney/TogglPy.git,d5b630aec58d29b85ccffa527d24766eef6f61f9,"@@ -197,7 +197,7 @@ class Toggl():
+ day = datetime.now().day if not day else day
+ hour = datetime.now().hour if not hour else hour
+
+- timestruct = datetime(year, month, day, hour - hourdiff).isoformat() + '.000Z'
++ timestruct = datetime(year, month, day, hour + hourdiff).isoformat() + '.000Z'
+ data['time_entry']['start'] = timestruct
+ data['time_entry']['duration'] = hourduration * 3600
+ data['time_entry']['pid'] = projectid
+",toggl/TogglPy.py,"ReplaceText(target='+' @(200,53)->(200,54))","class Toggl():
+ day = datetime.now().day if not day else day
+ hour = datetime.now().hour if not hour else hour
+
+ timestruct = datetime(year, month, day, hour - hourdiff).isoformat() + '.000Z'
+ data['time_entry']['start'] = timestruct
+ data['time_entry']['duration'] = hourduration * 3600
+ data['time_entry']['pid'] = projectid","class Toggl():
+ day = datetime.now().day if not day else day
+ hour = datetime.now().hour if not hour else hour
+
+ timestruct = datetime(year, month, day, hour + hourdiff).isoformat() + '.000Z'
+ data['time_entry']['start'] = timestruct
+ data['time_entry']['duration'] = hourduration * 3600
+ data['time_entry']['pid'] = projectid"
+4,https://:@github.com/eEcoLiDAR/eEcoLiDAR.git,f0b2a0b7a5fdd41887ba40b7687c8161c0faba1e,"@@ -28,6 +28,6 @@ class Test3FeatureExtractor(AbstractFeatureExtractor):
+ return ['test3_a']
+
+ def extract(self, sourcepc, neighborhood, targetpc, targetindex, volume):
+- t2a, t2c = utils.get_features(targetpc, targetindex, self.requires())
++ t2a, t2c = utils.get_features(targetpc, self.requires(), targetindex)
+ x, y, z = utils.get_point(targetpc, targetindex)
+ return t2c - t2a - z # z
+",laserchicken/test_feature_extractor/feature_test23.py,"ArgSwap(idxs=1<->2 @(31,19)->(31,37))","class Test3FeatureExtractor(AbstractFeatureExtractor):
+ return ['test3_a']
+
+ def extract(self, sourcepc, neighborhood, targetpc, targetindex, volume):
+ t2a, t2c = utils.get_features(targetpc, targetindex, self.requires())
+ x, y, z = utils.get_point(targetpc, targetindex)
+ return t2c - t2a - z # z","class Test3FeatureExtractor(AbstractFeatureExtractor):
+ return ['test3_a']
+
+ def extract(self, sourcepc, neighborhood, targetpc, targetindex, volume):
+ t2a, t2c = utils.get_features(targetpc, self.requires(), targetindex)
+ x, y, z = utils.get_point(targetpc, targetindex)
+ return t2c - t2a - z # z"
+5,https://:@github.com/eEcoLiDAR/eEcoLiDAR.git,f0b2a0b7a5fdd41887ba40b7687c8161c0faba1e,"@@ -31,7 +31,7 @@ class TestUtils(unittest.TestCase):
+ pc[keys.point][""color""] = {""type"": ""double"", ""data"": cols}
+ pc[keys.point][""flavor""] = {""type"": ""double"", ""data"": flavs}
+ x, y, z = utils.get_point(pc, 2)
+- c, f = utils.get_features(pc, 2, (""color"", ""flavor""))
++ c, f = utils.get_features(pc, (""color"", ""flavor""), 2)
+ self.assertEqual(c, 0.5 * (x + y))
+ self.assertEqual(f, 0.5 * (x - y))
+
+",laserchicken/test_utils.py,"ArgSwap(idxs=1<->2 @(34,15)->(34,33))","class TestUtils(unittest.TestCase):
+ pc[keys.point][""color""] = {""type"": ""double"", ""data"": cols}
+ pc[keys.point][""flavor""] = {""type"": ""double"", ""data"": flavs}
+ x, y, z = utils.get_point(pc, 2)
+ c, f = utils.get_features(pc, 2, (""color"", ""flavor""))
+ self.assertEqual(c, 0.5 * (x + y))
+ self.assertEqual(f, 0.5 * (x - y))
+ ","class TestUtils(unittest.TestCase):
+ pc[keys.point][""color""] = {""type"": ""double"", ""data"": cols}
+ pc[keys.point][""flavor""] = {""type"": ""double"", ""data"": flavs}
+ x, y, z = utils.get_point(pc, 2)
+ c, f = utils.get_features(pc, (""color"", ""flavor""), 2)
+ self.assertEqual(c, 0.5 * (x + y))
+ self.assertEqual(f, 0.5 * (x - y))
+ "
+6,https://:@github.com/eEcoLiDAR/eEcoLiDAR.git,502a365efda1393b130281803702d01f7e2d1dcd,"@@ -29,7 +29,7 @@ class TestExtractEigenValues(unittest.TestCase):
+ [""eigenv_1"", ""eigenv_2"", ""eigenv_3""], InfiniteCylinder(5))
+
+ self.assertEqual(""laserchicken.feature_extractor.eigenvals_feature_extractor"",
+- target_point_cloud[keys.provenance][0][""module""])
++ target_point_cloud[keys.provenance][1][""module""])
+
+ @staticmethod
+ def test_eigenvalues_of_too_few_points_results_in_0():
+",laserchicken/feature_extractor/test_eigenvals_feature_extractor.py,"ReplaceText(target='1' @(32,61)->(32,62))","class TestExtractEigenValues(unittest.TestCase):
+ [""eigenv_1"", ""eigenv_2"", ""eigenv_3""], InfiniteCylinder(5))
+
+ self.assertEqual(""laserchicken.feature_extractor.eigenvals_feature_extractor"",
+ target_point_cloud[keys.provenance][0][""module""])
+
+ @staticmethod
+ def test_eigenvalues_of_too_few_points_results_in_0():","class TestExtractEigenValues(unittest.TestCase):
+ [""eigenv_1"", ""eigenv_2"", ""eigenv_3""], InfiniteCylinder(5))
+
+ self.assertEqual(""laserchicken.feature_extractor.eigenvals_feature_extractor"",
+ target_point_cloud[keys.provenance][1][""module""])
+
+ @staticmethod
+ def test_eigenvalues_of_too_few_points_results_in_0():"
+7,https://:@github.com/eEcoLiDAR/eEcoLiDAR.git,eb7b021147a60b57e5dec536bd6f118c213f0952,"@@ -29,7 +29,7 @@ class TestExtractEigenValues(unittest.TestCase):
+ [""eigenv_1"", ""eigenv_2"", ""eigenv_3""], InfiniteCylinder(5))
+
+ self.assertEqual(""laserchicken.feature_extractor.eigenvals_feature_extractor"",
+- target_point_cloud[keys.provenance][1][""module""])
++ target_point_cloud[keys.provenance][-1][""module""])
+
+ @staticmethod
+ def test_eigenvalues_of_too_few_points_results_in_0():
+",laserchicken/feature_extractor/test_eigenvals_feature_extractor.py,"ReplaceText(target='-1' @(32,61)->(32,62))","class TestExtractEigenValues(unittest.TestCase):
+ [""eigenv_1"", ""eigenv_2"", ""eigenv_3""], InfiniteCylinder(5))
+
+ self.assertEqual(""laserchicken.feature_extractor.eigenvals_feature_extractor"",
+ target_point_cloud[keys.provenance][1][""module""])
+
+ @staticmethod
+ def test_eigenvalues_of_too_few_points_results_in_0():","class TestExtractEigenValues(unittest.TestCase):
+ [""eigenv_1"", ""eigenv_2"", ""eigenv_3""], InfiniteCylinder(5))
+
+ self.assertEqual(""laserchicken.feature_extractor.eigenvals_feature_extractor"",
+ target_point_cloud[keys.provenance][-1][""module""])
+
+ @staticmethod
+ def test_eigenvalues_of_too_few_points_results_in_0():"
+8,https://:@github.com/VinF/deer.git,66ea41db02c3361f18874dea7fd97720b1b06590,"@@ -441,7 +441,7 @@ class CircularBuffer(object):
+
+ if end == sys.maxsize:
+ return self._data[self._lb+start:self._ub]
+- elif self._lb + end >= self._ub:
++ elif self._lb + end > self._ub:
+ raise IndexError()
+ else:
+ return self._data[self._lb+start:self._lb+end]
+",General_Deep_Q_RL/agent.py,"ReplaceText(target='>' @(444,28)->(444,30))","class CircularBuffer(object):
+
+ if end == sys.maxsize:
+ return self._data[self._lb+start:self._ub]
+ elif self._lb + end >= self._ub:
+ raise IndexError()
+ else:
+ return self._data[self._lb+start:self._lb+end]","class CircularBuffer(object):
+
+ if end == sys.maxsize:
+ return self._data[self._lb+start:self._ub]
+ elif self._lb + end > self._ub:
+ raise IndexError()
+ else:
+ return self._data[self._lb+start:self._lb+end]"
+9,https://:@github.com/VinF/deer.git,fd939e272d5441d48fd7d30bf24312c0f6bc8aaa,"@@ -176,7 +176,7 @@ class MyEnv(Environment):
+ # Lack of energy
+ if (self._lastPonctualObservation[0]*self.battery_size>Energy_needed_from_battery):
+ # If enough energy in the battery, use it
+- self._lastPonctualObservation[0]=self._lastPonctualObservation[0]-Energy_needed_from_battery/self.battery_size*self.battery_eta
++ self._lastPonctualObservation[0]=self._lastPonctualObservation[0]-Energy_needed_from_battery/self.battery_size/self.battery_eta
+ else:
+ # Otherwise: use what is left and then penalty
+ reward-=(Energy_needed_from_battery-self._lastPonctualObservation[0]*self.battery_size)*2 #2euro/kWh
+",General_Deep_Q_RL/environments/MG_two_storages_env.py,"ReplaceText(target='/' @(179,126)->(179,127))","class MyEnv(Environment):
+ # Lack of energy
+ if (self._lastPonctualObservation[0]*self.battery_size>Energy_needed_from_battery):
+ # If enough energy in the battery, use it
+ self._lastPonctualObservation[0]=self._lastPonctualObservation[0]-Energy_needed_from_battery/self.battery_size*self.battery_eta
+ else:
+ # Otherwise: use what is left and then penalty
+ reward-=(Energy_needed_from_battery-self._lastPonctualObservation[0]*self.battery_size)*2 #2euro/kWh","class MyEnv(Environment):
+ # Lack of energy
+ if (self._lastPonctualObservation[0]*self.battery_size>Energy_needed_from_battery):
+ # If enough energy in the battery, use it
+ self._lastPonctualObservation[0]=self._lastPonctualObservation[0]-Energy_needed_from_battery/self.battery_size/self.battery_eta
+ else:
+ # Otherwise: use what is left and then penalty
+ reward-=(Energy_needed_from_battery-self._lastPonctualObservation[0]*self.battery_size)*2 #2euro/kWh"
+10,https://:@github.com/piccolbo/altair_recipes.git,4992dd864a317eaad641d0408f003c429ed24af6,"@@ -6,7 +6,7 @@ from vega_datasets import data
+
+ @viz_reg_test
+ def test_boxplot_melted():
+- return ar.boxplot(data.iris(), ""species"", ""petalLength"")
++ return ar.boxplot(data.iris(), ""petalLength"", ""species"")
+
+
+ @viz_reg_test
+",tests/test_boxplot.py,"ArgSwap(idxs=1<->2 @(9,11)->(9,21))","from vega_datasets import data
+
+ @viz_reg_test
+ def test_boxplot_melted():
+ return ar.boxplot(data.iris(), ""species"", ""petalLength"")
+
+
+ @viz_reg_test","from vega_datasets import data
+
+ @viz_reg_test
+ def test_boxplot_melted():
+ return ar.boxplot(data.iris(), ""petalLength"", ""species"")
+
+
+ @viz_reg_test"
+11,https://:@github.com/tailhook/zorro.git,dcbc37d47fe2a8de029f5a2f3ae13adf52e7aace,"@@ -121,7 +121,7 @@ class RequestChannel(channel.PipelinedReqChannel):
+ clen = int(headers.get('Content-Length', '0'))
+ if clen < 0:
+ raise EOFError(""Wrong content length"")
+- while pos[0] + clen < len(buf):
++ while pos[0] + clen > len(buf):
+ readmore()
+ return status, headers, buf[pos[0]:pos[0]+clen]
+
+",zorro/http.py,"ReplaceText(target='>' @(124,32)->(124,33))","class RequestChannel(channel.PipelinedReqChannel):
+ clen = int(headers.get('Content-Length', '0'))
+ if clen < 0:
+ raise EOFError(""Wrong content length"")
+ while pos[0] + clen < len(buf):
+ readmore()
+ return status, headers, buf[pos[0]:pos[0]+clen]
+ ","class RequestChannel(channel.PipelinedReqChannel):
+ clen = int(headers.get('Content-Length', '0'))
+ if clen < 0:
+ raise EOFError(""Wrong content length"")
+ while pos[0] + clen > len(buf):
+ readmore()
+ return status, headers, buf[pos[0]:pos[0]+clen]
+ "
+12,https://:@gitlab.com/eavise/brambox.git,f1faeed0b52d6f1c9c9ba6da818c1656f841622c,"@@ -73,7 +73,7 @@ def test_multiclass(parser, df_anno_simple):
+ parser = parser()
+
+ with pytest.raises(ValueError) as errinfo:
+- bb.io.save(parser, df_anno_simple, 'path.txt')
++ bb.io.save(df_anno_simple, parser, 'path.txt')
+ assert 'single-class problems' in str(errinfo.value)
+
+
+",test/io/parser/test_anno_cvc.py,"ArgSwap(idxs=0<->1 @(76,8)->(76,18))","def test_multiclass(parser, df_anno_simple):
+ parser = parser()
+
+ with pytest.raises(ValueError) as errinfo:
+ bb.io.save(parser, df_anno_simple, 'path.txt')
+ assert 'single-class problems' in str(errinfo.value)
+
+ ","def test_multiclass(parser, df_anno_simple):
+ parser = parser()
+
+ with pytest.raises(ValueError) as errinfo:
+ bb.io.save(df_anno_simple, parser, 'path.txt')
+ assert 'single-class problems' in str(errinfo.value)
+
+ "
+13,https://:@github.com/uber/h3-py.git,359924df907144c85ec323ae2804e2c0d173dfc5,"@@ -631,7 +631,7 @@ def hex_ranges(h3_address_list, ring_size):
+ (1 + math.sqrt(1 + 8 * math.ceil(j / 6.0))) / 2)) - 1
+ # hexRanges doesn't return distance array
+ hex_range_list[ring_index].add(
+- h3_to_string(krings[i * num_hexagons + j]))
++ h3_to_string(krings[i * array_len + j]))
+ return out
+
+
+",h3/h3.py,"ReplaceText(target='array_len' @(634,40)->(634,52))","def hex_ranges(h3_address_list, ring_size):
+ (1 + math.sqrt(1 + 8 * math.ceil(j / 6.0))) / 2)) - 1
+ # hexRanges doesn't return distance array
+ hex_range_list[ring_index].add(
+ h3_to_string(krings[i * num_hexagons + j]))
+ return out
+
+ ","def hex_ranges(h3_address_list, ring_size):
+ (1 + math.sqrt(1 + 8 * math.ceil(j / 6.0))) / 2)) - 1
+ # hexRanges doesn't return distance array
+ hex_range_list[ring_index].add(
+ h3_to_string(krings[i * array_len + j]))
+ return out
+
+ "
+14,https://:@github.com/polysquare/polysquare-generic-file-linter.git,e9dbb28ea30955ab59d1339c04f0710b24ba53aa,"@@ -388,7 +388,7 @@ def _maybe_log_technical_terms(global_options, tool_options):
+ terms = set(terms_file.read().splitlines()) # suppress(PYC70)
+ terms_file.seek(0) # suppress(PYC70)
+ terms_file.truncate(0) # suppress(PYC70)
+- tech_terms = freduce(lambda x, y: x + y,
++ tech_terms = freduce(lambda x, y: x | y,
+ _drain(log_technical_terms_to_queue))
+ terms_file.write(""\n"".join(list(terms | # suppress(PYC70)
+ set(tech_terms))))
+",polysquarelinter/linter.py,"ReplaceText(target='|' @(391,48)->(391,49))","def _maybe_log_technical_terms(global_options, tool_options):
+ terms = set(terms_file.read().splitlines()) # suppress(PYC70)
+ terms_file.seek(0) # suppress(PYC70)
+ terms_file.truncate(0) # suppress(PYC70)
+ tech_terms = freduce(lambda x, y: x + y,
+ _drain(log_technical_terms_to_queue))
+ terms_file.write(""\n"".join(list(terms | # suppress(PYC70)
+ set(tech_terms))))","def _maybe_log_technical_terms(global_options, tool_options):
+ terms = set(terms_file.read().splitlines()) # suppress(PYC70)
+ terms_file.seek(0) # suppress(PYC70)
+ terms_file.truncate(0) # suppress(PYC70)
+ tech_terms = freduce(lambda x, y: x | y,
+ _drain(log_technical_terms_to_queue))
+ terms_file.write(""\n"".join(list(terms | # suppress(PYC70)
+ set(tech_terms))))"
+15,https://:@github.com/johntruckenbrodt/spatialist.git,c9d552e64cd47b30156b288e035d17debea48b45,"@@ -300,7 +300,7 @@ def centerdist(obj1, obj2):
+
+
+ def intersect(obj1, obj2):
+- if not (isinstance(obj1, Vector) or isinstance(obj2, Vector)):
++ if not (isinstance(obj1, Vector) and isinstance(obj2, Vector)):
+ raise IOError('object must be of type Vector')
+ obj1.reproject(obj2.srs)
+
+",pyroSAR/spatial/vector.py,"ReplaceText(target='and' @(303,37)->(303,39))","def centerdist(obj1, obj2):
+
+
+ def intersect(obj1, obj2):
+ if not (isinstance(obj1, Vector) or isinstance(obj2, Vector)):
+ raise IOError('object must be of type Vector')
+ obj1.reproject(obj2.srs)
+ ","def centerdist(obj1, obj2):
+
+
+ def intersect(obj1, obj2):
+ if not (isinstance(obj1, Vector) and isinstance(obj2, Vector)):
+ raise IOError('object must be of type Vector')
+ obj1.reproject(obj2.srs)
+ "
+16,https://:@github.com/Toblerity/Shapely.git,9f1b78e6fd5f4286f210b54827bdd26661f0ee7a,"@@ -40,7 +40,7 @@ if __name__ == '__main__':
+ ]
+
+ if pattern:
+- tests = [f for f in docfiles if f.find(pattern) >= 0]
++ tests = [f for f in docfiles if f.find(pattern) == 0]
+ else:
+ tests = docfiles
+
+",tests/runalldoctests.py,"ReplaceText(target='==' @(43,56)->(43,58))","if __name__ == '__main__':
+ ]
+
+ if pattern:
+ tests = [f for f in docfiles if f.find(pattern) >= 0]
+ else:
+ tests = docfiles
+ ","if __name__ == '__main__':
+ ]
+
+ if pattern:
+ tests = [f for f in docfiles if f.find(pattern) == 0]
+ else:
+ tests = docfiles
+ "
+17,https://:@github.com/Toblerity/Shapely.git,d6fc8cc0e0d50b23ba0d7ca6195bc530b2f8d1b9,"@@ -11,7 +11,7 @@ def halton(base):
+ i = index
+ while i > 0:
+ result += f * (i % base)
+- i = i/base
++ i = i//base
+ f = f/base
+ return result
+ i = 1
+",shapely/tests/test_unary_union.py,"ReplaceText(target='//' @(14,17)->(14,18))","def halton(base):
+ i = index
+ while i > 0:
+ result += f * (i % base)
+ i = i/base
+ f = f/base
+ return result
+ i = 1","def halton(base):
+ i = index
+ while i > 0:
+ result += f * (i % base)
+ i = i//base
+ f = f/base
+ return result
+ i = 1"
+18,https://:@github.com/Toblerity/Shapely.git,5f0db7fdc052beeeef36aa1251f19175d0abeedb,"@@ -36,7 +36,7 @@ if version is None:
+
+ # Handle UTF-8 encoding of certain text files.
+ open_kwds = {}
+-if sys.version_info > (3,):
++if sys.version_info >= (3,):
+ open_kwds['encoding'] = 'utf-8'
+
+ with open('VERSION.txt', 'w', **open_kwds) as fp:
+",setup.py,"ReplaceText(target='>=' @(39,20)->(39,21))","if version is None:
+
+ # Handle UTF-8 encoding of certain text files.
+ open_kwds = {}
+ if sys.version_info > (3,):
+ open_kwds['encoding'] = 'utf-8'
+
+ with open('VERSION.txt', 'w', **open_kwds) as fp:","if version is None:
+
+ # Handle UTF-8 encoding of certain text files.
+ open_kwds = {}
+ if sys.version_info >= (3,):
+ open_kwds['encoding'] = 'utf-8'
+
+ with open('VERSION.txt', 'w', **open_kwds) as fp:"
+19,https://:@github.com/svetlyak40wt/django-tagging-ng.git,0293b78ee0274d123eb70c1f8c5c01a5b36e2b40,"@@ -163,7 +163,7 @@ class TaggedItemManager(models.Manager):
+ associated with a given Tag or list of Tags.
+ """"""
+ tags = get_tag_list(tags)
+- if len(tags) == 0:
++ if len(tags) == 1:
+ tag = tags[0] # Optimisation for single tag
+ else:
+ return self.get_intersection_by_model(Model, tags)
+",models.py,"ReplaceText(target='1' @(166,24)->(166,25))","class TaggedItemManager(models.Manager):
+ associated with a given Tag or list of Tags.
+ """"""
+ tags = get_tag_list(tags)
+ if len(tags) == 0:
+ tag = tags[0] # Optimisation for single tag
+ else:
+ return self.get_intersection_by_model(Model, tags)","class TaggedItemManager(models.Manager):
+ associated with a given Tag or list of Tags.
+ """"""
+ tags = get_tag_list(tags)
+ if len(tags) == 1:
+ tag = tags[0] # Optimisation for single tag
+ else:
+ return self.get_intersection_by_model(Model, tags)"
+20,https://:@github.com/svetlyak40wt/django-tagging-ng.git,3285d40e4c1de628886a7fa45a6d4cf6ed4cd7e7,"@@ -163,7 +163,7 @@ class TaggedItemManager(models.Manager):
+ associated with a given Tag or list of Tags.
+ """"""
+ tags = get_tag_list(tags)
+- if len(tags) == 0:
++ if len(tags) == 1:
+ tag = tags[0] # Optimisation for single tag
+ else:
+ return self.get_intersection_by_model(Model, tags)
+",models.py,"ReplaceText(target='1' @(166,24)->(166,25))","class TaggedItemManager(models.Manager):
+ associated with a given Tag or list of Tags.
+ """"""
+ tags = get_tag_list(tags)
+ if len(tags) == 0:
+ tag = tags[0] # Optimisation for single tag
+ else:
+ return self.get_intersection_by_model(Model, tags)","class TaggedItemManager(models.Manager):
+ associated with a given Tag or list of Tags.
+ """"""
+ tags = get_tag_list(tags)
+ if len(tags) == 1:
+ tag = tags[0] # Optimisation for single tag
+ else:
+ return self.get_intersection_by_model(Model, tags)"
+21,https://:@github.com/zzzsochi/yadm.git,03efd06fe95c7d84264455c4fac5c8cbb17eb4dd,"@@ -316,7 +316,7 @@ class QuerySet(BaseQuerySet):
+
+ if data is None:
+ if exc is not None:
+- raise exc(criteria)
++ raise exc(qs)
+ else:
+ return None
+
+",yadm/queryset.py,"ReplaceText(target='qs' @(319,26)->(319,34))","class QuerySet(BaseQuerySet):
+
+ if data is None:
+ if exc is not None:
+ raise exc(criteria)
+ else:
+ return None
+ ","class QuerySet(BaseQuerySet):
+
+ if data is None:
+ if exc is not None:
+ raise exc(qs)
+ else:
+ return None
+ "
+22,https://:@github.com/instacart/lore.git,1c1e0efdac6b27dc111eaa93bb99317c59aaffaf,"@@ -196,7 +196,7 @@ class Base(object):
+ def upload(self):
+ self.fitting = 0
+ self.save()
+- lore.io.upload(self.remote_model_path(), self.model_path())
++ lore.io.upload(self.model_path(), self.remote_model_path())
+
+ @classmethod
+ def download(cls, fitting=0):
+",lore/models/base.py,"ArgSwap(idxs=0<->1 @(199,8)->(199,22))","class Base(object):
+ def upload(self):
+ self.fitting = 0
+ self.save()
+ lore.io.upload(self.remote_model_path(), self.model_path())
+
+ @classmethod
+ def download(cls, fitting=0):","class Base(object):
+ def upload(self):
+ self.fitting = 0
+ self.save()
+ lore.io.upload(self.model_path(), self.remote_model_path())
+
+ @classmethod
+ def download(cls, fitting=0):"
+23,https://:@github.com/instacart/lore.git,1c1e0efdac6b27dc111eaa93bb99317c59aaffaf,"@@ -78,7 +78,7 @@ class Base(lore.models.base.Base):
+
+ def upload(self):
+ super(Base, self).upload()
+- lore.io.upload(self.remote_weights_path(), self.weights_path())
++ lore.io.upload(self.weights_path(), self.remote_weights_path())
+
+ @classmethod
+ def download(cls, fitting=0):
+",lore/models/keras.py,"ArgSwap(idxs=0<->1 @(81,8)->(81,22))","class Base(lore.models.base.Base):
+
+ def upload(self):
+ super(Base, self).upload()
+ lore.io.upload(self.remote_weights_path(), self.weights_path())
+
+ @classmethod
+ def download(cls, fitting=0):","class Base(lore.models.base.Base):
+
+ def upload(self):
+ super(Base, self).upload()
+ lore.io.upload(self.weights_path(), self.remote_weights_path())
+
+ @classmethod
+ def download(cls, fitting=0):"
+24,https://:@github.com/instacart/lore.git,f4ded2b3199d1c33ba6c9c79cd66b25d43c83c81,"@@ -464,7 +464,7 @@ class Base(BaseEstimator):
+ result = self.keras.predict(dataframe, batch_size=self.batch_size)
+
+ if self.towers > 1:
+- result = numpy.mean(result, axis=0).squeeze(axis=0)
++ result = numpy.mean(result, axis=0).squeeze(axis=1)
+
+ return result
+
+",lore/estimators/keras.py,"ReplaceText(target='1' @(467,61)->(467,62))","class Base(BaseEstimator):
+ result = self.keras.predict(dataframe, batch_size=self.batch_size)
+
+ if self.towers > 1:
+ result = numpy.mean(result, axis=0).squeeze(axis=0)
+
+ return result
+ ","class Base(BaseEstimator):
+ result = self.keras.predict(dataframe, batch_size=self.batch_size)
+
+ if self.towers > 1:
+ result = numpy.mean(result, axis=0).squeeze(axis=1)
+
+ return result
+ "
+25,https://:@github.com/baliga-lab/cmonkey2.git,3201a0e97688724450196da8fef96d283c855b3f,"@@ -273,7 +273,7 @@ class ClusterMembership:
+ #logging.warn(""cluster %s already associated with %s"",
+ # str(cluster), str(column))
+ pass
+- if columns not in columns:
++ if column not in columns:
+ columns.append(column)
+
+ def remove_cluster_from_column(self, column, cluster):
+",cmonkey/membership.py,"ReplaceText(target='column' @(276,11)->(276,18))","class ClusterMembership:
+ #logging.warn(""cluster %s already associated with %s"",
+ # str(cluster), str(column))
+ pass
+ if columns not in columns:
+ columns.append(column)
+
+ def remove_cluster_from_column(self, column, cluster):","class ClusterMembership:
+ #logging.warn(""cluster %s already associated with %s"",
+ # str(cluster), str(column))
+ pass
+ if column not in columns:
+ columns.append(column)
+
+ def remove_cluster_from_column(self, column, cluster):"
+26,https://:@github.com/baliga-lab/cmonkey2.git,48d14ac785b1013354a55a37239c66433fbf19eb,"@@ -460,7 +460,7 @@ class ClusterMembership:
+ max_score = sys.float_info.min
+ for row in range(sm.num_rows()):
+ if sm_values[row][0] > max_score:
+- max_score = sm[row][0]
++ max_score = sm_values[row][0]
+ max_row = row
+ return sm.row_names[max_row]
+
+",cmonkey/membership.py,"ReplaceText(target='sm_values' @(463,32)->(463,34))","class ClusterMembership:
+ max_score = sys.float_info.min
+ for row in range(sm.num_rows()):
+ if sm_values[row][0] > max_score:
+ max_score = sm[row][0]
+ max_row = row
+ return sm.row_names[max_row]
+ ","class ClusterMembership:
+ max_score = sys.float_info.min
+ for row in range(sm.num_rows()):
+ if sm_values[row][0] > max_score:
+ max_score = sm_values[row][0]
+ max_row = row
+ return sm.row_names[max_row]
+ "
+27,https://:@github.com/baliga-lab/cmonkey2.git,311548905a9def1cbdf63d2e0fd8a17346564742,"@@ -17,7 +17,7 @@ class MicrobesOnlineTest(unittest.TestCase): # pylint: disable-msg=R0904
+ """"""test fixture""""""
+ if not os.path.exists('testcache'):
+ os.mkdir('testcache')
+- self.service = mo.MicrobesOnline(mo.MICROBES_ONLINE_BASE_URL, 'testcache')
++ self.service = mo.MicrobesOnline('testcache', mo.MICROBES_ONLINE_BASE_URL)
+
+ def tearDown(self): # pylint: disable-msg=C0103
+ """"""test cleanup""""""
+",test/microbes_online_test.py,"ArgSwap(idxs=0<->1 @(20,23)->(20,40))","class MicrobesOnlineTest(unittest.TestCase): # pylint: disable-msg=R0904
+ """"""test fixture""""""
+ if not os.path.exists('testcache'):
+ os.mkdir('testcache')
+ self.service = mo.MicrobesOnline(mo.MICROBES_ONLINE_BASE_URL, 'testcache')
+
+ def tearDown(self): # pylint: disable-msg=C0103
+ """"""test cleanup""""""","class MicrobesOnlineTest(unittest.TestCase): # pylint: disable-msg=R0904
+ """"""test fixture""""""
+ if not os.path.exists('testcache'):
+ os.mkdir('testcache')
+ self.service = mo.MicrobesOnline('testcache', mo.MICROBES_ONLINE_BASE_URL)
+
+ def tearDown(self): # pylint: disable-msg=C0103
+ """"""test cleanup"""""""
+28,https://:@github.com/muammar/ml4chem.git,dbb7de0379cb8881538d211899e4bec8794f16e3,"@@ -344,7 +344,7 @@ def train(inputs, targets, model=None, data=None, optimizer=None, lr=None,
+ logger.info('Training finished in {} hours {} minutes {:.2f} seconds.'
+ .format(h, m, s))
+ logger.info('outputs')
+- logger.info(outputs)
++ logger.info(outputs_)
+ logger.info('targets')
+ logger.info(targets)
+
+",mlchem/models/neuralnetwork.py,"ReplaceText(target='outputs_' @(347,16)->(347,23))","def train(inputs, targets, model=None, data=None, optimizer=None, lr=None,
+ logger.info('Training finished in {} hours {} minutes {:.2f} seconds.'
+ .format(h, m, s))
+ logger.info('outputs')
+ logger.info(outputs)
+ logger.info('targets')
+ logger.info(targets)
+ ","def train(inputs, targets, model=None, data=None, optimizer=None, lr=None,
+ logger.info('Training finished in {} hours {} minutes {:.2f} seconds.'
+ .format(h, m, s))
+ logger.info('outputs')
+ logger.info(outputs_)
+ logger.info('targets')
+ logger.info(targets)
+ "
+29,https://:@github.com/chris7/pyquant.git,3730fbdb9789a59a65d38f5a2ae21c645086096f,"@@ -624,7 +624,7 @@ def findAllPeaks(xdata, ydata_original, min_dist=0, method=None, local_filter_si
+ best_fit = np.array(best_fit)
+ peak_func = bigauss_ndim if bigauss_fit else gauss_ndim
+ # Get rid of peaks with low r^2
+- if micro and r2_cutoff is not None:
++ if not micro and r2_cutoff is not None:
+ final_fit = np.array([])
+ for peak_index in xrange(0, len(best_fit), step_size):
+
+",pyquant/peaks.py,"ReplaceText(target='not ' @(627,7)->(627,7))","def findAllPeaks(xdata, ydata_original, min_dist=0, method=None, local_filter_si
+ best_fit = np.array(best_fit)
+ peak_func = bigauss_ndim if bigauss_fit else gauss_ndim
+ # Get rid of peaks with low r^2
+ if micro and r2_cutoff is not None:
+ final_fit = np.array([])
+ for peak_index in xrange(0, len(best_fit), step_size):
+ ","def findAllPeaks(xdata, ydata_original, min_dist=0, method=None, local_filter_si
+ best_fit = np.array(best_fit)
+ peak_func = bigauss_ndim if bigauss_fit else gauss_ndim
+ # Get rid of peaks with low r^2
+ if not micro and r2_cutoff is not None:
+ final_fit = np.array([])
+ for peak_index in xrange(0, len(best_fit), step_size):
+ "
+30,https://:@github.com/chris7/pyquant.git,4a0755563e0a36fecf1f4393554cfaf4c1615c2c,"@@ -615,7 +615,7 @@ def find_peaks_derivative(xdata, ydata, ydata_peaks=None, min_slope=None, rel_pe
+ # By default, cross points returns the left side
+ for i in xrange(len(cross_points)):
+ index = cross_points[i]
+- if index < len(cross_points):
++ if index < len(ydata):
+ if ydata[index] < ydata[index+1]:
+ cross_points[i] = index+1
+
+",pyquant/utils.py,"ReplaceText(target='ydata' @(618,23)->(618,35))","def find_peaks_derivative(xdata, ydata, ydata_peaks=None, min_slope=None, rel_pe
+ # By default, cross points returns the left side
+ for i in xrange(len(cross_points)):
+ index = cross_points[i]
+ if index < len(cross_points):
+ if ydata[index] < ydata[index+1]:
+ cross_points[i] = index+1
+ ","def find_peaks_derivative(xdata, ydata, ydata_peaks=None, min_slope=None, rel_pe
+ # By default, cross points returns the left side
+ for i in xrange(len(cross_points)):
+ index = cross_points[i]
+ if index < len(ydata):
+ if ydata[index] < ydata[index+1]:
+ cross_points[i] = index+1
+ "
+31,https://:@github.com/chris7/pyquant.git,cd61286935d8ca64eb539851e39a98a0655ff400,"@@ -611,7 +611,7 @@ def find_peaks_derivative(xdata, ydata, ydata_peaks=None, min_slope=None, rel_pe
+ ydata = np.abs(ydata_peaks)
+
+ if min_peak_width is None:
+- max_peak_width = int(len(ydata) / 2)
++ min_peak_width = int(len(ydata) / 2)
+ if min_peak_width > 5:
+ min_peak_width = 5
+
+",pyquant/utils.py,"ReplaceText(target='min_peak_width' @(614,8)->(614,22))","def find_peaks_derivative(xdata, ydata, ydata_peaks=None, min_slope=None, rel_pe
+ ydata = np.abs(ydata_peaks)
+
+ if min_peak_width is None:
+ max_peak_width = int(len(ydata) / 2)
+ if min_peak_width > 5:
+ min_peak_width = 5
+ ","def find_peaks_derivative(xdata, ydata, ydata_peaks=None, min_slope=None, rel_pe
+ ydata = np.abs(ydata_peaks)
+
+ if min_peak_width is None:
+ min_peak_width = int(len(ydata) / 2)
+ if min_peak_width > 5:
+ min_peak_width = 5
+ "
+32,https://:@github.com/ssec/sift.git,24ce052cd497c42c917de06f0c89a7c5be13ab50,"@@ -599,7 +599,7 @@ class ProbeGraphDisplay (object) :
+ x_point = self.workspace.get_content_point(x_uuid, point_xy)
+ format_str, unit_str, x_point = self.document.convert_units(x_uuid, x_point)
+ y_point = self.workspace.get_content_point(y_uuid, point_xy)
+- format_str, unit_str, y_point = self.document.convert_units(x_uuid, y_point)
++ format_str, unit_str, y_point = self.document.convert_units(y_uuid, y_point)
+ else:
+ x_point = None
+ y_point = None
+",py/cspov/view/ProbeGraphs.py,"ReplaceText(target='y_uuid' @(602,76)->(602,82))","class ProbeGraphDisplay (object) :
+ x_point = self.workspace.get_content_point(x_uuid, point_xy)
+ format_str, unit_str, x_point = self.document.convert_units(x_uuid, x_point)
+ y_point = self.workspace.get_content_point(y_uuid, point_xy)
+ format_str, unit_str, y_point = self.document.convert_units(x_uuid, y_point)
+ else:
+ x_point = None
+ y_point = None","class ProbeGraphDisplay (object) :
+ x_point = self.workspace.get_content_point(x_uuid, point_xy)
+ format_str, unit_str, x_point = self.document.convert_units(x_uuid, x_point)
+ y_point = self.workspace.get_content_point(y_uuid, point_xy)
+ format_str, unit_str, y_point = self.document.convert_units(y_uuid, y_point)
+ else:
+ x_point = None
+ y_point = None"
+33,https://:@github.com/threatwatch/twigs.git,7ee5d95178a459a8c2e8ff7855e3156e620c395c,"@@ -85,7 +85,7 @@ def parse_inventory(email,data,params):
+ asset_map = {}
+ asset_map['owner'] = email
+ asset_map['host'] = host
+- asset_map['id'] = host
++ asset_map['id'] = vmuuid
+ asset_map['name'] = host
+ asset_map['tags'] = [ ]
+ asset_map['patch_tracker'] = { } # To help remove duplicate patches
+",twigs/azure.py,"ReplaceText(target='vmuuid' @(88,30)->(88,34))","def parse_inventory(email,data,params):
+ asset_map = {}
+ asset_map['owner'] = email
+ asset_map['host'] = host
+ asset_map['id'] = host
+ asset_map['name'] = host
+ asset_map['tags'] = [ ]
+ asset_map['patch_tracker'] = { } # To help remove duplicate patches","def parse_inventory(email,data,params):
+ asset_map = {}
+ asset_map['owner'] = email
+ asset_map['host'] = host
+ asset_map['id'] = vmuuid
+ asset_map['name'] = host
+ asset_map['tags'] = [ ]
+ asset_map['patch_tracker'] = { } # To help remove duplicate patches"
+34,https://:@github.com/Keeper-Security/Commander.git,9bd55c8dd48ab62759bbbb8dfcd38ab364cec2dc,"@@ -1550,7 +1550,7 @@ def prepare_record(params, record):
+ else:
+ if params.debug: print('Generated record key')
+ unencrypted_key = os.urandom(32)
+- record_object['record_key'] = encrypt_aes(params.data_key, unencrypted_key)
++ record_object['record_key'] = encrypt_aes(unencrypted_key, params.data_key)
+ record_object['revision'] = 0
+
+ data['title'] = record.title
+",keepercommander/api.py,"ArgSwap(idxs=0<->1 @(1553,38)->(1553,49))","def prepare_record(params, record):
+ else:
+ if params.debug: print('Generated record key')
+ unencrypted_key = os.urandom(32)
+ record_object['record_key'] = encrypt_aes(params.data_key, unencrypted_key)
+ record_object['revision'] = 0
+
+ data['title'] = record.title","def prepare_record(params, record):
+ else:
+ if params.debug: print('Generated record key')
+ unencrypted_key = os.urandom(32)
+ record_object['record_key'] = encrypt_aes(unencrypted_key, params.data_key)
+ record_object['revision'] = 0
+
+ data['title'] = record.title"
+35,https://:@github.com/hpapaxen/rope.git,27d5085b30e89095e88339c96d9940e338482106,"@@ -69,7 +69,7 @@ class JobSet(object):
+
+ def get_percent_done(self):
+ if self.count is not None and self.count > 0:
+- percent = self.done * 100 / self.count
++ percent = self.done * 100 // self.count
+ return min(percent, 100)
+
+ def get_name(self):
+",rope/base/taskhandle.py,"ReplaceText(target='//' @(72,38)->(72,39))","class JobSet(object):
+
+ def get_percent_done(self):
+ if self.count is not None and self.count > 0:
+ percent = self.done * 100 / self.count
+ return min(percent, 100)
+
+ def get_name(self):","class JobSet(object):
+
+ def get_percent_done(self):
+ if self.count is not None and self.count > 0:
+ percent = self.done * 100 // self.count
+ return min(percent, 100)
+
+ def get_name(self):"
+36,https://:@github.com/hpapaxen/rope.git,27d5085b30e89095e88339c96d9940e338482106,"@@ -524,7 +524,7 @@ class ProgressBar(object):
+ self.text['text'] = text
+
+ def _draw_shape(self):
+- width = int(self.canvas['width']) * self.percent / 100
++ width = int(self.canvas['width']) * self.percent // 100
+ self.canvas.create_rectangle(0, 0, width, self.canvas['height'],
+ fill=self.color)
+ total_width = self.canvas['width']
+",rope/ui/uihelpers.py,"ReplaceText(target='//' @(527,57)->(527,58))","class ProgressBar(object):
+ self.text['text'] = text
+
+ def _draw_shape(self):
+ width = int(self.canvas['width']) * self.percent / 100
+ self.canvas.create_rectangle(0, 0, width, self.canvas['height'],
+ fill=self.color)
+ total_width = self.canvas['width']","class ProgressBar(object):
+ self.text['text'] = text
+
+ def _draw_shape(self):
+ width = int(self.canvas['width']) * self.percent // 100
+ self.canvas.create_rectangle(0, 0, width, self.canvas['height'],
+ fill=self.color)
+ total_width = self.canvas['width']"
+37,https://:@github.com/hpapaxen/rope.git,2720419618aceab7fba51aaa4d66f7eae005b22d,"@@ -129,7 +129,7 @@ class SimilarFinderTest(unittest.TestCase):
+ source = 'x.a = 1\n'
+ finder = similarfinder.SimilarFinder(source)
+ result = list(finder.get_matches('${a} = 1'))
+- self.assertEquals(1, len(result))
++ self.assertEquals(0, len(result))
+
+ def test_functions_not_matching_when_only_first_parameters(self):
+ source = 'f(1, 2)\n'
+",ropetest/refactor/similarfindertest.py,"ReplaceText(target='0' @(132,26)->(132,27))","class SimilarFinderTest(unittest.TestCase):
+ source = 'x.a = 1\n'
+ finder = similarfinder.SimilarFinder(source)
+ result = list(finder.get_matches('${a} = 1'))
+ self.assertEquals(1, len(result))
+
+ def test_functions_not_matching_when_only_first_parameters(self):
+ source = 'f(1, 2)\n'","class SimilarFinderTest(unittest.TestCase):
+ source = 'x.a = 1\n'
+ finder = similarfinder.SimilarFinder(source)
+ result = list(finder.get_matches('${a} = 1'))
+ self.assertEquals(0, len(result))
+
+ def test_functions_not_matching_when_only_first_parameters(self):
+ source = 'f(1, 2)\n'"
+38,https://:@github.com/hpapaxen/rope.git,0eb3cb58493cdaea83a4e24d47b5bd4dbd19f963,"@@ -32,7 +32,7 @@ class BuiltinModule(pyobjects.AbstractModule):
+ result.update(self.initial)
+ for modname in self.submodules:
+ name = modname.split('.')[-1]
+- result[name] = BuiltinModule(name, self.submodules)
++ result[name] = BuiltinModule(modname, self.submodules)
+ return result
+
+ @property
+",rope/base/builtins.py,"ReplaceText(target='modname' @(35,41)->(35,45))","class BuiltinModule(pyobjects.AbstractModule):
+ result.update(self.initial)
+ for modname in self.submodules:
+ name = modname.split('.')[-1]
+ result[name] = BuiltinModule(name, self.submodules)
+ return result
+
+ @property","class BuiltinModule(pyobjects.AbstractModule):
+ result.update(self.initial)
+ for modname in self.submodules:
+ name = modname.split('.')[-1]
+ result[name] = BuiltinModule(modname, self.submodules)
+ return result
+
+ @property"
+39,https://:@github.com/hpapaxen/rope.git,528744bb4bc1b8076680f7c2c1bfac508ddca4f9,"@@ -37,7 +37,7 @@ def relative(root, path):
+ if os.path.samefile(root, path):
+ return '/'.join(reversed(rel))
+ parent = os.path.dirname(path)
+- if not path or parent == path:
++ if not parent or parent == path:
+ break
+ rel.append(os.path.basename(path))
+ path = parent
+",rope/base/libutils.py,"ReplaceText(target='parent' @(40,15)->(40,19))","def relative(root, path):
+ if os.path.samefile(root, path):
+ return '/'.join(reversed(rel))
+ parent = os.path.dirname(path)
+ if not path or parent == path:
+ break
+ rel.append(os.path.basename(path))
+ path = parent","def relative(root, path):
+ if os.path.samefile(root, path):
+ return '/'.join(reversed(rel))
+ parent = os.path.dirname(path)
+ if not parent or parent == path:
+ break
+ rel.append(os.path.basename(path))
+ path = parent"
+40,https://:@github.com/benjamincrom/baseball.git,6ef29729ad07458aebe709b4e42f56ecd3761ec4,"@@ -111,7 +111,7 @@ def write_game_svg_and_html(game_id, game, output_path):
+ html_filename = game_id + '.html'
+
+ svg_text = game.get_svg_str()
+- html_text = HTML_WRAPPER.format(title=game_id, filename=html_filename)
++ html_text = HTML_WRAPPER.format(title=game_id, filename=svg_filename)
+
+ output_svg_path = join(output_path, svg_filename)
+ output_html_path = join(output_path, html_filename)
+",fetch_game.py,"ReplaceText(target='svg_filename' @(114,60)->(114,73))","def write_game_svg_and_html(game_id, game, output_path):
+ html_filename = game_id + '.html'
+
+ svg_text = game.get_svg_str()
+ html_text = HTML_WRAPPER.format(title=game_id, filename=html_filename)
+
+ output_svg_path = join(output_path, svg_filename)
+ output_html_path = join(output_path, html_filename)","def write_game_svg_and_html(game_id, game, output_path):
+ html_filename = game_id + '.html'
+
+ svg_text = game.get_svg_str()
+ html_text = HTML_WRAPPER.format(title=game_id, filename=svg_filename)
+
+ output_svg_path = join(output_path, svg_filename)
+ output_html_path = join(output_path, html_filename)"
+41,https://:@github.com/sporestack/bitcash.git,dbc65e1b47426e0e4d286db5b27216ec36cb32cf,"@@ -16,7 +16,7 @@ def test_set_fee_cache_time():
+
+
+ def test_get_fee():
+- assert get_fee(fast=True) != get_fee(fast=False)
++ assert get_fee(fast=True) >= get_fee(fast=False)
+
+
+ class TestFeeCache:
+",tests/network/test_fees.py,"ReplaceText(target='>=' @(19,30)->(19,32))","def test_set_fee_cache_time():
+
+
+ def test_get_fee():
+ assert get_fee(fast=True) != get_fee(fast=False)
+
+
+ class TestFeeCache:","def test_set_fee_cache_time():
+
+
+ def test_get_fee():
+ assert get_fee(fast=True) >= get_fee(fast=False)
+
+
+ class TestFeeCache:"
+42,https://:@github.com/galaxy-genome-annotation/python-apollo.git,53e514b619844fa1f87179d738b9d29830027300,"@@ -29,7 +29,7 @@ class ApolloTestCase(unittest.TestCase):
+ """"""
+
+ org_info = wa.organisms.show_organism(org_id)
+- if 'directory' in org_info:
++ if 'directory' not in org_info:
+ time.sleep(1)
+ org_info = wa.organisms.show_organism(org_id)
+
+",test/__init__.py,"ReplaceText(target=' not in ' @(32,22)->(32,26))","class ApolloTestCase(unittest.TestCase):
+ """"""
+
+ org_info = wa.organisms.show_organism(org_id)
+ if 'directory' in org_info:
+ time.sleep(1)
+ org_info = wa.organisms.show_organism(org_id)
+ ","class ApolloTestCase(unittest.TestCase):
+ """"""
+
+ org_info = wa.organisms.show_organism(org_id)
+ if 'directory' not in org_info:
+ time.sleep(1)
+ org_info = wa.organisms.show_organism(org_id)
+ "
+43,https://:@github.com/jakubplichta/grafana-dashboard-builder.git,3228e6950d65b9bd347cacb56a9e85ec410b14ce,"@@ -35,7 +35,7 @@ class Context(object):
+ formatter = string.Formatter()
+ (result, to_expand) = (formatter.vformat(to_expand, (), self._context), to_expand)
+ while result != to_expand:
+- (result, to_expand) = (formatter.vformat(to_expand, (), self._context), result)
++ (result, to_expand) = (formatter.vformat(result, (), self._context), result)
+ return result
+ elif isinstance(to_expand, list):
+ return [self.expand_placeholders(value) for value in to_expand]
+",grafana_dashboards/context.py,"ReplaceText(target='result' @(38,57)->(38,66))","class Context(object):
+ formatter = string.Formatter()
+ (result, to_expand) = (formatter.vformat(to_expand, (), self._context), to_expand)
+ while result != to_expand:
+ (result, to_expand) = (formatter.vformat(to_expand, (), self._context), result)
+ return result
+ elif isinstance(to_expand, list):
+ return [self.expand_placeholders(value) for value in to_expand]","class Context(object):
+ formatter = string.Formatter()
+ (result, to_expand) = (formatter.vformat(to_expand, (), self._context), to_expand)
+ while result != to_expand:
+ (result, to_expand) = (formatter.vformat(result, (), self._context), result)
+ return result
+ elif isinstance(to_expand, list):
+ return [self.expand_placeholders(value) for value in to_expand]"
+44,https://:@github.com/Phylliade/ikpy.git,815dbff3a521532a7b792c309902ffea82abac85,"@@ -13,7 +13,7 @@ class TestFK(unittest.TestCase):
+ one_move[5] = np.pi / 4
+ one_move[6] = -np.pi / 2
+ one_move[4] = -np.pi / 2
+- self.test_pos = one_move
++ self.test_pos = all_zeros
+
+ def test_fk_creature(self):
+
+",tests/test_fk.py,"ReplaceText(target='all_zeros' @(16,24)->(16,32))","class TestFK(unittest.TestCase):
+ one_move[5] = np.pi / 4
+ one_move[6] = -np.pi / 2
+ one_move[4] = -np.pi / 2
+ self.test_pos = one_move
+
+ def test_fk_creature(self):
+ ","class TestFK(unittest.TestCase):
+ one_move[5] = np.pi / 4
+ one_move[6] = -np.pi / 2
+ one_move[4] = -np.pi / 2
+ self.test_pos = all_zeros
+
+ def test_fk_creature(self):
+ "
+45,https://:@github.com/tingbot/tingbot-python.git,5374186675f6809faf9ce953fc35c81217348753,"@@ -72,7 +72,7 @@ class RunLoop(object):
+ while self.running:
+ if len(self.timers) > 0:
+ try:
+- self._wait(self.timers[0].next_fire_time)
++ self._wait(self.timers[-1].next_fire_time)
+ except Exception as e:
+ self._error(e)
+ continue
+",tingbot/run_loop.py,"ReplaceText(target='-1' @(75,43)->(75,44))","class RunLoop(object):
+ while self.running:
+ if len(self.timers) > 0:
+ try:
+ self._wait(self.timers[0].next_fire_time)
+ except Exception as e:
+ self._error(e)
+ continue","class RunLoop(object):
+ while self.running:
+ if len(self.timers) > 0:
+ try:
+ self._wait(self.timers[-1].next_fire_time)
+ except Exception as e:
+ self._error(e)
+ continue"
+46,https://:@github.com/nyoka-pmml/nyoka.git,8d5c0d31d0bf1e251abe686f06b614a16e5ffcfb,"@@ -74,7 +74,7 @@ class TestMethods(unittest.TestCase):
+ self.assertEqual(pmml_obj.NearestNeighborModel[0].ComparisonMeasure.kind, ""distance"")
+
+ ##3
+- self.assertEqual(pmml_obj.steps[-1][-1].n_neighbors, pmml_obj.NearestNeighborModel[0].numberOfNeighbors)
++ self.assertEqual(pipeline_obj.steps[-1][-1].n_neighbors, pmml_obj.NearestNeighborModel[0].numberOfNeighbors)
+
+
+ def test_sklearn_03(self):
+",nyoka/tests/skl_to_pmml_UnitTest.py,"ReplaceText(target='pipeline_obj' @(77,25)->(77,33))","class TestMethods(unittest.TestCase):
+ self.assertEqual(pmml_obj.NearestNeighborModel[0].ComparisonMeasure.kind, ""distance"")
+
+ ##3
+ self.assertEqual(pmml_obj.steps[-1][-1].n_neighbors, pmml_obj.NearestNeighborModel[0].numberOfNeighbors)
+
+
+ def test_sklearn_03(self):","class TestMethods(unittest.TestCase):
+ self.assertEqual(pmml_obj.NearestNeighborModel[0].ComparisonMeasure.kind, ""distance"")
+
+ ##3
+ self.assertEqual(pipeline_obj.steps[-1][-1].n_neighbors, pmml_obj.NearestNeighborModel[0].numberOfNeighbors)
+
+
+ def test_sklearn_03(self):"
+47,https://:@github.com/iris-edu/pyweed.git,77d919acd8d54d4879d1a34598e9e04f16fdf708,"@@ -97,7 +97,7 @@ class WaveformEntry(AttribDict):
+
+ self.error = None
+
+- self.start_time = self.distances.arrival + self.config.offsets[0]
++ self.start_time = self.distances.arrival - self.config.offsets[0]
+ self.end_time = self.distances.arrival + self.config.offsets[1]
+
+ self.start_string = UTCDateTime(self.start_time).format_iris_web_service().replace(':', '_')
+",pyweed/waveforms_handler.py,"ReplaceText(target='-' @(100,49)->(100,50))","class WaveformEntry(AttribDict):
+
+ self.error = None
+
+ self.start_time = self.distances.arrival + self.config.offsets[0]
+ self.end_time = self.distances.arrival + self.config.offsets[1]
+
+ self.start_string = UTCDateTime(self.start_time).format_iris_web_service().replace(':', '_')","class WaveformEntry(AttribDict):
+
+ self.error = None
+
+ self.start_time = self.distances.arrival - self.config.offsets[0]
+ self.end_time = self.distances.arrival + self.config.offsets[1]
+
+ self.start_string = UTCDateTime(self.start_time).format_iris_web_service().replace(':', '_')"
+48,https://:@github.com/anaxilaus/coindata.git,2e5067311c4eed50eed41c45f43ad63e8973e579,"@@ -52,6 +52,6 @@ def dump_json(data, filepath):
+
+ try:
+ with open(filepath, 'w') as file:
+- json.dump(data, filepath)
++ json.dump(data, file)
+ except TypeError as e:
+ print(""Data isn't JSON compatible.\n"", e)
+",coindata/utils.py,"ReplaceText(target='file' @(55,28)->(55,36))","def dump_json(data, filepath):
+
+ try:
+ with open(filepath, 'w') as file:
+ json.dump(data, filepath)
+ except TypeError as e:
+ print(""Data isn't JSON compatible.\n"", e)","def dump_json(data, filepath):
+
+ try:
+ with open(filepath, 'w') as file:
+ json.dump(data, file)
+ except TypeError as e:
+ print(""Data isn't JSON compatible.\n"", e)"
+49,https://:@github.com/Pixelapse/pyglass.git,a31e95cbc259ce61f5851d6f0d769792aaa182fe,"@@ -20,7 +20,7 @@ def preview(src_path):
+ preview_path = thumbnail_preview(src_path)
+
+ if preview_path:
+- mimetype = magic.from_file(src_path, mime=True).lower()
++ mimetype = magic.from_file(preview_path, mime=True).lower()
+ if mimetype in [ExportMimeType.PNG, ExportMimeType.PDF]:
+ return preview_path
+
+",pyglass/quicklook/api.py,"ReplaceText(target='preview_path' @(23,31)->(23,39))","def preview(src_path):
+ preview_path = thumbnail_preview(src_path)
+
+ if preview_path:
+ mimetype = magic.from_file(src_path, mime=True).lower()
+ if mimetype in [ExportMimeType.PNG, ExportMimeType.PDF]:
+ return preview_path
+ ","def preview(src_path):
+ preview_path = thumbnail_preview(src_path)
+
+ if preview_path:
+ mimetype = magic.from_file(preview_path, mime=True).lower()
+ if mimetype in [ExportMimeType.PNG, ExportMimeType.PDF]:
+ return preview_path
+ "
+50,https://:@github.com/erezsh/plyplus.git,8cc69bebfcb2cb0480ac66d07fe1f4b8637bba11,"@@ -784,7 +784,7 @@ class _Grammar(object):
+ subtree.extend(child.tail)
+ else:
+ subtree.append(child)
+- p[0] = self.tree_class(rule_name, subtree, skip_adjustments=True) if len(subtree) > 1 else subtree[0]
++ p[0] = self.tree_class(rule_name, subtree, skip_adjustments=True) if len(subtree) != 1 else subtree[0]
+ else:
+ def p_rule(self, p):
+ p[0] = self.tree_class(rule_name, p[1:], skip_adjustments=True)
+",plyplus/plyplus.py,"ReplaceText(target='!=' @(787,98)->(787,99))","class _Grammar(object):
+ subtree.extend(child.tail)
+ else:
+ subtree.append(child)
+ p[0] = self.tree_class(rule_name, subtree, skip_adjustments=True) if len(subtree) > 1 else subtree[0]
+ else:
+ def p_rule(self, p):
+ p[0] = self.tree_class(rule_name, p[1:], skip_adjustments=True)","class _Grammar(object):
+ subtree.extend(child.tail)
+ else:
+ subtree.append(child)
+ p[0] = self.tree_class(rule_name, subtree, skip_adjustments=True) if len(subtree) != 1 else subtree[0]
+ else:
+ def p_rule(self, p):
+ p[0] = self.tree_class(rule_name, p[1:], skip_adjustments=True)"
+51,https://:@github.com/olls/graphics.git,877ef2670d4ad34c4fcf951dab0922419f081531,"@@ -22,7 +22,7 @@ def colorStr(text, color=WHITE):
+ return seq
+ sys.stdout.write(seq + '\n')
+ else:
+- return seq
++ return text
+ sys.stdout.write(text + '\n')
+
+ if __name__ == '__main__':
+",colors.py,"ReplaceText(target='text' @(25,9)->(25,12))","def colorStr(text, color=WHITE):
+ return seq
+ sys.stdout.write(seq + '\n')
+ else:
+ return seq
+ sys.stdout.write(text + '\n')
+
+ if __name__ == '__main__':","def colorStr(text, color=WHITE):
+ return seq
+ sys.stdout.write(seq + '\n')
+ else:
+ return text
+ sys.stdout.write(text + '\n')
+
+ if __name__ == '__main__':"
+52,https://:@github.com/hkwi/twink.git,5ef359deb609fc55659596a8cb327abb9c7e4653,"@@ -319,7 +319,7 @@ def ofp_action_set_field(message, offset):
+ cursor = _cursor(offset)
+ offset = cursor.offset
+
+- (type,len) = ofp_action_header(message, offset)
++ (type,len) = ofp_action_header(message, cursor)
+ field = message[cursor.offset:offset+len]
+ cursor.offset = offset+len
+ return namedtuple(""ofp_action_set_field"",
+",twink/ofp4/parse.py,"ReplaceText(target='cursor' @(322,41)->(322,47))","def ofp_action_set_field(message, offset):
+ cursor = _cursor(offset)
+ offset = cursor.offset
+
+ (type,len) = ofp_action_header(message, offset)
+ field = message[cursor.offset:offset+len]
+ cursor.offset = offset+len
+ return namedtuple(""ofp_action_set_field"",","def ofp_action_set_field(message, offset):
+ cursor = _cursor(offset)
+ offset = cursor.offset
+
+ (type,len) = ofp_action_header(message, cursor)
+ field = message[cursor.offset:offset+len]
+ cursor.offset = offset+len
+ return namedtuple(""ofp_action_set_field"","
+53,https://:@github.com/hkwi/twink.git,fc6f5ad63cb12f9caf5455e3179ecfd9cd9de060,"@@ -27,7 +27,7 @@ def _unpack(fmt, message, offset):
+ return struct.unpack_from(fmt, message, offset)
+
+ def _align(length):
+- return (length+7)/8*8
++ return (length+7)//8*8
+
+ # 7.1
+ def ofp_header(version, type, length, xid):
+",twink/ofp4/build.py,"ReplaceText(target='//' @(30,18)->(30,19))","def _unpack(fmt, message, offset):
+ return struct.unpack_from(fmt, message, offset)
+
+ def _align(length):
+ return (length+7)/8*8
+
+ # 7.1
+ def ofp_header(version, type, length, xid):","def _unpack(fmt, message, offset):
+ return struct.unpack_from(fmt, message, offset)
+
+ def _align(length):
+ return (length+7)//8*8
+
+ # 7.1
+ def ofp_header(version, type, length, xid):"
+54,https://:@github.com/biolab/orange3-datafusion.git,54f941a66a9b369a73190dfe2007e5b6dae1803a,"@@ -33,7 +33,7 @@ def _find_completion(fuser, relation):
+ for fuser_relation in fuser.fusion_graph.get_relations(relation.row_type,
+ relation.col_type):
+ if fuser_relation._id == relation._id:
+- return fuser.complete(fuser_relation)
++ return fuser.complete(relation)
+ return None
+
+
+",orangecontrib/datafusion/widgets/owcompletionscoring.py,"ReplaceText(target='relation' @(36,34)->(36,48))","def _find_completion(fuser, relation):
+ for fuser_relation in fuser.fusion_graph.get_relations(relation.row_type,
+ relation.col_type):
+ if fuser_relation._id == relation._id:
+ return fuser.complete(fuser_relation)
+ return None
+
+ ","def _find_completion(fuser, relation):
+ for fuser_relation in fuser.fusion_graph.get_relations(relation.row_type,
+ relation.col_type):
+ if fuser_relation._id == relation._id:
+ return fuser.complete(relation)
+ return None
+
+ "
+55,https://:@github.com/aiqm/torchani.git,5bb6691515e5e56fbe4994b140dd40b73043a33f,"@@ -151,7 +151,7 @@ class PrepareInput(torch.nn.Module):
+ new_tensors = []
+ for t in tensors:
+ new_tensors.append(t.index_select(1, reverse))
+- return (species, *tensors)
++ return (species, *new_tensors)
+
+ def forward(self, species_coordinates):
+ species, coordinates = species_coordinates
+",torchani/aev.py,"ReplaceText(target='new_tensors' @(154,26)->(154,33))","class PrepareInput(torch.nn.Module):
+ new_tensors = []
+ for t in tensors:
+ new_tensors.append(t.index_select(1, reverse))
+ return (species, *tensors)
+
+ def forward(self, species_coordinates):
+ species, coordinates = species_coordinates","class PrepareInput(torch.nn.Module):
+ new_tensors = []
+ for t in tensors:
+ new_tensors.append(t.index_select(1, reverse))
+ return (species, *new_tensors)
+
+ def forward(self, species_coordinates):
+ species, coordinates = species_coordinates"
+56,https://:@github.com/aiqm/torchani.git,abc8f7f842ae4b273c6e867b392413dcadd9c921,"@@ -593,7 +593,7 @@ def collate_fn(data, chunk_threshold, properties_info):
+ if properties_info['padding_values'][i] is None:
+ prop = torch.stack(prop)
+ else:
+- prop = torch.nn.utils.rnn.pad_sequence(batch_species,
++ prop = torch.nn.utils.rnn.pad_sequence(prop,
+ batch_first=True,
+ padding_value=properties_info['padding_values'][i])
+ # sort with number of atoms
+",torchani/data/new.py,"ReplaceText(target='prop' @(596,51)->(596,64))","def collate_fn(data, chunk_threshold, properties_info):
+ if properties_info['padding_values'][i] is None:
+ prop = torch.stack(prop)
+ else:
+ prop = torch.nn.utils.rnn.pad_sequence(batch_species,
+ batch_first=True,
+ padding_value=properties_info['padding_values'][i])
+ # sort with number of atoms","def collate_fn(data, chunk_threshold, properties_info):
+ if properties_info['padding_values'][i] is None:
+ prop = torch.stack(prop)
+ else:
+ prop = torch.nn.utils.rnn.pad_sequence(prop,
+ batch_first=True,
+ padding_value=properties_info['padding_values'][i])
+ # sort with number of atoms"
+57,https://:@github.com/aiqm/torchani.git,c18f4a5ea1f9732cc07c8816caa401981e43dc48,"@@ -274,7 +274,7 @@ def compute_aev(species: Tensor, coordinates: Tensor, cell: Tensor,
+ num_atoms = species.shape[1]
+ num_species_pairs = angular_length // angular_sublength
+ # PBC calculation is bypassed if there are no shifts
+- if shifts.numel() == 1:
++ if shifts.numel() == 0:
+ atom_index1, atom_index2, shifts = neighbor_pairs_nopbc(species == -1, coordinates, cell, shifts, Rcr)
+ else:
+ atom_index1, atom_index2, shifts = neighbor_pairs(species == -1, coordinates, cell, shifts, Rcr)
+",torchani/aev.py,"ReplaceText(target='0' @(277,25)->(277,26))","def compute_aev(species: Tensor, coordinates: Tensor, cell: Tensor,
+ num_atoms = species.shape[1]
+ num_species_pairs = angular_length // angular_sublength
+ # PBC calculation is bypassed if there are no shifts
+ if shifts.numel() == 1:
+ atom_index1, atom_index2, shifts = neighbor_pairs_nopbc(species == -1, coordinates, cell, shifts, Rcr)
+ else:
+ atom_index1, atom_index2, shifts = neighbor_pairs(species == -1, coordinates, cell, shifts, Rcr)","def compute_aev(species: Tensor, coordinates: Tensor, cell: Tensor,
+ num_atoms = species.shape[1]
+ num_species_pairs = angular_length // angular_sublength
+ # PBC calculation is bypassed if there are no shifts
+ if shifts.numel() == 0:
+ atom_index1, atom_index2, shifts = neighbor_pairs_nopbc(species == -1, coordinates, cell, shifts, Rcr)
+ else:
+ atom_index1, atom_index2, shifts = neighbor_pairs(species == -1, coordinates, cell, shifts, Rcr)"
+58,https://:@github.com/cs207group4/cs207-FinalProject.git,e7f1cc613ace275a8d259de7455ee39ca063e029,"@@ -120,7 +120,7 @@ class ChemSolver:
+ r.set_initial_value(y0, 0)
+ self._t = [0]
+ self._y = [y0]
+- while r.successful() and r.t <= t1:
++ while r.successful() and r.t < t1:
+ self._t.append(r.t + dt)
+ self._y.append(r.integrate(r.t + dt))
+ self._t = np.array(self._t)
+",pychemkin/ChemSolver.py,"ReplaceText(target='<' @(123,37)->(123,39))","class ChemSolver:
+ r.set_initial_value(y0, 0)
+ self._t = [0]
+ self._y = [y0]
+ while r.successful() and r.t <= t1:
+ self._t.append(r.t + dt)
+ self._y.append(r.integrate(r.t + dt))
+ self._t = np.array(self._t)","class ChemSolver:
+ r.set_initial_value(y0, 0)
+ self._t = [0]
+ self._y = [y0]
+ while r.successful() and r.t < t1:
+ self._t.append(r.t + dt)
+ self._y.append(r.integrate(r.t + dt))
+ self._t = np.array(self._t)"
+59,https://:@github.com/MrLeeh/pyads.git,d14fd2a7bb2d4b784a4f6a47b6981ba2a86b699c,"@@ -97,7 +97,7 @@ def set_local_address(ams_netid):
+ else:
+ ams_netid_st = ams_netid
+
+- assert isinstance(ams_netid, SAmsNetId)
++ assert isinstance(ams_netid_st, SAmsNetId)
+
+ if linux:
+ return adsSetLocalAddress(ams_netid_st)
+",pyads/ads.py,"ReplaceText(target='ams_netid_st' @(100,22)->(100,31))","def set_local_address(ams_netid):
+ else:
+ ams_netid_st = ams_netid
+
+ assert isinstance(ams_netid, SAmsNetId)
+
+ if linux:
+ return adsSetLocalAddress(ams_netid_st)","def set_local_address(ams_netid):
+ else:
+ ams_netid_st = ams_netid
+
+ assert isinstance(ams_netid_st, SAmsNetId)
+
+ if linux:
+ return adsSetLocalAddress(ams_netid_st)"
+60,https://:@github.com/pytorch/fairseq.git,0a836276129ef71fa6c44975dd02ab70bccc496d,"@@ -58,7 +58,7 @@ class FConvEncoder(FairseqEncoder):
+ self.projections = nn.ModuleList()
+ self.convolutions = nn.ModuleList()
+ for (out_channels, kernel_size) in convolutions:
+- pad = (kernel_size - 1) // 2
++ pad = (kernel_size - 1) / 2
+ self.projections.append(Linear(in_channels, out_channels)
+ if in_channels != out_channels else None)
+ self.convolutions.append(
+",fairseq/models/fconv.py,"ReplaceText(target='/' @(61,36)->(61,38))","class FConvEncoder(FairseqEncoder):
+ self.projections = nn.ModuleList()
+ self.convolutions = nn.ModuleList()
+ for (out_channels, kernel_size) in convolutions:
+ pad = (kernel_size - 1) // 2
+ self.projections.append(Linear(in_channels, out_channels)
+ if in_channels != out_channels else None)
+ self.convolutions.append(","class FConvEncoder(FairseqEncoder):
+ self.projections = nn.ModuleList()
+ self.convolutions = nn.ModuleList()
+ for (out_channels, kernel_size) in convolutions:
+ pad = (kernel_size - 1) / 2
+ self.projections.append(Linear(in_channels, out_channels)
+ if in_channels != out_channels else None)
+ self.convolutions.append("
+61,https://:@github.com/pytorch/fairseq.git,f68a44359b6596997b931d2e662a899ffba9d407,"@@ -62,7 +62,7 @@ class SinusoidalPositionalEmbedding(nn.Module):
+ # recompute/expand embeddings if needed
+ bsz, seq_len = input.size()
+ max_pos = self.padding_idx + 1 + seq_len
+- if seq_len > self.weights.size(0):
++ if max_pos > self.weights.size(0):
+ self.weights = SinusoidalPositionalEmbedding.get_embedding(
+ max_pos,
+ self.embedding_dim,
+",fairseq/modules/sinusoidal_positional_embedding.py,"ReplaceText(target='max_pos' @(65,11)->(65,18))","class SinusoidalPositionalEmbedding(nn.Module):
+ # recompute/expand embeddings if needed
+ bsz, seq_len = input.size()
+ max_pos = self.padding_idx + 1 + seq_len
+ if seq_len > self.weights.size(0):
+ self.weights = SinusoidalPositionalEmbedding.get_embedding(
+ max_pos,
+ self.embedding_dim,","class SinusoidalPositionalEmbedding(nn.Module):
+ # recompute/expand embeddings if needed
+ bsz, seq_len = input.size()
+ max_pos = self.padding_idx + 1 + seq_len
+ if max_pos > self.weights.size(0):
+ self.weights = SinusoidalPositionalEmbedding.get_embedding(
+ max_pos,
+ self.embedding_dim,"
+62,https://:@github.com/pytorch/fairseq.git,762956a559e65e1e48df8f8b4df515d23b66fddb,"@@ -82,7 +82,7 @@ def main(args):
+ train_meter.start()
+ valid_losses = [None]
+ valid_subsets = args.valid_subset.split(',')
+- while lr > args.min_lr and epoch_itr.epoch <= max_epoch and trainer.get_num_updates() < max_update:
++ while lr > args.min_lr and epoch_itr.epoch < max_epoch and trainer.get_num_updates() < max_update:
+ # train for one epoch
+ train(args, trainer, task, epoch_itr)
+
+",train.py,"ReplaceText(target='<' @(85,47)->(85,49))","def main(args):
+ train_meter.start()
+ valid_losses = [None]
+ valid_subsets = args.valid_subset.split(',')
+ while lr > args.min_lr and epoch_itr.epoch <= max_epoch and trainer.get_num_updates() < max_update:
+ # train for one epoch
+ train(args, trainer, task, epoch_itr)
+ ","def main(args):
+ train_meter.start()
+ valid_losses = [None]
+ valid_subsets = args.valid_subset.split(',')
+ while lr > args.min_lr and epoch_itr.epoch < max_epoch and trainer.get_num_updates() < max_update:
+ # train for one epoch
+ train(args, trainer, task, epoch_itr)
+ "
+63,https://:@github.com/pytorch/fairseq.git,e9967cd334783f5da50deadc17cf8a4fc3380171,"@@ -82,7 +82,7 @@ def main(args):
+ train_meter.start()
+ valid_losses = [None]
+ valid_subsets = args.valid_subset.split(',')
+- while lr > args.min_lr and epoch_itr.epoch <= max_epoch and trainer.get_num_updates() < max_update:
++ while lr > args.min_lr and epoch_itr.epoch < max_epoch and trainer.get_num_updates() < max_update:
+ # train for one epoch
+ train(args, trainer, task, epoch_itr)
+
+",train.py,"ReplaceText(target='<' @(85,47)->(85,49))","def main(args):
+ train_meter.start()
+ valid_losses = [None]
+ valid_subsets = args.valid_subset.split(',')
+ while lr > args.min_lr and epoch_itr.epoch <= max_epoch and trainer.get_num_updates() < max_update:
+ # train for one epoch
+ train(args, trainer, task, epoch_itr)
+ ","def main(args):
+ train_meter.start()
+ valid_losses = [None]
+ valid_subsets = args.valid_subset.split(',')
+ while lr > args.min_lr and epoch_itr.epoch < max_epoch and trainer.get_num_updates() < max_update:
+ # train for one epoch
+ train(args, trainer, task, epoch_itr)
+ "
+64,https://:@github.com/pytorch/fairseq.git,7bcb487aad8504043d13c9b869d555aa565a46c7,"@@ -49,7 +49,7 @@ class LabelSmoothedCrossEntropyCriterion(FairseqCriterion):
+ sample_size = sample['target'].size(0) if self.args.sentence_avg else sample['ntokens']
+ logging_output = {
+ 'loss': utils.item(loss.data) if reduce else loss.data,
+- 'nll_loss': utils.item(nll_loss.data) if reduce else loss.data,
++ 'nll_loss': utils.item(nll_loss.data) if reduce else nll_loss.data,
+ 'ntokens': sample['ntokens'],
+ 'sample_size': sample_size,
+ }
+",fairseq/criterions/label_smoothed_cross_entropy.py,"ReplaceText(target='nll_loss' @(52,65)->(52,69))","class LabelSmoothedCrossEntropyCriterion(FairseqCriterion):
+ sample_size = sample['target'].size(0) if self.args.sentence_avg else sample['ntokens']
+ logging_output = {
+ 'loss': utils.item(loss.data) if reduce else loss.data,
+ 'nll_loss': utils.item(nll_loss.data) if reduce else loss.data,
+ 'ntokens': sample['ntokens'],
+ 'sample_size': sample_size,
+ }","class LabelSmoothedCrossEntropyCriterion(FairseqCriterion):
+ sample_size = sample['target'].size(0) if self.args.sentence_avg else sample['ntokens']
+ logging_output = {
+ 'loss': utils.item(loss.data) if reduce else loss.data,
+ 'nll_loss': utils.item(nll_loss.data) if reduce else nll_loss.data,
+ 'ntokens': sample['ntokens'],
+ 'sample_size': sample_size,
+ }"
+65,https://:@github.com/pytorch/fairseq.git,74efc21403477d103bd426ae64c37b7a30d8f4bf,"@@ -154,7 +154,7 @@ class TestIncrementalDecoder(FairseqIncrementalDecoder):
+ probs[:, i, self.dictionary.eos()] = 1.0
+
+ # random attention
+- attn = torch.rand(bbsz, src_len, tgt_len)
++ attn = torch.rand(bbsz, tgt_len, src_len)
+
+ return Variable(probs), Variable(attn)
+
+",tests/utils.py,"ArgSwap(idxs=1<->2 @(157,15)->(157,25))","class TestIncrementalDecoder(FairseqIncrementalDecoder):
+ probs[:, i, self.dictionary.eos()] = 1.0
+
+ # random attention
+ attn = torch.rand(bbsz, src_len, tgt_len)
+
+ return Variable(probs), Variable(attn)
+ ","class TestIncrementalDecoder(FairseqIncrementalDecoder):
+ probs[:, i, self.dictionary.eos()] = 1.0
+
+ # random attention
+ attn = torch.rand(bbsz, tgt_len, src_len)
+
+ return Variable(probs), Variable(attn)
+ "
+66,https://:@github.com/pytorch/fairseq.git,dfd77717b91a6e233829735795ab49d6fd85c0b3,"@@ -93,7 +93,7 @@ class CosineSchedule(FairseqLRScheduler):
+ else:
+ i = math.floor(curr_updates / self.period)
+ t_i = self.period
+- t_curr = num_updates - (self.period * i)
++ t_curr = curr_updates - (self.period * i)
+
+ lr_shrink = self.lr_shrink ** i
+ min_lr = self.min_lr * lr_shrink
+",fairseq/optim/lr_scheduler/cosine_lr_scheduler.py,"ReplaceText(target='curr_updates' @(96,25)->(96,36))","class CosineSchedule(FairseqLRScheduler):
+ else:
+ i = math.floor(curr_updates / self.period)
+ t_i = self.period
+ t_curr = num_updates - (self.period * i)
+
+ lr_shrink = self.lr_shrink ** i
+ min_lr = self.min_lr * lr_shrink","class CosineSchedule(FairseqLRScheduler):
+ else:
+ i = math.floor(curr_updates / self.period)
+ t_i = self.period
+ t_curr = curr_updates - (self.period * i)
+
+ lr_shrink = self.lr_shrink ** i
+ min_lr = self.min_lr * lr_shrink"
+67,https://:@github.com/pytorch/fairseq.git,0eea6923b9d7f408e667714709b070171ac7fe05,"@@ -312,7 +312,7 @@ def make_positions(tensor, padding_idx, left_pad, onnx_trace=False):
+ positions = range_buf.expand_as(tensor)
+ if left_pad:
+ positions = positions - mask.size(1) + mask.long().sum(dim=1).unsqueeze(1)
+- return positions * mask.long() + positions * (1 - mask.long())
++ return positions * mask.long() + padding_idx * (1 - mask.long())
+
+ max_pos = padding_idx + 1 + tensor.size(1)
+ if not hasattr(make_positions, 'range_buf'):
+",fairseq/utils.py,"ReplaceText(target='padding_idx' @(315,41)->(315,50))","def make_positions(tensor, padding_idx, left_pad, onnx_trace=False):
+ positions = range_buf.expand_as(tensor)
+ if left_pad:
+ positions = positions - mask.size(1) + mask.long().sum(dim=1).unsqueeze(1)
+ return positions * mask.long() + positions * (1 - mask.long())
+
+ max_pos = padding_idx + 1 + tensor.size(1)
+ if not hasattr(make_positions, 'range_buf'):","def make_positions(tensor, padding_idx, left_pad, onnx_trace=False):
+ positions = range_buf.expand_as(tensor)
+ if left_pad:
+ positions = positions - mask.size(1) + mask.long().sum(dim=1).unsqueeze(1)
+ return positions * mask.long() + padding_idx * (1 - mask.long())
+
+ max_pos = padding_idx + 1 + tensor.size(1)
+ if not hasattr(make_positions, 'range_buf'):"
+68,https://:@github.com/pytorch/fairseq.git,4d3401b09f155995cd81fd394dfa50bf65ee8e5f,"@@ -183,7 +183,7 @@ class Sampling(Search):
+ lprobs = lprobs[:, ::beam_size, :].contiguous()
+
+ # we exclude the first two vocab items, one of which is pad
+- assert self.pad == 1, 'sampling assumes the first two symbols can be ignored'
++ assert self.pad <= 1, 'sampling assumes the first two symbols can be ignored'
+ lprobs_nopad = lprobs[:, :, 2:]
+
+ # only sample from top-k candidates
+",fairseq/search.py,"ReplaceText(target='<=' @(186,24)->(186,26))","class Sampling(Search):
+ lprobs = lprobs[:, ::beam_size, :].contiguous()
+
+ # we exclude the first two vocab items, one of which is pad
+ assert self.pad == 1, 'sampling assumes the first two symbols can be ignored'
+ lprobs_nopad = lprobs[:, :, 2:]
+
+ # only sample from top-k candidates","class Sampling(Search):
+ lprobs = lprobs[:, ::beam_size, :].contiguous()
+
+ # we exclude the first two vocab items, one of which is pad
+ assert self.pad <= 1, 'sampling assumes the first two symbols can be ignored'
+ lprobs_nopad = lprobs[:, :, 2:]
+
+ # only sample from top-k candidates"
+69,https://:@github.com/pytorch/fairseq.git,2340832fdd7acaaaf07626daa6a0cef6fda06cd1,"@@ -160,7 +160,7 @@ def main(args):
+ ))
+
+ # update running id counter
+- start_id += len(results)
++ start_id += len(inputs)
+
+
+ def cli_main():
+",interactive.py,"ReplaceText(target='inputs' @(163,24)->(163,31))","def main(args):
+ ))
+
+ # update running id counter
+ start_id += len(results)
+
+
+ def cli_main():","def main(args):
+ ))
+
+ # update running id counter
+ start_id += len(inputs)
+
+
+ def cli_main():"
+70,https://:@github.com/pytorch/fairseq.git,39a60b844aad67aa59267d873edeb4948f6f0af9,"@@ -351,7 +351,7 @@ class LSTMDecoder(FairseqIncrementalDecoder):
+ self.additional_fc = Linear(hidden_size, out_embed_dim)
+ if adaptive_softmax_cutoff is not None:
+ # setting adaptive_softmax dropout to dropout_out for now but can be redefined
+- self.adaptive_softmax = AdaptiveSoftmax(num_embeddings, embed_dim, adaptive_softmax_cutoff,
++ self.adaptive_softmax = AdaptiveSoftmax(num_embeddings, hidden_size, adaptive_softmax_cutoff,
+ dropout=dropout_out)
+ elif not self.share_input_output_embed:
+ self.fc_out = Linear(out_embed_dim, num_embeddings, dropout=dropout_out)
+",fairseq/models/lstm.py,"ReplaceText(target='hidden_size' @(354,68)->(354,77))","class LSTMDecoder(FairseqIncrementalDecoder):
+ self.additional_fc = Linear(hidden_size, out_embed_dim)
+ if adaptive_softmax_cutoff is not None:
+ # setting adaptive_softmax dropout to dropout_out for now but can be redefined
+ self.adaptive_softmax = AdaptiveSoftmax(num_embeddings, embed_dim, adaptive_softmax_cutoff,
+ dropout=dropout_out)
+ elif not self.share_input_output_embed:
+ self.fc_out = Linear(out_embed_dim, num_embeddings, dropout=dropout_out)","class LSTMDecoder(FairseqIncrementalDecoder):
+ self.additional_fc = Linear(hidden_size, out_embed_dim)
+ if adaptive_softmax_cutoff is not None:
+ # setting adaptive_softmax dropout to dropout_out for now but can be redefined
+ self.adaptive_softmax = AdaptiveSoftmax(num_embeddings, hidden_size, adaptive_softmax_cutoff,
+ dropout=dropout_out)
+ elif not self.share_input_output_embed:
+ self.fc_out = Linear(out_embed_dim, num_embeddings, dropout=dropout_out)"
+71,https://:@github.com/pytorch/fairseq.git,49177c99c45f7d6e99a8f1500d16396e2d7b4519,"@@ -498,7 +498,7 @@ class TransformerDecoder(FairseqIncrementalDecoder):
+ del state_dict[k]
+
+ version_key = '{}.version'.format(name)
+- if utils.item(state_dict.get(version_key, torch.Tensor([1]))[0]) < 2:
++ if utils.item(state_dict.get(version_key, torch.Tensor([1]))[0]) <= 2:
+ # earlier checkpoints did not normalize after the stack of layers
+ self.layer_norm = None
+ self.normalize = False
+",fairseq/models/transformer.py,"ReplaceText(target='<=' @(501,73)->(501,74))","class TransformerDecoder(FairseqIncrementalDecoder):
+ del state_dict[k]
+
+ version_key = '{}.version'.format(name)
+ if utils.item(state_dict.get(version_key, torch.Tensor([1]))[0]) < 2:
+ # earlier checkpoints did not normalize after the stack of layers
+ self.layer_norm = None
+ self.normalize = False","class TransformerDecoder(FairseqIncrementalDecoder):
+ del state_dict[k]
+
+ version_key = '{}.version'.format(name)
+ if utils.item(state_dict.get(version_key, torch.Tensor([1]))[0]) <= 2:
+ # earlier checkpoints did not normalize after the stack of layers
+ self.layer_norm = None
+ self.normalize = False"
+72,https://:@github.com/pytorch/fairseq.git,5d7a81099462e9f19715ce5fa37c03816a750e12,"@@ -412,7 +412,7 @@ class LevenshteinTransformerModel(FairseqNATModel):
+ max_lens = torch.zeros_like(output_tokens).fill_(255)
+ else:
+ if encoder_out.encoder_padding_mask is None:
+- max_src_len = encoder_out.encoder_out.size(1)
++ max_src_len = encoder_out.encoder_out.size(0)
+ src_lens = encoder_out.encoder_out.new(bsz).fill_(max_src_len)
+ else:
+ src_lens = (~encoder_out.encoder_padding_mask).sum(1)
+",fairseq/models/nat/levenshtein_transformer.py,"ReplaceText(target='0' @(415,59)->(415,60))","class LevenshteinTransformerModel(FairseqNATModel):
+ max_lens = torch.zeros_like(output_tokens).fill_(255)
+ else:
+ if encoder_out.encoder_padding_mask is None:
+ max_src_len = encoder_out.encoder_out.size(1)
+ src_lens = encoder_out.encoder_out.new(bsz).fill_(max_src_len)
+ else:
+ src_lens = (~encoder_out.encoder_padding_mask).sum(1)","class LevenshteinTransformerModel(FairseqNATModel):
+ max_lens = torch.zeros_like(output_tokens).fill_(255)
+ else:
+ if encoder_out.encoder_padding_mask is None:
+ max_src_len = encoder_out.encoder_out.size(0)
+ src_lens = encoder_out.encoder_out.new(bsz).fill_(max_src_len)
+ else:
+ src_lens = (~encoder_out.encoder_padding_mask).sum(1)"
+73,https://:@github.com/pytorch/fairseq.git,431d604f696a15c06fceab56b4ace271bb85e74b,"@@ -331,7 +331,7 @@ class SequenceGenerator(object):
+ avg_attn_scores = avg_attn_scores[0]
+ if avg_attn_scores is not None:
+ if attn is None:
+- attn = scores.new(bsz * beam_size, src_tokens.size(1), max_len + 2)
++ attn = scores.new(bsz * beam_size, avg_attn_scores.size(1), max_len + 2)
+ attn_buf = attn.clone()
+ attn[:, :, step + 1].copy_(avg_attn_scores)
+
+",fairseq/sequence_generator.py,"ReplaceText(target='avg_attn_scores' @(334,55)->(334,65))","class SequenceGenerator(object):
+ avg_attn_scores = avg_attn_scores[0]
+ if avg_attn_scores is not None:
+ if attn is None:
+ attn = scores.new(bsz * beam_size, src_tokens.size(1), max_len + 2)
+ attn_buf = attn.clone()
+ attn[:, :, step + 1].copy_(avg_attn_scores)
+ ","class SequenceGenerator(object):
+ avg_attn_scores = avg_attn_scores[0]
+ if avg_attn_scores is not None:
+ if attn is None:
+ attn = scores.new(bsz * beam_size, avg_attn_scores.size(1), max_len + 2)
+ attn_buf = attn.clone()
+ attn[:, :, step + 1].copy_(avg_attn_scores)
+ "
+74,https://:@github.com/pytorch/fairseq.git,4f8b0643c80d6a41039ae29e94fca6b44de8791a,"@@ -138,7 +138,7 @@ def should_stop_early(args, valid_loss):
+ return False
+ else:
+ should_stop_early.num_runs += 1
+- return should_stop_early.num_runs > args.patience
++ return should_stop_early.num_runs >= args.patience
+
+
+ @metrics.aggregate('train')
+",fairseq_cli/train.py,"ReplaceText(target='>=' @(141,42)->(141,43))","def should_stop_early(args, valid_loss):
+ return False
+ else:
+ should_stop_early.num_runs += 1
+ return should_stop_early.num_runs > args.patience
+
+
+ @metrics.aggregate('train')","def should_stop_early(args, valid_loss):
+ return False
+ else:
+ should_stop_early.num_runs += 1
+ return should_stop_early.num_runs >= args.patience
+
+
+ @metrics.aggregate('train')"
+75,https://:@github.com/pytorch/fairseq.git,9a718e29855713a51877237b2dcc25e39c234c82,"@@ -110,5 +110,5 @@ class TranslationFromPretrainedBARTTask(TranslationTask):
+ for s_t in src_tokens:
+ s_t = torch.cat([s_t, s_t.new(1).fill_(src_lang_id)])
+ source_tokens.append(s_t)
+- dataset = LanguagePairDataset(src_tokens, src_lengths, self.source_dictionary)
++ dataset = LanguagePairDataset(source_tokens, src_lengths, self.source_dictionary)
+ return dataset
+",fairseq/tasks/translation_from_pretrained_bart.py,"ReplaceText(target='source_tokens' @(113,38)->(113,48))","class TranslationFromPretrainedBARTTask(TranslationTask):
+ for s_t in src_tokens:
+ s_t = torch.cat([s_t, s_t.new(1).fill_(src_lang_id)])
+ source_tokens.append(s_t)
+ dataset = LanguagePairDataset(src_tokens, src_lengths, self.source_dictionary)
+ return dataset","class TranslationFromPretrainedBARTTask(TranslationTask):
+ for s_t in src_tokens:
+ s_t = torch.cat([s_t, s_t.new(1).fill_(src_lang_id)])
+ source_tokens.append(s_t)
+ dataset = LanguagePairDataset(source_tokens, src_lengths, self.source_dictionary)
+ return dataset"
+76,https://:@github.com/pytorch/fairseq.git,b689b6ff3ab7b806217b8aa41821bb8fc85f7cd8,"@@ -264,7 +264,7 @@ class LanguagePairDataset(FairseqDataset):
+ tgt_item = torch.cat([torch.LongTensor([bos]), self.tgt[index]])
+
+ bos = self.src_dict.bos()
+- if self.src[index][-1] != bos:
++ if self.src[index][0] != bos:
+ src_item = torch.cat([torch.LongTensor([bos]), self.src[index]])
+
+ if self.remove_eos_from_source:
+",fairseq/data/language_pair_dataset.py,"ReplaceText(target='0' @(267,31)->(267,33))","class LanguagePairDataset(FairseqDataset):
+ tgt_item = torch.cat([torch.LongTensor([bos]), self.tgt[index]])
+
+ bos = self.src_dict.bos()
+ if self.src[index][-1] != bos:
+ src_item = torch.cat([torch.LongTensor([bos]), self.src[index]])
+
+ if self.remove_eos_from_source:","class LanguagePairDataset(FairseqDataset):
+ tgt_item = torch.cat([torch.LongTensor([bos]), self.tgt[index]])
+
+ bos = self.src_dict.bos()
+ if self.src[index][0] != bos:
+ src_item = torch.cat([torch.LongTensor([bos]), self.src[index]])
+
+ if self.remove_eos_from_source:"
+77,https://:@github.com/prprprus/PyMySQLPool.git,66b07cdf844554245cf209a72de89bd17133269c,"@@ -169,7 +169,7 @@ class Pool(object):
+ if self.ping_check:
+ now = int(time())
+ timeout = now
+- if isinstance(int, self.ping_check):
++ if isinstance(self.ping_check, int):
+ timeout = timeout - self.ping_check
+ if not hasattr(c, '__ping_check_timestamp'):
+ c.__ping_check_timestamp = now
+",pymysqlpool/pool.py,"ArgSwap(idxs=0<->1 @(172,15)->(172,25))","class Pool(object):
+ if self.ping_check:
+ now = int(time())
+ timeout = now
+ if isinstance(int, self.ping_check):
+ timeout = timeout - self.ping_check
+ if not hasattr(c, '__ping_check_timestamp'):
+ c.__ping_check_timestamp = now","class Pool(object):
+ if self.ping_check:
+ now = int(time())
+ timeout = now
+ if isinstance(self.ping_check, int):
+ timeout = timeout - self.ping_check
+ if not hasattr(c, '__ping_check_timestamp'):
+ c.__ping_check_timestamp = now"
+78,https://:@github.com/dailymuse/oz.git,a15adf73c721d07b9dac886fcc27145e2449563c,"@@ -173,7 +173,7 @@ class S3File(CDNFile):
+
+ def copy(self, new_path, replace=False):
+ """"""Uses boto to copy the file to the new path instead of uploading another file to the new key""""""
+- if replace or get_file(new_path).exists():
++ if replace or not get_file(new_path).exists():
+ self.key.copy(self.key.bucket, new_path)
+ return True
+ return False
+",oz/aws_cdn/__init__.py,"ReplaceText(target='not ' @(176,22)->(176,22))","class S3File(CDNFile):
+
+ def copy(self, new_path, replace=False):
+ """"""Uses boto to copy the file to the new path instead of uploading another file to the new key""""""
+ if replace or get_file(new_path).exists():
+ self.key.copy(self.key.bucket, new_path)
+ return True
+ return False","class S3File(CDNFile):
+
+ def copy(self, new_path, replace=False):
+ """"""Uses boto to copy the file to the new path instead of uploading another file to the new key""""""
+ if replace or not get_file(new_path).exists():
+ self.key.copy(self.key.bucket, new_path)
+ return True
+ return False"
+79,https://:@github.com/juju/amulet.git,016bfab60aca89cbcb58e80f4103e371a77b06ba,"@@ -77,7 +77,7 @@ class Deployment(object):
+ pass # Copy the current parent directory to temp and deploy that
+ elif self.charm_name:
+ if charm_name == self.charm_name:
+- charm = os.getcwd()
++ charm_branch = os.getcwd()
+
+ self.services[service] = {'branch': charm_branch}
+ if units > 1:
+",amulet/deployer.py,"ReplaceText(target='charm_branch' @(80,16)->(80,21))","class Deployment(object):
+ pass # Copy the current parent directory to temp and deploy that
+ elif self.charm_name:
+ if charm_name == self.charm_name:
+ charm = os.getcwd()
+
+ self.services[service] = {'branch': charm_branch}
+ if units > 1:","class Deployment(object):
+ pass # Copy the current parent directory to temp and deploy that
+ elif self.charm_name:
+ if charm_name == self.charm_name:
+ charm_branch = os.getcwd()
+
+ self.services[service] = {'branch': charm_branch}
+ if units > 1:"
+80,https://:@github.com/gitpython-developers/gitdb.git,ca829e0b341dd5c3ae1408b24702f2c75db6ec73,"@@ -445,7 +445,7 @@ class DeltaApplyReader(LazyMixin):
+
+
+ #{ Configuration
+- if not has_perf_mod:
++ if has_perf_mod:
+ _set_cache_ = _set_cache_brute_
+ else:
+ _set_cache_ = _set_cache_too_slow_without_c
+",stream.py,"ReplaceText(target='' @(448,4)->(448,8))","class DeltaApplyReader(LazyMixin):
+
+
+ #{ Configuration
+ if not has_perf_mod:
+ _set_cache_ = _set_cache_brute_
+ else:
+ _set_cache_ = _set_cache_too_slow_without_c","class DeltaApplyReader(LazyMixin):
+
+
+ #{ Configuration
+ if has_perf_mod:
+ _set_cache_ = _set_cache_brute_
+ else:
+ _set_cache_ = _set_cache_too_slow_without_c"
+81,https://:@github.com/longld/peda.git,82fcb5a12c92c27fc5722772a84df47b996d3d03,"@@ -4746,7 +4746,7 @@ class PEDACmd(object):
+
+ step = peda.intsize()
+ if not peda.is_address(address): # cannot determine address
+- msg(""Invalid $SP address: 0x%x"" % sp, ""red"")
++ msg(""Invalid $SP address: 0x%x"" % address, ""red"")
+ return
+ for i in range(count):
+ if not peda.execute(""x/%sx 0x%x"" % (""g"" if step == 8 else ""w"", address + i*step)):
+",peda.py,"ReplaceText(target='address' @(4749,46)->(4749,48))","class PEDACmd(object):
+
+ step = peda.intsize()
+ if not peda.is_address(address): # cannot determine address
+ msg(""Invalid $SP address: 0x%x"" % sp, ""red"")
+ return
+ for i in range(count):
+ if not peda.execute(""x/%sx 0x%x"" % (""g"" if step == 8 else ""w"", address + i*step)):","class PEDACmd(object):
+
+ step = peda.intsize()
+ if not peda.is_address(address): # cannot determine address
+ msg(""Invalid $SP address: 0x%x"" % address, ""red"")
+ return
+ for i in range(count):
+ if not peda.execute(""x/%sx 0x%x"" % (""g"" if step == 8 else ""w"", address + i*step)):"
+82,https://:@github.com/TheGhouls/oct.git,1f9ea29181962353fe0ea275cb4ba4ec9ae93142,"@@ -18,7 +18,7 @@ class Report(object):
+ self.set_statics()
+
+ def set_statics(self):
+- if os.path.exists(self.results_dir):
++ if not os.path.exists(self.results_dir):
+ return
+ try:
+ shutil.copytree(os.path.join(self.templates_dir, 'css'), os.path.join(self.results_dir, 'css'))
+",oct/results/reportwriter.py,"ReplaceText(target='not ' @(21,11)->(21,11))","class Report(object):
+ self.set_statics()
+
+ def set_statics(self):
+ if os.path.exists(self.results_dir):
+ return
+ try:
+ shutil.copytree(os.path.join(self.templates_dir, 'css'), os.path.join(self.results_dir, 'css'))","class Report(object):
+ self.set_statics()
+
+ def set_statics(self):
+ if not os.path.exists(self.results_dir):
+ return
+ try:
+ shutil.copytree(os.path.join(self.templates_dir, 'css'), os.path.join(self.results_dir, 'css'))"
+83,https://:@github.com/ASPP/pelita.git,bee6872dbd95a1e526305ef39f42ac537fd2f708,"@@ -105,7 +105,7 @@ def create_maze(layout_mesh):
+ Mesh of lists of MazeComponents
+
+ """"""
+- maze_mesh = Mesh(layout_mesh.height, layout_mesh.width,
++ maze_mesh = Mesh(layout_mesh.width, layout_mesh.height,
+ data=[[] for i in range(len(layout_mesh))])
+ for index in maze_mesh.iterkeys():
+ if layout_mesh[index] == CTFUniverse.wall:
+",pelita/universe.py,"ArgSwap(idxs=0<->1 @(108,16)->(108,20))","def create_maze(layout_mesh):
+ Mesh of lists of MazeComponents
+
+ """"""
+ maze_mesh = Mesh(layout_mesh.height, layout_mesh.width,
+ data=[[] for i in range(len(layout_mesh))])
+ for index in maze_mesh.iterkeys():
+ if layout_mesh[index] == CTFUniverse.wall:","def create_maze(layout_mesh):
+ Mesh of lists of MazeComponents
+
+ """"""
+ maze_mesh = Mesh(layout_mesh.width, layout_mesh.height,
+ data=[[] for i in range(len(layout_mesh))])
+ for index in maze_mesh.iterkeys():
+ if layout_mesh[index] == CTFUniverse.wall:"
+84,https://:@github.com/ASPP/pelita.git,508cd180dce7b72ab248211c977c8525a9c023de,"@@ -31,7 +31,7 @@ def __init__(self, index, initial_pos, team, homezone,
+
+ @property
+ def in_own_zone(self):
+- return self.homezone[0] <= self.current_pos[1] <= self.homezone[1]
++ return self.homezone[0] <= self.current_pos[0] <= self.homezone[1]
+
+ def move(self, new_pos):
+ self.current_pos = new_pos
+",pelita/universe.py,"ReplaceText(target='0' @(34,52)->(34,53))","def __init__(self, index, initial_pos, team, homezone,
+
+ @property
+ def in_own_zone(self):
+ return self.homezone[0] <= self.current_pos[1] <= self.homezone[1]
+
+ def move(self, new_pos):
+ self.current_pos = new_pos","def __init__(self, index, initial_pos, team, homezone,
+
+ @property
+ def in_own_zone(self):
+ return self.homezone[0] <= self.current_pos[0] <= self.homezone[1]
+
+ def move(self, new_pos):
+ self.current_pos = new_pos"
+85,https://:@github.com/ASPP/pelita.git,6b76e416da2dc0d18224e47d7b176dad967e15b2,"@@ -182,7 +182,7 @@ def a_star(self, initial, target):
+ else:
+ seen.append(current)
+ for pos in self.adjacency[current]:
+- heapq.heappush(to_visit, (datamodel.manhattan_dist(current, pos), (pos)))
++ heapq.heappush(to_visit, (datamodel.manhattan_dist(target, pos), (pos)))
+
+ # Now back-track using seen to determine how we got here.
+ # Initialise the path with current node, i.e. position of food.
+",pelita/game_master.py,"ReplaceText(target='target' @(185,71)->(185,78))","def a_star(self, initial, target):
+ else:
+ seen.append(current)
+ for pos in self.adjacency[current]:
+ heapq.heappush(to_visit, (datamodel.manhattan_dist(current, pos), (pos)))
+
+ # Now back-track using seen to determine how we got here.
+ # Initialise the path with current node, i.e. position of food.","def a_star(self, initial, target):
+ else:
+ seen.append(current)
+ for pos in self.adjacency[current]:
+ heapq.heappush(to_visit, (datamodel.manhattan_dist(target, pos), (pos)))
+
+ # Now back-track using seen to determine how we got here.
+ # Initialise the path with current node, i.e. position of food."
+86,https://:@github.com/ASPP/pelita.git,fa2505d44ae3d3724f7fa979c0167f03bf7424f7,"@@ -136,7 +136,7 @@ def play(self):
+ if self.universe.teams[0].score < self.universe.teams[1].score:
+ events.append(datamodel.TeamWins(1))
+ elif self.universe.teams[0].score > self.universe.teams[1].score:
+- events.append(datamodel.TeamWins(1))
++ events.append(datamodel.TeamWins(0))
+ else:
+ events.append(datamodel.GameDraw())
+ self.send_to_viewers(round_index, None, events)
+",pelita/game_master.py,"ReplaceText(target='0' @(139,45)->(139,46))","def play(self):
+ if self.universe.teams[0].score < self.universe.teams[1].score:
+ events.append(datamodel.TeamWins(1))
+ elif self.universe.teams[0].score > self.universe.teams[1].score:
+ events.append(datamodel.TeamWins(1))
+ else:
+ events.append(datamodel.GameDraw())
+ self.send_to_viewers(round_index, None, events)","def play(self):
+ if self.universe.teams[0].score < self.universe.teams[1].score:
+ events.append(datamodel.TeamWins(1))
+ elif self.universe.teams[0].score > self.universe.teams[1].score:
+ events.append(datamodel.TeamWins(0))
+ else:
+ events.append(datamodel.GameDraw())
+ self.send_to_viewers(round_index, None, events)"
+87,https://:@github.com/ASPP/pelita.git,4044f845e54c2077d6896010c25fcc123fc10203,"@@ -78,7 +78,7 @@ def test_equal_positions(self):
+ layout = create_layout(layout_str)
+ assert layout.bots == [(1, 1), (1, 1)]
+ assert layout.enemy == [(1, 1), (1, 1)]
+- setup_test_game(layout=layout)
++ setup_test_game(layout=layout_str)
+
+ def test_define_after(self):
+ layout = create_layout(self.layout, food=[(1, 1)], bots=[None, None], enemy=None)
+",test/test_team.py,"ReplaceText(target='layout_str' @(81,31)->(81,37))","def test_equal_positions(self):
+ layout = create_layout(layout_str)
+ assert layout.bots == [(1, 1), (1, 1)]
+ assert layout.enemy == [(1, 1), (1, 1)]
+ setup_test_game(layout=layout)
+
+ def test_define_after(self):
+ layout = create_layout(self.layout, food=[(1, 1)], bots=[None, None], enemy=None)","def test_equal_positions(self):
+ layout = create_layout(layout_str)
+ assert layout.bots == [(1, 1), (1, 1)]
+ assert layout.enemy == [(1, 1), (1, 1)]
+ setup_test_game(layout=layout_str)
+
+ def test_define_after(self):
+ layout = create_layout(self.layout, food=[(1, 1)], bots=[None, None], enemy=None)"
+88,https://:@github.com/ASPP/pelita.git,6fd0a9d2af44c491c1cc6774c3a169e97e2040be,"@@ -398,7 +398,7 @@ def _team(self):
+ @property
+ def turn(self):
+ """""" The turn of our bot. """"""
+- return self.bot_index // 2
++ return self.bot_index % 2
+
+ @property
+ def other(self):
+",pelita/player/team.py,"ReplaceText(target='%' @(401,30)->(401,32))","def _team(self):
+ @property
+ def turn(self):
+ """""" The turn of our bot. """"""
+ return self.bot_index // 2
+
+ @property
+ def other(self):","def _team(self):
+ @property
+ def turn(self):
+ """""" The turn of our bot. """"""
+ return self.bot_index % 2
+
+ @property
+ def other(self):"
+89,https://:@github.com/iotaledger/ccurl.interface.py.git,eb7f9190d24995d3f8d03a8350382ab6045a6e67,"@@ -44,7 +44,7 @@ gta = api.get_transactions_to_approve(depth=3) # get tips to be approved by your
+
+ mwm = 14 # target is mainnet
+
+-bundle = entangled_interface.local_attach_to_tangle(pb, gta['trunkTransaction'], gta['branchTransaction'], mwm)
++bundle = entangled_interface.local_attach_to_tangle(pb, gta['branchTransaction'],gta['trunkTransaction'], mwm)
+
+ bundle_trytes = [ x.as_tryte_string() for x in pb._transactions ]
+
+",examples/with_entangled.py,"ArgSwap(idxs=1<->2 @(47,9)->(47,51))","gta = api.get_transactions_to_approve(depth=3) # get tips to be approved by your
+
+ mwm = 14 # target is mainnet
+
+ bundle = entangled_interface.local_attach_to_tangle(pb, gta['trunkTransaction'], gta['branchTransaction'], mwm)
+
+ bundle_trytes = [ x.as_tryte_string() for x in pb._transactions ]
+ ","gta = api.get_transactions_to_approve(depth=3) # get tips to be approved by your
+
+ mwm = 14 # target is mainnet
+
+ bundle = entangled_interface.local_attach_to_tangle(pb, gta['branchTransaction'],gta['trunkTransaction'], mwm)
+
+ bundle_trytes = [ x.as_tryte_string() for x in pb._transactions ]
+ "
+90,https://:@github.com/softlayer/softlayer-python.git,53731de7e51d31475cc224aceb0f3ff7217cdafd,"@@ -153,7 +153,7 @@ class NetworkManager(object):
+ ('privateResidenceFlag', private_residence),
+ ('state', state),
+ ('postalCode', postal_code)]:
+- if key is not None:
++ if value is not None:
+ update[key] = value
+
+ # If there's anything to update, update it
+",SoftLayer/managers/network.py,"ReplaceText(target='value' @(156,15)->(156,18))","class NetworkManager(object):
+ ('privateResidenceFlag', private_residence),
+ ('state', state),
+ ('postalCode', postal_code)]:
+ if key is not None:
+ update[key] = value
+
+ # If there's anything to update, update it","class NetworkManager(object):
+ ('privateResidenceFlag', private_residence),
+ ('state', state),
+ ('postalCode', postal_code)]:
+ if value is not None:
+ update[key] = value
+
+ # If there's anything to update, update it"
+91,https://:@github.com/softlayer/softlayer-python.git,dcf66e15711e47c594f20ffac7605bfc6d1a8746,"@@ -15,7 +15,7 @@ import click
+ type=click.Choice(['vs', 'vlan', 'server']),
+ help='Firewall type',
+ required=True)
+-@click.option('--high-availability', '--ha',
++@click.option('--ha', '--high-availability',
+ is_flag=True,
+ help='High available firewall option')
+ @environment.pass_env
+",SoftLayer/CLI/firewall/add.py,"ArgSwap(idxs=0<->1 @(18,1)->(18,13))","import click
+ type=click.Choice(['vs', 'vlan', 'server']),
+ help='Firewall type',
+ required=True)
+ @click.option('--high-availability', '--ha',
+ is_flag=True,
+ help='High available firewall option')
+ @environment.pass_env","import click
+ type=click.Choice(['vs', 'vlan', 'server']),
+ help='Firewall type',
+ required=True)
+ @click.option('--ha', '--high-availability',
+ is_flag=True,
+ help='High available firewall option')
+ @environment.pass_env"
+92,https://:@github.com/softlayer/softlayer-python.git,f0840e302d486d6002a14419bbde85c1deedaf6a,"@@ -271,7 +271,7 @@ class BlockStorageManager(utils.IdentifierMixin, object):
+ package,
+ 'performance_storage_iscsi'
+ ),
+- storage_utils.find_performance_space_price(package, iops),
++ storage_utils.find_performance_space_price(package, size),
+ storage_utils.find_performance_iops_price(package, size, iops),
+ ]
+ elif storage_type == 'storage_service_enterprise':
+",SoftLayer/managers/block.py,"ReplaceText(target='size' @(274,68)->(274,72))","class BlockStorageManager(utils.IdentifierMixin, object):
+ package,
+ 'performance_storage_iscsi'
+ ),
+ storage_utils.find_performance_space_price(package, iops),
+ storage_utils.find_performance_iops_price(package, size, iops),
+ ]
+ elif storage_type == 'storage_service_enterprise':","class BlockStorageManager(utils.IdentifierMixin, object):
+ package,
+ 'performance_storage_iscsi'
+ ),
+ storage_utils.find_performance_space_price(package, size),
+ storage_utils.find_performance_iops_price(package, size, iops),
+ ]
+ elif storage_type == 'storage_service_enterprise':"
+93,https://:@github.com/softlayer/softlayer-python.git,4418057fc0e3632aba2d89b6e42494c79cadd16a,"@@ -367,7 +367,7 @@ class VSManager(utils.IdentifierMixin, object):
+ if datacenter:
+ data[""datacenter""] = {""name"": datacenter}
+
+- if private_vlan and public_vlan:
++ if private_vlan or public_vlan:
+ network_components = self._create_network_components(public_vlan, private_vlan,
+ private_subnet, public_subnet)
+ data.update(network_components)
+",SoftLayer/managers/vs.py,"ReplaceText(target='or' @(370,24)->(370,27))","class VSManager(utils.IdentifierMixin, object):
+ if datacenter:
+ data[""datacenter""] = {""name"": datacenter}
+
+ if private_vlan and public_vlan:
+ network_components = self._create_network_components(public_vlan, private_vlan,
+ private_subnet, public_subnet)
+ data.update(network_components)","class VSManager(utils.IdentifierMixin, object):
+ if datacenter:
+ data[""datacenter""] = {""name"": datacenter}
+
+ if private_vlan or public_vlan:
+ network_components = self._create_network_components(public_vlan, private_vlan,
+ private_subnet, public_subnet)
+ data.update(network_components)"
+94,https://:@github.com/softlayer/softlayer-python.git,58b27c6bf5400a717acd00b7866964ef11f36e59,"@@ -87,6 +87,6 @@ def cli(env, identifier):
+ for guest in guests:
+ real_guest = guest.get('virtualGuest')
+ member_table.add_row([
+- guest.get('id'), real_guest.get('hostname'), utils.clean_time(real_guest.get('provisionDate'))
++ real_guest.get('id'), real_guest.get('hostname'), utils.clean_time(real_guest.get('provisionDate'))
+ ])
+ env.fout(member_table)
+",SoftLayer/CLI/autoscale/detail.py,"ReplaceText(target='real_guest' @(90,12)->(90,17))","def cli(env, identifier):
+ for guest in guests:
+ real_guest = guest.get('virtualGuest')
+ member_table.add_row([
+ guest.get('id'), real_guest.get('hostname'), utils.clean_time(real_guest.get('provisionDate'))
+ ])
+ env.fout(member_table)","def cli(env, identifier):
+ for guest in guests:
+ real_guest = guest.get('virtualGuest')
+ member_table.add_row([
+ real_guest.get('id'), real_guest.get('hostname'), utils.clean_time(real_guest.get('provisionDate'))
+ ])
+ env.fout(member_table)"
+95,https://:@github.com/data-8/datascience.git,fd9aceb598290fb89a0f3131c3fb39dde18ef543,"@@ -446,7 +446,7 @@ class Table(collections.abc.Mapping):
+ count | points
+ 9 | 10
+ """"""
+- percentiles = [percentile(self[column_name], p) for column_name in self]
++ percentiles = [percentile(p, self[column_name]) for column_name in self]
+ return Table(percentiles, self.column_labels)
+ ##################
+ # Export/Display #
+",datascience/tables.py,"ArgSwap(idxs=0<->1 @(449,23)->(449,33))","class Table(collections.abc.Mapping):
+ count | points
+ 9 | 10
+ """"""
+ percentiles = [percentile(self[column_name], p) for column_name in self]
+ return Table(percentiles, self.column_labels)
+ ##################
+ # Export/Display #","class Table(collections.abc.Mapping):
+ count | points
+ 9 | 10
+ """"""
+ percentiles = [percentile(p, self[column_name]) for column_name in self]
+ return Table(percentiles, self.column_labels)
+ ##################
+ # Export/Display #"
+96,https://:@github.com/data-8/datascience.git,084450f127ecc490b887cad82fa43cda5f9b32fe,"@@ -2255,7 +2255,7 @@ class Table(collections.abc.MutableMapping):
+ space_count[labels[i]] += 1
+ return updated_labels
+ return labels
+- yticks = make_unique_labels(labels)
++ yticks = make_unique_labels(yticks)
+
+ print(""yticks: "" + str(yticks))
+ print(""ylabel: "" + str(ylabel))
+",datascience/tables.py,"ReplaceText(target='yticks' @(2258,36)->(2258,42))","class Table(collections.abc.MutableMapping):
+ space_count[labels[i]] += 1
+ return updated_labels
+ return labels
+ yticks = make_unique_labels(labels)
+
+ print(""yticks: "" + str(yticks))
+ print(""ylabel: "" + str(ylabel))","class Table(collections.abc.MutableMapping):
+ space_count[labels[i]] += 1
+ return updated_labels
+ return labels
+ yticks = make_unique_labels(yticks)
+
+ print(""yticks: "" + str(yticks))
+ print(""ylabel: "" + str(ylabel))"
+97,https://:@github.com/dnaeon/py-vpoller.git,81769f6f8d9cb0dfc8cbc39a44027afa7d459636,"@@ -51,6 +51,6 @@ def task(name, required=None):
+ result = {'success': 1, 'msg': e.message}
+ finally:
+ return result
+- registry.register(name=name, fn=fn, required=required)
++ registry.register(name=name, fn=wrapper, required=required)
+ return wrapper
+ return decorator
+",src/vpoller/decorators.py,"ReplaceText(target='wrapper' @(54,40)->(54,42))","def task(name, required=None):
+ result = {'success': 1, 'msg': e.message}
+ finally:
+ return result
+ registry.register(name=name, fn=fn, required=required)
+ return wrapper
+ return decorator","def task(name, required=None):
+ result = {'success': 1, 'msg': e.message}
+ finally:
+ return result
+ registry.register(name=name, fn=wrapper, required=required)
+ return wrapper
+ return decorator"
+98,https://:@github.com/enthought/qt_binder.git,68381b406035f2ce9666cb8ef1ab2e8e57cf8bf8,"@@ -58,4 +58,4 @@ else:
+ loader = RecordingUiLoader()
+ ui = loader.load(path)
+
+- return ui, ui.to_be_bound()
++ return ui, loader.to_be_bound()
+",qt_binder/qt/ui_loader.py,"ReplaceText(target='loader' @(61,19)->(61,21))","else:
+ loader = RecordingUiLoader()
+ ui = loader.load(path)
+
+ return ui, ui.to_be_bound()","else:
+ loader = RecordingUiLoader()
+ ui = loader.load(path)
+
+ return ui, loader.to_be_bound()"
+99,https://:@github.com/ggozad/behaving.git,1bc546aa03f9d42ff78a0a79e0894e488edc9add,"@@ -40,7 +40,7 @@ def should_receive_email(context, address):
+ def click_link_in_email(context, address):
+ mails = context.mail.user_messages(address)
+ assert mails, u'message not found'
+- mail = email.message_from_string(mails[-1])
++ mail = email.message_from_string(mails[0])
+ links = URL_RE.findall(str(mail).replace('=\n', ''))
+ assert links, u'link not found'
+ url = links[0]
+",src/behaving/mail/steps.py,"ReplaceText(target='0' @(43,43)->(43,45))","def should_receive_email(context, address):
+ def click_link_in_email(context, address):
+ mails = context.mail.user_messages(address)
+ assert mails, u'message not found'
+ mail = email.message_from_string(mails[-1])
+ links = URL_RE.findall(str(mail).replace('=\n', ''))
+ assert links, u'link not found'
+ url = links[0]","def should_receive_email(context, address):
+ def click_link_in_email(context, address):
+ mails = context.mail.user_messages(address)
+ assert mails, u'message not found'
+ mail = email.message_from_string(mails[0])
+ links = URL_RE.findall(str(mail).replace('=\n', ''))
+ assert links, u'link not found'
+ url = links[0]"
+100,https://:@github.com/allenai/SciSpaCy.git,d0d1d525943e051762ea5482ba82c9a4718285c0,"@@ -58,7 +58,7 @@ def train_parser_and_tagger(train_json_path: str,
+ parser = nlp.get_pipe('parser')
+
+ train_corpus = GoldCorpus(train_json_path, dev_json_path)
+- test_corpus = GoldCorpus(train_json_path, dev_json_path)
++ test_corpus = GoldCorpus(train_json_path, test_json_path)
+
+ if ontonotes_path:
+ onto_train_path = os.path.join(ontonotes_path, ""train"")
+",scripts/train_parser_and_tagger.py,"ReplaceText(target='test_json_path' @(61,46)->(61,59))","def train_parser_and_tagger(train_json_path: str,
+ parser = nlp.get_pipe('parser')
+
+ train_corpus = GoldCorpus(train_json_path, dev_json_path)
+ test_corpus = GoldCorpus(train_json_path, dev_json_path)
+
+ if ontonotes_path:
+ onto_train_path = os.path.join(ontonotes_path, ""train"")","def train_parser_and_tagger(train_json_path: str,
+ parser = nlp.get_pipe('parser')
+
+ train_corpus = GoldCorpus(train_json_path, dev_json_path)
+ test_corpus = GoldCorpus(train_json_path, test_json_path)
+
+ if ontonotes_path:
+ onto_train_path = os.path.join(ontonotes_path, ""train"")"
+101,https://:@github.com/allenai/SciSpaCy.git,e15e9b7913459b6139d4f30030a502f30479cfd5,"@@ -190,7 +190,7 @@ def train_parser_and_tagger(train_json_path: str,
+ print(""Token acc:"", scorer_onto_retrained.token_acc)
+
+ with open(os.path.join(model_output_dir, ""ontonotes_test.json"")) as metric_file:
+- json.dump(scorer.scores, metric_file)
++ json.dump(scorer_onto_retrained.scores, metric_file)
+ if __name__ == ""__main__"":
+ parser = argparse.ArgumentParser()
+
+",scripts/train_parser_and_tagger.py,"ReplaceText(target='scorer_onto_retrained' @(193,22)->(193,28))","def train_parser_and_tagger(train_json_path: str,
+ print(""Token acc:"", scorer_onto_retrained.token_acc)
+
+ with open(os.path.join(model_output_dir, ""ontonotes_test.json"")) as metric_file:
+ json.dump(scorer.scores, metric_file)
+ if __name__ == ""__main__"":
+ parser = argparse.ArgumentParser()
+ ","def train_parser_and_tagger(train_json_path: str,
+ print(""Token acc:"", scorer_onto_retrained.token_acc)
+
+ with open(os.path.join(model_output_dir, ""ontonotes_test.json"")) as metric_file:
+ json.dump(scorer_onto_retrained.scores, metric_file)
+ if __name__ == ""__main__"":
+ parser = argparse.ArgumentParser()
+ "
+102,https://:@github.com/allenai/SciSpaCy.git,47400cbed4d4943f6bba7ed013bf80110f738f2e,"@@ -679,7 +679,7 @@ def eval_candidate_generation_and_linking(examples: List[data_util.MedMentionExa
+ if generate_linking_classifier_training_data:
+ for candidates, mention_types_for_mention in zip(candidates_by_mention, mention_types_by_mention):
+ for candidate_id, candidate in candidates.items():
+- classifier_example = linker.classifier_example(candidate_id, candidate, mention_text, mention_types)
++ classifier_example = linker.classifier_example(candidate_id, candidate, mention_text, mention_types_for_mention)
+ classifier_example['label'] = int(gold_entity.umls_id == candidate_id)
+ linking_classifier_training_data.append(classifier_example)
+
+",scripts/linking.py,"ReplaceText(target='mention_types_for_mention' @(682,118)->(682,131))","def eval_candidate_generation_and_linking(examples: List[data_util.MedMentionExa
+ if generate_linking_classifier_training_data:
+ for candidates, mention_types_for_mention in zip(candidates_by_mention, mention_types_by_mention):
+ for candidate_id, candidate in candidates.items():
+ classifier_example = linker.classifier_example(candidate_id, candidate, mention_text, mention_types)
+ classifier_example['label'] = int(gold_entity.umls_id == candidate_id)
+ linking_classifier_training_data.append(classifier_example)
+ ","def eval_candidate_generation_and_linking(examples: List[data_util.MedMentionExa
+ if generate_linking_classifier_training_data:
+ for candidates, mention_types_for_mention in zip(candidates_by_mention, mention_types_by_mention):
+ for candidate_id, candidate in candidates.items():
+ classifier_example = linker.classifier_example(candidate_id, candidate, mention_text, mention_types_for_mention)
+ classifier_example['label'] = int(gold_entity.umls_id == candidate_id)
+ linking_classifier_training_data.append(classifier_example)
+ "
+103,https://:@github.com/Burnysc2/python-sc2.git,c3f5b0de304727914a2a59d5cfde6dda04071686,"@@ -381,7 +381,7 @@ class BotAI(object):
+ return ActionResult.CantFindPlacementLocation
+
+ unit = unit or self.select_build_worker(p)
+- if unit is None or self.can_afford(building):
++ if unit is None or not self.can_afford(building):
+ return ActionResult.Error
+ return await self.do(unit.build(building, p))
+
+",sc2/bot_ai.py,"ReplaceText(target='not ' @(384,27)->(384,27))","class BotAI(object):
+ return ActionResult.CantFindPlacementLocation
+
+ unit = unit or self.select_build_worker(p)
+ if unit is None or self.can_afford(building):
+ return ActionResult.Error
+ return await self.do(unit.build(building, p))
+ ","class BotAI(object):
+ return ActionResult.CantFindPlacementLocation
+
+ unit = unit or self.select_build_worker(p)
+ if unit is None or not self.can_afford(building):
+ return ActionResult.Error
+ return await self.do(unit.build(building, p))
+ "
+104,https://:@github.com/Burnysc2/python-sc2.git,20468d57d6fd5cc80c9e7757d75e987bd81e632a,"@@ -185,7 +185,7 @@ class Point2(Pointlike):
+ Used in ramp finding """"""
+ assert self != p
+ distanceBetweenPoints = self.distance_to(p)
+- assert r > distanceBetweenPoints / 2
++ assert r >= distanceBetweenPoints / 2
+ # remaining distance from center towards the intersection, using pythagoras
+ remainingDistanceFromCenter = (r ** 2 - (distanceBetweenPoints / 2) ** 2) ** 0.5
+ # center of both points
+",sc2/position.py,"ReplaceText(target='>=' @(188,17)->(188,18))","class Point2(Pointlike):
+ Used in ramp finding """"""
+ assert self != p
+ distanceBetweenPoints = self.distance_to(p)
+ assert r > distanceBetweenPoints / 2
+ # remaining distance from center towards the intersection, using pythagoras
+ remainingDistanceFromCenter = (r ** 2 - (distanceBetweenPoints / 2) ** 2) ** 0.5
+ # center of both points","class Point2(Pointlike):
+ Used in ramp finding """"""
+ assert self != p
+ distanceBetweenPoints = self.distance_to(p)
+ assert r >= distanceBetweenPoints / 2
+ # remaining distance from center towards the intersection, using pythagoras
+ remainingDistanceFromCenter = (r ** 2 - (distanceBetweenPoints / 2) ** 2) ** 0.5
+ # center of both points"
+105,https://:@github.com/Burnysc2/python-sc2.git,9470180d3caaa18098ebffea220719ad6083afbe,"@@ -185,7 +185,7 @@ class Point2(Pointlike):
+ Used in ramp finding """"""
+ assert self != p
+ distanceBetweenPoints = self.distance_to(p)
+- assert r > distanceBetweenPoints / 2
++ assert r >= distanceBetweenPoints / 2
+ # remaining distance from center towards the intersection, using pythagoras
+ remainingDistanceFromCenter = (r ** 2 - (distanceBetweenPoints / 2) ** 2) ** 0.5
+ # center of both points
+",sc2/position.py,"ReplaceText(target='>=' @(188,17)->(188,18))","class Point2(Pointlike):
+ Used in ramp finding """"""
+ assert self != p
+ distanceBetweenPoints = self.distance_to(p)
+ assert r > distanceBetweenPoints / 2
+ # remaining distance from center towards the intersection, using pythagoras
+ remainingDistanceFromCenter = (r ** 2 - (distanceBetweenPoints / 2) ** 2) ** 0.5
+ # center of both points","class Point2(Pointlike):
+ Used in ramp finding """"""
+ assert self != p
+ distanceBetweenPoints = self.distance_to(p)
+ assert r >= distanceBetweenPoints / 2
+ # remaining distance from center towards the intersection, using pythagoras
+ remainingDistanceFromCenter = (r ** 2 - (distanceBetweenPoints / 2) ** 2) ** 0.5
+ # center of both points"
+106,https://:@github.com/Burnysc2/python-sc2.git,9c59f42e1722e1141a51300d472b0385d64f1640,"@@ -86,7 +86,7 @@ class Units(list):
+ return self[0]
+
+ def take(self, n: int) -> ""Units"":
+- if self.amount >= n:
++ if self.amount <= n:
+ return self
+ else:
+ return self.subgroup(self[:n])
+",sc2/units.py,"ReplaceText(target='<=' @(89,23)->(89,25))","class Units(list):
+ return self[0]
+
+ def take(self, n: int) -> ""Units"":
+ if self.amount >= n:
+ return self
+ else:
+ return self.subgroup(self[:n])","class Units(list):
+ return self[0]
+
+ def take(self, n: int) -> ""Units"":
+ if self.amount <= n:
+ return self
+ else:
+ return self.subgroup(self[:n])"
+107,https://:@github.com/kenjyco/beu.git,4aea6146fc5f01df3e344b9fadddf28b795dac89,"@@ -36,7 +36,7 @@ def _get_settings_file():
+ if not os.path.exists(home_config_dir):
+ os.makedirs(home_config_dir)
+ copyfile(sample_file, settings_file)
+- print('\nCopied settings to {}'.format(repr(home_config_dir)))
++ print('\nCopied settings to {}'.format(repr(settings_file)))
+ return settings_file
+
+
+",beu/__init__.py,"ReplaceText(target='settings_file' @(39,48)->(39,63))","def _get_settings_file():
+ if not os.path.exists(home_config_dir):
+ os.makedirs(home_config_dir)
+ copyfile(sample_file, settings_file)
+ print('\nCopied settings to {}'.format(repr(home_config_dir)))
+ return settings_file
+
+ ","def _get_settings_file():
+ if not os.path.exists(home_config_dir):
+ os.makedirs(home_config_dir)
+ copyfile(sample_file, settings_file)
+ print('\nCopied settings to {}'.format(repr(settings_file)))
+ return settings_file
+
+ "
+108,https://:@github.com/WattTime/pyiso.git,009316799f872c90f50b73e41f3a6f9021f8b2cc,"@@ -111,7 +111,7 @@ class BaseClient(object):
+ self.options.update(kwargs)
+
+ # check start_at and end_at args
+- if self.options.get('start_at', None) and self.options.get('end_at', None):
++ if self.options.get('start_at', None) or self.options.get('end_at', None):
+ assert self.options['start_at'] < self.options['end_at']
+ self.options['start_at'] = self.utcify(self.options['start_at'])
+ self.options['end_at'] = self.utcify(self.options['end_at'])
+",pyiso/base.py,"ReplaceText(target='or' @(114,46)->(114,49))","class BaseClient(object):
+ self.options.update(kwargs)
+
+ # check start_at and end_at args
+ if self.options.get('start_at', None) and self.options.get('end_at', None):
+ assert self.options['start_at'] < self.options['end_at']
+ self.options['start_at'] = self.utcify(self.options['start_at'])
+ self.options['end_at'] = self.utcify(self.options['end_at'])","class BaseClient(object):
+ self.options.update(kwargs)
+
+ # check start_at and end_at args
+ if self.options.get('start_at', None) or self.options.get('end_at', None):
+ assert self.options['start_at'] < self.options['end_at']
+ self.options['start_at'] = self.utcify(self.options['start_at'])
+ self.options['end_at'] = self.utcify(self.options['end_at'])"
+109,https://:@github.com/WattTime/pyiso.git,31c2680f1e96d6affbbef6dc75b9ab3724a7d8b9,"@@ -117,7 +117,7 @@ class BaseClient(object):
+ self.options.update(kwargs)
+
+ # check start_at and end_at args
+- if self.options.get('start_at', None) or self.options.get('end_at', None):
++ if self.options.get('start_at', None) and self.options.get('end_at', None):
+ assert self.options['start_at'] < self.options['end_at']
+ self.options['start_at'] = self.utcify(self.options['start_at'])
+ self.options['end_at'] = self.utcify(self.options['end_at'])
+",pyiso/base.py,"ReplaceText(target='and' @(120,46)->(120,48))","class BaseClient(object):
+ self.options.update(kwargs)
+
+ # check start_at and end_at args
+ if self.options.get('start_at', None) or self.options.get('end_at', None):
+ assert self.options['start_at'] < self.options['end_at']
+ self.options['start_at'] = self.utcify(self.options['start_at'])
+ self.options['end_at'] = self.utcify(self.options['end_at'])","class BaseClient(object):
+ self.options.update(kwargs)
+
+ # check start_at and end_at args
+ if self.options.get('start_at', None) and self.options.get('end_at', None):
+ assert self.options['start_at'] < self.options['end_at']
+ self.options['start_at'] = self.utcify(self.options['start_at'])
+ self.options['end_at'] = self.utcify(self.options['end_at'])"
+110,https://:@github.com/WattTime/pyiso.git,14fd34daa69230352ecb651ee8f30a4566ab6c59,"@@ -18,7 +18,7 @@ class TestGenerationTask(TestCase):
+ expected = client_factory(ba).get_generation(**kwargs)
+ received = tasks.get_generation(ba, **kwargs)
+
+- for i in range(len(expected)):
++ for i in range(len(received)):
+ if expected[i]['timestamp'] == received[i]['timestamp']:
+ self.assertEqual(expected[i]['gen_MW'], received[i]['gen_MW'])
+ self.assertEqual(expected[i]['fuel_name'], received[i]['fuel_name'])
+",tests/test_tasks.py,"ReplaceText(target='received' @(21,27)->(21,35))","class TestGenerationTask(TestCase):
+ expected = client_factory(ba).get_generation(**kwargs)
+ received = tasks.get_generation(ba, **kwargs)
+
+ for i in range(len(expected)):
+ if expected[i]['timestamp'] == received[i]['timestamp']:
+ self.assertEqual(expected[i]['gen_MW'], received[i]['gen_MW'])
+ self.assertEqual(expected[i]['fuel_name'], received[i]['fuel_name'])","class TestGenerationTask(TestCase):
+ expected = client_factory(ba).get_generation(**kwargs)
+ received = tasks.get_generation(ba, **kwargs)
+
+ for i in range(len(received)):
+ if expected[i]['timestamp'] == received[i]['timestamp']:
+ self.assertEqual(expected[i]['gen_MW'], received[i]['gen_MW'])
+ self.assertEqual(expected[i]['fuel_name'], received[i]['fuel_name'])"
+111,https://:@github.com/TTWShell/hobbit-core.git,b51217f7fc8cb238c1dc09e8932178cda40cf2b4,"@@ -133,4 +133,4 @@ class TestTransaction(BaseTest):
+
+ with pytest.raises(Exception):
+ view_func2()
+- assert len(User.query.all()) == 1
++ assert len(User.query.all()) == 0
+",tests/test_db.py,"ReplaceText(target='0' @(136,40)->(136,41))","class TestTransaction(BaseTest):
+
+ with pytest.raises(Exception):
+ view_func2()
+ assert len(User.query.all()) == 1","class TestTransaction(BaseTest):
+
+ with pytest.raises(Exception):
+ view_func2()
+ assert len(User.query.all()) == 0"
+112,https://:@github.com/ktdreyer/jenkins-job-wrecker.git,3be4ea2d49a46cec8223361142305107b88ca889,"@@ -162,7 +162,7 @@ def prebuildcleanup(top, parent):
+ pass
+ else:
+ raise NotImplementedError(""cannot handle ""
+- ""XML %s"" % subelement.tag)
++ ""XML %s"" % element.tag)
+
+ for rule in preclean_patterns:
+ if preclean_patterns[rule] is not None and len(preclean_patterns[rule]) > 0:
+",jenkins_job_wrecker/modules/buildwrappers.py,"ReplaceText(target='element' @(165,49)->(165,59))","def prebuildcleanup(top, parent):
+ pass
+ else:
+ raise NotImplementedError(""cannot handle ""
+ ""XML %s"" % subelement.tag)
+
+ for rule in preclean_patterns:
+ if preclean_patterns[rule] is not None and len(preclean_patterns[rule]) > 0:","def prebuildcleanup(top, parent):
+ pass
+ else:
+ raise NotImplementedError(""cannot handle ""
+ ""XML %s"" % element.tag)
+
+ for rule in preclean_patterns:
+ if preclean_patterns[rule] is not None and len(preclean_patterns[rule]) > 0:"
+113,https://:@github.com/Sage-Bionetworks/Genie.git,7a6ff590425d32fd596687bd0d35bc98680fc5b8,"@@ -379,7 +379,7 @@ class clinical(example_filetype_format.FileTypeFormat):
+ patient_patients = clinicalDF[patientId][clinicalDF[patientId] != """"]
+ # #CHECK: All samples must have associated patient data (GENIE requires patient data)
+ if not all(sample_patients.isin(patient_patients)):
+- total_error += ""Sample: All samples must have associated patient information. These samples are missing patient data: %s\n"" % "", "".join(clinicalSampleDF[patientId][~clinicalSampleDF[patientId].isin(clinicalDF[patientId])])
++ total_error += ""Sample: All samples must have associated patient information. These samples are missing patient data: %s\n"" % "", "".join(clinicalSampleDF[sampleId][~clinicalSampleDF[patientId].isin(clinicalDF[patientId])])
+ #CHECK: All patients must have associated sample data
+ if not all(patient_patients.isin(sample_patients)):
+ ### MAKE WARNING FOR NOW###
+",processing/clinical.py,"ReplaceText(target='sampleId' @(382,157)->(382,166))","class clinical(example_filetype_format.FileTypeFormat):
+ patient_patients = clinicalDF[patientId][clinicalDF[patientId] != """"]
+ # #CHECK: All samples must have associated patient data (GENIE requires patient data)
+ if not all(sample_patients.isin(patient_patients)):
+ total_error += ""Sample: All samples must have associated patient information. These samples are missing patient data: %s\n"" % "", "".join(clinicalSampleDF[patientId][~clinicalSampleDF[patientId].isin(clinicalDF[patientId])])
+ #CHECK: All patients must have associated sample data
+ if not all(patient_patients.isin(sample_patients)):
+ ### MAKE WARNING FOR NOW###","class clinical(example_filetype_format.FileTypeFormat):
+ patient_patients = clinicalDF[patientId][clinicalDF[patientId] != """"]
+ # #CHECK: All samples must have associated patient data (GENIE requires patient data)
+ if not all(sample_patients.isin(patient_patients)):
+ total_error += ""Sample: All samples must have associated patient information. These samples are missing patient data: %s\n"" % "", "".join(clinicalSampleDF[sampleId][~clinicalSampleDF[patientId].isin(clinicalDF[patientId])])
+ #CHECK: All patients must have associated sample data
+ if not all(patient_patients.isin(sample_patients)):
+ ### MAKE WARNING FOR NOW###"
+114,https://:@github.com/Sage-Bionetworks/Genie.git,b5b670e4a5797ba2a66caa517bbe2160fec645f7,"@@ -209,7 +209,7 @@ def createMafDatabase(syn, databaseToSynIdMappingDf,testing=False,staging=False)
+ #Make sure to store the newly created maf db synid into the staging synapse mapping
+ databaseToSynIdMapping = syn.tableQuery(""SELECT * FROM syn12094210 where Database = 'vcf2maf'"")
+ databaseToSynIdMappingDf = databaseToSynIdMapping.asDataFrame()
+- databaseToSynIdMapping['Id'][0] = newMafDb.id
++ databaseToSynIdMappingDf['Id'][0] = newMafDb.id
+ syn.store(synapseclient.Table(""syn12094210"",databaseToSynIdMappingDf))
+ #Move and archive old mafdatabase
+ mafDatabaseEnt.parentId = ""syn7208886""
+",processing/input_to_database.py,"ReplaceText(target='databaseToSynIdMappingDf' @(212,2)->(212,24))","def createMafDatabase(syn, databaseToSynIdMappingDf,testing=False,staging=False)
+ #Make sure to store the newly created maf db synid into the staging synapse mapping
+ databaseToSynIdMapping = syn.tableQuery(""SELECT * FROM syn12094210 where Database = 'vcf2maf'"")
+ databaseToSynIdMappingDf = databaseToSynIdMapping.asDataFrame()
+ databaseToSynIdMapping['Id'][0] = newMafDb.id
+ syn.store(synapseclient.Table(""syn12094210"",databaseToSynIdMappingDf))
+ #Move and archive old mafdatabase
+ mafDatabaseEnt.parentId = ""syn7208886""","def createMafDatabase(syn, databaseToSynIdMappingDf,testing=False,staging=False)
+ #Make sure to store the newly created maf db synid into the staging synapse mapping
+ databaseToSynIdMapping = syn.tableQuery(""SELECT * FROM syn12094210 where Database = 'vcf2maf'"")
+ databaseToSynIdMappingDf = databaseToSynIdMapping.asDataFrame()
+ databaseToSynIdMappingDf['Id'][0] = newMafDb.id
+ syn.store(synapseclient.Table(""syn12094210"",databaseToSynIdMappingDf))
+ #Move and archive old mafdatabase
+ mafDatabaseEnt.parentId = ""syn7208886"""
+115,https://:@github.com/Sage-Bionetworks/Genie.git,78fcacd10d4c44c90f41893a161de24ff13ea774,"@@ -311,7 +311,7 @@ class clinical(FileTypeFormat):
+ haveColumn = process_functions.checkColExist(clinicalDF, ""SEQ_ASSAY_ID"")
+ if haveColumn:
+ if not all([i != """" for i in clinicalDF['SEQ_ASSAY_ID']]):
+- total_error += ""Sample: Please double check your SEQ_ASSAY_ID columns, there are empty rows.\n""
++ warning += ""Sample: Please double check your SEQ_ASSAY_ID columns, there are empty rows.\n""
+ #must remove empty seq assay ids first
+ #Checking if seq assay ids start with the center name
+ seqAssayIds = clinicalDF.SEQ_ASSAY_ID[clinicalDF.SEQ_ASSAY_ID != """"]
+",genie/clinical.py,"ReplaceText(target='warning' @(314,4)->(314,15))","class clinical(FileTypeFormat):
+ haveColumn = process_functions.checkColExist(clinicalDF, ""SEQ_ASSAY_ID"")
+ if haveColumn:
+ if not all([i != """" for i in clinicalDF['SEQ_ASSAY_ID']]):
+ total_error += ""Sample: Please double check your SEQ_ASSAY_ID columns, there are empty rows.\n""
+ #must remove empty seq assay ids first
+ #Checking if seq assay ids start with the center name
+ seqAssayIds = clinicalDF.SEQ_ASSAY_ID[clinicalDF.SEQ_ASSAY_ID != """"]","class clinical(FileTypeFormat):
+ haveColumn = process_functions.checkColExist(clinicalDF, ""SEQ_ASSAY_ID"")
+ if haveColumn:
+ if not all([i != """" for i in clinicalDF['SEQ_ASSAY_ID']]):
+ warning += ""Sample: Please double check your SEQ_ASSAY_ID columns, there are empty rows.\n""
+ #must remove empty seq assay ids first
+ #Checking if seq assay ids start with the center name
+ seqAssayIds = clinicalDF.SEQ_ASSAY_ID[clinicalDF.SEQ_ASSAY_ID != """"]"
+116,https://:@github.com/Sage-Bionetworks/Genie.git,e115f3884db224a231c87b346f04d6edbf66d6bb,"@@ -87,7 +87,7 @@ class vcf(maf.maf):
+ tumor = ""TUMOR""
+ normal = ""NORMAL""
+ # ### If the tumor name isn't TUMOR, set the sample id to be the tumor name
+- if tumor != ""TUMOR"":
++ if tumor == ""TUMOR"":
+ tumorName = vcfName.replace("".vcf"","""")
+ else:
+ tumorName = tumor
+",genie/vcf.py,"ReplaceText(target='==' @(90,12)->(90,14))","class vcf(maf.maf):
+ tumor = ""TUMOR""
+ normal = ""NORMAL""
+ # ### If the tumor name isn't TUMOR, set the sample id to be the tumor name
+ if tumor != ""TUMOR"":
+ tumorName = vcfName.replace("".vcf"","""")
+ else:
+ tumorName = tumor","class vcf(maf.maf):
+ tumor = ""TUMOR""
+ normal = ""NORMAL""
+ # ### If the tumor name isn't TUMOR, set the sample id to be the tumor name
+ if tumor == ""TUMOR"":
+ tumorName = vcfName.replace("".vcf"","""")
+ else:
+ tumorName = tumor"
+117,https://:@github.com/Sage-Bionetworks/Genie.git,4c861c5eccebb0d0a402d85b658924df1e6a8819,"@@ -247,7 +247,7 @@ def validation(syn, center, process, center_mapping_df, databaseToSynIdMappingDf
+ duplicatedFiles = duplicatedFiles.append(cbsSegFiles)
+ clinical_bool = [""clinical"" in i for i in inputValidStatus['name']]
+ clinical_files = inputValidStatus[clinical_bool]
+- if len(clinical_bool) > 2:
++ if len(clinical_files) > 2:
+ duplicatedFiles = duplicatedFiles.append(clinical_files)
+
+ # nodups = [""data_mutations_extended""]
+",genie/input_to_database.py,"ReplaceText(target='clinical_files' @(250,15)->(250,28))","def validation(syn, center, process, center_mapping_df, databaseToSynIdMappingDf
+ duplicatedFiles = duplicatedFiles.append(cbsSegFiles)
+ clinical_bool = [""clinical"" in i for i in inputValidStatus['name']]
+ clinical_files = inputValidStatus[clinical_bool]
+ if len(clinical_bool) > 2:
+ duplicatedFiles = duplicatedFiles.append(clinical_files)
+
+ # nodups = [""data_mutations_extended""]","def validation(syn, center, process, center_mapping_df, databaseToSynIdMappingDf
+ duplicatedFiles = duplicatedFiles.append(cbsSegFiles)
+ clinical_bool = [""clinical"" in i for i in inputValidStatus['name']]
+ clinical_files = inputValidStatus[clinical_bool]
+ if len(clinical_files) > 2:
+ duplicatedFiles = duplicatedFiles.append(clinical_files)
+
+ # nodups = [""data_mutations_extended""]"
+118,https://:@github.com/Sage-Bionetworks/Genie.git,39f33cd754223ee515b8d790c0cd96b32f36b88e,"@@ -270,7 +270,7 @@ def validatefile(syn, entities, validation_status_table, error_tracker_table,
+ input_status_list, invalid_errors_list = _get_status_and_error_list(
+ valid, message, entities)
+ # Send email the first time the file is invalid
+- if invalid_errors_list:
++ if not invalid_errors_list:
+ _send_validation_error_email(syn, filenames, message, file_users)
+ else:
+ input_status_list = [
+",genie/input_to_database.py,"ReplaceText(target='not ' @(273,11)->(273,11))","def validatefile(syn, entities, validation_status_table, error_tracker_table,
+ input_status_list, invalid_errors_list = _get_status_and_error_list(
+ valid, message, entities)
+ # Send email the first time the file is invalid
+ if invalid_errors_list:
+ _send_validation_error_email(syn, filenames, message, file_users)
+ else:
+ input_status_list = [","def validatefile(syn, entities, validation_status_table, error_tracker_table,
+ input_status_list, invalid_errors_list = _get_status_and_error_list(
+ valid, message, entities)
+ # Send email the first time the file is invalid
+ if not invalid_errors_list:
+ _send_validation_error_email(syn, filenames, message, file_users)
+ else:
+ input_status_list = ["
+119,https://:@github.com/Sage-Bionetworks/Genie.git,e140dee708542afa35c5d1e30671d8083fcbcd29,"@@ -512,7 +512,7 @@ class bed(FileTypeFormat):
+ string: Path to new bed file
+ """"""
+ final_beddf = self._process(beddf, seq_assay_id, newPath, parentId)
+- process_functions.updateData(self.syn, databaseSynId, beddf,
++ process_functions.updateData(self.syn, databaseSynId, final_beddf,
+ seq_assay_id,
+ filterByColumn=""SEQ_ASSAY_ID"",
+ toDelete=True)
+",genie/bed.py,"ReplaceText(target='final_beddf' @(515,62)->(515,67))","class bed(FileTypeFormat):
+ string: Path to new bed file
+ """"""
+ final_beddf = self._process(beddf, seq_assay_id, newPath, parentId)
+ process_functions.updateData(self.syn, databaseSynId, beddf,
+ seq_assay_id,
+ filterByColumn=""SEQ_ASSAY_ID"",
+ toDelete=True)","class bed(FileTypeFormat):
+ string: Path to new bed file
+ """"""
+ final_beddf = self._process(beddf, seq_assay_id, newPath, parentId)
+ process_functions.updateData(self.syn, databaseSynId, final_beddf,
+ seq_assay_id,
+ filterByColumn=""SEQ_ASSAY_ID"",
+ toDelete=True)"
+120,https://:@github.com/Libensemble/libensemble.git,a7175c6bf59803deb4a52aaf8c0185b93874ff21,"@@ -96,7 +96,7 @@ def decide_work_and_resources(active_w, idle_w, H, H_ind, sim_specs, gen_specs):
+ 'form_subcomm': [],
+ 'calc_in': H[sim_specs['in']][inds_to_send],
+ 'calc_out': sim_specs['out'],
+- 'calc_info': {'type':'sim', 'pt_ids': q_inds},
++ 'calc_info': {'type':'sim', 'pt_ids': inds_to_send},
+ }
+
+ update_history_x_out(H, q_inds, Work[i]['calc_in'], i, sim_specs['params'])
+",code/src/libE_manager.py,"ReplaceText(target='inds_to_send' @(99,61)->(99,67))","def decide_work_and_resources(active_w, idle_w, H, H_ind, sim_specs, gen_specs):
+ 'form_subcomm': [],
+ 'calc_in': H[sim_specs['in']][inds_to_send],
+ 'calc_out': sim_specs['out'],
+ 'calc_info': {'type':'sim', 'pt_ids': q_inds},
+ }
+
+ update_history_x_out(H, q_inds, Work[i]['calc_in'], i, sim_specs['params'])","def decide_work_and_resources(active_w, idle_w, H, H_ind, sim_specs, gen_specs):
+ 'form_subcomm': [],
+ 'calc_in': H[sim_specs['in']][inds_to_send],
+ 'calc_out': sim_specs['out'],
+ 'calc_info': {'type':'sim', 'pt_ids': inds_to_send},
+ }
+
+ update_history_x_out(H, q_inds, Work[i]['calc_in'], i, sim_specs['params'])"
+121,https://:@github.com/Libensemble/libensemble.git,ad5e021d040efd28a61d6afa2be908e25f363bd4,"@@ -52,7 +52,7 @@ def worker_main(c, sim_specs, gen_specs):
+
+ if tag_out == STOP_TAG: break
+
+- comm.send(obj=data_out, dest=0, tag=calc_tag)
++ comm.send(obj=data_out, dest=0, tag=tag_out)
+
+ # Clean up
+ for loc in locations.values():
+",code/src/libE_worker.py,"ReplaceText(target='tag_out' @(55,44)->(55,52))","def worker_main(c, sim_specs, gen_specs):
+
+ if tag_out == STOP_TAG: break
+
+ comm.send(obj=data_out, dest=0, tag=calc_tag)
+
+ # Clean up
+ for loc in locations.values():","def worker_main(c, sim_specs, gen_specs):
+
+ if tag_out == STOP_TAG: break
+
+ comm.send(obj=data_out, dest=0, tag=tag_out)
+
+ # Clean up
+ for loc in locations.values():"
+122,https://:@github.com/Libensemble/libensemble.git,2b33970bdac3034cc7799c2849eae09f9c22fcf6,"@@ -40,7 +40,7 @@ class MPIComm(Comm):
+ def kill_pending(self):
+ ""Make sure pending requests are cancelled if the comm is killed.""
+ for req in self._outbox:
+- if req.Test():
++ if not req.Test():
+ req.Cancel()
+ self._outbox = []
+
+",libensemble/mpi_comms.py,"ReplaceText(target='not ' @(43,15)->(43,15))","class MPIComm(Comm):
+ def kill_pending(self):
+ ""Make sure pending requests are cancelled if the comm is killed.""
+ for req in self._outbox:
+ if req.Test():
+ req.Cancel()
+ self._outbox = []
+ ","class MPIComm(Comm):
+ def kill_pending(self):
+ ""Make sure pending requests are cancelled if the comm is killed.""
+ for req in self._outbox:
+ if not req.Test():
+ req.Cancel()
+ self._outbox = []
+ "
+123,https://:@github.com/Libensemble/libensemble.git,155ba0c0517046e8ec305e76862bc6f0a44fafc7,"@@ -136,7 +136,7 @@ class EnvResources:
+ nidstr = splitstr[1].strip(""]"")
+ nidlst = EnvResources._noderange_append(prefix, nidstr)
+ else: # Multiple Partitions
+- splitgroups = [str.split('[', 1) for str in splitstr]
++ splitgroups = [str.split('[', 1) for str in part_splitstr]
+ prefixgroups = [group[0] for group in splitgroups]
+ nodegroups = [group[1].strip(']') for group in splitgroups]
+ nidlst = []
+",libensemble/env_resources.py,"ReplaceText(target='part_splitstr' @(139,56)->(139,64))","class EnvResources:
+ nidstr = splitstr[1].strip(""]"")
+ nidlst = EnvResources._noderange_append(prefix, nidstr)
+ else: # Multiple Partitions
+ splitgroups = [str.split('[', 1) for str in splitstr]
+ prefixgroups = [group[0] for group in splitgroups]
+ nodegroups = [group[1].strip(']') for group in splitgroups]
+ nidlst = []","class EnvResources:
+ nidstr = splitstr[1].strip(""]"")
+ nidlst = EnvResources._noderange_append(prefix, nidstr)
+ else: # Multiple Partitions
+ splitgroups = [str.split('[', 1) for str in part_splitstr]
+ prefixgroups = [group[0] for group in splitgroups]
+ nodegroups = [group[1].strip(']') for group in splitgroups]
+ nidlst = []"
+124,https://:@github.com/Libensemble/libensemble.git,c89e4f0b72361ba84884a3c691d73d8f62b98014,"@@ -108,7 +108,7 @@ def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):
+ last_size = persis_info.get('last_size')
+ if len(H):
+ # Don't give gen instances in batch mode if points are unfinished
+- if (gen_specs['user'].get('batch_mode')
++ if (alloc_specs['user'].get('batch_mode')
+ and not all(np.logical_or(H['returned'][last_size:],
+ H['paused'][last_size:]))):
+ break
+",libensemble/alloc_funcs/fast_alloc_and_pausing.py,"ReplaceText(target='alloc_specs' @(111,20)->(111,29))","def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):
+ last_size = persis_info.get('last_size')
+ if len(H):
+ # Don't give gen instances in batch mode if points are unfinished
+ if (gen_specs['user'].get('batch_mode')
+ and not all(np.logical_or(H['returned'][last_size:],
+ H['paused'][last_size:]))):
+ break","def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):
+ last_size = persis_info.get('last_size')
+ if len(H):
+ # Don't give gen instances in batch mode if points are unfinished
+ if (alloc_specs['user'].get('batch_mode')
+ and not all(np.logical_or(H['returned'][last_size:],
+ H['paused'][last_size:]))):
+ break"
+125,https://:@github.com/Libensemble/libensemble.git,c89e4f0b72361ba84884a3c691d73d8f62b98014,"@@ -33,7 +33,7 @@ def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):
+ last_size = persis_info.get('last_size')
+ if len(H):
+ # Don't give gen instances in batch mode if points are unfinished
+- if (gen_specs['user'].get('batch_mode')
++ if (alloc_specs['user'].get('batch_mode')
+ and not all(np.logical_or(H['returned'][last_size:],
+ H['paused'][last_size:]))):
+ break
+",libensemble/alloc_funcs/fast_alloc_to_aposmm.py,"ReplaceText(target='alloc_specs' @(36,20)->(36,29))","def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):
+ last_size = persis_info.get('last_size')
+ if len(H):
+ # Don't give gen instances in batch mode if points are unfinished
+ if (gen_specs['user'].get('batch_mode')
+ and not all(np.logical_or(H['returned'][last_size:],
+ H['paused'][last_size:]))):
+ break","def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):
+ last_size = persis_info.get('last_size')
+ if len(H):
+ # Don't give gen instances in batch mode if points are unfinished
+ if (alloc_specs['user'].get('batch_mode')
+ and not all(np.logical_or(H['returned'][last_size:],
+ H['paused'][last_size:]))):
+ break"
+126,https://:@github.com/Libensemble/libensemble.git,c89e4f0b72361ba84884a3c691d73d8f62b98014,"@@ -73,7 +73,7 @@ def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):
+
+ # No gen instances in batch mode if workers still working
+ still_working = ~H['returned']
+- if gen_specs['user'].get('batch_mode') and np.any(still_working):
++ if alloc_specs['user'].get('batch_mode') and np.any(still_working):
+ break
+
+ # Give gen work
+",libensemble/alloc_funcs/give_sim_work_first.py,"ReplaceText(target='alloc_specs' @(76,15)->(76,24))","def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):
+
+ # No gen instances in batch mode if workers still working
+ still_working = ~H['returned']
+ if gen_specs['user'].get('batch_mode') and np.any(still_working):
+ break
+
+ # Give gen work","def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):
+
+ # No gen instances in batch mode if workers still working
+ still_working = ~H['returned']
+ if alloc_specs['user'].get('batch_mode') and np.any(still_working):
+ break
+
+ # Give gen work"
+127,https://:@github.com/Libensemble/libensemble.git,55f4a8f05ade4709b53cbe9ef92fe00a0e2e9a79,"@@ -59,7 +59,7 @@ def try_and_run_nlopt(H, gen_specs, libE_info):
+ gen_specs['user']['ub'], gen_specs['user']['lb'], local=True, active=True)
+ tag, Work, calc_in = sendrecv_mgr_worker_msg(comm, H_o)
+ if tag in [STOP_TAG, PERSIS_STOP]:
+- nlopt.forced_stop.message = 'tag=' + str(tag)
++ nlopt.forced_stop.message = 'tag=' + str(Work)
+ raise nlopt.forced_stop
+
+ # Return function value (and maybe gradient)
+",libensemble/gen_funcs/uniform_or_localopt.py,"ReplaceText(target='Work' @(62,53)->(62,56))","def try_and_run_nlopt(H, gen_specs, libE_info):
+ gen_specs['user']['ub'], gen_specs['user']['lb'], local=True, active=True)
+ tag, Work, calc_in = sendrecv_mgr_worker_msg(comm, H_o)
+ if tag in [STOP_TAG, PERSIS_STOP]:
+ nlopt.forced_stop.message = 'tag=' + str(tag)
+ raise nlopt.forced_stop
+
+ # Return function value (and maybe gradient)","def try_and_run_nlopt(H, gen_specs, libE_info):
+ gen_specs['user']['ub'], gen_specs['user']['lb'], local=True, active=True)
+ tag, Work, calc_in = sendrecv_mgr_worker_msg(comm, H_o)
+ if tag in [STOP_TAG, PERSIS_STOP]:
+ nlopt.forced_stop.message = 'tag=' + str(Work)
+ raise nlopt.forced_stop
+
+ # Return function value (and maybe gradient)"
+128,https://:@github.com/Libensemble/libensemble.git,c090514bb370c6960db4c8be2ae643534def8d2b,"@@ -24,4 +24,4 @@ def persistent_uniform(H, persis_info, gen_specs, libE_info):
+ H_o['x'] = persis_info['rand_stream'].uniform(lb, ub, (b, n))
+ tag, Work, calc_in = sendrecv_mgr_worker_msg(libE_info['comm'], H_o)
+
+- return H_o, persis_info, tag
++ return H_o, persis_info, Work
+",libensemble/gen_funcs/persistent_uniform_sampling.py,"ReplaceText(target='Work' @(27,29)->(27,32))","def persistent_uniform(H, persis_info, gen_specs, libE_info):
+ H_o['x'] = persis_info['rand_stream'].uniform(lb, ub, (b, n))
+ tag, Work, calc_in = sendrecv_mgr_worker_msg(libE_info['comm'], H_o)
+
+ return H_o, persis_info, tag","def persistent_uniform(H, persis_info, gen_specs, libE_info):
+ H_o['x'] = persis_info['rand_stream'].uniform(lb, ub, (b, n))
+ tag, Work, calc_in = sendrecv_mgr_worker_msg(libE_info['comm'], H_o)
+
+ return H_o, persis_info, Work"
+129,https://:@github.com/davedittrich/python_secrets.git,3a477f63bb9d0417e63254ba993025a8666c3e1d,"@@ -181,7 +181,7 @@ class PythonSecretsApp(App):
+ self.environment = self.options.environment
+ self.secrets_basedir = self.options.secrets_basedir
+ # Don't output error messages when ""complete"" command used
+- if cmd.cmd_name == 'complete':
++ if cmd.cmd_name != 'complete':
+ SecretsEnvironment.permissions_check(
+ self.secrets_basedir,
+ verbose_level=self.options.verbose_level,
+",psec/main.py,"ReplaceText(target='!=' @(184,24)->(184,26))","class PythonSecretsApp(App):
+ self.environment = self.options.environment
+ self.secrets_basedir = self.options.secrets_basedir
+ # Don't output error messages when ""complete"" command used
+ if cmd.cmd_name == 'complete':
+ SecretsEnvironment.permissions_check(
+ self.secrets_basedir,
+ verbose_level=self.options.verbose_level,","class PythonSecretsApp(App):
+ self.environment = self.options.environment
+ self.secrets_basedir = self.options.secrets_basedir
+ # Don't output error messages when ""complete"" command used
+ if cmd.cmd_name != 'complete':
+ SecretsEnvironment.permissions_check(
+ self.secrets_basedir,
+ verbose_level=self.options.verbose_level,"
+130,https://:@github.com/junzis/pyModeS.git,b2940af6efe4cb6d99bca8a1f1f214292acf3e6a,"@@ -79,7 +79,7 @@ def cpr2position(cprlat0, cprlat1, cprlon0, cprlon1, t0, t1):
+ cprlat_even = cprlat0 / 131072.0
+ cprlat_odd = cprlat1 / 131072.0
+ cprlon_even = cprlon0 / 131072.0
+- cprlon_odd = cprlon0 / 131072.0
++ cprlon_odd = cprlon1 / 131072.0
+
+ air_d_lat_even = 360.0 / 60
+ air_d_lat_odd = 360.0 / 59
+",decoder.py,"ReplaceText(target='cprlon1' @(82,18)->(82,25))","def cpr2position(cprlat0, cprlat1, cprlon0, cprlon1, t0, t1):
+ cprlat_even = cprlat0 / 131072.0
+ cprlat_odd = cprlat1 / 131072.0
+ cprlon_even = cprlon0 / 131072.0
+ cprlon_odd = cprlon0 / 131072.0
+
+ air_d_lat_even = 360.0 / 60
+ air_d_lat_odd = 360.0 / 59 ","def cpr2position(cprlat0, cprlat1, cprlon0, cprlon1, t0, t1):
+ cprlat_even = cprlat0 / 131072.0
+ cprlat_odd = cprlat1 / 131072.0
+ cprlon_even = cprlon0 / 131072.0
+ cprlon_odd = cprlon1 / 131072.0
+
+ air_d_lat_even = 360.0 / 60
+ air_d_lat_odd = 360.0 / 59 "
+131,https://:@github.com/icb-dcm/pyabc.git,2df9fbbc034ecad45cde0e14d0205fc70ae9b90b,"@@ -456,5 +456,5 @@ class ABCSMC:
+ return
+
+ for m in self.history.alive_models(t - 1):
+- particles, w = self.history.get_distribution(t - 1, m)
++ particles, w = self.history.get_distribution(m, t - 1)
+ self.transitions[m].fit(particles, w)
+",pyabc/smc.py,"ArgSwap(idxs=0<->1 @(459,27)->(459,56))","class ABCSMC:
+ return
+
+ for m in self.history.alive_models(t - 1):
+ particles, w = self.history.get_distribution(t - 1, m)
+ self.transitions[m].fit(particles, w)","class ABCSMC:
+ return
+
+ for m in self.history.alive_models(t - 1):
+ particles, w = self.history.get_distribution(m, t - 1)
+ self.transitions[m].fit(particles, w)"
+132,https://:@github.com/icb-dcm/pyabc.git,2df9fbbc034ecad45cde0e14d0205fc70ae9b90b,"@@ -108,7 +108,7 @@ def abc_model(abc_id, model_id, t):
+ t = history.max_t
+ else:
+ t = int(t)
+- df, w = history.get_distribution(t, model_id)
++ df, w = history.get_distribution(model_id, t)
+ df[""CDF""] = w
+ tabs = []
+
+",pyabc/visserver/server.py,"ArgSwap(idxs=0<->1 @(111,12)->(111,36))","def abc_model(abc_id, model_id, t):
+ t = history.max_t
+ else:
+ t = int(t)
+ df, w = history.get_distribution(t, model_id)
+ df[""CDF""] = w
+ tabs = []
+ ","def abc_model(abc_id, model_id, t):
+ t = history.max_t
+ else:
+ t = int(t)
+ df, w = history.get_distribution(model_id, t)
+ df[""CDF""] = w
+ tabs = []
+ "
+133,https://:@github.com/icb-dcm/pyabc.git,2df9fbbc034ecad45cde0e14d0205fc70ae9b90b,"@@ -122,7 +122,7 @@ def test_dataframe_storage_readout():
+ for m in range(5):
+ pop = pops[(h, m, t)]
+ expected_particles_list = [p.parameter for p in pop]
+- pars_df, w = h.get_distribution(t, m)
++ pars_df, w = h.get_distribution(m, t)
+ # use range(len and not zip on dataframe to not stop early
+ # in case of population not completely stored
+ assert np.isclose(w.sum(), 1)
+",test/test_storage.py,"ArgSwap(idxs=0<->1 @(125,29)->(125,47))","def test_dataframe_storage_readout():
+ for m in range(5):
+ pop = pops[(h, m, t)]
+ expected_particles_list = [p.parameter for p in pop]
+ pars_df, w = h.get_distribution(t, m)
+ # use range(len and not zip on dataframe to not stop early
+ # in case of population not completely stored
+ assert np.isclose(w.sum(), 1)","def test_dataframe_storage_readout():
+ for m in range(5):
+ pop = pops[(h, m, t)]
+ expected_particles_list = [p.parameter for p in pop]
+ pars_df, w = h.get_distribution(m, t)
+ # use range(len and not zip on dataframe to not stop early
+ # in case of population not completely stored
+ assert np.isclose(w.sum(), 1)"
+134,https://:@github.com/llllllllll/codetransformer.git,7c327683df810265d01a995d2704c9f8218b0ef7,"@@ -141,7 +141,7 @@ class Instruction(InstructionMeta._marker, metaclass=InstructionMeta):
+ 'little',
+ )
+
+- yield cls(arg)
++ yield instr(arg)
+
+ @classmethod
+ def from_opcode(cls, opcode):
+",codetransformer/instructions.py,"ReplaceText(target='instr' @(144,18)->(144,21))","class Instruction(InstructionMeta._marker, metaclass=InstructionMeta):
+ 'little',
+ )
+
+ yield cls(arg)
+
+ @classmethod
+ def from_opcode(cls, opcode):","class Instruction(InstructionMeta._marker, metaclass=InstructionMeta):
+ 'little',
+ )
+
+ yield instr(arg)
+
+ @classmethod
+ def from_opcode(cls, opcode):"
+135,https://:@github.com/richardkiss/pycoin.git,c6b3b2e0d7167d4566dc1d90258d6b98dba8bb65,"@@ -197,7 +197,7 @@ def eval_script(script, signature_for_hash_type_f, lock_time, expected_hash_type
+ # Subset of script starting at the most recent codeseparator
+ op_checksig(stack, signature_for_hash_type_f, expected_hash_type, script[begin_code_hash:], flags)
+ if opcode == opcodes.OP_CHECKSIGVERIFY:
+- if bool_from_script_bytes(stack.pop()):
++ if not bool_from_script_bytes(stack.pop()):
+ raise ScriptError(""VERIFY failed at %d"" % (pc-1))
+ continue
+
+",pycoin/tx/script/vm.py,"ReplaceText(target='not ' @(200,23)->(200,23))","def eval_script(script, signature_for_hash_type_f, lock_time, expected_hash_type
+ # Subset of script starting at the most recent codeseparator
+ op_checksig(stack, signature_for_hash_type_f, expected_hash_type, script[begin_code_hash:], flags)
+ if opcode == opcodes.OP_CHECKSIGVERIFY:
+ if bool_from_script_bytes(stack.pop()):
+ raise ScriptError(""VERIFY failed at %d"" % (pc-1))
+ continue
+ ","def eval_script(script, signature_for_hash_type_f, lock_time, expected_hash_type
+ # Subset of script starting at the most recent codeseparator
+ op_checksig(stack, signature_for_hash_type_f, expected_hash_type, script[begin_code_hash:], flags)
+ if opcode == opcodes.OP_CHECKSIGVERIFY:
+ if not bool_from_script_bytes(stack.pop()):
+ raise ScriptError(""VERIFY failed at %d"" % (pc-1))
+ continue
+ "
+136,https://:@github.com/richardkiss/pycoin.git,6d1df60ddb054d1510f38231a529ccf35a73525a,"@@ -302,7 +302,7 @@ def generate_output(args, output_dict, output_order):
+
+ if len(output_order) == 0:
+ print(""no output: use -j option to see keys"")
+- elif len(output_order) == 1:
++ elif len(output_dict) == 1:
+ print(output_dict[output_order[0][0]])
+ else:
+ dump_output(output_dict, output_order)
+",pycoin/cmds/ku.py,"ReplaceText(target='output_dict' @(305,13)->(305,25))","def generate_output(args, output_dict, output_order):
+
+ if len(output_order) == 0:
+ print(""no output: use -j option to see keys"")
+ elif len(output_order) == 1:
+ print(output_dict[output_order[0][0]])
+ else:
+ dump_output(output_dict, output_order)","def generate_output(args, output_dict, output_order):
+
+ if len(output_order) == 0:
+ print(""no output: use -j option to see keys"")
+ elif len(output_dict) == 1:
+ print(output_dict[output_order[0][0]])
+ else:
+ dump_output(output_dict, output_order)"
+137,https://:@github.com/richardkiss/pycoin.git,02a225ef6056cc5a7fa19a731e14fbda94522c55,"@@ -37,7 +37,7 @@ def deterministic_generate_k(generator_order, secret_exponent, val, hash_f=hashl
+ shift = 8 * hash_size - bln
+ if shift > 0:
+ val >>= shift
+- if val > n:
++ if val >= n:
+ val -= n
+ h1 = intstream.to_bytes(val, length=order_size)
+ k = hmac.new(k, v + b'\x00' + priv + h1, hash_f).digest()
+",pycoin/ecdsa/rfc6979.py,"ReplaceText(target='>=' @(40,11)->(40,12))","def deterministic_generate_k(generator_order, secret_exponent, val, hash_f=hashl
+ shift = 8 * hash_size - bln
+ if shift > 0:
+ val >>= shift
+ if val > n:
+ val -= n
+ h1 = intstream.to_bytes(val, length=order_size)
+ k = hmac.new(k, v + b'\x00' + priv + h1, hash_f).digest()","def deterministic_generate_k(generator_order, secret_exponent, val, hash_f=hashl
+ shift = 8 * hash_size - bln
+ if shift > 0:
+ val >>= shift
+ if val >= n:
+ val -= n
+ h1 = intstream.to_bytes(val, length=order_size)
+ k = hmac.new(k, v + b'\x00' + priv + h1, hash_f).digest()"
+138,https://:@github.com/er1iang/hfut-stu-lib.git,6bdc0e5591564da7b5fe2acd60bde0cb8b2b46f6,"@@ -60,7 +60,7 @@ class TestUtil(TestBase):
+ '172.18.6.98',
+ '172.18.6.99'
+ ])
+- assert len(r) == 1
++ assert len(r) <= 1
+ with pytest.raises(ValueError):
+ util.get_host_speed_rank(['qq.com'])
+ assert util.get_host_speed_rank(timeout=0) == []
+",tests/test_util.py,"ReplaceText(target='<=' @(63,22)->(63,24))","class TestUtil(TestBase):
+ '172.18.6.98',
+ '172.18.6.99'
+ ])
+ assert len(r) == 1
+ with pytest.raises(ValueError):
+ util.get_host_speed_rank(['qq.com'])
+ assert util.get_host_speed_rank(timeout=0) == []","class TestUtil(TestBase):
+ '172.18.6.98',
+ '172.18.6.99'
+ ])
+ assert len(r) <= 1
+ with pytest.raises(ValueError):
+ util.get_host_speed_rank(['qq.com'])
+ assert util.get_host_speed_rank(timeout=0) == []"
+139,https://:@github.com/acorg/dark-matter.git,7837baf17ff17925b5a56178358b3ec478635c9b,"@@ -109,7 +109,7 @@ def main():
+ consensus.id = args.id
+ elif args.idLambda is not None:
+ idLambda = eval(args.idLambda)
+- consensus.id = idLambda(args.id)
++ consensus.id = idLambda(consensus.id)
+
+ print(consensus.toString('fasta'), end='')
+
+",bin/make-consensus.py,"ReplaceText(target='consensus' @(112,32)->(112,36))","def main():
+ consensus.id = args.id
+ elif args.idLambda is not None:
+ idLambda = eval(args.idLambda)
+ consensus.id = idLambda(args.id)
+
+ print(consensus.toString('fasta'), end='')
+ ","def main():
+ consensus.id = args.id
+ elif args.idLambda is not None:
+ idLambda = eval(args.idLambda)
+ consensus.id = idLambda(consensus.id)
+
+ print(consensus.toString('fasta'), end='')
+ "
+140,https://:@github.com/Netflix/security_monkey.git,b6356189f8c9e407e4c017bbbf31d8f32aa004a9,"@@ -122,7 +122,7 @@ class SNSAuditor(Auditor):
+ else:
+ arn = ARN(princ_aws)
+ if arn.error:
+- self.add_issue(3, 'Auditor could not parse ARN', snsitem, notes=entry)
++ self.add_issue(3, 'Auditor could not parse ARN', snsitem, notes=princ_aws)
+ else:
+ account_numbers.append(arn.account_number)
+
+",security_monkey/auditors/sns.py,"ReplaceText(target='princ_aws' @(125,88)->(125,93))","class SNSAuditor(Auditor):
+ else:
+ arn = ARN(princ_aws)
+ if arn.error:
+ self.add_issue(3, 'Auditor could not parse ARN', snsitem, notes=entry)
+ else:
+ account_numbers.append(arn.account_number)
+ ","class SNSAuditor(Auditor):
+ else:
+ arn = ARN(princ_aws)
+ if arn.error:
+ self.add_issue(3, 'Auditor could not parse ARN', snsitem, notes=princ_aws)
+ else:
+ account_numbers.append(arn.account_number)
+ "
+141,https://:@github.com/SetBased/py-stratum.git,0a4f1f580810e466e6384395832353a77b8e909f,"@@ -26,7 +26,7 @@ class Connection:
+ else:
+ return_value = config.get(section, option, fallback=fallback)
+
+- if fallback is not None and return_value is None:
++ if fallback is None and return_value is None:
+ raise KeyError(""Option '%s' is not found in section '%s'."" % (option, section))
+
+ return return_value
+",pystratum/Connection.py,"ReplaceText(target=' is ' @(29,19)->(29,27))","class Connection:
+ else:
+ return_value = config.get(section, option, fallback=fallback)
+
+ if fallback is not None and return_value is None:
+ raise KeyError(""Option '%s' is not found in section '%s'."" % (option, section))
+
+ return return_value","class Connection:
+ else:
+ return_value = config.get(section, option, fallback=fallback)
+
+ if fallback is None and return_value is None:
+ raise KeyError(""Option '%s' is not found in section '%s'."" % (option, section))
+
+ return return_value"
+142,https://:@github.com/awslabs/aws-service-catalog-puppet-framework.git,8ec184735fbc4d8f72484d5baa0e357bbdbeb9d8,"@@ -85,7 +85,7 @@ def test_deploy_launches_task_builder_for_account_launch_region(sut, mocker, sha
+ assert len(actual_all_tasks.keys()) == 1
+ assert actual_all_tasks == expected_all_tasks
+ mocked_get_required_params.assert_called_once_with(
+- region_name, launch_details.get('portfolio'), launch_details.get('product'), launch_details.get('version'), puppet_account_id
++ region_name, launch_details.get('portfolio'), launch_details.get('product'), launch_details.get('version'), account_id
+ )
+ mocked_get_parameters_for_launch.assert_called_once_with(
+ required_parameters,
+",servicecatalog_puppet/cli_command_helpers_unit_test.py,"ReplaceText(target='account_id' @(88,116)->(88,133))","def test_deploy_launches_task_builder_for_account_launch_region(sut, mocker, sha
+ assert len(actual_all_tasks.keys()) == 1
+ assert actual_all_tasks == expected_all_tasks
+ mocked_get_required_params.assert_called_once_with(
+ region_name, launch_details.get('portfolio'), launch_details.get('product'), launch_details.get('version'), puppet_account_id
+ )
+ mocked_get_parameters_for_launch.assert_called_once_with(
+ required_parameters,","def test_deploy_launches_task_builder_for_account_launch_region(sut, mocker, sha
+ assert len(actual_all_tasks.keys()) == 1
+ assert actual_all_tasks == expected_all_tasks
+ mocked_get_required_params.assert_called_once_with(
+ region_name, launch_details.get('portfolio'), launch_details.get('product'), launch_details.get('version'), account_id
+ )
+ mocked_get_parameters_for_launch.assert_called_once_with(
+ required_parameters,"
+143,https://:@github.com/kivy-garden/graph.git,b6ec8765b231bfbc1cf0c585243eb43379bb8946,"@@ -448,7 +448,7 @@ class Graph(Widget):
+ ymin = self.ymin
+ ymax = self.ymax
+ if ylog:
+- xmin = log10(ymin)
++ ymin = log10(ymin)
+ ymax = log10(ymax)
+ if len(xpoints):
+ top = size[3] if self.x_grid else metrics.dp(12) + size[1]
+",__init__.py,"ReplaceText(target='ymin' @(451,12)->(451,16))","class Graph(Widget):
+ ymin = self.ymin
+ ymax = self.ymax
+ if ylog:
+ xmin = log10(ymin)
+ ymax = log10(ymax)
+ if len(xpoints):
+ top = size[3] if self.x_grid else metrics.dp(12) + size[1]","class Graph(Widget):
+ ymin = self.ymin
+ ymax = self.ymax
+ if ylog:
+ ymin = log10(ymin)
+ ymax = log10(ymax)
+ if len(xpoints):
+ top = size[3] if self.x_grid else metrics.dp(12) + size[1]"
+144,https://:@github.com/irmen/synthesizer.git,e1da70408c0fce248edc4542e2f94e8ea6ea72b9,"@@ -31,7 +31,7 @@ class DecodedSoundFile:
+ self.sample_format = sample_format # one of the ma_format_ values
+ self.sample_format_name = ffi.string(lib.ma_get_format_name(sample_format)).decode()
+ self.samples = samples
+- self.num_frames = len(samples) / self.nchannels
++ self.num_frames = len(samples) // self.nchannels
+ self.duration = self.num_frames / self.sample_rate
+
+
+",pyminiaudio/miniaudio.py,"ReplaceText(target='//' @(34,39)->(34,40))","class DecodedSoundFile:
+ self.sample_format = sample_format # one of the ma_format_ values
+ self.sample_format_name = ffi.string(lib.ma_get_format_name(sample_format)).decode()
+ self.samples = samples
+ self.num_frames = len(samples) / self.nchannels
+ self.duration = self.num_frames / self.sample_rate
+
+ ","class DecodedSoundFile:
+ self.sample_format = sample_format # one of the ma_format_ values
+ self.sample_format_name = ffi.string(lib.ma_get_format_name(sample_format)).decode()
+ self.samples = samples
+ self.num_frames = len(samples) // self.nchannels
+ self.duration = self.num_frames / self.sample_rate
+
+ "
+145,https://:@github.com/pydata/numexpr.git,d11ef8a9dec059b679e773ad8fa54dd4f462d2e8,"@@ -304,7 +304,7 @@ class test_numexpr(TestCase):
+ assert_equal(res, b)
+ a = False
+ res = evaluate('where(a, b, c)')
+- assert_equal(res, b)
++ assert_equal(res, c)
+
+
+
+",numexpr/tests/test_numexpr.py,"ReplaceText(target='c' @(307,26)->(307,27))","class test_numexpr(TestCase):
+ assert_equal(res, b)
+ a = False
+ res = evaluate('where(a, b, c)')
+ assert_equal(res, b)
+
+
+ ","class test_numexpr(TestCase):
+ assert_equal(res, b)
+ a = False
+ res = evaluate('where(a, b, c)')
+ assert_equal(res, c)
+
+
+ "
+146,https://:@github.com/aio-libs/aiozipkin.git,73a9594e475a65d11f32ae1ec48d3a324d2cb2b2,"@@ -23,7 +23,7 @@ class Transport:
+ self._queue.append(data)
+
+ async def _sender_loop(self):
+- while self._ender.done():
++ while not self._ender.done():
+ if len(self._queue) != 0:
+ await self._send()
+
+",aiozipkin/transport.py,"ReplaceText(target='not ' @(26,14)->(26,14))","class Transport:
+ self._queue.append(data)
+
+ async def _sender_loop(self):
+ while self._ender.done():
+ if len(self._queue) != 0:
+ await self._send()
+ ","class Transport:
+ self._queue.append(data)
+
+ async def _sender_loop(self):
+ while not self._ender.done():
+ if len(self._queue) != 0:
+ await self._send()
+ "
+147,https://:@gitlab.com/deliberist/xdgenvpy.git,cce7b99c90cd770aee31195f98e23169405d31c2,"@@ -96,7 +96,7 @@ def print_vars(xdg, variables):
+ :param list variables: A sequence of XDG variables to print.
+ """"""
+ for var in variables:
+- if not (str(var).startswith('XDG_') or hasattr(xdg, var)):
++ if not (str(var).startswith('XDG_') and hasattr(xdg, var)):
+ LOG.error('Invalid XDG variable: %s', var)
+ else:
+ value = getattr(xdg, var)
+",xdgenvpy/__main__.py,"ReplaceText(target='and' @(99,44)->(99,46))","def print_vars(xdg, variables):
+ :param list variables: A sequence of XDG variables to print.
+ """"""
+ for var in variables:
+ if not (str(var).startswith('XDG_') or hasattr(xdg, var)):
+ LOG.error('Invalid XDG variable: %s', var)
+ else:
+ value = getattr(xdg, var)","def print_vars(xdg, variables):
+ :param list variables: A sequence of XDG variables to print.
+ """"""
+ for var in variables:
+ if not (str(var).startswith('XDG_') and hasattr(xdg, var)):
+ LOG.error('Invalid XDG variable: %s', var)
+ else:
+ value = getattr(xdg, var)"
+148,https://:@github.com/theislab/anndata.git,908bbbd7c0ad3e61e7db0441fbe9ec93091a0dd5,"@@ -850,7 +850,7 @@ class AnnData(IndexMixin):
+ categories=ddata[k])
+ if k_stripped in var:
+ var[k_stripped] = pd.Categorical.from_codes(
+- codes=smp[k_stripped].values,
++ codes=var[k_stripped].values,
+ categories=ddata[k])
+ k_to_delete.append(k)
+
+",anndata/anndata.py,"ReplaceText(target='var' @(853,34)->(853,37))","class AnnData(IndexMixin):
+ categories=ddata[k])
+ if k_stripped in var:
+ var[k_stripped] = pd.Categorical.from_codes(
+ codes=smp[k_stripped].values,
+ categories=ddata[k])
+ k_to_delete.append(k)
+ ","class AnnData(IndexMixin):
+ categories=ddata[k])
+ if k_stripped in var:
+ var[k_stripped] = pd.Categorical.from_codes(
+ codes=var[k_stripped].values,
+ categories=ddata[k])
+ k_to_delete.append(k)
+ "
+149,https://:@github.com/theislab/anndata.git,0c6ad8700a028675f25e6a769aaf39db3f2b8893,"@@ -104,7 +104,7 @@ def write_loom(
+ elif len(adata.obsm.keys()) > 0 or len(adata.varm.keys()) > 0:
+ logger.warning(
+ f'The loom file will lack these fields:\n'
+- f'{adata.obsm.keys() + adata.varm.keys()}\n'
++ f'{adata.obsm.keys() | adata.varm.keys()}\n'
+ f'Use write_obsm_varm=True to export multi-dimensional annotations'
+ )
+
+",anndata/readwrite/write.py,"ReplaceText(target='|' @(107,33)->(107,34))","def write_loom(
+ elif len(adata.obsm.keys()) > 0 or len(adata.varm.keys()) > 0:
+ logger.warning(
+ f'The loom file will lack these fields:\n'
+ f'{adata.obsm.keys() + adata.varm.keys()}\n'
+ f'Use write_obsm_varm=True to export multi-dimensional annotations'
+ )
+ ","def write_loom(
+ elif len(adata.obsm.keys()) > 0 or len(adata.varm.keys()) > 0:
+ logger.warning(
+ f'The loom file will lack these fields:\n'
+ f'{adata.obsm.keys() | adata.varm.keys()}\n'
+ f'Use write_obsm_varm=True to export multi-dimensional annotations'
+ )
+ "
+150,https://:@github.com/atarashansky/self-assembling-manifold.git,a8a2172a308d8fb99fc3981e64c1cc358d4d3355,"@@ -965,7 +965,7 @@ class SAMGUI(object):
+ else:
+ return; #quit
+
+- markers = ut.find_corr_genes(s,txt).flatten()
++ markers = ut.find_corr_genes(gene,txt).flatten()
+ _,i = np.unique(markers,return_index=True)
+ markers=markers[np.sort(i)]
+ self.marker_genes[self.stab.selected_index] = markers
+",SAMGUI.py,"ReplaceText(target='gene' @(968,37)->(968,38))","class SAMGUI(object):
+ else:
+ return; #quit
+
+ markers = ut.find_corr_genes(s,txt).flatten()
+ _,i = np.unique(markers,return_index=True)
+ markers=markers[np.sort(i)]
+ self.marker_genes[self.stab.selected_index] = markers","class SAMGUI(object):
+ else:
+ return; #quit
+
+ markers = ut.find_corr_genes(gene,txt).flatten()
+ _,i = np.unique(markers,return_index=True)
+ markers=markers[np.sort(i)]
+ self.marker_genes[self.stab.selected_index] = markers"
+151,https://:@github.com/atarashansky/self-assembling-manifold.git,6539b0d87edc6dd18bd1bd3709fc41ad2c51b3f3,"@@ -248,7 +248,7 @@ def search_string(vec, s, case_sensitive=False, invert=False):
+ i = len(V)
+ V = np.concatenate(V); M = np.concatenate(M);
+ if i > 1:
+- ix = np.sort(np.unique(V,return_index=True)[1])
++ ix = np.sort(np.unique(M,return_index=True)[1])
+ V=V[ix]; M=M[ix];
+ return V,M
+ else:
+",samalg/utilities.py,"ReplaceText(target='M' @(251,35)->(251,36))","def search_string(vec, s, case_sensitive=False, invert=False):
+ i = len(V)
+ V = np.concatenate(V); M = np.concatenate(M);
+ if i > 1:
+ ix = np.sort(np.unique(V,return_index=True)[1])
+ V=V[ix]; M=M[ix];
+ return V,M
+ else:","def search_string(vec, s, case_sensitive=False, invert=False):
+ i = len(V)
+ V = np.concatenate(V); M = np.concatenate(M);
+ if i > 1:
+ ix = np.sort(np.unique(M,return_index=True)[1])
+ V=V[ix]; M=M[ix];
+ return V,M
+ else:"
+152,https://:@github.com/den4uk/andriller.git,a5af3433a9caa6f05d8d43aef5abc8f405349f67,"@@ -379,7 +379,7 @@ class MainWindow(BaseWindow):
+ self.menubar.add_cascade(menu=menu_help, label='Help', underline=0)
+ menu_help.add_command(label='Visit website')
+ menu_help.add_separator()
+- if getattr(sys, 'frozen', False):
++ if not getattr(sys, 'frozen', False):
+ menu_help.add_command(label='Run Update', command=lambda: self.conf.upgrade_package(logger=self.logger))
+ menu_help.add_separator()
+ menu_help.add_command(label='About', command=self.about_msg)
+",andriller/windows.py,"ReplaceText(target='not ' @(382,11)->(382,11))","class MainWindow(BaseWindow):
+ self.menubar.add_cascade(menu=menu_help, label='Help', underline=0)
+ menu_help.add_command(label='Visit website')
+ menu_help.add_separator()
+ if getattr(sys, 'frozen', False):
+ menu_help.add_command(label='Run Update', command=lambda: self.conf.upgrade_package(logger=self.logger))
+ menu_help.add_separator()
+ menu_help.add_command(label='About', command=self.about_msg)","class MainWindow(BaseWindow):
+ self.menubar.add_cascade(menu=menu_help, label='Help', underline=0)
+ menu_help.add_command(label='Visit website')
+ menu_help.add_separator()
+ if not getattr(sys, 'frozen', False):
+ menu_help.add_command(label='Run Update', command=lambda: self.conf.upgrade_package(logger=self.logger))
+ menu_help.add_separator()
+ menu_help.add_command(label='About', command=self.about_msg)"
+153,https://:@github.com/fabiencro/knmt.git,26b7b1ed8dfbc0e82804e86c149926fc96cd8d84,"@@ -699,7 +699,7 @@ def do_eval(config_eval):
+ assert len(encdec_list) == 1
+ scorer = encdec_list[0].nbest_scorer(src_batch, src_mask)
+
+- nb_batches = (len(tgt_list) + mb_size - 1) / mb_size
++ nb_batches = (len(tgt_list) + mb_size - 1) // mb_size
+ for num_batch in six.moves.range(nb_batches):
+ tgt_batch, arg_sort = utils.make_batch_tgt(tgt_list[num_batch * nb_batches: (num_batch + 1) * nb_batches],
+ eos_idx=eos_idx, gpu=gpu, volatile=""on"", need_arg_sort=True)
+",nmt_chainer/translation/eval.py,"ReplaceText(target='//' @(702,55)->(702,56))","def do_eval(config_eval):
+ assert len(encdec_list) == 1
+ scorer = encdec_list[0].nbest_scorer(src_batch, src_mask)
+
+ nb_batches = (len(tgt_list) + mb_size - 1) / mb_size
+ for num_batch in six.moves.range(nb_batches):
+ tgt_batch, arg_sort = utils.make_batch_tgt(tgt_list[num_batch * nb_batches: (num_batch + 1) * nb_batches],
+ eos_idx=eos_idx, gpu=gpu, volatile=""on"", need_arg_sort=True)","def do_eval(config_eval):
+ assert len(encdec_list) == 1
+ scorer = encdec_list[0].nbest_scorer(src_batch, src_mask)
+
+ nb_batches = (len(tgt_list) + mb_size - 1) // mb_size
+ for num_batch in six.moves.range(nb_batches):
+ tgt_batch, arg_sort = utils.make_batch_tgt(tgt_list[num_batch * nb_batches: (num_batch + 1) * nb_batches],
+ eos_idx=eos_idx, gpu=gpu, volatile=""on"", need_arg_sort=True)"
+154,https://:@github.com/fabiencro/knmt.git,8ca17b7d3b52100a3c36ae7a380efbf0ce42107d,"@@ -699,7 +699,7 @@ def do_eval(config_eval):
+ assert len(encdec_list) == 1
+ scorer = encdec_list[0].nbest_scorer(src_batch, src_mask)
+
+- nb_batches = (len(tgt_list) + mb_size - 1) / mb_size
++ nb_batches = (len(tgt_list) + mb_size - 1) // mb_size
+ for num_batch in six.moves.range(nb_batches):
+ tgt_batch, arg_sort = utils.make_batch_tgt(tgt_list[num_batch * nb_batches: (num_batch + 1) * nb_batches],
+ eos_idx=eos_idx, gpu=gpu, volatile=""on"", need_arg_sort=True)
+",nmt_chainer/translation/eval.py,"ReplaceText(target='//' @(702,55)->(702,56))","def do_eval(config_eval):
+ assert len(encdec_list) == 1
+ scorer = encdec_list[0].nbest_scorer(src_batch, src_mask)
+
+ nb_batches = (len(tgt_list) + mb_size - 1) / mb_size
+ for num_batch in six.moves.range(nb_batches):
+ tgt_batch, arg_sort = utils.make_batch_tgt(tgt_list[num_batch * nb_batches: (num_batch + 1) * nb_batches],
+ eos_idx=eos_idx, gpu=gpu, volatile=""on"", need_arg_sort=True)","def do_eval(config_eval):
+ assert len(encdec_list) == 1
+ scorer = encdec_list[0].nbest_scorer(src_batch, src_mask)
+
+ nb_batches = (len(tgt_list) + mb_size - 1) // mb_size
+ for num_batch in six.moves.range(nb_batches):
+ tgt_batch, arg_sort = utils.make_batch_tgt(tgt_list[num_batch * nb_batches: (num_batch + 1) * nb_batches],
+ eos_idx=eos_idx, gpu=gpu, volatile=""on"", need_arg_sort=True)"
+155,https://:@github.com/fabiencro/knmt.git,b091633d528161ceba3b63c501774627a2c927aa,"@@ -1127,7 +1127,7 @@ def build_dataset_one_side_pp(src_fn, src_pp, max_nb_ex=None, make_constraints=N
+ # print(len(sentence_tgt), len(sentence_src))
+ seq_src = src_pp.convert(sentence_src, stats=stats_src)
+ if make_constraints is not None:
+- constraints_fn = make_constraints(src, seq_src)
++ constraints_fn = make_constraints(sentence_src, seq_src)
+ constraints_list.append(constraints_fn)
+ res.append(seq_src)
+ if make_constraints is not None:
+",nmt_chainer/dataprocessing/processors.py,"ReplaceText(target='sentence_src' @(1130,46)->(1130,49))","def build_dataset_one_side_pp(src_fn, src_pp, max_nb_ex=None, make_constraints=N
+ # print(len(sentence_tgt), len(sentence_src))
+ seq_src = src_pp.convert(sentence_src, stats=stats_src)
+ if make_constraints is not None:
+ constraints_fn = make_constraints(src, seq_src)
+ constraints_list.append(constraints_fn)
+ res.append(seq_src)
+ if make_constraints is not None:","def build_dataset_one_side_pp(src_fn, src_pp, max_nb_ex=None, make_constraints=N
+ # print(len(sentence_tgt), len(sentence_src))
+ seq_src = src_pp.convert(sentence_src, stats=stats_src)
+ if make_constraints is not None:
+ constraints_fn = make_constraints(sentence_src, seq_src)
+ constraints_list.append(constraints_fn)
+ res.append(seq_src)
+ if make_constraints is not None:"
+156,https://:@github.com/biocore/emperor.git,dedef9ab8d8578dd9d8d002dfa2dde254f27b133,"@@ -100,7 +100,7 @@ def main():
+ sids_intersection = len(set(zip(*mapping_data)[0]) & set(parsed_coords[0]))
+
+ # sample ids must be shared between files
+- if sids_intersection > 0:
++ if sids_intersection <= 0:
+ option_parser.error('The sample identifiers in the coordinates file '
+ 'must have at least one match with the data contained in mapping '
+ 'file. Verify you are using a coordinates file and a mapping file '
+",scripts/make_emperor.py,"ReplaceText(target='<=' @(103,25)->(103,26))","def main():
+ sids_intersection = len(set(zip(*mapping_data)[0]) & set(parsed_coords[0]))
+
+ # sample ids must be shared between files
+ if sids_intersection > 0:
+ option_parser.error('The sample identifiers in the coordinates file '
+ 'must have at least one match with the data contained in mapping '
+ 'file. Verify you are using a coordinates file and a mapping file '","def main():
+ sids_intersection = len(set(zip(*mapping_data)[0]) & set(parsed_coords[0]))
+
+ # sample ids must be shared between files
+ if sids_intersection <= 0:
+ option_parser.error('The sample identifiers in the coordinates file '
+ 'must have at least one match with the data contained in mapping '
+ 'file. Verify you are using a coordinates file and a mapping file '"
+157,https://:@github.com/juanpex/django-model-report.git,0aa6d98497f25d178fe48ed9185b77e8d62e722b,"@@ -58,7 +58,7 @@ class ExcelExporter(Exporter):
+
+ for g, rows in report_rows:
+ if g:
+- sheet1.write(row_index, 0, u'%s' % x, stylebold)
++ sheet1.write(row_index, 0, u'%s' % g, stylebold)
+ row_index += 1
+ for row in list(rows):
+ if row.is_value():
+",model_report/exporters/excel.py,"ReplaceText(target='g' @(61,51)->(61,52))","class ExcelExporter(Exporter):
+
+ for g, rows in report_rows:
+ if g:
+ sheet1.write(row_index, 0, u'%s' % x, stylebold)
+ row_index += 1
+ for row in list(rows):
+ if row.is_value():","class ExcelExporter(Exporter):
+
+ for g, rows in report_rows:
+ if g:
+ sheet1.write(row_index, 0, u'%s' % g, stylebold)
+ row_index += 1
+ for row in list(rows):
+ if row.is_value():"
+158,https://:@github.com/hclivess/Bismuth.git,a969c471f3d255e9cd139c100ac942c441c51aa0,"@@ -120,7 +120,7 @@ def difficulty(c):
+
+ time_now = time.time()
+ if time_now > timestamp_last + 300: #if 5 minutes have passed
+- difficulty2 = percentage(97,diff_block_previous)
++ difficulty2 = percentage(97,difficulty)
+ else:
+ difficulty2 = difficulty
+
+",gui.py,"ReplaceText(target='difficulty' @(123,36)->(123,55))","def difficulty(c):
+
+ time_now = time.time()
+ if time_now > timestamp_last + 300: #if 5 minutes have passed
+ difficulty2 = percentage(97,diff_block_previous)
+ else:
+ difficulty2 = difficulty
+ ","def difficulty(c):
+
+ time_now = time.time()
+ if time_now > timestamp_last + 300: #if 5 minutes have passed
+ difficulty2 = percentage(97,difficulty)
+ else:
+ difficulty2 = difficulty
+ "
+159,https://:@github.com/hclivess/Bismuth.git,75e47ec06ac2c83df3fbe413086393d265f27f1c,"@@ -1097,7 +1097,7 @@ def manager(c, conn):
+ app_log.warning(""Only {} connections active, resetting the connection history"".format(len(connection_pool)))
+ del tried[:]
+
+- if nodes_ban_reset and len(connection_pool) < len(banlist) and int(time.time() - reset_time) > 60*10: #do not reset too often. 10 minutes here
++ if nodes_ban_reset and len(connection_pool) <= len(banlist) and int(time.time() - reset_time) > 60*10: #do not reset too often. 10 minutes here
+ app_log.warning(""Less active connections ({}) than banlist ({}), resetting banlist and tried"" .format(len(connection_pool), len(banlist)))
+ del banlist[:]
+ banlist.extend(config.banlist) # reset to config version
+",node.py,"ReplaceText(target='<=' @(1100,52)->(1100,53))","def manager(c, conn):
+ app_log.warning(""Only {} connections active, resetting the connection history"".format(len(connection_pool)))
+ del tried[:]
+
+ if nodes_ban_reset and len(connection_pool) < len(banlist) and int(time.time() - reset_time) > 60*10: #do not reset too often. 10 minutes here
+ app_log.warning(""Less active connections ({}) than banlist ({}), resetting banlist and tried"" .format(len(connection_pool), len(banlist)))
+ del banlist[:]
+ banlist.extend(config.banlist) # reset to config version","def manager(c, conn):
+ app_log.warning(""Only {} connections active, resetting the connection history"".format(len(connection_pool)))
+ del tried[:]
+
+ if nodes_ban_reset and len(connection_pool) <= len(banlist) and int(time.time() - reset_time) > 60*10: #do not reset too often. 10 minutes here
+ app_log.warning(""Less active connections ({}) than banlist ({}), resetting banlist and tried"" .format(len(connection_pool), len(banlist)))
+ del banlist[:]
+ banlist.extend(config.banlist) # reset to config version"
+160,https://:@github.com/hclivess/Bismuth.git,34d72e31b605ce74fc26bd9dac9cedd0c659d5b0,"@@ -204,7 +204,7 @@ class MainHandler(tornado.web.RequestHandler):
+ html.append(""
"")
+
+ html.append(""Statistics for the last 500 blocks | "")
+- html.append(""
---|
Kilobytes transferred: | {} | "".format(transferred_total))
++ html.append(""
Kilobytes transferred: | {} | "".format(data_total))
+ html.append(""
Transactions: | {} | "".format(tx_count))
+ html.append(""
Transactions per block: | {} | "".format(tx_count/500))
+ html.append(""
Total BIS transferred | {} | "".format(transferred_total))
+",ledger_explorer.py,"ReplaceText(target='data_total' @(207,77)->(207,94))","class MainHandler(tornado.web.RequestHandler):
+ html.append("""")
+
+ html.append(""Statistics for the last 500 blocks | "")
+ html.append(""
---|
Kilobytes transferred: | {} | "".format(transferred_total))
+ html.append(""
Transactions: | {} | "".format(tx_count))
+ html.append(""
Transactions per block: | {} | "".format(tx_count/500))
+ html.append(""
Total BIS transferred | {} | "".format(transferred_total))","class MainHandler(tornado.web.RequestHandler):
+ html.append("""")
+
+ html.append(""Statistics for the last 500 blocks | "")
+ html.append(""
---|
Kilobytes transferred: | {} | "".format(data_total))
+ html.append(""
Transactions: | {} | "".format(tx_count))
+ html.append(""
Transactions per block: | {} | "".format(tx_count/500))
+ html.append(""
Total BIS transferred | {} | "".format(transferred_total))"
+161,https://:@github.com/hclivess/Bismuth.git,e6dd78e38707d04ea401ef86960e9deb08ea59b7,"@@ -520,7 +520,7 @@ def difficulty(c, mode):
+ block_height = int(result[0])
+ timestamp_before_last = Decimal(c.fetchone()[1])
+
+- if block_height > 427000: #remove code ABOVE after hf
++ if block_height >= 427000: #remove code ABOVE after hf
+ execute(c, ""SELECT * FROM transactions WHERE reward != 0 ORDER BY block_height DESC LIMIT 2"")
+ result = c.fetchone()
+ timestamp_last = Decimal(result[1])
+",node.py,"ReplaceText(target='>=' @(523,20)->(523,21))","def difficulty(c, mode):
+ block_height = int(result[0])
+ timestamp_before_last = Decimal(c.fetchone()[1])
+
+ if block_height > 427000: #remove code ABOVE after hf
+ execute(c, ""SELECT * FROM transactions WHERE reward != 0 ORDER BY block_height DESC LIMIT 2"")
+ result = c.fetchone()
+ timestamp_last = Decimal(result[1])","def difficulty(c, mode):
+ block_height = int(result[0])
+ timestamp_before_last = Decimal(c.fetchone()[1])
+
+ if block_height >= 427000: #remove code ABOVE after hf
+ execute(c, ""SELECT * FROM transactions WHERE reward != 0 ORDER BY block_height DESC LIMIT 2"")
+ result = c.fetchone()
+ timestamp_last = Decimal(result[1])"
+162,https://:@github.com/hclivess/Bismuth.git,01139c3f9457e2c4dbe7e143c47aa8475f7433cc,"@@ -9,7 +9,7 @@ def keys_load(privkey_file, pubkey_file):
+ pubkey_loaded = open(pubkey_file, 'rb').read()
+ pubkey = VerifyingKey.from_string(pubkey_loaded, curve=SECP256k1)
+
+- address = blake2b(privkey.to_string(), digest_size=20).hexdigest()
++ address = blake2b(pubkey.to_string(), digest_size=20).hexdigest()
+
+ return privkey, pubkey, address
+
+",bisecdsa.py,"ReplaceText(target='pubkey' @(12,22)->(12,29))","def keys_load(privkey_file, pubkey_file):
+ pubkey_loaded = open(pubkey_file, 'rb').read()
+ pubkey = VerifyingKey.from_string(pubkey_loaded, curve=SECP256k1)
+
+ address = blake2b(privkey.to_string(), digest_size=20).hexdigest()
+
+ return privkey, pubkey, address
+ ","def keys_load(privkey_file, pubkey_file):
+ pubkey_loaded = open(pubkey_file, 'rb').read()
+ pubkey = VerifyingKey.from_string(pubkey_loaded, curve=SECP256k1)
+
+ address = blake2b(pubkey.to_string(), digest_size=20).hexdigest()
+
+ return privkey, pubkey, address
+ "
+163,https://:@github.com/hclivess/Bismuth.git,b4f1e59d63db962b8f674dc2f4e6e0df34e8404d,"@@ -9,7 +9,7 @@ def keys_load(privkey_file, pubkey_file):
+ pubkey_loaded = open(pubkey_file, 'rb').read()
+ pubkey = VerifyingKey.from_string(pubkey_loaded, curve=SECP256k1)
+
+- address = blake2b(pubkey.to_string(), digest_size=20).hexdigest()
++ address = blake2b(privkey.to_string(), digest_size=20).hexdigest()
+
+ return privkey, pubkey, address
+
+",bisecdsa.py,"ReplaceText(target='privkey' @(12,22)->(12,28))","def keys_load(privkey_file, pubkey_file):
+ pubkey_loaded = open(pubkey_file, 'rb').read()
+ pubkey = VerifyingKey.from_string(pubkey_loaded, curve=SECP256k1)
+
+ address = blake2b(pubkey.to_string(), digest_size=20).hexdigest()
+
+ return privkey, pubkey, address
+ ","def keys_load(privkey_file, pubkey_file):
+ pubkey_loaded = open(pubkey_file, 'rb').read()
+ pubkey = VerifyingKey.from_string(pubkey_loaded, curve=SECP256k1)
+
+ address = blake2b(privkey.to_string(), digest_size=20).hexdigest()
+
+ return privkey, pubkey, address
+ "
+164,https://:@github.com/hclivess/Bismuth.git,081200edc97ae9d5e35156d634037844835c7205,"@@ -1192,7 +1192,7 @@ def digest_block(data, sdef, peer_ip, conn, c, hdd, h, hdd2, h2, h3, index, inde
+
+ # if (q_time_now < q_received_timestamp + 432000) and not quicksync:
+ # balance_pre = quantize_eight(credit_ledger - debit_ledger - fees + rewards) # without projection
+- balance_pre = ledger_balance3(db_address, h2, balances)
++ balance_pre = ledger_balance3(db_address, c, balances)
+ # balance = quantize_eight(credit - debit - fees + rewards)
+ balance = quantize_eight(balance_pre - block_debit_address)
+ # app_log.info(""Digest: Projected transaction address balance: "" + str(balance))
+",node.py,"ReplaceText(target='c' @(1195,62)->(1195,64))","def digest_block(data, sdef, peer_ip, conn, c, hdd, h, hdd2, h2, h3, index, inde
+
+ # if (q_time_now < q_received_timestamp + 432000) and not quicksync:
+ # balance_pre = quantize_eight(credit_ledger - debit_ledger - fees + rewards) # without projection
+ balance_pre = ledger_balance3(db_address, h2, balances)
+ # balance = quantize_eight(credit - debit - fees + rewards)
+ balance = quantize_eight(balance_pre - block_debit_address)
+ # app_log.info(""Digest: Projected transaction address balance: "" + str(balance))","def digest_block(data, sdef, peer_ip, conn, c, hdd, h, hdd2, h2, h3, index, inde
+
+ # if (q_time_now < q_received_timestamp + 432000) and not quicksync:
+ # balance_pre = quantize_eight(credit_ledger - debit_ledger - fees + rewards) # without projection
+ balance_pre = ledger_balance3(db_address, c, balances)
+ # balance = quantize_eight(credit - debit - fees + rewards)
+ balance = quantize_eight(balance_pre - block_debit_address)
+ # app_log.info(""Digest: Projected transaction address balance: "" + str(balance))"
+165,https://:@github.com/RDCH106/parallel_foreach_submodule.git,714ddc620894fbc6fefac093fe9323a9429f85a8,"@@ -23,7 +23,7 @@ class PFSProcess(object):
+ if self.__output_filter == """":
+ self.__output += self.__p.communicate()[0].decode('utf-8') # stdoutdata
+ else:
+- if str(self.__p.communicate()[0].decode('utf-8')).find(self.__output_filter) != -1:
++ if str(self.__p.communicate()[0].decode('utf-8')).find(self.__output_filter) == -1:
+ self.__output += self.__p.communicate()[0].decode('utf-8')
+
+ if self.__p.communicate()[1]: # stderrdata
+",parallelforeachsubmodule/process.py,"ReplaceText(target='==' @(26,89)->(26,91))","class PFSProcess(object):
+ if self.__output_filter == """":
+ self.__output += self.__p.communicate()[0].decode('utf-8') # stdoutdata
+ else:
+ if str(self.__p.communicate()[0].decode('utf-8')).find(self.__output_filter) != -1:
+ self.__output += self.__p.communicate()[0].decode('utf-8')
+
+ if self.__p.communicate()[1]: # stderrdata","class PFSProcess(object):
+ if self.__output_filter == """":
+ self.__output += self.__p.communicate()[0].decode('utf-8') # stdoutdata
+ else:
+ if str(self.__p.communicate()[0].decode('utf-8')).find(self.__output_filter) == -1:
+ self.__output += self.__p.communicate()[0].decode('utf-8')
+
+ if self.__p.communicate()[1]: # stderrdata"
+166,https://:@github.com/rsokl/noggin.git,2f9ec33b6807cf8ff00169a284a2e1c3a77db137,"@@ -71,7 +71,7 @@ class LivePlot(LiveLogger):
+ if (
+ not isinstance(size, Sequence)
+ or len(size) != 2
+- or not all(isinstance(x, Real) and x >= 0 for x in size)
++ or not all(isinstance(x, Real) and x > 0 for x in size)
+ ):
+ raise ValueError(
+ f""`size` must be a length-2 sequence of ""
+",src/liveplot/plotter.py,"ReplaceText(target='>' @(74,49)->(74,51))","class LivePlot(LiveLogger):
+ if (
+ not isinstance(size, Sequence)
+ or len(size) != 2
+ or not all(isinstance(x, Real) and x >= 0 for x in size)
+ ):
+ raise ValueError(
+ f""`size` must be a length-2 sequence of ""","class LivePlot(LiveLogger):
+ if (
+ not isinstance(size, Sequence)
+ or len(size) != 2
+ or not all(isinstance(x, Real) and x > 0 for x in size)
+ ):
+ raise ValueError(
+ f""`size` must be a length-2 sequence of """
+167,https://:@github.com/ome/ome-model.git,99bf44c7c5f8661d4c073b98dcafa980abd44920,"@@ -366,5 +366,5 @@ class OMEModel(object):
+ substitutionGroupName = self.opts.lang.substitutionGroup(element.getName())
+ self.substitutionElement_map[substitutionGroupName] = element
+ continue
+- if len(self.opts.lang.getSubstitutionTypes()) >= 0:
++ if len(self.opts.lang.getSubstitutionTypes()) > 0:
+ config.METADATA_OBJECT_IGNORE.remove('BinData')
+",components/xsd-fu/python/ome/modeltools/model.py,"ReplaceText(target='>' @(369,54)->(369,56))","class OMEModel(object):
+ substitutionGroupName = self.opts.lang.substitutionGroup(element.getName())
+ self.substitutionElement_map[substitutionGroupName] = element
+ continue
+ if len(self.opts.lang.getSubstitutionTypes()) >= 0:
+ config.METADATA_OBJECT_IGNORE.remove('BinData')","class OMEModel(object):
+ substitutionGroupName = self.opts.lang.substitutionGroup(element.getName())
+ self.substitutionElement_map[substitutionGroupName] = element
+ continue
+ if len(self.opts.lang.getSubstitutionTypes()) > 0:
+ config.METADATA_OBJECT_IGNORE.remove('BinData')"
+168,https://:@github.com/ome/ome-model.git,49d212302bd30541e55ef64409b14377b069cd3a,"@@ -135,7 +135,7 @@ class Image(object):
+ assert (len(self.data[""Channels""]) <= sizeC), str(self.data)
+ channel_samples = sum([int(x.data['SamplesPerPixel'])
+ for x in self.data[""Channels""]])
+- assert channel_samples < sizeC, str(self.data)
++ assert channel_samples <= sizeC, str(self.data)
+ return self.data
+
+
+",ome_model/experimental.py,"ReplaceText(target='<=' @(138,31)->(138,32))","class Image(object):
+ assert (len(self.data[""Channels""]) <= sizeC), str(self.data)
+ channel_samples = sum([int(x.data['SamplesPerPixel'])
+ for x in self.data[""Channels""]])
+ assert channel_samples < sizeC, str(self.data)
+ return self.data
+
+ ","class Image(object):
+ assert (len(self.data[""Channels""]) <= sizeC), str(self.data)
+ channel_samples = sum([int(x.data['SamplesPerPixel'])
+ for x in self.data[""Channels""]])
+ assert channel_samples <= sizeC, str(self.data)
+ return self.data
+
+ "
+169,https://:@github.com/uber/causalml.git,3c085167f8fbf6a07ef53ad84f36682e015ff320,"@@ -966,7 +966,7 @@ class UpliftTreeClassifier:
+ rightNodeSummary = self.tree_node_summary(w_r, y_r,
+ min_samples_treatment=min_samples_treatment,
+ n_reg=n_reg,
+- parentNodeSummary=parentNodeSummary)
++ parentNodeSummary=currentNodeSummary)
+
+ # check the split validity on min_samples_treatment
+ if set(leftNodeSummary.keys()) != set(rightNodeSummary.keys()):
+",causalml/inference/tree/models.py,"ReplaceText(target='currentNodeSummary' @(969,76)->(969,93))","class UpliftTreeClassifier:
+ rightNodeSummary = self.tree_node_summary(w_r, y_r,
+ min_samples_treatment=min_samples_treatment,
+ n_reg=n_reg,
+ parentNodeSummary=parentNodeSummary)
+
+ # check the split validity on min_samples_treatment
+ if set(leftNodeSummary.keys()) != set(rightNodeSummary.keys()):","class UpliftTreeClassifier:
+ rightNodeSummary = self.tree_node_summary(w_r, y_r,
+ min_samples_treatment=min_samples_treatment,
+ n_reg=n_reg,
+ parentNodeSummary=currentNodeSummary)
+
+ # check the split validity on min_samples_treatment
+ if set(leftNodeSummary.keys()) != set(rightNodeSummary.keys()):"
+170,https://:@github.com/pypa/setuptools_scm.git,3e2ee4c2c77900f2d20241f489a670f7cb512e98,"@@ -77,7 +77,7 @@ def test_version_from_hg_id(tmpdir, get_log_version):
+ hg('add test.txt', cwd)
+ hg('commit -m commit -u test -d ""0 0""', cwd)
+
+- after_first_commit = get_log_version(tmpdir)
++ after_first_commit = get_log_version(cwd)
+
+ assert after_first_commit.startswith('0.0.post1-')
+
+",test_hgdistver.py,"ReplaceText(target='cwd' @(80,41)->(80,47))","def test_version_from_hg_id(tmpdir, get_log_version):
+ hg('add test.txt', cwd)
+ hg('commit -m commit -u test -d ""0 0""', cwd)
+
+ after_first_commit = get_log_version(tmpdir)
+
+ assert after_first_commit.startswith('0.0.post1-')
+ ","def test_version_from_hg_id(tmpdir, get_log_version):
+ hg('add test.txt', cwd)
+ hg('commit -m commit -u test -d ""0 0""', cwd)
+
+ after_first_commit = get_log_version(cwd)
+
+ assert after_first_commit.startswith('0.0.post1-')
+ "
+171,https://:@github.com/pypa/setuptools_scm.git,340b2356e8ab2e6525ef1a07d17155db2788ed50,"@@ -50,6 +50,6 @@ def scm_find_files(path, scm_files, scm_dirs):
+ # dirpath + filename with symlinks preserved
+ fullfilename = os.path.join(dirpath, filename)
+ if os.path.normcase(os.path.realpath(fullfilename)) in scm_files:
+- res.append(os.path.join(path, os.path.relpath(fullfilename, path)))
++ res.append(os.path.join(path, os.path.relpath(fullfilename, realpath)))
+ seen.add(realdirpath)
+ return res
+",src/setuptools_scm/file_finder.py,"ReplaceText(target='realpath' @(53,76)->(53,80))","def scm_find_files(path, scm_files, scm_dirs):
+ # dirpath + filename with symlinks preserved
+ fullfilename = os.path.join(dirpath, filename)
+ if os.path.normcase(os.path.realpath(fullfilename)) in scm_files:
+ res.append(os.path.join(path, os.path.relpath(fullfilename, path)))
+ seen.add(realdirpath)
+ return res","def scm_find_files(path, scm_files, scm_dirs):
+ # dirpath + filename with symlinks preserved
+ fullfilename = os.path.join(dirpath, filename)
+ if os.path.normcase(os.path.realpath(fullfilename)) in scm_files:
+ res.append(os.path.join(path, os.path.relpath(fullfilename, realpath)))
+ seen.add(realdirpath)
+ return res"
+172,https://:@github.com/alphaomega-technology/Equation.git,66e92f5b6ab584b7e7ac3bb7c328ff4ea410f88e,"@@ -600,7 +600,7 @@ class Expression( object ):
+ continue
+ fs = self.__getfunction(op)
+ while True:
+- if (fn['prec'] <= fs['prec']):
++ if (fn['prec'] >= fs['prec']):
+ self.__expr.append(ExpressionFunction(fs['func'],fs['args'],fs['str'],fs['latex'],op[0],False))
+ if len(stack) == 0:
+ stack.append(v)
+",Equation/core.py,"ReplaceText(target='>=' @(603,35)->(603,37))","class Expression( object ):
+ continue
+ fs = self.__getfunction(op)
+ while True:
+ if (fn['prec'] <= fs['prec']):
+ self.__expr.append(ExpressionFunction(fs['func'],fs['args'],fs['str'],fs['latex'],op[0],False))
+ if len(stack) == 0:
+ stack.append(v)","class Expression( object ):
+ continue
+ fs = self.__getfunction(op)
+ while True:
+ if (fn['prec'] >= fs['prec']):
+ self.__expr.append(ExpressionFunction(fs['func'],fs['args'],fs['str'],fs['latex'],op[0],False))
+ if len(stack) == 0:
+ stack.append(v)"
+173,https://:@github.com/Azure/azure-uamqp-python.git,29706fc2599f09f186f85fd15bf243b5ed60477f,"@@ -499,7 +499,7 @@ class SendClient(AMQPClient):
+ message.state = constants.MessageState.SendComplete
+ message._response = errors.MessageAlreadySettled() # pylint: disable=protected-access
+ if message.on_send_complete:
+- message.on_send_complete(result, delivery_state)
++ message.on_send_complete(result, exception)
+
+ def _filter_pending(self, message):
+ if message.state in constants.DONE_STATES:
+",uamqp/client.py,"ReplaceText(target='exception' @(502,45)->(502,59))","class SendClient(AMQPClient):
+ message.state = constants.MessageState.SendComplete
+ message._response = errors.MessageAlreadySettled() # pylint: disable=protected-access
+ if message.on_send_complete:
+ message.on_send_complete(result, delivery_state)
+
+ def _filter_pending(self, message):
+ if message.state in constants.DONE_STATES:","class SendClient(AMQPClient):
+ message.state = constants.MessageState.SendComplete
+ message._response = errors.MessageAlreadySettled() # pylint: disable=protected-access
+ if message.on_send_complete:
+ message.on_send_complete(result, exception)
+
+ def _filter_pending(self, message):
+ if message.state in constants.DONE_STATES:"
+174,https://:@github.com/MITHaystack/digital_rf.git,fe9ab29c4bc9584474f264516130c1c92b43e0d3,"@@ -418,7 +418,7 @@ class Thor(object):
+ # set master clock rate
+ clock_rate = op.clock_rates[mb_num]
+ if clock_rate is not None:
+- op.set_clock_rate(clock_rate, mb_num)
++ u.set_clock_rate(clock_rate, mb_num)
+ op.clock_rates[mb_num] = u.get_clock_rate(mb_num)
+
+ # set clock source
+",python/tools/thor.py,"ReplaceText(target='u' @(421,16)->(421,18))","class Thor(object):
+ # set master clock rate
+ clock_rate = op.clock_rates[mb_num]
+ if clock_rate is not None:
+ op.set_clock_rate(clock_rate, mb_num)
+ op.clock_rates[mb_num] = u.get_clock_rate(mb_num)
+
+ # set clock source","class Thor(object):
+ # set master clock rate
+ clock_rate = op.clock_rates[mb_num]
+ if clock_rate is not None:
+ u.set_clock_rate(clock_rate, mb_num)
+ op.clock_rates[mb_num] = u.get_clock_rate(mb_num)
+
+ # set clock source"
+175,https://:@github.com/rm-hull/luma.core.git,dca2765dc5f02941a5f5668ed65f60650a95d929,"@@ -40,7 +40,7 @@ def show_message(device, msg, y_offset=0, fill=None, font=None, scroll_delay=0.0
+ text(draw, (x, y_offset), msg, font=font, fill=fill)
+
+ i = 0
+- while i < w + x:
++ while i <= w + x:
+ virtual.set_position((i, 0))
+ regulator.sleep()
+ i += 1
+",luma/core/legacy/__init__.py,"ReplaceText(target='<=' @(43,12)->(43,13))","def show_message(device, msg, y_offset=0, fill=None, font=None, scroll_delay=0.0
+ text(draw, (x, y_offset), msg, font=font, fill=fill)
+
+ i = 0
+ while i < w + x:
+ virtual.set_position((i, 0))
+ regulator.sleep()
+ i += 1","def show_message(device, msg, y_offset=0, fill=None, font=None, scroll_delay=0.0
+ text(draw, (x, y_offset), msg, font=font, fill=fill)
+
+ i = 0
+ while i <= w + x:
+ virtual.set_position((i, 0))
+ regulator.sleep()
+ i += 1"
+176,https://:@github.com/gforcada/flake8-builtins.git,da932110850fae82bdc56cb2e5b5fed2ff228e3c,"@@ -211,7 +211,7 @@ class BuiltinsChecker(object):
+ if not message:
+ message = self.assign_msg
+ if not variable:
+- column = statement.id
++ variable = statement.id
+ if not line:
+ line = statement.lineno
+ if not column:
+",flake8_builtins.py,"ReplaceText(target='variable' @(214,12)->(214,18))","class BuiltinsChecker(object):
+ if not message:
+ message = self.assign_msg
+ if not variable:
+ column = statement.id
+ if not line:
+ line = statement.lineno
+ if not column:","class BuiltinsChecker(object):
+ if not message:
+ message = self.assign_msg
+ if not variable:
+ variable = statement.id
+ if not line:
+ line = statement.lineno
+ if not column:"
+177,https://:@github.com/European-XFEL/h5glance.git,23bcd02f8a36c9fd1f623e6627a7d6960669e06c,"@@ -157,7 +157,7 @@ class TreeViewBuilder:
+ if obj.id.get_create_plist().get_layout() == h5py.h5d.VIRTUAL:
+ detail += ' virtual'
+ elif isinstance(obj, h5py.Group):
+- if max_depth > 1:
++ if max_depth >= 1:
+ children += [self.group_item_node(obj, key, max_depth - 1)
+ for key in obj]
+ else:
+",h5glance/terminal.py,"ReplaceText(target='>=' @(160,25)->(160,26))","class TreeViewBuilder:
+ if obj.id.get_create_plist().get_layout() == h5py.h5d.VIRTUAL:
+ detail += ' virtual'
+ elif isinstance(obj, h5py.Group):
+ if max_depth > 1:
+ children += [self.group_item_node(obj, key, max_depth - 1)
+ for key in obj]
+ else:","class TreeViewBuilder:
+ if obj.id.get_create_plist().get_layout() == h5py.h5d.VIRTUAL:
+ detail += ' virtual'
+ elif isinstance(obj, h5py.Group):
+ if max_depth >= 1:
+ children += [self.group_item_node(obj, key, max_depth - 1)
+ for key in obj]
+ else:"
+178,https://:@github.com/camptocamp/c2cgeoform.git,98126ec7859b1bc5b1b2b720fea1c5d5ca9bbbef,"@@ -224,7 +224,7 @@ class AbstractViews():
+ if field.id() == sort:
+ criterion = field.sort_column()
+ if order == 'desc':
+- criterion = desc(sort)
++ criterion = desc(criterion)
+ criteria.append(criterion)
+
+ # Sort on primary key as subqueryload with limit need deterministic order
+",c2cgeoform/views/abstract_views.py,"ReplaceText(target='criterion' @(227,37)->(227,41))","class AbstractViews():
+ if field.id() == sort:
+ criterion = field.sort_column()
+ if order == 'desc':
+ criterion = desc(sort)
+ criteria.append(criterion)
+
+ # Sort on primary key as subqueryload with limit need deterministic order","class AbstractViews():
+ if field.id() == sort:
+ criterion = field.sort_column()
+ if order == 'desc':
+ criterion = desc(criterion)
+ criteria.append(criterion)
+
+ # Sort on primary key as subqueryload with limit need deterministic order"
+179,https://:@github.com/HumanCellAtlas/data-store.git,a28a6a38433fa3ead01ba5bd7e9289caf9c905b0,"@@ -114,7 +114,7 @@ def _verify_checkout(
+ ) -> typing.Tuple[str, bool]:
+ decoded_token: dict
+ if token is None:
+- execution_id = start_file_checkout(blob_path, replica)
++ execution_id = start_file_checkout(replica, blob_path)
+ start_time = time.time()
+ attempts = 0
+
+",dss/api/files.py,"ArgSwap(idxs=0<->1 @(117,23)->(117,42))","def _verify_checkout(
+ ) -> typing.Tuple[str, bool]:
+ decoded_token: dict
+ if token is None:
+ execution_id = start_file_checkout(blob_path, replica)
+ start_time = time.time()
+ attempts = 0
+ ","def _verify_checkout(
+ ) -> typing.Tuple[str, bool]:
+ decoded_token: dict
+ if token is None:
+ execution_id = start_file_checkout(replica, blob_path)
+ start_time = time.time()
+ attempts = 0
+ "
+180,https://:@github.com/HumanCellAtlas/data-store.git,6ab718c4aef36abe12b10556e27d5943176f7314,"@@ -53,7 +53,7 @@ class ElasticsearchIndexBackend(IndexBackend):
+ tombstone_doc = BundleTombstoneDocument.from_tombstone(tombstone)
+ modified, index_name = doc.entomb(tombstone_doc, dryrun=self.dryrun)
+ if self.notify or modified and self.notify is None:
+- self._notify(doc, index_name)
++ self._notify(tombstone_doc, index_name)
+
+ def _notify(self, bundle, index_name):
+ subscription_ids = self._find_matching_subscriptions(bundle, index_name)
+",dss/index/es/backend.py,"ReplaceText(target='tombstone_doc' @(56,25)->(56,28))","class ElasticsearchIndexBackend(IndexBackend):
+ tombstone_doc = BundleTombstoneDocument.from_tombstone(tombstone)
+ modified, index_name = doc.entomb(tombstone_doc, dryrun=self.dryrun)
+ if self.notify or modified and self.notify is None:
+ self._notify(doc, index_name)
+
+ def _notify(self, bundle, index_name):
+ subscription_ids = self._find_matching_subscriptions(bundle, index_name)","class ElasticsearchIndexBackend(IndexBackend):
+ tombstone_doc = BundleTombstoneDocument.from_tombstone(tombstone)
+ modified, index_name = doc.entomb(tombstone_doc, dryrun=self.dryrun)
+ if self.notify or modified and self.notify is None:
+ self._notify(tombstone_doc, index_name)
+
+ def _notify(self, bundle, index_name):
+ subscription_ids = self._find_matching_subscriptions(bundle, index_name)"
+181,https://:@github.com/oemof/tespy.git,b6c36317886f435ae4dda9a8459788fabbfe85a8,"@@ -330,7 +330,7 @@ class bus:
+ 'This bus accepts components of type ' +
+ str(type(c).__bases__[0]) + '.')
+ raise TypeError(msg)
+- return False
++ return True
+ return True
+
+
+",tespy/connections.py,"ReplaceText(target='True' @(333,23)->(333,28))","class bus:
+ 'This bus accepts components of type ' +
+ str(type(c).__bases__[0]) + '.')
+ raise TypeError(msg)
+ return False
+ return True
+
+ ","class bus:
+ 'This bus accepts components of type ' +
+ str(type(c).__bases__[0]) + '.')
+ raise TypeError(msg)
+ return True
+ return True
+
+ "
+182,https://:@github.com/oemof/tespy.git,d69bd568bde4209be5aff37328ca422171ce3467,"@@ -1318,7 +1318,7 @@ class separator(node):
+ res = x * self.inl[0].m.val_SI
+ for o in self.outl:
+ res -= o.fluid.val[fluid] * o.m.val_SI
+- self.vec_res[k] += res
++ self.vec_res[k] = res
+ k += 1
+
+ ######################################################################
+",tespy/components/nodes.py,"ReplaceText(target='=' @(1321,28)->(1321,30))","class separator(node):
+ res = x * self.inl[0].m.val_SI
+ for o in self.outl:
+ res -= o.fluid.val[fluid] * o.m.val_SI
+ self.vec_res[k] += res
+ k += 1
+
+ ######################################################################","class separator(node):
+ res = x * self.inl[0].m.val_SI
+ for o in self.outl:
+ res -= o.fluid.val[fluid] * o.m.val_SI
+ self.vec_res[k] = res
+ k += 1
+
+ ######################################################################"
+183,https://:@github.com/uber/tchannel-python.git,867364eea67d8da34f5f84a2d9fa02203f02aa95,"@@ -222,7 +222,7 @@ class TChannelClientOperation(object):
+
+ message = CallRequestMessage(
+ service=self.service,
+- args=[safebytes(arg_1), arg_3, arg_3],
++ args=[safebytes(arg_1), arg_2, arg_3],
+ )
+
+ response_future = peer_connection.send(message, message_id)
+",tchannel/tornado/tchannel.py,"ReplaceText(target='arg_2' @(225,36)->(225,41))","class TChannelClientOperation(object):
+
+ message = CallRequestMessage(
+ service=self.service,
+ args=[safebytes(arg_1), arg_3, arg_3],
+ )
+
+ response_future = peer_connection.send(message, message_id)","class TChannelClientOperation(object):
+
+ message = CallRequestMessage(
+ service=self.service,
+ args=[safebytes(arg_1), arg_2, arg_3],
+ )
+
+ response_future = peer_connection.send(message, message_id)"
+184,https://:@github.com/arrrlo/Google-Images-Search.git,26df6441928bc8d69224fe7bf5fc52741a3404a7,"@@ -109,7 +109,7 @@ class FetchResizeSave(object):
+ for i, page in enumerate(range(start, end, IMAGES_NUM_LIMIT)):
+ start = page+1
+
+- if self._number_of_images > IMAGES_NUM_LIMIT*(i+1):
++ if self._number_of_images >= IMAGES_NUM_LIMIT*(i+1):
+ num = IMAGES_NUM_LIMIT
+ else:
+ num = (self._number_of_images % IMAGES_NUM_LIMIT) or \
+",google_images_search/fetch_resize_save.py,"ReplaceText(target='>=' @(112,38)->(112,39))","class FetchResizeSave(object):
+ for i, page in enumerate(range(start, end, IMAGES_NUM_LIMIT)):
+ start = page+1
+
+ if self._number_of_images > IMAGES_NUM_LIMIT*(i+1):
+ num = IMAGES_NUM_LIMIT
+ else:
+ num = (self._number_of_images % IMAGES_NUM_LIMIT) or \","class FetchResizeSave(object):
+ for i, page in enumerate(range(start, end, IMAGES_NUM_LIMIT)):
+ start = page+1
+
+ if self._number_of_images >= IMAGES_NUM_LIMIT*(i+1):
+ num = IMAGES_NUM_LIMIT
+ else:
+ num = (self._number_of_images % IMAGES_NUM_LIMIT) or \"
+185,https://:@github.com/Parsl/parsl.git,794ea182f61a9626a84aa58be11952c8bb148ccd,"@@ -278,7 +278,7 @@ class EC2Provider(ExecutionProvider):
+
+ try:
+ with open(credfile, 'r') as f:
+- creds = json.load(credfile)
++ creds = json.load(f)
+ except json.JSONDecodeError as e:
+ logger.error(
+ ""Site[{0}]: Json decode error in credential file {1}"".format(self, credfile)
+",libsubmit/providers/aws/aws.py,"ReplaceText(target='f' @(281,38)->(281,46))","class EC2Provider(ExecutionProvider):
+
+ try:
+ with open(credfile, 'r') as f:
+ creds = json.load(credfile)
+ except json.JSONDecodeError as e:
+ logger.error(
+ ""Site[{0}]: Json decode error in credential file {1}"".format(self, credfile)","class EC2Provider(ExecutionProvider):
+
+ try:
+ with open(credfile, 'r') as f:
+ creds = json.load(f)
+ except json.JSONDecodeError as e:
+ logger.error(
+ ""Site[{0}]: Json decode error in credential file {1}"".format(self, credfile)"
+186,https://:@github.com/Parsl/parsl.git,547ef33559003eddb8206bb01d9bbc22bc07aba7,"@@ -83,7 +83,7 @@ def update_config(config, rundir):
+ ""maxThreads"": 8
+ }
+ }
+- config[""sites""].append(data_manager_site)
++ config_base[""sites""].append(data_manager_site)
+
+ # Update the config datastructure
+ _config = copy.deepcopy(config)
+",parsl/dataflow/config_defaults.py,"ReplaceText(target='config_base' @(86,4)->(86,10))","def update_config(config, rundir):
+ ""maxThreads"": 8
+ }
+ }
+ config[""sites""].append(data_manager_site)
+
+ # Update the config datastructure
+ _config = copy.deepcopy(config)","def update_config(config, rundir):
+ ""maxThreads"": 8
+ }
+ }
+ config_base[""sites""].append(data_manager_site)
+
+ # Update the config datastructure
+ _config = copy.deepcopy(config)"
+187,https://:@github.com/Parsl/parsl.git,be25fe238b3269947cd6c882dfba88a147304937,"@@ -76,6 +76,6 @@ class PythonApp(AppBase):
+ fn_hash=self.func_hash,
+ cache=self.cache,
+ ignore_for_cache=self.ignore_for_cache,
+- app_kwargs=kwargs)
++ app_kwargs=invocation_kwargs)
+
+ return app_fut
+",parsl/app/python.py,"ReplaceText(target='invocation_kwargs' @(79,40)->(79,46))","class PythonApp(AppBase):
+ fn_hash=self.func_hash,
+ cache=self.cache,
+ ignore_for_cache=self.ignore_for_cache,
+ app_kwargs=kwargs)
+
+ return app_fut","class PythonApp(AppBase):
+ fn_hash=self.func_hash,
+ cache=self.cache,
+ ignore_for_cache=self.ignore_for_cache,
+ app_kwargs=invocation_kwargs)
+
+ return app_fut"
+188,https://:@github.com/qutang/padar.git,afb839dec2306e76355a03bc5b5602838e1a9201,"@@ -63,7 +63,7 @@ class OrientationFeatureComputer(SensorProcessor):
+ ]
+
+ windows = mw.get_sliding_window_boundaries(start_time=st, stop_time=et, window_duration=ws, step_size=ss)
+- chunk_windows_mask = (windows[:,0] >= data_start_indicator) & (windows[:,0] <= data_stop_indicator)
++ chunk_windows_mask = (windows[:,0] >= data_start_indicator) & (windows[:,0] < data_stop_indicator)
+ chunk_windows = windows[chunk_windows_mask,:]
+ if len(chunk_windows) == 0:
+ return pd.DataFrame()
+",mhealth/scripts/OrientationFeatureComputer.py,"ReplaceText(target='<' @(66,84)->(66,86))","class OrientationFeatureComputer(SensorProcessor):
+ ]
+
+ windows = mw.get_sliding_window_boundaries(start_time=st, stop_time=et, window_duration=ws, step_size=ss)
+ chunk_windows_mask = (windows[:,0] >= data_start_indicator) & (windows[:,0] <= data_stop_indicator)
+ chunk_windows = windows[chunk_windows_mask,:]
+ if len(chunk_windows) == 0:
+ return pd.DataFrame()","class OrientationFeatureComputer(SensorProcessor):
+ ]
+
+ windows = mw.get_sliding_window_boundaries(start_time=st, stop_time=et, window_duration=ws, step_size=ss)
+ chunk_windows_mask = (windows[:,0] >= data_start_indicator) & (windows[:,0] < data_stop_indicator)
+ chunk_windows = windows[chunk_windows_mask,:]
+ if len(chunk_windows) == 0:
+ return pd.DataFrame()"
+189,https://:@github.com/mozman/ezdxf.git,a4c290a333b51772ecb0b9184506596d49183690,"@@ -22,7 +22,7 @@ class Drawing:
+ self.encoding = 'cp1252' # read/write
+ self.filename = None # read/write
+ self.entitydb = EntityDB()
+- self.sections = Sections(self, tagreader)
++ self.sections = Sections(tagreader, self)
+ self._dxfversion = self.header['$ACADVER']
+ self.encoding = self._get_encoding()
+ nexthandle = int(self.header.get('$HANDSEED', '500'), 16)
+",ezdxf/drawing.py,"ArgSwap(idxs=0<->1 @(25,24)->(25,32))","class Drawing:
+ self.encoding = 'cp1252' # read/write
+ self.filename = None # read/write
+ self.entitydb = EntityDB()
+ self.sections = Sections(self, tagreader)
+ self._dxfversion = self.header['$ACADVER']
+ self.encoding = self._get_encoding()
+ nexthandle = int(self.header.get('$HANDSEED', '500'), 16)","class Drawing:
+ self.encoding = 'cp1252' # read/write
+ self.filename = None # read/write
+ self.entitydb = EntityDB()
+ self.sections = Sections(tagreader, self)
+ self._dxfversion = self.header['$ACADVER']
+ self.encoding = self._get_encoding()
+ nexthandle = int(self.header.get('$HANDSEED', '500'), 16)"
+190,https://:@github.com/mozman/ezdxf.git,d2bcbe493b5300e97913a1a13772a19547436239,"@@ -212,7 +212,7 @@ class GroupCollection(ObjectCollection):
+ raise DXFTypeError(group.dxftype())
+
+ if name in self:
+- super().delete(group)
++ super().delete(name)
+ else:
+ raise DXFValueError(""GROUP not in group table registered."")
+
+",ezdxf/entities/dxfgroups.py,"ReplaceText(target='name' @(215,27)->(215,32))","class GroupCollection(ObjectCollection):
+ raise DXFTypeError(group.dxftype())
+
+ if name in self:
+ super().delete(group)
+ else:
+ raise DXFValueError(""GROUP not in group table registered."")
+ ","class GroupCollection(ObjectCollection):
+ raise DXFTypeError(group.dxftype())
+
+ if name in self:
+ super().delete(name)
+ else:
+ raise DXFValueError(""GROUP not in group table registered."")
+ "
+191,https://:@github.com/mozman/ezdxf.git,f6517755bbaeb24096de1f6fb8294b36c21cb769,"@@ -116,7 +116,7 @@ class Face3d(_Base):
+
+ def set_edge_visibilty(self, num, status=False):
+ """""" Set visibility of edge `num`, status `True` for visible, status `False` for invisible. """"""
+- if status:
++ if not status:
+ self.dxf.invisible = self.dxf.invisible | (1 << num)
+ else:
+ self.dxf.invisible = self.dxf.invisible & ~(1 << num)
+",src/ezdxf/entities/solid.py,"ReplaceText(target='not ' @(119,11)->(119,11))","class Face3d(_Base):
+
+ def set_edge_visibilty(self, num, status=False):
+ """""" Set visibility of edge `num`, status `True` for visible, status `False` for invisible. """"""
+ if status:
+ self.dxf.invisible = self.dxf.invisible | (1 << num)
+ else:
+ self.dxf.invisible = self.dxf.invisible & ~(1 << num)","class Face3d(_Base):
+
+ def set_edge_visibilty(self, num, status=False):
+ """""" Set visibility of edge `num`, status `True` for visible, status `False` for invisible. """"""
+ if not status:
+ self.dxf.invisible = self.dxf.invisible | (1 << num)
+ else:
+ self.dxf.invisible = self.dxf.invisible & ~(1 << num)"
+192,https://:@github.com/mozman/ezdxf.git,516fbb01d55b9dc86b20b3d2263496560ad74415,"@@ -195,7 +195,7 @@ def virtual_block_reference_entities(block_ref: 'Insert',
+
+ if block_ref.has_uniform_scaling and xscale < 0:
+ # handle reflection about all three axis -x, -y, -z explicit as non uniform scaling
+- has_non_uniform_scaling = True
++ has_non_uniform_scaling = False
+
+ if uniform_scaling_factor is not None:
+ uniform_scaling_factor = float(uniform_scaling_factor)
+",src/ezdxf/explode.py,"ReplaceText(target='False' @(198,38)->(198,42))","def virtual_block_reference_entities(block_ref: 'Insert',
+
+ if block_ref.has_uniform_scaling and xscale < 0:
+ # handle reflection about all three axis -x, -y, -z explicit as non uniform scaling
+ has_non_uniform_scaling = True
+
+ if uniform_scaling_factor is not None:
+ uniform_scaling_factor = float(uniform_scaling_factor)","def virtual_block_reference_entities(block_ref: 'Insert',
+
+ if block_ref.has_uniform_scaling and xscale < 0:
+ # handle reflection about all three axis -x, -y, -z explicit as non uniform scaling
+ has_non_uniform_scaling = False
+
+ if uniform_scaling_factor is not None:
+ uniform_scaling_factor = float(uniform_scaling_factor)"
+193,https://:@github.com/mozman/ezdxf.git,ba0c909bdfc0c64d4909b15c9e12a54b9a36d7a4,"@@ -264,7 +264,7 @@ class Frontend:
+ last_vertex = end
+
+ if vertices:
+- if last_vertex.isclose(vertices[0]):
++ if not last_vertex.isclose(vertices[0]):
+ vertices.append(last_vertex)
+ self.out.draw_filled_polygon(vertices, properties)
+
+",src/ezdxf/addons/drawing/frontend.py,"ReplaceText(target='not ' @(267,19)->(267,19))","class Frontend:
+ last_vertex = end
+
+ if vertices:
+ if last_vertex.isclose(vertices[0]):
+ vertices.append(last_vertex)
+ self.out.draw_filled_polygon(vertices, properties)
+ ","class Frontend:
+ last_vertex = end
+
+ if vertices:
+ if not last_vertex.isclose(vertices[0]):
+ vertices.append(last_vertex)
+ self.out.draw_filled_polygon(vertices, properties)
+ "
+194,https://:@github.com/mozman/ezdxf.git,637cf54b973fb9bda6e4b0612b439ee69f04cf15,"@@ -184,7 +184,7 @@ def has_clockwise_orientation(vertices: Iterable['Vertex']) -> bool:
+ return sum(
+ (p2.x - p1.x) * (p2.y + p1.y)
+ for p1, p2 in zip(vertices, vertices[1:])
+- ) < 0
++ ) > 0
+
+
+ def enclosing_angles(angle, start_angle, end_angle, ccw=True,
+",src/ezdxf/math/construct2d.py,"ReplaceText(target='>' @(187,6)->(187,7))","def has_clockwise_orientation(vertices: Iterable['Vertex']) -> bool:
+ return sum(
+ (p2.x - p1.x) * (p2.y + p1.y)
+ for p1, p2 in zip(vertices, vertices[1:])
+ ) < 0
+
+
+ def enclosing_angles(angle, start_angle, end_angle, ccw=True,","def has_clockwise_orientation(vertices: Iterable['Vertex']) -> bool:
+ return sum(
+ (p2.x - p1.x) * (p2.y + p1.y)
+ for p1, p2 in zip(vertices, vertices[1:])
+ ) > 0
+
+
+ def enclosing_angles(angle, start_angle, end_angle, ccw=True,"
+195,https://:@github.com/Parsely/pykafka.git,676b3119ff9f4cd2a5bebf1ee0e3e52071cd65af,"@@ -198,7 +198,7 @@ class Producer():
+ else:
+ key, value = message
+ value = str(value)
+- yield (key, value), self._partitioner(partitions, message).id
++ yield (key, value), self._partitioner(partitions, key).id
+
+ def _produce(self, message_partition_tups, attempt):
+ """"""Publish a set of messages to relevant brokers.
+",pykafka/producer.py,"ReplaceText(target='key' @(201,62)->(201,69))","class Producer():
+ else:
+ key, value = message
+ value = str(value)
+ yield (key, value), self._partitioner(partitions, message).id
+
+ def _produce(self, message_partition_tups, attempt):
+ """"""Publish a set of messages to relevant brokers.","class Producer():
+ else:
+ key, value = message
+ value = str(value)
+ yield (key, value), self._partitioner(partitions, key).id
+
+ def _produce(self, message_partition_tups, attempt):
+ """"""Publish a set of messages to relevant brokers."
+196,https://:@github.com/Parsely/pykafka.git,559679443462fa62b4378453c5dfff14df85654f,"@@ -816,7 +816,7 @@ class OwnedPartition(object):
+ :type messages: Iterable of :class:`pykafka.common.Message`
+ """"""
+ for message in messages:
+- if message.offset < self.last_offset_consumed:
++ if message.offset <= self.last_offset_consumed:
+ log.debug(""Skipping enqueue for offset (%s) ""
+ ""less than last_offset_consumed (%s)"",
+ message.offset, self.last_offset_consumed)
+",pykafka/simpleconsumer.py,"ReplaceText(target='<=' @(819,30)->(819,31))","class OwnedPartition(object):
+ :type messages: Iterable of :class:`pykafka.common.Message`
+ """"""
+ for message in messages:
+ if message.offset < self.last_offset_consumed:
+ log.debug(""Skipping enqueue for offset (%s) ""
+ ""less than last_offset_consumed (%s)"",
+ message.offset, self.last_offset_consumed)","class OwnedPartition(object):
+ :type messages: Iterable of :class:`pykafka.common.Message`
+ """"""
+ for message in messages:
+ if message.offset <= self.last_offset_consumed:
+ log.debug(""Skipping enqueue for offset (%s) ""
+ ""less than last_offset_consumed (%s)"",
+ message.offset, self.last_offset_consumed)"
+197,https://:@github.com/Parsely/pykafka.git,e515296f6b130acb930ddc9f97e84a7997aedb2f,"@@ -137,7 +137,7 @@ class ProducerIntegrationTests(unittest2.TestCase):
+ start = time.time()
+ producer.produce(uuid4().bytes)
+ producer.produce(uuid4().bytes)
+- self.assertTrue(int(time.time() - start) > int(linger))
++ self.assertTrue(int(time.time() - start) >= int(linger))
+ self.consumer.consume()
+ self.consumer.consume()
+
+",tests/pykafka/test_producer.py,"ReplaceText(target='>=' @(140,49)->(140,50))","class ProducerIntegrationTests(unittest2.TestCase):
+ start = time.time()
+ producer.produce(uuid4().bytes)
+ producer.produce(uuid4().bytes)
+ self.assertTrue(int(time.time() - start) > int(linger))
+ self.consumer.consume()
+ self.consumer.consume()
+ ","class ProducerIntegrationTests(unittest2.TestCase):
+ start = time.time()
+ producer.produce(uuid4().bytes)
+ producer.produce(uuid4().bytes)
+ self.assertTrue(int(time.time() - start) >= int(linger))
+ self.consumer.consume()
+ self.consumer.consume()
+ "
+198,https://:@github.com/Parsely/pykafka.git,ad8f2d457b8ca3b7dc7a75360f00becd7f0484a4,"@@ -595,7 +595,7 @@ class OwnedBroker(object):
+ # bind the MessageSizeTooLarge error the delivery
+ # report and remove it from the producer queue
+ message = self.queue.pop()
+- self._delivery_reports.put(peeked_message, exc=exc)
++ self._delivery_reports.put(message, exc=exc)
+ # remove from pending message count
+ self.increment_messages_pending(-1)
+ continue
+",pykafka/producer.py,"ReplaceText(target='message' @(598,51)->(598,65))","class OwnedBroker(object):
+ # bind the MessageSizeTooLarge error the delivery
+ # report and remove it from the producer queue
+ message = self.queue.pop()
+ self._delivery_reports.put(peeked_message, exc=exc)
+ # remove from pending message count
+ self.increment_messages_pending(-1)
+ continue","class OwnedBroker(object):
+ # bind the MessageSizeTooLarge error the delivery
+ # report and remove it from the producer queue
+ message = self.queue.pop()
+ self._delivery_reports.put(message, exc=exc)
+ # remove from pending message count
+ self.increment_messages_pending(-1)
+ continue"
+199,https://:@github.com/Parsely/pykafka.git,217865b12c58addc95c419f159b477bc5636c6a9,"@@ -594,7 +594,7 @@ class SimpleConsumer(object):
+ to_retry = [pair for err in itervalues(parts_by_error) for pair in err]
+ reqs = [p.build_offset_fetch_request() for p, _ in to_retry]
+
+- if len(parts_by_error) > 1:
++ if len(parts_by_error) > 0:
+ raise KafkaException(parts_by_error)
+
+ def reset_offsets(self, partition_offsets=None):
+",pykafka/simpleconsumer.py,"ReplaceText(target='0' @(597,33)->(597,34))","class SimpleConsumer(object):
+ to_retry = [pair for err in itervalues(parts_by_error) for pair in err]
+ reqs = [p.build_offset_fetch_request() for p, _ in to_retry]
+
+ if len(parts_by_error) > 1:
+ raise KafkaException(parts_by_error)
+
+ def reset_offsets(self, partition_offsets=None):","class SimpleConsumer(object):
+ to_retry = [pair for err in itervalues(parts_by_error) for pair in err]
+ reqs = [p.build_offset_fetch_request() for p, _ in to_retry]
+
+ if len(parts_by_error) > 0:
+ raise KafkaException(parts_by_error)
+
+ def reset_offsets(self, partition_offsets=None):"
+200,https://:@github.com/Timidger/Wikia.git,ff74a5711925274af13738f4b588a46356a1fa98,"@@ -395,7 +395,7 @@ class WikiaPage(object):
+ # Remove the /revision/ fluff after the image url
+ image = image.partition(""/revision/"")[0]
+ image_type = mimetypes.guess_type(image)[0]
+- if image_type is None:
++ if image_type is not None:
+ image_type = ""."" + image_type.split(""/"")[-1]
+ else:
+ image_type = "".png"" # in case mimetypes.guess cant find it it will return None
+",wikia/wikia.py,"ReplaceText(target=' is not ' @(398,23)->(398,27))","class WikiaPage(object):
+ # Remove the /revision/ fluff after the image url
+ image = image.partition(""/revision/"")[0]
+ image_type = mimetypes.guess_type(image)[0]
+ if image_type is None:
+ image_type = ""."" + image_type.split(""/"")[-1]
+ else:
+ image_type = "".png"" # in case mimetypes.guess cant find it it will return None","class WikiaPage(object):
+ # Remove the /revision/ fluff after the image url
+ image = image.partition(""/revision/"")[0]
+ image_type = mimetypes.guess_type(image)[0]
+ if image_type is not None:
+ image_type = ""."" + image_type.split(""/"")[-1]
+ else:
+ image_type = "".png"" # in case mimetypes.guess cant find it it will return None"
+201,https://:@github.com/meetshah1995/pytorch-semseg.git,81997cd5af36759773a67b11cf148d3876b13a69,"@@ -156,7 +156,7 @@ def train(cfg, writer, logger):
+ labels_val = labels_val.to(device)
+
+ outputs = model(images_val)
+- val_loss = loss_fn(input=outputs, target=labels)
++ val_loss = loss_fn(input=outputs, target=labels_val)
+
+ pred = outputs.data.max(1)[1].cpu().numpy()
+ gt = labels_val.data.cpu().numpy()
+",train.py,"ReplaceText(target='labels_val' @(159,65)->(159,71))","def train(cfg, writer, logger):
+ labels_val = labels_val.to(device)
+
+ outputs = model(images_val)
+ val_loss = loss_fn(input=outputs, target=labels)
+
+ pred = outputs.data.max(1)[1].cpu().numpy()
+ gt = labels_val.data.cpu().numpy()","def train(cfg, writer, logger):
+ labels_val = labels_val.to(device)
+
+ outputs = model(images_val)
+ val_loss = loss_fn(input=outputs, target=labels_val)
+
+ pred = outputs.data.max(1)[1].cpu().numpy()
+ gt = labels_val.data.cpu().numpy()"
+202,https://:@github.com/meetshah1995/pytorch-semseg.git,801fb200547caa5b0d91b8dde56b837da029f746,"@@ -27,7 +27,7 @@ def multi_scale_cross_entropy2d(input, target, weight=None, size_average=True, s
+ n_inp = len(input)
+ scale = 0.4
+ scale_weight = torch.pow(scale * torch.ones(n_inp), torch.arange(n_inp).float()).to(
+- input.device
++ target.device
+ )
+
+ loss = 0.0
+",ptsemseg/loss/loss.py,"ReplaceText(target='target' @(30,12)->(30,17))","def multi_scale_cross_entropy2d(input, target, weight=None, size_average=True, s
+ n_inp = len(input)
+ scale = 0.4
+ scale_weight = torch.pow(scale * torch.ones(n_inp), torch.arange(n_inp).float()).to(
+ input.device
+ )
+
+ loss = 0.0","def multi_scale_cross_entropy2d(input, target, weight=None, size_average=True, s
+ n_inp = len(input)
+ scale = 0.4
+ scale_weight = torch.pow(scale * torch.ones(n_inp), torch.arange(n_inp).float()).to(
+ target.device
+ )
+
+ loss = 0.0"
+203,https://:@github.com/bhmm/bhmm.git,34f1e00dc49a99094b5c492381d9f711e96fc4d9,"@@ -192,7 +192,7 @@ def estimate_initial_hmm(observations, nstates, reversible=True, eps_A=None, eps
+ # does the count matrix too few closed sets to give nstates metastable states? Then we need a prior
+ if len(_tmatrix_disconnected.closed_sets(C)) < nstates:
+ msm_prior = 0.001
+- B = msm_prior * np.eye(C_full.shape[0]) # diagonal prior
++ B = msm_prior * np.eye(C.shape[0]) # diagonal prior
+ B += msmtools.estimation.prior_neighbor(C, alpha=msm_prior) # neighbor prior
+ C_post = C + B # posterior
+ P_for_pcca = _tmatrix_disconnected.estimate_P(C_post, reversible=True)
+",bhmm/init/discrete.py,"ReplaceText(target='C' @(195,31)->(195,37))","def estimate_initial_hmm(observations, nstates, reversible=True, eps_A=None, eps
+ # does the count matrix too few closed sets to give nstates metastable states? Then we need a prior
+ if len(_tmatrix_disconnected.closed_sets(C)) < nstates:
+ msm_prior = 0.001
+ B = msm_prior * np.eye(C_full.shape[0]) # diagonal prior
+ B += msmtools.estimation.prior_neighbor(C, alpha=msm_prior) # neighbor prior
+ C_post = C + B # posterior
+ P_for_pcca = _tmatrix_disconnected.estimate_P(C_post, reversible=True)","def estimate_initial_hmm(observations, nstates, reversible=True, eps_A=None, eps
+ # does the count matrix too few closed sets to give nstates metastable states? Then we need a prior
+ if len(_tmatrix_disconnected.closed_sets(C)) < nstates:
+ msm_prior = 0.001
+ B = msm_prior * np.eye(C.shape[0]) # diagonal prior
+ B += msmtools.estimation.prior_neighbor(C, alpha=msm_prior) # neighbor prior
+ C_post = C + B # posterior
+ P_for_pcca = _tmatrix_disconnected.estimate_P(C_post, reversible=True)"
+204,https://:@github.com/rackspace/pyrax.git,71a7f1924e2c53a4caac54e2b8eb985c207869c7,"@@ -220,7 +220,7 @@ class ManagerTest(unittest.TestCase):
+ ret = mgr.findall(some_att=""ok"")
+ self.assertTrue(o1 in ret)
+ self.assertFalse(o2 in ret)
+- self.assertTrue(o1 in ret)
++ self.assertTrue(o3 in ret)
+ mgr.list = sav
+
+ def test_findall_bad_att(self):
+",tests/unit/test_manager.py,"ReplaceText(target='o3' @(223,24)->(223,26))","class ManagerTest(unittest.TestCase):
+ ret = mgr.findall(some_att=""ok"")
+ self.assertTrue(o1 in ret)
+ self.assertFalse(o2 in ret)
+ self.assertTrue(o1 in ret)
+ mgr.list = sav
+
+ def test_findall_bad_att(self):","class ManagerTest(unittest.TestCase):
+ ret = mgr.findall(some_att=""ok"")
+ self.assertTrue(o1 in ret)
+ self.assertFalse(o2 in ret)
+ self.assertTrue(o3 in ret)
+ mgr.list = sav
+
+ def test_findall_bad_att(self):"
+205,https://:@github.com/deckbsd/glouton-satnogs-data-downloader.git,7b3982a3ac4c7ecb086cf6ce504aa766a54f1211,"@@ -25,7 +25,7 @@ class ObservationRepo:
+
+ self.__read_page(r.json(), self.__cmd.start_date, self.__cmd.end_date)
+ page += 1
+- params['page'] += str(page)
++ params['page'] = str(page)
+
+ print('\ndownloading started (Ctrl + F5 to stop)...\t~( ^o^)~')
+ self.__create_workers_and_wait()
+",repositories/observation/observationsRepo.py,"ReplaceText(target='=' @(28,27)->(28,29))","class ObservationRepo:
+
+ self.__read_page(r.json(), self.__cmd.start_date, self.__cmd.end_date)
+ page += 1
+ params['page'] += str(page)
+
+ print('\ndownloading started (Ctrl + F5 to stop)...\t~( ^o^)~')
+ self.__create_workers_and_wait()","class ObservationRepo:
+
+ self.__read_page(r.json(), self.__cmd.start_date, self.__cmd.end_date)
+ page += 1
+ params['page'] = str(page)
+
+ print('\ndownloading started (Ctrl + F5 to stop)...\t~( ^o^)~')
+ self.__create_workers_and_wait()"
+206,https://:@github.com/vmware/pyvcloud.git,e250911c7ba7666c42c2fa197f32744424d647ff,"@@ -121,7 +121,7 @@ class VCA(object):
+ #todo: check if vcloud session can be cached as well...
+ vCloudSession = self.create_vCloudSession(vdcReference[1])
+ if vCloudSession:
+- vcd = VCD(vCloudSession, serviceId, serviceId)
++ vcd = VCD(vCloudSession, serviceId, vdcId)
+ return vcd
+ return None
+
+",pyvcloud/vcloudair.py,"ReplaceText(target='vdcId' @(124,52)->(124,61))","class VCA(object):
+ #todo: check if vcloud session can be cached as well...
+ vCloudSession = self.create_vCloudSession(vdcReference[1])
+ if vCloudSession:
+ vcd = VCD(vCloudSession, serviceId, serviceId)
+ return vcd
+ return None
+ ","class VCA(object):
+ #todo: check if vcloud session can be cached as well...
+ vCloudSession = self.create_vCloudSession(vdcReference[1])
+ if vCloudSession:
+ vcd = VCD(vCloudSession, serviceId, vdcId)
+ return vcd
+ return None
+ "
+207,https://:@github.com/vmware/pyvcloud.git,0b7926b141b58afbf94168ac95f1ab3f00f14e71,"@@ -2129,7 +2129,7 @@ class VDC(object):
+ policy_list = []
+ for policy_reference in policy_references.VdcComputePolicyReference:
+ policy_list.append(policy_reference)
+- return policy_reference
++ return policy_list
+
+ def add_compute_policy(self, href):
+ """"""Add a VdcComputePolicy.
+",pyvcloud/vcd/vdc.py,"ReplaceText(target='policy_list' @(2132,15)->(2132,31))","class VDC(object):
+ policy_list = []
+ for policy_reference in policy_references.VdcComputePolicyReference:
+ policy_list.append(policy_reference)
+ return policy_reference
+
+ def add_compute_policy(self, href):
+ """"""Add a VdcComputePolicy.","class VDC(object):
+ policy_list = []
+ for policy_reference in policy_references.VdcComputePolicyReference:
+ policy_list.append(policy_reference)
+ return policy_list
+
+ def add_compute_policy(self, href):
+ """"""Add a VdcComputePolicy."
+208,https://:@github.com/springer-math/Mathematics-of-Epidemics-on-Networks.git,1f069443a464955c87cfa926c0ad8c8ce66bc424,"@@ -851,7 +851,7 @@ def get_infected_nodes(G, tau, gamma, initial_infecteds=None):
+ elif G.has_node(initial_infecteds):
+ initial_infecteds=[initial_infecteds]
+ H = directed_percolate_network(G, tau, gamma)
+- infected_nodes = _out_component_(G, initial_infecteds)
++ infected_nodes = _out_component_(H, initial_infecteds)
+ return infected_nodes
+
+
+",EoN/simulation.py,"ReplaceText(target='H' @(854,37)->(854,38))","def get_infected_nodes(G, tau, gamma, initial_infecteds=None):
+ elif G.has_node(initial_infecteds):
+ initial_infecteds=[initial_infecteds]
+ H = directed_percolate_network(G, tau, gamma)
+ infected_nodes = _out_component_(G, initial_infecteds)
+ return infected_nodes
+
+ ","def get_infected_nodes(G, tau, gamma, initial_infecteds=None):
+ elif G.has_node(initial_infecteds):
+ initial_infecteds=[initial_infecteds]
+ H = directed_percolate_network(G, tau, gamma)
+ infected_nodes = _out_component_(H, initial_infecteds)
+ return infected_nodes
+
+ "
+209,https://:@github.com/waipbmtd/python-client.git,3d95fa3fb3d85c14d1b92da348b4f2f0b007424b,"@@ -135,7 +135,7 @@ def show(path):
+ def validate_params(ctx, param, value):
+ if any(['=' not in item for item in value]):
+ raise click.BadParameter('Parameters need to be in format =')
+- return dict([tuple(item.split('=', 1)) for item in param])
++ return dict([tuple(item.split('=', 1)) for item in value])
+
+
+ def validate_inplace(ctx, param, value):
+",coreapi/commandline.py,"ReplaceText(target='value' @(138,55)->(138,60))","def show(path):
+ def validate_params(ctx, param, value):
+ if any(['=' not in item for item in value]):
+ raise click.BadParameter('Parameters need to be in format =')
+ return dict([tuple(item.split('=', 1)) for item in param])
+
+
+ def validate_inplace(ctx, param, value):","def show(path):
+ def validate_params(ctx, param, value):
+ if any(['=' not in item for item in value]):
+ raise click.BadParameter('Parameters need to be in format =')
+ return dict([tuple(item.split('=', 1)) for item in value])
+
+
+ def validate_inplace(ctx, param, value):"
+210,https://:@github.com/waipbmtd/python-client.git,e630971368e28989484272ca7774af385ce3ddd6,"@@ -436,7 +436,7 @@ def credentials_show():
+ @click.option('--auth', metavar=""AUTH_SCHEME"", help='Auth scheme to apply to the credentials string. Options: ""none"", ""basic"". Default is ""none"".', default='none', type=click.Choice(['none', 'basic']))
+ def credentials_add(domain, credentials_string, auth):
+ if auth == 'none':
+- header = auth
++ header = credentials_string
+ elif auth == 'basic':
+ header = 'Basic ' + b64encode(credentials_string)
+ credentials = get_credentials()
+",coreapi/commandline.py,"ReplaceText(target='credentials_string' @(439,17)->(439,21))","def credentials_show():
+ @click.option('--auth', metavar=""AUTH_SCHEME"", help='Auth scheme to apply to the credentials string. Options: ""none"", ""basic"". Default is ""none"".', default='none', type=click.Choice(['none', 'basic']))
+ def credentials_add(domain, credentials_string, auth):
+ if auth == 'none':
+ header = auth
+ elif auth == 'basic':
+ header = 'Basic ' + b64encode(credentials_string)
+ credentials = get_credentials()","def credentials_show():
+ @click.option('--auth', metavar=""AUTH_SCHEME"", help='Auth scheme to apply to the credentials string. Options: ""none"", ""basic"". Default is ""none"".', default='none', type=click.Choice(['none', 'basic']))
+ def credentials_add(domain, credentials_string, auth):
+ if auth == 'none':
+ header = credentials_string
+ elif auth == 'basic':
+ header = 'Basic ' + b64encode(credentials_string)
+ credentials = get_credentials()"
+211,https://:@github.com/openfisca/openfisca-survey-manager.git,b1c6e08ca7ddd546171b5623ce0ae04ed9f597fd,"@@ -24,7 +24,7 @@ def temporary_store_decorator(config_files_directory = default_config_files_dire
+ 'tmp_directory is not set: {!r} in {}'.format(tmp_directory, read_config_file_name)
+ assert os.path.isabs(tmp_directory), \
+ 'tmp_directory should be an absolut path: {!r} in {}'.format(tmp_directory, read_config_file_name)
+- if os.path.isdir(tmp_directory):
++ if not os.path.isdir(tmp_directory):
+ 'tmp_directory does not exist: {!r} in {}. Creating it.'.format(tmp_directory, read_config_file_name)
+ os.makedirs(tmp_directory)
+
+",openfisca_survey_manager/temporary.py,"ReplaceText(target='not ' @(27,7)->(27,7))","def temporary_store_decorator(config_files_directory = default_config_files_dire
+ 'tmp_directory is not set: {!r} in {}'.format(tmp_directory, read_config_file_name)
+ assert os.path.isabs(tmp_directory), \
+ 'tmp_directory should be an absolut path: {!r} in {}'.format(tmp_directory, read_config_file_name)
+ if os.path.isdir(tmp_directory):
+ 'tmp_directory does not exist: {!r} in {}. Creating it.'.format(tmp_directory, read_config_file_name)
+ os.makedirs(tmp_directory)
+ ","def temporary_store_decorator(config_files_directory = default_config_files_dire
+ 'tmp_directory is not set: {!r} in {}'.format(tmp_directory, read_config_file_name)
+ assert os.path.isabs(tmp_directory), \
+ 'tmp_directory should be an absolut path: {!r} in {}'.format(tmp_directory, read_config_file_name)
+ if not os.path.isdir(tmp_directory):
+ 'tmp_directory does not exist: {!r} in {}. Creating it.'.format(tmp_directory, read_config_file_name)
+ os.makedirs(tmp_directory)
+ "
+212,https://:@github.com/ARMmbed/yotta.git,e948620774774810165b28968ce0324b1f5bb953,"@@ -329,7 +329,7 @@ def satisfyTarget(name, version_required, working_directory, update_installed=No
+ # must rm the old target before continuing
+ fsutils.rmRf(target_path)
+
+- if not v and update_installed is None:
++ if not v and update_installed is not None:
+ v = latestSuitableVersion(name, version_required, registry='target')
+
+ if not v:
+",yotta/lib/access.py,"ReplaceText(target=' is not ' @(332,33)->(332,37))","def satisfyTarget(name, version_required, working_directory, update_installed=No
+ # must rm the old target before continuing
+ fsutils.rmRf(target_path)
+
+ if not v and update_installed is None:
+ v = latestSuitableVersion(name, version_required, registry='target')
+
+ if not v:","def satisfyTarget(name, version_required, working_directory, update_installed=No
+ # must rm the old target before continuing
+ fsutils.rmRf(target_path)
+
+ if not v and update_installed is not None:
+ v = latestSuitableVersion(name, version_required, registry='target')
+
+ if not v:"
+213,https://:@github.com/ARMmbed/yotta.git,06a9d7e69861044818b5a5de490336f6be65d6f1,"@@ -371,7 +371,7 @@ def generateTest(**kwargs):
+ test_method.__name__ = test_name
+ setattr(TestCLITestGenerated, test_name, test_method)
+
+-if not util.canBuildNatively():
++if util.canBuildNatively():
+ forAllReporterTests(generateTest)
+ else:
+ print('WARNING: skipping test reporter tests (cannot build natively on this platform)')
+",yotta/test/cli/test_test.py,"ReplaceText(target='' @(374,3)->(374,7))","def generateTest(**kwargs):
+ test_method.__name__ = test_name
+ setattr(TestCLITestGenerated, test_name, test_method)
+
+ if not util.canBuildNatively():
+ forAllReporterTests(generateTest)
+ else:
+ print('WARNING: skipping test reporter tests (cannot build natively on this platform)')","def generateTest(**kwargs):
+ test_method.__name__ = test_name
+ setattr(TestCLITestGenerated, test_name, test_method)
+
+ if util.canBuildNatively():
+ forAllReporterTests(generateTest)
+ else:
+ print('WARNING: skipping test reporter tests (cannot build natively on this platform)')"
+214,https://:@github.com/b1naryth1ef/disco.git,bd75deb29adcc42f8de451d51e7dbc02eb360b1e,"@@ -112,7 +112,7 @@ class Plugin(LoggingClass, PluginDeco):
+
+ def register_command(self, func, *args, **kwargs):
+ wrapped = functools.partial(self._dispatch, 'command', func)
+- self.commands[func.__name__] = Command(self, func, *args, **kwargs)
++ self.commands[func.__name__] = Command(self, wrapped, *args, **kwargs)
+
+ def destroy(self):
+ map(lambda k: k.remove(), self._events)
+",disco/bot/plugin.py,"ReplaceText(target='wrapped' @(115,53)->(115,57))","class Plugin(LoggingClass, PluginDeco):
+
+ def register_command(self, func, *args, **kwargs):
+ wrapped = functools.partial(self._dispatch, 'command', func)
+ self.commands[func.__name__] = Command(self, func, *args, **kwargs)
+
+ def destroy(self):
+ map(lambda k: k.remove(), self._events)","class Plugin(LoggingClass, PluginDeco):
+
+ def register_command(self, func, *args, **kwargs):
+ wrapped = functools.partial(self._dispatch, 'command', func)
+ self.commands[func.__name__] = Command(self, wrapped, *args, **kwargs)
+
+ def destroy(self):
+ map(lambda k: k.remove(), self._events)"
+215,https://:@github.com/b1naryth1ef/disco.git,c5848dbe8b66295598b4e6cad1c5ec8f5cc3a5fb,"@@ -305,7 +305,7 @@ class Channel(SlottedModel, Permissible):
+ return
+
+ if self.can(self.client.state.me, Permissions.MANAGE_MESSAGES) and len(messages) > 2:
+- for chunk in chunks(messages, 100):
++ for chunk in chunks(message_ids, 100):
+ self.client.api.channels_messages_delete_bulk(self.id, chunk)
+ else:
+ for msg in messages:
+",disco/types/channel.py,"ReplaceText(target='message_ids' @(308,32)->(308,40))","class Channel(SlottedModel, Permissible):
+ return
+
+ if self.can(self.client.state.me, Permissions.MANAGE_MESSAGES) and len(messages) > 2:
+ for chunk in chunks(messages, 100):
+ self.client.api.channels_messages_delete_bulk(self.id, chunk)
+ else:
+ for msg in messages:","class Channel(SlottedModel, Permissible):
+ return
+
+ if self.can(self.client.state.me, Permissions.MANAGE_MESSAGES) and len(messages) > 2:
+ for chunk in chunks(message_ids, 100):
+ self.client.api.channels_messages_delete_bulk(self.id, chunk)
+ else:
+ for msg in messages:"
+216,https://:@github.com/yuru-yuri/manga-dl.git,5cbcbd37c4f904720d08074241a890851b94a7dd,"@@ -26,7 +26,7 @@ if __name__ == '__main__':
+ if parse_args.cli:
+ cli = Cli(args)
+ # cli
+- exit(0 if cli.status else 0)
++ exit(0 if cli.status else 1)
+
+ # else run GUI
+ app = QApplication(argv)
+",manga.py,"ReplaceText(target='1' @(29,34)->(29,35))","if __name__ == '__main__':
+ if parse_args.cli:
+ cli = Cli(args)
+ # cli
+ exit(0 if cli.status else 0)
+
+ # else run GUI
+ app = QApplication(argv)","if __name__ == '__main__':
+ if parse_args.cli:
+ cli = Cli(args)
+ # cli
+ exit(0 if cli.status else 1)
+
+ # else run GUI
+ app = QApplication(argv)"
+217,https://:@github.com/yuru-yuri/manga-dl.git,f10777831c4c128a6f6a9bb1d9903889a43ad1df,"@@ -44,7 +44,7 @@ class WebDriver:
+ driver_path = self._driver_path()
+ if not is_file(driver_path):
+ self.download_drivder()
+- self.is_win() and chmod(driver_path, 0o755)
++ self.is_win() or chmod(driver_path, 0o755)
+ driver = webdriver.Chrome(executable_path=driver_path)
+ driver.set_window_size(500, 600)
+ return driver
+",src/base_classes/web_driver.py,"ReplaceText(target='or' @(47,22)->(47,25))","class WebDriver:
+ driver_path = self._driver_path()
+ if not is_file(driver_path):
+ self.download_drivder()
+ self.is_win() and chmod(driver_path, 0o755)
+ driver = webdriver.Chrome(executable_path=driver_path)
+ driver.set_window_size(500, 600)
+ return driver","class WebDriver:
+ driver_path = self._driver_path()
+ if not is_file(driver_path):
+ self.download_drivder()
+ self.is_win() or chmod(driver_path, 0o755)
+ driver = webdriver.Chrome(executable_path=driver_path)
+ driver.set_window_size(500, 600)
+ return driver"
+218,https://:@github.com/veg/bioext.git,5fbb2b3fb52d1e59b787713f9d9521124cb2f24b,"@@ -217,7 +217,7 @@ def _translate_gapped(seq, *args, **kwds):
+ elif gaps:
+ protein += '-' * gaps
+ gaps = 0
+- lwr = j
++ lwr = i
+ if gaps:
+ protein += '-' * gaps
+ else:
+",lib/BioExt/_util.py,"ReplaceText(target='i' @(220,18)->(220,19))","def _translate_gapped(seq, *args, **kwds):
+ elif gaps:
+ protein += '-' * gaps
+ gaps = 0
+ lwr = j
+ if gaps:
+ protein += '-' * gaps
+ else:","def _translate_gapped(seq, *args, **kwds):
+ elif gaps:
+ protein += '-' * gaps
+ gaps = 0
+ lwr = i
+ if gaps:
+ protein += '-' * gaps
+ else:"
+219,https://:@github.com/python-trio/trio.git,82253caa8bd59b5b3bbb0ba61d196289c967f838,"@@ -371,7 +371,7 @@ def test_waitid_eintr():
+ sync_wait_reapable(sleeper.pid)
+ assert sleeper.wait(timeout=1) == -9
+ finally:
+- if sleeper.returncode is not None:
++ if sleeper.returncode is None:
+ sleeper.kill()
+ sleeper.wait()
+ signal.signal(signal.SIGALRM, old_sigalrm)
+",trio/tests/test_subprocess.py,"ReplaceText(target=' is ' @(374,29)->(374,37))","def test_waitid_eintr():
+ sync_wait_reapable(sleeper.pid)
+ assert sleeper.wait(timeout=1) == -9
+ finally:
+ if sleeper.returncode is not None:
+ sleeper.kill()
+ sleeper.wait()
+ signal.signal(signal.SIGALRM, old_sigalrm)","def test_waitid_eintr():
+ sync_wait_reapable(sleeper.pid)
+ assert sleeper.wait(timeout=1) == -9
+ finally:
+ if sleeper.returncode is None:
+ sleeper.kill()
+ sleeper.wait()
+ signal.signal(signal.SIGALRM, old_sigalrm)"
+220,https://:@github.com/python-trio/trio.git,94a587f758f0597cd790505ca7bfbec17a247fb1,"@@ -37,7 +37,7 @@ def test_warn_deprecated(recwarn_always):
+ assert ""water instead"" in got.message.args[0]
+ assert ""/issues/1"" in got.message.args[0]
+ assert got.filename == filename
+- assert got.lineno == lineno + 1
++ assert got.lineno == lineno - 1
+
+
+ def test_warn_deprecated_no_instead_or_issue(recwarn_always):
+",trio/tests/test_deprecate.py,"ReplaceText(target='-' @(40,32)->(40,33))","def test_warn_deprecated(recwarn_always):
+ assert ""water instead"" in got.message.args[0]
+ assert ""/issues/1"" in got.message.args[0]
+ assert got.filename == filename
+ assert got.lineno == lineno + 1
+
+
+ def test_warn_deprecated_no_instead_or_issue(recwarn_always):","def test_warn_deprecated(recwarn_always):
+ assert ""water instead"" in got.message.args[0]
+ assert ""/issues/1"" in got.message.args[0]
+ assert got.filename == filename
+ assert got.lineno == lineno - 1
+
+
+ def test_warn_deprecated_no_instead_or_issue(recwarn_always):"
+221,https://:@github.com/python-trio/trio.git,8d9effc1d32b8ef2f7a7a02c1b02a4de3f5f8e3d,"@@ -90,7 +90,7 @@ def ki_protection_enabled(frame):
+ if frame.f_code.co_name == ""__del__"":
+ return True
+ frame = frame.f_back
+- return False
++ return True
+
+
+ def currently_ki_protected():
+",trio/_core/_ki.py,"ReplaceText(target='True' @(93,11)->(93,16))","def ki_protection_enabled(frame):
+ if frame.f_code.co_name == ""__del__"":
+ return True
+ frame = frame.f_back
+ return False
+
+
+ def currently_ki_protected():","def ki_protection_enabled(frame):
+ if frame.f_code.co_name == ""__del__"":
+ return True
+ frame = frame.f_back
+ return True
+
+
+ def currently_ki_protected():"
+222,https://:@github.com/tkrajina/srtm.py.git,b1e1c673b613780c6a7151ab3db53461e2b668c7,"@@ -187,7 +187,7 @@ class GeoElevationData:
+ for row in range(height):
+ for column in range(width):
+ latitude = latitude_from + float(row) / height * (latitude_to - latitude_from)
+- longitude = longitude_from + float(column) / height * (longitude_to - longitude_from)
++ longitude = longitude_from + float(column) / width * (longitude_to - longitude_from)
+ elevation = self.get_elevation(latitude, longitude)
+ array[row,column] = elevation
+
+",srtm/data.py,"ReplaceText(target='width' @(190,65)->(190,71))","class GeoElevationData:
+ for row in range(height):
+ for column in range(width):
+ latitude = latitude_from + float(row) / height * (latitude_to - latitude_from)
+ longitude = longitude_from + float(column) / height * (longitude_to - longitude_from)
+ elevation = self.get_elevation(latitude, longitude)
+ array[row,column] = elevation
+ ","class GeoElevationData:
+ for row in range(height):
+ for column in range(width):
+ latitude = latitude_from + float(row) / height * (latitude_to - latitude_from)
+ longitude = longitude_from + float(column) / width * (longitude_to - longitude_from)
+ elevation = self.get_elevation(latitude, longitude)
+ array[row,column] = elevation
+ "
+223,https://:@github.com/tkrajina/srtm.py.git,771bb0e73e7b478603f73644a8c8f441b0e02e9f,"@@ -208,7 +208,7 @@ class GeoElevationData:
+ for row in range(height):
+ for column in range(width):
+ latitude = latitude_from + float(row) / height * (latitude_to - latitude_from)
+- longitude = longitude_from + float(column) / height * (longitude_to - longitude_from)
++ longitude = longitude_from + float(column) / width * (longitude_to - longitude_from)
+ elevation = self.get_elevation(latitude, longitude)
+ if elevation == None:
+ color = unknown_color
+",srtm/data.py,"ReplaceText(target='width' @(211,65)->(211,71))","class GeoElevationData:
+ for row in range(height):
+ for column in range(width):
+ latitude = latitude_from + float(row) / height * (latitude_to - latitude_from)
+ longitude = longitude_from + float(column) / height * (longitude_to - longitude_from)
+ elevation = self.get_elevation(latitude, longitude)
+ if elevation == None:
+ color = unknown_color","class GeoElevationData:
+ for row in range(height):
+ for column in range(width):
+ latitude = latitude_from + float(row) / height * (latitude_to - latitude_from)
+ longitude = longitude_from + float(column) / width * (longitude_to - longitude_from)
+ elevation = self.get_elevation(latitude, longitude)
+ if elevation == None:
+ color = unknown_color"
+224,https://:@github.com/mwouts/nbrmd.git,628e3f952bb786220efc1e14b976809bf8ea96be,"@@ -218,7 +218,7 @@ def readf(nb_file):
+ 'Expected extensions are {}'.format(nb_file,
+ notebook_extensions))
+ with io.open(nb_file, encoding='utf-8') as fp:
+- return read(nb_file, as_version=4, ext=ext)
++ return read(fp, as_version=4, ext=ext)
+
+
+ def writef(nb, nb_file):
+",nbrmd/nbrmd.py,"ReplaceText(target='fp' @(221,20)->(221,27))","def readf(nb_file):
+ 'Expected extensions are {}'.format(nb_file,
+ notebook_extensions))
+ with io.open(nb_file, encoding='utf-8') as fp:
+ return read(nb_file, as_version=4, ext=ext)
+
+
+ def writef(nb, nb_file):","def readf(nb_file):
+ 'Expected extensions are {}'.format(nb_file,
+ notebook_extensions))
+ with io.open(nb_file, encoding='utf-8') as fp:
+ return read(fp, as_version=4, ext=ext)
+
+
+ def writef(nb, nb_file):"
+225,https://:@github.com/mwouts/nbrmd.git,366614bce3dc65c6e88bcf37c4e2cd31ea36de92,"@@ -63,7 +63,7 @@ def test_load_save_rename_nbpy(nb_file, tmpdir):
+ cm.save(model=dict(type='notebook', content=nb), path=tmp_ipynb)
+
+ # rename nbpy
+- cm.rename(tmp_ipynb, 'new.nb.py')
++ cm.rename(tmp_nbpy, 'new.nb.py')
+ assert not os.path.isfile(str(tmpdir.join(tmp_ipynb)))
+ assert not os.path.isfile(str(tmpdir.join(tmp_nbpy)))
+
+",tests/test_contentsmanager.py,"ReplaceText(target='tmp_nbpy' @(66,14)->(66,23))","def test_load_save_rename_nbpy(nb_file, tmpdir):
+ cm.save(model=dict(type='notebook', content=nb), path=tmp_ipynb)
+
+ # rename nbpy
+ cm.rename(tmp_ipynb, 'new.nb.py')
+ assert not os.path.isfile(str(tmpdir.join(tmp_ipynb)))
+ assert not os.path.isfile(str(tmpdir.join(tmp_nbpy)))
+ ","def test_load_save_rename_nbpy(nb_file, tmpdir):
+ cm.save(model=dict(type='notebook', content=nb), path=tmp_ipynb)
+
+ # rename nbpy
+ cm.rename(tmp_nbpy, 'new.nb.py')
+ assert not os.path.isfile(str(tmpdir.join(tmp_ipynb)))
+ assert not os.path.isfile(str(tmpdir.join(tmp_nbpy)))
+ "
+226,https://:@github.com/mwouts/nbrmd.git,171256b67818ab86f43e35065fc828234e9abf98,"@@ -163,7 +163,7 @@ class CellExporter():
+ return True
+ if all([line.startswith('#') for line in self.source]):
+ return True
+- if CellReader(self.ext).read(source)[1] != len(source):
++ if CellReader(self.ext).read(source)[1] < len(source):
+ return True
+
+ return False
+",jupytext/cell_to_text.py,"ReplaceText(target='<' @(166,48)->(166,50))","class CellExporter():
+ return True
+ if all([line.startswith('#') for line in self.source]):
+ return True
+ if CellReader(self.ext).read(source)[1] != len(source):
+ return True
+
+ return False","class CellExporter():
+ return True
+ if all([line.startswith('#') for line in self.source]):
+ return True
+ if CellReader(self.ext).read(source)[1] < len(source):
+ return True
+
+ return False"
+227,https://:@github.com/mwouts/nbrmd.git,8048c8d0a09eab875376c7a4d1efb3cd886b8d3c,"@@ -122,7 +122,7 @@ def metadata_and_cell_to_header(notebook, text_format, ext):
+ if lines_to_next_cell is None and notebook.cells:
+ lines_to_next_cell = pep8_lines_between_cells(header, notebook.cells[0], ext)
+ else:
+- lines_to_next_cell = 0
++ lines_to_next_cell = 1
+
+ header.extend([''] * lines_to_next_cell)
+
+",jupytext/header.py,"ReplaceText(target='1' @(125,29)->(125,30))","def metadata_and_cell_to_header(notebook, text_format, ext):
+ if lines_to_next_cell is None and notebook.cells:
+ lines_to_next_cell = pep8_lines_between_cells(header, notebook.cells[0], ext)
+ else:
+ lines_to_next_cell = 0
+
+ header.extend([''] * lines_to_next_cell)
+ ","def metadata_and_cell_to_header(notebook, text_format, ext):
+ if lines_to_next_cell is None and notebook.cells:
+ lines_to_next_cell = pep8_lines_between_cells(header, notebook.cells[0], ext)
+ else:
+ lines_to_next_cell = 1
+
+ header.extend([''] * lines_to_next_cell)
+ "
+228,https://:@github.com/mwouts/nbrmd.git,120bebc0d37792cfa1418476d5f26809b996dca8,"@@ -615,7 +615,7 @@ def test_sync(nb_file, tmpdir):
+ compare_notebooks(nb, nb2)
+
+ # ipynb must be older than py file, otherwise our Contents Manager will complain
+- assert os.path.getmtime(tmp_ipynb) < os.path.getmtime(tmp_py)
++ assert os.path.getmtime(tmp_ipynb) <= os.path.getmtime(tmp_py)
+
+
+ @pytest.mark.parametrize('nb_file,ext',
+",tests/test_cli.py,"ReplaceText(target='<=' @(618,39)->(618,40))","def test_sync(nb_file, tmpdir):
+ compare_notebooks(nb, nb2)
+
+ # ipynb must be older than py file, otherwise our Contents Manager will complain
+ assert os.path.getmtime(tmp_ipynb) < os.path.getmtime(tmp_py)
+
+
+ @pytest.mark.parametrize('nb_file,ext',","def test_sync(nb_file, tmpdir):
+ compare_notebooks(nb, nb2)
+
+ # ipynb must be older than py file, otherwise our Contents Manager will complain
+ assert os.path.getmtime(tmp_ipynb) <= os.path.getmtime(tmp_py)
+
+
+ @pytest.mark.parametrize('nb_file,ext',"
+229,https://:@github.com/mwouts/nbrmd.git,dfa96996445cbc7514b93337dbf94d592ba06bad,"@@ -19,4 +19,4 @@ def test_identity_source_write_read(nb_file, ext):
+ R = jupytext.writes(nb1, ext)
+ nb2 = jupytext.reads(R, ext)
+
+- compare_notebooks(nb1, nb2)
++ compare_notebooks(nb2, nb1)
+",tests/test_ipynb_to_R.py,"ArgSwap(idxs=0<->1 @(22,4)->(22,21))","def test_identity_source_write_read(nb_file, ext):
+ R = jupytext.writes(nb1, ext)
+ nb2 = jupytext.reads(R, ext)
+
+ compare_notebooks(nb1, nb2)","def test_identity_source_write_read(nb_file, ext):
+ R = jupytext.writes(nb1, ext)
+ nb2 = jupytext.reads(R, ext)
+
+ compare_notebooks(nb2, nb1)"
+230,https://:@github.com/mwouts/nbrmd.git,dfa96996445cbc7514b93337dbf94d592ba06bad,"@@ -16,4 +16,4 @@ def test_identity_source_write_read(nb_file):
+ py = jupytext.writes(nb1, 'py')
+ nb2 = jupytext.reads(py, 'py')
+
+- compare_notebooks(nb1, nb2)
++ compare_notebooks(nb2, nb1)
+",tests/test_ipynb_to_py.py,"ArgSwap(idxs=0<->1 @(19,4)->(19,21))","def test_identity_source_write_read(nb_file):
+ py = jupytext.writes(nb1, 'py')
+ nb2 = jupytext.reads(py, 'py')
+
+ compare_notebooks(nb1, nb2)","def test_identity_source_write_read(nb_file):
+ py = jupytext.writes(nb1, 'py')
+ nb2 = jupytext.reads(py, 'py')
+
+ compare_notebooks(nb2, nb1)"
+231,https://:@github.com/mwouts/nbrmd.git,dfa96996445cbc7514b93337dbf94d592ba06bad,"@@ -16,4 +16,4 @@ def test_identity_source_write_read(nb_file):
+ rmd = jupytext.writes(nb1, 'Rmd')
+ nb2 = jupytext.reads(rmd, 'Rmd')
+
+- compare_notebooks(nb1, nb2, 'Rmd')
++ compare_notebooks(nb2, nb1, 'Rmd')
+",tests/test_ipynb_to_rmd.py,"ArgSwap(idxs=0<->1 @(19,4)->(19,21))","def test_identity_source_write_read(nb_file):
+ rmd = jupytext.writes(nb1, 'Rmd')
+ nb2 = jupytext.reads(rmd, 'Rmd')
+
+ compare_notebooks(nb1, nb2, 'Rmd')","def test_identity_source_write_read(nb_file):
+ rmd = jupytext.writes(nb1, 'Rmd')
+ nb2 = jupytext.reads(rmd, 'Rmd')
+
+ compare_notebooks(nb2, nb1, 'Rmd')"
+232,https://:@github.com/splunk/splunk-sdk-python.git,68f87378d5bac7efc97cf118f6754b5a6de73fa3,"@@ -48,7 +48,7 @@ class EventWriter(object):
+ else:
+ self._out = TextIOWrapper(output)
+
+- if isinstance(output, TextIOBase):
++ if isinstance(error, TextIOBase):
+ self._err = error
+ else:
+ self._err = TextIOWrapper(error)
+",splunklib/modularinput/event_writer.py,"ReplaceText(target='error' @(51,22)->(51,28))","class EventWriter(object):
+ else:
+ self._out = TextIOWrapper(output)
+
+ if isinstance(output, TextIOBase):
+ self._err = error
+ else:
+ self._err = TextIOWrapper(error)","class EventWriter(object):
+ else:
+ self._out = TextIOWrapper(output)
+
+ if isinstance(error, TextIOBase):
+ self._err = error
+ else:
+ self._err = TextIOWrapper(error)"
+233,https://:@github.com/tgbugs/pyontutils.git,78db71bb8b163794ef9bafb5a0ee50453d29971a,"@@ -56,7 +56,7 @@ def sysidpath(ignore_options=False):
+ )
+ for option in options:
+ if (option.exists() and
+- os.access(options, os.R_OK) and
++ os.access(option, os.R_OK) and
+ option.stat().st_size > 0):
+ return option
+
+",pyontutils/utils.py,"ReplaceText(target='option' @(59,26)->(59,33))","def sysidpath(ignore_options=False):
+ )
+ for option in options:
+ if (option.exists() and
+ os.access(options, os.R_OK) and
+ option.stat().st_size > 0):
+ return option
+ ","def sysidpath(ignore_options=False):
+ )
+ for option in options:
+ if (option.exists() and
+ os.access(option, os.R_OK) and
+ option.stat().st_size > 0):
+ return option
+ "
+234,https://:@github.com/holgern/beem.git,45ae6dc0380434d3544f5588fa24b379f5a62541,"@@ -224,7 +224,7 @@ class Blockchain(object):
+ else:
+ self.steem.rpc.get_block(blocknum, add_to_queue=True)
+ latest_block = blocknum
+- if batches > 1:
++ if batches >= 1:
+ latest_block += 1
+ if latest_block <= head_block:
+ if self.steem.rpc.get_use_appbase():
+",beem/blockchain.py,"ReplaceText(target='>=' @(227,31)->(227,32))","class Blockchain(object):
+ else:
+ self.steem.rpc.get_block(blocknum, add_to_queue=True)
+ latest_block = blocknum
+ if batches > 1:
+ latest_block += 1
+ if latest_block <= head_block:
+ if self.steem.rpc.get_use_appbase():","class Blockchain(object):
+ else:
+ self.steem.rpc.get_block(blocknum, add_to_queue=True)
+ latest_block = blocknum
+ if batches >= 1:
+ latest_block += 1
+ if latest_block <= head_block:
+ if self.steem.rpc.get_use_appbase():"
+235,https://:@github.com/holgern/beem.git,9eb381d23d582979934e0d3256447aef7d67de55,"@@ -509,7 +509,7 @@ class Testcases(unittest.TestCase):
+ op_num = account.estimate_virtual_op_num(block_num, stop_diff=0.1, max_count=100)
+ if op_num > 0:
+ op_num -= 1
+- self.assertTrue(op_num < i)
++ self.assertTrue(op_num <= i)
+ i += 1
+ last_block = new_block
+
+",tests/beem/test_account.py,"ReplaceText(target='<=' @(512,35)->(512,36))","class Testcases(unittest.TestCase):
+ op_num = account.estimate_virtual_op_num(block_num, stop_diff=0.1, max_count=100)
+ if op_num > 0:
+ op_num -= 1
+ self.assertTrue(op_num < i)
+ i += 1
+ last_block = new_block
+ ","class Testcases(unittest.TestCase):
+ op_num = account.estimate_virtual_op_num(block_num, stop_diff=0.1, max_count=100)
+ if op_num > 0:
+ op_num -= 1
+ self.assertTrue(op_num <= i)
+ i += 1
+ last_block = new_block
+ "
+236,https://:@github.com/holgern/beem.git,5f156fdf5a75367c32d85efb02e456abfa2719f6,"@@ -714,6 +714,6 @@ class RecentByPath(list):
+ comments = []
+ for reply in replies:
+ post = state[""content""][reply]
+- if category is None or (category is not None and post[""category""] != category):
++ if category is None or (category is not None and post[""category""] == category):
+ comments.append(Comment(post, lazy=True, steem_instance=self.steem))
+ super(RecentByPath, self).__init__(comments)
+",beem/comment.py,"ReplaceText(target='==' @(717,78)->(717,80))","class RecentByPath(list):
+ comments = []
+ for reply in replies:
+ post = state[""content""][reply]
+ if category is None or (category is not None and post[""category""] != category):
+ comments.append(Comment(post, lazy=True, steem_instance=self.steem))
+ super(RecentByPath, self).__init__(comments)","class RecentByPath(list):
+ comments = []
+ for reply in replies:
+ post = state[""content""][reply]
+ if category is None or (category is not None and post[""category""] == category):
+ comments.append(Comment(post, lazy=True, steem_instance=self.steem))
+ super(RecentByPath, self).__init__(comments)"
+237,https://:@github.com/holgern/beem.git,7b9ee9c75cbf285d18c1b4913cffe3798444ac30,"@@ -50,7 +50,7 @@ class RC(object):
+ resource_count[""resource_state_bytes""] += state_bytes_count
+ resource_count[""resource_new_accounts""] = new_account_op_count
+ if market_op_count > 0:
+- resource_count[""resource_market_bytes""] = market_op_count
++ resource_count[""resource_market_bytes""] = tx_size
+ return resource_count
+
+ def comment_dict(self, comment_dict):
+",beem/rc.py,"ReplaceText(target='tx_size' @(53,54)->(53,69))","class RC(object):
+ resource_count[""resource_state_bytes""] += state_bytes_count
+ resource_count[""resource_new_accounts""] = new_account_op_count
+ if market_op_count > 0:
+ resource_count[""resource_market_bytes""] = market_op_count
+ return resource_count
+
+ def comment_dict(self, comment_dict):","class RC(object):
+ resource_count[""resource_state_bytes""] += state_bytes_count
+ resource_count[""resource_new_accounts""] = new_account_op_count
+ if market_op_count > 0:
+ resource_count[""resource_market_bytes""] = tx_size
+ return resource_count
+
+ def comment_dict(self, comment_dict):"
+238,https://:@github.com/holgern/beem.git,9e96dc84f9965b25b6b2a56a1bca7b7652b93be8,"@@ -1456,7 +1456,7 @@ class Steem(object):
+ 'key_auths': active_key_authority,
+ ""address_auths"": [],
+ 'weight_threshold': 1},
+- 'posting': {'account_auths': active_accounts_authority,
++ 'posting': {'account_auths': posting_accounts_authority,
+ 'key_auths': posting_key_authority,
+ ""address_auths"": [],
+ 'weight_threshold': 1},
+",beem/steem.py,"ReplaceText(target='posting_accounts_authority' @(1459,41)->(1459,66))","class Steem(object):
+ 'key_auths': active_key_authority,
+ ""address_auths"": [],
+ 'weight_threshold': 1},
+ 'posting': {'account_auths': active_accounts_authority,
+ 'key_auths': posting_key_authority,
+ ""address_auths"": [],
+ 'weight_threshold': 1},","class Steem(object):
+ 'key_auths': active_key_authority,
+ ""address_auths"": [],
+ 'weight_threshold': 1},
+ 'posting': {'account_auths': posting_accounts_authority,
+ 'key_auths': posting_key_authority,
+ ""address_auths"": [],
+ 'weight_threshold': 1},"
+239,https://:@github.com/holgern/beem.git,8e4214f27e746be7ed01c5d644911c830bfe988a,"@@ -135,7 +135,7 @@ class Block(BlockchainObject):
+ if ops_ops is None:
+ ops = None
+ else:
+- ops = ops[""ops""]
++ ops = ops_ops[""ops""]
+ except ApiNotSupported:
+ ops = self.steem.rpc.get_ops_in_block(self.identifier, self.only_virtual_ops, api=""condenser"")
+ else:
+",beem/block.py,"ReplaceText(target='ops_ops' @(138,30)->(138,33))","class Block(BlockchainObject):
+ if ops_ops is None:
+ ops = None
+ else:
+ ops = ops[""ops""]
+ except ApiNotSupported:
+ ops = self.steem.rpc.get_ops_in_block(self.identifier, self.only_virtual_ops, api=""condenser"")
+ else:","class Block(BlockchainObject):
+ if ops_ops is None:
+ ops = None
+ else:
+ ops = ops_ops[""ops""]
+ except ApiNotSupported:
+ ops = self.steem.rpc.get_ops_in_block(self.identifier, self.only_virtual_ops, api=""condenser"")
+ else:"
+240,https://:@github.com/holgern/beem.git,d19894c85464f2bc5221e15f858326c4e8efdaf3,"@@ -367,7 +367,7 @@ class ActiveVotes(VotesObject):
+ elif isinstance(authorperm, string_types):
+ [author, permlink] = resolve_authorperm(authorperm)
+ if self.steem.rpc.get_use_appbase():
+- self.steem.rpc.set_next_node_on_empty_reply(True)
++ self.steem.rpc.set_next_node_on_empty_reply(False)
+ try:
+ votes = self.steem.rpc.get_active_votes(author, permlink, api=""condenser"")
+ except:
+",beem/vote.py,"ReplaceText(target='False' @(370,60)->(370,64))","class ActiveVotes(VotesObject):
+ elif isinstance(authorperm, string_types):
+ [author, permlink] = resolve_authorperm(authorperm)
+ if self.steem.rpc.get_use_appbase():
+ self.steem.rpc.set_next_node_on_empty_reply(True)
+ try:
+ votes = self.steem.rpc.get_active_votes(author, permlink, api=""condenser"")
+ except:","class ActiveVotes(VotesObject):
+ elif isinstance(authorperm, string_types):
+ [author, permlink] = resolve_authorperm(authorperm)
+ if self.steem.rpc.get_use_appbase():
+ self.steem.rpc.set_next_node_on_empty_reply(False)
+ try:
+ votes = self.steem.rpc.get_active_votes(author, permlink, api=""condenser"")
+ except:"
+241,https://:@github.com/holgern/beem.git,8f173f0ab272a57a5c036589dcc19b8543026b3e,"@@ -780,7 +780,7 @@ def keygen(import_word_list, strength, passphrase, path, network, role, account_
+ t.add_row([""Key role"", role])
+ t.add_row([""path"", path])
+ pubkey = ledgertx.ledgertx.get_pubkey(path, request_screen_approval=False)
+- aprove_key = PrettyTable([""Approve %s Key"" % r])
++ aprove_key = PrettyTable([""Approve %s Key"" % role])
+ aprove_key.align = ""l""
+ aprove_key.add_row([format(pubkey, ""STM"")])
+ print(aprove_key)
+",beem/cli.py,"ReplaceText(target='role' @(783,57)->(783,58))","def keygen(import_word_list, strength, passphrase, path, network, role, account_
+ t.add_row([""Key role"", role])
+ t.add_row([""path"", path])
+ pubkey = ledgertx.ledgertx.get_pubkey(path, request_screen_approval=False)
+ aprove_key = PrettyTable([""Approve %s Key"" % r])
+ aprove_key.align = ""l""
+ aprove_key.add_row([format(pubkey, ""STM"")])
+ print(aprove_key)","def keygen(import_word_list, strength, passphrase, path, network, role, account_
+ t.add_row([""Key role"", role])
+ t.add_row([""path"", path])
+ pubkey = ledgertx.ledgertx.get_pubkey(path, request_screen_approval=False)
+ aprove_key = PrettyTable([""Approve %s Key"" % role])
+ aprove_key.align = ""l""
+ aprove_key.add_row([format(pubkey, ""STM"")])
+ print(aprove_key)"
+242,https://:@github.com/BlackLight/platypush.git,56b87f343693e89131b3b30930acfeeaec4915fe,"@@ -101,7 +101,7 @@ class MqttBackend(Backend):
+ format(response_topic, response))
+
+ client = get_plugin('mqtt')
+- client.send_message(topic=self.topic, msg=msg, host=self.host,
++ client.send_message(topic=self.topic, msg=response, host=self.host,
+ port=self.port, username=self.username,
+ password=self.password, tls_cafile=self.tls_cafile,
+ tls_certfile=self.tls_certfile,
+",platypush/backend/mqtt.py,"ReplaceText(target='response' @(104,58)->(104,61))","class MqttBackend(Backend):
+ format(response_topic, response))
+
+ client = get_plugin('mqtt')
+ client.send_message(topic=self.topic, msg=msg, host=self.host,
+ port=self.port, username=self.username,
+ password=self.password, tls_cafile=self.tls_cafile,
+ tls_certfile=self.tls_certfile,","class MqttBackend(Backend):
+ format(response_topic, response))
+
+ client = get_plugin('mqtt')
+ client.send_message(topic=self.topic, msg=response, host=self.host,
+ port=self.port, username=self.username,
+ password=self.password, tls_cafile=self.tls_cafile,
+ tls_certfile=self.tls_certfile,"
+243,https://:@github.com/BlackLight/platypush.git,c9dc1aac44ec4df76071092f4a17601d97955a38,"@@ -47,7 +47,7 @@ class SensorEnvirophatBackend(SensorBackend):
+ if enabled and sensor in sensors and sensors[sensor] != self._last_read.get(sensor)
+ }
+
+- self._last_read = ret
++ self._last_read = sensors
+ return ret
+
+
+",platypush/backend/sensor/envirophat.py,"ReplaceText(target='sensors' @(50,26)->(50,29))","class SensorEnvirophatBackend(SensorBackend):
+ if enabled and sensor in sensors and sensors[sensor] != self._last_read.get(sensor)
+ }
+
+ self._last_read = ret
+ return ret
+
+ ","class SensorEnvirophatBackend(SensorBackend):
+ if enabled and sensor in sensors and sensors[sensor] != self._last_read.get(sensor)
+ }
+
+ self._last_read = sensors
+ return ret
+
+ "
+244,https://:@github.com/BlackLight/platypush.git,7f440a9160619c699f7e8e58b3c0fad3c80ceaf3,"@@ -46,7 +46,7 @@ class GpioPlugin(Plugin):
+ import RPi.GPIO as GPIO
+
+ with self._init_lock:
+- if self._initialized or GPIO.getmode():
++ if self._initialized and GPIO.getmode():
+ return
+
+ GPIO.setmode(self.mode)
+",platypush/plugins/gpio/__init__.py,"ReplaceText(target='and' @(49,33)->(49,35))","class GpioPlugin(Plugin):
+ import RPi.GPIO as GPIO
+
+ with self._init_lock:
+ if self._initialized or GPIO.getmode():
+ return
+
+ GPIO.setmode(self.mode)","class GpioPlugin(Plugin):
+ import RPi.GPIO as GPIO
+
+ with self._init_lock:
+ if self._initialized and GPIO.getmode():
+ return
+
+ GPIO.setmode(self.mode)"
+245,https://:@github.com/BlackLight/platypush.git,c26d456109fea166f8fb5da25aed1d4fb7fc94ab,"@@ -175,7 +175,7 @@ class SensorBackend(Backend):
+
+ def process_data(self, data, new_data):
+ if new_data:
+- self.bus.post(SensorDataChangeEvent(data=data, source=self.plugin or self.__class__.__name__))
++ self.bus.post(SensorDataChangeEvent(data=new_data, source=self.plugin or self.__class__.__name__))
+
+ def run(self):
+ super().run()
+",platypush/backend/sensor/__init__.py,"ReplaceText(target='new_data' @(178,53)->(178,57))","class SensorBackend(Backend):
+
+ def process_data(self, data, new_data):
+ if new_data:
+ self.bus.post(SensorDataChangeEvent(data=data, source=self.plugin or self.__class__.__name__))
+
+ def run(self):
+ super().run()","class SensorBackend(Backend):
+
+ def process_data(self, data, new_data):
+ if new_data:
+ self.bus.post(SensorDataChangeEvent(data=new_data, source=self.plugin or self.__class__.__name__))
+
+ def run(self):
+ super().run()"
+246,https://:@github.com/chrisjsewell/ipypublish.git,cfb66fb74d48cbcc99c695b64fe6336213877e04,"@@ -52,7 +52,7 @@ class LatexDocLinks(Preprocessor):
+ ': {}'.format(bib))
+ else:
+ external_files.append(bib)
+- resources['bibliopath'] = external_files
++ resources['bibliopath'] = bib
+
+ nb.metadata.latex_doc.bibliography = os.path.join(self.filesfolder,
+ os.path.basename(bib))
+",ipypublish/preprocessors/latex_doc.py,"ReplaceText(target='bib' @(55,46)->(55,60))","class LatexDocLinks(Preprocessor):
+ ': {}'.format(bib))
+ else:
+ external_files.append(bib)
+ resources['bibliopath'] = external_files
+
+ nb.metadata.latex_doc.bibliography = os.path.join(self.filesfolder,
+ os.path.basename(bib))","class LatexDocLinks(Preprocessor):
+ ': {}'.format(bib))
+ else:
+ external_files.append(bib)
+ resources['bibliopath'] = bib
+
+ nb.metadata.latex_doc.bibliography = os.path.join(self.filesfolder,
+ os.path.basename(bib))"
+247,https://:@github.com/pazz/alot.git,dd7b2a15495ce5fddcac0d34c14e5ef9f1032482,"@@ -64,7 +64,7 @@ class ThreadlineWidget(urwid.AttrMap):
+ mailcountstring = ""(%d)"" % self.thread.get_total_messages()
+ else:
+ mailcountstring = ""(?)""
+- datestring = pad(mailcountstring)
++ mailcountstring = pad(mailcountstring)
+ width = len(mailcountstring)
+ mailcount_w = AttrFlipWidget(urwid.Text(mailcountstring),
+ struct['mailcount'])
+",alot/widgets/search.py,"ReplaceText(target='mailcountstring' @(67,12)->(67,22))","class ThreadlineWidget(urwid.AttrMap):
+ mailcountstring = ""(%d)"" % self.thread.get_total_messages()
+ else:
+ mailcountstring = ""(?)""
+ datestring = pad(mailcountstring)
+ width = len(mailcountstring)
+ mailcount_w = AttrFlipWidget(urwid.Text(mailcountstring),
+ struct['mailcount'])","class ThreadlineWidget(urwid.AttrMap):
+ mailcountstring = ""(%d)"" % self.thread.get_total_messages()
+ else:
+ mailcountstring = ""(?)""
+ mailcountstring = pad(mailcountstring)
+ width = len(mailcountstring)
+ mailcount_w = AttrFlipWidget(urwid.Text(mailcountstring),
+ struct['mailcount'])"
+248,https://:@github.com/luozhouyang/python-string-similarity.git,5f6717fe6d7cae48a664eaa76a47e3388ffd0cf2,"@@ -33,7 +33,7 @@ class Levenshtein(MetricStringDistance):
+ if len(s0) == 0:
+ return len(s1)
+ if len(s1) == 0:
+- return len(s1)
++ return len(s0)
+
+ v0 = [0] * (len(s1) + 1)
+ v1 = [0] * (len(s1) + 1)
+",strsimpy/levenshtein.py,"ReplaceText(target='s0' @(36,23)->(36,25))","class Levenshtein(MetricStringDistance):
+ if len(s0) == 0:
+ return len(s1)
+ if len(s1) == 0:
+ return len(s1)
+
+ v0 = [0] * (len(s1) + 1)
+ v1 = [0] * (len(s1) + 1)","class Levenshtein(MetricStringDistance):
+ if len(s0) == 0:
+ return len(s1)
+ if len(s1) == 0:
+ return len(s0)
+
+ v0 = [0] * (len(s1) + 1)
+ v1 = [0] * (len(s1) + 1)"
+249,https://:@github.com/ElementsProject/lightning.git,84b9e3e72b2bf8590603072d709a3ea294dd5483,"@@ -943,7 +943,7 @@ def test_logging(node_factory):
+
+ def check_new_log():
+ log2 = open(logpath).readlines()
+- return len(log2) > 1 and log2[0].endswith(""Started log due to SIGHUP\n"")
++ return len(log2) > 0 and log2[0].endswith(""Started log due to SIGHUP\n"")
+ wait_for(check_new_log)
+
+
+",tests/test_misc.py,"ReplaceText(target='0' @(946,27)->(946,28))","def test_logging(node_factory):
+
+ def check_new_log():
+ log2 = open(logpath).readlines()
+ return len(log2) > 1 and log2[0].endswith(""Started log due to SIGHUP\n"")
+ wait_for(check_new_log)
+
+ ","def test_logging(node_factory):
+
+ def check_new_log():
+ log2 = open(logpath).readlines()
+ return len(log2) > 0 and log2[0].endswith(""Started log due to SIGHUP\n"")
+ wait_for(check_new_log)
+
+ "
+250,https://:@github.com/ElementsProject/lightning.git,c8579b99d01d8b738feadd2d9f541daba5230a63,"@@ -305,7 +305,7 @@ other types. Since 'msgtype' is almost identical, it inherits from this too.
+ def read(self, io_in: BufferedIOBase, otherfields: Dict[str, Any]) -> Optional[Dict[str, Any]]:
+ vals = {}
+ for field in self.fields:
+- val = field.fieldtype.read(io_in, otherfields)
++ val = field.fieldtype.read(io_in, vals)
+ if val is None:
+ # If first field fails to read, we return None.
+ if field == self.fields[0]:
+",contrib/pyln-proto/pyln/proto/message/message.py,"ReplaceText(target='vals' @(308,46)->(308,57))","other types. Since 'msgtype' is almost identical, it inherits from this too.
+ def read(self, io_in: BufferedIOBase, otherfields: Dict[str, Any]) -> Optional[Dict[str, Any]]:
+ vals = {}
+ for field in self.fields:
+ val = field.fieldtype.read(io_in, otherfields)
+ if val is None:
+ # If first field fails to read, we return None.
+ if field == self.fields[0]:","other types. Since 'msgtype' is almost identical, it inherits from this too.
+ def read(self, io_in: BufferedIOBase, otherfields: Dict[str, Any]) -> Optional[Dict[str, Any]]:
+ vals = {}
+ for field in self.fields:
+ val = field.fieldtype.read(io_in, vals)
+ if val is None:
+ # If first field fails to read, we return None.
+ if field == self.fields[0]:"
+251,https://:@github.com/funilrys/PyFunceble.git,c766732abdf31c0c1ce283ee9aa2ec32f0ac7829,"@@ -301,7 +301,7 @@ class Generate(object): # pragma: no cover
+ regex_blogger = [""create-blog.g?"", ""87065"", ""doesn’t exist""]
+
+ if self.tested == PyFunceble.CONFIGURATION[""domain""]:
+- url_to_get = ""http://%s"" & self.tested
++ url_to_get = ""http://%s"" % self.tested
+ else:
+ url_to_get = self.tested
+
+",PyFunceble/generate.py,"ReplaceText(target='%' @(304,37)->(304,38))","class Generate(object): # pragma: no cover
+ regex_blogger = [""create-blog.g?"", ""87065"", ""doesn’t exist""]
+
+ if self.tested == PyFunceble.CONFIGURATION[""domain""]:
+ url_to_get = ""http://%s"" & self.tested
+ else:
+ url_to_get = self.tested
+ ","class Generate(object): # pragma: no cover
+ regex_blogger = [""create-blog.g?"", ""87065"", ""doesn’t exist""]
+
+ if self.tested == PyFunceble.CONFIGURATION[""domain""]:
+ url_to_get = ""http://%s"" % self.tested
+ else:
+ url_to_get = self.tested
+ "
+252,https://:@github.com/funilrys/PyFunceble.git,08400b05f5f3e20c24c9222a9cb9216d1a76aea5,"@@ -80,7 +80,7 @@ class Load(object): # pylint: disable=too-few-public-methods
+ def __init__(self, path_to_config):
+ self.path_to_config = path_to_config
+
+- if path_to_config.endswith(directory_separator):
++ if not path_to_config.endswith(directory_separator):
+ self.path_to_config += directory_separator
+
+ self.path_to_config += PyFunceble.CONFIGURATION_FILENAME
+",PyFunceble/config.py,"ReplaceText(target='not ' @(83,11)->(83,11))","class Load(object): # pylint: disable=too-few-public-methods
+ def __init__(self, path_to_config):
+ self.path_to_config = path_to_config
+
+ if path_to_config.endswith(directory_separator):
+ self.path_to_config += directory_separator
+
+ self.path_to_config += PyFunceble.CONFIGURATION_FILENAME","class Load(object): # pylint: disable=too-few-public-methods
+ def __init__(self, path_to_config):
+ self.path_to_config = path_to_config
+
+ if not path_to_config.endswith(directory_separator):
+ self.path_to_config += directory_separator
+
+ self.path_to_config += PyFunceble.CONFIGURATION_FILENAME"
+253,https://:@github.com/funilrys/PyFunceble.git,fb9465acb6a7124aa84b8c419c9709243e001f94,"@@ -96,7 +96,7 @@ class Clean:
+ if (
+ number_of_tested == 0
+ or list_to_test[number_of_tested - 1] == list_to_test[-1]
+- or number_of_tested == len(list_to_test)
++ or number_of_tested >= len(list_to_test)
+ ):
+ # * If the number of tested is null,
+ # or
+",PyFunceble/clean.py,"ReplaceText(target='>=' @(99,40)->(99,42))","class Clean:
+ if (
+ number_of_tested == 0
+ or list_to_test[number_of_tested - 1] == list_to_test[-1]
+ or number_of_tested == len(list_to_test)
+ ):
+ # * If the number of tested is null,
+ # or","class Clean:
+ if (
+ number_of_tested == 0
+ or list_to_test[number_of_tested - 1] == list_to_test[-1]
+ or number_of_tested >= len(list_to_test)
+ ):
+ # * If the number of tested is null,
+ # or"
+254,https://:@github.com/funilrys/PyFunceble.git,a9e45c83e13eca92389d0be56634cc45ef601bc1,"@@ -92,7 +92,7 @@ class DBTypeDownloader(DownloaderBase):
+ f""{PyFunceble.OUTPUTS.db_type.files[PyFunceble.CONFIGURATION.db_type]}""
+ )
+
+- if is_cloned_version and (
++ if not is_cloned_version and (
+ PyFunceble.CONFIGURATION.db_type not in not_supported_db_types
+ ):
+ destination_dir_instance.delete()
+",PyFunceble/downloader/db_type.py,"ReplaceText(target='not ' @(95,11)->(95,11))","class DBTypeDownloader(DownloaderBase):
+ f""{PyFunceble.OUTPUTS.db_type.files[PyFunceble.CONFIGURATION.db_type]}""
+ )
+
+ if is_cloned_version and (
+ PyFunceble.CONFIGURATION.db_type not in not_supported_db_types
+ ):
+ destination_dir_instance.delete()","class DBTypeDownloader(DownloaderBase):
+ f""{PyFunceble.OUTPUTS.db_type.files[PyFunceble.CONFIGURATION.db_type]}""
+ )
+
+ if not is_cloned_version and (
+ PyFunceble.CONFIGURATION.db_type not in not_supported_db_types
+ ):
+ destination_dir_instance.delete()"
+255,https://:@github.com/funilrys/PyFunceble.git,76bc73c57f4ac2865fc89d70ad330be2aa501c08,"@@ -154,7 +154,7 @@ class Credential:
+ regex = f""{name}=.*""
+
+ if not content:
+- content += f""{to_write}\n""
++ content = f""{to_write}\n""
+ continue
+
+ if PyFunceble.helpers.Regex(f""^{regex}"").get_matching_list(
+",PyFunceble/engine/database/loader/credential.py,"ReplaceText(target='=' @(157,28)->(157,30))","class Credential:
+ regex = f""{name}=.*""
+
+ if not content:
+ content += f""{to_write}\n""
+ continue
+
+ if PyFunceble.helpers.Regex(f""^{regex}"").get_matching_list(","class Credential:
+ regex = f""{name}=.*""
+
+ if not content:
+ content = f""{to_write}\n""
+ continue
+
+ if PyFunceble.helpers.Regex(f""^{regex}"").get_matching_list("
+256,https://:@github.com/valassis-digital-media/conda-mirror.git,e0b34555d779f9b440512f850da39aa5a0e29ece,"@@ -85,5 +85,5 @@ def test_handling_bad_package(tmpdir, repodata):
+ with bz2.BZ2File(bad_pkg_path, 'wb') as f:
+ f.write(""This is a fake package"".encode())
+ assert bad_pkg_name in os.listdir(bad_pkg_root)
+- conda_mirror._validate_packages(repodata, local_repo_root)
++ conda_mirror._validate_packages(repodata, bad_pkg_root)
+ assert bad_pkg_name not in os.listdir(bad_pkg_root)
+\ No newline at end of file
+",test/test_conda_mirror.py,"ReplaceText(target='bad_pkg_root' @(88,46)->(88,61))","def test_handling_bad_package(tmpdir, repodata):
+ with bz2.BZ2File(bad_pkg_path, 'wb') as f:
+ f.write(""This is a fake package"".encode())
+ assert bad_pkg_name in os.listdir(bad_pkg_root)
+ conda_mirror._validate_packages(repodata, local_repo_root)
+ assert bad_pkg_name not in os.listdir(bad_pkg_root)
+\ No newline at end of file","def test_handling_bad_package(tmpdir, repodata):
+ with bz2.BZ2File(bad_pkg_path, 'wb') as f:
+ f.write(""This is a fake package"".encode())
+ assert bad_pkg_name in os.listdir(bad_pkg_root)
+ conda_mirror._validate_packages(repodata, bad_pkg_root)
+ assert bad_pkg_name not in os.listdir(bad_pkg_root)
+\ No newline at end of file"
+257,https://:@github.com/fact-project/pycustos.git,e2432cee5bba6dc97b30d0b640c0c92f3bdd6961,"@@ -8,7 +8,7 @@ class Notifier(metaclass=ABCMeta):
+ self.categories = set(categories)
+
+ def handle_message(self, msg):
+- if self.categories.intersection(msg.categories) and msg.level > self.level:
++ if self.categories.intersection(msg.categories) and msg.level >= self.level:
+ self.notify(msg)
+
+ @abstractmethod
+",custos/notify/base.py,"ReplaceText(target='>=' @(11,70)->(11,71))","class Notifier(metaclass=ABCMeta):
+ self.categories = set(categories)
+
+ def handle_message(self, msg):
+ if self.categories.intersection(msg.categories) and msg.level > self.level:
+ self.notify(msg)
+
+ @abstractmethod","class Notifier(metaclass=ABCMeta):
+ self.categories = set(categories)
+
+ def handle_message(self, msg):
+ if self.categories.intersection(msg.categories) and msg.level >= self.level:
+ self.notify(msg)
+
+ @abstractmethod"
+258,https://:@github.com/danilobellini/audiolazy.git,3119b12f8f0b175b3f55aecf3053ed6a0d1a477a,"@@ -249,4 +249,4 @@ def gammatone(freq, bandwidth):
+ freqs = tee(freq, 4)
+ resons = [resonator.z_exp, resonator.poles_exp] * 2
+ return CascadeFilter(reson(f, bw)
+- for reson, f, bw in zip(bws, freqs, resons))
++ for reson, f, bw in zip(resons, freqs, bws))
+",audiolazy/lazy_auditory.py,"ArgSwap(idxs=0<->2 @(252,43)->(252,46))","def gammatone(freq, bandwidth):
+ freqs = tee(freq, 4)
+ resons = [resonator.z_exp, resonator.poles_exp] * 2
+ return CascadeFilter(reson(f, bw)
+ for reson, f, bw in zip(bws, freqs, resons))","def gammatone(freq, bandwidth):
+ freqs = tee(freq, 4)
+ resons = [resonator.z_exp, resonator.poles_exp] * 2
+ return CascadeFilter(reson(f, bw)
+ for reson, f, bw in zip(resons, freqs, bws))"
+259,https://:@github.com/ojii/django-sekizai.git,b0b50e0713a90e84acabe1ab39e951421fd4aa7a,"@@ -91,6 +91,6 @@ class CSSSingleFileFilter(BaseMinifierFilter):
+ mtime = os.path.getmtime(master)
+ for f in files:
+ fpath = media_url_to_filepath(f)
+- if os.path.getmtime(fpath) > mtime:
++ if os.path.getmtime(fpath) >= mtime:
+ return True
+ return False
+\ No newline at end of file
+",sekizai/filters/css.py,"ReplaceText(target='>=' @(94,39)->(94,40))","class CSSSingleFileFilter(BaseMinifierFilter):
+ mtime = os.path.getmtime(master)
+ for f in files:
+ fpath = media_url_to_filepath(f)
+ if os.path.getmtime(fpath) > mtime:
+ return True
+ return False
+\ No newline at end of file","class CSSSingleFileFilter(BaseMinifierFilter):
+ mtime = os.path.getmtime(master)
+ for f in files:
+ fpath = media_url_to_filepath(f)
+ if os.path.getmtime(fpath) >= mtime:
+ return True
+ return False
+\ No newline at end of file"
+260,https://:@github.com/websocket-client/websocket-client.git,6410340fca47f258d50a34646138ba03b2b2783b,"@@ -183,7 +183,7 @@ def _tunnel(sock, host, port, auth):
+
+ if status != 200:
+ raise WebSocketProxyException(
+- ""failed CONNECT via proxy status: %r"" + status)
++ ""failed CONNECT via proxy status: %r"" % status)
+
+ return sock
+
+",websocket/_http.py,"ReplaceText(target='%' @(186,50)->(186,51))","def _tunnel(sock, host, port, auth):
+
+ if status != 200:
+ raise WebSocketProxyException(
+ ""failed CONNECT via proxy status: %r"" + status)
+
+ return sock
+ ","def _tunnel(sock, host, port, auth):
+
+ if status != 200:
+ raise WebSocketProxyException(
+ ""failed CONNECT via proxy status: %r"" % status)
+
+ return sock
+ "
+261,https://:@github.com/getsentry/raven-python.git,dedca8e5c98124f6a43a18986e142e8cb7ecc3cf,"@@ -59,7 +59,7 @@ def setup_logging(handler, exclude=['raven', 'sentry.errors']):
+ Returns a boolean based on if logging was configured or not.
+ """"""
+ logger = logging.getLogger()
+- if handler.__class__ not in map(type, logger.handlers):
++ if handler.__class__ in map(type, logger.handlers):
+ return False
+
+ logger.addHandler(handler)
+",raven/conf/__init__.py,"ReplaceText(target=' in ' @(62,24)->(62,32))","def setup_logging(handler, exclude=['raven', 'sentry.errors']):
+ Returns a boolean based on if logging was configured or not.
+ """"""
+ logger = logging.getLogger()
+ if handler.__class__ not in map(type, logger.handlers):
+ return False
+
+ logger.addHandler(handler)","def setup_logging(handler, exclude=['raven', 'sentry.errors']):
+ Returns a boolean based on if logging was configured or not.
+ """"""
+ logger = logging.getLogger()
+ if handler.__class__ in map(type, logger.handlers):
+ return False
+
+ logger.addHandler(handler)"
+262,https://:@github.com/getsentry/raven-python.git,f0ad0ca6a9de44128982de50c30157b779b69d71,"@@ -16,7 +16,7 @@ class TransportRegistry(object):
+ self.register_transport(transport)
+
+ def register_transport(self, transport):
+- if not hasattr(transport, 'scheme') and not hasattr(transport.scheme, '__iter__'):
++ if not hasattr(transport, 'scheme') or not hasattr(transport.scheme, '__iter__'):
+ raise AttributeError('Transport %s must have a scheme list', transport.__class__.__name__)
+
+ for scheme in transport.scheme:
+",raven/transport/registry.py,"ReplaceText(target='or' @(19,44)->(19,47))","class TransportRegistry(object):
+ self.register_transport(transport)
+
+ def register_transport(self, transport):
+ if not hasattr(transport, 'scheme') and not hasattr(transport.scheme, '__iter__'):
+ raise AttributeError('Transport %s must have a scheme list', transport.__class__.__name__)
+
+ for scheme in transport.scheme:","class TransportRegistry(object):
+ self.register_transport(transport)
+
+ def register_transport(self, transport):
+ if not hasattr(transport, 'scheme') or not hasattr(transport.scheme, '__iter__'):
+ raise AttributeError('Transport %s must have a scheme list', transport.__class__.__name__)
+
+ for scheme in transport.scheme:"
+263,https://:@github.com/ilius/pyglossary.git,8ad925bbb4ce19207322471c4c758d1a66f0db9d,"@@ -186,7 +186,7 @@ def write(
+ with open(filePathBase + "".xml"", ""w"", encoding=""utf8"") as toFile:
+ write_header(glos, toFile, frontBackMatter)
+ for entryI, entry in enumerate(glos):
+- if glos.isData():
++ if entry.isData():
+ entry.save(myResDir)
+ continue
+
+",pyglossary/plugins/appledict/__init__.py,"ReplaceText(target='entry' @(189,6)->(189,10))","def write(
+ with open(filePathBase + "".xml"", ""w"", encoding=""utf8"") as toFile:
+ write_header(glos, toFile, frontBackMatter)
+ for entryI, entry in enumerate(glos):
+ if glos.isData():
+ entry.save(myResDir)
+ continue
+ ","def write(
+ with open(filePathBase + "".xml"", ""w"", encoding=""utf8"") as toFile:
+ write_header(glos, toFile, frontBackMatter)
+ for entryI, entry in enumerate(glos):
+ if entry.isData():
+ entry.save(myResDir)
+ continue
+ "
+264,https://:@github.com/ilius/pyglossary.git,194fea3e176f5c9caf090a58bee3c5b04fd483ef,"@@ -450,7 +450,7 @@ class Glossary(GlossaryType):
+ wordCount = len(reader)
+ except Exception:
+ log.exception("""")
+- if wordCount > 0:
++ if wordCount >= 0:
+ progressbar = True
+ if progressbar:
+ self.progressInit(""Converting"")
+",pyglossary/glossary.py,"ReplaceText(target='>=' @(453,17)->(453,18))","class Glossary(GlossaryType):
+ wordCount = len(reader)
+ except Exception:
+ log.exception("""")
+ if wordCount > 0:
+ progressbar = True
+ if progressbar:
+ self.progressInit(""Converting"")","class Glossary(GlossaryType):
+ wordCount = len(reader)
+ except Exception:
+ log.exception("""")
+ if wordCount >= 0:
+ progressbar = True
+ if progressbar:
+ self.progressInit(""Converting"")"
+265,https://:@github.com/ilius/pyglossary.git,a7237c6749dcd2f2cf34b5f8ec385b6ba0b5565a,"@@ -99,7 +99,7 @@ class TextGlossaryReader(object):
+ try:
+ wordDefi = self.nextPair()
+ except StopIteration as e:
+- if self._fileIndex < self._fileCount + 1:
++ if self._fileIndex < self._fileCount - 1:
+ if self.openNextFile():
+ return self.__next__()
+ self._wordCount = self._pos
+",pyglossary/text_reader.py,"ReplaceText(target='-' @(102,40)->(102,41))","class TextGlossaryReader(object):
+ try:
+ wordDefi = self.nextPair()
+ except StopIteration as e:
+ if self._fileIndex < self._fileCount + 1:
+ if self.openNextFile():
+ return self.__next__()
+ self._wordCount = self._pos","class TextGlossaryReader(object):
+ try:
+ wordDefi = self.nextPair()
+ except StopIteration as e:
+ if self._fileIndex < self._fileCount - 1:
+ if self.openNextFile():
+ return self.__next__()
+ self._wordCount = self._pos"
+266,https://:@github.com/GOVCERT-LU/eml_parser.git,5a129fd37081de0c3483a317e4eefced52fed44d,"@@ -636,7 +636,7 @@ def parse_email(msg, include_raw_body=False, include_attachment_data=False):
+ if list_observed_dom:
+ bodie['domain'] = list(set(list_observed_dom))
+
+- if list_observed_dom:
++ if list_observed_ip:
+ bodie['ip'] = list(set(list_observed_ip))
+
+ else:
+",eml_parser/eml_parser.py,"ReplaceText(target='list_observed_ip' @(639,15)->(639,32))","def parse_email(msg, include_raw_body=False, include_attachment_data=False):
+ if list_observed_dom:
+ bodie['domain'] = list(set(list_observed_dom))
+
+ if list_observed_dom:
+ bodie['ip'] = list(set(list_observed_ip))
+
+ else:","def parse_email(msg, include_raw_body=False, include_attachment_data=False):
+ if list_observed_dom:
+ bodie['domain'] = list(set(list_observed_dom))
+
+ if list_observed_ip:
+ bodie['ip'] = list(set(list_observed_ip))
+
+ else:"
+267,https://:@github.com/noripyt/wagtail-react-streamfield.git,fcd366318ffd0f20f93efcc58e00658f1334899c,"@@ -75,4 +75,4 @@ class NewListBlock(ListBlock):
+ _('The maximum number of items is %d') % self.meta.max_num
+ )
+
+- return value
++ return result
+",wagtail_react_streamfield/blocks/list_block.py,"ReplaceText(target='result' @(78,15)->(78,20))","class NewListBlock(ListBlock):
+ _('The maximum number of items is %d') % self.meta.max_num
+ )
+
+ return value","class NewListBlock(ListBlock):
+ _('The maximum number of items is %d') % self.meta.max_num
+ )
+
+ return result"
+268,https://:@github.com/noripyt/wagtail-react-streamfield.git,4a33dab16bc9665349e6aaa011df3a47eea25277,"@@ -43,7 +43,7 @@ class NewBlock(Block):
+ else errors.as_data()[0].params.get(NON_FIELD_ERRORS, ()))
+ else:
+ non_block_errors = errors
+- if help_text and non_block_errors:
++ if help_text or non_block_errors:
+ return render_to_string(
+ 'wagtailadmin/block_forms/blocks_container.html',
+ {
+",wagtail_react_streamfield/blocks/block.py,"ReplaceText(target='or' @(46,21)->(46,24))","class NewBlock(Block):
+ else errors.as_data()[0].params.get(NON_FIELD_ERRORS, ()))
+ else:
+ non_block_errors = errors
+ if help_text and non_block_errors:
+ return render_to_string(
+ 'wagtailadmin/block_forms/blocks_container.html',
+ {","class NewBlock(Block):
+ else errors.as_data()[0].params.get(NON_FIELD_ERRORS, ()))
+ else:
+ non_block_errors = errors
+ if help_text or non_block_errors:
+ return render_to_string(
+ 'wagtailadmin/block_forms/blocks_container.html',
+ {"
+269,https://:@github.com/PMBio/MOFA.git,f7cd442f209ce679001b67e2ed439016bdef6991,"@@ -82,7 +82,7 @@ class initModel(object):
+
+ elif qmean == ""pca"": # Latent variables are initialised from PCA in the concatenated matrix
+ pca = sklearn.decomposition.PCA(n_components=self.K, copy=True, whiten=True)
+- pca.fit(s.concatenate(self.data,axis=0).T)
++ pca.fit(s.concatenate(self.data,axis=1).T)
+ qmean = pca.components_.T
+
+ elif isinstance(qmean,s.ndarray):
+",mofa/core/init_nodes.py,"ReplaceText(target='1' @(85,57)->(85,58))","class initModel(object):
+
+ elif qmean == ""pca"": # Latent variables are initialised from PCA in the concatenated matrix
+ pca = sklearn.decomposition.PCA(n_components=self.K, copy=True, whiten=True)
+ pca.fit(s.concatenate(self.data,axis=0).T)
+ qmean = pca.components_.T
+
+ elif isinstance(qmean,s.ndarray):","class initModel(object):
+
+ elif qmean == ""pca"": # Latent variables are initialised from PCA in the concatenated matrix
+ pca = sklearn.decomposition.PCA(n_components=self.K, copy=True, whiten=True)
+ pca.fit(s.concatenate(self.data,axis=1).T)
+ qmean = pca.components_.T
+
+ elif isinstance(qmean,s.ndarray):"
+270,https://:@github.com/twisted/tubes.git,836d6021f14ad923bb595dffb0a6ca39f0b884b5,"@@ -168,7 +168,7 @@ class _SiphonFount(_SiphonPiece):
+ def _actuallyPause():
+ fount = self._siphon._tdrain.fount
+ self._siphon._pending.suspend()
+- if fount is None:
++ if fount is not None:
+ pbpc = fount.pauseFlow()
+ else:
+ pbpc = NoPause()
+",tubes/_siphon.py,"ReplaceText(target=' is not ' @(171,20)->(171,24))","class _SiphonFount(_SiphonPiece):
+ def _actuallyPause():
+ fount = self._siphon._tdrain.fount
+ self._siphon._pending.suspend()
+ if fount is None:
+ pbpc = fount.pauseFlow()
+ else:
+ pbpc = NoPause()","class _SiphonFount(_SiphonPiece):
+ def _actuallyPause():
+ fount = self._siphon._tdrain.fount
+ self._siphon._pending.suspend()
+ if fount is not None:
+ pbpc = fount.pauseFlow()
+ else:
+ pbpc = NoPause()"
+271,https://:@github.com/deschler/django-modeltranslation.git,656dca3e4031d8f030a0aae833fc43c0c09cb51c,"@@ -57,7 +57,7 @@ class TranslationBaseModelAdmin(BaseModelAdmin):
+ else:
+ orig_formfield = self.formfield_for_dbfield(orig_field, **kwargs)
+ field.widget = deepcopy(orig_formfield.widget)
+- if orig_field.null and isinstance(field.widget, (forms.TextInput, forms.Textarea)):
++ if db_field.null and isinstance(field.widget, (forms.TextInput, forms.Textarea)):
+ field.widget = ClearableWidgetWrapper(field.widget)
+ css_classes = field.widget.attrs.get('class', '').split(' ')
+ css_classes.append('mt')
+",modeltranslation/admin.py,"ReplaceText(target='db_field' @(60,15)->(60,25))","class TranslationBaseModelAdmin(BaseModelAdmin):
+ else:
+ orig_formfield = self.formfield_for_dbfield(orig_field, **kwargs)
+ field.widget = deepcopy(orig_formfield.widget)
+ if orig_field.null and isinstance(field.widget, (forms.TextInput, forms.Textarea)):
+ field.widget = ClearableWidgetWrapper(field.widget)
+ css_classes = field.widget.attrs.get('class', '').split(' ')
+ css_classes.append('mt')","class TranslationBaseModelAdmin(BaseModelAdmin):
+ else:
+ orig_formfield = self.formfield_for_dbfield(orig_field, **kwargs)
+ field.widget = deepcopy(orig_formfield.widget)
+ if db_field.null and isinstance(field.widget, (forms.TextInput, forms.Textarea)):
+ field.widget = ClearableWidgetWrapper(field.widget)
+ css_classes = field.widget.attrs.get('class', '').split(' ')
+ css_classes.append('mt')"
+272,https://:@github.com/xcgspring/AXUI.git,82f7d6f7f2565d28553fda3c12bb1a2aafb5bab9,"@@ -123,7 +123,7 @@ class AppMap(object):
+ UI_element_group.stop_func = self.get_func_by_name(xml_element.attrib[""stop_func""])
+ if xml_element.attrib.has_key(""identifier""):
+ UI_element_group.identifier_string = xml_element.attrib[""identifier""]
+- UI_element_group.identifier = identifier_parser.parse(UI_element.identifier_string, lexer=identifier_lexer)
++ UI_element_group.identifier = identifier_parser.parse(UI_element_group.identifier_string, lexer=identifier_lexer)
+
+ return UI_element_group
+
+",AXUI/XML/app_map.py,"ReplaceText(target='UI_element_group' @(126,70)->(126,80))","class AppMap(object):
+ UI_element_group.stop_func = self.get_func_by_name(xml_element.attrib[""stop_func""])
+ if xml_element.attrib.has_key(""identifier""):
+ UI_element_group.identifier_string = xml_element.attrib[""identifier""]
+ UI_element_group.identifier = identifier_parser.parse(UI_element.identifier_string, lexer=identifier_lexer)
+
+ return UI_element_group
+ ","class AppMap(object):
+ UI_element_group.stop_func = self.get_func_by_name(xml_element.attrib[""stop_func""])
+ if xml_element.attrib.has_key(""identifier""):
+ UI_element_group.identifier_string = xml_element.attrib[""identifier""]
+ UI_element_group.identifier = identifier_parser.parse(UI_element_group.identifier_string, lexer=identifier_lexer)
+
+ return UI_element_group
+ "
+273,https://:@github.com/docker/compose.git,0e19c92e82c75f821c231367b5cda88eefdf1427,"@@ -577,7 +577,7 @@ class VolumeConfigTest(unittest.TestCase):
+
+ def test_volume_path_with_non_ascii_directory(self):
+ volume = u'/Füü/data:/data'
+- container_path = config.resolve_volume_path(volume, ""."", ""test"")
++ container_path = config.resolve_volume_path(""."", volume, ""test"")
+ self.assertEqual(container_path, volume)
+
+
+",tests/unit/config/config_test.py,"ArgSwap(idxs=0<->1 @(580,25)->(580,51))","class VolumeConfigTest(unittest.TestCase):
+
+ def test_volume_path_with_non_ascii_directory(self):
+ volume = u'/Füü/data:/data'
+ container_path = config.resolve_volume_path(volume, ""."", ""test"")
+ self.assertEqual(container_path, volume)
+
+ ","class VolumeConfigTest(unittest.TestCase):
+
+ def test_volume_path_with_non_ascii_directory(self):
+ volume = u'/Füü/data:/data'
+ container_path = config.resolve_volume_path(""."", volume, ""test"")
+ self.assertEqual(container_path, volume)
+
+ "
+274,https://:@github.com/docker/compose.git,c4f59e731d540780a767d105bcb8d7d164ba4cd5,"@@ -577,7 +577,7 @@ class VolumeConfigTest(unittest.TestCase):
+
+ def test_volume_path_with_non_ascii_directory(self):
+ volume = u'/Füü/data:/data'
+- container_path = config.resolve_volume_path(volume, ""."", ""test"")
++ container_path = config.resolve_volume_path(""."", volume, ""test"")
+ self.assertEqual(container_path, volume)
+
+
+",tests/unit/config/config_test.py,"ArgSwap(idxs=0<->1 @(580,25)->(580,51))","class VolumeConfigTest(unittest.TestCase):
+
+ def test_volume_path_with_non_ascii_directory(self):
+ volume = u'/Füü/data:/data'
+ container_path = config.resolve_volume_path(volume, ""."", ""test"")
+ self.assertEqual(container_path, volume)
+
+ ","class VolumeConfigTest(unittest.TestCase):
+
+ def test_volume_path_with_non_ascii_directory(self):
+ volume = u'/Füü/data:/data'
+ container_path = config.resolve_volume_path(""."", volume, ""test"")
+ self.assertEqual(container_path, volume)
+
+ "
+275,https://:@github.com/ranaroussi/qtpylib.git,e5eac01b67e908823c80b1bdeac57dcb68dbb164,"@@ -65,7 +65,7 @@ def _gen_symbol_group(sym):
+
+ def _gen_asset_class(sym):
+ sym_class = str(sym).split(""_"")
+- if len(sym_class) > 0:
++ if len(sym_class) > 1:
+ return sym_class[1]
+ return ""STK""
+
+",qtpylib/blotter.py,"ReplaceText(target='1' @(68,24)->(68,25))","def _gen_symbol_group(sym):
+
+ def _gen_asset_class(sym):
+ sym_class = str(sym).split(""_"")
+ if len(sym_class) > 0:
+ return sym_class[1]
+ return ""STK""
+ ","def _gen_symbol_group(sym):
+
+ def _gen_asset_class(sym):
+ sym_class = str(sym).split(""_"")
+ if len(sym_class) > 1:
+ return sym_class[1]
+ return ""STK""
+ "
+276,https://:@github.com/lmjohns3/theanets.git,507eac0d7fe007cdc93d89ca6cb0db9521908eac,"@@ -253,7 +253,7 @@ class Network(object):
+ h = self.hiddens[-1]
+ a, b = self.weights[i].get_value(borrow=True).shape
+ logging.info('tied weights from layer %d: %s x %s', i, b, a)
+- o = theano.shared(np.zeros((b, ), FLOAT), name='b_out{}'.format(i))
++ o = theano.shared(np.zeros((a, ), FLOAT), name='b_out{}'.format(i))
+ self.preacts.append(TT.dot(h, self.weights[i].T) + o)
+ func = self._output_func if i == 0 else self._hidden_func
+ self.hiddens.append(func(self.preacts[-1]))
+",theanets/feedforward.py,"ReplaceText(target='a' @(256,44)->(256,45))","class Network(object):
+ h = self.hiddens[-1]
+ a, b = self.weights[i].get_value(borrow=True).shape
+ logging.info('tied weights from layer %d: %s x %s', i, b, a)
+ o = theano.shared(np.zeros((b, ), FLOAT), name='b_out{}'.format(i))
+ self.preacts.append(TT.dot(h, self.weights[i].T) + o)
+ func = self._output_func if i == 0 else self._hidden_func
+ self.hiddens.append(func(self.preacts[-1]))","class Network(object):
+ h = self.hiddens[-1]
+ a, b = self.weights[i].get_value(borrow=True).shape
+ logging.info('tied weights from layer %d: %s x %s', i, b, a)
+ o = theano.shared(np.zeros((a, ), FLOAT), name='b_out{}'.format(i))
+ self.preacts.append(TT.dot(h, self.weights[i].T) + o)
+ func = self._output_func if i == 0 else self._hidden_func
+ self.hiddens.append(func(self.preacts[-1]))"
+277,https://:@github.com/lmjohns3/theanets.git,62f7125e1b179df846fdcd5d213c8bca18595648,"@@ -83,7 +83,7 @@ class SequenceDataset:
+ slices = [slice(None), slice(None)]
+ self.batches = []
+ i = 0
+- while i + size < shape[axis]:
++ while i + size <= shape[axis]:
+ slices[axis] = slice(i, i + size)
+ self.batches.append([d[tuple(slices)] for d in data])
+ i += size
+",theanets/dataset.py,"ReplaceText(target='<=' @(86,27)->(86,28))","class SequenceDataset:
+ slices = [slice(None), slice(None)]
+ self.batches = []
+ i = 0
+ while i + size < shape[axis]:
+ slices[axis] = slice(i, i + size)
+ self.batches.append([d[tuple(slices)] for d in data])
+ i += size","class SequenceDataset:
+ slices = [slice(None), slice(None)]
+ self.batches = []
+ i = 0
+ while i + size <= shape[axis]:
+ slices[axis] = slice(i, i + size)
+ self.batches.append([d[tuple(slices)] for d in data])
+ i += size"
+278,https://:@github.com/lmjohns3/theanets.git,8fa4792eaae89e4da7d041178fdcb341f5313914,"@@ -834,4 +834,4 @@ class Classifier(Network):
+ k : ndarray (num-examples, )
+ A vector of class index values, one per row of input data.
+ '''
+- return self.predict(x).argmax(axis=1)
++ return self.predict(x).argmax(axis=-1)
+",theanets/feedforward.py,"ReplaceText(target='-1' @(837,43)->(837,44))","class Classifier(Network):
+ k : ndarray (num-examples, )
+ A vector of class index values, one per row of input data.
+ '''
+ return self.predict(x).argmax(axis=1)","class Classifier(Network):
+ k : ndarray (num-examples, )
+ A vector of class index values, one per row of input data.
+ '''
+ return self.predict(x).argmax(axis=-1)"
+279,https://:@github.com/lmjohns3/theanets.git,114f37976b5c00330da9c5fed75ecf7b727eff58,"@@ -338,7 +338,7 @@ class Network(object):
+ if i == 0:
+ noise = kwargs.get('input_noise', 0)
+ dropout = kwargs.get('input_dropouts', 0)
+- elif i == len(self.layers) - 1:
++ elif i != len(self.layers) - 1:
+ noise = kwargs.get('hidden_noise', 0)
+ dropout = kwargs.get('hidden_dropouts', 0)
+ out, mon, upd = layer.connect(inputs, noise=noise, dropout=dropout)
+",theanets/graph.py,"ReplaceText(target='!=' @(341,23)->(341,25))","class Network(object):
+ if i == 0:
+ noise = kwargs.get('input_noise', 0)
+ dropout = kwargs.get('input_dropouts', 0)
+ elif i == len(self.layers) - 1:
+ noise = kwargs.get('hidden_noise', 0)
+ dropout = kwargs.get('hidden_dropouts', 0)
+ out, mon, upd = layer.connect(inputs, noise=noise, dropout=dropout)","class Network(object):
+ if i == 0:
+ noise = kwargs.get('input_noise', 0)
+ dropout = kwargs.get('input_dropouts', 0)
+ elif i != len(self.layers) - 1:
+ noise = kwargs.get('hidden_noise', 0)
+ dropout = kwargs.get('hidden_dropouts', 0)
+ out, mon, upd = layer.connect(inputs, noise=noise, dropout=dropout)"
+280,https://:@github.com/pyiron/pyiron_base.git,f9ea8a31ec8fe36704c4c8f73e127ee3e077ca3a,"@@ -98,7 +98,7 @@ class Vasprun(object):
+ d[""cells""] = np.array(d[""cells""])
+ d[""positions""] = np.array(d[""positions""])
+ # Check if the parsed coordinates are in absolute/relative coordinates. If absolute, convert to relative
+- if len(np.argwhere(d[""positions""].flatten() > 1).flatten()) / len(d[""positions""].flatten()) < 0.01:
++ if len(np.argwhere(d[""positions""].flatten() > 1).flatten()) / len(d[""positions""].flatten()) > 0.01:
+ pos_new = d[""positions""].copy()
+ for i, pos in enumerate(pos_new):
+ d[""positions""][i] = np.dot(pos, np.linalg.inv(d[""cells""][i]))
+",pyiron_vasp/vasprun.py,"ReplaceText(target='>' @(101,100)->(101,101))","class Vasprun(object):
+ d[""cells""] = np.array(d[""cells""])
+ d[""positions""] = np.array(d[""positions""])
+ # Check if the parsed coordinates are in absolute/relative coordinates. If absolute, convert to relative
+ if len(np.argwhere(d[""positions""].flatten() > 1).flatten()) / len(d[""positions""].flatten()) < 0.01:
+ pos_new = d[""positions""].copy()
+ for i, pos in enumerate(pos_new):
+ d[""positions""][i] = np.dot(pos, np.linalg.inv(d[""cells""][i]))","class Vasprun(object):
+ d[""cells""] = np.array(d[""cells""])
+ d[""positions""] = np.array(d[""positions""])
+ # Check if the parsed coordinates are in absolute/relative coordinates. If absolute, convert to relative
+ if len(np.argwhere(d[""positions""].flatten() > 1).flatten()) / len(d[""positions""].flatten()) > 0.01:
+ pos_new = d[""positions""].copy()
+ for i, pos in enumerate(pos_new):
+ d[""positions""][i] = np.dot(pos, np.linalg.inv(d[""cells""][i]))"
+281,https://:@github.com/pyiron/pyiron_base.git,5d9677db9fcbca5fce348a7208830467381cd643,"@@ -487,7 +487,7 @@ class ParallelMaster(GenericMaster):
+ job_lst.append(ham._process)
+ ham = next(self._job_generator, None)
+ if ham is None and self.server.run_mode.modal:
+- while ham is not None:
++ while ham is None:
+ time.sleep(10)
+ ham = next(self._job_generator, None)
+ else:
+",pyiron_base/objects/job/parallel.py,"ReplaceText(target=' is ' @(490,29)->(490,37))","class ParallelMaster(GenericMaster):
+ job_lst.append(ham._process)
+ ham = next(self._job_generator, None)
+ if ham is None and self.server.run_mode.modal:
+ while ham is not None:
+ time.sleep(10)
+ ham = next(self._job_generator, None)
+ else:","class ParallelMaster(GenericMaster):
+ job_lst.append(ham._process)
+ ham = next(self._job_generator, None)
+ if ham is None and self.server.run_mode.modal:
+ while ham is None:
+ time.sleep(10)
+ ham = next(self._job_generator, None)
+ else:"
+282,https://:@github.com/pyiron/pyiron_base.git,a4ed8375fa375ff740a8334f7ce5eb5bf9d7d4a2,"@@ -477,7 +477,7 @@ class Settings(with_metaclass(Singleton)):
+ else:
+ # SQLite is raising ugly error messages when the database directory does not exist.
+ if config[""sql_file""] is None:
+- if len(config[""resource_paths""]) > 1:
++ if len(config[""resource_paths""]) >= 1:
+ config[""sql_file""] = ""/"".join(
+ [config[""resource_paths""][0], ""pyiron.db""]
+ )
+",pyiron_base/settings/generic.py,"ReplaceText(target='>=' @(480,49)->(480,50))","class Settings(with_metaclass(Singleton)):
+ else:
+ # SQLite is raising ugly error messages when the database directory does not exist.
+ if config[""sql_file""] is None:
+ if len(config[""resource_paths""]) > 1:
+ config[""sql_file""] = ""/"".join(
+ [config[""resource_paths""][0], ""pyiron.db""]
+ )","class Settings(with_metaclass(Singleton)):
+ else:
+ # SQLite is raising ugly error messages when the database directory does not exist.
+ if config[""sql_file""] is None:
+ if len(config[""resource_paths""]) >= 1:
+ config[""sql_file""] = ""/"".join(
+ [config[""resource_paths""][0], ""pyiron.db""]
+ )"
+283,https://:@github.com/ESSolutions/django-mssql-backend.git,06578347a5e775088cfe3a2c2e9c528c5ffb7de0,"@@ -201,7 +201,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
+ # Only append DRIVER if DATABASE_ODBC_DSN hasn't been set
+ cstr_parts.append('DRIVER={%s}' % driver)
+ if ms_drivers.match(driver) or driver == 'FreeTDS' and \
+- conn_params.get('host_is_server', False):
++ options.get('host_is_server', False):
+ if port:
+ host += ';PORT=%s' % port
+ cstr_parts.append('SERVER=%s' % host)
+",sql_server/pyodbc/base.py,"ReplaceText(target='options' @(204,16)->(204,27))","class DatabaseWrapper(BaseDatabaseWrapper):
+ # Only append DRIVER if DATABASE_ODBC_DSN hasn't been set
+ cstr_parts.append('DRIVER={%s}' % driver)
+ if ms_drivers.match(driver) or driver == 'FreeTDS' and \
+ conn_params.get('host_is_server', False):
+ if port:
+ host += ';PORT=%s' % port
+ cstr_parts.append('SERVER=%s' % host)","class DatabaseWrapper(BaseDatabaseWrapper):
+ # Only append DRIVER if DATABASE_ODBC_DSN hasn't been set
+ cstr_parts.append('DRIVER={%s}' % driver)
+ if ms_drivers.match(driver) or driver == 'FreeTDS' and \
+ options.get('host_is_server', False):
+ if port:
+ host += ';PORT=%s' % port
+ cstr_parts.append('SERVER=%s' % host)"
+284,https://:@github.com/bykof/billomapy.git,29dc1fcd8f491c158a713b07680ea1305748c959,"@@ -112,7 +112,7 @@ todo_include_todos = False
+ # a list of builtin themes.
+ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+-if not on_rtd: # only import and set the theme if we're building docs locally
++if on_rtd: # only import and set the theme if we're building docs locally
+ import sphinx_rtd_theme
+ html_theme = 'sphinx_rtd_theme'
+ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+",docs/source/conf.py,"ReplaceText(target='' @(115,3)->(115,7))","todo_include_todos = False
+ # a list of builtin themes.
+ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+ if not on_rtd: # only import and set the theme if we're building docs locally
+ import sphinx_rtd_theme
+ html_theme = 'sphinx_rtd_theme'
+ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]","todo_include_todos = False
+ # a list of builtin themes.
+ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+ if on_rtd: # only import and set the theme if we're building docs locally
+ import sphinx_rtd_theme
+ html_theme = 'sphinx_rtd_theme'
+ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]"
+285,https://:@github.com/quva-lab/artemis.git,26ae4a7049b0f6ac2aef7daf4c2a5184748be516,"@@ -76,7 +76,7 @@ def get_new_positions(fixed_positions, layout, n_plots):
+ positions.append(fixed_positions[i])
+ else:
+ while True:
+- row, col = ix/n_cols, ix%n_cols
++ row, col = ix//n_cols, ix%n_cols
+ if (row, col) not in taken_positions:
+ positions.append((row, col))
+ taken_positions.add((row, col))
+",artemis/plotting/expanding_subplots.py,"ReplaceText(target='//' @(79,29)->(79,30))","def get_new_positions(fixed_positions, layout, n_plots):
+ positions.append(fixed_positions[i])
+ else:
+ while True:
+ row, col = ix/n_cols, ix%n_cols
+ if (row, col) not in taken_positions:
+ positions.append((row, col))
+ taken_positions.add((row, col))","def get_new_positions(fixed_positions, layout, n_plots):
+ positions.append(fixed_positions[i])
+ else:
+ while True:
+ row, col = ix//n_cols, ix%n_cols
+ if (row, col) not in taken_positions:
+ positions.append((row, col))
+ taken_positions.add((row, col))"
+286,https://:@github.com/OCR-D/core.git,e82299a48e4cf4677535819f81bb944ad4f64f8a,"@@ -312,7 +312,7 @@ def validate_consistency(node, page_textequiv_consistency, page_textequiv_strate
+ pass # already reported in recursive call above
+ elif not child_poly.within(node_poly.buffer(PARENT_SLACK)):
+ # TODO: automatic repair?
+- report.add_error(CoordinateConsistencyError(tag, child.id, file_id,
++ report.add_error(CoordinateConsistencyError(child_tag, child.id, file_id,
+ parent_points, child_points))
+ log.debug(""Inconsistent coords of %s %s"", child_tag, child.id)
+ consistent = False
+",ocrd_validators/ocrd_validators/page_validator.py,"ReplaceText(target='child_tag' @(315,64)->(315,67))","def validate_consistency(node, page_textequiv_consistency, page_textequiv_strate
+ pass # already reported in recursive call above
+ elif not child_poly.within(node_poly.buffer(PARENT_SLACK)):
+ # TODO: automatic repair?
+ report.add_error(CoordinateConsistencyError(tag, child.id, file_id,
+ parent_points, child_points))
+ log.debug(""Inconsistent coords of %s %s"", child_tag, child.id)
+ consistent = False","def validate_consistency(node, page_textequiv_consistency, page_textequiv_strate
+ pass # already reported in recursive call above
+ elif not child_poly.within(node_poly.buffer(PARENT_SLACK)):
+ # TODO: automatic repair?
+ report.add_error(CoordinateConsistencyError(child_tag, child.id, file_id,
+ parent_points, child_points))
+ log.debug(""Inconsistent coords of %s %s"", child_tag, child.id)
+ consistent = False"
+287,https://:@github.com/jhuapl-boss/heaviside.git,3adb4902a04dc3e1d9a325ab1752c4b2d856b677,"@@ -69,7 +69,7 @@ class ASTCompAndOr(ASTNode):
+ super(ASTCompAndOr, self).__init__(comp.token)
+ self.comps = [comp]
+ for c in comps:
+- self.comps.append(comp)
++ self.comps.append(c)
+
+ class ASTCompAnd(ASTCompAndOr):
+ op = 'And'
+",heaviside/ast.py,"ReplaceText(target='c' @(72,30)->(72,34))","class ASTCompAndOr(ASTNode):
+ super(ASTCompAndOr, self).__init__(comp.token)
+ self.comps = [comp]
+ for c in comps:
+ self.comps.append(comp)
+
+ class ASTCompAnd(ASTCompAndOr):
+ op = 'And'","class ASTCompAndOr(ASTNode):
+ super(ASTCompAndOr, self).__init__(comp.token)
+ self.comps = [comp]
+ for c in comps:
+ self.comps.append(c)
+
+ class ASTCompAnd(ASTCompAndOr):
+ op = 'And'"
+288,https://:@github.com/google-research/text-to-text-transfer-transformer.git,d2c010b48b702f22fb665d2e5723c7baaf4f6a1c,"@@ -98,7 +98,7 @@ def main(_):
+ "" "".join(str(i) for i in v) if FLAGS.tokenize
+ else v.decode(""utf-8""))
+ else:
+- v[k] = """"
++ key_to_string[k] = """"
+ return FLAGS.format_string.format(**key_to_string)
+
+ for shard_path in files:
+",t5/scripts/dump_task.py,"ReplaceText(target='key_to_string' @(101,8)->(101,9))","def main(_):
+ "" "".join(str(i) for i in v) if FLAGS.tokenize
+ else v.decode(""utf-8""))
+ else:
+ v[k] = """"
+ return FLAGS.format_string.format(**key_to_string)
+
+ for shard_path in files:","def main(_):
+ "" "".join(str(i) for i in v) if FLAGS.tokenize
+ else v.decode(""utf-8""))
+ else:
+ key_to_string[k] = """"
+ return FLAGS.format_string.format(**key_to_string)
+
+ for shard_path in files:"
+289,https://:@github.com/lvieirajr/mongorest.git,470f17173b63b14ab60bbc99db7ca3b3f93afdac,"@@ -401,4 +401,4 @@ class CoercionError(SchemaValidationError):
+
+ self['collection'] = collection
+ self['field'] = field
+- self['coercion_type'] = coercion_type
++ self['coercion_type'] = coercion_type_repr
+",mongorest/errors.py,"ReplaceText(target='coercion_type_repr' @(404,32)->(404,45))","class CoercionError(SchemaValidationError):
+
+ self['collection'] = collection
+ self['field'] = field
+ self['coercion_type'] = coercion_type","class CoercionError(SchemaValidationError):
+
+ self['collection'] = collection
+ self['field'] = field
+ self['coercion_type'] = coercion_type_repr"
+290,https://:@github.com/internetarchive/fatcat.git,89b729feac30a272b557542c5c4149d3611f869a,"@@ -295,7 +295,7 @@ def container_to_elasticsearch(entity):
+ t['in_sherpa_romeo'] = in_sherpa_romeo
+ t['is_oa'] = in_doaj or in_road or is_longtail_oa or is_oa
+ t['is_longtail_oa'] = is_longtail_oa
+- t['any_kbart'] = any_ia_sim
++ t['any_kbart'] = any_kbart
+ t['any_jstor'] = any_jstor
+ t['any_ia_sim'] = bool(any_ia_sim)
+ return t
+",python/fatcat_tools/transforms.py,"ReplaceText(target='any_kbart' @(298,21)->(298,31))","def container_to_elasticsearch(entity):
+ t['in_sherpa_romeo'] = in_sherpa_romeo
+ t['is_oa'] = in_doaj or in_road or is_longtail_oa or is_oa
+ t['is_longtail_oa'] = is_longtail_oa
+ t['any_kbart'] = any_ia_sim
+ t['any_jstor'] = any_jstor
+ t['any_ia_sim'] = bool(any_ia_sim)
+ return t","def container_to_elasticsearch(entity):
+ t['in_sherpa_romeo'] = in_sherpa_romeo
+ t['is_oa'] = in_doaj or in_road or is_longtail_oa or is_oa
+ t['is_longtail_oa'] = is_longtail_oa
+ t['any_kbart'] = any_kbart
+ t['any_jstor'] = any_jstor
+ t['any_ia_sim'] = bool(any_ia_sim)
+ return t"
+291,https://:@github.com/internetarchive/fatcat.git,11dfac5f8f9ced9b56cf277d0e3adeccc572b251,"@@ -57,7 +57,7 @@ class ArabesqueMatchImporter(EntityImporter):
+ eg_extra = kwargs.get('editgroup_extra', dict())
+ eg_extra['agent'] = eg_extra.get('agent', 'fatcat_tools.ArabesqueMatchImporter')
+ if kwargs.get('crawl_id'):
+- eg_extra['crawl_id'] = eg_extra.get('crawl_id')
++ eg_extra['crawl_id'] = kwargs.get('crawl_id')
+ super().__init__(api,
+ editgroup_description=eg_desc,
+ editgroup_extra=eg_extra,
+",python/fatcat_tools/importers/arabesque.py,"ReplaceText(target='kwargs' @(60,35)->(60,43))","class ArabesqueMatchImporter(EntityImporter):
+ eg_extra = kwargs.get('editgroup_extra', dict())
+ eg_extra['agent'] = eg_extra.get('agent', 'fatcat_tools.ArabesqueMatchImporter')
+ if kwargs.get('crawl_id'):
+ eg_extra['crawl_id'] = eg_extra.get('crawl_id')
+ super().__init__(api,
+ editgroup_description=eg_desc,
+ editgroup_extra=eg_extra,","class ArabesqueMatchImporter(EntityImporter):
+ eg_extra = kwargs.get('editgroup_extra', dict())
+ eg_extra['agent'] = eg_extra.get('agent', 'fatcat_tools.ArabesqueMatchImporter')
+ if kwargs.get('crawl_id'):
+ eg_extra['crawl_id'] = kwargs.get('crawl_id')
+ super().__init__(api,
+ editgroup_description=eg_desc,
+ editgroup_extra=eg_extra,"
+292,https://:@github.com/internetarchive/fatcat.git,7104e6dfb99717353e3819853ae61ac6387a02a1,"@@ -128,7 +128,7 @@ class EntityUpdatesWorker(FatcatWorker):
+ # update release when a file changes
+ # TODO: fetch old revision as well, and only update
+ # releases for which list changed
+- release_ids.extend(e['release_ids'])
++ release_ids.extend(file_entity['release_ids'])
+ file_dict = self.api.api_client.sanitize_for_serialization(file_entity)
+ file_producer.produce(
+ message=json.dumps(file_dict).encode('utf-8'),
+",python/fatcat_tools/workers/changelog.py,"ReplaceText(target='file_entity' @(131,35)->(131,36))","class EntityUpdatesWorker(FatcatWorker):
+ # update release when a file changes
+ # TODO: fetch old revision as well, and only update
+ # releases for which list changed
+ release_ids.extend(e['release_ids'])
+ file_dict = self.api.api_client.sanitize_for_serialization(file_entity)
+ file_producer.produce(
+ message=json.dumps(file_dict).encode('utf-8'),","class EntityUpdatesWorker(FatcatWorker):
+ # update release when a file changes
+ # TODO: fetch old revision as well, and only update
+ # releases for which list changed
+ release_ids.extend(file_entity['release_ids'])
+ file_dict = self.api.api_client.sanitize_for_serialization(file_entity)
+ file_producer.produce(
+ message=json.dumps(file_dict).encode('utf-8'),"
+293,https://:@github.com/internetarchive/fatcat.git,80b756d6feec3f66225287b9ca73c8b02d012027,"@@ -167,7 +167,7 @@ class IngestFileResultImporter(EntityImporter):
+ urls=urls,
+ )
+ if request.get('edit_extra'):
+- fe.edit_extra = fatcat['edit_extra']
++ fe.edit_extra = request['edit_extra']
+ else:
+ fe.edit_extra = dict()
+ if request.get('ingest_request_source'):
+",python/fatcat_tools/importers/ingest.py,"ReplaceText(target='request' @(170,28)->(170,34))","class IngestFileResultImporter(EntityImporter):
+ urls=urls,
+ )
+ if request.get('edit_extra'):
+ fe.edit_extra = fatcat['edit_extra']
+ else:
+ fe.edit_extra = dict()
+ if request.get('ingest_request_source'):","class IngestFileResultImporter(EntityImporter):
+ urls=urls,
+ )
+ if request.get('edit_extra'):
+ fe.edit_extra = request['edit_extra']
+ else:
+ fe.edit_extra = dict()
+ if request.get('ingest_request_source'):"
+294,https://:@github.com/pallets/flask-ext-migrate.git,ea6a0666e08ce176031456dced635ca3c92c1386,"@@ -43,7 +43,7 @@ def fix_from_imports(red):
+ modules = node.value
+
+ if (len(modules) < 2 or
+- modules[0].value != 'flask' and modules[1].value != 'ext'):
++ modules[0].value != 'flask' or modules[1].value != 'ext'):
+ continue
+
+ if len(modules) >= 3:
+",flask_ext_migrate/__init__.py,"ReplaceText(target='or' @(46,44)->(46,47))","def fix_from_imports(red):
+ modules = node.value
+
+ if (len(modules) < 2 or
+ modules[0].value != 'flask' and modules[1].value != 'ext'):
+ continue
+
+ if len(modules) >= 3:","def fix_from_imports(red):
+ modules = node.value
+
+ if (len(modules) < 2 or
+ modules[0].value != 'flask' or modules[1].value != 'ext'):
+ continue
+
+ if len(modules) >= 3:"
+295,https://:@github.com/SpockBotMC/SpockBot.git,6c8e63b97e3d9617ce0ca9bea9a677902b5ef2fb,"@@ -42,7 +42,7 @@ class SelectSocket:
+ else:
+ slist = [(self.sock,), (), (self.sock,)]
+ timeout = self.timer.get_timeout()
+- if timeout>0:
++ if timeout>=0:
+ slist.append(timeout)
+ try:
+ rlist, wlist, xlist = select.select(*slist)
+",spock/plugins/core/net.py,"ReplaceText(target='>=' @(45,12)->(45,13))","class SelectSocket:
+ else:
+ slist = [(self.sock,), (), (self.sock,)]
+ timeout = self.timer.get_timeout()
+ if timeout>0:
+ slist.append(timeout)
+ try:
+ rlist, wlist, xlist = select.select(*slist)","class SelectSocket:
+ else:
+ slist = [(self.sock,), (), (self.sock,)]
+ timeout = self.timer.get_timeout()
+ if timeout>=0:
+ slist.append(timeout)
+ try:
+ rlist, wlist, xlist = select.select(*slist)"
+296,https://:@github.com/SpockBotMC/SpockBot.git,bebe1187dd6432ec3b4b6dddb8246baef83c2203,"@@ -15,7 +15,7 @@ class PloaderFetch:
+ @pl_announce('PloaderFetch')
+ class SettingsPlugin:
+ def __init__(self, ploader, kwargs):
+- settings = get_settings(kwargs, kwargs.get('settings', {}))
++ settings = get_settings(kwargs.get('settings', {}), kwargs)
+ plugin_list = settings.get('plugins', DefaultPlugins)
+ plugins = []
+ plugin_settings = {}
+",spock/plugins/core/settings.py,"ArgSwap(idxs=0<->1 @(18,13)->(18,25))","class PloaderFetch:
+ @pl_announce('PloaderFetch')
+ class SettingsPlugin:
+ def __init__(self, ploader, kwargs):
+ settings = get_settings(kwargs, kwargs.get('settings', {}))
+ plugin_list = settings.get('plugins', DefaultPlugins)
+ plugins = []
+ plugin_settings = {}","class PloaderFetch:
+ @pl_announce('PloaderFetch')
+ class SettingsPlugin:
+ def __init__(self, ploader, kwargs):
+ settings = get_settings(kwargs.get('settings', {}), kwargs)
+ plugin_list = settings.get('plugins', DefaultPlugins)
+ plugins = []
+ plugin_settings = {}"
+297,https://:@github.com/SpockBotMC/SpockBot.git,bebe1187dd6432ec3b4b6dddb8246baef83c2203,"@@ -19,7 +19,7 @@ default_settings = {
+
+ class StartPlugin:
+ def __init__(self, ploader, settings):
+- self.settings = utils.get_settings(settings, default_settings)
++ self.settings = utils.get_settings(default_settings, settings)
+ self.event = ploader.requires('Event')
+ self.net = ploader.requires('Net')
+ self.auth = ploader.requires('Auth')
+",spock/plugins/helpers/start.py,"ArgSwap(idxs=0<->1 @(22,18)->(22,36))","default_settings = {
+
+ class StartPlugin:
+ def __init__(self, ploader, settings):
+ self.settings = utils.get_settings(settings, default_settings)
+ self.event = ploader.requires('Event')
+ self.net = ploader.requires('Net')
+ self.auth = ploader.requires('Auth')","default_settings = {
+
+ class StartPlugin:
+ def __init__(self, ploader, settings):
+ self.settings = utils.get_settings(default_settings, settings)
+ self.event = ploader.requires('Event')
+ self.net = ploader.requires('Net')
+ self.auth = ploader.requires('Auth')"
+298,https://:@github.com/hungpham2511/toppra.git,fefd8430ad55fb09414a1d4c6d8be41e81977842,"@@ -19,7 +19,7 @@ def _find_left_index(ss_waypoints, s):
+ for i in range(1, len(ss_waypoints)):
+ if ss_waypoints[i - 1] <= s and s < ss_waypoints[i]:
+ return i - 1
+- return len(ss_waypoints) - 1
++ return len(ss_waypoints) - 2
+
+
+ class Interpolator(object):
+",toppra/interpolator.py,"ReplaceText(target='2' @(22,31)->(22,32))","def _find_left_index(ss_waypoints, s):
+ for i in range(1, len(ss_waypoints)):
+ if ss_waypoints[i - 1] <= s and s < ss_waypoints[i]:
+ return i - 1
+ return len(ss_waypoints) - 1
+
+
+ class Interpolator(object):","def _find_left_index(ss_waypoints, s):
+ for i in range(1, len(ss_waypoints)):
+ if ss_waypoints[i - 1] <= s and s < ss_waypoints[i]:
+ return i - 1
+ return len(ss_waypoints) - 2
+
+
+ class Interpolator(object):"
+299,https://:@github.com/cmrivers/epipy.git,c541e6f7f559c92279623aa3c2cb7f644247280e,"@@ -34,7 +34,7 @@ def generate_example_data(cluster_size, outbreak_len, clusters, gen_time, attrib
+ for i in range(clusters):
+ cluster_letter = np.random.choice([i for i in string.ascii_uppercase if i not in used])[0]
+ cluster_name = 'Cluster' + cluster_letter
+- used.append(cluster_name)
++ used.append(cluster_letter)
+
+ ix_rng = pd.date_range('1/1/2014', periods=outbreak_len, freq='D')
+ ix_date = np.random.choice(ix_rng, size=1)
+",epipy/data_generator.py,"ReplaceText(target='cluster_letter' @(37,20)->(37,32))","def generate_example_data(cluster_size, outbreak_len, clusters, gen_time, attrib
+ for i in range(clusters):
+ cluster_letter = np.random.choice([i for i in string.ascii_uppercase if i not in used])[0]
+ cluster_name = 'Cluster' + cluster_letter
+ used.append(cluster_name)
+
+ ix_rng = pd.date_range('1/1/2014', periods=outbreak_len, freq='D')
+ ix_date = np.random.choice(ix_rng, size=1)","def generate_example_data(cluster_size, outbreak_len, clusters, gen_time, attrib
+ for i in range(clusters):
+ cluster_letter = np.random.choice([i for i in string.ascii_uppercase if i not in used])[0]
+ cluster_name = 'Cluster' + cluster_letter
+ used.append(cluster_letter)
+
+ ix_rng = pd.date_range('1/1/2014', periods=outbreak_len, freq='D')
+ ix_date = np.random.choice(ix_rng, size=1)"
+300,https://:@github.com/parmed/ParmEd.git,9eda010f0342ace7a3ccc6452a8c8014c73bd130,"@@ -282,7 +282,7 @@ class AmberFormat(object):
+ rawdata = self.parm_data[flag]
+ self.parm_data[flag] = []
+ for line in rawdata:
+- self.parm_data[flag].extend(self.formats[key].read(line))
++ self.parm_data[flag].extend(self.formats[flag].read(line))
+
+ try:
+ for i, chg in enumerate(self.parm_data[self.charge_flag]):
+",chemistry/amber/amberformat.py,"ReplaceText(target='flag' @(285,61)->(285,64))","class AmberFormat(object):
+ rawdata = self.parm_data[flag]
+ self.parm_data[flag] = []
+ for line in rawdata:
+ self.parm_data[flag].extend(self.formats[key].read(line))
+
+ try:
+ for i, chg in enumerate(self.parm_data[self.charge_flag]):","class AmberFormat(object):
+ rawdata = self.parm_data[flag]
+ self.parm_data[flag] = []
+ for line in rawdata:
+ self.parm_data[flag].extend(self.formats[flag].read(line))
+
+ try:
+ for i, chg in enumerate(self.parm_data[self.charge_flag]):"
+301,https://:@github.com/parmed/ParmEd.git,9167bf221e4fe5d71ccaa6bf310fce60f09dc873,"@@ -192,7 +192,7 @@ def diff_files(file1, file2, ignore_whitespace=True,
+ i = 1
+ same = True
+ if ignore_whitespace:
+- while l1 and l2:
++ while l1 or l2:
+ if l1.strip() != l2.strip():
+ if l1.startswith('%VERSION') and l2.startswith('%VERSION'):
+ l1 = f1.readline()
+",test/utils.py,"ReplaceText(target='or' @(195,21)->(195,24))","def diff_files(file1, file2, ignore_whitespace=True,
+ i = 1
+ same = True
+ if ignore_whitespace:
+ while l1 and l2:
+ if l1.strip() != l2.strip():
+ if l1.startswith('%VERSION') and l2.startswith('%VERSION'):
+ l1 = f1.readline()","def diff_files(file1, file2, ignore_whitespace=True,
+ i = 1
+ same = True
+ if ignore_whitespace:
+ while l1 or l2:
+ if l1.strip() != l2.strip():
+ if l1.startswith('%VERSION') and l2.startswith('%VERSION'):
+ l1 = f1.readline()"
+302,https://:@github.com/parmed/ParmEd.git,b5fdf3d9b7095b96bcb8ac0bdbdfb3694d1d5220,"@@ -334,7 +334,7 @@ class ChamberParm(AmberParm):
+ for i, j, k, l, m, n in zip(it, it, it, it, it, it):
+ self.cmaps.append(
+ Cmap(self.atoms[i-1], self.atoms[j-1], self.atoms[k-1],
+- self.atoms[k-1], self.atoms[m-1], self.cmap_types[n-1])
++ self.atoms[l-1], self.atoms[m-1], self.cmap_types[n-1])
+ )
+
+ #===================================================
+",chemistry/amber/_chamberparm.py,"ReplaceText(target='l' @(337,36)->(337,37))","class ChamberParm(AmberParm):
+ for i, j, k, l, m, n in zip(it, it, it, it, it, it):
+ self.cmaps.append(
+ Cmap(self.atoms[i-1], self.atoms[j-1], self.atoms[k-1],
+ self.atoms[k-1], self.atoms[m-1], self.cmap_types[n-1])
+ )
+
+ #===================================================","class ChamberParm(AmberParm):
+ for i, j, k, l, m, n in zip(it, it, it, it, it, it):
+ self.cmaps.append(
+ Cmap(self.atoms[i-1], self.atoms[j-1], self.atoms[k-1],
+ self.atoms[l-1], self.atoms[m-1], self.cmap_types[n-1])
+ )
+
+ #==================================================="
+303,https://:@github.com/parmed/ParmEd.git,820a80ccad22ee881042f03b83a0f07b5f1b537d,"@@ -1272,7 +1272,7 @@ class Structure(object):
+ break
+ elif a2.residue is None:
+ break
+- elif a1.residue.name != a1.residue.name:
++ elif a1.residue.name != a2.residue.name:
+ break
+ if not a1.type and not a2.type:
+ if a1.name != a2.name: break
+",chemistry/structure.py,"ReplaceText(target='a2' @(1275,48)->(1275,50))","class Structure(object):
+ break
+ elif a2.residue is None:
+ break
+ elif a1.residue.name != a1.residue.name:
+ break
+ if not a1.type and not a2.type:
+ if a1.name != a2.name: break","class Structure(object):
+ break
+ elif a2.residue is None:
+ break
+ elif a1.residue.name != a2.residue.name:
+ break
+ if not a1.type and not a2.type:
+ if a1.name != a2.name: break"
+304,https://:@github.com/parmed/ParmEd.git,4cba8197ae90a1af4abe0dee3f19e1c8c61c959f,"@@ -313,7 +313,7 @@ class Mol2File(object):
+ if a == '0': continue
+ for atom in res:
+ if atom.name == a:
+- atom.connections.append(atom)
++ res.connections.append(atom)
+ break
+ else:
+ raise Mol2Error('Residue connection atom %s not '
+",parmed/formats/mol2.py,"ReplaceText(target='res' @(316,32)->(316,36))","class Mol2File(object):
+ if a == '0': continue
+ for atom in res:
+ if atom.name == a:
+ atom.connections.append(atom)
+ break
+ else:
+ raise Mol2Error('Residue connection atom %s not '","class Mol2File(object):
+ if a == '0': continue
+ for atom in res:
+ if atom.name == a:
+ res.connections.append(atom)
+ break
+ else:
+ raise Mol2Error('Residue connection atom %s not '"
+305,https://:@github.com/parmed/ParmEd.git,9be43ac3521aca71f84de9b2b11740b00dfdb1b6,"@@ -696,6 +696,6 @@ def _set_owner(atoms, owner_array, atm, mol_id):
+ if not partner.marked:
+ owner_array.append(partner.idx)
+ _set_owner(atoms, owner_array, partner.idx, mol_id)
+- assert partner.marked != mol_id, 'Atom in multiple molecules!'
++ assert partner.marked == mol_id, 'Atom in multiple molecules!'
+
+ # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+",parmed/charmm/psf.py,"ReplaceText(target='==' @(699,30)->(699,32))","def _set_owner(atoms, owner_array, atm, mol_id):
+ if not partner.marked:
+ owner_array.append(partner.idx)
+ _set_owner(atoms, owner_array, partner.idx, mol_id)
+ assert partner.marked != mol_id, 'Atom in multiple molecules!'
+
+ # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++","def _set_owner(atoms, owner_array, atm, mol_id):
+ if not partner.marked:
+ owner_array.append(partner.idx)
+ _set_owner(atoms, owner_array, partner.idx, mol_id)
+ assert partner.marked == mol_id, 'Atom in multiple molecules!'
+
+ # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+306,https://:@github.com/parmed/ParmEd.git,8f1dc98d485ea57e4046494ad1e6f84cfbd17f4f,"@@ -449,7 +449,7 @@ class ParameterSet(object):
+ for name, residue in iteritems(self.residues):
+ if isinstance(residue, ResidueTemplateContainer):
+ for res in residue:
+- for atom in residue:
++ for atom in res:
+ atom.atom_type = self.atom_types[atom.type]
+ else:
+ assert isinstance(residue, ResidueTemplate), 'Wrong type!'
+",parmed/parameters.py,"ReplaceText(target='res' @(452,32)->(452,39))","class ParameterSet(object):
+ for name, residue in iteritems(self.residues):
+ if isinstance(residue, ResidueTemplateContainer):
+ for res in residue:
+ for atom in residue:
+ atom.atom_type = self.atom_types[atom.type]
+ else:
+ assert isinstance(residue, ResidueTemplate), 'Wrong type!'","class ParameterSet(object):
+ for name, residue in iteritems(self.residues):
+ if isinstance(residue, ResidueTemplateContainer):
+ for res in residue:
+ for atom in res:
+ atom.atom_type = self.atom_types[atom.type]
+ else:
+ assert isinstance(residue, ResidueTemplate), 'Wrong type!'"
+307,https://:@github.com/parmed/ParmEd.git,403c2874c1826cbe182386959a23118b33d1e27c,"@@ -219,7 +219,7 @@ class OpenMMParameterSet(ParameterSet):
+ if tag not in sub_content:
+ raise KeyError('Content of an attribute-containing element '
+ 'specified incorrectly.')
+- attributes = [key for key in content if key != tag]
++ attributes = [key for key in sub_content if key != tag]
+ element_content = sub_content[tag]
+ dest.write(' <%s' % tag)
+ for attribute in attributes:
+",parmed/openmm/parameters.py,"ReplaceText(target='sub_content' @(222,49)->(222,56))","class OpenMMParameterSet(ParameterSet):
+ if tag not in sub_content:
+ raise KeyError('Content of an attribute-containing element '
+ 'specified incorrectly.')
+ attributes = [key for key in content if key != tag]
+ element_content = sub_content[tag]
+ dest.write(' <%s' % tag)
+ for attribute in attributes:","class OpenMMParameterSet(ParameterSet):
+ if tag not in sub_content:
+ raise KeyError('Content of an attribute-containing element '
+ 'specified incorrectly.')
+ attributes = [key for key in sub_content if key != tag]
+ element_content = sub_content[tag]
+ dest.write(' <%s' % tag)
+ for attribute in attributes:"
+308,https://:@github.com/parmed/ParmEd.git,657ba99e2338df75ef118155d95d144c7b33ab32,"@@ -281,7 +281,7 @@ T = RNAResidue('Thymine', 'T', ['THY', 'T3', 'T5', 'TN',
+
+ WATER_NAMES = set(['WAT', 'HOH', 'TIP3', 'TIP4',
+ 'TIP5', 'SPCE', 'SPC'])
+-SOLVENT_NAMES = WATER_NAMES ^ set({'SOL'})
++SOLVENT_NAMES = WATER_NAMES | set({'SOL'})
+ EXTRA_POINT_NAMES = set(['EP', 'LP'])
+ CATION_NAMES = set(['Na+', 'Li+', 'Mg+', 'Rb+', 'MG', 'Cs+', 'POT', 'SOD',
+ 'MG2', 'CAL', 'RUB', 'LIT', 'ZN2', 'CD2', 'NA', 'K+', 'K',
+",parmed/residue.py,"ReplaceText(target='|' @(284,28)->(284,29))","T = RNAResidue('Thymine', 'T', ['THY', 'T3', 'T5', 'TN',
+
+ WATER_NAMES = set(['WAT', 'HOH', 'TIP3', 'TIP4',
+ 'TIP5', 'SPCE', 'SPC'])
+ SOLVENT_NAMES = WATER_NAMES ^ set({'SOL'})
+ EXTRA_POINT_NAMES = set(['EP', 'LP'])
+ CATION_NAMES = set(['Na+', 'Li+', 'Mg+', 'Rb+', 'MG', 'Cs+', 'POT', 'SOD',
+ 'MG2', 'CAL', 'RUB', 'LIT', 'ZN2', 'CD2', 'NA', 'K+', 'K',","T = RNAResidue('Thymine', 'T', ['THY', 'T3', 'T5', 'TN',
+
+ WATER_NAMES = set(['WAT', 'HOH', 'TIP3', 'TIP4',
+ 'TIP5', 'SPCE', 'SPC'])
+ SOLVENT_NAMES = WATER_NAMES | set({'SOL'})
+ EXTRA_POINT_NAMES = set(['EP', 'LP'])
+ CATION_NAMES = set(['Na+', 'Li+', 'Mg+', 'Rb+', 'MG', 'Cs+', 'POT', 'SOD',
+ 'MG2', 'CAL', 'RUB', 'LIT', 'ZN2', 'CD2', 'NA', 'K+', 'K',"
+309,https://:@github.com/parmed/ParmEd.git,bd2a1120adf53ab364dda802a272c19c7d335fdd,"@@ -374,7 +374,7 @@ class OpenMMParameterSet(ParameterSet):
+ for attribute in attributes:
+ dest.write(' %s=""%s""' % (attribute, sub_content[attribute]))
+ escaped_element_content = escape(element_content, XML_ESCAPES)
+- dest.write('>%s%s>\n' % (element_content, tag))
++ dest.write('>%s%s>\n' % (escaped_element_content, tag))
+ else:
+ raise TypeError('Incorrect type of the %s element content' % tag)
+ dest.write(' \n')
+",parmed/openmm/parameters.py,"ReplaceText(target='escaped_element_content' @(377,47)->(377,62))","class OpenMMParameterSet(ParameterSet):
+ for attribute in attributes:
+ dest.write(' %s=""%s""' % (attribute, sub_content[attribute]))
+ escaped_element_content = escape(element_content, XML_ESCAPES)
+ dest.write('>%s%s>\n' % (element_content, tag))
+ else:
+ raise TypeError('Incorrect type of the %s element content' % tag)
+ dest.write(' \n')","class OpenMMParameterSet(ParameterSet):
+ for attribute in attributes:
+ dest.write(' %s=""%s""' % (attribute, sub_content[attribute]))
+ escaped_element_content = escape(element_content, XML_ESCAPES)
+ dest.write('>%s%s>\n' % (escaped_element_content, tag))
+ else:
+ raise TypeError('Incorrect type of the %s element content' % tag)
+ dest.write(' \n')"
+310,https://:@github.com/parmed/ParmEd.git,62e0c8aa4561628d005e84bbe97b1ef37f32dee5,"@@ -502,7 +502,7 @@ class OpenMMParameterSet(ParameterSet):
+ patched_residue = residue.apply_patch(patch)
+
+ for atom in patch.atoms:
+- if atom.name not in patched_residue:
++ if atom.name not in residue:
+ dest.write(' \n' %
+ (atom.name, atom.type, atom.charge))
+ else:
+",parmed/openmm/parameters.py,"ReplaceText(target='residue' @(505,36)->(505,51))","class OpenMMParameterSet(ParameterSet):
+ patched_residue = residue.apply_patch(patch)
+
+ for atom in patch.atoms:
+ if atom.name not in patched_residue:
+ dest.write(' \n' %
+ (atom.name, atom.type, atom.charge))
+ else:","class OpenMMParameterSet(ParameterSet):
+ patched_residue = residue.apply_patch(patch)
+
+ for atom in patch.atoms:
+ if atom.name not in residue:
+ dest.write(' \n' %
+ (atom.name, atom.type, atom.charge))
+ else:"
+311,https://:@github.com/parmed/ParmEd.git,90fa4626c3db158047991044f4dd4619a7cc2599,"@@ -502,7 +502,7 @@ class AmberFormat(object):
+ own_handle = True
+ elif hasattr(fname, 'read'):
+ prm = fname
+- own_handle = True
++ own_handle = False
+ else:
+ raise TypeError('%s must be a file name or file-like object' % fname)
+
+",parmed/amber/amberformat.py,"ReplaceText(target='False' @(505,25)->(505,29))","class AmberFormat(object):
+ own_handle = True
+ elif hasattr(fname, 'read'):
+ prm = fname
+ own_handle = True
+ else:
+ raise TypeError('%s must be a file name or file-like object' % fname)
+ ","class AmberFormat(object):
+ own_handle = True
+ elif hasattr(fname, 'read'):
+ prm = fname
+ own_handle = False
+ else:
+ raise TypeError('%s must be a file name or file-like object' % fname)
+ "
+312,https://:@github.com/xmunoz/sodapy.git,76bdcfd9670e94c833b66b8894ea4153c27004ee,"@@ -71,7 +71,7 @@ class Socrata(object):
+ else:
+ self.uri_prefix = ""https://""
+
+- if isinstance(timeout, (int, long, float)):
++ if not isinstance(timeout, (int, long, float)):
+ raise TypeError(""Timeout must be numeric."")
+ self.timeout = timeout
+
+",sodapy/__init__.py,"ReplaceText(target='not ' @(74,11)->(74,11))","class Socrata(object):
+ else:
+ self.uri_prefix = ""https://""
+
+ if isinstance(timeout, (int, long, float)):
+ raise TypeError(""Timeout must be numeric."")
+ self.timeout = timeout
+ ","class Socrata(object):
+ else:
+ self.uri_prefix = ""https://""
+
+ if not isinstance(timeout, (int, long, float)):
+ raise TypeError(""Timeout must be numeric."")
+ self.timeout = timeout
+ "
+313,https://:@github.com/xmunoz/sodapy.git,be6804a7f566eda08af7bb5d67f9c75512581189,"@@ -129,7 +129,7 @@ class Socrata(object):
+ next(iter(kwargs)))
+
+ if order:
+- kwargs.append(('order', order))
++ params.append(('order', order))
+
+ results = self._perform_request(""get"", DATASETS_PATH,
+ params=params + [('offset', offset)])
+",sodapy/__init__.py,"ReplaceText(target='params' @(132,12)->(132,18))","class Socrata(object):
+ next(iter(kwargs)))
+
+ if order:
+ kwargs.append(('order', order))
+
+ results = self._perform_request(""get"", DATASETS_PATH,
+ params=params + [('offset', offset)])","class Socrata(object):
+ next(iter(kwargs)))
+
+ if order:
+ params.append(('order', order))
+
+ results = self._perform_request(""get"", DATASETS_PATH,
+ params=params + [('offset', offset)])"
+314,https://:@github.com/visgence/teleceptor.git,4a8db10b79207b4bf8b48bbcaafdd03cc1166a2f,"@@ -397,7 +397,7 @@ def _updateCalibration(sensor, coefficients, timestamp, session):
+ logging.debug(""Comparing coefficients."")
+
+ # check if coefficients are different
+- if ""{}"".format(Cal.coefficients) == ""{}"".format(coefficients):
++ if ""{}"".format(Cal.coefficients) != ""{}"".format(coefficients):
+ logging.debug(""Coefficients are different, updating..."")
+
+ assert isinstance(coefficients, list)
+",teleceptor/api/sensors.py,"ReplaceText(target='!=' @(400,49)->(400,51))","def _updateCalibration(sensor, coefficients, timestamp, session):
+ logging.debug(""Comparing coefficients."")
+
+ # check if coefficients are different
+ if ""{}"".format(Cal.coefficients) == ""{}"".format(coefficients):
+ logging.debug(""Coefficients are different, updating..."")
+
+ assert isinstance(coefficients, list)","def _updateCalibration(sensor, coefficients, timestamp, session):
+ logging.debug(""Comparing coefficients."")
+
+ # check if coefficients are different
+ if ""{}"".format(Cal.coefficients) != ""{}"".format(coefficients):
+ logging.debug(""Coefficients are different, updating..."")
+
+ assert isinstance(coefficients, list)"
+315,https://:@github.com/projectmesa/mesa.git,0893a8f03d7f22f1b064e66c97da3dddd987b7ea,"@@ -50,7 +50,7 @@ class Schelling(Model):
+ self.homophily = homophily
+
+ self.schedule = RandomActivation(self)
+- self.grid = SingleGrid(height, width, torus=True)
++ self.grid = SingleGrid(width, height, torus=True)
+
+ self.happy = 0
+ self.datacollector = DataCollector(
+",examples/schelling/model.py,"ArgSwap(idxs=0<->1 @(53,20)->(53,30))","class Schelling(Model):
+ self.homophily = homophily
+
+ self.schedule = RandomActivation(self)
+ self.grid = SingleGrid(height, width, torus=True)
+
+ self.happy = 0
+ self.datacollector = DataCollector(","class Schelling(Model):
+ self.homophily = homophily
+
+ self.schedule = RandomActivation(self)
+ self.grid = SingleGrid(width, height, torus=True)
+
+ self.happy = 0
+ self.datacollector = DataCollector("
+316,https://:@github.com/projectmesa/mesa.git,9277b0f55ed63d3b8a32c7f3e52e3df1e7de6579,"@@ -31,7 +31,7 @@ class PdGrid(Model):
+ Determines the agent activation regime.
+ payoffs: (optional) Dictionary of (move, neighbor_move) payoffs.
+ '''
+- self.grid = SingleGrid(height, width, torus=True)
++ self.grid = SingleGrid(width, height, torus=True)
+ self.schedule_type = schedule_type
+ self.schedule = self.schedule_types[self.schedule_type](self)
+
+",examples/pd_grid/pd_grid/model.py,"ArgSwap(idxs=0<->1 @(34,20)->(34,30))","class PdGrid(Model):
+ Determines the agent activation regime.
+ payoffs: (optional) Dictionary of (move, neighbor_move) payoffs.
+ '''
+ self.grid = SingleGrid(height, width, torus=True)
+ self.schedule_type = schedule_type
+ self.schedule = self.schedule_types[self.schedule_type](self)
+ ","class PdGrid(Model):
+ Determines the agent activation regime.
+ payoffs: (optional) Dictionary of (move, neighbor_move) payoffs.
+ '''
+ self.grid = SingleGrid(width, height, torus=True)
+ self.schedule_type = schedule_type
+ self.schedule = self.schedule_types[self.schedule_type](self)
+ "
+317,https://:@github.com/iCHEF/queryfilter.git,96c25a4e5e750ae3415712d6812eee04d2187e64,"@@ -70,7 +70,7 @@ class DictFilterMixin(object):
+ if not dictobj:
+ # Point to which level doesn't exist exactly
+ return handle_missing_field(
+- ""__"".join(level_field_names[:index+1])
++ ""__"".join(parent_field_names[:index+1])
+ )
+ if final_field_name not in dictobj:
+ return handle_missing_field(field_name)
+",queryfilter/base.py,"ReplaceText(target='parent_field_names' @(73,30)->(73,47))","class DictFilterMixin(object):
+ if not dictobj:
+ # Point to which level doesn't exist exactly
+ return handle_missing_field(
+ ""__"".join(level_field_names[:index+1])
+ )
+ if final_field_name not in dictobj:
+ return handle_missing_field(field_name)","class DictFilterMixin(object):
+ if not dictobj:
+ # Point to which level doesn't exist exactly
+ return handle_missing_field(
+ ""__"".join(parent_field_names[:index+1])
+ )
+ if final_field_name not in dictobj:
+ return handle_missing_field(field_name)"
+318,https://:@github.com/slaclab/paws.git,953037e723903e2213495189c9a99eb5445ecc9a,"@@ -293,7 +293,7 @@ class XRSDFitGUI(Operation):
+ ubnd = xrsdkit.param_bound_defaults[param_nm][1]
+ if xrsdkit.contains_param(self.inputs['param_bounds'],pop_nm,param_nm):
+ lbnd = self.inputs['param_bounds'][pop_nm]['parameters'][param_nm][0]
+- lbnd = self.inputs['param_bounds'][pop_nm]['parameters'][param_nm][1]
++ ubnd = self.inputs['param_bounds'][pop_nm]['parameters'][param_nm][1]
+ # TODO: the bounds entries need to be connected to DoubleVars.
+ pbnde1.insert(0,str(lbnd))
+ pbnde2.insert(0,str(ubnd))
+",paws/core/operations/PROCESSING/FITTING/XRSDFitGUI.py,"ReplaceText(target='ubnd' @(296,16)->(296,20))","class XRSDFitGUI(Operation):
+ ubnd = xrsdkit.param_bound_defaults[param_nm][1]
+ if xrsdkit.contains_param(self.inputs['param_bounds'],pop_nm,param_nm):
+ lbnd = self.inputs['param_bounds'][pop_nm]['parameters'][param_nm][0]
+ lbnd = self.inputs['param_bounds'][pop_nm]['parameters'][param_nm][1]
+ # TODO: the bounds entries need to be connected to DoubleVars.
+ pbnde1.insert(0,str(lbnd))
+ pbnde2.insert(0,str(ubnd))","class XRSDFitGUI(Operation):
+ ubnd = xrsdkit.param_bound_defaults[param_nm][1]
+ if xrsdkit.contains_param(self.inputs['param_bounds'],pop_nm,param_nm):
+ lbnd = self.inputs['param_bounds'][pop_nm]['parameters'][param_nm][0]
+ ubnd = self.inputs['param_bounds'][pop_nm]['parameters'][param_nm][1]
+ # TODO: the bounds entries need to be connected to DoubleVars.
+ pbnde1.insert(0,str(lbnd))
+ pbnde2.insert(0,str(ubnd))"
+319,https://:@github.com/PyFilesystem/pyfilesystem2.git,cd1a973dd80e4083502db51844981f3457d13760,"@@ -258,7 +258,7 @@ class OSFS(FS):
+ with convert_os_errors(""getinfo"", path):
+ _stat = os.stat(fsencode(sys_path))
+ if ""lstat"" in namespaces:
+- _stat = os.lstat(fsencode(sys_path))
++ _lstat = os.lstat(fsencode(sys_path))
+
+ info = {
+ ""basic"": {""name"": basename(_path), ""is_dir"": stat.S_ISDIR(_stat.st_mode)}
+",fs/osfs.py,"ReplaceText(target='_lstat' @(261,16)->(261,21))","class OSFS(FS):
+ with convert_os_errors(""getinfo"", path):
+ _stat = os.stat(fsencode(sys_path))
+ if ""lstat"" in namespaces:
+ _stat = os.lstat(fsencode(sys_path))
+
+ info = {
+ ""basic"": {""name"": basename(_path), ""is_dir"": stat.S_ISDIR(_stat.st_mode)}","class OSFS(FS):
+ with convert_os_errors(""getinfo"", path):
+ _stat = os.stat(fsencode(sys_path))
+ if ""lstat"" in namespaces:
+ _lstat = os.lstat(fsencode(sys_path))
+
+ info = {
+ ""basic"": {""name"": basename(_path), ""is_dir"": stat.S_ISDIR(_stat.st_mode)}"
+320,https://:@github.com/kevinzg/facebook-scraper.git,c11dffbc1beef25271fb5bc6d2aa3aeb5b2079aa,"@@ -83,7 +83,7 @@ def _get_posts(path, pages=10, timeout=5, sleep=0, credentials=None, extra_info=
+ yield post
+
+ pages -= 1
+- if pages == 0:
++ if pages <= 0:
+ return
+
+ cursor = _find_cursor(cursor_blob)
+",facebook_scraper.py,"ReplaceText(target='<=' @(86,17)->(86,19))","def _get_posts(path, pages=10, timeout=5, sleep=0, credentials=None, extra_info=
+ yield post
+
+ pages -= 1
+ if pages == 0:
+ return
+
+ cursor = _find_cursor(cursor_blob)","def _get_posts(path, pages=10, timeout=5, sleep=0, credentials=None, extra_info=
+ yield post
+
+ pages -= 1
+ if pages <= 0:
+ return
+
+ cursor = _find_cursor(cursor_blob)"
+321,https://:@github.com/linkedin/naarad.git,897858ba0d80fb74bbad40bfc8f96b0f59b0900e,"@@ -75,10 +75,10 @@ class Report(object):
+ for metric in self.metric_list:
+ metric_stats = []
+ metric_stats_file, summary_stats, metric_plots, correlated_plots = self.discover_metric_data(self.output_directory, metric)
+- if metric_stats_file != '' and len(metric_plots) > 0:
++ if metric_stats_file != '' or len(metric_plots) > 0:
+ metric_stats = self.get_summary_table(metric_stats_file)
+ metric_html = template_environment.get_template(self.report_templates['header']).render(custom_javascript_includes=[""http://www.kryogenix.org/code/browser/sorttable/sorttable.js""])
+ metric_html += template_environment.get_template(self.report_templates['metric']).render(metric_stats=metric_stats, metric_plots=metric_plots, correlated_plots=correlated_plots, metric=metric)
+ metric_html += template_environment.get_template(self.report_templates['footer']).render()
+- with open(os.path.join(self.output_directory, metric + '_report.html'),'w') as metric_report:
++ with open(os.path.join(self.output_directory, metric + '_report.html'), 'w') as metric_report:
+ metric_report.write(metric_html)
+",src/naarad/reporting/report.py,"ReplaceText(target='or' @(78,33)->(78,36))","class Report(object):
+ for metric in self.metric_list:
+ metric_stats = []
+ metric_stats_file, summary_stats, metric_plots, correlated_plots = self.discover_metric_data(self.output_directory, metric)
+ if metric_stats_file != '' and len(metric_plots) > 0:
+ metric_stats = self.get_summary_table(metric_stats_file)
+ metric_html = template_environment.get_template(self.report_templates['header']).render(custom_javascript_includes=[""http://www.kryogenix.org/code/browser/sorttable/sorttable.js""])
+ metric_html += template_environment.get_template(self.report_templates['metric']).render(metric_stats=metric_stats, metric_plots=metric_plots, correlated_plots=correlated_plots, metric=metric)
+ metric_html += template_environment.get_template(self.report_templates['footer']).render()
+ with open(os.path.join(self.output_directory, metric + '_report.html'),'w') as metric_report:
+ metric_report.write(metric_html)","class Report(object):
+ for metric in self.metric_list:
+ metric_stats = []
+ metric_stats_file, summary_stats, metric_plots, correlated_plots = self.discover_metric_data(self.output_directory, metric)
+ if metric_stats_file != '' or len(metric_plots) > 0:
+ metric_stats = self.get_summary_table(metric_stats_file)
+ metric_html = template_environment.get_template(self.report_templates['header']).render(custom_javascript_includes=[""http://www.kryogenix.org/code/browser/sorttable/sorttable.js""])
+ metric_html += template_environment.get_template(self.report_templates['metric']).render(metric_stats=metric_stats, metric_plots=metric_plots, correlated_plots=correlated_plots, metric=metric)
+ metric_html += template_environment.get_template(self.report_templates['footer']).render()
+ with open(os.path.join(self.output_directory, metric + '_report.html'), 'w') as metric_report:
+ metric_report.write(metric_html)"
+322,https://:@github.com/linkedin/naarad.git,74c5928b9c26fb7bd708fb9480dd2014b4305b89,"@@ -67,7 +67,7 @@ def graph_data(list_of_plots, output_directory, output_filename):
+ plot_count = len(plots)
+
+ if plot_count == 0:
+- return True, None
++ return False, None
+
+ graph_height, graph_width, graph_title = get_graph_metadata(list_of_plots)
+
+",src/naarad/graphing/matplotlib_naarad.py,"ReplaceText(target='False' @(70,11)->(70,15))","def graph_data(list_of_plots, output_directory, output_filename):
+ plot_count = len(plots)
+
+ if plot_count == 0:
+ return True, None
+
+ graph_height, graph_width, graph_title = get_graph_metadata(list_of_plots)
+ ","def graph_data(list_of_plots, output_directory, output_filename):
+ plot_count = len(plots)
+
+ if plot_count == 0:
+ return False, None
+
+ graph_height, graph_width, graph_title = get_graph_metadata(list_of_plots)
+ "
+323,https://:@github.com/linkedin/naarad.git,fa8753e74e301602fd50281ef36bc13cde421ac2,"@@ -204,7 +204,7 @@ class Metric(object):
+ if i+1 in groupby_idxes:
+ continue
+ else:
+- out_csv = self.get_csv(groupby_names, self.columns[i])
++ out_csv = self.get_csv(self.columns[i], groupby_names)
+ if out_csv in data:
+ data[out_csv].append(ts + ',' + words[i+1])
+ else:
+",src/naarad/metrics/metric.py,"ArgSwap(idxs=0<->1 @(207,26)->(207,38))","class Metric(object):
+ if i+1 in groupby_idxes:
+ continue
+ else:
+ out_csv = self.get_csv(groupby_names, self.columns[i])
+ if out_csv in data:
+ data[out_csv].append(ts + ',' + words[i+1])
+ else:","class Metric(object):
+ if i+1 in groupby_idxes:
+ continue
+ else:
+ out_csv = self.get_csv(self.columns[i], groupby_names)
+ if out_csv in data:
+ data[out_csv].append(ts + ',' + words[i+1])
+ else:"
+324,https://:@gitlab.com/mailman/postorius.git,308434aa505637da8275150484943b2442bc4b3c,"@@ -232,6 +232,6 @@ class ListMembersTest(ViewTestCase):
+ {'q': 'not_a_member'})
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(len(response.context['members']), 0)
+- self.assertNotContains(response, member_2.email)
++ self.assertNotContains(response, member_1.email)
+ self.assertNotContains(response, member_2.email)
+
+",src/postorius/tests/mailman_api_tests/test_list_members.py,"ReplaceText(target='member_1' @(235,41)->(235,49))","class ListMembersTest(ViewTestCase):
+ {'q': 'not_a_member'})
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(len(response.context['members']), 0)
+ self.assertNotContains(response, member_2.email)
+ self.assertNotContains(response, member_2.email)
+ ","class ListMembersTest(ViewTestCase):
+ {'q': 'not_a_member'})
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(len(response.context['members']), 0)
+ self.assertNotContains(response, member_1.email)
+ self.assertNotContains(response, member_2.email)
+ "
+325,https://:@github.com/crsmithdev/arrow.git,fa5bce04765198071c17fa2ee889c16b5dbe6377,"@@ -94,7 +94,7 @@ class DateTimeFormatter(object):
+ tz = dateutil_tz.tzutc() if dt.tzinfo is None else dt.tzinfo
+ total_minutes = int(util.total_seconds(tz.utcoffset(dt)) / 60)
+
+- sign = '+' if total_minutes > 0 else '-'
++ sign = '+' if total_minutes >= 0 else '-'
+ total_minutes = abs(total_minutes)
+ hour, minute = divmod(total_minutes, 60)
+
+",arrow/formatter.py,"ReplaceText(target='>=' @(97,40)->(97,41))","class DateTimeFormatter(object):
+ tz = dateutil_tz.tzutc() if dt.tzinfo is None else dt.tzinfo
+ total_minutes = int(util.total_seconds(tz.utcoffset(dt)) / 60)
+
+ sign = '+' if total_minutes > 0 else '-'
+ total_minutes = abs(total_minutes)
+ hour, minute = divmod(total_minutes, 60)
+ ","class DateTimeFormatter(object):
+ tz = dateutil_tz.tzutc() if dt.tzinfo is None else dt.tzinfo
+ total_minutes = int(util.total_seconds(tz.utcoffset(dt)) / 60)
+
+ sign = '+' if total_minutes >= 0 else '-'
+ total_minutes = abs(total_minutes)
+ hour, minute = divmod(total_minutes, 60)
+ "
+326,https://:@github.com/AICoE/log-anomaly-detector.git,cd462c169c77152ae10cf3b0b99adfa51d53c043,"@@ -37,4 +37,4 @@ class SOMPYModel(BaseModel):
+ dist = np.linalg.norm(self.model[x][y] - log)
+ if dist < dist_smallest:
+ dist_smallest = dist
+- return dist
++ return dist_smallest
+",anomaly_detector/model/sompy_model.py,"ReplaceText(target='dist_smallest' @(40,15)->(40,19))","class SOMPYModel(BaseModel):
+ dist = np.linalg.norm(self.model[x][y] - log)
+ if dist < dist_smallest:
+ dist_smallest = dist
+ return dist","class SOMPYModel(BaseModel):
+ dist = np.linalg.norm(self.model[x][y] - log)
+ if dist < dist_smallest:
+ dist_smallest = dist
+ return dist_smallest"
+327,https://:@github.com/ksmet1977/luxpy.git,6b6e6f7dd1dd257c8394dcd439f2bbb39be46fef,"@@ -896,7 +896,7 @@ def plot_spectrum_colors(spd = None, spdmax = None,\
+ cmfs = _CMF[cieobs]['bar']
+ else:
+ cmfs = cieobs
+- cmfs = cmfs[:,cmfs[1:].sum(axis=1)>0] # avoid div by zero in xyz-to-Yxy conversion
++ cmfs = cmfs[:,cmfs[1:].sum(axis=0)>0] # avoid div by zero in xyz-to-Yxy conversion
+
+ wavs = cmfs[0:1].T
+ SL = cmfs[1:4].T
+",luxpy/color/utils/plotters.py,"ReplaceText(target='0' @(899,36)->(899,37))","def plot_spectrum_colors(spd = None, spdmax = None,\
+ cmfs = _CMF[cieobs]['bar']
+ else:
+ cmfs = cieobs
+ cmfs = cmfs[:,cmfs[1:].sum(axis=1)>0] # avoid div by zero in xyz-to-Yxy conversion
+
+ wavs = cmfs[0:1].T
+ SL = cmfs[1:4].T ","def plot_spectrum_colors(spd = None, spdmax = None,\
+ cmfs = _CMF[cieobs]['bar']
+ else:
+ cmfs = cieobs
+ cmfs = cmfs[:,cmfs[1:].sum(axis=0)>0] # avoid div by zero in xyz-to-Yxy conversion
+
+ wavs = cmfs[0:1].T
+ SL = cmfs[1:4].T "
+328,https://:@github.com/melexis/sphinx-traceability-extension.git,64a00adbbbec4088a6e0bb88b1ed43e26c2776bd,"@@ -760,7 +760,7 @@ def process_item_nodes(app, doctree, fromdocname):
+ for source in node['sources']:
+ for target in node['targets']:
+ try:
+- env.traceability_collection.add_relation(target, node['type'], source)
++ env.traceability_collection.add_relation(source, node['type'], target)
+ except TraceabilityException as err:
+ report_warning(env, err, env.docname, self.lineno)
+ # The ItemLink node has no final representation, so is removed from the tree
+",mlx/traceability.py,"ArgSwap(idxs=0<->2 @(763,20)->(763,60))","def process_item_nodes(app, doctree, fromdocname):
+ for source in node['sources']:
+ for target in node['targets']:
+ try:
+ env.traceability_collection.add_relation(target, node['type'], source)
+ except TraceabilityException as err:
+ report_warning(env, err, env.docname, self.lineno)
+ # The ItemLink node has no final representation, so is removed from the tree","def process_item_nodes(app, doctree, fromdocname):
+ for source in node['sources']:
+ for target in node['targets']:
+ try:
+ env.traceability_collection.add_relation(source, node['type'], target)
+ except TraceabilityException as err:
+ report_warning(env, err, env.docname, self.lineno)
+ # The ItemLink node has no final representation, so is removed from the tree"
+329,https://:@github.com/rocky/python3-trepan.git,2ff3e8439122926251ef9e7e4b7b89018feb9892,"@@ -47,7 +47,7 @@ and recolor all source code output.""""""
+ pass
+
+ def run(self, args):
+- if len(args) >= 1 and 'reset' == args[0]:
++ if len(args) > 1 and 'reset' == args[0]:
+ highlight_type = self.get_highlight_type(args[1])
+ if not highlight_type: return
+ clear_file_format_cache()
+",trepan/processor/command/set_subcmd/highlight.py,"ReplaceText(target='>' @(50,21)->(50,23))","and recolor all source code output.""""""
+ pass
+
+ def run(self, args):
+ if len(args) >= 1 and 'reset' == args[0]:
+ highlight_type = self.get_highlight_type(args[1])
+ if not highlight_type: return
+ clear_file_format_cache()","and recolor all source code output.""""""
+ pass
+
+ def run(self, args):
+ if len(args) > 1 and 'reset' == args[0]:
+ highlight_type = self.get_highlight_type(args[1])
+ if not highlight_type: return
+ clear_file_format_cache()"
+330,https://:@github.com/rocky/python3-trepan.git,7fe5f2be86cf60c41b67ea4a6d24990b06dd536a,"@@ -4,7 +4,7 @@ from fn_helper import strarray_setup, compare_output
+
+
+ class TestSkip(unittest.TestCase):
+- @unittest.skipIf('TRAVIS' not in os.environ,
++ @unittest.skipIf('TRAVIS' in os.environ,
+ ""FIXME: figure out why this doesn't work in travis"")
+ def test_skip(self):
+
+",test/functional/test-skip.py,"ReplaceText(target=' in ' @(7,29)->(7,37))","from fn_helper import strarray_setup, compare_output
+
+
+ class TestSkip(unittest.TestCase):
+ @unittest.skipIf('TRAVIS' not in os.environ,
+ ""FIXME: figure out why this doesn't work in travis"")
+ def test_skip(self):
+ ","from fn_helper import strarray_setup, compare_output
+
+
+ class TestSkip(unittest.TestCase):
+ @unittest.skipIf('TRAVIS' in os.environ,
+ ""FIXME: figure out why this doesn't work in travis"")
+ def test_skip(self):
+ "
+331,https://:@github.com/rocky/python3-trepan.git,ce7705f666154604fb580ca56cd22ec7cc6eae69,"@@ -183,7 +183,7 @@ dictionary that gets fed to trepan.Debugger.core.start().
+ Parameter ""step_ignore"" specifies how many line events to ignore after the
+ debug() call. 0 means don't even wait for the debug() call to finish.
+ """"""
+- if isinstance(Mdebugger.debugger_obj, Mdebugger.Trepan):
++ if not isinstance(Mdebugger.debugger_obj, Mdebugger.Trepan):
+ Mdebugger.debugger_obj = Mdebugger.Trepan(dbg_opts)
+ Mdebugger.debugger_obj.core.add_ignore(debug, stop)
+ pass
+",trepan/api.py,"ReplaceText(target='not ' @(186,7)->(186,7))","dictionary that gets fed to trepan.Debugger.core.start().
+ Parameter ""step_ignore"" specifies how many line events to ignore after the
+ debug() call. 0 means don't even wait for the debug() call to finish.
+ """"""
+ if isinstance(Mdebugger.debugger_obj, Mdebugger.Trepan):
+ Mdebugger.debugger_obj = Mdebugger.Trepan(dbg_opts)
+ Mdebugger.debugger_obj.core.add_ignore(debug, stop)
+ pass","dictionary that gets fed to trepan.Debugger.core.start().
+ Parameter ""step_ignore"" specifies how many line events to ignore after the
+ debug() call. 0 means don't even wait for the debug() call to finish.
+ """"""
+ if not isinstance(Mdebugger.debugger_obj, Mdebugger.Trepan):
+ Mdebugger.debugger_obj = Mdebugger.Trepan(dbg_opts)
+ Mdebugger.debugger_obj.core.add_ignore(debug, stop)
+ pass"
+332,https://:@github.com/rocky/python3-trepan.git,342c05260ac86fcc4e6d711a3f579c71d1d53d64,"@@ -116,7 +116,7 @@ See also:
+ pass
+
+ sys_version = version_info.major + (version_info.minor / 10.0)
+- if len(args) >= 1 and args[1] == '.':
++ if len(args) >= 1 and args[0] == '.':
+ try:
+ if pretty:
+ deparsed = deparse_code(sys_version, co)
+",trepan/processor/command/deparse.py,"ReplaceText(target='0' @(119,35)->(119,36))","See also:
+ pass
+
+ sys_version = version_info.major + (version_info.minor / 10.0)
+ if len(args) >= 1 and args[1] == '.':
+ try:
+ if pretty:
+ deparsed = deparse_code(sys_version, co)","See also:
+ pass
+
+ sys_version = version_info.major + (version_info.minor / 10.0)
+ if len(args) >= 1 and args[0] == '.':
+ try:
+ if pretty:
+ deparsed = deparse_code(sys_version, co)"
+333,https://:@github.com/kanaka/websockify.git,0da91c7fdb3a49873121594e1820eef7ac078595,"@@ -225,7 +225,7 @@ Sec-WebSocket-Accept: %s\r
+ payload_len = len(buf)
+ if payload_len <= 125:
+ header = struct.pack('>BB', b1, payload_len)
+- elif payload_len > 125 and payload_len <= 65536:
++ elif payload_len > 125 and payload_len < 65536:
+ header = struct.pack('>BBH', b1, 126, payload_len)
+ elif payload_len >= 65536:
+ header = struct.pack('>BBQ', b1, 127, payload_len)
+",websocket.py,"ReplaceText(target='<' @(228,47)->(228,49))","Sec-WebSocket-Accept: %s\r
+ payload_len = len(buf)
+ if payload_len <= 125:
+ header = struct.pack('>BB', b1, payload_len)
+ elif payload_len > 125 and payload_len <= 65536:
+ header = struct.pack('>BBH', b1, 126, payload_len)
+ elif payload_len >= 65536:
+ header = struct.pack('>BBQ', b1, 127, payload_len)","Sec-WebSocket-Accept: %s\r
+ payload_len = len(buf)
+ if payload_len <= 125:
+ header = struct.pack('>BB', b1, payload_len)
+ elif payload_len > 125 and payload_len < 65536:
+ header = struct.pack('>BBH', b1, 126, payload_len)
+ elif payload_len >= 65536:
+ header = struct.pack('>BBQ', b1, 127, payload_len)"
+334,https://:@github.com/annoviko/pyclustering.git,70597e34bed02d7c3cb4a3d2e2ed6b30cd6cb3df,"@@ -320,7 +320,7 @@ class hysteresis_network(network):
+
+ if (collect_dynamic is False):
+ dyn_state.append(self._states);
+- dyn_time.append(t);
++ dyn_time.append(time);
+
+ return hysteresis_dynamic(dyn_state, dyn_time);
+
+",pyclustering/nnet/hysteresis.py,"ReplaceText(target='time' @(323,28)->(323,29))","class hysteresis_network(network):
+
+ if (collect_dynamic is False):
+ dyn_state.append(self._states);
+ dyn_time.append(t);
+
+ return hysteresis_dynamic(dyn_state, dyn_time);
+ ","class hysteresis_network(network):
+
+ if (collect_dynamic is False):
+ dyn_state.append(self._states);
+ dyn_time.append(time);
+
+ return hysteresis_dynamic(dyn_state, dyn_time);
+ "
+335,https://:@github.com/annoviko/pyclustering.git,7e1bf5ed9cc2817c00c7e5e216adb4cc9fa8fc49,"@@ -123,7 +123,7 @@ class ttsas(bsas):
+
+ index_cluster, distance = self._find_nearest_cluster(point);
+
+- if distance < self._threshold:
++ if distance <= self._threshold:
+ self.__append_to_cluster(index_cluster, index_point, point);
+ elif distance > self._threshold2:
+ self.__allocate_cluster(index_point, point);
+",pyclustering/cluster/ttsas.py,"ReplaceText(target='<=' @(126,20)->(126,21))","class ttsas(bsas):
+
+ index_cluster, distance = self._find_nearest_cluster(point);
+
+ if distance < self._threshold:
+ self.__append_to_cluster(index_cluster, index_point, point);
+ elif distance > self._threshold2:
+ self.__allocate_cluster(index_point, point);","class ttsas(bsas):
+
+ index_cluster, distance = self._find_nearest_cluster(point);
+
+ if distance <= self._threshold:
+ self.__append_to_cluster(index_cluster, index_point, point);
+ elif distance > self._threshold2:
+ self.__allocate_cluster(index_point, point);"
+336,https://:@github.com/annoviko/pyclustering.git,cdb0ca92c076282084f54816d681f7d0a1588066,"@@ -64,7 +64,7 @@ class XmeansTestTemplates:
+ assertion.eq(expected_wce, wce)
+
+ if expected_cluster_length is not None:
+- assertion.eq(len(centers), len(expected_cluster_length))
++ assertion.eq(len(expected_cluster_length), len(centers))
+
+ obtained_cluster_sizes.sort()
+ expected_cluster_length.sort()
+",pyclustering/cluster/tests/xmeans_templates.py,"ArgSwap(idxs=0<->1 @(67,12)->(67,24))","class XmeansTestTemplates:
+ assertion.eq(expected_wce, wce)
+
+ if expected_cluster_length is not None:
+ assertion.eq(len(centers), len(expected_cluster_length))
+
+ obtained_cluster_sizes.sort()
+ expected_cluster_length.sort()","class XmeansTestTemplates:
+ assertion.eq(expected_wce, wce)
+
+ if expected_cluster_length is not None:
+ assertion.eq(len(expected_cluster_length), len(centers))
+
+ obtained_cluster_sizes.sort()
+ expected_cluster_length.sort()"
+337,https://:@github.com/evolbioinfo/pastml.git,06384fd264d834bff88efdc6bf70a098b06f307d,"@@ -232,7 +232,7 @@ def parsimonious_acr(tree, feature, prediction_method, states, num_nodes, num_ti
+ .format(feature, num_steps))
+ num_scenarios, unresolved_nodes = choose_parsimonious_states(tree, feature)
+ logger.debug('{} node{} unresolved ({:.2f}%) for {}, leading to {:g} ancestral scenario{}.'
+- .format(unresolved_nodes, 's are' if unresolved_nodes > 1 else ' is',
++ .format(unresolved_nodes, 's are' if unresolved_nodes != 1 else ' is',
+ unresolved_nodes * 100 / num_nodes, feature,
+ num_scenarios, 's' if num_scenarios > 1 else ''))
+
+",pastml/parsimony.py,"ReplaceText(target='!=' @(235,71)->(235,72))","def parsimonious_acr(tree, feature, prediction_method, states, num_nodes, num_ti
+ .format(feature, num_steps))
+ num_scenarios, unresolved_nodes = choose_parsimonious_states(tree, feature)
+ logger.debug('{} node{} unresolved ({:.2f}%) for {}, leading to {:g} ancestral scenario{}.'
+ .format(unresolved_nodes, 's are' if unresolved_nodes > 1 else ' is',
+ unresolved_nodes * 100 / num_nodes, feature,
+ num_scenarios, 's' if num_scenarios > 1 else ''))
+ ","def parsimonious_acr(tree, feature, prediction_method, states, num_nodes, num_ti
+ .format(feature, num_steps))
+ num_scenarios, unresolved_nodes = choose_parsimonious_states(tree, feature)
+ logger.debug('{} node{} unresolved ({:.2f}%) for {}, leading to {:g} ancestral scenario{}.'
+ .format(unresolved_nodes, 's are' if unresolved_nodes != 1 else ' is',
+ unresolved_nodes * 100 / num_nodes, feature,
+ num_scenarios, 's' if num_scenarios > 1 else ''))
+ "
+338,https://:@github.com/jirifilip/pyARC.git,e18a6c280f30bc753192bfa83f311ce36915aca4,"@@ -42,7 +42,7 @@ class TestClassAssociationRule(unittest.TestCase):
+ sorted_cars = sorted([car1, car2, car3, car4], reverse=True)
+
+ assert car1 < car2
+- assert car2 < car3
++ assert car2 > car3
+ assert car3 < car2
+ assert car4 > car3
+ assert car1.antecedent <= transaction1
+",cba/test/test_class_association_rule.py,"ReplaceText(target='>' @(45,20)->(45,21))","class TestClassAssociationRule(unittest.TestCase):
+ sorted_cars = sorted([car1, car2, car3, car4], reverse=True)
+
+ assert car1 < car2
+ assert car2 < car3
+ assert car3 < car2
+ assert car4 > car3
+ assert car1.antecedent <= transaction1","class TestClassAssociationRule(unittest.TestCase):
+ sorted_cars = sorted([car1, car2, car3, car4], reverse=True)
+
+ assert car1 < car2
+ assert car2 > car3
+ assert car3 < car2
+ assert car4 > car3
+ assert car1.antecedent <= transaction1"
+339,https://:@github.com/oblalex/verboselib.git,5ec91a09ae9f0674513f4953111009b93eaad74a,"@@ -123,4 +123,4 @@ class VerboselibTranslationTestCase(unittest.TestCase):
+
+ t1.merge(t2)
+ self.assertEqual(t1.ugettext(""Hello""), ""Вітаю"")
+- self.assertEqual(t2.ugettext(""Good bye""), ""До зустрічі"")
++ self.assertEqual(t1.ugettext(""Good bye""), ""До зустрічі"")
+",tests/test_package.py,"ReplaceText(target='t1' @(126,25)->(126,27))","class VerboselibTranslationTestCase(unittest.TestCase):
+
+ t1.merge(t2)
+ self.assertEqual(t1.ugettext(""Hello""), ""Вітаю"")
+ self.assertEqual(t2.ugettext(""Good bye""), ""До зустрічі"")","class VerboselibTranslationTestCase(unittest.TestCase):
+
+ t1.merge(t2)
+ self.assertEqual(t1.ugettext(""Hello""), ""Вітаю"")
+ self.assertEqual(t1.ugettext(""Good bye""), ""До зустрічі"")"
+340,https://:@github.com/lexndru/hap.git,5ef18f88572400983578d8723663562329066779,"@@ -87,7 +87,7 @@ class Cache(object):
+ tuple: Boolean for success read and string for size or error.
+ """"""
+
+- if len(cache) == 0:
++ if len(cache_path) == 0:
+ return False, ""missing cache path""
+ if len(cache) == 0:
+ return False, ""missing cache data""
+",hap/cache.py,"ReplaceText(target='cache_path' @(90,15)->(90,20))","class Cache(object):
+ tuple: Boolean for success read and string for size or error.
+ """"""
+
+ if len(cache) == 0:
+ return False, ""missing cache path""
+ if len(cache) == 0:
+ return False, ""missing cache data""","class Cache(object):
+ tuple: Boolean for success read and string for size or error.
+ """"""
+
+ if len(cache_path) == 0:
+ return False, ""missing cache path""
+ if len(cache) == 0:
+ return False, ""missing cache data"""
+341,https://:@github.com/littlezz/island-backup.git,fed75aebccfa31e418e351492618a2d50c15b9cb,"@@ -103,7 +103,7 @@ class ImageManager:
+ print('this is {} in busying'.format(len(self.busying)))
+ urls = []
+ for i, url in enumerate(self.busying):
+- if i > 3:
++ if i >= 3:
+ break
+ urls.append(url)
+
+",main.py,"ReplaceText(target='>=' @(106,17)->(106,18))","class ImageManager:
+ print('this is {} in busying'.format(len(self.busying)))
+ urls = []
+ for i, url in enumerate(self.busying):
+ if i > 3:
+ break
+ urls.append(url)
+ ","class ImageManager:
+ print('this is {} in busying'.format(len(self.busying)))
+ urls = []
+ for i, url in enumerate(self.busying):
+ if i >= 3:
+ break
+ urls.append(url)
+ "
+342,https://:@github.com/parrt/dtreeviz.git,aa5b4811af5c5a5c9620705fc44ffd9e48377664,"@@ -1121,7 +1121,7 @@ def draw_legend(shadow_tree, target_name, filename, colors=None):
+ boxes = []
+ for i, c in enumerate(class_values):
+ box = patches.Rectangle((0, 0), 20, 10, linewidth=.4, edgecolor=colors['rect_edge'],
+- facecolor=color_map[c], label=class_names[c])
++ facecolor=color_map[c], label=class_names[i])
+ boxes.append(box)
+
+ fig, ax = plt.subplots(1, 1, figsize=(1,1))
+",dtreeviz/trees.py,"ReplaceText(target='i' @(1124,74)->(1124,75))","def draw_legend(shadow_tree, target_name, filename, colors=None):
+ boxes = []
+ for i, c in enumerate(class_values):
+ box = patches.Rectangle((0, 0), 20, 10, linewidth=.4, edgecolor=colors['rect_edge'],
+ facecolor=color_map[c], label=class_names[c])
+ boxes.append(box)
+
+ fig, ax = plt.subplots(1, 1, figsize=(1,1))","def draw_legend(shadow_tree, target_name, filename, colors=None):
+ boxes = []
+ for i, c in enumerate(class_values):
+ box = patches.Rectangle((0, 0), 20, 10, linewidth=.4, edgecolor=colors['rect_edge'],
+ facecolor=color_map[c], label=class_names[i])
+ boxes.append(box)
+
+ fig, ax = plt.subplots(1, 1, figsize=(1,1))"
+343,https://:@github.com/parrt/dtreeviz.git,01cc13f495decbd6f8f716d7be586e02864f3434,"@@ -809,7 +809,7 @@ def dtreeviz(tree_model: (tree.DecisionTreeRegressor, tree.DecisionTreeClassifie
+ lcolor = colors['highlight']
+ lpw = ""1.2""
+ if node.right.id in highlight_path:
+- lcolor = colors['highlight']
++ rcolor = colors['highlight']
+ rpw = ""1.2""
+ edges.append( f'{nname} -> {left_node_name} [penwidth={lpw} color=""{lcolor}"" label=<{llabel}>]' )
+ edges.append( f'{nname} -> {right_node_name} [penwidth={rpw} color=""{rcolor}"" label=<{rlabel}>]' )
+",dtreeviz/trees.py,"ReplaceText(target='rcolor' @(812,12)->(812,18))","def dtreeviz(tree_model: (tree.DecisionTreeRegressor, tree.DecisionTreeClassifie
+ lcolor = colors['highlight']
+ lpw = ""1.2""
+ if node.right.id in highlight_path:
+ lcolor = colors['highlight']
+ rpw = ""1.2""
+ edges.append( f'{nname} -> {left_node_name} [penwidth={lpw} color=""{lcolor}"" label=<{llabel}>]' )
+ edges.append( f'{nname} -> {right_node_name} [penwidth={rpw} color=""{rcolor}"" label=<{rlabel}>]' )","def dtreeviz(tree_model: (tree.DecisionTreeRegressor, tree.DecisionTreeClassifie
+ lcolor = colors['highlight']
+ lpw = ""1.2""
+ if node.right.id in highlight_path:
+ rcolor = colors['highlight']
+ rpw = ""1.2""
+ edges.append( f'{nname} -> {left_node_name} [penwidth={lpw} color=""{lcolor}"" label=<{llabel}>]' )
+ edges.append( f'{nname} -> {right_node_name} [penwidth={rpw} color=""{rcolor}"" label=<{rlabel}>]' )"
+344,https://:@github.com/4teamwork/ftw.workspace.git,b12970101f5ca213e4604c2c3cf2f767f911b71e,"@@ -75,7 +75,7 @@ class AssignableUsersVocabulary(object):
+ if user not in groups:
+ groups.add(user)
+
+- if getattr(aq_base(workspace), '__ac_local_roles_block__', None):
++ if getattr(aq_base(context), '__ac_local_roles_block__', None):
+ cont = False
+ else:
+ context = aq_parent(context)
+",ftw/workspace/vocabularies.py,"ReplaceText(target='context' @(78,31)->(78,40))","class AssignableUsersVocabulary(object):
+ if user not in groups:
+ groups.add(user)
+
+ if getattr(aq_base(workspace), '__ac_local_roles_block__', None):
+ cont = False
+ else:
+ context = aq_parent(context)","class AssignableUsersVocabulary(object):
+ if user not in groups:
+ groups.add(user)
+
+ if getattr(aq_base(context), '__ac_local_roles_block__', None):
+ cont = False
+ else:
+ context = aq_parent(context)"
+345,https://:@github.com/regulusweb/wagtail-extensions.git,ea388649a0c6dc6fbc1ce018d767c8b583486523,"@@ -74,7 +74,7 @@ class ContactDetailsSetting(BaseSetting):
+ today = date.today()
+ cache_key = self.get_opening_today_cache_key(today)
+ times = cache.get(cache_key)
+- if times is not None:
++ if times is None:
+ opening_times = self.primary_opening_times
+ if opening_times:
+ specific_times = utils.first_true(opening_times, lambda x: x.get('date') == today)
+",wagtail_extensions/models.py,"ReplaceText(target=' is ' @(77,16)->(77,24))","class ContactDetailsSetting(BaseSetting):
+ today = date.today()
+ cache_key = self.get_opening_today_cache_key(today)
+ times = cache.get(cache_key)
+ if times is not None:
+ opening_times = self.primary_opening_times
+ if opening_times:
+ specific_times = utils.first_true(opening_times, lambda x: x.get('date') == today)","class ContactDetailsSetting(BaseSetting):
+ today = date.today()
+ cache_key = self.get_opening_today_cache_key(today)
+ times = cache.get(cache_key)
+ if times is None:
+ opening_times = self.primary_opening_times
+ if opening_times:
+ specific_times = utils.first_true(opening_times, lambda x: x.get('date') == today)"
+346,https://:@github.com/tjcsl/cslbot.git,eaa1165f7ceb19b8e98828fea2894d275ffe5743,"@@ -394,7 +394,7 @@ class MyHandler():
+ elif cmd[0] == ""get"":
+ if cmd[1] == ""disabled"" and cmd[2] == ""modules"":
+ send(str(self.disabled_mods))
+- if cmd[2] == ""enabled"" and cmd[2] == ""modules"":
++ if cmd[1] == ""enabled"" and cmd[2] == ""modules"":
+ send(str([i for i in self.modules if i not in self.disabled_mods]))
+
+ def handle_msg(self, msgtype, c, e):
+",handler.py,"ReplaceText(target='1' @(397,19)->(397,20))","class MyHandler():
+ elif cmd[0] == ""get"":
+ if cmd[1] == ""disabled"" and cmd[2] == ""modules"":
+ send(str(self.disabled_mods))
+ if cmd[2] == ""enabled"" and cmd[2] == ""modules"":
+ send(str([i for i in self.modules if i not in self.disabled_mods]))
+
+ def handle_msg(self, msgtype, c, e):","class MyHandler():
+ elif cmd[0] == ""get"":
+ if cmd[1] == ""disabled"" and cmd[2] == ""modules"":
+ send(str(self.disabled_mods))
+ if cmd[1] == ""enabled"" and cmd[2] == ""modules"":
+ send(str([i for i in self.modules if i not in self.disabled_mods]))
+
+ def handle_msg(self, msgtype, c, e):"
+347,https://:@github.com/tjcsl/cslbot.git,6c801ad70e0a9d1a963b9b560f9c654616e64a3b,"@@ -260,7 +260,7 @@ class BotHandler():
+ if self.log_to_ctrlchan:
+ # somewhat hacky fix
+ if target != CTRLCHAN:
+- self.connection.send_raw((""PRIVMSG %s :(%s) <%s> %s"" % (CTRLCHAN, target, nick, log))\
++ self.connection.send_raw((""PRIVMSG %s :(%s) <%s> %s"" % (CTRLCHAN, target, nick, msg))\
+ .replace(""\n"", """").replace(""\r"", """"))
+ self.logs[target].append([day, log])
+ self.logfiles[target].write(log)
+",handler.py,"ReplaceText(target='msg' @(263,96)->(263,99))","class BotHandler():
+ if self.log_to_ctrlchan:
+ # somewhat hacky fix
+ if target != CTRLCHAN:
+ self.connection.send_raw((""PRIVMSG %s :(%s) <%s> %s"" % (CTRLCHAN, target, nick, log))\
+ .replace(""\n"", """").replace(""\r"", """"))
+ self.logs[target].append([day, log])
+ self.logfiles[target].write(log)","class BotHandler():
+ if self.log_to_ctrlchan:
+ # somewhat hacky fix
+ if target != CTRLCHAN:
+ self.connection.send_raw((""PRIVMSG %s :(%s) <%s> %s"" % (CTRLCHAN, target, nick, msg))\
+ .replace(""\n"", """").replace(""\r"", """"))
+ self.logs[target].append([day, log])
+ self.logfiles[target].write(log)"
+348,https://:@github.com/tjcsl/cslbot.git,b5c181736ff1adc6b665d2d4a80bd6141aaa549e,"@@ -331,7 +331,7 @@ class BotHandler():
+ return
+ if cmdargs[0] != '#':
+ cmdargs = '#' + cmdargs
+- if cmdargs in self.channels and len(cmd) > 0 and cmd[1] != ""force"":
++ if cmdargs in self.channels or len(cmd) > 0 and cmd[1] != ""force"":
+ send(""%s is already a member of %s"" % (NICK, cmdargs))
+ return
+ c.join(cmd[0])
+",handler.py,"ReplaceText(target='or' @(334,36)->(334,39))","class BotHandler():
+ return
+ if cmdargs[0] != '#':
+ cmdargs = '#' + cmdargs
+ if cmdargs in self.channels and len(cmd) > 0 and cmd[1] != ""force"":
+ send(""%s is already a member of %s"" % (NICK, cmdargs))
+ return
+ c.join(cmd[0])","class BotHandler():
+ return
+ if cmdargs[0] != '#':
+ cmdargs = '#' + cmdargs
+ if cmdargs in self.channels or len(cmd) > 0 and cmd[1] != ""force"":
+ send(""%s is already a member of %s"" % (NICK, cmdargs))
+ return
+ c.join(cmd[0])"
+349,https://:@github.com/tjcsl/cslbot.git,20dab902837bb40599cb34afe152dfc780f2854e,"@@ -315,7 +315,7 @@ class BotHandler():
+ # -pub
+ # -private
+ #log to sqlite logger
+- self.logger.log(target, nick, isop, msg, msgtype)
++ self.logger.log(nick, target, isop, msg, msgtype)
+
+ if self.log_to_ctrlchan:
+ ctrlchan = self.config['core']['ctrlchan']
+",handler.py,"ArgSwap(idxs=0<->1 @(318,8)->(318,23))","class BotHandler():
+ # -pub
+ # -private
+ #log to sqlite logger
+ self.logger.log(target, nick, isop, msg, msgtype)
+
+ if self.log_to_ctrlchan:
+ ctrlchan = self.config['core']['ctrlchan']","class BotHandler():
+ # -pub
+ # -private
+ #log to sqlite logger
+ self.logger.log(nick, target, isop, msg, msgtype)
+
+ if self.log_to_ctrlchan:
+ ctrlchan = self.config['core']['ctrlchan']"
+350,https://:@github.com/tjcsl/cslbot.git,7b544654a37dd0ca467157c76aaa51bb6e9a73e8,"@@ -442,7 +442,7 @@ class BotHandler():
+ if cmd_obj.is_limited() and self.abusecheck(send, nick, cmd_obj.limit, msgtype, cmd[len(cmdchar):]):
+ return
+ args = self.do_args(cmd_obj.args, send, nick, target, e.source, c, cmd_name, msgtype)
+- cmd_obj.run(send, cmdargs, args, cmd_name, target, nick, self.db.get())
++ cmd_obj.run(send, cmdargs, args, cmd_name, nick, target, self.db.get())
+ # special commands
+ if cmd.startswith(cmdchar):
+ if cmd[len(cmdchar):] == 'reload':
+",handler.py,"ArgSwap(idxs=4<->5 @(445,16)->(445,27))","class BotHandler():
+ if cmd_obj.is_limited() and self.abusecheck(send, nick, cmd_obj.limit, msgtype, cmd[len(cmdchar):]):
+ return
+ args = self.do_args(cmd_obj.args, send, nick, target, e.source, c, cmd_name, msgtype)
+ cmd_obj.run(send, cmdargs, args, cmd_name, target, nick, self.db.get())
+ # special commands
+ if cmd.startswith(cmdchar):
+ if cmd[len(cmdchar):] == 'reload':","class BotHandler():
+ if cmd_obj.is_limited() and self.abusecheck(send, nick, cmd_obj.limit, msgtype, cmd[len(cmdchar):]):
+ return
+ args = self.do_args(cmd_obj.args, send, nick, target, e.source, c, cmd_name, msgtype)
+ cmd_obj.run(send, cmdargs, args, cmd_name, nick, target, self.db.get())
+ # special commands
+ if cmd.startswith(cmdchar):
+ if cmd[len(cmdchar):] == 'reload':"
+351,https://:@github.com/tjcsl/cslbot.git,8d5e5ff45a32d6849e0daf38414e818b4d8e4a96,"@@ -38,7 +38,7 @@ def cmd(send, msg, args):
+ name = 'passthrough'
+ else:
+ name = name[4:]
+- names.append(i)
++ names.append(name)
+ send(""Current filter(s): %s"" % "", "".join(names))
+ elif msg == 'list':
+ send(""Available filters are %s"" % "", "".join(output_filters.keys()))
+",commands/filter.py,"ReplaceText(target='name' @(41,25)->(41,26))","def cmd(send, msg, args):
+ name = 'passthrough'
+ else:
+ name = name[4:]
+ names.append(i)
+ send(""Current filter(s): %s"" % "", "".join(names))
+ elif msg == 'list':
+ send(""Available filters are %s"" % "", "".join(output_filters.keys()))","def cmd(send, msg, args):
+ name = 'passthrough'
+ else:
+ name = name[4:]
+ names.append(name)
+ send(""Current filter(s): %s"" % "", "".join(names))
+ elif msg == 'list':
+ send(""Available filters are %s"" % "", "".join(output_filters.keys()))"
+352,https://:@github.com/tjcsl/cslbot.git,0e38c8226ab070d321cbed3ade449c2833d0f36e,"@@ -154,7 +154,7 @@ def handle_accept(handler, cmd):
+ return ""Missing argument.""
+ if not cmd[1].isdigit():
+ return ""Not A Valid Positive Integer""
+- elif not handler.issues or len(handler.issues) < int(cmd[1]):
++ elif not handler.issues or len(handler.issues) <= int(cmd[1]):
+ return ""Not a valid issue""
+ else:
+ num = int(cmd[1])
+",helpers/control.py,"ReplaceText(target='<=' @(157,51)->(157,52))","def handle_accept(handler, cmd):
+ return ""Missing argument.""
+ if not cmd[1].isdigit():
+ return ""Not A Valid Positive Integer""
+ elif not handler.issues or len(handler.issues) < int(cmd[1]):
+ return ""Not a valid issue""
+ else:
+ num = int(cmd[1])","def handle_accept(handler, cmd):
+ return ""Missing argument.""
+ if not cmd[1].isdigit():
+ return ""Not A Valid Positive Integer""
+ elif not handler.issues or len(handler.issues) <= int(cmd[1]):
+ return ""Not a valid issue""
+ else:
+ num = int(cmd[1])"
+353,https://:@github.com/tjcsl/cslbot.git,1694edfac9e6ee93ce648c78be52d19360b7e364,"@@ -54,7 +54,7 @@ def do_add_quote(cmd, conn, isadmin, send, args):
+ cursor = conn.execute('INSERT INTO quotes(quote, nick, submitter) VALUES(?,?,?)', (quote[0], quote[1], args['nick']))
+ qid = cursor.lastrowid
+ if isadmin:
+- cursor.execute('UPDATE quotes SET approved=1 WHERE id=?', (qid,))
++ conn.execute('UPDATE quotes SET approved=1 WHERE id=?', (qid,))
+ send(""Added quote %d!"" % qid)
+ else:
+ send(""Quote submitted for approval."", target=args['nick'])
+",commands/quote.py,"ReplaceText(target='conn' @(57,8)->(57,14))","def do_add_quote(cmd, conn, isadmin, send, args):
+ cursor = conn.execute('INSERT INTO quotes(quote, nick, submitter) VALUES(?,?,?)', (quote[0], quote[1], args['nick']))
+ qid = cursor.lastrowid
+ if isadmin:
+ cursor.execute('UPDATE quotes SET approved=1 WHERE id=?', (qid,))
+ send(""Added quote %d!"" % qid)
+ else:
+ send(""Quote submitted for approval."", target=args['nick'])","def do_add_quote(cmd, conn, isadmin, send, args):
+ cursor = conn.execute('INSERT INTO quotes(quote, nick, submitter) VALUES(?,?,?)', (quote[0], quote[1], args['nick']))
+ qid = cursor.lastrowid
+ if isadmin:
+ conn.execute('UPDATE quotes SET approved=1 WHERE id=?', (qid,))
+ send(""Added quote %d!"" % qid)
+ else:
+ send(""Quote submitted for approval."", target=args['nick'])"
+354,https://:@github.com/tjcsl/cslbot.git,aa3079c68c6bfed92fe95cf92dbed87d1f3c91d2,"@@ -33,7 +33,7 @@ def handle_traceback(ex, c, target, config, source=""the bot""):
+ errtarget = ctrlchan if prettyerrors else target
+ if prettyerrors:
+ if name == 'CSLException':
+- c.privmsg(target, ""%s -- %s"" % (name, output))
++ c.privmsg(target, ""%s -- %s"" % (source, output))
+ else:
+ c.privmsg(target, ""An %s has occured in %s. See the control channel for details."" % (name, source))
+ c.privmsg(errtarget, '%s -- %s in %s on line %s: %s' % (source, name, trace[0], trace[1], output))
+",helpers/traceback.py,"ReplaceText(target='source' @(36,44)->(36,48))","def handle_traceback(ex, c, target, config, source=""the bot""):
+ errtarget = ctrlchan if prettyerrors else target
+ if prettyerrors:
+ if name == 'CSLException':
+ c.privmsg(target, ""%s -- %s"" % (name, output))
+ else:
+ c.privmsg(target, ""An %s has occured in %s. See the control channel for details."" % (name, source))
+ c.privmsg(errtarget, '%s -- %s in %s on line %s: %s' % (source, name, trace[0], trace[1], output))","def handle_traceback(ex, c, target, config, source=""the bot""):
+ errtarget = ctrlchan if prettyerrors else target
+ if prettyerrors:
+ if name == 'CSLException':
+ c.privmsg(target, ""%s -- %s"" % (source, output))
+ else:
+ c.privmsg(target, ""An %s has occured in %s. See the control channel for details."" % (name, source))
+ c.privmsg(errtarget, '%s -- %s in %s on line %s: %s' % (source, name, trace[0], trace[1], output))"
+355,https://:@github.com/tjcsl/cslbot.git,8bd3d1038ba16c4c097b51c1bdce1a54a5fb43af,"@@ -38,7 +38,7 @@ def get_definition(msg):
+ elif not index.isdigit() or int(index) >= len(data) or int(index) == 0:
+ output = ""Invalid Index""
+ else:
+- output = data[int(index)+1]['definition']
++ output = data[int(index)-1]['definition']
+ output = output.splitlines()
+ return ' '.join(output)
+
+",commands/urban.py,"ReplaceText(target='-' @(41,32)->(41,33))","def get_definition(msg):
+ elif not index.isdigit() or int(index) >= len(data) or int(index) == 0:
+ output = ""Invalid Index""
+ else:
+ output = data[int(index)+1]['definition']
+ output = output.splitlines()
+ return ' '.join(output)
+ ","def get_definition(msg):
+ elif not index.isdigit() or int(index) >= len(data) or int(index) == 0:
+ output = ""Invalid Index""
+ else:
+ output = data[int(index)-1]['definition']
+ output = output.splitlines()
+ return ' '.join(output)
+ "
+356,https://:@github.com/tjcsl/cslbot.git,a72f1944cc07392f2f1c023448bfc0eceb6cd8cd,"@@ -40,7 +40,7 @@ def get_definition(msg):
+ output = ""UrbanDictionary doesn't have an answer for you.""
+ elif index is None:
+ output = data[0]['definition']
+- elif not index.isdigit() or int(index) >= len(data) or int(index) == 0:
++ elif not index.isdigit() or int(index) > len(data) or int(index) == 0:
+ output = ""Invalid Index""
+ else:
+ output = data[int(index)-1]['definition']
+",commands/urban.py,"ReplaceText(target='>' @(43,43)->(43,45))","def get_definition(msg):
+ output = ""UrbanDictionary doesn't have an answer for you.""
+ elif index is None:
+ output = data[0]['definition']
+ elif not index.isdigit() or int(index) >= len(data) or int(index) == 0:
+ output = ""Invalid Index""
+ else:
+ output = data[int(index)-1]['definition']","def get_definition(msg):
+ output = ""UrbanDictionary doesn't have an answer for you.""
+ elif index is None:
+ output = data[0]['definition']
+ elif not index.isdigit() or int(index) > len(data) or int(index) == 0:
+ output = ""Invalid Index""
+ else:
+ output = data[int(index)-1]['definition']"
+357,https://:@github.com/tjcsl/cslbot.git,ffc2cedcd394bf7076f4e8882d7f8773fc2a529b,"@@ -24,7 +24,7 @@ from helpers.command import Command
+ def cmd(send, msg, args):
+ """"""Finds a random quote from tjbash.org given search criteria
+ """"""
+- if len(msg) < 0:
++ if len(msg) == 0:
+ url = 'http://tjbash.org/random1'
+ else:
+ url = 'http://tjbash.org/search?query='
+",commands/tjbash.py,"ReplaceText(target='==' @(27,16)->(27,17))","from helpers.command import Command
+ def cmd(send, msg, args):
+ """"""Finds a random quote from tjbash.org given search criteria
+ """"""
+ if len(msg) < 0:
+ url = 'http://tjbash.org/random1'
+ else:
+ url = 'http://tjbash.org/search?query='","from helpers.command import Command
+ def cmd(send, msg, args):
+ """"""Finds a random quote from tjbash.org given search criteria
+ """"""
+ if len(msg) == 0:
+ url = 'http://tjbash.org/random1'
+ else:
+ url = 'http://tjbash.org/search?query='"
+358,https://:@github.com/tjcsl/cslbot.git,0a9fcb6ce10d7d7dca87496e3abb02faa1c35794,"@@ -87,7 +87,7 @@ def build_markov(cursor, speaker, cmdchar, ctrlchan):
+ def get_markov(cursor, speaker, handler, cmdchar, ctrlchan):
+ markov = cursor.query(Babble).filter(Babble.nick == speaker).first()
+ if not markov:
+- update_markov(cursor, speaker, cmdchar, ctrlchan)
++ update_markov(handler, speaker, cmdchar, ctrlchan)
+ markov = cursor.query(Babble).filter(Babble.nick == speaker).first()
+ elif time.time() - markov.time > CACHE_LIFE:
+ handler.workers.defer(0, False, update_markov, handler, speaker, cmdchar, ctrlchan)
+",commands/babble.py,"ReplaceText(target='handler' @(90,22)->(90,28))","def build_markov(cursor, speaker, cmdchar, ctrlchan):
+ def get_markov(cursor, speaker, handler, cmdchar, ctrlchan):
+ markov = cursor.query(Babble).filter(Babble.nick == speaker).first()
+ if not markov:
+ update_markov(cursor, speaker, cmdchar, ctrlchan)
+ markov = cursor.query(Babble).filter(Babble.nick == speaker).first()
+ elif time.time() - markov.time > CACHE_LIFE:
+ handler.workers.defer(0, False, update_markov, handler, speaker, cmdchar, ctrlchan)","def build_markov(cursor, speaker, cmdchar, ctrlchan):
+ def get_markov(cursor, speaker, handler, cmdchar, ctrlchan):
+ markov = cursor.query(Babble).filter(Babble.nick == speaker).first()
+ if not markov:
+ update_markov(handler, speaker, cmdchar, ctrlchan)
+ markov = cursor.query(Babble).filter(Babble.nick == speaker).first()
+ elif time.time() - markov.time > CACHE_LIFE:
+ handler.workers.defer(0, False, update_markov, handler, speaker, cmdchar, ctrlchan)"
+359,https://:@github.com/ThibHlln/smartpy.git,6e02ac69689bff3802de8dcc5b15237996379aae,"@@ -26,7 +26,7 @@ def nash_sutcliffe(evaluation, simulation):
+
+
+ def groundwater_constraint(evaluation, simulation):
+- if (evaluation[0] - 0.1 <= simulation[0]) or (simulation[0] <= evaluation[0] + 0.1):
++ if (evaluation[0] - 0.1 <= simulation[0]) and (simulation[0] <= evaluation[0] + 0.1):
+ return 1.0
+ else:
+ return 0.0
+",SMARTobjective.py,"ReplaceText(target='and' @(29,46)->(29,48))","def nash_sutcliffe(evaluation, simulation):
+
+
+ def groundwater_constraint(evaluation, simulation):
+ if (evaluation[0] - 0.1 <= simulation[0]) or (simulation[0] <= evaluation[0] + 0.1):
+ return 1.0
+ else:
+ return 0.0","def nash_sutcliffe(evaluation, simulation):
+
+
+ def groundwater_constraint(evaluation, simulation):
+ if (evaluation[0] - 0.1 <= simulation[0]) and (simulation[0] <= evaluation[0] + 0.1):
+ return 1.0
+ else:
+ return 0.0"
+360,https://:@github.com/satellogic/orbit-predictor.git,672c75a9b64b6735c08bd5270855588e3d514065,"@@ -30,7 +30,7 @@ from orbit_predictor.predictors.base import CartesianPredictor, logger
+ class TLEPredictor(CartesianPredictor):
+
+ def __init__(self, sate_id, source):
+- super(TLEPredictor, self).__init__(source, sate_id)
++ super(TLEPredictor, self).__init__(sate_id, source)
+ self._iterations = 0
+
+ def _propagate_eci(self, when_utc=None):
+",orbit_predictor/predictors/tle.py,"ArgSwap(idxs=0<->1 @(33,8)->(33,42))","from orbit_predictor.predictors.base import CartesianPredictor, logger
+ class TLEPredictor(CartesianPredictor):
+
+ def __init__(self, sate_id, source):
+ super(TLEPredictor, self).__init__(source, sate_id)
+ self._iterations = 0
+
+ def _propagate_eci(self, when_utc=None):","from orbit_predictor.predictors.base import CartesianPredictor, logger
+ class TLEPredictor(CartesianPredictor):
+
+ def __init__(self, sate_id, source):
+ super(TLEPredictor, self).__init__(sate_id, source)
+ self._iterations = 0
+
+ def _propagate_eci(self, when_utc=None):"
+361,https://:@github.com/dipu-bd/lightnovel-crawler.git,773695654f273c9f7191817c4dd64e8322325809,"@@ -39,7 +39,7 @@ class LightNovelOnline(Crawler):
+ logger.debug('Visiting %s', self.novel_url)
+ soup = self.get_soup(self.novel_url)
+
+- self.novel_id = urlparse(self.novel_url).path.split('/')[1]
++ self.novel_id = urlparse(self.novel_url).path.split('/')[-1]
+ logger.info(""Novel Id: %s"", self.novel_id)
+
+ self.novel_title = soup.select_one(
+",lncrawl/sources/lightnovelonline.py,"ReplaceText(target='-1' @(42,65)->(42,66))","class LightNovelOnline(Crawler):
+ logger.debug('Visiting %s', self.novel_url)
+ soup = self.get_soup(self.novel_url)
+
+ self.novel_id = urlparse(self.novel_url).path.split('/')[1]
+ logger.info(""Novel Id: %s"", self.novel_id)
+
+ self.novel_title = soup.select_one(","class LightNovelOnline(Crawler):
+ logger.debug('Visiting %s', self.novel_url)
+ soup = self.get_soup(self.novel_url)
+
+ self.novel_id = urlparse(self.novel_url).path.split('/')[-1]
+ logger.info(""Novel Id: %s"", self.novel_id)
+
+ self.novel_title = soup.select_one("
+362,https://:@github.com/raphaelm/python-sepaxml.git,024a11dd1e26d08bbeb028a2a13dabcb509011ec,"@@ -54,7 +54,7 @@ def make_id(name):
+ 12 char rand hex string.
+ """"""
+ r = get_rand_string(12)
+- if len(name) <= 22:
++ if len(name) > 22:
+ name = name[:22]
+ return name + ""-"" + r
+
+",sepadd/utils.py,"ReplaceText(target='>' @(57,17)->(57,19))","def make_id(name):
+ 12 char rand hex string.
+ """"""
+ r = get_rand_string(12)
+ if len(name) <= 22:
+ name = name[:22]
+ return name + ""-"" + r
+ ","def make_id(name):
+ 12 char rand hex string.
+ """"""
+ r = get_rand_string(12)
+ if len(name) > 22:
+ name = name[:22]
+ return name + ""-"" + r
+ "
+363,https://:@github.com/raphaelm/python-sepaxml.git,98934ba5c863ffbc2bc770a34dd9ddea8edf2577,"@@ -70,7 +70,7 @@ def int_to_decimal_str(integer):
+ @return string The amount in currency with full stop decimal separator
+ """"""
+ int_string = str(integer)
+- if len(int_string) < 2:
++ if len(int_string) <= 2:
+ return ""0."" + int_string.zfill(2)
+ else:
+ return int_string[:-2] + ""."" + int_string[-2:]
+",sepaxml/utils.py,"ReplaceText(target='<=' @(73,23)->(73,24))","def int_to_decimal_str(integer):
+ @return string The amount in currency with full stop decimal separator
+ """"""
+ int_string = str(integer)
+ if len(int_string) < 2:
+ return ""0."" + int_string.zfill(2)
+ else:
+ return int_string[:-2] + ""."" + int_string[-2:]","def int_to_decimal_str(integer):
+ @return string The amount in currency with full stop decimal separator
+ """"""
+ int_string = str(integer)
+ if len(int_string) <= 2:
+ return ""0."" + int_string.zfill(2)
+ else:
+ return int_string[:-2] + ""."" + int_string[-2:]"
+364,https://:@github.com/scikit-image/scikit-image.git,2585a323ac57004179b0ba643f953162650f39ee,"@@ -51,7 +51,7 @@ def peak_local_max(image, min_distance=10, threshold='deprecated',
+ threshold_rel = threshold
+ # find top corner candidates above a threshold
+ corner_threshold = max(np.max(image.ravel()) * threshold_rel, threshold_abs)
+- image_t = (image >= corner_threshold) * 1
++ image_t = (image > corner_threshold) * 1
+
+ # get coordinates of peaks
+ coordinates = np.transpose(image_t.nonzero())
+",skimage/feature/peak.py,"ReplaceText(target='>' @(54,21)->(54,23))","def peak_local_max(image, min_distance=10, threshold='deprecated',
+ threshold_rel = threshold
+ # find top corner candidates above a threshold
+ corner_threshold = max(np.max(image.ravel()) * threshold_rel, threshold_abs)
+ image_t = (image >= corner_threshold) * 1
+
+ # get coordinates of peaks
+ coordinates = np.transpose(image_t.nonzero())","def peak_local_max(image, min_distance=10, threshold='deprecated',
+ threshold_rel = threshold
+ # find top corner candidates above a threshold
+ corner_threshold = max(np.max(image.ravel()) * threshold_rel, threshold_abs)
+ image_t = (image > corner_threshold) * 1
+
+ # get coordinates of peaks
+ coordinates = np.transpose(image_t.nonzero())"
+365,https://:@github.com/scikit-image/scikit-image.git,8084faf1f69c2c4ba79b6e85c7a2a06e1e7c77b8,"@@ -133,7 +133,7 @@ def reconstruction(seed, mask, method='dilation', selem=None, offset=None):
+ if offset == None:
+ if not all([d % 2 == 1 for d in selem.shape]):
+ ValueError(""Footprint dimensions must all be odd"")
+- offset = np.array([d / 2 for d in selem.shape])
++ offset = np.array([d // 2 for d in selem.shape])
+ # Cross out the center of the selem
+ selem[[slice(d, d + 1) for d in offset]] = False
+
+",skimage/morphology/greyreconstruct.py,"ReplaceText(target='//' @(136,29)->(136,30))","def reconstruction(seed, mask, method='dilation', selem=None, offset=None):
+ if offset == None:
+ if not all([d % 2 == 1 for d in selem.shape]):
+ ValueError(""Footprint dimensions must all be odd"")
+ offset = np.array([d / 2 for d in selem.shape])
+ # Cross out the center of the selem
+ selem[[slice(d, d + 1) for d in offset]] = False
+ ","def reconstruction(seed, mask, method='dilation', selem=None, offset=None):
+ if offset == None:
+ if not all([d % 2 == 1 for d in selem.shape]):
+ ValueError(""Footprint dimensions must all be odd"")
+ offset = np.array([d // 2 for d in selem.shape])
+ # Cross out the center of the selem
+ selem[[slice(d, d + 1) for d in offset]] = False
+ "
+366,https://:@github.com/scikit-image/scikit-image.git,d1629aec0f1a861106d54cb015b238e7fe542936,"@@ -28,7 +28,7 @@ def approximate_polygon(coords, tolerance):
+ ----------
+ .. [1] http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
+ """"""
+- if tolerance == 0:
++ if tolerance <= 0:
+ return coords
+
+ chain = np.zeros(coords.shape[0], 'bool')
+",skimage/measure/_polygon.py,"ReplaceText(target='<=' @(31,17)->(31,19))","def approximate_polygon(coords, tolerance):
+ ----------
+ .. [1] http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
+ """"""
+ if tolerance == 0:
+ return coords
+
+ chain = np.zeros(coords.shape[0], 'bool')","def approximate_polygon(coords, tolerance):
+ ----------
+ .. [1] http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
+ """"""
+ if tolerance <= 0:
+ return coords
+
+ chain = np.zeros(coords.shape[0], 'bool')"
+367,https://:@github.com/scikit-image/scikit-image.git,22f94d8707d3d9d2a36493403cbaeb61213dd68b,"@@ -163,7 +163,7 @@ def rotate(image, angle, resize=False, order=1, mode='constant', cval=0.):
+ tform = tform1 + tform2 + tform3
+
+ output_shape = None
+- if not resize:
++ if resize:
+ # determine shape of output image
+ corners = np.array([[1, 1], [1, rows], [cols, rows], [cols, 1]])
+ corners = tform(corners - 1)
+",skimage/transform/_warps.py,"ReplaceText(target='' @(166,7)->(166,11))","def rotate(image, angle, resize=False, order=1, mode='constant', cval=0.):
+ tform = tform1 + tform2 + tform3
+
+ output_shape = None
+ if not resize:
+ # determine shape of output image
+ corners = np.array([[1, 1], [1, rows], [cols, rows], [cols, 1]])
+ corners = tform(corners - 1)","def rotate(image, angle, resize=False, order=1, mode='constant', cval=0.):
+ tform = tform1 + tform2 + tform3
+
+ output_shape = None
+ if resize:
+ # determine shape of output image
+ corners = np.array([[1, 1], [1, rows], [cols, rows], [cols, 1]])
+ corners = tform(corners - 1)"
+368,https://:@github.com/scikit-image/scikit-image.git,794a4d7daebfdcb217fbf0a73b9d42e256ce45cd,"@@ -1085,7 +1085,7 @@ def _validate_lengths(narray, number_elements):
+ normshp = _normalize_shape(narray, number_elements)
+ for i in normshp:
+ chk = [1 if x is None else x for x in i]
+- chk = [1 if x > 0 else -1 for x in chk]
++ chk = [1 if x >= 0 else -1 for x in chk]
+ if (chk[0] < 0) or (chk[1] < 0):
+ fmt = ""%s cannot contain negative values.""
+ raise ValueError(fmt % (number_elements,))
+",skimage/util/arraypad.py,"ReplaceText(target='>=' @(1088,22)->(1088,23))","def _validate_lengths(narray, number_elements):
+ normshp = _normalize_shape(narray, number_elements)
+ for i in normshp:
+ chk = [1 if x is None else x for x in i]
+ chk = [1 if x > 0 else -1 for x in chk]
+ if (chk[0] < 0) or (chk[1] < 0):
+ fmt = ""%s cannot contain negative values.""
+ raise ValueError(fmt % (number_elements,))","def _validate_lengths(narray, number_elements):
+ normshp = _normalize_shape(narray, number_elements)
+ for i in normshp:
+ chk = [1 if x is None else x for x in i]
+ chk = [1 if x >= 0 else -1 for x in chk]
+ if (chk[0] < 0) or (chk[1] < 0):
+ fmt = ""%s cannot contain negative values.""
+ raise ValueError(fmt % (number_elements,))"
+369,https://:@github.com/scikit-image/scikit-image.git,5f46fd01be76ac8c7252ab35ba58609e81ad0ca0,"@@ -124,7 +124,7 @@ def _star_filter_kernel(m, n):
+ def _suppress_lines(feature_mask, image, sigma, line_threshold):
+ Axx, Axy, Ayy = _compute_auto_correlation(image, sigma)
+ feature_mask[(Axx + Ayy) * (Axx + Ayy)
+- < line_threshold * (Axx * Ayy - Axy * Axy)] = 0
++ > line_threshold * (Axx * Ayy - Axy * Axy)] = 0
+ return feature_mask
+
+
+",skimage/feature/censure.py,"ReplaceText(target='>' @(127,17)->(127,18))","def _star_filter_kernel(m, n):
+ def _suppress_lines(feature_mask, image, sigma, line_threshold):
+ Axx, Axy, Ayy = _compute_auto_correlation(image, sigma)
+ feature_mask[(Axx + Ayy) * (Axx + Ayy)
+ < line_threshold * (Axx * Ayy - Axy * Axy)] = 0
+ return feature_mask
+
+ ","def _star_filter_kernel(m, n):
+ def _suppress_lines(feature_mask, image, sigma, line_threshold):
+ Axx, Axy, Ayy = _compute_auto_correlation(image, sigma)
+ feature_mask[(Axx + Ayy) * (Axx + Ayy)
+ > line_threshold * (Axx * Ayy - Axy * Axy)] = 0
+ return feature_mask
+
+ "
+370,https://:@github.com/scikit-image/scikit-image.git,05aeb7c7fe89a70fa18294d69c9e12dd58fa5c08,"@@ -159,7 +159,7 @@ def reconstruction(seed, mask, method='dilation', selem=None, offset=None):
+ # Create a list of strides across the array to get the neighbors within
+ # a flattened array
+ value_stride = np.array(images.strides[1:]) / images.dtype.itemsize
+- image_stride = images.strides[0] / images.dtype.itemsize
++ image_stride = images.strides[0] // images.dtype.itemsize
+ selem_mgrid = np.mgrid[[slice(-o, d - o)
+ for d, o in zip(selem.shape, offset)]]
+ selem_offsets = selem_mgrid[:, selem].transpose()
+",skimage/morphology/greyreconstruct.py,"ReplaceText(target='//' @(162,37)->(162,38))","def reconstruction(seed, mask, method='dilation', selem=None, offset=None):
+ # Create a list of strides across the array to get the neighbors within
+ # a flattened array
+ value_stride = np.array(images.strides[1:]) / images.dtype.itemsize
+ image_stride = images.strides[0] / images.dtype.itemsize
+ selem_mgrid = np.mgrid[[slice(-o, d - o)
+ for d, o in zip(selem.shape, offset)]]
+ selem_offsets = selem_mgrid[:, selem].transpose()","def reconstruction(seed, mask, method='dilation', selem=None, offset=None):
+ # Create a list of strides across the array to get the neighbors within
+ # a flattened array
+ value_stride = np.array(images.strides[1:]) / images.dtype.itemsize
+ image_stride = images.strides[0] // images.dtype.itemsize
+ selem_mgrid = np.mgrid[[slice(-o, d - o)
+ for d, o in zip(selem.shape, offset)]]
+ selem_offsets = selem_mgrid[:, selem].transpose()"
+371,https://:@github.com/scikit-image/scikit-image.git,05fbc3fbfcc00157841c18b15b171d6477bfb5da,"@@ -119,7 +119,7 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=None,
+ spacing = np.array(spacing, np.double)
+ if not isinstance(sigma, coll.Iterable):
+ sigma = np.array([sigma, sigma, sigma], np.double)
+- elif isinstance(spacing, (list, tuple)):
++ elif isinstance(sigma, (list, tuple)):
+ sigma = np.array(sigma, np.double)
+ if (sigma > 0).any():
+ sigma /= spacing.astype(np.double)
+",skimage/segmentation/slic_superpixels.py,"ReplaceText(target='sigma' @(122,20)->(122,27))","def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=None,
+ spacing = np.array(spacing, np.double)
+ if not isinstance(sigma, coll.Iterable):
+ sigma = np.array([sigma, sigma, sigma], np.double)
+ elif isinstance(spacing, (list, tuple)):
+ sigma = np.array(sigma, np.double)
+ if (sigma > 0).any():
+ sigma /= spacing.astype(np.double)","def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=None,
+ spacing = np.array(spacing, np.double)
+ if not isinstance(sigma, coll.Iterable):
+ sigma = np.array([sigma, sigma, sigma], np.double)
+ elif isinstance(sigma, (list, tuple)):
+ sigma = np.array(sigma, np.double)
+ if (sigma > 0).any():
+ sigma /= spacing.astype(np.double)"
+372,https://:@github.com/scikit-image/scikit-image.git,1ca0eef825188ac5e9fc84b232b4783c166933ac,"@@ -94,7 +94,7 @@ def view_as_blocks(arr_in, block_shape):
+
+ arr_in = np.ascontiguousarray(arr_in)
+
+- new_shape = tuple(arr_shape / block_shape) + tuple(block_shape)
++ new_shape = tuple(arr_shape // block_shape) + tuple(block_shape)
+ new_strides = tuple(arr_in.strides * block_shape) + arr_in.strides
+
+ arr_out = as_strided(arr_in, shape=new_shape, strides=new_strides)
+",skimage/util/shape.py,"ReplaceText(target='//' @(97,32)->(97,33))","def view_as_blocks(arr_in, block_shape):
+
+ arr_in = np.ascontiguousarray(arr_in)
+
+ new_shape = tuple(arr_shape / block_shape) + tuple(block_shape)
+ new_strides = tuple(arr_in.strides * block_shape) + arr_in.strides
+
+ arr_out = as_strided(arr_in, shape=new_shape, strides=new_strides)","def view_as_blocks(arr_in, block_shape):
+
+ arr_in = np.ascontiguousarray(arr_in)
+
+ new_shape = tuple(arr_shape // block_shape) + tuple(block_shape)
+ new_strides = tuple(arr_in.strides * block_shape) + arr_in.strides
+
+ arr_out = as_strided(arr_in, shape=new_shape, strides=new_strides)"
+373,https://:@github.com/scikit-image/scikit-image.git,a38b1c12579214cf77785e9c85f30202b2048c4f,"@@ -136,7 +136,7 @@ def _clahe(image, ntiles_x, ntiles_y, clip_limit, nbins=128):
+ image = pad(image, ((0, h_pad), (0, w_pad)), mode='reflect')
+ h_inner, w_inner = image.shape
+
+- bin_size = 1 + NR_OF_GREY / nbins
++ bin_size = 1 + NR_OF_GREY // nbins
+ lut = np.arange(NR_OF_GREY)
+ lut //= bin_size
+ img_blocks = view_as_blocks(image, (height, width))
+",skimage/exposure/_adapthist.py,"ReplaceText(target='//' @(139,30)->(139,31))","def _clahe(image, ntiles_x, ntiles_y, clip_limit, nbins=128):
+ image = pad(image, ((0, h_pad), (0, w_pad)), mode='reflect')
+ h_inner, w_inner = image.shape
+
+ bin_size = 1 + NR_OF_GREY / nbins
+ lut = np.arange(NR_OF_GREY)
+ lut //= bin_size
+ img_blocks = view_as_blocks(image, (height, width))","def _clahe(image, ntiles_x, ntiles_y, clip_limit, nbins=128):
+ image = pad(image, ((0, h_pad), (0, w_pad)), mode='reflect')
+ h_inner, w_inner = image.shape
+
+ bin_size = 1 + NR_OF_GREY // nbins
+ lut = np.arange(NR_OF_GREY)
+ lut //= bin_size
+ img_blocks = view_as_blocks(image, (height, width))"
+374,https://:@github.com/scikit-image/scikit-image.git,9a192bf1cb899632253619385ad9814dbd61f63a,"@@ -16,7 +16,7 @@ from skimage import graph, data, io, segmentation, color
+ img = data.coffee()
+ labels = segmentation.slic(img, compactness=30, n_segments=400)
+ g = graph.rag_mean_color(img, labels)
+-labels2 = graph.merge_hierarchical(g, labels, 40)
++labels2 = graph.merge_hierarchical(labels, g, 40)
+ g2 = graph.rag_mean_color(img, labels2)
+
+ out = color.label2rgb(labels2, img, kind='avg')
+",doc/examples/plot_rag_merge.py,"ArgSwap(idxs=0<->1 @(19,10)->(19,34))","from skimage import graph, data, io, segmentation, color
+ img = data.coffee()
+ labels = segmentation.slic(img, compactness=30, n_segments=400)
+ g = graph.rag_mean_color(img, labels)
+ labels2 = graph.merge_hierarchical(g, labels, 40)
+ g2 = graph.rag_mean_color(img, labels2)
+
+ out = color.label2rgb(labels2, img, kind='avg')","from skimage import graph, data, io, segmentation, color
+ img = data.coffee()
+ labels = segmentation.slic(img, compactness=30, n_segments=400)
+ g = graph.rag_mean_color(img, labels)
+ labels2 = graph.merge_hierarchical(labels, g, 40)
+ g2 = graph.rag_mean_color(img, labels2)
+
+ out = color.label2rgb(labels2, img, kind='avg')"
+375,https://:@github.com/scikit-image/scikit-image.git,4bdde3d2aef2dd184e0b907983a15167326aec55,"@@ -254,7 +254,7 @@ class ImageCollection(object):
+ if ((self.conserve_memory and n != self._cached) or
+ (self.data[idx] is None)):
+ if self._frame_index:
+- fname, img_num = self._frame_index[idx]
++ fname, img_num = self._frame_index[n]
+ self.data[idx] = self.load_func(fname, img_num=img_num,
+ **self.load_func_kwargs)
+ else:
+",skimage/io/collection.py,"ReplaceText(target='n' @(257,55)->(257,58))","class ImageCollection(object):
+ if ((self.conserve_memory and n != self._cached) or
+ (self.data[idx] is None)):
+ if self._frame_index:
+ fname, img_num = self._frame_index[idx]
+ self.data[idx] = self.load_func(fname, img_num=img_num,
+ **self.load_func_kwargs)
+ else:","class ImageCollection(object):
+ if ((self.conserve_memory and n != self._cached) or
+ (self.data[idx] is None)):
+ if self._frame_index:
+ fname, img_num = self._frame_index[n]
+ self.data[idx] = self.load_func(fname, img_num=img_num,
+ **self.load_func_kwargs)
+ else:"
+376,https://:@github.com/scikit-image/scikit-image.git,84bcb583d76c1ec507b3d5794b6705d06383ced8,"@@ -288,7 +288,7 @@ def hessian_matrix_eigvals(Hxx, Hxy, Hyy):
+
+ """"""
+
+- return _image_orthogonal_matrix22_eigvals(Hyy, Hxy, Hyy)
++ return _image_orthogonal_matrix22_eigvals(Hxx, Hxy, Hyy)
+
+
+ def corner_kitchen_rosenfeld(image, mode='constant', cval=0):
+",skimage/feature/corner.py,"ReplaceText(target='Hxx' @(291,46)->(291,49))","def hessian_matrix_eigvals(Hxx, Hxy, Hyy):
+
+ """"""
+
+ return _image_orthogonal_matrix22_eigvals(Hyy, Hxy, Hyy)
+
+
+ def corner_kitchen_rosenfeld(image, mode='constant', cval=0):","def hessian_matrix_eigvals(Hxx, Hxy, Hyy):
+
+ """"""
+
+ return _image_orthogonal_matrix22_eigvals(Hxx, Hxy, Hyy)
+
+
+ def corner_kitchen_rosenfeld(image, mode='constant', cval=0):"
+377,https://:@github.com/scikit-image/scikit-image.git,33e36542d5f457a50c5fa00371fb9fe18a620f15,"@@ -84,7 +84,7 @@ def hough_line_peaks(hspace, angles, dists, min_distance=9, min_angle=10,
+ -min_angle:min_angle + 1]
+
+ for dist_idx, angle_idx in coords:
+- accum = hspace[dist_idx, angle_idx]
++ accum = hspace_max[dist_idx, angle_idx]
+ if accum > threshold:
+ # absolute coordinate grid for local neighbourhood suppression
+ dist_nh = dist_idx + dist_ext
+",skimage/transform/hough_transform.py,"ReplaceText(target='hspace_max' @(87,16)->(87,22))","def hough_line_peaks(hspace, angles, dists, min_distance=9, min_angle=10,
+ -min_angle:min_angle + 1]
+
+ for dist_idx, angle_idx in coords:
+ accum = hspace[dist_idx, angle_idx]
+ if accum > threshold:
+ # absolute coordinate grid for local neighbourhood suppression
+ dist_nh = dist_idx + dist_ext","def hough_line_peaks(hspace, angles, dists, min_distance=9, min_angle=10,
+ -min_angle:min_angle + 1]
+
+ for dist_idx, angle_idx in coords:
+ accum = hspace_max[dist_idx, angle_idx]
+ if accum > threshold:
+ # absolute coordinate grid for local neighbourhood suppression
+ dist_nh = dist_idx + dist_ext"
+378,https://:@github.com/scikit-image/scikit-image.git,bc52e4a411ab6d4aa10d38281e979158e6f21f19,"@@ -105,7 +105,7 @@ def hough_line_peaks(hspace, angles, dists, min_distance=9, min_angle=10,
+ angle_nh[angle_high] -= cols
+
+ # suppress neighbourhood
+- hspace[dist_nh, angle_nh] = 0
++ hspace_max[dist_nh, angle_nh] = 0
+
+ # add current line to peaks
+ hspace_peaks.append(accum)
+",skimage/transform/hough_transform.py,"ReplaceText(target='hspace_max' @(108,12)->(108,18))","def hough_line_peaks(hspace, angles, dists, min_distance=9, min_angle=10,
+ angle_nh[angle_high] -= cols
+
+ # suppress neighbourhood
+ hspace[dist_nh, angle_nh] = 0
+
+ # add current line to peaks
+ hspace_peaks.append(accum)","def hough_line_peaks(hspace, angles, dists, min_distance=9, min_angle=10,
+ angle_nh[angle_high] -= cols
+
+ # suppress neighbourhood
+ hspace_max[dist_nh, angle_nh] = 0
+
+ # add current line to peaks
+ hspace_peaks.append(accum)"
+379,https://:@github.com/scikit-image/scikit-image.git,2fb59b92435b9f67c091871cba701323b784ade7,"@@ -48,7 +48,7 @@ def imread(fname, dtype=None, img_num=None, **kwargs):
+ im = Image.open(f)
+ return pil_to_ndarray(im, dtype=dtype, img_num=img_num)
+ else:
+- im = Image.open(f)
++ im = Image.open(fname)
+ return pil_to_ndarray(im, dtype=dtype, img_num=img_num)
+
+
+",skimage/io/_plugins/pil_plugin.py,"ReplaceText(target='fname' @(51,24)->(51,25))","def imread(fname, dtype=None, img_num=None, **kwargs):
+ im = Image.open(f)
+ return pil_to_ndarray(im, dtype=dtype, img_num=img_num)
+ else:
+ im = Image.open(f)
+ return pil_to_ndarray(im, dtype=dtype, img_num=img_num)
+
+ ","def imread(fname, dtype=None, img_num=None, **kwargs):
+ im = Image.open(f)
+ return pil_to_ndarray(im, dtype=dtype, img_num=img_num)
+ else:
+ im = Image.open(fname)
+ return pil_to_ndarray(im, dtype=dtype, img_num=img_num)
+
+ "
+380,https://:@github.com/scikit-image/scikit-image.git,4ee3b2c5ac89f946a9b4bbf26665411bb7241ff4,"@@ -20,7 +20,7 @@ image = data.astronaut()
+ rows, cols, dim = image.shape
+ pyramid = tuple(pyramid_gaussian(image, downscale=2))
+
+-composite_image = np.zeros((rows, cols + cols / 2, 3), dtype=np.double)
++composite_image = np.zeros((rows, cols + cols // 2, 3), dtype=np.double)
+
+ composite_image[:rows, :cols, :] = pyramid[0]
+
+",doc/examples/transform/plot_pyramid.py,"ReplaceText(target='//' @(23,46)->(23,47))","image = data.astronaut()
+ rows, cols, dim = image.shape
+ pyramid = tuple(pyramid_gaussian(image, downscale=2))
+
+ composite_image = np.zeros((rows, cols + cols / 2, 3), dtype=np.double)
+
+ composite_image[:rows, :cols, :] = pyramid[0]
+ ","image = data.astronaut()
+ rows, cols, dim = image.shape
+ pyramid = tuple(pyramid_gaussian(image, downscale=2))
+
+ composite_image = np.zeros((rows, cols + cols // 2, 3), dtype=np.double)
+
+ composite_image[:rows, :cols, :] = pyramid[0]
+ "
+381,https://:@github.com/scikit-image/scikit-image.git,472a420d86ff363cbb11df4e4b76ec090e0d015c,"@@ -634,7 +634,7 @@ def skeletonize_3d(image, *, img=None):
+ raise ValueError(""skeletonize_3d can only handle 2D or 3D images; ""
+ ""got image.ndim = %s instead."" % image.ndim)
+ image = np.ascontiguousarray(image)
+- image = img_as_ubyte(img, force_copy=False)
++ image = img_as_ubyte(image, force_copy=False)
+
+ # make an in image 3D and pad it w/ zeros to simplify dealing w/ boundaries
+ # NB: careful here to not clobber the original *and* minimize copying
+",skimage/morphology/_skeletonize.py,"ReplaceText(target='image' @(637,25)->(637,28))","def skeletonize_3d(image, *, img=None):
+ raise ValueError(""skeletonize_3d can only handle 2D or 3D images; ""
+ ""got image.ndim = %s instead."" % image.ndim)
+ image = np.ascontiguousarray(image)
+ image = img_as_ubyte(img, force_copy=False)
+
+ # make an in image 3D and pad it w/ zeros to simplify dealing w/ boundaries
+ # NB: careful here to not clobber the original *and* minimize copying","def skeletonize_3d(image, *, img=None):
+ raise ValueError(""skeletonize_3d can only handle 2D or 3D images; ""
+ ""got image.ndim = %s instead."" % image.ndim)
+ image = np.ascontiguousarray(image)
+ image = img_as_ubyte(image, force_copy=False)
+
+ # make an in image 3D and pad it w/ zeros to simplify dealing w/ boundaries
+ # NB: careful here to not clobber the original *and* minimize copying"
+382,https://:@github.com/scikit-image/scikit-image.git,1539f238e52610f5e7607d5b447b5c491e3455eb,"@@ -242,7 +242,7 @@ def test_arraymap_update():
+ in_values = np.unique(np.random.randint(0, 200, size=5))
+ out_values = np.random.random(len(in_values))
+ m = ArrayMap(in_values, out_values)
+- image = np.random.randint(1, len(in_values), size=(512, 512))
++ image = np.random.randint(1, len(m), size=(512, 512))
+ assert np.all(m[image] < 1) # missing values map to 0.
+ m[1:] += 1
+ assert np.all(m[image] >= 1)
+",skimage/segmentation/tests/test_join.py,"ReplaceText(target='m' @(245,37)->(245,46))","def test_arraymap_update():
+ in_values = np.unique(np.random.randint(0, 200, size=5))
+ out_values = np.random.random(len(in_values))
+ m = ArrayMap(in_values, out_values)
+ image = np.random.randint(1, len(in_values), size=(512, 512))
+ assert np.all(m[image] < 1) # missing values map to 0.
+ m[1:] += 1
+ assert np.all(m[image] >= 1)","def test_arraymap_update():
+ in_values = np.unique(np.random.randint(0, 200, size=5))
+ out_values = np.random.random(len(in_values))
+ m = ArrayMap(in_values, out_values)
+ image = np.random.randint(1, len(m), size=(512, 512))
+ assert np.all(m[image] < 1) # missing values map to 0.
+ m[1:] += 1
+ assert np.all(m[image] >= 1)"
+383,https://:@github.com/globusonline/agamemnon.git,6460e336b2a3fd359364f85e39d6e3222077621e,"@@ -233,7 +233,7 @@ class DataStore(object):
+ source_node_key = value
+ elif column.startswith('source__'):
+ source_attributes[column[8:]] = value
+- source = prim.Node(self, source_node_type, source_node_key, values)
++ source = prim.Node(self, source_node_type, source_node_key, source_attributes)
+ rel_key = RELATIONSHIP_KEY_PATTERN % (rel_type, rel_key)
+ return self.get_outgoing_relationship(rel_type, source, (rel_key, values))
+
+",agamemnon/factory.py,"ReplaceText(target='source_attributes' @(236,68)->(236,74))","class DataStore(object):
+ source_node_key = value
+ elif column.startswith('source__'):
+ source_attributes[column[8:]] = value
+ source = prim.Node(self, source_node_type, source_node_key, values)
+ rel_key = RELATIONSHIP_KEY_PATTERN % (rel_type, rel_key)
+ return self.get_outgoing_relationship(rel_type, source, (rel_key, values))
+ ","class DataStore(object):
+ source_node_key = value
+ elif column.startswith('source__'):
+ source_attributes[column[8:]] = value
+ source = prim.Node(self, source_node_type, source_node_key, source_attributes)
+ rel_key = RELATIONSHIP_KEY_PATTERN % (rel_type, rel_key)
+ return self.get_outgoing_relationship(rel_type, source, (rel_key, values))
+ "
+384,https://:@github.com/chiptopher/guet.git,f95c54917b51e65f47789534ab88ecbede1838eb,"@@ -11,6 +11,6 @@ def _recursive_directory_find(path: Path, directory_name: str) -> str:
+ raise FileNotFoundError()
+ joined_with_driectory = path.joinpath(directory_name)
+ if joined_with_driectory.is_dir():
+- return str(joined_with_driectory)
++ return str(path)
+ else:
+ return _recursive_directory_find(path.parent, directory_name)
+",guet/util/_recursive_directory_find.py,"ReplaceText(target='path' @(14,19)->(14,40))","def _recursive_directory_find(path: Path, directory_name: str) -> str:
+ raise FileNotFoundError()
+ joined_with_driectory = path.joinpath(directory_name)
+ if joined_with_driectory.is_dir():
+ return str(joined_with_driectory)
+ else:
+ return _recursive_directory_find(path.parent, directory_name)","def _recursive_directory_find(path: Path, directory_name: str) -> str:
+ raise FileNotFoundError()
+ joined_with_driectory = path.joinpath(directory_name)
+ if joined_with_driectory.is_dir():
+ return str(path)
+ else:
+ return _recursive_directory_find(path.parent, directory_name)"
+385,https://:@github.com/justinsalamon/scaper.git,520ae608ebcbcc5e5438ca5c7967dc2479454038,"@@ -193,7 +193,7 @@ def generate_from_jams(jams_infile, audio_outfile, fg_path=None, bg_path=None,
+ tfm.trim(sliceop['slice_start'], sliceop['slice_end'])
+ tfm.build(audio_file, tmpfiles[-1].name)
+ # Copy result back to original file
+- shutil.copyfile(tmpfiles[-1].name, audio_outfile)
++ shutil.copyfile(tmpfiles[-1].name, audio_file)
+
+ # Optionally save new jams file
+ if jams_outfile is not None:
+",scaper/core.py,"ReplaceText(target='audio_file' @(196,55)->(196,68))","def generate_from_jams(jams_infile, audio_outfile, fg_path=None, bg_path=None,
+ tfm.trim(sliceop['slice_start'], sliceop['slice_end'])
+ tfm.build(audio_file, tmpfiles[-1].name)
+ # Copy result back to original file
+ shutil.copyfile(tmpfiles[-1].name, audio_outfile)
+
+ # Optionally save new jams file
+ if jams_outfile is not None:","def generate_from_jams(jams_infile, audio_outfile, fg_path=None, bg_path=None,
+ tfm.trim(sliceop['slice_start'], sliceop['slice_end'])
+ tfm.build(audio_file, tmpfiles[-1].name)
+ # Copy result back to original file
+ shutil.copyfile(tmpfiles[-1].name, audio_file)
+
+ # Optionally save new jams file
+ if jams_outfile is not None:"
+386,https://:@github.com/markokr/rarfile.git,7fd6b2ca3efb81f7c4dffa6b6cef347b7d6ba043,"@@ -833,7 +833,7 @@ class RarFile:
+ if dirs:
+ dirs.sort(reverse=True)
+ for dst, inf in dirs:
+- self._set_attrs(dst, inf)
++ self._set_attrs(inf, dst)
+
+ def testrar(self, pwd=None):
+ """"""Read all files and test CRC.
+",rarfile.py,"ArgSwap(idxs=0<->1 @(836,16)->(836,31))","class RarFile:
+ if dirs:
+ dirs.sort(reverse=True)
+ for dst, inf in dirs:
+ self._set_attrs(dst, inf)
+
+ def testrar(self, pwd=None):
+ """"""Read all files and test CRC.","class RarFile:
+ if dirs:
+ dirs.sort(reverse=True)
+ for dst, inf in dirs:
+ self._set_attrs(inf, dst)
+
+ def testrar(self, pwd=None):
+ """"""Read all files and test CRC."
+387,https://:@github.com/rougier/freetype-py.git,b21f15fb02eb44a656c250357665d1d7dc50bef6,"@@ -44,7 +44,7 @@ if __name__ == '__main__':
+ y = height-baseline-top
+ kerning = face.get_kerning(previous, c)
+ x += (kerning.x >> 6)
+- Z[y:y+h,x:x+w] |= numpy.array(bitmap.buffer).reshape(h,w)
++ Z[y:y+h,x:x+w] += numpy.array(bitmap.buffer).reshape(h,w)
+ x += (slot.advance.x >> 6)
+ previous = c
+
+",examples/hello-world.py,"ReplaceText(target='+=' @(47,23)->(47,25))","if __name__ == '__main__':
+ y = height-baseline-top
+ kerning = face.get_kerning(previous, c)
+ x += (kerning.x >> 6)
+ Z[y:y+h,x:x+w] |= numpy.array(bitmap.buffer).reshape(h,w)
+ x += (slot.advance.x >> 6)
+ previous = c
+ ","if __name__ == '__main__':
+ y = height-baseline-top
+ kerning = face.get_kerning(previous, c)
+ x += (kerning.x >> 6)
+ Z[y:y+h,x:x+w] += numpy.array(bitmap.buffer).reshape(h,w)
+ x += (slot.advance.x >> 6)
+ previous = c
+ "
+388,https://:@github.com/piotrmaslanka/satella.git,24018c366401278a79da72097f1c594c188f5220,"@@ -15,7 +15,7 @@ def _merge(v1, v2):
+
+ if isinstance(v1, list) and isinstance(v2, list):
+ v1.extend(v2)
+- return v2
++ return v1
+
+ raise TypeError
+
+",satella/coding/algos.py,"ReplaceText(target='v1' @(18,15)->(18,17))","def _merge(v1, v2):
+
+ if isinstance(v1, list) and isinstance(v2, list):
+ v1.extend(v2)
+ return v2
+
+ raise TypeError
+ ","def _merge(v1, v2):
+
+ if isinstance(v1, list) and isinstance(v2, list):
+ v1.extend(v2)
+ return v1
+
+ raise TypeError
+ "
+389,https://:@github.com/piotrmaslanka/satella.git,4828537442e39bd6592413a5b4a2421a079edc91,"@@ -194,7 +194,7 @@ class Heap(object):
+ :return: Iterator
+ """"""
+ while self:
+- if self.heap[0] >= less:
++ if self.heap[0] < less:
+ return
+ yield self.pop()
+
+",satella/coding/structures.py,"ReplaceText(target='<' @(197,28)->(197,30))","class Heap(object):
+ :return: Iterator
+ """"""
+ while self:
+ if self.heap[0] >= less:
+ return
+ yield self.pop()
+ ","class Heap(object):
+ :return: Iterator
+ """"""
+ while self:
+ if self.heap[0] < less:
+ return
+ yield self.pop()
+ "
+390,https://:@github.com/piotrmaslanka/satella.git,fab19fa60841455e2ec0ec4493c618b7f5225f7d,"@@ -35,7 +35,7 @@ class MeasurableMixin:
+ elapsed = value_getter() - future.old_value
+ self.handle(logging_level, elapsed, **labels)
+
+- future.add_done_callback(future)
++ future.add_done_callback(on_future_done)
+
+ def measure(self, include_exceptions: bool = True,
+ logging_level: MetricLevel = MetricLevel.RUNTIME,
+",satella/instrumentation/metrics/metric_types/measurable_mixin.py,"ReplaceText(target='on_future_done' @(38,33)->(38,39))","class MeasurableMixin:
+ elapsed = value_getter() - future.old_value
+ self.handle(logging_level, elapsed, **labels)
+
+ future.add_done_callback(future)
+
+ def measure(self, include_exceptions: bool = True,
+ logging_level: MetricLevel = MetricLevel.RUNTIME,","class MeasurableMixin:
+ elapsed = value_getter() - future.old_value
+ self.handle(logging_level, elapsed, **labels)
+
+ future.add_done_callback(on_future_done)
+
+ def measure(self, include_exceptions: bool = True,
+ logging_level: MetricLevel = MetricLevel.RUNTIME,"
+391,https://:@github.com/piotrmaslanka/satella.git,a9b866bd76586a440918130d52ca933529ac521a,"@@ -117,7 +117,7 @@ class Proxy(tp.Generic[T]):
+ return self.__obj or other
+
+ def __and__(self, other):
+- return self.__obj or other
++ return self.__obj and other
+
+ def __le__(self, other):
+ return self.__obj <= other
+",satella/coding/structures/proxy.py,"ReplaceText(target='and' @(120,26)->(120,28))","class Proxy(tp.Generic[T]):
+ return self.__obj or other
+
+ def __and__(self, other):
+ return self.__obj or other
+
+ def __le__(self, other):
+ return self.__obj <= other","class Proxy(tp.Generic[T]):
+ return self.__obj or other
+
+ def __and__(self, other):
+ return self.__obj and other
+
+ def __le__(self, other):
+ return self.__obj <= other"
+392,https://:@github.com/dmlc/keras.git,2662d81a9c925501831f0acb805c9e8adcde0a32,"@@ -160,7 +160,7 @@ class Adam(Optimizer):
+ m_b_t = m_t / (1 - beta_1_t)
+ v_b_t = v_t / (1 - beta_2_t)
+
+- p_t = p - self.lr * m_b_t / (T.sqrt(v_t) + self.epsilon)
++ p_t = p - self.lr * m_b_t / (T.sqrt(v_b_t) + self.epsilon)
+
+ updates.append((m, m_t))
+ updates.append((v, v_t))
+",keras/optimizers.py,"ReplaceText(target='v_b_t' @(163,48)->(163,51))","class Adam(Optimizer):
+ m_b_t = m_t / (1 - beta_1_t)
+ v_b_t = v_t / (1 - beta_2_t)
+
+ p_t = p - self.lr * m_b_t / (T.sqrt(v_t) + self.epsilon)
+
+ updates.append((m, m_t))
+ updates.append((v, v_t))","class Adam(Optimizer):
+ m_b_t = m_t / (1 - beta_1_t)
+ v_b_t = v_t / (1 - beta_2_t)
+
+ p_t = p - self.lr * m_b_t / (T.sqrt(v_b_t) + self.epsilon)
+
+ updates.append((m, m_t))
+ updates.append((v, v_t))"
+393,https://:@github.com/dmlc/keras.git,cc10c4d907d959eb9009ad502c727542a5259613,"@@ -69,7 +69,7 @@ def skipgrams(sequence, vocabulary_size,
+ if not wi:
+ continue
+ if sampling_table is not None:
+- if sampling_table[i] < random.random():
++ if sampling_table[wi] < random.random():
+ continue
+
+ window_start = max(0, i-window_size)
+",keras/preprocessing/sequence.py,"ReplaceText(target='wi' @(72,30)->(72,31))","def skipgrams(sequence, vocabulary_size,
+ if not wi:
+ continue
+ if sampling_table is not None:
+ if sampling_table[i] < random.random():
+ continue
+
+ window_start = max(0, i-window_size)","def skipgrams(sequence, vocabulary_size,
+ if not wi:
+ continue
+ if sampling_table is not None:
+ if sampling_table[wi] < random.random():
+ continue
+
+ window_start = max(0, i-window_size)"
+394,https://:@github.com/dmlc/keras.git,e3695591704a21c6d0d6236c11c1bad7de4e314c,"@@ -58,7 +58,7 @@ class SimpleRNN(Layer):
+ mask = T.addbroadcast(mask[:, :, np.newaxis], 2)
+
+ mask_tm1 = alloc_zeros_matrix(*mask.shape)
+- mask_tm1 = T.addbroadcast(T.set_subtensor(mask[1:, :, :], mask[:-1, :, :]), 2)
++ mask_tm1 = T.addbroadcast(T.set_subtensor(mask_tm1[1:, :, :], mask[:-1, :, :]), 2)
+
+ # scan = theano symbolic loop.
+ # See: http://deeplearning.net/software/theano/library/scan.html
+",keras/layers/recurrent.py,"ReplaceText(target='mask_tm1' @(61,50)->(61,54))","class SimpleRNN(Layer):
+ mask = T.addbroadcast(mask[:, :, np.newaxis], 2)
+
+ mask_tm1 = alloc_zeros_matrix(*mask.shape)
+ mask_tm1 = T.addbroadcast(T.set_subtensor(mask[1:, :, :], mask[:-1, :, :]), 2)
+
+ # scan = theano symbolic loop.
+ # See: http://deeplearning.net/software/theano/library/scan.html","class SimpleRNN(Layer):
+ mask = T.addbroadcast(mask[:, :, np.newaxis], 2)
+
+ mask_tm1 = alloc_zeros_matrix(*mask.shape)
+ mask_tm1 = T.addbroadcast(T.set_subtensor(mask_tm1[1:, :, :], mask[:-1, :, :]), 2)
+
+ # scan = theano symbolic loop.
+ # See: http://deeplearning.net/software/theano/library/scan.html"
+395,https://:@github.com/dmlc/keras.git,c315b0d7a95b6677452300bdefd526b444951819,"@@ -218,7 +218,7 @@ class GaussianNoise(MaskedLayer):
+
+ def get_output(self, train=False):
+ X = self.get_input(train)
+- if train or self.sigma == 0:
++ if not train or self.sigma == 0:
+ return X
+ else:
+ return X + srng.normal(size=X.shape, avg=0.0, std=self.sigma,
+",keras/layers/core.py,"ReplaceText(target='not ' @(221,11)->(221,11))","class GaussianNoise(MaskedLayer):
+
+ def get_output(self, train=False):
+ X = self.get_input(train)
+ if train or self.sigma == 0:
+ return X
+ else:
+ return X + srng.normal(size=X.shape, avg=0.0, std=self.sigma,","class GaussianNoise(MaskedLayer):
+
+ def get_output(self, train=False):
+ X = self.get_input(train)
+ if not train or self.sigma == 0:
+ return X
+ else:
+ return X + srng.normal(size=X.shape, avg=0.0, std=self.sigma,"
+396,https://:@github.com/dmlc/keras.git,46a2fb6fd8e52b02df78f1416cc9fbd4b3156604,"@@ -42,7 +42,7 @@ class Optimizer(object):
+ grads = [clip_norm(g, self.clipnorm, norm) for g in grads]
+
+ if hasattr(self, 'clipvalue') and self.clipvalue > 0:
+- grads = [T.clip(g, self.clipvalue, -self.clipvalue) for g in grads]
++ grads = [T.clip(g, -self.clipvalue, self.clipvalue) for g in grads]
+
+ return grads
+
+",keras/optimizers.py,"ArgSwap(idxs=1<->2 @(45,21)->(45,27))","class Optimizer(object):
+ grads = [clip_norm(g, self.clipnorm, norm) for g in grads]
+
+ if hasattr(self, 'clipvalue') and self.clipvalue > 0:
+ grads = [T.clip(g, self.clipvalue, -self.clipvalue) for g in grads]
+
+ return grads
+ ","class Optimizer(object):
+ grads = [clip_norm(g, self.clipnorm, norm) for g in grads]
+
+ if hasattr(self, 'clipvalue') and self.clipvalue > 0:
+ grads = [T.clip(g, -self.clipvalue, self.clipvalue) for g in grads]
+
+ return grads
+ "
+397,https://:@github.com/dmlc/keras.git,c2534964b76015eb3d76261b025c7556b354764c,"@@ -158,7 +158,7 @@ class SimpleRNN(Recurrent):
+ assert len(states) == 1
+ prev_output = states[0]
+ h = K.dot(x, self.W) + self.b
+- output = self.activation(h * K.dot(prev_output, self.U))
++ output = self.activation(h + K.dot(prev_output, self.U))
+ return output, [output]
+
+ def get_config(self):
+",keras/layers/recurrent.py,"ReplaceText(target='+' @(161,35)->(161,36))","class SimpleRNN(Recurrent):
+ assert len(states) == 1
+ prev_output = states[0]
+ h = K.dot(x, self.W) + self.b
+ output = self.activation(h * K.dot(prev_output, self.U))
+ return output, [output]
+
+ def get_config(self):","class SimpleRNN(Recurrent):
+ assert len(states) == 1
+ prev_output = states[0]
+ h = K.dot(x, self.W) + self.b
+ output = self.activation(h + K.dot(prev_output, self.U))
+ return output, [output]
+
+ def get_config(self):"
+398,https://:@github.com/dmlc/keras.git,3d51a26749937cb1a1aec40c20bc505e82809dce,"@@ -449,7 +449,7 @@ class Graph(Layer):
+ self.namespace.add(sh_name)
+ self.nodes[sh_name] = sh
+ self.node_config.append({'name': sh_name,
+- 'inputs': [s],
++ 'inputs': [name],
+ 'create_output': create_output})
+ if create_output:
+ self.add_output(sh_name, input=sh_name)
+",keras/layers/containers.py,"ReplaceText(target='name' @(452,52)->(452,53))","class Graph(Layer):
+ self.namespace.add(sh_name)
+ self.nodes[sh_name] = sh
+ self.node_config.append({'name': sh_name,
+ 'inputs': [s],
+ 'create_output': create_output})
+ if create_output:
+ self.add_output(sh_name, input=sh_name)","class Graph(Layer):
+ self.namespace.add(sh_name)
+ self.nodes[sh_name] = sh
+ self.node_config.append({'name': sh_name,
+ 'inputs': [name],
+ 'create_output': create_output})
+ if create_output:
+ self.add_output(sh_name, input=sh_name)"
+399,https://:@github.com/dmlc/keras.git,42b3d37a54545882699283b5764cf3c997f8d9cd,"@@ -43,7 +43,7 @@ def test_skipgrams():
+ couples, labels = skipgrams(np.arange(5), vocabulary_size=5, window_size=1,
+ categorical=True)
+ for couple in couples:
+- assert couple[0] - couple[1] < 3
++ assert couple[0] - couple[1] <= 3
+ for l in labels:
+ assert len(l) == 2
+
+",tests/keras/preprocessing/test_sequence.py,"ReplaceText(target='<=' @(46,37)->(46,38))","def test_skipgrams():
+ couples, labels = skipgrams(np.arange(5), vocabulary_size=5, window_size=1,
+ categorical=True)
+ for couple in couples:
+ assert couple[0] - couple[1] < 3
+ for l in labels:
+ assert len(l) == 2
+ ","def test_skipgrams():
+ couples, labels = skipgrams(np.arange(5), vocabulary_size=5, window_size=1,
+ categorical=True)
+ for couple in couples:
+ assert couple[0] - couple[1] <= 3
+ for l in labels:
+ assert len(l) == 2
+ "
+400,https://:@github.com/dmlc/keras.git,e2e281e14f619d9ade61c46567e2c599db070f16,"@@ -23,7 +23,7 @@ def test_unitnorm_constraint():
+ lookup.compile(loss='binary_crossentropy', optimizer='sgd',
+ class_mode='binary')
+ lookup.train_on_batch(X1, np.array([[1], [0]], dtype='int32'))
+- norm = np.linalg.norm(K.get_value(lookup.params[0]), axis=1)
++ norm = np.linalg.norm(K.get_value(lookup.params[0]), axis=0)
+ assert_allclose(norm, np.ones_like(norm).astype('float32'), rtol=1e-05)
+
+
+",tests/keras/layers/test_embeddings.py,"ReplaceText(target='0' @(26,62)->(26,63))","def test_unitnorm_constraint():
+ lookup.compile(loss='binary_crossentropy', optimizer='sgd',
+ class_mode='binary')
+ lookup.train_on_batch(X1, np.array([[1], [0]], dtype='int32'))
+ norm = np.linalg.norm(K.get_value(lookup.params[0]), axis=1)
+ assert_allclose(norm, np.ones_like(norm).astype('float32'), rtol=1e-05)
+
+ ","def test_unitnorm_constraint():
+ lookup.compile(loss='binary_crossentropy', optimizer='sgd',
+ class_mode='binary')
+ lookup.train_on_batch(X1, np.array([[1], [0]], dtype='int32'))
+ norm = np.linalg.norm(K.get_value(lookup.params[0]), axis=0)
+ assert_allclose(norm, np.ones_like(norm).astype('float32'), rtol=1e-05)
+
+ "
+401,https://:@github.com/dmlc/keras.git,e2e281e14f619d9ade61c46567e2c599db070f16,"@@ -54,7 +54,7 @@ def test_identity_oddballs():
+ def test_unitnorm():
+ unitnorm_instance = constraints.unitnorm()
+ normalized = unitnorm_instance(K.variable(example_array))
+- norm_of_normalized = np.sqrt(np.sum(K.eval(normalized)**2, axis=1))
++ norm_of_normalized = np.sqrt(np.sum(K.eval(normalized)**2, axis=0))
+ # in the unit norm constraint, it should be equal to 1.
+ difference = norm_of_normalized - 1.
+ largest_difference = np.max(np.abs(difference))
+",tests/keras/test_constraints.py,"ReplaceText(target='0' @(57,68)->(57,69))","def test_identity_oddballs():
+ def test_unitnorm():
+ unitnorm_instance = constraints.unitnorm()
+ normalized = unitnorm_instance(K.variable(example_array))
+ norm_of_normalized = np.sqrt(np.sum(K.eval(normalized)**2, axis=1))
+ # in the unit norm constraint, it should be equal to 1.
+ difference = norm_of_normalized - 1.
+ largest_difference = np.max(np.abs(difference))","def test_identity_oddballs():
+ def test_unitnorm():
+ unitnorm_instance = constraints.unitnorm()
+ normalized = unitnorm_instance(K.variable(example_array))
+ norm_of_normalized = np.sqrt(np.sum(K.eval(normalized)**2, axis=0))
+ # in the unit norm constraint, it should be equal to 1.
+ difference = norm_of_normalized - 1.
+ largest_difference = np.max(np.abs(difference))"
+402,https://:@github.com/dmlc/keras.git,f4af11c7300816ca28b6b707fdf7d64b00430074,"@@ -52,7 +52,7 @@ def pad_sequences(sequences, maxlen=None, dtype='int32', padding='pre', truncati
+ elif truncating == 'post':
+ trunc = s[:maxlen]
+ else:
+- raise ValueError(""Truncating type '%s' not understood"" % padding)
++ raise ValueError(""Truncating type '%s' not understood"" % truncating)
+
+ # check `trunc` has expected shape
+ trunc = np.asarray(trunc, dtype=dtype)
+",keras/preprocessing/sequence.py,"ReplaceText(target='truncating' @(55,69)->(55,76))","def pad_sequences(sequences, maxlen=None, dtype='int32', padding='pre', truncati
+ elif truncating == 'post':
+ trunc = s[:maxlen]
+ else:
+ raise ValueError(""Truncating type '%s' not understood"" % padding)
+
+ # check `trunc` has expected shape
+ trunc = np.asarray(trunc, dtype=dtype)","def pad_sequences(sequences, maxlen=None, dtype='int32', padding='pre', truncati
+ elif truncating == 'post':
+ trunc = s[:maxlen]
+ else:
+ raise ValueError(""Truncating type '%s' not understood"" % truncating)
+
+ # check `trunc` has expected shape
+ trunc = np.asarray(trunc, dtype=dtype)"
+403,https://:@github.com/dmlc/keras.git,b61235b77f87288d62ddd8ce4aae88b76babf887,"@@ -153,7 +153,7 @@ def check_array_lengths(X, Y, W):
+ raise Exception('All input arrays (x) should have '
+ 'the same number of samples.')
+ set_y = set(y_lengths)
+- if len(set_x) != 1:
++ if len(set_y) != 1:
+ raise Exception('All target arrays (y) should have '
+ 'the same number of samples.')
+ set_w = set(w_lengths)
+",keras/engine/training.py,"ReplaceText(target='set_y' @(156,11)->(156,16))","def check_array_lengths(X, Y, W):
+ raise Exception('All input arrays (x) should have '
+ 'the same number of samples.')
+ set_y = set(y_lengths)
+ if len(set_x) != 1:
+ raise Exception('All target arrays (y) should have '
+ 'the same number of samples.')
+ set_w = set(w_lengths)","def check_array_lengths(X, Y, W):
+ raise Exception('All input arrays (x) should have '
+ 'the same number of samples.')
+ set_y = set(y_lengths)
+ if len(set_y) != 1:
+ raise Exception('All target arrays (y) should have '
+ 'the same number of samples.')
+ set_w = set(w_lengths)"
+404,https://:@github.com/dmlc/keras.git,98974efa5f51d6f55afbf2bc125d6fd090bcf782,"@@ -510,7 +510,7 @@ class Model(Container):
+ 'it should have one entry per model outputs. '
+ 'The model has ' + str(len(self.outputs)) +
+ ' outputs, but you passed loss_weights=' +
+- str(loss))
++ str(loss_weights))
+ loss_weights_list = loss_weights
+ else:
+ raise Exception('Could not interpret loss_weights argument: ' +
+",keras/engine/training.py,"ReplaceText(target='loss_weights' @(513,36)->(513,40))","class Model(Container):
+ 'it should have one entry per model outputs. '
+ 'The model has ' + str(len(self.outputs)) +
+ ' outputs, but you passed loss_weights=' +
+ str(loss))
+ loss_weights_list = loss_weights
+ else:
+ raise Exception('Could not interpret loss_weights argument: ' +","class Model(Container):
+ 'it should have one entry per model outputs. '
+ 'The model has ' + str(len(self.outputs)) +
+ ' outputs, but you passed loss_weights=' +
+ str(loss_weights))
+ loss_weights_list = loss_weights
+ else:
+ raise Exception('Could not interpret loss_weights argument: ' +"
+405,https://:@github.com/dmlc/keras.git,48ae7217e482a1a3624d6e5380c972a653cacfaf,"@@ -1136,7 +1136,7 @@ def rnn(step_function, inputs, initial_states,
+
+ if mask is not None:
+ if go_backwards:
+- mask = tf.reverse(mask, [True] + [False] * (ndim - 1))
++ mask = tf.reverse(mask, [True] + [False] * (ndim - 2))
+
+ # Transpose not supported by bool tensor types, hence round-trip to uint8.
+ mask = tf.cast(mask, tf.uint8)
+",keras/backend/tensorflow_backend.py,"ReplaceText(target='2' @(1139,67)->(1139,68))","def rnn(step_function, inputs, initial_states,
+
+ if mask is not None:
+ if go_backwards:
+ mask = tf.reverse(mask, [True] + [False] * (ndim - 1))
+
+ # Transpose not supported by bool tensor types, hence round-trip to uint8.
+ mask = tf.cast(mask, tf.uint8)","def rnn(step_function, inputs, initial_states,
+
+ if mask is not None:
+ if go_backwards:
+ mask = tf.reverse(mask, [True] + [False] * (ndim - 2))
+
+ # Transpose not supported by bool tensor types, hence round-trip to uint8.
+ mask = tf.cast(mask, tf.uint8)"
+406,https://:@github.com/dmlc/keras.git,41741c38e5f29ebf69fe9bd82a604eba3c0b97e5,"@@ -1261,7 +1261,7 @@ def rnn(step_function, inputs, initial_states,
+ new_state = new_states[0]
+ else:
+ # return dummy state, otherwise _dynamic_rnn_loop breaks
+- new_state = output
++ new_state = state
+ return output, new_state
+
+ _step.state_size = state_size * nb_states
+",keras/backend/tensorflow_backend.py,"ReplaceText(target='state' @(1264,32)->(1264,38))","def rnn(step_function, inputs, initial_states,
+ new_state = new_states[0]
+ else:
+ # return dummy state, otherwise _dynamic_rnn_loop breaks
+ new_state = output
+ return output, new_state
+
+ _step.state_size = state_size * nb_states","def rnn(step_function, inputs, initial_states,
+ new_state = new_states[0]
+ else:
+ # return dummy state, otherwise _dynamic_rnn_loop breaks
+ new_state = state
+ return output, new_state
+
+ _step.state_size = state_size * nb_states"
+407,https://:@github.com/dmlc/keras.git,80fbbc3a6a2a30f391bad2aa85e7558c50ca0709,"@@ -411,7 +411,7 @@ class ImageDataGenerator(object):
+
+ if self.zca_whitening:
+ flatX = np.reshape(X, (X.shape[0], X.shape[1] * X.shape[2] * X.shape[3]))
+- sigma = np.dot(flatX.T, flatX) / flatX.shape[1]
++ sigma = np.dot(flatX.T, flatX) / flatX.shape[0]
+ U, S, V = linalg.svd(sigma)
+ self.principal_components = np.dot(np.dot(U, np.diag(1. / np.sqrt(S + 10e-7))), U.T)
+
+",keras/preprocessing/image.py,"ReplaceText(target='0' @(414,57)->(414,58))","class ImageDataGenerator(object):
+
+ if self.zca_whitening:
+ flatX = np.reshape(X, (X.shape[0], X.shape[1] * X.shape[2] * X.shape[3]))
+ sigma = np.dot(flatX.T, flatX) / flatX.shape[1]
+ U, S, V = linalg.svd(sigma)
+ self.principal_components = np.dot(np.dot(U, np.diag(1. / np.sqrt(S + 10e-7))), U.T)
+ ","class ImageDataGenerator(object):
+
+ if self.zca_whitening:
+ flatX = np.reshape(X, (X.shape[0], X.shape[1] * X.shape[2] * X.shape[3]))
+ sigma = np.dot(flatX.T, flatX) / flatX.shape[0]
+ U, S, V = linalg.svd(sigma)
+ self.principal_components = np.dot(np.dot(U, np.diag(1. / np.sqrt(S + 10e-7))), U.T)
+ "
+408,https://:@github.com/dmlc/keras.git,7bd5c862a271f125a76fa1ada7f0d9ae27159549,"@@ -209,7 +209,7 @@ def check_loss_and_target_compatibility(targets, losses, output_shapes):
+ 'which does expect integer targets.')
+ if loss.__name__ in key_losses:
+ for target_dim, out_dim in zip(y.shape[1:], shape[1:]):
+- if target_dim is not None and target_dim != out_dim:
++ if out_dim is not None and target_dim != out_dim:
+ raise Exception('A target array with shape ' + str(y.shape) +
+ ' was passed for an output of shape ' + str(shape) +
+ ' while using as loss `' + loss.__name__ + '`. '
+",keras/engine/training.py,"ReplaceText(target='out_dim' @(212,19)->(212,29))","def check_loss_and_target_compatibility(targets, losses, output_shapes):
+ 'which does expect integer targets.')
+ if loss.__name__ in key_losses:
+ for target_dim, out_dim in zip(y.shape[1:], shape[1:]):
+ if target_dim is not None and target_dim != out_dim:
+ raise Exception('A target array with shape ' + str(y.shape) +
+ ' was passed for an output of shape ' + str(shape) +
+ ' while using as loss `' + loss.__name__ + '`. '","def check_loss_and_target_compatibility(targets, losses, output_shapes):
+ 'which does expect integer targets.')
+ if loss.__name__ in key_losses:
+ for target_dim, out_dim in zip(y.shape[1:], shape[1:]):
+ if out_dim is not None and target_dim != out_dim:
+ raise Exception('A target array with shape ' + str(y.shape) +
+ ' was passed for an output of shape ' + str(shape) +
+ ' while using as loss `' + loss.__name__ + '`. '"
+409,https://:@github.com/dmlc/keras.git,cb4f93913eb871a5e234db0c31f885daff87ecdf,"@@ -67,7 +67,7 @@ def _obtain_input_shape(input_shape, default_size, min_size, dim_ordering, inclu
+ if input_shape is not None:
+ if len(input_shape) != 3:
+ raise ValueError('`input_shape` must be a tuple of three integers.')
+- if input_shape[1] != 3:
++ if input_shape[0] != 3:
+ raise ValueError('The input must have 3 channels; got '
+ '`input_shape=' + str(input_shape) + '`')
+ if ((input_shape[1] is not None and input_shape[1] < min_size) or
+",keras/applications/imagenet_utils.py,"ReplaceText(target='0' @(70,31)->(70,32))","def _obtain_input_shape(input_shape, default_size, min_size, dim_ordering, inclu
+ if input_shape is not None:
+ if len(input_shape) != 3:
+ raise ValueError('`input_shape` must be a tuple of three integers.')
+ if input_shape[1] != 3:
+ raise ValueError('The input must have 3 channels; got '
+ '`input_shape=' + str(input_shape) + '`')
+ if ((input_shape[1] is not None and input_shape[1] < min_size) or","def _obtain_input_shape(input_shape, default_size, min_size, dim_ordering, inclu
+ if input_shape is not None:
+ if len(input_shape) != 3:
+ raise ValueError('`input_shape` must be a tuple of three integers.')
+ if input_shape[0] != 3:
+ raise ValueError('The input must have 3 channels; got '
+ '`input_shape=' + str(input_shape) + '`')
+ if ((input_shape[1] is not None and input_shape[1] < min_size) or"
+410,https://:@github.com/dmlc/keras.git,82ca6d418588ccd61d663ec8029937290b62d583,"@@ -120,7 +120,7 @@ X = X[indices]
+ y = y[indices]
+
+ # Explicitly set apart 10% for validation data that we never train over
+-split_at = len(X) - len(X) / 10
++split_at = len(X) - len(X) // 10
+ (X_train, X_val) = (slice_X(X, 0, split_at), slice_X(X, split_at))
+ (y_train, y_val) = (y[:split_at], y[split_at:])
+
+",examples/addition_rnn.py,"ReplaceText(target='//' @(123,27)->(123,28))","X = X[indices]
+ y = y[indices]
+
+ # Explicitly set apart 10% for validation data that we never train over
+ split_at = len(X) - len(X) / 10
+ (X_train, X_val) = (slice_X(X, 0, split_at), slice_X(X, split_at))
+ (y_train, y_val) = (y[:split_at], y[split_at:])
+ ","X = X[indices]
+ y = y[indices]
+
+ # Explicitly set apart 10% for validation data that we never train over
+ split_at = len(X) - len(X) // 10
+ (X_train, X_val) = (slice_X(X, 0, split_at), slice_X(X, split_at))
+ (y_train, y_val) = (y[:split_at], y[split_at:])
+ "
+411,https://:@github.com/dmlc/keras.git,7c34add25d0f6a773f1c74d1d8bb50f4482afc76,"@@ -1875,7 +1875,7 @@ def set_value(x, value):
+ """"""Sets the value of a variable,
+ from a Numpy array. It returns `None`.
+ """"""
+- if isinstance(x, Number):
++ if isinstance(value, Number):
+ value = [value]
+ x.bind(mx.nd.array(value))
+
+",keras/backend/mxnet_backend.py,"ReplaceText(target='value' @(1878,18)->(1878,19))","def set_value(x, value):
+ """"""Sets the value of a variable,
+ from a Numpy array. It returns `None`.
+ """"""
+ if isinstance(x, Number):
+ value = [value]
+ x.bind(mx.nd.array(value))
+ ","def set_value(x, value):
+ """"""Sets the value of a variable,
+ from a Numpy array. It returns `None`.
+ """"""
+ if isinstance(value, Number):
+ value = [value]
+ x.bind(mx.nd.array(value))
+ "
+412,https://:@github.com/incountry/sdk-python.git,e98e4243dae300a5ae9cab87347fa61bb87b51a9,"@@ -28,6 +28,6 @@ storage = Storage(
+
+ while not migration_complete:
+ migration_res = storage.migrate(country=COUNTRY, limit=50)
+- if migration_res[""total_left""] <= 0:
++ if migration_res[""total_left""] == 0:
+ migration_complete = True
+ time.sleep(1)
+",examples/full_migration.py,"ReplaceText(target='==' @(31,35)->(31,37))","storage = Storage(
+
+ while not migration_complete:
+ migration_res = storage.migrate(country=COUNTRY, limit=50)
+ if migration_res[""total_left""] <= 0:
+ migration_complete = True
+ time.sleep(1)","storage = Storage(
+
+ while not migration_complete:
+ migration_res = storage.migrate(country=COUNTRY, limit=50)
+ if migration_res[""total_left""] == 0:
+ migration_complete = True
+ time.sleep(1)"
+413,https://:@github.com/knockrentals/scrapy-elasticsearch.git,1c5c20459e68544eeb8a0490b9f7b14895861b24,"@@ -96,7 +96,7 @@ class ElasticSearchPipeline(object):
+
+ self.items_buffer.append(index_action)
+
+- if len(self.items_buffer) == self.settings.get('ELASTICSEARCH_BUFFER_LENGTH', 500):
++ if len(self.items_buffer) >= self.settings.get('ELASTICSEARCH_BUFFER_LENGTH', 500):
+ self.send_items()
+ self.items_buffer = []
+
+",scrapyelasticsearch/scrapyelasticsearch.py,"ReplaceText(target='>=' @(99,34)->(99,36))","class ElasticSearchPipeline(object):
+
+ self.items_buffer.append(index_action)
+
+ if len(self.items_buffer) == self.settings.get('ELASTICSEARCH_BUFFER_LENGTH', 500):
+ self.send_items()
+ self.items_buffer = []
+ ","class ElasticSearchPipeline(object):
+
+ self.items_buffer.append(index_action)
+
+ if len(self.items_buffer) >= self.settings.get('ELASTICSEARCH_BUFFER_LENGTH', 500):
+ self.send_items()
+ self.items_buffer = []
+ "
+414,https://:@github.com/smithlabcode/ribotricer.git,805255ef81f4c94dcaf9f0c63ba39f0de7f14eea,"@@ -149,7 +149,7 @@ def detect_orfs_cmd(bam, ribocop_index, prefix, stranded, read_lengths,
+ sys.exit('Error: cannot convert psite_offsets into integers')
+ if len(read_lengths) != len(psite_offsets):
+ sys.exit('Error: psite_offsets must match read_lengths')
+- if not all(x > 0 for x in psite_offsets):
++ if not all(x >= 0 for x in psite_offsets):
+ sys.exit('Error: P-site offset must be >= 0')
+ if not all(x > y for (x, y) in zip(read_lengths, psite_offsets)):
+ sys.exit('Error: P-site offset must be smaller than read length')
+",RiboCop/cli.py,"ReplaceText(target='>=' @(152,21)->(152,22))","def detect_orfs_cmd(bam, ribocop_index, prefix, stranded, read_lengths,
+ sys.exit('Error: cannot convert psite_offsets into integers')
+ if len(read_lengths) != len(psite_offsets):
+ sys.exit('Error: psite_offsets must match read_lengths')
+ if not all(x > 0 for x in psite_offsets):
+ sys.exit('Error: P-site offset must be >= 0')
+ if not all(x > y for (x, y) in zip(read_lengths, psite_offsets)):
+ sys.exit('Error: P-site offset must be smaller than read length')","def detect_orfs_cmd(bam, ribocop_index, prefix, stranded, read_lengths,
+ sys.exit('Error: cannot convert psite_offsets into integers')
+ if len(read_lengths) != len(psite_offsets):
+ sys.exit('Error: psite_offsets must match read_lengths')
+ if not all(x >= 0 for x in psite_offsets):
+ sys.exit('Error: P-site offset must be >= 0')
+ if not all(x > y for (x, y) in zip(read_lengths, psite_offsets)):
+ sys.exit('Error: P-site offset must be smaller than read length')"
+415,https://:@github.com/smithlabcode/ribotricer.git,9e9c9497eb5c2669bd272729e19f47e2cbf2b3db,"@@ -321,7 +321,7 @@ def prepare_orfs(gtf, fasta, prefix, min_orf_length, start_codons,
+ for orf in tqdm(candidate_orfs):
+ coordinate = ','.join(
+ ['{}-{}'.format(iv.start, iv.end) for iv in orf.intervals])
+- to_write = formatter.format(orf.oid, orf.category, orf.tid, orf.ttype,
++ to_write += formatter.format(orf.oid, orf.category, orf.tid, orf.ttype,
+ orf.gid, orf.gname, orf.gtype, orf.chrom,
+ orf.strand, coordinate)
+
+",RiboCop/prepare_orfs.py,"ReplaceText(target='+=' @(324,17)->(324,18))","def prepare_orfs(gtf, fasta, prefix, min_orf_length, start_codons,
+ for orf in tqdm(candidate_orfs):
+ coordinate = ','.join(
+ ['{}-{}'.format(iv.start, iv.end) for iv in orf.intervals])
+ to_write = formatter.format(orf.oid, orf.category, orf.tid, orf.ttype,
+ orf.gid, orf.gname, orf.gtype, orf.chrom,
+ orf.strand, coordinate)
+ ","def prepare_orfs(gtf, fasta, prefix, min_orf_length, start_codons,
+ for orf in tqdm(candidate_orfs):
+ coordinate = ','.join(
+ ['{}-{}'.format(iv.start, iv.end) for iv in orf.intervals])
+ to_write += formatter.format(orf.oid, orf.category, orf.tid, orf.ttype,
+ orf.gid, orf.gname, orf.gtype, orf.chrom,
+ orf.strand, coordinate)
+ "
+416,https://:@github.com/pughlab/ConsensusCruncher.git,3622410b893b07afb4e423a4537eab33da26a55d,"@@ -147,7 +147,7 @@ def main():
+ sscs_bam = pysam.AlignmentFile(args.infile, ""rb"")
+ dcs_bam = pysam.AlignmentFile(args.outfile, ""wb"", template=sscs_bam)
+
+- if re.search('dcs.sc', args.outfile) is None:
++ if re.search('dcs.sc', args.outfile) is not None:
+ sscs_singleton_bam = pysam.AlignmentFile('{}.sscs.sc.singleton.bam'.format(args.outfile.split('.dcs.sc')[0]),
+ ""wb"", template=sscs_bam)
+ dcs_header = ""DCS - Singleton Correction""
+",ConsensusCruncher/DCS_maker.py,"ReplaceText(target=' is not ' @(150,40)->(150,44))","def main():
+ sscs_bam = pysam.AlignmentFile(args.infile, ""rb"")
+ dcs_bam = pysam.AlignmentFile(args.outfile, ""wb"", template=sscs_bam)
+
+ if re.search('dcs.sc', args.outfile) is None:
+ sscs_singleton_bam = pysam.AlignmentFile('{}.sscs.sc.singleton.bam'.format(args.outfile.split('.dcs.sc')[0]),
+ ""wb"", template=sscs_bam)
+ dcs_header = ""DCS - Singleton Correction""","def main():
+ sscs_bam = pysam.AlignmentFile(args.infile, ""rb"")
+ dcs_bam = pysam.AlignmentFile(args.outfile, ""wb"", template=sscs_bam)
+
+ if re.search('dcs.sc', args.outfile) is not None:
+ sscs_singleton_bam = pysam.AlignmentFile('{}.sscs.sc.singleton.bam'.format(args.outfile.split('.dcs.sc')[0]),
+ ""wb"", template=sscs_bam)
+ dcs_header = ""DCS - Singleton Correction"""
+417,https://:@github.com/django-guardian/django-guardian.git,f60306eb93fd276879806d6e78557bdb5d1ce34f,"@@ -172,7 +172,7 @@ def get_obj_perms_model(obj, base_cls, generic_cls):
+ for attr in fields:
+ model = getattr(attr, 'related_model', None)
+ if (model and issubclass(model, base_cls) and
+- model is not generic_cls and getattr(attr, 'enabled', True)):
++ model is not generic_cls and getattr(model, 'enabled', True)):
+ # if model is generic one it would be returned anyway
+ if not model.objects.is_generic():
+ # make sure that content_object's content_type is same as
+",guardian/utils.py,"ReplaceText(target='model' @(175,53)->(175,57))","def get_obj_perms_model(obj, base_cls, generic_cls):
+ for attr in fields:
+ model = getattr(attr, 'related_model', None)
+ if (model and issubclass(model, base_cls) and
+ model is not generic_cls and getattr(attr, 'enabled', True)):
+ # if model is generic one it would be returned anyway
+ if not model.objects.is_generic():
+ # make sure that content_object's content_type is same as","def get_obj_perms_model(obj, base_cls, generic_cls):
+ for attr in fields:
+ model = getattr(attr, 'related_model', None)
+ if (model and issubclass(model, base_cls) and
+ model is not generic_cls and getattr(model, 'enabled', True)):
+ # if model is generic one it would be returned anyway
+ if not model.objects.is_generic():
+ # make sure that content_object's content_type is same as"
+418,https://:@github.com/podhmo/magicalimport.git,293f619fee3f401ebe0daf55f001354ecf2a2124,"@@ -69,7 +69,7 @@ def import_symbol(sym, here=None, sep="":"", ns=None):
+ sym = ""{}:{}"".format(ns, sym)
+ module_path, fn_name = sym.rsplit(sep, 2)
+ try:
+- module = import_module(sym, here=here, sep=sep)
++ module = import_module(module_path, here=here, sep=sep)
+ return getattr(module, fn_name)
+ except (ImportError, AttributeError) as e:
+ sys.stderr.write(""could not import {!r}\n{}\n"".format(sym, e))
+",magicalimport/__init__.py,"ReplaceText(target='module_path' @(72,31)->(72,34))","def import_symbol(sym, here=None, sep="":"", ns=None):
+ sym = ""{}:{}"".format(ns, sym)
+ module_path, fn_name = sym.rsplit(sep, 2)
+ try:
+ module = import_module(sym, here=here, sep=sep)
+ return getattr(module, fn_name)
+ except (ImportError, AttributeError) as e:
+ sys.stderr.write(""could not import {!r}\n{}\n"".format(sym, e))","def import_symbol(sym, here=None, sep="":"", ns=None):
+ sym = ""{}:{}"".format(ns, sym)
+ module_path, fn_name = sym.rsplit(sep, 2)
+ try:
+ module = import_module(module_path, here=here, sep=sep)
+ return getattr(module, fn_name)
+ except (ImportError, AttributeError) as e:
+ sys.stderr.write(""could not import {!r}\n{}\n"".format(sym, e))"
+419,https://:@github.com/sigmavirus24/betamax.git,9d84fcffbdf41133dbdd686490c993d63e0243fc,"@@ -112,7 +112,7 @@ def deserialize_response(serialized):
+ for header_name, header_list in serialized['headers'].items():
+ if isinstance(header_list, list):
+ for header_value in header_list:
+- header_dict.add(header_name, header_list)
++ header_dict.add(header_name, header_value)
+ else:
+ header_dict.add(header_name, header_list)
+ r.headers = CaseInsensitiveDict(header_dict)
+",betamax/cassette/util.py,"ReplaceText(target='header_value' @(115,45)->(115,56))","def deserialize_response(serialized):
+ for header_name, header_list in serialized['headers'].items():
+ if isinstance(header_list, list):
+ for header_value in header_list:
+ header_dict.add(header_name, header_list)
+ else:
+ header_dict.add(header_name, header_list)
+ r.headers = CaseInsensitiveDict(header_dict)","def deserialize_response(serialized):
+ for header_name, header_list in serialized['headers'].items():
+ if isinstance(header_list, list):
+ for header_value in header_list:
+ header_dict.add(header_name, header_value)
+ else:
+ header_dict.add(header_name, header_list)
+ r.headers = CaseInsensitiveDict(header_dict)"
+420,https://:@github.com/CodyKochmann/generators.git,0c99248a9a96a675d6995855c4a9ae0efebef329,"@@ -17,7 +17,7 @@ def itemgetter(iterable, indexes):
+ for i,x in enumerate(iterable):
+ if i in positive_indexes:
+ out[i]=x
+- negative_index_buffer.append(i)
++ negative_index_buffer.append(x)
+ out.update({ni:negative_index_buffer[ni] for ni in negative_indexes})
+ else:
+ # if just positive results
+",generators/itemgetter.py,"ReplaceText(target='x' @(20,41)->(20,42))","def itemgetter(iterable, indexes):
+ for i,x in enumerate(iterable):
+ if i in positive_indexes:
+ out[i]=x
+ negative_index_buffer.append(i)
+ out.update({ni:negative_index_buffer[ni] for ni in negative_indexes})
+ else:
+ # if just positive results","def itemgetter(iterable, indexes):
+ for i,x in enumerate(iterable):
+ if i in positive_indexes:
+ out[i]=x
+ negative_index_buffer.append(x)
+ out.update({ni:negative_index_buffer[ni] for ni in negative_indexes})
+ else:
+ # if just positive results"
+421,https://:@github.com/reiinakano/xcessiv.git,b197e370a6f8a46f6ba3e9b77fb76f150f28edd5,"@@ -146,7 +146,7 @@ def evaluate_stacked_ensemble(path, ensemble_id):
+ )
+ preds = []
+ trues_list = []
+- for train_index, test_index in cv.split(X, y):
++ for train_index, test_index in cv.split(secondary_features, y):
+ X_train, X_test = secondary_features[train_index], secondary_features[test_index]
+ y_train, y_test = y[train_index], y[test_index]
+ est = est.fit(X_train, y_train)
+",xcessiv/rqtasks.py,"ReplaceText(target='secondary_features' @(149,52)->(149,53))","def evaluate_stacked_ensemble(path, ensemble_id):
+ )
+ preds = []
+ trues_list = []
+ for train_index, test_index in cv.split(X, y):
+ X_train, X_test = secondary_features[train_index], secondary_features[test_index]
+ y_train, y_test = y[train_index], y[test_index]
+ est = est.fit(X_train, y_train)","def evaluate_stacked_ensemble(path, ensemble_id):
+ )
+ preds = []
+ trues_list = []
+ for train_index, test_index in cv.split(secondary_features, y):
+ X_train, X_test = secondary_features[train_index], secondary_features[test_index]
+ y_train, y_test = y[train_index], y[test_index]
+ est = est.fit(X_train, y_train)"
+422,https://:@github.com/MosesofEgypt/mozzarilla.git,5c0f1e29111be71edbb67ef13094a0cdc83d760c,"@@ -684,7 +684,7 @@ def _compile_model_animations(self):
+ print(error)
+
+ self.update()
+- if messagebox.askyesno(
++ if not messagebox.askyesno(
+ ""Model_animations compilation failed"",
+ ""Errors occurred while compiling animations(check console). ""
+ ""Do you want to save the model_animations tag anyway?"",
+",mozzarilla/tools/animations_compiler_window.py,"ReplaceText(target='not ' @(687,15)->(687,15))","def _compile_model_animations(self):
+ print(error)
+
+ self.update()
+ if messagebox.askyesno(
+ ""Model_animations compilation failed"",
+ ""Errors occurred while compiling animations(check console). ""
+ ""Do you want to save the model_animations tag anyway?"",","def _compile_model_animations(self):
+ print(error)
+
+ self.update()
+ if not messagebox.askyesno(
+ ""Model_animations compilation failed"",
+ ""Errors occurred while compiling animations(check console). ""
+ ""Do you want to save the model_animations tag anyway?"","
+423,https://:@github.com/HeeroYui/lutin.git,9fc593fb59a192ddf5f50a96e2a6cba76dab73b6,"@@ -23,7 +23,7 @@ class System(system.System):
+ # no check needed ==> just add this:
+ self.add_module_depend(['c'])
+ self.add_export_flag('link-lib', 'X11')
+- if env.get_isolate_system() == False:
++ if env.get_isolate_system() == True:
+ self.add_header_file([
+ ""/usr/include/X11/*""
+ ],
+",lutin/z_system/lutinSystem_Linux_X11.py,"ReplaceText(target='True' @(26,33)->(26,38))","class System(system.System):
+ # no check needed ==> just add this:
+ self.add_module_depend(['c'])
+ self.add_export_flag('link-lib', 'X11')
+ if env.get_isolate_system() == False:
+ self.add_header_file([
+ ""/usr/include/X11/*""
+ ],","class System(system.System):
+ # no check needed ==> just add this:
+ self.add_module_depend(['c'])
+ self.add_export_flag('link-lib', 'X11')
+ if env.get_isolate_system() == True:
+ self.add_header_file([
+ ""/usr/include/X11/*""
+ ],"
+424,https://:@github.com/sanger-pathogens/ariba.git,8625628cf307e533bb6e778d9b8e936e48cef727,"@@ -294,7 +294,7 @@ class ReferenceData:
+ def sanity_check(self, outprefix):
+ variants_only_removed = self._remove_bad_genes(self.seq_dicts['variants_only'], outprefix + '.00.check_fasta_variants_only.log')
+ presence_absence_removed = self._remove_bad_genes(self.seq_dicts['presence_absence'], outprefix + '.00.check_fasta_presence_absence.log')
+- self._filter_bad_variant_data(outprefix + '.01.check_variants', variants_only_removed, presence_absence_removed)
++ self._filter_bad_variant_data(outprefix + '.01.check_variants', presence_absence_removed, variants_only_removed)
+
+
+ @classmethod
+",ariba/reference_data.py,"ArgSwap(idxs=1<->2 @(297,8)->(297,37))","class ReferenceData:
+ def sanity_check(self, outprefix):
+ variants_only_removed = self._remove_bad_genes(self.seq_dicts['variants_only'], outprefix + '.00.check_fasta_variants_only.log')
+ presence_absence_removed = self._remove_bad_genes(self.seq_dicts['presence_absence'], outprefix + '.00.check_fasta_presence_absence.log')
+ self._filter_bad_variant_data(outprefix + '.01.check_variants', variants_only_removed, presence_absence_removed)
+
+
+ @classmethod","class ReferenceData:
+ def sanity_check(self, outprefix):
+ variants_only_removed = self._remove_bad_genes(self.seq_dicts['variants_only'], outprefix + '.00.check_fasta_variants_only.log')
+ presence_absence_removed = self._remove_bad_genes(self.seq_dicts['presence_absence'], outprefix + '.00.check_fasta_presence_absence.log')
+ self._filter_bad_variant_data(outprefix + '.01.check_variants', presence_absence_removed, variants_only_removed)
+
+
+ @classmethod"
+425,https://:@github.com/sanger-pathogens/ariba.git,c70bc90299a1c5a85f20127ac8c750925219316b,"@@ -192,7 +192,7 @@ class Summary:
+ if self.show_known_het and (cluster, variant) in all_het_snps:
+ rows[filename][cluster][key + '.%'] = 'NA'
+
+- if self.show_known_het and (ref_name, variant) in all_het_snps and key + '.%' not in rows[filename][cluster]:
++ if self.show_known_het and (cluster, variant) in all_het_snps and key + '.%' not in rows[filename][cluster]:
+ rows[filename][cluster][key + '.%'] = 'NA'
+
+ for key, wanted in self.cluster_columns.items():
+",ariba/summary.py,"ReplaceText(target='cluster' @(195,52)->(195,60))","class Summary:
+ if self.show_known_het and (cluster, variant) in all_het_snps:
+ rows[filename][cluster][key + '.%'] = 'NA'
+
+ if self.show_known_het and (ref_name, variant) in all_het_snps and key + '.%' not in rows[filename][cluster]:
+ rows[filename][cluster][key + '.%'] = 'NA'
+
+ for key, wanted in self.cluster_columns.items():","class Summary:
+ if self.show_known_het and (cluster, variant) in all_het_snps:
+ rows[filename][cluster][key + '.%'] = 'NA'
+
+ if self.show_known_het and (cluster, variant) in all_het_snps and key + '.%' not in rows[filename][cluster]:
+ rows[filename][cluster][key + '.%'] = 'NA'
+
+ for key, wanted in self.cluster_columns.items():"
+426,https://:@github.com/sanger-pathogens/ariba.git,1fd2c639e7b24a69252390744ae4e1a9e49db5dd,"@@ -47,7 +47,7 @@ class MlstReporter:
+ depths = [int(x) for x in d['smtls_nts_depth'].split(',')]
+ depths.sort()
+ het_pc = round(100.0 * depths[-1] / sum(depths), 2)
+- if results['hetmin'] == '.' or results['hetmin'] < het_pc:
++ if results['hetmin'] == '.' or results['hetmin'] > het_pc:
+ results['hetmin'] = het_pc
+ if len(het_data):
+ results['hets'] = '.'.join(het_data)
+",ariba/mlst_reporter.py,"ReplaceText(target='>' @(50,69)->(50,70))","class MlstReporter:
+ depths = [int(x) for x in d['smtls_nts_depth'].split(',')]
+ depths.sort()
+ het_pc = round(100.0 * depths[-1] / sum(depths), 2)
+ if results['hetmin'] == '.' or results['hetmin'] < het_pc:
+ results['hetmin'] = het_pc
+ if len(het_data):
+ results['hets'] = '.'.join(het_data)","class MlstReporter:
+ depths = [int(x) for x in d['smtls_nts_depth'].split(',')]
+ depths.sort()
+ het_pc = round(100.0 * depths[-1] / sum(depths), 2)
+ if results['hetmin'] == '.' or results['hetmin'] > het_pc:
+ results['hetmin'] = het_pc
+ if len(het_data):
+ results['hets'] = '.'.join(het_data)"
+427,https://:@github.com/urschrei/pyzotero.git,cdfd191116363c947fc0a0d0b4f37849d709f9f2,"@@ -40,7 +40,7 @@ def check():
+ return library_version == git_version
+
+ if __name__ == '__main__':
+- if check():
++ if not check():
+ sys.exit(1)
+ else:
+ sys.exit(0)
+",pre-deploy.py,"ReplaceText(target='not ' @(43,7)->(43,7))","def check():
+ return library_version == git_version
+
+ if __name__ == '__main__':
+ if check():
+ sys.exit(1)
+ else:
+ sys.exit(0)","def check():
+ return library_version == git_version
+
+ if __name__ == '__main__':
+ if not check():
+ sys.exit(1)
+ else:
+ sys.exit(0)"
+428,https://:@github.com/lyft/confidant.git,5de06bb144ad392dba5ef9c75603eb9587dfcfe3,"@@ -410,7 +410,7 @@ def update_credential(id):
+ include_credential_pairs=True,
+ )
+ credential_response.permissions = permissions
+- return credential_response_schema.dumps(permissions)
++ return credential_response_schema.dumps(credential_response)
+
+
+ @blueprint.route('/v1/credentials//', methods=['PUT'])
+",confidant/routes/credentials.py,"ReplaceText(target='credential_response' @(413,44)->(413,55))","def update_credential(id):
+ include_credential_pairs=True,
+ )
+ credential_response.permissions = permissions
+ return credential_response_schema.dumps(permissions)
+
+
+ @blueprint.route('/v1/credentials//', methods=['PUT'])","def update_credential(id):
+ include_credential_pairs=True,
+ )
+ credential_response.permissions = permissions
+ return credential_response_schema.dumps(credential_response)
+
+
+ @blueprint.route('/v1/credentials//', methods=['PUT'])"
+429,https://:@github.com/cloudenvy/cloudenvy.git,a19f6f84832b1dfddbf5ad7b1e84790842b22712,"@@ -35,7 +35,7 @@ class Files(cloudenvy.envy.Command):
+ logging.info(""Copying file from '%s' to '%s'"",
+ local_path, remote_path)
+
+- if os.path.exists(local_path):
++ if not os.path.exists(local_path):
+ logging.error(""Local file '%s' not found."", local_path)
+
+ dest_dir = _parse_directory(remote_path)
+",cloudenvy/commands/files.py,"ReplaceText(target='not ' @(38,23)->(38,23))","class Files(cloudenvy.envy.Command):
+ logging.info(""Copying file from '%s' to '%s'"",
+ local_path, remote_path)
+
+ if os.path.exists(local_path):
+ logging.error(""Local file '%s' not found."", local_path)
+
+ dest_dir = _parse_directory(remote_path)","class Files(cloudenvy.envy.Command):
+ logging.info(""Copying file from '%s' to '%s'"",
+ local_path, remote_path)
+
+ if not os.path.exists(local_path):
+ logging.error(""Local file '%s' not found."", local_path)
+
+ dest_dir = _parse_directory(remote_path)"
+430,https://:@github.com/WeiXuanChan/autoD.git,e163474f70ed6a02f39cd6edaa298271e5f23327,"@@ -520,7 +520,7 @@ class Imaginary(AD):
+ class Absolute(AD):
+ def __init__(self,func):
+ self.func=func
+- self.abs=(Real(func)**2.-Imaginary(func)**2.)**0.5
++ self.abs=(Real(func)**2.+Imaginary(func)**2.)**0.5
+ try:
+ self.dependent=func.dependent[:]
+ except AttributeError:
+",autoD.py,"ReplaceText(target='+' @(523,32)->(523,33))","class Imaginary(AD):
+ class Absolute(AD):
+ def __init__(self,func):
+ self.func=func
+ self.abs=(Real(func)**2.-Imaginary(func)**2.)**0.5
+ try:
+ self.dependent=func.dependent[:]
+ except AttributeError:","class Imaginary(AD):
+ class Absolute(AD):
+ def __init__(self,func):
+ self.func=func
+ self.abs=(Real(func)**2.+Imaginary(func)**2.)**0.5
+ try:
+ self.dependent=func.dependent[:]
+ except AttributeError:"
+431,https://:@github.com/dwavesystems/dimod.git,79979454139757bd49c1e31c67d890c1d5efeee2,"@@ -279,7 +279,7 @@ class PolyScaleComposite(ComposedPolySampler):
+ # we need to know how much we scaled by, which we can do by looking
+ # at the biases
+ try:
+- v = next((v for v, bias in poly.items() if bias))
++ v = next((v for v, bias in original.items() if bias))
+ except StopIteration:
+ # nothing to scale
+ scalar = 1
+",dimod/reference/composites/higherordercomposites.py,"ReplaceText(target='original' @(282,43)->(282,47))","class PolyScaleComposite(ComposedPolySampler):
+ # we need to know how much we scaled by, which we can do by looking
+ # at the biases
+ try:
+ v = next((v for v, bias in poly.items() if bias))
+ except StopIteration:
+ # nothing to scale
+ scalar = 1","class PolyScaleComposite(ComposedPolySampler):
+ # we need to know how much we scaled by, which we can do by looking
+ # at the biases
+ try:
+ v = next((v for v, bias in original.items() if bias))
+ except StopIteration:
+ # nothing to scale
+ scalar = 1"
+432,https://:@github.com/dwavesystems/dimod.git,c21ee99ab65a519b822689361fcfcc66ffb890f2,"@@ -2146,7 +2146,7 @@ class TestSerialization(unittest.TestCase):
+ new = dimod.BinaryQuadraticModel.from_serializable(bqm.to_serializable(use_bytes=True))
+
+ self.assertEqual(bqm, new)
+- self.assertEqual(bqm.info, {""tag"": 5})
++ self.assertEqual(new.info, {""tag"": 5})
+
+
+ class TestZeroField(unittest.TestCase):
+",tests/test_binary_quadratic_model.py,"ReplaceText(target='new' @(2149,25)->(2149,28))","class TestSerialization(unittest.TestCase):
+ new = dimod.BinaryQuadraticModel.from_serializable(bqm.to_serializable(use_bytes=True))
+
+ self.assertEqual(bqm, new)
+ self.assertEqual(bqm.info, {""tag"": 5})
+
+
+ class TestZeroField(unittest.TestCase):","class TestSerialization(unittest.TestCase):
+ new = dimod.BinaryQuadraticModel.from_serializable(bqm.to_serializable(use_bytes=True))
+
+ self.assertEqual(bqm, new)
+ self.assertEqual(new.info, {""tag"": 5})
+
+
+ class TestZeroField(unittest.TestCase):"
+433,https://:@github.com/dwavesystems/dimod.git,ceee47e049c2c3305d459c6ae865a430dbd113e9,"@@ -197,7 +197,7 @@ def ran_r(r, graph, cls=BinaryQuadraticModel, seed=None):
+ rvals = np.empty(2*r)
+ rvals[0:r] = range(-r, 0)
+ rvals[r:] = range(1, r+1)
+- qdata = rnd.choice(rvals, size=len(variables))
++ qdata = rnd.choice(rvals, size=len(irow))
+
+ offset = 0
+
+",dimod/generators/random.py,"ReplaceText(target='irow' @(200,39)->(200,48))","def ran_r(r, graph, cls=BinaryQuadraticModel, seed=None):
+ rvals = np.empty(2*r)
+ rvals[0:r] = range(-r, 0)
+ rvals[r:] = range(1, r+1)
+ qdata = rnd.choice(rvals, size=len(variables))
+
+ offset = 0
+ ","def ran_r(r, graph, cls=BinaryQuadraticModel, seed=None):
+ rvals = np.empty(2*r)
+ rvals[0:r] = range(-r, 0)
+ rvals[r:] = range(1, r+1)
+ qdata = rnd.choice(rvals, size=len(irow))
+
+ offset = 0
+ "
+434,https://:@github.com/dvdotsenko/jsonrpc.py.git,92ad90db194c878cb2023e97758671d72c976797,"@@ -75,7 +75,7 @@ class JSONPRCWSGIApplicationTestSuite(TestCase):
+
+ response_json = responses_data[0]
+ assert 'error' not in response_json
+- assert response_json['id'] == request2['id']
++ assert response_json['id'] == request1['id']
+ assert response_json['result'] == 5
+
+ response_json = responses_data[1]
+",tests/test_wsgi_application.py,"ReplaceText(target='request1' @(78,38)->(78,46))","class JSONPRCWSGIApplicationTestSuite(TestCase):
+
+ response_json = responses_data[0]
+ assert 'error' not in response_json
+ assert response_json['id'] == request2['id']
+ assert response_json['result'] == 5
+
+ response_json = responses_data[1]","class JSONPRCWSGIApplicationTestSuite(TestCase):
+
+ response_json = responses_data[0]
+ assert 'error' not in response_json
+ assert response_json['id'] == request1['id']
+ assert response_json['result'] == 5
+
+ response_json = responses_data[1]"
+435,https://:@github.com/MarSoft/ses-mailer-2.git,8c1b6aafc09412a6b6b2b1a69337ccbd99fc43f2,"@@ -264,7 +264,7 @@ class Mail(object):
+ for ob in optional_blocks:
+ if ob in blocks:
+ if ob == ""format"" and \
+- mail_params[ob].lower() not in [""html"", ""text""]:
++ blocks[ob].lower() not in [""html"", ""text""]:
+ continue
+ mail_params[ob] = blocks[ob]
+ return mail_params
+",ses_mailer.py,"ReplaceText(target='blocks' @(267,24)->(267,35))","class Mail(object):
+ for ob in optional_blocks:
+ if ob in blocks:
+ if ob == ""format"" and \
+ mail_params[ob].lower() not in [""html"", ""text""]:
+ continue
+ mail_params[ob] = blocks[ob]
+ return mail_params","class Mail(object):
+ for ob in optional_blocks:
+ if ob in blocks:
+ if ob == ""format"" and \
+ blocks[ob].lower() not in [""html"", ""text""]:
+ continue
+ mail_params[ob] = blocks[ob]
+ return mail_params"
+436,https://:@github.com/interpretml/interpret.git,dfae1d47394d50472e25717c53c245cbe9f8a5ad,"@@ -1067,7 +1067,7 @@ class BaseEBM(BaseEstimator):
+ ""scores_range"": bounds,
+ }
+ feature_list.append(feature_dict)
+- density_dict.append({})
++ density_list.append({})
+
+ data_dict = {
+ ""type"": ""pairwise"",
+",python/interpret/glassbox/ebm/ebm.py,"ReplaceText(target='density_list' @(1070,16)->(1070,28))","class BaseEBM(BaseEstimator):
+ ""scores_range"": bounds,
+ }
+ feature_list.append(feature_dict)
+ density_dict.append({})
+
+ data_dict = {
+ ""type"": ""pairwise"",","class BaseEBM(BaseEstimator):
+ ""scores_range"": bounds,
+ }
+ feature_list.append(feature_dict)
+ density_list.append({})
+
+ data_dict = {
+ ""type"": ""pairwise"","
+437,https://:@gitlab.com/serial-lab/random-flavorpack.git,e69ba47e04a84e1746363a93d33bfe2ca9581cd5,"@@ -76,7 +76,7 @@ class RandomGenerator(Generator):
+ if maximum <= minimum:
+ raise ValueError(
+ _(""The maximum can not be less than the minimum.""))
+- if start < minimum or start >= maximum:
++ if start < minimum or start > maximum:
+ raise ValueError(
+ _(""The start must be between the minimum and maximum!""))
+ rnrange = maximum - minimum
+",random_flavorpack/generators/random.py,"ReplaceText(target='>' @(79,36)->(79,38))","class RandomGenerator(Generator):
+ if maximum <= minimum:
+ raise ValueError(
+ _(""The maximum can not be less than the minimum.""))
+ if start < minimum or start >= maximum:
+ raise ValueError(
+ _(""The start must be between the minimum and maximum!""))
+ rnrange = maximum - minimum","class RandomGenerator(Generator):
+ if maximum <= minimum:
+ raise ValueError(
+ _(""The maximum can not be less than the minimum.""))
+ if start < minimum or start > maximum:
+ raise ValueError(
+ _(""The start must be between the minimum and maximum!""))
+ rnrange = maximum - minimum"
+438,https://:@github.com/Ezibenroc/PyRoaringBitMap.git,7081ceba18ccaf2ee80d3c142e6e612cf77d17d2,"@@ -779,7 +779,7 @@ class OptimizationTest(unittest.TestCase):
+ self.assertGreater(bm2.shrink_to_fit(), 0)
+ self.assertEqual(bm2.shrink_to_fit(), 0)
+ bm3 = cls(bm1, optimize=True)
+- self.assertEqual(bm2.shrink_to_fit(), 0)
++ self.assertEqual(bm3.shrink_to_fit(), 0)
+
+
+ class VersionTest(unittest.TestCase):
+",test.py,"ReplaceText(target='bm3' @(782,25)->(782,28))","class OptimizationTest(unittest.TestCase):
+ self.assertGreater(bm2.shrink_to_fit(), 0)
+ self.assertEqual(bm2.shrink_to_fit(), 0)
+ bm3 = cls(bm1, optimize=True)
+ self.assertEqual(bm2.shrink_to_fit(), 0)
+
+
+ class VersionTest(unittest.TestCase):","class OptimizationTest(unittest.TestCase):
+ self.assertGreater(bm2.shrink_to_fit(), 0)
+ self.assertEqual(bm2.shrink_to_fit(), 0)
+ bm3 = cls(bm1, optimize=True)
+ self.assertEqual(bm3.shrink_to_fit(), 0)
+
+
+ class VersionTest(unittest.TestCase):"
+439,https://:@github.com/Cavenfish/autogamess.git,09def521ebf6c9686479439d71aee114d554a5de,"@@ -136,8 +136,8 @@ def new_project(maindir, csvfile, ebasis_dir, initial_coords_dict=None,
+
+ #Run Input Builder function
+ save_dir = maindir + 'inputs/'
+- input_builder(csvfile, initial_coords_dict, ebasis_dir,
+- save_dir, title.replace('/', '\n'))
++ input_builder(csvfile, save_dir, ebasis_dir,
++ initial_coords_dict, title.replace('/', '\n'))
+
+
+ return
+",autogamess/new_project.py,"ArgSwap(idxs=1<->3 @(139,4)->(139,17))","def new_project(maindir, csvfile, ebasis_dir, initial_coords_dict=None,
+
+ #Run Input Builder function
+ save_dir = maindir + 'inputs/'
+ input_builder(csvfile, initial_coords_dict, ebasis_dir,
+ save_dir, title.replace('/', '\n'))
+
+
+ return","def new_project(maindir, csvfile, ebasis_dir, initial_coords_dict=None,
+
+ #Run Input Builder function
+ save_dir = maindir + 'inputs/'
+ input_builder(csvfile, save_dir, ebasis_dir,
+ initial_coords_dict, title.replace('/', '\n'))
+
+
+ return"
+440,https://:@github.com/Cavenfish/autogamess.git,4dcbf5d1a0f9059f8bdbc1a346c8f9cced70f62d,"@@ -136,7 +136,7 @@ def new_project(maindir, csvfile, ebasis_dir, initial_coords_dict=None,
+
+ #Run Input Builder function
+ save_dir = maindir + 'inputs/'
+- input_builder(csvfile, save_dir, ebasis_dir,
++ input_builder(csvfile, ebasis_dir, save_dir,
+ initial_coords_dict, title.replace('/', '\n'))
+
+
+",autogamess/new_project.py,"ArgSwap(idxs=1<->2 @(139,4)->(139,17))","def new_project(maindir, csvfile, ebasis_dir, initial_coords_dict=None,
+
+ #Run Input Builder function
+ save_dir = maindir + 'inputs/'
+ input_builder(csvfile, save_dir, ebasis_dir,
+ initial_coords_dict, title.replace('/', '\n'))
+
+ ","def new_project(maindir, csvfile, ebasis_dir, initial_coords_dict=None,
+
+ #Run Input Builder function
+ save_dir = maindir + 'inputs/'
+ input_builder(csvfile, ebasis_dir, save_dir,
+ initial_coords_dict, title.replace('/', '\n'))
+
+ "
+441,https://:@github.com/Cavenfish/autogamess.git,3890ccfd3dc7e723a37b8b5308d59a8de0b6f807,"@@ -306,6 +306,6 @@ def fill_spreadsheets(projdir=False, sorteddir=False, sheetsdir=False):
+ if vsc in df:
+ df[vsc].to_excel(writer, sheet_name=vsc, startrow=6)
+ if cmp in df:
+- df[cmp].to_excel(writer, sheet_name=vsc, startrow=6)
++ df[cmp].to_excel(writer, sheet_name=cmp, startrow=6)
+
+ return
+",autogamess/fill_spreadsheets.py,"ReplaceText(target='cmp' @(309,52)->(309,55))","def fill_spreadsheets(projdir=False, sorteddir=False, sheetsdir=False):
+ if vsc in df:
+ df[vsc].to_excel(writer, sheet_name=vsc, startrow=6)
+ if cmp in df:
+ df[cmp].to_excel(writer, sheet_name=vsc, startrow=6)
+
+ return","def fill_spreadsheets(projdir=False, sorteddir=False, sheetsdir=False):
+ if vsc in df:
+ df[vsc].to_excel(writer, sheet_name=vsc, startrow=6)
+ if cmp in df:
+ df[cmp].to_excel(writer, sheet_name=cmp, startrow=6)
+
+ return"
+442,https://:@github.com/EntilZha/ScalaFunctional.git,8426ff978b84cb4125052ad842ae5db64eaf42f3,"@@ -185,6 +185,6 @@ class TestStreams(unittest.TestCase):
+
+ # test insert into a connection
+ with sqlite3.connect(tmp_path) as conn:
+- seq(elements).to_sqlite3(tmp_path, insert_sql)
++ seq(elements).to_sqlite3(conn, insert_sql)
+ result = seq.sqlite3(conn, ""SELECT id, name FROM user;"").to_list()
+ self.assertListEqual(elements, result)
+",functional/test/test_streams.py,"ReplaceText(target='conn' @(188,37)->(188,45))","class TestStreams(unittest.TestCase):
+
+ # test insert into a connection
+ with sqlite3.connect(tmp_path) as conn:
+ seq(elements).to_sqlite3(tmp_path, insert_sql)
+ result = seq.sqlite3(conn, ""SELECT id, name FROM user;"").to_list()
+ self.assertListEqual(elements, result)","class TestStreams(unittest.TestCase):
+
+ # test insert into a connection
+ with sqlite3.connect(tmp_path) as conn:
+ seq(elements).to_sqlite3(conn, insert_sql)
+ result = seq.sqlite3(conn, ""SELECT id, name FROM user;"").to_list()
+ self.assertListEqual(elements, result)"
+443,https://:@github.com/wesselb/stheno.git,32d55bf855f88067e689684eaa5d6f9e8c7604d6,"@@ -80,7 +80,7 @@ class Kernel(Referentiable):
+ def feat_map(x):
+ scale = 2 * B.pi / B.cast(period, x.dtype)
+ return B.concatenate((B.sin(x * scale),
+- B.cos(x * scale)), axis=0)
++ B.cos(x * scale)), axis=1)
+
+ return Kernel(lambda x, y: self.f(feat_map(x), feat_map(y)))
+
+",stheno/kernel.py,"ReplaceText(target='1' @(83,59)->(83,60))","class Kernel(Referentiable):
+ def feat_map(x):
+ scale = 2 * B.pi / B.cast(period, x.dtype)
+ return B.concatenate((B.sin(x * scale),
+ B.cos(x * scale)), axis=0)
+
+ return Kernel(lambda x, y: self.f(feat_map(x), feat_map(y)))
+ ","class Kernel(Referentiable):
+ def feat_map(x):
+ scale = 2 * B.pi / B.cast(period, x.dtype)
+ return B.concatenate((B.sin(x * scale),
+ B.cos(x * scale)), axis=1)
+
+ return Kernel(lambda x, y: self.f(feat_map(x), feat_map(y)))
+ "
+444,https://:@github.com/djgagne/hagelslag.git,7ef4f68645a7b7146f21813f2b39a0a7208b0fdb,"@@ -19,7 +19,7 @@ class Watershed(object):
+ self.max_intensity = max_intensity
+
+ def label(self, data):
+- core_labels, n_labels = label(data <= self.max_intensity)
++ core_labels, n_labels = label(data >= self.max_intensity)
+ ws_labels = watershed(data.max() - data, markers=core_labels, mask=data >= self.min_intensity)
+ return ws_labels
+
+",hagelslag/processing/Watershed.py,"ReplaceText(target='>=' @(22,43)->(22,45))","class Watershed(object):
+ self.max_intensity = max_intensity
+
+ def label(self, data):
+ core_labels, n_labels = label(data <= self.max_intensity)
+ ws_labels = watershed(data.max() - data, markers=core_labels, mask=data >= self.min_intensity)
+ return ws_labels
+ ","class Watershed(object):
+ self.max_intensity = max_intensity
+
+ def label(self, data):
+ core_labels, n_labels = label(data >= self.max_intensity)
+ ws_labels = watershed(data.max() - data, markers=core_labels, mask=data >= self.min_intensity)
+ return ws_labels
+ "
+445,https://:@github.com/djgagne/hagelslag.git,28dbda86b4244802a1651a808dfcfe0dbdeb62e3,"@@ -19,7 +19,7 @@ class Watershed(object):
+ self.max_intensity = max_intensity
+
+ def label(self, data):
+- core_labels, n_labels = label(data >= self.max_intensity)
++ core_labels, n_labels = label(data <= self.max_intensity)
+ ws_labels = watershed(data.max() - data, markers=core_labels, mask=data >= self.min_intensity)
+ return ws_labels
+
+",hagelslag/processing/Watershed.py,"ReplaceText(target='<=' @(22,43)->(22,45))","class Watershed(object):
+ self.max_intensity = max_intensity
+
+ def label(self, data):
+ core_labels, n_labels = label(data >= self.max_intensity)
+ ws_labels = watershed(data.max() - data, markers=core_labels, mask=data >= self.min_intensity)
+ return ws_labels
+ ","class Watershed(object):
+ self.max_intensity = max_intensity
+
+ def label(self, data):
+ core_labels, n_labels = label(data <= self.max_intensity)
+ ws_labels = watershed(data.max() - data, markers=core_labels, mask=data >= self.min_intensity)
+ return ws_labels
+ "
+446,https://:@github.com/djgagne/hagelslag.git,be189c11c1135f782bb30529f58dff78e99f4c8e,"@@ -19,7 +19,7 @@ class Watershed(object):
+ self.max_intensity = max_intensity
+
+ def label(self, data):
+- core_labels, n_labels = label(data <= self.max_intensity)
++ core_labels, n_labels = label(data >= self.max_intensity)
+ ws_labels = watershed(data.max() - data, markers=core_labels, mask=data >= self.min_intensity)
+ return ws_labels
+
+",hagelslag/processing/Watershed.py,"ReplaceText(target='>=' @(22,43)->(22,45))","class Watershed(object):
+ self.max_intensity = max_intensity
+
+ def label(self, data):
+ core_labels, n_labels = label(data <= self.max_intensity)
+ ws_labels = watershed(data.max() - data, markers=core_labels, mask=data >= self.min_intensity)
+ return ws_labels
+ ","class Watershed(object):
+ self.max_intensity = max_intensity
+
+ def label(self, data):
+ core_labels, n_labels = label(data >= self.max_intensity)
+ ws_labels = watershed(data.max() - data, markers=core_labels, mask=data >= self.min_intensity)
+ return ws_labels
+ "
+447,https://:@github.com/ICRAR/daliuge.git,72b08c308f61bc4e9006976fc9e63f3638fad9e8,"@@ -604,7 +604,7 @@ def chiles_pg():
+ total_bandwidth = 480
+ num_obs = 8 # the same as num of data island
+ subband_width = 60 # MHz
+- num_subb = total_bandwidth / subband_width
++ num_subb = total_bandwidth // subband_width
+ subband_dict = collections.defaultdict(list) # for corner turning
+ img_list = []
+ start_freq = 940
+",test/graphsRepository.py,"ReplaceText(target='//' @(607,31)->(607,32))","def chiles_pg():
+ total_bandwidth = 480
+ num_obs = 8 # the same as num of data island
+ subband_width = 60 # MHz
+ num_subb = total_bandwidth / subband_width
+ subband_dict = collections.defaultdict(list) # for corner turning
+ img_list = []
+ start_freq = 940","def chiles_pg():
+ total_bandwidth = 480
+ num_obs = 8 # the same as num of data island
+ subband_width = 60 # MHz
+ num_subb = total_bandwidth // subband_width
+ subband_dict = collections.defaultdict(list) # for corner turning
+ img_list = []
+ start_freq = 940"
+448,https://:@github.com/ICRAR/daliuge.git,00eb7a92f6679df09650e2e8054e9163f0089785,"@@ -115,7 +115,7 @@ class TestDM(unittest.TestCase):
+ a.setCompleted()
+
+ for dm, drop in (dm1,a), (dm2,b), (dm2,c):
+- self.assertEqual(DROPStates.COMPLETED, dm.get_drop_property(sessionId, 'status', drop.uid))
++ self.assertEqual(DROPStates.COMPLETED, dm.get_drop_property(sessionId, drop.uid, 'status'))
+ self.assertEqual(a.checksum, int(droputils.allDropContents(c)))
+
+ for dropProxy in a,b,c:
+",test/manager/test_dm.py,"ArgSwap(idxs=1<->2 @(118,51)->(118,71))","class TestDM(unittest.TestCase):
+ a.setCompleted()
+
+ for dm, drop in (dm1,a), (dm2,b), (dm2,c):
+ self.assertEqual(DROPStates.COMPLETED, dm.get_drop_property(sessionId, 'status', drop.uid))
+ self.assertEqual(a.checksum, int(droputils.allDropContents(c)))
+
+ for dropProxy in a,b,c:","class TestDM(unittest.TestCase):
+ a.setCompleted()
+
+ for dm, drop in (dm1,a), (dm2,b), (dm2,c):
+ self.assertEqual(DROPStates.COMPLETED, dm.get_drop_property(sessionId, drop.uid, 'status'))
+ self.assertEqual(a.checksum, int(droputils.allDropContents(c)))
+
+ for dropProxy in a,b,c:"
+449,https://:@github.com/ICRAR/daliuge.git,a45bf6f0b7e2fa2627b7e4faa18324aa1087d8f5,"@@ -167,7 +167,7 @@ class DockerTests(unittest.TestCase):
+ c = FileDROP('c', 'c')
+ b.addInput(a)
+ b.addOutput(c)
+- with DROPWaiterCtx(self, b, 100):
++ with DROPWaiterCtx(self, c, 100):
+ a.setCompleted()
+ self.assertEqual(six.b(a.dataURL), droputils.allDropContents(c))
+
+",test/apps/test_docker.py,"ReplaceText(target='c' @(170,33)->(170,34))","class DockerTests(unittest.TestCase):
+ c = FileDROP('c', 'c')
+ b.addInput(a)
+ b.addOutput(c)
+ with DROPWaiterCtx(self, b, 100):
+ a.setCompleted()
+ self.assertEqual(six.b(a.dataURL), droputils.allDropContents(c))
+ ","class DockerTests(unittest.TestCase):
+ c = FileDROP('c', 'c')
+ b.addInput(a)
+ b.addOutput(c)
+ with DROPWaiterCtx(self, c, 100):
+ a.setCompleted()
+ self.assertEqual(six.b(a.dataURL), droputils.allDropContents(c))
+ "
+450,https://:@github.com/ICRAR/daliuge.git,882b2feb9672662c5347bf0b11ce06b0e7529be8,"@@ -512,7 +512,7 @@ class LogParser(object):
+ for dim_log_f in possible_logs:
+ if (os.path.exists(dim_log_f)):
+ self._dim_log_f = [dim_log_f]
+- if (dim_log_f == possible_logs[1]):
++ if (dim_log_f == possible_logs[0]):
+ cluster_log = os.path.join(log_dir, '0', 'start_dlg_cluster.log')
+ if (os.path.exists(cluster_log)):
+ self._dim_log_f.append(cluster_log)
+",dlg/deploy/pawsey/scale_test.py,"ReplaceText(target='0' @(515,47)->(515,48))","class LogParser(object):
+ for dim_log_f in possible_logs:
+ if (os.path.exists(dim_log_f)):
+ self._dim_log_f = [dim_log_f]
+ if (dim_log_f == possible_logs[1]):
+ cluster_log = os.path.join(log_dir, '0', 'start_dlg_cluster.log')
+ if (os.path.exists(cluster_log)):
+ self._dim_log_f.append(cluster_log)","class LogParser(object):
+ for dim_log_f in possible_logs:
+ if (os.path.exists(dim_log_f)):
+ self._dim_log_f = [dim_log_f]
+ if (dim_log_f == possible_logs[0]):
+ cluster_log = os.path.join(log_dir, '0', 'start_dlg_cluster.log')
+ if (os.path.exists(cluster_log)):
+ self._dim_log_f.append(cluster_log)"
+451,https://:@github.com/ICRAR/daliuge.git,f1204971537d6fa5e972cd96c963f907166dd291,"@@ -952,7 +952,7 @@ class KFamilyPartition(Partition):
+ kwargs['weight'] = self_global_dag.node[u].get('weight', 5)
+ self._dag.add_node(u, **kwargs)
+ for k in self._w_attr:
+- self._tmp_max_dop[_w_attr] = get_max_weighted_antichain(self._dag, w_attr=k)[0]
++ self._tmp_max_dop[k] = get_max_weighted_antichain(self._dag, w_attr=k)[0]
+ self._max_dop = self._tmp_max_dop
+
+ def can_merge(self, that, u, v):
+",dlg/dropmake/scheduler.py,"ReplaceText(target='k' @(955,30)->(955,37))","class KFamilyPartition(Partition):
+ kwargs['weight'] = self_global_dag.node[u].get('weight', 5)
+ self._dag.add_node(u, **kwargs)
+ for k in self._w_attr:
+ self._tmp_max_dop[_w_attr] = get_max_weighted_antichain(self._dag, w_attr=k)[0]
+ self._max_dop = self._tmp_max_dop
+
+ def can_merge(self, that, u, v):","class KFamilyPartition(Partition):
+ kwargs['weight'] = self_global_dag.node[u].get('weight', 5)
+ self._dag.add_node(u, **kwargs)
+ for k in self._w_attr:
+ self._tmp_max_dop[k] = get_max_weighted_antichain(self._dag, w_attr=k)[0]
+ self._max_dop = self._tmp_max_dop
+
+ def can_merge(self, that, u, v):"
+452,https://:@github.com/ICRAR/daliuge.git,6a91d4338a9a90bc2413e4e78c9ed8ca02264ae4,"@@ -2225,7 +2225,7 @@ def partition(pgt, algo, num_partitions=1, num_islands=1,
+
+ elif algo == ALGO_MIN_NUM_PARTS:
+ time_greedy = 1 - time_greedy / 100.0 # assuming between 1 to 100
+- pgt = MinNumPartsPGTP(pgt, deadline, num_partitions, partition_label, max_dop, merge_parts=could_merge, optimistic_factor=time_greedy)
++ pgt = MinNumPartsPGTP(pgt, deadline, num_partitions, partition_label, max_cpu, merge_parts=could_merge, optimistic_factor=time_greedy)
+
+ elif algo == ALGO_PSO:
+ pgt = PSOPGTP(pgt, partition_label, max_dop, deadline=deadline, topk=topk, swarm_size=swarm_size, merge_parts=could_merge)
+",dlg/dropmake/pg_generator.py,"ReplaceText(target='max_cpu' @(2228,79)->(2228,86))","def partition(pgt, algo, num_partitions=1, num_islands=1,
+
+ elif algo == ALGO_MIN_NUM_PARTS:
+ time_greedy = 1 - time_greedy / 100.0 # assuming between 1 to 100
+ pgt = MinNumPartsPGTP(pgt, deadline, num_partitions, partition_label, max_dop, merge_parts=could_merge, optimistic_factor=time_greedy)
+
+ elif algo == ALGO_PSO:
+ pgt = PSOPGTP(pgt, partition_label, max_dop, deadline=deadline, topk=topk, swarm_size=swarm_size, merge_parts=could_merge)","def partition(pgt, algo, num_partitions=1, num_islands=1,
+
+ elif algo == ALGO_MIN_NUM_PARTS:
+ time_greedy = 1 - time_greedy / 100.0 # assuming between 1 to 100
+ pgt = MinNumPartsPGTP(pgt, deadline, num_partitions, partition_label, max_cpu, merge_parts=could_merge, optimistic_factor=time_greedy)
+
+ elif algo == ALGO_PSO:
+ pgt = PSOPGTP(pgt, partition_label, max_dop, deadline=deadline, topk=topk, swarm_size=swarm_size, merge_parts=could_merge)"
+453,https://:@github.com/ICRAR/daliuge.git,885ea31e59129d694329161da7acf7e8f2654348,"@@ -96,7 +96,7 @@ def check_hosts(ips, port, timeout=None, check_with_session=False, retry=1):
+ logger.info(""Host %s:%d is running"", ip, port)
+ return ip
+ logger.warning(""Failed to contact host %s:%d"", ip, port)
+- ntries -= 0
++ ntries -= 1
+ return None
+
+ # Don't return None values
+",dlg/deploy/pawsey/start_dfms_cluster.py,"ReplaceText(target='1' @(99,22)->(99,23))","def check_hosts(ips, port, timeout=None, check_with_session=False, retry=1):
+ logger.info(""Host %s:%d is running"", ip, port)
+ return ip
+ logger.warning(""Failed to contact host %s:%d"", ip, port)
+ ntries -= 0
+ return None
+
+ # Don't return None values","def check_hosts(ips, port, timeout=None, check_with_session=False, retry=1):
+ logger.info(""Host %s:%d is running"", ip, port)
+ return ip
+ logger.warning(""Failed to contact host %s:%d"", ip, port)
+ ntries -= 1
+ return None
+
+ # Don't return None values"
+454,https://:@github.com/ICRAR/daliuge.git,ca615527deef8c147aaad3c64755b5f3d89b65b8,"@@ -56,7 +56,7 @@ def timed_import(module_name):
+ """"""Imports `module_name` and log how long it took to import it""""""
+ start = time.time()
+ module = importlib.import_module(module_name)
+- logger.info('Imported %s in %.3f seconds', module, time.time() - start)
++ logger.info('Imported %s in %.3f seconds', module_name, time.time() - start)
+ return module
+
+
+",dlg/utils.py,"ReplaceText(target='module_name' @(59,47)->(59,53))","def timed_import(module_name):
+ """"""Imports `module_name` and log how long it took to import it""""""
+ start = time.time()
+ module = importlib.import_module(module_name)
+ logger.info('Imported %s in %.3f seconds', module, time.time() - start)
+ return module
+
+ ","def timed_import(module_name):
+ """"""Imports `module_name` and log how long it took to import it""""""
+ start = time.time()
+ module = importlib.import_module(module_name)
+ logger.info('Imported %s in %.3f seconds', module_name, time.time() - start)
+ return module
+
+ "
+455,https://:@github.com/JRCSTU/co2mpas-ta.git,8e8557c3590acc6942bcabc7167de3767681e48b,"@@ -419,7 +419,7 @@ def define_alternator_status_model(
+ if soc < dn_soc or (prev_status == 1 and soc < up_soc):
+ status = 1
+
+- elif has_energy_recuperation and gear_box_power_in >= 0:
++ elif has_energy_recuperation and gear_box_power_in < 0:
+ status = 2
+
+ return status
+",co2mpas/functions/physical/electrics/__init__.py,"ReplaceText(target='<' @(422,63)->(422,65))","def define_alternator_status_model(
+ if soc < dn_soc or (prev_status == 1 and soc < up_soc):
+ status = 1
+
+ elif has_energy_recuperation and gear_box_power_in >= 0:
+ status = 2
+
+ return status","def define_alternator_status_model(
+ if soc < dn_soc or (prev_status == 1 and soc < up_soc):
+ status = 1
+
+ elif has_energy_recuperation and gear_box_power_in < 0:
+ status = 2
+
+ return status"
+456,https://:@github.com/JRCSTU/co2mpas-ta.git,b155780da4cd2489da6c06da12e0c4df41534ab5,"@@ -2766,8 +2766,8 @@ class Dispatcher(object):
+
+ elif node_id in dists: # The node w already estimated.
+ if dist < dists[node_id]: # Error for negative paths.
+- raise DispatcherError('Contradictory paths found: '
+- 'negative weights?', self)
++ raise DispatcherError(self, 'Contradictory paths found: '
++ 'negative weights?')
+ elif node_id not in seen or dist < seen[node_id]: # Check min dist.
+ seen[node_id] = dist # Update dist.
+
+",co2mpas/dispatcher/__init__.py,"ArgSwap(idxs=0<->1 @(2769,22)->(2769,37))","class Dispatcher(object):
+
+ elif node_id in dists: # The node w already estimated.
+ if dist < dists[node_id]: # Error for negative paths.
+ raise DispatcherError('Contradictory paths found: '
+ 'negative weights?', self)
+ elif node_id not in seen or dist < seen[node_id]: # Check min dist.
+ seen[node_id] = dist # Update dist.
+ ","class Dispatcher(object):
+
+ elif node_id in dists: # The node w already estimated.
+ if dist < dists[node_id]: # Error for negative paths.
+ raise DispatcherError(self, 'Contradictory paths found: '
+ 'negative weights?')
+ elif node_id not in seen or dist < seen[node_id]: # Check min dist.
+ seen[node_id] = dist # Update dist.
+ "
+457,https://:@github.com/JRCSTU/co2mpas-ta.git,46830a3edd1490d499b8f0e788ce87efe873d264,"@@ -225,7 +225,7 @@ def _predict_electrics(
+ alternator_current = calculate_alternator_current(
+ alternator_status, on_engine, gear_box_power_in,
+ alternator_current_model, engine_start_current,
+- prev_battery_current, acceleration)
++ battery_state_of_charge, acceleration)
+
+ battery_current = calculate_battery_current(
+ electric_load, alternator_current, alternator_nominal_voltage,
+",co2mpas/functions/co2mpas_model/physical/electrics/electrics_prediction.py,"ReplaceText(target='battery_state_of_charge' @(228,8)->(228,28))","def _predict_electrics(
+ alternator_current = calculate_alternator_current(
+ alternator_status, on_engine, gear_box_power_in,
+ alternator_current_model, engine_start_current,
+ prev_battery_current, acceleration)
+
+ battery_current = calculate_battery_current(
+ electric_load, alternator_current, alternator_nominal_voltage,","def _predict_electrics(
+ alternator_current = calculate_alternator_current(
+ alternator_status, on_engine, gear_box_power_in,
+ alternator_current_model, engine_start_current,
+ battery_state_of_charge, acceleration)
+
+ battery_current = calculate_battery_current(
+ electric_load, alternator_current, alternator_nominal_voltage,"
+458,https://:@github.com/JRCSTU/co2mpas-ta.git,45e4f0782888c84b9c99842db88457353b45efb3,"@@ -240,7 +240,7 @@ def define_data_schema(read=True):
+ 'f0_uncorrected': positive,
+ 'f2': positive,
+ 'f0': positive,
+- 'correct_f0': positive,
++ 'correct_f0': _bool,
+
+ 'co2_emission_low': positive,
+ 'co2_emission_medium': positive,
+",co2mpas/functions/io/schema.py,"ReplaceText(target='_bool' @(243,22)->(243,30))","def define_data_schema(read=True):
+ 'f0_uncorrected': positive,
+ 'f2': positive,
+ 'f0': positive,
+ 'correct_f0': positive,
+
+ 'co2_emission_low': positive,
+ 'co2_emission_medium': positive,","def define_data_schema(read=True):
+ 'f0_uncorrected': positive,
+ 'f2': positive,
+ 'f0': positive,
+ 'correct_f0': _bool,
+
+ 'co2_emission_low': positive,
+ 'co2_emission_medium': positive,"
+459,https://:@github.com/JRCSTU/co2mpas-ta.git,3fcd6ce4395980ea879bde8f1270e390e750a8ee,"@@ -3020,7 +3020,7 @@ class Dispatcher(object):
+ self._meet[dsp_id] = initial_dist # Set view distance.
+
+ # Check if inputs are satisfied.
+- if self.check_wait_in(node['wait_inputs'], node_id):
++ if self.check_wait_in(node['wait_inputs'], dsp_id):
+ return False # Pass the node
+
+ if dsp_id not in distances:
+",co2mpas/dispatcher/__init__.py,"ReplaceText(target='dsp_id' @(3023,51)->(3023,58))","class Dispatcher(object):
+ self._meet[dsp_id] = initial_dist # Set view distance.
+
+ # Check if inputs are satisfied.
+ if self.check_wait_in(node['wait_inputs'], node_id):
+ return False # Pass the node
+
+ if dsp_id not in distances:","class Dispatcher(object):
+ self._meet[dsp_id] = initial_dist # Set view distance.
+
+ # Check if inputs are satisfied.
+ if self.check_wait_in(node['wait_inputs'], dsp_id):
+ return False # Pass the node
+
+ if dsp_id not in distances:"
+460,https://:@github.com/JRCSTU/co2mpas-ta.git,e3346285e51b0bba0d909746146e0be70c3090eb,"@@ -87,7 +87,7 @@ def calculate_full_load(full_load_speeds, full_load_powers, idle_engine_speed):
+ """"""
+
+ pn = np.array((full_load_speeds, full_load_powers))
+- max_speed_at_max_power, max_power = pn[:, np.argmax(pn[0])]
++ max_speed_at_max_power, max_power = pn[:, np.argmax(pn[1])]
+ pn[1] /= max_power
+ idle = idle_engine_speed[0]
+ pn[0] = (pn[0] - idle) / (max_speed_at_max_power - idle)
+",co2mpas/model/physical/engine/__init__.py,"ReplaceText(target='1' @(90,59)->(90,60))","def calculate_full_load(full_load_speeds, full_load_powers, idle_engine_speed):
+ """"""
+
+ pn = np.array((full_load_speeds, full_load_powers))
+ max_speed_at_max_power, max_power = pn[:, np.argmax(pn[0])]
+ pn[1] /= max_power
+ idle = idle_engine_speed[0]
+ pn[0] = (pn[0] - idle) / (max_speed_at_max_power - idle)","def calculate_full_load(full_load_speeds, full_load_powers, idle_engine_speed):
+ """"""
+
+ pn = np.array((full_load_speeds, full_load_powers))
+ max_speed_at_max_power, max_power = pn[:, np.argmax(pn[1])]
+ pn[1] /= max_power
+ idle = idle_engine_speed[0]
+ pn[0] = (pn[0] - idle) / (max_speed_at_max_power - idle)"
+461,https://:@github.com/JRCSTU/co2mpas-ta.git,4154efcd8980a1790f2675afa14803991b4da76e,"@@ -1223,7 +1223,7 @@ def calibrate_co2_params(
+
+ p = restrict_bounds(p)
+
+- p, s = calibrate_model_params(co2_error_function_on_phases, p)
++ p, s = calibrate_model_params(co2_error_function_on_emissions, p)
+ success.append((s, copy.deepcopy(p)))
+ _set_attr(p, vary)
+
+",co2mpas/model/physical/engine/co2_emission.py,"ReplaceText(target='co2_error_function_on_emissions' @(1226,34)->(1226,62))","def calibrate_co2_params(
+
+ p = restrict_bounds(p)
+
+ p, s = calibrate_model_params(co2_error_function_on_phases, p)
+ success.append((s, copy.deepcopy(p)))
+ _set_attr(p, vary)
+ ","def calibrate_co2_params(
+
+ p = restrict_bounds(p)
+
+ p, s = calibrate_model_params(co2_error_function_on_emissions, p)
+ success.append((s, copy.deepcopy(p)))
+ _set_attr(p, vary)
+ "
+462,https://:@github.com/JRCSTU/co2mpas-ta.git,4c077512de9127f377b3802d2c82fe8ebd56f5c2,"@@ -703,7 +703,7 @@ def define_data_schema(read=True):
+ 'alternator_powers_demand': np_array,
+ 'alternator_statuses': np_array_int,
+ 'auxiliaries_power_losses': np_array,
+- 'auxiliaries_torque_loss': positive,
++ 'auxiliaries_torque_loss': tuplefloat,
+ 'auxiliaries_torque_losses': np_array,
+ 'battery_currents': np_array,
+ 'clutch_tc_powers': np_array,
+",co2mpas/io/schema.py,"ReplaceText(target='tuplefloat' @(706,35)->(706,43))","def define_data_schema(read=True):
+ 'alternator_powers_demand': np_array,
+ 'alternator_statuses': np_array_int,
+ 'auxiliaries_power_losses': np_array,
+ 'auxiliaries_torque_loss': positive,
+ 'auxiliaries_torque_losses': np_array,
+ 'battery_currents': np_array,
+ 'clutch_tc_powers': np_array,","def define_data_schema(read=True):
+ 'alternator_powers_demand': np_array,
+ 'alternator_statuses': np_array_int,
+ 'auxiliaries_power_losses': np_array,
+ 'auxiliaries_torque_loss': tuplefloat,
+ 'auxiliaries_torque_losses': np_array,
+ 'battery_currents': np_array,
+ 'clutch_tc_powers': np_array,"
+463,https://:@github.com/JRCSTU/co2mpas-ta.git,274f898a173aa42185fa5ef138035b4cb5994d28,"@@ -74,7 +74,7 @@ class TestGearBox(unittest.TestCase):
+ def test_calculate_torque_out(self):
+ wp, es, gbs = self.wp, self.es, self.ws
+ self.assertEquals(
+- list(calculate_gear_box_torques(wp, es, gbs, 10)), list(self.tgb)
++ list(calculate_gear_box_torques(wp, gbs, es, 10)), list(self.tgb)
+ )
+
+ @unittest.skip(""to be reviewed"")
+",tests/functions/test_gear_box.py,"ArgSwap(idxs=1<->2 @(77,17)->(77,43))","class TestGearBox(unittest.TestCase):
+ def test_calculate_torque_out(self):
+ wp, es, gbs = self.wp, self.es, self.ws
+ self.assertEquals(
+ list(calculate_gear_box_torques(wp, es, gbs, 10)), list(self.tgb)
+ )
+
+ @unittest.skip(""to be reviewed"")","class TestGearBox(unittest.TestCase):
+ def test_calculate_torque_out(self):
+ wp, es, gbs = self.wp, self.es, self.ws
+ self.assertEquals(
+ list(calculate_gear_box_torques(wp, gbs, es, 10)), list(self.tgb)
+ )
+
+ @unittest.skip(""to be reviewed"")"
+464,https://:@github.com/JRCSTU/co2mpas-ta.git,739964622f68661a4dc35b8a60a30db5cb8475b2,"@@ -2608,7 +2608,7 @@ class Co2guiCmd(cmdlets.Cmd):
+ progr_bar.grid(column=1, row=1, sticky='nswe')
+
+ if step is not None:
+- if step < 0:
++ if step <= 0:
+ progr_var.set(-step)
+ else:
+ progr_var.set(progr_var.get() + step)
+",co2mpas/co2gui/__init__.py,"ReplaceText(target='<=' @(2611,20)->(2611,21))","class Co2guiCmd(cmdlets.Cmd):
+ progr_bar.grid(column=1, row=1, sticky='nswe')
+
+ if step is not None:
+ if step < 0:
+ progr_var.set(-step)
+ else:
+ progr_var.set(progr_var.get() + step)","class Co2guiCmd(cmdlets.Cmd):
+ progr_bar.grid(column=1, row=1, sticky='nswe')
+
+ if step is not None:
+ if step <= 0:
+ progr_var.set(-step)
+ else:
+ progr_var.set(progr_var.get() + step)"
+465,https://:@github.com/JRCSTU/co2mpas-ta.git,18af1fede3536121930c99ea0a2c94e8ffeb3bf7,"@@ -450,6 +450,6 @@ def calculate_drive_battery_currents_v2(
+ n_p, n_s = drive_battery_n_parallel_cells, drive_battery_n_series_cells
+ p = drive_battery_electric_powers
+ r0, ocv = drive_battery_r0, drive_battery_ocv
+- x = ocv + np.nan_to_num(np.sqrt(ocv ** 2 - (4e3 * r0 / (n_s * n_p)) * p))
++ x = ocv - np.nan_to_num(np.sqrt(ocv ** 2 - (4e3 * r0 / (n_s * n_p)) * p))
+ x *= n_p / (2 * r0)
+ return x
+",co2mpas/core/model/physical/electrics/batteries/drive.py,"ReplaceText(target='-' @(453,12)->(453,13))","def calculate_drive_battery_currents_v2(
+ n_p, n_s = drive_battery_n_parallel_cells, drive_battery_n_series_cells
+ p = drive_battery_electric_powers
+ r0, ocv = drive_battery_r0, drive_battery_ocv
+ x = ocv + np.nan_to_num(np.sqrt(ocv ** 2 - (4e3 * r0 / (n_s * n_p)) * p))
+ x *= n_p / (2 * r0)
+ return x","def calculate_drive_battery_currents_v2(
+ n_p, n_s = drive_battery_n_parallel_cells, drive_battery_n_series_cells
+ p = drive_battery_electric_powers
+ r0, ocv = drive_battery_r0, drive_battery_ocv
+ x = ocv - np.nan_to_num(np.sqrt(ocv ** 2 - (4e3 * r0 / (n_s * n_p)) * p))
+ x *= n_p / (2 * r0)
+ return x"
+466,https://:@github.com/JRCSTU/co2mpas-ta.git,8f4cfb4afa97fc43a95b62b497f182fd72b0e379,"@@ -263,7 +263,7 @@ def calculate_service_battery_loads(
+ Service battery load vector [kW].
+ :rtype: numpy.array
+ """"""
+- p = service_battery_electric_powers - service_battery_electric_powers_supply
++ p = service_battery_electric_powers + service_battery_electric_powers_supply
+ return p
+
+
+",co2mpas/core/model/physical/electrics/batteries/service/__init__.py,"ReplaceText(target='+' @(266,40)->(266,41))","def calculate_service_battery_loads(
+ Service battery load vector [kW].
+ :rtype: numpy.array
+ """"""
+ p = service_battery_electric_powers - service_battery_electric_powers_supply
+ return p
+
+ ","def calculate_service_battery_loads(
+ Service battery load vector [kW].
+ :rtype: numpy.array
+ """"""
+ p = service_battery_electric_powers + service_battery_electric_powers_supply
+ return p
+
+ "
+467,https://:@github.com/JRCSTU/co2mpas-ta.git,52695d79acea053f5ff38a8a5d223f1907d33fb8,"@@ -46,7 +46,7 @@ def calculate_final_drive_ratios(final_drive_ratio, n_gears=1):
+
+ # noinspection PyUnusedLocal,PyMissingOrEmptyDocstring
+ def is_not_manual_or_automatic(gear_box_type, *args):
+- return gear_box_type in ('manual', 'automatic')
++ return gear_box_type not in ('manual', 'automatic')
+
+
+ dsp.add_function(
+",co2mpas/core/model/physical/final_drive.py,"ReplaceText(target=' not in ' @(49,24)->(49,28))","def calculate_final_drive_ratios(final_drive_ratio, n_gears=1):
+
+ # noinspection PyUnusedLocal,PyMissingOrEmptyDocstring
+ def is_not_manual_or_automatic(gear_box_type, *args):
+ return gear_box_type in ('manual', 'automatic')
+
+
+ dsp.add_function(","def calculate_final_drive_ratios(final_drive_ratio, n_gears=1):
+
+ # noinspection PyUnusedLocal,PyMissingOrEmptyDocstring
+ def is_not_manual_or_automatic(gear_box_type, *args):
+ return gear_box_type not in ('manual', 'automatic')
+
+
+ dsp.add_function("
+468,https://:@github.com/JRCSTU/co2mpas-ta.git,401ec07523c5b34dacab9e73cf9a417dada880cb,"@@ -429,7 +429,7 @@ class CorrectGear:
+
+ # 3.2
+ j = i + np.searchsorted(times[i:], times[i] + 1)
+- if not gear and up_clip(velocities, j + 1) >= up_clip(velocities, j):
++ if not gear and up_clip(velocities, j + 1) > up_clip(velocities, j):
+ gear = self.min_gear
+
+ return gear
+",co2mpas/core/model/physical/gear_box/at_gear/__init__.py,"ReplaceText(target='>' @(432,51)->(432,53))","class CorrectGear:
+
+ # 3.2
+ j = i + np.searchsorted(times[i:], times[i] + 1)
+ if not gear and up_clip(velocities, j + 1) >= up_clip(velocities, j):
+ gear = self.min_gear
+
+ return gear","class CorrectGear:
+
+ # 3.2
+ j = i + np.searchsorted(times[i:], times[i] + 1)
+ if not gear and up_clip(velocities, j + 1) > up_clip(velocities, j):
+ gear = self.min_gear
+
+ return gear"
+469,https://:@github.com/JRCSTU/co2mpas-ta.git,745c3623fffca5cf7f84358f8fff87287a35525c,"@@ -125,7 +125,7 @@ def define_tau_function(after_treatment_temperature_threshold):
+ f = sci_sta.lognorm(max(s, dfl.EPS), 0, temp_mean).cdf
+
+ def _tau_function(t0, t1, temp):
+- return t0 - (t1 - t0) * f(temp + 273)
++ return t0 + (t1 - t0) * f(temp + 273)
+
+ return _tau_function
+
+",co2mpas/core/model/physical/engine/fc.py,"ReplaceText(target='+' @(128,18)->(128,19))","def define_tau_function(after_treatment_temperature_threshold):
+ f = sci_sta.lognorm(max(s, dfl.EPS), 0, temp_mean).cdf
+
+ def _tau_function(t0, t1, temp):
+ return t0 - (t1 - t0) * f(temp + 273)
+
+ return _tau_function
+ ","def define_tau_function(after_treatment_temperature_threshold):
+ f = sci_sta.lognorm(max(s, dfl.EPS), 0, temp_mean).cdf
+
+ def _tau_function(t0, t1, temp):
+ return t0 + (t1 - t0) * f(temp + 273)
+
+ return _tau_function
+ "
+470,https://:@github.com/RasaHQ/rasa.git,57d15923475ec8b5361cd6f84f327d864253746a,"@@ -33,7 +33,7 @@ def run_train(_config):
+
+ def load_interpreter_for_model(nlp, config, persisted_path):
+ metadata = DataRouter.read_model_metadata(persisted_path, config)
+- return DataRouter.create_interpreter(nlp, metadata)
++ return DataRouter.create_interpreter(metadata, nlp)
+
+
+ class ResponseTest(object):
+",_pytest/utilities.py,"ArgSwap(idxs=0<->1 @(36,11)->(36,40))","def run_train(_config):
+
+ def load_interpreter_for_model(nlp, config, persisted_path):
+ metadata = DataRouter.read_model_metadata(persisted_path, config)
+ return DataRouter.create_interpreter(nlp, metadata)
+
+
+ class ResponseTest(object):","def run_train(_config):
+
+ def load_interpreter_for_model(nlp, config, persisted_path):
+ metadata = DataRouter.read_model_metadata(persisted_path, config)
+ return DataRouter.create_interpreter(metadata, nlp)
+
+
+ class ResponseTest(object):"
+471,https://:@github.com/RasaHQ/rasa.git,bb0b24e56a97affbfa3db91be71782f293e9e5c2,"@@ -29,7 +29,7 @@ def test_luis_data_without_tokenizer():
+ def test_wit_data():
+ td = load_data('data/examples/wit/demo-flights.json', ""en"")
+ assert td.entity_examples != []
+- assert td.intent_examples != []
++ assert td.intent_examples == []
+ assert td.entity_synonyms == {}
+
+
+",_pytest/test_training_data.py,"ReplaceText(target='==' @(32,30)->(32,32))","def test_luis_data_without_tokenizer():
+ def test_wit_data():
+ td = load_data('data/examples/wit/demo-flights.json', ""en"")
+ assert td.entity_examples != []
+ assert td.intent_examples != []
+ assert td.entity_synonyms == {}
+
+ ","def test_luis_data_without_tokenizer():
+ def test_wit_data():
+ td = load_data('data/examples/wit/demo-flights.json', ""en"")
+ assert td.entity_examples != []
+ assert td.intent_examples == []
+ assert td.entity_synonyms == {}
+
+ "
+472,https://:@github.com/RasaHQ/rasa.git,12484270fb8c3c271d74c5b3269f287eaf2d7cfb,"@@ -84,7 +84,7 @@ class SklearnIntentClassifier(Component):
+
+ # dirty str fix because sklearn is expecting str not instance of basestr...
+ tuned_parameters = [{'C': [1, 2, 5, 10, 20, 100], 'kernel': [str('linear')]}]
+- cv_splits = max(2, min(MAX_CV_FOLDS, np.min(np.bincount(y)) / 5)) # aim for at least 5 examples in each fold
++ cv_splits = max(2, min(MAX_CV_FOLDS, np.min(np.bincount(y)) // 5)) # aim for at least 5 examples in each fold
+
+ self.clf = GridSearchCV(SVC(C=1, probability=True),
+ param_grid=tuned_parameters, n_jobs=num_threads,
+",rasa_nlu/classifiers/sklearn_intent_classifier.py,"ReplaceText(target='//' @(87,68)->(87,69))","class SklearnIntentClassifier(Component):
+
+ # dirty str fix because sklearn is expecting str not instance of basestr...
+ tuned_parameters = [{'C': [1, 2, 5, 10, 20, 100], 'kernel': [str('linear')]}]
+ cv_splits = max(2, min(MAX_CV_FOLDS, np.min(np.bincount(y)) / 5)) # aim for at least 5 examples in each fold
+
+ self.clf = GridSearchCV(SVC(C=1, probability=True),
+ param_grid=tuned_parameters, n_jobs=num_threads,","class SklearnIntentClassifier(Component):
+
+ # dirty str fix because sklearn is expecting str not instance of basestr...
+ tuned_parameters = [{'C': [1, 2, 5, 10, 20, 100], 'kernel': [str('linear')]}]
+ cv_splits = max(2, min(MAX_CV_FOLDS, np.min(np.bincount(y)) // 5)) # aim for at least 5 examples in each fold
+
+ self.clf = GridSearchCV(SVC(C=1, probability=True),
+ param_grid=tuned_parameters, n_jobs=num_threads,"
+473,https://:@github.com/RasaHQ/rasa.git,b5f9b6ad06ff52d75522b49c745f3e83c32ee7cd,"@@ -135,7 +135,7 @@ class TrainingData(object):
+ logger.info(""Training data stats: \n"" +
+ ""\t- intent examples: {} ({} distinct intents)\n"".format(
+ self.num_intent_examples, len(different_intents)) +
+- ""\t- found intents: {}\n"".format(list_to_str(different_entities)) +
++ ""\t- found intents: {}\n"".format(list_to_str(different_intents)) +
+ ""\t- entity examples: {} ({} distinct entities)\n"".format(
+ self.num_entity_examples, len(different_entities)) +
+ ""\t- found entities: {}\n"".format(list_to_str(different_entities)))
+",rasa_nlu/training_data.py,"ReplaceText(target='different_intents' @(138,65)->(138,83))","class TrainingData(object):
+ logger.info(""Training data stats: \n"" +
+ ""\t- intent examples: {} ({} distinct intents)\n"".format(
+ self.num_intent_examples, len(different_intents)) +
+ ""\t- found intents: {}\n"".format(list_to_str(different_entities)) +
+ ""\t- entity examples: {} ({} distinct entities)\n"".format(
+ self.num_entity_examples, len(different_entities)) +
+ ""\t- found entities: {}\n"".format(list_to_str(different_entities)))","class TrainingData(object):
+ logger.info(""Training data stats: \n"" +
+ ""\t- intent examples: {} ({} distinct intents)\n"".format(
+ self.num_intent_examples, len(different_intents)) +
+ ""\t- found intents: {}\n"".format(list_to_str(different_intents)) +
+ ""\t- entity examples: {} ({} distinct entities)\n"".format(
+ self.num_entity_examples, len(different_entities)) +
+ ""\t- found entities: {}\n"".format(list_to_str(different_entities)))"
+474,https://:@github.com/RasaHQ/rasa.git,c5e10bd1c504146064183b6b87cfdf80d8617a4d,"@@ -28,7 +28,7 @@ class MarkdownToRasa:
+ entities = []
+ utter = example_in_md
+ for regex in [ent_regex, ent_regex_with_value]:
+- utter = re.sub(regex, r""\1"", example_in_md) # [text](entity) -> text
++ utter = re.sub(regex, r""\1"", utter) # [text](entity) -> text
+ ent_matches = re.finditer(regex, example_in_md)
+ for matchNum, match in enumerate(ent_matches):
+ if 'synonym' in match.groupdict():
+",rasa_nlu/utils/md_to_rasa.py,"ReplaceText(target='utter' @(31,41)->(31,54))","class MarkdownToRasa:
+ entities = []
+ utter = example_in_md
+ for regex in [ent_regex, ent_regex_with_value]:
+ utter = re.sub(regex, r""\1"", example_in_md) # [text](entity) -> text
+ ent_matches = re.finditer(regex, example_in_md)
+ for matchNum, match in enumerate(ent_matches):
+ if 'synonym' in match.groupdict():","class MarkdownToRasa:
+ entities = []
+ utter = example_in_md
+ for regex in [ent_regex, ent_regex_with_value]:
+ utter = re.sub(regex, r""\1"", utter) # [text](entity) -> text
+ ent_matches = re.finditer(regex, example_in_md)
+ for matchNum, match in enumerate(ent_matches):
+ if 'synonym' in match.groupdict():"
+475,https://:@github.com/RasaHQ/rasa.git,571c59bc9fccca87aa1c29b56ddf874fce9b111a,"@@ -87,9 +87,9 @@ class Metadata(object):
+ return []
+
+ def for_component(self, name, defaults=None):
+- return config.component_config_from_pipeline(self.get('pipeline', []),
+- name,
+- defaults)
++ return config.component_config_from_pipeline(name,
++ self.get('pipeline', []),
++ defaults)
+
+ @property
+ def language(self):
+",rasa_nlu/model.py,"ArgSwap(idxs=0<->1 @(90,15)->(90,52))","class Metadata(object):
+ return []
+
+ def for_component(self, name, defaults=None):
+ return config.component_config_from_pipeline(self.get('pipeline', []),
+ name,
+ defaults)
+
+ @property
+ def language(self):","class Metadata(object):
+ return []
+
+ def for_component(self, name, defaults=None):
+ return config.component_config_from_pipeline(name,
+ self.get('pipeline', []),
+ defaults)
+
+ @property
+ def language(self):"
+476,https://:@github.com/RasaHQ/rasa.git,9a06d81201ca84812540bc4128111c55e22ffca7,"@@ -156,7 +156,7 @@ class RasaNLUModelConfig(object):
+ return json_to_string(self.__dict__, indent=4)
+
+ def for_component(self, name, defaults=None):
+- return component_config_from_pipeline(self.pipeline, name, defaults)
++ return component_config_from_pipeline(name, self.pipeline, defaults)
+
+ @property
+ def component_names(self):
+",rasa_nlu/config.py,"ArgSwap(idxs=0<->1 @(159,15)->(159,45))","class RasaNLUModelConfig(object):
+ return json_to_string(self.__dict__, indent=4)
+
+ def for_component(self, name, defaults=None):
+ return component_config_from_pipeline(self.pipeline, name, defaults)
+
+ @property
+ def component_names(self):","class RasaNLUModelConfig(object):
+ return json_to_string(self.__dict__, indent=4)
+
+ def for_component(self, name, defaults=None):
+ return component_config_from_pipeline(name, self.pipeline, defaults)
+
+ @property
+ def component_names(self):"
+477,https://:@github.com/RasaHQ/rasa.git,2d92ef4002144ec4b3d66bd911c26642e5ab698f,"@@ -42,7 +42,7 @@ def create_argument_parser():
+ description='evaluates a dialogue model')
+ parent_parser = argparse.ArgumentParser(add_help=False)
+ add_args_to_parser(parent_parser)
+- cli.arguments.add_model_and_story_group(parser,
++ cli.arguments.add_model_and_story_group(parent_parser,
+ allow_pretrained_model=False)
+ utils.add_logging_option_arguments(parent_parser)
+ subparsers = parser.add_subparsers(help='mode', dest='mode')
+",rasa_core/evaluate.py,"ReplaceText(target='parent_parser' @(45,44)->(45,50))","def create_argument_parser():
+ description='evaluates a dialogue model')
+ parent_parser = argparse.ArgumentParser(add_help=False)
+ add_args_to_parser(parent_parser)
+ cli.arguments.add_model_and_story_group(parser,
+ allow_pretrained_model=False)
+ utils.add_logging_option_arguments(parent_parser)
+ subparsers = parser.add_subparsers(help='mode', dest='mode')","def create_argument_parser():
+ description='evaluates a dialogue model')
+ parent_parser = argparse.ArgumentParser(add_help=False)
+ add_args_to_parser(parent_parser)
+ cli.arguments.add_model_and_story_group(parent_parser,
+ allow_pretrained_model=False)
+ utils.add_logging_option_arguments(parent_parser)
+ subparsers = parser.add_subparsers(help='mode', dest='mode')"
+478,https://:@github.com/RasaHQ/rasa.git,665cf94ee30f44aac85e8ac3c5ed8b2b0694354a,"@@ -49,7 +49,7 @@ def create_argument_parser():
+ description='evaluates a dialogue model')
+ parent_parser = argparse.ArgumentParser(add_help=False)
+ add_args_to_parser(parent_parser)
+- cli.arguments.add_model_and_story_group(parser,
++ cli.arguments.add_model_and_story_group(parent_parser,
+ allow_pretrained_model=False)
+ utils.add_logging_option_arguments(parent_parser)
+ subparsers = parser.add_subparsers(help='mode', dest='mode')
+",rasa_core/evaluate.py,"ReplaceText(target='parent_parser' @(52,44)->(52,50))","def create_argument_parser():
+ description='evaluates a dialogue model')
+ parent_parser = argparse.ArgumentParser(add_help=False)
+ add_args_to_parser(parent_parser)
+ cli.arguments.add_model_and_story_group(parser,
+ allow_pretrained_model=False)
+ utils.add_logging_option_arguments(parent_parser)
+ subparsers = parser.add_subparsers(help='mode', dest='mode')","def create_argument_parser():
+ description='evaluates a dialogue model')
+ parent_parser = argparse.ArgumentParser(add_help=False)
+ add_args_to_parser(parent_parser)
+ cli.arguments.add_model_and_story_group(parent_parser,
+ allow_pretrained_model=False)
+ utils.add_logging_option_arguments(parent_parser)
+ subparsers = parser.add_subparsers(help='mode', dest='mode')"
+479,https://:@github.com/RasaHQ/rasa.git,37f446c8246c78339727f7b09bd2021906ec8d60,"@@ -174,7 +174,7 @@ def test_generate_training_data_original_and_augmented_trackers(
+ hasattr(t, 'is_augmented') or not t.is_augmented
+ ]
+ assert len(original_trackers) == 3
+- assert len(original_trackers) <= 33
++ assert len(training_trackers) <= 33
+
+
+ def test_visualize_training_data_graph(tmpdir, default_domain):
+",tests/test_dsl.py,"ReplaceText(target='training_trackers' @(177,15)->(177,32))","def test_generate_training_data_original_and_augmented_trackers(
+ hasattr(t, 'is_augmented') or not t.is_augmented
+ ]
+ assert len(original_trackers) == 3
+ assert len(original_trackers) <= 33
+
+
+ def test_visualize_training_data_graph(tmpdir, default_domain):","def test_generate_training_data_original_and_augmented_trackers(
+ hasattr(t, 'is_augmented') or not t.is_augmented
+ ]
+ assert len(original_trackers) == 3
+ assert len(training_trackers) <= 33
+
+
+ def test_visualize_training_data_graph(tmpdir, default_domain):"
+480,https://:@github.com/RasaHQ/rasa.git,31ab3bb5d10a09f8957455909311257b257f44dc,"@@ -218,7 +218,7 @@ class TestMemoizationPolicy(PolicyTestCollection):
+ assert recalled == default_domain.index_for_action(actions[0])
+
+ for tracker, states, actions \
+- in zip(trackers, all_states_augmented, all_actions_augmented):
++ in zip(augmented_trackers, all_states_augmented, all_actions_augmented):
+ recalled = trained_policy.recall(states, tracker, default_domain)
+ assert recalled == 0
+
+",tests/test_policies.py,"ReplaceText(target='augmented_trackers' @(221,23)->(221,31))","class TestMemoizationPolicy(PolicyTestCollection):
+ assert recalled == default_domain.index_for_action(actions[0])
+
+ for tracker, states, actions \
+ in zip(trackers, all_states_augmented, all_actions_augmented):
+ recalled = trained_policy.recall(states, tracker, default_domain)
+ assert recalled == 0
+ ","class TestMemoizationPolicy(PolicyTestCollection):
+ assert recalled == default_domain.index_for_action(actions[0])
+
+ for tracker, states, actions \
+ in zip(augmented_trackers, all_states_augmented, all_actions_augmented):
+ recalled = trained_policy.recall(states, tracker, default_domain)
+ assert recalled == 0
+ "
+481,https://:@github.com/RasaHQ/rasa.git,90a98e954b209a05a168e86e78d4ad90e12d8869,"@@ -31,7 +31,7 @@ def run(model: Text, endpoints: Text, connector: Text = None,
+ from rasa_core.utils import AvailableEndpoints
+
+ model_path = get_model(model)
+- core_path, nlu_path = get_model_subdirectories(model)
++ core_path, nlu_path = get_model_subdirectories(model_path)
+ _endpoints = AvailableEndpoints.read_endpoints(endpoints)
+
+ if not connector and not credentials:
+",rasa/run.py,"ReplaceText(target='model_path' @(34,51)->(34,56))","def run(model: Text, endpoints: Text, connector: Text = None,
+ from rasa_core.utils import AvailableEndpoints
+
+ model_path = get_model(model)
+ core_path, nlu_path = get_model_subdirectories(model)
+ _endpoints = AvailableEndpoints.read_endpoints(endpoints)
+
+ if not connector and not credentials:","def run(model: Text, endpoints: Text, connector: Text = None,
+ from rasa_core.utils import AvailableEndpoints
+
+ model_path = get_model(model)
+ core_path, nlu_path = get_model_subdirectories(model_path)
+ _endpoints = AvailableEndpoints.read_endpoints(endpoints)
+
+ if not connector and not credentials:"
+482,https://:@github.com/RasaHQ/rasa.git,e43636652c80d0e9d81dc01f6a83ebfc5444ee12,"@@ -69,8 +69,8 @@ def test_core(
+ if os.path.exists(core_path) and os.path.exists(nlu_path):
+ _interpreter = NaturalLanguageInterpreter.create(nlu_path, _endpoints.nlu)
+
+- _agent = Agent.load(core_path, interpreter=_interpreter)
+-
++ _agent = Agent.load(model_path, interpreter=_interpreter)
++
+ kwargs = minimal_kwargs(kwargs, rasa.core.test, [""stories"", ""agent""])
+
+ loop.run_until_complete(
+",rasa/test.py,"ReplaceText(target='model_path' @(72,28)->(72,37))","def test_core(
+ if os.path.exists(core_path) and os.path.exists(nlu_path):
+ _interpreter = NaturalLanguageInterpreter.create(nlu_path, _endpoints.nlu)
+
+ _agent = Agent.load(core_path, interpreter=_interpreter)
+
+ kwargs = minimal_kwargs(kwargs, rasa.core.test, [""stories"", ""agent""])
+
+ loop.run_until_complete(","def test_core(
+ if os.path.exists(core_path) and os.path.exists(nlu_path):
+ _interpreter = NaturalLanguageInterpreter.create(nlu_path, _endpoints.nlu)
+
+ _agent = Agent.load(model_path, interpreter=_interpreter)
+
+ kwargs = minimal_kwargs(kwargs, rasa.core.test, [""stories"", ""agent""])
+
+ loop.run_until_complete("
+483,https://:@github.com/RasaHQ/rasa.git,2d74a8355b63f587c6e1a7d69027a84982fe237d,"@@ -118,7 +118,7 @@ async def train_comparison_models(
+ file_importer,
+ train_path,
+ policy_config=policy_config,
+- exclusion_percentage=current_run,
++ exclusion_percentage=percentage,
+ kwargs=kwargs,
+ dump_stories=dump_stories,
+ )
+",rasa/core/train.py,"ReplaceText(target='percentage' @(121,45)->(121,56))","async def train_comparison_models(
+ file_importer,
+ train_path,
+ policy_config=policy_config,
+ exclusion_percentage=current_run,
+ kwargs=kwargs,
+ dump_stories=dump_stories,
+ )","async def train_comparison_models(
+ file_importer,
+ train_path,
+ policy_config=policy_config,
+ exclusion_percentage=percentage,
+ kwargs=kwargs,
+ dump_stories=dump_stories,
+ )"
+484,https://:@github.com/RasaHQ/rasa.git,3b51563dc49830f4e5f9a09ebd823c5f7eb563ef,"@@ -29,7 +29,7 @@ class Tokenizer(Component):
+ if ""use_cls_token"" in self.component_config:
+ self.use_cls_token = self.component_config[""use_cls_token""]
+ else:
+- self.use_cls_token = False
++ self.use_cls_token = True
+
+ def add_cls_token(
+ self, tokens: List[Token], attribute: Text = MESSAGE_TEXT_ATTRIBUTE
+",rasa/nlu/tokenizers/tokenizer.py,"ReplaceText(target='True' @(32,33)->(32,38))","class Tokenizer(Component):
+ if ""use_cls_token"" in self.component_config:
+ self.use_cls_token = self.component_config[""use_cls_token""]
+ else:
+ self.use_cls_token = False
+
+ def add_cls_token(
+ self, tokens: List[Token], attribute: Text = MESSAGE_TEXT_ATTRIBUTE","class Tokenizer(Component):
+ if ""use_cls_token"" in self.component_config:
+ self.use_cls_token = self.component_config[""use_cls_token""]
+ else:
+ self.use_cls_token = True
+
+ def add_cls_token(
+ self, tokens: List[Token], attribute: Text = MESSAGE_TEXT_ATTRIBUTE"
+485,https://:@github.com/RasaHQ/rasa.git,f96eb791fb2236695a98fd5a4f935c3c5d316fe3,"@@ -376,7 +376,7 @@ def test_intent_evaluation_report_large(tmpdir_factory):
+
+ assert len(report.keys()) == 8
+ assert report[""A""] == a_results
+- assert result[""E""] == e_results
++ assert report[""E""] == e_results
+
+
+ def test_response_evaluation_report(tmpdir_factory):
+",tests/nlu/base/test_evaluation.py,"ReplaceText(target='report' @(379,11)->(379,17))","def test_intent_evaluation_report_large(tmpdir_factory):
+
+ assert len(report.keys()) == 8
+ assert report[""A""] == a_results
+ assert result[""E""] == e_results
+
+
+ def test_response_evaluation_report(tmpdir_factory):","def test_intent_evaluation_report_large(tmpdir_factory):
+
+ assert len(report.keys()) == 8
+ assert report[""A""] == a_results
+ assert report[""E""] == e_results
+
+
+ def test_response_evaluation_report(tmpdir_factory):"
+486,https://:@github.com/RasaHQ/rasa.git,ff9bb32d79e484cd2cfd7cde0acfa9d0006e14f8,"@@ -527,7 +527,7 @@ class DotProductLoss(tf.keras.layers.Layer):
+
+ tiled = tf.tile(tf.expand_dims(x, 0), (batch_size, 1, 1))
+
+- return tf.gather(tiled, idxs, batch_dims=-1)
++ return tf.gather(tiled, idxs, batch_dims=1)
+
+ def _get_bad_mask(
+ self, labels: ""tf.Tensor"", target_labels: ""tf.Tensor"", idxs: ""tf.Tensor""
+",rasa/utils/tf_layers.py,"ReplaceText(target='1' @(530,49)->(530,51))","class DotProductLoss(tf.keras.layers.Layer):
+
+ tiled = tf.tile(tf.expand_dims(x, 0), (batch_size, 1, 1))
+
+ return tf.gather(tiled, idxs, batch_dims=-1)
+
+ def _get_bad_mask(
+ self, labels: ""tf.Tensor"", target_labels: ""tf.Tensor"", idxs: ""tf.Tensor""","class DotProductLoss(tf.keras.layers.Layer):
+
+ tiled = tf.tile(tf.expand_dims(x, 0), (batch_size, 1, 1))
+
+ return tf.gather(tiled, idxs, batch_dims=1)
+
+ def _get_bad_mask(
+ self, labels: ""tf.Tensor"", target_labels: ""tf.Tensor"", idxs: ""tf.Tensor"""
+487,https://:@github.com/RasaHQ/rasa.git,75e04b5ec3cb1ac6925152f491db074a391a9378,"@@ -67,7 +67,7 @@ class SpacyFeaturizer(Featurizer):
+ non_zero_features = np.array([f for f in features if f.any()])
+
+ if self.pooling_operation == ""mean"":
+- return np.mean(features, axis=0, keepdims=True)
++ return np.mean(non_zero_features, axis=0, keepdims=True)
+ elif self.pooling_operation == ""max"":
+ return np.max(features, axis=0, keepdims=True)
+ else:
+",rasa/nlu/featurizers/dense_featurizer/spacy_featurizer.py,"ReplaceText(target='non_zero_features' @(70,27)->(70,35))","class SpacyFeaturizer(Featurizer):
+ non_zero_features = np.array([f for f in features if f.any()])
+
+ if self.pooling_operation == ""mean"":
+ return np.mean(features, axis=0, keepdims=True)
+ elif self.pooling_operation == ""max"":
+ return np.max(features, axis=0, keepdims=True)
+ else:","class SpacyFeaturizer(Featurizer):
+ non_zero_features = np.array([f for f in features if f.any()])
+
+ if self.pooling_operation == ""mean"":
+ return np.mean(non_zero_features, axis=0, keepdims=True)
+ elif self.pooling_operation == ""max"":
+ return np.max(features, axis=0, keepdims=True)
+ else:"
+488,https://:@github.com/RasaHQ/rasa.git,ba4b8f70ffbb7bb4d3429c3b6aaa1f9fbcc3f632,"@@ -69,7 +69,7 @@ class SpacyFeaturizer(Featurizer):
+ if self.pooling_operation == ""mean"":
+ return np.mean(non_zero_features, axis=0, keepdims=True)
+ elif self.pooling_operation == ""max"":
+- return np.max(features, axis=0, keepdims=True)
++ return np.max(non_zero_features, axis=0, keepdims=True)
+ else:
+ raise ValueError(
+ f""Invalid pooling operation specified. Available operations are ""
+",rasa/nlu/featurizers/dense_featurizer/spacy_featurizer.py,"ReplaceText(target='non_zero_features' @(72,26)->(72,34))","class SpacyFeaturizer(Featurizer):
+ if self.pooling_operation == ""mean"":
+ return np.mean(non_zero_features, axis=0, keepdims=True)
+ elif self.pooling_operation == ""max"":
+ return np.max(features, axis=0, keepdims=True)
+ else:
+ raise ValueError(
+ f""Invalid pooling operation specified. Available operations are ""","class SpacyFeaturizer(Featurizer):
+ if self.pooling_operation == ""mean"":
+ return np.mean(non_zero_features, axis=0, keepdims=True)
+ elif self.pooling_operation == ""max"":
+ return np.max(non_zero_features, axis=0, keepdims=True)
+ else:
+ raise ValueError(
+ f""Invalid pooling operation specified. Available operations are """
+489,https://:@github.com/RasaHQ/rasa.git,a2552e73fc8e4a656f43796101121ff8963bc0da,"@@ -50,7 +50,7 @@ class EntityExtractor(Component):
+ # get indices of entity labels that belong to one word
+ for idx in range(1, len(entities)):
+ if entities[idx][""start""] == entities[idx - 1][""end""]:
+- if entity_indices and entity_indices[-1][1] == idx - 1:
++ if entity_indices and entity_indices[-1][-1] == idx - 1:
+ entity_indices[-1].append(idx)
+ else:
+ entity_indices.append([idx - 1, idx])
+",rasa/nlu/extractors/extractor.py,"ReplaceText(target='-1' @(53,57)->(53,58))","class EntityExtractor(Component):
+ # get indices of entity labels that belong to one word
+ for idx in range(1, len(entities)):
+ if entities[idx][""start""] == entities[idx - 1][""end""]:
+ if entity_indices and entity_indices[-1][1] == idx - 1:
+ entity_indices[-1].append(idx)
+ else:
+ entity_indices.append([idx - 1, idx])","class EntityExtractor(Component):
+ # get indices of entity labels that belong to one word
+ for idx in range(1, len(entities)):
+ if entities[idx][""start""] == entities[idx - 1][""end""]:
+ if entity_indices and entity_indices[-1][-1] == idx - 1:
+ entity_indices[-1].append(idx)
+ else:
+ entity_indices.append([idx - 1, idx])"
+490,https://:@github.com/RasaHQ/rasa.git,16ac7259b842e188c5c012bcaf6303e4bf4a4602,"@@ -223,7 +223,7 @@ class RasaModel(tf.keras.models.Model):
+ self.save(self.best_model_file, overwrite=True)
+
+ if best_model_epoch >= 0:
+- logger.info(f'The model of epoch {epoch} (out of {epochs} in total) will be stored!')
++ logger.info(f'The model of epoch {best_model_epoch} (out of {epochs} in total) will be stored!')
+ if self.model_summary_file is not None:
+ self._write_model_summary()
+
+",rasa/utils/tensorflow/models.py,"ReplaceText(target='best_model_epoch' @(226,46)->(226,51))","class RasaModel(tf.keras.models.Model):
+ self.save(self.best_model_file, overwrite=True)
+
+ if best_model_epoch >= 0:
+ logger.info(f'The model of epoch {epoch} (out of {epochs} in total) will be stored!')
+ if self.model_summary_file is not None:
+ self._write_model_summary()
+ ","class RasaModel(tf.keras.models.Model):
+ self.save(self.best_model_file, overwrite=True)
+
+ if best_model_epoch >= 0:
+ logger.info(f'The model of epoch {best_model_epoch} (out of {epochs} in total) will be stored!')
+ if self.model_summary_file is not None:
+ self._write_model_summary()
+ "
+491,https://:@github.com/RasaHQ/rasa.git,194820a60d61607fc480a95d981cb570e9ec3d4f,"@@ -254,7 +254,7 @@ class RasaModel(tf.keras.models.Model):
+ val_results = self._get_metric_results(prefix=""val_"")
+ if self._does_model_improve(val_results):
+ logger.debug(f""Creating model checkpoint after training..."")
+- best_model_epoch = epoch
++ best_model_epoch = epochs
+ self.save(self.best_model_file, overwrite=True)
+
+ if best_model_epoch >= 0:
+",rasa/utils/tensorflow/models.py,"ReplaceText(target='epochs' @(257,35)->(257,40))","class RasaModel(tf.keras.models.Model):
+ val_results = self._get_metric_results(prefix=""val_"")
+ if self._does_model_improve(val_results):
+ logger.debug(f""Creating model checkpoint after training..."")
+ best_model_epoch = epoch
+ self.save(self.best_model_file, overwrite=True)
+
+ if best_model_epoch >= 0:","class RasaModel(tf.keras.models.Model):
+ val_results = self._get_metric_results(prefix=""val_"")
+ if self._does_model_improve(val_results):
+ logger.debug(f""Creating model checkpoint after training..."")
+ best_model_epoch = epochs
+ self.save(self.best_model_file, overwrite=True)
+
+ if best_model_epoch >= 0:"
+492,https://:@github.com/gbrammer/grizli.git,a14c6aef2fb7790a5418ac882e332cbddf3771d9,"@@ -87,7 +87,7 @@ def run_all(id, t0=None, t1=None, fwhm=1200, zr=[0.65, 1.6], dz=[0.004, 0.0002],
+
+ if scale_photometry:
+ scl = mb.scale_to_photometry(z=fit.meta['z_map'][0], method='lm', templates=t0, order=scale_photometry*1)
+- if scl.status == 0:
++ if scl.status > 0:
+ mb.pscale = scl.x
+ st.pscale = scl.x
+
+",grizli/fitting.py,"ReplaceText(target='>' @(90,22)->(90,24))","def run_all(id, t0=None, t1=None, fwhm=1200, zr=[0.65, 1.6], dz=[0.004, 0.0002],
+
+ if scale_photometry:
+ scl = mb.scale_to_photometry(z=fit.meta['z_map'][0], method='lm', templates=t0, order=scale_photometry*1)
+ if scl.status == 0:
+ mb.pscale = scl.x
+ st.pscale = scl.x
+ ","def run_all(id, t0=None, t1=None, fwhm=1200, zr=[0.65, 1.6], dz=[0.004, 0.0002],
+
+ if scale_photometry:
+ scl = mb.scale_to_photometry(z=fit.meta['z_map'][0], method='lm', templates=t0, order=scale_photometry*1)
+ if scl.status > 0:
+ mb.pscale = scl.x
+ st.pscale = scl.x
+ "
+493,https://:@github.com/gbrammer/grizli.git,06b2bb1a51cc4090eb57f37798a4b6cb6b24b2c2,"@@ -2291,7 +2291,7 @@ For example,
+ # Pixel area map
+ pam = os.path.join(os.getenv('iref'), 'ir_wfc3_map.fits')
+ print('Pixel area map: {0}'.format(pam))
+- if not os.path.exists(badpix):
++ if not os.path.exists(pam):
+ os.system('curl -o {0} http://www.stsci.edu/hst/wfc3/pam/ir_wfc3_map.fits'.format(pam))
+
+ def fetch_config_files(ACS=False):
+",grizli/utils.py,"ReplaceText(target='pam' @(2294,26)->(2294,32))","For example,
+ # Pixel area map
+ pam = os.path.join(os.getenv('iref'), 'ir_wfc3_map.fits')
+ print('Pixel area map: {0}'.format(pam))
+ if not os.path.exists(badpix):
+ os.system('curl -o {0} http://www.stsci.edu/hst/wfc3/pam/ir_wfc3_map.fits'.format(pam))
+
+ def fetch_config_files(ACS=False):","For example,
+ # Pixel area map
+ pam = os.path.join(os.getenv('iref'), 'ir_wfc3_map.fits')
+ print('Pixel area map: {0}'.format(pam))
+ if not os.path.exists(pam):
+ os.system('curl -o {0} http://www.stsci.edu/hst/wfc3/pam/ir_wfc3_map.fits'.format(pam))
+
+ def fetch_config_files(ACS=False):"
+494,https://:@github.com/gbrammer/grizli.git,60c15addafcb4ac4a0e55bc697b4bb18d6463736,"@@ -229,7 +229,7 @@ def go(root='j010311+131615', maglim=[17,26], HOME_PATH='/Volumes/Pegasus/Grizli
+ ir_ref = None
+
+ auto_script.drizzle_overlaps(root, filters=optical_filters,
+- make_combined=(ir_ref is not None), ref_image=ir_ref)
++ make_combined=(ir_ref is None), ref_image=ir_ref)
+
+ if ir_ref is None:
+ # Need
+",grizli/pipeline/auto_script.py,"ReplaceText(target=' is ' @(232,33)->(232,41))","def go(root='j010311+131615', maglim=[17,26], HOME_PATH='/Volumes/Pegasus/Grizli
+ ir_ref = None
+
+ auto_script.drizzle_overlaps(root, filters=optical_filters,
+ make_combined=(ir_ref is not None), ref_image=ir_ref)
+
+ if ir_ref is None:
+ # Need ","def go(root='j010311+131615', maglim=[17,26], HOME_PATH='/Volumes/Pegasus/Grizli
+ ir_ref = None
+
+ auto_script.drizzle_overlaps(root, filters=optical_filters,
+ make_combined=(ir_ref is None), ref_image=ir_ref)
+
+ if ir_ref is None:
+ # Need "
+495,https://:@github.com/gbrammer/grizli.git,e32899e470d02fa98365ca1ab1bfc70d6b64077b,"@@ -3420,7 +3420,7 @@ def field_rgb(root='j010514+021532', xsize=6, output_dpi=None, HOME_PATH='./', s
+ PATH_TO = '{0}/{1}/Prep'.format(HOME_PATH, root)
+ else:
+ PATH_TO = './'
+- sci_files = glob.glob('./{1}-f*sci.fits'.format(HOME_PATH, root))
++ sci_files = glob.glob('./{1}-f*sci.fits'.format(PATH_TO, root))
+
+ if filters is None:
+ filters = [file.split('_')[-3].split('-')[-1] for file in sci_files]
+",grizli/pipeline/auto_script.py,"ReplaceText(target='PATH_TO' @(3423,56)->(3423,65))","def field_rgb(root='j010514+021532', xsize=6, output_dpi=None, HOME_PATH='./', s
+ PATH_TO = '{0}/{1}/Prep'.format(HOME_PATH, root)
+ else:
+ PATH_TO = './'
+ sci_files = glob.glob('./{1}-f*sci.fits'.format(HOME_PATH, root))
+
+ if filters is None:
+ filters = [file.split('_')[-3].split('-')[-1] for file in sci_files]","def field_rgb(root='j010514+021532', xsize=6, output_dpi=None, HOME_PATH='./', s
+ PATH_TO = '{0}/{1}/Prep'.format(HOME_PATH, root)
+ else:
+ PATH_TO = './'
+ sci_files = glob.glob('./{1}-f*sci.fits'.format(PATH_TO, root))
+
+ if filters is None:
+ filters = [file.split('_')[-3].split('-')[-1] for file in sci_files]"
+496,https://:@github.com/gbrammer/grizli.git,27974fdbe2c948dee6777f6c6d333b46e1456a80,"@@ -575,7 +575,7 @@ class GroupFLT():
+ is_cgs=False):
+ """"""TBD
+ """"""
+- if cpu_count == 0:
++ if cpu_count <= 0:
+ cpu_count = mp.cpu_count()
+
+ if fit_info is None:
+",grizli/multifit.py,"ReplaceText(target='<=' @(578,21)->(578,23))","class GroupFLT():
+ is_cgs=False):
+ """"""TBD
+ """"""
+ if cpu_count == 0:
+ cpu_count = mp.cpu_count()
+
+ if fit_info is None:","class GroupFLT():
+ is_cgs=False):
+ """"""TBD
+ """"""
+ if cpu_count <= 0:
+ cpu_count = mp.cpu_count()
+
+ if fit_info is None:"
+497,https://:@github.com/gbrammer/grizli.git,73b7211978b46ce1f7bcc1de111237c047fbe00e,"@@ -959,7 +959,7 @@ def parse_visits(field_root='', HOME_PATH='./', use_visit=True, combine_same_pa=
+ elif (combine_minexp > 0) & (not has_grism):
+ combined = []
+ for visit in visits:
+- if len(visit['files']) > combine_minexp*1:
++ if len(visit['files']) >= combine_minexp*1:
+ combined.append(copy.deepcopy(visit))
+ else:
+ filter_pa = '-'.join(visit['product'].split('-')[-2:])
+",grizli/pipeline/auto_script.py,"ReplaceText(target='>=' @(962,35)->(962,36))","def parse_visits(field_root='', HOME_PATH='./', use_visit=True, combine_same_pa=
+ elif (combine_minexp > 0) & (not has_grism):
+ combined = []
+ for visit in visits:
+ if len(visit['files']) > combine_minexp*1:
+ combined.append(copy.deepcopy(visit))
+ else:
+ filter_pa = '-'.join(visit['product'].split('-')[-2:])","def parse_visits(field_root='', HOME_PATH='./', use_visit=True, combine_same_pa=
+ elif (combine_minexp > 0) & (not has_grism):
+ combined = []
+ for visit in visits:
+ if len(visit['files']) >= combine_minexp*1:
+ combined.append(copy.deepcopy(visit))
+ else:
+ filter_pa = '-'.join(visit['product'].split('-')[-2:])"
+498,https://:@github.com/gbrammer/grizli.git,54178395a55d79f53bf11d651b53bb6bc3448eb6,"@@ -3386,7 +3386,7 @@ def make_filter_combinations(root, weight_fnu=True, filter_combinations=FILTER_C
+
+ # UVIS
+ if filt_i.startswith('f') & filt_i.endswith('u'):
+- filt_i = filt_i[:1]
++ filt_i = filt_i[:-1]
+
+ band = None
+ for f in filter_combinations:
+",grizli/pipeline/auto_script.py,"ReplaceText(target='-1' @(3389,29)->(3389,30))","def make_filter_combinations(root, weight_fnu=True, filter_combinations=FILTER_C
+
+ # UVIS
+ if filt_i.startswith('f') & filt_i.endswith('u'):
+ filt_i = filt_i[:1]
+
+ band = None
+ for f in filter_combinations:","def make_filter_combinations(root, weight_fnu=True, filter_combinations=FILTER_C
+
+ # UVIS
+ if filt_i.startswith('f') & filt_i.endswith('u'):
+ filt_i = filt_i[:-1]
+
+ band = None
+ for f in filter_combinations:"
+499,https://:@github.com/PmagPy/PmagPy.git,153e127b39023f35ad6724b0e89609849ec48689,"@@ -33,7 +33,7 @@ def main():
+ try:
+ fh_last = open(last_path, 'r+')
+ last_checked = pickle.load(fh_last)
+- if last_checked > time.time() - 24*60*60:
++ if last_checked < time.time() - 24*60*60:
+ return # stop here because it's been less than 24 hours
+ else:
+ pickle.dump(time.time(), fh_last)
+",check_updates.py,"ReplaceText(target='<' @(36,24)->(36,25))","def main():
+ try:
+ fh_last = open(last_path, 'r+')
+ last_checked = pickle.load(fh_last)
+ if last_checked > time.time() - 24*60*60:
+ return # stop here because it's been less than 24 hours
+ else:
+ pickle.dump(time.time(), fh_last)","def main():
+ try:
+ fh_last = open(last_path, 'r+')
+ last_checked = pickle.load(fh_last)
+ if last_checked < time.time() - 24*60*60:
+ return # stop here because it's been less than 24 hours
+ else:
+ pickle.dump(time.time(), fh_last)"
+500,https://:@github.com/PmagPy/PmagPy.git,1c9dfb436532fcefcdf85913462eca89c4a05886,"@@ -3363,7 +3363,7 @@ def upload_magic3(concat=0, dir_path='.', dmodel=None, vocab="""", contribution=No
+ # otherwise create a new Contribution in dir_path
+ con = Contribution(dir_path, vocabulary=vocab)
+
+- dir_path = contribution.directory
++ dir_path = con.directory
+ # take out any extra added columns
+ con.remove_non_magic_cols()
+ # begin the upload process
+",pmagpy/ipmag.py,"ReplaceText(target='con' @(3366,15)->(3366,27))","def upload_magic3(concat=0, dir_path='.', dmodel=None, vocab="""", contribution=No
+ # otherwise create a new Contribution in dir_path
+ con = Contribution(dir_path, vocabulary=vocab)
+
+ dir_path = contribution.directory
+ # take out any extra added columns
+ con.remove_non_magic_cols()
+ # begin the upload process","def upload_magic3(concat=0, dir_path='.', dmodel=None, vocab="""", contribution=No
+ # otherwise create a new Contribution in dir_path
+ con = Contribution(dir_path, vocabulary=vocab)
+
+ dir_path = con.directory
+ # take out any extra added columns
+ con.remove_non_magic_cols()
+ # begin the upload process"
+501,https://:@github.com/PmagPy/PmagPy.git,8fd06aa1272e4a82082fc0a0b5641242e2f18154,"@@ -72,7 +72,7 @@ def main():
+ pastTime=startTime
+ if d < commandLength:
+ pastTime=startTime-commandLength
+- printout=""Due to long processing time the look-back time has been extended to "" +str(pastTime.total_seconds()) + "" seconds"" + ""\n""
++ printout=""Due to long processing time the look-back time has been extended to "" +str(commandLength.total_seconds()) + "" seconds"" + ""\n""
+ f.write(printout)
+ else:
+ pastTime=startTime-d
+",programs/createNewPlots.py,"ReplaceText(target='commandLength' @(75,97)->(75,105))","def main():
+ pastTime=startTime
+ if d < commandLength:
+ pastTime=startTime-commandLength
+ printout=""Due to long processing time the look-back time has been extended to "" +str(pastTime.total_seconds()) + "" seconds"" + ""\n""
+ f.write(printout)
+ else:
+ pastTime=startTime-d","def main():
+ pastTime=startTime
+ if d < commandLength:
+ pastTime=startTime-commandLength
+ printout=""Due to long processing time the look-back time has been extended to "" +str(commandLength.total_seconds()) + "" seconds"" + ""\n""
+ f.write(printout)
+ else:
+ pastTime=startTime-d"
+502,https://:@github.com/PmagPy/PmagPy.git,de14e55e58558ac9d6980bdaf309fe17496a8f44,"@@ -3524,7 +3524,7 @@ def iodp_kly4s_lore(kly4s_file, meas_out='measurements.txt',
+ tau3=in_df['Kmin susceptibility (SI)']/3
+ v3_dec=in_df['Kmin dec (deg)']
+ v3_inc=in_df['Kmin inc (deg)']
+- specimens_df['aniso_v3']=tau1.astype('str')+"":""+v3_dec.astype('str')+"":""+v3_inc.astype('str')
++ specimens_df['aniso_v3']=tau3.astype('str')+"":""+v3_dec.astype('str')+"":""+v3_inc.astype('str')
+
+
+ # output data files
+",pmagpy/convert_2_magic.py,"ReplaceText(target='tau3' @(3527,29)->(3527,33))","def iodp_kly4s_lore(kly4s_file, meas_out='measurements.txt',
+ tau3=in_df['Kmin susceptibility (SI)']/3
+ v3_dec=in_df['Kmin dec (deg)']
+ v3_inc=in_df['Kmin inc (deg)']
+ specimens_df['aniso_v3']=tau1.astype('str')+"":""+v3_dec.astype('str')+"":""+v3_inc.astype('str')
+
+
+ # output data files","def iodp_kly4s_lore(kly4s_file, meas_out='measurements.txt',
+ tau3=in_df['Kmin susceptibility (SI)']/3
+ v3_dec=in_df['Kmin dec (deg)']
+ v3_inc=in_df['Kmin inc (deg)']
+ specimens_df['aniso_v3']=tau3.astype('str')+"":""+v3_dec.astype('str')+"":""+v3_inc.astype('str')
+
+
+ # output data files"
+503,https://:@github.com/efficios/pytsdl.git,1b6d994aa14340af28ed903692ff0fde598ebaeb,"@@ -1671,7 +1671,7 @@ class _DocCreatorVisitor:
+ # assign tag to copy now
+ variant_copy.tag = self._decode_unary(t.tag.value)
+
+- return variant
++ return variant_copy
+
+ def _type_to_obj(self, t):
+ return self._type_to_obj_map[type(t)](t)
+",pytsdl/parser.py,"ReplaceText(target='variant_copy' @(1674,15)->(1674,22))","class _DocCreatorVisitor:
+ # assign tag to copy now
+ variant_copy.tag = self._decode_unary(t.tag.value)
+
+ return variant
+
+ def _type_to_obj(self, t):
+ return self._type_to_obj_map[type(t)](t)","class _DocCreatorVisitor:
+ # assign tag to copy now
+ variant_copy.tag = self._decode_unary(t.tag.value)
+
+ return variant_copy
+
+ def _type_to_obj(self, t):
+ return self._type_to_obj_map[type(t)](t)"
+504,https://:@github.com/mabrownnyu/youtube-data-api.git,07d71d5668d1dbeec28d84ce1cf8982fbd71be36,"@@ -585,7 +585,7 @@ class YoutubeDataApi:
+ else:
+ captions = []
+ for v_id in video_id:
+- captions.append(_get_captions(video_id, lang_code=lang_code, parser=parser, **kwargs))
++ captions.append(_get_captions(v_id, lang_code=lang_code, parser=parser, **kwargs))
+ return captions
+
+
+",youtube_api/youtube_api.py,"ReplaceText(target='v_id' @(588,46)->(588,54))","class YoutubeDataApi:
+ else:
+ captions = []
+ for v_id in video_id:
+ captions.append(_get_captions(video_id, lang_code=lang_code, parser=parser, **kwargs))
+ return captions
+
+ ","class YoutubeDataApi:
+ else:
+ captions = []
+ for v_id in video_id:
+ captions.append(_get_captions(v_id, lang_code=lang_code, parser=parser, **kwargs))
+ return captions
+
+ "
+505,https://:@github.com/xhochy/conda-mirror-ng.git,e0b34555d779f9b440512f850da39aa5a0e29ece,"@@ -85,5 +85,5 @@ def test_handling_bad_package(tmpdir, repodata):
+ with bz2.BZ2File(bad_pkg_path, 'wb') as f:
+ f.write(""This is a fake package"".encode())
+ assert bad_pkg_name in os.listdir(bad_pkg_root)
+- conda_mirror._validate_packages(repodata, local_repo_root)
++ conda_mirror._validate_packages(repodata, bad_pkg_root)
+ assert bad_pkg_name not in os.listdir(bad_pkg_root)
+\ No newline at end of file
+",test/test_conda_mirror.py,"ReplaceText(target='bad_pkg_root' @(88,46)->(88,61))","def test_handling_bad_package(tmpdir, repodata):
+ with bz2.BZ2File(bad_pkg_path, 'wb') as f:
+ f.write(""This is a fake package"".encode())
+ assert bad_pkg_name in os.listdir(bad_pkg_root)
+ conda_mirror._validate_packages(repodata, local_repo_root)
+ assert bad_pkg_name not in os.listdir(bad_pkg_root)
+\ No newline at end of file","def test_handling_bad_package(tmpdir, repodata):
+ with bz2.BZ2File(bad_pkg_path, 'wb') as f:
+ f.write(""This is a fake package"".encode())
+ assert bad_pkg_name in os.listdir(bad_pkg_root)
+ conda_mirror._validate_packages(repodata, bad_pkg_root)
+ assert bad_pkg_name not in os.listdir(bad_pkg_root)
+\ No newline at end of file"
+506,https://:@github.com/kelsoncm/sc4.git,8c4e8ac8358668aaa6c32b73af44178e6e9db3ab,"@@ -45,6 +45,6 @@ def others_months():
+
+ def daterange(start, end, step=datetime.timedelta(1)):
+ curr = start
+- while curr < end:
++ while curr <= end:
+ yield curr
+ curr += step
+",sc4py/sc4py/datetime.py,"ReplaceText(target='<=' @(48,15)->(48,16))","def others_months():
+
+ def daterange(start, end, step=datetime.timedelta(1)):
+ curr = start
+ while curr < end:
+ yield curr
+ curr += step","def others_months():
+
+ def daterange(start, end, step=datetime.timedelta(1)):
+ curr = start
+ while curr <= end:
+ yield curr
+ curr += step"
+507,https://:@github.com/makingspace/pubsubpy.git,bd6903e8ea6e7069712d7cf17cb725aa7f821d1a,"@@ -5,7 +5,7 @@ MODEL_EXCHANGE = 'model_exchange'
+
+ __REQUIRED_INIT_KWARGS = {AMQP_URL, MODEL_EXCHANGE}
+ __OPTIONAL_INIT_KWARGS = set()
+-__ALLOWED_INIT_KWARGS = __REQUIRED_INIT_KWARGS & __OPTIONAL_INIT_KWARGS
++__ALLOWED_INIT_KWARGS = __REQUIRED_INIT_KWARGS | __OPTIONAL_INIT_KWARGS
+
+
+ def init(**kwargs):
+",pubsub/__init__.py,"ReplaceText(target='|' @(8,47)->(8,48))","MODEL_EXCHANGE = 'model_exchange'
+
+ __REQUIRED_INIT_KWARGS = {AMQP_URL, MODEL_EXCHANGE}
+ __OPTIONAL_INIT_KWARGS = set()
+ __ALLOWED_INIT_KWARGS = __REQUIRED_INIT_KWARGS & __OPTIONAL_INIT_KWARGS
+
+
+ def init(**kwargs):","MODEL_EXCHANGE = 'model_exchange'
+
+ __REQUIRED_INIT_KWARGS = {AMQP_URL, MODEL_EXCHANGE}
+ __OPTIONAL_INIT_KWARGS = set()
+ __ALLOWED_INIT_KWARGS = __REQUIRED_INIT_KWARGS | __OPTIONAL_INIT_KWARGS
+
+
+ def init(**kwargs):"
+508,https://:@github.com/moff4/kframe.git,01c644e825136b2b86d9b6f7dd6a34e4997c128c,"@@ -310,7 +310,7 @@ class Parent:
+ kwargs (dict) - dict of arg that will be passed to init() as **kwargs (plugins only)
+ """"""
+ from kframe.base.plugin import Plugin
+- if issubclass(target, Plugin):
++ if not issubclass(target, Plugin):
+ raise ValueError('target ({}) bust be isinstance of kframe.Plugin'.format(str(target)))
+ self.plugin_t[kw.get('key', target.name)] = {
+ 'target': target,
+",kframe/base/parent.py,"ReplaceText(target='not ' @(313,11)->(313,11))","class Parent:
+ kwargs (dict) - dict of arg that will be passed to init() as **kwargs (plugins only)
+ """"""
+ from kframe.base.plugin import Plugin
+ if issubclass(target, Plugin):
+ raise ValueError('target ({}) bust be isinstance of kframe.Plugin'.format(str(target)))
+ self.plugin_t[kw.get('key', target.name)] = {
+ 'target': target,","class Parent:
+ kwargs (dict) - dict of arg that will be passed to init() as **kwargs (plugins only)
+ """"""
+ from kframe.base.plugin import Plugin
+ if not issubclass(target, Plugin):
+ raise ValueError('target ({}) bust be isinstance of kframe.Plugin'.format(str(target)))
+ self.plugin_t[kw.get('key', target.name)] = {
+ 'target': target,"
+509,https://:@github.com/moff4/kframe.git,85c41d1f13cb2c7d79787bbe35de661aa6c6b824,"@@ -329,7 +329,7 @@ class Task:
+ cfg.update(kwargs)
+ if 'shedule' in cfg:
+ cfg['shedule'] = self._convert_shedule(cfg['shedule'])
+- self.cfg.update(kwargs)
++ self.cfg.update(cfg)
+
+ def ready_for_run(self, t, tm):
+ """"""
+",kframe/plugins/planner/task.py,"ReplaceText(target='cfg' @(332,24)->(332,30))","class Task:
+ cfg.update(kwargs)
+ if 'shedule' in cfg:
+ cfg['shedule'] = self._convert_shedule(cfg['shedule'])
+ self.cfg.update(kwargs)
+
+ def ready_for_run(self, t, tm):
+ """"""","class Task:
+ cfg.update(kwargs)
+ if 'shedule' in cfg:
+ cfg['shedule'] = self._convert_shedule(cfg['shedule'])
+ self.cfg.update(cfg)
+
+ def ready_for_run(self, t, tm):
+ """""""
+510,https://:@github.com/qaviton/qaviton_package_manager.git,0498c2b71479109db949e369a0b7189d75dded65,"@@ -63,7 +63,7 @@ class Build(Prep):
+ def update_version(self, version):
+ version = self.versioning(version)
+ content = self.get_pkg_init()
+- if b'\n__version__' not in content or not content.startswith(b'__version__'):
++ if b'\n__version__' not in content and not content.startswith(b'__version__'):
+ raise IOError(""missing __version__ in the package __init__.py file"")
+ lines = content.splitlines()
+ for i, line in enumerate(lines):
+",qaviton_package_manager/manager_methods/distribute_to_git.py,"ReplaceText(target='and' @(66,43)->(66,45))","class Build(Prep):
+ def update_version(self, version):
+ version = self.versioning(version)
+ content = self.get_pkg_init()
+ if b'\n__version__' not in content or not content.startswith(b'__version__'):
+ raise IOError(""missing __version__ in the package __init__.py file"")
+ lines = content.splitlines()
+ for i, line in enumerate(lines):","class Build(Prep):
+ def update_version(self, version):
+ version = self.versioning(version)
+ content = self.get_pkg_init()
+ if b'\n__version__' not in content and not content.startswith(b'__version__'):
+ raise IOError(""missing __version__ in the package __init__.py file"")
+ lines = content.splitlines()
+ for i, line in enumerate(lines):"
+511,https://:@github.com/morganthrapp/pyACH.git,516f347fa832237e2868544c078f86f80c7c2a1c,"@@ -256,7 +256,7 @@ class BatchHeader:
+ def _get_effective_entry_date(effective_entry_date):
+ _date = datetime.datetime.today()
+ _date += datetime.timedelta(days=effective_entry_date)
+- while _date.isoweekday() not in WEEKEND:
++ while _date.isoweekday() in WEEKEND:
+ _date += datetime.timedelta(days=1)
+ return _date.strftime(day_format_string)
+
+",pyach/ACHRecordTypes.py,"ReplaceText(target=' in ' @(259,32)->(259,40))","class BatchHeader:
+ def _get_effective_entry_date(effective_entry_date):
+ _date = datetime.datetime.today()
+ _date += datetime.timedelta(days=effective_entry_date)
+ while _date.isoweekday() not in WEEKEND:
+ _date += datetime.timedelta(days=1)
+ return _date.strftime(day_format_string)
+ ","class BatchHeader:
+ def _get_effective_entry_date(effective_entry_date):
+ _date = datetime.datetime.today()
+ _date += datetime.timedelta(days=effective_entry_date)
+ while _date.isoweekday() in WEEKEND:
+ _date += datetime.timedelta(days=1)
+ return _date.strftime(day_format_string)
+ "
+512,https://:@github.com/eldarion/agon-ratings.git,99a317f1ead850e948cf08123fef8ea60b30060e,"@@ -72,7 +72,7 @@ class Rating(models.Model):
+ rating_obj = None
+
+ if rating_obj and rating == 0:
+- return rating.clear()
++ return rating_obj.clear()
+
+ if rating_obj is None:
+ rating_obj = cls.objects.create(
+",pinax/ratings/models.py,"ReplaceText(target='rating_obj' @(75,19)->(75,25))","class Rating(models.Model):
+ rating_obj = None
+
+ if rating_obj and rating == 0:
+ return rating.clear()
+
+ if rating_obj is None:
+ rating_obj = cls.objects.create(","class Rating(models.Model):
+ rating_obj = None
+
+ if rating_obj and rating == 0:
+ return rating_obj.clear()
+
+ if rating_obj is None:
+ rating_obj = cls.objects.create("
+513,https://:@github.com/sraashis/ature.git,caee2ab19dc6b73ab1916156ad80c5732957803f,"@@ -94,7 +94,7 @@ class PatchesGenerator(Dataset):
+ img_tensor = self.transform(img_tensor)
+
+ if self.segment_mode:
+- return self.data[ID], img_tensor, self.labels[index]
++ return self.data[index], img_tensor, self.labels[index]
+
+ return img_tensor, self.labels[index]
+
+",neuralnet/utils/datasets.py,"ReplaceText(target='index' @(97,29)->(97,31))","class PatchesGenerator(Dataset):
+ img_tensor = self.transform(img_tensor)
+
+ if self.segment_mode:
+ return self.data[ID], img_tensor, self.labels[index]
+
+ return img_tensor, self.labels[index]
+ ","class PatchesGenerator(Dataset):
+ img_tensor = self.transform(img_tensor)
+
+ if self.segment_mode:
+ return self.data[index], img_tensor, self.labels[index]
+
+ return img_tensor, self.labels[index]
+ "
+514,https://:@github.com/sraashis/ature.git,e192de63324d8472c331bd06ab36ea710ee93d2a,"@@ -96,7 +96,7 @@ class ThrnetTrainer(NNTrainer):
+ img_loss += current_loss
+
+ thr = thr_map[..., None][..., None]
+- segmented = (prob_map >= thr.byte())
++ segmented = (prob_map > thr.byte())
+
+ # batch_score = ScoreAccumulator().add_tensor(segmented, truth)
+ print('Loss: ', current_loss, end='\r')
+",neuralnet/thrnet/thrnet_trainer.py,"ReplaceText(target='>' @(99,42)->(99,44))","class ThrnetTrainer(NNTrainer):
+ img_loss += current_loss
+
+ thr = thr_map[..., None][..., None]
+ segmented = (prob_map >= thr.byte())
+
+ # batch_score = ScoreAccumulator().add_tensor(segmented, truth)
+ print('Loss: ', current_loss, end='\r')","class ThrnetTrainer(NNTrainer):
+ img_loss += current_loss
+
+ thr = thr_map[..., None][..., None]
+ segmented = (prob_map > thr.byte())
+
+ # batch_score = ScoreAccumulator().add_tensor(segmented, truth)
+ print('Loss: ', current_loss, end='\r')"
+515,https://:@github.com/sraashis/ature.git,934f9ff3b34b487614e4f2653c153cd78d716b57,"@@ -50,7 +50,7 @@ class ThrnetTrainer(NNTrainer):
+
+ if gen_images:
+ img = segmented_img.clone().cpu().numpy()
+- img_score.add_array(img_obj.ground_truth, img)
++ img_score.add_array(img, img_obj.ground_truth)
+ # img = iu.remove_connected_comp(np.array(segmented_img, dtype=np.uint8),
+ # connected_comp_diam_limit=10)
+ IMG.fromarray(np.array(img, dtype=np.uint8)).save(
+",neuralnet/mapnet/mapnet_trainer.py,"ArgSwap(idxs=0<->1 @(53,20)->(53,39))","class ThrnetTrainer(NNTrainer):
+
+ if gen_images:
+ img = segmented_img.clone().cpu().numpy()
+ img_score.add_array(img_obj.ground_truth, img)
+ # img = iu.remove_connected_comp(np.array(segmented_img, dtype=np.uint8),
+ # connected_comp_diam_limit=10)
+ IMG.fromarray(np.array(img, dtype=np.uint8)).save(","class ThrnetTrainer(NNTrainer):
+
+ if gen_images:
+ img = segmented_img.clone().cpu().numpy()
+ img_score.add_array(img, img_obj.ground_truth)
+ # img = iu.remove_connected_comp(np.array(segmented_img, dtype=np.uint8),
+ # connected_comp_diam_limit=10)
+ IMG.fromarray(np.array(img, dtype=np.uint8)).save("
+516,https://:@github.com/sraashis/ature.git,934f9ff3b34b487614e4f2653c153cd78d716b57,"@@ -59,7 +59,7 @@ class UNetNNTrainer(NNTrainer):
+ if gen_images:
+ map_img = map_img.cpu().numpy()
+ predicted_img = predicted_img.cpu().numpy()
+- img_score.add_array(img_obj.ground_truth, predicted_img)
++ img_score.add_array(predicted_img, img_obj.ground_truth)
+ IMG.fromarray(np.array(predicted_img, dtype=np.uint8)).save(
+ os.path.join(self.log_dir, 'pred_' + img_obj.file_name.split('.')[0] + '.png'))
+ IMG.fromarray(np.array(map_img, dtype=np.uint8)).save(
+",neuralnet/unet/unet_trainer.py,"ArgSwap(idxs=0<->1 @(62,20)->(62,39))","class UNetNNTrainer(NNTrainer):
+ if gen_images:
+ map_img = map_img.cpu().numpy()
+ predicted_img = predicted_img.cpu().numpy()
+ img_score.add_array(img_obj.ground_truth, predicted_img)
+ IMG.fromarray(np.array(predicted_img, dtype=np.uint8)).save(
+ os.path.join(self.log_dir, 'pred_' + img_obj.file_name.split('.')[0] + '.png'))
+ IMG.fromarray(np.array(map_img, dtype=np.uint8)).save(","class UNetNNTrainer(NNTrainer):
+ if gen_images:
+ map_img = map_img.cpu().numpy()
+ predicted_img = predicted_img.cpu().numpy()
+ img_score.add_array(predicted_img, img_obj.ground_truth)
+ IMG.fromarray(np.array(predicted_img, dtype=np.uint8)).save(
+ os.path.join(self.log_dir, 'pred_' + img_obj.file_name.split('.')[0] + '.png'))
+ IMG.fromarray(np.array(map_img, dtype=np.uint8)).save("
+517,https://:@github.com/tessgi/ticgen.git,9350670fed545226d33c16432802990b6ddd7274,"@@ -144,7 +144,7 @@ class Star(object):
+ E * self.Tmag**4 + F * self.Tmag**5)
+
+ def get_oneSigmaNoise(self):
+- return (np.exp(self.get_oneHourNoiseLnsigma()) *
++ return (np.exp(self.get_oneHourNoiseLnsigma()) /
+ np.sqrt(self.integration / 60.))
+
+ def TESS_Mag_VJKs(self):
+",ticgen/ticgen.py,"ReplaceText(target='/' @(147,55)->(147,56))","class Star(object):
+ E * self.Tmag**4 + F * self.Tmag**5)
+
+ def get_oneSigmaNoise(self):
+ return (np.exp(self.get_oneHourNoiseLnsigma()) *
+ np.sqrt(self.integration / 60.))
+
+ def TESS_Mag_VJKs(self):","class Star(object):
+ E * self.Tmag**4 + F * self.Tmag**5)
+
+ def get_oneSigmaNoise(self):
+ return (np.exp(self.get_oneHourNoiseLnsigma()) /
+ np.sqrt(self.integration / 60.))
+
+ def TESS_Mag_VJKs(self):"
+518,https://:@github.com/aki-nishimura/bayes-bridge.git,728164889880a793dd156bafeeaaec2da93c4706,"@@ -94,7 +94,7 @@ class SparseRegressionCoefficientSampler():
+ ))
+ precond_hessian_matvec = lambda beta: \
+ precond_prior_prec * beta \
+- + precond_scale * loglik_hessian_matvec(precond_scale * beta)
++ - precond_scale * loglik_hessian_matvec(precond_scale * beta)
+ precond_hessian_op = sp.sparse.linalg.LinearOperator(
+ (X.shape[1], X.shape[1]), precond_hessian_matvec
+ )
+",bayesbridge/reg_coef_sampler/reg_coef_sampler.py,"ReplaceText(target='-' @(97,12)->(97,13))","class SparseRegressionCoefficientSampler():
+ ))
+ precond_hessian_matvec = lambda beta: \
+ precond_prior_prec * beta \
+ + precond_scale * loglik_hessian_matvec(precond_scale * beta)
+ precond_hessian_op = sp.sparse.linalg.LinearOperator(
+ (X.shape[1], X.shape[1]), precond_hessian_matvec
+ )","class SparseRegressionCoefficientSampler():
+ ))
+ precond_hessian_matvec = lambda beta: \
+ precond_prior_prec * beta \
+ - precond_scale * loglik_hessian_matvec(precond_scale * beta)
+ precond_hessian_op = sp.sparse.linalg.LinearOperator(
+ (X.shape[1], X.shape[1]), precond_hessian_matvec
+ )"
+519,https://:@github.com/aki-nishimura/bayes-bridge.git,8558d665b0d07e1565d88b4d477a67c576c7ffbd,"@@ -70,7 +70,7 @@ class BayesBridge():
+ self.model = LinearModel(outcome, X)
+ elif model == 'logit':
+ n_success, n_trial = outcome
+- self.model = LogisticModel(n_success, X, n_trial)
++ self.model = LogisticModel(n_success, n_trial, X)
+ elif model == 'cox':
+ self.model = CoxModel(event_time, censoring_time, X)
+ else:
+",bayesbridge/bayesbridge.py,"ArgSwap(idxs=1<->2 @(73,25)->(73,38))","class BayesBridge():
+ self.model = LinearModel(outcome, X)
+ elif model == 'logit':
+ n_success, n_trial = outcome
+ self.model = LogisticModel(n_success, X, n_trial)
+ elif model == 'cox':
+ self.model = CoxModel(event_time, censoring_time, X)
+ else:","class BayesBridge():
+ self.model = LinearModel(outcome, X)
+ elif model == 'logit':
+ n_success, n_trial = outcome
+ self.model = LogisticModel(n_success, n_trial, X)
+ elif model == 'cox':
+ self.model = CoxModel(event_time, censoring_time, X)
+ else:"
+520,https://:@github.com/BTrDB/btrdb4-python.git,68f67274b6c2a6bb4a9206cfb00e7c3747cab1fa,"@@ -36,7 +36,7 @@ from btrdb4.endpoint import Endpoint
+ from btrdb4.utils import *
+
+ MIN_TIME = -(16 << 56)
+-MAX_TIME = 48 >> 56
++MAX_TIME = 48 << 56
+ MAX_POINTWIDTH = 63
+
+ class Connection(object):
+",btrdb4/__init__.py,"ReplaceText(target='<<' @(39,14)->(39,16))","from btrdb4.endpoint import Endpoint
+ from btrdb4.utils import *
+
+ MIN_TIME = -(16 << 56)
+ MAX_TIME = 48 >> 56
+ MAX_POINTWIDTH = 63
+
+ class Connection(object):","from btrdb4.endpoint import Endpoint
+ from btrdb4.utils import *
+
+ MIN_TIME = -(16 << 56)
+ MAX_TIME = 48 << 56
+ MAX_POINTWIDTH = 63
+
+ class Connection(object):"
+521,https://:@github.com/mahaoyang/newspaper.git,ac1d4c7346ddd0e035f9c7968e7e712340723934,"@@ -62,7 +62,7 @@ def prepare_url(url, source_url=None):
+ """"""operations that purify a url, removes arguments,
+ redirects, and merges relatives with absolutes""""""
+
+- if source_url is None:
++ if source_url is not None:
+ source_domain = urlparse(source_url).netloc
+ proper_url = urljoin(source_url, url)
+ proper_url = redirect_back(proper_url, source_domain)
+",newspaper/urls.py,"ReplaceText(target=' is not ' @(65,17)->(65,21))","def prepare_url(url, source_url=None):
+ """"""operations that purify a url, removes arguments,
+ redirects, and merges relatives with absolutes""""""
+
+ if source_url is None:
+ source_domain = urlparse(source_url).netloc
+ proper_url = urljoin(source_url, url)
+ proper_url = redirect_back(proper_url, source_domain)","def prepare_url(url, source_url=None):
+ """"""operations that purify a url, removes arguments,
+ redirects, and merges relatives with absolutes""""""
+
+ if source_url is not None:
+ source_domain = urlparse(source_url).netloc
+ proper_url = urljoin(source_url, url)
+ proper_url = redirect_back(proper_url, source_domain)"
+522,https://:@github.com/tmconsulting/onelya-railway-sdk.git,059265060ae8f9828ae6f5d7a143988cd9c5da4c,"@@ -28,7 +28,7 @@ class Session(object):
+
+ if 'Code' in response:
+ raise OnelyaAPIError(method, response, data)
+- return data
++ return response
+
+ def __send_api_request(self, method, data):
+ url = '{}{}'.format(Session.API_URL, method)
+",onelya_railway_sdk/session.py,"ReplaceText(target='response' @(31,15)->(31,19))","class Session(object):
+
+ if 'Code' in response:
+ raise OnelyaAPIError(method, response, data)
+ return data
+
+ def __send_api_request(self, method, data):
+ url = '{}{}'.format(Session.API_URL, method)","class Session(object):
+
+ if 'Code' in response:
+ raise OnelyaAPIError(method, response, data)
+ return response
+
+ def __send_api_request(self, method, data):
+ url = '{}{}'.format(Session.API_URL, method)"
+523,https://:@github.com/rafalp/misago-social-app-django.git,d1d23e7e3cf4364c0d35289290b27787b84f5211,"@@ -50,7 +50,7 @@ def sanitize_redirect(host, redirect_to):
+ """"""
+ # Quick sanity check.
+ if not redirect_to or \
+- not isinstance(redirect_to, six.string_types) and \
++ not isinstance(redirect_to, six.string_types) or \
+ getattr(redirect_to, 'decode', None) and \
+ not isinstance(redirect_to.decode(), six.string_types):
+ return None
+",social/utils.py,"ReplaceText(target='or' @(53,53)->(53,56))","def sanitize_redirect(host, redirect_to):
+ """"""
+ # Quick sanity check.
+ if not redirect_to or \
+ not isinstance(redirect_to, six.string_types) and \
+ getattr(redirect_to, 'decode', None) and \
+ not isinstance(redirect_to.decode(), six.string_types):
+ return None","def sanitize_redirect(host, redirect_to):
+ """"""
+ # Quick sanity check.
+ if not redirect_to or \
+ not isinstance(redirect_to, six.string_types) or \
+ getattr(redirect_to, 'decode', None) and \
+ not isinstance(redirect_to.decode(), six.string_types):
+ return None"
+524,https://:@github.com/rafalp/misago-social-app-django.git,7d0628e7a756526b50449435eb02b2806e815755,"@@ -132,7 +132,7 @@ def partial_pipeline_data(strategy, user, *args, **kwargs):
+ kwargs.setdefault('user', user)
+ kwargs.setdefault('request', strategy.request)
+ kwargs.update(xkwargs)
+- return idx, backend, xargs, xkwargs
++ return idx, backend, xargs, kwargs
+
+
+ def build_absolute_uri(host_url, path=None):
+",social/utils.py,"ReplaceText(target='kwargs' @(135,36)->(135,43))","def partial_pipeline_data(strategy, user, *args, **kwargs):
+ kwargs.setdefault('user', user)
+ kwargs.setdefault('request', strategy.request)
+ kwargs.update(xkwargs)
+ return idx, backend, xargs, xkwargs
+
+
+ def build_absolute_uri(host_url, path=None):","def partial_pipeline_data(strategy, user, *args, **kwargs):
+ kwargs.setdefault('user', user)
+ kwargs.setdefault('request', strategy.request)
+ kwargs.update(xkwargs)
+ return idx, backend, xargs, kwargs
+
+
+ def build_absolute_uri(host_url, path=None):"
+525,https://:@github.com/rafalp/misago-social-app-django.git,d53529b57f0a4992889ad490e5314a2244155afa,"@@ -27,7 +27,7 @@ class SocialAuthExceptionMiddleware(object):
+ return
+
+ if isinstance(exception, SocialAuthBaseException):
+- backend_name = strategy.backend.name
++ backend_name = request.backend.name
+ message = self.get_message(request, exception)
+ url = self.get_redirect_uri(request, exception)
+ try:
+",social/apps/django_app/middleware.py,"ReplaceText(target='request' @(30,27)->(30,35))","class SocialAuthExceptionMiddleware(object):
+ return
+
+ if isinstance(exception, SocialAuthBaseException):
+ backend_name = strategy.backend.name
+ message = self.get_message(request, exception)
+ url = self.get_redirect_uri(request, exception)
+ try:","class SocialAuthExceptionMiddleware(object):
+ return
+
+ if isinstance(exception, SocialAuthBaseException):
+ backend_name = request.backend.name
+ message = self.get_message(request, exception)
+ url = self.get_redirect_uri(request, exception)
+ try:"
+526,https://:@github.com/c137digital/unv_app.git,d217fa0d780bc6f2acbbf4ea307630c78a695653,"@@ -34,7 +34,7 @@ class ComponentSettings:
+ """"""Create app settings, overrided by env.""""""
+ settings = settings or {}
+ if base_settings:
+- settings = update_dict_recur(settings, base_settings)
++ settings = update_dict_recur(base_settings, settings)
+ for key, value in os.environ.items():
+ if 'SETTINGS_' not in key:
+ continue
+",src/unv/app/settings.py,"ArgSwap(idxs=0<->1 @(37,23)->(37,40))","class ComponentSettings:
+ """"""Create app settings, overrided by env.""""""
+ settings = settings or {}
+ if base_settings:
+ settings = update_dict_recur(settings, base_settings)
+ for key, value in os.environ.items():
+ if 'SETTINGS_' not in key:
+ continue","class ComponentSettings:
+ """"""Create app settings, overrided by env.""""""
+ settings = settings or {}
+ if base_settings:
+ settings = update_dict_recur(base_settings, settings)
+ for key, value in os.environ.items():
+ if 'SETTINGS_' not in key:
+ continue"
+527,https://:@github.com/timothycrosley/blox.git,fdc21c5be25dd5452075748e4027e067bfb28e1e,"@@ -141,7 +141,7 @@ class TagAttributes(type):
+ full_attribute_map = dict(parents[0].attribute_map)
+ full_attribute_map.update(attribute_map)
+ attribute_map = full_attribute_map
+- class_dict['attribute_map'] = full_attributes
++ class_dict['attribute_map'] = attribute_map
+
+ class_dict['attribute_descriptors'] = attributes
+ attribute_signals = (attribute.signal for attribute in attributes.values() if getattr(attribute, 'signal'))
+",blox/base.py,"ReplaceText(target='attribute_map' @(144,46)->(144,61))","class TagAttributes(type):
+ full_attribute_map = dict(parents[0].attribute_map)
+ full_attribute_map.update(attribute_map)
+ attribute_map = full_attribute_map
+ class_dict['attribute_map'] = full_attributes
+
+ class_dict['attribute_descriptors'] = attributes
+ attribute_signals = (attribute.signal for attribute in attributes.values() if getattr(attribute, 'signal'))","class TagAttributes(type):
+ full_attribute_map = dict(parents[0].attribute_map)
+ full_attribute_map.update(attribute_map)
+ attribute_map = full_attribute_map
+ class_dict['attribute_map'] = attribute_map
+
+ class_dict['attribute_descriptors'] = attributes
+ attribute_signals = (attribute.signal for attribute in attributes.values() if getattr(attribute, 'signal'))"
+528,https://:@github.com/Vizzuality/LMIPy.git,abd7e5a3a0d4e6f5fdaf2798647adb88c490cd6b,"@@ -557,5 +557,5 @@ class Layer:
+ # confirm update
+
+ # update other layer
+- target_layer.update(update_params=payload, token=token)
++ target_layer.update(update_params=filtered_payload, token=token)
+
+",LMIPy/layer.py,"ReplaceText(target='filtered_payload' @(560,42)->(560,49))","class Layer:
+ # confirm update
+
+ # update other layer
+ target_layer.update(update_params=payload, token=token)
+ ","class Layer:
+ # confirm update
+
+ # update other layer
+ target_layer.update(update_params=filtered_payload, token=token)
+ "
+529,https://:@github.com/collective/mr.cabot.git,9c955abc239fcdff9bd12db236142387bce61f21,"@@ -7,7 +7,7 @@ def html_snippet(obj):
+ else:
+ lat, lon = loc
+ content = IListing(obj).summary
+- if lat < 0:
++ if lat > 0:
+ hemi = ""west""
+ else:
+ hemi = ""east""
+",src/mr/cabot/html.py,"ReplaceText(target='>' @(10,11)->(10,12))","def html_snippet(obj):
+ else:
+ lat, lon = loc
+ content = IListing(obj).summary
+ if lat < 0:
+ hemi = ""west""
+ else:
+ hemi = ""east""","def html_snippet(obj):
+ else:
+ lat, lon = loc
+ content = IListing(obj).summary
+ if lat > 0:
+ hemi = ""west""
+ else:
+ hemi = ""east"""
+530,https://:@github.com/TeamSpen210/srctools.git,079e1c394836a6daecc3e4c996514286937a98dc,"@@ -392,7 +392,7 @@ class ModelManager:
+ with open(qc.ref_smd, 'rb') as fb:
+ child_ref = Mesh.parse_smd(fb)
+
+- if prop.skin != 0 and prop.skin <= len(mdl.skins):
++ if prop.skin != 0 and prop.skin < len(mdl.skins):
+ # We need to rename the materials to match the skin.
+ swap_skins = dict(zip(
+ mdl.skins[0],
+",srctools/compiler/propcombine.py,"ReplaceText(target='<' @(395,48)->(395,50))","class ModelManager:
+ with open(qc.ref_smd, 'rb') as fb:
+ child_ref = Mesh.parse_smd(fb)
+
+ if prop.skin != 0 and prop.skin <= len(mdl.skins):
+ # We need to rename the materials to match the skin.
+ swap_skins = dict(zip(
+ mdl.skins[0],","class ModelManager:
+ with open(qc.ref_smd, 'rb') as fb:
+ child_ref = Mesh.parse_smd(fb)
+
+ if prop.skin != 0 and prop.skin < len(mdl.skins):
+ # We need to rename the materials to match the skin.
+ swap_skins = dict(zip(
+ mdl.skins[0],"
+531,https://:@github.com/TeamSpen210/srctools.git,ef4510d1517525251ae2f62f8be714b068e4d909,"@@ -1799,7 +1799,7 @@ class Entity:
+
+ base_name = orig_name.rstrip('0123456789')
+
+- if self.map.by_target[orig_name]:
++ if self.map.by_target[base_name]:
+ # Check every index in order.
+ for i in itertools.count(start=1):
+ name = base_name + str(i)
+",srctools/vmf.py,"ReplaceText(target='base_name' @(1802,30)->(1802,39))","class Entity:
+
+ base_name = orig_name.rstrip('0123456789')
+
+ if self.map.by_target[orig_name]:
+ # Check every index in order.
+ for i in itertools.count(start=1):
+ name = base_name + str(i)","class Entity:
+
+ base_name = orig_name.rstrip('0123456789')
+
+ if self.map.by_target[base_name]:
+ # Check every index in order.
+ for i in itertools.count(start=1):
+ name = base_name + str(i)"
+532,https://:@github.com/TeamSpen210/srctools.git,3954c99aa7922609c5c90a40b239ef57d747c5cc,"@@ -88,7 +88,7 @@ def main(argv: List[str]) -> None:
+ LOGGER.warning('No studiomdl path provided.')
+ studiomdl_loc = None
+
+- run_transformations(vmf, fsys, packlist, path, game_info, studiomdl_loc)
++ run_transformations(vmf, fsys, packlist, bsp_file, game_info, studiomdl_loc)
+
+ if studiomdl_loc is not None and args.propcombine:
+ LOGGER.info('Combining props...')
+",srctools/scripts/postcompiler.py,"ReplaceText(target='bsp_file' @(91,45)->(91,49))","def main(argv: List[str]) -> None:
+ LOGGER.warning('No studiomdl path provided.')
+ studiomdl_loc = None
+
+ run_transformations(vmf, fsys, packlist, path, game_info, studiomdl_loc)
+
+ if studiomdl_loc is not None and args.propcombine:
+ LOGGER.info('Combining props...')","def main(argv: List[str]) -> None:
+ LOGGER.warning('No studiomdl path provided.')
+ studiomdl_loc = None
+
+ run_transformations(vmf, fsys, packlist, bsp_file, game_info, studiomdl_loc)
+
+ if studiomdl_loc is not None and args.propcombine:
+ LOGGER.info('Combining props...')"
+533,https://:@github.com/garicchi/pyassistant.git,46494b523af213c34a755bfee77fdc0ff00525b1,"@@ -31,4 +31,4 @@ class Assistant():
+ with open(self.setting_file, 'w') as f:
+ json.dump(self.setting,f)
+
+- return True
+\ No newline at end of file
++ return False
+\ No newline at end of file
+",assistant/util/assistant.py,"ReplaceText(target='False' @(34,15)->(34,19))","class Assistant():
+ with open(self.setting_file, 'w') as f:
+ json.dump(self.setting,f)
+
+ return True
+\ No newline at end of file
+\ No newline at end of file","class Assistant():
+ with open(self.setting_file, 'w') as f:
+ json.dump(self.setting,f)
+
+\ No newline at end of file
+ return False
+\ No newline at end of file"
+534,https://:@github.com/u0078867/PyBiomech.git,b817b7617d9d57c39c72d8288d8cdb5748b9755c,"@@ -272,7 +272,7 @@ def evalPolynomialDerivative(poly, u, der=1):
+ tck, dummy = interpolate.splprep([x.tolist(),x.tolist()], s=0, k=1)
+ xU = np.array(interpolate.splev(u, tck)[1])
+ out = f2(xU)
+- p = np.array([np.ones((x.shape[0],)), out]).T
++ p = np.array([np.ones((xU.shape[0],)), out]).T
+ return p
+
+
+",src/PyBiomech/vtkh.py,"ReplaceText(target='xU' @(275,27)->(275,28))","def evalPolynomialDerivative(poly, u, der=1):
+ tck, dummy = interpolate.splprep([x.tolist(),x.tolist()], s=0, k=1)
+ xU = np.array(interpolate.splev(u, tck)[1])
+ out = f2(xU)
+ p = np.array([np.ones((x.shape[0],)), out]).T
+ return p
+
+ ","def evalPolynomialDerivative(poly, u, der=1):
+ tck, dummy = interpolate.splprep([x.tolist(),x.tolist()], s=0, k=1)
+ xU = np.array(interpolate.splev(u, tck)[1])
+ out = f2(xU)
+ p = np.array([np.ones((xU.shape[0],)), out]).T
+ return p
+
+ "
+535,https://:@github.com/mardix/gokku.git,c44093fc8d160748f4c6902e590ecd2193fdeb90,"@@ -509,7 +509,7 @@ def deploy_node(app, deltas={}):
+ first_time = False
+ if not exists(virtualenv_path):
+ echo(""-----> Creating virtualenv_path for '{}'"".format(app), fg='green')
+- makedirs(node_path)
++ makedirs(virtualenv_path)
+ first_time = True
+ if not exists(node_path):
+ echo(""-----> Creating node_modules for '{}'"".format(app), fg='green')
+",gokku.py,"ReplaceText(target='virtualenv_path' @(512,17)->(512,26))","def deploy_node(app, deltas={}):
+ first_time = False
+ if not exists(virtualenv_path):
+ echo(""-----> Creating virtualenv_path for '{}'"".format(app), fg='green')
+ makedirs(node_path)
+ first_time = True
+ if not exists(node_path):
+ echo(""-----> Creating node_modules for '{}'"".format(app), fg='green')","def deploy_node(app, deltas={}):
+ first_time = False
+ if not exists(virtualenv_path):
+ echo(""-----> Creating virtualenv_path for '{}'"".format(app), fg='green')
+ makedirs(virtualenv_path)
+ first_time = True
+ if not exists(node_path):
+ echo(""-----> Creating node_modules for '{}'"".format(app), fg='green')"
+536,https://:@github.com/sophacles/pyCLiFF.git,35bf4ff2714329a786c093d7e24a63e6fc1555b9,"@@ -16,7 +16,7 @@ def handle_opts(opts):
+
+ def datahandler(line):
+ global n
+- if n > clmax:
++ if n >= clmax:
+ raise StopIteration
+
+ n += 1
+",examples/head.py,"ReplaceText(target='>=' @(19,9)->(19,10))","def handle_opts(opts):
+
+ def datahandler(line):
+ global n
+ if n > clmax:
+ raise StopIteration
+
+ n += 1","def handle_opts(opts):
+
+ def datahandler(line):
+ global n
+ if n >= clmax:
+ raise StopIteration
+
+ n += 1"
+537,https://:@github.com/pilt/flask-versioned.git,2dd47374531a9426845a2b3b10fa5f2dc2418bf2,"@@ -45,7 +45,7 @@ class FileChangedDriver(Driver):
+ mods = time.strftime('%Y%m%dT%H%M%S', modt)
+ return self.format % {
+ 'version': mods,
+- 'path': path,
++ 'path': stream,
+ }
+
+
+",flaskext/versioned/__init__.py,"ReplaceText(target='stream' @(48,20)->(48,24))","class FileChangedDriver(Driver):
+ mods = time.strftime('%Y%m%dT%H%M%S', modt)
+ return self.format % {
+ 'version': mods,
+ 'path': path,
+ }
+
+ ","class FileChangedDriver(Driver):
+ mods = time.strftime('%Y%m%dT%H%M%S', modt)
+ return self.format % {
+ 'version': mods,
+ 'path': stream,
+ }
+
+ "
+538,https://:@github.com/lantunes/netomaton.git,7d73976ac295f05911b9b67e495bd54021f97644,"@@ -7,7 +7,7 @@ if __name__ == '__main__':
+
+ initial_conditions = [0] * 100 + [1] + [0] * 99
+
+- activities, connectivities = evolve(adjacencies, initial_conditions, timesteps=100,
++ activities, connectivities = evolve(initial_conditions, adjacencies, timesteps=100,
+ activity_rule=lambda n, c, t: ActivityRule.nks_ca_rule(n, c, 30))
+
+ plot_grid(activities)
+",demos/elementary_ca/elementary_ca_demo.py,"ArgSwap(idxs=0<->1 @(10,33)->(10,39))","if __name__ == '__main__':
+
+ initial_conditions = [0] * 100 + [1] + [0] * 99
+
+ activities, connectivities = evolve(adjacencies, initial_conditions, timesteps=100,
+ activity_rule=lambda n, c, t: ActivityRule.nks_ca_rule(n, c, 30))
+
+ plot_grid(activities)","if __name__ == '__main__':
+
+ initial_conditions = [0] * 100 + [1] + [0] * 99
+
+ activities, connectivities = evolve(initial_conditions, adjacencies, timesteps=100,
+ activity_rule=lambda n, c, t: ActivityRule.nks_ca_rule(n, c, 30))
+
+ plot_grid(activities)"
+539,https://:@github.com/lantunes/netomaton.git,7d73976ac295f05911b9b67e495bd54021f97644,"@@ -61,7 +61,7 @@ if __name__ == '__main__':
+
+ initial_conditions = half_two
+
+- activities, connectivities = evolve(hopfield_net.adjacency_matrix, initial_conditions, timesteps=155,
++ activities, connectivities = evolve(initial_conditions, hopfield_net.adjacency_matrix, timesteps=155,
+ activity_rule=hopfield_net.activity_rule)
+
+ # view the weights, stored in the adjacency matrix
+",demos/hopfield_net/hopfield_net_demo.py,"ArgSwap(idxs=0<->1 @(64,33)->(64,39))","if __name__ == '__main__':
+
+ initial_conditions = half_two
+
+ activities, connectivities = evolve(hopfield_net.adjacency_matrix, initial_conditions, timesteps=155,
+ activity_rule=hopfield_net.activity_rule)
+
+ # view the weights, stored in the adjacency matrix","if __name__ == '__main__':
+
+ initial_conditions = half_two
+
+ activities, connectivities = evolve(initial_conditions, hopfield_net.adjacency_matrix, timesteps=155,
+ activity_rule=hopfield_net.activity_rule)
+
+ # view the weights, stored in the adjacency matrix"
+540,https://:@github.com/orionw/tuningDEAP.git,7e7a40a386832fd386dfb8f67ff10e27ade0421e,"@@ -96,7 +96,7 @@ class TestConfigMapping(unittest.TestCase):
+ assert value == bool(new_value) and type(value) == bool, ""did not set the correct value from the map, expected {} but got {} (which is not the original {})"".format(""bool"", bool(new_value), type(value), value)
+ set_by_path(test_config, path, new_value, is_bool=False)
+ int_value = get_by_path(test_config, path)
+- assert new_value == int_value and type(int_value) == int, ""did not set the correct value from the map, expected type {} = {} but got type {} = {})"".format(""int"", int_value, type(int_value), new_value)
++ assert value == int_value and type(int_value) == int, ""did not set the correct value from the map, expected type {} = {} but got type {} = {})"".format(""int"", int_value, type(int_value), new_value)
+
+ def test_set_from_map_invalid(self):
+ test_value = ""three_levels""
+",test/test_config_mapping.py,"ReplaceText(target='value' @(99,15)->(99,24))","class TestConfigMapping(unittest.TestCase):
+ assert value == bool(new_value) and type(value) == bool, ""did not set the correct value from the map, expected {} but got {} (which is not the original {})"".format(""bool"", bool(new_value), type(value), value)
+ set_by_path(test_config, path, new_value, is_bool=False)
+ int_value = get_by_path(test_config, path)
+ assert new_value == int_value and type(int_value) == int, ""did not set the correct value from the map, expected type {} = {} but got type {} = {})"".format(""int"", int_value, type(int_value), new_value)
+
+ def test_set_from_map_invalid(self):
+ test_value = ""three_levels""","class TestConfigMapping(unittest.TestCase):
+ assert value == bool(new_value) and type(value) == bool, ""did not set the correct value from the map, expected {} but got {} (which is not the original {})"".format(""bool"", bool(new_value), type(value), value)
+ set_by_path(test_config, path, new_value, is_bool=False)
+ int_value = get_by_path(test_config, path)
+ assert value == int_value and type(int_value) == int, ""did not set the correct value from the map, expected type {} = {} but got type {} = {})"".format(""int"", int_value, type(int_value), new_value)
+
+ def test_set_from_map_invalid(self):
+ test_value = ""three_levels"""
+541,https://:@github.com/benjamincrom/scrabble.git,59d26971b75475d0a66aeb03902fda6bfa57a048,"@@ -188,7 +188,7 @@ def move_does_not_stack_tiles(letter_list, location_set):
+ # return False
+
+ def move_is_rack_size_or_less(location_set):
+- return len(location_set) > config.PLAYER_RACK_SIZE
++ return len(location_set) <= config.PLAYER_RACK_SIZE
+ # print('Move places greater than seven tiles.')
+ # return False
+ # else:
+",scrabble_game.py,"ReplaceText(target='<=' @(191,29)->(191,30))","def move_does_not_stack_tiles(letter_list, location_set):
+ # return False
+
+ def move_is_rack_size_or_less(location_set):
+ return len(location_set) > config.PLAYER_RACK_SIZE
+ # print('Move places greater than seven tiles.')
+ # return False
+ # else:","def move_does_not_stack_tiles(letter_list, location_set):
+ # return False
+
+ def move_is_rack_size_or_less(location_set):
+ return len(location_set) <= config.PLAYER_RACK_SIZE
+ # print('Move places greater than seven tiles.')
+ # return False
+ # else:"
+542,https://:@bitbucket.org/norok2/pytk.git,934113ff8273afe9c2737a1bdee6f5f298217986,"@@ -179,7 +179,7 @@ def center(target, reference=None):
+ geometry = reference.winfo_geometry()
+ else:
+ geometry = reference
+- if isinstance(reference, str):
++ if isinstance(geometry, str):
+ geometry = Geometry(geometry)
+ target_geometry = Geometry(target.winfo_geometry())
+ target.geometry(str(target_geometry.set_to_center(geometry)))
+",pytk/util.py,"ReplaceText(target='geometry' @(182,18)->(182,27))","def center(target, reference=None):
+ geometry = reference.winfo_geometry()
+ else:
+ geometry = reference
+ if isinstance(reference, str):
+ geometry = Geometry(geometry)
+ target_geometry = Geometry(target.winfo_geometry())
+ target.geometry(str(target_geometry.set_to_center(geometry)))","def center(target, reference=None):
+ geometry = reference.winfo_geometry()
+ else:
+ geometry = reference
+ if isinstance(geometry, str):
+ geometry = Geometry(geometry)
+ target_geometry = Geometry(target.winfo_geometry())
+ target.geometry(str(target_geometry.set_to_center(geometry)))"
+543,https://:@github.com/ds4dm/ecole.git,90d17acf7796734b64299619474a60519b19db59,"@@ -13,7 +13,7 @@ def test_IsDone(state):
+ def test_NLPIterations(state):
+ reward_func = R.NLPIterations()
+ reward_func.reset(state)
+- assert reward_func.get(state) >= 0
++ assert reward_func.get(state) <= 0
+ assert reward_func.get(state, done=True) == 0
+
+
+",python/tests/test_reward.py,"ReplaceText(target='<=' @(16,34)->(16,36))","def test_IsDone(state):
+ def test_NLPIterations(state):
+ reward_func = R.NLPIterations()
+ reward_func.reset(state)
+ assert reward_func.get(state) >= 0
+ assert reward_func.get(state, done=True) == 0
+
+ ","def test_IsDone(state):
+ def test_NLPIterations(state):
+ reward_func = R.NLPIterations()
+ reward_func.reset(state)
+ assert reward_func.get(state) <= 0
+ assert reward_func.get(state, done=True) == 0
+
+ "
+544,https://:@github.com/ds4dm/ecole.git,6bc408253cbea5c8cb6740412601d13eb6772039,"@@ -101,4 +101,4 @@ def test_LpIterations(model):
+ def test_NNodes(model):
+ reward_func = R.NNodes()
+ reward_func.reset(model)
+- assert reward_func.obtain_reward(model) <= 0
++ assert reward_func.obtain_reward(model) >= 0
+",python/tests/test_reward.py,"ReplaceText(target='>=' @(104,44)->(104,46))","def test_LpIterations(model):
+ def test_NNodes(model):
+ reward_func = R.NNodes()
+ reward_func.reset(model)
+ assert reward_func.obtain_reward(model) <= 0","def test_LpIterations(model):
+ def test_NNodes(model):
+ reward_func = R.NNodes()
+ reward_func.reset(model)
+ assert reward_func.obtain_reward(model) >= 0"
+545,https://:@github.com/nodedge/nodedge.git,b610ea8a12132e143aafe2824a83a9c032a973f7,"@@ -313,7 +313,7 @@ class GraphicsView(QGraphicsView):
+ event.localPos(),
+ event.screenPos(),
+ Qt.LeftButton,
+- event.buttons() & -Qt.LeftButton,
++ event.buttons() | -Qt.LeftButton,
+ event.modifiers(),
+ )
+ super().mouseReleaseEvent(fake_event)
+",nodedge/graphics_view.py,"ReplaceText(target='|' @(316,28)->(316,29))","class GraphicsView(QGraphicsView):
+ event.localPos(),
+ event.screenPos(),
+ Qt.LeftButton,
+ event.buttons() & -Qt.LeftButton,
+ event.modifiers(),
+ )
+ super().mouseReleaseEvent(fake_event)","class GraphicsView(QGraphicsView):
+ event.localPos(),
+ event.screenPos(),
+ Qt.LeftButton,
+ event.buttons() | -Qt.LeftButton,
+ event.modifiers(),
+ )
+ super().mouseReleaseEvent(fake_event)"
+546,https://:@github.com/ovnicraft/suds2.git,b5d1aa94c6c825f717bf41f687ca687241aeae43,"@@ -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)"
+547,https://:@github.com/ovnicraft/suds2.git,e54498f49a9973bc9a385885b5a220026503f22b,"@@ -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)"
+548,https://:@github.com/lukegb/ticketml.git,99c13a8e34a4397470564a355d639a4fbd5c72c4,"@@ -122,7 +122,7 @@ class BaseBackend(object):
+ self._serial.write(h2b('1d21' + hex))
+
+ def get_characters_per_line(self, font_width):
+- return self.BASE_CHARS_PER_LINE / font_width
++ return self.BASE_CHARS_PER_LINE // font_width
+
+ class Ibm4610Backend(BaseBackend):
+ BARCODE_MAP = {
+",ticketml/ticketml.py,"ReplaceText(target='//' @(125,40)->(125,41))","class BaseBackend(object):
+ self._serial.write(h2b('1d21' + hex))
+
+ def get_characters_per_line(self, font_width):
+ return self.BASE_CHARS_PER_LINE / font_width
+
+ class Ibm4610Backend(BaseBackend):
+ BARCODE_MAP = {","class BaseBackend(object):
+ self._serial.write(h2b('1d21' + hex))
+
+ def get_characters_per_line(self, font_width):
+ return self.BASE_CHARS_PER_LINE // font_width
+
+ class Ibm4610Backend(BaseBackend):
+ BARCODE_MAP = {"
+549,https://:@github.com/EmanuelGoncalves/crispy.git,2a029a350d328a65b32b5434a6b555dcc94a562c,"@@ -60,7 +60,7 @@ def iterate_correction(crispr_file, crispr_lib_file, cnv_file, output_folder, bs
+ assert len(overlap_genes) > 0, 'No genes (rows) overlap between CRISPR and Copy-number matrices'
+
+ # run correction for each cell line
+- for sample in overlap_genes:
++ for sample in overlap_samples:
+ if bsub_flag:
+ print('[{}] Crispy: bsub {}'.format(dt.now().strftime('%Y-%m-%d %H:%M:%S'), sample))
+
+",scripts/crispy/processing/correct_cnv_bias.py,"ReplaceText(target='overlap_samples' @(63,18)->(63,31))","def iterate_correction(crispr_file, crispr_lib_file, cnv_file, output_folder, bs
+ assert len(overlap_genes) > 0, 'No genes (rows) overlap between CRISPR and Copy-number matrices'
+
+ # run correction for each cell line
+ for sample in overlap_genes:
+ if bsub_flag:
+ print('[{}] Crispy: bsub {}'.format(dt.now().strftime('%Y-%m-%d %H:%M:%S'), sample))
+ ","def iterate_correction(crispr_file, crispr_lib_file, cnv_file, output_folder, bs
+ assert len(overlap_genes) > 0, 'No genes (rows) overlap between CRISPR and Copy-number matrices'
+
+ # run correction for each cell line
+ for sample in overlap_samples:
+ if bsub_flag:
+ print('[{}] Crispy: bsub {}'.format(dt.now().strftime('%Y-%m-%d %H:%M:%S'), sample))
+ "
+550,https://:@github.com/ninapavlich/sitecomber-article-tests.git,a053bd33aa15bf1c6e4a2dded9e5e1a71511e9bc,"@@ -159,4 +159,4 @@ def check_spelling(page, settings):
+ message = ""No misspellings found"" if not found_misspellings else u'Found %s misspelling(s): ""%s""' % (len(misspelled), '"", ""'.join(misspelled))
+ return found_misspellings, message
+
+- return True, 'No article found'
++ return False, 'No article found'
+",sitecomber_article_tests/utils.py,"ReplaceText(target='False' @(162,11)->(162,15))","def check_spelling(page, settings):
+ message = ""No misspellings found"" if not found_misspellings else u'Found %s misspelling(s): ""%s""' % (len(misspelled), '"", ""'.join(misspelled))
+ return found_misspellings, message
+
+ return True, 'No article found'","def check_spelling(page, settings):
+ message = ""No misspellings found"" if not found_misspellings else u'Found %s misspelling(s): ""%s""' % (len(misspelled), '"", ""'.join(misspelled))
+ return found_misspellings, message
+
+ return False, 'No article found'"
+551,https://:@github.com/salpreh/tablat.git,fef6e07276bced6e885653ef760884a0ee5e0606,"@@ -132,7 +132,7 @@ class Table(object):
+ end = row_lenght
+ filt_data = []
+
+- while end < len(self._table_data):
++ while end <= len(self._table_data):
+ filt_data.extend(self._filter_list(self._table_data[start:end], mask))
+ start = end
+ end += row_lenght
+",tablat/Table.py,"ReplaceText(target='<=' @(135,18)->(135,19))","class Table(object):
+ end = row_lenght
+ filt_data = []
+
+ while end < len(self._table_data):
+ filt_data.extend(self._filter_list(self._table_data[start:end], mask))
+ start = end
+ end += row_lenght","class Table(object):
+ end = row_lenght
+ filt_data = []
+
+ while end <= len(self._table_data):
+ filt_data.extend(self._filter_list(self._table_data[start:end], mask))
+ start = end
+ end += row_lenght"
+552,https://:@github.com/cloudshare/cloudshare-py-sdk.git,1363279f77267f5e18ec26f2d1bd345b3adea08e,"@@ -156,7 +156,7 @@ def request(method, path, queryParams=None, content=None):
+ path=path,
+ queryParams=queryParams,
+ content=content)
+- if res.status / 100 != 2:
++ if res.status // 100 != 2:
+ raise Exception('{} {}'.format(res.status, res.content['message']))
+ return res.content
+
+",example.py,"ReplaceText(target='//' @(159,18)->(159,19))","def request(method, path, queryParams=None, content=None):
+ path=path,
+ queryParams=queryParams,
+ content=content)
+ if res.status / 100 != 2:
+ raise Exception('{} {}'.format(res.status, res.content['message']))
+ return res.content
+ ","def request(method, path, queryParams=None, content=None):
+ path=path,
+ queryParams=queryParams,
+ content=content)
+ if res.status // 100 != 2:
+ raise Exception('{} {}'.format(res.status, res.content['message']))
+ return res.content
+ "
+553,https://:@github.com/Oslandia/deeposlandia.git,529dd916303d712ea3c51bb8454349812537e506,"@@ -111,7 +111,7 @@ if __name__ == '__main__':
+ testing_dataset.load(testing_filename, args.nb_testing_image)
+ else:
+ input_image_dir = os.path.join(input_repo, ""testing"")
+- testing_dataset.populate(input_image_dir, preprocessed_testing_path,
++ testing_dataset.populate(preprocessed_testing_path, input_image_dir,
+ nb_images=args.nb_testing_image, labelling=False)
+ testing_dataset.save(testing_filename)
+
+",sources/test.py,"ArgSwap(idxs=0<->1 @(114,8)->(114,32))","if __name__ == '__main__':
+ testing_dataset.load(testing_filename, args.nb_testing_image)
+ else:
+ input_image_dir = os.path.join(input_repo, ""testing"")
+ testing_dataset.populate(input_image_dir, preprocessed_testing_path,
+ nb_images=args.nb_testing_image, labelling=False)
+ testing_dataset.save(testing_filename)
+ ","if __name__ == '__main__':
+ testing_dataset.load(testing_filename, args.nb_testing_image)
+ else:
+ input_image_dir = os.path.join(input_repo, ""testing"")
+ testing_dataset.populate(preprocessed_testing_path, input_image_dir,
+ nb_images=args.nb_testing_image, labelling=False)
+ testing_dataset.save(testing_filename)
+ "
+554,https://:@github.com/Oslandia/deeposlandia.git,2bc626291e2f069c68e4a5a43e6ef5bfc3059d6a,"@@ -158,7 +158,7 @@ class SemanticSegmentationModel(ConvolutionalNeuralNetwork):
+ name=dataset_type+""_images"")
+ label_filepaths = [dataset.image_info[i][""label_filename""]
+ for i in range(dataset.get_nb_images())]
+- label_tensors = ops.convert_to_tensor(image_filepaths, dtype=tf.string,
++ label_tensors = ops.convert_to_tensor(label_filepaths, dtype=tf.string,
+ name=dataset_type+""_labels"")
+ input_queue = tf.train.slice_input_producer([image_tensors,
+ label_tensors],
+",sources/semantic_segmentation.py,"ReplaceText(target='label_filepaths' @(161,50)->(161,65))","class SemanticSegmentationModel(ConvolutionalNeuralNetwork):
+ name=dataset_type+""_images"")
+ label_filepaths = [dataset.image_info[i][""label_filename""]
+ for i in range(dataset.get_nb_images())]
+ label_tensors = ops.convert_to_tensor(image_filepaths, dtype=tf.string,
+ name=dataset_type+""_labels"")
+ input_queue = tf.train.slice_input_producer([image_tensors,
+ label_tensors],","class SemanticSegmentationModel(ConvolutionalNeuralNetwork):
+ name=dataset_type+""_images"")
+ label_filepaths = [dataset.image_info[i][""label_filename""]
+ for i in range(dataset.get_nb_images())]
+ label_tensors = ops.convert_to_tensor(label_filepaths, dtype=tf.string,
+ name=dataset_type+""_labels"")
+ input_queue = tf.train.slice_input_producer([image_tensors,
+ label_tensors],"
+555,https://:@github.com/Oslandia/deeposlandia.git,09e5206460eae73b533e9007ca5241bd5baee7f6,"@@ -449,7 +449,7 @@ def main(args):
+ ""semseg"",
+ ""predicted_geometries"",
+ )
+- os.makedirs(predicted_label_folder, exist_ok=True)
++ os.makedirs(predicted_geom_folder, exist_ok=True)
+ predicted_geom_file = os.path.join(
+ predicted_geom_folder,
+ args.image_basename + ""_"" + str(args.image_size) + "".geojson"",
+",deeposlandia/postprocess.py,"ReplaceText(target='predicted_geom_folder' @(452,16)->(452,38))","def main(args):
+ ""semseg"",
+ ""predicted_geometries"",
+ )
+ os.makedirs(predicted_label_folder, exist_ok=True)
+ predicted_geom_file = os.path.join(
+ predicted_geom_folder,
+ args.image_basename + ""_"" + str(args.image_size) + "".geojson"",","def main(args):
+ ""semseg"",
+ ""predicted_geometries"",
+ )
+ os.makedirs(predicted_geom_folder, exist_ok=True)
+ predicted_geom_file = os.path.join(
+ predicted_geom_folder,
+ args.image_basename + ""_"" + str(args.image_size) + "".geojson"","
+556,https://:@github.com/metal3d/keras-video-generators.git,7313aa497a80147714dda3581ce34d4821130ae1,"@@ -72,7 +72,7 @@ class VideoFrameGenerator(Sequence):
+
+ # split factor should be a propoer value
+ if split is not None:
+- assert 0.0 > split < 1.0
++ assert 0.0 < split < 1.0
+
+ # be sure that classes are well ordered
+ classes.sort()
+",src/keras_video/generator.py,"ReplaceText(target='<' @(75,23)->(75,24))","class VideoFrameGenerator(Sequence):
+
+ # split factor should be a propoer value
+ if split is not None:
+ assert 0.0 > split < 1.0
+
+ # be sure that classes are well ordered
+ classes.sort()","class VideoFrameGenerator(Sequence):
+
+ # split factor should be a propoer value
+ if split is not None:
+ assert 0.0 < split < 1.0
+
+ # be sure that classes are well ordered
+ classes.sort()"
+557,https://:@github.com/yongzhuo/Macropodus.git,11789503e9122303464bf6f02df1122397c0ca97,"@@ -142,7 +142,7 @@ class RandomEmbedding(BaseEmbedding):
+ else:
+ raise RuntimeError(""your input level_type is wrong, it must be 'word', 'char', 'ngram'"")
+ for text_one in text:
+- if term_one not in token2idx:
++ if text_one not in token2idx:
+ token2idx[text_one] = len(token2idx)
+ else:
+ raise RuntimeError(""your input corpus_path is wrong, it must be 'dict' or 'corpus'"")
+",macropodus/network/base/embedding.py,"ReplaceText(target='text_one' @(145,27)->(145,35))","class RandomEmbedding(BaseEmbedding):
+ else:
+ raise RuntimeError(""your input level_type is wrong, it must be 'word', 'char', 'ngram'"")
+ for text_one in text:
+ if term_one not in token2idx:
+ token2idx[text_one] = len(token2idx)
+ else:
+ raise RuntimeError(""your input corpus_path is wrong, it must be 'dict' or 'corpus'"")","class RandomEmbedding(BaseEmbedding):
+ else:
+ raise RuntimeError(""your input level_type is wrong, it must be 'word', 'char', 'ngram'"")
+ for text_one in text:
+ if text_one not in token2idx:
+ token2idx[text_one] = len(token2idx)
+ else:
+ raise RuntimeError(""your input corpus_path is wrong, it must be 'dict' or 'corpus'"")"
+558,https://:@github.com/foxkit-us/PyIRC.git,c0bcbffa66f6fe1ddb7f3002e85fa38bfaafa103,"@@ -156,7 +156,7 @@ class IRCString(UserString):
+
+ def convert(self, case):
+ """"""Convert string into another caseform""""""
+- return IRCString(self, case)
++ return IRCString(case, self)
+
+ def ascii_lower(self):
+ """"""Return a copy of the string S converted to lowercase, using ASCII
+",PyIRC/casemapping.py,"ArgSwap(idxs=0<->1 @(159,15)->(159,24))","class IRCString(UserString):
+
+ def convert(self, case):
+ """"""Convert string into another caseform""""""
+ return IRCString(self, case)
+
+ def ascii_lower(self):
+ """"""Return a copy of the string S converted to lowercase, using ASCII","class IRCString(UserString):
+
+ def convert(self, case):
+ """"""Convert string into another caseform""""""
+ return IRCString(case, self)
+
+ def ascii_lower(self):
+ """"""Return a copy of the string S converted to lowercase, using ASCII"
+559,https://:@github.com/foxkit-us/PyIRC.git,b262e84b066a39cd911a37c5f3ab517413ed707f,"@@ -332,7 +332,7 @@ class UserTrack(BaseExtension):
+
+ basicrfc = self.get_extension(""BasicRFC"")
+
+- if self.casecmp(user.nick, basicrfc.nick):
++ if self.casecmp(target.nick, basicrfc.nick):
+ # It's us!
+ isupport = self.get_extension(""ISupport"")
+
+",PyIRC/extensions/usertrack.py,"ReplaceText(target='target' @(335,24)->(335,28))","class UserTrack(BaseExtension):
+
+ basicrfc = self.get_extension(""BasicRFC"")
+
+ if self.casecmp(user.nick, basicrfc.nick):
+ # It's us!
+ isupport = self.get_extension(""ISupport"")
+ ","class UserTrack(BaseExtension):
+
+ basicrfc = self.get_extension(""BasicRFC"")
+
+ if self.casecmp(target.nick, basicrfc.nick):
+ # It's us!
+ isupport = self.get_extension(""ISupport"")
+ "
+560,https://:@github.com/foxkit-us/PyIRC.git,71fa54a10227f629b88a2345a1da19b7db02b862,"@@ -48,7 +48,7 @@ class NullSocket(IRCBase):
+
+ def inject_line(self, line):
+ """"""Inject a Line into the recvq for the client.""""""
+- assert isinstance(Line, line)
++ assert isinstance(line, Line)
+ self.recvq.put(line)
+
+ def loop(self):
+",PyIRC/io/null.py,"ArgSwap(idxs=0<->1 @(51,15)->(51,25))","class NullSocket(IRCBase):
+
+ def inject_line(self, line):
+ """"""Inject a Line into the recvq for the client.""""""
+ assert isinstance(Line, line)
+ self.recvq.put(line)
+
+ def loop(self):","class NullSocket(IRCBase):
+
+ def inject_line(self, line):
+ """"""Inject a Line into the recvq for the client.""""""
+ assert isinstance(line, Line)
+ self.recvq.put(line)
+
+ def loop(self):"
+561,https://:@github.com/foxkit-us/PyIRC.git,bf102eab33bde57ba3ae1b240a84ee2d161103f0,"@@ -362,7 +362,7 @@ class XTerm16ColourFormatter(ANSIFormatter):
+
+ if self.background is not None:
+ bgc = ColoursANSI[self.background.name].value
+- ret.append(str(fgc.background_16))
++ ret.append(str(bgc.background_16))
+ else:
+ # Reset background just in case
+ ret.append(self.fmt_resetbackground)
+",PyIRC/formatting/formatters.py,"ReplaceText(target='bgc' @(365,31)->(365,34))","class XTerm16ColourFormatter(ANSIFormatter):
+
+ if self.background is not None:
+ bgc = ColoursANSI[self.background.name].value
+ ret.append(str(fgc.background_16))
+ else:
+ # Reset background just in case
+ ret.append(self.fmt_resetbackground)","class XTerm16ColourFormatter(ANSIFormatter):
+
+ if self.background is not None:
+ bgc = ColoursANSI[self.background.name].value
+ ret.append(str(bgc.background_16))
+ else:
+ # Reset background just in case
+ ret.append(self.fmt_resetbackground)"
+562,https://:@bitbucket.org/pixelforest/pixelforest_drf.git,71155a01605838be2123eae28b650ceae32d7c2c,"@@ -14,7 +14,7 @@ from ..permissions import FullDjangoModelPermissions
+
+ User = get_user_model()
+
+-if User is PFUser:
++if User is not PFUser:
+ raise ImproperlyConfigured(""Pf User is not the User model"")
+
+
+",pixelforest_drf/rest/users/api_views.py,"ReplaceText(target=' is not ' @(17,7)->(17,11))","from ..permissions import FullDjangoModelPermissions
+
+ User = get_user_model()
+
+ if User is PFUser:
+ raise ImproperlyConfigured(""Pf User is not the User model"")
+
+ ","from ..permissions import FullDjangoModelPermissions
+
+ User = get_user_model()
+
+ if User is not PFUser:
+ raise ImproperlyConfigured(""Pf User is not the User model"")
+
+ "
+563,https://:@github.com/sphemakh/meerkathi.git,b6220f225f989604f184d10863e5012f215ed639,"@@ -65,7 +65,7 @@ class worker_administrator(object):
+ else:
+ worker = name + '_worker'
+
+- self.workers.append((name, worker, order))
++ self.workers.append((name, worker, i))
+
+ self.workers = sorted(self.workers, key=lambda a: a[2])
+
+",meerkathi/workers/worker_administrator.py,"ReplaceText(target='i' @(68,47)->(68,52))","class worker_administrator(object):
+ else:
+ worker = name + '_worker'
+
+ self.workers.append((name, worker, order))
+
+ self.workers = sorted(self.workers, key=lambda a: a[2])
+ ","class worker_administrator(object):
+ else:
+ worker = name + '_worker'
+
+ self.workers.append((name, worker, i))
+
+ self.workers = sorted(self.workers, key=lambda a: a[2])
+ "
+564,https://:@github.com/sphemakh/meerkathi.git,8bb75b04fe481c06cf0e7987e0072ed58fea1bc3,"@@ -528,7 +528,7 @@ found in our database or in the CASA NRAO database'.format(field))
+ step = 'plot_fluxscale_{0:d}'.format(i)
+ table = prefix+"".F0""
+ fieldtoplot = []
+- fieldtoplot.append(utils.get_field_id(msinfo, ref)[0])
++ fieldtoplot.append(utils.get_field_id(msinfo, trans)[0])
+ recipe.add('cab/ragavi', step,
+ {
+ ""table"" : '{0:s}/{1:s}:{2:s}'.format(get_dir_path(pipeline.caltables, pipeline), table, 'output'),
+",meerkathi/workers/cross_cal_worker.py,"ReplaceText(target='trans' @(531,62)->(531,65))","found in our database or in the CASA NRAO database'.format(field))
+ step = 'plot_fluxscale_{0:d}'.format(i)
+ table = prefix+"".F0""
+ fieldtoplot = []
+ fieldtoplot.append(utils.get_field_id(msinfo, ref)[0])
+ recipe.add('cab/ragavi', step,
+ {
+ ""table"" : '{0:s}/{1:s}:{2:s}'.format(get_dir_path(pipeline.caltables, pipeline), table, 'output'),","found in our database or in the CASA NRAO database'.format(field))
+ step = 'plot_fluxscale_{0:d}'.format(i)
+ table = prefix+"".F0""
+ fieldtoplot = []
+ fieldtoplot.append(utils.get_field_id(msinfo, trans)[0])
+ recipe.add('cab/ragavi', step,
+ {
+ ""table"" : '{0:s}/{1:s}:{2:s}'.format(get_dir_path(pipeline.caltables, pipeline), table, 'output'),"
+565,https://:@github.com/sphemakh/meerkathi.git,67485769492da55875da1fea491a7a32ce82d16a,"@@ -176,7 +176,7 @@ def worker(pipeline, recipe, config):
+ substep = 'delete_flag_versions_after_{0:s}_ms{1:d}'.format(version, target_iter)
+ manflags.delete_cflags(pipeline, recipe,
+ available_flagversions[available_flagversions.index(version)+1],
+- msname, cab_name=substep)
++ fms, cab_name=substep)
+
+ flagv = tms+'.flagversions'
+
+",caracal/workers/transform_worker.py,"ReplaceText(target='fms' @(179,24)->(179,30))","def worker(pipeline, recipe, config):
+ substep = 'delete_flag_versions_after_{0:s}_ms{1:d}'.format(version, target_iter)
+ manflags.delete_cflags(pipeline, recipe,
+ available_flagversions[available_flagversions.index(version)+1],
+ msname, cab_name=substep)
+
+ flagv = tms+'.flagversions'
+ ","def worker(pipeline, recipe, config):
+ substep = 'delete_flag_versions_after_{0:s}_ms{1:d}'.format(version, target_iter)
+ manflags.delete_cflags(pipeline, recipe,
+ available_flagversions[available_flagversions.index(version)+1],
+ fms, cab_name=substep)
+
+ flagv = tms+'.flagversions'
+ "
+566,https://:@gitlab.com/nekokatt/hikari.git,0b4d26aa20ddbf580ad84581bc5eeea34c687896,"@@ -48,4 +48,4 @@ class TestReaction:
+
+ assert re.count == 420
+ assert re.me is True
+- test_state.parse_emoji.assert_called_with(None, emoji_dict)
++ test_state.parse_emoji.assert_called_with(emoji_dict, None)
+",tests/hikari/core/model/test_reaction.py,"ArgSwap(idxs=0<->1 @(51,8)->(51,49))","class TestReaction:
+
+ assert re.count == 420
+ assert re.me is True
+ test_state.parse_emoji.assert_called_with(None, emoji_dict)","class TestReaction:
+
+ assert re.count == 420
+ assert re.me is True
+ test_state.parse_emoji.assert_called_with(emoji_dict, None)"
+567,https://:@gitlab.com/nekokatt/hikari.git,b40bd61096cbd597d0f2863351ebddebf571867d,"@@ -286,7 +286,7 @@ class DispatchingEventAdapterImpl(dispatching_event_adapter.DispatchingEventAdap
+
+ for role_id in role_ids:
+ role_obj = self.fabric.state_registry.get_role_by_id(guild_id, role_id)
+- if role_objs is not None:
++ if role_obj is not None:
+ role_objs.append(role_obj)
+ else:
+ self.logger.warning(
+",hikari/orm/dispatching_event_adapter_impl.py,"ReplaceText(target='role_obj' @(289,19)->(289,28))","class DispatchingEventAdapterImpl(dispatching_event_adapter.DispatchingEventAdap
+
+ for role_id in role_ids:
+ role_obj = self.fabric.state_registry.get_role_by_id(guild_id, role_id)
+ if role_objs is not None:
+ role_objs.append(role_obj)
+ else:
+ self.logger.warning(","class DispatchingEventAdapterImpl(dispatching_event_adapter.DispatchingEventAdap
+
+ for role_id in role_ids:
+ role_obj = self.fabric.state_registry.get_role_by_id(guild_id, role_id)
+ if role_obj is not None:
+ role_objs.append(role_obj)
+ else:
+ self.logger.warning("
+568,https://:@gitlab.com/nekokatt/hikari.git,89f2070c7a2135162e4852a8b778490b4695bc78,"@@ -699,7 +699,7 @@ class BotAppImpl(bot.IBotApp):
+ if plat == ""win32"":
+ supports_color |= os.getenv(""TERM_PROGRAM"", None) == ""mintty""
+ supports_color |= ""ANSICON"" in os.environ
+- supports_color |= is_a_tty
++ supports_color &= is_a_tty
+ else:
+ supports_color = is_a_tty
+
+",hikari/impl/bot.py,"ReplaceText(target='&=' @(702,31)->(702,33))","class BotAppImpl(bot.IBotApp):
+ if plat == ""win32"":
+ supports_color |= os.getenv(""TERM_PROGRAM"", None) == ""mintty""
+ supports_color |= ""ANSICON"" in os.environ
+ supports_color |= is_a_tty
+ else:
+ supports_color = is_a_tty
+ ","class BotAppImpl(bot.IBotApp):
+ if plat == ""win32"":
+ supports_color |= os.getenv(""TERM_PROGRAM"", None) == ""mintty""
+ supports_color |= ""ANSICON"" in os.environ
+ supports_color &= is_a_tty
+ else:
+ supports_color = is_a_tty
+ "
+569,https://:@github.com/matthewhanson/boto3-utils.git,23390e1f08fda449451266dc7136a89914e00b4e,"@@ -33,7 +33,7 @@ class s3(object):
+ _url = deepcopy(url)
+ if url[0:5] == 'https':
+ _url = cls.https_to_s3(url)
+- if url[0:5] != 's3://':
++ if _url[0:5] != 's3://':
+ raise Exception('Invalid S3 url %s' % _url)
+
+ url_obj = _url.replace('s3://', '').split('/')
+",boto3utils/s3.py,"ReplaceText(target='_url' @(36,11)->(36,14))","class s3(object):
+ _url = deepcopy(url)
+ if url[0:5] == 'https':
+ _url = cls.https_to_s3(url)
+ if url[0:5] != 's3://':
+ raise Exception('Invalid S3 url %s' % _url)
+
+ url_obj = _url.replace('s3://', '').split('/')","class s3(object):
+ _url = deepcopy(url)
+ if url[0:5] == 'https':
+ _url = cls.https_to_s3(url)
+ if _url[0:5] != 's3://':
+ raise Exception('Invalid S3 url %s' % _url)
+
+ url_obj = _url.replace('s3://', '').split('/')"
+570,https://:@github.com/spex-xray/pyspextools.git,c68beb5206e3525010e0265f2c18f8f5fc4bebc3,"@@ -131,7 +131,7 @@ class OGIPRegion(Region):
+ if isinstance(corr, Pha):
+ self.corr = corr
+ self.input_corr = True
+- elif back is None:
++ elif corr is None:
+ self.input_corr = False
+ else:
+ self.input_corr = False
+",pyspextools/io/ogip.py,"ReplaceText(target='corr' @(134,13)->(134,17))","class OGIPRegion(Region):
+ if isinstance(corr, Pha):
+ self.corr = corr
+ self.input_corr = True
+ elif back is None:
+ self.input_corr = False
+ else:
+ self.input_corr = False","class OGIPRegion(Region):
+ if isinstance(corr, Pha):
+ self.corr = corr
+ self.input_corr = True
+ elif corr is None:
+ self.input_corr = False
+ else:
+ self.input_corr = False"
+571,https://:@github.com/djerbic/xlrd-ignore-writeaccess-corruption.git,8ce449208ac3a8a1f4ec9c72954c11afcd40d3a8,"@@ -1975,7 +1975,7 @@ class Sheet(BaseObject):
+ nchars = data2_len - 1
+ if nb:
+ assert nchars % 2 == 0
+- nchars /= 2
++ nchars //= 2
+ utext, endpos = unpack_unicode_update_pos(data2, 0, known_len=nchars)
+ assert endpos == data2_len
+ o.text += utext
+",xlrd/sheet.py,"ReplaceText(target='//=' @(1978,23)->(1978,25))","class Sheet(BaseObject):
+ nchars = data2_len - 1
+ if nb:
+ assert nchars % 2 == 0
+ nchars /= 2
+ utext, endpos = unpack_unicode_update_pos(data2, 0, known_len=nchars)
+ assert endpos == data2_len
+ o.text += utext","class Sheet(BaseObject):
+ nchars = data2_len - 1
+ if nb:
+ assert nchars % 2 == 0
+ nchars //= 2
+ utext, endpos = unpack_unicode_update_pos(data2, 0, known_len=nchars)
+ assert endpos == data2_len
+ o.text += utext"
+572,https://:@github.com/ijiraq/daomop.git,2b9c4af87e1b899b7589cfb04aa272540d2e8a04,"@@ -61,7 +61,7 @@ class GeneralModelTest(FileReadingTestCase, DirectoryCleaningTestCase):
+ # Put a real fits image on the first source, first observation
+ apcor_str = ""4 15 0.19 0.01""
+ with open(self.get_abs_path(path), ""rb"") as fh:
+- self.first_image = DownloadedFitsImage(fh.read(), apcor_str, Mock(), in_memory=True)
++ self.first_image = DownloadedFitsImage(fh.read(), Mock(), apcor_str, in_memory=True)
+ first_reading = self.model.get_current_workunit().get_sources()[0].get_readings()[0]
+ self.model._on_image_loaded(first_reading, self.first_image)
+
+",src/ossos-pipeline/tests/test_integration/test_models.py,"ArgSwap(idxs=1<->2 @(64,31)->(64,50))","class GeneralModelTest(FileReadingTestCase, DirectoryCleaningTestCase):
+ # Put a real fits image on the first source, first observation
+ apcor_str = ""4 15 0.19 0.01""
+ with open(self.get_abs_path(path), ""rb"") as fh:
+ self.first_image = DownloadedFitsImage(fh.read(), apcor_str, Mock(), in_memory=True)
+ first_reading = self.model.get_current_workunit().get_sources()[0].get_readings()[0]
+ self.model._on_image_loaded(first_reading, self.first_image)
+ ","class GeneralModelTest(FileReadingTestCase, DirectoryCleaningTestCase):
+ # Put a real fits image on the first source, first observation
+ apcor_str = ""4 15 0.19 0.01""
+ with open(self.get_abs_path(path), ""rb"") as fh:
+ self.first_image = DownloadedFitsImage(fh.read(), Mock(), apcor_str, in_memory=True)
+ first_reading = self.model.get_current_workunit().get_sources()[0].get_readings()[0]
+ self.model._on_image_loaded(first_reading, self.first_image)
+ "
+573,https://:@github.com/iamsteadman/bambu-buffer.git,5704abdda5297d6cde2ccac7f91ded4108e1f616,"@@ -12,7 +12,7 @@ def post_save_receiver(sender, instance, **kwargs):
+
+ name = m.pop(0)
+ app, model = name.lower().split('.')
+- if app != instance._meta.app_label and model != instance._meta.module_name:
++ if app != instance._meta.app_label or model != instance._meta.module_name:
+ continue
+
+ if any(m):
+",bambu_buffer/receivers.py,"ReplaceText(target='or' @(15,43)->(15,46))","def post_save_receiver(sender, instance, **kwargs):
+
+ name = m.pop(0)
+ app, model = name.lower().split('.')
+ if app != instance._meta.app_label and model != instance._meta.module_name:
+ continue
+
+ if any(m):","def post_save_receiver(sender, instance, **kwargs):
+
+ name = m.pop(0)
+ app, model = name.lower().split('.')
+ if app != instance._meta.app_label or model != instance._meta.module_name:
+ continue
+
+ if any(m):"
+574,https://:@github.com/khllkcm/templot.git,d4b329d16f94e3808e54b05116a8545e987a5e7b,"@@ -95,7 +95,7 @@ def plot_aggregated_map(
+
+ if aggregation_method not in aggregates:
+ raise ValueError(
+- f""{group} is not a valid aggregation method. Possible values are: {', '.join([k for k in aggregates])}""
++ f""{aggregation_method} is not a valid aggregation method. Possible values are: {', '.join([k for k in aggregates])}""
+ )
+
+ map_data = aggregates[aggregation_method][variables]
+",templot/plot_aggregated_map.py,"ReplaceText(target='aggregation_method' @(98,15)->(98,20))","def plot_aggregated_map(
+
+ if aggregation_method not in aggregates:
+ raise ValueError(
+ f""{group} is not a valid aggregation method. Possible values are: {', '.join([k for k in aggregates])}""
+ )
+
+ map_data = aggregates[aggregation_method][variables]","def plot_aggregated_map(
+
+ if aggregation_method not in aggregates:
+ raise ValueError(
+ f""{aggregation_method} is not a valid aggregation method. Possible values are: {', '.join([k for k in aggregates])}""
+ )
+
+ map_data = aggregates[aggregation_method][variables]"
+575,https://:@github.com/cjneely10/BioMetaDB.git,71352d2e75c038af886007c7b82591896aa23e1c,"@@ -146,4 +146,4 @@ def create_database(db_name, table_name, directory_name, data_file, alias, silen
+ if not silent:
+ _initialization_display_message_epilogue()
+ if not integrity_cancel:
+- integrity_check(directory_name, table_name, ""None"", silent)
++ integrity_check(db_name, table_name, ""None"", silent)
+",BioMetaDB/DBOperations/create_database.py,"ReplaceText(target='db_name' @(149,24)->(149,38))","def create_database(db_name, table_name, directory_name, data_file, alias, silen
+ if not silent:
+ _initialization_display_message_epilogue()
+ if not integrity_cancel:
+ integrity_check(directory_name, table_name, ""None"", silent)","def create_database(db_name, table_name, directory_name, data_file, alias, silen
+ if not silent:
+ _initialization_display_message_epilogue()
+ if not integrity_cancel:
+ integrity_check(db_name, table_name, ""None"", silent)"
+576,https://:@github.com/lsst-sqre/kubespawner.git,5f0ca5f9734552b4c40563828899316d2b69156c,"@@ -361,7 +361,7 @@ class KubeSpawner(Spawner):
+ # shut down to complete
+ while True:
+ data = yield self.get_pod_info(self.pod_name)
+- if data is not None:
++ if data is None:
+ break
+ time.sleep(5)
+
+",kubespawner/spawner.py,"ReplaceText(target=' is ' @(364,23)->(364,31))","class KubeSpawner(Spawner):
+ # shut down to complete
+ while True:
+ data = yield self.get_pod_info(self.pod_name)
+ if data is not None:
+ break
+ time.sleep(5)
+ ","class KubeSpawner(Spawner):
+ # shut down to complete
+ while True:
+ data = yield self.get_pod_info(self.pod_name)
+ if data is None:
+ break
+ time.sleep(5)
+ "
+577,https://:@github.com/lsst-sqre/kubespawner.git,df9936a785e34c898ffd065f17697a0035cf310c,"@@ -404,7 +404,7 @@ class KubeSpawner(Spawner):
+ @gen.coroutine
+ def start(self):
+ pvc_data = get_pvc_info(self.pvc_name)
+- if pvc_data is not None:
++ if pvc_data is None:
+ pvc_manifest = self.get_pvc_manifest()
+ yield self.httpclient.fetch(self.request(
+ url=k8s_url(self.namespace, 'persistentvolumeclaims'),
+",kubespawner/spawner.py,"ReplaceText(target=' is ' @(407,19)->(407,27))","class KubeSpawner(Spawner):
+ @gen.coroutine
+ def start(self):
+ pvc_data = get_pvc_info(self.pvc_name)
+ if pvc_data is not None:
+ pvc_manifest = self.get_pvc_manifest()
+ yield self.httpclient.fetch(self.request(
+ url=k8s_url(self.namespace, 'persistentvolumeclaims'),","class KubeSpawner(Spawner):
+ @gen.coroutine
+ def start(self):
+ pvc_data = get_pvc_info(self.pvc_name)
+ if pvc_data is None:
+ pvc_manifest = self.get_pvc_manifest()
+ yield self.httpclient.fetch(self.request(
+ url=k8s_url(self.namespace, 'persistentvolumeclaims'),"
+578,https://:@github.com/d-meiser/cold-atoms.git,8235e3bc1d9cc9b1bbfe27948d24adc48db33f06,"@@ -48,5 +48,5 @@ def bend_kick(dt, Bz, ensemble, forces, reference_impl=False):
+ f = np.zeros_like(ensemble.v)
+ for force in forces:
+ force.force(dt, ensemble, f)
+- ensemble.v *= f / m
++ ensemble.v += f / m
+ updater(0.5 * dt, omegaB, ensemble.x, ensemble.v)
+",src/coldatoms/bend_kick.py,"ReplaceText(target='+=' @(51,19)->(51,21))","def bend_kick(dt, Bz, ensemble, forces, reference_impl=False):
+ f = np.zeros_like(ensemble.v)
+ for force in forces:
+ force.force(dt, ensemble, f)
+ ensemble.v *= f / m
+ updater(0.5 * dt, omegaB, ensemble.x, ensemble.v)","def bend_kick(dt, Bz, ensemble, forces, reference_impl=False):
+ f = np.zeros_like(ensemble.v)
+ for force in forces:
+ force.force(dt, ensemble, f)
+ ensemble.v += f / m
+ updater(0.5 * dt, omegaB, ensemble.x, ensemble.v)"
+579,https://:@github.com/silvacms/silva.pas.base.git,d0e1b5196420a6a1359fc5f45d220d172f7a1e01,"@@ -41,7 +41,7 @@ class SilvaCascadingPASPlugin(SearchPrincipalsPlugin):
+ for authenticator_id, auth in authenticators:
+ try:
+ info = auth.authenticateCredentials(credentials)
+- if info is not None and info[0] is None:
++ if info is not None and info[0] is not None:
+ # Failed login can be None OR (None, None)
+ return info
+ except _SWALLOWABLE_PLUGIN_EXCEPTIONS:
+",src/silva/pas/base/plugins/cascading.py,"ReplaceText(target=' is not ' @(44,47)->(44,51))","class SilvaCascadingPASPlugin(SearchPrincipalsPlugin):
+ for authenticator_id, auth in authenticators:
+ try:
+ info = auth.authenticateCredentials(credentials)
+ if info is not None and info[0] is None:
+ # Failed login can be None OR (None, None)
+ return info
+ except _SWALLOWABLE_PLUGIN_EXCEPTIONS:","class SilvaCascadingPASPlugin(SearchPrincipalsPlugin):
+ for authenticator_id, auth in authenticators:
+ try:
+ info = auth.authenticateCredentials(credentials)
+ if info is not None and info[0] is not None:
+ # Failed login can be None OR (None, None)
+ return info
+ except _SWALLOWABLE_PLUGIN_EXCEPTIONS:"
+580,https://:@github.com/jgolob/maliampi.git,dd0a5bf78106e083005db0e7bd21f1122e63f162,"@@ -239,7 +239,7 @@ class Workflow_Placement(sl.WorkflowTask):
+ lpca = self.new_task(
+ 'calculate_lpca',
+ Jplace_PCA,
+- containerinfo=long_containerinfo,
++ containerinfo=highmem_containerinfo,
+ path=os.path.join(
+ self.destination_dir,
+ 'placement',
+",maliampi/subcommands/placement.py,"ReplaceText(target='highmem_containerinfo' @(242,26)->(242,44))","class Workflow_Placement(sl.WorkflowTask):
+ lpca = self.new_task(
+ 'calculate_lpca',
+ Jplace_PCA,
+ containerinfo=long_containerinfo,
+ path=os.path.join(
+ self.destination_dir,
+ 'placement',","class Workflow_Placement(sl.WorkflowTask):
+ lpca = self.new_task(
+ 'calculate_lpca',
+ Jplace_PCA,
+ containerinfo=highmem_containerinfo,
+ path=os.path.join(
+ self.destination_dir,
+ 'placement',"
+581,https://:@github.com/jgolob/maliampi.git,cdea28dbb12093af0165e983149da396b69fe33a,"@@ -115,7 +115,7 @@ class Workflow_DADA2(sl.WorkflowTask):
+ batch_errModels[batch] = self.new_task(
+ 'dada2_learn_error_batch_{}'.format(batch),
+ DADA2_LearnError,
+- containerinfo=heavy_containerinfo,
++ containerinfo=midcpu_containerinfo,
+ batch=batch,
+ tar_reads=False,
+ path=os.path.join(
+",maliampi/subcommands/sv_dada2.py,"ReplaceText(target='midcpu_containerinfo' @(118,30)->(118,49))","class Workflow_DADA2(sl.WorkflowTask):
+ batch_errModels[batch] = self.new_task(
+ 'dada2_learn_error_batch_{}'.format(batch),
+ DADA2_LearnError,
+ containerinfo=heavy_containerinfo,
+ batch=batch,
+ tar_reads=False,
+ path=os.path.join(","class Workflow_DADA2(sl.WorkflowTask):
+ batch_errModels[batch] = self.new_task(
+ 'dada2_learn_error_batch_{}'.format(batch),
+ DADA2_LearnError,
+ containerinfo=midcpu_containerinfo,
+ batch=batch,
+ tar_reads=False,
+ path=os.path.join("
+582,https://:@github.com/jgolob/maliampi.git,3cde81cdd2b908b7edd44a000986744301092fae,"@@ -203,7 +203,7 @@ class Workflow_Classify(sl.WorkflowTask):
+ placement_db_classified = self.new_task(
+ 'classify_into_placement_db',
+ PlacementDB_Classify_SV,
+- containerinfo=heavy_containerinfo,
++ containerinfo=midcpu_containerinfo,
+ )
+ placement_db_classified.in_placement_db = placement_db_w_si.out_placement_db
+ placement_db_classified.in_refpkg_tgz = refpkg_tgz.out_refpkg_tgz
+",maliampi/subcommands/classify.py,"ReplaceText(target='midcpu_containerinfo' @(206,26)->(206,45))","class Workflow_Classify(sl.WorkflowTask):
+ placement_db_classified = self.new_task(
+ 'classify_into_placement_db',
+ PlacementDB_Classify_SV,
+ containerinfo=heavy_containerinfo,
+ )
+ placement_db_classified.in_placement_db = placement_db_w_si.out_placement_db
+ placement_db_classified.in_refpkg_tgz = refpkg_tgz.out_refpkg_tgz","class Workflow_Classify(sl.WorkflowTask):
+ placement_db_classified = self.new_task(
+ 'classify_into_placement_db',
+ PlacementDB_Classify_SV,
+ containerinfo=midcpu_containerinfo,
+ )
+ placement_db_classified.in_placement_db = placement_db_w_si.out_placement_db
+ placement_db_classified.in_refpkg_tgz = refpkg_tgz.out_refpkg_tgz"
+583,https://:@github.com/jgolob/maliampi.git,f50cfcea1e390ae5eb05de0c116c2251a09f4864,"@@ -203,7 +203,7 @@ class Workflow_Classify(sl.WorkflowTask):
+ placement_db_classified = self.new_task(
+ 'classify_into_placement_db',
+ PlacementDB_Classify_SV,
+- containerinfo=midcpu_containerinfo,
++ containerinfo=highmem_containerinfo,
+ )
+ placement_db_classified.in_placement_db = placement_db_w_si.out_placement_db
+ placement_db_classified.in_refpkg_tgz = refpkg_tgz.out_refpkg_tgz
+",maliampi/subcommands/classify.py,"ReplaceText(target='highmem_containerinfo' @(206,26)->(206,46))","class Workflow_Classify(sl.WorkflowTask):
+ placement_db_classified = self.new_task(
+ 'classify_into_placement_db',
+ PlacementDB_Classify_SV,
+ containerinfo=midcpu_containerinfo,
+ )
+ placement_db_classified.in_placement_db = placement_db_w_si.out_placement_db
+ placement_db_classified.in_refpkg_tgz = refpkg_tgz.out_refpkg_tgz","class Workflow_Classify(sl.WorkflowTask):
+ placement_db_classified = self.new_task(
+ 'classify_into_placement_db',
+ PlacementDB_Classify_SV,
+ containerinfo=highmem_containerinfo,
+ )
+ placement_db_classified.in_placement_db = placement_db_w_si.out_placement_db
+ placement_db_classified.in_refpkg_tgz = refpkg_tgz.out_refpkg_tgz"
+584,https://:@github.com/d3rp/clima.git,92eced31f43fd49f87e6af8582066a25fc0ba726,"@@ -46,7 +46,7 @@ def SeparateFlagArgs(args: list):
+ Returns:
+ A tuple with the Fire args (a list), followed by the Flag args (a list).
+ """"""
+- if len(args) > 1 and (args[-1] == '-h' or args[-1] == '--help') and '--' not in args:
++ if len(args) > 0 and (args[-1] == '-h' or args[-1] == '--help') and '--' not in args:
+ args.pop()
+ args.append('--')
+ args.append('-h')
+",clima/fire/parser.py,"ReplaceText(target='0' @(49,17)->(49,18))","def SeparateFlagArgs(args: list):
+ Returns:
+ A tuple with the Fire args (a list), followed by the Flag args (a list).
+ """"""
+ if len(args) > 1 and (args[-1] == '-h' or args[-1] == '--help') and '--' not in args:
+ args.pop()
+ args.append('--')
+ args.append('-h')","def SeparateFlagArgs(args: list):
+ Returns:
+ A tuple with the Fire args (a list), followed by the Flag args (a list).
+ """"""
+ if len(args) > 0 and (args[-1] == '-h' or args[-1] == '--help') and '--' not in args:
+ args.pop()
+ args.append('--')
+ args.append('-h')"
+585,https://:@github.com/jeffkinnison/pyrameter.git,306c95b1e0643fc47e0206281cd12c714849782d,"@@ -47,7 +47,7 @@ def backend_factory(path, *args, **kwargs):
+ if os.path.isfile(path) or os.path.isdir(path):
+ from pyrameter.db.local import JsonStorage
+ return JsonStorage(path, *args, **kwargs)
+- elif path.find('mongodb://') >= 0:
++ elif path.find('mongodb://') == 0:
+ from pyrameter.db.mongo import MongoStorage
+ return MongoStorage(path, *args, **kwargs)
+ else:
+",pyrameter/db/backend_factory.py,"ReplaceText(target='==' @(50,33)->(50,35))","def backend_factory(path, *args, **kwargs):
+ if os.path.isfile(path) or os.path.isdir(path):
+ from pyrameter.db.local import JsonStorage
+ return JsonStorage(path, *args, **kwargs)
+ elif path.find('mongodb://') >= 0:
+ from pyrameter.db.mongo import MongoStorage
+ return MongoStorage(path, *args, **kwargs)
+ else:","def backend_factory(path, *args, **kwargs):
+ if os.path.isfile(path) or os.path.isdir(path):
+ from pyrameter.db.local import JsonStorage
+ return JsonStorage(path, *args, **kwargs)
+ elif path.find('mongodb://') == 0:
+ from pyrameter.db.mongo import MongoStorage
+ return MongoStorage(path, *args, **kwargs)
+ else:"
+586,https://:@github.com/RADAR-base/pyRADAR-processing.git,2c6ea694e1d40b9c16d6a10e10c0af9afd5a3d0d,"@@ -115,7 +115,7 @@ class Project(RadarObject):
+ self.ptcs_update_info(info)
+
+ labels = kwargs.get('labels', False)
+- if info:
++ if labels:
+ for ptc in labels:
+ if ptc not in self.participants:
+ self.add_participant(ptc)
+",radar/wrappers.py,"ReplaceText(target='labels' @(118,11)->(118,15))","class Project(RadarObject):
+ self.ptcs_update_info(info)
+
+ labels = kwargs.get('labels', False)
+ if info:
+ for ptc in labels:
+ if ptc not in self.participants:
+ self.add_participant(ptc)","class Project(RadarObject):
+ self.ptcs_update_info(info)
+
+ labels = kwargs.get('labels', False)
+ if labels:
+ for ptc in labels:
+ if ptc not in self.participants:
+ self.add_participant(ptc)"
+587,https://:@github.com/marshallward/ropes.git,b8fd70b68d2ec157c7f2397aab3931e50c5a16ae,"@@ -145,7 +145,7 @@ class Rope(object):
+ else:
+ if start is None:
+ offset = index.step + (head.length - 1) % (-index.step)
+- elif start > 0:
++ elif start >= 0:
+ offset = index.step + min(start, head.length - 1) % (-index.step)
+ else:
+ offset = index.step + (start + head.length) % (-index.step)
+",ropes.py,"ReplaceText(target='>=' @(148,35)->(148,36))","class Rope(object):
+ else:
+ if start is None:
+ offset = index.step + (head.length - 1) % (-index.step)
+ elif start > 0:
+ offset = index.step + min(start, head.length - 1) % (-index.step)
+ else:
+ offset = index.step + (start + head.length) % (-index.step)","class Rope(object):
+ else:
+ if start is None:
+ offset = index.step + (head.length - 1) % (-index.step)
+ elif start >= 0:
+ offset = index.step + min(start, head.length - 1) % (-index.step)
+ else:
+ offset = index.step + (start + head.length) % (-index.step)"
+588,https://:@github.com/pkgw/bibtools.git,2273ff1a94f4f6952026c5ab1d3ddffa042f2158,"@@ -204,7 +204,7 @@ class Dump (multitool.Command):
+ help_if_no_args = False
+
+ def invoke (self, args, app=None, **kwargs):
+- if len (args) != 1:
++ if len (args) != 0:
+ raise multitool.UsageError ('expected no arguments')
+
+ app.export_all (sys.stdout, 72)
+",bibtools/cli.py,"ReplaceText(target='0' @(207,25)->(207,26))","class Dump (multitool.Command):
+ help_if_no_args = False
+
+ def invoke (self, args, app=None, **kwargs):
+ if len (args) != 1:
+ raise multitool.UsageError ('expected no arguments')
+
+ app.export_all (sys.stdout, 72)","class Dump (multitool.Command):
+ help_if_no_args = False
+
+ def invoke (self, args, app=None, **kwargs):
+ if len (args) != 0:
+ raise multitool.UsageError ('expected no arguments')
+
+ app.export_all (sys.stdout, 72)"
+589,https://:@github.com/cooper-software/hammock.git,ed682f4d33be53d7d2f2b21b384a36a2770c6cf5,"@@ -20,7 +20,7 @@ class Hammock(object):
+ entities = set()
+ self.collections_by_class_name = {}
+
+- for collection_cls in collections:
++ for collection_cls in collection_classes:
+ entities.add(collection_cls.entity)
+ collection = collection_cls(storage)
+ self.collections_by_class_name[collection_cls.__name__] = collection
+",hammock/__init__.py,"ReplaceText(target='collection_classes' @(23,24)->(23,35))","class Hammock(object):
+ entities = set()
+ self.collections_by_class_name = {}
+
+ for collection_cls in collections:
+ entities.add(collection_cls.entity)
+ collection = collection_cls(storage)
+ self.collections_by_class_name[collection_cls.__name__] = collection","class Hammock(object):
+ entities = set()
+ self.collections_by_class_name = {}
+
+ for collection_cls in collection_classes:
+ entities.add(collection_cls.entity)
+ collection = collection_cls(storage)
+ self.collections_by_class_name[collection_cls.__name__] = collection"
+590,https://:@github.com/bempp/bempp-cl.git,7ab5546ce89b626e146cb29433ed1113a3c72c9c,"@@ -97,7 +97,7 @@ def visualize_with_jupyter_notebook(obj, mode=""element"", transformation=None):
+ for element in grid.entity_iterator(0):
+ index = element.index
+ local_values = np.real(
+- transformation(obj.evaluate(element, local_coordinates))
++ transformation(obj.evaluate(index, local_coordinates))
+ )
+ values[index] = local_values.flatten()
+
+",bempp/api/external/viewers.py,"ReplaceText(target='index' @(100,44)->(100,51))","def visualize_with_jupyter_notebook(obj, mode=""element"", transformation=None):
+ for element in grid.entity_iterator(0):
+ index = element.index
+ local_values = np.real(
+ transformation(obj.evaluate(element, local_coordinates))
+ )
+ values[index] = local_values.flatten()
+ ","def visualize_with_jupyter_notebook(obj, mode=""element"", transformation=None):
+ for element in grid.entity_iterator(0):
+ index = element.index
+ local_values = np.real(
+ transformation(obj.evaluate(index, local_coordinates))
+ )
+ values[index] = local_values.flatten()
+ "
+591,https://:@github.com/bempp/bempp-cl.git,094eb06f36e837f3a17d2abe23f4bb78d1a32dc0,"@@ -91,7 +91,7 @@ def assemble_dense(
+ cols = domain.global_dof_count
+
+ nshape_test = dual_to_range.number_of_shape_functions
+- nshape_trial = dual_to_range.number_of_shape_functions
++ nshape_trial = domain.number_of_shape_functions
+
+ precision = operator_descriptor.precision
+
+",bempp/core/numba/dense_assembler.py,"ReplaceText(target='domain' @(94,19)->(94,32))","def assemble_dense(
+ cols = domain.global_dof_count
+
+ nshape_test = dual_to_range.number_of_shape_functions
+ nshape_trial = dual_to_range.number_of_shape_functions
+
+ precision = operator_descriptor.precision
+ ","def assemble_dense(
+ cols = domain.global_dof_count
+
+ nshape_test = dual_to_range.number_of_shape_functions
+ nshape_trial = domain.number_of_shape_functions
+
+ precision = operator_descriptor.precision
+ "
+592,https://:@github.com/bempp/bempp-cl.git,242da1c08304423e6ef6ead60e691928426dab1b,"@@ -1035,9 +1035,9 @@ def helmholtz_hypersingular_regular(
+ ] * (
+ curl_product[test_fun_index, trial_fun_index]
+ - wavenumber
+- * wavenumber
++ * wavenumber
+ * local_test_fun_values[
+- 0, test_fun_index, quad_point_index
++ 0, test_fun_index, test_point_index
+ ]
+ * local_trial_fun_values[
+ 0, trial_fun_index, quad_point_index
+",bempp/core/numba/kernels.py,"ReplaceText(target='test_point_index' @(1040,55)->(1040,71))","def helmholtz_hypersingular_regular(
+ ] * (
+ curl_product[test_fun_index, trial_fun_index]
+ - wavenumber
+ * wavenumber
+ * local_test_fun_values[
+ 0, test_fun_index, quad_point_index
+ ]
+ * local_trial_fun_values[
+ 0, trial_fun_index, quad_point_index","def helmholtz_hypersingular_regular(
+ ] * (
+ curl_product[test_fun_index, trial_fun_index]
+ - wavenumber
+ * wavenumber
+ * local_test_fun_values[
+ 0, test_fun_index, test_point_index
+ ]
+ * local_trial_fun_values[
+ 0, trial_fun_index, quad_point_index"
+593,https://:@github.com/bempp/bempp-cl.git,1bb4a1c097e4e3e87ed328f37cde5abd9c0c24b9,"@@ -33,7 +33,7 @@ class DensePotentialAssembler(object):
+ x_transformed = self.space.map_to_full_grid @ (
+ self.space.dof_transformation @ x
+ )
+- result = implementation(x)
++ result = implementation(x_transformed)
+ return result.reshape([kernel_dimension, -1], order=""F"")
+
+ self._evaluator = potential_evaluator
+",bempp/core/dense_potential_assembler.py,"ReplaceText(target='x_transformed' @(36,36)->(36,37))","class DensePotentialAssembler(object):
+ x_transformed = self.space.map_to_full_grid @ (
+ self.space.dof_transformation @ x
+ )
+ result = implementation(x)
+ return result.reshape([kernel_dimension, -1], order=""F"")
+
+ self._evaluator = potential_evaluator","class DensePotentialAssembler(object):
+ x_transformed = self.space.map_to_full_grid @ (
+ self.space.dof_transformation @ x
+ )
+ result = implementation(x_transformed)
+ return result.reshape([kernel_dimension, -1], order=""F"")
+
+ self._evaluator = potential_evaluator"
+594,https://:@bitbucket.org/agaveapi/agaveflask.git,17f24e257b275fe1bf64afcf6a5b09d87ab05b79,"@@ -34,7 +34,7 @@ def read_config(conf_file='service.conf'):
+ raise RuntimeError('No config file found.')
+ if not parser.parser.read(place):
+ raise RuntimeError(""couldn't read config file from {0}""
+- .format(', '.join(place)))
++ .format(', '.join(places)))
+ return parser
+
+ Config = read_config()
+\ No newline at end of file
+",agaveflask/config.py,"ReplaceText(target='places' @(37,45)->(37,50))","def read_config(conf_file='service.conf'):
+ raise RuntimeError('No config file found.')
+ if not parser.parser.read(place):
+ raise RuntimeError(""couldn't read config file from {0}""
+ .format(', '.join(place)))
+ return parser
+
+ Config = read_config()
+\ No newline at end of file","def read_config(conf_file='service.conf'):
+ raise RuntimeError('No config file found.')
+ if not parser.parser.read(place):
+ raise RuntimeError(""couldn't read config file from {0}""
+ .format(', '.join(places)))
+ return parser
+
+ Config = read_config()
+\ No newline at end of file"
+595,https://:@github.com/llazzaro/jarvispatrick.git,05457d04a6982a47c39d5109b6e91efa6441bd93,"@@ -27,7 +27,7 @@ class JarvisPatrick(object):
+ def __call__(self, number_of_neighbors, number_of_common_neighbors):
+ """"""
+ """"""
+- if number_of_common_neighbors >= number_of_neighbors:
++ if number_of_common_neighbors > number_of_neighbors:
+ raise ValueError('Asked for more common neighbors than number of neighbors')
+ neighbors_list = {}
+ for element in self.dataset_elements:
+",jarvispatrick/__init__.py,"ReplaceText(target='>' @(30,38)->(30,40))","class JarvisPatrick(object):
+ def __call__(self, number_of_neighbors, number_of_common_neighbors):
+ """"""
+ """"""
+ if number_of_common_neighbors >= number_of_neighbors:
+ raise ValueError('Asked for more common neighbors than number of neighbors')
+ neighbors_list = {}
+ for element in self.dataset_elements:","class JarvisPatrick(object):
+ def __call__(self, number_of_neighbors, number_of_common_neighbors):
+ """"""
+ """"""
+ if number_of_common_neighbors > number_of_neighbors:
+ raise ValueError('Asked for more common neighbors than number of neighbors')
+ neighbors_list = {}
+ for element in self.dataset_elements:"
+596,https://:@github.com/kennydo/oauthlib.git,1f292e6923aa9419d28e3700e22102dffd447886,"@@ -112,7 +112,7 @@ def collect_parameters(uri_query='', body='', headers=None,
+ if isinstance(k, str):
+ k = k.decode('utf-8')
+ if isinstance(v, str):
+- if v.startswith('oauth_'):
++ if k.startswith('oauth_'):
+ v = utils.unescape(v)
+ else:
+ v = v.decode('utf-8')
+",oauthlib/oauth1/rfc5849/signature.py,"ReplaceText(target='k' @(115,15)->(115,16))","def collect_parameters(uri_query='', body='', headers=None,
+ if isinstance(k, str):
+ k = k.decode('utf-8')
+ if isinstance(v, str):
+ if v.startswith('oauth_'):
+ v = utils.unescape(v)
+ else:
+ v = v.decode('utf-8')","def collect_parameters(uri_query='', body='', headers=None,
+ if isinstance(k, str):
+ k = k.decode('utf-8')
+ if isinstance(v, str):
+ if k.startswith('oauth_'):
+ v = utils.unescape(v)
+ else:
+ v = v.decode('utf-8')"
+597,https://:@github.com/kennydo/oauthlib.git,8f57459fbbab1f317d5475f31f90b1a75016a2a8,"@@ -281,7 +281,7 @@ def add_params_to_uri(uri, params, fragment=False):
+ """"""Add a list of two-tuples to the uri query components.""""""
+ sch, net, path, par, query, fra = urlparse.urlparse(uri)
+ if fragment:
+- fra = add_params_to_qs(query, params)
++ fra = add_params_to_qs(fra, params)
+ else:
+ query = add_params_to_qs(query, params)
+ return urlparse.urlunparse((sch, net, path, par, query, fra))
+",oauthlib/common.py,"ReplaceText(target='fra' @(284,31)->(284,36))","def add_params_to_uri(uri, params, fragment=False):
+ """"""Add a list of two-tuples to the uri query components.""""""
+ sch, net, path, par, query, fra = urlparse.urlparse(uri)
+ if fragment:
+ fra = add_params_to_qs(query, params)
+ else:
+ query = add_params_to_qs(query, params)
+ return urlparse.urlunparse((sch, net, path, par, query, fra))","def add_params_to_uri(uri, params, fragment=False):
+ """"""Add a list of two-tuples to the uri query components.""""""
+ sch, net, path, par, query, fra = urlparse.urlparse(uri)
+ if fragment:
+ fra = add_params_to_qs(fra, params)
+ else:
+ query = add_params_to_qs(query, params)
+ return urlparse.urlunparse((sch, net, path, par, query, fra))"
+598,https://:@github.com/jakobrunge/tigramite.git,2011867b0f0cc4c3ca6bb3317b2a3a37d828116b,"@@ -236,7 +236,7 @@ def time_bin_with_mask(data, time_bin_length, sample_selector=None):
+ sample_selector.shape = (T, 1)
+
+ bindata = numpy.zeros(
+- (T / time_bin_length,) + data.shape[1:], dtype=""float32"")
++ (T // time_bin_length,) + data.shape[1:], dtype=""float32"")
+ for index, i in enumerate(range(0, T - time_bin_length + 1,
+ time_bin_length)):
+ # print weighted_avg_and_std(fulldata[i:i+time_bin_length], axis=0,
+",tigramite/data_processing.py,"ReplaceText(target='//' @(239,11)->(239,12))","def time_bin_with_mask(data, time_bin_length, sample_selector=None):
+ sample_selector.shape = (T, 1)
+
+ bindata = numpy.zeros(
+ (T / time_bin_length,) + data.shape[1:], dtype=""float32"")
+ for index, i in enumerate(range(0, T - time_bin_length + 1,
+ time_bin_length)):
+ # print weighted_avg_and_std(fulldata[i:i+time_bin_length], axis=0,","def time_bin_with_mask(data, time_bin_length, sample_selector=None):
+ sample_selector.shape = (T, 1)
+
+ bindata = numpy.zeros(
+ (T // time_bin_length,) + data.shape[1:], dtype=""float32"")
+ for index, i in enumerate(range(0, T - time_bin_length + 1,
+ time_bin_length)):
+ # print weighted_avg_and_std(fulldata[i:i+time_bin_length], axis=0,"
+599,https://:@github.com/jakobrunge/tigramite.git,2011867b0f0cc4c3ca6bb3317b2a3a37d828116b,"@@ -528,7 +528,7 @@ class LinearMediation(Models):
+
+ def tsg_to_net(self, node, max_lag):
+ """"""Helper function to translate from time series graph to network.""""""
+- row = node / max_lag
++ row = node // max_lag
+ lag = node % max_lag
+ return (row, -lag)
+
+",tigramite/models.py,"ReplaceText(target='//' @(531,19)->(531,20))","class LinearMediation(Models):
+
+ def tsg_to_net(self, node, max_lag):
+ """"""Helper function to translate from time series graph to network.""""""
+ row = node / max_lag
+ lag = node % max_lag
+ return (row, -lag)
+ ","class LinearMediation(Models):
+
+ def tsg_to_net(self, node, max_lag):
+ """"""Helper function to translate from time series graph to network.""""""
+ row = node // max_lag
+ lag = node % max_lag
+ return (row, -lag)
+ "
+600,https://:@github.com/jakobrunge/tigramite.git,ebf5ae6ad58a416f2097bc7453df96b6ff584b17,"@@ -2577,7 +2577,7 @@ class CMIsymb(CondIndTest):
+ dim, T = symb_array.shape
+
+ # Needed because np.bincount cannot process longs
+- if isinstance(self.n_symbs ** dim, int):
++ if not isinstance(self.n_symbs ** dim, int):
+ raise ValueError(""Too many n_symbs and/or dimensions, ""
+ ""numpy.bincount cannot process longs"")
+ if self.n_symbs ** dim * 16. / 8. / 1024. ** 3 > 3.:
+",tigramite/independence_tests.py,"ReplaceText(target='not ' @(2580,11)->(2580,11))","class CMIsymb(CondIndTest):
+ dim, T = symb_array.shape
+
+ # Needed because np.bincount cannot process longs
+ if isinstance(self.n_symbs ** dim, int):
+ raise ValueError(""Too many n_symbs and/or dimensions, ""
+ ""numpy.bincount cannot process longs"")
+ if self.n_symbs ** dim * 16. / 8. / 1024. ** 3 > 3.:","class CMIsymb(CondIndTest):
+ dim, T = symb_array.shape
+
+ # Needed because np.bincount cannot process longs
+ if not isinstance(self.n_symbs ** dim, int):
+ raise ValueError(""Too many n_symbs and/or dimensions, ""
+ ""numpy.bincount cannot process longs"")
+ if self.n_symbs ** dim * 16. / 8. / 1024. ** 3 > 3.:"
+601,https://:@github.com/ontio/neo-boa.git,07ac051d44eb38ac612effd14b57af0a5b65c90e,"@@ -8,7 +8,7 @@ class SCTest(FunctionCode):
+ @staticmethod
+ def Main(a, b):
+
+- if a > b:
++ if a == b:
+
+ return True
+
+",tests/src/CompareTest2.py,"ReplaceText(target='==' @(11,13)->(11,14))","class SCTest(FunctionCode):
+ @staticmethod
+ def Main(a, b):
+
+ if a > b:
+
+ return True
+ ","class SCTest(FunctionCode):
+ @staticmethod
+ def Main(a, b):
+
+ if a == b:
+
+ return True
+ "
+602,https://:@github.com/ggventurini/python-deltasigma.git,3dd6127dc022234c4433d4e4a018942927fa417f,"@@ -59,7 +59,7 @@ def cancelPZ(arg1, tol=1e-6):
+ z = copy.copy(arg1.zeros)
+ p = copy.copy(arg1.poles)
+ k = arg1.gain
+- for i in range(max(z.shape) - 1, 0, -1):
++ for i in range(max(z.shape) - 1, -1, -1):
+ d = z[i] - p
+ cancel = np.nonzero(np.abs(d) < tol)[0]
+ if cancel.size:
+",deltasigma/_cancelPZ.py,"ReplaceText(target='-1' @(62,37)->(62,38))","def cancelPZ(arg1, tol=1e-6):
+ z = copy.copy(arg1.zeros)
+ p = copy.copy(arg1.poles)
+ k = arg1.gain
+ for i in range(max(z.shape) - 1, 0, -1):
+ d = z[i] - p
+ cancel = np.nonzero(np.abs(d) < tol)[0]
+ if cancel.size:","def cancelPZ(arg1, tol=1e-6):
+ z = copy.copy(arg1.zeros)
+ p = copy.copy(arg1.poles)
+ k = arg1.gain
+ for i in range(max(z.shape) - 1, -1, -1):
+ d = z[i] - p
+ cancel = np.nonzero(np.abs(d) < tol)[0]
+ if cancel.size:"
+603,https://:@github.com/jordens/rayopt.git,3bc56650b966e2c34d25d47af76d3b7f63110c4f,"@@ -199,7 +199,7 @@ class Analysis(object):
+ axp, axm, axsm, axss, axo = axi
+ axp.add_patch(mpl.patches.Circle((0, 0), r, edgecolor=""black"",
+ facecolor=""none""))
+- axp.text(-.1, .5, ""OY=%s"" % hi, rotation=""vertical"",
++ axo.text(-.1, .5, ""OY=%s"" % hi, rotation=""vertical"",
+ transform=axp.transAxes,
+ verticalalignment=""center"")
+ for i, (wi, ci) in enumerate(zip(wavelengths, colors)):
+",rayopt/analysis.py,"ReplaceText(target='axo' @(202,12)->(202,15))","class Analysis(object):
+ axp, axm, axsm, axss, axo = axi
+ axp.add_patch(mpl.patches.Circle((0, 0), r, edgecolor=""black"",
+ facecolor=""none""))
+ axp.text(-.1, .5, ""OY=%s"" % hi, rotation=""vertical"",
+ transform=axp.transAxes,
+ verticalalignment=""center"")
+ for i, (wi, ci) in enumerate(zip(wavelengths, colors)):","class Analysis(object):
+ axp, axm, axsm, axss, axo = axi
+ axp.add_patch(mpl.patches.Circle((0, 0), r, edgecolor=""black"",
+ facecolor=""none""))
+ axo.text(-.1, .5, ""OY=%s"" % hi, rotation=""vertical"",
+ transform=axp.transAxes,
+ verticalalignment=""center"")
+ for i, (wi, ci) in enumerate(zip(wavelengths, colors)):"
+604,https://:@github.com/jordens/rayopt.git,0d5689d0c36fa3aec836c7869e169f4bc4b1a72f,"@@ -333,7 +333,7 @@ class System(list):
+ c = getattr(el, ""curvature"", 0)
+ if pending is not None:
+ r = max(el.radius, pending.radius)
+- if c < 0:
++ if c <= 0:
+ el.radius = r
+ if c0 > 0:
+ pending.radius = r
+",rayopt/system.py,"ReplaceText(target='<=' @(336,21)->(336,22))","class System(list):
+ c = getattr(el, ""curvature"", 0)
+ if pending is not None:
+ r = max(el.radius, pending.radius)
+ if c < 0:
+ el.radius = r
+ if c0 > 0:
+ pending.radius = r","class System(list):
+ c = getattr(el, ""curvature"", 0)
+ if pending is not None:
+ r = max(el.radius, pending.radius)
+ if c <= 0:
+ el.radius = r
+ if c0 > 0:
+ pending.radius = r"
+605,https://:@github.com/pantherlab/v2d-cli.git,fe2f6fe46f14778cfcb74852d817d1876d171352,"@@ -92,7 +92,7 @@ def main():
+ print('Similar domains to {}'.format(dom))
+ domains.difference_update(set(dom))
+ for d in domains:
+- print_diff(d, args.domain)
++ print_diff(args.domain, d)
+ if write:
+ f.write(d + ""\n"")
+ if (args.check):
+",v2d/main.py,"ArgSwap(idxs=0<->1 @(95,16)->(95,26))","def main():
+ print('Similar domains to {}'.format(dom))
+ domains.difference_update(set(dom))
+ for d in domains:
+ print_diff(d, args.domain)
+ if write:
+ f.write(d + ""\n"")
+ if (args.check):","def main():
+ print('Similar domains to {}'.format(dom))
+ domains.difference_update(set(dom))
+ for d in domains:
+ print_diff(args.domain, d)
+ if write:
+ f.write(d + ""\n"")
+ if (args.check):"
+606,https://:@github.com/xtimon/inipgdump.git,47c9bf35a256ee9c6caa0aeb6913a5e80cc15d23,"@@ -92,7 +92,7 @@ def main():
+ if not os.path.isdir(dump_dir):
+ print('Folder \'%s\' not found' % dump_dir)
+ sys.exit(1)
+- if keep_count <= 0:
++ if keep_count < 0:
+ print('keep_count must be greater than 0')
+ sys.exit(1)
+ make_dump(conf_file, dump_dir, keep_count)
+",inipgdump/core.py,"ReplaceText(target='<' @(95,18)->(95,20))","def main():
+ if not os.path.isdir(dump_dir):
+ print('Folder \'%s\' not found' % dump_dir)
+ sys.exit(1)
+ if keep_count <= 0:
+ print('keep_count must be greater than 0')
+ sys.exit(1)
+ make_dump(conf_file, dump_dir, keep_count)","def main():
+ if not os.path.isdir(dump_dir):
+ print('Folder \'%s\' not found' % dump_dir)
+ sys.exit(1)
+ if keep_count < 0:
+ print('keep_count must be greater than 0')
+ sys.exit(1)
+ make_dump(conf_file, dump_dir, keep_count)"
+607,https://:@github.com/dogebuild/dogebuild.git,5fbc92cbf6aceb4a99374e5e19208b3889c36628,"@@ -14,7 +14,7 @@ class Doge:
+ plugin_full_name = self.contrib_name + '-' + plugin_name
+ plugin_package = self.contrib_name + '_' + plugin_name
+
+- if not self.check_plugin_installed(plugin_full_name):
++ if not self.check_plugin_installed(plugin_package):
+ self.pip.install(plugin_full_name) # ???
+
+ file, path, desc = self.find_dotted_module(plugin_package + '.loader')
+",dogebuild/Doge.py,"ReplaceText(target='plugin_package' @(17,43)->(17,59))","class Doge:
+ plugin_full_name = self.contrib_name + '-' + plugin_name
+ plugin_package = self.contrib_name + '_' + plugin_name
+
+ if not self.check_plugin_installed(plugin_full_name):
+ self.pip.install(plugin_full_name) # ???
+
+ file, path, desc = self.find_dotted_module(plugin_package + '.loader')","class Doge:
+ plugin_full_name = self.contrib_name + '-' + plugin_name
+ plugin_package = self.contrib_name + '_' + plugin_name
+
+ if not self.check_plugin_installed(plugin_package):
+ self.pip.install(plugin_full_name) # ???
+
+ file, path, desc = self.find_dotted_module(plugin_package + '.loader')"
+608,https://:@github.com/jiosue/qubovert.git,11782cc691038742a250ee53b863c413f28b6455,"@@ -329,7 +329,7 @@ class DictArithmetic(dict):
+ for k, v in other.items():
+ self[k] -= v
+ else:
+- self[()] -= v
++ self[()] -= other
+ return self
+
+ def __mul__(self, other):
+",qubovert/utils/_dict_arithmetic.py,"ReplaceText(target='other' @(332,24)->(332,25))","class DictArithmetic(dict):
+ for k, v in other.items():
+ self[k] -= v
+ else:
+ self[()] -= v
+ return self
+
+ def __mul__(self, other):","class DictArithmetic(dict):
+ for k, v in other.items():
+ self[k] -= v
+ else:
+ self[()] -= other
+ return self
+
+ def __mul__(self, other):"
+609,https://:@github.com/jiosue/qubovert.git,ad39ad11cea1cd2ca8f82a23b21990cd0e758915,"@@ -323,7 +323,7 @@ class SpinSimulation:
+ # the change in energy from flipping variable i is equal to
+ # -2 * (the energy of the subgraph depending on i)
+ dE = -2 * puso_value(self._state, self._subgraphs[i])
+- if dE < 0 or (T and random.random() < exp(-dE / T)):
++ if dE <= 0 or (T and random.random() < exp(-dE / T)):
+ self._flip_bit(i)
+
+
+",qubovert/sim/_simulations.py,"ReplaceText(target='<=' @(326,22)->(326,23))","class SpinSimulation:
+ # the change in energy from flipping variable i is equal to
+ # -2 * (the energy of the subgraph depending on i)
+ dE = -2 * puso_value(self._state, self._subgraphs[i])
+ if dE < 0 or (T and random.random() < exp(-dE / T)):
+ self._flip_bit(i)
+
+ ","class SpinSimulation:
+ # the change in energy from flipping variable i is equal to
+ # -2 * (the energy of the subgraph depending on i)
+ dE = -2 * puso_value(self._state, self._subgraphs[i])
+ if dE <= 0 or (T and random.random() < exp(-dE / T)):
+ self._flip_bit(i)
+
+ "
+610,https://:@github.com/gjo/colander_jsonschema.git,14d7446b85b8faf56705047146a62f10981c0bf7,"@@ -124,7 +124,7 @@ class ValidatorConversionDispatcher(object):
+ if isinstance(validator, colander.All):
+ converted = {}
+ for v in validator.validators:
+- ret = self(schema_node, validator)
++ ret = self(schema_node, v)
+ converted.update(ret)
+ return converted
+
+",colander_jsonschema/__init__.py,"ReplaceText(target='v' @(127,40)->(127,49))","class ValidatorConversionDispatcher(object):
+ if isinstance(validator, colander.All):
+ converted = {}
+ for v in validator.validators:
+ ret = self(schema_node, validator)
+ converted.update(ret)
+ return converted
+ ","class ValidatorConversionDispatcher(object):
+ if isinstance(validator, colander.All):
+ converted = {}
+ for v in validator.validators:
+ ret = self(schema_node, v)
+ converted.update(ret)
+ return converted
+ "
+611,https://:@github.com/ucl-exoplanets/TauREx3_public.git,fdfa8c4e1d29dc715c7f42d55c21c0d911390a83,"@@ -127,7 +127,7 @@ def main():
+
+ wlgrid = np.log10(10000/bindown_wngrid)
+ if args.plot:
+- if get_rank()==0 and nprocs()==1:
++ if get_rank()==0 and nprocs()<=1:
+ import matplotlib.pyplot as plt
+ if args.contrib:
+ for name,value in contrib:
+",taurex/taurex.py,"ReplaceText(target='<=' @(130,38)->(130,40))","def main():
+
+ wlgrid = np.log10(10000/bindown_wngrid)
+ if args.plot:
+ if get_rank()==0 and nprocs()==1:
+ import matplotlib.pyplot as plt
+ if args.contrib:
+ for name,value in contrib:","def main():
+
+ wlgrid = np.log10(10000/bindown_wngrid)
+ if args.plot:
+ if get_rank()==0 and nprocs()<=1:
+ import matplotlib.pyplot as plt
+ if args.contrib:
+ for name,value in contrib:"
+612,https://:@github.com/ucl-exoplanets/TauREx3_public.git,b159dcc22b3e753aaea101031b3c8df14e5affdc,"@@ -135,7 +135,7 @@ def main():
+ priors = {}
+ priors['Profiles'] = profiles
+ priors['Spectra'] = spectrum
+- out.store_dictionary(solution,group_name='Priors')
++ out.store_dictionary(priors,group_name='Priors')
+ else:
+ out.store_dictionary(profiles,group_name='Profiles')
+ out.store_dictionary(spectrum,group_name='Spectra')
+",taurex/taurex.py,"ReplaceText(target='priors' @(138,37)->(138,45))","def main():
+ priors = {}
+ priors['Profiles'] = profiles
+ priors['Spectra'] = spectrum
+ out.store_dictionary(solution,group_name='Priors')
+ else:
+ out.store_dictionary(profiles,group_name='Profiles')
+ out.store_dictionary(spectrum,group_name='Spectra')","def main():
+ priors = {}
+ priors['Profiles'] = profiles
+ priors['Spectra'] = spectrum
+ out.store_dictionary(priors,group_name='Priors')
+ else:
+ out.store_dictionary(profiles,group_name='Profiles')
+ out.store_dictionary(spectrum,group_name='Spectra')"
+613,https://:@github.com/ucl-exoplanets/TauREx3_public.git,1aa67f68d7086afcf2390add80728193d7a9024e,"@@ -13,7 +13,7 @@ def nprocs():
+ try:
+ from mpi4py import MPI
+ except ImportError:
+- return 0
++ return 1
+
+ comm = MPI.COMM_WORLD
+
+",taurex/mpi.py,"ReplaceText(target='1' @(16,15)->(16,16))","def nprocs():
+ try:
+ from mpi4py import MPI
+ except ImportError:
+ return 0
+
+ comm = MPI.COMM_WORLD
+ ","def nprocs():
+ try:
+ from mpi4py import MPI
+ except ImportError:
+ return 1
+
+ comm = MPI.COMM_WORLD
+ "
+614,https://:@github.com/sjoerdk/yeahyeah.git,11a1a12a02c9fea724f0dc4072b5e86e688e33fd,"@@ -66,7 +66,7 @@ def add(context: ClockifyPluginContext, message, project, time):
+ project_obj = None
+
+ log_start = time
+- click.echo(f""Adding {message} at {as_local(log_start)} to project {project}"")
++ click.echo(f""Adding {message} at {as_local(log_start)} to project {project_obj}"")
+ context.session.add_time_entry(
+ start_time=time, description=message, project=project_obj
+ )
+",plugins/clockify_plugin/cli.py,"ReplaceText(target='project_obj' @(69,71)->(69,78))","def add(context: ClockifyPluginContext, message, project, time):
+ project_obj = None
+
+ log_start = time
+ click.echo(f""Adding {message} at {as_local(log_start)} to project {project}"")
+ context.session.add_time_entry(
+ start_time=time, description=message, project=project_obj
+ )","def add(context: ClockifyPluginContext, message, project, time):
+ project_obj = None
+
+ log_start = time
+ click.echo(f""Adding {message} at {as_local(log_start)} to project {project_obj}"")
+ context.session.add_time_entry(
+ start_time=time, description=message, project=project_obj
+ )"
+615,https://:@bitbucket.org/synerty/peek-plugin-graphdb.git,c47b1c7df8ba01b9a47a9afda0f1c1f829517990,"@@ -58,7 +58,7 @@ class PackedSegmentTupleProvider(TuplesProviderABC):
+
+ # Create the new object
+ foundDocuments.append(GraphDbPackedSegmentTuple(
+- key=key,
++ key=subKey,
+ packedJson=segmentsByKey[subKey]
+ ))
+
+",peek_plugin_graphdb/_private/client/tuple_providers/PackedSegmentTupleProvider.py,"ReplaceText(target='subKey' @(61,24)->(61,27))","class PackedSegmentTupleProvider(TuplesProviderABC):
+
+ # Create the new object
+ foundDocuments.append(GraphDbPackedSegmentTuple(
+ key=key,
+ packedJson=segmentsByKey[subKey]
+ ))
+ ","class PackedSegmentTupleProvider(TuplesProviderABC):
+
+ # Create the new object
+ foundDocuments.append(GraphDbPackedSegmentTuple(
+ key=subKey,
+ packedJson=segmentsByKey[subKey]
+ ))
+ "
+616,https://:@github.com/ihgazni2/ematmap.git,d6f160d8c7b85fdca2d552ca6de1c1c3c75b3245,"@@ -50,7 +50,7 @@ def get_matsize(m):
+ size = 0
+ depth = len(m)
+ for i in range(depth):
+- layer = m[depth]
++ layer = m[i]
+ lngth = len(layer)
+ for j in range(lngth):
+ size = size + 1
+",ematmap/utils.py,"ReplaceText(target='i' @(53,18)->(53,23))","def get_matsize(m):
+ size = 0
+ depth = len(m)
+ for i in range(depth):
+ layer = m[depth]
+ lngth = len(layer)
+ for j in range(lngth):
+ size = size + 1","def get_matsize(m):
+ size = 0
+ depth = len(m)
+ for i in range(depth):
+ layer = m[i]
+ lngth = len(layer)
+ for j in range(lngth):
+ size = size + 1"
+617,https://:@github.com/ndawe/goodruns.git,fa5a7a24b6ebaa80141a0fd5b887e61eeb60d0d0,"@@ -258,7 +258,7 @@ class GRL(object):
+ version = root.find('NamedLumiRange/Version')
+ if version is not None:
+ self.version = version.text
+- self.metadata = root.findall('NamedLumiRange/Metadata')
++ self.metadata += root.findall('NamedLumiRange/Metadata')
+ lbcols = root.findall(
+ 'NamedLumiRange/LumiBlockCollection')
+ for lbcol in lbcols:
+",goodruns/grl.py,"ReplaceText(target='+=' @(261,22)->(261,23))","class GRL(object):
+ version = root.find('NamedLumiRange/Version')
+ if version is not None:
+ self.version = version.text
+ self.metadata = root.findall('NamedLumiRange/Metadata')
+ lbcols = root.findall(
+ 'NamedLumiRange/LumiBlockCollection')
+ for lbcol in lbcols:","class GRL(object):
+ version = root.find('NamedLumiRange/Version')
+ if version is not None:
+ self.version = version.text
+ self.metadata += root.findall('NamedLumiRange/Metadata')
+ lbcols = root.findall(
+ 'NamedLumiRange/LumiBlockCollection')
+ for lbcol in lbcols:"
+618,https://:@github.com/churchill-lab/scBASE.git,456bacc4227fd3ccb5a901a205b0add65f9d8dfc,"@@ -37,7 +37,7 @@ except NameError:
+
+ def select(loomfile, min_read_count, min_cell_count, layer):
+ with loompy.connect(loomfile) as ds:
+- gsurv = (ds.sparse(layer=layer) >= min_read_count).sum(axis=1) > min_cell_count
++ gsurv = (ds.sparse(layer=layer) >= min_read_count).sum(axis=1) >= min_cell_count
+ ds.ra.Selected = np.squeeze(np.asarray(gsurv))
+ LOG.info('Total %d genes selected' % gsurv.sum())
+ # totals = ds.map([np.sum], axis=1)[0] # Select based upon cell size?
+",scbase/scbase.py,"ReplaceText(target='>=' @(40,71)->(40,72))","except NameError:
+
+ def select(loomfile, min_read_count, min_cell_count, layer):
+ with loompy.connect(loomfile) as ds:
+ gsurv = (ds.sparse(layer=layer) >= min_read_count).sum(axis=1) > min_cell_count
+ ds.ra.Selected = np.squeeze(np.asarray(gsurv))
+ LOG.info('Total %d genes selected' % gsurv.sum())
+ # totals = ds.map([np.sum], axis=1)[0] # Select based upon cell size?","except NameError:
+
+ def select(loomfile, min_read_count, min_cell_count, layer):
+ with loompy.connect(loomfile) as ds:
+ gsurv = (ds.sparse(layer=layer) >= min_read_count).sum(axis=1) >= min_cell_count
+ ds.ra.Selected = np.squeeze(np.asarray(gsurv))
+ LOG.info('Total %d genes selected' % gsurv.sum())
+ # totals = ds.map([np.sum], axis=1)[0] # Select based upon cell size?"
+619,https://:@github.com/glottolog/treedb.git,af327b021d5aa5ee8c593903f663f5653181217d,"@@ -48,7 +48,7 @@ def iterrecords(bind=ENGINE, windowsize=WINDOWSIZE, skip_unknown=True):
+ with bind.connect() as conn:
+ select_files.bind = conn
+ select_values.bind = conn
+- for in_slice in window_slices(File.id, size=windowsize, bind=bind):
++ for in_slice in window_slices(File.id, size=windowsize, bind=conn):
+ if log.level <= logging.DEBUG:
+ where = literal_compile(in_slice(File.id))
+ log.debug('fetch rows %r', where.string)
+",treedb/raw/records.py,"ReplaceText(target='conn' @(51,69)->(51,73))","def iterrecords(bind=ENGINE, windowsize=WINDOWSIZE, skip_unknown=True):
+ with bind.connect() as conn:
+ select_files.bind = conn
+ select_values.bind = conn
+ for in_slice in window_slices(File.id, size=windowsize, bind=bind):
+ if log.level <= logging.DEBUG:
+ where = literal_compile(in_slice(File.id))
+ log.debug('fetch rows %r', where.string)","def iterrecords(bind=ENGINE, windowsize=WINDOWSIZE, skip_unknown=True):
+ with bind.connect() as conn:
+ select_files.bind = conn
+ select_values.bind = conn
+ for in_slice in window_slices(File.id, size=windowsize, bind=conn):
+ if log.level <= logging.DEBUG:
+ where = literal_compile(in_slice(File.id))
+ log.debug('fetch rows %r', where.string)"
+620,https://:@github.com/funkybob/django-rated.git,4c68393abfdbb42030e0211c8c99ac8f2fa251d0,"@@ -14,7 +14,7 @@ class RatedMiddleware(object):
+ def process_view(self, request, view_func, view_args, view_kwargs):
+ # Try to determine the realm for this view
+ try:
+- realm = request._rated_realm
++ realm = view_func._rated_realm
+ except AttributeError:
+ try:
+ realm = settings.REALM_MAP[request.resolver_match.url_name]
+",rated/middleware.py,"ReplaceText(target='view_func' @(17,20)->(17,27))","class RatedMiddleware(object):
+ def process_view(self, request, view_func, view_args, view_kwargs):
+ # Try to determine the realm for this view
+ try:
+ realm = request._rated_realm
+ except AttributeError:
+ try:
+ realm = settings.REALM_MAP[request.resolver_match.url_name]","class RatedMiddleware(object):
+ def process_view(self, request, view_func, view_args, view_kwargs):
+ # Try to determine the realm for this view
+ try:
+ realm = view_func._rated_realm
+ except AttributeError:
+ try:
+ realm = settings.REALM_MAP[request.resolver_match.url_name]"
+621,https://:@github.com/StevenGolovkine/FDApy.git,f1768ccf93593162be890f8685027b9d9a1d3ad2,"@@ -25,7 +25,7 @@ def _check_argvals(argvals):
+ ------
+ argvals : list of numpy.ndarray
+ """"""
+- if isinstance(argvals, (np.ndarray, list)):
++ if not isinstance(argvals, (np.ndarray, list)):
+ raise ValueError(
+ 'argvals has to be a list of numpy.ndarray or a numpy.ndarray!')
+ # TODO: Modify the condition to accept multidimensional irregular
+",FDApy/irregular_functional.py,"ReplaceText(target='not ' @(28,7)->(28,7))","def _check_argvals(argvals):
+ ------
+ argvals : list of numpy.ndarray
+ """"""
+ if isinstance(argvals, (np.ndarray, list)):
+ raise ValueError(
+ 'argvals has to be a list of numpy.ndarray or a numpy.ndarray!')
+ # TODO: Modify the condition to accept multidimensional irregular","def _check_argvals(argvals):
+ ------
+ argvals : list of numpy.ndarray
+ """"""
+ if not isinstance(argvals, (np.ndarray, list)):
+ raise ValueError(
+ 'argvals has to be a list of numpy.ndarray or a numpy.ndarray!')
+ # TODO: Modify the condition to accept multidimensional irregular"
+622,https://:@github.com/StevenGolovkine/FDApy.git,f1768ccf93593162be890f8685027b9d9a1d3ad2,"@@ -30,7 +30,7 @@ def _check_argvals(argvals):
+ ------
+ argvals : list of numpy.ndarray
+ """"""
+- if isinstance(argvals, (np.ndarray, list)):
++ if not isinstance(argvals, (np.ndarray, list)):
+ raise ValueError(
+ 'argvals has to be a list of numpy.ndarray or a numpy.ndarray!')
+ if isinstance(argvals, list) and \
+",FDApy/univariate_functional.py,"ReplaceText(target='not ' @(33,7)->(33,7))","def _check_argvals(argvals):
+ ------
+ argvals : list of numpy.ndarray
+ """"""
+ if isinstance(argvals, (np.ndarray, list)):
+ raise ValueError(
+ 'argvals has to be a list of numpy.ndarray or a numpy.ndarray!')
+ if isinstance(argvals, list) and \","def _check_argvals(argvals):
+ ------
+ argvals : list of numpy.ndarray
+ """"""
+ if not isinstance(argvals, (np.ndarray, list)):
+ raise ValueError(
+ 'argvals has to be a list of numpy.ndarray or a numpy.ndarray!')
+ if isinstance(argvals, list) and \"
+623,https://:@github.com/StevenGolovkine/FDApy.git,4fbe69f439588f469d858b25c3d063e02b45ed97,"@@ -24,9 +24,9 @@ def _check_data(data):
+ ------
+ data : list of UnivariateFunctionalData ot IrregularFunctionalData
+ """"""
+- if isinstance(data, (list,
+- UnivariateFunctionalData,
+- IrregularFunctionalData)):
++ if not isinstance(data, (list,
++ UnivariateFunctionalData,
++ IrregularFunctionalData)):
+ raise ValueError(
+ """"""Data has to be a list or elements of UnivariateFunctionalData
+ or IrregularFunctionalData!"""""")
+",FDApy/multivariate_functional.py,"ReplaceText(target='not ' @(27,7)->(27,7))","def _check_data(data):
+ ------
+ data : list of UnivariateFunctionalData ot IrregularFunctionalData
+ """"""
+ if isinstance(data, (list,
+ UnivariateFunctionalData,
+ IrregularFunctionalData)):
+ raise ValueError(
+ """"""Data has to be a list or elements of UnivariateFunctionalData
+ or IrregularFunctionalData!"""""")","def _check_data(data):
+ ------
+ data : list of UnivariateFunctionalData ot IrregularFunctionalData
+ """"""
+ if not isinstance(data, (list,
+ UnivariateFunctionalData,
+ IrregularFunctionalData)):
+ raise ValueError(
+ """"""Data has to be a list or elements of UnivariateFunctionalData
+ or IrregularFunctionalData!"""""")"
+624,https://:@github.com/StevenGolovkine/FDApy.git,a671e9da96d43a8cd21778b535374dce8942e7da,"@@ -1075,7 +1075,7 @@ class IrregularFunctionalData(FunctionalData):
+ bandwidth=b,
+ degree=degree)
+ pred = lp.fit_predict(arg, val, points_estim)
+- smooth_argvals[i] = arg
++ smooth_argvals[i] = points_estim
+ smooth_values[i] = pred
+ return IrregularFunctionalData({'input_dim_0': smooth_argvals},
+ smooth_values)
+",FDApy/representation/functional_data.py,"ReplaceText(target='points_estim' @(1078,32)->(1078,35))","class IrregularFunctionalData(FunctionalData):
+ bandwidth=b,
+ degree=degree)
+ pred = lp.fit_predict(arg, val, points_estim)
+ smooth_argvals[i] = arg
+ smooth_values[i] = pred
+ return IrregularFunctionalData({'input_dim_0': smooth_argvals},
+ smooth_values)","class IrregularFunctionalData(FunctionalData):
+ bandwidth=b,
+ degree=degree)
+ pred = lp.fit_predict(arg, val, points_estim)
+ smooth_argvals[i] = points_estim
+ smooth_values[i] = pred
+ return IrregularFunctionalData({'input_dim_0': smooth_argvals},
+ smooth_values)"
+625,https://:@github.com/Flowminder/pytest-airflow.git,47c128f0affa875e4baed2f7223fcd0747f3bb55,"@@ -138,7 +138,7 @@ def _task_gen(item, **kwds):
+ provide_context=True,
+ dag=dag,
+ )
+- dag.set_dependency(task_id, ""__pytest_branch"")
++ dag.set_dependency(""__pytest_branch"", task_id)
+ return task
+
+
+",pytest_airflow/plugin.py,"ArgSwap(idxs=0<->1 @(141,4)->(141,22))","def _task_gen(item, **kwds):
+ provide_context=True,
+ dag=dag,
+ )
+ dag.set_dependency(task_id, ""__pytest_branch"")
+ return task
+
+ ","def _task_gen(item, **kwds):
+ provide_context=True,
+ dag=dag,
+ )
+ dag.set_dependency(""__pytest_branch"", task_id)
+ return task
+
+ "
+626,https://:@github.com/datadrivencontrol/pyvrft.git,d21df29ac62c08e4de3bfbcc1c01a6943cfe78fe,"@@ -77,7 +77,7 @@ def design(u,y,y_iv,Td,C,L):
+ y_iv=y_iv[0:N,:]
+ # virtual error
+ ebar=rv-y
+- ebar_iv=rv-y_iv
++ ebar_iv=rv_iv-y_iv
+ # remove the last samples of the input (to match the dimension of the virtual error)
+ uf=uf[0:N,:]
+
+",vrft/control.py,"ReplaceText(target='rv_iv' @(80,16)->(80,18))","def design(u,y,y_iv,Td,C,L):
+ y_iv=y_iv[0:N,:]
+ # virtual error
+ ebar=rv-y
+ ebar_iv=rv-y_iv
+ # remove the last samples of the input (to match the dimension of the virtual error)
+ uf=uf[0:N,:]
+ ","def design(u,y,y_iv,Td,C,L):
+ y_iv=y_iv[0:N,:]
+ # virtual error
+ ebar=rv-y
+ ebar_iv=rv_iv-y_iv
+ # remove the last samples of the input (to match the dimension of the virtual error)
+ uf=uf[0:N,:]
+ "
+627,https://:@github.com/onecommons/unfurl.git,c7b04c15dc919919696f6d20fef4465c25fda6d3,"@@ -67,7 +67,7 @@ class Resource(object):
+
+ @property
+ def root(self):
+- return self.ancestors[0]
++ return self.ancestors[-1]
+
+ def __getitem__(self, name):
+ if not name:
+",giterop/resource.py,"ReplaceText(target='-1' @(70,26)->(70,27))","class Resource(object):
+
+ @property
+ def root(self):
+ return self.ancestors[0]
+
+ def __getitem__(self, name):
+ if not name:","class Resource(object):
+
+ @property
+ def root(self):
+ return self.ancestors[-1]
+
+ def __getitem__(self, name):
+ if not name:"
+628,https://:@github.com/onecommons/unfurl.git,7b9fe40414b2646ba7ee98e1f7ab770feed1c80a,"@@ -336,7 +336,7 @@ Returns:
+ if not configSpec:
+ raise UnfurlError(
+ 'unable to find an implementation to ""%s"" ""%s"" on """"%s"": %s'
+- % (action, resource.template.name, resource.template.name, reason)
++ % (action, resource.template.name, resource.template.name, notfoundmsg)
+ )
+ logger.debug(
+ ""creating configuration %s with %s to run for %s: %s"",
+",unfurl/plan.py,"ReplaceText(target='notfoundmsg' @(339,75)->(339,81))","Returns:
+ if not configSpec:
+ raise UnfurlError(
+ 'unable to find an implementation to ""%s"" ""%s"" on """"%s"": %s'
+ % (action, resource.template.name, resource.template.name, reason)
+ )
+ logger.debug(
+ ""creating configuration %s with %s to run for %s: %s"",","Returns:
+ if not configSpec:
+ raise UnfurlError(
+ 'unable to find an implementation to ""%s"" ""%s"" on """"%s"": %s'
+ % (action, resource.template.name, resource.template.name, notfoundmsg)
+ )
+ logger.debug(
+ ""creating configuration %s with %s to run for %s: %s"","
+629,https://:@github.com/heartexlabs/label-studio-evalme.git,9b7f13ab32802d5ef602d1c4f9399e949b9f3df8,"@@ -35,7 +35,7 @@ class HTMLTagsEvalItem(EvalItem):
+
+
+ def _as_html_tags_eval_item(item):
+- if not isinstance(HTMLTagsEvalItem, item):
++ if not isinstance(item, HTMLTagsEvalItem):
+ return HTMLTagsEvalItem(item)
+ return item
+
+",evalme/text/text.py,"ArgSwap(idxs=0<->1 @(38,11)->(38,21))","class HTMLTagsEvalItem(EvalItem):
+
+
+ def _as_html_tags_eval_item(item):
+ if not isinstance(HTMLTagsEvalItem, item):
+ return HTMLTagsEvalItem(item)
+ return item
+ ","class HTMLTagsEvalItem(EvalItem):
+
+
+ def _as_html_tags_eval_item(item):
+ if not isinstance(item, HTMLTagsEvalItem):
+ return HTMLTagsEvalItem(item)
+ return item
+ "
+630,https://:@github.com/parlance/ctcdecode.git,1a35bb5fc07eee0c9939fdf824fa8158ec52499a,"@@ -20,7 +20,7 @@ class CTCBeamDecoder(object):
+ def decode(self, probs, seq_lens):
+ # We expect batch x seq x label_size
+ probs = probs.cpu().float()
+- seq_lens = probs.cpu().int()
++ seq_lens = seq_lens.cpu().int()
+ batch_size, max_seq_len = probs.size(0), probs.size(1)
+ output = torch.IntTensor(batch_size, self._beam_width, max_seq_len).cpu().int()
+ timesteps = torch.IntTensor(batch_size, self._beam_width, max_seq_len).cpu().int()
+",ctcdecode/__init__.py,"ReplaceText(target='seq_lens' @(23,19)->(23,24))","class CTCBeamDecoder(object):
+ def decode(self, probs, seq_lens):
+ # We expect batch x seq x label_size
+ probs = probs.cpu().float()
+ seq_lens = probs.cpu().int()
+ batch_size, max_seq_len = probs.size(0), probs.size(1)
+ output = torch.IntTensor(batch_size, self._beam_width, max_seq_len).cpu().int()
+ timesteps = torch.IntTensor(batch_size, self._beam_width, max_seq_len).cpu().int()","class CTCBeamDecoder(object):
+ def decode(self, probs, seq_lens):
+ # We expect batch x seq x label_size
+ probs = probs.cpu().float()
+ seq_lens = seq_lens.cpu().int()
+ batch_size, max_seq_len = probs.size(0), probs.size(1)
+ output = torch.IntTensor(batch_size, self._beam_width, max_seq_len).cpu().int()
+ timesteps = torch.IntTensor(batch_size, self._beam_width, max_seq_len).cpu().int()"
+631,https://:@github.com/benmaier/binpacking.git,6ada2c62c319d56cd0f5918a2f01ff61d0e45348,"@@ -107,7 +107,7 @@ def to_constant_bin_number(d,N_bin,weight_pos=None,lower_bound=None,upper_bound=
+ while not found_bin:
+
+ #if this weight fits in the bin
+- if new_weight_sum < V_bin_max:
++ if new_weight_sum <= V_bin_max:
+
+ #...put it in
+ if isdict:
+",binpacking/to_constant_bin_number.py,"ReplaceText(target='<=' @(110,30)->(110,31))","def to_constant_bin_number(d,N_bin,weight_pos=None,lower_bound=None,upper_bound=
+ while not found_bin:
+
+ #if this weight fits in the bin
+ if new_weight_sum < V_bin_max:
+
+ #...put it in
+ if isdict:","def to_constant_bin_number(d,N_bin,weight_pos=None,lower_bound=None,upper_bound=
+ while not found_bin:
+
+ #if this weight fits in the bin
+ if new_weight_sum <= V_bin_max:
+
+ #...put it in
+ if isdict:"
+632,https://:@github.com/amatino-code/nozomi.git,dc608f09a68fc8972f563e2b9974692581d40efc,"@@ -257,7 +257,7 @@ integers'.format(
+ min_value=min_value
+ ))
+
+- return values
++ return validated
+
+ def optionally_parse_bool(
+ self,
+",nozomi/http/parseable_data.py,"ReplaceText(target='validated' @(260,15)->(260,21))","integers'.format(
+ min_value=min_value
+ ))
+
+ return values
+
+ def optionally_parse_bool(
+ self,","integers'.format(
+ min_value=min_value
+ ))
+
+ return validated
+
+ def optionally_parse_bool(
+ self,"
+633,https://:@github.com/amatino-code/nozomi.git,b486a1109ac83dcabb4022d071644cadc4734769,"@@ -70,7 +70,7 @@ class Resource:
+ if not candidate.grants_read_to(unauthorised_agent):
+ raise NotAuthorised
+ continue
+- return broadcast_candidate
++ return unauthorised_agent
+
+ if not broadcast_candidate.grants_read_to(unauthorised_agent):
+ raise NotAuthorised
+",nozomi/resources/resource.py,"ReplaceText(target='unauthorised_agent' @(73,19)->(73,38))","class Resource:
+ if not candidate.grants_read_to(unauthorised_agent):
+ raise NotAuthorised
+ continue
+ return broadcast_candidate
+
+ if not broadcast_candidate.grants_read_to(unauthorised_agent):
+ raise NotAuthorised","class Resource:
+ if not candidate.grants_read_to(unauthorised_agent):
+ raise NotAuthorised
+ continue
+ return unauthorised_agent
+
+ if not broadcast_candidate.grants_read_to(unauthorised_agent):
+ raise NotAuthorised"
+634,https://:@github.com/Puumanamana/CoCoNet.git,5e966cbf19199b62e265f1320a5e60a0cdb2e26e,"@@ -54,7 +54,7 @@ def make_positive_pairs(label, frag_steps, contig_frags, fppc, encoding_len=128)
+ if k < fppc:
+ # print(""WARNING: cannot make {} unique pairs with genome of {} fragments"".format(fppc, contig_frags), end='\r')
+ pairs.sp = np.tile(label, [fppc, 2])
+- pairs.start = np.random.choice(frag_steps, [fppc, 2])
++ pairs.start = np.random.choice(contig_frags, [fppc, 2])
+ pairs.end = pairs.start + frag_steps
+
+ return pairs
+",coconet/fragmentation.py,"ReplaceText(target='contig_frags' @(57,39)->(57,49))","def make_positive_pairs(label, frag_steps, contig_frags, fppc, encoding_len=128)
+ if k < fppc:
+ # print(""WARNING: cannot make {} unique pairs with genome of {} fragments"".format(fppc, contig_frags), end='\r')
+ pairs.sp = np.tile(label, [fppc, 2])
+ pairs.start = np.random.choice(frag_steps, [fppc, 2])
+ pairs.end = pairs.start + frag_steps
+
+ return pairs","def make_positive_pairs(label, frag_steps, contig_frags, fppc, encoding_len=128)
+ if k < fppc:
+ # print(""WARNING: cannot make {} unique pairs with genome of {} fragments"".format(fppc, contig_frags), end='\r')
+ pairs.sp = np.tile(label, [fppc, 2])
+ pairs.start = np.random.choice(contig_frags, [fppc, 2])
+ pairs.end = pairs.start + frag_steps
+
+ return pairs"
+635,https://:@github.com/struts2spring/sql-editor.git,92d594a22fc8cf532f18a445961615037bfa2685,"@@ -305,7 +305,7 @@ class FileBrowser(FileTree):
+ fileName=os.path.split(path)[-1]
+
+
+- stc.SetText(FileOperations().readFile(filePath=fname))
++ stc.SetText(FileOperations().readFile(filePath=path))
+ centerPaneTab.window.addTab(name='openFileLoad'+fileName, worksheetPanel=stc)
+
+ # win = wx.GetApp().GetActiveWindow()
+",src/view/views/file/explorer/FileBrowserPanel.py,"ReplaceText(target='path' @(308,67)->(308,72))","class FileBrowser(FileTree):
+ fileName=os.path.split(path)[-1]
+
+
+ stc.SetText(FileOperations().readFile(filePath=fname))
+ centerPaneTab.window.addTab(name='openFileLoad'+fileName, worksheetPanel=stc)
+
+ # win = wx.GetApp().GetActiveWindow()","class FileBrowser(FileTree):
+ fileName=os.path.split(path)[-1]
+
+
+ stc.SetText(FileOperations().readFile(filePath=path))
+ centerPaneTab.window.addTab(name='openFileLoad'+fileName, worksheetPanel=stc)
+
+ # win = wx.GetApp().GetActiveWindow()"
+636,https://:@github.com/struts2spring/sql-editor.git,3b18738cabd125bf7e4faeb0170edcc888f22c0b,"@@ -2306,7 +2306,7 @@ class ScrolledThumbnail(wx.ScrolledWindow):
+ logger.error(e, exc_info=True)
+ logger.error('selectedBookIndex: %s, len: %s', selectedBookIndex, len(self._items))
+ # logger.debug(.0deleteBooks)
+- if len(deleteBooks) > 0:
++ if len(deleteBooks) >= 0:
+ self.updateStatusBar(text=f'{len(deleteBooks)} books deleted')
+ self.GetParent().GetParent().loadingBook()
+ self.GetParent().GetParent().updatePangnation()
+",src/view/views/calibre/book/browser/BookThumbCrtl.py,"ReplaceText(target='>=' @(2309,28)->(2309,29))","class ScrolledThumbnail(wx.ScrolledWindow):
+ logger.error(e, exc_info=True)
+ logger.error('selectedBookIndex: %s, len: %s', selectedBookIndex, len(self._items))
+ # logger.debug(.0deleteBooks)
+ if len(deleteBooks) > 0:
+ self.updateStatusBar(text=f'{len(deleteBooks)} books deleted')
+ self.GetParent().GetParent().loadingBook()
+ self.GetParent().GetParent().updatePangnation()","class ScrolledThumbnail(wx.ScrolledWindow):
+ logger.error(e, exc_info=True)
+ logger.error('selectedBookIndex: %s, len: %s', selectedBookIndex, len(self._items))
+ # logger.debug(.0deleteBooks)
+ if len(deleteBooks) >= 0:
+ self.updateStatusBar(text=f'{len(deleteBooks)} books deleted')
+ self.GetParent().GetParent().loadingBook()
+ self.GetParent().GetParent().updatePangnation()"
+637,https://:@github.com/khaledghobashy/uraeus.git,d0011bf8d00b0212dd67ce4cd64b21719fbed709,"@@ -186,7 +186,7 @@ class internal_force(generic_force):
+ defflection = self.LF - distance
+ velocity = unit_vector.T*self.joint.dijd
+
+- self.Fi = unit_vector*(self.Fs(defflection) + self.Fd(velocity))
++ self.Fi = unit_vector*(self.Fs(defflection) - self.Fd(velocity))
+ Ti_e = 2*G(self.Pi).T*(self.Ti + Skew(self.ui).T*self.Fi)
+
+ force_vector = sm.BlockMatrix([[self.Fi], [Ti_e]])
+",source/symbolic_classes/forces.py,"ReplaceText(target='-' @(189,52)->(189,53))","class internal_force(generic_force):
+ defflection = self.LF - distance
+ velocity = unit_vector.T*self.joint.dijd
+
+ self.Fi = unit_vector*(self.Fs(defflection) + self.Fd(velocity))
+ Ti_e = 2*G(self.Pi).T*(self.Ti + Skew(self.ui).T*self.Fi)
+
+ force_vector = sm.BlockMatrix([[self.Fi], [Ti_e]])","class internal_force(generic_force):
+ defflection = self.LF - distance
+ velocity = unit_vector.T*self.joint.dijd
+
+ self.Fi = unit_vector*(self.Fs(defflection) - self.Fd(velocity))
+ Ti_e = 2*G(self.Pi).T*(self.Ti + Skew(self.ui).T*self.Fi)
+
+ force_vector = sm.BlockMatrix([[self.Fi], [Ti_e]])"
+638,https://:@github.com/naglis/odd-bunch.git,6e9e55c327eaa6bccd5a54a1da850db418fa3a3a,"@@ -74,7 +74,7 @@ class FieldAttrStringRedundant(Plugin):
+ f'for field ""{field.name}"". The same value will be computed '
+ f""by Odoo automatically."",
+ addon,
+- locations=[Location(path, [column_index_1(string_kwarg.start_pos)])],
++ locations=[Location(path, [column_index_1(field.start_pos)])],
+ confidence=Confidence.LOW,
+ categories=[""redundancy""],
+ sources=sources,
+",odd_bunch/plugin/field_attr_string_redundant.py,"ReplaceText(target='field' @(77,58)->(77,70))","class FieldAttrStringRedundant(Plugin):
+ f'for field ""{field.name}"". The same value will be computed '
+ f""by Odoo automatically."",
+ addon,
+ locations=[Location(path, [column_index_1(string_kwarg.start_pos)])],
+ confidence=Confidence.LOW,
+ categories=[""redundancy""],
+ sources=sources,","class FieldAttrStringRedundant(Plugin):
+ f'for field ""{field.name}"". The same value will be computed '
+ f""by Odoo automatically."",
+ addon,
+ locations=[Location(path, [column_index_1(field.start_pos)])],
+ confidence=Confidence.LOW,
+ categories=[""redundancy""],
+ sources=sources,"
+639,https://:@github.com/naglis/odd-bunch.git,6e9e55c327eaa6bccd5a54a1da850db418fa3a3a,"@@ -23,7 +23,7 @@ class TrackVisibilityAlways(Plugin):
+ ""deprecated since version 12.0"",
+ addon,
+ locations=[
+- Location(field.model.path, [column_index_1(kwarg.start_pos)])
++ Location(field.model.path, [column_index_1(field.start_pos)])
+ ],
+ categories=[""deprecated""],
+ sources=[
+",odd_bunch/plugin/track_visibility_always.py,"ReplaceText(target='field' @(26,67)->(26,72))","class TrackVisibilityAlways(Plugin):
+ ""deprecated since version 12.0"",
+ addon,
+ locations=[
+ Location(field.model.path, [column_index_1(kwarg.start_pos)])
+ ],
+ categories=[""deprecated""],
+ sources=[","class TrackVisibilityAlways(Plugin):
+ ""deprecated since version 12.0"",
+ addon,
+ locations=[
+ Location(field.model.path, [column_index_1(field.start_pos)])
+ ],
+ categories=[""deprecated""],
+ sources=["
+640,https://:@github.com/haipdev/config.git,c81fb07972b62e9c51d47b7306ad0cb39b90025d,"@@ -115,7 +115,7 @@ def get(*paths, **options):
+ elif value is not MANDATORY:
+ result[key] = value
+ else:
+- path = '/'.join(path)
++ path = '/'.join(paths)
+ raise HaipConfigException(f'option ""{key}"" not found in section ""{path}""')
+ return result
+
+",haip/config.py,"ReplaceText(target='paths' @(118,28)->(118,32))","def get(*paths, **options):
+ elif value is not MANDATORY:
+ result[key] = value
+ else:
+ path = '/'.join(path)
+ raise HaipConfigException(f'option ""{key}"" not found in section ""{path}""')
+ return result
+ ","def get(*paths, **options):
+ elif value is not MANDATORY:
+ result[key] = value
+ else:
+ path = '/'.join(paths)
+ raise HaipConfigException(f'option ""{key}"" not found in section ""{path}""')
+ return result
+ "
+641,https://:@github.com/woblers/rightmove_webscraper.py.git,75bc8dc28e5a998582ddf86ae43a3160b5729a90,"@@ -37,7 +37,7 @@ class rightmove_data(object):
+ There are 24 results on each results page, but note that the
+ rightmove website limits results pages to a maximum of 42 pages.""""""
+
+- page_count = self.results_count() / 24
++ page_count = self.results_count() // 24
+ if self.results_count() % 24 > 0:
+ page_count += 1
+
+",rightmove_webscraper.py,"ReplaceText(target='//' @(40,42)->(40,43))","class rightmove_data(object):
+ There are 24 results on each results page, but note that the
+ rightmove website limits results pages to a maximum of 42 pages.""""""
+
+ page_count = self.results_count() / 24
+ if self.results_count() % 24 > 0:
+ page_count += 1
+ ","class rightmove_data(object):
+ There are 24 results on each results page, but note that the
+ rightmove website limits results pages to a maximum of 42 pages.""""""
+
+ page_count = self.results_count() // 24
+ if self.results_count() % 24 > 0:
+ page_count += 1
+ "
+642,https://:@github.com/DomBennett/MassPhylogenyEstimation.git,e72cb1554f059c77b45c8c74af96bd0b2fb140b9,"@@ -39,7 +39,7 @@ with open(os.path.join(working_dir, ""data"", ""test_alignment.p""),
+ # MOCK
+ def dummy_blast(query, subj, minoverlap):
+ # should return bools and positions
+- bools = [True for e in subj]
++ bools = [True for e in query]
+ positions = [0 for e in subj]
+ max_positions = [len(e) for e in subj]
+ positions.extend(max_positions)
+",tests/test_tools_alignment.py,"ReplaceText(target='query' @(42,27)->(42,31))","with open(os.path.join(working_dir, ""data"", ""test_alignment.p""),
+ # MOCK
+ def dummy_blast(query, subj, minoverlap):
+ # should return bools and positions
+ bools = [True for e in subj]
+ positions = [0 for e in subj]
+ max_positions = [len(e) for e in subj]
+ positions.extend(max_positions)","with open(os.path.join(working_dir, ""data"", ""test_alignment.p""),
+ # MOCK
+ def dummy_blast(query, subj, minoverlap):
+ # should return bools and positions
+ bools = [True for e in query]
+ positions = [0 for e in subj]
+ max_positions = [len(e) for e in subj]
+ positions.extend(max_positions)"
+643,https://:@github.com/DomBennett/MassPhylogenyEstimation.git,832e9df9733c4e266c0583d4e1a329b5f72d4f4c,"@@ -159,7 +159,7 @@ class Stager(object):
+ @classmethod
+ def run_all(klass, wd, stages):
+ for s in stages:
+- if check(stage=s, directory=wd):
++ if not check(stage=s, directory=wd):
+ Stager(wd, s).run()
+
+
+",pglt/tools/system_tools.py,"ReplaceText(target='not ' @(162,15)->(162,15))","class Stager(object):
+ @classmethod
+ def run_all(klass, wd, stages):
+ for s in stages:
+ if check(stage=s, directory=wd):
+ Stager(wd, s).run()
+
+ ","class Stager(object):
+ @classmethod
+ def run_all(klass, wd, stages):
+ for s in stages:
+ if not check(stage=s, directory=wd):
+ Stager(wd, s).run()
+
+ "
+644,https://:@bitbucket.org/bowaggonerpublic/bomail.git,383fe87f4b5a54ce110d33850ce10f19e088a001,"@@ -62,7 +62,7 @@ def main():
+ exit(0)
+
+ if sys.argv[1] == ""help"":
+- if len(sys.argv) < 2:
++ if len(sys.argv) <= 2:
+ print(usage_str)
+ elif sys.argv[2] == ""datestr"":
+ print(bomail.util.datestr.datestr_str)
+",bomail/bomail.py,"ReplaceText(target='<=' @(65,21)->(65,22))","def main():
+ exit(0)
+
+ if sys.argv[1] == ""help"":
+ if len(sys.argv) < 2:
+ print(usage_str)
+ elif sys.argv[2] == ""datestr"":
+ print(bomail.util.datestr.datestr_str)","def main():
+ exit(0)
+
+ if sys.argv[1] == ""help"":
+ if len(sys.argv) <= 2:
+ print(usage_str)
+ elif sys.argv[2] == ""datestr"":
+ print(bomail.util.datestr.datestr_str)"
+645,https://:@bitbucket.org/bowaggonerpublic/bomail.git,6769b3f3dc022b9674b2f26d2ff842f74703da7e,"@@ -73,7 +73,7 @@ class TabNoThread:
+ new_fileset = set(new_filenames)
+ self.remove_files([t[0] for t in self.file_data if t[0] not in new_fileset], old_disp_info)
+ # assume, worst-case, that all matching files have changed/added
+- self.update_for_change(new_fileset, old_disp_info)
++ self.update_for_change(new_filenames, old_disp_info)
+
+
+ # lazily load display data and return disp_data, is_unread, is_marked
+",bomail/guistuff/tabnothread.py,"ReplaceText(target='new_filenames' @(76,27)->(76,38))","class TabNoThread:
+ new_fileset = set(new_filenames)
+ self.remove_files([t[0] for t in self.file_data if t[0] not in new_fileset], old_disp_info)
+ # assume, worst-case, that all matching files have changed/added
+ self.update_for_change(new_fileset, old_disp_info)
+
+
+ # lazily load display data and return disp_data, is_unread, is_marked","class TabNoThread:
+ new_fileset = set(new_filenames)
+ self.remove_files([t[0] for t in self.file_data if t[0] not in new_fileset], old_disp_info)
+ # assume, worst-case, that all matching files have changed/added
+ self.update_for_change(new_filenames, old_disp_info)
+
+
+ # lazily load display data and return disp_data, is_unread, is_marked"
+646,https://:@github.com/GainCompliance/gain-requests-futures.git,2779819b9b7554d787280d5889878237ba1937b5,"@@ -69,7 +69,7 @@ class FuturesSession(Session):
+ func = super(FuturesSession, self).send
+ if isinstance(self.executor, ProcessPoolExecutor):
+ try:
+- dumps(request)
++ dumps(func)
+ except (TypeError, PickleError):
+ raise RuntimeError(PICKLE_ERROR)
+ return self.executor.submit(func, request, **kwargs)
+",requests_futures/sessions.py,"ReplaceText(target='func' @(72,22)->(72,29))","class FuturesSession(Session):
+ func = super(FuturesSession, self).send
+ if isinstance(self.executor, ProcessPoolExecutor):
+ try:
+ dumps(request)
+ except (TypeError, PickleError):
+ raise RuntimeError(PICKLE_ERROR)
+ return self.executor.submit(func, request, **kwargs)","class FuturesSession(Session):
+ func = super(FuturesSession, self).send
+ if isinstance(self.executor, ProcessPoolExecutor):
+ try:
+ dumps(func)
+ except (TypeError, PickleError):
+ raise RuntimeError(PICKLE_ERROR)
+ return self.executor.submit(func, request, **kwargs)"
+647,https://:@github.com/praekelt/casepropods.family_connect_subscription.git,9f04ceacb29a64763e11de6c8fd3008faf9eddb2,"@@ -95,7 +95,7 @@ class SubscriptionPod(Pod):
+ 'subscription_ids': active_sub_ids
+ }
+ })
+- if len(active_sub_ids) > 0:
++ if len(active_sub_ids) > 1:
+ actions.append(self.get_cancel_action(active_sub_ids))
+
+ content['actions'] = actions
+",casepropods/family_connect_subscription/plugin.py,"ReplaceText(target='1' @(98,33)->(98,34))","class SubscriptionPod(Pod):
+ 'subscription_ids': active_sub_ids
+ }
+ })
+ if len(active_sub_ids) > 0:
+ actions.append(self.get_cancel_action(active_sub_ids))
+
+ content['actions'] = actions","class SubscriptionPod(Pod):
+ 'subscription_ids': active_sub_ids
+ }
+ })
+ if len(active_sub_ids) > 1:
+ actions.append(self.get_cancel_action(active_sub_ids))
+
+ content['actions'] = actions"
+648,https://:@github.com/fmilthaler/FinQuant.git,075430f74799040aa1d46c722e16a52a82637c63,"@@ -783,7 +783,7 @@ def _yfinance_request(names, start_date=None, end_date=None):
+ try:
+ import datetime
+ if isinstance(start_date, str):
+- start_date = datetime.datetime.strptime(end_date, ""%Y-%m-%d"")
++ start_date = datetime.datetime.strptime(start_date, ""%Y-%m-%d"")
+ if isinstance(end_date, str):
+ end_date = datetime.datetime.strptime(end_date, ""%Y-%m-%d"")
+ except ImportError:
+",finquant/portfolio.py,"ReplaceText(target='start_date' @(786,52)->(786,60))","def _yfinance_request(names, start_date=None, end_date=None):
+ try:
+ import datetime
+ if isinstance(start_date, str):
+ start_date = datetime.datetime.strptime(end_date, ""%Y-%m-%d"")
+ if isinstance(end_date, str):
+ end_date = datetime.datetime.strptime(end_date, ""%Y-%m-%d"")
+ except ImportError:","def _yfinance_request(names, start_date=None, end_date=None):
+ try:
+ import datetime
+ if isinstance(start_date, str):
+ start_date = datetime.datetime.strptime(start_date, ""%Y-%m-%d"")
+ if isinstance(end_date, str):
+ end_date = datetime.datetime.strptime(end_date, ""%Y-%m-%d"")
+ except ImportError:"
+649,https://:@github.com/MrTango/click.git,a6af25df9c2e82e94c3aa15d579f9347881e5efb,"@@ -1173,7 +1173,7 @@ class Argument(Parameter):
+ if attrs.get('default') is not None:
+ required = False
+ else:
+- required = attrs.get('nargs', 0) > 0
++ required = attrs.get('nargs', 1) > 0
+ Parameter.__init__(self, param_decls, required=required, **attrs)
+
+ def make_metavar(self):
+",click/core.py,"ReplaceText(target='1' @(1176,46)->(1176,47))","class Argument(Parameter):
+ if attrs.get('default') is not None:
+ required = False
+ else:
+ required = attrs.get('nargs', 0) > 0
+ Parameter.__init__(self, param_decls, required=required, **attrs)
+
+ def make_metavar(self):","class Argument(Parameter):
+ if attrs.get('default') is not None:
+ required = False
+ else:
+ required = attrs.get('nargs', 1) > 0
+ Parameter.__init__(self, param_decls, required=required, **attrs)
+
+ def make_metavar(self):"
+650,https://:@github.com/MrTango/click.git,336e5e08acf98a4033e5aa4c6fcef118d4f469ec,"@@ -224,7 +224,7 @@ def version_option(version=None, *param_decls, **attrs):
+ message = attrs.pop('message', '%(prog)s, version %(version)s')
+
+ def callback(ctx, param, value):
+- if value or ctx.resilient_parsing:
++ if not value or ctx.resilient_parsing:
+ return
+ prog = prog_name
+ if prog is None:
+",click/decorators.py,"ReplaceText(target='not ' @(227,15)->(227,15))","def version_option(version=None, *param_decls, **attrs):
+ message = attrs.pop('message', '%(prog)s, version %(version)s')
+
+ def callback(ctx, param, value):
+ if value or ctx.resilient_parsing:
+ return
+ prog = prog_name
+ if prog is None:","def version_option(version=None, *param_decls, **attrs):
+ message = attrs.pop('message', '%(prog)s, version %(version)s')
+
+ def callback(ctx, param, value):
+ if not value or ctx.resilient_parsing:
+ return
+ prog = prog_name
+ if prog is None:"
+651,https://:@github.com/MrTango/click.git,598c6d76fbc036fb3219d9f09948a682cda66601,"@@ -213,7 +213,7 @@ class CliRunner(object):
+ old_env = {}
+ try:
+ for key, value in iteritems(env):
+- old_env[key] = os.environ.get(value)
++ old_env[key] = os.environ.get(key)
+ if value is None:
+ try:
+ del os.environ[key]
+",click/testing.py,"ReplaceText(target='key' @(216,46)->(216,51))","class CliRunner(object):
+ old_env = {}
+ try:
+ for key, value in iteritems(env):
+ old_env[key] = os.environ.get(value)
+ if value is None:
+ try:
+ del os.environ[key]","class CliRunner(object):
+ old_env = {}
+ try:
+ for key, value in iteritems(env):
+ old_env[key] = os.environ.get(key)
+ if value is None:
+ try:
+ del os.environ[key]"
+652,https://:@github.com/epeios-q37/atlas-python.git,c310fd7273b7ec139c0eca6be43506cb611d5bfc,"@@ -69,7 +69,7 @@ class Chatroom:
+ def displayMessages(this, dom):
+ global messages
+
+- if len(messages) >= this.lastMessage:
++ if len(messages) > this.lastMessage:
+ id = dom.createElement(""span"")
+ dom.setLayoutXSL(id, this.buildXML(), ""Messages.xsl"")
+ dom.insertChild(id, ""Board"")
+",Chatroom/main.py,"ReplaceText(target='>' @(72,19)->(72,21))","class Chatroom:
+ def displayMessages(this, dom):
+ global messages
+
+ if len(messages) >= this.lastMessage:
+ id = dom.createElement(""span"")
+ dom.setLayoutXSL(id, this.buildXML(), ""Messages.xsl"")
+ dom.insertChild(id, ""Board"")","class Chatroom:
+ def displayMessages(this, dom):
+ global messages
+
+ if len(messages) > this.lastMessage:
+ id = dom.createElement(""span"")
+ dom.setLayoutXSL(id, this.buildXML(), ""Messages.xsl"")
+ dom.insertChild(id, ""Board"")"
+653,https://:@github.com/herrersystem/apize.git,3f4ce76b32fdc1cddc66cde54f0d7552b2ab2101,"@@ -15,7 +15,7 @@ def send_request(url, method,
+ """"""
+ ## Parse url args
+ for p in args:
+- url = url.replace(':'+p, str(params[p]))
++ url = url.replace(':' + p, str(args[p]))
+
+ try:
+ if data:
+",apize/decorators.py,"ReplaceText(target='args' @(18,31)->(18,37))","def send_request(url, method,
+ """"""
+ ## Parse url args
+ for p in args:
+ url = url.replace(':'+p, str(params[p]))
+
+ try:
+ if data:","def send_request(url, method,
+ """"""
+ ## Parse url args
+ for p in args:
+ url = url.replace(':' + p, str(args[p]))
+
+ try:
+ if data:"
+654,https://:@github.com/silvacms/silva.core.services.git,a674128c54bb10f2abdda32808285fabc985e363,"@@ -39,7 +39,7 @@ class SecretService(SilvaService):
+ assert len(args) > 1, u'Too few arguments'
+ challenge = hmac.new(self.__key, str(args[0]), hashlib.sha1)
+ for arg in args[1:]:
+- challenge.update(str(args))
++ challenge.update(str(arg))
+ return challenge.hexdigest()
+
+ InitializeClass(SecretService)
+",src/silva/core/services/secret.py,"ReplaceText(target='arg' @(42,33)->(42,37))","class SecretService(SilvaService):
+ assert len(args) > 1, u'Too few arguments'
+ challenge = hmac.new(self.__key, str(args[0]), hashlib.sha1)
+ for arg in args[1:]:
+ challenge.update(str(args))
+ return challenge.hexdigest()
+
+ InitializeClass(SecretService)","class SecretService(SilvaService):
+ assert len(args) > 1, u'Too few arguments'
+ challenge = hmac.new(self.__key, str(args[0]), hashlib.sha1)
+ for arg in args[1:]:
+ challenge.update(str(arg))
+ return challenge.hexdigest()
+
+ InitializeClass(SecretService)"
+655,https://:@github.com/SatelliteApplicationsCatapult/sedas_pyapi.git,db1d3308de5180dd9a26e8bc73b82c97d2f07507,"@@ -225,7 +225,7 @@ class SeDASAPI:
+ req = Request(url, headers=self.headers)
+ try:
+ decoded = json.load(urlopen(req))
+- if len(decoded) > 1 and 'downloadUrl' in decoded[0]:
++ if len(decoded) >= 1 and 'downloadUrl' in decoded[0]:
+ return decoded[0]['downloadUrl']
+ return None
+ except HTTPError as e:
+",getthestuff/sedas_api.py,"ReplaceText(target='>=' @(228,28)->(228,29))","class SeDASAPI:
+ req = Request(url, headers=self.headers)
+ try:
+ decoded = json.load(urlopen(req))
+ if len(decoded) > 1 and 'downloadUrl' in decoded[0]:
+ return decoded[0]['downloadUrl']
+ return None
+ except HTTPError as e:","class SeDASAPI:
+ req = Request(url, headers=self.headers)
+ try:
+ decoded = json.load(urlopen(req))
+ if len(decoded) >= 1 and 'downloadUrl' in decoded[0]:
+ return decoded[0]['downloadUrl']
+ return None
+ except HTTPError as e:"
+656,https://:@github.com/gigaquads/pybiz.git,9431e28a54c7a64f4fabcd861239a9651a75dde5,"@@ -91,7 +91,7 @@ class YamlDao(Dao):
+ cur_data = self.fetch(_id)
+ new_data = DictUtils.merge(cur_data, data)
+ Yaml.to_file(file_path=file_path, data=new_data)
+- return data
++ return new_data
+
+ def delete(self, _id) -> None:
+ """"""
+",pybiz/dao/yaml_dao.py,"ReplaceText(target='new_data' @(94,15)->(94,19))","class YamlDao(Dao):
+ cur_data = self.fetch(_id)
+ new_data = DictUtils.merge(cur_data, data)
+ Yaml.to_file(file_path=file_path, data=new_data)
+ return data
+
+ def delete(self, _id) -> None:
+ """"""","class YamlDao(Dao):
+ cur_data = self.fetch(_id)
+ new_data = DictUtils.merge(cur_data, data)
+ Yaml.to_file(file_path=file_path, data=new_data)
+ return new_data
+
+ def delete(self, _id) -> None:
+ """""""
+657,https://:@github.com/gigaquads/pybiz.git,cc4bc8499bdffbf4bef4704afb722fa55c7ccc1d,"@@ -790,7 +790,7 @@ class BizObject(
+ related_bizobj_list.append(obj)
+ else:
+ related_bizobj_list.append(
+- rel.target(related_data)
++ rel.target(obj)
+ )
+
+ self._related_bizobjs[rel.name] = related_bizobj_list
+",pybiz/biz.py,"ReplaceText(target='obj' @(793,39)->(793,51))","class BizObject(
+ related_bizobj_list.append(obj)
+ else:
+ related_bizobj_list.append(
+ rel.target(related_data)
+ )
+
+ self._related_bizobjs[rel.name] = related_bizobj_list","class BizObject(
+ related_bizobj_list.append(obj)
+ else:
+ related_bizobj_list.append(
+ rel.target(obj)
+ )
+
+ self._related_bizobjs[rel.name] = related_bizobj_list"
+658,https://:@github.com/gigaquads/pybiz.git,4bfdaf78df6eec9213f65df0656d346cfd4a45f2,"@@ -79,6 +79,6 @@ class BreadthFirstSaver(Saver):
+ v_type = v.__class__
+ if v._id is None:
+ to_create[v_type].append(v)
+- elif x.dirty:
++ elif v.dirty:
+ to_update[v_type].append(x)
+ self._aggregate_related(v, to_create, to_update)
+",pybiz/biz/internal/save.py,"ReplaceText(target='v' @(82,21)->(82,22))","class BreadthFirstSaver(Saver):
+ v_type = v.__class__
+ if v._id is None:
+ to_create[v_type].append(v)
+ elif x.dirty:
+ to_update[v_type].append(x)
+ self._aggregate_related(v, to_create, to_update)","class BreadthFirstSaver(Saver):
+ v_type = v.__class__
+ if v._id is None:
+ to_create[v_type].append(v)
+ elif v.dirty:
+ to_update[v_type].append(x)
+ self._aggregate_related(v, to_create, to_update)"
+659,https://:@github.com/gigaquads/pybiz.git,9ccaa42fdf4677090e93c27b2326c5d935d568f9,"@@ -80,5 +80,5 @@ class BreadthFirstSaver(Saver):
+ if v._id is None:
+ to_create[v_type].append(v)
+ elif v.dirty:
+- to_update[v_type].append(x)
++ to_update[v_type].append(v)
+ self._aggregate_related(v, to_create, to_update)
+",pybiz/biz/internal/save.py,"ReplaceText(target='v' @(83,45)->(83,46))","class BreadthFirstSaver(Saver):
+ if v._id is None:
+ to_create[v_type].append(v)
+ elif v.dirty:
+ to_update[v_type].append(x)
+ self._aggregate_related(v, to_create, to_update)","class BreadthFirstSaver(Saver):
+ if v._id is None:
+ to_create[v_type].append(v)
+ elif v.dirty:
+ to_update[v_type].append(v)
+ self._aggregate_related(v, to_create, to_update)"
+660,https://:@github.com/gigaquads/pybiz.git,c042a85234732c1ff96c0240b378595d24631fbe,"@@ -116,7 +116,7 @@ class CompositeGuard(Guard):
+ if rhs_exc is not None and lhs_exc is not None:
+ return CompositeGuardException(lhs_exc, rhs_exc)
+ elif self._op == OP_CODE.NOT:
+- if lhs_exc is not None:
++ if lhs_exc is None:
+ return lhs_exc
+ else:
+ return ValueError(f'op not recognized, ""{self._op}""')
+",pybiz/api/middleware/guard_middleware/guard.py,"ReplaceText(target=' is ' @(119,22)->(119,30))","class CompositeGuard(Guard):
+ if rhs_exc is not None and lhs_exc is not None:
+ return CompositeGuardException(lhs_exc, rhs_exc)
+ elif self._op == OP_CODE.NOT:
+ if lhs_exc is not None:
+ return lhs_exc
+ else:
+ return ValueError(f'op not recognized, ""{self._op}""')","class CompositeGuard(Guard):
+ if rhs_exc is not None and lhs_exc is not None:
+ return CompositeGuardException(lhs_exc, rhs_exc)
+ elif self._op == OP_CODE.NOT:
+ if lhs_exc is None:
+ return lhs_exc
+ else:
+ return ValueError(f'op not recognized, ""{self._op}""')"
+661,https://:@github.com/gigaquads/pybiz.git,30e14e8c946edb447a76ea243a271c6a03895def,"@@ -43,7 +43,7 @@ class ActionDecorator(object):
+ else:
+ func = obj
+ action = self.setup_action(func, False)
+- return action
++ return func
+
+ def setup_action(self, func, overwrite):
+ action = self.app.action_type(func, self)
+",ravel/app/base/action_decorator.py,"ReplaceText(target='func' @(46,19)->(46,25))","class ActionDecorator(object):
+ else:
+ func = obj
+ action = self.setup_action(func, False)
+ return action
+
+ def setup_action(self, func, overwrite):
+ action = self.app.action_type(func, self)","class ActionDecorator(object):
+ else:
+ func = obj
+ action = self.setup_action(func, False)
+ return func
+
+ def setup_action(self, func, overwrite):
+ action = self.app.action_type(func, self)"
+662,https://:@github.com/a1phat0ny/noteboard.git,82eea493ff696d09af702a1cfd0c645f5f61b86e,"@@ -429,7 +429,7 @@ def display_board(date=False, sort=False, im=False):
+ (Fore.LIGHTBLACK_EX + ""(due: {})"".format(color + str(duedate) + Fore.LIGHTBLACK_EX)) if item[""due""] else """",
+ Fore.LIGHTBLACK_EX + str(item[""date""]))
+ else:
+- p(star, Fore.LIGHTMAGENTA_EX + str(item[""id""]).rjust(2), mark, text_color + item[""text""], tag_text, due_text, day_text)
++ p(star, Fore.LIGHTMAGENTA_EX + str(item[""id""]).rjust(2), mark, text_color + item[""text""], tag_text, day_text, due_text)
+ print()
+ print_footer()
+ print_total()
+",noteboard/cli.py,"ArgSwap(idxs=5<->6 @(432,16)->(432,17))","def display_board(date=False, sort=False, im=False):
+ (Fore.LIGHTBLACK_EX + ""(due: {})"".format(color + str(duedate) + Fore.LIGHTBLACK_EX)) if item[""due""] else """",
+ Fore.LIGHTBLACK_EX + str(item[""date""]))
+ else:
+ p(star, Fore.LIGHTMAGENTA_EX + str(item[""id""]).rjust(2), mark, text_color + item[""text""], tag_text, due_text, day_text)
+ print()
+ print_footer()
+ print_total()","def display_board(date=False, sort=False, im=False):
+ (Fore.LIGHTBLACK_EX + ""(due: {})"".format(color + str(duedate) + Fore.LIGHTBLACK_EX)) if item[""due""] else """",
+ Fore.LIGHTBLACK_EX + str(item[""date""]))
+ else:
+ p(star, Fore.LIGHTMAGENTA_EX + str(item[""id""]).rjust(2), mark, text_color + item[""text""], tag_text, day_text, due_text)
+ print()
+ print_footer()
+ print_total()"
+663,https://:@github.com/tlevine/sheetmusic.git,5c919c8d4c6be39cd42847e44942305521c7fa52,"@@ -54,7 +54,7 @@ def _next_note(first_note, second_note_name):
+ If the second note name is less than the first (""G"" is greater than ""C""),
+ return a note of the second name in the octave above the first.
+ '''
+- if second_note_name > first_note.name:
++ if second_note_name >= first_note.name:
+ second_note_octave = first_note.octave
+ else:
+ second_note_octave = first_note.octave + 1
+",libsheetmusic/music.py,"ReplaceText(target='>=' @(57,24)->(57,25))","def _next_note(first_note, second_note_name):
+ If the second note name is less than the first (""G"" is greater than ""C""),
+ return a note of the second name in the octave above the first.
+ '''
+ if second_note_name > first_note.name:
+ second_note_octave = first_note.octave
+ else:
+ second_note_octave = first_note.octave + 1","def _next_note(first_note, second_note_name):
+ If the second note name is less than the first (""G"" is greater than ""C""),
+ return a note of the second name in the octave above the first.
+ '''
+ if second_note_name >= first_note.name:
+ second_note_octave = first_note.octave
+ else:
+ second_note_octave = first_note.octave + 1"
+664,https://:@github.com/tlevine/sheetmusic.git,62a714388992483a00824d0ce16af7a7c8b9ee7e,"@@ -80,4 +80,4 @@ def util_functions():
+
+ def functions():
+ callables = reduce(u.merge, [scale_functions(), chord_functions(), progression_functions(), interval_functions(), util_functions()])
+- return {k:u.to_function(v, k) for k,v in callables.items()}
++ return {k:u.to_function(k, v) for k,v in callables.items()}
+",libsheetmusic/main.py,"ArgSwap(idxs=0<->1 @(83,14)->(83,27))","def util_functions():
+
+ def functions():
+ callables = reduce(u.merge, [scale_functions(), chord_functions(), progression_functions(), interval_functions(), util_functions()])
+ return {k:u.to_function(v, k) for k,v in callables.items()}","def util_functions():
+
+ def functions():
+ callables = reduce(u.merge, [scale_functions(), chord_functions(), progression_functions(), interval_functions(), util_functions()])
+ return {k:u.to_function(k, v) for k,v in callables.items()}"
+665,https://:@gitlab.com/ebenhoeh/modelbase.git,dcc3cdf01cf74859ff59f4a641a9caf0faa21069,"@@ -207,7 +207,7 @@ class Model(core.ParameterModel):
+ raise TypeError(""Rate name must be str"")
+ if not callable(rate_function):
+ raise TypeError(""Rate function must be a function"")
+- if variables is not None:
++ if variables is None:
+ variables = []
+ if not isinstance(variables, list):
+ raise TypeError(""Variables must be a list"")
+",modelbase/ode/model.py,"ReplaceText(target=' is ' @(210,20)->(210,28))","class Model(core.ParameterModel):
+ raise TypeError(""Rate name must be str"")
+ if not callable(rate_function):
+ raise TypeError(""Rate function must be a function"")
+ if variables is not None:
+ variables = []
+ if not isinstance(variables, list):
+ raise TypeError(""Variables must be a list"")","class Model(core.ParameterModel):
+ raise TypeError(""Rate name must be str"")
+ if not callable(rate_function):
+ raise TypeError(""Rate function must be a function"")
+ if variables is None:
+ variables = []
+ if not isinstance(variables, list):
+ raise TypeError(""Variables must be a list"")"
+666,https://:@gitlab.com/ebenhoeh/modelbase.git,34fc0fc7c745eef34ae0edf0377347d83b733890,"@@ -281,7 +281,7 @@ class Model(core.ParameterModel):
+ def get_rate_indexes(self, rate_name=None):
+ v, k = zip(*enumerate(self.get_rate_names()))
+ rate_idx = dict(zip(k, v))
+- if rate_name is not None:
++ if rate_name is None:
+ return rate_idx
+ return rate_idx[rate_name]
+
+",modelbase/ode/model.py,"ReplaceText(target=' is ' @(284,20)->(284,28))","class Model(core.ParameterModel):
+ def get_rate_indexes(self, rate_name=None):
+ v, k = zip(*enumerate(self.get_rate_names()))
+ rate_idx = dict(zip(k, v))
+ if rate_name is not None:
+ return rate_idx
+ return rate_idx[rate_name]
+ ","class Model(core.ParameterModel):
+ def get_rate_indexes(self, rate_name=None):
+ v, k = zip(*enumerate(self.get_rate_names()))
+ rate_idx = dict(zip(k, v))
+ if rate_name is None:
+ return rate_idx
+ return rate_idx[rate_name]
+ "
+667,https://:@github.com/kalombos/pynetsnmp.git,812b5789589ca0d99f6e6d2339fee7e4254e9c01,"@@ -637,7 +637,7 @@ class Session(object):
+
+
+ MAXFD = 1024
+-fdset = c_int32 * (MAXFD/32)
++fdset = c_int32 * (MAXFD//32)
+
+ class timeval(Structure):
+ _fields_ = [
+",pynetsnmp/netsnmp.py,"ReplaceText(target='//' @(640,24)->(640,25))","class Session(object):
+
+
+ MAXFD = 1024
+ fdset = c_int32 * (MAXFD/32)
+
+ class timeval(Structure):
+ _fields_ = [","class Session(object):
+
+
+ MAXFD = 1024
+ fdset = c_int32 * (MAXFD//32)
+
+ class timeval(Structure):
+ _fields_ = ["
+668,https://:@github.com/kalombos/pynetsnmp.git,f2883247d0b1df1804aa12653b06dce1d2137697,"@@ -312,7 +312,7 @@ def strToOid(oidStr):
+ return mkoid(tuple([int(x) for x in oidStr.strip('.').split('.')]))
+
+ def decodeOid(pdu):
+- return tuple([pdu.val.objid[i] for i in range(pdu.val_len / sizeof(u_long))])
++ return tuple([pdu.val.objid[i] for i in range(pdu.val_len // sizeof(u_long))])
+
+ def decodeIp(pdu):
+ return '.'.join(map(str, pdu.val.bitstring[:4]))
+",pynetsnmp/netsnmp.py,"ReplaceText(target='//' @(315,62)->(315,63))","def strToOid(oidStr):
+ return mkoid(tuple([int(x) for x in oidStr.strip('.').split('.')]))
+
+ def decodeOid(pdu):
+ return tuple([pdu.val.objid[i] for i in range(pdu.val_len / sizeof(u_long))])
+
+ def decodeIp(pdu):
+ return '.'.join(map(str, pdu.val.bitstring[:4]))","def strToOid(oidStr):
+ return mkoid(tuple([int(x) for x in oidStr.strip('.').split('.')]))
+
+ def decodeOid(pdu):
+ return tuple([pdu.val.objid[i] for i in range(pdu.val_len // sizeof(u_long))])
+
+ def decodeIp(pdu):
+ return '.'.join(map(str, pdu.val.bitstring[:4]))"
+669,https://:@github.com/Swiftea/Crawler.git,fb03cfc257939d5b86fe00037ab6b00fd54c9afa,"@@ -14,7 +14,7 @@ def stats(dir_stats=DIR_STATS):
+ stat_links = ('Average links in webpage: ' + str(average(content)))
+ if len(content) > 10000:
+ compress_stats(dir_stats + 'stat_links')
+- result += stat_links + '\n'
++ result = stat_links + '\n'
+ try:
+ with open(dir_stats + 'stat_webpages', 'r') as myfile:
+ content = myfile.read().split()
+",crawler/stats.py,"ReplaceText(target='=' @(17,8)->(17,10))","def stats(dir_stats=DIR_STATS):
+ stat_links = ('Average links in webpage: ' + str(average(content)))
+ if len(content) > 10000:
+ compress_stats(dir_stats + 'stat_links')
+ result += stat_links + '\n'
+ try:
+ with open(dir_stats + 'stat_webpages', 'r') as myfile:
+ content = myfile.read().split()","def stats(dir_stats=DIR_STATS):
+ stat_links = ('Average links in webpage: ' + str(average(content)))
+ if len(content) > 10000:
+ compress_stats(dir_stats + 'stat_links')
+ result = stat_links + '\n'
+ try:
+ with open(dir_stats + 'stat_webpages', 'r') as myfile:
+ content = myfile.read().split()"
+670,https://:@bitbucket.org/mikhail-makovenko/save-to-db.git,0b152880bfce8af5f211bfbb3d5677f283823bdc,"@@ -187,7 +187,7 @@ class AdapterBase(object):
+ :returns: Item list and corresponding ORM models as a list of lists
+ (in case one item updates multiple models).
+ """"""
+- return db_persist(cls, item, adapter_settings)
++ return db_persist(item, cls, adapter_settings)
+
+
+ @classmethod
+",save_to_db/adapters/utils/adapter_base.py,"ArgSwap(idxs=0<->1 @(190,15)->(190,25))","class AdapterBase(object):
+ :returns: Item list and corresponding ORM models as a list of lists
+ (in case one item updates multiple models).
+ """"""
+ return db_persist(cls, item, adapter_settings)
+
+
+ @classmethod","class AdapterBase(object):
+ :returns: Item list and corresponding ORM models as a list of lists
+ (in case one item updates multiple models).
+ """"""
+ return db_persist(item, cls, adapter_settings)
+
+
+ @classmethod"
+671,https://:@github.com/itu-algorithms/itu.algs4.git,8a06e126f13f6d54802e342b1ad7c44ec792ffc3,"@@ -64,7 +64,7 @@ class Queue:
+ if __name__ == '__main__':
+ queue = Queue()
+
+- if len(sys.argv) > 0:
++ if len(sys.argv) > 1:
+ sys.stdin = open(sys.argv[1])
+ while not stdio.isEmpty():
+ input_item = stdio.readString()
+",fundamentals/queue.py,"ReplaceText(target='1' @(67,23)->(67,24))","class Queue:
+ if __name__ == '__main__':
+ queue = Queue()
+
+ if len(sys.argv) > 0:
+ sys.stdin = open(sys.argv[1])
+ while not stdio.isEmpty():
+ input_item = stdio.readString()","class Queue:
+ if __name__ == '__main__':
+ queue = Queue()
+
+ if len(sys.argv) > 1:
+ sys.stdin = open(sys.argv[1])
+ while not stdio.isEmpty():
+ input_item = stdio.readString()"
+672,https://:@github.com/itu-algorithms/itu.algs4.git,2282d1fa58d8c525d83890def4dc5b4d1902a0dd,"@@ -9,6 +9,6 @@ class ThreeSumFast:
+ count = 0
+ for i in range(n):
+ for j in range(i+1, n):
+- if binary_search.index_of(a, -a[i]-a[j]) > i:
++ if binary_search.index_of(a, -a[i]-a[j]) > j:
+ count += 1
+ return count
+",algs4/fundamentals/three_sum_fast.py,"ReplaceText(target='j' @(12,59)->(12,60))","class ThreeSumFast:
+ count = 0
+ for i in range(n):
+ for j in range(i+1, n):
+ if binary_search.index_of(a, -a[i]-a[j]) > i:
+ count += 1
+ return count","class ThreeSumFast:
+ count = 0
+ for i in range(n):
+ for j in range(i+1, n):
+ if binary_search.index_of(a, -a[i]-a[j]) > j:
+ count += 1
+ return count"
+673,https://:@github.com/itu-algorithms/itu.algs4.git,62cc19d6f09e3f24abbe1551d69d67474518a7cb,"@@ -183,7 +183,7 @@ class BinarySearchST:
+ while j < self._n-1:
+ self._keys[j] = self._keys[j+1]
+ self._vals[j] = self._vals[j+1]
+- j = 1
++ j += 1
+
+ self._n -= 1
+ n = self._n
+",itu/algs4/searching/binary_search_st.py,"ReplaceText(target='+=' @(186,14)->(186,15))","class BinarySearchST:
+ while j < self._n-1:
+ self._keys[j] = self._keys[j+1]
+ self._vals[j] = self._vals[j+1]
+ j = 1
+
+ self._n -= 1
+ n = self._n","class BinarySearchST:
+ while j < self._n-1:
+ self._keys[j] = self._keys[j+1]
+ self._vals[j] = self._vals[j+1]
+ j += 1
+
+ self._n -= 1
+ n = self._n"
+674,https://:@github.com/itu-algorithms/itu.algs4.git,616a6dd32cf80578bfae1ce36dbede8eb2e241cc,"@@ -481,7 +481,7 @@ class RedBlackBST(Generic[Key, Val]):
+ return
+ if lo < x.key:
+ self._keys(x.left, queue, lo, hi)
+- if not x.key < lo and x.key < hi:
++ if not x.key < lo and x.key <= hi:
+ queue.enqueue(x.key)
+ if hi > x.key:
+ self._keys(x.right, queue, lo, hi)
+",itu/algs4/searching/red_black_bst.py,"ReplaceText(target='<=' @(484,37)->(484,38))","class RedBlackBST(Generic[Key, Val]):
+ return
+ if lo < x.key:
+ self._keys(x.left, queue, lo, hi)
+ if not x.key < lo and x.key < hi:
+ queue.enqueue(x.key)
+ if hi > x.key:
+ self._keys(x.right, queue, lo, hi)","class RedBlackBST(Generic[Key, Val]):
+ return
+ if lo < x.key:
+ self._keys(x.left, queue, lo, hi)
+ if not x.key < lo and x.key <= hi:
+ queue.enqueue(x.key)
+ if hi > x.key:
+ self._keys(x.right, queue, lo, hi)"
+675,https://:@github.com/kbytesys/django-recaptcha3.git,69219ca34dc834fede05f4e7f107ba17156f8f45,"@@ -15,7 +15,7 @@ logger = logging.getLogger(__name__)
+
+ class ReCaptchaField(forms.CharField):
+ def __init__(self, attrs=None, *args, **kwargs):
+- if os.environ.get('RECAPTCHA_DISABLE', None) is not None:
++ if os.environ.get('RECAPTCHA_DISABLE', None) is None:
+ self._private_key = kwargs.pop('private_key', settings.RECAPTCHA_PRIVATE_KEY)
+ self._score_threshold = kwargs.pop('score_threshold', settings.RECAPTCHA_SCORE_THRESHOLD)
+
+",snowpenguin/django/recaptcha3/fields.py,"ReplaceText(target=' is ' @(18,52)->(18,60))","logger = logging.getLogger(__name__)
+
+ class ReCaptchaField(forms.CharField):
+ def __init__(self, attrs=None, *args, **kwargs):
+ if os.environ.get('RECAPTCHA_DISABLE', None) is not None:
+ self._private_key = kwargs.pop('private_key', settings.RECAPTCHA_PRIVATE_KEY)
+ self._score_threshold = kwargs.pop('score_threshold', settings.RECAPTCHA_SCORE_THRESHOLD)
+ ","logger = logging.getLogger(__name__)
+
+ class ReCaptchaField(forms.CharField):
+ def __init__(self, attrs=None, *args, **kwargs):
+ if os.environ.get('RECAPTCHA_DISABLE', None) is None:
+ self._private_key = kwargs.pop('private_key', settings.RECAPTCHA_PRIVATE_KEY)
+ self._score_threshold = kwargs.pop('score_threshold', settings.RECAPTCHA_SCORE_THRESHOLD)
+ "
+676,https://:@github.com/MonetDBSolutions/mal_analytics.git,0b7cd6d9394adc932e19a29eda69bb11e5a3fb19,"@@ -375,7 +375,7 @@ class ProfilerObjectParser:
+ except json.JSONDecodeError as json_error:
+ LOGGER.warning(""W001: Cannot parse object"")
+ LOGGER.warning(json_string)
+- LOGGER.warning(""Decoder reports %s"", json_string)
++ LOGGER.warning(""Decoder reports %s"", json_error)
+ return
+
+ dispatcher = {
+",mal_profiler/profiler_parser.py,"ReplaceText(target='json_error' @(378,49)->(378,60))","class ProfilerObjectParser:
+ except json.JSONDecodeError as json_error:
+ LOGGER.warning(""W001: Cannot parse object"")
+ LOGGER.warning(json_string)
+ LOGGER.warning(""Decoder reports %s"", json_string)
+ return
+
+ dispatcher = {","class ProfilerObjectParser:
+ except json.JSONDecodeError as json_error:
+ LOGGER.warning(""W001: Cannot parse object"")
+ LOGGER.warning(json_string)
+ LOGGER.warning(""Decoder reports %s"", json_error)
+ return
+
+ dispatcher = {"
+677,https://:@github.com/MonetDBSolutions/mal_analytics.git,a4e4a3d115ffc81721248d71176d8205c1866d98,"@@ -148,7 +148,7 @@ class DatabaseManager(object, metaclass=Singleton):
+ stmt = list()
+ for ln in sql_in:
+ cline = ln.strip()
+- if ln.startswith('--') or len(cline) == 0:
++ if cline.startswith('--') or len(cline) == 0:
+ continue
+
+ stmt.append(cline)
+",mal_analytics/db_manager.py,"ReplaceText(target='cline' @(151,15)->(151,17))","class DatabaseManager(object, metaclass=Singleton):
+ stmt = list()
+ for ln in sql_in:
+ cline = ln.strip()
+ if ln.startswith('--') or len(cline) == 0:
+ continue
+
+ stmt.append(cline)","class DatabaseManager(object, metaclass=Singleton):
+ stmt = list()
+ for ln in sql_in:
+ cline = ln.strip()
+ if cline.startswith('--') or len(cline) == 0:
+ continue
+
+ stmt.append(cline)"
+678,https://:@github.com/codepost-io/codePost-api-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:"
+679,https://:@github.com/optimatorlab/veroviz.git,0c34d475219e023bbc77e96bbcf8c7bd2ec09fde,"@@ -527,7 +527,7 @@ def geoAreaOfPolygon(poly):
+ polyArea = 0
+
+ # Use polygon triangulation to cut the bounding region into a list of triangles, calculate the area of each triangle
+- lstTriangle = tripy.earclip(poly)
++ lstTriangle = tripy.earclip(cleanPoly)
+ lstArea = []
+ for i in range(len(lstTriangle)):
+ lstArea.append(geoAreaOfTriangle(lstTriangle[i][0], lstTriangle[i][1], lstTriangle[i][2]))
+",veroviz/_geometry.py,"ReplaceText(target='cleanPoly' @(530,29)->(530,33))","def geoAreaOfPolygon(poly):
+ polyArea = 0
+
+ # Use polygon triangulation to cut the bounding region into a list of triangles, calculate the area of each triangle
+ lstTriangle = tripy.earclip(poly)
+ lstArea = []
+ for i in range(len(lstTriangle)):
+ lstArea.append(geoAreaOfTriangle(lstTriangle[i][0], lstTriangle[i][1], lstTriangle[i][2]))","def geoAreaOfPolygon(poly):
+ polyArea = 0
+
+ # Use polygon triangulation to cut the bounding region into a list of triangles, calculate the area of each triangle
+ lstTriangle = tripy.earclip(cleanPoly)
+ lstArea = []
+ for i in range(len(lstTriangle)):
+ lstArea.append(geoAreaOfTriangle(lstTriangle[i][0], lstTriangle[i][1], lstTriangle[i][2]))"
+680,https://:@github.com/slipguru/adenine.git,0ea659ee40e7d0eff55de0da241e5e2566de4a48,"@@ -380,7 +380,7 @@ def analysis_worker(elem, root, y, feat_names, class_names, lock):
+ model=voronoi_mdl_obj)
+ elif hasattr(mdl_obj, 'n_leaves_'):
+ plotting.tree(root=rootname, data_in=step_in,
+- labels=step_out, model=mdl_obj)
++ labels=y, model=mdl_obj)
+ plotting.dendrogram(root=rootname, data_in=step_in,
+ labels=y, model=mdl_obj)
+
+",adenine/core/analyze_results.py,"ReplaceText(target='y' @(383,37)->(383,45))","def analysis_worker(elem, root, y, feat_names, class_names, lock):
+ model=voronoi_mdl_obj)
+ elif hasattr(mdl_obj, 'n_leaves_'):
+ plotting.tree(root=rootname, data_in=step_in,
+ labels=step_out, model=mdl_obj)
+ plotting.dendrogram(root=rootname, data_in=step_in,
+ labels=y, model=mdl_obj)
+ ","def analysis_worker(elem, root, y, feat_names, class_names, lock):
+ model=voronoi_mdl_obj)
+ elif hasattr(mdl_obj, 'n_leaves_'):
+ plotting.tree(root=rootname, data_in=step_in,
+ labels=y, model=mdl_obj)
+ plotting.dendrogram(root=rootname, data_in=step_in,
+ labels=y, model=mdl_obj)
+ "
+681,https://:@github.com/Tenchi2xh/Almonds.git,79cd9da8e404df197cbe23586aeacec156080722,"@@ -135,7 +135,7 @@ class Cursebox(object):
+ return EVENT_RIGHT
+ elif ch == 3:
+ return EVENT_CTRL_C
+- elif 0 >= ch < 256:
++ elif 0 <= ch < 256:
+ return chr(ch)
+ else:
+ return EVENT_UNHANDLED
+",almonds/cursebox/cursebox.py,"ReplaceText(target='<=' @(138,15)->(138,17))","class Cursebox(object):
+ return EVENT_RIGHT
+ elif ch == 3:
+ return EVENT_CTRL_C
+ elif 0 >= ch < 256:
+ return chr(ch)
+ else:
+ return EVENT_UNHANDLED","class Cursebox(object):
+ return EVENT_RIGHT
+ elif ch == 3:
+ return EVENT_CTRL_C
+ elif 0 <= ch < 256:
+ return chr(ch)
+ else:
+ return EVENT_UNHANDLED"
+682,https://:@github.com/abrahamrhoffman/anaxdb.git,0ff2588e2af89bb06d04834ad6bef887ed5ebb14,"@@ -263,7 +263,7 @@ class Database(object):
+ try:
+ tableFile = (self._path + ""/"" + aTableName + "".pq"")
+ tableFileEnc = (self._path + ""/"" + aTableName + "".enc"")
+- self._decrypt(tableFileEnc)
++ self._decrypt(tableFile)
+ dataframe = pq.read_table(tableFile).to_pandas()
+ os.remove(tableFile)
+ return dataframe
+",anaxdb/anaxdb.py,"ReplaceText(target='tableFile' @(266,30)->(266,42))","class Database(object):
+ try:
+ tableFile = (self._path + ""/"" + aTableName + "".pq"")
+ tableFileEnc = (self._path + ""/"" + aTableName + "".enc"")
+ self._decrypt(tableFileEnc)
+ dataframe = pq.read_table(tableFile).to_pandas()
+ os.remove(tableFile)
+ return dataframe","class Database(object):
+ try:
+ tableFile = (self._path + ""/"" + aTableName + "".pq"")
+ tableFileEnc = (self._path + ""/"" + aTableName + "".enc"")
+ self._decrypt(tableFile)
+ dataframe = pq.read_table(tableFile).to_pandas()
+ os.remove(tableFile)
+ return dataframe"
+683,https://:@github.com/badmetacoder/calculator.git,531135ec2a5b354165ad6e6e6b8d2e4d84b8ee38,"@@ -96,7 +96,7 @@ class SimpleCalculator():
+ elif self.op == '+':
+ self.r1 = self.r1 + self.r2
+ elif self.op == '-':
+- self.r1 = self.r1 + self.r2
++ self.r1 = self.r1 - self.r2
+ elif self.op == '*':
+ self.r1 = self.r1 * self.r2
+ elif self.op == '/':
+",calculator/simple.py,"ReplaceText(target='-' @(99,34)->(99,35))","class SimpleCalculator():
+ elif self.op == '+':
+ self.r1 = self.r1 + self.r2
+ elif self.op == '-':
+ self.r1 = self.r1 + self.r2
+ elif self.op == '*':
+ self.r1 = self.r1 * self.r2
+ elif self.op == '/':","class SimpleCalculator():
+ elif self.op == '+':
+ self.r1 = self.r1 + self.r2
+ elif self.op == '-':
+ self.r1 = self.r1 - self.r2
+ elif self.op == '*':
+ self.r1 = self.r1 * self.r2
+ elif self.op == '/':"
+684,https://:@github.com/mhantke/h5writer.git,b70deaa06e1b8043aa658410e6ffe2310f796c35,"@@ -150,7 +150,7 @@ class H5WriterMPI(AbstractH5Writer):
+
+ def _write_solocache_group_to_file(self, data_dict, group_prefix=""/""):
+ if self._is_master() and group_prefix != ""/"":
+- if group_prefix in self._f:
++ if group_prefix not in self._f:
+ self._f.create_group(group_prefix)
+ keys = data_dict.keys()
+ keys.sort()
+",src/h5writer_mpi.py,"ReplaceText(target=' not in ' @(153,27)->(153,31))","class H5WriterMPI(AbstractH5Writer):
+
+ def _write_solocache_group_to_file(self, data_dict, group_prefix=""/""):
+ if self._is_master() and group_prefix != ""/"":
+ if group_prefix in self._f:
+ self._f.create_group(group_prefix)
+ keys = data_dict.keys()
+ keys.sort()","class H5WriterMPI(AbstractH5Writer):
+
+ def _write_solocache_group_to_file(self, data_dict, group_prefix=""/""):
+ if self._is_master() and group_prefix != ""/"":
+ if group_prefix not in self._f:
+ self._f.create_group(group_prefix)
+ keys = data_dict.keys()
+ keys.sort()"
+685,https://:@github.com/MushroomRL/mushroom-rl.git,21a7d99f2c2f28a1de150b3464c7b649b096d757,"@@ -6,7 +6,7 @@ class EpsGreedy(object):
+ self._epsilon = epsilon
+
+ def __call__(self):
+- if np.random.uniform() > self._epsilon:
++ if np.random.uniform() < self._epsilon:
+ return False
+ return True
+
+",PyPi/policy/policy.py,"ReplaceText(target='<' @(9,31)->(9,32))","class EpsGreedy(object):
+ self._epsilon = epsilon
+
+ def __call__(self):
+ if np.random.uniform() > self._epsilon:
+ return False
+ return True
+ ","class EpsGreedy(object):
+ self._epsilon = epsilon
+
+ def __call__(self):
+ if np.random.uniform() < self._epsilon:
+ return False
+ return True
+ "
+686,https://:@github.com/MushroomRL/mushroom-rl.git,86fae8d69f4906e0e395163d1b2fa43371d28deb,"@@ -103,7 +103,7 @@ class Algorithm(object):
+ if render:
+ self.mdp._render()
+
+- last = 0 if n_steps < self.mdp.horizon or not absorbing else 1
++ last = 0 if n_steps < self.mdp.horizon and not absorbing else 1
+ sample = self.state.ravel().tolist() + action.ravel().tolist() + \
+ [reward] + next_state.ravel().tolist() + \
+ [absorbing, last]
+",PyPi/algorithms/algorithm.py,"ReplaceText(target='and' @(106,51)->(106,53))","class Algorithm(object):
+ if render:
+ self.mdp._render()
+
+ last = 0 if n_steps < self.mdp.horizon or not absorbing else 1
+ sample = self.state.ravel().tolist() + action.ravel().tolist() + \
+ [reward] + next_state.ravel().tolist() + \
+ [absorbing, last]","class Algorithm(object):
+ if render:
+ self.mdp._render()
+
+ last = 0 if n_steps < self.mdp.horizon and not absorbing else 1
+ sample = self.state.ravel().tolist() + action.ravel().tolist() + \
+ [reward] + next_state.ravel().tolist() + \
+ [absorbing, last]"
+687,https://:@github.com/MushroomRL/mushroom-rl.git,2f134a73ac9cdab98206afeab6cd39bb02b6a6fc,"@@ -113,7 +113,7 @@ class Core(object):
+ action_idx = self.agent.draw_action(self.state,
+ self.agent.approximator)
+ action_value = self.mdp.action_space.get_value(action_idx)
+- next_state, reward, absorbing, _ = self.mdp.step(action_idx)
++ next_state, reward, absorbing, _ = self.mdp.step(action_value)
+ J += self.mdp.gamma ** n_steps * reward
+ n_steps += 1
+
+",PyPi/core/core.py,"ReplaceText(target='action_value' @(116,61)->(116,71))","class Core(object):
+ action_idx = self.agent.draw_action(self.state,
+ self.agent.approximator)
+ action_value = self.mdp.action_space.get_value(action_idx)
+ next_state, reward, absorbing, _ = self.mdp.step(action_idx)
+ J += self.mdp.gamma ** n_steps * reward
+ n_steps += 1
+ ","class Core(object):
+ action_idx = self.agent.draw_action(self.state,
+ self.agent.approximator)
+ action_value = self.mdp.action_space.get_value(action_idx)
+ next_state, reward, absorbing, _ = self.mdp.step(action_value)
+ J += self.mdp.gamma ** n_steps * reward
+ n_steps += 1
+ "
+688,https://:@github.com/MushroomRL/mushroom-rl.git,a38031ed8b004f73983b53919acfd4c36e1f2bf1,"@@ -75,4 +75,4 @@ class Binarizer(Preprocessor):
+ The binarized input data array.
+
+ """"""
+- return (x > self._threshold).astype(np.float)
++ return (x >= self._threshold).astype(np.float)
+",mushroom/utils/preprocessor.py,"ReplaceText(target='>=' @(78,18)->(78,19))","class Binarizer(Preprocessor):
+ The binarized input data array.
+
+ """"""
+ return (x > self._threshold).astype(np.float)","class Binarizer(Preprocessor):
+ The binarized input data array.
+
+ """"""
+ return (x >= self._threshold).astype(np.float)"
+689,https://:@github.com/MushroomRL/mushroom-rl.git,bcf82aaeed185c53d3f512491f80ec793e264bab,"@@ -237,7 +237,7 @@ class RDQN(DQN):
+ state, action, _, _, absorbing, _ =\
+ self._replay_memory.get_idxs(idxs)
+
+- no_abs_idxs = idxs[np.argwhere(absorbing != 0).ravel()]
++ no_abs_idxs = idxs[np.argwhere(absorbing == 0).ravel()]
+ state, action, _, _, absorbing, _ =\
+ self._replay_memory.get_idxs(no_abs_idxs)
+ next_state, next_action, next_reward, _, next_absorbing, _ =\
+",mushroom/algorithms/dqn.py,"ReplaceText(target='==' @(240,53)->(240,55))","class RDQN(DQN):
+ state, action, _, _, absorbing, _ =\
+ self._replay_memory.get_idxs(idxs)
+
+ no_abs_idxs = idxs[np.argwhere(absorbing != 0).ravel()]
+ state, action, _, _, absorbing, _ =\
+ self._replay_memory.get_idxs(no_abs_idxs)
+ next_state, next_action, next_reward, _, next_absorbing, _ =\","class RDQN(DQN):
+ state, action, _, _, absorbing, _ =\
+ self._replay_memory.get_idxs(idxs)
+
+ no_abs_idxs = idxs[np.argwhere(absorbing == 0).ravel()]
+ state, action, _, _, absorbing, _ =\
+ self._replay_memory.get_idxs(no_abs_idxs)
+ next_state, next_action, next_reward, _, next_absorbing, _ =\"
+690,https://:@github.com/MushroomRL/mushroom-rl.git,d4ec7569d1f7409b05754abe8a11a69f016efd01,"@@ -258,7 +258,7 @@ class SARSALambdaDiscrete(TD):
+ for s in self.mdp_info.observation_space.values:
+ for a in self.mdp_info.action_space.values:
+ self.Q[s, a] += self.alpha(s, a) * delta * self.e[s, a]
+- self.e[s, a] = self.mdp_info.gamma * self._lambda
++ self.e[s, a] *= self.mdp_info.gamma * self._lambda
+
+
+ class SARSALambdaContinuous(TD):
+",mushroom/algorithms/value/td.py,"ReplaceText(target='*=' @(261,29)->(261,30))","class SARSALambdaDiscrete(TD):
+ for s in self.mdp_info.observation_space.values:
+ for a in self.mdp_info.action_space.values:
+ self.Q[s, a] += self.alpha(s, a) * delta * self.e[s, a]
+ self.e[s, a] = self.mdp_info.gamma * self._lambda
+
+
+ class SARSALambdaContinuous(TD):","class SARSALambdaDiscrete(TD):
+ for s in self.mdp_info.observation_space.values:
+ for a in self.mdp_info.action_space.values:
+ self.Q[s, a] += self.alpha(s, a) * delta * self.e[s, a]
+ self.e[s, a] *= self.mdp_info.gamma * self._lambda
+
+
+ class SARSALambdaContinuous(TD):"
+691,https://:@github.com/MushroomRL/mushroom-rl.git,809c24e9b50202c6c06fbe6fc7e4b067894230c4,"@@ -161,7 +161,7 @@ class DoubleFQI(FQI):
+ next_state = list()
+ absorbing = list()
+
+- half = len(x) / 2
++ half = len(x) // 2
+ for i in range(2):
+ s, a, r, ss, ab, _ = parse_dataset(x[i * half:(i + 1) * half])
+ state.append(s)
+",mushroom/algorithms/value/batch_td.py,"ReplaceText(target='//' @(164,22)->(164,23))","class DoubleFQI(FQI):
+ next_state = list()
+ absorbing = list()
+
+ half = len(x) / 2
+ for i in range(2):
+ s, a, r, ss, ab, _ = parse_dataset(x[i * half:(i + 1) * half])
+ state.append(s)","class DoubleFQI(FQI):
+ next_state = list()
+ absorbing = list()
+
+ half = len(x) // 2
+ for i in range(2):
+ s, a, r, ss, ab, _ = parse_dataset(x[i * half:(i + 1) * half])
+ state.append(s)"
+692,https://:@github.com/MushroomRL/mushroom-rl.git,809c24e9b50202c6c06fbe6fc7e4b067894230c4,"@@ -186,7 +186,7 @@ class AveragedDQN(DQN):
+ assert isinstance(self.target_approximator.model, Ensemble)
+
+ def _update_target(self):
+- idx = self._n_updates / self._target_update_frequency\
++ idx = self._n_updates // self._target_update_frequency\
+ % self._n_approximators
+ self.target_approximator.model[idx].set_weights(
+ self.approximator.model.get_weights())
+",mushroom/algorithms/value/dqn.py,"ReplaceText(target='//' @(189,30)->(189,31))","class AveragedDQN(DQN):
+ assert isinstance(self.target_approximator.model, Ensemble)
+
+ def _update_target(self):
+ idx = self._n_updates / self._target_update_frequency\
+ % self._n_approximators
+ self.target_approximator.model[idx].set_weights(
+ self.approximator.model.get_weights())","class AveragedDQN(DQN):
+ assert isinstance(self.target_approximator.model, Ensemble)
+
+ def _update_target(self):
+ idx = self._n_updates // self._target_update_frequency\
+ % self._n_approximators
+ self.target_approximator.model[idx].set_weights(
+ self.approximator.model.get_weights())"
+693,https://:@github.com/MushroomRL/mushroom-rl.git,809c24e9b50202c6c06fbe6fc7e4b067894230c4,"@@ -108,7 +108,7 @@ def compute_probabilities(grid_map, cell_list, passenger_list, prob):
+ passenger_states = cartesian([[0, 1]] * len(passenger_list))
+
+ for i in range(n_states):
+- idx = i / len(cell_list)
++ idx = i // len(cell_list)
+ collected_passengers = np.array(
+ passenger_list)[np.argwhere(passenger_states[idx] == 1).ravel()]
+ state = c[i % len(cell_list)]
+",mushroom/environments/generators/taxi.py,"ReplaceText(target='//' @(111,16)->(111,17))","def compute_probabilities(grid_map, cell_list, passenger_list, prob):
+ passenger_states = cartesian([[0, 1]] * len(passenger_list))
+
+ for i in range(n_states):
+ idx = i / len(cell_list)
+ collected_passengers = np.array(
+ passenger_list)[np.argwhere(passenger_states[idx] == 1).ravel()]
+ state = c[i % len(cell_list)]","def compute_probabilities(grid_map, cell_list, passenger_list, prob):
+ passenger_states = cartesian([[0, 1]] * len(passenger_list))
+
+ for i in range(n_states):
+ idx = i // len(cell_list)
+ collected_passengers = np.array(
+ passenger_list)[np.argwhere(passenger_states[idx] == 1).ravel()]
+ state = c[i % len(cell_list)]"
+694,https://:@github.com/MushroomRL/mushroom-rl.git,809c24e9b50202c6c06fbe6fc7e4b067894230c4,"@@ -54,7 +54,7 @@ class AbstractGridWorld(Environment):
+
+ @staticmethod
+ def convert_to_grid(state, width):
+- return np.array([state[0] / width, state[0] % width])
++ return np.array([state[0] // width, state[0] % width])
+
+ @staticmethod
+ def convert_to_int(state, width):
+",mushroom/environments/grid_world.py,"ReplaceText(target='//' @(57,34)->(57,35))","class AbstractGridWorld(Environment):
+
+ @staticmethod
+ def convert_to_grid(state, width):
+ return np.array([state[0] / width, state[0] % width])
+
+ @staticmethod
+ def convert_to_int(state, width):","class AbstractGridWorld(Environment):
+
+ @staticmethod
+ def convert_to_grid(state, width):
+ return np.array([state[0] // width, state[0] % width])
+
+ @staticmethod
+ def convert_to_int(state, width):"
+695,https://:@github.com/MushroomRL/mushroom-rl.git,809c24e9b50202c6c06fbe6fc7e4b067894230c4,"@@ -90,7 +90,7 @@ def experiment(alg):
+ # evaluate initial policy
+ pi.set_epsilon(epsilon_test)
+ mdp.set_episode_end(ends_at_life=False)
+- for n_epoch in range(1, max_steps / evaluation_frequency + 1):
++ for n_epoch in range(1, max_steps // evaluation_frequency + 1):
+ # learning step
+ pi.set_epsilon(epsilon)
+ mdp.set_episode_end(ends_at_life=True)
+",tests/atari_dqn/atari_dqn.py,"ReplaceText(target='//' @(93,38)->(93,39))","def experiment(alg):
+ # evaluate initial policy
+ pi.set_epsilon(epsilon_test)
+ mdp.set_episode_end(ends_at_life=False)
+ for n_epoch in range(1, max_steps / evaluation_frequency + 1):
+ # learning step
+ pi.set_epsilon(epsilon)
+ mdp.set_episode_end(ends_at_life=True)","def experiment(alg):
+ # evaluate initial policy
+ pi.set_epsilon(epsilon_test)
+ mdp.set_episode_end(ends_at_life=False)
+ for n_epoch in range(1, max_steps // evaluation_frequency + 1):
+ # learning step
+ pi.set_epsilon(epsilon)
+ mdp.set_episode_end(ends_at_life=True)"
+696,https://:@github.com/MushroomRL/mushroom-rl.git,a3695d7feb30d5fbb277fb1e8a7e3711d84545a2,"@@ -294,7 +294,7 @@ def experiment():
+ agent.policy.set_q(agent.approximator)
+
+ np.save(folder_name + '/scores.npy', scores)
+- for n_epoch in range(1, max_steps / evaluation_frequency + 1):
++ for n_epoch in range(1, max_steps // evaluation_frequency + 1):
+ print_epoch(n_epoch)
+ print('- Learning:')
+ # learning step
+",examples/atari_dqn/atari_dqn.py,"ReplaceText(target='//' @(297,42)->(297,43))","def experiment():
+ agent.policy.set_q(agent.approximator)
+
+ np.save(folder_name + '/scores.npy', scores)
+ for n_epoch in range(1, max_steps / evaluation_frequency + 1):
+ print_epoch(n_epoch)
+ print('- Learning:')
+ # learning step","def experiment():
+ agent.policy.set_q(agent.approximator)
+
+ np.save(folder_name + '/scores.npy', scores)
+ for n_epoch in range(1, max_steps // evaluation_frequency + 1):
+ print_epoch(n_epoch)
+ print('- Learning:')
+ # learning step"
+697,https://:@github.com/MushroomRL/mushroom-rl.git,238a6a652a8ce6c7fb23eba48dd52a2bce343b92,"@@ -51,7 +51,7 @@ class DQN(Agent):
+ self._batch_size = batch_size
+ self._n_approximators = n_approximators
+ self._clip_reward = clip_reward
+- self._target_update_frequency = target_update_frequency / train_frequency
++ self._target_update_frequency = target_update_frequency // train_frequency
+ self._max_no_op_actions = max_no_op_actions
+ self._no_op_action_value = no_op_action_value
+
+",mushroom/algorithms/value/dqn.py,"ReplaceText(target='//' @(54,64)->(54,65))","class DQN(Agent):
+ self._batch_size = batch_size
+ self._n_approximators = n_approximators
+ self._clip_reward = clip_reward
+ self._target_update_frequency = target_update_frequency / train_frequency
+ self._max_no_op_actions = max_no_op_actions
+ self._no_op_action_value = no_op_action_value
+ ","class DQN(Agent):
+ self._batch_size = batch_size
+ self._n_approximators = n_approximators
+ self._clip_reward = clip_reward
+ self._target_update_frequency = target_update_frequency // train_frequency
+ self._max_no_op_actions = max_no_op_actions
+ self._no_op_action_value = no_op_action_value
+ "
+698,https://:@github.com/MushroomRL/mushroom-rl.git,bdd275227ed4e37833414e33176bbe0585f02a8b,"@@ -180,7 +180,7 @@ class InvertedPendulumDiscrete(Environment):
+ u = 0.
+ else:
+ u = self._max_u
+- action += np.random.uniform(-self._noise_u, self._noise_u)
++ u += np.random.uniform(-self._noise_u, self._noise_u)
+ new_state = odeint(self._dynamics, self._state, [0, self._dt],
+ (u,))
+
+",mushroom/environments/inverted_pendulum.py,"ReplaceText(target='u' @(183,8)->(183,14))","class InvertedPendulumDiscrete(Environment):
+ u = 0.
+ else:
+ u = self._max_u
+ action += np.random.uniform(-self._noise_u, self._noise_u)
+ new_state = odeint(self._dynamics, self._state, [0, self._dt],
+ (u,))
+ ","class InvertedPendulumDiscrete(Environment):
+ u = 0.
+ else:
+ u = self._max_u
+ u += np.random.uniform(-self._noise_u, self._noise_u)
+ new_state = odeint(self._dynamics, self._state, [0, self._dt],
+ (u,))
+ "
+699,https://:@github.com/MushroomRL/mushroom-rl.git,590aabe042c74f6d6be4b1b821ad35d9ae1a47f7,"@@ -232,7 +232,7 @@ class ReplayMemory(object):
+ allows it to be used.
+
+ """"""
+- return self.size > self._initial_size
++ return self.size >= self._initial_size
+
+ @property
+ def size(self):
+",mushroom/utils/replay_memory.py,"ReplaceText(target='>=' @(235,25)->(235,26))","class ReplayMemory(object):
+ allows it to be used.
+
+ """"""
+ return self.size > self._initial_size
+
+ @property
+ def size(self):","class ReplayMemory(object):
+ allows it to be used.
+
+ """"""
+ return self.size >= self._initial_size
+
+ @property
+ def size(self):"
+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
+ 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
+ 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
+ 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
+ "
+800,https://:@github.com/ankush13r/BvSalud.git,10216a189e9f63ab1a1d8cf7c647a026b7b941bb,"@@ -195,7 +195,7 @@ def get_mesh_major_list(document_dict,decsCodes_list_dict,with_header): #Method
+ else:
+ if len(header_before_slash) != 0:
+ final_header = str(header_code) +'/'+ str(header_after_slash)
+- elif len(header_after_slash) == 0:
++ elif len(header_before_slash) == 0:
+ final_header = '/' + str(decsCodes_list_dict)
+ else:
+ print(header,""--"",header_before_slash,""--"",header_after_slash)
+",BvSalud/makeSet.py,"ReplaceText(target='header_before_slash' @(198,21)->(198,39))","def get_mesh_major_list(document_dict,decsCodes_list_dict,with_header): #Method
+ else:
+ if len(header_before_slash) != 0:
+ final_header = str(header_code) +'/'+ str(header_after_slash)
+ elif len(header_after_slash) == 0:
+ final_header = '/' + str(decsCodes_list_dict)
+ else:
+ print(header,""--"",header_before_slash,""--"",header_after_slash)","def get_mesh_major_list(document_dict,decsCodes_list_dict,with_header): #Method
+ else:
+ if len(header_before_slash) != 0:
+ final_header = str(header_code) +'/'+ str(header_after_slash)
+ elif len(header_before_slash) == 0:
+ final_header = '/' + str(decsCodes_list_dict)
+ else:
+ print(header,""--"",header_before_slash,""--"",header_after_slash)"
+801,https://:@github.com/Hypers-HFA/paraer.git,8a5fd8156012b94e50b1e6a3413244b95f3e323b,"@@ -112,7 +112,7 @@ def para_ok_or_400(itemset):
+ ]
+ value = None # 与 '' 区别
+ para = paramap.get(name)
+- if required and para not in (None, ''): # 如果是post方法并且传参是json的话,para可能为0
++ if required and para in (None, ''): # 如果是post方法并且传参是json的话,para可能为0
+ result.error(name, 'required')
+ if para is not None:
+ if para:
+",paraer/para.py,"ReplaceText(target=' in ' @(115,36)->(115,44))","def para_ok_or_400(itemset):
+ ]
+ value = None # 与 '' 区别
+ para = paramap.get(name)
+ if required and para not in (None, ''): # 如果是post方法并且传参是json的话,para可能为0
+ result.error(name, 'required')
+ if para is not None:
+ if para:","def para_ok_or_400(itemset):
+ ]
+ value = None # 与 '' 区别
+ para = paramap.get(name)
+ if required and para in (None, ''): # 如果是post方法并且传参是json的话,para可能为0
+ result.error(name, 'required')
+ if para is not None:
+ if para:"
+802,https://:@github.com/davidenunes/tensorx.git,34fb24ae4eeca927a7d7b5f376aeeddbb0b7aacd,"@@ -2604,7 +2604,7 @@ class SaltPepperNoise(Layer):
+ else:
+ batch_size = noise_shape[0]
+
+- noise = salt_pepper_noise(batch_size, noise_shape[1], density, salt_value, pepper_value, seed)
++ noise = salt_pepper_noise(noise_shape[1], batch_size, density, salt_value, pepper_value, seed)
+
+ if layer.is_sparse():
+ tensor = transform.sparse_put(layer.tensor, noise)
+",tensorx/layers.py,"ArgSwap(idxs=0<->1 @(2607,24)->(2607,41))","class SaltPepperNoise(Layer):
+ else:
+ batch_size = noise_shape[0]
+
+ noise = salt_pepper_noise(batch_size, noise_shape[1], density, salt_value, pepper_value, seed)
+
+ if layer.is_sparse():
+ tensor = transform.sparse_put(layer.tensor, noise)","class SaltPepperNoise(Layer):
+ else:
+ batch_size = noise_shape[0]
+
+ noise = salt_pepper_noise(noise_shape[1], batch_size, density, salt_value, pepper_value, seed)
+
+ if layer.is_sparse():
+ tensor = transform.sparse_put(layer.tensor, noise)"
+803,https://:@github.com/sauliusl/dgw.git,9120263028d2e64983b9b9babe31c46b8f2caedd,"@@ -98,7 +98,7 @@ def dtw_std(x, y, metric='sqeuclidean', dist_only=True, constraint=None, k=None,
+ path_rev = (_reverse_path(path[0]), path[1])
+
+ if scale_first:
+- path_rev = _scaled_path(path, scaling_path, flip_paths)
++ path_rev = _scaled_path(path_rev, scaling_path, flip_paths)
+
+ # TODO: Reverse cost matrix here
+ cost = None
+",dgw/dtw/distance.py,"ReplaceText(target='path_rev' @(101,40)->(101,44))","def dtw_std(x, y, metric='sqeuclidean', dist_only=True, constraint=None, k=None,
+ path_rev = (_reverse_path(path[0]), path[1])
+
+ if scale_first:
+ path_rev = _scaled_path(path, scaling_path, flip_paths)
+
+ # TODO: Reverse cost matrix here
+ cost = None","def dtw_std(x, y, metric='sqeuclidean', dist_only=True, constraint=None, k=None,
+ path_rev = (_reverse_path(path[0]), path[1])
+
+ if scale_first:
+ path_rev = _scaled_path(path_rev, scaling_path, flip_paths)
+
+ # TODO: Reverse cost matrix here
+ cost = None"
+804,https://:@bitbucket.org/slicedice/aboutyou-shop-sdk-python.git,c125675219cbb473f47c78c57e9205d1be44d4f2,"@@ -439,7 +439,7 @@ class Search(object):
+ else:
+ product = Product(self.easy, p)
+
+- self.easy.product_cach[p.id] = product
++ self.easy.product_cach[product.id] = product
+ self.products.buffer[i+offset] = product
+
+
+",collins/easy.py,"ReplaceText(target='product' @(442,35)->(442,36))","class Search(object):
+ else:
+ product = Product(self.easy, p)
+
+ self.easy.product_cach[p.id] = product
+ self.products.buffer[i+offset] = product
+
+ ","class Search(object):
+ else:
+ product = Product(self.easy, p)
+
+ self.easy.product_cach[product.id] = product
+ self.products.buffer[i+offset] = product
+
+ "
+805,https://:@github.com/neizod/extmath.git,b66496463e3d724a29d652e97867f41e4e1d2aea,"@@ -117,7 +117,7 @@ def factorized(n):
+ break
+ while not n % i:
+ factor.append(i)
+- n /= i
++ n //= i
+ if n == 1:
+ break
+ return factor
+",mathapi/__init__.py,"ReplaceText(target='//=' @(120,14)->(120,16))","def factorized(n):
+ break
+ while not n % i:
+ factor.append(i)
+ n /= i
+ if n == 1:
+ break
+ return factor","def factorized(n):
+ break
+ while not n % i:
+ factor.append(i)
+ n //= i
+ if n == 1:
+ break
+ return factor"
+806,https://:@github.com/storborg/axibot.git,4ffd9fc0f715bbe4ae8c1708fbeae45186d35f6e,"@@ -64,7 +64,7 @@ async def handle_user_message(app, ws, msg):
+ except Exception as e:
+ notify_error(app, ws, str(e))
+ else:
+- app['document'] = msg.document
++ app['document'] = job.document
+ app['job'] = job
+ app['estimated_time'] = job.duration().total_seconds()
+ notify_new_document(app, exclude_client=ws)
+",axibot/server/handlers.py,"ReplaceText(target='job' @(67,30)->(67,33))","async def handle_user_message(app, ws, msg):
+ except Exception as e:
+ notify_error(app, ws, str(e))
+ else:
+ app['document'] = msg.document
+ app['job'] = job
+ app['estimated_time'] = job.duration().total_seconds()
+ notify_new_document(app, exclude_client=ws)","async def handle_user_message(app, ws, msg):
+ except Exception as e:
+ notify_error(app, ws, str(e))
+ else:
+ app['document'] = job.document
+ app['job'] = job
+ app['estimated_time'] = job.duration().total_seconds()
+ notify_new_document(app, exclude_client=ws)"
+807,https://:@github.com/storborg/axibot.git,4ad752828696a789ef25fa001f1489f87344c3e4,"@@ -116,7 +116,7 @@ async def client_handler(request):
+ elif raw_msg.tp == aiohttp.MsgType.closed:
+ break
+ elif raw_msg.tp == aiohttp.MsgType.error:
+- log.info(""User websocket error: %s"", msg)
++ log.info(""User websocket error: %s"", raw_msg)
+ break
+ else:
+ log.error(""Unknown user message type: %s, ignoring."",
+",axibot/server/handlers.py,"ReplaceText(target='raw_msg' @(119,53)->(119,56))","async def client_handler(request):
+ elif raw_msg.tp == aiohttp.MsgType.closed:
+ break
+ elif raw_msg.tp == aiohttp.MsgType.error:
+ log.info(""User websocket error: %s"", msg)
+ break
+ else:
+ log.error(""Unknown user message type: %s, ignoring."",","async def client_handler(request):
+ elif raw_msg.tp == aiohttp.MsgType.closed:
+ break
+ elif raw_msg.tp == aiohttp.MsgType.error:
+ log.info(""User websocket error: %s"", raw_msg)
+ break
+ else:
+ log.error(""Unknown user message type: %s, ignoring."","
+808,https://:@github.com/tsuyukimakoto/biisan.git,4465b109a4e71dcb64499c14b579c762e54b4db4,"@@ -116,7 +116,7 @@ def process_image(elm, registry, container):
+ img.alt = subitem[1]
+ elif subitem[0] == 'witdh':
+ img.witdh = subitem[1]
+- elif subitem[1] == 'height':
++ elif subitem[0] == 'height':
+ img.height = subitem[1]
+ elif subitem[0] == 'uri':
+ img.uri = subitem[1]
+",biisan/processors/__init__.py,"ReplaceText(target='0' @(119,21)->(119,22))","def process_image(elm, registry, container):
+ img.alt = subitem[1]
+ elif subitem[0] == 'witdh':
+ img.witdh = subitem[1]
+ elif subitem[1] == 'height':
+ img.height = subitem[1]
+ elif subitem[0] == 'uri':
+ img.uri = subitem[1]","def process_image(elm, registry, container):
+ img.alt = subitem[1]
+ elif subitem[0] == 'witdh':
+ img.witdh = subitem[1]
+ elif subitem[0] == 'height':
+ img.height = subitem[1]
+ elif subitem[0] == 'uri':
+ img.uri = subitem[1]"
+809,https://:@github.com/csm10495/csmlog.git,010e00e53545842d2dc1342c375c068c90138ca2,"@@ -262,7 +262,7 @@ def test_gsheets_calculate_periodic_loop_sleep_time(gsheets_handler_no_thread):
+ def test_gsheets_add_rows_to_active_sheet_sets_add_rows_time(gsheets_handler_no_thread):
+ gsheets_handler_no_thread._add_rows_time = 99
+ assert isinstance(gsheets_handler_no_thread._add_rows_to_active_sheet([]), unittest.mock.Mock)
+- assert gsheets_handler_no_thread._add_rows_time < 99 and gsheets_handler_no_thread._add_rows_time > 0
++ assert gsheets_handler_no_thread._add_rows_time < 99 and gsheets_handler_no_thread._add_rows_time >= 0
+
+ def test_gsheets_add_rows_to_active_sheet_set_coerce_to_correct_exceptions(gsheets_handler_no_thread):
+ with unittest.mock.patch.object(gsheets_handler_no_thread.sheet, 'append_rows', side_effect=Exception(""RESOURCE_EXHAUSTED uh-oh"")) as mock:
+",csmlog/tests/test_google_sheets_handler.py,"ReplaceText(target='>=' @(265,102)->(265,103))","def test_gsheets_calculate_periodic_loop_sleep_time(gsheets_handler_no_thread):
+ def test_gsheets_add_rows_to_active_sheet_sets_add_rows_time(gsheets_handler_no_thread):
+ gsheets_handler_no_thread._add_rows_time = 99
+ assert isinstance(gsheets_handler_no_thread._add_rows_to_active_sheet([]), unittest.mock.Mock)
+ assert gsheets_handler_no_thread._add_rows_time < 99 and gsheets_handler_no_thread._add_rows_time > 0
+
+ def test_gsheets_add_rows_to_active_sheet_set_coerce_to_correct_exceptions(gsheets_handler_no_thread):
+ with unittest.mock.patch.object(gsheets_handler_no_thread.sheet, 'append_rows', side_effect=Exception(""RESOURCE_EXHAUSTED uh-oh"")) as mock:","def test_gsheets_calculate_periodic_loop_sleep_time(gsheets_handler_no_thread):
+ def test_gsheets_add_rows_to_active_sheet_sets_add_rows_time(gsheets_handler_no_thread):
+ gsheets_handler_no_thread._add_rows_time = 99
+ assert isinstance(gsheets_handler_no_thread._add_rows_to_active_sheet([]), unittest.mock.Mock)
+ assert gsheets_handler_no_thread._add_rows_time < 99 and gsheets_handler_no_thread._add_rows_time >= 0
+
+ def test_gsheets_add_rows_to_active_sheet_set_coerce_to_correct_exceptions(gsheets_handler_no_thread):
+ with unittest.mock.patch.object(gsheets_handler_no_thread.sheet, 'append_rows', side_effect=Exception(""RESOURCE_EXHAUSTED uh-oh"")) as mock:"
+810,https://:@github.com/JorrandeWit/django-oscar-fees.git,7d18c7bdbeb881f4af5f81c1adf989422e134995,"@@ -26,7 +26,7 @@ class FeeApplications(object):
+ 'fee': fee,
+ 'result': result,
+ 'name': fee.name,
+- 'description': result.description,
++ 'description': fee.description,
+ 'freq': 0,
+ 'amount': D('0.00')}
+ self.applications[fee.id]['amount'] += result.fee
+",django_oscar_fees/results.py,"ReplaceText(target='fee' @(29,31)->(29,37))","class FeeApplications(object):
+ 'fee': fee,
+ 'result': result,
+ 'name': fee.name,
+ 'description': result.description,
+ 'freq': 0,
+ 'amount': D('0.00')}
+ self.applications[fee.id]['amount'] += result.fee","class FeeApplications(object):
+ 'fee': fee,
+ 'result': result,
+ 'name': fee.name,
+ 'description': fee.description,
+ 'freq': 0,
+ 'amount': D('0.00')}
+ self.applications[fee.id]['amount'] += result.fee"
+811,https://:@gitlab.com/yhtang/graphdot.git,2ac46e719092b1e78bc2bd860bce1dd23e152638,"@@ -27,7 +27,7 @@ class OctileGraph(object):
+ nnz = len(edges)
+
+ ''' add phantom label if none exists to facilitate C++ interop '''
+- assert(len(edges.columns) >= 1)
++ assert(len(nodes.columns) >= 1)
+ if len(nodes.columns) == 1:
+ nodes['labeled'] = np.zeros(len(nodes), np.bool_)
+
+",graphdot/kernel/marginalized/_octilegraph.py,"ReplaceText(target='nodes' @(30,19)->(30,24))","class OctileGraph(object):
+ nnz = len(edges)
+
+ ''' add phantom label if none exists to facilitate C++ interop '''
+ assert(len(edges.columns) >= 1)
+ if len(nodes.columns) == 1:
+ nodes['labeled'] = np.zeros(len(nodes), np.bool_)
+ ","class OctileGraph(object):
+ nnz = len(edges)
+
+ ''' add phantom label if none exists to facilitate C++ interop '''
+ assert(len(nodes.columns) >= 1)
+ if len(nodes.columns) == 1:
+ nodes['labeled'] = np.zeros(len(nodes), np.bool_)
+ "
+812,https://:@gitlab.com/yhtang/graphdot.git,c1d46fe384aaac63a6e32b0a30cf6f3aa2b04183,"@@ -315,7 +315,7 @@ class MarginalizedGraphKernel:
+ if traits.eval_gradient is True:
+ output_shape = (output_length, 1 + self.n_dims)
+ else:
+- output_shape = (output_shape, 1)
++ output_shape = (output_length, 1)
+ output = backend.empty(int(np.prod(output_shape)), np.float32)
+ timer.toc('creating output buffer')
+
+",graphdot/kernel/marginalized/_kernel.py,"ReplaceText(target='output_length' @(318,28)->(318,40))","class MarginalizedGraphKernel:
+ if traits.eval_gradient is True:
+ output_shape = (output_length, 1 + self.n_dims)
+ else:
+ output_shape = (output_shape, 1)
+ output = backend.empty(int(np.prod(output_shape)), np.float32)
+ timer.toc('creating output buffer')
+ ","class MarginalizedGraphKernel:
+ if traits.eval_gradient is True:
+ output_shape = (output_length, 1 + self.n_dims)
+ else:
+ output_shape = (output_length, 1)
+ output = backend.empty(int(np.prod(output_shape)), np.float32)
+ timer.toc('creating output buffer')
+ "
+813,https://:@gitlab.com/yhtang/graphdot.git,f1499423ac76e790b77f729e92b2cc3223d64f58,"@@ -117,7 +117,7 @@ class SpectralApprox(FactorApprox):
+ def __init__(self, X, rcut=0, acut=0):
+ if isinstance(X, np.ndarray):
+ U, S, _ = np.linalg.svd(X, full_matrices=False)
+- mask = (S >= S.max() * rcut) | (S >= acut)
++ mask = (S >= S.max() * rcut) & (S >= acut)
+ self.U = U[:, mask]
+ self.S = S[mask]
+ elif isinstance(X, tuple) and len(X) == 2:
+",graphdot/linalg/low_rank.py,"ReplaceText(target='&' @(120,41)->(120,42))","class SpectralApprox(FactorApprox):
+ def __init__(self, X, rcut=0, acut=0):
+ if isinstance(X, np.ndarray):
+ U, S, _ = np.linalg.svd(X, full_matrices=False)
+ mask = (S >= S.max() * rcut) | (S >= acut)
+ self.U = U[:, mask]
+ self.S = S[mask]
+ elif isinstance(X, tuple) and len(X) == 2:","class SpectralApprox(FactorApprox):
+ def __init__(self, X, rcut=0, acut=0):
+ if isinstance(X, np.ndarray):
+ U, S, _ = np.linalg.svd(X, full_matrices=False)
+ mask = (S >= S.max() * rcut) & (S >= acut)
+ self.U = U[:, mask]
+ self.S = S[mask]
+ elif isinstance(X, tuple) and len(X) == 2:"
+814,https://:@github.com/straga/micropython.git,1679696612007107dac55d936006b1923eda2475,"@@ -7,7 +7,7 @@ desc = {
+
+ data = bytearray(b""01234567"")
+
+-S = uctypes.struct(desc, uctypes.addressof(data), uctypes.LITTLE_ENDIAN)
++S = uctypes.struct(uctypes.addressof(data), desc, uctypes.LITTLE_ENDIAN)
+
+ # Arrays of UINT8 are accessed as bytearrays
+ print(S.arr)
+",tests/extmod/uctypes_bytearray.py,"ArgSwap(idxs=0<->1 @(10,4)->(10,18))","desc = {
+
+ data = bytearray(b""01234567"")
+
+ S = uctypes.struct(desc, uctypes.addressof(data), uctypes.LITTLE_ENDIAN)
+
+ # Arrays of UINT8 are accessed as bytearrays
+ print(S.arr)","desc = {
+
+ data = bytearray(b""01234567"")
+
+ S = uctypes.struct(uctypes.addressof(data), desc, uctypes.LITTLE_ENDIAN)
+
+ # Arrays of UINT8 are accessed as bytearrays
+ print(S.arr)"
+815,https://:@github.com/straga/micropython.git,1679696612007107dac55d936006b1923eda2475,"@@ -22,7 +22,7 @@ desc = {
+
+ data = bytearray(b""01"")
+
+-S = uctypes.struct(desc, uctypes.addressof(data), uctypes.LITTLE_ENDIAN)
++S = uctypes.struct(uctypes.addressof(data), desc, uctypes.LITTLE_ENDIAN)
+
+ #print(S)
+ print(hex(S.s0))
+",tests/extmod/uctypes_le.py,"ArgSwap(idxs=0<->1 @(25,4)->(25,18))","desc = {
+
+ data = bytearray(b""01"")
+
+ S = uctypes.struct(desc, uctypes.addressof(data), uctypes.LITTLE_ENDIAN)
+
+ #print(S)
+ print(hex(S.s0))","desc = {
+
+ data = bytearray(b""01"")
+
+ S = uctypes.struct(uctypes.addressof(data), desc, uctypes.LITTLE_ENDIAN)
+
+ #print(S)
+ print(hex(S.s0))"
+816,https://:@github.com/straga/micropython.git,1679696612007107dac55d936006b1923eda2475,"@@ -31,7 +31,7 @@ desc = {
+
+ data = bytearray(b""01"")
+
+-S = uctypes.struct(desc, uctypes.addressof(data), uctypes.NATIVE)
++S = uctypes.struct(uctypes.addressof(data), desc, uctypes.NATIVE)
+
+ #print(S)
+ print(hex(S.s0))
+",tests/extmod/uctypes_native_le.py,"ArgSwap(idxs=0<->1 @(34,4)->(34,18))","desc = {
+
+ data = bytearray(b""01"")
+
+ S = uctypes.struct(desc, uctypes.addressof(data), uctypes.NATIVE)
+
+ #print(S)
+ print(hex(S.s0))","desc = {
+
+ data = bytearray(b""01"")
+
+ S = uctypes.struct(uctypes.addressof(data), desc, uctypes.NATIVE)
+
+ #print(S)
+ print(hex(S.s0))"
+817,https://:@github.com/straga/micropython.git,1679696612007107dac55d936006b1923eda2475,"@@ -16,7 +16,7 @@ bytes = b""01""
+ addr = uctypes.addressof(bytes)
+ buf = addr.to_bytes(uctypes.sizeof(desc))
+
+-S = uctypes.struct(desc, uctypes.addressof(buf), uctypes.LITTLE_ENDIAN)
++S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.LITTLE_ENDIAN)
+
+ print(S.ptr[0])
+ assert S.ptr[0] == ord(""0"")
+",tests/extmod/uctypes_ptr_le.py,"ArgSwap(idxs=0<->1 @(19,4)->(19,18))","bytes = b""01""
+ addr = uctypes.addressof(bytes)
+ buf = addr.to_bytes(uctypes.sizeof(desc))
+
+ S = uctypes.struct(desc, uctypes.addressof(buf), uctypes.LITTLE_ENDIAN)
+
+ print(S.ptr[0])
+ assert S.ptr[0] == ord(""0"")","bytes = b""01""
+ addr = uctypes.addressof(bytes)
+ buf = addr.to_bytes(uctypes.sizeof(desc))
+
+ S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.LITTLE_ENDIAN)
+
+ print(S.ptr[0])
+ assert S.ptr[0] == ord(""0"")"
+818,https://:@github.com/IL2HorusTeam/il2fb-ds-airbridge.git,bc69d1a47a4994071d0b46c7dd29aebf6a7d4169,"@@ -60,7 +60,7 @@ class TextFileWatchDog:
+
+ def stop(self) -> None:
+ with self._stop_lock:
+- self._do_stop = False
++ self._do_stop = True
+
+ def run(self) -> None:
+ try:
+",il2fb/ds/airbridge/watch_dog.py,"ReplaceText(target='True' @(63,28)->(63,33))","class TextFileWatchDog:
+
+ def stop(self) -> None:
+ with self._stop_lock:
+ self._do_stop = False
+
+ def run(self) -> None:
+ try:","class TextFileWatchDog:
+
+ def stop(self) -> None:
+ with self._stop_lock:
+ self._do_stop = True
+
+ def run(self) -> None:
+ try:"
+819,https://:@github.com/south-coast-science/scs_dfe_eng.git,060bd36c51a20f4586ed199b1e3996c70b0318a7,"@@ -49,7 +49,7 @@ class AFE(object):
+ self.__wrk_adc = ADS1115(ADS1115.ADDR_WRK, AFE.__RATE)
+ self.__aux_adc = ADS1115(ADS1115.ADDR_AUX, AFE.__RATE)
+
+- self.__pt1000_adc = pt1000_conf.adc(MCP342X.GAIN_4, MCP342X.RATE_15) if pt1000_conf else None
++ self.__pt1000_adc = pt1000_conf.adc(MCP342X.GAIN_4, MCP342X.RATE_15) if pt1000 else None
+
+ self.__tconv = self.__wrk_adc.tconv
+
+",scs_dfe/gas/afe.py,"ReplaceText(target='pt1000' @(52,80)->(52,91))","class AFE(object):
+ self.__wrk_adc = ADS1115(ADS1115.ADDR_WRK, AFE.__RATE)
+ self.__aux_adc = ADS1115(ADS1115.ADDR_AUX, AFE.__RATE)
+
+ self.__pt1000_adc = pt1000_conf.adc(MCP342X.GAIN_4, MCP342X.RATE_15) if pt1000_conf else None
+
+ self.__tconv = self.__wrk_adc.tconv
+ ","class AFE(object):
+ self.__wrk_adc = ADS1115(ADS1115.ADDR_WRK, AFE.__RATE)
+ self.__aux_adc = ADS1115(ADS1115.ADDR_AUX, AFE.__RATE)
+
+ self.__pt1000_adc = pt1000_conf.adc(MCP342X.GAIN_4, MCP342X.RATE_15) if pt1000 else None
+
+ self.__tconv = self.__wrk_adc.tconv
+ "
+820,https://:@github.com/ionox0/toil.git,3f065a27c433b1cb9c5266ed4c28b643419d4466,"@@ -456,7 +456,7 @@ def mainLoop(config, batchSystem):
+ reissueOverLongJobs(updatedJobFiles, jobBatcher, config, batchSystem, childJobFileToParentJob, childCounts)
+ logger.info(""Reissued any over long jobs"")
+
+- hasNoMissingJobs = reissueMissingJobs(updatedJobFiles, jobBatcher, batchSystem, childJobFileToParentJob, config, childCounts)
++ hasNoMissingJobs = reissueMissingJobs(updatedJobFiles, jobBatcher, batchSystem, childJobFileToParentJob, childCounts, config)
+ if hasNoMissingJobs:
+ timeSinceJobsLastRescued = time.time()
+ else:
+",src/master.py,"ArgSwap(idxs=4<->5 @(459,35)->(459,53))","def mainLoop(config, batchSystem):
+ reissueOverLongJobs(updatedJobFiles, jobBatcher, config, batchSystem, childJobFileToParentJob, childCounts)
+ logger.info(""Reissued any over long jobs"")
+
+ hasNoMissingJobs = reissueMissingJobs(updatedJobFiles, jobBatcher, batchSystem, childJobFileToParentJob, config, childCounts)
+ if hasNoMissingJobs:
+ timeSinceJobsLastRescued = time.time()
+ else:","def mainLoop(config, batchSystem):
+ reissueOverLongJobs(updatedJobFiles, jobBatcher, config, batchSystem, childJobFileToParentJob, childCounts)
+ logger.info(""Reissued any over long jobs"")
+
+ hasNoMissingJobs = reissueMissingJobs(updatedJobFiles, jobBatcher, batchSystem, childJobFileToParentJob, childCounts, config)
+ if hasNoMissingJobs:
+ timeSinceJobsLastRescued = time.time()
+ else:"
+821,https://:@github.com/ionox0/toil.git,a0e4eadb87f09791088b6c11dc6aec0bf8002991,"@@ -99,7 +99,7 @@ please ensure you re-import targets defined in main"" % self.__class__.__name__)
+ """"""Takes a file (as a path) and uploads it to to the global file store, returns
+ an ID that can be used to retrieve the file.
+ """"""
+- return self.jobStore.writeFile(localFileName, self.job.jobStoreID)
++ return self.jobStore.writeFile(self.job.jobStoreID, localFileName)
+
+ def updateGlobalFile(self, fileStoreID, localFileName):
+ """"""Replaces the existing version of a file in the global file store, keyed by the fileStoreID.
+",src/target.py,"ArgSwap(idxs=0<->1 @(102,15)->(102,38))","please ensure you re-import targets defined in main"" % self.__class__.__name__)
+ """"""Takes a file (as a path) and uploads it to to the global file store, returns
+ an ID that can be used to retrieve the file.
+ """"""
+ return self.jobStore.writeFile(localFileName, self.job.jobStoreID)
+
+ def updateGlobalFile(self, fileStoreID, localFileName):
+ """"""Replaces the existing version of a file in the global file store, keyed by the fileStoreID. ","please ensure you re-import targets defined in main"" % self.__class__.__name__)
+ """"""Takes a file (as a path) and uploads it to to the global file store, returns
+ an ID that can be used to retrieve the file.
+ """"""
+ return self.jobStore.writeFile(self.job.jobStoreID, localFileName)
+
+ def updateGlobalFile(self, fileStoreID, localFileName):
+ """"""Replaces the existing version of a file in the global file store, keyed by the fileStoreID. "
+822,https://:@github.com/ionox0/toil.git,06718f425d5981afabd30bcfa39d866edb5c09b4,"@@ -46,7 +46,7 @@ class Job( object ):
+ #The IDs of predecessors that have finished.
+ #When len(predecessorsFinished) == predecessorNumber then the
+ #job can be run.
+- self.predecessorsFinished = predecessorNumber or set()
++ self.predecessorsFinished = predecessorsFinished or set()
+
+ #The list of successor jobs to run. Successor jobs are stored
+ #as 4-tuples of the form (jobStoreId, memory, cpu, predecessorNumber).
+",src/jobTree/job.py,"ReplaceText(target='predecessorsFinished' @(49,36)->(49,53))","class Job( object ):
+ #The IDs of predecessors that have finished.
+ #When len(predecessorsFinished) == predecessorNumber then the
+ #job can be run.
+ self.predecessorsFinished = predecessorNumber or set()
+
+ #The list of successor jobs to run. Successor jobs are stored
+ #as 4-tuples of the form (jobStoreId, memory, cpu, predecessorNumber).","class Job( object ):
+ #The IDs of predecessors that have finished.
+ #When len(predecessorsFinished) == predecessorNumber then the
+ #job can be run.
+ self.predecessorsFinished = predecessorsFinished or set()
+
+ #The list of successor jobs to run. Successor jobs are stored
+ #as 4-tuples of the form (jobStoreId, memory, cpu, predecessorNumber)."
+823,https://:@github.com/ionox0/toil.git,47ec5287d747036c524100cc49fa4262a73293cf,"@@ -107,7 +107,7 @@ class JobWrapper( object ):
+ """"""
+ if self.logJobStoreFileID is not None:
+ self.clearLogFile(jobStore)
+- self.logJobStoreFileID = jobStore.writeFile( self.jobStoreID, logFile )
++ self.logJobStoreFileID = jobStore.writeFile( logFile, self.jobStoreID )
+ assert self.logJobStoreFileID is not None
+
+ def getLogFileHandle( self, jobStore ):
+",src/toil/jobWrapper.py,"ArgSwap(idxs=0<->1 @(110,33)->(110,51))","class JobWrapper( object ):
+ """"""
+ if self.logJobStoreFileID is not None:
+ self.clearLogFile(jobStore)
+ self.logJobStoreFileID = jobStore.writeFile( self.jobStoreID, logFile )
+ assert self.logJobStoreFileID is not None
+
+ def getLogFileHandle( self, jobStore ):","class JobWrapper( object ):
+ """"""
+ if self.logJobStoreFileID is not None:
+ self.clearLogFile(jobStore)
+ self.logJobStoreFileID = jobStore.writeFile( logFile, self.jobStoreID )
+ assert self.logJobStoreFileID is not None
+
+ def getLogFileHandle( self, jobStore ):"
+824,https://:@github.com/ionox0/toil.git,cad17f6cbe391264e00675c51a8bfe9221ba1091,"@@ -159,7 +159,7 @@ class AbstractJobStore( object ):
+ break
+
+ #Reset the retry count of the jobWrapper
+- if jobWrapper.remainingRetryCount < self._defaultTryCount():
++ if jobWrapper.remainingRetryCount != self._defaultTryCount():
+ jobWrapper.remainingRetryCount = self._defaultTryCount()
+ changed = True
+
+",src/toil/jobStores/abstractJobStore.py,"ReplaceText(target='!=' @(162,46)->(162,47))","class AbstractJobStore( object ):
+ break
+
+ #Reset the retry count of the jobWrapper
+ if jobWrapper.remainingRetryCount < self._defaultTryCount():
+ jobWrapper.remainingRetryCount = self._defaultTryCount()
+ changed = True
+ ","class AbstractJobStore( object ):
+ break
+
+ #Reset the retry count of the jobWrapper
+ if jobWrapper.remainingRetryCount != self._defaultTryCount():
+ jobWrapper.remainingRetryCount = self._defaultTryCount()
+ changed = True
+ "
+825,https://:@github.com/ionox0/toil.git,dcd5e6f86c0f9d376140f4626e97666348683b73,"@@ -437,7 +437,7 @@ class ModuleDescriptor(namedtuple('ModuleDescriptor', ('dirPath', 'name'))):
+
+ :rtype: toil.resource.Resource
+ """"""
+- if self._runningOnWorker():
++ if not self._runningOnWorker():
+ log.warn('The localize() method should only be invoked on a worker.')
+ resource = Resource.lookup(self._resourcePath)
+ if resource is None:
+",src/toil/resource.py,"ReplaceText(target='not ' @(440,11)->(440,11))","class ModuleDescriptor(namedtuple('ModuleDescriptor', ('dirPath', 'name'))):
+
+ :rtype: toil.resource.Resource
+ """"""
+ if self._runningOnWorker():
+ log.warn('The localize() method should only be invoked on a worker.')
+ resource = Resource.lookup(self._resourcePath)
+ if resource is None:","class ModuleDescriptor(namedtuple('ModuleDescriptor', ('dirPath', 'name'))):
+
+ :rtype: toil.resource.Resource
+ """"""
+ if not self._runningOnWorker():
+ log.warn('The localize() method should only be invoked on a worker.')
+ resource = Resource.lookup(self._resourcePath)
+ if resource is None:"
+826,https://:@github.com/ionox0/toil.git,bee00f3fc4f68af0e7c00b884627f728ca20f792,"@@ -649,7 +649,7 @@ def main(args=None, stdout=sys.stdout):
+ if options.logLevel:
+ cwllogger.setLevel(options.logLevel)
+
+- useStrict = not args.not_strict
++ useStrict = not options.not_strict
+ try:
+ t = cwltool.load_tool.load_tool(options.cwltool, cwltool.workflow.defaultMakeTool,
+ resolver=cwltool.resolver.tool_resolver, strict=useStrict)
+",src/toil/cwl/cwltoil.py,"ReplaceText(target='options' @(652,20)->(652,24))","def main(args=None, stdout=sys.stdout):
+ if options.logLevel:
+ cwllogger.setLevel(options.logLevel)
+
+ useStrict = not args.not_strict
+ try:
+ t = cwltool.load_tool.load_tool(options.cwltool, cwltool.workflow.defaultMakeTool,
+ resolver=cwltool.resolver.tool_resolver, strict=useStrict)","def main(args=None, stdout=sys.stdout):
+ if options.logLevel:
+ cwllogger.setLevel(options.logLevel)
+
+ useStrict = not options.not_strict
+ try:
+ t = cwltool.load_tool.load_tool(options.cwltool, cwltool.workflow.defaultMakeTool,
+ resolver=cwltool.resolver.tool_resolver, strict=useStrict)"
+827,https://:@github.com/ionox0/toil.git,231b6665bde956aae5b3469a7147e2358097fca4,"@@ -143,7 +143,7 @@ class SingleMachineBatchSystem(BatchSystemSupport):
+ startTime = time.time() # Time job is started
+ popen = None
+ statusCode = None
+- forkWorker = not (self.debugWorker and ""_toil_worker"" not in jobCommand)
++ forkWorker = not (self.debugWorker and ""_toil_worker"" in jobCommand)
+ if forkWorker:
+ with self.popenLock:
+ popen = subprocess.Popen(jobCommand,
+",src/toil/batchSystems/singleMachine.py,"ReplaceText(target=' in ' @(146,61)->(146,69))","class SingleMachineBatchSystem(BatchSystemSupport):
+ startTime = time.time() # Time job is started
+ popen = None
+ statusCode = None
+ forkWorker = not (self.debugWorker and ""_toil_worker"" not in jobCommand)
+ if forkWorker:
+ with self.popenLock:
+ popen = subprocess.Popen(jobCommand,","class SingleMachineBatchSystem(BatchSystemSupport):
+ startTime = time.time() # Time job is started
+ popen = None
+ statusCode = None
+ forkWorker = not (self.debugWorker and ""_toil_worker"" in jobCommand)
+ if forkWorker:
+ with self.popenLock:
+ popen = subprocess.Popen(jobCommand,"
+828,https://:@github.com/ionox0/toil.git,f5054aca67788f976c72b1e3f42334afe3a1dfaa,"@@ -138,7 +138,7 @@ class AbstractProvisioner(with_metaclass(ABCMeta, object)):
+ self._spotBidsMap[nodeType] = bid
+ else:
+ self.nodeTypes.append(nodeTypeStr)
+- self.nodeShapes.append(self.getNodeShape(nodeType, preemptable=False))
++ self.nodeShapes.append(self.getNodeShape(nodeTypeStr, preemptable=False))
+
+ @staticmethod
+ def retryPredicate(e):
+",src/toil/provisioners/abstractProvisioner.py,"ReplaceText(target='nodeTypeStr' @(141,57)->(141,65))","class AbstractProvisioner(with_metaclass(ABCMeta, object)):
+ self._spotBidsMap[nodeType] = bid
+ else:
+ self.nodeTypes.append(nodeTypeStr)
+ self.nodeShapes.append(self.getNodeShape(nodeType, preemptable=False))
+
+ @staticmethod
+ def retryPredicate(e):","class AbstractProvisioner(with_metaclass(ABCMeta, object)):
+ self._spotBidsMap[nodeType] = bid
+ else:
+ self.nodeTypes.append(nodeTypeStr)
+ self.nodeShapes.append(self.getNodeShape(nodeTypeStr, preemptable=False))
+
+ @staticmethod
+ def retryPredicate(e):"
+829,https://:@github.com/ionox0/toil.git,59f716aed0363adba211e7c1f18ebe3802edb636,"@@ -108,7 +108,7 @@ class GridEngineBatchSystem(AbstractGridEngineBatchSystem):
+ if not self.boss.config.manualMemArgs:
+ # for UGE instead of SGE; see #2309
+ reqline += ['vf=' + memStr, 'h_vmem=' + memStr]
+- elif self.boss.config.manualMemArgs and sgeArgs:
++ elif self.boss.config.manualMemArgs and not sgeArgs:
+ raise ValueError(""--manualMemArgs set to True, but TOIL_GRIDGENGINE_ARGS is not set.""
+ ""Please set TOIL_GRIDGENGINE_ARGS to specify memory allocation for ""
+ ""your system. Default adds the arguments: vf= h_vmem= ""
+",src/toil/batchSystems/gridengine.py,"ReplaceText(target='not ' @(111,56)->(111,56))","class GridEngineBatchSystem(AbstractGridEngineBatchSystem):
+ if not self.boss.config.manualMemArgs:
+ # for UGE instead of SGE; see #2309
+ reqline += ['vf=' + memStr, 'h_vmem=' + memStr]
+ elif self.boss.config.manualMemArgs and sgeArgs:
+ raise ValueError(""--manualMemArgs set to True, but TOIL_GRIDGENGINE_ARGS is not set.""
+ ""Please set TOIL_GRIDGENGINE_ARGS to specify memory allocation for ""
+ ""your system. Default adds the arguments: vf= h_vmem= ""","class GridEngineBatchSystem(AbstractGridEngineBatchSystem):
+ if not self.boss.config.manualMemArgs:
+ # for UGE instead of SGE; see #2309
+ reqline += ['vf=' + memStr, 'h_vmem=' + memStr]
+ elif self.boss.config.manualMemArgs and not sgeArgs:
+ raise ValueError(""--manualMemArgs set to True, but TOIL_GRIDGENGINE_ARGS is not set.""
+ ""Please set TOIL_GRIDGENGINE_ARGS to specify memory allocation for ""
+ ""your system. Default adds the arguments: vf= h_vmem= """
+830,https://:@github.com/tkf/railgun.git,f49414f39ca7c6bbbd5e000d45db46b77a4e514d,"@@ -64,7 +64,7 @@ DATA_TEST_CDEC_PARSE = [
+ (""int a[i] =2"", dict_cdec_parse('int', 'a', tuple('i'), 1, 2)),
+ (""int a[i][j]=3"", dict_cdec_parse('int', 'a', tuple('ij'), 2, 3)),
+ ('num_i = 10', dict_cdec_parse('int', 'num_i', default=10)),
+- (cmem('obj', DmyCDT), dict_cdec_parse(DmyCDT, 'obj', valtype='object')),
++ (cmem(DmyCDT, 'obj'), dict_cdec_parse(DmyCDT, 'obj', valtype='object')),
+ ]
+
+
+",tests/test_cdata.py,"ArgSwap(idxs=0<->1 @(67,5)->(67,9))","DATA_TEST_CDEC_PARSE = [
+ (""int a[i] =2"", dict_cdec_parse('int', 'a', tuple('i'), 1, 2)),
+ (""int a[i][j]=3"", dict_cdec_parse('int', 'a', tuple('ij'), 2, 3)),
+ ('num_i = 10', dict_cdec_parse('int', 'num_i', default=10)),
+ (cmem('obj', DmyCDT), dict_cdec_parse(DmyCDT, 'obj', valtype='object')),
+ ]
+
+ ","DATA_TEST_CDEC_PARSE = [
+ (""int a[i] =2"", dict_cdec_parse('int', 'a', tuple('i'), 1, 2)),
+ (""int a[i][j]=3"", dict_cdec_parse('int', 'a', tuple('ij'), 2, 3)),
+ ('num_i = 10', dict_cdec_parse('int', 'num_i', default=10)),
+ (cmem(DmyCDT, 'obj'), dict_cdec_parse(DmyCDT, 'obj', valtype='object')),
+ ]
+
+ "
+831,https://:@github.com/hubzero/hublib.git,8921395b8feda7af6d59ed2133dd1a4068ae9803,"@@ -486,7 +486,7 @@ def copy_files(errnum, etime, toolname, runName):
+ else:
+ # nonparametric run. Results are in current working directory.
+ # Use the timestamp to copy all newer files to the cacheName.
+- if errnum > 0:
++ if errnum == 0:
+ files = os.listdir('.')
+ for f in files:
+ if os.path.getmtime(f) > self.start_time:
+",hublib/ui/submit.py,"ReplaceText(target='==' @(489,18)->(489,19))","def copy_files(errnum, etime, toolname, runName):
+ else:
+ # nonparametric run. Results are in current working directory.
+ # Use the timestamp to copy all newer files to the cacheName.
+ if errnum > 0:
+ files = os.listdir('.')
+ for f in files:
+ if os.path.getmtime(f) > self.start_time:","def copy_files(errnum, etime, toolname, runName):
+ else:
+ # nonparametric run. Results are in current working directory.
+ # Use the timestamp to copy all newer files to the cacheName.
+ if errnum == 0:
+ files = os.listdir('.')
+ for f in files:
+ if os.path.getmtime(f) > self.start_time:"
+832,https://:@github.com/tjstretchalot/ignite-simple.git,944f32fd5421cb01c0c75be5959277e1a1a2c741,"@@ -240,7 +240,7 @@ class ParamsTaskQueue(disp.TaskQueue, ps.SweepListener):
+ # remove from params_to_task
+ # add to in_progress
+ # return built disp.Task
+- if cores > self.sweep_cores and self.sweeps:
++ if cores >= self.sweep_cores and self.sweeps:
+ swp: ParamsTask = self.sweeps.pop()
+ del self.params_to_sweeps_ind[swp.params]
+ self._len -= 1
+",ignite_simple/gen_sweep/sweeper.py,"ReplaceText(target='>=' @(243,17)->(243,18))","class ParamsTaskQueue(disp.TaskQueue, ps.SweepListener):
+ # remove from params_to_task
+ # add to in_progress
+ # return built disp.Task
+ if cores > self.sweep_cores and self.sweeps:
+ swp: ParamsTask = self.sweeps.pop()
+ del self.params_to_sweeps_ind[swp.params]
+ self._len -= 1","class ParamsTaskQueue(disp.TaskQueue, ps.SweepListener):
+ # remove from params_to_task
+ # add to in_progress
+ # return built disp.Task
+ if cores >= self.sweep_cores and self.sweeps:
+ swp: ParamsTask = self.sweeps.pop()
+ del self.params_to_sweeps_ind[swp.params]
+ self._len -= 1"
+833,https://:@github.com/jessemyers/lxmlbind.git,35bb1bbc635ea9dca813dffe25165b14576c4a00,"@@ -75,7 +75,7 @@ class Base(object):
+ child = etree.SubElement(parent, head)
+ else:
+ return None
+- return self.search(child, tail, create) if tail else child
++ return self.search(tail, child, create) if tail else child
+
+ def __str__(self):
+ """"""
+",lxmlbind/base.py,"ArgSwap(idxs=0<->1 @(78,15)->(78,26))","class Base(object):
+ child = etree.SubElement(parent, head)
+ else:
+ return None
+ return self.search(child, tail, create) if tail else child
+
+ def __str__(self):
+ """"""","class Base(object):
+ child = etree.SubElement(parent, head)
+ else:
+ return None
+ return self.search(tail, child, create) if tail else child
+
+ def __str__(self):
+ """""""
+834,https://:@github.com/dieterv/etk.docking.git,f7e423f2e5d2a68183238c2d1eb39dcb4cf7ec30,"@@ -521,7 +521,7 @@ class DockPaned(gtk.Container):
+ width = max(width, w)
+ height += h
+ # Store the minimum weight for usage in do_size_allocate
+- item.min_size = w
++ item.min_size = h
+
+ # Add handles
+ if self._orientation == gtk.ORIENTATION_HORIZONTAL:
+",lib/etk/docking/dockpaned.py,"ReplaceText(target='h' @(524,32)->(524,33))","class DockPaned(gtk.Container):
+ width = max(width, w)
+ height += h
+ # Store the minimum weight for usage in do_size_allocate
+ item.min_size = w
+
+ # Add handles
+ if self._orientation == gtk.ORIENTATION_HORIZONTAL:","class DockPaned(gtk.Container):
+ width = max(width, w)
+ height += h
+ # Store the minimum weight for usage in do_size_allocate
+ item.min_size = h
+
+ # Add handles
+ if self._orientation == gtk.ORIENTATION_HORIZONTAL:"
+835,https://:@github.com/isnok/asciidrumming.git,66e35371a4b96774d931516f7131e19ccf6e2c43,"@@ -42,7 +42,7 @@ def assemble_pieces(phrases, pieces):
+ def clean_phrases(phrases):
+ for phrase in phrases.values():
+ phrase['pattern'] = ''.join(phrase['pattern']).replace(' ', '')
+- phrase['length'] = (len(phrase['pattern']) // phrase['beat']) + bool(len(phrase['pattern']) % phrase['beat'])
++ phrase['length'] = (len(phrase['pattern']) / phrase['beat']) + bool(len(phrase['pattern']) % phrase['beat'])
+
+
+ def assemble_phrases(config):
+",asciidrumming/assemble.py,"ReplaceText(target='/' @(45,51)->(45,53))","def assemble_pieces(phrases, pieces):
+ def clean_phrases(phrases):
+ for phrase in phrases.values():
+ phrase['pattern'] = ''.join(phrase['pattern']).replace(' ', '')
+ phrase['length'] = (len(phrase['pattern']) // phrase['beat']) + bool(len(phrase['pattern']) % phrase['beat'])
+
+
+ def assemble_phrases(config):","def assemble_pieces(phrases, pieces):
+ def clean_phrases(phrases):
+ for phrase in phrases.values():
+ phrase['pattern'] = ''.join(phrase['pattern']).replace(' ', '')
+ phrase['length'] = (len(phrase['pattern']) / phrase['beat']) + bool(len(phrase['pattern']) % phrase['beat'])
+
+
+ def assemble_phrases(config):"
+836,https://:@github.com/FedericoCinus/WoMG.git,75addc91cd520c8e7ebf8975ceaf24b79b2cf49f,"@@ -390,7 +390,7 @@ class LDA(TLTTopicModel):
+ saved_model_fname = str(hash(saved_model))+'.model'
+ if os.path.exists(saved_model_fname):
+ #lda_model = pickle.load(os.path.abspath(saved_model))
+- lda_model = gensim.models.ldamodel.LdaModel.load(os.path.abspath(saved_model))
++ lda_model = gensim.models.ldamodel.LdaModel.load(os.path.abspath(saved_model_fname))
+ else:
+ lda_model = gensim.models.ldamodel.LdaModel(corpus=corpus,
+ id2word=self.dictionary,
+",src/test_version/topic/lda.py,"ReplaceText(target='saved_model_fname' @(393,77)->(393,88))","class LDA(TLTTopicModel):
+ saved_model_fname = str(hash(saved_model))+'.model'
+ if os.path.exists(saved_model_fname):
+ #lda_model = pickle.load(os.path.abspath(saved_model))
+ lda_model = gensim.models.ldamodel.LdaModel.load(os.path.abspath(saved_model))
+ else:
+ lda_model = gensim.models.ldamodel.LdaModel(corpus=corpus,
+ id2word=self.dictionary,","class LDA(TLTTopicModel):
+ saved_model_fname = str(hash(saved_model))+'.model'
+ if os.path.exists(saved_model_fname):
+ #lda_model = pickle.load(os.path.abspath(saved_model))
+ lda_model = gensim.models.ldamodel.LdaModel.load(os.path.abspath(saved_model_fname))
+ else:
+ lda_model = gensim.models.ldamodel.LdaModel(corpus=corpus,
+ id2word=self.dictionary,"
+837,https://:@github.com/waikato-datamining/wai-annotations.git,1c1e29a44b802c45c83af7278b1637aa98855a68,"@@ -63,4 +63,4 @@ def get_all_sharded_filenames(filename: str) -> Tuple[str, ...]:
+ if shards == 0:
+ raise ValueError(f""{filename} is not a shard filename"")
+
+- return tuple(format_sharded_filename(base_name, shards, i) for i in range(index))
++ return tuple(format_sharded_filename(base_name, shards, i) for i in range(shards))
+",src/wai/annotations/tf/utils/_sharded_filenames.py,"ReplaceText(target='shards' @(66,78)->(66,83))","def get_all_sharded_filenames(filename: str) -> Tuple[str, ...]:
+ if shards == 0:
+ raise ValueError(f""{filename} is not a shard filename"")
+
+ return tuple(format_sharded_filename(base_name, shards, i) for i in range(index))","def get_all_sharded_filenames(filename: str) -> Tuple[str, ...]:
+ if shards == 0:
+ raise ValueError(f""{filename} is not a shard filename"")
+
+ return tuple(format_sharded_filename(base_name, shards, i) for i in range(shards))"
+838,https://:@github.com/broundal/Pytolemaic.git,c407b7b2410fe04641d0261ca209a2e57a728ded,"@@ -220,7 +220,7 @@ class SensitivityAnalysis():
+ vulnerability_report = self._vulnerability_report(
+ shuffled_sensitivity=self.shuffled_sensitivity,
+ missing_sensitivity=self.missing_sensitivity,
+- shuffled_sensitivity_stats=missing_stats_report)
++ shuffled_sensitivity_stats=shuffle_stats_report)
+
+ return SensitivityFullReport(
+ shuffle_report=self.shuffled_sensitivity,
+",pytolemaic/analysis_logic/model_analysis/sensitivity/sensitivity.py,"ReplaceText(target='shuffle_stats_report' @(223,39)->(223,59))","class SensitivityAnalysis():
+ vulnerability_report = self._vulnerability_report(
+ shuffled_sensitivity=self.shuffled_sensitivity,
+ missing_sensitivity=self.missing_sensitivity,
+ shuffled_sensitivity_stats=missing_stats_report)
+
+ return SensitivityFullReport(
+ shuffle_report=self.shuffled_sensitivity,","class SensitivityAnalysis():
+ vulnerability_report = self._vulnerability_report(
+ shuffled_sensitivity=self.shuffled_sensitivity,
+ missing_sensitivity=self.missing_sensitivity,
+ shuffled_sensitivity_stats=shuffle_stats_report)
+
+ return SensitivityFullReport(
+ shuffle_report=self.shuffled_sensitivity,"
+839,https://:@github.com/damoti/shipmaster.git,f81614acecb36da1343ec9e114679b06f0d8b0ba,"@@ -94,7 +94,7 @@ class LayerBase:
+ # Only tag image if container was built successfully.
+ repository, tag = self.image_name, None
+ if ':' in repository:
+- repository, tag = tag.split(':')
++ repository, tag = repository.split(':')
+ conf = client.create_container_config(self.image_name, cmd, working_dir=APP_PATH)
+ client.commit(container, repository=repository, tag=tag, conf=conf)
+ client.remove_container(container)
+",shipmaster/base/builder.py,"ReplaceText(target='repository' @(97,34)->(97,37))","class LayerBase:
+ # Only tag image if container was built successfully.
+ repository, tag = self.image_name, None
+ if ':' in repository:
+ repository, tag = tag.split(':')
+ conf = client.create_container_config(self.image_name, cmd, working_dir=APP_PATH)
+ client.commit(container, repository=repository, tag=tag, conf=conf)
+ client.remove_container(container)","class LayerBase:
+ # Only tag image if container was built successfully.
+ repository, tag = self.image_name, None
+ if ':' in repository:
+ repository, tag = repository.split(':')
+ conf = client.create_container_config(self.image_name, cmd, working_dir=APP_PATH)
+ client.commit(container, repository=repository, tag=tag, conf=conf)
+ client.remove_container(container)"
+840,https://:@github.com/ldo/pybidi.git,ef93e8fdd0220fb446238060c7b4f30422251943,"@@ -1352,7 +1352,7 @@ def remove_bidi_marks(string, positions_to_this = None, position_from_this_list
+ if position_from_this_list != None :
+ c_position_from_this_list = seq_to_ct(position_from_this_list, FRIBIDI.StrIndex)
+ else :
+- position_from_this_list = None
++ c_position_from_this_list = None
+ #end if
+ if embedding_levels != None :
+ c_embedding_levels = seq_to_ct(embedding_levels, FRIBIDI.StrIndex)
+",fribidi.py,"ReplaceText(target='c_position_from_this_list' @(1355,8)->(1355,31))","def remove_bidi_marks(string, positions_to_this = None, position_from_this_list
+ if position_from_this_list != None :
+ c_position_from_this_list = seq_to_ct(position_from_this_list, FRIBIDI.StrIndex)
+ else :
+ position_from_this_list = None
+ #end if
+ if embedding_levels != None :
+ c_embedding_levels = seq_to_ct(embedding_levels, FRIBIDI.StrIndex)","def remove_bidi_marks(string, positions_to_this = None, position_from_this_list
+ if position_from_this_list != None :
+ c_position_from_this_list = seq_to_ct(position_from_this_list, FRIBIDI.StrIndex)
+ else :
+ c_position_from_this_list = None
+ #end if
+ if embedding_levels != None :
+ c_embedding_levels = seq_to_ct(embedding_levels, FRIBIDI.StrIndex)"
+841,https://:@github.com/wbolster/cardinality.git,cfc729bc337f8d796d7bfe11a64ef3a3d516575b,"@@ -68,7 +68,7 @@ def between(min, max, iterable):
+ """"""
+ if min < 0:
+ raise ValueError(""'min' must be positive (or zero)"")
+- if min < 0:
++ if max < 0:
+ raise ValueError(""'max' must be positive (or zero)"")
+ if min > max:
+ raise ValueError(""'max' must be greater or equal than 'min'"")
+",cardinality.py,"ReplaceText(target='max' @(71,7)->(71,10))","def between(min, max, iterable):
+ """"""
+ if min < 0:
+ raise ValueError(""'min' must be positive (or zero)"")
+ if min < 0:
+ raise ValueError(""'max' must be positive (or zero)"")
+ if min > max:
+ raise ValueError(""'max' must be greater or equal than 'min'"")","def between(min, max, iterable):
+ """"""
+ if min < 0:
+ raise ValueError(""'min' must be positive (or zero)"")
+ if max < 0:
+ raise ValueError(""'max' must be positive (or zero)"")
+ if min > max:
+ raise ValueError(""'max' must be greater or equal than 'min'"")"
+842,https://:@github.com/zongzhenh/pymysql-pool.git,66b07cdf844554245cf209a72de89bd17133269c,"@@ -169,7 +169,7 @@ class Pool(object):
+ if self.ping_check:
+ now = int(time())
+ timeout = now
+- if isinstance(int, self.ping_check):
++ if isinstance(self.ping_check, int):
+ timeout = timeout - self.ping_check
+ if not hasattr(c, '__ping_check_timestamp'):
+ c.__ping_check_timestamp = now
+",pymysqlpool/pool.py,"ArgSwap(idxs=0<->1 @(172,15)->(172,25))","class Pool(object):
+ if self.ping_check:
+ now = int(time())
+ timeout = now
+ if isinstance(int, self.ping_check):
+ timeout = timeout - self.ping_check
+ if not hasattr(c, '__ping_check_timestamp'):
+ c.__ping_check_timestamp = now","class Pool(object):
+ if self.ping_check:
+ now = int(time())
+ timeout = now
+ if isinstance(self.ping_check, int):
+ timeout = timeout - self.ping_check
+ if not hasattr(c, '__ping_check_timestamp'):
+ c.__ping_check_timestamp = now"
+843,https://:@github.com/kanzure/python-vba-wrapper.git,98edf03512c8f7960f10fa615867269cdf0821d6,"@@ -315,7 +315,7 @@ class VBA(object):
+ # 29 registers
+ buf = (ctypes.c_int32 * self.register_count)()
+ buf[:] = registers
+- self._vba.set_registers(registers)
++ self._vba.set_registers(buf)
+
+ def _get_max_save_size(self):
+ return self._vba.get_max_save_size()
+",vba_wrapper/core.py,"ReplaceText(target='buf' @(318,32)->(318,41))","class VBA(object):
+ # 29 registers
+ buf = (ctypes.c_int32 * self.register_count)()
+ buf[:] = registers
+ self._vba.set_registers(registers)
+
+ def _get_max_save_size(self):
+ return self._vba.get_max_save_size()","class VBA(object):
+ # 29 registers
+ buf = (ctypes.c_int32 * self.register_count)()
+ buf[:] = registers
+ self._vba.set_registers(buf)
+
+ def _get_max_save_size(self):
+ return self._vba.get_max_save_size()"
+844,https://:@github.com/severb/flowy.git,82cbab85d672880b7c3db69b5e1707e90da7686e,"@@ -191,7 +191,7 @@ class DecisionPoller(object):
+ elif e_type == 'StartChildWorkflowExecutionFailed':
+ SCWEFEA = 'startChildWorkflowExecutionFailedEventAttributes'
+ id = _subworkflow_id(e[SCWEFEA]['workflowId'])
+- reason = e[SCWEIEA]['cause']
++ reason = e[SCWEFEA]['cause']
+ errors[id] = reason
+ elif e_type == 'TimerStarted':
+ id = e['timerStartedEventAttributes']['timerId']
+",flowy/swf/poller.py,"ReplaceText(target='SCWEFEA' @(194,27)->(194,34))","class DecisionPoller(object):
+ elif e_type == 'StartChildWorkflowExecutionFailed':
+ SCWEFEA = 'startChildWorkflowExecutionFailedEventAttributes'
+ id = _subworkflow_id(e[SCWEFEA]['workflowId'])
+ reason = e[SCWEIEA]['cause']
+ errors[id] = reason
+ elif e_type == 'TimerStarted':
+ id = e['timerStartedEventAttributes']['timerId']","class DecisionPoller(object):
+ elif e_type == 'StartChildWorkflowExecutionFailed':
+ SCWEFEA = 'startChildWorkflowExecutionFailedEventAttributes'
+ id = _subworkflow_id(e[SCWEFEA]['workflowId'])
+ reason = e[SCWEFEA]['cause']
+ errors[id] = reason
+ elif e_type == 'TimerStarted':
+ id = e['timerStartedEventAttributes']['timerId']"
+845,https://:@github.com/brthor/codetransformer-py2.git,7c327683df810265d01a995d2704c9f8218b0ef7,"@@ -141,7 +141,7 @@ class Instruction(InstructionMeta._marker, metaclass=InstructionMeta):
+ 'little',
+ )
+
+- yield cls(arg)
++ yield instr(arg)
+
+ @classmethod
+ def from_opcode(cls, opcode):
+",codetransformer/instructions.py,"ReplaceText(target='instr' @(144,18)->(144,21))","class Instruction(InstructionMeta._marker, metaclass=InstructionMeta):
+ 'little',
+ )
+
+ yield cls(arg)
+
+ @classmethod
+ def from_opcode(cls, opcode):","class Instruction(InstructionMeta._marker, metaclass=InstructionMeta):
+ 'little',
+ )
+
+ yield instr(arg)
+
+ @classmethod
+ def from_opcode(cls, opcode):"
+846,https://:@github.com/bacadra/bacadra.git,74346189dfe3cac99821fd0a32ddeb3290886c4d,"@@ -1256,7 +1256,7 @@ class texme(TeXM, object, metaclass=texmemeta):
+ elif type(inherit)==str:
+ self.store(inherit, tex)
+ elif inherit is False:
+- self.data = [tex + '\n%']
++ self.data += [tex + '\n%']
+ if self.echo:
+ print('[texme.' + name + ']\n' + tex)
+
+",bacadra/pinky/texme/texme.py,"ReplaceText(target='+=' @(1259,22)->(1259,23))","class texme(TeXM, object, metaclass=texmemeta):
+ elif type(inherit)==str:
+ self.store(inherit, tex)
+ elif inherit is False:
+ self.data = [tex + '\n%']
+ if self.echo:
+ print('[texme.' + name + ']\n' + tex)
+ ","class texme(TeXM, object, metaclass=texmemeta):
+ elif type(inherit)==str:
+ self.store(inherit, tex)
+ elif inherit is False:
+ self.data += [tex + '\n%']
+ if self.echo:
+ print('[texme.' + name + ']\n' + tex)
+ "
+847,https://:@github.com/bacadra/bacadra.git,3e4cd62c6a0769ea886aaae2104aeb5dff18dbea,"@@ -1131,7 +1131,7 @@ class texme(metaclass=texmemeta):
+
+ return self.add(
+ submodule = _name1,
+- code = code,
++ code = tex,
+ inherit = inherit,
+ echo = echo,
+ )
+",bacadra/pinky/texme/texme.py,"ReplaceText(target='tex' @(1134,24)->(1134,28))","class texme(metaclass=texmemeta):
+
+ return self.add(
+ submodule = _name1,
+ code = code,
+ inherit = inherit,
+ echo = echo,
+ )","class texme(metaclass=texmemeta):
+
+ return self.add(
+ submodule = _name1,
+ code = tex,
+ inherit = inherit,
+ echo = echo,
+ )"
+848,https://:@github.com/ulif/diceware-list.git,744223382d439315c8195d3ddff170e3542d80f0,"@@ -92,4 +92,4 @@ def local_android_download(request, monkeypatch, tmpdir):
+ monkeypatch.setattr(
+ ""diceware_list.libwordlist.AndroidWordList.base_url"",
+ fake_base_url)
+- return dictfile
++ return tmpdir
+",tests/conftest.py,"ReplaceText(target='tmpdir' @(95,11)->(95,19))","def local_android_download(request, monkeypatch, tmpdir):
+ monkeypatch.setattr(
+ ""diceware_list.libwordlist.AndroidWordList.base_url"",
+ fake_base_url)
+ return dictfile","def local_android_download(request, monkeypatch, tmpdir):
+ monkeypatch.setattr(
+ ""diceware_list.libwordlist.AndroidWordList.base_url"",
+ fake_base_url)
+ return tmpdir"
+849,https://:@github.com/AeGean-Studio/pysolr_aio.git,056f4e2d4284fc740bcc7862fabab673ea1a439b,"@@ -747,7 +747,7 @@ class Solr(object):
+ m = force_unicode(m)
+
+ end_time = time.time()
+- se