diff
stringlengths
139
3.65k
message
stringlengths
8
627
diff_languages
stringclasses
1 value
diff --git a/tofu/geom/_comp.py b/tofu/geom/_comp.py index <HASH>..<HASH> 100644 --- a/tofu/geom/_comp.py +++ b/tofu/geom/_comp.py @@ -419,7 +419,6 @@ def _Ves_get_sampleV( num_threads=num_threads, ) else: - print("~~~~~~CALLING OLD ALGO~~~~~~~") (Pts, dV, ind, dVr[0], dVr[1], dVr[2]) = _GG._Ves_Vmesh_Tor_SubFromD_cython_old( dV[0], @@ -468,7 +467,6 @@ def _Ves_get_sampleV( num_threads=num_threads, ) else: - print("~~~~~~CALLING OLD ALGO~~~~~~~") Pts, dV, dVr[0], dVr[1], dVr[ 2 ] = _GG._Ves_Vmesh_Tor_SubFromInd_cython_old(
[vmesh] took out useless print
py
diff --git a/wfdb/io/annotation.py b/wfdb/io/annotation.py index <HASH>..<HASH> 100644 --- a/wfdb/io/annotation.py +++ b/wfdb/io/annotation.py @@ -1748,8 +1748,8 @@ def load_byte_pairs(record_name, extension, pn_dir): Returns ------- - filebytes : str - The input filestream converted to bytes. + filebytes : ndarray + The input filestream converted to an Nx2 array of unsigned bytes. """ # local file @@ -1769,8 +1769,8 @@ def proc_ann_bytes(filebytes, sampto): Parameters ---------- - filebytes : str - The input filestream converted to bytes. + filebytes : ndarray + The input filestream converted to an Nx2 array of unsigned bytes. sampto : int The maximum sample number for annotations to be returned. @@ -1852,8 +1852,8 @@ def proc_core_fields(filebytes, bpi): Parameters ---------- - filebytes : str - The input filestream converted to bytes. + filebytes : ndarray + The input filestream converted to an Nx2 array of unsigned bytes. bpi : int The index to start the conversion.
Fix documentation of the internal variable 'filebytes'. This variable contains the complete contents of the input annotation file, as a numpy array of pairs of bytes (shape=(N,2), dtype='uint8'). It is neither a str nor a bytes object.
py
diff --git a/claripy/backends/backend_z3.py b/claripy/backends/backend_z3.py index <HASH>..<HASH> 100644 --- a/claripy/backends/backend_z3.py +++ b/claripy/backends/backend_z3.py @@ -304,12 +304,13 @@ class BackendZ3(Backend): if isinstance(expr_raw, z3.BoolRef): tactics = z3.Then(z3.Tactic("simplify"), z3.Tactic("propagate-ineqs"), z3.Tactic("propagate-values"), z3.Tactic("unit-subsume-simplify")) s = tactics(expr_raw).as_expr() + n = s.decl().name() - if s.sexpr() == 'true': + if n == 'true': s = True symbolic = False variables = set() - elif s.sexpr() == 'false': + elif n == 'false': s = False symbolic = False variables = set()
faster way of identifying concrete z3 bools
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,14 @@ from setuptools import setup, find_packages +import re + +# Parse version number from creamas/__init__.py to keep it in one place. +__version__ = re.search( + r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', + open('creamas/__init__.py').read()).group(1) setup( name='creamas', - version='0.2.1', + version=__version__, author='Simo Linkola', author_email='simo.linkola at gmail.com', description=('A library for creative MAS build on top of aiomas.'),
Added version number parsing from creamas/__init__.py to setup.py to keep the version number in only one place.
py
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index <HASH>..<HASH> 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -124,7 +124,7 @@ class TestEasyInstallTest: site.getsitepackages. """ mock_gsp = lambda: ['/setuptools/test/site-packages'] - monkeypatch.setattr(site, 'getsitepackages', mock_gsp) + monkeypatch.setattr(site, 'getsitepackages', mock_gsp, raising=False) assert '/setuptools/test/site-packages' in ei.get_site_dirs() def test_all_site_dirs_works_without_getsitepackages(self, monkeypatch):
getsitepackages may not be present
py
diff --git a/pysat/instruments/pysat_testmodel.py b/pysat/instruments/pysat_testmodel.py index <HASH>..<HASH> 100644 --- a/pysat/instruments/pysat_testmodel.py +++ b/pysat/instruments/pysat_testmodel.py @@ -80,8 +80,8 @@ def load(fnames, tag=None, sat_id=None): for i, ut in enumerate(uts): for j, long in enumerate(longitude): slt[i, j] = np.mod(ut / 3600.0 + long / 15.0, 24.0) - data['slt'] = (('time', 'longtiude'), slt) - data['mlt'] = (('time', 'longtiude'), np.mod(slt+0.2, 24.0)) + data['slt'] = (('time', 'longitude'), slt) + data['mlt'] = (('time', 'longitude'), np.mod(slt+0.2, 24.0)) # Fake 3D data consisting of values between 0 and 21 everywhere dummy1 = np.mod(data['uts'] * data['latitude'] * data['longitude'], 21.0)
BUG: testmodel coordinate name Coordinate name for two of the data variables misspelled.
py
diff --git a/holoviews/core/operation.py b/holoviews/core/operation.py index <HASH>..<HASH> 100644 --- a/holoviews/core/operation.py +++ b/holoviews/core/operation.py @@ -180,6 +180,11 @@ class OperationCallable(Callable): operation = param.ClassSelector(class_=ElementOperation, doc=""" The ElementOperation being wrapped.""") + def __init__(self, callable, **kwargs): + if 'operation' not in kwargs: + raise ValueError('An OperationCallable must have an operation specified') + super(OperationCallable, self).__init__(callable, **kwargs) + class MapOperation(param.ParameterizedFunction): """
Added check to ensure OperationCallable always has an operation
py
diff --git a/src/hcl/parser.py b/src/hcl/parser.py index <HASH>..<HASH> 100644 --- a/src/hcl/parser.py +++ b/src/hcl/parser.py @@ -27,12 +27,16 @@ if sys.version_info[0] < 3: def iteritems(d): return iter(d.iteritems()) + string_types = (str, unicode) + else: def iteritems(d): return iter(d.items()) + string_types = (str, bytes) + class HclParser(object): @@ -389,9 +393,13 @@ class HclParser(object): return ",".join(self.flatten(v) for v in value) if isinstance(value, tuple): return " ".join(self.flatten(v) for v in value) - if isinstance(value, str): - if value.isnumeric(): # return numbers as is - return value + if isinstance(value, string_types): + if sys.version_info[0] < 3: + if value.isdigit(): # python2 support, return numbers as is + return value + else: + if value.isnumeric(): # return numbers as is + return value return ( '"' + value + '"' # wrap string literals in double quotes if value not in ['+', '-'] and '.' not in value
fix for python2 tests
py
diff --git a/assess_win_client.py b/assess_win_client.py index <HASH>..<HASH> 100755 --- a/assess_win_client.py +++ b/assess_win_client.py @@ -34,7 +34,7 @@ def win_test(script_dir, address, juju_home, revision_build): ci = [os.path.join(script_dir, f) for f in [ 'deploy_stack.py', 'deploy_job.py', 'jujupy.py', 'jujuconfig.py', 'remote.py', 'substrate.py', 'utility.py', 'get_ami.py', 'chaos.py', - 'timeout.py', 'jujucharm.py', + 'timeout.py', 'jujucharm.py', 'tests/test_jujupy.py', ]] ci.extend([install_file, 'run-file']) with open('foo.yaml', 'w') as config:
Added missing dep for win deploy tests.
py
diff --git a/parker/consumepage.py b/parker/consumepage.py index <HASH>..<HASH> 100644 --- a/parker/consumepage.py +++ b/parker/consumepage.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ConsumePage object for Parker.""" -from parsedpage import ParsedPage - _instances = dict()
Remove the redundant import of ParsedPage in ConsumePage.
py
diff --git a/salt/renderers/gpg.py b/salt/renderers/gpg.py index <HASH>..<HASH> 100644 --- a/salt/renderers/gpg.py +++ b/salt/renderers/gpg.py @@ -41,7 +41,7 @@ To generate a cipher from a secret: .. code-block:: bash - $ echo -n "supersecret" | gpg --homedir --armor --encrypt -r <KEY-name> + $ echo -n "supersecret" | gpg --homedir ~/.gnupg --armor --encrypt -r <KEY-name> Set up the renderer on your master by adding something like this line to your config:
Added the default directory that gpg imports to
py
diff --git a/test_joyent.py b/test_joyent.py index <HASH>..<HASH> 100644 --- a/test_joyent.py +++ b/test_joyent.py @@ -82,7 +82,7 @@ class ClientTestCase(TestCase): with patch.object(client, 'request_deletion', autospec=True) as rd_mock: client.delete_old_machines(1, 'foo@bar') - lm_mock.assert_call_any(None) + lm_mock.assert_any_call(None) lm_mock.assert_call_any('id') lmt_mock.assert_called_once_with('id') drm_mock.assert_called_once_with('id')
Updated method name to assert_any_call.
py
diff --git a/popbill/faxService.py b/popbill/faxService.py index <HASH>..<HASH> 100644 --- a/popbill/faxService.py +++ b/popbill/faxService.py @@ -7,7 +7,7 @@ # Author : Kim Seongjun (pallet027@gmail.com) # Written : 2015-01-21 # Contributor : Jeong Yohan (code@linkhub.co.kr) -# Updated : 2018-08-09 +# Updated : 2021-04-22 # Thanks for your interest. from datetime import datetime from .base import PopbillBase, PopbillException, File
fixed fax comment(Updated)
py
diff --git a/__main__.py b/__main__.py index <HASH>..<HASH> 100644 --- a/__main__.py +++ b/__main__.py @@ -16,11 +16,13 @@ def configure_path(): while not templar.startswith(cwd): paths.append(cwd) cwd = os.path.dirname(cwd) - paths.append(cwd) - import config - for i in range(len(paths)): - sys.path.insert(0, paths[-i-1]) - imp.reload(config) + root = cwd + paths.append(root) + sys.path.insert(0, root) + for path in paths: + path = path.replace(root, '').replace('/', '.') + '.config' + path = path.strip('.') + config = importlib.import_module(path) extract_configs(config, configs) return configs
Fix path configuration to work with python<I>
py
diff --git a/holoviews/core/util.py b/holoviews/core/util.py index <HASH>..<HASH> 100644 --- a/holoviews/core/util.py +++ b/holoviews/core/util.py @@ -490,7 +490,7 @@ def callable_name(callable_obj): if sys.version_info < (3,0): owner = meth.im_class if meth.im_self is None else meth.im_self else: - owner = meth.__self__ + return meth.__func__.__qualname__.replace('__call__', '') if meth.__name__ == '__call__': return type(owner).__name__ return '.'.join([owner.__name__, meth.__name__]) @@ -498,7 +498,7 @@ def callable_name(callable_obj): return callable_obj.__name__ else: return type(callable_obj).__name__ - except: + except Exception: return str(callable_obj)
Avoid using Parameterized repr in callable_name (#<I>) * Avoid using Parameterized repr in callable_name * Small fix
py
diff --git a/pydriller/repository_mining.py b/pydriller/repository_mining.py index <HASH>..<HASH> 100644 --- a/pydriller/repository_mining.py +++ b/pydriller/repository_mining.py @@ -12,16 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -import atexit import logging import os -import shutil import tempfile from datetime import datetime from typing import List, Generator, Union import pytz as pytz -from git import Repo, GitCommandError +from git import Repo from pydriller.domain.commit import Commit from pydriller.git_repository import GitRepository @@ -119,7 +117,7 @@ class RepositoryMining: repo_folder = os.path.join(tmp_folder, self._get_repo_name_from_url(repo)) logger.info("Cloning {} in temporary folder {}".format(repo, repo_folder)) Repo.clone_from(url=repo, to_path=repo_folder) - + return repo_folder def traverse_commits(self) -> Generator[Commit, None, None]:
small refactor in repository_mining
py
diff --git a/datatableview/utils.py b/datatableview/utils.py index <HASH>..<HASH> 100644 --- a/datatableview/utils.py +++ b/datatableview/utils.py @@ -1,6 +1,6 @@ # -*- encoding: utf-8 -*- -from collections import namedtuple +from collections import defaultdict, namedtuple try: from functools import reduce except ImportError: @@ -55,7 +55,8 @@ OPTION_NAME_MAP = { # Mapping of Django field categories to the set of field classes falling into that category. # This is used during field searches to know which ORM language queries can be applied to a field, # such as "__icontains" or "__year". -FIELD_TYPES = { +FIELD_TYPES = defaultdict(list) +FIELD_TYPES.update({ 'text': [models.CharField, models.TextField, models.FileField], 'date': [models.DateField], 'boolean': [models.BooleanField, models.NullBooleanField], @@ -65,7 +66,7 @@ FIELD_TYPES = { # This is a special type for fields that should be passed up, since there is no intuitive # meaning for searches done agains the FK field directly. 'ignored': [models.ForeignKey], -} +}) if hasattr(models, 'GenericIPAddressField'): FIELD_TYPES['text'].append(models.GenericIPAddressField)
Change FIELD_TYPES to a defaultdict Part of the partial merge from @davidfischer-ch
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup( name='plucky', - version='0.3.3', + version='0.3.4', description='Plucking (deep) keys/paths safely from python collections has never been easier.', long_description=open('README.rst').read(), author='Radomir Stevanovic',
bumped to <I>
py
diff --git a/wpull/testing/badapp.py b/wpull/testing/badapp.py index <HASH>..<HASH> 100644 --- a/wpull/testing/badapp.py +++ b/wpull/testing/badapp.py @@ -188,7 +188,7 @@ class BadAppTestCase(AsyncTestCase): self.http_server.start() self._port = self.http_server.port self.connection = Connection('localhost', self._port, - connect_timeout=2.0, read_timeout=2.0) + connect_timeout=2.0, read_timeout=4.0) @tornado.gen.coroutine def fetch(self, path):
Increases unit test connection read timeout.
py
diff --git a/brightside/message_pump.py b/brightside/message_pump.py index <HASH>..<HASH> 100644 --- a/brightside/message_pump.py +++ b/brightside/message_pump.py @@ -115,10 +115,8 @@ class MessagePump: except DeferMessageException: self._requeue_message(message) - self._channel.end_heartbeat() continue except ConfigurationException: - self._channel.end_heartbeat() raise except Exception as ex: self._logger.error("MessagePump: Failed to dispatch the message with id {} from {} on thread # {} due to {}".format(
Use a context manager to control the lifetime of the heartbeat over an explicit call in the code
py
diff --git a/eli5/formatters/text.py b/eli5/formatters/text.py index <HASH>..<HASH> 100644 --- a/eli5/formatters/text.py +++ b/eli5/formatters/text.py @@ -158,9 +158,7 @@ def _targets_lines(explanation, hl_spaces, show_feature_values, header=table_header, col_align=col_align, ) - header_sep = table[1] - max_width = len(header_sep) - table = [header_sep] + table + max_width = len(table[1]) pos_table = '\n'.join(table[:-len(w.neg)]) neg_table = '\n'.join(table[-len(w.neg):])
It's better without an extra header separator
py
diff --git a/booty/__main__.py b/booty/__main__.py index <HASH>..<HASH> 100644 --- a/booty/__main__.py +++ b/booty/__main__.py @@ -51,3 +51,6 @@ def main(hexfile, port, baudrate, load, verify): logger.info('device verified!') else: logger.warning('device verification failed') + +if __name__ == '__main__': + main()
Added a 'if name == main' statement
py
diff --git a/openid/server/trustroot.py b/openid/server/trustroot.py index <HASH>..<HASH> 100644 --- a/openid/server/trustroot.py +++ b/openid/server/trustroot.py @@ -55,7 +55,7 @@ class TrustRoot(object): @sort: parse, isSane """ - + def __init__(self, unparsed, proto, wildcard, host, port, path): self.unparsed = unparsed self.proto = proto
[project @ M-x whitespace-cleanup]
py
diff --git a/eventlib/core.py b/eventlib/core.py index <HASH>..<HASH> 100644 --- a/eventlib/core.py +++ b/eventlib/core.py @@ -95,8 +95,7 @@ def find_handlers(event_name): def find_external_handlers(event_name): - handlers = EXTERNAL_HANDLER_REGISTRY.get(find_event(event_name), []) - handlers.extend(EXTERNAL_HANDLER_REGISTRY.get(event_name, [])) + handlers = EXTERNAL_HANDLER_REGISTRY.get(event_name, []) return handlers
fix event lookup issue with external handlers
py
diff --git a/spacy_iwnlp/__init__.py b/spacy_iwnlp/__init__.py index <HASH>..<HASH> 100644 --- a/spacy_iwnlp/__init__.py +++ b/spacy_iwnlp/__init__.py @@ -7,8 +7,7 @@ class spaCyIWNLP(object): self.lemmatizer = IWNLPWrapper(lemmatizer_path=lemmatizer_path) self.use_plain_lemmatization = use_plain_lemmatization self.ignore_case = ignore_case - Token.set_extension('iwnlp_lemmas', default=None) - Token.set_extension('iwnlp_lemmas', getter=self.get_lemmas) + Token.set_extension('iwnlp_lemmas', getter=self.get_lemmas, force=True) def __call__(self, doc): for token in doc:
Update necessary call to token.set_extension with force=True after spaCy update to latest
py
diff --git a/test/test_conf_in_symlinks.py b/test/test_conf_in_symlinks.py index <HASH>..<HASH> 100755 --- a/test/test_conf_in_symlinks.py +++ b/test/test_conf_in_symlinks.py @@ -21,6 +21,7 @@ # # This file is used to test reading and processing of config files # +import os import sys from shinken_test import * @@ -28,10 +29,13 @@ from shinken_test import * class TestConfigWithSymlinks(ShinkenTest): def setUp(self): + if os.name == 'nt': + return self.setup_with_file('etc/nagios_conf_in_symlinks.cfg') def test_symlinks(self): - + if os.name == 'nt': + return if sys.version_info < (2 , 6): print "************* WARNING********"*200 print "On python 2.4 and 2.5, the symlinks following is NOT managed"
Fix : test_conf_in_symlinks.py and windows is not a good mix....
py
diff --git a/dallinger/version.py b/dallinger/version.py index <HASH>..<HASH> 100644 --- a/dallinger/version.py +++ b/dallinger/version.py @@ -1,3 +1,3 @@ """Dallinger version number.""" -__version__ = "3.0.0a1" +__version__ = "2.7.0"
Move experiments to ``experiments`` module
py
diff --git a/services/managers/phpbb3_manager.py b/services/managers/phpbb3_manager.py index <HASH>..<HASH> 100755 --- a/services/managers/phpbb3_manager.py +++ b/services/managers/phpbb3_manager.py @@ -39,7 +39,7 @@ class Phpbb3Manager: SQL_ADD_USER_AVATAR = r"UPDATE phpbb_users SET user_avatar_type=2, user_avatar_width=64, user_avatar_height=64, user_avatar=%s WHERE user_id = %s" - SQL_CLEAR_USER_PERMISSIONS = r"UPDATE php_users SET user_permissions = '' WHERE User_Id = %s" + SQL_CLEAR_USER_PERMISSIONS = r"UPDATE phpbb_users SET user_permissions = '' WHERE User_Id = %s" def __init__(self): pass
Fixing invalid column name We're using phpBB, not just "php"
py
diff --git a/jieba/__init__.py b/jieba/__init__.py index <HASH>..<HASH> 100644 --- a/jieba/__init__.py +++ b/jieba/__init__.py @@ -331,7 +331,7 @@ def load_userdict(f): tup = line.split(" ") add_word(*tup) except Exception as e: - logger.debug('%s at line %s %s' % (f_name, lineno, line)) + logger.debug('%s at line %s %s' % (f.name, line_no, line)) raise e
fixed an error in load_userdict()
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -751,7 +751,9 @@ class InnoScript: print(file=fd) # Uninstall optional log files print('[UninstallDelete]', file=fd) - print(r'Type: files; Name: "{pf}\%s\linkchecker*.exe.log"' % self.name, file=fd) + for path in (self.windows_exe_files + self.console_exe_files): + exename = os.path.basename(path) + print(r'Type: files; Name: "{pf}\%s\%s.log"' % (self.name, exename), file=fd) print(file=fd) def compile (self):
Remove all logs on uninstall in Windows.
py
diff --git a/python/ray/tests/test_failure.py b/python/ray/tests/test_failure.py index <HASH>..<HASH> 100644 --- a/python/ray/tests/test_failure.py +++ b/python/ray/tests/test_failure.py @@ -459,9 +459,18 @@ def test_actor_scope_or_intentionally_killed_message(ray_start_regular, @ray.remote class Actor: - pass + def __init__(self): + # This log is added to debug a flaky test issue. + print(os.getpid()) + + def ping(self): + pass a = Actor.remote() + # Without this waiting, there seems to be race condition happening + # in the CI. This is not a fundamental fix for that, but it at least + # makes the test less flaky. + ray.get(a.ping.remote()) a = Actor.remote() a.__ray_terminate__.remote() time.sleep(1)
Try to deflake test_failure (#<I>)
py
diff --git a/example/settings.py b/example/settings.py index <HASH>..<HASH> 100644 --- a/example/settings.py +++ b/example/settings.py @@ -101,6 +101,8 @@ SESSION_ENGINE = 'user_sessions.backends.db' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' +SILENCED_SYSTEM_CHECKS = ['admin.E410'] + try: from .settings_private import * # noqa except ImportError:
Opt-out of system checks for example
py
diff --git a/ckanutils/__init__.py b/ckanutils/__init__.py index <HASH>..<HASH> 100755 --- a/ckanutils/__init__.py +++ b/ckanutils/__init__.py @@ -21,6 +21,6 @@ __package_name__ = 'ckanutils' __author__ = 'Reuben Cummings' __description__ = 'Miscellaneous CKAN utility scripts' __email__ = 'reubano@gmail.com' -__version__ = '0.8.0' +__version__ = '0.9.0' __license__ = 'MIT' __copyright__ = 'Copyright 2015 Reuben Cummings'
Bump to version <I>
py
diff --git a/malcolm/core/process.py b/malcolm/core/process.py index <HASH>..<HASH> 100644 --- a/malcolm/core/process.py +++ b/malcolm/core/process.py @@ -182,6 +182,7 @@ class Process(Loggable): self.log.warning( "Timeout waiting for %s *%s **%s", s._function, s._args, s._kwargs) + raise self._spawned = [] self._controllers = OrderedDict() self._unpublished = set()
Raise on first error at Process.stop()
py
diff --git a/txjason/tests/test_client.py b/txjason/tests/test_client.py index <HASH>..<HASH> 100644 --- a/txjason/tests/test_client.py +++ b/txjason/tests/test_client.py @@ -29,6 +29,15 @@ class ClientTestCase(TXJasonTestCase): clock.advance(1) self.assertIsInstance(called[0], defer.CancelledError) + def test_timeout_argument(self): + called = [] + payload, d = self.client.getRequest('foo', timeout=4) + d.addErrback(called.append) + clock.advance(3) + self.assertFalse(called) + clock.advance(1) + self.assertIsInstance(called[0].value, defer.CancelledError) + def test_response(self): called = []
Add a test for passing a timeout to getRequest.
py
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index <HASH>..<HASH> 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -512,21 +512,16 @@ class RemoveCommand(Command): if (yield ui.choice(confirm_msg, select='yes', cancel='no')) == 'no': return - # remove messages - try: - for m in messages: - ui.dbman.remove_message(m) - except DatabaseError, e: - err_msg = str(e) - ui.notify(err_msg, priority='error') - logging.debug(err_msg) - return + # notify callback + def callback(): + ui.notify(ok_msg) + ui.apply_command(RefreshCommand()) - # notify - ui.notify(ok_msg) + # remove messages + for m in messages: + ui.dbman.remove_message(m, afterwards=callback) - # refresh buffer - ui.apply_command(RefreshCommand()) + ui.apply_command(FlushCommand()) @registerCommand(MODE, 'print', arguments=[
rewrite thread.RemoveCommand call flush and use "afterwards" callback for notification
py
diff --git a/pystache/__init__.py b/pystache/__init__.py index <HASH>..<HASH> 100644 --- a/pystache/__init__.py +++ b/pystache/__init__.py @@ -4,5 +4,5 @@ from pystache.init import * # TODO: make sure that "from pystache import *" exposes only the following: -# ['__version__', 'render', 'Renderer', 'TemplateSpec'] +# ['__version__', 'render', 'Renderer', 'TemplateSpec'] # and add a unit test for this.
Deleted a trailing space.
py
diff --git a/js_host/conf.py b/js_host/conf.py index <HASH>..<HASH> 100644 --- a/js_host/conf.py +++ b/js_host/conf.py @@ -10,7 +10,7 @@ class Conf(conf.Conf): PATH_TO_NODE = 'node' # An absolute path to the directory which contains your node_modules directory - SOURCE_ROOT = None + SOURCE_ROOT = os.getcwd() # A path to the binary used to control hosts and managers. BIN_PATH = os.path.join('node_modules', '.bin', 'js-host')
SOURCE_ROOT now defaults to the current working directory
py
diff --git a/src/html5lib/html5parser.py b/src/html5lib/html5parser.py index <HASH>..<HASH> 100644 --- a/src/html5lib/html5parser.py +++ b/src/html5lib/html5parser.py @@ -880,7 +880,8 @@ class InBodyPhase(Phase): ("xmp", self.startTagXmp), ("table", self.startTagTable), (("area", "basefont", "bgsound", "br", "embed", "img", "input", - "keygen", "param", "spacer", "wbr"), self.startTagVoidFormatting), + "keygen", "spacer", "wbr"), self.startTagVoidFormatting), + (("param", "source"), self.startTagParamSource), ("hr", self.startTagHr), ("image", self.startTagImage), ("isindex", self.startTagIsIndex), @@ -1116,6 +1117,11 @@ class InBodyPhase(Phase): token["selfClosingAcknowledged"] = True self.parser.framesetOK = False + def startTagParamSource(self, token): + self.tree.insertElement(token) + self.tree.openElements.pop() + token["selfClosingAcknowledged"] = True + def startTagHr(self, token): if self.tree.elementInScope("p"): self.endTagP(impliedTagToken("p"))
Fix handling of source/param within "in body". Fixes #<I>.
py
diff --git a/cnxpublishing/publish.py b/cnxpublishing/publish.py index <HASH>..<HASH> 100644 --- a/cnxpublishing/publish.py +++ b/cnxpublishing/publish.py @@ -9,6 +9,7 @@ Functions used to commit publication works to the archive. """ import cnxepub +import psycopg2 from cnxepub import Document, Binder from cnxarchive.utils import join_ident_hash, split_ident_hash @@ -263,7 +264,7 @@ def publish_model(cursor, model, publisher, message): 'module_ident': module_ident, 'filename': 'index.cnxml.html', 'mime_type': 'text/html', - 'data': model.html.encode('utf-8'), + 'data': psycopg2.Binary(model.html.encode('utf-8')), } cursor.execute("""\ WITH file_insertion AS (
Fix the data input from text to binary when inserting content.
py
diff --git a/scoop/__main__.py b/scoop/__main__.py index <HASH>..<HASH> 100644 --- a/scoop/__main__.py +++ b/scoop/__main__.py @@ -315,6 +315,7 @@ class ScoopApp(object): sys.stdout.write(data.decode("utf-8")) sys.stdout.flush() data = stream.read(1) + self.errors = rootProcess.wait() # TODO: print others than root def close(self):
Now returns the exit code of the remote root worker program.
py
diff --git a/velbus/messages/kwh_status.py b/velbus/messages/kwh_status.py index <HASH>..<HASH> 100644 --- a/velbus/messages/kwh_status.py +++ b/velbus/messages/kwh_status.py @@ -40,6 +40,8 @@ class KwhStatusMessage(velbus.Message): self.kwh = float(float(self.counter)/self.pulses) self.delay = (data[5] << 8) + data[6] self.watt = float((1000 * 1000 * 3600) / (self.delay * self.pulses)) + if self.watt < 55: + self.watt = 0 def to_json(self): """
if watt value is < <I>, then nothing is received by the module
py
diff --git a/tools/run_tests/run_microbenchmark.py b/tools/run_tests/run_microbenchmark.py index <HASH>..<HASH> 100755 --- a/tools/run_tests/run_microbenchmark.py +++ b/tools/run_tests/run_microbenchmark.py @@ -173,7 +173,7 @@ argp.add_argument('-c', '--collect', default=sorted(collectors.keys()), help='Which collectors should be run against each benchmark') argp.add_argument('-b', '--benchmarks', - default=['bm_fullstack', 'bm_closure'], + default=['bm_fullstack', 'bm_closure', 'bm_cq'], nargs='+', type=str, help='Which microbenchmarks should be run')
Update microbenchmarking framework for new benchmark
py
diff --git a/tensorlayer/layers.py b/tensorlayer/layers.py index <HASH>..<HASH> 100755 --- a/tensorlayer/layers.py +++ b/tensorlayer/layers.py @@ -1264,7 +1264,7 @@ class DeConv3dLayer(Layer): ): Layer.__init__(self, name=name) self.inputs = layer.outputs - print(" tensorlayer:Instantiate DeConv2dLayer %s: %s, %s, %s, %s, %s" % + print(" tensorlayer:Instantiate DeConv3dLayer %s: %s, %s, %s, %s, %s" % (self.name, str(shape), str(output_shape), str(strides), padding, act.__name__)) with tf.variable_scope(name) as vs:
[TYPO] deconv3dlayer console
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -72,7 +72,7 @@ class InstallWithKernelspec(install): setup(name='SAS_kernel', version='1.2.1', - description='A SAS kernel for IPython', + description='A SAS kernel for Jupyter', long_description=open('README.rst', 'rb').read().decode('utf-8'), author='Jared Dean', license='Apache Software License',
inital push of doc build system
py
diff --git a/crontabber/tests/base.py b/crontabber/tests/base.py index <HASH>..<HASH> 100644 --- a/crontabber/tests/base.py +++ b/crontabber/tests/base.py @@ -112,16 +112,13 @@ class IntegrationTestCaseBase(TestCaseBase): configman.ConfigFileFutureProxy, environment, ], - # app_name='crontabber', - # app_name=app.CronTabber.app_name, app_name='test-crontabber', app_description=__doc__, - # argv_source=[] ) - with config_manager.context() as config: - config.crontabber.logger = mock.Mock() - return config + config = config_manager.get_config() + config.crontabber.logger = mock.Mock() + return config def setUp(self): super(IntegrationTestCaseBase, self).setUp()
fixes #<I> - improper use of context in tests
py
diff --git a/gooey/gui/components/footer.py b/gooey/gui/components/footer.py index <HASH>..<HASH> 100644 --- a/gooey/gui/components/footer.py +++ b/gooey/gui/components/footer.py @@ -90,6 +90,7 @@ class Footer(wx.Panel): def _do_layout(self): + self.SetBackgroundColour(self.buildSpec['footer_bg_color']) self.stop_button.Hide() self.restart_button.Hide()
pass footer_bg_color from buildSpec to Footer
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ except(IOError, ImportError): setup( name='passwordgenerator', - version='1.5', + version='1.5.1', description='Passwords easy for humans, hard for computers', long_description=long_description, author='Gabriel Bordeaux',
Push minor release for python_requires update (#<I>)
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ with open('README.rst') as f: install_reqs = [ 'bcrypt', 'boto', - 'CherryPy', + 'CherryPy<8', # see https://github.com/girder/girder/issues/1615 'Mako', 'pymongo>=3', 'PyYAML', @@ -80,7 +80,7 @@ extras_reqs = { 'worker': ['celery'], 'oauth': ['pyjwt', 'cryptography'] } -all_extra_reqs = itertools.chain.from_iterable(extras_reqs.values()) +all_extra_reqs = itertools.chain.from_iterable(extras_reqs.values()) extras_reqs['plugins'] = list(set(all_extra_reqs)) if sys.version_info[0] == 2:
Fixes #<I>. Disallow cherrpy version 8.x It contains a bug that breaks restarting the server
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 @@ -218,7 +218,7 @@ def query(key, keyid, method='GET', params=None, headers=None, if return_url is True: return ret, requesturl else: - if method == 'GET' or method == 'HEAD': + if result.status_code != requests.codes.ok: return ret = {'headers': []} for header in result.headers:
updated s3.query function to return headers array for successful requests fixes issue with s3.head returning None for files that exist
py
diff --git a/src/browse.py b/src/browse.py index <HASH>..<HASH> 100755 --- a/src/browse.py +++ b/src/browse.py @@ -60,7 +60,9 @@ def parse(text): outputs = [] try: - target = next(lines)[:-1] # strip trailing colon + target = next(lines) + if target.endswith(':'): + target = target[:-1] # strip trailing colon line = next(lines) (match, rule) = match_strip(line, ' input: ')
browse.py: Fix truncation with an unknown target.
py
diff --git a/crispy_forms_foundation/layout.py b/crispy_forms_foundation/layout.py index <HASH>..<HASH> 100644 --- a/crispy_forms_foundation/layout.py +++ b/crispy_forms_foundation/layout.py @@ -254,11 +254,11 @@ class InlineSwitchField(InlineField): def __init__(self, field, *args, **kwargs): self.switch_class = ['switch']+kwargs.pop('switch_class', '').split() - super(SwitchField, self).__init__(field, *args, **kwargs) + super(InlineSwitchField, self).__init__(field, *args, **kwargs) def render(self, form, form_style, context, template_pack=TEMPLATE_PACK): context['switch_class'] = " ".join(self.switch_class) - return super(SwitchField, self).render(form, form_style, context, template_pack) + return super(InlineSwitchField, self).render(form, form_style, context, template_pack) class ButtonHolder(crispy_forms_layout.ButtonHolder):
argh ! forgot to update class name
py
diff --git a/openquake/hazardlib/contexts.py b/openquake/hazardlib/contexts.py index <HASH>..<HASH> 100644 --- a/openquake/hazardlib/contexts.py +++ b/openquake/hazardlib/contexts.py @@ -79,7 +79,8 @@ def get_maxsize(num_levels, num_gsims): # optimized for the USA model assert num_levels * num_gsims * 32 < TWO32, (num_levels, num_gsims) maxsize = TWO32 // (num_levels * num_gsims * 32) - return min(maxsize, 200_000) # 200_000 to fit in the CPU cache + # 10_000 optimizes "computing pnes" for the ALS calculation + return min(maxsize, 10_000) def trivial(ctx, name):
Refined maxsize more [ci skip]
py
diff --git a/flake8_import_order/__init__.py b/flake8_import_order/__init__.py index <HASH>..<HASH> 100644 --- a/flake8_import_order/__init__.py +++ b/flake8_import_order/__init__.py @@ -182,8 +182,6 @@ class ImportVisitor(ast.NodeVisitor): pkg = root_package_name(name) - # Entirely not confusingly we use "False" for "True" in the flags. - if pkg == "__future__": return IMPORT_FUTURE
Remove missleading comment It no longer applies to the code.
py
diff --git a/zinnia_html5/__init__.py b/zinnia_html5/__init__.py index <HASH>..<HASH> 100644 --- a/zinnia_html5/__init__.py +++ b/zinnia_html5/__init__.py @@ -1,5 +1,5 @@ """zinnia_html5""" -__version__ = '0.1' +__version__ = '0.2.dev' __license__ = 'BSD License' __author__ = 'Fantomas42'
passing to version <I>.dev
py
diff --git a/multiqc/modules/mirtrace/mirtrace.py b/multiqc/modules/mirtrace/mirtrace.py index <HASH>..<HASH> 100755 --- a/multiqc/modules/mirtrace/mirtrace.py +++ b/multiqc/modules/mirtrace/mirtrace.py @@ -304,7 +304,7 @@ class MultiqcModule(BaseMultiqcModule): # Specify the order of the different possible categories keys = OrderedDict() - for clade in self.contamination_data[self.contamination_data.keys()[0]]: + for clade in self.contamination_data[list(self.contamination_data.keys())[0]]: keys[clade] = { 'color': color_lib[idx], 'name': clade } if idx < 23: idx += 1
Fix bug that dict_keys does not support indexing for python 3.x
py
diff --git a/pylivetrader/_version.py b/pylivetrader/_version.py index <HASH>..<HASH> 100644 --- a/pylivetrader/_version.py +++ b/pylivetrader/_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = '0.0.13' +VERSION = '0.0.15'
Bump to <I> (<I> was skipped)
py
diff --git a/falafel/core/__init__.py b/falafel/core/__init__.py index <HASH>..<HASH> 100644 --- a/falafel/core/__init__.py +++ b/falafel/core/__init__.py @@ -251,7 +251,7 @@ crw-------. 1 0 0 10, 236 Jul 25 10:00 control # Note that we don't try to determine nonexistent month, day > 31, hour # > 23, minute > 59 or improbable year here. # TODO: handle non-English formatted dates here. - date_regex = r'(?P<date>\w{3}\s[ 0-9][0-9]\s(?:[ 0-9]\d:\d{2}|\s\d{4}))' + date_regex = r'(?P<date>\w{3}\s[ 0-9][0-9]\s(?:[012]\d:\d{2}|\s\d{4}))' name_regex = r'(?P<name>\S.*?)(?: -> (?P<link>\S+))?$' normal_regex = '\s+'.join((perms_regex, links_regex, owner_regex, size_regex, date_regex, name_regex))
We can at least limit the accepted hours up to <I> :-)
py
diff --git a/vumi_http_api/auth.py b/vumi_http_api/auth.py index <HASH>..<HASH> 100644 --- a/vumi_http_api/auth.py +++ b/vumi_http_api/auth.py @@ -29,8 +29,14 @@ class ConversationAccessChecker(object): username = credentials.username token = credentials.password tokens = self.worker.get_static_config().api_tokens - if token in tokens: - return username + valid_tokens = [t for t in tokens if t['account'] == username] + valid_tokens = [ + t for t in tokens if + t['conversation'] == self.conversation_key] + if len(valid_tokens) > 0: + valid_tokens = valid_tokens[0]['tokens'] + if token in valid_tokens: + return username raise error.UnauthorizedLogin()
Extra validation for conversation key and account key in auth
py
diff --git a/jujupy/tests/test_client.py b/jujupy/tests/test_client.py index <HASH>..<HASH> 100644 --- a/jujupy/tests/test_client.py +++ b/jujupy/tests/test_client.py @@ -180,6 +180,12 @@ class TestJuju2Backend(TestCase): self.assertIsNot(cloned, backend) self.assertIs(soft_deadline, cloned.soft_deadline) + def test_cloned_backends_share_juju_timings(self): + backend = Juju2Backend('/bin/path', '2.0', set(), False) + cloned = backend.clone( + full_path=None, version=None, debug=None, feature_flags=None) + self.assertIs(cloned.juju_timings, backend.juju_timings) + def test__check_timeouts(self): backend = Juju2Backend('/bin/path', '2.0', set(), debug=False, soft_deadline=datetime(2015, 1, 2, 3, 4, 5))
Failing test for sharing juju_timings data.
py
diff --git a/taxii2client/common.py b/taxii2client/common.py index <HASH>..<HASH> 100644 --- a/taxii2client/common.py +++ b/taxii2client/common.py @@ -253,6 +253,7 @@ class _HTTPConnection(object): self.version = version if cert: self.session.cert = cert + def valid_content_type(self, content_type, accept): """Check that the server is returning a valid Content-Type
Added blank line to appease the flake gods
py
diff --git a/mintapi/api.py b/mintapi/api.py index <HASH>..<HASH> 100644 --- a/mintapi/api.py +++ b/mintapi/api.py @@ -147,7 +147,12 @@ class Mint(requests.Session): def get_transactions(self): if not pd: raise ImportError('transactions data requires pandas') - from StringIO import StringIO + + try: + from StringIO import StringIO # Python 2 + except ImportError: + from io import StringIO # Python 3 + result = self.get( 'https://wwws.mint.com/transactionDownload.event', headers=self.headers @@ -157,8 +162,13 @@ class Mint(requests.Session): if not result.headers['content-type'].startswith('text/csv'): raise ValueError('non csv content returned') - s = StringIO() - s.write(result.content) + csv_data = result.content + + try: + s = StringIO(csv_data) # Python 2 + except Exception: + s = StringIO(csv_data.decode()) # Python 3 + s.seek(0) df = pd.read_csv(s, parse_dates=['Date']) df.columns = [c.lower().replace(' ', '_') for c in df.columns]
Fix Python 3 compatibility in get_transactions
py
diff --git a/src/svgutils/transform.py b/src/svgutils/transform.py index <HASH>..<HASH> 100644 --- a/src/svgutils/transform.py +++ b/src/svgutils/transform.py @@ -240,14 +240,14 @@ class SVGFigure(object): if width: try: - # width is an instance of Unit - self._width = width.value + self.width = width # this goes to @width.setter a few lines down except AttributeError: # int or str self._width = width + if height: try: - self._height = height.value + self.height = height # this goes to @height.setter a few lines down except AttributeError: self._height = height
transform.py: Get width/height/viewBox included with SVG output again (fixes #<I>) Regression from commit 6f5d<I>fa5cb<I>f7fb<I>ee<I>d<I>ba9d<I> introduce as part of pull request #<I>.
py
diff --git a/JSAnimation/html_writer.py b/JSAnimation/html_writer.py index <HASH>..<HASH> 100644 --- a/JSAnimation/html_writer.py +++ b/JSAnimation/html_writer.py @@ -1,9 +1,9 @@ import os import warnings -import random import cStringIO from matplotlib.animation import writers, FileMovieWriter import random +import string ICON_DIR = os.path.join(os.path.dirname(__file__), 'icons') @@ -243,7 +243,9 @@ class HTMLWriter(FileMovieWriter): @classmethod def new_id(cls): - return '%16x' % cls.rng.getrandbits(64) + #return '%16x' % cls.rng.getrandbits(64) + return ''.join(cls.rng.choice(string.ascii_uppercase) + for x in range(16)) def __init__(self, fps=30, codec=None, bitrate=None, extra_args=None, metadata=None, embed_frames=False, default_mode='loop'):
use non-digit characters for hash
py
diff --git a/jiphy/handlers.py b/jiphy/handlers.py index <HASH>..<HASH> 100644 --- a/jiphy/handlers.py +++ b/jiphy/handlers.py @@ -287,6 +287,16 @@ class SingleLineComment(Handler): return '# {0}\n'.format(self.python_content) +@routes.add('import pdb; pdb.set_trace()\n', 'import pdb;pdb.set_trace()\n', 'debugger;\n') +class BreakPoint(Handler): + + def _javascript(self): + return "debugger;\n" + + def _python(self): + return "import pdb; pdb.set_trace()\n" + + @routes.add("import ") class PythonImport(Handler): end_on = ("\n", " #", " //")
Implement support for Break Points according to test and README specifications
py
diff --git a/em73xx/sms.py b/em73xx/sms.py index <HASH>..<HASH> 100644 --- a/em73xx/sms.py +++ b/em73xx/sms.py @@ -3,6 +3,17 @@ from .utils import unquote class SMS(object): @classmethod + def fromJson(cls, sms_json): + return cls( + sms_json["sms_id"], + sms_json["status"], + sms_json["sender"], + sms_json["date"], + sms_json["time"], + sms_json["message"] + ) + + @classmethod def from_AT_response(cls, header, message): (sms_id_txt, status, sender, something, date, time) = header.split(",")
oops, forgot from json
py
diff --git a/openquake/hazardlib/lt.py b/openquake/hazardlib/lt.py index <HASH>..<HASH> 100644 --- a/openquake/hazardlib/lt.py +++ b/openquake/hazardlib/lt.py @@ -310,7 +310,7 @@ def apply_uncertainties(bset_values, src_group): def random(size, seed, sampling_method='early_weights'): """ - :param size: size of the returned array + :param size: size of the returned array (integer or pair of integers) :param seed: random seed :param sampling_method: 'early_weights', 'early_latin', ... :returns: an array of floats in the range 0..1
Updated docstring [skip CI]
py
diff --git a/safe/impact_function/impact_function.py b/safe/impact_function/impact_function.py index <HASH>..<HASH> 100644 --- a/safe/impact_function/impact_function.py +++ b/safe/impact_function/impact_function.py @@ -299,7 +299,7 @@ class ImpactFunction(object): 'end_datetime', 'duration', 'earthquake_function', - # 'performance_log', # I don't need we need this one + # 'performance_log', # I don't think need we need this one 'hazard', 'exposure', 'aggregation', @@ -346,12 +346,23 @@ class ImpactFunction(object): 'A: %s\nB: %s' % (if_property, string_a, string_b)) return False except AttributeError as e: - LOGGER.error(e) + LOGGER.error( + 'Property %s is not found. The exception is %s' % ( + if_property, e)) return False + except IndexError as e: + if if_property == 'impact': + continue + else: + LOGGER.error( + 'Property %s is out of index. The exception is %s' % ( + if_property, e)) + return False except Exception as e: LOGGER.error( 'Error on %s with error message %s' % (if_property, e)) return False + return True @property
Pass if impact is empty because no output yet.
py
diff --git a/phoebe/io/parsers.py b/phoebe/io/parsers.py index <HASH>..<HASH> 100644 --- a/phoebe/io/parsers.py +++ b/phoebe/io/parsers.py @@ -585,7 +585,7 @@ def legacy_to_phoebe(inputfile, create_body=False, create_bundle=False, logger.warning("The light curve file {} cannot be located.".format(lc_file[i])) else: if lcsigma[i]=='sigma': - if os.path.isfile(rv_file[i]) or os.path.isfile(os.path.basename(lc_file[i])): + if os.path.isfile(lc_file[i]) or os.path.isfile(os.path.basename(lc_file[i])): col1lc,col2lc,col3lc = np.loadtxt(lc_file[i], unpack=True) obslc.append(datasets.LCDataSet(phase=col1lc,flux=col2lc,sigma=col3lc,columns=[lctime[i],'flux',lcsigma[i]], ref="lightcurve_"+str(j), filename=str(lc_file[i]), statweight=lc_pbweight[i], user_components=lcname[i]))
fixed typo in rv_file that should be lc_file
py
diff --git a/spinoff/actor/_actor.py b/spinoff/actor/_actor.py index <HASH>..<HASH> 100644 --- a/spinoff/actor/_actor.py +++ b/spinoff/actor/_actor.py @@ -1311,10 +1311,10 @@ class TempActor(Actor): pool = set() @classmethod - def make(cls, node=None): + def make(cls, context=None): # if not cls.pool: d = Deferred() - ret = node.spawn(cls.using(d, cls.pool)) + ret = context.spawn(cls.using(d, cls.pool)) return ret, d # TODO:this doesn't work reliably for some reason, otherwise it could be a major performance enhancer, # at least for as long as actors are as heavy as they currently are
Renamed TempActor.make argument 'node' to 'context' because it can be anything that can spawn an actor
py
diff --git a/uptick/wallet.py b/uptick/wallet.py index <HASH>..<HASH> 100644 --- a/uptick/wallet.py +++ b/uptick/wallet.py @@ -209,3 +209,14 @@ def importaccount(ctx, account, role): if not imported: click.echo("No matching key(s) found. Password correct?") + + +@main.command() +@click.pass_context +@click.option( + '--ignore-warning/--no-ignore-warning', + prompt="Are you sure you want to wipe your wallet? This action is irreversible!", +) +@offlineChain +def wipewallet(ctx, ignore_warning): + ctx.bitshares.wallet.wipe(ignore_warning)
[wallet] Allow to wipe wallet
py
diff --git a/fuel/transformers/defaults.py b/fuel/transformers/defaults.py index <HASH>..<HASH> 100644 --- a/fuel/transformers/defaults.py +++ b/fuel/transformers/defaults.py @@ -20,7 +20,9 @@ class ToBytes(SourcewiseTransformer): """ def __init__(self, stream, **kwargs): kwargs.setdefault('produces_examples', stream.produces_examples) - axis_labels = stream.axis_labels + axis_labels = (stream.axis_labels + if stream.axis_labels is not None + else {}) for source in kwargs.get('which_sources', stream.sources): axis_labels[source] = (('batch', 'bytes') if 'batch' in axis_labels.get(source, ())
Handle None axis_labels in ToBytes.
py
diff --git a/saspy/sasiohttp.py b/saspy/sasiohttp.py index <HASH>..<HASH> 100644 --- a/saspy/sasiohttp.py +++ b/saspy/sasiohttp.py @@ -376,7 +376,7 @@ class SASconfigHTTP: headers={"Accept":"application/vnd.sas.collection+json", "Accept-Item":"application/vnd.sas.compute.context.summary+json", "Authorization":"Bearer "+self._token} - conn.request('GET', "/compute/contexts", headers=headers) + conn.request('GET', "/compute/contexts?limit=999999", headers=headers) req = conn.getresponse() status = req.status resp = req.read()
fix get contexts not retuning all of the contexts
py
diff --git a/phy/utils/logging.py b/phy/utils/logging.py index <HASH>..<HASH> 100644 --- a/phy/utils/logging.py +++ b/phy/utils/logging.py @@ -1,3 +1,4 @@ +from __future__ import absolute_import """Logger utility classes and functions.""" # -----------------------------------------------------------------------------
Added future statement to avoid absolute/relative import bug in Python 2.
py
diff --git a/pyemu/utils/gw_utils.py b/pyemu/utils/gw_utils.py index <HASH>..<HASH> 100644 --- a/pyemu/utils/gw_utils.py +++ b/pyemu/utils/gw_utils.py @@ -229,7 +229,7 @@ def setup_mtlist_budget_obs(list_filename,gw_filename="mtlist_gw.dat",sw_filenam if df_sw is None: raise Exception("error processing surface water instruction file") df_gw = df_gw.append(df_sw) - df_gw.obsnme = df_gw.index.values + df_gw.loc[:, "obsnme"] = df_gw.index.values if save_setup_file: df_gw.to_csv("_setup_" + os.path.split(list_filename)[-1] + '.csv', index=False) @@ -325,7 +325,7 @@ def setup_mflist_budget_obs(list_filename,flx_filename="flux.dat", It is recommended to use the default values for flux_file and vol_file. - This is the companion function of `gw_utils.setup_mflist_budget_obs()`. + This is the companion function of `gw_utils.apply_mflist_budget_obs()`. """
minor changes in mf/mtlist setup
py
diff --git a/spyderlib/spyder.py b/spyderlib/spyder.py index <HASH>..<HASH> 100644 --- a/spyderlib/spyder.py +++ b/spyderlib/spyder.py @@ -1578,7 +1578,7 @@ class MainWindow(QMainWindow): <a href="%s">Google Group</a> </li></ul> <p>This project is part of a larger effort to promote and - facilitate the use of Python for scientific and enginering + facilitate the use of Python for scientific and engineering software development. The popular Python distributions <a href="http://code.google.com/p/pythonxy/">Python(x,y)</a> and <a href="http://code.google.com/p/winpython/">WinPython</a>
About dialog: Fix another spelling error Update Issue <I> Status: Fixed - Thanks to Pythius.Jang for noticing it.
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ INSTALL_REQUIRES = [ 'Jinja2>=2.7.2', 'MarkupSafe>=0.23', 'Werkzeug>=0.9.4', - 'jinja2-highlight>=0.5.1', + 'jinja2-highlight==0.5.1', # pin for Python26 compatibility 'pyzmq>=4.3.1', 'zipstream>=1.0.4', 'Markdown<2.5.0', # pinned to <2.5 because it is Python26 incompatible
pin jinja2-highlight for Python <I> support
py
diff --git a/honeybadger/tests/contrib/test_django.py b/honeybadger/tests/contrib/test_django.py index <HASH>..<HASH> 100644 --- a/honeybadger/tests/contrib/test_django.py +++ b/honeybadger/tests/contrib/test_django.py @@ -154,7 +154,7 @@ class DjangoMiddlewareIntegrationTestCase(SimpleTestCase): ) def test_exceptions_handled_by_middleware(self): def assert_payload(req): - error_payload = json.loads(req.data) + error_payload = json.loads(str(req.data, "utf-8")) self.assertEqual(req.get_header('X-api-key'), 'abc123') self.assertEqual(req.get_full_url(), '{}/v1/notices/'.format(honeybadger.config.endpoint)) @@ -167,4 +167,4 @@ class DjangoMiddlewareIntegrationTestCase(SimpleTestCase): response = self.client.get('/always_fails/') except: pass - self.assertTrue(request_mock.called) \ No newline at end of file + self.assertTrue(request_mock.called)
Update honeybadger/tests/contrib/test_django.py
py
diff --git a/schedule/models/events.py b/schedule/models/events.py index <HASH>..<HASH> 100644 --- a/schedule/models/events.py +++ b/schedule/models/events.py @@ -59,12 +59,6 @@ class Event(models.Model): def get_absolute_url(self): return reverse('event', args=[self.id]) - def create_relation(self, obj, distinction=None): - """ - Creates a EventRelation between self and obj. - """ - EventRelation.objects.create_relation(self, obj, distinction) - def get_occurrences(self, start, end): """ >>> rule = Rule(frequency = "MONTHLY", name = "Monthly") @@ -289,16 +283,6 @@ class EventRelationManager(models.Manager): event_q = Q(dist_q, Q(eventrelation__object_id=content_object.id), Q(eventrelation__content_type=ct)) return Event.objects.filter(inherit_q | event_q) - def change_distinction(self, distinction, new_distinction): - ''' - This function is for change the a group of eventrelations from an old - distinction to a new one. It should only be used for managerial stuff. - It is also expensive so it should be used sparingly. - ''' - for relation in self.filter(distinction=distinction): - relation.distinction = new_distinction - relation.save() - def create_relation(self, event, content_object, distinction=None): """ Creates a relation between event and content_object.
remove trivial methods, if you want to do this just do the query
py
diff --git a/importer_invenio/indico_importer_invenio/plugin.py b/importer_invenio/indico_importer_invenio/plugin.py index <HASH>..<HASH> 100644 --- a/importer_invenio/indico_importer_invenio/plugin.py +++ b/importer_invenio/indico_importer_invenio/plugin.py @@ -16,17 +16,17 @@ from __future__ import unicode_literals -from indico_importer import ImporterEnginePluginBase +from indico_importer import ImporterSourcePluginBase from .forms import SettingsForm from .importer import InvenioImporter -class ImporterInvenioPlugin(ImporterEnginePluginBase): +class ImporterInvenioPlugin(ImporterSourcePluginBase): """Importer for Invenio plugin Adds Invenio importer to Indico timetable import sources. """ - engine_class = InvenioImporter + importer_engine_classes = (InvenioImporter,) settings_form = SettingsForm
Adapt to multiple importer engines per plugin
py
diff --git a/airflow/utils/db.py b/airflow/utils/db.py index <HASH>..<HASH> 100644 --- a/airflow/utils/db.py +++ b/airflow/utils/db.py @@ -361,7 +361,8 @@ def resetdb(): # We need to add this model manually to get reset working well # noinspection PyUnresolvedReferences from airflow.models.serialized_dag import SerializedDagModel # noqa: F401 - + # noinspection PyUnresolvedReferences + from airflow.jobs.base_job import BaseJob # noqa: F401 # alembic adds significant import time, so we import it lazily # noinspection PyUnresolvedReferences from alembic.migration import MigrationContext
[AIRFLOW-<I>] BaseJob table was not deleted on db reset (#<I>)
py
diff --git a/tests/test_trac.py b/tests/test_trac.py index <HASH>..<HASH> 100644 --- a/tests/test_trac.py +++ b/tests/test_trac.py @@ -38,6 +38,7 @@ class TestTracIssue(AbstractServiceTest, ServiceTest): 'summary': 'Some Summary', 'number': 204, 'priority': 'critical', + 'component': 'testcomponent', } def setUp(self): @@ -69,6 +70,7 @@ class TestTracIssue(AbstractServiceTest, ServiceTest): issue.URL: self.arbitrary_issue['url'], issue.SUMMARY: self.arbitrary_issue['summary'], issue.NUMBER: self.arbitrary_issue['number'], + issue.COMPONENT: self.arbitrary_issue['component'], } actual_output = issue.to_taskwarrior() @@ -86,6 +88,7 @@ class TestTracIssue(AbstractServiceTest, ServiceTest): 'tags': [], 'tracnumber': 1, 'tracsummary': 'Some Summary', - 'tracurl': 'https://http://ljlkajsdfl.com/ticket/1'} + 'tracurl': 'https://http://ljlkajsdfl.com/ticket/1', + 'traccomponent': 'testcomponent'} self.assertEqual(issue.get_taskwarrior_record(), expected)
Update Trac tests to include component UDA
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -65,6 +65,7 @@ setuptools.setup( 'channels_redis~=2.3', 'async-timeout~=2.0', 'plumbum~=1.6.6', + 'resolwe-runtime-utils>=1.2.0', ], extras_require={ 'docs': ['sphinx_rtd_theme'], @@ -76,7 +77,6 @@ setuptools.setup( 'pydocstyle~=2.1.1', 'pylint~=1.9.1', 'readme_renderer', - 'resolwe-runtime-utils>=1.1.0', 'setuptools_scm', 'testfixtures>=4.10.0', 'tblib>=1.3.0',
Add resolwe-runtime-utils to list of required packages
py
diff --git a/mautrix/__init__.py b/mautrix/__init__.py index <HASH>..<HASH> 100644 --- a/mautrix/__init__.py +++ b/mautrix/__init__.py @@ -1,3 +1,3 @@ -__version__ = "0.4.0.dev70" +__version__ = "0.4.0.dev71" __author__ = "Tulir Asokan <tulir@maunium.net>" __all__ = ["api", "appservice", "bridge", "client", "errors", "util", "types"]
New pypi dev build
py
diff --git a/pmagpy_tests/test_ipmag.py b/pmagpy_tests/test_ipmag.py index <HASH>..<HASH> 100644 --- a/pmagpy_tests/test_ipmag.py +++ b/pmagpy_tests/test_ipmag.py @@ -213,7 +213,10 @@ class TestCombineMagic(unittest.TestCase): res = ipmag.combine_magic(flist, 'custom.out', data_model=3) print('MIDDLE XYZ') with open(os.path.join(WD, 'custom.out')) as f: + print('XYZ opened custom.out') n = len(f.readlines()) - 2 + print('XYZ read custom.out') + print('XYZ about to assert Equal') self.assertEqual(n, 2747) print('DONE XYZ')
add more debugging for combine magic windows tests
py
diff --git a/api/src/opentrons/hardware_control/__init__.py b/api/src/opentrons/hardware_control/__init__.py index <HASH>..<HASH> 100644 --- a/api/src/opentrons/hardware_control/__init__.py +++ b/api/src/opentrons/hardware_control/__init__.py @@ -543,8 +543,8 @@ class API(HardwareAPILike): for smoothie_plunger, current in smoothie_plungers.items(): self._backend.set_active_current( smoothie_plunger, current) - smoothie_pos.update( - self._backend.home([smoothie_plunger.name.upper()])) + self._backend.home([smoothie_plunger.name.upper()]) + smoothie_pos.update(self._backend.update_position()) self._current_position = self._deck_from_smoothie(smoothie_pos) async def add_tip(
fix(api): Ensure position is fully updated after a home (#<I>)
py
diff --git a/sammy/__init__.py b/sammy/__init__.py index <HASH>..<HASH> 100644 --- a/sammy/__init__.py +++ b/sammy/__init__.py @@ -335,9 +335,10 @@ class DynamoDBTable(Resource): TableName = CharForeignProperty(SAMSchema, required=True) GlobalSecondaryIndexes = ListProperty() KeySchema = ListProperty(required=True) + BillingMode = CharForeignProperty(Ref) LocalSecondaryIndexes = ListProperty() PointInTimeRecoverySpecification = DictProperty() - ProvisionedThroughput = DictProperty(required=True) + ProvisionedThroughput = DictProperty() SSESpecification = DictProperty() StreamSpecification = DictProperty() Tags = DictProperty()
added BillingMode to DynamoDB spec
py
diff --git a/graphenecommon/transactionbuilder.py b/graphenecommon/transactionbuilder.py index <HASH>..<HASH> 100644 --- a/graphenecommon/transactionbuilder.py +++ b/graphenecommon/transactionbuilder.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import struct import logging +from datetime import datetime, timedelta from binascii import unhexlify from .exceptions import ( InsufficientAuthorityError, @@ -400,8 +401,10 @@ class TransactionBuilder(dict, AbstractBlockchainInstanceProvider): or self.blockchain.expiration or 30 # defaults to 30 seconds ) - if not self.get("ref_block_num"): + now = datetime.now() + if not self.get("ref_block_num") or now > self.get("ref_block_time") + datetime.timedelta(days=1) : ref_block_num, ref_block_prefix = self.get_block_params() + ref_block_time = now else: ref_block_num = self["ref_block_num"] ref_block_prefix = self["ref_block_prefix"]
Expire TaPoS cache after one day, fix #<I>
py
diff --git a/cartoframes/viz/source.py b/cartoframes/viz/source.py index <HASH>..<HASH> 100644 --- a/cartoframes/viz/source.py +++ b/cartoframes/viz/source.py @@ -79,14 +79,17 @@ class Source: raise ValueError('Wrong source input. Valid values are str and DataFrame.') def get_credentials(self): - if self.credentials: - return { - # CARTO VL requires a username but CARTOframes allows passing only the base_url. - # That's why 'user' is used by default if username is empty. - 'username': self.credentials.username or 'user', - 'api_key': self.credentials.api_key, - 'base_url': self.credentials.base_url - } + if self.type == SourceType.QUERY: + if self.credentials: + return { + # CARTO VL requires a username but CARTOframes allows passing only the base_url. + # That's why 'user' is used by default if username is empty. + 'username': self.credentials.username or 'user', + 'api_key': self.credentials.api_key, + 'base_url': self.credentials.base_url + } + elif self.type == SourceType.GEOJSON: + return None def set_datetime_columns(self): if self.type == SourceType.GEOJSON:
Return Credentials only for Query Sources
py
diff --git a/angr/sim_type.py b/angr/sim_type.py index <HASH>..<HASH> 100644 --- a/angr/sim_type.py +++ b/angr/sim_type.py @@ -861,7 +861,8 @@ class SimUnion(SimType): def __init__(self, members, name=None, label=None): """ - :param members: The members of the struct, as a mapping name -> type + :param members: The members of the union, as a mapping name -> type + :param name: The name of the union """ super(SimUnion, self).__init__(label) self._name = name if name is not None else '<anon>' @@ -880,7 +881,7 @@ class SimUnion(SimType): return max(val.alignment for val in self.members.values()) def __repr__(self): - return 'union {\n\t%s\n}' % '\n\t'.join('%s %s;' % (name, repr(ty)) for name, ty in self.members.items()) + return 'union %s {\n\t%s\n}' % (self.name, '\n\t'.join('%s %s;' % (name, repr(ty)) for name, ty in self.members.items())) def _with_arch(self, arch): out = SimUnion({name: ty.with_arch(arch) for name, ty in self.members.items()}, self.label)
Fix SimUnion __init__ docstring and __repr__ definition (it includes union name in its representation)
py
diff --git a/penaltymodel_maxgap/tests/test_interface.py b/penaltymodel_maxgap/tests/test_interface.py index <HASH>..<HASH> 100644 --- a/penaltymodel_maxgap/tests/test_interface.py +++ b/penaltymodel_maxgap/tests/test_interface.py @@ -56,12 +56,3 @@ class TestInterface(unittest.TestCase): else: self.assertGreaterEqual(energy, widget.ground_energy + widget.classical_gap - 10**-6) - def test_nonzero_configuration(self): - """MaxGap is currently not supporting non-zero feasible states. This is checking that - non-zero feasible state problems don't get run. - """ - graph = nx.complete_graph(3) - spec = pm.Specification(graph, [0, 1], {(-1, 1): 0, (-1, -1): -2}, dimod.SPIN) - - with self.assertRaises(ImpossiblePenaltyModel): - maxgap.get_penalty_model(spec)
Remove test that checks the non-zero feasible state filter Since MaxGap now supports non-zero feasible states, we no longer need to filter out non-zero feasible state problems. Since the filter has been removed, this test is no longer valid.
py
diff --git a/test/sqlalchemy/test_suite.py b/test/sqlalchemy/test_suite.py index <HASH>..<HASH> 100644 --- a/test/sqlalchemy/test_suite.py +++ b/test/sqlalchemy/test_suite.py @@ -1,14 +1 @@ from sqlalchemy.testing.suite import * # noqa - -from sqlalchemy.testing.suite import RowFetchTest as _RowFetchTest - - -# This test isn't controllable with any requirements setting, -# so patch it out by hand. The failure relates to the fact that -# we return time zone offsets on timestamps that are not configured -# as "WITH TIME ZONE". -class RowFetchTest(_RowFetchTest): - def test_row_w_scalar_select(self): - pass - -del _RowFetchTest
Re-enable a test we now pass
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,11 @@ #!/usr/bin/env python from distutils.core import setup +for cmd in ('egg_info', 'develop'): + import sys + if cmd in sys.argv: + from setuptools import setup + version='1.2.2' setup(
allow to run egg_info & develop command
py
diff --git a/controller/api/tests/test_limits.py b/controller/api/tests/test_limits.py index <HASH>..<HASH> 100644 --- a/controller/api/tests/test_limits.py +++ b/controller/api/tests/test_limits.py @@ -1,14 +1,14 @@ import unittest -import re - -MEMLIMIT = re.compile(r'^(?P<mem>[0-9]+(MB|KB|GB|[BKMG]))$', re.IGNORECASE) +from api.serializers import MEMLIMIT_MATCH class TestLimits(unittest.TestCase): - - def test_upper(self): - self.assertTrue(MEMLIMIT.match("20MB")) - self.assertFalse(MEMLIMIT.match("20MK")) - self.assertTrue(MEMLIMIT.match("20gb")) - self.assertFalse(MEMLIMIT.match("20gK")) + """Tests the regex for unit format used by "deis limits:set --memory=<limit>". + """ + + def test_memlimit_regex(self): + self.assertTrue(MEMLIMIT_MATCH.match("20MB")) + self.assertFalse(MEMLIMIT_MATCH.match("20MK")) + self.assertTrue(MEMLIMIT_MATCH.match("20gb")) + self.assertFalse(MEMLIMIT_MATCH.match("20gK"))
ref(controller/tests): import regex to be tested, don't copy it
py
diff --git a/pychromecast/__init__.py b/pychromecast/__init__.py index <HASH>..<HASH> 100644 --- a/pychromecast/__init__.py +++ b/pychromecast/__init__.py @@ -62,7 +62,7 @@ def get_chromecasts(**filters): for key, val in filters.items(): for chromecast in cc_list: - for tup in [chromecast.device, chromecast.app]: + for tup in [chromecast.device, chromecast.status]: if hasattr(tup, key) and val != getattr(tup, key): excluded_cc.add(chromecast)
Detecting chromecasts while using filters was broken
py
diff --git a/nameko/containers.py b/nameko/containers.py index <HASH>..<HASH> 100644 --- a/nameko/containers.py +++ b/nameko/containers.py @@ -457,7 +457,7 @@ class ServiceContainer(object): if num_workers: _log.warning('killing %s active workers(s)', num_workers) - for worker_ctx, gt in self._worker_threads.items(): + for worker_ctx, gt in list(self._worker_threads.items()): _log.warning('killing active worker for %s', worker_ctx) gt.kill() @@ -470,7 +470,7 @@ class ServiceContainer(object): if num_threads: _log.warning('killing %s managed thread(s)', num_threads) - for gt, identifier in self._managed_threads.items(): + for gt, identifier in list(self._managed_threads.items()): _log.warning('killing managed thread `%s`', identifier) gt.kill()
wrap kill iterations in a list just in case we yield
py
diff --git a/werkzeug/urls.py b/werkzeug/urls.py index <HASH>..<HASH> 100644 --- a/werkzeug/urls.py +++ b/werkzeug/urls.py @@ -342,7 +342,7 @@ def url_fix(s, charset='utf-8'): s = s.encode(charset, 'replace') scheme, netloc, path, qs, anchor = urlsplit(s) path = url_quote(path, safe='/%') - qs = url_quote_plus(path, safe=':&%=') + qs = url_quote_plus(qs, safe=':&%=') return urlunsplit((scheme, netloc, path, qs, anchor))
Fix path instead of qs quoting in url_fix
py
diff --git a/test/integration/rget.py b/test/integration/rget.py index <HASH>..<HASH> 100755 --- a/test/integration/rget.py +++ b/test/integration/rget.py @@ -18,7 +18,7 @@ def gen_value(prefix, num): return prefix + value_padding + str(num).zfill(6) -value_line = line("^VALUE\s+([^\s]+)\s+(\d+)\s+(\d+)\r\n", [('key', 's'), ('flags', 'd'), ('length', 'd')]) +value_line = line("^VALUE\s+([^\s]+)\s+(\d+)\s+(\d+)\r\n$", [('key', 's'), ('flags', 'd'), ('length', 'd')]) def is_sorted_output(kvs): k = None for kv in kvs: @@ -44,7 +44,7 @@ def get_results(s): if not val_def: raise ValueError("received unexpected line from rget: %s" % l) val = f.read(val_def['length']) - if f.readline() != '\r\n': + if f.read(2) != '\r\n': raise ValueError("received unexpected line from rget (expected '\\r\\n'): %s" % l) res.append({'key': val_def['key'], 'value': val})
Fix rget test (Python readline reads more than expected on Python <I>)
py
diff --git a/trashcli/put.py b/trashcli/put.py index <HASH>..<HASH> 100644 --- a/trashcli/put.py +++ b/trashcli/put.py @@ -88,9 +88,9 @@ class TrashPutCmd: help="ignored (for GNU rm compatibility)") parser.add_option("-v", "--verbose", action="store_true", help="explain what is being done", dest="verbose") + original_print_help = parser.print_help def patched_print_help(): - encoding = parser._get_encoding(self.stdout) - self.stdout.write(parser.format_help().encode(encoding, "replace")) + original_print_help(self.stdout) def patched_error(msg): parser.print_usage(self.stderr) parser.exit(2, "%s: error: %s\n" % (program_name, msg))
Fixed python 3 incompatibility in patching OptionParser
py
diff --git a/openquake/calculators/risk/scenario_damage/core.py b/openquake/calculators/risk/scenario_damage/core.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/risk/scenario_damage/core.py +++ b/openquake/calculators/risk/scenario_damage/core.py @@ -56,6 +56,9 @@ class ScenarioDamageRiskCalculator(general.BaseRiskCalculator): fm = _fm(oq_job) + # temporary, will be removed + assert fm.format == "continuous" + dmg_states = list(fm.lss) dmg_states.insert(0, "no_damage")
Added check for continuous fragility model
py