Unnamed: 0
int64 0
2.44k
| repo
stringlengths 32
81
| hash
stringlengths 40
40
| diff
stringlengths 113
1.17k
| old_path
stringlengths 5
84
| rewrite
stringlengths 34
79
| initial_state
stringlengths 75
980
| final_state
stringlengths 76
980
|
---|---|---|---|---|---|---|---|
1,500 | https://:@github.com/tboser/cwltool.git | c22c762ba871bbe9ab4f6be7f639ad69a7b78942 | @@ -40,7 +40,7 @@ def _draft2toDraft3dev1(doc, loader, baseuri): # type: (Any, Loader, str) -> An
impLoaded = loader.fetch(imp)
r = None # type: Dict[str, Any]
if isinstance(impLoaded, list):
- r = {"@graph": r}
+ r = {"@graph": impLoaded}
elif isinstance(impLoaded, dict):
r = impLoaded
else:
| cwltool/update.py | ReplaceText(target='impLoaded' @(43,35)->(43,36)) | def _draft2toDraft3dev1(doc, loader, baseuri): # type: (Any, Loader, str) -> An
impLoaded = loader.fetch(imp)
r = None # type: Dict[str, Any]
if isinstance(impLoaded, list):
r = {"@graph": r}
elif isinstance(impLoaded, dict):
r = impLoaded
else: | def _draft2toDraft3dev1(doc, loader, baseuri): # type: (Any, Loader, str) -> An
impLoaded = loader.fetch(imp)
r = None # type: Dict[str, Any]
if isinstance(impLoaded, list):
r = {"@graph": impLoaded}
elif isinstance(impLoaded, dict):
r = impLoaded
else: |
1,501 | https://:@github.com/tboser/cwltool.git | ad34521788edfe8b9c98841b16846c5eebb07edc | @@ -337,7 +337,7 @@ class Loader(object):
for k in sorted(idmapFieldValue.keys()):
val = idmapFieldValue[k]
v = None # type: Dict[unicode, Any]
- if not isinstance(v, dict):
+ if not isinstance(val, dict):
if idmapField in loader.mapPredicate:
v = {loader.mapPredicate[idmapField]: val}
else:
| schema_salad/ref_resolver.py | ReplaceText(target='val' @(340,42)->(340,43)) | class Loader(object):
for k in sorted(idmapFieldValue.keys()):
val = idmapFieldValue[k]
v = None # type: Dict[unicode, Any]
if not isinstance(v, dict):
if idmapField in loader.mapPredicate:
v = {loader.mapPredicate[idmapField]: val}
else: | class Loader(object):
for k in sorted(idmapFieldValue.keys()):
val = idmapFieldValue[k]
v = None # type: Dict[unicode, Any]
if not isinstance(val, dict):
if idmapField in loader.mapPredicate:
v = {loader.mapPredicate[idmapField]: val}
else: |
1,502 | https://:@github.com/MichaelScript/zerorpc-python.git | 74899a7f9f7ebe06e08ce486d3e55145131e399e | @@ -241,7 +241,7 @@ class ClientBase(object):
return self._process_response(request_event, bufchan, timeout)
async_result = gevent.event.AsyncResult()
- gevent.spawn(self._process_response, method, bufchan,
+ gevent.spawn(self._process_response, request_event, bufchan,
timeout).link(async_result)
return async_result
except:
| zerorpc/core.py | ReplaceText(target='request_event' @(244,49)->(244,55)) | class ClientBase(object):
return self._process_response(request_event, bufchan, timeout)
async_result = gevent.event.AsyncResult()
gevent.spawn(self._process_response, method, bufchan,
timeout).link(async_result)
return async_result
except: | class ClientBase(object):
return self._process_response(request_event, bufchan, timeout)
async_result = gevent.event.AsyncResult()
gevent.spawn(self._process_response, request_event, bufchan,
timeout).link(async_result)
return async_result
except: |
1,503 | https://:@github.com/CellProfiling/cam_acq.git | ff589fdfb73715b09fe27ffd8a2040ae286eca4c | @@ -191,7 +191,7 @@ class CamImage(Base):
"""Return the part of the name of the image, matching regex."""
if path is None:
path = self.path
- return super(CamImage, self).get_name(path, regex)
+ return super(CamImage, self).get_name(regex, path)
def make_proj(self, path_list):
"""Make a dict of max projections from a list of image paths.
| camacq/image.py | ArgSwap(idxs=0<->1 @(194,15)->(194,45)) | class CamImage(Base):
"""Return the part of the name of the image, matching regex."""
if path is None:
path = self.path
return super(CamImage, self).get_name(path, regex)
def make_proj(self, path_list):
"""Make a dict of max projections from a list of image paths. | class CamImage(Base):
"""Return the part of the name of the image, matching regex."""
if path is None:
path = self.path
return super(CamImage, self).get_name(regex, path)
def make_proj(self, path_list):
"""Make a dict of max projections from a list of image paths. |
1,504 | https://:@github.com/mvrozanti/youtube-curses.git | f4d58ba3be350a25dd70c607be565ac8a21ad1ff | @@ -107,7 +107,7 @@ try:
stdscr.addstr(1,0,"too small")
key = stdscr.getch()
if key == curses.KEY_DOWN:
- if highlight + page * maxitems + 1 != totalitems:
+ if highlight + page * maxitems + 1 < totalitems:
if highlight + 1 == maxitems:
page += 1
highlight = 0
| twitch-curses.py | ReplaceText(target='<' @(110,38)->(110,40)) | try:
stdscr.addstr(1,0,"too small")
key = stdscr.getch()
if key == curses.KEY_DOWN:
if highlight + page * maxitems + 1 != totalitems:
if highlight + 1 == maxitems:
page += 1
highlight = 0 | try:
stdscr.addstr(1,0,"too small")
key = stdscr.getch()
if key == curses.KEY_DOWN:
if highlight + page * maxitems + 1 < totalitems:
if highlight + 1 == maxitems:
page += 1
highlight = 0 |
1,505 | https://:@github.com/seblin/shcol.git | 96a07be4ba75dcd00374dbf0bf69aabf55bedf36 | @@ -51,7 +51,7 @@ class ColumnWidthCalculator(object):
item_widths = [len(item) for item in items]
if not item_widths:
column_widths, num_lines = [], 0
- elif any(width > self.max_line_width for width in item_widths):
+ elif any(width >= self.max_line_width for width in item_widths):
column_widths, num_lines = [self.max_line_width], len(item_widths)
else:
column_widths, num_lines = self.calculate_columns(item_widths)
| shcol.py | ReplaceText(target='>=' @(54,23)->(54,24)) | class ColumnWidthCalculator(object):
item_widths = [len(item) for item in items]
if not item_widths:
column_widths, num_lines = [], 0
elif any(width > self.max_line_width for width in item_widths):
column_widths, num_lines = [self.max_line_width], len(item_widths)
else:
column_widths, num_lines = self.calculate_columns(item_widths) | class ColumnWidthCalculator(object):
item_widths = [len(item) for item in items]
if not item_widths:
column_widths, num_lines = [], 0
elif any(width >= self.max_line_width for width in item_widths):
column_widths, num_lines = [self.max_line_width], len(item_widths)
else:
column_widths, num_lines = self.calculate_columns(item_widths) |
1,506 | https://:@github.com/biothings/biothings_explorer.git | aaf17dd35289147c1eb701f6739e576a16a08ca1 | @@ -41,7 +41,7 @@ class ConnectTwoConcepts():
print('q2 original nodes', q2.G.nodes())
q2_subset = q2.G.subgraph(q1_common + [self.output_values])
print('q2_subset nodes', q2_subset.nodes())
- self.G = nx.compose(q1_subset, q2_subset)
+ self.G = nx.compose(q2_subset, q1_subset)
def visualize(self):
return visualize(self.G.edges())
| biothings_explorer/connect.py | ArgSwap(idxs=0<->1 @(44,21)->(44,31)) | class ConnectTwoConcepts():
print('q2 original nodes', q2.G.nodes())
q2_subset = q2.G.subgraph(q1_common + [self.output_values])
print('q2_subset nodes', q2_subset.nodes())
self.G = nx.compose(q1_subset, q2_subset)
def visualize(self):
return visualize(self.G.edges()) | class ConnectTwoConcepts():
print('q2 original nodes', q2.G.nodes())
q2_subset = q2.G.subgraph(q1_common + [self.output_values])
print('q2_subset nodes', q2_subset.nodes())
self.G = nx.compose(q2_subset, q1_subset)
def visualize(self):
return visualize(self.G.edges()) |
1,507 | https://:@github.com/QwilApp/gasofo.git | 839d7bf88cc2ccbc92b980502586614db35b4f42 | @@ -144,7 +144,7 @@ class ServiceMetaclass(type):
raise UnknownPort('{}.{} references undeclared Needs - {}'.format(
class_name,
attr_name,
- ', '.join(sorted(deps_used))
+ ', '.join(sorted(invalid_ports))
))
unused_needs = needs_ports_defined.difference(all_deps_used)
| gasofo/service.py | ReplaceText(target='invalid_ports' @(147,41)->(147,50)) | class ServiceMetaclass(type):
raise UnknownPort('{}.{} references undeclared Needs - {}'.format(
class_name,
attr_name,
', '.join(sorted(deps_used))
))
unused_needs = needs_ports_defined.difference(all_deps_used) | class ServiceMetaclass(type):
raise UnknownPort('{}.{} references undeclared Needs - {}'.format(
class_name,
attr_name,
', '.join(sorted(invalid_ports))
))
unused_needs = needs_ports_defined.difference(all_deps_used) |
1,508 | https://:@github.com/mila-udem/blocks.git | 8f71ba948707c3bc7ddbe28e0bfb2a6f26c2f626 | @@ -274,7 +274,7 @@ class Application(object):
annotations = getattr(copy.tag, 'annotations', []) + [brick, call]
copy.tag.annotations = annotations
copy.tag.name = name # Blocks name
- VariableRole.add_role(variable, role)
+ VariableRole.add_role(copy, role)
return copy
for i, input_ in enumerate(args):
| blocks/bricks/base.py | ReplaceText(target='copy' @(277,34)->(277,42)) | class Application(object):
annotations = getattr(copy.tag, 'annotations', []) + [brick, call]
copy.tag.annotations = annotations
copy.tag.name = name # Blocks name
VariableRole.add_role(variable, role)
return copy
for i, input_ in enumerate(args): | class Application(object):
annotations = getattr(copy.tag, 'annotations', []) + [brick, call]
copy.tag.annotations = annotations
copy.tag.name = name # Blocks name
VariableRole.add_role(copy, role)
return copy
for i, input_ in enumerate(args): |
1,509 | https://:@github.com/mila-udem/blocks.git | a8c99adf643eb8c4edb40acd9c95210a07b36aea | @@ -28,7 +28,7 @@ def test_gaussian():
rng = numpy.random.RandomState(1)
def check_gaussian(rng, mean, std, shape):
- weights = IsotropicGaussian(mean, std).generate(rng, shape)
+ weights = IsotropicGaussian(std, mean).generate(rng, shape)
assert weights.shape == shape
assert weights.dtype == theano.config.floatX
assert_allclose(weights.mean(), mean, atol=1e-2)
| tests/test_initialization.py | ArgSwap(idxs=0<->1 @(31,18)->(31,35)) | def test_gaussian():
rng = numpy.random.RandomState(1)
def check_gaussian(rng, mean, std, shape):
weights = IsotropicGaussian(mean, std).generate(rng, shape)
assert weights.shape == shape
assert weights.dtype == theano.config.floatX
assert_allclose(weights.mean(), mean, atol=1e-2) | def test_gaussian():
rng = numpy.random.RandomState(1)
def check_gaussian(rng, mean, std, shape):
weights = IsotropicGaussian(std, mean).generate(rng, shape)
assert weights.shape == shape
assert weights.dtype == theano.config.floatX
assert_allclose(weights.mean(), mean, atol=1e-2) |
1,510 | https://:@github.com/mila-udem/blocks.git | a76f7c437ff32103fd9a66c31a1fbcc963dcc82e | @@ -105,7 +105,7 @@ def inject_parameter_values(bricks, param_values):
params = bricks.get_params()
for name in params.keys():
- if name not in params:
+ if name not in param_values:
logger.error("No value is provided for the parameter {}"
.format(name))
| blocks/serialization.py | ReplaceText(target='param_values' @(108,23)->(108,29)) | def inject_parameter_values(bricks, param_values):
params = bricks.get_params()
for name in params.keys():
if name not in params:
logger.error("No value is provided for the parameter {}"
.format(name))
| def inject_parameter_values(bricks, param_values):
params = bricks.get_params()
for name in params.keys():
if name not in param_values:
logger.error("No value is provided for the parameter {}"
.format(name))
|
1,511 | https://:@github.com/mila-udem/blocks.git | 54dd52f080177aede81a63f58b276dd1e9cfc915 | @@ -622,7 +622,7 @@ class VariableClipping(StepRule):
def compute_step(self, param, previous_step):
if any(axis >= previous_step.ndim for axis in self.axes):
raise ValueError("Invalid axes {} for {}, ndim={}".format(
- self.axes, param, param.ndim))
+ self.axes, param, previous_step.ndim))
squares = tensor.sqr(previous_step)
if len(self.axes) == 0:
norms = l2_norm([previous_step])
| blocks/algorithms/__init__.py | ReplaceText(target='previous_step' @(625,34)->(625,39)) | class VariableClipping(StepRule):
def compute_step(self, param, previous_step):
if any(axis >= previous_step.ndim for axis in self.axes):
raise ValueError("Invalid axes {} for {}, ndim={}".format(
self.axes, param, param.ndim))
squares = tensor.sqr(previous_step)
if len(self.axes) == 0:
norms = l2_norm([previous_step]) | class VariableClipping(StepRule):
def compute_step(self, param, previous_step):
if any(axis >= previous_step.ndim for axis in self.axes):
raise ValueError("Invalid axes {} for {}, ndim={}".format(
self.axes, param, previous_step.ndim))
squares = tensor.sqr(previous_step)
if len(self.axes) == 0:
norms = l2_norm([previous_step]) |
1,512 | https://:@github.com/jeremiedecock/pywi-cta.git | 51ea19f5d8cec9f4759eb8079dc4c01295719577 | @@ -228,7 +228,7 @@ class AbstractCleaningAlgorithm(object):
image_dict["img_cleaned_max_pe"] = float(np.nanmax(cleaned_img))
image_dict["img_cleaned_num_pix"] = int( (cleaned_img[np.isfinite(cleaned_img)] > 0).sum() )
- cleaned_img1d = geometry_converter.image_2d_to_1d(reference_img, fits_metadata_dict['cam_id'])
+ cleaned_img1d = geometry_converter.image_2d_to_1d(cleaned_img, fits_metadata_dict['cam_id'])
hillas_params_2_cleaned_img = get_hillas_parameters(geom1d, cleaned_img1d, HILLAS_IMPLEMENTATION) # GEOM
image_dict["img_cleaned_hillas_2_size"] = float(hillas_params_2_cleaned_img.size)
| datapipe/denoising/abstract_cleaning_algorithm.py | ReplaceText(target='cleaned_img' @(231,74)->(231,87)) | class AbstractCleaningAlgorithm(object):
image_dict["img_cleaned_max_pe"] = float(np.nanmax(cleaned_img))
image_dict["img_cleaned_num_pix"] = int( (cleaned_img[np.isfinite(cleaned_img)] > 0).sum() )
cleaned_img1d = geometry_converter.image_2d_to_1d(reference_img, fits_metadata_dict['cam_id'])
hillas_params_2_cleaned_img = get_hillas_parameters(geom1d, cleaned_img1d, HILLAS_IMPLEMENTATION) # GEOM
image_dict["img_cleaned_hillas_2_size"] = float(hillas_params_2_cleaned_img.size) | class AbstractCleaningAlgorithm(object):
image_dict["img_cleaned_max_pe"] = float(np.nanmax(cleaned_img))
image_dict["img_cleaned_num_pix"] = int( (cleaned_img[np.isfinite(cleaned_img)] > 0).sum() )
cleaned_img1d = geometry_converter.image_2d_to_1d(cleaned_img, fits_metadata_dict['cam_id'])
hillas_params_2_cleaned_img = get_hillas_parameters(geom1d, cleaned_img1d, HILLAS_IMPLEMENTATION) # GEOM
image_dict["img_cleaned_hillas_2_size"] = float(hillas_params_2_cleaned_img.size) |
1,513 | https://:@github.com/jeremiedecock/pywi-cta.git | 339e74ccf897012a30b4077d3ffa81a37bb005b9 | @@ -171,7 +171,7 @@ class ObjectiveFunction:
filter_thresholds_str = ",".join([str(sigma) for sigma in filter_thresholds])
# Check the length of filter_thresholds_str is consistent with self.num_scales
- if len(filter_thresholds_str) != (self.num_scales - 1):
+ if len(filter_thresholds) != (self.num_scales - 1):
raise ValueError("The tested solution has a wrong number of dimensions: "
"{} instead of {}".format(len(filter_thresholds),
self.num_scales - 1))
| pywicta/optimization/objectivefunc/wavelets_mrfilter.py | ReplaceText(target='filter_thresholds' @(174,15)->(174,36)) | class ObjectiveFunction:
filter_thresholds_str = ",".join([str(sigma) for sigma in filter_thresholds])
# Check the length of filter_thresholds_str is consistent with self.num_scales
if len(filter_thresholds_str) != (self.num_scales - 1):
raise ValueError("The tested solution has a wrong number of dimensions: "
"{} instead of {}".format(len(filter_thresholds),
self.num_scales - 1)) | class ObjectiveFunction:
filter_thresholds_str = ",".join([str(sigma) for sigma in filter_thresholds])
# Check the length of filter_thresholds_str is consistent with self.num_scales
if len(filter_thresholds) != (self.num_scales - 1):
raise ValueError("The tested solution has a wrong number of dimensions: "
"{} instead of {}".format(len(filter_thresholds),
self.num_scales - 1)) |
1,514 | https://:@github.com/ros/urdf_parser_py.git | c0183ac51435815923a9a8aab17698ae29230338 | @@ -237,7 +237,7 @@ class Inertial(object):
mass=0.0, origin=None):
self.matrix = {}
self.matrix['ixx'] = ixx
- self.matrix['ixy'] = iyy
+ self.matrix['ixy'] = ixy
self.matrix['ixz'] = ixz
self.matrix['iyy'] = iyy
self.matrix['iyz'] = iyz
| src/urdf_parser_py/urdf.py | ReplaceText(target='ixy' @(240,29)->(240,32)) | class Inertial(object):
mass=0.0, origin=None):
self.matrix = {}
self.matrix['ixx'] = ixx
self.matrix['ixy'] = iyy
self.matrix['ixz'] = ixz
self.matrix['iyy'] = iyy
self.matrix['iyz'] = iyz | class Inertial(object):
mass=0.0, origin=None):
self.matrix = {}
self.matrix['ixx'] = ixx
self.matrix['ixy'] = ixy
self.matrix['ixz'] = ixz
self.matrix['iyy'] = iyy
self.matrix['iyz'] = iyz |
1,515 | https://:@github.com/Faithforus/Colour-printing.git | f927c250c967ea52a74d60587a9709bc9a073454 | @@ -17,7 +17,7 @@ class Markers:
self.__cal_flag_len()
def __cal_flag_len(self):
- if Markers.__flag_len < len(self.__flag_name):
+ if Markers.__flag_len <= len(self.__flag_name):
Markers.__flag_len = len(self.__flag_name)+2
def message_style(self, mode='', fore='', back=''):
| colour_printing/custom/markers.py | ReplaceText(target='<=' @(20,30)->(20,31)) | class Markers:
self.__cal_flag_len()
def __cal_flag_len(self):
if Markers.__flag_len < len(self.__flag_name):
Markers.__flag_len = len(self.__flag_name)+2
def message_style(self, mode='', fore='', back=''): | class Markers:
self.__cal_flag_len()
def __cal_flag_len(self):
if Markers.__flag_len <= len(self.__flag_name):
Markers.__flag_len = len(self.__flag_name)+2
def message_style(self, mode='', fore='', back=''): |
1,516 | https://:@github.com/ccarocean/pyrads.git | 11fd786460c69972560cb02cce0a8b8b8a9ab2c9 | @@ -82,7 +82,7 @@ def ensure_open(
.. seealso:: :func:`open`
"""
if hasattr(file, "read"):
- if closeio:
+ if not closeio:
return cast(IO[Any], _NoCloseIOWrapper(file))
return cast(IO[Any], file)
return open(
| rads/utility.py | ReplaceText(target='not ' @(85,11)->(85,11)) | def ensure_open(
.. seealso:: :func:`open`
"""
if hasattr(file, "read"):
if closeio:
return cast(IO[Any], _NoCloseIOWrapper(file))
return cast(IO[Any], file)
return open( | def ensure_open(
.. seealso:: :func:`open`
"""
if hasattr(file, "read"):
if not closeio:
return cast(IO[Any], _NoCloseIOWrapper(file))
return cast(IO[Any], file)
return open( |
1,517 | https://:@github.com/paulsbond/modelcraft.git | 688d05f50a4c1ded44fdd3d0309fbeaadf762807 | @@ -88,7 +88,7 @@ class Pipeline():
def refmac(self, cycles):
directory = self.job_directory("refmac")
use_phases = self.args.unbiased and self.min_rwork > 0.35
- job = Refmac(self.args, directory, self.current_xyz, use_phases, cycles)
+ job = Refmac(self.args, directory, self.current_xyz, cycles, use_phases)
self.jobs[self.cycle].append(job)
self.current_hkl = job.hklout
self.current_xyz = job.xyzout
| modelcraft/pipeline.py | ArgSwap(idxs=3<->4 @(91,14)->(91,20)) | class Pipeline():
def refmac(self, cycles):
directory = self.job_directory("refmac")
use_phases = self.args.unbiased and self.min_rwork > 0.35
job = Refmac(self.args, directory, self.current_xyz, use_phases, cycles)
self.jobs[self.cycle].append(job)
self.current_hkl = job.hklout
self.current_xyz = job.xyzout | class Pipeline():
def refmac(self, cycles):
directory = self.job_directory("refmac")
use_phases = self.args.unbiased and self.min_rwork > 0.35
job = Refmac(self.args, directory, self.current_xyz, cycles, use_phases)
self.jobs[self.cycle].append(job)
self.current_hkl = job.hklout
self.current_xyz = job.xyzout |
1,518 | https://:@github.com/gaoyunzhi/readee.git | 699c229fdcc1ddd2dd52b72d7b7e4b4da76a7585 | @@ -33,7 +33,7 @@ def _tagReplace(soup, args = {}):
if len(children) != 1 or not isinstance(children[0], str):
continue
to_replace = None
- if l.parent.name != 'blockquote': # douban status specific
+ if l.parent.name == 'blockquote': # douban status specific
to_replace = l.parent
if 'review-content' in str(l.parent.attrs): # douban reviews specific
to_replace = l
| readee/tag_replace.py | ReplaceText(target='==' @(36,19)->(36,21)) | def _tagReplace(soup, args = {}):
if len(children) != 1 or not isinstance(children[0], str):
continue
to_replace = None
if l.parent.name != 'blockquote': # douban status specific
to_replace = l.parent
if 'review-content' in str(l.parent.attrs): # douban reviews specific
to_replace = l | def _tagReplace(soup, args = {}):
if len(children) != 1 or not isinstance(children[0], str):
continue
to_replace = None
if l.parent.name == 'blockquote': # douban status specific
to_replace = l.parent
if 'review-content' in str(l.parent.attrs): # douban reviews specific
to_replace = l |
1,519 | https://:@github.com/bkad/gevent.git | 3444f110d767c8985127c4421c4f79f206122ad5 | @@ -313,7 +313,7 @@ def _parse_address(address):
host = ''
return family, (host, int(port))
else:
- return _socket.AF_INET, ('', int(port))
+ return _socket.AF_INET, ('', int(address))
elif isinstance(address, integer_types):
return _socket.AF_INET, ('', int(address))
else:
| gevent/baseserver.py | ReplaceText(target='address' @(316,45)->(316,49)) | def _parse_address(address):
host = ''
return family, (host, int(port))
else:
return _socket.AF_INET, ('', int(port))
elif isinstance(address, integer_types):
return _socket.AF_INET, ('', int(address))
else: | def _parse_address(address):
host = ''
return family, (host, int(port))
else:
return _socket.AF_INET, ('', int(address))
elif isinstance(address, integer_types):
return _socket.AF_INET, ('', int(address))
else: |
1,520 | https://:@github.com/jerith/txTwitter.git | 05cb3871bd345ea0850b223388f37f5a7cf5c3c5 | @@ -517,7 +517,7 @@ class FakeTwitterAPI(object):
self._twitter_data.iter_tweets_from(user_id), count, since_id,
max_id)
if exclude_replies:
- tweets = [tweet for tweet in tweets if tweet.reply_to is not None]
+ tweets = [tweet for tweet in tweets if tweet.reply_to is None]
if include_rts is not None:
raise NotImplementedError("exclude_rts param")
return [
| txtwitter/tests/fake_twitter.py | ReplaceText(target=' is ' @(520,65)->(520,73)) | class FakeTwitterAPI(object):
self._twitter_data.iter_tweets_from(user_id), count, since_id,
max_id)
if exclude_replies:
tweets = [tweet for tweet in tweets if tweet.reply_to is not None]
if include_rts is not None:
raise NotImplementedError("exclude_rts param")
return [ | class FakeTwitterAPI(object):
self._twitter_data.iter_tweets_from(user_id), count, since_id,
max_id)
if exclude_replies:
tweets = [tweet for tweet in tweets if tweet.reply_to is None]
if include_rts is not None:
raise NotImplementedError("exclude_rts param")
return [ |
1,521 | https://:@github.com/rainwoodman/gaepsi.git | 2a3b9fca6494eeb84a68cd82e4c8bd1e04f7652f | @@ -49,7 +49,7 @@ class Snapshot:
return [self.P[ptype][bn] for bn in blocknames]
def has(self, blockname, ptype):
- return self.reader.has_block(self, ptype, blockname)
+ return self.reader.has_block(self, blockname, ptype)
def save_header(self):
self.reader.write_header(self)
| snapshot.py | ArgSwap(idxs=1<->2 @(52,11)->(52,32)) | class Snapshot:
return [self.P[ptype][bn] for bn in blocknames]
def has(self, blockname, ptype):
return self.reader.has_block(self, ptype, blockname)
def save_header(self):
self.reader.write_header(self) | class Snapshot:
return [self.P[ptype][bn] for bn in blocknames]
def has(self, blockname, ptype):
return self.reader.has_block(self, blockname, ptype)
def save_header(self):
self.reader.write_header(self) |
1,522 | https://:@github.com/staffanm/ferenda.git | 250cc870c14cbb8089ffd9b1f4dab44865ab4e7d | @@ -4,7 +4,7 @@ from ferenda.sources.legal.se import SwedishLegalSource
class LocalURI(SwedishLegalSource):
def infer_triples(self, d, basefile=None):
- super(self, LocalURI).infer_triples(d,basefile)
+ super(LocalURI, self).infer_triples(d,basefile)
canonicalminter = ...
sameas = self.canonicalminter(d)
d.rel(OWL.sameAs, sameas)
| lagen/nu/localuri.py | ArgSwap(idxs=0<->1 @(7,8)->(7,13)) | from ferenda.sources.legal.se import SwedishLegalSource
class LocalURI(SwedishLegalSource):
def infer_triples(self, d, basefile=None):
super(self, LocalURI).infer_triples(d,basefile)
canonicalminter = ...
sameas = self.canonicalminter(d)
d.rel(OWL.sameAs, sameas) | from ferenda.sources.legal.se import SwedishLegalSource
class LocalURI(SwedishLegalSource):
def infer_triples(self, d, basefile=None):
super(LocalURI, self).infer_triples(d,basefile)
canonicalminter = ...
sameas = self.canonicalminter(d)
d.rel(OWL.sameAs, sameas) |
1,523 | https://:@github.com/staffanm/ferenda.git | 268b56a25bb57f04675661603eea670fe33d7085 | @@ -458,7 +458,7 @@ class Offtryck(SwedishLegalSource):
else:
initialstate['pageno'] = lastpagebreak.ordinal + 1
allbody += body[:]
- self.validate_body(body, basefile) # Throws exception if invalid
+ self.validate_body(allbody, basefile) # Throws exception if invalid
return allbody
except Exception as e:
errmsg = str(e)
| ferenda/sources/legal/se/offtryck.py | ReplaceText(target='allbody' @(461,35)->(461,39)) | class Offtryck(SwedishLegalSource):
else:
initialstate['pageno'] = lastpagebreak.ordinal + 1
allbody += body[:]
self.validate_body(body, basefile) # Throws exception if invalid
return allbody
except Exception as e:
errmsg = str(e) | class Offtryck(SwedishLegalSource):
else:
initialstate['pageno'] = lastpagebreak.ordinal + 1
allbody += body[:]
self.validate_body(allbody, basefile) # Throws exception if invalid
return allbody
except Exception as e:
errmsg = str(e) |
1,524 | https://:@github.com/staffanm/ferenda.git | 133ebd33435acb8a7d6ed611341c50755881538e | @@ -56,7 +56,7 @@ class TestGlue(unittest.TestCase):
self._f('<fontspec id="6" size="14" family="MAPPGJ+TT9Eo00" color="#000000"/>')
textbox = self._p('<text top="288" left="85" width="468" height="17" font="2">Det är nu hög tid att göra en kraftsamling för informationsförsörj-</text>')
prevbox = self._p('<text top="307" left="85" width="252" height="17" font="2">ningen till forskning och utbildning.</text>')
- self.assertTrue(self.gluefunc(prevbox, prevbox, textbox))
+ self.assertTrue(self.gluefunc(textbox, prevbox, textbox))
textbox = textbox + prevbox
nextbox = self._p('<text top="304" left="337" width="220" height="21" font="6"><i> </i>Den tekniska utvecklingen går </text>')
self.assertTrue(self.gluefunc(textbox, nextbox, prevbox))
| test/integrationOfftryck.py | ReplaceText(target='textbox' @(59,38)->(59,45)) | class TestGlue(unittest.TestCase):
self._f('<fontspec id="6" size="14" family="MAPPGJ+TT9Eo00" color="#000000"/>')
textbox = self._p('<text top="288" left="85" width="468" height="17" font="2">Det är nu hög tid att göra en kraftsamling för informationsförsörj-</text>')
prevbox = self._p('<text top="307" left="85" width="252" height="17" font="2">ningen till forskning och utbildning.</text>')
self.assertTrue(self.gluefunc(prevbox, prevbox, textbox))
textbox = textbox + prevbox
nextbox = self._p('<text top="304" left="337" width="220" height="21" font="6"><i> </i>Den tekniska utvecklingen går </text>')
self.assertTrue(self.gluefunc(textbox, nextbox, prevbox)) | class TestGlue(unittest.TestCase):
self._f('<fontspec id="6" size="14" family="MAPPGJ+TT9Eo00" color="#000000"/>')
textbox = self._p('<text top="288" left="85" width="468" height="17" font="2">Det är nu hög tid att göra en kraftsamling för informationsförsörj-</text>')
prevbox = self._p('<text top="307" left="85" width="252" height="17" font="2">ningen till forskning och utbildning.</text>')
self.assertTrue(self.gluefunc(textbox, prevbox, textbox))
textbox = textbox + prevbox
nextbox = self._p('<text top="304" left="337" width="220" height="21" font="6"><i> </i>Den tekniska utvecklingen går </text>')
self.assertTrue(self.gluefunc(textbox, nextbox, prevbox)) |
1,525 | https://:@github.com/staffanm/ferenda.git | 699fb245c4cb447a0f8cf7d4fd62bbb1d6efcfec | @@ -986,7 +986,7 @@ with the *config* object as single parameter.
if response.status_code == 304:
self.log.debug("%s: 304 Not modified" % url)
return False # ie not updated
- elif response.status_code > 400:
+ elif response.status_code >= 400:
self.log.error("Failed to retrieve %s" % url)
response.raise_for_status()
| ferenda/documentrepository.py | ReplaceText(target='>=' @(989,34)->(989,35)) | with the *config* object as single parameter.
if response.status_code == 304:
self.log.debug("%s: 304 Not modified" % url)
return False # ie not updated
elif response.status_code > 400:
self.log.error("Failed to retrieve %s" % url)
response.raise_for_status()
| with the *config* object as single parameter.
if response.status_code == 304:
self.log.debug("%s: 304 Not modified" % url)
return False # ie not updated
elif response.status_code >= 400:
self.log.error("Failed to retrieve %s" % url)
response.raise_for_status()
|
1,526 | https://:@github.com/staffanm/ferenda.git | 158f09f9d9152ccb71b1af4a60a17e53349f0226 | @@ -561,7 +561,7 @@ class Offtryck(SwedishLegalSource):
# fix the json file at pagemapping_path as well?
for idx, page in enumerate(sanitized):
sanitized[idx].number = idx + 1
- sanitized[idx].src = "%s/sid%s.png" % (basefile, idx+1)
+ sanitized[idx].src = "%s/sid%s.png" % (baseuri, idx+1)
else:
analyzer = sanitized.analyzer
if not os.path.exists(pagemapping_path) or self.config.force:
| ferenda/sources/legal/se/offtryck.py | ReplaceText(target='baseuri' @(564,55)->(564,63)) | class Offtryck(SwedishLegalSource):
# fix the json file at pagemapping_path as well?
for idx, page in enumerate(sanitized):
sanitized[idx].number = idx + 1
sanitized[idx].src = "%s/sid%s.png" % (basefile, idx+1)
else:
analyzer = sanitized.analyzer
if not os.path.exists(pagemapping_path) or self.config.force: | class Offtryck(SwedishLegalSource):
# fix the json file at pagemapping_path as well?
for idx, page in enumerate(sanitized):
sanitized[idx].number = idx + 1
sanitized[idx].src = "%s/sid%s.png" % (baseuri, idx+1)
else:
analyzer = sanitized.analyzer
if not os.path.exists(pagemapping_path) or self.config.force: |
1,527 | https://:@github.com/pyopenapi/pyopenapi.git | fbe951506252bffe083942c246736bca14f13a4c | @@ -30,7 +30,7 @@ class SwaggerApp(BaseObj):
# default initialization is passing the url
# you can override this behavior by passing an
# initialized getter object.
- local_getter = getter(url)
+ local_getter = local_getter(url)
ctx = ResourceListContext(None, local_getter)
ctx.parse()
| pyopenapi/core.py | ReplaceText(target='local_getter' @(33,27)->(33,33)) | class SwaggerApp(BaseObj):
# default initialization is passing the url
# you can override this behavior by passing an
# initialized getter object.
local_getter = getter(url)
ctx = ResourceListContext(None, local_getter)
ctx.parse() | class SwaggerApp(BaseObj):
# default initialization is passing the url
# you can override this behavior by passing an
# initialized getter object.
local_getter = local_getter(url)
ctx = ResourceListContext(None, local_getter)
ctx.parse() |
1,528 | https://:@github.com/pyopenapi/pyopenapi.git | 54bdc346b45deb8277831a7ac70886bc81568696 | @@ -39,7 +39,7 @@ class ScopeDict(dict):
def __init__(self, sep=SCOPE_SEPARATOR):
self.__sep = sep
- super(self, ScopeDict).__init__()
+ super(ScopeDict, self).__init__()
def __getitem__(self, *keys):
""" to access an obj with key: 'n!##!m...!##!z', caller can pass as key:
| pyopenapi/utils.py | ArgSwap(idxs=0<->1 @(42,8)->(42,13)) | class ScopeDict(dict):
def __init__(self, sep=SCOPE_SEPARATOR):
self.__sep = sep
super(self, ScopeDict).__init__()
def __getitem__(self, *keys):
""" to access an obj with key: 'n!##!m...!##!z', caller can pass as key: | class ScopeDict(dict):
def __init__(self, sep=SCOPE_SEPARATOR):
self.__sep = sep
super(ScopeDict, self).__init__()
def __getitem__(self, *keys):
""" to access an obj with key: 'n!##!m...!##!z', caller can pass as key: |
1,529 | https://:@github.com/clindatsci/dicomweb-client.git | a8426098bf10c893366be9043bc3366a47c22b48 | @@ -1427,7 +1427,7 @@ class DICOMwebClient(object):
response = self._session.post(
url=url,
data=data_chunks,
- headers=headers
+ headers=chunked_headers
)
else:
response = self._session.post(url=url, data=data, headers=headers)
| src/dicomweb_client/api.py | ReplaceText(target='chunked_headers' @(1430,24)->(1430,31)) | class DICOMwebClient(object):
response = self._session.post(
url=url,
data=data_chunks,
headers=headers
)
else:
response = self._session.post(url=url, data=data, headers=headers) | class DICOMwebClient(object):
response = self._session.post(
url=url,
data=data_chunks,
headers=chunked_headers
)
else:
response = self._session.post(url=url, data=data, headers=headers) |
1,530 | https://:@github.com/clindatsci/dicomweb-client.git | e9d9410e7de9108e6cda82c5c44a3fb177e32163 | @@ -403,7 +403,7 @@ class DICOMwebClient(object):
self._session.proxies = proxies
if callback is not None:
self._session.hooks = {'response': [callback, ]}
- if chunk_size is not None:
+ if chunk_size is None:
# There is a bug in the requests library that sets the Host header
# again when using chunked transer encoding. Apparently this is
# tricky to fix (see https://github.com/psf/requests/issues/4392).
| src/dicomweb_client/api.py | ReplaceText(target=' is ' @(406,21)->(406,29)) | class DICOMwebClient(object):
self._session.proxies = proxies
if callback is not None:
self._session.hooks = {'response': [callback, ]}
if chunk_size is not None:
# There is a bug in the requests library that sets the Host header
# again when using chunked transer encoding. Apparently this is
# tricky to fix (see https://github.com/psf/requests/issues/4392). | class DICOMwebClient(object):
self._session.proxies = proxies
if callback is not None:
self._session.hooks = {'response': [callback, ]}
if chunk_size is None:
# There is a bug in the requests library that sets the Host header
# again when using chunked transer encoding. Apparently this is
# tricky to fix (see https://github.com/psf/requests/issues/4392). |
1,531 | https://:@gitlab.com/koala-lms/django-learning.git | 600bf3b8691699936ebffccd7f31f2f937eab388 | @@ -88,7 +88,7 @@ class ActivityCreateOnCourseView(LoginRequiredMixin, PermissionRequiredMixin, Up
def form_invalid(self, form):
for sub_form in form:
- update_valid_or_invalid_form_fields(form)
+ update_valid_or_invalid_form_fields(sub_form)
for error in sub_form.errors:
messages.error(self.request, sub_form.errors[error])
return self.get_success_url()
| learning/views/activity.py | ReplaceText(target='sub_form' @(91,48)->(91,52)) | class ActivityCreateOnCourseView(LoginRequiredMixin, PermissionRequiredMixin, Up
def form_invalid(self, form):
for sub_form in form:
update_valid_or_invalid_form_fields(form)
for error in sub_form.errors:
messages.error(self.request, sub_form.errors[error])
return self.get_success_url() | class ActivityCreateOnCourseView(LoginRequiredMixin, PermissionRequiredMixin, Up
def form_invalid(self, form):
for sub_form in form:
update_valid_or_invalid_form_fields(sub_form)
for error in sub_form.errors:
messages.error(self.request, sub_form.errors[error])
return self.get_success_url() |
1,532 | https://:@github.com/finderseyes/upkit.git | 5f39342aa3261683f3aa675617c9f505409c346f | @@ -172,7 +172,7 @@ class PackageLinker(object):
item_source = os.path.abspath(os.path.join(source, item['source']))
item_target = os.path.abspath(self._render_template(item['target'], params))
- content = package_linkspec.get('content', None)
+ content = item.get('content', None)
if not content:
utils.fs_link(item_source, item_target, hard_link=True, forced=forced)
else:
| unity_tools/package_linker.py | ReplaceText(target='item' @(175,26)->(175,42)) | class PackageLinker(object):
item_source = os.path.abspath(os.path.join(source, item['source']))
item_target = os.path.abspath(self._render_template(item['target'], params))
content = package_linkspec.get('content', None)
if not content:
utils.fs_link(item_source, item_target, hard_link=True, forced=forced)
else: | class PackageLinker(object):
item_source = os.path.abspath(os.path.join(source, item['source']))
item_target = os.path.abspath(self._render_template(item['target'], params))
content = item.get('content', None)
if not content:
utils.fs_link(item_source, item_target, hard_link=True, forced=forced)
else: |
1,533 | https://:@github.com/spoorcc/cppumockify.git | 8b4f2089cda3cc3071cd8fb5d83a36c5f6b0552b | @@ -82,7 +82,7 @@ class MockError(Exception):
def generate_mock(mocked_module, mock_prototype):
''' Generates the mock '''
mock_filename = "{0}_mock.cpp".format(mocked_module)
- include_filename = "{0}.h".format(mock_filename)
+ include_filename = "{0}.h".format(mocked_module)
logger.debug("working directory: %s", os.getcwd())
logger.debug("mock_filename: %s", mock_filename)
logger.debug("include_filename: %s", include_filename)
| cppumockify.py | ReplaceText(target='mocked_module' @(85,38)->(85,51)) | class MockError(Exception):
def generate_mock(mocked_module, mock_prototype):
''' Generates the mock '''
mock_filename = "{0}_mock.cpp".format(mocked_module)
include_filename = "{0}.h".format(mock_filename)
logger.debug("working directory: %s", os.getcwd())
logger.debug("mock_filename: %s", mock_filename)
logger.debug("include_filename: %s", include_filename) | class MockError(Exception):
def generate_mock(mocked_module, mock_prototype):
''' Generates the mock '''
mock_filename = "{0}_mock.cpp".format(mocked_module)
include_filename = "{0}.h".format(mocked_module)
logger.debug("working directory: %s", os.getcwd())
logger.debug("mock_filename: %s", mock_filename)
logger.debug("include_filename: %s", include_filename) |
1,534 | https://:@github.com/pigmonkey/django-vellum.git | f8edc139fe9f8a6d6e63af6d6b1a2a42d3c38002 | @@ -208,7 +208,7 @@ def tag_detail(request, slug, page=0, **kwargs):
return list_detail.object_list(
request,
- queryset=Post.objects.filter(tags__name__in=[slug]),
+ queryset=Post.objects.filter(tags__name__in=[tag]),
paginate_by=blog_settings.BLOG_PAGESIZE,
page=page,
extra_context={
| basic/blog/views.py | ReplaceText(target='tag' @(211,53)->(211,57)) | def tag_detail(request, slug, page=0, **kwargs):
return list_detail.object_list(
request,
queryset=Post.objects.filter(tags__name__in=[slug]),
paginate_by=blog_settings.BLOG_PAGESIZE,
page=page,
extra_context={ | def tag_detail(request, slug, page=0, **kwargs):
return list_detail.object_list(
request,
queryset=Post.objects.filter(tags__name__in=[tag]),
paginate_by=blog_settings.BLOG_PAGESIZE,
page=page,
extra_context={ |
1,535 | https://:@github.com/asoroa/ical2org.py.git | ac33b4760b1d87eb35ce9892e329dc6926d83f57 | @@ -63,7 +63,7 @@ def recurring_event_days(event_start, event_end, delta_str, start_utc, end_utc):
else :
event_aux = event_start
- while event_aux < end_utc:
+ while event_aux <= end_utc:
result.append( (event_aux, event_aux.tzinfo.normalize(event_aux + event_duration), 1) )
event_aux = add_delta_dst(event_aux, delta)
return result
| ical2org.py | ReplaceText(target='<=' @(66,20)->(66,21)) | def recurring_event_days(event_start, event_end, delta_str, start_utc, end_utc):
else :
event_aux = event_start
while event_aux < end_utc:
result.append( (event_aux, event_aux.tzinfo.normalize(event_aux + event_duration), 1) )
event_aux = add_delta_dst(event_aux, delta)
return result | def recurring_event_days(event_start, event_end, delta_str, start_utc, end_utc):
else :
event_aux = event_start
while event_aux <= end_utc:
result.append( (event_aux, event_aux.tzinfo.normalize(event_aux + event_duration), 1) )
event_aux = add_delta_dst(event_aux, delta)
return result |
1,536 | https://:@github.com/PaloAltoNetworks/ansible-pan.git | 370d08e2204b387e30596c6cec3ddb388acc11dc | @@ -434,7 +434,7 @@ def main():
if destination_lower <= obj <= destination_upper:
destination_ip_match = True
else:
- if source_ip == object_string:
+ if destination_ip == object_string:
destination_ip_match = True
if isinstance(obj, objects.AddressObject) and addr_in_obj(destination_ip, obj):
destination_ip_match = True
| library/panos_query_rules.py | ReplaceText(target='destination_ip' @(437,31)->(437,40)) | def main():
if destination_lower <= obj <= destination_upper:
destination_ip_match = True
else:
if source_ip == object_string:
destination_ip_match = True
if isinstance(obj, objects.AddressObject) and addr_in_obj(destination_ip, obj):
destination_ip_match = True | def main():
if destination_lower <= obj <= destination_upper:
destination_ip_match = True
else:
if destination_ip == object_string:
destination_ip_match = True
if isinstance(obj, objects.AddressObject) and addr_in_obj(destination_ip, obj):
destination_ip_match = True |
1,537 | https://:@github.com/bond005/impartial_text_cls.git | d81895309fc7a26004fb50e5b5ced3fd62307c46 | @@ -97,7 +97,7 @@ class ImpatialTextClassifier(BaseEstimator, ClassifierMixin):
if self.verbose:
lengths_of_texts = []
sum_of_lengths = 0
- for sample_idx in range(len(y_train_)):
+ for sample_idx in range(len(y_train_tokenized)):
lengths_of_texts.append(sum(X_train_tokenized[1][sample_idx]))
sum_of_lengths += lengths_of_texts[-1]
if X_unlabeled_tokenized is not None:
| impatial_text_cls/impatial_text_cls.py | ReplaceText(target='y_train_tokenized' @(100,40)->(100,48)) | class ImpatialTextClassifier(BaseEstimator, ClassifierMixin):
if self.verbose:
lengths_of_texts = []
sum_of_lengths = 0
for sample_idx in range(len(y_train_)):
lengths_of_texts.append(sum(X_train_tokenized[1][sample_idx]))
sum_of_lengths += lengths_of_texts[-1]
if X_unlabeled_tokenized is not None: | class ImpatialTextClassifier(BaseEstimator, ClassifierMixin):
if self.verbose:
lengths_of_texts = []
sum_of_lengths = 0
for sample_idx in range(len(y_train_tokenized)):
lengths_of_texts.append(sum(X_train_tokenized[1][sample_idx]))
sum_of_lengths += lengths_of_texts[-1]
if X_unlabeled_tokenized is not None: |
1,538 | https://:@bitbucket.org/padraicshafer/pkgscript.git | 2839ec817483697e30480486957df7e82994eae1 | @@ -131,7 +131,7 @@ def get_versions():
pass
return_key_values = _get_versions()
- return_key_values["authors"] = pieces["authors"]
+ return_key_values["authors"] = default_keys_values["authors"]
return return_key_values
| pkgscript/version.py | ReplaceText(target='default_keys_values' @(134,35)->(134,41)) | def get_versions():
pass
return_key_values = _get_versions()
return_key_values["authors"] = pieces["authors"]
return return_key_values
| def get_versions():
pass
return_key_values = _get_versions()
return_key_values["authors"] = default_keys_values["authors"]
return return_key_values
|
1,539 | https://:@github.com/rpatterson/iiswsgi.git | 5be4e27875d2e28bfe7148ecc90b995c6e32c828 | @@ -43,7 +43,7 @@ app_attr_defaults_init = dict(
def get_web_config_apps(web_config):
doc = minidom.parse(web_config)
for fcgi in doc.getElementsByTagName("fastCgi"):
- for app in doc.getElementsByTagName("application"):
+ for app in fcgi.getElementsByTagName("application"):
yield dict((key, value) for key, value in app.attributes.items())
| iiswsgi/deploy.py | ReplaceText(target='fcgi' @(46,19)->(46,22)) | app_attr_defaults_init = dict(
def get_web_config_apps(web_config):
doc = minidom.parse(web_config)
for fcgi in doc.getElementsByTagName("fastCgi"):
for app in doc.getElementsByTagName("application"):
yield dict((key, value) for key, value in app.attributes.items())
| app_attr_defaults_init = dict(
def get_web_config_apps(web_config):
doc = minidom.parse(web_config)
for fcgi in doc.getElementsByTagName("fastCgi"):
for app in fcgi.getElementsByTagName("application"):
yield dict((key, value) for key, value in app.attributes.items())
|
1,540 | https://:@github.com/Sebatyne/django-feed-manager.git | d54f6eb66e1e6fd5b848fcb1d330eccadf3e369c | @@ -48,7 +48,7 @@ class FeedView(SyndicationFeed):
@csrf_exempt
def createAccount(request):
if 'username' not in request.POST \
- or 'password' not in request.POST:
+ and 'password' not in request.POST:
return HttpResponse(status=500)
user = User.objects.create_user(request.POST['username'], password=request.POST['password'], is_active=False)
| feedmanager/views.py | ReplaceText(target='and' @(51,12)->(51,14)) | class FeedView(SyndicationFeed):
@csrf_exempt
def createAccount(request):
if 'username' not in request.POST \
or 'password' not in request.POST:
return HttpResponse(status=500)
user = User.objects.create_user(request.POST['username'], password=request.POST['password'], is_active=False) | class FeedView(SyndicationFeed):
@csrf_exempt
def createAccount(request):
if 'username' not in request.POST \
and 'password' not in request.POST:
return HttpResponse(status=500)
user = User.objects.create_user(request.POST['username'], password=request.POST['password'], is_active=False) |
1,541 | https://:@github.com/pjdelport/django-payfast.git | 8b9de727d901a6698a8f7118d73ffb5e8d7fa1d0 | @@ -32,7 +32,7 @@ def data_is_valid(post_data, postback_url=POSTBACK_URL):
"""
post_str = urlencode(_values_to_encode(post_data))
try:
- response = urllib2.urlopen(postback_url, post_data).read()
+ response = urllib2.urlopen(postback_url, post_str).read()
except urllib2.HTTPError:
return None
if response == 'VALID':
| payfast/api.py | ReplaceText(target='post_str' @(35,49)->(35,58)) | def data_is_valid(post_data, postback_url=POSTBACK_URL):
"""
post_str = urlencode(_values_to_encode(post_data))
try:
response = urllib2.urlopen(postback_url, post_data).read()
except urllib2.HTTPError:
return None
if response == 'VALID': | def data_is_valid(post_data, postback_url=POSTBACK_URL):
"""
post_str = urlencode(_values_to_encode(post_data))
try:
response = urllib2.urlopen(postback_url, post_str).read()
except urllib2.HTTPError:
return None
if response == 'VALID': |
1,542 | https://:@github.com/engdan77/tasks_collector.git | 80b4eb078fcfec4fdc9c24632f779dddd1e17822 | @@ -370,7 +370,7 @@ def get_lowest_value(input_dict_list: Dict, key_name: str) -> int:
for d in input_dict_list:
current_value = d[key_name]
if type(current_value) is int:
- if current_value < lowest:
+ if current_value >= lowest:
lowest = current_value
return lowest
| tasks_collector/reportgenerator/api.py | ReplaceText(target='>=' @(373,29)->(373,30)) | def get_lowest_value(input_dict_list: Dict, key_name: str) -> int:
for d in input_dict_list:
current_value = d[key_name]
if type(current_value) is int:
if current_value < lowest:
lowest = current_value
return lowest
| def get_lowest_value(input_dict_list: Dict, key_name: str) -> int:
for d in input_dict_list:
current_value = d[key_name]
if type(current_value) is int:
if current_value >= lowest:
lowest = current_value
return lowest
|
1,543 | https://:@github.com/Princeton-CDH/django-annotator-store.git | 4572a52a6ec49dc039b9b2b06039e2698e638bdb | @@ -46,7 +46,7 @@ def search(request):
if 'collection' in request.GET:
filter_val = request.GET['collection']
# filter the solr query based on the requested collection
- q = solr.query(collection_label='"%s"' % filter_val)
+ q = q.query(collection_label='"%s"' % filter_val)
# generate link to remove the facet
unfacet_urlopts = url_params.copy()
del unfacet_urlopts['collection']
| readux/books/views.py | ReplaceText(target='q' @(49,16)->(49,20)) | def search(request):
if 'collection' in request.GET:
filter_val = request.GET['collection']
# filter the solr query based on the requested collection
q = solr.query(collection_label='"%s"' % filter_val)
# generate link to remove the facet
unfacet_urlopts = url_params.copy()
del unfacet_urlopts['collection'] | def search(request):
if 'collection' in request.GET:
filter_val = request.GET['collection']
# filter the solr query based on the requested collection
q = q.query(collection_label='"%s"' % filter_val)
# generate link to remove the facet
unfacet_urlopts = url_params.copy()
del unfacet_urlopts['collection'] |
1,544 | https://:@github.com/unlearnai/genemunge.git | 84d323239f43571ccc95bb80caa76fbac464d917 | @@ -108,7 +108,7 @@ def create_tissue_stats():
fraction_zero, pandas.DataFrame(
(tpm == 0).mean().astype(float), columns=[t])], axis=1)
# Convert tpms to clr with 0.5*min imputation
- clr = norm.clr_from_tpm(tissue_expression, imputer=normalize.impute)
+ clr = norm.clr_from_tpm(tpm, imputer=normalize.impute)
mean_clr = pandas.concat(
[mean_clr, pandas.DataFrame(clr.mean(), columns=[t])], axis=1)
median_clr = pandas.concat(
| genemunge/data/gtex/process_gtex.py | ReplaceText(target='tpm' @(111,32)->(111,49)) | def create_tissue_stats():
fraction_zero, pandas.DataFrame(
(tpm == 0).mean().astype(float), columns=[t])], axis=1)
# Convert tpms to clr with 0.5*min imputation
clr = norm.clr_from_tpm(tissue_expression, imputer=normalize.impute)
mean_clr = pandas.concat(
[mean_clr, pandas.DataFrame(clr.mean(), columns=[t])], axis=1)
median_clr = pandas.concat( | def create_tissue_stats():
fraction_zero, pandas.DataFrame(
(tpm == 0).mean().astype(float), columns=[t])], axis=1)
# Convert tpms to clr with 0.5*min imputation
clr = norm.clr_from_tpm(tpm, imputer=normalize.impute)
mean_clr = pandas.concat(
[mean_clr, pandas.DataFrame(clr.mean(), columns=[t])], axis=1)
median_clr = pandas.concat( |
1,545 | https://:@github.com/robotpt/interaction-engine.git | e12a35db12e4e97431f0c5be18034c545fa0dc48 | @@ -90,7 +90,7 @@ class TextPopulator:
else:
default_value = None
- if DatabasePopulator.Tags.POST_OP in kwargs and is_test:
+ if DatabasePopulator.Tags.POST_OP in kwargs and not is_test:
fn = kwargs[DatabasePopulator.Tags.POST_OP]
value = self._database_populator.get_replacement(
key,
| text_populator/populator.py | ReplaceText(target='not ' @(93,60)->(93,60)) | class TextPopulator:
else:
default_value = None
if DatabasePopulator.Tags.POST_OP in kwargs and is_test:
fn = kwargs[DatabasePopulator.Tags.POST_OP]
value = self._database_populator.get_replacement(
key, | class TextPopulator:
else:
default_value = None
if DatabasePopulator.Tags.POST_OP in kwargs and not is_test:
fn = kwargs[DatabasePopulator.Tags.POST_OP]
value = self._database_populator.get_replacement(
key, |
1,546 | https://:@github.com/Storj/storj-kademlia.git | 61631b21db3a4204bef38431799244fda90e7e4d | @@ -9,7 +9,7 @@ from kademlia.log import Logger
class KademliaProtocol(RPCProtocol):
def __init__(self, sourceNode, storage, ksize):
RPCProtocol.__init__(self)
- self.router = RoutingTable(self, sourceNode, ksize)
+ self.router = RoutingTable(self, ksize, sourceNode)
self.storage = storage
self.sourceID = sourceNode.id
self.log = Logger(system=self)
| kademlia/protocol.py | ArgSwap(idxs=1<->2 @(12,22)->(12,34)) | from kademlia.log import Logger
class KademliaProtocol(RPCProtocol):
def __init__(self, sourceNode, storage, ksize):
RPCProtocol.__init__(self)
self.router = RoutingTable(self, sourceNode, ksize)
self.storage = storage
self.sourceID = sourceNode.id
self.log = Logger(system=self) | from kademlia.log import Logger
class KademliaProtocol(RPCProtocol):
def __init__(self, sourceNode, storage, ksize):
RPCProtocol.__init__(self)
self.router = RoutingTable(self, ksize, sourceNode)
self.storage = storage
self.sourceID = sourceNode.id
self.log = Logger(system=self) |
1,547 | https://:@github.com/ProbonoBonobo/dash.git | 765a58e651914b5f51939b5d869d1dcdc0f094f5 | @@ -49,7 +49,7 @@ class Dash(object):
secret_key = os.environ.get(
secret_key_name, SeaSurf()._generate_token()
)
- os.environ[secret_key_name] = secret_key_name
+ os.environ[secret_key_name] = secret_key
self.server.secret_key = secret_key
if filename is not None:
| dash/dash.py | ReplaceText(target='secret_key' @(52,42)->(52,57)) | class Dash(object):
secret_key = os.environ.get(
secret_key_name, SeaSurf()._generate_token()
)
os.environ[secret_key_name] = secret_key_name
self.server.secret_key = secret_key
if filename is not None: | class Dash(object):
secret_key = os.environ.get(
secret_key_name, SeaSurf()._generate_token()
)
os.environ[secret_key_name] = secret_key
self.server.secret_key = secret_key
if filename is not None: |
1,548 | https://:@github.com/ProbonoBonobo/dash.git | 84c52140b8e9f2dd7ce088ff6e78d91e9c605fe9 | @@ -185,7 +185,7 @@ class TestGenerateClasses(unittest.TestCase):
'default_namespace'
)
- generate_classes(METADATA_PATH, 'default_namespace')
+ generate_classes('default_namespace', METADATA_PATH)
from default_namespace.MyComponent import MyComponent \
as MyComponent_buildtime
from default_namespace.A import A as A_buildtime
| tests/development/test_component_loader.py | ArgSwap(idxs=0<->1 @(188,8)->(188,24)) | class TestGenerateClasses(unittest.TestCase):
'default_namespace'
)
generate_classes(METADATA_PATH, 'default_namespace')
from default_namespace.MyComponent import MyComponent \
as MyComponent_buildtime
from default_namespace.A import A as A_buildtime | class TestGenerateClasses(unittest.TestCase):
'default_namespace'
)
generate_classes('default_namespace', METADATA_PATH)
from default_namespace.MyComponent import MyComponent \
as MyComponent_buildtime
from default_namespace.A import A as A_buildtime |
1,549 | https://:@bitbucket.org/ptr-yudai/ptrlib.git | 094080b5205972ee6bc845d9f29823015885f52b | @@ -82,7 +82,7 @@ class Socket(Tube):
recv_size = size
while read_byte < size:
data += self.sock.recv(recv_size)
- read_byte += len(data)
+ read_byte = len(data)
recv_size = size - read_byte
except socket.timeout:
dump("recv: Timeout", "error")
| ptrlib/pwn/sock.py | ReplaceText(target='=' @(85,26)->(85,28)) | class Socket(Tube):
recv_size = size
while read_byte < size:
data += self.sock.recv(recv_size)
read_byte += len(data)
recv_size = size - read_byte
except socket.timeout:
dump("recv: Timeout", "error") | class Socket(Tube):
recv_size = size
while read_byte < size:
data += self.sock.recv(recv_size)
read_byte = len(data)
recv_size = size - read_byte
except socket.timeout:
dump("recv: Timeout", "error") |
1,550 | https://:@github.com/brndnmtthws/tweet-delete.git | 3ac99e2b0278b8348595d056678baa8514d6d7d3 | @@ -122,7 +122,7 @@ class Deleter:
# same tweets as the previous run
favourite_counts = []
retweet_counts = []
- while len(statuses) > 0 and (last_max_id is None or last_min_id is not None or last_min_id < last_max_id):
+ while len(statuses) > 0 and (last_max_id is None or last_min_id is None or last_min_id < last_max_id):
statuses = self.api.GetUserTimeline(
include_rts=True,
exclude_replies=False,
| tweet_delete/deleter.py | ReplaceText(target=' is ' @(125,71)->(125,79)) | class Deleter:
# same tweets as the previous run
favourite_counts = []
retweet_counts = []
while len(statuses) > 0 and (last_max_id is None or last_min_id is not None or last_min_id < last_max_id):
statuses = self.api.GetUserTimeline(
include_rts=True,
exclude_replies=False, | class Deleter:
# same tweets as the previous run
favourite_counts = []
retweet_counts = []
while len(statuses) > 0 and (last_max_id is None or last_min_id is None or last_min_id < last_max_id):
statuses = self.api.GetUserTimeline(
include_rts=True,
exclude_replies=False, |
1,551 | https://:@github.com/fantasticfears/kgegrok.git | cc7f0c2a3ed727b7f2cc656c6205be6e08be9f23 | @@ -15,7 +15,7 @@ def _evaluate_predict_element(model, triple_index, num_expands, element_type, ra
logging.debug(element_type)
logging.debug("Batch len: " + str(len(batch)) + "; batch sample: " + str(batch[0]))
predicted_batch = model.forward(batch).cpu()
- logging.debug("Predicted batch len" + str(len(batch)) + "; batch sample: " + str(predicted_batch[0]))
+ logging.debug("Predicted batch len" + str(len(predicted_batch)) + "; batch sample: " + str(predicted_batch[0]))
rank, filtered_rank = rank_fn(predicted_batch.data.numpy(), triple_index)
logging.debug("Rank :" + str(rank) + "; Filtered rank length :" + str(filtered_rank))
ranks_list.append(rank)
| estimate.py | ReplaceText(target='predicted_batch' @(18,50)->(18,55)) | def _evaluate_predict_element(model, triple_index, num_expands, element_type, ra
logging.debug(element_type)
logging.debug("Batch len: " + str(len(batch)) + "; batch sample: " + str(batch[0]))
predicted_batch = model.forward(batch).cpu()
logging.debug("Predicted batch len" + str(len(batch)) + "; batch sample: " + str(predicted_batch[0]))
rank, filtered_rank = rank_fn(predicted_batch.data.numpy(), triple_index)
logging.debug("Rank :" + str(rank) + "; Filtered rank length :" + str(filtered_rank))
ranks_list.append(rank) | def _evaluate_predict_element(model, triple_index, num_expands, element_type, ra
logging.debug(element_type)
logging.debug("Batch len: " + str(len(batch)) + "; batch sample: " + str(batch[0]))
predicted_batch = model.forward(batch).cpu()
logging.debug("Predicted batch len" + str(len(predicted_batch)) + "; batch sample: " + str(predicted_batch[0]))
rank, filtered_rank = rank_fn(predicted_batch.data.numpy(), triple_index)
logging.debug("Rank :" + str(rank) + "; Filtered rank length :" + str(filtered_rank))
ranks_list.append(rank) |
1,552 | https://:@github.com/fantasticfears/kgegrok.git | 9e6c504d07c0faaebf7f5f4ec46509ba0c71622c | @@ -122,7 +122,7 @@ def train_and_validate(triple_source,
stats.report_prediction_result(
config, result, epoch=i_epoch, drawer=drawer)
- if config.save_per_epoch != 0 and i_epoch % config.save_per_epoch:
+ if config.save_per_epoch > 0 and i_epoch % config.save_per_epoch:
save_checkpoint({
'epoch': i_epoch,
'state_dict': model.state_dict(),
| kgexpr/estimate.py | ReplaceText(target='>' @(125,33)->(125,35)) | def train_and_validate(triple_source,
stats.report_prediction_result(
config, result, epoch=i_epoch, drawer=drawer)
if config.save_per_epoch != 0 and i_epoch % config.save_per_epoch:
save_checkpoint({
'epoch': i_epoch,
'state_dict': model.state_dict(), | def train_and_validate(triple_source,
stats.report_prediction_result(
config, result, epoch=i_epoch, drawer=drawer)
if config.save_per_epoch > 0 and i_epoch % config.save_per_epoch:
save_checkpoint({
'epoch': i_epoch,
'state_dict': model.state_dict(), |
1,553 | https://:@github.com/klem4/panacea.git | feef5bb935bd8fb1626dbf9670a24ed858133473 | @@ -39,7 +39,7 @@ def cache_thing(model, cache_key, data, cond_dnf=[[]], timeout=None):
# Write data to cache
if timeout is not None:
- txn.setex(cache_key, data, timeout)
+ txn.setex(cache_key, timeout, data)
else:
txn.set(cache_key, data)
| panacea/tools.py | ArgSwap(idxs=1<->2 @(42,8)->(42,17)) | def cache_thing(model, cache_key, data, cond_dnf=[[]], timeout=None):
# Write data to cache
if timeout is not None:
txn.setex(cache_key, data, timeout)
else:
txn.set(cache_key, data)
| def cache_thing(model, cache_key, data, cond_dnf=[[]], timeout=None):
# Write data to cache
if timeout is not None:
txn.setex(cache_key, timeout, data)
else:
txn.set(cache_key, data)
|
1,554 | https://:@github.com/mrk-its/s3fs.git | b5a5e712b40da1938760fce0095a9f9d99a436fc | @@ -23,7 +23,7 @@ class S3FSOpener(Opener):
strict = (
parse_result.params["strict"] == "1"
if "strict" in parse_result.params
- else True
+ else False
)
s3fs = S3FS(
bucket_name,
| fs_s3fs/opener.py | ReplaceText(target='False' @(26,17)->(26,21)) | class S3FSOpener(Opener):
strict = (
parse_result.params["strict"] == "1"
if "strict" in parse_result.params
else True
)
s3fs = S3FS(
bucket_name, | class S3FSOpener(Opener):
strict = (
parse_result.params["strict"] == "1"
if "strict" in parse_result.params
else False
)
s3fs = S3FS(
bucket_name, |
1,555 | https://:@github.com/python-trio/asyncclick.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: |
1,556 | https://:@github.com/python-trio/asyncclick.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] |
1,557 | https://:@github.com/KonstantinTogoi/aiomailru.git | d506e10c260e749ff986a9acfa939016faf683e8 | @@ -94,7 +94,7 @@ class TokenSession(PublicSession):
for cookie in cookies:
loose_cookie = Cookie.to_morsel(cookie)
- loose_cookies.append((loose_cookies.key, loose_cookie))
+ loose_cookies.append((loose_cookie.key, loose_cookie))
self.session.cookie_jar.update_cookies(loose_cookies)
| aiomailru/sessions.py | ReplaceText(target='loose_cookie' @(97,34)->(97,47)) | class TokenSession(PublicSession):
for cookie in cookies:
loose_cookie = Cookie.to_morsel(cookie)
loose_cookies.append((loose_cookies.key, loose_cookie))
self.session.cookie_jar.update_cookies(loose_cookies)
| class TokenSession(PublicSession):
for cookie in cookies:
loose_cookie = Cookie.to_morsel(cookie)
loose_cookies.append((loose_cookie.key, loose_cookie))
self.session.cookie_jar.update_cookies(loose_cookies)
|
1,558 | https://:@github.com/muma378/moose.git | 7068cc3a5636a5bebd005af13e601e5a6bddeefd | @@ -101,7 +101,7 @@ class ConfigLoader(object):
content = self.__update_with_locales(raw_content)
except UnicodeError as e:
result = chardet.detect(raw_content)
- if not result and result['encoding'] in ['ascii', settings.FILE_CHARSET]:
+ if not result or result['encoding'] in ['ascii', settings.FILE_CHARSET]:
# Tried, but failed
raise ImproperlyConfigured(
"Unknown encoding for '%s'." % self.path)
| moose/core/configs/loader.py | ReplaceText(target='or' @(104,18)->(104,21)) | class ConfigLoader(object):
content = self.__update_with_locales(raw_content)
except UnicodeError as e:
result = chardet.detect(raw_content)
if not result and result['encoding'] in ['ascii', settings.FILE_CHARSET]:
# Tried, but failed
raise ImproperlyConfigured(
"Unknown encoding for '%s'." % self.path) | class ConfigLoader(object):
content = self.__update_with_locales(raw_content)
except UnicodeError as e:
result = chardet.detect(raw_content)
if not result or result['encoding'] in ['ascii', settings.FILE_CHARSET]:
# Tried, but failed
raise ImproperlyConfigured(
"Unknown encoding for '%s'." % self.path) |
1,559 | https://:@github.com/S1M0N38/aao.git | 77ed1c21e6f2f4b0e51620aa044ef2192998938f | @@ -161,7 +161,7 @@ class Soccer(Spider888sport):
value = [''] + value
try:
yes, no = float(value[7]), float(value[9])
- odds[i]['both_teams_to_score'] = {'yes': no, 'no': no}
+ odds[i]['both_teams_to_score'] = {'yes': yes, 'no': no}
except IndexError:
pass
self.log.debug(' * got both teams to score odds')
| aao/spiders/spider_888sport.py | ReplaceText(target='yes' @(164,57)->(164,59)) | class Soccer(Spider888sport):
value = [''] + value
try:
yes, no = float(value[7]), float(value[9])
odds[i]['both_teams_to_score'] = {'yes': no, 'no': no}
except IndexError:
pass
self.log.debug(' * got both teams to score odds') | class Soccer(Spider888sport):
value = [''] + value
try:
yes, no = float(value[7]), float(value[9])
odds[i]['both_teams_to_score'] = {'yes': yes, 'no': no}
except IndexError:
pass
self.log.debug(' * got both teams to score odds') |
1,560 | https://:@github.com/silvacms/silva.ui.git | 8012cc5c85765254d22d4313db35fcb71e98b10d | @@ -75,7 +75,7 @@ class ContentSerializer(object):
formatter = locale.dates.getFormatter('dateTime', 'short')
self.format_date = lambda d: formatter.format(d.asdatetime())
self.format_author = lambda a: a.userid()
- if not getUtility(IMemberService).get_display_usernames():
+ if getUtility(IMemberService).get_display_usernames():
self.format_author = lambda a: a.fullname()
def get_access(self, content):
| src/silva/ui/rest/container/serializer.py | ReplaceText(target='' @(78,11)->(78,15)) | class ContentSerializer(object):
formatter = locale.dates.getFormatter('dateTime', 'short')
self.format_date = lambda d: formatter.format(d.asdatetime())
self.format_author = lambda a: a.userid()
if not getUtility(IMemberService).get_display_usernames():
self.format_author = lambda a: a.fullname()
def get_access(self, content): | class ContentSerializer(object):
formatter = locale.dates.getFormatter('dateTime', 'short')
self.format_date = lambda d: formatter.format(d.asdatetime())
self.format_author = lambda a: a.userid()
if getUtility(IMemberService).get_display_usernames():
self.format_author = lambda a: a.fullname()
def get_access(self, content): |
1,561 | https://:@github.com/sglumac/pyislands.git | d76a611240c3b2cc9b5a6cef7f503feb0919e314 | @@ -39,7 +39,7 @@ def policy_2tournament(population, immigrants):
new_population = list(population)
for immigrant in immigrants:
- _, idxs = ktournament(population, 2)
+ _, idxs = ktournament(2, population)
bad_idx = idxs[1]
new_population[bad_idx] = immigrant
| pyislands/archipelago/immigration.py | ArgSwap(idxs=0<->1 @(42,18)->(42,29)) | def policy_2tournament(population, immigrants):
new_population = list(population)
for immigrant in immigrants:
_, idxs = ktournament(population, 2)
bad_idx = idxs[1]
new_population[bad_idx] = immigrant | def policy_2tournament(population, immigrants):
new_population = list(population)
for immigrant in immigrants:
_, idxs = ktournament(2, population)
bad_idx = idxs[1]
new_population[bad_idx] = immigrant |
1,562 | https://:@github.com/AmyOlex/Chrono.git | 91f5ba63a7825e0b85b5b69b6d32a2336d5142ba | @@ -264,7 +264,7 @@ def hasPartOfDay(text):
#convert to all lower
text_lower = text.lower()
#remove all punctuation
- text_norm = text.translate(str.maketrans(string.punctuation, " "*len(string.punctuation))).strip()
+ text_norm = text_lower.translate(str.maketrans(string.punctuation, " "*len(string.punctuation))).strip()
#convert to list
text_list = text_norm.split(" ")
| Chrono/temporalTest.py | ReplaceText(target='text_lower' @(267,16)->(267,20)) | def hasPartOfDay(text):
#convert to all lower
text_lower = text.lower()
#remove all punctuation
text_norm = text.translate(str.maketrans(string.punctuation, " "*len(string.punctuation))).strip()
#convert to list
text_list = text_norm.split(" ")
| def hasPartOfDay(text):
#convert to all lower
text_lower = text.lower()
#remove all punctuation
text_norm = text_lower.translate(str.maketrans(string.punctuation, " "*len(string.punctuation))).strip()
#convert to list
text_list = text_norm.split(" ")
|
1,563 | https://:@bitbucket.org/bgframework/bglogs.git | 20a9bb781132eaecf084c6998056e7c07c7a5df8 | @@ -81,7 +81,7 @@ def configure(_name=None, debug=False, conf=None):
default_conf['loggers'][logger.name] = {
'level': logging.DEBUG if debug else logging.INFO
}
- if conf is not None:
+ if conf is None:
conf_ = default_conf
else:
conf_ = copy.deepcopy(default_conf)
| bglogs/configuration.py | ReplaceText(target=' is ' @(84,11)->(84,19)) | def configure(_name=None, debug=False, conf=None):
default_conf['loggers'][logger.name] = {
'level': logging.DEBUG if debug else logging.INFO
}
if conf is not None:
conf_ = default_conf
else:
conf_ = copy.deepcopy(default_conf) | def configure(_name=None, debug=False, conf=None):
default_conf['loggers'][logger.name] = {
'level': logging.DEBUG if debug else logging.INFO
}
if conf is None:
conf_ = default_conf
else:
conf_ = copy.deepcopy(default_conf) |
1,564 | https://:@github.com/QuailTeam/Quail.git | 4903f493bef0f297a8209f6eb4f603710396dd79 | @@ -34,7 +34,7 @@ def run(solution, installer, builder=Builder()):
elif args.quail_uninstall:
manager.uninstall()
else:
- if installer.is_installed():
+ if manager.is_installed():
manager.run()
else:
manager.install()
| quail/run.py | ReplaceText(target='manager' @(37,11)->(37,20)) | def run(solution, installer, builder=Builder()):
elif args.quail_uninstall:
manager.uninstall()
else:
if installer.is_installed():
manager.run()
else:
manager.install() | def run(solution, installer, builder=Builder()):
elif args.quail_uninstall:
manager.uninstall()
else:
if manager.is_installed():
manager.run()
else:
manager.install() |
1,565 | https://:@github.com/QuailTeam/Quail.git | 5b1ac96b6b0d1707b1cd7cb5c85a222e8b782292 | @@ -20,7 +20,7 @@ def _validate_side_img(path):
logger.warn("Side image not valid: height should be 250px")
return False
- if width <= 250:
+ if width > 250:
logger.warn("Side image not valid: width should be <= 250px")
return False
else:
| iquail/validate/validate.py | ReplaceText(target='>' @(23,21)->(23,23)) | def _validate_side_img(path):
logger.warn("Side image not valid: height should be 250px")
return False
if width <= 250:
logger.warn("Side image not valid: width should be <= 250px")
return False
else: | def _validate_side_img(path):
logger.warn("Side image not valid: height should be 250px")
return False
if width > 250:
logger.warn("Side image not valid: width should be <= 250px")
return False
else: |
1,566 | https://:@github.com/davidhalter/depl.git | 518ab778c71bbfa5d9038d623e6c658222279160 | @@ -70,7 +70,7 @@ class Config(object):
for key, value in current.items():
if key not in grammar:
raise ValidationError("Key %s is not in grammar." % key)
- result[key] = self._validate_detail(element, grammar[key])
+ result[key] = self._validate_detail(value, grammar[key])
else:
# normal type
if type(grammar) != type(current):
| depl/config.py | ReplaceText(target='value' @(73,52)->(73,59)) | class Config(object):
for key, value in current.items():
if key not in grammar:
raise ValidationError("Key %s is not in grammar." % key)
result[key] = self._validate_detail(element, grammar[key])
else:
# normal type
if type(grammar) != type(current): | class Config(object):
for key, value in current.items():
if key not in grammar:
raise ValidationError("Key %s is not in grammar." % key)
result[key] = self._validate_detail(value, grammar[key])
else:
# normal type
if type(grammar) != type(current): |
1,567 | https://:@github.com/davidhalter/depl.git | b74ad2d1308a0af5eae349f79aa87661f222621a | @@ -20,7 +20,7 @@ def load(name, settings):
module_dependencies, commands = module.load(settings, _Package.system())
for dep in module_dependencies:
- dep_name = dependencies[name][_Package.system()]
+ dep_name = dependencies[dep][_Package.system()]
yield 'sudo %s %s' % (_Package.install(), dep_name)
for cmd in commands:
yield cmd
| depl/deploy/__init__.py | ReplaceText(target='dep' @(23,32)->(23,36)) | def load(name, settings):
module_dependencies, commands = module.load(settings, _Package.system())
for dep in module_dependencies:
dep_name = dependencies[name][_Package.system()]
yield 'sudo %s %s' % (_Package.install(), dep_name)
for cmd in commands:
yield cmd | def load(name, settings):
module_dependencies, commands = module.load(settings, _Package.system())
for dep in module_dependencies:
dep_name = dependencies[dep][_Package.system()]
yield 'sudo %s %s' % (_Package.install(), dep_name)
for cmd in commands:
yield cmd |
1,568 | https://:@github.com/nukesor/gitalizer.git | 1b778e4064198676069d1a339a2f1faf97aad2c0 | @@ -82,7 +82,7 @@ class Repository(db.Model):
If that is the case, we want to skip it.
"""
timeout_threshold = datetime.utcnow() - current_app.config['REPOSITORY_RESCAN_TIMEOUT']
- up_to_date = self.completely_scanned and self.updated_at <= timeout_threshold
+ up_to_date = self.completely_scanned and self.updated_at >= timeout_threshold
if self.fork or self.broken or up_to_date:
return False
| gitalizer/models/repository.py | ReplaceText(target='>=' @(85,65)->(85,67)) | class Repository(db.Model):
If that is the case, we want to skip it.
"""
timeout_threshold = datetime.utcnow() - current_app.config['REPOSITORY_RESCAN_TIMEOUT']
up_to_date = self.completely_scanned and self.updated_at <= timeout_threshold
if self.fork or self.broken or up_to_date:
return False | class Repository(db.Model):
If that is the case, we want to skip it.
"""
timeout_threshold = datetime.utcnow() - current_app.config['REPOSITORY_RESCAN_TIMEOUT']
up_to_date = self.completely_scanned and self.updated_at >= timeout_threshold
if self.fork or self.broken or up_to_date:
return False |
1,569 | https://:@github.com/qualinext/ionosphere.git | 1a1ec05ce9fb48dfbb0362aebbb779e8ba92f3f6 | @@ -372,7 +372,7 @@ class Template(object):
if isinstance(values, list):
for v in values:
if v.title in d:
- self.handle_duplicate_key(values.title)
+ self.handle_duplicate_key(v.title)
d[v.title] = v
else:
if values.title in d:
| troposphere/__init__.py | ReplaceText(target='v' @(375,46)->(375,52)) | class Template(object):
if isinstance(values, list):
for v in values:
if v.title in d:
self.handle_duplicate_key(values.title)
d[v.title] = v
else:
if values.title in d: | class Template(object):
if isinstance(values, list):
for v in values:
if v.title in d:
self.handle_duplicate_key(v.title)
d[v.title] = v
else:
if values.title in d: |
1,570 | https://:@github.com/natcap/ecoshard.git | ef72a3898ccc18018f1d048211b681edb7cd29ab | @@ -60,7 +60,7 @@ def hash_file(
prefix = match_result.group(1)
LOGGER.debug('calculating hash for %s', base_path)
- hash_val = calculate_hash(base_filename, hash_algorithm)
+ hash_val = calculate_hash(base_path, hash_algorithm)
if target_dir is None:
target_dir = os.path.dirname(base_path)
| src/ecoshard/ecoshard.py | ReplaceText(target='base_path' @(63,30)->(63,43)) | def hash_file(
prefix = match_result.group(1)
LOGGER.debug('calculating hash for %s', base_path)
hash_val = calculate_hash(base_filename, hash_algorithm)
if target_dir is None:
target_dir = os.path.dirname(base_path) | def hash_file(
prefix = match_result.group(1)
LOGGER.debug('calculating hash for %s', base_path)
hash_val = calculate_hash(base_path, hash_algorithm)
if target_dir is None:
target_dir = os.path.dirname(base_path) |
1,571 | https://:@github.com/natcap/ecoshard.git | ddb17b5c75dc78ac1f0687b12d0ca0d3c1c42ff7 | @@ -37,7 +37,7 @@ def main():
payload = {
"style": {
"name": style_name,
- "filename": style_path
+ "filename": filepath
}
}
LOGGER.debug(payload)
| load_to_geoserver.py | ReplaceText(target='filepath' @(40,24)->(40,34)) | def main():
payload = {
"style": {
"name": style_name,
"filename": style_path
}
}
LOGGER.debug(payload) | def main():
payload = {
"style": {
"name": style_name,
"filename": filepath
}
}
LOGGER.debug(payload) |
1,572 | https://:@github.com/startling/argent.git | 5353bc7b29abd2e0d2a1307496c84287becdb326 | @@ -40,7 +40,7 @@ class Argument(object):
# `self.name` is what we get but with no underscores and all dashes.
self.name = name.replace("_", "-")
# `self.underscored` is the opposite.
- self.underscored = name.replace("_", "-")
+ self.underscored = name.replace("-", "_")
# this is the default value; can be None if there isn't one.
self.default = default
# if the name starts with an underscore or dash, it's a flag,
| argent/arguments.py | ArgSwap(idxs=0<->1 @(43,27)->(43,39)) | class Argument(object):
# `self.name` is what we get but with no underscores and all dashes.
self.name = name.replace("_", "-")
# `self.underscored` is the opposite.
self.underscored = name.replace("_", "-")
# this is the default value; can be None if there isn't one.
self.default = default
# if the name starts with an underscore or dash, it's a flag, | class Argument(object):
# `self.name` is what we get but with no underscores and all dashes.
self.name = name.replace("_", "-")
# `self.underscored` is the opposite.
self.underscored = name.replace("-", "_")
# this is the default value; can be None if there isn't one.
self.default = default
# if the name starts with an underscore or dash, it's a flag, |
1,573 | https://:@github.com/joakimskoog/anapioficeandfire-python.git | da65bed5110c34f62c872f55f1ffb09326940a63 | @@ -4,7 +4,7 @@
class AnApiOfIceAndFireError(Exception):
def __init__(self, reason, response=None):
- self.reason = response
+ self.reason = reason
self.response = response
Exception.__init__(self, reason)
| anapioficeandfire/error.py | ReplaceText(target='reason' @(7,22)->(7,30)) | -4,7 +4,7 @@
class AnApiOfIceAndFireError(Exception):
def __init__(self, reason, response=None):
self.reason = response
self.response = response
Exception.__init__(self, reason)
| -4,7 +4,7 @@
class AnApiOfIceAndFireError(Exception):
def __init__(self, reason, response=None):
self.reason = reason
self.response = response
Exception.__init__(self, reason)
|
1,574 | https://:@github.com/prologic/udns.git | 80988bc30391f48cd9189623043db516c0217a5a | @@ -244,7 +244,7 @@ class Server(Component):
)
)
- lookup = DNSRecord(q=DNSQuestion(qname, qclass, qtype))
+ lookup = DNSRecord(q=DNSQuestion(qname, qtype, qclass))
id = lookup.header.id
self.peers[id] = peer
self.requests[id] = request
| udns/server.py | ArgSwap(idxs=1<->2 @(247,29)->(247,40)) | class Server(Component):
)
)
lookup = DNSRecord(q=DNSQuestion(qname, qclass, qtype))
id = lookup.header.id
self.peers[id] = peer
self.requests[id] = request | class Server(Component):
)
)
lookup = DNSRecord(q=DNSQuestion(qname, qtype, qclass))
id = lookup.header.id
self.peers[id] = peer
self.requests[id] = request |
1,575 | https://:@github.com/ShadauxCat/csbuild.git | 53b88d8dbcb6c14ed2d5155d8312142e3c1db9ff | @@ -72,7 +72,7 @@ class project_generator_qtcreator( project_generator.project_generator ):
# These values don't matter much as they're likely to be the same (or close enough to the same for our purposes)
# across all targets.
archDict = projectDict[list(projectDict.keys())[0]]
- toolchainDict = projectDict[list(archDict.keys())[0]]
+ toolchainDict = archDict[list(archDict.keys())[0]]
project = toolchainDict[list(toolchainDict.keys())[0]]
projectpath = os.path.join( self.rootpath, parentPath, project.name )
| csbuild/project_generator_qtcreator.py | ReplaceText(target='archDict' @(75,18)->(75,29)) | class project_generator_qtcreator( project_generator.project_generator ):
# These values don't matter much as they're likely to be the same (or close enough to the same for our purposes)
# across all targets.
archDict = projectDict[list(projectDict.keys())[0]]
toolchainDict = projectDict[list(archDict.keys())[0]]
project = toolchainDict[list(toolchainDict.keys())[0]]
projectpath = os.path.join( self.rootpath, parentPath, project.name ) | class project_generator_qtcreator( project_generator.project_generator ):
# These values don't matter much as they're likely to be the same (or close enough to the same for our purposes)
# across all targets.
archDict = projectDict[list(projectDict.keys())[0]]
toolchainDict = archDict[list(archDict.keys())[0]]
project = toolchainDict[list(toolchainDict.keys())[0]]
projectpath = os.path.join( self.rootpath, parentPath, project.name ) |
1,576 | https://:@github.com/Ciaran1981/geospatial-learn.git | 9c5a1d76e1eff22ec986f2bb6bbf2d4bb8337033 | @@ -1655,7 +1655,7 @@ def multi_temp_filter(inRas, outRas, bands=None, windowSize=None):
if bands==None:
bands = inDataset.RasterCount
- outDataset = _copy_dataset_config(inRas, outMap = outRas,
+ outDataset = _copy_dataset_config(inDataset, outMap = outRas,
bands = bands)
| geospatial_learn/geodata.py | ReplaceText(target='inDataset' @(1658,38)->(1658,43)) | def multi_temp_filter(inRas, outRas, bands=None, windowSize=None):
if bands==None:
bands = inDataset.RasterCount
outDataset = _copy_dataset_config(inRas, outMap = outRas,
bands = bands)
| def multi_temp_filter(inRas, outRas, bands=None, windowSize=None):
if bands==None:
bands = inDataset.RasterCount
outDataset = _copy_dataset_config(inDataset, outMap = outRas,
bands = bands)
|
1,577 | https://:@github.com/oslandia/geo3dfeatures.git | 0ee727feb8ba02991c6546783c6d786ae1e63563 | @@ -195,7 +195,7 @@ def save_clusters(
io.write_xyz(results, output_file_path)
else:
input_file_path = Path(datapath, "input", experiment + ".las")
- io.write_las(results, output_file_path, input_file_path)
+ io.write_las(results, input_file_path, output_file_path)
logger.info("Clusters saved into %s", output_file_path)
| geo3dfeatures/tools/kmean.py | ArgSwap(idxs=1<->2 @(198,8)->(198,20)) | def save_clusters(
io.write_xyz(results, output_file_path)
else:
input_file_path = Path(datapath, "input", experiment + ".las")
io.write_las(results, output_file_path, input_file_path)
logger.info("Clusters saved into %s", output_file_path)
| def save_clusters(
io.write_xyz(results, output_file_path)
else:
input_file_path = Path(datapath, "input", experiment + ".las")
io.write_las(results, input_file_path, output_file_path)
logger.info("Clusters saved into %s", output_file_path)
|
1,578 | https://:@github.com/MBravoS/splot.git | f469d20ba0500925408bd33e90ac3ec2a2a9046d | @@ -237,7 +237,7 @@ def scat(x,y,xlim=None,ylim=None,xinvert=False,yinvert=False,cbar_invert=False,x
cbar.set_label(clabel)
if cbar_invert:
cbar.ax.invert_yaxis()
- if plot_par[0] is not None:
+ if plabel[0] is not None:
plt.legend(loc=lab_loc)
if not multi:
plot_finalizer(xlog,ylog,xlim,ylim,title,xlabel,ylabel,xinvert,yinvert)
| splotch/plots_2d.py | ReplaceText(target='plabel' @(240,4)->(240,12)) | def scat(x,y,xlim=None,ylim=None,xinvert=False,yinvert=False,cbar_invert=False,x
cbar.set_label(clabel)
if cbar_invert:
cbar.ax.invert_yaxis()
if plot_par[0] is not None:
plt.legend(loc=lab_loc)
if not multi:
plot_finalizer(xlog,ylog,xlim,ylim,title,xlabel,ylabel,xinvert,yinvert) | def scat(x,y,xlim=None,ylim=None,xinvert=False,yinvert=False,cbar_invert=False,x
cbar.set_label(clabel)
if cbar_invert:
cbar.ax.invert_yaxis()
if plabel[0] is not None:
plt.legend(loc=lab_loc)
if not multi:
plot_finalizer(xlog,ylog,xlim,ylim,title,xlabel,ylabel,xinvert,yinvert) |
1,579 | https://:@github.com/MBravoS/splot.git | 6a56f84589b416b32e5344de94dc23d4c8ea08e2 | @@ -603,7 +603,7 @@ def cornerplot(data,columns=None,pair_type='contour',nsamples=None,sample_type='
if (jj == 0 and ii != 0):
axes[ii,jj].set_ylabel(labels[ii])
if (len(pair_type) == 2 and jj == npar-1 and ii != npar-1):
- axes[ii,jj].set_ylabel(labels[jj])
+ axes[ii,jj].set_ylabel(labels[ii])
axes[ii,jj].yaxis.tick_right()
axes[ii,jj].yaxis.set_label_position('right')
| src/splotch/axis_func.py | ReplaceText(target='ii' @(606,35)->(606,37)) | def cornerplot(data,columns=None,pair_type='contour',nsamples=None,sample_type='
if (jj == 0 and ii != 0):
axes[ii,jj].set_ylabel(labels[ii])
if (len(pair_type) == 2 and jj == npar-1 and ii != npar-1):
axes[ii,jj].set_ylabel(labels[jj])
axes[ii,jj].yaxis.tick_right()
axes[ii,jj].yaxis.set_label_position('right')
| def cornerplot(data,columns=None,pair_type='contour',nsamples=None,sample_type='
if (jj == 0 and ii != 0):
axes[ii,jj].set_ylabel(labels[ii])
if (len(pair_type) == 2 and jj == npar-1 and ii != npar-1):
axes[ii,jj].set_ylabel(labels[ii])
axes[ii,jj].yaxis.tick_right()
axes[ii,jj].yaxis.set_label_position('right')
|
1,580 | https://:@github.com/GiulioRossetti/ANGEL.git | a04ff79e2e3625c49aebcdf4143aa62422e70172 | @@ -94,7 +94,7 @@ class ArchAngel(object):
edge_list = []
self.slices_ids.append(actual_slice)
- yield g, actual_slice
+ yield g, previous_slice
previous_slice = actual_slice
| angel/alg/iArchAngel.py | ReplaceText(target='previous_slice' @(97,29)->(97,41)) | class ArchAngel(object):
edge_list = []
self.slices_ids.append(actual_slice)
yield g, actual_slice
previous_slice = actual_slice
| class ArchAngel(object):
edge_list = []
self.slices_ids.append(actual_slice)
yield g, previous_slice
previous_slice = actual_slice
|
1,581 | https://:@github.com/tdi/pyPEPA.git | 98934ecf6c42e589938e607e1b075395b37586df | @@ -55,7 +55,7 @@ def range_maker(low, hi, step):
nonlocal hi
nonlocal step
cur = low
- while cur < hi:
+ while cur <= hi:
yield cur
cur += step
return counter
| pyPEPA/experiments/experiment.py | ReplaceText(target='<=' @(58,18)->(58,19)) | def range_maker(low, hi, step):
nonlocal hi
nonlocal step
cur = low
while cur < hi:
yield cur
cur += step
return counter | def range_maker(low, hi, step):
nonlocal hi
nonlocal step
cur = low
while cur <= hi:
yield cur
cur += step
return counter |
1,582 | https://:@github.com/hellupline/flask-crud.git | 1760827b285ba24f20e111e8d8146e3514ca2c96 | @@ -20,7 +20,7 @@ class Tree:
if items is not None:
self.register_items(items)
- if url is not None:
+ if url is None:
self.url = slugify(name)
else:
self.url = url
| flask_crud/tree.py | ReplaceText(target=' is ' @(23,14)->(23,22)) | class Tree:
if items is not None:
self.register_items(items)
if url is not None:
self.url = slugify(name)
else:
self.url = url | class Tree:
if items is not None:
self.register_items(items)
if url is None:
self.url = slugify(name)
else:
self.url = url |
1,583 | https://:@github.com/IMTMarburg/pypipegraph.git | 6a69a16a320e712e114af10cc578be7737e3a620 | @@ -173,7 +173,7 @@ if PY3:
def reraise(tp, value, tb=None):
if tb:
raise tp.with_traceback(tb)
- raise value
+ raise tp
else:
def exec_(code, globs=None, locs=None):
"""Execute code in a namespace."""
| pypipegraph/util.py | ReplaceText(target='tp' @(176,14)->(176,19)) | if PY3:
def reraise(tp, value, tb=None):
if tb:
raise tp.with_traceback(tb)
raise value
else:
def exec_(code, globs=None, locs=None):
"""Execute code in a namespace.""" | if PY3:
def reraise(tp, value, tb=None):
if tb:
raise tp.with_traceback(tb)
raise tp
else:
def exec_(code, globs=None, locs=None):
"""Execute code in a namespace.""" |
1,584 | https://:@github.com/IMTMarburg/pypipegraph.git | d4e04e455117994041e921742ee1599931a44915 | @@ -120,7 +120,7 @@ def check_closure_vars(f1, f2):
return False
for item_name in ["nonlocals"]:
map1 = getattr(cv1, item_name)
- map2 = getattr(cv1, item_name)
+ map2 = getattr(cv2, item_name)
for key in map1:
o1 = map1[key]
if key not in map2:
| src/pypipegraph/job.py | ReplaceText(target='cv2' @(123,23)->(123,26)) | def check_closure_vars(f1, f2):
return False
for item_name in ["nonlocals"]:
map1 = getattr(cv1, item_name)
map2 = getattr(cv1, item_name)
for key in map1:
o1 = map1[key]
if key not in map2: | def check_closure_vars(f1, f2):
return False
for item_name in ["nonlocals"]:
map1 = getattr(cv1, item_name)
map2 = getattr(cv2, item_name)
for key in map1:
o1 = map1[key]
if key not in map2: |
1,585 | https://:@github.com/JJamesWWang/noteutil.git | 867e11505f85724ad5494c58419c497c978f94c6 | @@ -81,7 +81,7 @@ class Quiz:
yield note
else:
index = 0
- while index != len(self.pairs):
+ while index < len(self.pairs):
note = self.pairs[index]
self.last_nindex = note.nindex
yield note
| noteutil/quiz.py | ReplaceText(target='<' @(84,24)->(84,26)) | class Quiz:
yield note
else:
index = 0
while index != len(self.pairs):
note = self.pairs[index]
self.last_nindex = note.nindex
yield note | class Quiz:
yield note
else:
index = 0
while index < len(self.pairs):
note = self.pairs[index]
self.last_nindex = note.nindex
yield note |
1,586 | https://:@github.com/fishtown-analytics/dbt-spark.git | 10a5c7f47e4530d16c42e268199c4957c1516de7 | @@ -222,7 +222,7 @@ class SparkAdapter(SQLAdapter):
def get_catalog(self, manifest):
schema_map = self._get_catalog_schemas(manifest)
- if len(schema_map) != 1:
+ if len(schema_map) > 1:
dbt.exceptions.raise_compiler_error(
f'Expected only one database in get_catalog, found '
f'{list(schema_map)}'
| dbt/adapters/spark/impl.py | ReplaceText(target='>' @(225,27)->(225,29)) | class SparkAdapter(SQLAdapter):
def get_catalog(self, manifest):
schema_map = self._get_catalog_schemas(manifest)
if len(schema_map) != 1:
dbt.exceptions.raise_compiler_error(
f'Expected only one database in get_catalog, found '
f'{list(schema_map)}' | class SparkAdapter(SQLAdapter):
def get_catalog(self, manifest):
schema_map = self._get_catalog_schemas(manifest)
if len(schema_map) > 1:
dbt.exceptions.raise_compiler_error(
f'Expected only one database in get_catalog, found '
f'{list(schema_map)}' |
1,587 | https://:@github.com/monocongo/cvdata.git | 1098d305941dfb35785105da831a7178266a80ef | @@ -227,7 +227,7 @@ def _to_tfrecord(
output_tfrecords = \
tf_record_creation_util.open_sharded_output_tfrecords(
tf_record_close_stack,
- annotations_dir,
+ tfrecord_path,
total_shards,
)
for index, group in enumerate(filename_groups):
| cvdata/convert.py | ReplaceText(target='tfrecord_path' @(230,16)->(230,31)) | def _to_tfrecord(
output_tfrecords = \
tf_record_creation_util.open_sharded_output_tfrecords(
tf_record_close_stack,
annotations_dir,
total_shards,
)
for index, group in enumerate(filename_groups): | def _to_tfrecord(
output_tfrecords = \
tf_record_creation_util.open_sharded_output_tfrecords(
tf_record_close_stack,
tfrecord_path,
total_shards,
)
for index, group in enumerate(filename_groups): |
1,588 | https://:@github.com/kkiyama117/KUEventParser.git | de76133e3c6c181b1ed31c531133c689ef5b3dbd | @@ -41,7 +41,7 @@ def eventparser(manager, **kwargs):
_date = datetime.date(year, month, 1)
else:
_date = date
- return manager.get_events(_date)
+ return _manager.get_events(_date)
def main():
| kueventparser/core.py | ReplaceText(target='_manager' @(44,11)->(44,18)) | def eventparser(manager, **kwargs):
_date = datetime.date(year, month, 1)
else:
_date = date
return manager.get_events(_date)
def main(): | def eventparser(manager, **kwargs):
_date = datetime.date(year, month, 1)
else:
_date = date
return _manager.get_events(_date)
def main(): |
1,589 | https://:@github.com/shanedabes/fzf_wal.git | 64c69a73f6044e93f301f6817c326f921b0ba893 | @@ -80,7 +80,7 @@ def name_from_selection(s: str) -> str:
def theme_selector(theme_dicts: dict) -> str:
""" Use fzf to select a theme """
- os.environ['FZF_DEFAULT_OPTS'] = '--ansi'
+ os.environ['FZF_DEFAULT_OPTS'] += '--ansi'
selected = iterfzf(theme_name_iter(theme_dicts))
if selected is None:
return None
| fzf_wal/fzf_wal.py | ReplaceText(target='+=' @(83,35)->(83,36)) | def name_from_selection(s: str) -> str:
def theme_selector(theme_dicts: dict) -> str:
""" Use fzf to select a theme """
os.environ['FZF_DEFAULT_OPTS'] = '--ansi'
selected = iterfzf(theme_name_iter(theme_dicts))
if selected is None:
return None | def name_from_selection(s: str) -> str:
def theme_selector(theme_dicts: dict) -> str:
""" Use fzf to select a theme """
os.environ['FZF_DEFAULT_OPTS'] += '--ansi'
selected = iterfzf(theme_name_iter(theme_dicts))
if selected is None:
return None |
1,590 | https://:@github.com/kbarnes3/PyGithub.git | d796d289eb32f9bd228fd530bf37f6f354d357c7 | @@ -20,7 +20,7 @@ UserKey = GithubObject(
InternalSimpleAttributes(
"url", "id", "title", "key",
),
- Editable( [ "title", "key" ], [] ),
+ Editable( [], [ "title", "key" ] ),
Deletable(),
)
| github/GithubObjects.py | ArgSwap(idxs=0<->1 @(23,4)->(23,12)) | UserKey = GithubObject(
InternalSimpleAttributes(
"url", "id", "title", "key",
),
Editable( [ "title", "key" ], [] ),
Deletable(),
)
| UserKey = GithubObject(
InternalSimpleAttributes(
"url", "id", "title", "key",
),
Editable( [], [ "title", "key" ] ),
Deletable(),
)
|
1,591 | https://:@github.com/echinopsii/net.echinopsii.ariane.community.plugin.procos.git | 994f5bfea5299397826ff080f3f729f59bd1f0a8 | @@ -1230,7 +1230,7 @@ class MappingGear(InjectorGearSkeleton):
LOGGER.debug("No endpoint found for selector " + selector +
" on container " + target_container.id)
- if target_endpoint is not None:
+ if target_endpoint is None:
addr = target_fqdn if target_fqdn is not None else map_socket.destination_ip
target_node = Node(
name=addr + ':' + str(map_socket.destination_port),
| ariane_procos/gears.py | ReplaceText(target=' is ' @(1233,58)->(1233,66)) | class MappingGear(InjectorGearSkeleton):
LOGGER.debug("No endpoint found for selector " + selector +
" on container " + target_container.id)
if target_endpoint is not None:
addr = target_fqdn if target_fqdn is not None else map_socket.destination_ip
target_node = Node(
name=addr + ':' + str(map_socket.destination_port), | class MappingGear(InjectorGearSkeleton):
LOGGER.debug("No endpoint found for selector " + selector +
" on container " + target_container.id)
if target_endpoint is None:
addr = target_fqdn if target_fqdn is not None else map_socket.destination_ip
target_node = Node(
name=addr + ':' + str(map_socket.destination_port), |
1,592 | https://:@github.com/JustDSOrg/itssutils.git | f002cc06010c0ff7f3157791bae99e5f70ffc0a9 | @@ -108,7 +108,7 @@ class RawITSSData(object):
# Filter all the stops by a given column/value(s) pair
if filter_cols:
filter_values = [filter_values] if not isinstance(filter_values, list) else filter_values
- filter_cols = [filter_cols] if not isinstance(filter_values, list) else filter_cols
+ filter_cols = [filter_cols] if not isinstance(filter_cols, list) else filter_cols
for col in filter_cols:
ts = ts[ts[col].isin(filter_values)]
| itssutils/itssdata.py | ReplaceText(target='filter_cols' @(111,58)->(111,71)) | class RawITSSData(object):
# Filter all the stops by a given column/value(s) pair
if filter_cols:
filter_values = [filter_values] if not isinstance(filter_values, list) else filter_values
filter_cols = [filter_cols] if not isinstance(filter_values, list) else filter_cols
for col in filter_cols:
ts = ts[ts[col].isin(filter_values)]
| class RawITSSData(object):
# Filter all the stops by a given column/value(s) pair
if filter_cols:
filter_values = [filter_values] if not isinstance(filter_values, list) else filter_values
filter_cols = [filter_cols] if not isinstance(filter_cols, list) else filter_cols
for col in filter_cols:
ts = ts[ts[col].isin(filter_values)]
|
1,593 | https://:@github.com/ionrock/taskin.git | c60374a696a8920b068599bf5faea9903f21460a | @@ -38,11 +38,11 @@ def dig_it(data):
myflow = [
foo,
task.IfTask(check, [bar], [baz]),
- task.MapTask([
+ task.MapTask(dig_it, [
'ionrock.org',
'google.com',
'rackspace.com',
- ], dig_it),
+ ]),
finish,
]
| example/flow.py | ArgSwap(idxs=0<->1 @(41,4)->(41,16)) | def dig_it(data):
myflow = [
foo,
task.IfTask(check, [bar], [baz]),
task.MapTask([
'ionrock.org',
'google.com',
'rackspace.com',
], dig_it),
finish,
]
| def dig_it(data):
myflow = [
foo,
task.IfTask(check, [bar], [baz]),
task.MapTask(dig_it, [
'ionrock.org',
'google.com',
'rackspace.com',
]),
finish,
]
|
1,594 | https://:@github.com/hwipl/nuqql-based.git | 9bae0ed6eca32793dc8d5a4789454627572a6fc0 | @@ -32,7 +32,7 @@ def start(name, callback_list):
loggers = Loggers(config)
# load accounts
- account_list = AccountList(conf, loggers, callbacks)
+ account_list = AccountList(config, loggers, callbacks)
accounts = account_list.load()
# call add account callback for each account
| nuqql_based/based.py | ReplaceText(target='config' @(35,31)->(35,35)) | def start(name, callback_list):
loggers = Loggers(config)
# load accounts
account_list = AccountList(conf, loggers, callbacks)
accounts = account_list.load()
# call add account callback for each account | def start(name, callback_list):
loggers = Loggers(config)
# load accounts
account_list = AccountList(config, loggers, callbacks)
accounts = account_list.load()
# call add account callback for each account |
1,595 | https://:@github.com/scipion-em/scipion-pyworkflow.git | a17e4733e9b7da8509d35f2d7c70ac2b2c7e35d8 | @@ -177,7 +177,7 @@ class ProtPrime(em.ProtInitialVolume):
vol.append(aux)
self._defineOutputs(outputVolumes=vol)
- self._defineSourceRelation(vol, self.inputClasses)
+ self._defineSourceRelation(self.inputClasses, vol)
#--------------------------- INFO functions --------------------------------------------
def _summary(self):
| pyworkflow/em/packages/simple/protocol_prime.py | ArgSwap(idxs=0<->1 @(180,8)->(180,34)) | class ProtPrime(em.ProtInitialVolume):
vol.append(aux)
self._defineOutputs(outputVolumes=vol)
self._defineSourceRelation(vol, self.inputClasses)
#--------------------------- INFO functions --------------------------------------------
def _summary(self): | class ProtPrime(em.ProtInitialVolume):
vol.append(aux)
self._defineOutputs(outputVolumes=vol)
self._defineSourceRelation(self.inputClasses, vol)
#--------------------------- INFO functions --------------------------------------------
def _summary(self): |
1,596 | https://:@github.com/scipion-em/scipion-pyworkflow.git | 2d119701f1a6fb9fdf9965f17205302b17e98f73 | @@ -121,7 +121,7 @@ class ProtSummovie(ProtProcessMovies):
# special case is mrc but ends in mrcs
inMovieName= os.path.join(movieFolder,movieName)
if movieName.endswith('.mrc'):
- movieNameAux = inMovieName
+ movieNameAux = movieName
elif movieName.endswith('.mrcs'):
movieNameAux= pwutils.replaceExt(inMovieName, "mrc")
createLink(inMovieName,movieNameAux)
| pyworkflow/em/packages/grigoriefflab/protocol_summovie.py | ReplaceText(target='movieName' @(124,27)->(124,38)) | class ProtSummovie(ProtProcessMovies):
# special case is mrc but ends in mrcs
inMovieName= os.path.join(movieFolder,movieName)
if movieName.endswith('.mrc'):
movieNameAux = inMovieName
elif movieName.endswith('.mrcs'):
movieNameAux= pwutils.replaceExt(inMovieName, "mrc")
createLink(inMovieName,movieNameAux) | class ProtSummovie(ProtProcessMovies):
# special case is mrc but ends in mrcs
inMovieName= os.path.join(movieFolder,movieName)
if movieName.endswith('.mrc'):
movieNameAux = movieName
elif movieName.endswith('.mrcs'):
movieNameAux= pwutils.replaceExt(inMovieName, "mrc")
createLink(inMovieName,movieNameAux) |
1,597 | https://:@github.com/scipion-em/scipion-pyworkflow.git | d1abfda8b49978e368e525c4798247e17708b6ba | @@ -90,7 +90,7 @@ class ChimeraViewerBase(Viewer):
if _showVol.hasOrigin():
x, y, z = _showVol.getOrigin().getShifts()
else:
- x, y, z = outputVol.getOrigin(force=True).getShifts()
+ x, y, z = _showVol.getOrigin(force=True).getShifts()
f.write("volume #1 style surface voxelSize %f origin "
"%0.2f,%0.2f,%0.2f\n"
| pyworkflow/em/packages/chimera/viewer.py | ReplaceText(target='_showVol' @(93,26)->(93,35)) | class ChimeraViewerBase(Viewer):
if _showVol.hasOrigin():
x, y, z = _showVol.getOrigin().getShifts()
else:
x, y, z = outputVol.getOrigin(force=True).getShifts()
f.write("volume #1 style surface voxelSize %f origin "
"%0.2f,%0.2f,%0.2f\n" | class ChimeraViewerBase(Viewer):
if _showVol.hasOrigin():
x, y, z = _showVol.getOrigin().getShifts()
else:
x, y, z = _showVol.getOrigin(force=True).getShifts()
f.write("volume #1 style surface voxelSize %f origin "
"%0.2f,%0.2f,%0.2f\n" |
1,598 | https://:@github.com/scipion-em/scipion-pyworkflow.git | 9d35fca2ea439a27b9c28b68505636ba4d2ecc3d | @@ -110,7 +110,7 @@ class scipionMMCIFIO(MMCIFIO):
hetfield, resseq, icode = residue.get_id()
if hetfield == " ":
residue_type = "ATOM"
- label_seq_id = str(residue_number)
+ label_seq_id = str(resseq)
residue_number += 1
else:
residue_type = "HETATM"
| pyworkflow/em/convert/atom_struct.py | ReplaceText(target='resseq' @(113,47)->(113,61)) | class scipionMMCIFIO(MMCIFIO):
hetfield, resseq, icode = residue.get_id()
if hetfield == " ":
residue_type = "ATOM"
label_seq_id = str(residue_number)
residue_number += 1
else:
residue_type = "HETATM" | class scipionMMCIFIO(MMCIFIO):
hetfield, resseq, icode = residue.get_id()
if hetfield == " ":
residue_type = "ATOM"
label_seq_id = str(resseq)
residue_number += 1
else:
residue_type = "HETATM" |
1,599 | https://:@github.com/scipion-em/scipion-pyworkflow.git | 63b9497dc33173c1d481fc53c56f8a2c187485d2 | @@ -110,7 +110,7 @@ class scipionMMCIFIO(MMCIFIO):
hetfield, resseq, icode = residue.get_id()
if hetfield == " ":
residue_type = "ATOM"
- label_seq_id = str(residue_number)
+ label_seq_id = str(resseq)
residue_number += 1
else:
residue_type = "HETATM"
| pyworkflow/em/convert/atom_struct.py | ReplaceText(target='resseq' @(113,47)->(113,61)) | class scipionMMCIFIO(MMCIFIO):
hetfield, resseq, icode = residue.get_id()
if hetfield == " ":
residue_type = "ATOM"
label_seq_id = str(residue_number)
residue_number += 1
else:
residue_type = "HETATM" | class scipionMMCIFIO(MMCIFIO):
hetfield, resseq, icode = residue.get_id()
if hetfield == " ":
residue_type = "ATOM"
label_seq_id = str(resseq)
residue_number += 1
else:
residue_type = "HETATM" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.