{"repo": "https://:@github.com/emedvedev/attention-ocr.git", "hash": "291042e7cb623c8a908e9badd132c1fa2360288c", "diff": "@@ -465,7 +465,7 @@ class Model(object):\n mh = 32\n mw = math.floor(1. * w / h * mh)\n img = img.resize(\n- (mw, h),\n+ (mw, mh),\n Image.ANTIALIAS)\n img_data = np.asarray(img, dtype=np.uint8)\n for idx in xrange(len(output)):\n", "old_path": "aocr/model/model.py", "rewrite": "ReplaceText(target='mh' @(468,25)->(468,26))"} {"repo": "https://:@github.com/emedvedev/attention-ocr.git", "hash": "6e6593c27fe0e63118adadf11562b1c4699b14e3", "diff": "@@ -477,7 +477,7 @@ class Model(object):\n attention_orig[i] = attention[int(i/4)-1]\n attention_orig = np.convolve(attention_orig, [0.199547, 0.200226, 0.200454, 0.200226, 0.199547], mode='same')\n attention_orig = np.maximum(attention_orig, 0.3)\n- attention_out = np.zeros((h, mw))\n+ attention_out = np.zeros((mh, mw))\n for i in xrange(mw):\n attention_out[:, i] = attention_orig[i]\n if len(img_data.shape) == 3:\n", "old_path": "aocr/model/model.py", "rewrite": "ReplaceText(target='mh' @(480,42)->(480,43))"} {"repo": "https://:@github.com/emedvedev/attention-ocr.git", "hash": "e741baf7170e72a974754908d323cacc0bd55247", "diff": "@@ -133,7 +133,7 @@ class Model(object):\n self.target_weights = []\n for i in xrange(self.decoder_size + 1):\n self.decoder_inputs.append(\n- tf.tile([0], [num_images])\n+ tf.tile([1], [num_images])\n )\n if i < self.decoder_size:\n self.target_weights.append(tf.tile([1.], [num_images]))\n", "old_path": "aocr/model/model.py", "rewrite": "ReplaceText(target='1' @(136,29)->(136,30))"} {"repo": "https://:@github.com/matthewdowney/TogglPy.git", "hash": "d5b630aec58d29b85ccffa527d24766eef6f61f9", "diff": "@@ -197,7 +197,7 @@ class Toggl():\n day = datetime.now().day if not day else day\n hour = datetime.now().hour if not hour else hour\n \n- timestruct = datetime(year, month, day, hour - hourdiff).isoformat() + '.000Z'\n+ timestruct = datetime(year, month, day, hour + hourdiff).isoformat() + '.000Z'\n data['time_entry']['start'] = timestruct\n data['time_entry']['duration'] = hourduration * 3600\n data['time_entry']['pid'] = projectid\n", "old_path": "toggl/TogglPy.py", "rewrite": "ReplaceText(target='+' @(200,53)->(200,54))"} {"repo": "https://:@github.com/eEcoLiDAR/eEcoLiDAR.git", "hash": "f0b2a0b7a5fdd41887ba40b7687c8161c0faba1e", "diff": "@@ -28,6 +28,6 @@ class Test3FeatureExtractor(AbstractFeatureExtractor):\n return ['test3_a']\n \n def extract(self, sourcepc, neighborhood, targetpc, targetindex, volume):\n- t2a, t2c = utils.get_features(targetpc, targetindex, self.requires())\n+ t2a, t2c = utils.get_features(targetpc, self.requires(), targetindex)\n x, y, z = utils.get_point(targetpc, targetindex)\n return t2c - t2a - z # z\n", "old_path": "laserchicken/test_feature_extractor/feature_test23.py", "rewrite": "ArgSwap(idxs=1<->2 @(31,19)->(31,37))"} {"repo": "https://:@github.com/eEcoLiDAR/eEcoLiDAR.git", "hash": "f0b2a0b7a5fdd41887ba40b7687c8161c0faba1e", "diff": "@@ -31,7 +31,7 @@ class TestUtils(unittest.TestCase):\n pc[keys.point][\"color\"] = {\"type\": \"double\", \"data\": cols}\n pc[keys.point][\"flavor\"] = {\"type\": \"double\", \"data\": flavs}\n x, y, z = utils.get_point(pc, 2)\n- c, f = utils.get_features(pc, 2, (\"color\", \"flavor\"))\n+ c, f = utils.get_features(pc, (\"color\", \"flavor\"), 2)\n self.assertEqual(c, 0.5 * (x + y))\n self.assertEqual(f, 0.5 * (x - y))\n \n", "old_path": "laserchicken/test_utils.py", "rewrite": "ArgSwap(idxs=1<->2 @(34,15)->(34,33))"} {"repo": "https://:@github.com/eEcoLiDAR/eEcoLiDAR.git", "hash": "502a365efda1393b130281803702d01f7e2d1dcd", "diff": "@@ -29,7 +29,7 @@ class TestExtractEigenValues(unittest.TestCase):\n [\"eigenv_1\", \"eigenv_2\", \"eigenv_3\"], InfiniteCylinder(5))\n \n self.assertEqual(\"laserchicken.feature_extractor.eigenvals_feature_extractor\",\n- target_point_cloud[keys.provenance][0][\"module\"])\n+ target_point_cloud[keys.provenance][1][\"module\"])\n \n @staticmethod\n def test_eigenvalues_of_too_few_points_results_in_0():\n", "old_path": "laserchicken/feature_extractor/test_eigenvals_feature_extractor.py", "rewrite": "ReplaceText(target='1' @(32,61)->(32,62))"} {"repo": "https://:@github.com/eEcoLiDAR/eEcoLiDAR.git", "hash": "eb7b021147a60b57e5dec536bd6f118c213f0952", "diff": "@@ -29,7 +29,7 @@ class TestExtractEigenValues(unittest.TestCase):\n [\"eigenv_1\", \"eigenv_2\", \"eigenv_3\"], InfiniteCylinder(5))\n \n self.assertEqual(\"laserchicken.feature_extractor.eigenvals_feature_extractor\",\n- target_point_cloud[keys.provenance][1][\"module\"])\n+ target_point_cloud[keys.provenance][-1][\"module\"])\n \n @staticmethod\n def test_eigenvalues_of_too_few_points_results_in_0():\n", "old_path": "laserchicken/feature_extractor/test_eigenvals_feature_extractor.py", "rewrite": "ReplaceText(target='-1' @(32,61)->(32,62))"} {"repo": "https://:@github.com/VinF/deer.git", "hash": "66ea41db02c3361f18874dea7fd97720b1b06590", "diff": "@@ -441,7 +441,7 @@ class CircularBuffer(object):\n \r\n if end == sys.maxsize:\r\n return self._data[self._lb+start:self._ub]\r\n- elif self._lb + end >= self._ub:\r\n+ elif self._lb + end > self._ub:\r\n raise IndexError()\r\n else:\r\n return self._data[self._lb+start:self._lb+end]\r\n", "old_path": "General_Deep_Q_RL/agent.py", "rewrite": "ReplaceText(target='>' @(444,28)->(444,30))"} {"repo": "https://:@github.com/VinF/deer.git", "hash": "fd939e272d5441d48fd7d30bf24312c0f6bc8aaa", "diff": "@@ -176,7 +176,7 @@ class MyEnv(Environment):\n # Lack of energy\n if (self._lastPonctualObservation[0]*self.battery_size>Energy_needed_from_battery):\n # If enough energy in the battery, use it\n- self._lastPonctualObservation[0]=self._lastPonctualObservation[0]-Energy_needed_from_battery/self.battery_size*self.battery_eta\n+ self._lastPonctualObservation[0]=self._lastPonctualObservation[0]-Energy_needed_from_battery/self.battery_size/self.battery_eta\n else:\n # Otherwise: use what is left and then penalty \n reward-=(Energy_needed_from_battery-self._lastPonctualObservation[0]*self.battery_size)*2 #2euro/kWh\n", "old_path": "General_Deep_Q_RL/environments/MG_two_storages_env.py", "rewrite": "ReplaceText(target='/' @(179,126)->(179,127))"} {"repo": "https://:@github.com/piccolbo/altair_recipes.git", "hash": "4992dd864a317eaad641d0408f003c429ed24af6", "diff": "@@ -6,7 +6,7 @@ from vega_datasets import data\n \n @viz_reg_test\n def test_boxplot_melted():\n- return ar.boxplot(data.iris(), \"species\", \"petalLength\")\n+ return ar.boxplot(data.iris(), \"petalLength\", \"species\")\n \n \n @viz_reg_test\n", "old_path": "tests/test_boxplot.py", "rewrite": "ArgSwap(idxs=1<->2 @(9,11)->(9,21))"} {"repo": "https://:@github.com/tailhook/zorro.git", "hash": "dcbc37d47fe2a8de029f5a2f3ae13adf52e7aace", "diff": "@@ -121,7 +121,7 @@ class RequestChannel(channel.PipelinedReqChannel):\n clen = int(headers.get('Content-Length', '0'))\n if clen < 0:\n raise EOFError(\"Wrong content length\")\n- while pos[0] + clen < len(buf):\n+ while pos[0] + clen > len(buf):\n readmore()\n return status, headers, buf[pos[0]:pos[0]+clen]\n \n", "old_path": "zorro/http.py", "rewrite": "ReplaceText(target='>' @(124,32)->(124,33))"} {"repo": "https://:@gitlab.com/eavise/brambox.git", "hash": "f1faeed0b52d6f1c9c9ba6da818c1656f841622c", "diff": "@@ -73,7 +73,7 @@ def test_multiclass(parser, df_anno_simple):\n parser = parser()\n \n with pytest.raises(ValueError) as errinfo:\n- bb.io.save(parser, df_anno_simple, 'path.txt')\n+ bb.io.save(df_anno_simple, parser, 'path.txt')\n assert 'single-class problems' in str(errinfo.value)\n \n \n", "old_path": "test/io/parser/test_anno_cvc.py", "rewrite": "ArgSwap(idxs=0<->1 @(76,8)->(76,18))"} {"repo": "https://:@github.com/uber/h3-py.git", "hash": "359924df907144c85ec323ae2804e2c0d173dfc5", "diff": "@@ -631,7 +631,7 @@ def hex_ranges(h3_address_list, ring_size):\n (1 + math.sqrt(1 + 8 * math.ceil(j / 6.0))) / 2)) - 1\n # hexRanges doesn't return distance array\n hex_range_list[ring_index].add(\n- h3_to_string(krings[i * num_hexagons + j]))\n+ h3_to_string(krings[i * array_len + j]))\n return out\n \n \n", "old_path": "h3/h3.py", "rewrite": "ReplaceText(target='array_len' @(634,40)->(634,52))"} {"repo": "https://:@github.com/polysquare/polysquare-generic-file-linter.git", "hash": "e9dbb28ea30955ab59d1339c04f0710b24ba53aa", "diff": "@@ -388,7 +388,7 @@ def _maybe_log_technical_terms(global_options, tool_options):\n terms = set(terms_file.read().splitlines()) # suppress(PYC70)\n terms_file.seek(0) # suppress(PYC70)\n terms_file.truncate(0) # suppress(PYC70)\n- tech_terms = freduce(lambda x, y: x + y,\n+ tech_terms = freduce(lambda x, y: x | y,\n _drain(log_technical_terms_to_queue))\n terms_file.write(\"\\n\".join(list(terms | # suppress(PYC70)\n set(tech_terms))))\n", "old_path": "polysquarelinter/linter.py", "rewrite": "ReplaceText(target='|' @(391,48)->(391,49))"} {"repo": "https://:@github.com/johntruckenbrodt/spatialist.git", "hash": "c9d552e64cd47b30156b288e035d17debea48b45", "diff": "@@ -300,7 +300,7 @@ def centerdist(obj1, obj2):\n \n \n def intersect(obj1, obj2):\n- if not (isinstance(obj1, Vector) or isinstance(obj2, Vector)):\n+ if not (isinstance(obj1, Vector) and isinstance(obj2, Vector)):\n raise IOError('object must be of type Vector')\n obj1.reproject(obj2.srs)\n \n", "old_path": "pyroSAR/spatial/vector.py", "rewrite": "ReplaceText(target='and' @(303,37)->(303,39))"} {"repo": "https://:@github.com/Toblerity/Shapely.git", "hash": "9f1b78e6fd5f4286f210b54827bdd26661f0ee7a", "diff": "@@ -40,7 +40,7 @@ if __name__ == '__main__':\n ]\n \n if pattern:\n- tests = [f for f in docfiles if f.find(pattern) >= 0]\n+ tests = [f for f in docfiles if f.find(pattern) == 0]\n else:\n tests = docfiles\n \n", "old_path": "tests/runalldoctests.py", "rewrite": "ReplaceText(target='==' @(43,56)->(43,58))"} {"repo": "https://:@github.com/Toblerity/Shapely.git", "hash": "d6fc8cc0e0d50b23ba0d7ca6195bc530b2f8d1b9", "diff": "@@ -11,7 +11,7 @@ def halton(base):\n i = index\n while i > 0:\n result += f * (i % base)\n- i = i/base\n+ i = i//base\n f = f/base\n return result\n i = 1\n", "old_path": "shapely/tests/test_unary_union.py", "rewrite": "ReplaceText(target='//' @(14,17)->(14,18))"} {"repo": "https://:@github.com/Toblerity/Shapely.git", "hash": "5f0db7fdc052beeeef36aa1251f19175d0abeedb", "diff": "@@ -36,7 +36,7 @@ if version is None:\n \n # Handle UTF-8 encoding of certain text files.\n open_kwds = {}\n-if sys.version_info > (3,):\n+if sys.version_info >= (3,):\n open_kwds['encoding'] = 'utf-8'\n \n with open('VERSION.txt', 'w', **open_kwds) as fp:\n", "old_path": "setup.py", "rewrite": "ReplaceText(target='>=' @(39,20)->(39,21))"} {"repo": "https://:@github.com/svetlyak40wt/django-tagging-ng.git", "hash": "0293b78ee0274d123eb70c1f8c5c01a5b36e2b40", "diff": "@@ -163,7 +163,7 @@ class TaggedItemManager(models.Manager):\n associated with a given Tag or list of Tags.\r\n \"\"\"\r\n tags = get_tag_list(tags)\r\n- if len(tags) == 0:\r\n+ if len(tags) == 1:\r\n tag = tags[0] # Optimisation for single tag\r\n else:\r\n return self.get_intersection_by_model(Model, tags)\r\n", "old_path": "models.py", "rewrite": "ReplaceText(target='1' @(166,24)->(166,25))"} {"repo": "https://:@github.com/svetlyak40wt/django-tagging-ng.git", "hash": "3285d40e4c1de628886a7fa45a6d4cf6ed4cd7e7", "diff": "@@ -163,7 +163,7 @@ class TaggedItemManager(models.Manager):\n associated with a given Tag or list of Tags.\r\n \"\"\"\r\n tags = get_tag_list(tags)\r\n- if len(tags) == 0:\r\n+ if len(tags) == 1:\r\n tag = tags[0] # Optimisation for single tag\r\n else:\r\n return self.get_intersection_by_model(Model, tags)\r\n", "old_path": "models.py", "rewrite": "ReplaceText(target='1' @(166,24)->(166,25))"} {"repo": "https://:@github.com/zzzsochi/yadm.git", "hash": "03efd06fe95c7d84264455c4fac5c8cbb17eb4dd", "diff": "@@ -316,7 +316,7 @@ class QuerySet(BaseQuerySet):\n \n if data is None:\n if exc is not None:\n- raise exc(criteria)\n+ raise exc(qs)\n else:\n return None\n \n", "old_path": "yadm/queryset.py", "rewrite": "ReplaceText(target='qs' @(319,26)->(319,34))"} {"repo": "https://:@github.com/instacart/lore.git", "hash": "1c1e0efdac6b27dc111eaa93bb99317c59aaffaf", "diff": "@@ -196,7 +196,7 @@ class Base(object):\n def upload(self):\n self.fitting = 0\n self.save()\n- lore.io.upload(self.remote_model_path(), self.model_path())\n+ lore.io.upload(self.model_path(), self.remote_model_path())\n \n @classmethod\n def download(cls, fitting=0):\n", "old_path": "lore/models/base.py", "rewrite": "ArgSwap(idxs=0<->1 @(199,8)->(199,22))"} {"repo": "https://:@github.com/instacart/lore.git", "hash": "1c1e0efdac6b27dc111eaa93bb99317c59aaffaf", "diff": "@@ -78,7 +78,7 @@ class Base(lore.models.base.Base):\n \n def upload(self):\n super(Base, self).upload()\n- lore.io.upload(self.remote_weights_path(), self.weights_path())\n+ lore.io.upload(self.weights_path(), self.remote_weights_path())\n \n @classmethod\n def download(cls, fitting=0):\n", "old_path": "lore/models/keras.py", "rewrite": "ArgSwap(idxs=0<->1 @(81,8)->(81,22))"} {"repo": "https://:@github.com/instacart/lore.git", "hash": "f4ded2b3199d1c33ba6c9c79cd66b25d43c83c81", "diff": "@@ -464,7 +464,7 @@ class Base(BaseEstimator):\n result = self.keras.predict(dataframe, batch_size=self.batch_size)\n \n if self.towers > 1:\n- result = numpy.mean(result, axis=0).squeeze(axis=0)\n+ result = numpy.mean(result, axis=0).squeeze(axis=1)\n \n return result\n \n", "old_path": "lore/estimators/keras.py", "rewrite": "ReplaceText(target='1' @(467,61)->(467,62))"} {"repo": "https://:@github.com/baliga-lab/cmonkey2.git", "hash": "3201a0e97688724450196da8fef96d283c855b3f", "diff": "@@ -273,7 +273,7 @@ class ClusterMembership:\n #logging.warn(\"cluster %s already associated with %s\",\n # str(cluster), str(column))\n pass\n- if columns not in columns:\n+ if column not in columns:\n columns.append(column)\n \n def remove_cluster_from_column(self, column, cluster):\n", "old_path": "cmonkey/membership.py", "rewrite": "ReplaceText(target='column' @(276,11)->(276,18))"} {"repo": "https://:@github.com/baliga-lab/cmonkey2.git", "hash": "48d14ac785b1013354a55a37239c66433fbf19eb", "diff": "@@ -460,7 +460,7 @@ class ClusterMembership:\n max_score = sys.float_info.min\n for row in range(sm.num_rows()):\n if sm_values[row][0] > max_score:\n- max_score = sm[row][0]\n+ max_score = sm_values[row][0]\n max_row = row\n return sm.row_names[max_row]\n \n", "old_path": "cmonkey/membership.py", "rewrite": "ReplaceText(target='sm_values' @(463,32)->(463,34))"} {"repo": "https://:@github.com/baliga-lab/cmonkey2.git", "hash": "311548905a9def1cbdf63d2e0fd8a17346564742", "diff": "@@ -17,7 +17,7 @@ class MicrobesOnlineTest(unittest.TestCase): # pylint: disable-msg=R0904\n \"\"\"test fixture\"\"\"\n if not os.path.exists('testcache'):\n os.mkdir('testcache')\n- self.service = mo.MicrobesOnline(mo.MICROBES_ONLINE_BASE_URL, 'testcache')\n+ self.service = mo.MicrobesOnline('testcache', mo.MICROBES_ONLINE_BASE_URL)\n \n def tearDown(self): # pylint: disable-msg=C0103\n \"\"\"test cleanup\"\"\"\n", "old_path": "test/microbes_online_test.py", "rewrite": "ArgSwap(idxs=0<->1 @(20,23)->(20,40))"} {"repo": "https://:@github.com/muammar/ml4chem.git", "hash": "dbb7de0379cb8881538d211899e4bec8794f16e3", "diff": "@@ -344,7 +344,7 @@ def train(inputs, targets, model=None, data=None, optimizer=None, lr=None,\n logger.info('Training finished in {} hours {} minutes {:.2f} seconds.'\n .format(h, m, s))\n logger.info('outputs')\n- logger.info(outputs)\n+ logger.info(outputs_)\n logger.info('targets')\n logger.info(targets)\n \n", "old_path": "mlchem/models/neuralnetwork.py", "rewrite": "ReplaceText(target='outputs_' @(347,16)->(347,23))"} {"repo": "https://:@github.com/chris7/pyquant.git", "hash": "3730fbdb9789a59a65d38f5a2ae21c645086096f", "diff": "@@ -624,7 +624,7 @@ def findAllPeaks(xdata, ydata_original, min_dist=0, method=None, local_filter_si\n best_fit = np.array(best_fit)\n peak_func = bigauss_ndim if bigauss_fit else gauss_ndim\n # Get rid of peaks with low r^2\n- if micro and r2_cutoff is not None:\n+ if not micro and r2_cutoff is not None:\n final_fit = np.array([])\n for peak_index in xrange(0, len(best_fit), step_size):\n \n", "old_path": "pyquant/peaks.py", "rewrite": "ReplaceText(target='not ' @(627,7)->(627,7))"} {"repo": "https://:@github.com/chris7/pyquant.git", "hash": "4a0755563e0a36fecf1f4393554cfaf4c1615c2c", "diff": "@@ -615,7 +615,7 @@ def find_peaks_derivative(xdata, ydata, ydata_peaks=None, min_slope=None, rel_pe\n # By default, cross points returns the left side\n for i in xrange(len(cross_points)):\n index = cross_points[i]\n- if index < len(cross_points):\n+ if index < len(ydata):\n if ydata[index] < ydata[index+1]:\n cross_points[i] = index+1\n \n", "old_path": "pyquant/utils.py", "rewrite": "ReplaceText(target='ydata' @(618,23)->(618,35))"} {"repo": "https://:@github.com/chris7/pyquant.git", "hash": "cd61286935d8ca64eb539851e39a98a0655ff400", "diff": "@@ -611,7 +611,7 @@ def find_peaks_derivative(xdata, ydata, ydata_peaks=None, min_slope=None, rel_pe\n ydata = np.abs(ydata_peaks)\n \n if min_peak_width is None:\n- max_peak_width = int(len(ydata) / 2)\n+ min_peak_width = int(len(ydata) / 2)\n if min_peak_width > 5:\n min_peak_width = 5\n \n", "old_path": "pyquant/utils.py", "rewrite": "ReplaceText(target='min_peak_width' @(614,8)->(614,22))"} {"repo": "https://:@github.com/ssec/sift.git", "hash": "24ce052cd497c42c917de06f0c89a7c5be13ab50", "diff": "@@ -599,7 +599,7 @@ class ProbeGraphDisplay (object) :\n x_point = self.workspace.get_content_point(x_uuid, point_xy)\n format_str, unit_str, x_point = self.document.convert_units(x_uuid, x_point)\n y_point = self.workspace.get_content_point(y_uuid, point_xy)\n- format_str, unit_str, y_point = self.document.convert_units(x_uuid, y_point)\n+ format_str, unit_str, y_point = self.document.convert_units(y_uuid, y_point)\n else:\n x_point = None\n y_point = None\n", "old_path": "py/cspov/view/ProbeGraphs.py", "rewrite": "ReplaceText(target='y_uuid' @(602,76)->(602,82))"} {"repo": "https://:@github.com/threatwatch/twigs.git", "hash": "7ee5d95178a459a8c2e8ff7855e3156e620c395c", "diff": "@@ -85,7 +85,7 @@ def parse_inventory(email,data,params):\n asset_map = {}\n asset_map['owner'] = email\n asset_map['host'] = host\n- asset_map['id'] = host\n+ asset_map['id'] = vmuuid\n asset_map['name'] = host\n asset_map['tags'] = [ ]\n asset_map['patch_tracker'] = { } # To help remove duplicate patches\n", "old_path": "twigs/azure.py", "rewrite": "ReplaceText(target='vmuuid' @(88,30)->(88,34))"} {"repo": "https://:@github.com/Keeper-Security/Commander.git", "hash": "9bd55c8dd48ab62759bbbb8dfcd38ab364cec2dc", "diff": "@@ -1550,7 +1550,7 @@ def prepare_record(params, record):\n else:\n if params.debug: print('Generated record key')\n unencrypted_key = os.urandom(32)\n- record_object['record_key'] = encrypt_aes(params.data_key, unencrypted_key)\n+ record_object['record_key'] = encrypt_aes(unencrypted_key, params.data_key)\n record_object['revision'] = 0\n \n data['title'] = record.title\n", "old_path": "keepercommander/api.py", "rewrite": "ArgSwap(idxs=0<->1 @(1553,38)->(1553,49))"} {"repo": "https://:@github.com/hpapaxen/rope.git", "hash": "27d5085b30e89095e88339c96d9940e338482106", "diff": "@@ -69,7 +69,7 @@ class JobSet(object):\n \n def get_percent_done(self):\n if self.count is not None and self.count > 0:\n- percent = self.done * 100 / self.count\n+ percent = self.done * 100 // self.count\n return min(percent, 100)\n \n def get_name(self):\n", "old_path": "rope/base/taskhandle.py", "rewrite": "ReplaceText(target='//' @(72,38)->(72,39))"} {"repo": "https://:@github.com/hpapaxen/rope.git", "hash": "27d5085b30e89095e88339c96d9940e338482106", "diff": "@@ -524,7 +524,7 @@ class ProgressBar(object):\n self.text['text'] = text\n \n def _draw_shape(self):\n- width = int(self.canvas['width']) * self.percent / 100\n+ width = int(self.canvas['width']) * self.percent // 100\n self.canvas.create_rectangle(0, 0, width, self.canvas['height'],\n fill=self.color)\n total_width = self.canvas['width']\n", "old_path": "rope/ui/uihelpers.py", "rewrite": "ReplaceText(target='//' @(527,57)->(527,58))"} {"repo": "https://:@github.com/hpapaxen/rope.git", "hash": "2720419618aceab7fba51aaa4d66f7eae005b22d", "diff": "@@ -129,7 +129,7 @@ class SimilarFinderTest(unittest.TestCase):\n source = 'x.a = 1\\n'\n finder = similarfinder.SimilarFinder(source)\n result = list(finder.get_matches('${a} = 1'))\n- self.assertEquals(1, len(result))\n+ self.assertEquals(0, len(result))\n \n def test_functions_not_matching_when_only_first_parameters(self):\n source = 'f(1, 2)\\n'\n", "old_path": "ropetest/refactor/similarfindertest.py", "rewrite": "ReplaceText(target='0' @(132,26)->(132,27))"} {"repo": "https://:@github.com/hpapaxen/rope.git", "hash": "0eb3cb58493cdaea83a4e24d47b5bd4dbd19f963", "diff": "@@ -32,7 +32,7 @@ class BuiltinModule(pyobjects.AbstractModule):\n result.update(self.initial)\n for modname in self.submodules:\n name = modname.split('.')[-1]\n- result[name] = BuiltinModule(name, self.submodules)\n+ result[name] = BuiltinModule(modname, self.submodules)\n return result\n \n @property\n", "old_path": "rope/base/builtins.py", "rewrite": "ReplaceText(target='modname' @(35,41)->(35,45))"} {"repo": "https://:@github.com/hpapaxen/rope.git", "hash": "528744bb4bc1b8076680f7c2c1bfac508ddca4f9", "diff": "@@ -37,7 +37,7 @@ def relative(root, path):\n if os.path.samefile(root, path):\n return '/'.join(reversed(rel))\n parent = os.path.dirname(path)\n- if not path or parent == path:\n+ if not parent or parent == path:\n break\n rel.append(os.path.basename(path))\n path = parent\n", "old_path": "rope/base/libutils.py", "rewrite": "ReplaceText(target='parent' @(40,15)->(40,19))"} {"repo": "https://:@github.com/benjamincrom/baseball.git", "hash": "6ef29729ad07458aebe709b4e42f56ecd3761ec4", "diff": "@@ -111,7 +111,7 @@ def write_game_svg_and_html(game_id, game, output_path):\n html_filename = game_id + '.html'\n \n svg_text = game.get_svg_str()\n- html_text = HTML_WRAPPER.format(title=game_id, filename=html_filename)\n+ html_text = HTML_WRAPPER.format(title=game_id, filename=svg_filename)\n \n output_svg_path = join(output_path, svg_filename)\n output_html_path = join(output_path, html_filename)\n", "old_path": "fetch_game.py", "rewrite": "ReplaceText(target='svg_filename' @(114,60)->(114,73))"} {"repo": "https://:@github.com/sporestack/bitcash.git", "hash": "dbc65e1b47426e0e4d286db5b27216ec36cb32cf", "diff": "@@ -16,7 +16,7 @@ def test_set_fee_cache_time():\n \n \n def test_get_fee():\n- assert get_fee(fast=True) != get_fee(fast=False)\n+ assert get_fee(fast=True) >= get_fee(fast=False)\n \n \n class TestFeeCache:\n", "old_path": "tests/network/test_fees.py", "rewrite": "ReplaceText(target='>=' @(19,30)->(19,32))"} {"repo": "https://:@github.com/galaxy-genome-annotation/python-apollo.git", "hash": "53e514b619844fa1f87179d738b9d29830027300", "diff": "@@ -29,7 +29,7 @@ class ApolloTestCase(unittest.TestCase):\n \"\"\"\n \n org_info = wa.organisms.show_organism(org_id)\n- if 'directory' in org_info:\n+ if 'directory' not in org_info:\n time.sleep(1)\n org_info = wa.organisms.show_organism(org_id)\n \n", "old_path": "test/__init__.py", "rewrite": "ReplaceText(target=' not in ' @(32,22)->(32,26))"} {"repo": "https://:@github.com/jakubplichta/grafana-dashboard-builder.git", "hash": "3228e6950d65b9bd347cacb56a9e85ec410b14ce", "diff": "@@ -35,7 +35,7 @@ class Context(object):\n formatter = string.Formatter()\n (result, to_expand) = (formatter.vformat(to_expand, (), self._context), to_expand)\n while result != to_expand:\n- (result, to_expand) = (formatter.vformat(to_expand, (), self._context), result)\n+ (result, to_expand) = (formatter.vformat(result, (), self._context), result)\n return result\n elif isinstance(to_expand, list):\n return [self.expand_placeholders(value) for value in to_expand]\n", "old_path": "grafana_dashboards/context.py", "rewrite": "ReplaceText(target='result' @(38,57)->(38,66))"} {"repo": "https://:@github.com/Phylliade/ikpy.git", "hash": "815dbff3a521532a7b792c309902ffea82abac85", "diff": "@@ -13,7 +13,7 @@ class TestFK(unittest.TestCase):\n one_move[5] = np.pi / 4\n one_move[6] = -np.pi / 2\n one_move[4] = -np.pi / 2\n- self.test_pos = one_move\n+ self.test_pos = all_zeros\n \n def test_fk_creature(self):\n \n", "old_path": "tests/test_fk.py", "rewrite": "ReplaceText(target='all_zeros' @(16,24)->(16,32))"} {"repo": "https://:@github.com/tingbot/tingbot-python.git", "hash": "5374186675f6809faf9ce953fc35c81217348753", "diff": "@@ -72,7 +72,7 @@ class RunLoop(object):\n while self.running:\n if len(self.timers) > 0:\n try:\n- self._wait(self.timers[0].next_fire_time)\n+ self._wait(self.timers[-1].next_fire_time)\n except Exception as e:\n self._error(e)\n continue\n", "old_path": "tingbot/run_loop.py", "rewrite": "ReplaceText(target='-1' @(75,43)->(75,44))"} {"repo": "https://:@github.com/nyoka-pmml/nyoka.git", "hash": "8d5c0d31d0bf1e251abe686f06b614a16e5ffcfb", "diff": "@@ -74,7 +74,7 @@ class TestMethods(unittest.TestCase):\n self.assertEqual(pmml_obj.NearestNeighborModel[0].ComparisonMeasure.kind, \"distance\")\n \n ##3\n- self.assertEqual(pmml_obj.steps[-1][-1].n_neighbors, pmml_obj.NearestNeighborModel[0].numberOfNeighbors)\n+ self.assertEqual(pipeline_obj.steps[-1][-1].n_neighbors, pmml_obj.NearestNeighborModel[0].numberOfNeighbors)\n \n \n def test_sklearn_03(self):\n", "old_path": "nyoka/tests/skl_to_pmml_UnitTest.py", "rewrite": "ReplaceText(target='pipeline_obj' @(77,25)->(77,33))"} {"repo": "https://:@github.com/iris-edu/pyweed.git", "hash": "77d919acd8d54d4879d1a34598e9e04f16fdf708", "diff": "@@ -97,7 +97,7 @@ class WaveformEntry(AttribDict):\n \n self.error = None\n \n- self.start_time = self.distances.arrival + self.config.offsets[0]\n+ self.start_time = self.distances.arrival - self.config.offsets[0]\n self.end_time = self.distances.arrival + self.config.offsets[1]\n \n self.start_string = UTCDateTime(self.start_time).format_iris_web_service().replace(':', '_')\n", "old_path": "pyweed/waveforms_handler.py", "rewrite": "ReplaceText(target='-' @(100,49)->(100,50))"} {"repo": "https://:@github.com/anaxilaus/coindata.git", "hash": "2e5067311c4eed50eed41c45f43ad63e8973e579", "diff": "@@ -52,6 +52,6 @@ def dump_json(data, filepath):\n \n try:\n with open(filepath, 'w') as file:\n- json.dump(data, filepath)\n+ json.dump(data, file)\n except TypeError as e:\n print(\"Data isn't JSON compatible.\\n\", e)\n", "old_path": "coindata/utils.py", "rewrite": "ReplaceText(target='file' @(55,28)->(55,36))"} {"repo": "https://:@github.com/Pixelapse/pyglass.git", "hash": "a31e95cbc259ce61f5851d6f0d769792aaa182fe", "diff": "@@ -20,7 +20,7 @@ def preview(src_path):\n preview_path = thumbnail_preview(src_path)\n \n if preview_path:\n- mimetype = magic.from_file(src_path, mime=True).lower()\n+ mimetype = magic.from_file(preview_path, mime=True).lower()\n if mimetype in [ExportMimeType.PNG, ExportMimeType.PDF]:\n return preview_path\n \n", "old_path": "pyglass/quicklook/api.py", "rewrite": "ReplaceText(target='preview_path' @(23,31)->(23,39))"} {"repo": "https://:@github.com/erezsh/plyplus.git", "hash": "8cc69bebfcb2cb0480ac66d07fe1f4b8637bba11", "diff": "@@ -784,7 +784,7 @@ class _Grammar(object):\n subtree.extend(child.tail)\n else:\n subtree.append(child)\n- p[0] = self.tree_class(rule_name, subtree, skip_adjustments=True) if len(subtree) > 1 else subtree[0]\n+ p[0] = self.tree_class(rule_name, subtree, skip_adjustments=True) if len(subtree) != 1 else subtree[0]\n else:\n def p_rule(self, p):\n p[0] = self.tree_class(rule_name, p[1:], skip_adjustments=True)\n", "old_path": "plyplus/plyplus.py", "rewrite": "ReplaceText(target='!=' @(787,98)->(787,99))"} {"repo": "https://:@github.com/olls/graphics.git", "hash": "877ef2670d4ad34c4fcf951dab0922419f081531", "diff": "@@ -22,7 +22,7 @@ def colorStr(text, color=WHITE):\n \t\treturn seq\n \t\tsys.stdout.write(seq + '\\n')\n \telse:\n-\t\treturn seq\n+\t\treturn text\n \t\tsys.stdout.write(text + '\\n')\n \n if __name__ == '__main__':\n", "old_path": "colors.py", "rewrite": "ReplaceText(target='text' @(25,9)->(25,12))"} {"repo": "https://:@github.com/hkwi/twink.git", "hash": "5ef359deb609fc55659596a8cb327abb9c7e4653", "diff": "@@ -319,7 +319,7 @@ def ofp_action_set_field(message, offset):\n \tcursor = _cursor(offset)\r\n \toffset = cursor.offset\r\n \t\r\n-\t(type,len) = ofp_action_header(message, offset)\r\n+\t(type,len) = ofp_action_header(message, cursor)\r\n \tfield = message[cursor.offset:offset+len]\r\n \tcursor.offset = offset+len\r\n \treturn namedtuple(\"ofp_action_set_field\",\r\n", "old_path": "twink/ofp4/parse.py", "rewrite": "ReplaceText(target='cursor' @(322,41)->(322,47))"} {"repo": "https://:@github.com/hkwi/twink.git", "hash": "fc6f5ad63cb12f9caf5455e3179ecfd9cd9de060", "diff": "@@ -27,7 +27,7 @@ def _unpack(fmt, message, offset):\n \treturn struct.unpack_from(fmt, message, offset)\r\n \r\n def _align(length):\r\n-\treturn (length+7)/8*8\r\n+\treturn (length+7)//8*8\r\n \r\n # 7.1\r\n def ofp_header(version, type, length, xid):\r\n", "old_path": "twink/ofp4/build.py", "rewrite": "ReplaceText(target='//' @(30,18)->(30,19))"} {"repo": "https://:@github.com/biolab/orange3-datafusion.git", "hash": "54f941a66a9b369a73190dfe2007e5b6dae1803a", "diff": "@@ -33,7 +33,7 @@ def _find_completion(fuser, relation):\n for fuser_relation in fuser.fusion_graph.get_relations(relation.row_type,\n relation.col_type):\n if fuser_relation._id == relation._id:\n- return fuser.complete(fuser_relation)\n+ return fuser.complete(relation)\n return None\n \n \n", "old_path": "orangecontrib/datafusion/widgets/owcompletionscoring.py", "rewrite": "ReplaceText(target='relation' @(36,34)->(36,48))"} {"repo": "https://:@github.com/aiqm/torchani.git", "hash": "5bb6691515e5e56fbe4994b140dd40b73043a33f", "diff": "@@ -151,7 +151,7 @@ class PrepareInput(torch.nn.Module):\n new_tensors = []\n for t in tensors:\n new_tensors.append(t.index_select(1, reverse))\n- return (species, *tensors)\n+ return (species, *new_tensors)\n \n def forward(self, species_coordinates):\n species, coordinates = species_coordinates\n", "old_path": "torchani/aev.py", "rewrite": "ReplaceText(target='new_tensors' @(154,26)->(154,33))"} {"repo": "https://:@github.com/aiqm/torchani.git", "hash": "abc8f7f842ae4b273c6e867b392413dcadd9c921", "diff": "@@ -593,7 +593,7 @@ def collate_fn(data, chunk_threshold, properties_info):\n if properties_info['padding_values'][i] is None:\n prop = torch.stack(prop)\n else:\n- prop = torch.nn.utils.rnn.pad_sequence(batch_species,\n+ prop = torch.nn.utils.rnn.pad_sequence(prop,\n batch_first=True,\n padding_value=properties_info['padding_values'][i])\n # sort with number of atoms\n", "old_path": "torchani/data/new.py", "rewrite": "ReplaceText(target='prop' @(596,51)->(596,64))"} {"repo": "https://:@github.com/aiqm/torchani.git", "hash": "c18f4a5ea1f9732cc07c8816caa401981e43dc48", "diff": "@@ -274,7 +274,7 @@ def compute_aev(species: Tensor, coordinates: Tensor, cell: Tensor,\n num_atoms = species.shape[1]\n num_species_pairs = angular_length // angular_sublength\n # PBC calculation is bypassed if there are no shifts\n- if shifts.numel() == 1:\n+ if shifts.numel() == 0:\n atom_index1, atom_index2, shifts = neighbor_pairs_nopbc(species == -1, coordinates, cell, shifts, Rcr)\n else:\n atom_index1, atom_index2, shifts = neighbor_pairs(species == -1, coordinates, cell, shifts, Rcr)\n", "old_path": "torchani/aev.py", "rewrite": "ReplaceText(target='0' @(277,25)->(277,26))"} {"repo": "https://:@github.com/cs207group4/cs207-FinalProject.git", "hash": "e7f1cc613ace275a8d259de7455ee39ca063e029", "diff": "@@ -120,7 +120,7 @@ class ChemSolver:\n r.set_initial_value(y0, 0)\n self._t = [0]\n self._y = [y0]\n- while r.successful() and r.t <= t1:\n+ while r.successful() and r.t < t1:\n self._t.append(r.t + dt)\n self._y.append(r.integrate(r.t + dt))\n self._t = np.array(self._t)\n", "old_path": "pychemkin/ChemSolver.py", "rewrite": "ReplaceText(target='<' @(123,37)->(123,39))"} {"repo": "https://:@github.com/MrLeeh/pyads.git", "hash": "d14fd2a7bb2d4b784a4f6a47b6981ba2a86b699c", "diff": "@@ -97,7 +97,7 @@ def set_local_address(ams_netid):\n else:\r\n ams_netid_st = ams_netid\r\n \r\n- assert isinstance(ams_netid, SAmsNetId)\r\n+ assert isinstance(ams_netid_st, SAmsNetId)\r\n \r\n if linux:\r\n return adsSetLocalAddress(ams_netid_st)\r\n", "old_path": "pyads/ads.py", "rewrite": "ReplaceText(target='ams_netid_st' @(100,22)->(100,31))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "0a836276129ef71fa6c44975dd02ab70bccc496d", "diff": "@@ -58,7 +58,7 @@ class FConvEncoder(FairseqEncoder):\n self.projections = nn.ModuleList()\n self.convolutions = nn.ModuleList()\n for (out_channels, kernel_size) in convolutions:\n- pad = (kernel_size - 1) // 2\n+ pad = (kernel_size - 1) / 2\n self.projections.append(Linear(in_channels, out_channels)\n if in_channels != out_channels else None)\n self.convolutions.append(\n", "old_path": "fairseq/models/fconv.py", "rewrite": "ReplaceText(target='/' @(61,36)->(61,38))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "f68a44359b6596997b931d2e662a899ffba9d407", "diff": "@@ -62,7 +62,7 @@ class SinusoidalPositionalEmbedding(nn.Module):\n # recompute/expand embeddings if needed\n bsz, seq_len = input.size()\n max_pos = self.padding_idx + 1 + seq_len\n- if seq_len > self.weights.size(0):\n+ if max_pos > self.weights.size(0):\n self.weights = SinusoidalPositionalEmbedding.get_embedding(\n max_pos,\n self.embedding_dim,\n", "old_path": "fairseq/modules/sinusoidal_positional_embedding.py", "rewrite": "ReplaceText(target='max_pos' @(65,11)->(65,18))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "762956a559e65e1e48df8f8b4df515d23b66fddb", "diff": "@@ -82,7 +82,7 @@ def main(args):\n train_meter.start()\n valid_losses = [None]\n valid_subsets = args.valid_subset.split(',')\n- while lr > args.min_lr and epoch_itr.epoch <= max_epoch and trainer.get_num_updates() < max_update:\n+ while lr > args.min_lr and epoch_itr.epoch < max_epoch and trainer.get_num_updates() < max_update:\n # train for one epoch\n train(args, trainer, task, epoch_itr)\n \n", "old_path": "train.py", "rewrite": "ReplaceText(target='<' @(85,47)->(85,49))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "e9967cd334783f5da50deadc17cf8a4fc3380171", "diff": "@@ -82,7 +82,7 @@ def main(args):\n train_meter.start()\n valid_losses = [None]\n valid_subsets = args.valid_subset.split(',')\n- while lr > args.min_lr and epoch_itr.epoch <= max_epoch and trainer.get_num_updates() < max_update:\n+ while lr > args.min_lr and epoch_itr.epoch < max_epoch and trainer.get_num_updates() < max_update:\n # train for one epoch\n train(args, trainer, task, epoch_itr)\n \n", "old_path": "train.py", "rewrite": "ReplaceText(target='<' @(85,47)->(85,49))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "7bcb487aad8504043d13c9b869d555aa565a46c7", "diff": "@@ -49,7 +49,7 @@ class LabelSmoothedCrossEntropyCriterion(FairseqCriterion):\n sample_size = sample['target'].size(0) if self.args.sentence_avg else sample['ntokens']\n logging_output = {\n 'loss': utils.item(loss.data) if reduce else loss.data,\n- 'nll_loss': utils.item(nll_loss.data) if reduce else loss.data,\n+ 'nll_loss': utils.item(nll_loss.data) if reduce else nll_loss.data,\n 'ntokens': sample['ntokens'],\n 'sample_size': sample_size,\n }\n", "old_path": "fairseq/criterions/label_smoothed_cross_entropy.py", "rewrite": "ReplaceText(target='nll_loss' @(52,65)->(52,69))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "74efc21403477d103bd426ae64c37b7a30d8f4bf", "diff": "@@ -154,7 +154,7 @@ class TestIncrementalDecoder(FairseqIncrementalDecoder):\n probs[:, i, self.dictionary.eos()] = 1.0\n \n # random attention\n- attn = torch.rand(bbsz, src_len, tgt_len)\n+ attn = torch.rand(bbsz, tgt_len, src_len)\n \n return Variable(probs), Variable(attn)\n \n", "old_path": "tests/utils.py", "rewrite": "ArgSwap(idxs=1<->2 @(157,15)->(157,25))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "dfd77717b91a6e233829735795ab49d6fd85c0b3", "diff": "@@ -93,7 +93,7 @@ class CosineSchedule(FairseqLRScheduler):\n else:\n i = math.floor(curr_updates / self.period)\n t_i = self.period\n- t_curr = num_updates - (self.period * i)\n+ t_curr = curr_updates - (self.period * i)\n \n lr_shrink = self.lr_shrink ** i\n min_lr = self.min_lr * lr_shrink\n", "old_path": "fairseq/optim/lr_scheduler/cosine_lr_scheduler.py", "rewrite": "ReplaceText(target='curr_updates' @(96,25)->(96,36))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "0eea6923b9d7f408e667714709b070171ac7fe05", "diff": "@@ -312,7 +312,7 @@ def make_positions(tensor, padding_idx, left_pad, onnx_trace=False):\n positions = range_buf.expand_as(tensor)\n if left_pad:\n positions = positions - mask.size(1) + mask.long().sum(dim=1).unsqueeze(1)\n- return positions * mask.long() + positions * (1 - mask.long())\n+ return positions * mask.long() + padding_idx * (1 - mask.long())\n \n max_pos = padding_idx + 1 + tensor.size(1)\n if not hasattr(make_positions, 'range_buf'):\n", "old_path": "fairseq/utils.py", "rewrite": "ReplaceText(target='padding_idx' @(315,41)->(315,50))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "4d3401b09f155995cd81fd394dfa50bf65ee8e5f", "diff": "@@ -183,7 +183,7 @@ class Sampling(Search):\n lprobs = lprobs[:, ::beam_size, :].contiguous()\n \n # we exclude the first two vocab items, one of which is pad\n- assert self.pad == 1, 'sampling assumes the first two symbols can be ignored'\n+ assert self.pad <= 1, 'sampling assumes the first two symbols can be ignored'\n lprobs_nopad = lprobs[:, :, 2:]\n \n # only sample from top-k candidates\n", "old_path": "fairseq/search.py", "rewrite": "ReplaceText(target='<=' @(186,24)->(186,26))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "2340832fdd7acaaaf07626daa6a0cef6fda06cd1", "diff": "@@ -160,7 +160,7 @@ def main(args):\n ))\n \n # update running id counter\n- start_id += len(results)\n+ start_id += len(inputs)\n \n \n def cli_main():\n", "old_path": "interactive.py", "rewrite": "ReplaceText(target='inputs' @(163,24)->(163,31))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "39a60b844aad67aa59267d873edeb4948f6f0af9", "diff": "@@ -351,7 +351,7 @@ class LSTMDecoder(FairseqIncrementalDecoder):\n self.additional_fc = Linear(hidden_size, out_embed_dim)\n if adaptive_softmax_cutoff is not None:\n # setting adaptive_softmax dropout to dropout_out for now but can be redefined\n- self.adaptive_softmax = AdaptiveSoftmax(num_embeddings, embed_dim, adaptive_softmax_cutoff,\n+ self.adaptive_softmax = AdaptiveSoftmax(num_embeddings, hidden_size, adaptive_softmax_cutoff,\n dropout=dropout_out)\n elif not self.share_input_output_embed:\n self.fc_out = Linear(out_embed_dim, num_embeddings, dropout=dropout_out)\n", "old_path": "fairseq/models/lstm.py", "rewrite": "ReplaceText(target='hidden_size' @(354,68)->(354,77))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "49177c99c45f7d6e99a8f1500d16396e2d7b4519", "diff": "@@ -498,7 +498,7 @@ class TransformerDecoder(FairseqIncrementalDecoder):\n del state_dict[k]\n \n version_key = '{}.version'.format(name)\n- if utils.item(state_dict.get(version_key, torch.Tensor([1]))[0]) < 2:\n+ if utils.item(state_dict.get(version_key, torch.Tensor([1]))[0]) <= 2:\n # earlier checkpoints did not normalize after the stack of layers\n self.layer_norm = None\n self.normalize = False\n", "old_path": "fairseq/models/transformer.py", "rewrite": "ReplaceText(target='<=' @(501,73)->(501,74))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "5d7a81099462e9f19715ce5fa37c03816a750e12", "diff": "@@ -412,7 +412,7 @@ class LevenshteinTransformerModel(FairseqNATModel):\n max_lens = torch.zeros_like(output_tokens).fill_(255)\n else:\n if encoder_out.encoder_padding_mask is None:\n- max_src_len = encoder_out.encoder_out.size(1)\n+ max_src_len = encoder_out.encoder_out.size(0)\n src_lens = encoder_out.encoder_out.new(bsz).fill_(max_src_len)\n else:\n src_lens = (~encoder_out.encoder_padding_mask).sum(1)\n", "old_path": "fairseq/models/nat/levenshtein_transformer.py", "rewrite": "ReplaceText(target='0' @(415,59)->(415,60))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "431d604f696a15c06fceab56b4ace271bb85e74b", "diff": "@@ -331,7 +331,7 @@ class SequenceGenerator(object):\n avg_attn_scores = avg_attn_scores[0]\n if avg_attn_scores is not None:\n if attn is None:\n- attn = scores.new(bsz * beam_size, src_tokens.size(1), max_len + 2)\n+ attn = scores.new(bsz * beam_size, avg_attn_scores.size(1), max_len + 2)\n attn_buf = attn.clone()\n attn[:, :, step + 1].copy_(avg_attn_scores)\n \n", "old_path": "fairseq/sequence_generator.py", "rewrite": "ReplaceText(target='avg_attn_scores' @(334,55)->(334,65))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "4f8b0643c80d6a41039ae29e94fca6b44de8791a", "diff": "@@ -138,7 +138,7 @@ def should_stop_early(args, valid_loss):\n return False\n else:\n should_stop_early.num_runs += 1\n- return should_stop_early.num_runs > args.patience\n+ return should_stop_early.num_runs >= args.patience\n \n \n @metrics.aggregate('train')\n", "old_path": "fairseq_cli/train.py", "rewrite": "ReplaceText(target='>=' @(141,42)->(141,43))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "9a718e29855713a51877237b2dcc25e39c234c82", "diff": "@@ -110,5 +110,5 @@ class TranslationFromPretrainedBARTTask(TranslationTask):\n for s_t in src_tokens:\n s_t = torch.cat([s_t, s_t.new(1).fill_(src_lang_id)])\n source_tokens.append(s_t)\n- dataset = LanguagePairDataset(src_tokens, src_lengths, self.source_dictionary)\n+ dataset = LanguagePairDataset(source_tokens, src_lengths, self.source_dictionary)\n return dataset\n", "old_path": "fairseq/tasks/translation_from_pretrained_bart.py", "rewrite": "ReplaceText(target='source_tokens' @(113,38)->(113,48))"} {"repo": "https://:@github.com/pytorch/fairseq.git", "hash": "b689b6ff3ab7b806217b8aa41821bb8fc85f7cd8", "diff": "@@ -264,7 +264,7 @@ class LanguagePairDataset(FairseqDataset):\n tgt_item = torch.cat([torch.LongTensor([bos]), self.tgt[index]])\n \n bos = self.src_dict.bos()\n- if self.src[index][-1] != bos:\n+ if self.src[index][0] != bos:\n src_item = torch.cat([torch.LongTensor([bos]), self.src[index]])\n \n if self.remove_eos_from_source:\n", "old_path": "fairseq/data/language_pair_dataset.py", "rewrite": "ReplaceText(target='0' @(267,31)->(267,33))"} {"repo": "https://:@github.com/prprprus/PyMySQLPool.git", "hash": "66b07cdf844554245cf209a72de89bd17133269c", "diff": "@@ -169,7 +169,7 @@ class Pool(object):\n if self.ping_check:\n now = int(time())\n timeout = now\n- if isinstance(int, self.ping_check):\n+ if isinstance(self.ping_check, int):\n timeout = timeout - self.ping_check\n if not hasattr(c, '__ping_check_timestamp'):\n c.__ping_check_timestamp = now\n", "old_path": "pymysqlpool/pool.py", "rewrite": "ArgSwap(idxs=0<->1 @(172,15)->(172,25))"} {"repo": "https://:@github.com/dailymuse/oz.git", "hash": "a15adf73c721d07b9dac886fcc27145e2449563c", "diff": "@@ -173,7 +173,7 @@ class S3File(CDNFile):\n \n def copy(self, new_path, replace=False):\n \"\"\"Uses boto to copy the file to the new path instead of uploading another file to the new key\"\"\"\n- if replace or get_file(new_path).exists():\n+ if replace or not get_file(new_path).exists():\n self.key.copy(self.key.bucket, new_path)\n return True\n return False\n", "old_path": "oz/aws_cdn/__init__.py", "rewrite": "ReplaceText(target='not ' @(176,22)->(176,22))"} {"repo": "https://:@github.com/juju/amulet.git", "hash": "016bfab60aca89cbcb58e80f4103e371a77b06ba", "diff": "@@ -77,7 +77,7 @@ class Deployment(object):\n pass # Copy the current parent directory to temp and deploy that\n elif self.charm_name:\n if charm_name == self.charm_name:\n- charm = os.getcwd()\n+ charm_branch = os.getcwd()\n \n self.services[service] = {'branch': charm_branch}\n if units > 1:\n", "old_path": "amulet/deployer.py", "rewrite": "ReplaceText(target='charm_branch' @(80,16)->(80,21))"} {"repo": "https://:@github.com/gitpython-developers/gitdb.git", "hash": "ca829e0b341dd5c3ae1408b24702f2c75db6ec73", "diff": "@@ -445,7 +445,7 @@ class DeltaApplyReader(LazyMixin):\n \t\t\n \t\n \t#{ Configuration\n-\tif not has_perf_mod:\n+\tif has_perf_mod:\n \t\t_set_cache_ = _set_cache_brute_\n \telse:\n \t\t_set_cache_ = _set_cache_too_slow_without_c\n", "old_path": "stream.py", "rewrite": "ReplaceText(target='' @(448,4)->(448,8))"} {"repo": "https://:@github.com/longld/peda.git", "hash": "82fcb5a12c92c27fc5722772a84df47b996d3d03", "diff": "@@ -4746,7 +4746,7 @@ class PEDACmd(object):\n \n step = peda.intsize()\n if not peda.is_address(address): # cannot determine address\n- msg(\"Invalid $SP address: 0x%x\" % sp, \"red\")\n+ msg(\"Invalid $SP address: 0x%x\" % address, \"red\")\n return\n for i in range(count):\n if not peda.execute(\"x/%sx 0x%x\" % (\"g\" if step == 8 else \"w\", address + i*step)):\n", "old_path": "peda.py", "rewrite": "ReplaceText(target='address' @(4749,46)->(4749,48))"} {"repo": "https://:@github.com/TheGhouls/oct.git", "hash": "1f9ea29181962353fe0ea275cb4ba4ec9ae93142", "diff": "@@ -18,7 +18,7 @@ class Report(object):\n self.set_statics()\n \n def set_statics(self):\n- if os.path.exists(self.results_dir):\n+ if not os.path.exists(self.results_dir):\n return\n try:\n shutil.copytree(os.path.join(self.templates_dir, 'css'), os.path.join(self.results_dir, 'css'))\n", "old_path": "oct/results/reportwriter.py", "rewrite": "ReplaceText(target='not ' @(21,11)->(21,11))"} {"repo": "https://:@github.com/ASPP/pelita.git", "hash": "bee6872dbd95a1e526305ef39f42ac537fd2f708", "diff": "@@ -105,7 +105,7 @@ def create_maze(layout_mesh):\n Mesh of lists of MazeComponents\n \n \"\"\"\n- maze_mesh = Mesh(layout_mesh.height, layout_mesh.width,\n+ maze_mesh = Mesh(layout_mesh.width, layout_mesh.height,\n data=[[] for i in range(len(layout_mesh))])\n for index in maze_mesh.iterkeys():\n if layout_mesh[index] == CTFUniverse.wall:\n", "old_path": "pelita/universe.py", "rewrite": "ArgSwap(idxs=0<->1 @(108,16)->(108,20))"} {"repo": "https://:@github.com/ASPP/pelita.git", "hash": "508cd180dce7b72ab248211c977c8525a9c023de", "diff": "@@ -31,7 +31,7 @@ def __init__(self, index, initial_pos, team, homezone,\n \n @property\n def in_own_zone(self):\n- return self.homezone[0] <= self.current_pos[1] <= self.homezone[1]\n+ return self.homezone[0] <= self.current_pos[0] <= self.homezone[1]\n \n def move(self, new_pos):\n self.current_pos = new_pos\n", "old_path": "pelita/universe.py", "rewrite": "ReplaceText(target='0' @(34,52)->(34,53))"} {"repo": "https://:@github.com/ASPP/pelita.git", "hash": "6b76e416da2dc0d18224e47d7b176dad967e15b2", "diff": "@@ -182,7 +182,7 @@ def a_star(self, initial, target):\n else:\n seen.append(current)\n for pos in self.adjacency[current]:\n- heapq.heappush(to_visit, (datamodel.manhattan_dist(current, pos), (pos)))\n+ heapq.heappush(to_visit, (datamodel.manhattan_dist(target, pos), (pos)))\n \n # Now back-track using seen to determine how we got here.\n # Initialise the path with current node, i.e. position of food.\n", "old_path": "pelita/game_master.py", "rewrite": "ReplaceText(target='target' @(185,71)->(185,78))"} {"repo": "https://:@github.com/ASPP/pelita.git", "hash": "fa2505d44ae3d3724f7fa979c0167f03bf7424f7", "diff": "@@ -136,7 +136,7 @@ def play(self):\n if self.universe.teams[0].score < self.universe.teams[1].score:\n events.append(datamodel.TeamWins(1))\n elif self.universe.teams[0].score > self.universe.teams[1].score:\n- events.append(datamodel.TeamWins(1))\n+ events.append(datamodel.TeamWins(0))\n else:\n events.append(datamodel.GameDraw())\n self.send_to_viewers(round_index, None, events)\n", "old_path": "pelita/game_master.py", "rewrite": "ReplaceText(target='0' @(139,45)->(139,46))"} {"repo": "https://:@github.com/ASPP/pelita.git", "hash": "4044f845e54c2077d6896010c25fcc123fc10203", "diff": "@@ -78,7 +78,7 @@ def test_equal_positions(self):\n layout = create_layout(layout_str)\n assert layout.bots == [(1, 1), (1, 1)]\n assert layout.enemy == [(1, 1), (1, 1)]\n- setup_test_game(layout=layout)\n+ setup_test_game(layout=layout_str)\n \n def test_define_after(self):\n layout = create_layout(self.layout, food=[(1, 1)], bots=[None, None], enemy=None)\n", "old_path": "test/test_team.py", "rewrite": "ReplaceText(target='layout_str' @(81,31)->(81,37))"} {"repo": "https://:@github.com/ASPP/pelita.git", "hash": "6fd0a9d2af44c491c1cc6774c3a169e97e2040be", "diff": "@@ -398,7 +398,7 @@ def _team(self):\n @property\n def turn(self):\n \"\"\" The turn of our bot. \"\"\"\n- return self.bot_index // 2\n+ return self.bot_index % 2\n \n @property\n def other(self):\n", "old_path": "pelita/player/team.py", "rewrite": "ReplaceText(target='%' @(401,30)->(401,32))"} {"repo": "https://:@github.com/iotaledger/ccurl.interface.py.git", "hash": "eb7f9190d24995d3f8d03a8350382ab6045a6e67", "diff": "@@ -44,7 +44,7 @@ gta = api.get_transactions_to_approve(depth=3) # get tips to be approved by your\n \n mwm = 14 # target is mainnet\n \n-bundle = entangled_interface.local_attach_to_tangle(pb, gta['trunkTransaction'], gta['branchTransaction'], mwm)\n+bundle = entangled_interface.local_attach_to_tangle(pb, gta['branchTransaction'],gta['trunkTransaction'], mwm)\n \n bundle_trytes = [ x.as_tryte_string() for x in pb._transactions ]\n \n", "old_path": "examples/with_entangled.py", "rewrite": "ArgSwap(idxs=1<->2 @(47,9)->(47,51))"} {"repo": "https://:@github.com/softlayer/softlayer-python.git", "hash": "53731de7e51d31475cc224aceb0f3ff7217cdafd", "diff": "@@ -153,7 +153,7 @@ class NetworkManager(object):\n ('privateResidenceFlag', private_residence),\n ('state', state),\n ('postalCode', postal_code)]:\n- if key is not None:\n+ if value is not None:\n update[key] = value\n \n # If there's anything to update, update it\n", "old_path": "SoftLayer/managers/network.py", "rewrite": "ReplaceText(target='value' @(156,15)->(156,18))"} {"repo": "https://:@github.com/softlayer/softlayer-python.git", "hash": "dcf66e15711e47c594f20ffac7605bfc6d1a8746", "diff": "@@ -15,7 +15,7 @@ import click\n type=click.Choice(['vs', 'vlan', 'server']),\n help='Firewall type',\n required=True)\n-@click.option('--high-availability', '--ha',\n+@click.option('--ha', '--high-availability',\n is_flag=True,\n help='High available firewall option')\n @environment.pass_env\n", "old_path": "SoftLayer/CLI/firewall/add.py", "rewrite": "ArgSwap(idxs=0<->1 @(18,1)->(18,13))"} {"repo": "https://:@github.com/softlayer/softlayer-python.git", "hash": "f0840e302d486d6002a14419bbde85c1deedaf6a", "diff": "@@ -271,7 +271,7 @@ class BlockStorageManager(utils.IdentifierMixin, object):\n package,\n 'performance_storage_iscsi'\n ),\n- storage_utils.find_performance_space_price(package, iops),\n+ storage_utils.find_performance_space_price(package, size),\n storage_utils.find_performance_iops_price(package, size, iops),\n ]\n elif storage_type == 'storage_service_enterprise':\n", "old_path": "SoftLayer/managers/block.py", "rewrite": "ReplaceText(target='size' @(274,68)->(274,72))"} {"repo": "https://:@github.com/softlayer/softlayer-python.git", "hash": "4418057fc0e3632aba2d89b6e42494c79cadd16a", "diff": "@@ -367,7 +367,7 @@ class VSManager(utils.IdentifierMixin, object):\n if datacenter:\n data[\"datacenter\"] = {\"name\": datacenter}\n \n- if private_vlan and public_vlan:\n+ if private_vlan or public_vlan:\n network_components = self._create_network_components(public_vlan, private_vlan,\n private_subnet, public_subnet)\n data.update(network_components)\n", "old_path": "SoftLayer/managers/vs.py", "rewrite": "ReplaceText(target='or' @(370,24)->(370,27))"} {"repo": "https://:@github.com/softlayer/softlayer-python.git", "hash": "58b27c6bf5400a717acd00b7866964ef11f36e59", "diff": "@@ -87,6 +87,6 @@ def cli(env, identifier):\n for guest in guests:\n real_guest = guest.get('virtualGuest')\n member_table.add_row([\n- guest.get('id'), real_guest.get('hostname'), utils.clean_time(real_guest.get('provisionDate'))\n+ real_guest.get('id'), real_guest.get('hostname'), utils.clean_time(real_guest.get('provisionDate'))\n ])\n env.fout(member_table)\n", "old_path": "SoftLayer/CLI/autoscale/detail.py", "rewrite": "ReplaceText(target='real_guest' @(90,12)->(90,17))"} {"repo": "https://:@github.com/data-8/datascience.git", "hash": "fd9aceb598290fb89a0f3131c3fb39dde18ef543", "diff": "@@ -446,7 +446,7 @@ class Table(collections.abc.Mapping):\n count | points\n 9 | 10\n \"\"\"\n- percentiles = [percentile(self[column_name], p) for column_name in self]\n+ percentiles = [percentile(p, self[column_name]) for column_name in self]\n return Table(percentiles, self.column_labels)\n ##################\n # Export/Display #\n", "old_path": "datascience/tables.py", "rewrite": "ArgSwap(idxs=0<->1 @(449,23)->(449,33))"} {"repo": "https://:@github.com/data-8/datascience.git", "hash": "084450f127ecc490b887cad82fa43cda5f9b32fe", "diff": "@@ -2255,7 +2255,7 @@ class Table(collections.abc.MutableMapping):\n space_count[labels[i]] += 1\n return updated_labels\n return labels\n- yticks = make_unique_labels(labels)\n+ yticks = make_unique_labels(yticks)\n \n print(\"yticks: \" + str(yticks))\n print(\"ylabel: \" + str(ylabel))\n", "old_path": "datascience/tables.py", "rewrite": "ReplaceText(target='yticks' @(2258,36)->(2258,42))"} {"repo": "https://:@github.com/dnaeon/py-vpoller.git", "hash": "81769f6f8d9cb0dfc8cbc39a44027afa7d459636", "diff": "@@ -51,6 +51,6 @@ def task(name, required=None):\n result = {'success': 1, 'msg': e.message}\n finally:\n return result\n- registry.register(name=name, fn=fn, required=required)\n+ registry.register(name=name, fn=wrapper, required=required)\n return wrapper\n return decorator\n", "old_path": "src/vpoller/decorators.py", "rewrite": "ReplaceText(target='wrapper' @(54,40)->(54,42))"} {"repo": "https://:@github.com/enthought/qt_binder.git", "hash": "68381b406035f2ce9666cb8ef1ab2e8e57cf8bf8", "diff": "@@ -58,4 +58,4 @@ else:\n loader = RecordingUiLoader()\n ui = loader.load(path)\n \n- return ui, ui.to_be_bound()\n+ return ui, loader.to_be_bound()\n", "old_path": "qt_binder/qt/ui_loader.py", "rewrite": "ReplaceText(target='loader' @(61,19)->(61,21))"} {"repo": "https://:@github.com/ggozad/behaving.git", "hash": "1bc546aa03f9d42ff78a0a79e0894e488edc9add", "diff": "@@ -40,7 +40,7 @@ def should_receive_email(context, address):\n def click_link_in_email(context, address):\n mails = context.mail.user_messages(address)\n assert mails, u'message not found'\n- mail = email.message_from_string(mails[-1])\n+ mail = email.message_from_string(mails[0])\n links = URL_RE.findall(str(mail).replace('=\\n', ''))\n assert links, u'link not found'\n url = links[0]\n", "old_path": "src/behaving/mail/steps.py", "rewrite": "ReplaceText(target='0' @(43,43)->(43,45))"} {"repo": "https://:@github.com/allenai/SciSpaCy.git", "hash": "d0d1d525943e051762ea5482ba82c9a4718285c0", "diff": "@@ -58,7 +58,7 @@ def train_parser_and_tagger(train_json_path: str,\n parser = nlp.get_pipe('parser')\n \n train_corpus = GoldCorpus(train_json_path, dev_json_path)\n- test_corpus = GoldCorpus(train_json_path, dev_json_path)\n+ test_corpus = GoldCorpus(train_json_path, test_json_path)\n \n if ontonotes_path:\n onto_train_path = os.path.join(ontonotes_path, \"train\")\n", "old_path": "scripts/train_parser_and_tagger.py", "rewrite": "ReplaceText(target='test_json_path' @(61,46)->(61,59))"} {"repo": "https://:@github.com/allenai/SciSpaCy.git", "hash": "e15e9b7913459b6139d4f30030a502f30479cfd5", "diff": "@@ -190,7 +190,7 @@ def train_parser_and_tagger(train_json_path: str,\n print(\"Token acc:\", scorer_onto_retrained.token_acc)\n \n with open(os.path.join(model_output_dir, \"ontonotes_test.json\")) as metric_file:\n- json.dump(scorer.scores, metric_file)\n+ json.dump(scorer_onto_retrained.scores, metric_file)\n if __name__ == \"__main__\":\n parser = argparse.ArgumentParser()\n \n", "old_path": "scripts/train_parser_and_tagger.py", "rewrite": "ReplaceText(target='scorer_onto_retrained' @(193,22)->(193,28))"} {"repo": "https://:@github.com/allenai/SciSpaCy.git", "hash": "47400cbed4d4943f6bba7ed013bf80110f738f2e", "diff": "@@ -679,7 +679,7 @@ def eval_candidate_generation_and_linking(examples: List[data_util.MedMentionExa\n if generate_linking_classifier_training_data:\n for candidates, mention_types_for_mention in zip(candidates_by_mention, mention_types_by_mention):\n for candidate_id, candidate in candidates.items():\n- classifier_example = linker.classifier_example(candidate_id, candidate, mention_text, mention_types)\n+ classifier_example = linker.classifier_example(candidate_id, candidate, mention_text, mention_types_for_mention)\n classifier_example['label'] = int(gold_entity.umls_id == candidate_id)\n linking_classifier_training_data.append(classifier_example)\n \n", "old_path": "scripts/linking.py", "rewrite": "ReplaceText(target='mention_types_for_mention' @(682,118)->(682,131))"} {"repo": "https://:@github.com/Burnysc2/python-sc2.git", "hash": "c3f5b0de304727914a2a59d5cfde6dda04071686", "diff": "@@ -381,7 +381,7 @@ class BotAI(object):\n return ActionResult.CantFindPlacementLocation\n \n unit = unit or self.select_build_worker(p)\n- if unit is None or self.can_afford(building):\n+ if unit is None or not self.can_afford(building):\n return ActionResult.Error\n return await self.do(unit.build(building, p))\n \n", "old_path": "sc2/bot_ai.py", "rewrite": "ReplaceText(target='not ' @(384,27)->(384,27))"} {"repo": "https://:@github.com/Burnysc2/python-sc2.git", "hash": "20468d57d6fd5cc80c9e7757d75e987bd81e632a", "diff": "@@ -185,7 +185,7 @@ class Point2(Pointlike):\n Used in ramp finding \"\"\"\n assert self != p\n distanceBetweenPoints = self.distance_to(p)\n- assert r > distanceBetweenPoints / 2\n+ assert r >= distanceBetweenPoints / 2\n # remaining distance from center towards the intersection, using pythagoras\n remainingDistanceFromCenter = (r ** 2 - (distanceBetweenPoints / 2) ** 2) ** 0.5\n # center of both points\n", "old_path": "sc2/position.py", "rewrite": "ReplaceText(target='>=' @(188,17)->(188,18))"} {"repo": "https://:@github.com/Burnysc2/python-sc2.git", "hash": "9470180d3caaa18098ebffea220719ad6083afbe", "diff": "@@ -185,7 +185,7 @@ class Point2(Pointlike):\n Used in ramp finding \"\"\"\n assert self != p\n distanceBetweenPoints = self.distance_to(p)\n- assert r > distanceBetweenPoints / 2\n+ assert r >= distanceBetweenPoints / 2\n # remaining distance from center towards the intersection, using pythagoras\n remainingDistanceFromCenter = (r ** 2 - (distanceBetweenPoints / 2) ** 2) ** 0.5\n # center of both points\n", "old_path": "sc2/position.py", "rewrite": "ReplaceText(target='>=' @(188,17)->(188,18))"} {"repo": "https://:@github.com/Burnysc2/python-sc2.git", "hash": "9c59f42e1722e1141a51300d472b0385d64f1640", "diff": "@@ -86,7 +86,7 @@ class Units(list):\n return self[0]\n \n def take(self, n: int) -> \"Units\":\n- if self.amount >= n:\n+ if self.amount <= n:\n return self\n else:\n return self.subgroup(self[:n])\n", "old_path": "sc2/units.py", "rewrite": "ReplaceText(target='<=' @(89,23)->(89,25))"} {"repo": "https://:@github.com/kenjyco/beu.git", "hash": "4aea6146fc5f01df3e344b9fadddf28b795dac89", "diff": "@@ -36,7 +36,7 @@ def _get_settings_file():\n if not os.path.exists(home_config_dir):\n os.makedirs(home_config_dir)\n copyfile(sample_file, settings_file)\n- print('\\nCopied settings to {}'.format(repr(home_config_dir)))\n+ print('\\nCopied settings to {}'.format(repr(settings_file)))\n return settings_file\n \n \n", "old_path": "beu/__init__.py", "rewrite": "ReplaceText(target='settings_file' @(39,48)->(39,63))"} {"repo": "https://:@github.com/WattTime/pyiso.git", "hash": "009316799f872c90f50b73e41f3a6f9021f8b2cc", "diff": "@@ -111,7 +111,7 @@ class BaseClient(object):\n self.options.update(kwargs)\n \n # check start_at and end_at args\n- if self.options.get('start_at', None) and self.options.get('end_at', None):\n+ if self.options.get('start_at', None) or self.options.get('end_at', None):\n assert self.options['start_at'] < self.options['end_at']\n self.options['start_at'] = self.utcify(self.options['start_at'])\n self.options['end_at'] = self.utcify(self.options['end_at'])\n", "old_path": "pyiso/base.py", "rewrite": "ReplaceText(target='or' @(114,46)->(114,49))"} {"repo": "https://:@github.com/WattTime/pyiso.git", "hash": "31c2680f1e96d6affbbef6dc75b9ab3724a7d8b9", "diff": "@@ -117,7 +117,7 @@ class BaseClient(object):\n self.options.update(kwargs)\n \n # check start_at and end_at args\n- if self.options.get('start_at', None) or self.options.get('end_at', None):\n+ if self.options.get('start_at', None) and self.options.get('end_at', None):\n assert self.options['start_at'] < self.options['end_at']\n self.options['start_at'] = self.utcify(self.options['start_at'])\n self.options['end_at'] = self.utcify(self.options['end_at'])\n", "old_path": "pyiso/base.py", "rewrite": "ReplaceText(target='and' @(120,46)->(120,48))"} {"repo": "https://:@github.com/WattTime/pyiso.git", "hash": "14fd34daa69230352ecb651ee8f30a4566ab6c59", "diff": "@@ -18,7 +18,7 @@ class TestGenerationTask(TestCase):\n expected = client_factory(ba).get_generation(**kwargs)\n received = tasks.get_generation(ba, **kwargs)\n \n- for i in range(len(expected)):\n+ for i in range(len(received)):\n if expected[i]['timestamp'] == received[i]['timestamp']:\n self.assertEqual(expected[i]['gen_MW'], received[i]['gen_MW'])\n self.assertEqual(expected[i]['fuel_name'], received[i]['fuel_name'])\n", "old_path": "tests/test_tasks.py", "rewrite": "ReplaceText(target='received' @(21,27)->(21,35))"} {"repo": "https://:@github.com/TTWShell/hobbit-core.git", "hash": "b51217f7fc8cb238c1dc09e8932178cda40cf2b4", "diff": "@@ -133,4 +133,4 @@ class TestTransaction(BaseTest):\n \n with pytest.raises(Exception):\n view_func2()\n- assert len(User.query.all()) == 1\n+ assert len(User.query.all()) == 0\n", "old_path": "tests/test_db.py", "rewrite": "ReplaceText(target='0' @(136,40)->(136,41))"} {"repo": "https://:@github.com/ktdreyer/jenkins-job-wrecker.git", "hash": "3be4ea2d49a46cec8223361142305107b88ca889", "diff": "@@ -162,7 +162,7 @@ def prebuildcleanup(top, parent):\n pass\n else:\n raise NotImplementedError(\"cannot handle \"\n- \"XML %s\" % subelement.tag)\n+ \"XML %s\" % element.tag)\n \n for rule in preclean_patterns:\n if preclean_patterns[rule] is not None and len(preclean_patterns[rule]) > 0:\n", "old_path": "jenkins_job_wrecker/modules/buildwrappers.py", "rewrite": "ReplaceText(target='element' @(165,49)->(165,59))"} {"repo": "https://:@github.com/Sage-Bionetworks/Genie.git", "hash": "7a6ff590425d32fd596687bd0d35bc98680fc5b8", "diff": "@@ -379,7 +379,7 @@ class clinical(example_filetype_format.FileTypeFormat):\n \t\t\tpatient_patients = clinicalDF[patientId][clinicalDF[patientId] != \"\"]\n \t\t\t# #CHECK: All samples must have associated patient data (GENIE requires patient data)\n \t\t\tif not all(sample_patients.isin(patient_patients)):\n-\t\t\t\ttotal_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])])\n+\t\t\t\ttotal_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])])\n \t\t\t#CHECK: All patients must have associated sample data \n \t\t\tif not all(patient_patients.isin(sample_patients)):\n \t\t\t\t### MAKE WARNING FOR NOW###\n", "old_path": "processing/clinical.py", "rewrite": "ReplaceText(target='sampleId' @(382,157)->(382,166))"} {"repo": "https://:@github.com/Sage-Bionetworks/Genie.git", "hash": "b5b670e4a5797ba2a66caa517bbe2160fec645f7", "diff": "@@ -209,7 +209,7 @@ def createMafDatabase(syn, databaseToSynIdMappingDf,testing=False,staging=False)\n \t\t#Make sure to store the newly created maf db synid into the staging synapse mapping\n \t\tdatabaseToSynIdMapping = syn.tableQuery(\"SELECT * FROM syn12094210 where Database = 'vcf2maf'\")\n \t\tdatabaseToSynIdMappingDf = databaseToSynIdMapping.asDataFrame()\n-\t\tdatabaseToSynIdMapping['Id'][0] = newMafDb.id\n+\t\tdatabaseToSynIdMappingDf['Id'][0] = newMafDb.id\n \t\tsyn.store(synapseclient.Table(\"syn12094210\",databaseToSynIdMappingDf))\n \t#Move and archive old mafdatabase\n \tmafDatabaseEnt.parentId = \"syn7208886\"\n", "old_path": "processing/input_to_database.py", "rewrite": "ReplaceText(target='databaseToSynIdMappingDf' @(212,2)->(212,24))"} {"repo": "https://:@github.com/Sage-Bionetworks/Genie.git", "hash": "78fcacd10d4c44c90f41893a161de24ff13ea774", "diff": "@@ -311,7 +311,7 @@ class clinical(FileTypeFormat):\n \t\thaveColumn = process_functions.checkColExist(clinicalDF, \"SEQ_ASSAY_ID\")\n \t\tif haveColumn:\n \t\t\tif not all([i != \"\" for i in clinicalDF['SEQ_ASSAY_ID']]):\n-\t\t\t\ttotal_error += \"Sample: Please double check your SEQ_ASSAY_ID columns, there are empty rows.\\n\"\n+\t\t\t\twarning += \"Sample: Please double check your SEQ_ASSAY_ID columns, there are empty rows.\\n\"\n \t\t\t#must remove empty seq assay ids first\n \t\t\t#Checking if seq assay ids start with the center name\n \t\t\tseqAssayIds = clinicalDF.SEQ_ASSAY_ID[clinicalDF.SEQ_ASSAY_ID != \"\"]\n", "old_path": "genie/clinical.py", "rewrite": "ReplaceText(target='warning' @(314,4)->(314,15))"} {"repo": "https://:@github.com/Sage-Bionetworks/Genie.git", "hash": "e115f3884db224a231c87b346f04d6edbf66d6bb", "diff": "@@ -87,7 +87,7 @@ class vcf(maf.maf):\n \t\t\t\ttumor = \"TUMOR\"\n \t\t\t\tnormal = \"NORMAL\"\n \t\t\t# ### If the tumor name isn't TUMOR, set the sample id to be the tumor name\n-\t\t\tif tumor != \"TUMOR\":\n+\t\t\tif tumor == \"TUMOR\":\n \t\t\t\ttumorName = vcfName.replace(\".vcf\",\"\")\n \t\t\telse:\n \t\t\t\ttumorName = tumor\n", "old_path": "genie/vcf.py", "rewrite": "ReplaceText(target='==' @(90,12)->(90,14))"} {"repo": "https://:@github.com/Sage-Bionetworks/Genie.git", "hash": "4c861c5eccebb0d0a402d85b658924df1e6a8819", "diff": "@@ -247,7 +247,7 @@ def validation(syn, center, process, center_mapping_df, databaseToSynIdMappingDf\n duplicatedFiles = duplicatedFiles.append(cbsSegFiles)\n clinical_bool = [\"clinical\" in i for i in inputValidStatus['name']]\n clinical_files = inputValidStatus[clinical_bool]\n- if len(clinical_bool) > 2:\n+ if len(clinical_files) > 2:\n duplicatedFiles = duplicatedFiles.append(clinical_files)\n \n # nodups = [\"data_mutations_extended\"]\n", "old_path": "genie/input_to_database.py", "rewrite": "ReplaceText(target='clinical_files' @(250,15)->(250,28))"} {"repo": "https://:@github.com/Sage-Bionetworks/Genie.git", "hash": "39f33cd754223ee515b8d790c0cd96b32f36b88e", "diff": "@@ -270,7 +270,7 @@ def validatefile(syn, entities, validation_status_table, error_tracker_table,\n input_status_list, invalid_errors_list = _get_status_and_error_list(\n valid, message, entities)\n # Send email the first time the file is invalid\n- if invalid_errors_list:\n+ if not invalid_errors_list:\n _send_validation_error_email(syn, filenames, message, file_users)\n else:\n input_status_list = [\n", "old_path": "genie/input_to_database.py", "rewrite": "ReplaceText(target='not ' @(273,11)->(273,11))"} {"repo": "https://:@github.com/Sage-Bionetworks/Genie.git", "hash": "e140dee708542afa35c5d1e30671d8083fcbcd29", "diff": "@@ -512,7 +512,7 @@ class bed(FileTypeFormat):\n string: Path to new bed file\n \"\"\"\n final_beddf = self._process(beddf, seq_assay_id, newPath, parentId)\n- process_functions.updateData(self.syn, databaseSynId, beddf,\n+ process_functions.updateData(self.syn, databaseSynId, final_beddf,\n seq_assay_id,\n filterByColumn=\"SEQ_ASSAY_ID\",\n toDelete=True)\n", "old_path": "genie/bed.py", "rewrite": "ReplaceText(target='final_beddf' @(515,62)->(515,67))"} {"repo": "https://:@github.com/Libensemble/libensemble.git", "hash": "a7175c6bf59803deb4a52aaf8c0185b93874ff21", "diff": "@@ -96,7 +96,7 @@ def decide_work_and_resources(active_w, idle_w, H, H_ind, sim_specs, gen_specs):\n 'form_subcomm': [], \n 'calc_in': H[sim_specs['in']][inds_to_send],\n 'calc_out': sim_specs['out'],\n- 'calc_info': {'type':'sim', 'pt_ids': q_inds},\n+ 'calc_info': {'type':'sim', 'pt_ids': inds_to_send},\n }\n \n update_history_x_out(H, q_inds, Work[i]['calc_in'], i, sim_specs['params'])\n", "old_path": "code/src/libE_manager.py", "rewrite": "ReplaceText(target='inds_to_send' @(99,61)->(99,67))"} {"repo": "https://:@github.com/Libensemble/libensemble.git", "hash": "ad5e021d040efd28a61d6afa2be908e25f363bd4", "diff": "@@ -52,7 +52,7 @@ def worker_main(c, sim_specs, gen_specs):\n \n if tag_out == STOP_TAG: break\n \n- comm.send(obj=data_out, dest=0, tag=calc_tag) \n+ comm.send(obj=data_out, dest=0, tag=tag_out) \n \n # Clean up\n for loc in locations.values():\n", "old_path": "code/src/libE_worker.py", "rewrite": "ReplaceText(target='tag_out' @(55,44)->(55,52))"} {"repo": "https://:@github.com/Libensemble/libensemble.git", "hash": "2b33970bdac3034cc7799c2849eae09f9c22fcf6", "diff": "@@ -40,7 +40,7 @@ class MPIComm(Comm):\n def kill_pending(self):\n \"Make sure pending requests are cancelled if the comm is killed.\"\n for req in self._outbox:\n- if req.Test():\n+ if not req.Test():\n req.Cancel()\n self._outbox = []\n \n", "old_path": "libensemble/mpi_comms.py", "rewrite": "ReplaceText(target='not ' @(43,15)->(43,15))"} {"repo": "https://:@github.com/Libensemble/libensemble.git", "hash": "155ba0c0517046e8ec305e76862bc6f0a44fafc7", "diff": "@@ -136,7 +136,7 @@ class EnvResources:\n nidstr = splitstr[1].strip(\"]\")\n nidlst = EnvResources._noderange_append(prefix, nidstr)\n else: # Multiple Partitions\n- splitgroups = [str.split('[', 1) for str in splitstr]\n+ splitgroups = [str.split('[', 1) for str in part_splitstr]\n prefixgroups = [group[0] for group in splitgroups]\n nodegroups = [group[1].strip(']') for group in splitgroups]\n nidlst = []\n", "old_path": "libensemble/env_resources.py", "rewrite": "ReplaceText(target='part_splitstr' @(139,56)->(139,64))"} {"repo": "https://:@github.com/Libensemble/libensemble.git", "hash": "c89e4f0b72361ba84884a3c691d73d8f62b98014", "diff": "@@ -108,7 +108,7 @@ def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):\n last_size = persis_info.get('last_size')\n if len(H):\n # Don't give gen instances in batch mode if points are unfinished\n- if (gen_specs['user'].get('batch_mode')\n+ if (alloc_specs['user'].get('batch_mode')\n and not all(np.logical_or(H['returned'][last_size:],\n H['paused'][last_size:]))):\n break\n", "old_path": "libensemble/alloc_funcs/fast_alloc_and_pausing.py", "rewrite": "ReplaceText(target='alloc_specs' @(111,20)->(111,29))"} {"repo": "https://:@github.com/Libensemble/libensemble.git", "hash": "c89e4f0b72361ba84884a3c691d73d8f62b98014", "diff": "@@ -33,7 +33,7 @@ def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):\n last_size = persis_info.get('last_size')\n if len(H):\n # Don't give gen instances in batch mode if points are unfinished\n- if (gen_specs['user'].get('batch_mode')\n+ if (alloc_specs['user'].get('batch_mode')\n and not all(np.logical_or(H['returned'][last_size:],\n H['paused'][last_size:]))):\n break\n", "old_path": "libensemble/alloc_funcs/fast_alloc_to_aposmm.py", "rewrite": "ReplaceText(target='alloc_specs' @(36,20)->(36,29))"} {"repo": "https://:@github.com/Libensemble/libensemble.git", "hash": "c89e4f0b72361ba84884a3c691d73d8f62b98014", "diff": "@@ -73,7 +73,7 @@ def give_sim_work_first(W, H, sim_specs, gen_specs, alloc_specs, persis_info):\n \n # No gen instances in batch mode if workers still working\n still_working = ~H['returned']\n- if gen_specs['user'].get('batch_mode') and np.any(still_working):\n+ if alloc_specs['user'].get('batch_mode') and np.any(still_working):\n break\n \n # Give gen work\n", "old_path": "libensemble/alloc_funcs/give_sim_work_first.py", "rewrite": "ReplaceText(target='alloc_specs' @(76,15)->(76,24))"} {"repo": "https://:@github.com/Libensemble/libensemble.git", "hash": "55f4a8f05ade4709b53cbe9ef92fe00a0e2e9a79", "diff": "@@ -59,7 +59,7 @@ def try_and_run_nlopt(H, gen_specs, libE_info):\n gen_specs['user']['ub'], gen_specs['user']['lb'], local=True, active=True)\n tag, Work, calc_in = sendrecv_mgr_worker_msg(comm, H_o)\n if tag in [STOP_TAG, PERSIS_STOP]:\n- nlopt.forced_stop.message = 'tag=' + str(tag)\n+ nlopt.forced_stop.message = 'tag=' + str(Work)\n raise nlopt.forced_stop\n \n # Return function value (and maybe gradient)\n", "old_path": "libensemble/gen_funcs/uniform_or_localopt.py", "rewrite": "ReplaceText(target='Work' @(62,53)->(62,56))"} {"repo": "https://:@github.com/Libensemble/libensemble.git", "hash": "c090514bb370c6960db4c8be2ae643534def8d2b", "diff": "@@ -24,4 +24,4 @@ def persistent_uniform(H, persis_info, gen_specs, libE_info):\n H_o['x'] = persis_info['rand_stream'].uniform(lb, ub, (b, n))\n tag, Work, calc_in = sendrecv_mgr_worker_msg(libE_info['comm'], H_o)\n \n- return H_o, persis_info, tag\n+ return H_o, persis_info, Work\n", "old_path": "libensemble/gen_funcs/persistent_uniform_sampling.py", "rewrite": "ReplaceText(target='Work' @(27,29)->(27,32))"} {"repo": "https://:@github.com/davedittrich/python_secrets.git", "hash": "3a477f63bb9d0417e63254ba993025a8666c3e1d", "diff": "@@ -181,7 +181,7 @@ class PythonSecretsApp(App):\n self.environment = self.options.environment\n self.secrets_basedir = self.options.secrets_basedir\n # Don't output error messages when \"complete\" command used\n- if cmd.cmd_name == 'complete':\n+ if cmd.cmd_name != 'complete':\n SecretsEnvironment.permissions_check(\n self.secrets_basedir,\n verbose_level=self.options.verbose_level,\n", "old_path": "psec/main.py", "rewrite": "ReplaceText(target='!=' @(184,24)->(184,26))"} {"repo": "https://:@github.com/junzis/pyModeS.git", "hash": "b2940af6efe4cb6d99bca8a1f1f214292acf3e6a", "diff": "@@ -79,7 +79,7 @@ def cpr2position(cprlat0, cprlat1, cprlon0, cprlon1, t0, t1):\n cprlat_even = cprlat0 / 131072.0\n cprlat_odd = cprlat1 / 131072.0\n cprlon_even = cprlon0 / 131072.0\n- cprlon_odd = cprlon0 / 131072.0\n+ cprlon_odd = cprlon1 / 131072.0\n \n air_d_lat_even = 360.0 / 60 \n air_d_lat_odd = 360.0 / 59 \n", "old_path": "decoder.py", "rewrite": "ReplaceText(target='cprlon1' @(82,18)->(82,25))"} {"repo": "https://:@github.com/icb-dcm/pyabc.git", "hash": "2df9fbbc034ecad45cde0e14d0205fc70ae9b90b", "diff": "@@ -456,5 +456,5 @@ class ABCSMC:\n return\n \n for m in self.history.alive_models(t - 1):\n- particles, w = self.history.get_distribution(t - 1, m)\n+ particles, w = self.history.get_distribution(m, t - 1)\n self.transitions[m].fit(particles, w)\n", "old_path": "pyabc/smc.py", "rewrite": "ArgSwap(idxs=0<->1 @(459,27)->(459,56))"} {"repo": "https://:@github.com/icb-dcm/pyabc.git", "hash": "2df9fbbc034ecad45cde0e14d0205fc70ae9b90b", "diff": "@@ -108,7 +108,7 @@ def abc_model(abc_id, model_id, t):\n t = history.max_t\n else:\n t = int(t)\n- df, w = history.get_distribution(t, model_id)\n+ df, w = history.get_distribution(model_id, t)\n df[\"CDF\"] = w\n tabs = []\n \n", "old_path": "pyabc/visserver/server.py", "rewrite": "ArgSwap(idxs=0<->1 @(111,12)->(111,36))"} {"repo": "https://:@github.com/icb-dcm/pyabc.git", "hash": "2df9fbbc034ecad45cde0e14d0205fc70ae9b90b", "diff": "@@ -122,7 +122,7 @@ def test_dataframe_storage_readout():\n for m in range(5):\n pop = pops[(h, m, t)]\n expected_particles_list = [p.parameter for p in pop]\n- pars_df, w = h.get_distribution(t, m)\n+ pars_df, w = h.get_distribution(m, t)\n # use range(len and not zip on dataframe to not stop early\n # in case of population not completely stored\n assert np.isclose(w.sum(), 1)\n", "old_path": "test/test_storage.py", "rewrite": "ArgSwap(idxs=0<->1 @(125,29)->(125,47))"} {"repo": "https://:@github.com/llllllllll/codetransformer.git", "hash": "7c327683df810265d01a995d2704c9f8218b0ef7", "diff": "@@ -141,7 +141,7 @@ class Instruction(InstructionMeta._marker, metaclass=InstructionMeta):\n 'little',\n )\n \n- yield cls(arg)\n+ yield instr(arg)\n \n @classmethod\n def from_opcode(cls, opcode):\n", "old_path": "codetransformer/instructions.py", "rewrite": "ReplaceText(target='instr' @(144,18)->(144,21))"} {"repo": "https://:@github.com/richardkiss/pycoin.git", "hash": "c6b3b2e0d7167d4566dc1d90258d6b98dba8bb65", "diff": "@@ -197,7 +197,7 @@ def eval_script(script, signature_for_hash_type_f, lock_time, expected_hash_type\n # Subset of script starting at the most recent codeseparator\n op_checksig(stack, signature_for_hash_type_f, expected_hash_type, script[begin_code_hash:], flags)\n if opcode == opcodes.OP_CHECKSIGVERIFY:\n- if bool_from_script_bytes(stack.pop()):\n+ if not bool_from_script_bytes(stack.pop()):\n raise ScriptError(\"VERIFY failed at %d\" % (pc-1))\n continue\n \n", "old_path": "pycoin/tx/script/vm.py", "rewrite": "ReplaceText(target='not ' @(200,23)->(200,23))"} {"repo": "https://:@github.com/richardkiss/pycoin.git", "hash": "6d1df60ddb054d1510f38231a529ccf35a73525a", "diff": "@@ -302,7 +302,7 @@ def generate_output(args, output_dict, output_order):\n \n if len(output_order) == 0:\n print(\"no output: use -j option to see keys\")\n- elif len(output_order) == 1:\n+ elif len(output_dict) == 1:\n print(output_dict[output_order[0][0]])\n else:\n dump_output(output_dict, output_order)\n", "old_path": "pycoin/cmds/ku.py", "rewrite": "ReplaceText(target='output_dict' @(305,13)->(305,25))"} {"repo": "https://:@github.com/richardkiss/pycoin.git", "hash": "02a225ef6056cc5a7fa19a731e14fbda94522c55", "diff": "@@ -37,7 +37,7 @@ def deterministic_generate_k(generator_order, secret_exponent, val, hash_f=hashl\n shift = 8 * hash_size - bln\n if shift > 0:\n val >>= shift\n- if val > n:\n+ if val >= n:\n val -= n\n h1 = intstream.to_bytes(val, length=order_size)\n k = hmac.new(k, v + b'\\x00' + priv + h1, hash_f).digest()\n", "old_path": "pycoin/ecdsa/rfc6979.py", "rewrite": "ReplaceText(target='>=' @(40,11)->(40,12))"} {"repo": "https://:@github.com/er1iang/hfut-stu-lib.git", "hash": "6bdc0e5591564da7b5fe2acd60bde0cb8b2b46f6", "diff": "@@ -60,7 +60,7 @@ class TestUtil(TestBase):\n '172.18.6.98',\n '172.18.6.99'\n ])\n- assert len(r) == 1\n+ assert len(r) <= 1\n with pytest.raises(ValueError):\n util.get_host_speed_rank(['qq.com'])\n assert util.get_host_speed_rank(timeout=0) == []\n", "old_path": "tests/test_util.py", "rewrite": "ReplaceText(target='<=' @(63,22)->(63,24))"} {"repo": "https://:@github.com/acorg/dark-matter.git", "hash": "7837baf17ff17925b5a56178358b3ec478635c9b", "diff": "@@ -109,7 +109,7 @@ def main():\n consensus.id = args.id\n elif args.idLambda is not None:\n idLambda = eval(args.idLambda)\n- consensus.id = idLambda(args.id)\n+ consensus.id = idLambda(consensus.id)\n \n print(consensus.toString('fasta'), end='')\n \n", "old_path": "bin/make-consensus.py", "rewrite": "ReplaceText(target='consensus' @(112,32)->(112,36))"} {"repo": "https://:@github.com/Netflix/security_monkey.git", "hash": "b6356189f8c9e407e4c017bbbf31d8f32aa004a9", "diff": "@@ -122,7 +122,7 @@ class SNSAuditor(Auditor):\n else:\n arn = ARN(princ_aws)\n if arn.error:\n- self.add_issue(3, 'Auditor could not parse ARN', snsitem, notes=entry)\n+ self.add_issue(3, 'Auditor could not parse ARN', snsitem, notes=princ_aws)\n else:\n account_numbers.append(arn.account_number)\n \n", "old_path": "security_monkey/auditors/sns.py", "rewrite": "ReplaceText(target='princ_aws' @(125,88)->(125,93))"} {"repo": "https://:@github.com/SetBased/py-stratum.git", "hash": "0a4f1f580810e466e6384395832353a77b8e909f", "diff": "@@ -26,7 +26,7 @@ class Connection:\n else:\r\n return_value = config.get(section, option, fallback=fallback)\r\n \r\n- if fallback is not None and return_value is None:\r\n+ if fallback is None and return_value is None:\r\n raise KeyError(\"Option '%s' is not found in section '%s'.\" % (option, section))\r\n \r\n return return_value\r\n", "old_path": "pystratum/Connection.py", "rewrite": "ReplaceText(target=' is ' @(29,19)->(29,27))"} {"repo": "https://:@github.com/awslabs/aws-service-catalog-puppet-framework.git", "hash": "8ec184735fbc4d8f72484d5baa0e357bbdbeb9d8", "diff": "@@ -85,7 +85,7 @@ def test_deploy_launches_task_builder_for_account_launch_region(sut, mocker, sha\n assert len(actual_all_tasks.keys()) == 1\n assert actual_all_tasks == expected_all_tasks\n mocked_get_required_params.assert_called_once_with(\n- region_name, launch_details.get('portfolio'), launch_details.get('product'), launch_details.get('version'), puppet_account_id\n+ region_name, launch_details.get('portfolio'), launch_details.get('product'), launch_details.get('version'), account_id\n )\n mocked_get_parameters_for_launch.assert_called_once_with(\n required_parameters,\n", "old_path": "servicecatalog_puppet/cli_command_helpers_unit_test.py", "rewrite": "ReplaceText(target='account_id' @(88,116)->(88,133))"} {"repo": "https://:@github.com/kivy-garden/graph.git", "hash": "b6ec8765b231bfbc1cf0c585243eb43379bb8946", "diff": "@@ -448,7 +448,7 @@ class Graph(Widget):\n ymin = self.ymin\n ymax = self.ymax\n if ylog:\n- xmin = log10(ymin)\n+ ymin = log10(ymin)\n ymax = log10(ymax)\n if len(xpoints):\n top = size[3] if self.x_grid else metrics.dp(12) + size[1]\n", "old_path": "__init__.py", "rewrite": "ReplaceText(target='ymin' @(451,12)->(451,16))"} {"repo": "https://:@github.com/irmen/synthesizer.git", "hash": "e1da70408c0fce248edc4542e2f94e8ea6ea72b9", "diff": "@@ -31,7 +31,7 @@ class DecodedSoundFile:\n self.sample_format = sample_format # one of the ma_format_ values\n self.sample_format_name = ffi.string(lib.ma_get_format_name(sample_format)).decode()\n self.samples = samples\n- self.num_frames = len(samples) / self.nchannels\n+ self.num_frames = len(samples) // self.nchannels\n self.duration = self.num_frames / self.sample_rate\n \n \n", "old_path": "pyminiaudio/miniaudio.py", "rewrite": "ReplaceText(target='//' @(34,39)->(34,40))"} {"repo": "https://:@github.com/pydata/numexpr.git", "hash": "d11ef8a9dec059b679e773ad8fa54dd4f462d2e8", "diff": "@@ -304,7 +304,7 @@ class test_numexpr(TestCase):\n assert_equal(res, b)\n a = False\n res = evaluate('where(a, b, c)')\n- assert_equal(res, b)\n+ assert_equal(res, c)\n \n \n \n", "old_path": "numexpr/tests/test_numexpr.py", "rewrite": "ReplaceText(target='c' @(307,26)->(307,27))"} {"repo": "https://:@github.com/aio-libs/aiozipkin.git", "hash": "73a9594e475a65d11f32ae1ec48d3a324d2cb2b2", "diff": "@@ -23,7 +23,7 @@ class Transport:\n self._queue.append(data)\n \n async def _sender_loop(self):\n- while self._ender.done():\n+ while not self._ender.done():\n if len(self._queue) != 0:\n await self._send()\n \n", "old_path": "aiozipkin/transport.py", "rewrite": "ReplaceText(target='not ' @(26,14)->(26,14))"} {"repo": "https://:@gitlab.com/deliberist/xdgenvpy.git", "hash": "cce7b99c90cd770aee31195f98e23169405d31c2", "diff": "@@ -96,7 +96,7 @@ def print_vars(xdg, variables):\n :param list variables: A sequence of XDG variables to print.\n \"\"\"\n for var in variables:\n- if not (str(var).startswith('XDG_') or hasattr(xdg, var)):\n+ if not (str(var).startswith('XDG_') and hasattr(xdg, var)):\n LOG.error('Invalid XDG variable: %s', var)\n else:\n value = getattr(xdg, var)\n", "old_path": "xdgenvpy/__main__.py", "rewrite": "ReplaceText(target='and' @(99,44)->(99,46))"} {"repo": "https://:@github.com/theislab/anndata.git", "hash": "908bbbd7c0ad3e61e7db0441fbe9ec93091a0dd5", "diff": "@@ -850,7 +850,7 @@ class AnnData(IndexMixin):\n categories=ddata[k])\n if k_stripped in var:\n var[k_stripped] = pd.Categorical.from_codes(\n- codes=smp[k_stripped].values,\n+ codes=var[k_stripped].values,\n categories=ddata[k])\n k_to_delete.append(k)\n \n", "old_path": "anndata/anndata.py", "rewrite": "ReplaceText(target='var' @(853,34)->(853,37))"} {"repo": "https://:@github.com/theislab/anndata.git", "hash": "0c6ad8700a028675f25e6a769aaf39db3f2b8893", "diff": "@@ -104,7 +104,7 @@ def write_loom(\n elif len(adata.obsm.keys()) > 0 or len(adata.varm.keys()) > 0:\n logger.warning(\n f'The loom file will lack these fields:\\n'\n- f'{adata.obsm.keys() + adata.varm.keys()}\\n'\n+ f'{adata.obsm.keys() | adata.varm.keys()}\\n'\n f'Use write_obsm_varm=True to export multi-dimensional annotations'\n )\n \n", "old_path": "anndata/readwrite/write.py", "rewrite": "ReplaceText(target='|' @(107,33)->(107,34))"} {"repo": "https://:@github.com/atarashansky/self-assembling-manifold.git", "hash": "a8a2172a308d8fb99fc3981e64c1cc358d4d3355", "diff": "@@ -965,7 +965,7 @@ class SAMGUI(object):\n else:\n return; #quit\n \n- markers = ut.find_corr_genes(s,txt).flatten()\n+ markers = ut.find_corr_genes(gene,txt).flatten()\n _,i = np.unique(markers,return_index=True)\n markers=markers[np.sort(i)]\n self.marker_genes[self.stab.selected_index] = markers\n", "old_path": "SAMGUI.py", "rewrite": "ReplaceText(target='gene' @(968,37)->(968,38))"} {"repo": "https://:@github.com/atarashansky/self-assembling-manifold.git", "hash": "6539b0d87edc6dd18bd1bd3709fc41ad2c51b3f3", "diff": "@@ -248,7 +248,7 @@ def search_string(vec, s, case_sensitive=False, invert=False):\n i = len(V)\n V = np.concatenate(V); M = np.concatenate(M);\n if i > 1:\n- ix = np.sort(np.unique(V,return_index=True)[1])\n+ ix = np.sort(np.unique(M,return_index=True)[1])\n V=V[ix]; M=M[ix];\n return V,M\n else:\n", "old_path": "samalg/utilities.py", "rewrite": "ReplaceText(target='M' @(251,35)->(251,36))"} {"repo": "https://:@github.com/den4uk/andriller.git", "hash": "a5af3433a9caa6f05d8d43aef5abc8f405349f67", "diff": "@@ -379,7 +379,7 @@ class MainWindow(BaseWindow):\n self.menubar.add_cascade(menu=menu_help, label='Help', underline=0)\n menu_help.add_command(label='Visit website')\n menu_help.add_separator()\n- if getattr(sys, 'frozen', False):\n+ if not getattr(sys, 'frozen', False):\n menu_help.add_command(label='Run Update', command=lambda: self.conf.upgrade_package(logger=self.logger))\n menu_help.add_separator()\n menu_help.add_command(label='About', command=self.about_msg)\n", "old_path": "andriller/windows.py", "rewrite": "ReplaceText(target='not ' @(382,11)->(382,11))"} {"repo": "https://:@github.com/fabiencro/knmt.git", "hash": "26b7b1ed8dfbc0e82804e86c149926fc96cd8d84", "diff": "@@ -699,7 +699,7 @@ def do_eval(config_eval):\n assert len(encdec_list) == 1\n scorer = encdec_list[0].nbest_scorer(src_batch, src_mask)\n \n- nb_batches = (len(tgt_list) + mb_size - 1) / mb_size\n+ nb_batches = (len(tgt_list) + mb_size - 1) // mb_size\n for num_batch in six.moves.range(nb_batches):\n tgt_batch, arg_sort = utils.make_batch_tgt(tgt_list[num_batch * nb_batches: (num_batch + 1) * nb_batches],\n eos_idx=eos_idx, gpu=gpu, volatile=\"on\", need_arg_sort=True)\n", "old_path": "nmt_chainer/translation/eval.py", "rewrite": "ReplaceText(target='//' @(702,55)->(702,56))"} {"repo": "https://:@github.com/fabiencro/knmt.git", "hash": "8ca17b7d3b52100a3c36ae7a380efbf0ce42107d", "diff": "@@ -699,7 +699,7 @@ def do_eval(config_eval):\n assert len(encdec_list) == 1\n scorer = encdec_list[0].nbest_scorer(src_batch, src_mask)\n \n- nb_batches = (len(tgt_list) + mb_size - 1) / mb_size\n+ nb_batches = (len(tgt_list) + mb_size - 1) // mb_size\n for num_batch in six.moves.range(nb_batches):\n tgt_batch, arg_sort = utils.make_batch_tgt(tgt_list[num_batch * nb_batches: (num_batch + 1) * nb_batches],\n eos_idx=eos_idx, gpu=gpu, volatile=\"on\", need_arg_sort=True)\n", "old_path": "nmt_chainer/translation/eval.py", "rewrite": "ReplaceText(target='//' @(702,55)->(702,56))"} {"repo": "https://:@github.com/fabiencro/knmt.git", "hash": "b091633d528161ceba3b63c501774627a2c927aa", "diff": "@@ -1127,7 +1127,7 @@ def build_dataset_one_side_pp(src_fn, src_pp, max_nb_ex=None, make_constraints=N\n # print(len(sentence_tgt), len(sentence_src))\n seq_src = src_pp.convert(sentence_src, stats=stats_src)\n if make_constraints is not None:\n- constraints_fn = make_constraints(src, seq_src)\n+ constraints_fn = make_constraints(sentence_src, seq_src)\n constraints_list.append(constraints_fn)\n res.append(seq_src)\n if make_constraints is not None:\n", "old_path": "nmt_chainer/dataprocessing/processors.py", "rewrite": "ReplaceText(target='sentence_src' @(1130,46)->(1130,49))"} {"repo": "https://:@github.com/biocore/emperor.git", "hash": "dedef9ab8d8578dd9d8d002dfa2dde254f27b133", "diff": "@@ -100,7 +100,7 @@ def main():\n sids_intersection = len(set(zip(*mapping_data)[0]) & set(parsed_coords[0]))\n \n # sample ids must be shared between files\n- if sids_intersection > 0:\n+ if sids_intersection <= 0:\n option_parser.error('The sample identifiers in the coordinates file '\n 'must have at least one match with the data contained in mapping '\n 'file. Verify you are using a coordinates file and a mapping file '\n", "old_path": "scripts/make_emperor.py", "rewrite": "ReplaceText(target='<=' @(103,25)->(103,26))"} {"repo": "https://:@github.com/juanpex/django-model-report.git", "hash": "0aa6d98497f25d178fe48ed9185b77e8d62e722b", "diff": "@@ -58,7 +58,7 @@ class ExcelExporter(Exporter):\n \n for g, rows in report_rows:\n if g:\n- sheet1.write(row_index, 0, u'%s' % x, stylebold)\n+ sheet1.write(row_index, 0, u'%s' % g, stylebold)\n row_index += 1\n for row in list(rows):\n if row.is_value():\n", "old_path": "model_report/exporters/excel.py", "rewrite": "ReplaceText(target='g' @(61,51)->(61,52))"} {"repo": "https://:@github.com/hclivess/Bismuth.git", "hash": "a969c471f3d255e9cd139c100ac942c441c51aa0", "diff": "@@ -120,7 +120,7 @@ def difficulty(c):\n \n time_now = time.time()\n if time_now > timestamp_last + 300: #if 5 minutes have passed\n- difficulty2 = percentage(97,diff_block_previous)\n+ difficulty2 = percentage(97,difficulty)\n else:\n difficulty2 = difficulty\n \n", "old_path": "gui.py", "rewrite": "ReplaceText(target='difficulty' @(123,36)->(123,55))"} {"repo": "https://:@github.com/hclivess/Bismuth.git", "hash": "75e47ec06ac2c83df3fbe413086393d265f27f1c", "diff": "@@ -1097,7 +1097,7 @@ def manager(c, conn):\n app_log.warning(\"Only {} connections active, resetting the connection history\".format(len(connection_pool)))\r\n del tried[:]\r\n \r\n- 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\r\n+ 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\r\n app_log.warning(\"Less active connections ({}) than banlist ({}), resetting banlist and tried\" .format(len(connection_pool), len(banlist)))\r\n del banlist[:]\r\n banlist.extend(config.banlist) # reset to config version\r\n", "old_path": "node.py", "rewrite": "ReplaceText(target='<=' @(1100,52)->(1100,53))"} {"repo": "https://:@github.com/hclivess/Bismuth.git", "hash": "34d72e31b605ce74fc26bd9dac9cedd0c659d5b0", "diff": "@@ -204,7 +204,7 @@ class MainHandler(tornado.web.RequestHandler):\n html.append(\"
Thank you for participating!