diff
stringlengths
139
3.65k
message
stringlengths
8
627
diff_languages
stringclasses
1 value
diff --git a/pqhelper/base.py b/pqhelper/base.py index <HASH>..<HASH> 100644 --- a/pqhelper/base.py +++ b/pqhelper/base.py @@ -111,10 +111,6 @@ class Game(object): result_state.active.apply_tile_groups(destroyed_groups) result_state.passive.apply_attack(attack) swap.graft_child(result_state) - # hook for capture game optimizations. does nothing in base - if self._disallow_state(result_state): - result_state.graft_child(Filtered()) - continue # no more simulation for this filtered state yield result_state def _simulated_chain_result(self, potential_chain, already_used_bonus): @@ -131,15 +127,17 @@ class Game(object): same as the original state received. """ while potential_chain: + # hook for capture game optimizations. no effect in base + # warning: only do this ONCE for any given state or it will + # always filter the second time + if self._disallow_state(potential_chain): + potential_chain.graft_child(Filtered()) + return None # no more simulation for this filtered state result_board, destroyed_groups = \ potential_chain.board.execute_once(random_fill= self.random_fill) # yield the state if nothing happened during execution (chain done) if not destroyed_groups: - # hook for capture game optimizations. no effect in base - if self._disallow_state(potential_chain): - potential_chain.graft_child(Filtered()) - return None # no more simulation for this filtered state # yield this state as the final result of the chain return potential_chain # attach the transition
Fixed bug in main algorithm that only appeared once using capture in more situations. The duplicate board filter was being run twice on each state: once after swaps, and then during chain reaction where it always failed. Changed so that swaps are instead tested at the beginning of every chain loop --> exactly one test for each swap and chain result.
py
diff --git a/src/collectors/haproxy/haproxy.py b/src/collectors/haproxy/haproxy.py index <HASH>..<HASH> 100644 --- a/src/collectors/haproxy/haproxy.py +++ b/src/collectors/haproxy/haproxy.py @@ -161,10 +161,23 @@ class HAProxyCollector(diamond.collector.Collector): metric_name = '%s%s.%s' % (section_name, part_one, part_two) for index, metric_string in enumerate(row): + if index < 2: + continue + + metric_string_ok = False try: metric_value = float(metric_string) except ValueError: - continue + if not metric_string: + continue + metric_string_ok = True + metric_value = 1 + + if metric_string_ok: + stat_name = '%s.%s.%s' % (metric_name, headings[index], + self._sanitize(metric_string)) + else: + stat_name = '%s.%s' % (metric_name, headings[index]) stat_name = '%s.%s' % (metric_name, headings[index]) self.publish(stat_name, metric_value, metric_type='GAUGE')
add support string metric values for haproxy there are few haproxy metrics have non-numeric values and they are just as useful as the numeric counterparts. string metric values will be appended to the initial metric name and value will be set to 1
py
diff --git a/pandas/tests/groupby/transform/test_transform.py b/pandas/tests/groupby/transform/test_transform.py index <HASH>..<HASH> 100644 --- a/pandas/tests/groupby/transform/test_transform.py +++ b/pandas/tests/groupby/transform/test_transform.py @@ -769,6 +769,18 @@ def test_transform_numeric_ret(cols, exp, comp_func, agg_func, request): comp_func(result, exp) +def test_transform_ffill(): + # GH 24211 + data = [["a", 0.0], ["a", float("nan")], ["b", 1.0], ["b", float("nan")]] + df = DataFrame(data, columns=["key", "values"]) + result = df.groupby("key").transform("ffill") + expected = DataFrame({"values": [0.0, 0.0, 1.0, 1.0]}) + tm.assert_frame_equal(result, expected) + result = df.groupby("key")["values"].transform("ffill") + expected = Series([0.0, 0.0, 1.0, 1.0], name="values") + tm.assert_series_equal(result, expected) + + @pytest.mark.parametrize("mix_groupings", [True, False]) @pytest.mark.parametrize("as_series", [True, False]) @pytest.mark.parametrize("val1,val2", [("foo", "bar"), (1, 2), (1.0, 2.0)])
API: transform behaves differently with 'ffill' on DataFrameGroupBy and SeriesGroupBy (#<I>)
py
diff --git a/Python/cloud_function/invoke.py b/Python/cloud_function/invoke.py index <HASH>..<HASH> 100755 --- a/Python/cloud_function/invoke.py +++ b/Python/cloud_function/invoke.py @@ -96,7 +96,7 @@ def init(args): contents = fp.read() contents = base64.b64encode(contents) binary = True - elif artifact is not '': + elif artifact != '': with(codecs.open(artifact, 'r', 'utf-8')) as fp: contents = fp.read() binary = False
Use ==/!= to compare str, bytes, and int literals
py
diff --git a/gnupg/_parsers.py b/gnupg/_parsers.py index <HASH>..<HASH> 100644 --- a/gnupg/_parsers.py +++ b/gnupg/_parsers.py @@ -874,6 +874,15 @@ class GenKey(object): self.status = nodata(value) elif key == "PROGRESS": self.status = progress(value.split(' ', 1)[0]) + elif key == ("PINENTRY_LAUNCHED"): + log.warn(("GnuPG has just attempted to launch whichever pinentry " + "program you have configured, in order to obtain the " + "passphrase for this key. If you did not use the " + "`passphrase=` parameter, please try doing so. Otherwise, " + "see Issues #122 and #137:" + "\nhttps://github.com/isislovecruft/python-gnupg/issues/122" + "\nhttps://github.com/isislovecruft/python-gnupg/issues/137")) + self.status = 'key not created' else: raise ValueError("Unknown status message: %r" % key)
Handle PINENTRY_LAUNCHED status in GenKey. * FIXES part of Issue #<I>.
py
diff --git a/stripy-src/stripy/spherical.py b/stripy-src/stripy/spherical.py index <HASH>..<HASH> 100755 --- a/stripy-src/stripy/spherical.py +++ b/stripy-src/stripy/spherical.py @@ -1033,8 +1033,8 @@ class sTriangulation(object): def centroid_refine_triangulation_by_triangles(self, triangles): """ - return points defining a refined triangulation obtained by bisection of all edges - in the triangulation that are associated with the triangles in the list provided. + return points defining a refined triangulation obtained by adding the + face centroids of the triangles in the list of indices provided. Notes ----- @@ -1056,8 +1056,9 @@ class sTriangulation(object): def centroid_refine_triangulation_by_vertices(self, vertices): """ - return points defining a refined triangulation obtained by bisection of all edges - in the triangulation connected to any of the vertices in the list provided + return points defining a refined triangulation obtained by adding the + face centroids in the triangulation connected to any of the vertices in + the list provided """ triangles = self.identify_vertex_triangles(vertices)
Correct the docstrings for the centroid_refine_triangulation_by_triangles and centroid_refine_triangulation_by_vertices methods.
py
diff --git a/pysat/_orbits.py b/pysat/_orbits.py index <HASH>..<HASH> 100644 --- a/pysat/_orbits.py +++ b/pysat/_orbits.py @@ -571,7 +571,7 @@ class Orbits(object): pad_next = False if pad_next: # orbit went across day break, stick old orbit onto new - # data and grab second orbit (first is old) + # data and grab second orbit (first is old) self.sat.data = pds.concat( [temp_orbit_data[:self.sat.data.index[0] - pds.DateOffset(microseconds=1)],
Bugfix Fixed bug where underscore after hash sign kills everything.
py
diff --git a/synology/api.py b/synology/api.py index <HASH>..<HASH> 100644 --- a/synology/api.py +++ b/synology/api.py @@ -101,7 +101,7 @@ class Api: # It appears that surveillance station needs lowercase text # true/false for the on switch - if state != HOME_MODE_ON and state != HOME_MODE_OFF: + if state not in (HOME_MODE_ON, HOME_MODE_OFF): raise ValueError('Invalid home mode state') api = self._api_info['home_mode']
Fix pylint consider-using-in warning
py
diff --git a/figgypy/config.py b/figgypy/config.py index <HASH>..<HASH> 100644 --- a/figgypy/config.py +++ b/figgypy/config.py @@ -83,15 +83,18 @@ class Config(object): for k, v in obj.items(): obj[k] = self._decrypt_and_update(v) else: - if 'BEGIN PGP' in obj: - try: - decrypted = self.gpg.decrypt(obj) - if decrypted.ok: - obj = decrypted.data.decode('utf-8') - else: - logger.error("gpg error unpacking secrets %s" % decrypted.stderr) - except Exception as e: - logger.error("error unpacking secrets %s" % e) + try: + if 'BEGIN PGP' in obj: + try: + decrypted = self.gpg.decrypt(obj) + if decrypted.ok: + obj = decrypted.data.decode('utf-8') + else: + logger.error("gpg error unpacking secrets %s" % decrypted.stderr) + except Exception as e: + logger.error("error unpacking secrets %s" % e) + except TypeError as e: + logger.info('Pass on decryption. Only decrypt strings') return obj def _post_load_process(self, cfg):
Modify only to attempt decryption on strings
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,5 +8,5 @@ setup( packages=find_packages("src"), package_dir={"": "src"}, py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")], - python_requires=">=3.5,", + python_requires=">=3.5", )
Fix malformed python_requires directive in setup.py
py
diff --git a/tests/unit/modules/test_virt.py b/tests/unit/modules/test_virt.py index <HASH>..<HASH> 100644 --- a/tests/unit/modules/test_virt.py +++ b/tests/unit/modules/test_virt.py @@ -643,10 +643,10 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin): self.set_mock_vm("test-vm", xml) disks = virt.get_disks('test-vm') - disk = disks[list(disks)[0]] + disk = disks.get('vda') self.assertEqual('/disks/test.qcow2', disk['file']) self.assertEqual('disk', disk['type']) - cdrom = disks[list(disks)[1]] + cdrom = disks.get('hda') self.assertEqual('/disks/test-cdrom.iso', cdrom['file']) self.assertEqual('cdrom', cdrom['type'])
[Py3] Fix get_disks test in virt module unittests When using the `list()` function in Python3, the order that items are added to the list is not always the same. Instead of wrapping the disks dict in a `list` and the getting the first and second element, just get the elements we want directly and test against those. This makes the test much more stable on Python 3.
py
diff --git a/torchvision/ops/boxes.py b/torchvision/ops/boxes.py index <HASH>..<HASH> 100644 --- a/torchvision/ops/boxes.py +++ b/torchvision/ops/boxes.py @@ -24,7 +24,7 @@ def nms(boxes, scores, iou_threshold): scores for each one of the boxes iou_threshold : float discards all overlapping - boxes with IoU < iou_threshold + boxes with IoU > iou_threshold Returns ------- @@ -55,7 +55,7 @@ def batched_nms(boxes, scores, idxs, iou_threshold): indices of the categories for each one of the boxes. iou_threshold : float discards all overlapping boxes - with IoU < iou_threshold + with IoU > iou_threshold Returns -------
Fix documentation for NMS (#<I>)
py
diff --git a/salt/state.py b/salt/state.py index <HASH>..<HASH> 100644 --- a/salt/state.py +++ b/salt/state.py @@ -726,6 +726,13 @@ class State(object): # Add the requires to the reqs dict and check them # all for recursive requisites. argfirst = next(iter(arg)) + if argfirst == 'names': + if not isinstance(arg[argfirst], list): + errors.append(('Names statement in state ' + '"{0}" in sls "{1}" needs to be formed as' + 'a list').format( + name, + body['__sls__'])) if argfirst == 'require' or argfirst == 'watch': if not isinstance(arg[argfirst], list): errors.append(('The require or watch'
Add verification for names to be a list, fix #<I>
py
diff --git a/dimod/package_info.py b/dimod/package_info.py index <HASH>..<HASH> 100644 --- a/dimod/package_info.py +++ b/dimod/package_info.py @@ -14,7 +14,7 @@ # # ================================================================================================ -__version__ = '0.8.18' +__version__ = '0.8.19' __author__ = 'D-Wave Systems Inc.' __authoremail__ = 'acondello@dwavesys.com' __description__ = 'A shared API for binary quadratic model samplers.'
Update version <I> -> <I> Fixes ------ * Fix osx wheels for <I> binary compatibility * `ConnectedComponentComposites` now correctly fixes variables according to vartype
py
diff --git a/workshift/migrations/0003_auto_20150127_1646.py b/workshift/migrations/0003_auto_20150127_1646.py index <HASH>..<HASH> 100644 --- a/workshift/migrations/0003_auto_20150127_1646.py +++ b/workshift/migrations/0003_auto_20150127_1646.py @@ -10,7 +10,10 @@ def calculate_assigned_hours(apps, schema_editor): db_alias = schema_editor.connection.alias for workshifter in WorkshiftProfile.objects.using(db_alias).all(): for pool_hours in workshifter.pool_hours.all(): - shifts = RegularWorkshift.objects.using(db_alias).filter(current_assignees=workshifter) + shifts = RegularWorkshift.objects.using(db_alias).filter( + current_assignees=workshifter, + pool=pool_hours.pool, + ) pool_hours.assigned_hours = sum(i.hours for i in shifts) pool_hours.save(using=db_alias, update_fields=["assigned_hours"])
Fixed a bug in calculating assigned hours
py
diff --git a/airflow/providers/databricks/operators/databricks.py b/airflow/providers/databricks/operators/databricks.py index <HASH>..<HASH> 100644 --- a/airflow/providers/databricks/operators/databricks.py +++ b/airflow/providers/databricks/operators/databricks.py @@ -246,6 +246,7 @@ class DatabricksSubmitRunOperator(BaseOperator): # Used in airflow.models.BaseOperator template_fields: Sequence[str] = ('json',) + template_ext: Sequence[str] = ('.json',) # Databricks brand color (blue) under white text ui_color = '#1CB1C2' ui_fgcolor = '#fff' @@ -479,6 +480,7 @@ class DatabricksRunNowOperator(BaseOperator): # Used in airflow.models.BaseOperator template_fields: Sequence[str] = ('json',) + template_ext: Sequence[str] = ('.json',) # Databricks brand color (blue) under white text ui_color = '#1CB1C2' ui_fgcolor = '#fff'
Added template_ext = ('.json') to databricks operators #<I> (#<I>)
py
diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index <HASH>..<HASH> 100644 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -292,10 +292,9 @@ def data_manipulation_sh (network): from geoalchemy2.shape import from_shape, to_shape #add connection from Luebeck to Siems - - new_bus = str(int(network.buses.index.max())+1) - new_trafo = str(int(network.transformers.index.max())+1) - new_line = str(int(network.lines.index.max())+1) + new_bus = str(network.buses.index.astype(np.int64).max()+1) + new_trafo = str(network.transformers.index.astype(np.int64).max()+1) + new_line = str(network.lines.index.astype(np.int64).max()+1) network.add("Bus", new_bus,carrier='AC', v_nom=220, x=10.760835, y=53.909745) network.add("Transformer", new_trafo, bus0="25536", bus1=new_bus, x=1.29960, tap_ratio=1, s_nom=1600) network.add("Line",new_line, bus0="26387",bus1=new_bus, x=0.0001, s_nom=1600)
Update utilities.py data_manipulation_sh(network): find names of new components correctly
py
diff --git a/source/rafcon/core/state_elements/data_port.py b/source/rafcon/core/state_elements/data_port.py index <HASH>..<HASH> 100644 --- a/source/rafcon/core/state_elements/data_port.py +++ b/source/rafcon/core/state_elements/data_port.py @@ -147,7 +147,7 @@ class DataPort(StateElement): logger.warning("The name of the created data port is 'error'. " "This name is internally used for error propagation as well. " "Only proceed if you know, what you are doing, otherwise rename the data port.") - self._change_property_with_validity_check('_name', name) + self._name = name @property def data_type(self):
fix(data_port): resolves #<I> fix the special case that the name of a dart port of type object connected to a data_port of type int could not be changed
py
diff --git a/sphero/request.py b/sphero/request.py index <HASH>..<HASH> 100644 --- a/sphero/request.py +++ b/sphero/request.py @@ -138,12 +138,24 @@ class SetChassisId(Sphero): class SelfLevel(Sphero): cid = 0x09 +class SetVDL(Sphero): + cid = 0x0A + class SetDataStreaming(Sphero): cid = 0x11 class ConfigureCollisionDetection(Sphero): cid = 0x12 +class Locator(Sphero): + cid = 0x13 + +class SetAccelerometer(Sphero): + cid = 0x14 + +class ReadLocator(Sphero): + cid=0x15 + class SetRGB(Sphero): cid = 0x20 @@ -209,3 +221,6 @@ class RunOrbbasicProgram(Sphero): class AbortOrbbasicProgram(Sphero): cid = 0x63 + +class AnswerInput(Sphero): + cid = 0x64
Add Request commands from API <I>
py
diff --git a/hagelslag/data/ModelOutput.py b/hagelslag/data/ModelOutput.py index <HASH>..<HASH> 100644 --- a/hagelslag/data/ModelOutput.py +++ b/hagelslag/data/ModelOutput.py @@ -146,7 +146,7 @@ class ModelOutput(object): self.proj = get_proj_obj(proj_dict) elif self.ensemble_name.upper() == "NCAR" or self.ensemble_name.upper() == "VSE": proj_dict, grid_dict = read_ncar_map_file(map_file) - if self.member_name[0:3] == "1km": + if self.member_name[0:7] == "1km_pbl": # Don't just look at the first 3 characters. You have to differentiate '1km_pbl1' and '1km_on_3km_pbl1' grid_dict["dx"] = 1000 grid_dict["dy"] = 1000 grid_dict["sw_lon"] = 258.697
allow for '1km_pbl1' and '1km_on_3km_pbl1' member names
py
diff --git a/pyramid_debugtoolbar_dogpile/__init__.py b/pyramid_debugtoolbar_dogpile/__init__.py index <HASH>..<HASH> 100644 --- a/pyramid_debugtoolbar_dogpile/__init__.py +++ b/pyramid_debugtoolbar_dogpile/__init__.py @@ -24,7 +24,7 @@ LoggedEvent = namedtuple('LoggedEvent', ['key', 'value', 'size', ]) def includeme(config): - config.registry.settings['debugtoolbar.panels'].append(DogpileDebugPanel) + config.registry.settings['debugtoolbar.extra_panels'].append(DogpileDebugPanel) if 'mako.directories' not in config.registry.settings: config.registry.settings['mako.directories'] = []
changing to work with extra_panels
py
diff --git a/salt/utils/s3.py b/salt/utils/s3.py index <HASH>..<HASH> 100644 --- a/salt/utils/s3.py +++ b/salt/utils/s3.py @@ -106,6 +106,9 @@ def query(key, keyid, method='GET', params=None, headers=None, if local_file: payload_hash = salt.utils.get_hash(local_file, form='sha256') + if path is None: + path = '' + if not requesturl: requesturl = 'https://{0}/{1}'.format(endpoint, path) headers, requesturl = salt.utils.aws.sig4( @@ -132,13 +135,13 @@ def query(key, keyid, method='GET', params=None, headers=None, if method == 'PUT': if local_file: - with salt.utils.fopen(local_file, 'r') as data: - result = requests.request(method, - requesturl, - headers=headers, - data=data, - verify=verify_ssl, - stream=True) + data = salt.utils.fopen(local_file, 'r') + result = requests.request(method, + requesturl, + headers=headers, + data=data, + verify=verify_ssl, + stream=True) response = result.content elif method == 'GET' and local_file and not return_bin: result = requests.request(method,
Back-port #<I> to <I> (#<I>) * Fix: local variable result referenced before assignment * Fix: if 'path' variable is None convert it into an empty string
py
diff --git a/discord/oggparse.py b/discord/oggparse.py index <HASH>..<HASH> 100644 --- a/discord/oggparse.py +++ b/discord/oggparse.py @@ -77,6 +77,8 @@ class OggStream: head = self.stream.read(4) if head == b'OggS': return OggPage(self.stream) + elif not head: + return None else: raise OggError('invalid header magic')
Fix OggStream "invalid header magic" at end of stream
py
diff --git a/impact_functions/inundation/flood_OSM_building_impact.py b/impact_functions/inundation/flood_OSM_building_impact.py index <HASH>..<HASH> 100644 --- a/impact_functions/inundation/flood_OSM_building_impact.py +++ b/impact_functions/inundation/flood_OSM_building_impact.py @@ -20,6 +20,8 @@ class FloodBuildingImpactFunction(FunctionProvider): target_field = 'INUNDATED' plugin_name = _('Be temporarily closed') + #title = _('Be temporarily closed') + title = _('THIS SHOULD SHOW UP IN THE GUI') def run(self, layers): """Flood impact to buildings (e.g. from Open Street Map)
Added a new title field to impact function in preparation for issue #<I>
py
diff --git a/pymunin/__init__.py b/pymunin/__init__.py index <HASH>..<HASH> 100644 --- a/pymunin/__init__.py +++ b/pymunin/__init__.py @@ -16,7 +16,7 @@ __copyright__ = "Copyright 2011, Ali Onur Uyar" __credits__ = ["Samuel Stauffer (https://github.com/samuel)", "Mark Lavin (https://github.com/mlavin)"] __license__ = "GPL" -__version__ = "0.9.23" +__version__ = "0.9.24" __maintainer__ = "Ali Onur Uyar" __email__ = "aouyar at gmail.com" __status__ = "Development" @@ -960,8 +960,8 @@ def muninMain(pluginClass, argv=None, env=None, debug=False): return 0 else: return 1 - except Exception, e: - print >> sys.stderr, "EXCEPTION: %s" % str(e) + except Exception: + print >> sys.stderr, "ERROR: %s" % repr(sys.exc_info()[1]) if autoconf: print "no" if debug:
Implement more detailed error reporting by default.
py
diff --git a/neomodel/util.py b/neomodel/util.py index <HASH>..<HASH> 100644 --- a/neomodel/util.py +++ b/neomodel/util.py @@ -4,6 +4,7 @@ import sys import time import warnings from threading import local +from functools import wraps from neo4j.v1 import GraphDatabase, basic_auth, CypherError, SessionError @@ -21,8 +22,14 @@ logger = logging.getLogger(__name__) # make sure the connection url has been set prior to executing the wrapped function def ensure_connection(func): def wrapper(self, *args, **kwargs): - if not self.url: - self.set_connection(config.DATABASE_URL) + # Sort out where to find url + if hasattr(self, 'db'): + _db = self.db + else: + _db = self + + if not _db.url: + _db.set_connection(config.DATABASE_URL) return func(self, *args, **kwargs) return wrapper @@ -62,7 +69,6 @@ class Database(local): self._active_transaction = None @property - @ensure_connection def transaction(self): return TransactionProxy(self) @@ -127,6 +133,7 @@ class TransactionProxy(object): def __init__(self, db): self.db = db + @ensure_connection def __enter__(self): self.db.begin() return self
Ensure_connection only called when accessing the database, not when constructing the transaction decorator
py
diff --git a/glances/plugins/glances_ports.py b/glances/plugins/glances_ports.py index <HASH>..<HASH> 100644 --- a/glances/plugins/glances_ports.py +++ b/glances/plugins/glances_ports.py @@ -112,7 +112,7 @@ class Plugin(GlancesPlugin): # Only process if stats exist and display plugin enable... ret = [] - if not self.stats or self.args.disable_ports: + if not self.stats or args.disable_ports: return ret # Build the string message
Correct issue when running Glances client/server with port plugin
py
diff --git a/dynaphopy/interface/lammps_link.py b/dynaphopy/interface/lammps_link.py index <HASH>..<HASH> 100644 --- a/dynaphopy/interface/lammps_link.py +++ b/dynaphopy/interface/lammps_link.py @@ -19,7 +19,7 @@ def generate_lammps_trajectory(structure, sampling=1 - lmp = lammps(cmdargs=['-echo','none', '-log', 'none', '-screen', 'none']) + lmp = lammps(cmdargs=['-echo','none', '-log', 'none', '-screen', 'none', '-pk omp 2 -sf omp']) # test out various library functions after running in.demo
Improved lammps get forces script to works with older version of numpy
py
diff --git a/swingtix/settings.py b/swingtix/settings.py index <HASH>..<HASH> 100644 --- a/swingtix/settings.py +++ b/swingtix/settings.py @@ -152,3 +152,5 @@ LOGGING = { }, } } + +TEST_RUNNER = 'django.test.runner.DiscoverRunner'
Resolution of SwingTix/bookkeeper#7 Introduced the TEST_RUNNER property to settings.py
py
diff --git a/src/ocrmypdf/_validation.py b/src/ocrmypdf/_validation.py index <HASH>..<HASH> 100644 --- a/src/ocrmypdf/_validation.py +++ b/src/ocrmypdf/_validation.py @@ -65,13 +65,14 @@ def check_options_languages(options, ocr_engine_languages): log.debug("No language specified; assuming --language %s", DEFAULT_LANGUAGE) if not ocr_engine_languages: return - if not options.languages.issubset(ocr_engine_languages): + missing_languages = options.languages - ocr_engine_languages + if missing_languages: msg = ( f"OCR engine does not have language data for the following " "requested languages: \n" ) - for lang in options.languages - ocr_engine_languages: - msg += lang + '\n' + msg += '\n'.join(lang for lang in missing_languages) + msg += '\nNote: most languages are identified by a 3-digit ISO 639-2 Code' raise MissingDependencyError(msg)
validation: mention ISO <I>-2 to give people a clue about how to find the appropriate code
py
diff --git a/spyder_kernels/comms/commbase.py b/spyder_kernels/comms/commbase.py index <HASH>..<HASH> 100644 --- a/spyder_kernels/comms/commbase.py +++ b/spyder_kernels/comms/commbase.py @@ -170,8 +170,11 @@ class CommBase(object): id_list = self.get_comm_id_list(comm_id) for comm_id in id_list: - self._comms[comm_id]['comm'].close() - del self._comms[comm_id] + try: + self._comms[comm_id]['comm'].close() + del self._comms[comm_id] + except KeyError: + pass def is_open(self, comm_id=None): """Check to see if the comm is open."""
Catch KeyError when closing comm This error is shown in the console sometimes but it doesn't add any important information to users.
py
diff --git a/umap/views.py b/umap/views.py index <HASH>..<HASH> 100644 --- a/umap/views.py +++ b/umap/views.py @@ -142,11 +142,13 @@ class UserMaps(DetailView, PaginatorMixin): owner = self.request.user == self.object manager = Map.objects if owner else Map.public maps = manager.filter(Q(owner=self.object) | Q(editors=self.object)) - maps = maps.distinct().order_by('-modified_at')[:50] if owner: per_page = settings.UMAP_MAPS_PER_PAGE_OWNER + limit = 100 else: per_page = settings.UMAP_MAPS_PER_PAGE + limit = 50 + maps = maps.distinct().order_by('-modified_at')[:limit] maps = self.paginate(maps, per_page) kwargs.update({ "maps": maps
Increase limit in owner maps page fix #<I>
py
diff --git a/starlette/testclient.py b/starlette/testclient.py index <HASH>..<HASH> 100644 --- a/starlette/testclient.py +++ b/starlette/testclient.py @@ -67,7 +67,7 @@ class _ASGIAdapter(requests.adapters.HTTPAdapter): def send( # type: ignore self, request: requests.PreparedRequest, *args: typing.Any, **kwargs: typing.Any ) -> requests.Response: - scheme, netloc, path, query, fragement = urlsplit(request.url) # type: ignore + scheme, netloc, path, query, fragment = urlsplit(request.url) # type: ignore default_port = {"http": 80, "ws": 80, "https": 443, "wss": 443}[scheme]
minor: fix typo: s/fragement/fragment (#<I>)
py
diff --git a/redbeat/schedulers.py b/redbeat/schedulers.py index <HASH>..<HASH> 100644 --- a/redbeat/schedulers.py +++ b/redbeat/schedulers.py @@ -24,6 +24,8 @@ from decoder import RedBeatJSONEncoder, RedBeatJSONDecoder rdb = StrictRedis.from_url(current_app.conf.REDBEAT_REDIS_URL) REDBEAT_SCHEDULE_KEY = current_app.conf.REDBEAT_KEY_PREFIX + ':schedule' +REDBEAT_STATICS_KEY = current_app.conf.REDBEAT_KEY_PREFIX + ':statics' + ADD_ENTRY_ERROR = """\ @@ -134,9 +136,20 @@ class RedBeatScheduler(Scheduler): Entry = RedBeatSchedulerEntry def setup_schedule(self): + # cleanup old static entries + previous = rdb.smembers(REDBEAT_STATICS_KEY) + current = set(self.app.conf.CELERYBEAT_SCHEDULE.keys()) + removed = previous - current + for name in removed: + RedBeatSchedulerEntry(name).delete() + + # setup statics self.install_default_entries(self.app.conf.CELERYBEAT_SCHEDULE) self.update_from_dict(self.app.conf.CELERYBEAT_SCHEDULE) + # track static entries + rdb.sadd(REDBEAT_STATICS_KEY, *self.app.conf.CELERYBEAT_SCHEDULE.keys()) + def update_from_dict(self, dict_): for name, entry in dict_.items(): try:
remove deleted entries on restart - fixes #<I>
py
diff --git a/wechatpy/client/base.py b/wechatpy/client/base.py index <HASH>..<HASH> 100644 --- a/wechatpy/client/base.py +++ b/wechatpy/client/base.py @@ -138,7 +138,7 @@ class BaseWeChatClient(object): if 'errcode' in result and result['errcode'] != 0: errcode = result['errcode'] - errmsg = result['errmsg'] + errmsg = result.get('errmsg', errcode) if errcode in (40001, 40014, 42001): # access_token expired, fetch a new one and retry request self.fetch_access_token()
Wechat won't return errmsg on some occasion
py
diff --git a/python/test/function/test_random_functions.py b/python/test/function/test_random_functions.py index <HASH>..<HASH> 100644 --- a/python/test/function/test_random_functions.py +++ b/python/test/function/test_random_functions.py @@ -17,6 +17,7 @@ import numpy as np import nnabla as nn import nnabla.functions as F from nbla_test_utils import list_context +import platform ctxs_rand = list_context('Rand') ctxs_randint = list_context('Randint') @@ -145,6 +146,7 @@ def test_rand_binomial_forward(seed, ctx, func_name, n, p, shape): @pytest.mark.parametrize("k, theta", [(1, 2), (9, 0.5), (3, 2), (7.5, 1), (0.5, 1)]) @pytest.mark.parametrize("shape", [[50], [100, 100], [1000, 1000]]) @pytest.mark.parametrize("seed", [-1, 313]) +@pytest.mark.skipif(platform.system() == "Darwin", reason='skipped on mac') def test_rand_gamma_forward(seed, ctx, func_name, k, theta, shape): with nn.context_scope(ctx): o = F.rand_gamma(k, theta, shape, seed=seed)
alleviate test for gamma
py
diff --git a/robosuite/utils/placement_samplers.py b/robosuite/utils/placement_samplers.py index <HASH>..<HASH> 100644 --- a/robosuite/utils/placement_samplers.py +++ b/robosuite/utils/placement_samplers.py @@ -194,7 +194,7 @@ class UniformRandomSampler(ObjectPositionSampler): """ if self.rotation is None: rot_angle = np.random.uniform(high=2 * np.pi, low=0) - elif isinstance(self.rotation, collections.Iterable): + elif isinstance(self.rotation, collections.abc.Iterable): rot_angle = np.random.uniform( high=max(self.rotation), low=min(self.rotation) )
fix depreceation warning for collections.iterable
py
diff --git a/wooey/backend/command_line.py b/wooey/backend/command_line.py index <HASH>..<HASH> 100644 --- a/wooey/backend/command_line.py +++ b/wooey/backend/command_line.py @@ -43,6 +43,18 @@ def bootstrap(env=None, cwd=None): env['DJANGO_SETTINGS_MODULE'] = '' admin_command = [sys.executable] if sys.executable else [] admin_path = which('django-admin.py') + if admin_path is None: + # on windows, we may need to look for django-admin.exe + platform = sys.platform + if platform == "win32": + admin_path = which('django-admin') + if admin_path is None: + admin_path = which('django-admin.exe') + if admin_path is not None: + admin_command = [] + if admin_path is None: + sys.stderr.write('Unable to find django-admin command. Please check your PATH and ensure django-admin is accessible.\n') + sys.exit(1) admin_command.extend([admin_path, 'startproject', project_name]) admin_kwargs = {'env': env} if cwd is not None:
handling cases where django-admin cannot be found
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,8 @@ CLASSIFIERS = [ PYTHON_REQUIRES = '>=3.5' INSTALL_REQUIRES = ['numpy >= 1.12', 'pandas >= 0.19.2'] -SETUP_REQUIRES = ['pytest-runner >= 4.2'] +needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) +SETUP_REQUIRES = ['pytest-runner >= 4.2'] if needs_pytest else [] TESTS_REQUIRE = ['pytest >= 2.7.1'] if sys.version_info[0] < 3: TESTS_REQUIRE.append('mock')
BUG: pytest-runner no required for setup.py (#<I>)
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from numpy.distutils.core import setup, Extension import os -#os.environ["CC"] = "gcc" +# os.environ["CC"] = "gcc" os.environ["CXX"] = "g++" os.environ["CFLAGS"] = "-std=c++11" # numpy mixes CXXFLAGS and CFLAGS @@ -18,7 +18,7 @@ ext_modules = [ sources = ['./phoebe/algorithms/burlishstoer/phoebe_BS_nbody.cpp', './phoebe/algorithms/burlishstoer/n_body.cpp', './phoebe/algorithms/burlishstoer/n_body_state.cpp', - './phoebe/algorithms/burlishstoer/kepcart.c' + './phoebe/algorithms/burlishstoer/kepcart.h' ] ), @@ -29,7 +29,7 @@ ext_modules = [ sources = ['phoebe/algorithms/ceclipse.cpp']), Extension('phoebe.algorithms.interp', - sources = ['phoebe/algorithms/interp.c']), + sources = ['phoebe/algorithms/interp.cpp']), Extension('phoebe.atmospheres.atmcof', sources = ['./phoebe/atmospheres/atmcof.f']),
updated setup.py to link to new cpp files
py
diff --git a/import_export/admin.py b/import_export/admin.py index <HASH>..<HASH> 100644 --- a/import_export/admin.py +++ b/import_export/admin.py @@ -136,14 +136,15 @@ class ImportMixin(ImportExportMixinBase): } content_type_id=ContentType.objects.get_for_model(self.model).pk for row in result: - LogEntry.objects.log_action( - user_id=request.user.pk, - content_type_id=content_type_id, - object_id=row.object_id, - object_repr=row.object_repr, - action_flag=logentry_map[row.import_type], - change_message="%s through import_export" % row.import_type, - ) + if row.import_type != row.IMPORT_TYPE_SKIP: + LogEntry.objects.log_action( + user_id=request.user.pk, + content_type_id=content_type_id, + object_id=row.object_id, + object_repr=row.object_repr, + action_flag=logentry_map[row.import_type], + change_message="%s through import_export" % row.import_type, + ) success_message = _('Import finished') messages.success(request, success_message)
Fixed properly skipping row marked as skipped when importing data from the admin interface.
py
diff --git a/moneyed/localization.py b/moneyed/localization.py index <HASH>..<HASH> 100644 --- a/moneyed/localization.py +++ b/moneyed/localization.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +# +# IMPORTANT: +# Please see https://github.com/limist/py-moneyed/issues/22#issuecomment-447059971 before making changes here. from __future__ import unicode_literals from decimal import Decimal, ROUND_HALF_EVEN @@ -205,9 +208,8 @@ _format("nn_NO", group_size=3, group_separator=" ", decimal_point=",", # foreign or local currency signs for one reason or another differ # from the norm. -# There may be errors here, they have been entered manually. Please -# fork and fix if you find errors. -# Code lives here (2011-05-08): https://github.com/limist/py-moneyed +# READ ME FIRST: +# https://github.com/limist/py-moneyed/issues/22#issuecomment-447059971 _sign(DEFAULT, moneyed.AED, prefix='د.إ') _sign(DEFAULT, moneyed.AFN, suffix='؋')
Added comments about issue <I> to localization.py
py
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index <HASH>..<HASH> 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -189,8 +189,8 @@ class DirectorySandbox(AbstractSandbox): def open(self, file, flags, mode=0777): """Called for low-level os.open()""" - if flags & WRITE_FLAGS: - self._violation("open", file, flags, mode) + if flags & WRITE_FLAGS and not self._ok(file): + self._violation("os.open", file, flags, mode) return _os.open(file,flags,mode)
Fix os.open() sandboxing code that refused anything but read-only access. (backport from trunk) --HG-- branch : setuptools-<I> extra : convert_revision : svn%3A<I>fed2-<I>-<I>-9fe1-9d<I>cc<I>/sandbox/branches/setuptools-<I>%<I>
py
diff --git a/templated_emails/utils.py b/templated_emails/utils.py index <HASH>..<HASH> 100644 --- a/templated_emails/utils.py +++ b/templated_emails/utils.py @@ -66,7 +66,6 @@ def send_templated_email(recipients, template_path, context=None, import pynliner body = pynliner.fromString(body) msg.attach_alternative(body, "text/html") - msg.content_subtype = "html" except TemplateDoesNotExist: logging.info("Email sent without HTML, since %s not found" % html_path)
Do not set content_subtype of the message to text/html.
py
diff --git a/tldap/base.py b/tldap/base.py index <HASH>..<HASH> 100644 --- a/tldap/base.py +++ b/tldap/base.py @@ -158,6 +158,16 @@ class LDAPobject(object): def pk(self): return getattr(self, self._meta.pk) + def __eq__(self, other): + if type(self) != type(other): + return False + if self.pk != other.pk: + return False + return True + + def __ne__(self, other): + return not (self == other) + def get_fields(self): for i in self._meta.get_all_field_names(): yield i, getattr(self, i)
Add support for == and != in models. Compares pk only.
py
diff --git a/infoqmedia.py b/infoqmedia.py index <HASH>..<HASH> 100755 --- a/infoqmedia.py +++ b/infoqmedia.py @@ -64,7 +64,7 @@ class InfoQPresentationDumper: def __init__(self, presentation, ffmpeg="ffmpeg", swfrender="swfrender", rtmpdump="rtmpdump", earlyClean=True, quiet=False, verbose=False, jpeg=False): if presentation.startswith("http://"): - self.url = url + self.url = presentation else: self.url = InfoQPresentationDumper._baseUrl + presentation
Cope with full urls on command line
py
diff --git a/dynaphopy/interface/lammps_link.py b/dynaphopy/interface/lammps_link.py index <HASH>..<HASH> 100644 --- a/dynaphopy/interface/lammps_link.py +++ b/dynaphopy/interface/lammps_link.py @@ -78,7 +78,7 @@ def generate_lammps_trajectory(structure, xc = lmp.gather_atoms("x", 1, 3) vc = lmp.gather_atoms("v", 1, 3) - energy.append(lmp.gather_atoms("pe", 1, 1)) + energy.append(lmp.gather_atoms("pe", 1, 1)[0]) velocity.append(np.array([vc[i] for i in range(na * 3)]).reshape((na, 3))[indexing, :]) if not velocity_only:
Improved lammps get forces script to works with older version of numpy
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -132,7 +132,7 @@ setup(name = 'GPy', py_modules = ['GPy.__init__'], test_suite = 'GPy.testing', long_description=read_to_rst('README.md'), - install_requires=['numpy>=1.7', 'scipy>=0.16', 'six'], + install_requires=['numpy>=1.7', 'scipy>=0.16', 'six', 'paramz'], extras_require = {'docs':['sphinx'], 'optional':['mpi4py', 'ipython>=4.0.0',
[setup] paramz integrated
py
diff --git a/isort/identify.py b/isort/identify.py index <HASH>..<HASH> 100644 --- a/isort/identify.py +++ b/isort/identify.py @@ -25,7 +25,7 @@ class Import(NamedTuple): if self.attribute: full_path += f".{self.attribute}" if self.alias: - full_path += " as {self.alias}" + full_path += f" as {self.alias}" return f"{'cimport' if self.cimport else 'import'} {full_path}" def __str__(self):
Missing f for f'string'
py
diff --git a/ryu/app/bmpstation.py b/ryu/app/bmpstation.py index <HASH>..<HASH> 100644 --- a/ryu/app/bmpstation.py +++ b/ryu/app/bmpstation.py @@ -1,3 +1,18 @@ +# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import socket import logging logging.basicConfig(level=logging.DEBUG)
bmpstation: add copyright
py
diff --git a/common/vr/common/utils.py b/common/vr/common/utils.py index <HASH>..<HASH> 100644 --- a/common/vr/common/utils.py +++ b/common/vr/common/utils.py @@ -1,6 +1,5 @@ from __future__ import print_function -import sys import os import subprocess import shutil @@ -105,23 +104,28 @@ def run(command, verbose=False): comes in. """ - p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + do_nothing = lambda *args, **kwargs: None + v_print = print if verbose else do_nothing + + p = subprocess.Popen( + command, + shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + output = "" status_code = None - if verbose: - print("run:", command) + v_print("run:", command) while status_code is None: status_code = p.poll() line = p.stdout.readline() - if verbose: - sys.stdout.write(line) + v_print(line, end='') output += line # capture any last output. remainder = p.stdout.read() - if verbose: - sys.stdout.write(remainder) + v_print(remainder, end='') return CommandResult(command, output + remainder, status_code)
Replace several if statements with a single one
py
diff --git a/HMpTy/mysql/add_htm_ids_to_mysql_database_table.py b/HMpTy/mysql/add_htm_ids_to_mysql_database_table.py index <HASH>..<HASH> 100644 --- a/HMpTy/mysql/add_htm_ids_to_mysql_database_table.py +++ b/HMpTy/mysql/add_htm_ids_to_mysql_database_table.py @@ -79,8 +79,8 @@ def add_htm_ids_to_mysql_database_table( """Checking the table %(tableName)s exists in the database""" % locals()) tableList = [] for row in rows: - tableList.extend(row.values()) - if tableName not in tableList: + tableList.append(row.values()[0].lower()) + if tableName.lower() not in tableList: message = "The %s table does not exist in the database" % (tableName,) log.critical(message) raise IOError(message)
fixing small issue with comparing tables names on case sensitive file systems
py
diff --git a/jss/tlsadapter.py b/jss/tlsadapter.py index <HASH>..<HASH> 100644 --- a/jss/tlsadapter.py +++ b/jss/tlsadapter.py @@ -73,5 +73,5 @@ class TLSAdapter(HTTPAdapter): """Set up a poolmanager to use TLS and our cipher list.""" self.poolmanager = PoolManager( num_pools=connections, maxsize=maxsize, block=block, - ssl_version=ssl.PROTOCOL_TLSv1) # pylint: disable=no-member + ssl_version=ssl.PROTOCOL_TLSv1_2) # pylint: disable=no-member pyopenssl.DEFAULT_SSL_CIPHER_LIST = CIPHER_LIST
Modify TLS support for recent versions of JSS
py
diff --git a/salt/modules/smf.py b/salt/modules/smf.py index <HASH>..<HASH> 100644 --- a/salt/modules/smf.py +++ b/salt/modules/smf.py @@ -79,7 +79,7 @@ def get_stopped(): comps = line.split() if not comps: continue - if not 'online' in line and not 'legacy_run' in line: + if 'online' not in line and 'legacy_run' not in line: ret.add(comps[0]) return sorted(ret) @@ -110,7 +110,7 @@ def missing(name): salt '*' service.missing net-snmp ''' - return not name in get_all() + return name not in get_all() def get_all():
Fix PEP8 E<I> - test for membership should be "not in"
py
diff --git a/cassandra/metadata.py b/cassandra/metadata.py index <HASH>..<HASH> 100644 --- a/cassandra/metadata.py +++ b/cassandra/metadata.py @@ -838,7 +838,7 @@ class Aggregate(object): If `formatted` is set to :const:`True`, extra whitespace will be added to make the query more readable. """ - sep = '\n' if formatted else ' ' + sep = '\n ' if formatted else ' ' keyspace = protect_name(self.keyspace) name = protect_name(self.name) type_list = ', '.join(self.type_signature) @@ -932,7 +932,7 @@ class Function(object): If `formatted` is set to :const:`True`, extra whitespace will be added to make the query more readable. """ - sep = '\n' if formatted else ' ' + sep = '\n ' if formatted else ' ' keyspace = protect_name(self.keyspace) name = protect_name(self.name) arg_list = ', '.join(["%s %s" % (protect_name(n), t)
meta: improved format for Function and Aggregate CQL
py
diff --git a/tests/test_MySQLdb_times.py b/tests/test_MySQLdb_times.py index <HASH>..<HASH> 100644 --- a/tests/test_MySQLdb_times.py +++ b/tests/test_MySQLdb_times.py @@ -93,7 +93,6 @@ class TestToLiteral(unittest.TestCase): def test_datetimedelta_to_literal(self): d = datetime(2015, 12, 13, 1, 2, 3) - datetime(2015, 12, 13, 1, 2, 2) - print(times.DateTimeDelta2literal(d, '')) assert times.DateTimeDelta2literal(d, '') == b"'0 0:0:1'"
Drop debug logging from times test
py
diff --git a/smartcard/Observer.py b/smartcard/Observer.py index <HASH>..<HASH> 100644 --- a/smartcard/Observer.py +++ b/smartcard/Observer.py @@ -76,8 +76,8 @@ class Observable(Synchronization): def countObservers(self): return len(self.obs) + synchronize(Observable, - "addObserver deleteObserver deleteObservers " + - "setChanged clearChanged hasChanged " + - "countObservers") -#:~ + "addObserver deleteObserver deleteObservers " + + "setChanged clearChanged hasChanged " + + "countObservers")
Observer: fix PEP8 warnings Observer.py:<I>:5: E<I> continuation line under-indented for visual indent Observer.py:<I>:5: E<I> continuation line under-indented for visual indent Observer.py:<I>:5: E<I> continuation line under-indented for visual indent Observer.py:<I>:1: E<I> block comment should start with '# '
py
diff --git a/tools/run_tests/artifacts/artifact_targets.py b/tools/run_tests/artifacts/artifact_targets.py index <HASH>..<HASH> 100644 --- a/tools/run_tests/artifacts/artifact_targets.py +++ b/tools/run_tests/artifacts/artifact_targets.py @@ -177,7 +177,7 @@ class PythonArtifact: self.name, ['tools/run_tests/artifacts/build_artifact_python.sh'], environ=environ, - timeout_seconds=60 * 60, + timeout_seconds=60 * 60 * 2, use_workspace=True) def __str__(self):
Increase mac Python artifact build timeout
py
diff --git a/spacy/cli/debug_data.py b/spacy/cli/debug_data.py index <HASH>..<HASH> 100644 --- a/spacy/cli/debug_data.py +++ b/spacy/cli/debug_data.py @@ -361,7 +361,7 @@ def debug_data( if label != "-" ] labels_with_counts = _format_labels(labels_with_counts, counts=True) - msg.text(f"Labels in train data: {_format_labels(labels)}", show=verbose) + msg.text(f"Labels in train data: {labels_with_counts}", show=verbose) missing_labels = model_labels - labels if missing_labels: msg.warn(
add counts to verbose list of NER labels (#<I>)
py
diff --git a/colin/core/checks/dockerfile.py b/colin/core/checks/dockerfile.py index <HASH>..<HASH> 100644 --- a/colin/core/checks/dockerfile.py +++ b/colin/core/checks/dockerfile.py @@ -91,9 +91,9 @@ class InstructionCountAbstractCheck(DockerfileAbstractCheck): self.max_count) logger.debug(log) passed = True - if self.min_count: + if self.min_count is not None: passed = passed and self.min_count <= count - if self.max_count: + if self.max_count is not None: passed = passed and count <= self.max_count return CheckResult(ok=passed,
fix instruction checks when *_count is 0
py
diff --git a/src/sos/targets.py b/src/sos/targets.py index <HASH>..<HASH> 100644 --- a/src/sos/targets.py +++ b/src/sos/targets.py @@ -487,6 +487,11 @@ class file_target(path, BaseTarget): self._md5 = None self._attachments = [] + def _init(self): + super(file_target, self)._init() + self._md5 = None + self._attachments = [] + def target_exists(self, mode='any'): try: if mode in ('any', 'target') and self.expanduser().exists():
Fix initialization of file_target #<I>
py
diff --git a/pandas/io/tests/test_pytables.py b/pandas/io/tests/test_pytables.py index <HASH>..<HASH> 100644 --- a/pandas/io/tests/test_pytables.py +++ b/pandas/io/tests/test_pytables.py @@ -395,9 +395,9 @@ class TestHDFStore(Base, tm.TestCase): def test_iter_empty(self): - with ensure_clean_path(self.path) as path: + with ensure_clean_store(self.path) as store: # GH 12221 - self.assertTrue(list(pd.HDFStore(path)) == []) + self.assertTrue(list(store) == []) def test_repr(self):
TST: make sure closing all pytables stores
py
diff --git a/seed_identity_store/settings.py b/seed_identity_store/settings.py index <HASH>..<HASH> 100644 --- a/seed_identity_store/settings.py +++ b/seed_identity_store/settings.py @@ -162,7 +162,7 @@ CELERY_IMPORTS = ( CELERY_CREATE_MISSING_QUEUES = True CELERY_TASK_SERIALIZER = 'json' -CELERY_RESULT_SERIALIZER = 'json' +CELERY_RESULT_SERIALIZER = 'pickle' CELERY_ACCEPT_CONTENT = ['json'] djcelery.setup_loader()
use pickle insted of json for serialising the tasks
py
diff --git a/sdk/core/azure-core/azure/core/version.py b/sdk/core/azure-core/azure/core/version.py index <HASH>..<HASH> 100644 --- a/sdk/core/azure-core/azure/core/version.py +++ b/sdk/core/azure-core/azure/core/version.py @@ -9,4 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "0.0.1"
revert to <I>
py
diff --git a/src/cr/cube/crunch_cube.py b/src/cr/cube/crunch_cube.py index <HASH>..<HASH> 100644 --- a/src/cr/cube/crunch_cube.py +++ b/src/cr/cube/crunch_cube.py @@ -210,13 +210,6 @@ class CrunchCube(DataTable): ) slice_mask = np.logical_or(rows_pruned, cols_pruned) - # 0 stands for row dim (it's increased inside the method - inserted_rows_indices = self._inserted_dim_inds(transforms, 0) - if inserted_rows_indices.any(): - hs_pruned = slice_mask[inserted_rows_indices, :].all(axis=1) - # make sure we never prune H&S - slice_mask[inserted_rows_indices[hs_pruned], :] = False - # In case of MRs we need to "inflate" mask if self.mr_dim_ind == (1, 2): slice_mask = slice_mask[:, np.newaxis, :, np.newaxis]
[#<I>]: Don't force-keep H&S if they're pruned in both dims
py
diff --git a/ipyrad/core/assembly.py b/ipyrad/core/assembly.py index <HASH>..<HASH> 100644 --- a/ipyrad/core/assembly.py +++ b/ipyrad/core/assembly.py @@ -172,7 +172,7 @@ class Assembly(object): ("max_shared_Hs_locus", 0.50), ("trim_reads", (0, 0, 0, 0)), ("trim_loci", (0, 0, 0, 0)), - ("output_formats", ['l', 'p', 's', 'v']), + ("output_formats", ['p', 's', 'v']), ("pop_assign_file", ""), ])
Removed from output formats defaults (it doesn't do anything)
py
diff --git a/buildAll_unix.py b/buildAll_unix.py index <HASH>..<HASH> 100755 --- a/buildAll_unix.py +++ b/buildAll_unix.py @@ -54,7 +54,7 @@ def main(): 'make', 'make test', 'make install_sw', # don't build documentation, else will fail on Debian - 'mkdir %s'%(openssl_internal_dir), # copy some internal headers for accessing EDH and ECDH parameters + 'mkdir -p %s'%(openssl_internal_dir), # copy some internal headers for accessing EDH and ECDH parameters 'cp %s %s/'%(join(OPENSSL_DIR, 'e_os.h'), openssl_internal_dir), 'cp %s %s/'%(join(OPENSSL_DIR, 'ssl', 'ssl_locl.h'), openssl_internal_dir)]
don't fail if directory already exists
py
diff --git a/spyder/__init__.py b/spyder/__init__.py index <HASH>..<HASH> 100644 --- a/spyder/__init__.py +++ b/spyder/__init__.py @@ -29,7 +29,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -version_info = (5, 0, 3) +version_info = (5, 1, 0, "dev0") __version__ = '.'.join(map(str, version_info)) __installer_version__ = __version__
Back to work [ci skip]
py
diff --git a/glue/ligolw/array.py b/glue/ligolw/array.py index <HASH>..<HASH> 100644 --- a/glue/ligolw/array.py +++ b/glue/ligolw/array.py @@ -48,6 +48,8 @@ import re import sys from xml.sax.saxutils import escape as xmlescape + +import iterutils import ligolw import tokenizer import types @@ -153,17 +155,7 @@ def get_array(xmldoc, name): def IndexIter(shape): - # Adapted from Nick F.'s MultiIter generator in pylal - if len(shape) > 1: - head = shape[0] - for t in IndexIter(shape[1:]): - for h in xrange(head): - yield (h,) + t - elif len(shape) == 1: - for h in xrange(shape[0]): - yield (h,) - else: - yield () + return iterutils.MultiIter(*map(range, shape)) class ArrayStream(ligolw.Stream):
Convert IndexIter into a wrapper around iterutils.MultiIter.
py
diff --git a/StreamDecompressor/archive.py b/StreamDecompressor/archive.py index <HASH>..<HASH> 100644 --- a/StreamDecompressor/archive.py +++ b/StreamDecompressor/archive.py @@ -194,7 +194,9 @@ class ExternalPipe(Archive, threading.Thread): copyfileobj(self.source, self.p.stdin) except IOError, exc: # NOTE: regular exception when we close the pipe, just hide it - if not exc.errno == errno.EPIPE: + if exc.errno == errno.EPIPE: + pass + else: raise self.p.stdin.close() self.p.wait()
Clean-up: looks clearer that way
py
diff --git a/gemini.py b/gemini.py index <HASH>..<HASH> 100644 --- a/gemini.py +++ b/gemini.py @@ -11,7 +11,27 @@ Options: <files>... --report = <report> Output json file --threads = <threads> The number of threads in challenge [default: 1] ---config = <json> Configuration file [default: config.json] +--config = <json> Configuration file(see below) [default: config.json] + +Config file definition: +# Set following value as default if property is blank and not REQUIRED. +{ + "one": { + "host": "http://one", (# REQUIRED) + "proxy": None + }, + "other": { + "host": "http://other", (# REQUIRED) + "proxy": None + }, + "input": { + "format": "yaml", + "encoding": "utf8" + }, + "output": { + "encoding": "utf8" + } +} """ import codecs
(Refs #<I>) Explain config file definition
py
diff --git a/hcam_widgets/widgets.py b/hcam_widgets/widgets.py index <HASH>..<HASH> 100644 --- a/hcam_widgets/widgets.py +++ b/hcam_widgets/widgets.py @@ -2550,7 +2550,7 @@ class Timer(tk.Label): def update(self): """ Updates @ 10Hz to give smooth running clock, checks - run status @0.5Hz to reduce load on servers. + run status @0.2Hz to reduce load on servers. """ g = get_root(self).globals try: @@ -2558,7 +2558,7 @@ class Timer(tk.Label): delta = int(round(time.time() - self.startTime)) self.configure(text='{0:<d} s'.format(delta)) - if self.count % 20 == 0: + if self.count % 50 == 0: if not isRunActive(g): # try and write FITS table before enabling start button, otherwise
slowed down frequency of run status checks
py
diff --git a/py3status/modules/clementine.py b/py3status/modules/clementine.py index <HASH>..<HASH> 100644 --- a/py3status/modules/clementine.py +++ b/py3status/modules/clementine.py @@ -4,7 +4,7 @@ Display the current "artist - title" playing in Clementine. Configuration parameters: cache_timeout: how often we refresh this module in seconds (default 5) - format: string to print (default '♫ {current}') + format: Display format for Clementine (default '♫ {current}') Format placeholders: {current} print current song, artist, title, and/or internet radio
clementine: Too many comments. Hard to keep up. I forget.
py
diff --git a/openstack_dashboard/dashboards/admin/networks/ports/tables.py b/openstack_dashboard/dashboards/admin/networks/ports/tables.py index <HASH>..<HASH> 100644 --- a/openstack_dashboard/dashboards/admin/networks/ports/tables.py +++ b/openstack_dashboard/dashboards/admin/networks/ports/tables.py @@ -12,8 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -import logging - from django.utils.translation import ugettext_lazy as _ from horizon import tables @@ -23,8 +21,6 @@ from openstack_dashboard.dashboards.project.networks.ports import \ from openstack_dashboard.dashboards.project.networks.ports.tabs \ import PortsTab as project_port_tab -LOG = logging.getLogger(__name__) - class DeletePort(project_tables.DeletePort): failure_url = "horizon:admin:networks:detail"
Remove unused LOG This patch is to remove unused LOG in the code. Change-Id: I<I>ff<I>b<I>d6d<I>a3f6c<I>b<I>
py
diff --git a/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py b/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py index <HASH>..<HASH> 100755 --- a/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py +++ b/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py @@ -1338,10 +1338,9 @@ class SmoothieDriver_3_0_0: if home_flagged_axes: self.home_flagged_axes(''.join(list(target.keys()))) log.debug("move: {}".format(command)) - # TODO (andy) a movement's timeout should be calculated by - # how long the movement is expected to take. A default timeout - # of 30 seconds prevents any movements that take longer - self._send_command(command, timeout=DEFAULT_MOVEMENT_TIMEOUT) + # TODO (hmg) a movement's timeout should be calculated by + # how long the movement is expected to take. + self._send_command(command, timeout=DEFAULT_EXECUTE_TIMEOUT) finally: # dwell pipette motors because they get hot plunger_axis_moved = ''.join(set('BC') & set(target.keys()))
fix(api): set default move timeout to <I> instead of <I> (#<I>) We added a split between ack and execute timeouts, with the execute timeout being <I> seconds. But we didn't actually change the places where the timeout was specified to <I> for some reason. We therefore fixed the timeout issues that consistently happened when the robot homed with the head far from its home... but not the ones that happened when users specified a sharply limited speed. Closes #<I>
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup( name='slacker', - version='0.9.10', + version='0.9.15', packages=['slacker'], description='Slack API client', author='Oktay Sancak',
Set version number to <I>
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ except(IOError, ImportError): setup( name='esgfpid', - version='0.7.16-dev', + version='0.7.16', author='Merret Buurman, German Climate Computing Centre (DKRZ)', author_email='buurman@dkrz.de', url='https://github.com/IS-ENES-Data/esgf-pid',
Skip to <I> (need to rerelease <I> under new version, due to pypi upload error)
py
diff --git a/src/artist.py b/src/artist.py index <HASH>..<HASH> 100644 --- a/src/artist.py +++ b/src/artist.py @@ -26,7 +26,7 @@ class Artist(Entity): if attr in Artist.summary_attrs and not self.fetched_summary: self.fetch_summary() return getattr(self, attr) - if len(attr.split('_')) == 2: + if len(attr.split('_')) > 1: try: result = self._construct_timeseries(attr.replace('_', '/')) setattr(self, attr, result) # don't want to call the api over and over
works with deeper heirarchy ts
py
diff --git a/salt/client.py b/salt/client.py index <HASH>..<HASH> 100644 --- a/salt/client.py +++ b/salt/client.py @@ -29,12 +29,10 @@ The data structure needs to be: # This means that the primary client to build is, the LocalClient import os -import re import sys import glob import time import getpass -import fnmatch # Import salt modules import salt.config @@ -875,13 +873,13 @@ class LocalClient(object): # Generate the standard keyword args to feed to format_payload payload_kwargs = {'cmd': 'publish', - 'tgt': tgt, - 'fun': fun, - 'arg': arg, - 'key': self.key, - 'tgt_type': expr_form, - 'ret': ret, - 'jid': jid} + 'tgt': tgt, + 'fun': fun, + 'arg': arg, + 'key': self.key, + 'tgt_type': expr_form, + 'ret': ret, + 'jid': jid} # if kwargs are passed, pack them. if kwargs:
clean up some stragglers from the check_minions change
py
diff --git a/src/python/dxpy/scripts/dx.py b/src/python/dxpy/scripts/dx.py index <HASH>..<HASH> 100755 --- a/src/python/dxpy/scripts/dx.py +++ b/src/python/dxpy/scripts/dx.py @@ -375,7 +375,8 @@ def login(args): if args.save: msg = "You are now logged in. Your credentials are stored in {conf_dir} and will expire in {timeout}. {tip}" - tip = "You can use " + BOLD("dx login --timeout") + " to control the expiration date." + tip = "Use " + BOLD("dx login --timeout") + " to control the expiration date, or " + BOLD("dx logout") + \ + " to end this session." print(fill(msg.format(conf_dir=get_user_conf_dir(), timeout=datetime.timedelta(seconds=normalize_time_input(args.timeout)/1000), tip=tip)))
Expand tip to mention dx logout
py
diff --git a/salt/states/pkg.py b/salt/states/pkg.py index <HASH>..<HASH> 100644 --- a/salt/states/pkg.py +++ b/salt/states/pkg.py @@ -302,7 +302,10 @@ def installed( sources A list of packages to install, along with the source URI or local path - from which to install each package. + from which to install each package. In the example below, ``foo``, + ``bar``, ``baz``, etc. refer to the name of the package, as it would + appear in the output of the ``pkg.version`` or ``pkg.list_pkgs`` CLI + commands. Usage::
Clarify docstring for salt.states.pkg.installed
py
diff --git a/src/discoursegraphs/merging.py b/src/discoursegraphs/merging.py index <HASH>..<HASH> 100755 --- a/src/discoursegraphs/merging.py +++ b/src/discoursegraphs/merging.py @@ -109,8 +109,9 @@ def merging_cli(debug=False): write_gml(tiger_docgraph, args.output_file) elif args.output_format == 'graphml': from networkx import write_graphml - from discoursegraphs.readwrite.generic import layerset2list - layerset2list(tiger_docgraph) + from discoursegraphs.readwrite.generic import layerset2str, attriblist2str + layerset2str(tiger_docgraph) + attriblist2str(tiger_docgraph) write_graphml(tiger_docgraph, args.output_file) elif args.output_format == 'neo4j': import requests
fixed #<I>: graphml export works using layerset2str, attriblist2str
py
diff --git a/girder/utility/server.py b/girder/utility/server.py index <HASH>..<HASH> 100644 --- a/girder/utility/server.py +++ b/girder/utility/server.py @@ -193,8 +193,12 @@ def setup(test=False, plugins=None, curConfig=None): # Mount everything else in the routeTable for (name, route) in six.viewitems(routeTable): if name != 'girder' and name in pluginWebroots: - cherrypy.tree.mount(pluginWebroots[name]['webroot'], route, - pluginWebroots[name]['cp_config'] or appconf) + if pluginWebroots[name]['cp_config']: + config = {route: pluginWebroots[name]['cp_config']} + else: + config = appconf + + cherrypy.tree.mount(pluginWebroots[name]['webroot'], route, config) if test: application.merge({'server': {'mode': 'testing'}})
Surround CP config with routed dictionary
py
diff --git a/dev/run-tests.py b/dev/run-tests.py index <HASH>..<HASH> 100755 --- a/dev/run-tests.py +++ b/dev/run-tests.py @@ -391,7 +391,7 @@ def run_scala_tests_maven(test_profiles): def run_scala_tests_sbt(test_modules, test_profiles): # declare the variable for reference - sbt_test_goals = None + sbt_test_goals = [] if "ALL" in test_modules: sbt_test_goals = ["test"] @@ -399,12 +399,12 @@ def run_scala_tests_sbt(test_modules, test_profiles): # if we only have changes in SQL, MLlib, Streaming, or GraphX then build # a custom test list if "SQL" in test_modules and "CORE" not in test_modules: - sbt_test_goals = ["catalyst/test", - "sql/test", - "hive/test", - "hive-thriftserver/test", - "mllib/test", - "examples/test"] + sbt_test_goals += ["catalyst/test", + "sql/test", + "hive/test", + "hive-thriftserver/test", + "mllib/test", + "examples/test"] if "MLLIB" in test_modules and "CORE" not in test_modules: sbt_test_goals += ["mllib/test", "examples/test"] if "STREAMING" in test_modules and "CORE" not in test_modules:
[HOTFIX] [PROJECT-INFRA] Fix bug in dev/run-tests for MLlib-only PRs
py
diff --git a/slither/detectors/variables/unused_state_variables.py b/slither/detectors/variables/unused_state_variables.py index <HASH>..<HASH> 100644 --- a/slither/detectors/variables/unused_state_variables.py +++ b/slither/detectors/variables/unused_state_variables.py @@ -47,7 +47,7 @@ class UnusedStateVars(AbstractDetector): IMPACT = DetectorClassification.INFORMATIONAL CONFIDENCE = DetectorClassification.HIGH - WIKI = "https://github.com/crytic/slither/wiki/Detector-Documentation#unused-state-variables" + WIKI = "https://github.com/crytic/slither/wiki/Detector-Documentation#unused-state-variable" WIKI_TITLE = "Unused state variable" WIKI_DESCRIPTION = "Unused state variable."
Updated WIKI reference link Updated WIKI reference link for unused-state-variable
py
diff --git a/aws_syncr/amazon/iam.py b/aws_syncr/amazon/iam.py index <HASH>..<HASH> 100644 --- a/aws_syncr/amazon/iam.py +++ b/aws_syncr/amazon/iam.py @@ -137,7 +137,7 @@ class Iam(AmazonMixin, object): current_attached_policies = [] with self.ignore_missing(): - current_attached_policies = self.client.list_attached_role_policies(RoleName=name, PathPrefix=prefix) + current_attached_policies = self.client.list_attached_role_policies(RoleName=name) current_attached_policies = [p['PolicyArn'] for p in current_attached_policies["AttachedPolicies"]] new_attached_policies = ["arn:aws:iam::aws:policy/{0}".format(p) for p in new_policies]
Seems the PathPrefix isn't needed and it makes it come up with empty results
py
diff --git a/ccmlib/common.py b/ccmlib/common.py index <HASH>..<HASH> 100644 --- a/ccmlib/common.py +++ b/ccmlib/common.py @@ -626,7 +626,7 @@ def get_dse_cassandra_version(install_dir): if fnmatch.fnmatch(file, 'cassandra-all*.jar'): match = re.search('cassandra-all-([0-9.]+)(?:-.*)?\.jar', file) if match: - return match.group(1) + return LooseVersion(match.group(1)) raise ArgumentError("Unable to determine Cassandra version in: " + install_dir)
Return LooseVersions for DSE versions as well
py
diff --git a/tests/test_remoteblocks.py b/tests/test_remoteblocks.py index <HASH>..<HASH> 100644 --- a/tests/test_remoteblocks.py +++ b/tests/test_remoteblocks.py @@ -124,6 +124,7 @@ if __name__ == "__main__": print repr(data) blk = blocks.TransientBlock(rlp.encode(data)) chain_manager.receive_chain([blk]) + assert blk.hash in chain_manager
assert that the blks are successfully imported
py
diff --git a/test/test_detector.py b/test/test_detector.py index <HASH>..<HASH> 100644 --- a/test/test_detector.py +++ b/test/test_detector.py @@ -105,5 +105,7 @@ suite = unittest.TestSuite() suite.addTest(unittest.TestLoader().loadTestsFromTestCase(TestDetector)) if __name__ == '__main__': + from astropy.utils import iers + iers.conf.auto_download = False results = unittest.TextTestRunner(verbosity=2).run(suite) simple_exit(results)
do not download IERS data when running test
py
diff --git a/pyvisa/util.py b/pyvisa/util.py index <HASH>..<HASH> 100644 --- a/pyvisa/util.py +++ b/pyvisa/util.py @@ -22,7 +22,7 @@ import struct import subprocess import warnings -from .compat import check_output, string_types +from .compat import check_output, string_types, OrderedDict from . import __version__, logger if sys.version >= '3': @@ -396,7 +396,7 @@ def get_system_details(backends=True): 'unicode': unitype, 'bits': bits, 'pyvisa': __version__, - 'backends': {} + 'backends': OrderedDict() } if backends:
Changed backends debug info from dict to OrderedDict
py
diff --git a/porkchop/plugin.py b/porkchop/plugin.py index <HASH>..<HASH> 100644 --- a/porkchop/plugin.py +++ b/porkchop/plugin.py @@ -5,6 +5,7 @@ import porkchop.plugins class PorkchopPlugin(object): config_file = None + _cache = None _data = {} _lastrefresh = 0 @@ -27,9 +28,9 @@ class PorkchopPlugin(object): @property def data(self): if self.should_refresh(): - self.__class__._lastrefresh = time.time() self.config = self.get_config() self.data = self.get_data() + self.__class__._lastrefresh = time.time() return self.__class__._data @@ -52,10 +53,11 @@ class PorkchopPluginHandler(object): def __init__(self, config_dir, directory = None): self.config_dir = config_dir - PorkchopPluginHandler.plugins.update(self.load_plugins(os.path.dirname(porkchop.plugins.__file__))) if directory: - PorkchopPluginHandler.plugins.update(self.load_plugins(directory)) + self.__class__.plugins.update(self.load_plugins(directory)) + + self.__class__.plugins.update(self.load_plugins(os.path.dirname(porkchop.plugins.__file__))) def load_plugins(self, directory): plugins = {}
- Update _lastrefresh *after* updating ._data - Load user-specified plugins first so they take priority - Introduce _cache for plugins to store internal data between fetches.
py
diff --git a/djstripe/decorators.py b/djstripe/decorators.py index <HASH>..<HASH> 100644 --- a/djstripe/decorators.py +++ b/djstripe/decorators.py @@ -22,7 +22,7 @@ def subscriber_passes_pay_test(test_func, plan=None, pay_page="djstripe:subscrib """ Decorator for views that checks the subscriber passes the given test for a "Paid Feature". - Redirects to the pay_page if necessary. The test should be a callable + Redirects to the `pay_page` if necessary. The test should be a callable that takes the subscriber object and returns True if the subscriber passes. """ def decorator(view_func): @@ -40,7 +40,7 @@ def subscription_payment_required(function=None, plan=None, pay_page="djstripe:s """ Decorator for views that require subscription payment. - Redirects to the pay_page if necessary. + Redirects to the `pay_page` if necessary. """ actual_decorator = subscriber_passes_pay_test( subscriber_has_active_subscription,
Change decorator doc based on feedback
py
diff --git a/looper/models.py b/looper/models.py index <HASH>..<HASH> 100644 --- a/looper/models.py +++ b/looper/models.py @@ -934,11 +934,27 @@ class Project(AttributeDict): # so we don't re-derive them later. merged_cols = { key: "" for key in merge_rows.columns} - for row in merge_rows.index: + for row in range(len(merge_rows.index)): _LOGGER.debug( "New row: {}, {}".format(row, merge_rows)) + # Update with derived columns - row_dict = merge_rows.iloc[row].to_dict() + try: + row_dict = merge_rows.iloc[row].to_dict() + except IndexError: + context = "Processing of sample {} " \ + "attempted to access row {} in " \ + "table with shape {}".\ + format(sample.name, row, + merge_rows.shape) + _LOGGER.error(context) + _LOGGER.error("Columns: {}". + format(merge_table.columns)) + _LOGGER.error("Full rows = {}, " + "reduced rows = {}".format( + merge_table.index, merge_rows.index)) + raise + for col in merge_rows.columns: if col == SAMPLE_NAME_COLNAME or \ col not in self.derived_columns:
enumerate rows for int-based indexing
py
diff --git a/molecule/driver/ec2.py b/molecule/driver/ec2.py index <HASH>..<HASH> 100644 --- a/molecule/driver/ec2.py +++ b/molecule/driver/ec2.py @@ -45,8 +45,7 @@ class EC2(base.Base): .. code-block:: bash - $ sudo pip install boto - $ sudo pip install boto3 + $ pip install molecule[ec2] Change the options passed to the ssh client.
Add ec2 deps installation to docs
py
diff --git a/girc/capabilities.py b/girc/capabilities.py index <HASH>..<HASH> 100644 --- a/girc/capabilities.py +++ b/girc/capabilities.py @@ -24,7 +24,7 @@ class Capabilities: if '=' in cap: cap, value = cap.rsplit('=', 1) - if value = '': + if value == '': value = None else: value = True
[caps] Fix setting CAPA= capabilities
py
diff --git a/stimela/recipe.py b/stimela/recipe.py index <HASH>..<HASH> 100644 --- a/stimela/recipe.py +++ b/stimela/recipe.py @@ -462,7 +462,7 @@ class Recipe(object): # Update I/O with values specified on command line self.indir = indir self.outdir = outdir - self.msdir = msdir or ms_dir + self.msdir = self.ms_dir = msdir or ms_dir self.loglevel = self.stimela_context.get('_STIMELA_LOG_LEVEL', None) or loglevel self.JOB_TYPE = self.stimela_context.get('_STIMELA_JOB_TYPE', None) or JOB_TYPE
renew recipe.ms_dir for backwards comp
py
diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index <HASH>..<HASH> 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -248,7 +248,7 @@ class TestNumberedDir(object): def test_cleanup_keep(self, tmp_path): self._do_cleanup(tmp_path) - a, b = tmp_path.iterdir() + a, b = (x for x in tmp_path.iterdir() if not x.is_symlink()) print(a, b) def test_cleanup_locked(self, tmp_path):
fix test_cleanup_keep for expecting symlinks
py
diff --git a/rope/base/fscommands.py b/rope/base/fscommands.py index <HASH>..<HASH> 100644 --- a/rope/base/fscommands.py +++ b/rope/base/fscommands.py @@ -7,7 +7,6 @@ provided by `FileSystemCommands` class. See `SubversionCommands` and """ import os -import re import shutil @@ -163,12 +162,20 @@ def read_str_coding(source): return _find_coding(source[:second]) -_encoding_pattern = None - def _find_coding(first_two_lines): - global _encoding_pattern - if _encoding_pattern is None: - _encoding_pattern = re.compile(r'coding[=:]\s*([-\w.]+)') - match = _encoding_pattern.search(first_two_lines) - if match is not None: - return match.group(1) + coding = 'coding' + try: + start = first_two_lines.index(coding) + len(coding) + while start < len(first_two_lines): + if first_two_lines[start] not in '=: \t': + break + start += 1 + end = start + while end < len(first_two_lines): + c = first_two_lines[end] + if not c.isalnum() and c not in '-_': + break + end += 1 + return first_two_lines[start:end] + except ValueError: + pass
fscommands: not using regular expressions for finding file coding The main reason is in py3k branch, bytes and regexps don't work.
py
diff --git a/sphinx_revealjs/directives.py b/sphinx_revealjs/directives.py index <HASH>..<HASH> 100644 --- a/sphinx_revealjs/directives.py +++ b/sphinx_revealjs/directives.py @@ -61,10 +61,10 @@ REVEALJS_SECTION_ATTRIBUTES = { "data-auto-animate-duration": directives.unchanged, "data-auto-animate-easing": directives.unchanged, "data-auto-animate-unmatched": directives.unchanged, - "data-auto-animate-id": lambda x: FlagAttribute(), + "data-auto-animate-id": directives.unchanged, "data-auto-animate-restart": lambda x: FlagAttribute(), # Auto-Slide / Slide Timing - "data-autoslide": lambda x: FlagAttribute(), + "data-autoslide": directives.unchanged, }
fix: some attributes are not flag type - data-auto-animate-id - data-autoslide Refs: #<I>
py
diff --git a/grab/spider/pattern.py b/grab/spider/pattern.py index <HASH>..<HASH> 100644 --- a/grab/spider/pattern.py +++ b/grab/spider/pattern.py @@ -36,7 +36,7 @@ class SpiderPattern(object): '%s_url' % task.image_field: task.url}}) - def process_next_page(self, grab, task, xpath, **kwargs): + def process_next_page(self, grab, task, xpath, resolve_base=False, **kwargs): """ Generate task for next page. @@ -54,7 +54,7 @@ class SpiderPattern(object): except IndexError: return False else: - url = grab.make_url_absolute(next_url) + url = grab.make_url_absolute(next_url, resolve_base=resolve_base) page = task.get('page', 1) + 1 grab2 = grab.clone() grab2.setup(url=url)
Add resolve_base option to process_links method
py