diff
stringlengths
139
3.65k
message
stringlengths
8
627
diff_languages
stringclasses
1 value
diff --git a/pyramid_swagger/api.py b/pyramid_swagger/api.py index <HASH>..<HASH> 100644 --- a/pyramid_swagger/api.py +++ b/pyramid_swagger/api.py @@ -63,9 +63,10 @@ def register_api_declaration(config, resource_name, api_declaration): # NOTE: This means our resource paths are currently constrained to be valid # pyramid routes! (minus the leading /) - config.add_route(resource_name, '/api-docs/{0}'.format(resource_name)) + route_name = 'apidocs-{0}'.format(resource_name) + config.add_route(route_name, '/api-docs/{0}'.format(resource_name)) config.add_view( view_for_api_declaration, - route_name=resource_name, + route_name=route_name, renderer='json' )
Make sure to sufficiently namespace api-docs routes
py
diff --git a/fabfile.py b/fabfile.py index <HASH>..<HASH> 100644 --- a/fabfile.py +++ b/fabfile.py @@ -195,9 +195,11 @@ def load_configuration(input_file): output_file_name = os.path.dirname(input_file) + '/fabfile.yaml.lock' - - with open(output_file_name, 'w') as outfile: - outfile.write( yaml.dump(data, default_flow_style=False) ) + try: + with open(output_file_name, 'w') as outfile: + outfile.write( yaml.dump(data, default_flow_style=False) ) + except IOError as e: + print "Warning, could not safe fafile.yaml.lock: %s" % e # print json.dumps(data, sort_keys=True, indent=2, separators=(',', ': ')) @@ -205,9 +207,9 @@ def load_configuration(input_file): def internet_on(): try: - response=urllib2.urlopen('http://www.google.com',timeout=2) + urllib2.urlopen('http://www.google.com',timeout=2) return True - except urllib2.URLError as err: + except urllib2.URLError: pass return False @@ -275,7 +277,6 @@ def resolve_inheritance(config, all_configs): if 'inheritsFrom' not in config: return config - base_config = False inherits_from = config['inheritsFrom'] config.pop('inheritsFrom', None)
Handle io-errors when trying to save the lockfile with more grace. Code-style
py
diff --git a/girc/imapping.py b/girc/imapping.py index <HASH>..<HASH> 100644 --- a/girc/imapping.py +++ b/girc/imapping.py @@ -2,6 +2,7 @@ # Written by Daniel Oaks <daniel@danieloaks.net> # Released under the ISC license import collections +import encodings.idna class IMap: @@ -42,8 +43,7 @@ class IMap: def _translate(self, value): if self._std == 'rfc3454': - # python's casefold does nameprep, so just use that - return value.casefold() + return encodings.idna.nameprep(value) if self._lower_trans is not None: return value.translate(self._lower_trans)
[imapping] Do real nameprep for rfc<I> casemapping
py
diff --git a/blockstore/lib/operations/update.py b/blockstore/lib/operations/update.py index <HASH>..<HASH> 100644 --- a/blockstore/lib/operations/update.py +++ b/blockstore/lib/operations/update.py @@ -33,6 +33,14 @@ from ..config import * from ..scripts import * from ..hashing import hash256_trunc128 +from ..nameset import NAMEREC_FIELDS + +# consensus hash fields +FIELDS = NAMEREC_FIELDS + [ + 'name_hash', + 'consensus_hash' +] + def build(name, consensus_hash, data_hash=None, testset=False): """ Takes in the name to update the data for and the data update itself. @@ -166,4 +174,4 @@ def serialize( nameop ): Convert the set of data obtained from parsing the update into a unique string. """ - return NAME_UPDATE + ":" + nameop['name_hash'] + "," + nameop['update_hash'] + return NAME_UPDATE + ":" + str(nameop['name_hash']) + "," + str(nameop['update_hash'])
Identify consensus fields; coerce string on serialization
py
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -88,7 +88,6 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' -# If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False
Remove comment that was being detected as a todo item
py
diff --git a/mock_django/http.py b/mock_django/http.py index <HASH>..<HASH> 100644 --- a/mock_django/http.py +++ b/mock_django/http.py @@ -59,7 +59,7 @@ def MockHttpRequest(path='/', method='GET', GET=None, POST=None, META=None, user 'HTTP_REFERER': '', 'SERVER_NAME': 'testserver', } - if user is not None: + if user is None: user = user request = WsgiHttpRequest()
Correctly set user on MockHttpRequest
py
diff --git a/gitlint/__init__.py b/gitlint/__init__.py index <HASH>..<HASH> 100644 --- a/gitlint/__init__.py +++ b/gitlint/__init__.py @@ -1 +1 @@ -__version__ = "0.5.0" +__version__ = "0.6.0dev"
Bumped version to <I>dev
py
diff --git a/src/toil/batchSystems/lsfHelper.py b/src/toil/batchSystems/lsfHelper.py index <HASH>..<HASH> 100755 --- a/src/toil/batchSystems/lsfHelper.py +++ b/src/toil/batchSystems/lsfHelper.py @@ -207,7 +207,7 @@ def parse_memory(mem: float, resource: bool) -> str: if megabytes_of_mem < 1: megabytes_of_mem = 1.0 # round as a string here to avoid returning something like 1.231e+12 - return f'{megabytes_of_mem:.4f}' + return f'{megabytes_of_mem:.0f}MB' def per_core_reservation():
fix non integers lsf memory requested (#<I>) * Enforce LSF memory requested is an integer (resolves: #<I>) * Set memory units to MB - so we are explicit with the LSF batch system
py
diff --git a/visidata/shell.py b/visidata/shell.py index <HASH>..<HASH> 100644 --- a/visidata/shell.py +++ b/visidata/shell.py @@ -54,6 +54,9 @@ class DeferredSaveSheet(Sheet): RowColorizer(9, 'color_delete_pending', lambda s,c,r,v: id(r) in s.toBeDeleted), RowColorizer(9, 'color_add_pending', lambda s,c,r,v: id(r) in s.addedRows), ] + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.reset() def reset(self): 'reset deferred caches'
[DeferredSaveSheet] initialize toBeDeleted and addedRows
py
diff --git a/test/test_flange.py b/test/test_flange.py index <HASH>..<HASH> 100644 --- a/test/test_flange.py +++ b/test/test_flange.py @@ -169,7 +169,13 @@ def test_plugin_model(): 'test_plugin_config_key': { 'type': 'FLANGE.TYPE.PLUGIN', - 'schema': 'python://{}.TestPlugin.get_schema__static'.format(module_name), + 'schema': { + 'type': 'object', + 'properties':{ + 'only_TestPlugin_would_match_this': {'type': 'string'} + }, + 'required': ['only_TestPlugin_would_match_this'] + }, 'factory': 'python://{}.TestPlugin().get_instance'.format(module_name) } }
make sure direct jsonschema works in model config
py
diff --git a/bokeh/plotting_helpers.py b/bokeh/plotting_helpers.py index <HASH>..<HASH> 100644 --- a/bokeh/plotting_helpers.py +++ b/bokeh/plotting_helpers.py @@ -238,9 +238,9 @@ def _get_range(range_input): def _get_axis_class(axis_type, range_input): if axis_type is None: return None - elif axis_type is "linear": + elif axis_type == "linear": return LinearAxis - elif axis_type is "log": + elif axis_type == "log": return LogAxis elif axis_type == "datetime": return DatetimeAxis
Fix for axis types string comparision (is vs ==)
py
diff --git a/python/mxnet/gluon/data/dataset.py b/python/mxnet/gluon/data/dataset.py index <HASH>..<HASH> 100644 --- a/python/mxnet/gluon/data/dataset.py +++ b/python/mxnet/gluon/data/dataset.py @@ -165,8 +165,10 @@ class Dataset(object): """Returns a new dataset with the first element of each sample transformed by the transformer function `fn`. - This is useful, for example, when you only want to transform data - while keeping label as is. + This is mostly applicable when each sample contains two components + - features and label, i.e., (X, y), and you only want to transform + the first element X (i.e., the features) while keeping the label y + unchanged. Parameters ----------
More clear description to `transform_first` (#<I>) * More clear description to `transform_first` After teaching an MLU-CV class, some students feel confused when they are using the `transform_first` function. So I modified it a bit to make it more clear. :) * remove space
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -37,7 +37,6 @@ setup( 'bitcoin', 'click', 'cogapp', - 'ethereum', 'ethereum-serpent', 'EtherTDD', 'pbkdf2', @@ -48,6 +47,7 @@ setup( 'PyYAML', 'repoze.lru', 'rlp', + 'ethereum', 'scrypt', 'wheel' ],
Move ethereum dependency further down the list. Appears to make a difference... :-/
py
diff --git a/src/scs_core/data/json.py b/src/scs_core/data/json.py index <HASH>..<HASH> 100644 --- a/src/scs_core/data/json.py +++ b/src/scs_core/data/json.py @@ -190,6 +190,8 @@ class PersistentJSONable(AbstractPersistentJSONable): classdocs """ + __SECURITY_DELAY = 3.0 # seconds + # ---------------------------------------------------------------------------------------------------------------- @classmethod @@ -212,7 +214,12 @@ class PersistentJSONable(AbstractPersistentJSONable): if not manager.exists(dirname, filename): return cls.construct_from_jdict(None, default=default) - jstr = manager.load(dirname, filename, encryption_key=encryption_key) + try: + jstr = manager.load(dirname, filename, encryption_key=encryption_key) + + except (KeyError, ValueError) as ex: # caused by incorrect encryption_key + time.sleep(cls.__SECURITY_DELAY) + raise ex return cls.construct_from_jdict(cls.loads(jstr), default=default)
Added security delay to PersistentJSONable load(..) method
py
diff --git a/autofit/messages/transform_wrapper.py b/autofit/messages/transform_wrapper.py index <HASH>..<HASH> 100644 --- a/autofit/messages/transform_wrapper.py +++ b/autofit/messages/transform_wrapper.py @@ -156,10 +156,18 @@ class TransformedWrapperInstance(Prior): ) def __mul__(self, other): + if isinstance( + other, + TransformedWrapperInstance + ): + other = other.instance() return self._new_for_base_message( - self.instance() * other.instance() + self.instance() * other ) + def __rmul__(self, other): + return self * other + def __truediv__(self, other): return self._new_for_base_message( self.instance() / other.instance()
rmul and multiplication with float
py
diff --git a/internetarchive/session.py b/internetarchive/session.py index <HASH>..<HASH> 100644 --- a/internetarchive/session.py +++ b/internetarchive/session.py @@ -46,7 +46,7 @@ from requests.adapters import HTTPAdapter from requests.packages.urllib3 import Retry from six.moves.urllib.parse import urlparse, unquote -from internetarchive import __version__ +from internetarchive import __version__, auth from internetarchive.config import get_config from internetarchive.item import Item, Collection from internetarchive.search import Search @@ -271,7 +271,8 @@ class ArchiveSession(requests.sessions.Session): if 'timeout' not in request_kwargs: request_kwargs['timeout'] = 12 try: - resp = self.get(url, **request_kwargs) + s3_auth = auth.S3Auth(self.access_key, self.secret_key) + resp = self.get(url, auth=s3_auth, **request_kwargs) resp.raise_for_status() except Exception as exc: error_msg = 'Error retrieving metadata from {0}, {1}'.format(url, exc)
Use Authorization headr for metadata reads. - This is to support privileged access to /metadata (e.g. access-restricted JSON files). - Get around a very annoying ``requests`` bug (sigh) that automatically adds an Authorization header if a ~/.netrc file exists.
py
diff --git a/zendesk/endpoints_v2.py b/zendesk/endpoints_v2.py index <HASH>..<HASH> 100644 --- a/zendesk/endpoints_v2.py +++ b/zendesk/endpoints_v2.py @@ -87,7 +87,7 @@ mapping_table = { 'path': '/ticket_fields/{{ticket_field_id}}.json', 'method': 'DELETE', }, - + # Views 'list_views': { 'path': '/views.json', @@ -118,6 +118,10 @@ mapping_table = { 'path': '/views/{{view_id}}/count.json', 'method': 'GET', }, + 'list_tickets_in_view': { + 'path':'/views/{{view_id}}/tickets.json', + 'method': 'GET', + }, # Users 'list_users': { @@ -473,7 +477,7 @@ mapping_table = { 'path': '/topics/{{topic_id}}.json', 'method': 'DELETE', }, - + # Topic Comments 'list_topic_comments': { 'path': '/topics/{{topic_id}}/comments.json',
Add method for listing all tickets in view
py
diff --git a/pysat/_orbits.py b/pysat/_orbits.py index <HASH>..<HASH> 100644 --- a/pysat/_orbits.py +++ b/pysat/_orbits.py @@ -792,9 +792,11 @@ class Orbits(object): print('Loaded Orbit:%i' % (self._current - 1)) else: - raise Exception('You ended up where noone should ever be. ' + - 'Talk to someone about this fundamental ' + - 'failure.') + raise Exception(' '.join(('You ended up where nobody should', + 'ever be. Talk to someone about', + 'this fundamental failure or open', + 'an issue at', + 'www.github.com/rstonback/pysat'))) # includes hack to appear to be zero indexed else: # no data
consistent use of "edge of the world" exception message
py
diff --git a/pyotgw/protocol.py b/pyotgw/protocol.py index <HASH>..<HASH> 100644 --- a/pyotgw/protocol.py +++ b/pyotgw/protocol.py @@ -204,7 +204,11 @@ class protocol(asyncio.Protocol): recvfrom = match.group(1) frame = bytes.fromhex(match.group(2)) if recvfrom == "E": - _LOGGER.warning("Received erroneous message, ignoring: %s", frame) + _LOGGER.info( + "The OpenTherm Gateway received an erroneous message." + " This is not a bug in pyotgw. Ignoring: %s", + frame.hex(), + ) return (None, None, None, None, None) msgtype = self._get_msgtype(frame[0]) if msgtype in (v.READ_ACK, v.WRITE_ACK, v.READ_DATA, v.WRITE_DATA): @@ -566,7 +570,7 @@ class protocol(asyncio.Protocol): return if cmd == v.OTGW_CMD_MODE and value == "R": # Device was reset, msg contains build info - while not re.match(r"OpenTherm Gateway \d+\.\d+\.\d+", msg): + while not re.match(r"OpenTherm Gateway \d+(\.\d+)*", msg): msg = await self._cmdq.get() return True match = re.match(expect, msg)
Fix for OpenTherm Gateway <I>. Change log level and message for E* messages from the gateway.
py
diff --git a/jarn/mkrelease/mkrelease.py b/jarn/mkrelease/mkrelease.py index <HASH>..<HASH> 100644 --- a/jarn/mkrelease/mkrelease.py +++ b/jarn/mkrelease/mkrelease.py @@ -285,7 +285,7 @@ class ReleaseMaker(object): if not version: self.err_exit('Bad interpreter') if version < '2.6': - self.err_exit('Python >= 2.6 is required.') + self.err_exit('Python >= 2.6 required') def get_options(self): """Parse command line.
Wording & punctuation.
py
diff --git a/applicationinsights/channel/TelemetryChannel.py b/applicationinsights/channel/TelemetryChannel.py index <HASH>..<HASH> 100644 --- a/applicationinsights/channel/TelemetryChannel.py +++ b/applicationinsights/channel/TelemetryChannel.py @@ -101,9 +101,9 @@ class TelemetryChannel(object): if not properties: properties = {} data.properties = properties - for key, value in local_context.properties: + for key in local_context.properties: if key not in properties: - properties[key] = value + properties[key] = local_context.properties[key] envelope.data.base_data = data self._queue.put(envelope)
Merge pull request #<I> from silencev/dict-fix (#<I>)
py
diff --git a/sacad/sources/base.py b/sacad/sources/base.py index <HASH>..<HASH> 100644 --- a/sacad/sources/base.py +++ b/sacad/sources/base.py @@ -143,9 +143,9 @@ class CoverSource(metaclass=abc.ABCMeta): self.updateHttpHeaders(headers) with self.api_watcher: if post_data is not None: - response = requests.post(url, data=post_data, headers=headers, timeout=10, verify=False) + response = requests.post(url, data=post_data, headers=headers, timeout=15, verify=False) else: - response = requests.get(url, headers=headers, timeout=10, verify=False) + response = requests.get(url, headers=headers, timeout=15, verify=False) response.raise_for_status() data = response.content # add cache entry only when parsing is successful
Increase HTTP timeout again (to <I>s)
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -93,9 +93,12 @@ elif sys.platform.startswith(("darwin", "freebsd")): "/usr/local/include", "/usr/include/freetype2", "/usr/local/include/freetype2", + "/opt/homebrew/include", + "/opt/homebrew/include/mupdf", + "/opt/homebrew/include/freetype2", ], # libraries should already be linked here by brew - library_dirs=["/usr/local/lib"], + library_dirs=["/usr/local/lib", "/opt/homebrew/lib"], # library_dirs=['/usr/local/Cellar/mupdf-tools/1.8/lib/', #'/usr/local/Cellar/openssl/1.0.2g/lib/', #'/usr/local/Cellar/jpeg/8d/lib/',
Add new homebrew directories to build script
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ data_files = [] install_reqs = [ 'appdirs', 'colorama>=0.3.3', 'jinja2', 'six', 'enum34; python_version<"3.4"', 'sh>=1.10; sys_platform!="nt"', - 'pep517<0.7.0"', 'toml', + 'pep517<0.7.0', 'toml', ] # (pep517 and toml are used by pythonpackage.py)
:pencil2: setup.py: Fix dependency syntax (#<I>)
py
diff --git a/cspreports/utils.py b/cspreports/utils.py index <HASH>..<HASH> 100644 --- a/cspreports/utils.py +++ b/cspreports/utils.py @@ -31,6 +31,8 @@ def format_report(jsn): We trust that Python's json library is secure, but if the JSON is invalid then we still want to be able to display it, rather than tripping up on a ValueError. """ + if isinstance(jsn, bytes): + jsn = jsn.decode('utf-8') try: return json.dumps(json.loads(jsn), indent=4, sort_keys=True, separators=(',', ': ')) except ValueError:
Handle binary body Under Python 3, `request.body` is a `bytes`. Make sure to decode it.
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,6 @@ requirements = [ "Twisted[tls,conch] >= 16.0.0", # Celery packages - "celery", "txcelery-py3 >= 1.2.0", # The package for RW support
Downgraded celery dependency for windows.
py
diff --git a/lifetimes/fitters/__init__.py b/lifetimes/fitters/__init__.py index <HASH>..<HASH> 100644 --- a/lifetimes/fitters/__init__.py +++ b/lifetimes/fitters/__init__.py @@ -44,7 +44,7 @@ class BaseFitter(object): ---------- path: str Path where to save model. - save_date: bool, optional + save_data: bool, optional Whether to save data from fitter.data to pickle object save_generate_data_method: bool, optional Whether to save generate_new_data method (if it exists) from
fix typo in BaseFitter.save_model docstring
py
diff --git a/CSHLDAP.py b/CSHLDAP.py index <HASH>..<HASH> 100755 --- a/CSHLDAP.py +++ b/CSHLDAP.py @@ -117,6 +117,9 @@ class CSHLDAP: for member in result: groups = self.getGroups(member[0]) member[1]['groups'] = groups + if 'eboard' in member[1]['groups']: + member[1]['committee'] = self.search(base=self.committees, \ + head=member[0])[0][1]['cn'][0] return result def modify( self, uid, base=False, **kwargs ):
If dynamically inserts a committee attribute to any user search result that is a member of eboard
py
diff --git a/scopus/scopus_search.py b/scopus/scopus_search.py index <HASH>..<HASH> 100644 --- a/scopus/scopus_search.py +++ b/scopus/scopus_search.py @@ -51,7 +51,8 @@ class ScopusSearch(object): Notes ----- - XML results are cached in ~/.scopus/search/{query}. + XML results are cached in ~/.scopus/search/{fname} where fname is the + hashed version of query. The EIDs are stored as a property named EIDS. """
Update docs for hash version of filename
py
diff --git a/src/foremast/utils/lookups.py b/src/foremast/utils/lookups.py index <HASH>..<HASH> 100644 --- a/src/foremast/utils/lookups.py +++ b/src/foremast/utils/lookups.py @@ -102,8 +102,9 @@ class GitLookup(): """ file_contents = '' + file_path = os.path.join(self.runway_dir, filename) + try: - file_path = os.path.join(self.runway_dir, filename) with open(file_path, 'rt') as lookup_file: file_contents = lookup_file.read() except FileNotFoundError:
refactor: Move safe assignment outside of try See also: #<I>
py
diff --git a/intake/source/discovery.py b/intake/source/discovery.py index <HASH>..<HASH> 100644 --- a/intake/source/discovery.py +++ b/intake/source/discovery.py @@ -9,6 +9,7 @@ import pkgutil import warnings import importlib import inspect +import itertools import time import logging @@ -55,6 +56,21 @@ def autodiscover(path=None, plugin_prefix='intake_', do_package_scan=True): # Discover drivers via entrypoints. group = entrypoints.get_group_named('intake.drivers', path=path) + group_all = entrypoints.get_group_all('intake.drivers', path=path) + if group_all != group: + # There are some name collisions. Let's go digging for them. + for name, matches in itertools.groupby(group_all, lambda ep: ep.name): + matches = list(matches) + if len(matches) != 1: + winner = group[name] + logger.debug( + "There are %d 'intake.driver' entrypoints for the name " + "%r. They are %r. The match %r has won the race.", + len(matches), + name, + matches, + winner) + for entrypoint in group.values(): logger.debug("Discovered entrypoint '%s = %s.%s'", entrypoint.name,
Look for and log entrypoint name collision.
py
diff --git a/pyathenajdbc/connection.py b/pyathenajdbc/connection.py index <HASH>..<HASH> 100644 --- a/pyathenajdbc/connection.py +++ b/pyathenajdbc/connection.py @@ -123,7 +123,7 @@ class Connection(object): return props def __enter__(self): - return self.cursor() + return self def __exit__(self, exc_type, exc_val, exc_tb): self.close()
Fix the context manager to return a connection object
py
diff --git a/scripts/appveyor.py b/scripts/appveyor.py index <HASH>..<HASH> 100644 --- a/scripts/appveyor.py +++ b/scripts/appveyor.py @@ -13,7 +13,7 @@ import os from humanfriendly import concatenate # Test dependencies. -from executor import get_search_path, which +from executor import execute, get_search_path, which print("FakeS3 executables:\n%r" % which('fakes3')) @@ -25,6 +25,8 @@ for program in which('fakes3'): padding = vertical_whitespace + delimiter + vertical_whitespace print(padding + ("%s:" % program) + padding + contents + padding) +execute('fakes3', '--help') + print("Executable search path:\n\n%s" % "\n\n".join( "%s:\n%s" % (d, concatenate(sorted(os.listdir(d)))) for d in get_search_path() if os.path.isdir(d)
I'll get there eventually ... (re: AppVeyor and FakeS3)
py
diff --git a/hdbscan/tests/test_rsl.py b/hdbscan/tests/test_rsl.py index <HASH>..<HASH> 100644 --- a/hdbscan/tests/test_rsl.py +++ b/hdbscan/tests/test_rsl.py @@ -128,7 +128,7 @@ def test_rsl_high_dimensional(): labels = RobustSingleLinkage(cut=5.5, algorithm='best', metric='seuclidean', - V=np.ones(H.shape[1])).fit(H).labels_ + metric_params={'V': np.ones(H.shape[1])}).fit(H).labels_ n_clusters_2 = len(set(labels)) - int(-1 in labels) assert_equal(n_clusters_2, n_clusters)
fix inorrect passing of arg to metric
py
diff --git a/threadedcomments/forms.py b/threadedcomments/forms.py index <HASH>..<HASH> 100644 --- a/threadedcomments/forms.py +++ b/threadedcomments/forms.py @@ -37,5 +37,5 @@ class ThreadedCommentForm(CommentForm): def get_comment_create_data(self, *args, **kwargs): d = super(ThreadedCommentForm, self).get_comment_create_data(*args, **kwargs) d['parent_id'] = self.cleaned_data['parent'] - d['title'] = self.cleaned_data['title'] + d['title'] = self.cleaned_data.get('title', '') # title can be removed return d
Allow title to be removed from the form (e.g. via django-fluent-comments)
py
diff --git a/cogen/web/wsgi.py b/cogen/web/wsgi.py index <HASH>..<HASH> 100644 --- a/cogen/web/wsgi.py +++ b/cogen/web/wsgi.py @@ -39,7 +39,9 @@ HTTP handling code taken from the CherryPy WSGI server. # TODO: better application error reporting for the coroutine extensions from __future__ import with_statement -__all__ = ['WSGIFileWrapper', 'WSGIServer', 'WSGIConnection'] + +__all__ = ['WSGIFileWrapper', 'WSGIServer', 'WSGIConnection', 'server_factory'] + from contextlib import closing import base64
added server_factory to __all__
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,8 @@ from distutils.core import setup -#from setuptools import setup + +try: from setuptools import setup +except ImportError: pass + from pygooglechart import __version__ setup(name='pygooglechart',
Modified the setup script so that the old behavior was preserved under 2.x Since, AFAICS the extra behavior isn't required anywhere I didn't spend a bunch of time preserving it for 3.x, but I may be wrong about that. We'll see.
py
diff --git a/panphon/test/test_panphon.py b/panphon/test/test_panphon.py index <HASH>..<HASH> 100644 --- a/panphon/test/test_panphon.py +++ b/panphon/test/test_panphon.py @@ -68,5 +68,14 @@ class TestIpaRe(unittest.TestCase): self.assertIsNone(r.match('ts')) +class TestXSampa(unittest.TestCase): + + def setUp(self): + self.ft = panphon.FeatureTable() + + def test_affricates(self): + self.assertNotEqual(self.ft.word_to_vector_list(u'tS', xsampa=True), + self.ft.word_to_vector_list(u't S', xsampa=True)) + if __name__ == '__main__': unittest.main()
Added X-SAMPA test case(s)
py
diff --git a/src/aspectlib/__init__.py b/src/aspectlib/__init__.py index <HASH>..<HASH> 100644 --- a/src/aspectlib/__init__.py +++ b/src/aspectlib/__init__.py @@ -121,7 +121,7 @@ class Aspect(object): if not isgenerator(advisor): raise ExpectedGenerator("advise_function %s did not return a generator." % self.advise_function) try: - advice = advisor.next() + advice = advisor.send(None) while True: logger.debug('Got advice %r from %s', advice, self.advise_function) if advice is Proceed or advice is None or isinstance(advice, Proceed): @@ -131,13 +131,7 @@ class Aspect(object): try: result = cutpoint_function(*args, **kwargs) except Exception: - exc_info = sys.exc_info() - try: - advice = advisor.throw(*exc_info) - except StopIteration: - reraise(*exc_info) - finally: - del exc_info + advice = advisor.throw(*sys.exc_info()) else: try: advice = advisor.send(result)
Actually reraising is not needed.
py
diff --git a/python/dllib/src/test/dev/diff.py b/python/dllib/src/test/dev/diff.py index <HASH>..<HASH> 100755 --- a/python/dllib/src/test/dev/diff.py +++ b/python/dllib/src/test/dev/diff.py @@ -28,7 +28,8 @@ scala_to_python = {"Graph": "Model"} def extract_scala_class(class_path): - exclude_key_words = set(["*", "abstract"]) + exclude_key_words = set(["*", "abstract", "Const", "Fill", "Shape", + "SplitAndSelect", "StrideSlice"]) include_key_words = set(["Module", "Criterion", "Container", "Cell", "TensorNumeric"]) # noqa content = "\n".join([line for line in open(class_path).readlines() if all([key not in line for key in exclude_key_words])]) # noqa match = re.search(r"class ([\w]+)[^{]+", content)
remove tf layers from python api (#<I>)
py
diff --git a/src/Yowsup/connectionmanager.py b/src/Yowsup/connectionmanager.py index <HASH>..<HASH> 100644 --- a/src/Yowsup/connectionmanager.py +++ b/src/Yowsup/connectionmanager.py @@ -1260,7 +1260,7 @@ class ReaderThread(threading.Thread): if msgData: if isGroup: - self.signalInterface.send("group_messageReceived", (msgId, fromAttribute, author, msgData, timestamp, wantsReceipt)) + self.signalInterface.send("group_messageReceived", (msgId, fromAttribute, author, msgData, timestamp, wantsReceipt, pushName)) else: self.signalInterface.send("message_received", (msgId, fromAttribute, msgData, timestamp, wantsReceipt, pushName))
Sending pushName with group_messageReceived signal
py
diff --git a/test/test_cassandraclient.py b/test/test_cassandraclient.py index <HASH>..<HASH> 100644 --- a/test/test_cassandraclient.py +++ b/test/test_cassandraclient.py @@ -422,7 +422,7 @@ class ManagedCassandraClientFactoryTest(unittest.TestCase): cmanager = ManagedCassandraClientFactory() client = CassandraClient(cmanager) d = cmanager.deferred - reactor.connectTCP('nonexistent-host.000-', PORT, cmanager) + reactor.connectTCP('nonexistent.example.com', PORT, cmanager) yield self.assertFailure(d, error.DNSLookupError) cmanager.shutdown()
make test_initial_connection_failure not timeout in some cases, apparently, looking up an obviously bogus hostname like "nonexistent-host<I>-" makes a nameservice just not respond, which causes the test to time out instead of producing a DNSLookupError, as expected.
py
diff --git a/stomp/internal/__init__.py b/stomp/internal/__init__.py index <HASH>..<HASH> 100644 --- a/stomp/internal/__init__.py +++ b/stomp/internal/__init__.py @@ -1 +1 @@ -__version__ = (2, 0) \ No newline at end of file +__version__ = (2, 1) \ No newline at end of file
update version number for py3k version
py
diff --git a/karaage/applications/models.py b/karaage/applications/models.py index <HASH>..<HASH> 100644 --- a/karaage/applications/models.py +++ b/karaage/applications/models.py @@ -255,10 +255,26 @@ class ProjectApplication(Application): if self.make_leader: self.project.leaders.add(person) if self.needs_account: + found_pc = False for pc in self.project.projectquota_set.all(): + found_pc = True if not person.has_account(pc.machine_category): + log.add( + self.application_ptr, + 'Created account on machine category %s' + % pc.machine_category) Account.create(person, self.project, pc.machine_category) created_account = True + else: + log.change( + self.application_ptr, + 'Account on machine category %s already exists' + % pc.machine_category) + if not found_pc: + log.change( + self.application_ptr, + 'No project quotas found; no accounts created ' + 'despite being requested') self.project.group.members.add(person) return created_person, created_account approve.alters_data = True
Verbose logging when creating application accounts Make it easier to understand if accounts where created, and why not if they weren't created. Change-Id: I<I>d6e<I>d8e<I>aa<I>b<I>ef<I>d<I>f<I>bc<I>e<I>
py
diff --git a/py3status/modules/dpms.py b/py3status/modules/dpms.py index <HASH>..<HASH> 100644 --- a/py3status/modules/dpms.py +++ b/py3status/modules/dpms.py @@ -38,8 +38,8 @@ class Py3status: if event['button'] == 1: if self.run: self.run = False - system("xset -dpms") + system("xset -dpms;xset s off") else: self.run = True - system("xset +dpms") + system("xset +dpms;xset s on") system("killall -USR1 py3status")
[DPMS] Activate/deactivate the screensaver as well. The DPMS module allows activation/deactivation of DPMS and does it well. However, the purpose of deactivating DPMS is, in most cases, to avoid the screen going blank. If the screensaver is not deactivated then the screen will go blank anyway. This commits allow simultaneous activation/deactivation of both.
py
diff --git a/openquake/engine/calculators/hazard/classical/core.py b/openquake/engine/calculators/hazard/classical/core.py index <HASH>..<HASH> 100644 --- a/openquake/engine/calculators/hazard/classical/core.py +++ b/openquake/engine/calculators/hazard/classical/core.py @@ -66,10 +66,11 @@ def compute_hazard_curves(job_id, sources, lt_rlz, ltp): 'sites': hc.site_collection} if hc.maximum_distance: - if not hc.prefiltered: - calc_kwargs['source_site_filter'] = ( - openquake.hazardlib.calc.filters.source_site_distance_filter( - hc.maximum_distance)) + # NB: add a source site filter anyway, even if the sources were + # prefiltered, because it makes a LOT of difference (MS) + calc_kwargs['source_site_filter'] = ( + openquake.hazardlib.calc.filters.source_site_distance_filter( + hc.maximum_distance)) calc_kwargs['rupture_site_filter'] = ( openquake.hazardlib.calc.filters.rupture_site_distance_filter( hc.maximum_distance))
Restored source filtering in the classical calculator
py
diff --git a/glymur/test/test_opj_suite_write.py b/glymur/test/test_opj_suite_write.py index <HASH>..<HASH> 100644 --- a/glymur/test/test_opj_suite_write.py +++ b/glymur/test/test_opj_suite_write.py @@ -226,7 +226,7 @@ class TestSuiteWriteCinema(unittest.TestCase): @unittest.skipIf(not _HAS_SKIMAGE_FREEIMAGE_SUPPORT, "Cannot read input image without scikit-image/freeimage") @unittest.skipIf(os.name == "nt", "Temporary file issue on window.") -@unittest.skipIf(re.match(r"""2\.0""", glymur.version.openjpeg_version), +@unittest.skipIf(not re.match("(1.5|2.0)", glymur.version.openjpeg_version), "Functionality implemented for 2.1") @unittest.skipIf(OPJ_DATA_ROOT is None, "OPJ_OPJ_DATA_ROOT environment variable not set")
Fixed test now that openjpeg version has rolled to <I>
py
diff --git a/octodns/provider/ns1.py b/octodns/provider/ns1.py index <HASH>..<HASH> 100644 --- a/octodns/provider/ns1.py +++ b/octodns/provider/ns1.py @@ -341,6 +341,9 @@ class Ns1Provider(BaseProvider): 'ASIAPAC': 'AS', 'EUROPE': 'EU', 'SOUTH-AMERICA': 'SA', + # continent NA has been handled as part of Geofence Country filter + # starting from v0.9.13. These below US-* just need to continue to + # exist here so it doesn't break the ugrade path 'US-CENTRAL': 'NA', 'US-EAST': 'NA', 'US-WEST': 'NA',
comment for why US-* need to continue to exist under _REGION_TO_CONTINENT
py
diff --git a/GPy/util/caching.py b/GPy/util/caching.py index <HASH>..<HASH> 100644 --- a/GPy/util/caching.py +++ b/GPy/util/caching.py @@ -1,4 +1,5 @@ from ..core.parameterization.parameter_core import Observable +import itertools class Cacher(object): """ @@ -40,9 +41,9 @@ class Cacher(object): # TODO: WARNING !!! Cache OFFSWITCH !!! WARNING # return self.operation(*args) - + #if the result is cached, return the cached computation - state = [all(a is b for a, b in zip(args, cached_i)) for cached_i in self.cached_inputs] + state = [all(a is b for a, b in itertools.izip_longest(args, cached_i)) for cached_i in self.cached_inputs] if any(state): i = state.index(True) if self.inputs_changed[i]:
fixed caching bug with args having Nones
py
diff --git a/octodns/provider/ns1.py b/octodns/provider/ns1.py index <HASH>..<HASH> 100644 --- a/octodns/provider/ns1.py +++ b/octodns/provider/ns1.py @@ -363,7 +363,8 @@ class Ns1Provider(BaseProvider): 'NA': {'DO', 'DM', 'BB', 'BL', 'BM', 'HT', 'KN', 'JM', 'VC', 'HN', 'BS', 'BZ', 'PR', 'NI', 'LC', 'TT', 'VG', 'PA', 'TC', 'PM', 'GT', 'AG', 'GP', 'AI', 'VI', 'CA', 'GD', 'AW', 'CR', 'GL', - 'CU', 'MF', 'SV', 'US', 'MQ', 'MS', 'KY', 'MX', 'CW', 'BQ'} + 'CU', 'MF', 'SV', 'US', 'MQ', 'MS', 'KY', 'MX', 'CW', 'BQ', + 'SX', 'UM'} } def __init__(self, id, api_key, retry_count=4, monitor_regions=None,
Adding SX and UM to NA countries
py
diff --git a/sprinter/formula/perforce.py b/sprinter/formula/perforce.py index <HASH>..<HASH> 100644 --- a/sprinter/formula/perforce.py +++ b/sprinter/formula/perforce.py @@ -140,9 +140,9 @@ class PerforceFormula(FormulaBase): p4settings_file.write("\nP4PASSWD=%s" % config['password']) def __add_p4_env(self, config): - self.directory.add_to_rc('export P4PORT=%s' % config['port']) + self.directory.add_to_env('export P4PORT=%s' % config['port']) if config.get('write_p4settings'): - self.directory.add_to_rc('export P4CONFIG=.p4settings') + self.directory.add_to_env('export P4CONFIG=.p4settings') def __configure_client(self, config): """ write the perforce client """
Perforce formula should add to env, not rc.
py
diff --git a/yt_array.py b/yt_array.py index <HASH>..<HASH> 100644 --- a/yt_array.py +++ b/yt_array.py @@ -505,7 +505,7 @@ class YTArray(np.ndarray): def __pos__(self): """ Posify the data. """ - return YTArray(super(YTArray, self).__pos__()) + return YTArray(super(YTArray, self).__pos__(), self.units) def __mul__(self, right_object): """
Need to explicitly apply units for pos since there is no ufunc for it. --HG-- branch : yt-<I>
py
diff --git a/cwltool/pathmapper.py b/cwltool/pathmapper.py index <HASH>..<HASH> 100644 --- a/cwltool/pathmapper.py +++ b/cwltool/pathmapper.py @@ -12,7 +12,10 @@ class PathMapper(object): def __init__(self, referenced_files, basedir): self._pathmap = {} for src in referenced_files: - ab = src if os.path.isabs(src) else os.path.join(basedir, src) + if src.startswith("file://"): + ab = src[7:] + else: + ab = src if os.path.isabs(src) else os.path.join(basedir, src) self._pathmap[src] = (ab, ab) def mapper(self, src):
Pathmapper understands file:// URIs.
py
diff --git a/pysle/praattools.py b/pysle/praattools.py index <HASH>..<HASH> 100644 --- a/pysle/praattools.py +++ b/pysle/praattools.py @@ -329,7 +329,7 @@ def syllabifyTextgrid(isleDict, tg, wordTierName, phoneTierName, try: tmpStressJ = cvList.index('V') except ValueError: - for char in [u'r', u'n', u'l']: + for char in [u'r', u'm', u'n', u'l']: if char in cvList: tmpStressJ = cvList.index(char) break
feat: consider 'm' to be a fallback 'vowel' as as 'r', 'l', and 'n'
py
diff --git a/angr/analyses/veritesting.py b/angr/analyses/veritesting.py index <HASH>..<HASH> 100644 --- a/angr/analyses/veritesting.py +++ b/angr/analyses/veritesting.py @@ -101,7 +101,7 @@ class CallTracingFilter(object): cfg = self.project.analyses.CFGAccurate(starts=((addr, jumpkind),), initial_state=call_target_state, context_sensitivity_level=0, - call_depth=0, + call_depth=1, call_tracing_filter=tracing_filter.filter ) self.cfg_cache[cfg_key] = (cfg, tracing_filter) @@ -542,7 +542,7 @@ class Veritesting(Analysis): cfg = self.project.analyses.CFGAccurate( starts=((ip_int, path.jumpkind),), context_sensitivity_level=0, - call_depth=0, + call_depth=1, call_tracing_filter=filter, initial_state=cfg_initial_state )
Veritesting: change call_depth=0 to call_depth=1 to reflect new changes in CFG.
py
diff --git a/xbbg/blp.py b/xbbg/blp.py index <HASH>..<HASH> 100644 --- a/xbbg/blp.py +++ b/xbbg/blp.py @@ -5,9 +5,6 @@ from xone import utils, files, logs try: import blpapi - logs.get_logger('xbbg.blp').debug( - f'using blpapi version: {blpapi.__version__}' - ) except ImportError: import sys logs.get_logger('xbbg.blp').critical( @@ -25,6 +22,8 @@ import pytest pytest.skip() +logs.get_logger('xbbg.blp').debug(f'blpapi version: {blpapi.__version__}') + @with_bloomberg def bdp(tickers, flds, cache=False, **kwargs):
skip blp.py
py
diff --git a/contrib/python/api/setup.py b/contrib/python/api/setup.py index <HASH>..<HASH> 100644 --- a/contrib/python/api/setup.py +++ b/contrib/python/api/setup.py @@ -12,7 +12,7 @@ def get_install_requires(): setup(name='skydive-client', - version='0.8.0', + version='0.9.0', description='Skydive Python client library', url='http://github.com/skydive-project/skydive', author='Sylvain Afchain',
python: bump client version
py
diff --git a/tests/unit/states/test_virt.py b/tests/unit/states/test_virt.py index <HASH>..<HASH> 100644 --- a/tests/unit/states/test_virt.py +++ b/tests/unit/states/test_virt.py @@ -254,7 +254,8 @@ class LibvirtTestCase(TestCase, LoaderModuleMockMixin): os_type=None, arch=None, disk=None, disks=None, nic=None, interfaces=None, graphics=None, hypervisor=None, - seed=True, install=True, pub_key=None, priv_key=None) + seed=True, install=True, pub_key=None, priv_key=None, + connection=None, username=None, password=None) with patch.dict(virt.__salt__, { # pylint: disable=no-member 'virt.vm_state': MagicMock(side_effect=CommandExecutionError('not found')),
Remove unneeded kwargs in virt states Avoid using kwargs to get the states parameters, perfer documented named parameters with default value. (cherry picked from commit c7c5d6ee<I>fbc<I>d0ee0aeab<I>beb<I>d<I>f<I>)
py
diff --git a/docs/extensions/attributetable.py b/docs/extensions/attributetable.py index <HASH>..<HASH> 100644 --- a/docs/extensions/attributetable.py +++ b/docs/extensions/attributetable.py @@ -165,7 +165,7 @@ def process_attributetable(app, doctree, fromdocname): def get_class_results(lookup, modulename, name, fullname): module = importlib.import_module(modulename) - cls_dict = getattr(module, name).__dict__ + cls = getattr(module, name) groups = OrderedDict([ (_('Attributes'), []), @@ -183,7 +183,7 @@ def get_class_results(lookup, modulename, name, fullname): badge = None label = attr - value = cls_dict.get(attr) + value = getattr(cls, attr, None) if value is not None: doc = value.__doc__ or '' if inspect.iscoroutinefunction(value) or doc.startswith('|coro|'):
Fix methods from superclass showing under "Attributes" table
py
diff --git a/pymemcache/__init__.py b/pymemcache/__init__.py index <HASH>..<HASH> 100644 --- a/pymemcache/__init__.py +++ b/pymemcache/__init__.py @@ -3,3 +3,11 @@ __author__ = "Charles Gordon" from pymemcache.client import Client # noqa from pymemcache.client import PooledClient # noqa + +from pymemcache.exceptions import MemcacheError # noqa +from pymemcache.exceptions import MemcacheClientError # noqa +from pymemcache.exceptions import MemcacheUnknownCommandError # noqa +from pymemcache.exceptions import MemcacheIllegalInputError # noqa +from pymemcache.exceptions import MemcacheServerError # noqa +from pymemcache.exceptions import MemcacheUnknownError # noqa +from pymemcache.exceptions import MemcacheUnexpectedCloseError # noqa
Import Classes, Function into package level
py
diff --git a/fsoopify/nodes.py b/fsoopify/nodes.py index <HASH>..<HASH> 100644 --- a/fsoopify/nodes.py +++ b/fsoopify/nodes.py @@ -31,7 +31,7 @@ class NodeType(Enum): dir = 2 -class NodeInfo(os.PathLike): +class NodeInfo(ABC): ''' the abstract base class for file system node. ''' def __init__(self, path):
not sure why but use PathLike has bug
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ from setuptools import setup, find_packages setup(name='babelfish', - version='0.5.5', + version='0.5.6-dev', license='BSD', description='A module to work with countries and languages', long_description=open('README.rst').read() + '\n\n' + open('HISTORY.rst').read(),
Switched to version <I>-dev
py
diff --git a/airflow/jobs.py b/airflow/jobs.py index <HASH>..<HASH> 100644 --- a/airflow/jobs.py +++ b/airflow/jobs.py @@ -761,16 +761,18 @@ class SchedulerJob(BaseJob): self.logger.info("Starting {} scheduler jobs".format(len(jobs))) for j in jobs: j.start() + + while any(j.is_alive() for j in jobs): + while not tis_q.empty(): + ti_key, pickle_id = tis_q.get() + dag = dagbag.dags[ti_key[0]] + task = dag.get_task(ti_key[1]) + ti = TI(task, ti_key[2]) + self.executor.queue_task_instance(ti, pickle_id=pickle_id) + for j in jobs: j.join() - while not tis_q.empty(): - ti_key, pickle_id = tis_q.get() - dag = dagbag.dags[ti_key[0]] - task = dag.get_task(ti_key[1]) - ti = TI(task, ti_key[2]) - self.executor.queue_task_instance(ti, pickle_id=pickle_id) - self.logger.info("Done queuing tasks, calling the executor's " "heartbeat") duration_sec = (datetime.now() - loop_start_dttm).total_seconds()
Fix corner case with joining processes/queues (#<I>) If a process places items in a queue and the process is joined before the queue is emptied, it can lead to a deadlock under some circumstances. Closes AIRFLOW-<I>. See for example: <URL> <URL>
py
diff --git a/pypercube/expression.py b/pypercube/expression.py index <HASH>..<HASH> 100644 --- a/pypercube/expression.py +++ b/pypercube/expression.py @@ -220,6 +220,30 @@ class MetricExpression(object): """ return CompoundMetricExpression(self).__truediv__(right) + def __eq__(self, other): + """ + >>> e1 = EventExpression('request') + >>> e2 = EventExpression('other') + >>> m1 = MetricExpression('sum', e1) + >>> m2 = MetricExpression('sum', e1) + >>> m1 == m2 + True + >>> m2 = MetricExpression('sum', e2) + >>> m1 == m2 + False + >>> m1 = MetricExpression('sum', e2) + >>> m1 == m2 + True + >>> m1 = MetricExpression('min', e2) + >>> m1 == m2 + False + >>> m2 = MetricExpression('min', e2) + >>> m1 == m2 + True + """ + return self.metric_type == other.metric_type and \ + self.event_expression == other.event_expression + class Sum(MetricExpression): """A "sum" metric."""
Implement __eq__ for MetricExpression
py
diff --git a/libraries/botframework-connector/setup.py b/libraries/botframework-connector/setup.py index <HASH>..<HASH> 100644 --- a/libraries/botframework-connector/setup.py +++ b/libraries/botframework-connector/setup.py @@ -12,7 +12,7 @@ REQUIRES = [ "PyJWT==1.5.3", "botbuilder-schema==4.12.0", "adal==1.2.1", - "msal==1.2.0", + "msal==1.6.0", ] root = os.path.abspath(os.path.dirname(__file__))
Updating msal dependency (#<I>)
py
diff --git a/salt/master.py b/salt/master.py index <HASH>..<HASH> 100644 --- a/salt/master.py +++ b/salt/master.py @@ -1778,10 +1778,9 @@ class ClearFuncs(object): break except KeyError: pass - finally: - if '*' not in eauth_users and token['name'] not in eauth_users and not group_auth_match: - log.warning('Authentication failure of type "token" occurred.') - return '' + if '*' not in eauth_users and token['name'] not in eauth_users and not group_auth_match: + log.warning('Authentication failure of type "token" occurred.') + return '' # Compile list of authorized actions for the user auth_list = []
fix pylint error (unnecessary 'finally' clause may swallow exceptions unintentionally)
py
diff --git a/mutagen/id3.py b/mutagen/id3.py index <HASH>..<HASH> 100644 --- a/mutagen/id3.py +++ b/mutagen/id3.py @@ -95,9 +95,11 @@ class ID3(mutagen.Metadata): try: self.load_header() except EOFError: + self._size = 0 raise ID3NoHeaderError("%s: too small (%d bytes)" %( filename, self.__filesize)) except (ID3NoHeaderError, ID3UnsupportedVersionError), err: + self._size = 0 import sys stack = sys.exc_info()[2] try: self.__fileobj.seek(-128, 2)
ID3#load: Reset size to 0 if no valid ID3v2 tag is found.
py
diff --git a/simplecaptcha/widgets.py b/simplecaptcha/widgets.py index <HASH>..<HASH> 100644 --- a/simplecaptcha/widgets.py +++ b/simplecaptcha/widgets.py @@ -1,5 +1,6 @@ import random import time +import math from django import forms @@ -83,6 +84,10 @@ class CaptchaWidget(forms.widgets.MultiWidget): x, y = y, x answer = x - y else: + # Multiplication is hard, make it easier + x = math.ceil(x/2) + y = math.ceil(y/2) + answer = x * y # Use a prettied-up HTML multiplication character operator = '&times;'
Make multiplication catpchas easier We simply halve (rounding up) x and y when we happen to choose a multiplication-based captcha question. This makes it easier to quickly figure out the answer, but without significantly impacting the security.
py
diff --git a/animal/models.py b/animal/models.py index <HASH>..<HASH> 100644 --- a/animal/models.py +++ b/animal/models.py @@ -37,6 +37,7 @@ GENOTYPE_CHOICES = ( ), ('Floxed with Transgene',( ('fl/fl; ?', 'Floxed Undetermined Transgene'), + ('fl/+; ?', 'Heterozygous Floxed, Undetermined Transgene'), ('fl/fl; +/+', 'Floxed no Transgene'), ('fl/+; +/+', 'Heterozygous Floxed no Transgene'), ('fl/fl; Tg/+', 'Floxed Heterozygous Transgene'),
added a fl/+, ? genotype
py
diff --git a/examples/get_annotations.py b/examples/get_annotations.py index <HASH>..<HASH> 100644 --- a/examples/get_annotations.py +++ b/examples/get_annotations.py @@ -56,6 +56,11 @@ if __name__ == '__main__': annotations.fetch() print(annotations) + f= open("annotations.csv","w+") + f.write("ID;Image;Project;Term;User;Area;Perimeter;WKT \n") + for annotation in annotations: + f.write("{};{};{};{};{};{};{};{}\n".format(annotation.id,annotation.image,annotation.project,annotation.term,annotation.user,annotation.area,annotation.perimeter,annotation.location)) + for annotation in annotations: print("ID: {} | Image: {} | Project: {} | Term: {} | User: {} | Area: {} | Perimeter: {} | WKT: {}".format( annotation.id,
Add export of annotation data to CSV before fetching PNG crops and masks
py
diff --git a/clients/python/girder_client/__init__.py b/clients/python/girder_client/__init__.py index <HASH>..<HASH> 100644 --- a/clients/python/girder_client/__init__.py +++ b/clients/python/girder_client/__init__.py @@ -323,7 +323,7 @@ class GirderClient(object): resp = self.post('api_key/token', parameters={ 'key': apiKey }) - self.token = resp['authToken']['token'] + self.setToken(resp['authToken']['token']) else: if interactive: if username is None: @@ -343,7 +343,16 @@ class GirderClient(object): if 'authToken' not in resp: raise AuthenticationError() - self.token = resp['authToken']['token'] + self.setToken(resp['authToken']['token']) + + def setToken(self, token): + """ + Set a token on the GirderClient instance. This is useful in the case + where the client has already been given a valid token, such as a remote job. + + :param token: A string containing the existing Girder token + """ + self.token = token def getServerVersion(self, useCached=True): """
Add a method for setting a token on a GirderClient instance The intention here is to create an official method for setting a token on a GirderClient which was retrieved from some outside source, such as a remote job. Prior to this, it was assumed that the token would be acquired passing credentials to the constructor itself.
py
diff --git a/salt/utils/parsers.py b/salt/utils/parsers.py index <HASH>..<HASH> 100644 --- a/salt/utils/parsers.py +++ b/salt/utils/parsers.py @@ -1568,12 +1568,6 @@ class SaltSSHOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn, default='', help='Set the default password to attempt to use when ' 'authenticating') - self.add_option( - '--always-deply-key', - dest='ssh_deploy_key', - default=False, - help='Always deploy the ssh keys when authentecating via password' - ) def _mixin_after_parsed(self): if self.options.list:
This will take a little more work...
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,13 @@ else: ext = '.pyx' class build_ext(_build_ext): + # see http://stackoverflow.com/q/19919905 for explanation + def finalize_options(self): + _build_ext.finalize_options(self) + __builtins__.__NUMPY_SETUP__ = False + import numpy as np + self.include_dirs.append(np.get_include()) + # if optional extension modules fail to build, keep going anyway def run(self): try:
still need fix from <URL>
py
diff --git a/gpflow/training/natgrad_optimizer.py b/gpflow/training/natgrad_optimizer.py index <HASH>..<HASH> 100644 --- a/gpflow/training/natgrad_optimizer.py +++ b/gpflow/training/natgrad_optimizer.py @@ -95,7 +95,7 @@ class NatGradOptimizer(optimizer.Optimizer): q_mu, q_sqrt = arg[:2] xi_transform = arg[2] if len(arg) > 2 else XiNat() ops.append(self._build_natgrad_step_op(q_mu, q_sqrt, xi_transform)) - ops = list(sum(ops, [])) + ops = list(sum(ops, ())) return tf.group(ops) def _build_natgrad_step_op(self, q_mu_param, q_sqrt_param, xi_transform):
reverted to tuple
py
diff --git a/deployutils/mixins.py b/deployutils/mixins.py index <HASH>..<HASH> 100644 --- a/deployutils/mixins.py +++ b/deployutils/mixins.py @@ -122,7 +122,7 @@ class AccountMixin(object): def get_context_data(self, *args, **kwargs): context = super(AccountMixin, self).get_context_data(*args, **kwargs) - context.update({'account': self.account}) + context.update({self.account_url_kwarg: self.account}) return context def get_url_kwargs(self):
uses account_url_kwarg as key
py
diff --git a/web/web.py b/web/web.py index <HASH>..<HASH> 100644 --- a/web/web.py +++ b/web/web.py @@ -358,8 +358,8 @@ class HTTPResponse(object): except: #Catch the most general errors and tell the client with the least likelihood of throwing another exception status = 500 - status_msg = status_messages[500] - response = ('500 - ' + status_messages[500] + '\n').encode(default_encoding) + status_msg = status_messages[status] + response = (str(status) + ' - ' + status_msg + '\n').encode(default_encoding) self.headers.clear() self.headers.set('Content-Length', str(len(response)))
Change how the general <I> is generated
py
diff --git a/virtualchain/virtualchain.py b/virtualchain/virtualchain.py index <HASH>..<HASH> 100644 --- a/virtualchain/virtualchain.py +++ b/virtualchain/virtualchain.py @@ -167,6 +167,26 @@ def setup_virtualchain(impl_module, testset=False, bitcoind_connection_factory=s connect_bitcoind = bitcoind_connection_factory +def virtualchain_set_opfields( op, **fields ): + """ + Pass along virtualchain-reserved fields to a virtualchain operation. + This layer of indirection is meant to help with future compatibility, + so virtualchain implementations do not try to set operation fields + directly. + """ + + # warn about unsupported fields + for f in fields.keys(): + if f not in indexer.RESERVED_KEYS: + log.warning("Unsupported virtualchain field '%s'" % f) + + # propagate reserved fields + for f in fields.keys(): + if f in indexer.RESERVED_KEYS: + op[f] = fields[f] + + return op + if __name__ == '__main__': import impl_ref
Add a method for inserting virtualchain-specific operation fields. This is useful for both testing, and for reconstructing and replaying virtualchain operations.
py
diff --git a/dice/elements.py b/dice/elements.py index <HASH>..<HASH> 100644 --- a/dice/elements.py +++ b/dice/elements.py @@ -164,7 +164,7 @@ class Sort(Operator): class Drop(Operator): def function(self, iterable, n): - for die in sorted(iterable)[:n]: + for die in sorted(iterable)[n:]: iterable.remove(die) return iterable
Fix drop (v) operator So as to keep, instead of remove, the first n sorted values
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -67,6 +67,7 @@ setup( 'wheel', 'bumpversion', 'gitchangelog', + 'twine', ], }, entry_points={
Add dev dependency on twine.
py
diff --git a/paperweight/texutils.py b/paperweight/texutils.py index <HASH>..<HASH> 100755 --- a/paperweight/texutils.py +++ b/paperweight/texutils.py @@ -156,7 +156,9 @@ def inline(root_text, included_text = inline(included_text, base_dir=base_dir) return included_text - result = input_pattern.sub(_sub_line, root_text) + # Text processing pipline + result = remove_comments(root_text) + result = input_pattern.sub(_sub_line, result) result = include_pattern.sub(_sub_line, result) result = input_ifexists_pattern.sub(_sub_line_ifexists, result) return result @@ -236,7 +238,9 @@ def inline_blob(commit_ref, root_text, base_dir='.', repo_dir=""): repo_dir=repo_dir) return included_text - result = input_pattern.sub(_sub_blob, root_text) + # Text processing pipline + result = remove_comments(root_text) + result = input_pattern.sub(_sub_blob, result) result = include_pattern.sub(_sub_blob, result) result = input_ifexists_pattern.sub(_sub_blob_ifexists, result) return result
inline and inline_blob strip comments This is necessary to prevent commented-out input or include statements from being included.
py
diff --git a/endpoints_management/__init__.py b/endpoints_management/__init__.py index <HASH>..<HASH> 100644 --- a/endpoints_management/__init__.py +++ b/endpoints_management/__init__.py @@ -18,7 +18,7 @@ import logging from . import auth, config, control, gen -__version__ = '1.10.0' +__version__ = '1.11.0' _logger = logging.getLogger(__name__) _logger.setLevel(logging.INFO)
Bump minor version (<I> -> <I>) (#<I>) Rationale: Retry service config fetching if failed
py
diff --git a/digitalocean/Manager.py b/digitalocean/Manager.py index <HASH>..<HASH> 100644 --- a/digitalocean/Manager.py +++ b/digitalocean/Manager.py @@ -152,3 +152,6 @@ class Manager(BaseAPI): ssh_key.token = self.token ssh_keys.append(ssh_key) return ssh_keys + + def __str__(self): + return "%s" % (self.token) \ No newline at end of file
Should the manager return the token when used as string (?)
py
diff --git a/pyes/es.py b/pyes/es.py index <HASH>..<HASH> 100644 --- a/pyes/es.py +++ b/pyes/es.py @@ -1137,7 +1137,7 @@ class ES(object): if query is None: query = MatchAllQuery() - body = self._encode_query(query) + body = self._encode_query({"query":query}) path = self._make_path(indices, doc_types, "_count") return self._send_request('GET', path, body, params=query_params)
Added missing query wrapper in count. Closes #<I>
py
diff --git a/stump/stump.py b/stump/stump.py index <HASH>..<HASH> 100755 --- a/stump/stump.py +++ b/stump/stump.py @@ -187,8 +187,14 @@ def _stump(f, *args, **kwargs): try: ret = f(*xs, **kws) except Exception as e: - LOGGER.log(level, '%s...threw exception %s with message %s', - report, type(e).__name__, str(e)) + try: + with_message = ' with message %s' % str(e) + if str(e) == '': + raise Exception() # use default value + except: + with_message = '' + LOGGER.log(level, '%s...threw exception %s%s', + report, type(e).__name__, with_message) raise if not pre: if print_return:
message of exception is omitted when empty
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,9 @@ extras_require = { install_requires = [ 'pythonnet ; sys_platform == "win32"', - 'pyobjc ; sys_platform == "darwin"', + 'pyobjc-core ; sys_platform == "darwin"', + 'pyobjc-framework-Cocoa ; sys_platform == "darwin"', + 'pyobjc-framework-WebKit ; sys_platform == "darwin"', 'PyQt5 ; sys_platform == "openbsd6"', 'importlib_resources; python_version < "3.7"', ]
Only install the specific `pyobjc` packages required.
py
diff --git a/remoto/__init__.py b/remoto/__init__.py index <HASH>..<HASH> 100644 --- a/remoto/__init__.py +++ b/remoto/__init__.py @@ -4,4 +4,4 @@ from . import process from . import connection -__version__ = '0.0.29' +__version__ = '0.0.30'
bump the version to <I>
py
diff --git a/iribaker/__init__.py b/iribaker/__init__.py index <HASH>..<HASH> 100644 --- a/iribaker/__init__.py +++ b/iribaker/__init__.py @@ -51,8 +51,10 @@ def to_iri(iri): # Replace the invalid characters with an underscore (no need to roundtrip) quoted_parts['path'] = no_invalid_characters.sub(u'_', parts.path) - quoted_parts['fragment'] = no_invalid_characters.sub(u'_', parts.fragment) - quoted_parts['query'] = urllib.quote(parts.query.encode('utf-8')) + if parts.fragment: + quoted_parts['fragment'] = no_invalid_characters.sub(u'_', parts.fragment) + if parts.query: + quoted_parts['query'] = urllib.quote(parts.query.encode('utf-8')) # Leave these untouched quoted_parts['scheme'] = parts.scheme quoted_parts['authority'] = parts.netloc
Fixed issue where # and ? were appended to IRIs
py
diff --git a/pythonforandroid/recipes/sdl2_image/__init__.py b/pythonforandroid/recipes/sdl2_image/__init__.py index <HASH>..<HASH> 100644 --- a/pythonforandroid/recipes/sdl2_image/__init__.py +++ b/pythonforandroid/recipes/sdl2_image/__init__.py @@ -14,7 +14,8 @@ class LibSDL2Image(NDKRecipe): info('SDL2_image already patched, skipping') return self.apply_patch('disable_webp.patch', arch.arch) - self.apply_patch('disable_jpg.patch', arch.arch) + if arch.arch == 'x86': + self.apply_patch('disable_jpg.patch', arch.arch) shprint(sh.touch, join(build_dir, '.patched')) recipe = LibSDL2Image()
Made jpg disable only occur with x<I> build
py
diff --git a/example_project/example_project/views.py b/example_project/example_project/views.py index <HASH>..<HASH> 100644 --- a/example_project/example_project/views.py +++ b/example_project/example_project/views.py @@ -1,5 +1,5 @@ from django.core.urlresolvers import reverse -from django.forms.util import ErrorList +from django.forms.utils import ErrorList from django.forms.forms import NON_FIELD_ERRORS from django.http import HttpResponse from django.http import HttpResponseRedirect
Make tests pass under Django <I>
py
diff --git a/src/sos/sos_step.py b/src/sos/sos_step.py index <HASH>..<HASH> 100755 --- a/src/sos/sos_step.py +++ b/src/sos/sos_step.py @@ -255,18 +255,19 @@ class TaskManager(threading.Thread): def __init__(self, trunk_size, trunk_workers, host, pipe): super(TaskManager, self).__init__() self.lock = threading.Lock() - self._task_defs = [] self.trunk_size = trunk_size self.trunk_workers = trunk_workers - self._all_output = [] - self._ids = [] self._host = host self._pipe = pipe + self._all_output = [] + self._ids = [] + self._task_defs = [] def append(self, task_def): self.lock.acquire() try: self._task_defs.append(task_def) + env.logger.warning('add {}') if isinstance(task_def[2], Sequence): self._all_output.extend(task_def[2]) finally:
Rewrite task list as a task manager.
py
diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urldispatcher.py index <HASH>..<HASH> 100644 --- a/aiohttp/web_urldispatcher.py +++ b/aiohttp/web_urldispatcher.py @@ -273,6 +273,8 @@ class Resource(AbstractResource): else: return None, allowed_methods + yield # pragma: no cover + def __len__(self): return len(self._routes) @@ -441,6 +443,7 @@ class StaticResource(PrefixResource): match_dict = {'filename': unquote(path[self._prefix_len:])} return (UrlMappingMatchInfo(match_dict, self._routes[method]), allowed_methods) + yield # pragma: no cover def __len__(self): return len(self._routes)
Make methods a true coroutines in time critical paths
py
diff --git a/worker/buildbot_worker/null.py b/worker/buildbot_worker/null.py index <HASH>..<HASH> 100644 --- a/worker/buildbot_worker/null.py +++ b/worker/buildbot_worker/null.py @@ -36,8 +36,5 @@ class LocalWorker(WorkerBase): res = yield master.workers.newConnection(conn, self.name) if res: yield self.parent.attached(conn) - - @defer.inlineCallbacks - def stopService(self): - yield self.parent.detached() - yield WorkerBase.stopService(self) + # detached() will be called automatically on connection disconnection which is + # invoked from the master side when the AbstarctWorker.stopService() is called.
worker: Do not call detached() from LocalWorker This is handled automatically by the master-side AbstractWorker shutdown. AbstractWorker.stopService() -> disconnect() -> _disconnect() -> ull.Connection.loseConnection() -> notifyDisconnected() -> AbstractWorker.detached()
py
diff --git a/pyfolio/utils.py b/pyfolio/utils.py index <HASH>..<HASH> 100644 --- a/pyfolio/utils.py +++ b/pyfolio/utils.py @@ -15,7 +15,7 @@ from __future__ import division from datetime import datetime -from os import mkdir +from os import mkdir, environ from os.path import expanduser, join, getmtime import warnings @@ -44,11 +44,22 @@ ANNUALIZATION_FACTORS = { MONTHLY: MONTHS_PER_YEAR } -cache_dir = expanduser('~/.cache/pyfolio/') + +def cache_dir(environ=environ): + try: + return environ['PYFOLIO_CACHE_DIR'] + except KeyError: + return join( + environ.get( + 'XDG_CACHE_HOME', + expanduser('~/.cache/'), + ), + 'pyfolio', + ) def data_path(name): - return join(cache_dir, name) + return join(cache_dir(), name) def one_dec_places(x, pos):
ENH: Allow envvars to set cache dir
py
diff --git a/vstutils/models.py b/vstutils/models.py index <HASH>..<HASH> 100644 --- a/vstutils/models.py +++ b/vstutils/models.py @@ -10,7 +10,9 @@ from .utils import Paginator def is_class_method_or_function(obj): - return inspect.isfunction(obj) or inspect.ismethod(obj) + return inspect.isfunction(obj) or \ + inspect.ismethod(obj) or \ + isinstance(obj, type(is_class_method_or_function)) class BQuerySet(models.QuerySet):
Fix cythonized function inspection to model managers.
py
diff --git a/upnpclient/upnp.py b/upnpclient/upnp.py index <HASH>..<HASH> 100644 --- a/upnpclient/upnp.py +++ b/upnpclient/upnp.py @@ -114,7 +114,7 @@ class Device(CallActionMixin): resp.raise_for_status() root = etree.fromstring(resp.content) - findtext = partial(root.findtext, namespaces=root.nsmap) + findtext = partial(root.findtext, namespaces=root.nsmap, default="") self.device_type = findtext("device/deviceType").strip() self.friendly_name = findtext("device/friendlyName").strip() @@ -127,7 +127,7 @@ class Device(CallActionMixin): self.udn = findtext("device/UDN").strip() self._url_base = findtext("URLBase").strip() - if self._url_base is None or ignore_urlbase: + if self._url_base == "" or ignore_urlbase: # If no URL Base is given, the UPnP specification says: "the base # URL is the URL from which the device description was retrieved" self._url_base = self.location
Fix error because of stripping from None
py
diff --git a/graphite_api/app.py b/graphite_api/app.py index <HASH>..<HASH> 100644 --- a/graphite_api/app.py +++ b/graphite_api/app.py @@ -187,7 +187,6 @@ def prune_datapoints(series, max_datapoints, start, end): ) series.start += nudge values_to_lose = nudge // series.step - print(values_to_lose) del series[:values_to_lose-1] series.consolidate(values_per_point) step = seconds_per_point @@ -231,7 +230,7 @@ def render(): if 'maxDataPoints' in RequestParams: try: request_options['maxDataPoints'] = int( - RequestParams['maxDataPoints']) + float(RequestParams['maxDataPoints'])) except ValueError: errors['maxDataPoints'] = 'Must be an integer.'
Cast maxDataPoints to float then int
py
diff --git a/badgify/management/commands/badgify_sync.py b/badgify/management/commands/badgify_sync.py index <HASH>..<HASH> 100644 --- a/badgify/management/commands/badgify_sync.py +++ b/badgify/management/commands/badgify_sync.py @@ -25,7 +25,10 @@ class Command(BaseCommand): make_option('--batch-size', action='store', dest='batch_size', - type='int'),) + type='int'), + make_option('--badge', + action='store', + dest='badge')) def handle(self, *args, **options): if not len(args):
Add --badge option to badgify_sync command.
py
diff --git a/src/hypercorn/__about__.py b/src/hypercorn/__about__.py index <HASH>..<HASH> 100644 --- a/src/hypercorn/__about__.py +++ b/src/hypercorn/__about__.py @@ -1 +1 @@ -__version__ = "0.9.5" +__version__ = "0.9.5+dev"
Following the release of <I> bump to +dev
py
diff --git a/scvelo/tools/dynamical_model.py b/scvelo/tools/dynamical_model.py index <HASH>..<HASH> 100644 --- a/scvelo/tools/dynamical_model.py +++ b/scvelo/tools/dynamical_model.py @@ -372,8 +372,10 @@ def recover_dynamics( --------- data: :class:`~anndata.AnnData` Annotated data matrix. - var_names: `str`, list of `str` (default: `'velocity_genes`) - Names of variables/genes to use for the fitting. + var_names: `str`, list of `str` (default: `'velocity_genes'`) + Names of variables/genes to use for the fitting. If `var_names='velocity_genes'` + but there is no column `'velocity_genes'` in `adata.var`, velocity genes are + estimated using the steady state model. n_top_genes: `int` or `None` (default: `None`) Number of top velocity genes to use for the dynamical model. max_iter:`int` (default: `10`)
Update `recover_dynamics` docs (#<I>) * Fix typo * Update description of `var_names` Clarifies how velocity genes are estimated if not yet given as a column in `adata.var`.
py
diff --git a/src/foremast/utils/gate.py b/src/foremast/utils/gate.py index <HASH>..<HASH> 100644 --- a/src/foremast/utils/gate.py +++ b/src/foremast/utils/gate.py @@ -34,10 +34,7 @@ def gate_request(method='GET', uri=None, headers=None, data=None, params=None): url = '{host}{uri}'.format(host=API_URL, uri=uri) - if OAUTH_ENABLED: - headers['Bearer'] = "" - raise NotImplementedError - + method = method.upper() if method == 'GET': response = requests.get(url, params=params, headers=headers, verify=GATE_CA_BUNDLE, cert=GATE_CLIENT_CERT) elif method == 'POST':
Updated to remove unimplemented feature and upper the method
py