diff
stringlengths
139
3.65k
message
stringlengths
8
627
diff_languages
stringclasses
1 value
diff --git a/datapackage/datapackage.py b/datapackage/datapackage.py index <HASH>..<HASH> 100644 --- a/datapackage/datapackage.py +++ b/datapackage/datapackage.py @@ -235,5 +235,5 @@ class DataPackage(object): # For each row we yield it as a dictionary where keys are the field # names and the value the value in that row for row in reader: - yield dict((field['id'], self._field_parser(field)(row[idx])) + yield dict((field['id'], self._field_parser(field)(row[idx].decode("utf-8"))) for idx, field in enumerate(resource_dict['fields']))
decode unicode - to make .data work for python <I>
py
diff --git a/tests/unit/test_udp.py b/tests/unit/test_udp.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_udp.py +++ b/tests/unit/test_udp.py @@ -25,7 +25,7 @@ def test_core(): def test_send(): h = vanilla.Hub() - N = 100 + N = 5 serve = h.udp.listen() @h.spawn
ease up on udp test just for the moment
py
diff --git a/vcstool/commands/command.py b/vcstool/commands/command.py index <HASH>..<HASH> 100644 --- a/vcstool/commands/command.py +++ b/vcstool/commands/command.py @@ -23,7 +23,7 @@ def add_common_arguments(parser, skip_hide_empty=False, single_path=False, path_ group = parser.add_argument_group('Common parameters') group.add_argument('--debug', action='store_true', default=False, help='Show debug messages') if not skip_hide_empty: - group.add_argument('--hide-empty', action='store_true', default=False, help='Hide repositories with empty output') + group.add_argument('-s', '--hide-empty', '--skip-empty', action='store_true', default=False, help='Hide repositories with empty output') group.add_argument('--repos', action='store_true', default=False, help='List repositories which the command operates on') if single_path: path_help = path_help or 'Base path to look for repositories'
add short option for --hide-empty, use -s and --skip-empty as a synonym
py
diff --git a/src/psd_tools/reader/layers.py b/src/psd_tools/reader/layers.py index <HASH>..<HASH> 100644 --- a/src/psd_tools/reader/layers.py +++ b/src/psd_tools/reader/layers.py @@ -18,7 +18,7 @@ logger = logging.getLogger(__name__) _LayerRecord = collections.namedtuple('LayerRecord', [ 'top', 'left', 'bottom', 'right', 'num_channels', 'channels', - 'blend_mode', 'opacity', 'cilpping', 'flags', + 'blend_mode', 'opacity', 'clipping', 'flags', 'mask_data', 'blending_ranges', 'name', 'tagged_blocks' ])
Typo is fixed. Thanks @oliverzheng. Fix #1.
py
diff --git a/nashvegas/management/commands/upgradedb.py b/nashvegas/management/commands/upgradedb.py index <HASH>..<HASH> 100644 --- a/nashvegas/management/commands/upgradedb.py +++ b/nashvegas/management/commands/upgradedb.py @@ -356,7 +356,8 @@ class Command(BaseCommand): if self.do_create_all: self.create_all_migrations() elif self.do_create: - self.create_migrations(self.databases) + assert len(self.databases) == 1 + self.create_migrations(self.databases[0]) if self.do_execute: self.execute_migrations()
--create can only work with a single database
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,6 @@ setup( author = 'Kirk Byers', install_requires = ['paramiko>=1.7.5'], description = 'Multi-vendor library to simplify Paramiko SSH connections to network devices', - packages = ['netmiko', 'netmiko/cisco', 'netmiko/arista'], + packages = ['netmiko', 'netmiko/cisco', 'netmiko/arista', 'netmiko/hp'], )
Missing HP package dependency in setup.py FIXES #<I>
py
diff --git a/varify/variants/translators.py b/varify/variants/translators.py index <HASH>..<HASH> 100644 --- a/varify/variants/translators.py +++ b/varify/variants/translators.py @@ -9,11 +9,19 @@ class AllowNullsTranslator(Translator): def translate(self, field, roperator, rvalue, tree, **kwargs): output = super(AllowNullsTranslator, self).translate( field, roperator, rvalue, tree, **kwargs) - # Create a null condition for this field - null_condition = trees[tree].query_condition( - field.field, 'isnull', True) - # Allow the null condition - output['query_modifiers']['condition'] |= null_condition + + # We are excluding nulls in the case of range, gt, and gte operators. + # If we did not do this, then null values would be included all the + # time which would be confusing, especially then they are included + # for both lt and gt queries as it appears nulls are simultaneously + # 0 and infinity. + if roperator not in ('range', 'gt', 'gte'): + # Create a null condition for this field + null_condition = trees[tree].query_condition( + field.field, 'isnull', True) + # Allow the null condition + output['query_modifiers']['condition'] |= null_condition + return output
Exclude nulls in translator when operator is range, gt, gte Previously, nulls were included in all cases making it appear that null was but 0 and infinity. Now, null is effectively treated as 0.
py
diff --git a/marabunta/database.py b/marabunta/database.py index <HASH>..<HASH> 100644 --- a/marabunta/database.py +++ b/marabunta/database.py @@ -10,11 +10,6 @@ import psycopg2 from collections import namedtuple from contextlib import contextmanager -if sys.version_info[0] == 3: - from urllib.parse import unquote_plus -else: - from urllib import unquote_plus - class Database(object):
Fix error with special chars in postgres dsn With unquote_plus, a password such as 'odoo+test' is modified as 'odoo test', there is no reason to use it. Besides, use kwargs instead of a string which is cleaner.
py
diff --git a/suds/version.py b/suds/version.py index <HASH>..<HASH> 100644 --- a/suds/version.py +++ b/suds/version.py @@ -22,5 +22,5 @@ See the setup.py script for more detailed information. """ -__version__ = "0.4.1 jurko 5 (development)" +__version__ = "0.4.1 jurko 5" __build__ = ""
Bumped up version information for the '<I> jurko 5' release.
py
diff --git a/lenses/ui/base.py b/lenses/ui/base.py index <HASH>..<HASH> 100644 --- a/lenses/ui/base.py +++ b/lenses/ui/base.py @@ -910,34 +910,3 @@ class BaseUiLens(Generic[S, T, A, B]): def __getitem__(self, name): # type: (Any) -> BaseUiLens[S, T, X, Y] return self.GetItem(name) - - both_ = Both - decode_ = Decode - each_ = Each - error_ = Error - f_ = F - filter_ = Filter - fold_ = Fold - fork_ = Fork - get_ = Get - getattr_ = GetAttr - getitem_ = GetItem - getzoomattr_ = GetZoomAttr - instance_ = Instance - iso_ = Iso - item_ = Item - item_by_value_ = ItemByValue - items_ = Items - iter_ = Iter - json_ = Json - just_ = Just - keys_ = Keys - lens_ = Lens - listwrap_ = ListWrap - norm_ = Norm - prism_ = Prism - recur_ = Recur - tuple_ = Tuple - values_ = Values - zoom_ = Zoom - zoomattr_ = ZoomAttr
removed deprecated underscore methods from ui
py
diff --git a/src/arcrest/ags/_networkservice.py b/src/arcrest/ags/_networkservice.py index <HASH>..<HASH> 100644 --- a/src/arcrest/ags/_networkservice.py +++ b/src/arcrest/ags/_networkservice.py @@ -202,7 +202,8 @@ class NetworkLayer(BaseAGSServer): _hasZ = None _supportedTravelModes = None _serviceLimits = None - + _defaultTravelMode = None + _trafficSupport = None #---------------------------------------------------------------------- def __init__(self, url, securityHandler=None, proxy_url=None, proxy_port=None, @@ -384,6 +385,18 @@ class NetworkLayer(BaseAGSServer): self.__init() return self._serviceLimits #---------------------------------------------------------------------- + @property + def defaultTravelMode(self): + if self._defaultTravelMode is None: + self.__init() + return self._defaultTravelMode + #---------------------------------------------------------------------- + @property + def trafficSupport(self): + if self._trafficSupport is None: + self.__init() + return self._trafficSupport + #---------------------------------------------------------------------- def retrieveTravelModes(self): """identify all the valid travel modes that have been defined on the network dataset or in the portal if the GIS server is federated"""
added defaultTravelMode and trafficSupport props added defaultTravelMode and trafficSupport props to Network Layer
py
diff --git a/ssbio/protein/structure/properties/residues.py b/ssbio/protein/structure/properties/residues.py index <HASH>..<HASH> 100644 --- a/ssbio/protein/structure/properties/residues.py +++ b/ssbio/protein/structure/properties/residues.py @@ -57,8 +57,11 @@ def search_ss_bonds(model, threshold=3.0): bridges = [] for cys_pair in pairs: - if cys_pair[0]['SG'] - cys_pair[1]['SG'] < threshold: - bridges.append(cys_pair) + try: + if cys_pair[0]['SG'] - cys_pair[1]['SG'] < threshold: + bridges.append(cys_pair) + except KeyError: # This will occur when a CYS residue is missing a SG atom for some reason + continue infodict = {} if bridges:
Skip over CYS residues with no SG atoms in find_disulfide_bridges (cherry picked from commit d<I>cebe)
py
diff --git a/slave/buildslave/commands/fs.py b/slave/buildslave/commands/fs.py index <HASH>..<HASH> 100644 --- a/slave/buildslave/commands/fs.py +++ b/slave/buildslave/commands/fs.py @@ -67,6 +67,10 @@ class RemoveDirectory(base.Command): """ header = "rmdir" + + def setup(self,args): + self.logEnviron = args.get('logEnviron',True) + def start(self): args = self.args @@ -155,6 +159,9 @@ class CopyDirectory(base.Command): header = "rmdir" + def setup(self,args): + self.logEnviron = args.get('logEnviron',True) + def start(self): args = self.args # args['todir'] is relative to Builder directory, and is required.
add logEnviron to fs build steps to fix broken tests
py
diff --git a/python/src/nnabla/parameter.py b/python/src/nnabla/parameter.py index <HASH>..<HASH> 100644 --- a/python/src/nnabla/parameter.py +++ b/python/src/nnabla/parameter.py @@ -195,7 +195,7 @@ def _create_parameter_by_initializer(initializer, shape, need_grad): if callable(initializer): assert shape is not None return nn.Variable.from_numpy_array( - initializer(shape=shape), need_grad=need_grad) + initializer(shape=list(map(int, shape))), need_grad=need_grad) # Invalid initialzier argument. raise ValueError(
fix support float outmap for PF.conv
py
diff --git a/kitty/data/report.py b/kitty/data/report.py index <HASH>..<HASH> 100644 --- a/kitty/data/report.py +++ b/kitty/data/report.py @@ -122,6 +122,8 @@ class Report(object): ''' res = {} for k, v in self._data_fields.items(): + if isinstance(v, unicode): + v = v.encode('utf-8') if type(v) == str: v = v.encode(encoding)[:-1] res[k] = v
encode unicode strings in the report
py
diff --git a/test/unit/test_api_vrrp.py b/test/unit/test_api_vrrp.py index <HASH>..<HASH> 100644 --- a/test/unit/test_api_vrrp.py +++ b/test/unit/test_api_vrrp.py @@ -720,6 +720,9 @@ class TestApiVrrp(EapiConfigUnitTest): [{'name': 'Ethernet1', 'action': 'disable', 'amount': 10}], [{'name': 'Ethernet1', 'action': 'decrement', 'amount': True}], [{'name': 'Ethernet1', 'action': 'shutdown', 'amount': 10}], + [{'action': 'decrement', 'amount': 10}], + [{'name': 'Ethernet1', 'action': 'decrement', + 'amount': 10, 'bad': 1}], ] for tracks in cases:
add negative key tests for set_tracks
py
diff --git a/lib/svtplay_dl/fetcher/rtmp.py b/lib/svtplay_dl/fetcher/rtmp.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/fetcher/rtmp.py +++ b/lib/svtplay_dl/fetcher/rtmp.py @@ -22,7 +22,9 @@ class RTMP(VideoRetriever): if self.options.resume: args.append("-e") - output(self.options, self.options.output, "flv", False) + file_d = output(self.options, self.options.output, "flv", False) + if file_d is None: + return args += ["-o", self.options.output] if self.options.silent or self.options.output == "-": args.append("-q")
rtmp: need to return nothing when file exists. this fixes #<I>
py
diff --git a/fontbakery-check-ttf.py b/fontbakery-check-ttf.py index <HASH>..<HASH> 100755 --- a/fontbakery-check-ttf.py +++ b/fontbakery-check-ttf.py @@ -2406,7 +2406,10 @@ def main(): fontdir = os.path.dirname(font_file) metadata = os.path.join(fontdir, "METADATA.pb") - if not os.path.exists(metadata): + if args.skip: + pass # ignore METADATA.pb checks since user has requested that + # we do not run googlefonts-specific checks + elif not os.path.exists(metadata): logging.error("{} is missing a METADATA.pb file!".format(filename)) else: family = get_FamilyProto_Message(metadata)
Do not run METADATA.pb checks if user has requested to skip googlefonts-specific checks fixes issue #<I>
py
diff --git a/jumeaux/notification_handlers/slack.py b/jumeaux/notification_handlers/slack.py index <HASH>..<HASH> 100644 --- a/jumeaux/notification_handlers/slack.py +++ b/jumeaux/notification_handlers/slack.py @@ -35,7 +35,7 @@ class SlackNotificationHandler(NotificationHandler): "text": message, "channel": self.channel, "username": self.username, - "icon_emoji": self.icon_emoji.get(), + "icon_emoji": self.icon_emoji.map(lambda x: f':{x}:').get(), "icon_url": self.icon_url.get(), "link_names": 1 })
:arrow_upper_right: No need to type `:` for `icon_emoji`
py
diff --git a/examples/control_test.py b/examples/control_test.py index <HASH>..<HASH> 100644 --- a/examples/control_test.py +++ b/examples/control_test.py @@ -215,7 +215,6 @@ class ControlExampleTest(jtu.JaxTestCase): self.assertAllClose(U[1:], np.zeros((T - 1, 2)), check_dtypes=True) - @jtu.skip_on_devices("cpu") # TODO(mattjj,froystig): only fails on travis? def testMpcWithLqrProblemSpecifiedGenerally(self): randn = onp.random.RandomState(0).randn dim, T, num_iters = 2, 10, 3 @@ -229,7 +228,6 @@ class ControlExampleTest(jtu.JaxTestCase): self.assertAllClose(U[1:], np.zeros((T - 1, 2)), check_dtypes=True) - @jtu.skip_on_devices("cpu") # TODO(mattjj,froystig): only fails on travis? def testMpcWithNonlinearProblem(self): def cost(t, x, u): return (x[0] ** 2. + 1e-3 * u[0] ** 2.) / (t + 1.)
try re-enabling control tests that trigger #<I>
py
diff --git a/tests/integration.py b/tests/integration.py index <HASH>..<HASH> 100644 --- a/tests/integration.py +++ b/tests/integration.py @@ -21,14 +21,14 @@ async def main(): response = await client.fetch_world_list() assert isinstance(response, tibiapy.TibiaResponse) assert isinstance(response.data, tibiapy.WorldOverview) - log.info(f"{len(response.data.worlds)} worlds found.") + log.info("{} worlds found.".format(len(response.data.worlds))) assert isinstance(response.data.record_count, int) assert response.data.record_count > 0 assert isinstance(response.data.record_date, datetime.datetime) selected = random.choice(response.data.worlds) assert isinstance(selected, tibiapy.ListedWorld) - log.info(f"World {selected.name} selected: {selected.online_count} online | {selected.pvp_type} | {selected.location}") + log.info("World {0.name} selected: {0.online_count} online | {0.pvp_type} | {0.location}".format(selected)) assert isinstance(selected.pvp_type, tibiapy.PvpType) assert isinstance(selected.location, tibiapy.WorldLocation) log.info("Fetching world...")
Fix integration tests breaking <I> compatibility
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,5 +25,6 @@ setup( 'Operating System :: OS Independent', 'Programming Language :: Python', 'Environment :: Web Environment', + 'Topic :: Text Processing :: Linguistic', ], )
[#<I>] Adding a category for PyPI
py
diff --git a/test.py b/test.py index <HASH>..<HASH> 100644 --- a/test.py +++ b/test.py @@ -1776,17 +1776,19 @@ exit(49) def test_cwd_fg(self): - td = tempfile.mkdtemp() + td = realpath(tempfile.mkdtemp()) py = create_tmp_test(""" import sh import os -orig = os.getcwd() +from os.path import realpath +orig = realpath(os.getcwd()) print(orig) sh.pwd(_cwd="{newdir}", _fg=True) -print(os.getcwd()) +print(realpath(os.getcwd())) """.format(newdir=td)) orig, newdir, restored = python(py.name).strip().split("\n") + newdir = realpath(newdir) self.assertEqual(newdir, td) self.assertEqual(orig, restored) self.assertNotEqual(orig, newdir)
must canonicalize path on macos for tempfiles
py
diff --git a/tests/laser/evm_testsuite/evm_test.py b/tests/laser/evm_testsuite/evm_test.py index <HASH>..<HASH> 100644 --- a/tests/laser/evm_testsuite/evm_test.py +++ b/tests/laser/evm_testsuite/evm_test.py @@ -16,11 +16,9 @@ def load_test_data(designation): return_data = [] for file_reference in (evm_test_dir / designation).iterdir(): - if file_reference.name.startswith('expPower'): + if file_reference.name.startswith('exp'): continue - if file_reference.name != "mulmod2_1.json": - continue - print("Reading: {}".format(file_reference.name)) + with file_reference.open() as file: top_level = json.load(file) @@ -75,5 +73,6 @@ def test_vmtest(test_name: str, pre_condition: dict, action: dict, post_conditio assert account.code.bytecode == details['code'][2:] for index, value in details['storage'].items(): - - assert get_concrete_int(account.storage[int(index, 16)]) == int(value, 16) + expected = int(value, 16) + actual = get_concrete_int(account.storage[int(index, 16)]) + assert actual == expected
Filter cases with exp for now, and make debugging easier
py
diff --git a/test/test_formatting.py b/test/test_formatting.py index <HASH>..<HASH> 100644 --- a/test/test_formatting.py +++ b/test/test_formatting.py @@ -19,9 +19,9 @@ class TestBasicFormatters(object): assert flatten(fragment('${"27"}')()) == "27\n" assert flatten(fragment('${"<html>"}')()) == "&lt;html&gt;\n" - def test_blessed_text(self): # FIXME: These can't start at the beginning of lines due to priority... - assert flatten(fragment('text #{"42"}')()) == "text 42\n" - assert flatten(fragment('text #{"<html>"}')()) == "text <html>\n" + def test_blessed_text(self): + assert flatten(fragment('#{"42"}')()) == "42\n" + assert flatten(fragment('#{"<html>"}')()) == "<html>\n" def test_json_object(self): assert flatten(fragment('@{[27,42]}')()) == "[27, 42]\n"
Fixme fixed; blessed text can now start at the beginning of a line.
py
diff --git a/openquake/utils/db/loader.py b/openquake/utils/db/loader.py index <HASH>..<HASH> 100644 --- a/openquake/utils/db/loader.py +++ b/openquake/utils/db/loader.py @@ -158,10 +158,10 @@ def parse_mfd(fault, mfd_java_obj): min_mag = mfd_java_obj.getMinX() - (delta / 2) max_mag = mfd_java_obj.getMaxX() + (delta / 2) total_cumul_rate = mfd_java_obj.getTotCumRate() - denominator = (numpy.power(10, -(mfd['b_val'] * min_mag)) + denominator = float(numpy.power(10, -(mfd['b_val'] * min_mag)) - numpy.power(10, -(mfd['b_val'] * max_mag))) - mfd['a_val'] = numpy.log10(total_cumul_rate / denominator) + mfd['a_val'] = float(numpy.log10(total_cumul_rate / denominator)) mfd['total_cumulative_rate'] = \ mfd_java_obj.getTotCumRate() / surface_area
fixed a minor bug with trying to use sqalchemy to insert numpy.float<I> type data the fix is a simple float cast
py
diff --git a/dist.py b/dist.py index <HASH>..<HASH> 100644 --- a/dist.py +++ b/dist.py @@ -534,10 +534,6 @@ class Distribution: objects. """ - if self.metadata.version is None: - raise DistutilsSetupError, \ - "No version number specified for distribution" - keywords = self.metadata.keywords if keywords is not None: if type(keywords) is StringType:
Back out the requirement to supply a version number
py
diff --git a/src/pyctools/components/qt/qtdisplay.py b/src/pyctools/components/qt/qtdisplay.py index <HASH>..<HASH> 100644 --- a/src/pyctools/components/qt/qtdisplay.py +++ b/src/pyctools/components/qt/qtdisplay.py @@ -51,6 +51,7 @@ class QtDisplay(QtActorMixin, QtGui.QLabel, ConfigMixin): ConfigMixin.__init__(self) self.logger = logging.getLogger(self.__class__.__name__) self.config['shrink'] = ConfigInt(min_value=1, dynamic=True) + self.config['expand'] = ConfigInt(min_value=1, dynamic=True) self.config['framerate'] = ConfigInt(min_value=1, value=25) self.timer = QtCore.QTimer(self) @@ -87,8 +88,10 @@ class QtDisplay(QtActorMixin, QtGui.QLabel, ConfigMixin): return pixmap = QtGui.QPixmap.fromImage(image) shrink = self.config['shrink'] - if shrink > 1: - pixmap = pixmap.scaled(xlen // shrink, ylen // shrink) + expand = self.config['expand'] + if shrink > 1 or expand > 1: + pixmap = pixmap.scaled( + xlen * expand // shrink, ylen * expand // shrink) self.resize(pixmap.size()) self.setPixmap(pixmap)
Added an 'expand' option to Qt viewer
py
diff --git a/src/mattermostdriver/websocket.py b/src/mattermostdriver/websocket.py index <HASH>..<HASH> 100644 --- a/src/mattermostdriver/websocket.py +++ b/src/mattermostdriver/websocket.py @@ -55,7 +55,7 @@ class Websocket: except websockets.ConnectionClosedError: self.disconnect() break - except (websockets.ConnectionClosedError, ConnectionRefusedError) as e: + except Exception as e: log.debug(f"Failed to establish websocket connection: {e}") await asyncio.sleep(self.options['timeout'])
Expanding `expect` clause to catch all exceptions
py
diff --git a/indra/statements.py b/indra/statements.py index <HASH>..<HASH> 100644 --- a/indra/statements.py +++ b/indra/statements.py @@ -2366,7 +2366,8 @@ class Influence(IncreaseAmount): def _influence_agent_str(agent, delta): if delta is not None: pol = delta.get('polarity') - agent_str = '%s(%s)' % (agent.name, pol) + pol_str = 'positive' if pol == 1 else 'negative' + agent_str = '%s(%s)' % (agent.name, pol_str) else: agent_str = agent.name return agent_str
Use positive/negative in Influence str
py
diff --git a/salt/states/pip_state.py b/salt/states/pip_state.py index <HASH>..<HASH> 100644 --- a/salt/states/pip_state.py +++ b/salt/states/pip_state.py @@ -58,13 +58,6 @@ if HAS_PIP is True: # pylint: enable=import-error - ver = pip.__version__.split('.') - pip_ver = tuple([int(x) for x in ver if x.isdigit()]) - if pip_ver >= (8, 0, 0): - from pip.exceptions import InstallationError - else: - InstallationError = ValueError - logger = logging.getLogger(__name__) # Define the module's virtual name
Remove duplicated code. This check exists twice in the code. Once is good enough for anyone.
py
diff --git a/pbs.py b/pbs.py index <HASH>..<HASH> 100644 --- a/pbs.py +++ b/pbs.py @@ -211,12 +211,10 @@ class Command(object): return self.path def __enter__(self): - if self.call_args["with"]: - Command.prepend_stack.append([self.path]) + Command.prepend_stack.append([self.path]) def __exit__(self, typ, value, traceback): - if self.call_args["with"] and Command.prepend_stack: - Command.prepend_stack.pop() + Command.prepend_stack.pop() def __call__(self, *args, **kwargs):
no need to check callargs on command object with context
py
diff --git a/salt/pillar/hiera.py b/salt/pillar/hiera.py index <HASH>..<HASH> 100644 --- a/salt/pillar/hiera.py +++ b/salt/pillar/hiera.py @@ -9,7 +9,7 @@ import logging # Import salt libs import salt.utils -from six import string_types +from salt.utils.six import string_types # Import third party libs import yaml
Replaced module six in file /salt/pillar/hiera.py
py
diff --git a/test/test_replica_set_client.py b/test/test_replica_set_client.py index <HASH>..<HASH> 100644 --- a/test/test_replica_set_client.py +++ b/test/test_replica_set_client.py @@ -676,7 +676,7 @@ class TestReplicaSetClient(TestReplicaSetClientBase, TestRequestMixin): try: timeout.pymongo_test.test.find_one(query) except AutoReconnect, e: - self.assertEqual('%s: timed out' % pair, e.args[0]) + self.assertTrue('%d: timed out' % (port,) in e.args[0]) else: self.fail('RS client should have raised timeout error') @@ -685,7 +685,7 @@ class TestReplicaSetClient(TestReplicaSetClientBase, TestRequestMixin): try: no_timeout.pymongo_test.test.find_one(query, network_timeout=0.1) except AutoReconnect, e: - self.assertEqual('%s: timed out' % pair, e.args[0]) + self.assertTrue('%d: timed out' % (port,) in e.args[0]) else: self.fail('RS client should have raised timeout error')
Fix rs network timeout test.
py
diff --git a/plaid/version.py b/plaid/version.py index <HASH>..<HASH> 100644 --- a/plaid/version.py +++ b/plaid/version.py @@ -1 +1 @@ -__version__ = '2.0.2' +__version__ = '2.0.3'
plaid-python@<I>
py
diff --git a/client/sources/ok_test/sqlite.py b/client/sources/ok_test/sqlite.py index <HASH>..<HASH> 100644 --- a/client/sources/ok_test/sqlite.py +++ b/client/sources/ok_test/sqlite.py @@ -115,11 +115,12 @@ class SqliteConsole(interpreter.Console): expected = expected.split('\n') actual = actual.split('\n') - if not self.ordered: - expected = set(expected) - actual = set(actual) + if self.ordered: + correct = expected == actual + else: + correct = sorted(expected) == sorted(actual) - if expected != actual: + if not correct: print() error_msg = '# Error: expected' if self.ordered:
Fix bug with duplicate and shuffled rows.
py
diff --git a/inquirer/render/console/_list.py b/inquirer/render/console/_list.py index <HASH>..<HASH> 100644 --- a/inquirer/render/console/_list.py +++ b/inquirer/render/console/_list.py @@ -21,10 +21,8 @@ class List(BaseConsoleRender): else: cchoices = choices - for choice in cchoices: - selected = choice == choices[self.current] - - if selected: + for index, choice in enumerate(cchoices): + if index == self.current: color = self.theme.List.selection_color symbol = self.theme.List.selection_cursor else:
Fixing correct detection of curent option in List
py
diff --git a/tests/functional/test.py b/tests/functional/test.py index <HASH>..<HASH> 100755 --- a/tests/functional/test.py +++ b/tests/functional/test.py @@ -158,13 +158,13 @@ def is_same_file(fname1, fname2, ignore_regexp=None, replace_regexp=None, replac if not result: if diff is None: diff = [] - diff.extend(difflib.unified_diff(r1, r2, fname1, fname2)) + diff.extend(difflib.unified_diff(r1, r2, fname1, fname2, lineterm="")) if PRINT_DIFF and not result: if VIM_DIFF: systemExec('gvimdiff %s %s' % (fname1, fname2)) else: - sys.stdout.write(''.join(diff)) + sys.stdout.write('\n'.join(diff) + '\n') return result
Update test tool Diff was not output correctly.
py
diff --git a/lib/svtplay_dl/__init__.py b/lib/svtplay_dl/__init__.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/__init__.py +++ b/lib/svtplay_dl/__init__.py @@ -14,7 +14,7 @@ from svtplay_dl.log import log from svtplay_dl.utils import decode_html_entities, filenamify, select_quality from svtplay_dl.service import service_handler, Generic from svtplay_dl.fetcher import VideoRetriever -from svtplay_dl.subtitle import subtitle, subtitle_json, subtitle_sami, subtitle_smi, subtitle_tt, subtitle_wsrt +from svtplay_dl.subtitle import subtitle __version__ = "0.9.2014.04.27"
init: removing unused imports.
py
diff --git a/example/example/wsgi.py b/example/example/wsgi.py index <HASH>..<HASH> 100644 --- a/example/example/wsgi.py +++ b/example/example/wsgi.py @@ -19,7 +19,7 @@ import os # if running multiple sites in the same mod_wsgi process. To fix this, use # mod_wsgi daemon mode with each site in its own daemon process, or use # os.environ["DJANGO_SETTINGS_MODULE"] = "test_project.settings" -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings") # This application object is used by any WSGI server configured to use this # file. This includes Django's development server, if the WSGI_APPLICATION
Fix bug in wsgi file
py
diff --git a/sgqlc/types/__init__.py b/sgqlc/types/__init__.py index <HASH>..<HASH> 100644 --- a/sgqlc/types/__init__.py +++ b/sgqlc/types/__init__.py @@ -1312,9 +1312,6 @@ class EnumMeta(BaseMeta): 'meta class to set enumeration attributes, __contains__, __iter__...' def __init__(cls, name, bases, namespace): super(EnumMeta, cls).__init__(name, bases, namespace) - if not cls.__choices__ and BaseType not in bases: - raise ValueError(name + ': missing __choices__') - if isinstance(cls.__choices__, str): cls.__choices__ = tuple(cls.__choices__.split()) else: @@ -1384,14 +1381,6 @@ class Enum(BaseType, metaclass=EnumMeta): >>> len(Fruits) 3 - Failing to define choices will raise exception: - - >>> class FailureEnum(Enum): - ... pass - Traceback (most recent call last): - ... - ValueError: FailureEnum: missing __choices__ - Enumerations have a special syntax in GraphQL, no quotes: >>> print(Fruits.__to_graphql_input__(Fruits.APPLE))
fix allow empty enums Seems shopify has it and we're failing. It was a "security measure", but not critical one. Fixes: #<I>
py
diff --git a/src/hdx/freshness/app/__main__.py b/src/hdx/freshness/app/__main__.py index <HASH>..<HASH> 100755 --- a/src/hdx/freshness/app/__main__.py +++ b/src/hdx/freshness/app/__main__.py @@ -27,7 +27,7 @@ def main( **ignore, ) -> None: """Run freshness. Either a database connection string (db_url) or database - connection parameters (db_params0 can be supplied. + connection parameters (db_params) can be supplied. Args: db_url (Optional[str]): Database connection string. Defaults to None.
Type hints, docstrings and comments added Renaming of some variables to better explain them
py
diff --git a/spyder/widgets/panels/manager.py b/spyder/widgets/panels/manager.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/panels/manager.py +++ b/spyder/widgets/panels/manager.py @@ -23,7 +23,7 @@ def _logger(): class PanelsManager(Manager): """ - Manages the list of panels and draws them inised the margin of the + Manages the list of panels and draws them inside the margin of the CodeEditor widget. """ def __init__(self, editor):
Fix little typo (inised -> inside)
py
diff --git a/java-iot/synth.py b/java-iot/synth.py index <HASH>..<HASH> 100644 --- a/java-iot/synth.py +++ b/java-iot/synth.py @@ -28,4 +28,6 @@ for version in versions: bazel_target=f'//google/cloud/{service}/{version}:google-cloud-{service}-{version}-java', ) -java.common_templates() +java.common_templates(excludes=[ + ".github/blunderbuss.yml", +])
chore: exclude blunderbuss from synth (#<I>)
py
diff --git a/mail_deduplicate/mail.py b/mail_deduplicate/mail.py index <HASH>..<HASH> 100644 --- a/mail_deduplicate/mail.py +++ b/mail_deduplicate/mail.py @@ -228,7 +228,7 @@ class DedupMail: """Renders into a table and in the same order, headers names and values used to produce mail's hash. - Returns a string ready to be printing to user or for debugging. + Returns a string ready for printing to the user or for debugging. """ table = [["Header ID", "Header value"]] + list(self.canonical_headers) return "\n" + tabulate(table, tablefmt="fancy_grid", headers="firstrow")
mail.py: some minor change in wording of pretty_canonical_headers desc
py
diff --git a/src/aspectlib/py3support.py b/src/aspectlib/py3support.py index <HASH>..<HASH> 100644 --- a/src/aspectlib/py3support.py +++ b/src/aspectlib/py3support.py @@ -43,7 +43,7 @@ def decorate_advising_generator_py3(advising_function, cutpoint_function, bind): try: advice = advisor.send(result) except StopIteration: - return + return result finally: gen.close() elif advice is Return:
Port the fix in <I>cae8 to Py3.
py
diff --git a/salt/states/pkg.py b/salt/states/pkg.py index <HASH>..<HASH> 100644 --- a/salt/states/pkg.py +++ b/salt/states/pkg.py @@ -1248,6 +1248,15 @@ def installed( 'result': True, 'comment': 'No packages to install provided'} + # If just a name (and optionally a version) is passed, just pack them into + # the pkgs argument. + if name and not any((pkgs, sources)): + if version: + pkgs = [{name: version}] + version = None + else: + pkgs = [name] + kwargs['saltenv'] = __env__ refresh = salt.utils.pkg.check_refresh(__opts__, refresh) if not isinstance(pkg_verify, list): @@ -1414,7 +1423,7 @@ def installed( if salt.utils.is_freebsd(): force = True # Downgrades need to be forced. try: - pkg_ret = __salt__['pkg.install'](name, + pkg_ret = __salt__['pkg.install'](name=None, refresh=refresh, version=version, force=force,
pkg.installed: pack name/version into pkgs argument This allows a version of 'latest' to work when just a name and version is passed.
py
diff --git a/simpleimages/utils.py b/simpleimages/utils.py index <HASH>..<HASH> 100644 --- a/simpleimages/utils.py +++ b/simpleimages/utils.py @@ -81,5 +81,6 @@ def transform_field(instance, source_field_name, destination_field_name, transfo destination_field.save( destination_name, new_image, + save=False ) instance.save(update_fields=[destination_field_name])
Shouldn't save model when saving transformed image field, because can't specify `update_fields`
py
diff --git a/examples/botexample.py b/examples/botexample.py index <HASH>..<HASH> 100755 --- a/examples/botexample.py +++ b/examples/botexample.py @@ -18,6 +18,10 @@ https://developer.ciscospark.com. The bot's Access Token should be added as a 'SPARK_ACCESS_TOKEN' environment variable on the web server hosting this script. +NOTE: While this script is written to support Python versions 2 and 3, as of +the time of this writing web.py (v0.38) only supports Python 2. +Therefore this script only supports Python 2. + """
Update botexample to call out Python 2-only support web.py only supports Python 2, therefore this script only supports Python 2.
py
diff --git a/tests/unit/core/ProjectTest.py b/tests/unit/core/ProjectTest.py index <HASH>..<HASH> 100644 --- a/tests/unit/core/ProjectTest.py +++ b/tests/unit/core/ProjectTest.py @@ -270,7 +270,7 @@ class ProjectTest: assert ~sp.any([len(item.props()) for item in proj]) proj._fetch_data() assert sp.any([len(item.props()) for item in proj]) - os.remove(self.proj.name+'.hdf5') + os.remove(proj.name+'.hdf5') if __name__ == '__main__':
fixing file delete due to wrong object name
py
diff --git a/tenant_schemas/template_loaders.py b/tenant_schemas/template_loaders.py index <HASH>..<HASH> 100644 --- a/tenant_schemas/template_loaders.py +++ b/tenant_schemas/template_loaders.py @@ -4,28 +4,28 @@ multi-tenant setting """ import hashlib + from django import VERSION as DJANGO_VERSION from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import connection +from django.template import TemplateDoesNotExist from django.template.base import Template from django.template.loaders.base import Loader as BaseLoader from django.utils._os import safe_join from django.utils.encoding import force_bytes + from tenant_schemas.postgresql_backend.base import FakeTenant -DJANGO_1_10 = DJANGO_VERSION[0] == 1 and DJANGO_VERSION[1] >= 10 +DJANGO_1_9 = DJANGO_VERSION[0] == 1 and DJANGO_VERSION[1] >= 9 -if DJANGO_1_10: - from django.template import Origin, TemplateDoesNotExist +if DJANGO_1_9: + from django.template import Origin def make_origin(engine, name, loader, template_name, dirs): return Origin(name=name, template_name=template_name, loader=loader) else: - from django.template.base import TemplateDoesNotExist - - def make_origin(engine, name, loader, template_name, dirs): return engine.make_origin(name, loader, template_name, dirs)
Django <I> Support
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ for dir in test_web_dirs: setup( cmdclass={'install': install}, name='selenium', - version="0.7", + version="2.0-dev", description='Python bindings for WebDriver', url='http://code.google.com/p/selenium/', package_dir={
Updating version number of py bindings to <I>-dev r<I>
py
diff --git a/salt/pillar/git_pillar.py b/salt/pillar/git_pillar.py index <HASH>..<HASH> 100644 --- a/salt/pillar/git_pillar.py +++ b/salt/pillar/git_pillar.py @@ -56,6 +56,10 @@ the repo's URL. Configuration details can be found below. Configuring git_pillar for Salt releases before 2015.8.0 ======================================================== +.. note:: + This legacy configuration for git_pillar will no longer be supported as of + the **Oxygen** release of Salt. + For Salt releases earlier than :ref:`2015.8.0 <release-2015-8-0>`, GitPython is the only supported provider for git_pillar. Individual repositories can be configured under the :conf_master:`ext_pillar` @@ -539,6 +543,14 @@ def _legacy_git_pillar(minion_id, repo_string, pillar_dirs): ''' Support pre-Beryllium config schema ''' + salt.utils.warn_until( + 'Oxygen', + 'The git ext_pillar configuration is deprecated. Please refer to the ' + 'documentation at ' + 'https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.git_pillar.html ' + 'for more information. This configuration will no longer be supported ' + 'as of the Oxygen release of Salt.' + ) if pillar_dirs is None: return # split the branch, repo name and optional extra (key=val) parameters.
Put legacy git_pillar on a deprecation path for Oxygen (#<I>) This adds a warning when legacy git_pillar is used, and a notice in the docs.
py
diff --git a/pyemma/thermo/api.py b/pyemma/thermo/api.py index <HASH>..<HASH> 100644 --- a/pyemma/thermo/api.py +++ b/pyemma/thermo/api.py @@ -694,7 +694,7 @@ def tram( callback=callback, init=init, init_maxiter=init_maxiter, init_maxerr=init_maxerr, equilibrium=equilibrium, overcounting_factor=overcounting_factor).estimate((ttrajs, dtrajs, bias)) tram_estimators.append(t) - pg.update(1) + pg.update(1) _assign_unbiased_state_label(tram_estimators, unbiased_state) # return if len(tram_estimators) == 1:
fix pg for multiple lags
py
diff --git a/fmn/lib/models.py b/fmn/lib/models.py index <HASH>..<HASH> 100644 --- a/fmn/lib/models.py +++ b/fmn/lib/models.py @@ -457,7 +457,10 @@ class Preference(BASE): @classmethod def by_detail(cls, session, detail_value): value = DetailValue.get(session, detail_value) - return value.preference + if value: + return value.preference + else: + return None @classmethod def create(cls, session, user, context, detail_value=None):
Fix case where this is called before confirmation has completed. ..in which case there is no Preference yet, only a Confirmation entry.
py
diff --git a/cm/chef.py b/cm/chef.py index <HASH>..<HASH> 100644 --- a/cm/chef.py +++ b/cm/chef.py @@ -37,8 +37,8 @@ try: _d[m[0]] = m[1].strip("'").strip('"') # set global variables from client.rb CHEF_SERVER_URL = _d['chef_server_url'] - CHEF_NODE_NAME = _d['node_name'] - CHEF_CLIENT_NAME = _d['node_name'] + CHEF_NODE_NAME = _d.get('node_name', socket.hostname()) + CHEF_CLIENT_NAME = _d.get('node_name', socket.hostname()) CHEF_VALIDATION_NAME = _d['validation_client_name'] # read the client key _client_pem_path = os.path.join(CHEF_CONFIG_PATH, 'client.pem')
Proposed fix for gh#<I>
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,9 @@ # -*- coding: UTF-8 -*- from distutils.core import setup from setuptools import find_packages -import time -_version = "0.1.dev%s" % int(time.time()) +_version = "0.1" _packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]) _short_description = "pylint-celery is a Pylint plugin to aid Pylint in recognising and understanding" \
Setting version number to release number <I>
py
diff --git a/hdf5storage/utilities.py b/hdf5storage/utilities.py index <HASH>..<HASH> 100644 --- a/hdf5storage/utilities.py +++ b/hdf5storage/utilities.py @@ -356,9 +356,9 @@ def write_object_array(f, data, options): def read_object_array(f, data, options): """ Reads an array of objects recursively. - Read the elements of the given HDF5 Reference array recursively - in the and constructs a ``numpy.object_`` array from its elements, - which is returned. + Reads the elements of the given HDF5 Reference array recursively + and constructs a ``numpy.object_`` array from its elements, which is + returned. Parameters ----------
Made the docstring of utilities.read_object_array more clear.
py
diff --git a/animanager/config.py b/animanager/config.py index <HASH>..<HASH> 100644 --- a/animanager/config.py +++ b/animanager/config.py @@ -140,6 +140,6 @@ class Config(BaseConfig): """Directory to trash anime files.""" return self.config.getpath('trashdir') - def player(self): + def player_args(self): """Video player to use.""" - return self.config.get('player') + return self.config.getargs('player')
Use player_args instead of player
py
diff --git a/sem/manager.py b/sem/manager.py index <HASH>..<HASH> 100644 --- a/sem/manager.py +++ b/sem/manager.py @@ -2,7 +2,7 @@ from .database import DatabaseManager from .runner import SimulationRunner from .parallelrunner import ParallelRunner from .utils import DRMAA_AVAILABLE, list_param_combinations -from git import Repo +from git import Repo, exc from copy import deepcopy from tqdm import tqdm from random import shuffle @@ -448,7 +448,13 @@ class CampaignManager(object): # dirty if self.runner is not None: path = self.runner.path - repo = Repo(path) + try: + repo = Repo(path) + except(exc.InvalidGitRepositoryError): + raise Exception("No git repository detected.\nIn order to " + "use SEM and its reproducibility enforcing " + "features, please create a git repository at " + "the root of your ns-3 project.") current_commit = repo.head.commit.hexsha campaign_commit = self.db.get_commit()
Print a meaningful message when no git repo is found
py
diff --git a/test/test_contrib/test_jira_renderer.py b/test/test_contrib/test_jira_renderer.py index <HASH>..<HASH> 100644 --- a/test/test_contrib/test_jira_renderer.py +++ b/test/test_contrib/test_jira_renderer.py @@ -54,7 +54,7 @@ class TestJIRARenderer(TestCase): self.textFormatTest('*a{}*', '_a{}_') def test_render_inline_code(self): - self.textFormatTest('`a{}`', '{{{{a{}}}}}') + self.textFormatTest('`a{}b`', '{{{{a{}b}}}}') def test_render_strikethrough(self): self.textFormatTest('-{}-', '-{}-')
fixed: inline code should strip whitespace at end
py
diff --git a/cqlengine/named.py b/cqlengine/named.py index <HASH>..<HASH> 100644 --- a/cqlengine/named.py +++ b/cqlengine/named.py @@ -1,6 +1,8 @@ from cqlengine.exceptions import CQLEngineException from cqlengine.query import AbstractQueryableColumn, SimpleQuerySet +from cqlengine.query import DoesNotExist as _DoesNotExist +from cqlengine.query import MultipleObjectsReturned as _MultipleObjectsReturned class QuerySetDescriptor(object): """ @@ -54,6 +56,9 @@ class NamedTable(object): objects = QuerySetDescriptor() + class DoesNotExist(_DoesNotExist): pass + class MultipleObjectsReturned(_MultipleObjectsReturned): pass + def __init__(self, keyspace, name): self.keyspace = keyspace self.name = name
adding does not exist and multiple objects returns exceptions to named table
py
diff --git a/symengine/tests/test_expr.py b/symengine/tests/test_expr.py index <HASH>..<HASH> 100644 --- a/symengine/tests/test_expr.py +++ b/symengine/tests/test_expr.py @@ -4,7 +4,7 @@ from symengine.utilities import raises def test_as_coefficients_dict(): x = Symbol('x') y = Symbol('y') - check = [x, y, x*y, 1] + check = [x, y, x*y, Integer(1)] assert [(3*x + 2*x + y + 3).as_coefficients_dict()[i] for i in check] == \ [5, 1, 0, 3] assert [(3*x*y).as_coefficients_dict()[i] for i in check] == \
test a hypothesis for a test failure
py
diff --git a/rfxcom/__init__.py b/rfxcom/__init__.py index <HASH>..<HASH> 100644 --- a/rfxcom/__init__.py +++ b/rfxcom/__init__.py @@ -7,4 +7,4 @@ The base package used by the rfxcom library. """ #: A PEP 396 compatible version string. -__version__ = '0.2.3' +__version__ = '0.3.0'
Version <I> with better setup.
py
diff --git a/plucky/__init__.py b/plucky/__init__.py index <HASH>..<HASH> 100644 --- a/plucky/__init__.py +++ b/plucky/__init__.py @@ -3,7 +3,7 @@ Plucking (deep) keys/paths safely from python collections has never been easier. """ __title__ = 'plucky' -__version__ = '0.3.2' +__version__ = '0.3.3' __author__ = 'Radomir Stevanovic' __author_email__ = 'radomir.stevanovic@gmail.com' __copyright__ = 'Copyright 2014 Radomir Stevanovic'
bumped to <I>
py
diff --git a/publ/entry.py b/publ/entry.py index <HASH>..<HASH> 100644 --- a/publ/entry.py +++ b/publ/entry.py @@ -306,13 +306,13 @@ class Entry(caching.Memoizable): def more(self): """ Get the below-the-fold entry body text """ _, more, is_markdown = self._entry_content - return TrueCallableProxy( - lambda **kwargs: self._get_markup( - more, is_markdown, - **{'footnotes_defer': False, - 'footnotes_link': False, - **kwargs}) - ) if more else CallableProxy(None) + + def _more(**kwargs): + if kwargs.get('absolute') and 'footnote_links' not in kwargs: + kwargs = {'footnotes_link': self.link(absolute=True), **kwargs} + return self._get_markup(more, is_markdown, **kwargs) + + return TrueCallableProxy(_more) if more else CallableProxy(None) @cached_property def card(self):
In an absolute context, default to the entry link for entry.more too
py
diff --git a/discord/message.py b/discord/message.py index <HASH>..<HASH> 100644 --- a/discord/message.py +++ b/discord/message.py @@ -72,7 +72,7 @@ class Attachment: self._http = state.http @asyncio.coroutine - def save(self, fp): + def save(self, fp, *, seek_begin=True): """|coro| Saves this attachment into a file-like object. @@ -83,6 +83,9 @@ class Attachment: The file-like object to save this attachment to or the filename to use. If a filename is passed then a file is created with that filename and used instead. + seek_begin: bool + Whether to seek to the beginning of the file after saving is + successfully done. Raises -------- @@ -102,7 +105,10 @@ class Attachment: with open(fp, 'wb') as f: return f.write(data) else: - return fp.write(data) + written = fp.write(data) + if seek_begin: + fp.seek(0) + return written class Message: """Represents a message from Discord.
Add seek_begin keyword argument to Attachment.save
py
diff --git a/docs/build_generated_docs.py b/docs/build_generated_docs.py index <HASH>..<HASH> 100644 --- a/docs/build_generated_docs.py +++ b/docs/build_generated_docs.py @@ -78,7 +78,13 @@ def build_iam_policy(checker): ======================== Below is the sample IAM policy from this version of awslimitchecker, listing the IAM - permissions required for it to function correctly: + permissions required for it to function correctly. Please note that in some cases + awslimitchecker may cause AWS services to make additional API calls on your behalf + (such as when enumerating ElasticBeanstalk resources, the ElasticBeanstalk service + itself will make ``s3:ListBucket`` and ``s3:GetBucketLocation`` calls). The policy + below includes only the bare minimum permissions for awslimitchecker to function + properly, and does not include permissions for any side-effect calls made by AWS + services that do not affect the results of this program. .. code-block:: json
Fixes #<I> - add documentation on side-effect API calls made by AWS services
py
diff --git a/satpy/scene.py b/satpy/scene.py index <HASH>..<HASH> 100644 --- a/satpy/scene.py +++ b/satpy/scene.py @@ -703,13 +703,13 @@ class Scene(MetadataObject): source_area = dataset.attrs['area'] if source_area not in resamplers: key, resampler = prepare_resampler( - source_area, destination_area, resampler=resampler, - **resample_kwargs) + source_area, destination_area, **resample_kwargs) resamplers[source_area] = resampler self.resamplers[key] = resampler - resample_kwargs['resampler'] = resamplers[source_area] + kwargs = resample_kwargs.copy() + kwargs['resampler'] = resamplers[source_area] res = resample_dataset(dataset, destination_area, - **resample_kwargs) + **kwargs) new_datasets[ds_id] = res if parent_dataset is None: new_scn[ds_id] = res
Fix resampling wthen resampler type is provided
py
diff --git a/salt/states/file.py b/salt/states/file.py index <HASH>..<HASH> 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -232,7 +232,8 @@ def _source_list(source, source_hash, env): source = single_src break elif proto.startswith('http') or proto == 'ftp': - dest = tempfile.mkstemp()[1] + fd_, dest = tempfile.mkstemp() + fd_.close() fn_ = __salt__['cp.get_url'](single_src, dest) os.remove(fn_) if fn_:
clean up mkstemp in file state
py
diff --git a/salt/states/smartos.py b/salt/states/smartos.py index <HASH>..<HASH> 100644 --- a/salt/states/smartos.py +++ b/salt/states/smartos.py @@ -67,7 +67,7 @@ def _load_config(): config = {} if os.path.isfile('/usbkey/config'): - with open('/usbkey/config', 'r') as config_file: + with salt.utils.fopen('/usbkey/config', 'r') as config_file: for optval in config_file: if optval[0] == '#': continue @@ -83,7 +83,7 @@ def _write_config(config): ''' writes /usbkey/config ''' - with open('/usbkey/config.salt', 'w') as config_file: + with salt.utils.fopen('/usbkey/config.salt', 'w') as config_file: config_file.write("#\n# This file was generated by salt\n#\n") for prop in OrderedDict(sorted(config.items())): config_file.write("{0}={1}\n".format(prop, config[prop]))
switch to salt.utils.fopen for _read_config and _write_config
py
diff --git a/cqlengine/management.py b/cqlengine/management.py index <HASH>..<HASH> 100644 --- a/cqlengine/management.py +++ b/cqlengine/management.py @@ -228,13 +228,19 @@ def get_fields(model): col_family = model.column_family_name(include_keyspace=False) with connection_manager() as con: - query = "SELECT column_name, validator FROM system.schema_columns \ + query = "SELECT * FROM system.schema_columns \ WHERE keyspace_name = :ks_name AND columnfamily_name = :col_family" logger.debug("get_fields %s %s", ks_name, col_family) tmp = con.execute(query, {'ks_name': ks_name, 'col_family': col_family}, ONE) - return [Field(x[0], x[1]) for x in tmp.results] + + column_indices = [tmp.columns.index('column_name'), tmp.columns.index('validator')] + try: + type_index = tmp.columns.index('type') + return [Field(x[column_indices[0]], x[column_indices[1]]) for x in tmp.results if x[type_index] == 'regular'] + except ValueError: + return [Field(x[column_indices[0]], x[column_indices[1]]) for x in tmp.results] # convert to Field named tuples
Updated get_fields to be <I> compatible
py
diff --git a/solc/wrapper.py b/solc/wrapper.py index <HASH>..<HASH> 100644 --- a/solc/wrapper.py +++ b/solc/wrapper.py @@ -48,7 +48,8 @@ def solc_wrapper(solc_binary=None, formal=None, allow_paths=None, standard_json=None, - success_return_code=0): + success_return_code=0, + evm_version=None): if solc_binary is None: solc_binary = get_solc_binary_path() @@ -149,6 +150,9 @@ def solc_wrapper(solc_binary=None, # see Scanner class in Solidity source stdin = force_bytes(stdin, 'utf8') + if evm_version: + command.extend(('--evm-version', evm_version)) + proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
added flag evm-verison to solc_wrapper
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 @@ -576,11 +576,7 @@ def create_default_connections(session=None): def initdb(session=None): """Initialize Airflow database.""" upgradedb(session=session) - filldb() - -@provide_session -def filldb(session=None): if conf.getboolean('core', 'LOAD_DEFAULT_CONNECTIONS'): create_default_connections(session=session)
Chore: Some code cleanup in `airflow/utils/db.py` (#<I>) As part of <URL>
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,7 @@ setup( "attrdict>=2.0.0,<3", "eth-abi>=2.0.0b7,<3", "eth-keyfile>=0.5.0,<0.6.0", - "eth-keys>=0.2.1,<0.3.0", + "eth-keys>=0.2.1,<0.4.0", "eth-rlp>=0.1.2,<1", "eth-utils>=1.3.0,<2", "hexbytes>=0.1.0,<1",
Upgrade eth-keys to <I> But continue support for <I>.*
py
diff --git a/socketIO_client/transports.py b/socketIO_client/transports.py index <HASH>..<HASH> 100644 --- a/socketIO_client/transports.py +++ b/socketIO_client/transports.py @@ -96,7 +96,7 @@ class XHR_PollingTransport(AbstractTransport): params=params, data=memoryview(data), **self._kw_post) - assert response.content == b'ok' + assert response.content.lower() == b'ok' def _get_timestamp(self): with self._request_index_lock:
Some socket.io projects send upercased OK
py
diff --git a/salt/states/file.py b/salt/states/file.py index <HASH>..<HASH> 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -4109,7 +4109,8 @@ def copy( hash1 = salt.utils.get_hash(name) hash2 = salt.utils.get_hash(source) if hash1 == hash2: - changed = False + changed = True + ret['comment'] = ' '.join([ret['comment'], '- files are identical but force flag is set']) if not force: changed = False elif not __opts__['test'] and changed:
backport #<I> to <I> (#<I>)
py
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import epc setup( name='epc', version=epc.__version__, - packages=['epc'], + packages=['epc', 'epc.tests'], author=epc.__author__, author_email='aka.tkf@gmail.com', url='https://github.com/tkf/python-epc',
Include epc.tests in package
py
diff --git a/sirmordred/_version.py b/sirmordred/_version.py index <HASH>..<HASH> 100644 --- a/sirmordred/_version.py +++ b/sirmordred/_version.py @@ -1,2 +1,2 @@ # Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440 -__version__ = "0.2.9" +__version__ = "0.2.10"
[release] Update version number to <I>
py
diff --git a/chempy/kinetics/tests/test_ode.py b/chempy/kinetics/tests/test_ode.py index <HASH>..<HASH> 100644 --- a/chempy/kinetics/tests/test_ode.py +++ b/chempy/kinetics/tests/test_ode.py @@ -755,7 +755,7 @@ def test_get_odesys__Eyring_2nd_order(): @requires('pycvodes', 'sym', 'scipy', units_library) -def _test_get_odesys__Eyring_1st_order_linearly_ramped_temperature(): +def test_get_odesys__Eyring_1st_order_linearly_ramped_temperature(): from scipy.special import expi def analytic_unit0(t, T0, dH, dS): @@ -806,7 +806,7 @@ def _test_get_odesys__Eyring_1st_order_linearly_ramped_temperature(): @requires('pycvodes', 'sym', 'scipy', units_library) -def _test_get_odesys__Eyring_2nd_order_linearly_ramped_temperature(): +def test_get_odesys__Eyring_2nd_order_linearly_ramped_temperature(): from scipy.special import expi def analytic_unit0(t, k, m, dH, dS):
Re-enable Eyring tests
py
diff --git a/mbed/mbed.py b/mbed/mbed.py index <HASH>..<HASH> 100644 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -816,6 +816,7 @@ class Git(object): for ref in refs: m = re.match(r'^(.+)\s+refs\/tags\/(.+)$', ref) if m and (not rev or m.group(1).startswith(rev)): + t = m.group(2) if re.match(r'^(.+)\^\{\}$', t): # detect tag "pointer" t = re.sub(r'\^\{\}$', '', t) # remove "pointer" chars, e.g. some-tag^{} for tag in tags:
Fix variable bug introduce with regex simplification
py
diff --git a/djedi/plugins/img.py b/djedi/plugins/img.py index <HASH>..<HASH> 100644 --- a/djedi/plugins/img.py +++ b/djedi/plugins/img.py @@ -74,7 +74,7 @@ class ImagePluginBase(BasePlugin): try: box = tuple(int(x) for x in crop.split(',')) image = image.crop(box) - except: + except Exception: pass # TODO: Handle image crop error else: filename = self._create_filename(filename, crop=crop) @@ -84,7 +84,7 @@ class ImagePluginBase(BasePlugin): if (width and width != i_width) or (height and height != i_height): try: image = image.resize((width, height), Image.ANTIALIAS) - except: + except Exception: pass else: filename = self._create_filename(filename, w=width, h=height)
Fix E<I> warnings.
py
diff --git a/arviz/__init__.py b/arviz/__init__.py index <HASH>..<HASH> 100644 --- a/arviz/__init__.py +++ b/arviz/__init__.py @@ -1,6 +1,6 @@ # pylint: disable=wildcard-import,invalid-name,wrong-import-position """ArviZ is a library for exploratory analysis of Bayesian models.""" -__version__ = "0.3.3" +__version__ = "0.4.0" import os import logging
Increment version number to <I> (#<I>)
py
diff --git a/mongoctl/objects/replicaset_cluster.py b/mongoctl/objects/replicaset_cluster.py index <HASH>..<HASH> 100644 --- a/mongoctl/objects/replicaset_cluster.py +++ b/mongoctl/objects/replicaset_cluster.py @@ -728,7 +728,9 @@ class ReplicaSetCluster(Cluster): } if self.repl_set_config_settings: - cmd["settings"] = self.repl_set_config_settings + settings = (current_rs_conf and current_rs_conf.get("settings")) or {} + settings.update(self.repl_set_config_settings) + cmd["settings"] = settings return cmd
rs-conf: merge configured settings with existing settings instead of override
py
diff --git a/pkutils.py b/pkutils.py index <HASH>..<HASH> 100644 --- a/pkutils.py +++ b/pkutils.py @@ -31,7 +31,7 @@ from functools import total_ordering import semver -__version__ = "3.0.1" +__version__ = "3.0.2" __author__ = "Reuben Cummings" __description__ = "Python packaging utility library"
Bump to version <I>
py
diff --git a/backtrader/broker/bbroker.py b/backtrader/broker/bbroker.py index <HASH>..<HASH> 100644 --- a/backtrader/broker/bbroker.py +++ b/backtrader/broker/bbroker.py @@ -358,6 +358,8 @@ class BrokerBack(BrokerBase): else: # Execution depends on volume filler size = self.p.filler(order, price, ago) + if not order.isbuy(): + size = -size # Get comminfo object for the data comminfo = self.getcommissioninfo(order.data)
Fully Address #<I>. Take into account order side when considering the return of a volume filler
py
diff --git a/simpycity/model.py b/simpycity/model.py index <HASH>..<HASH> 100644 --- a/simpycity/model.py +++ b/simpycity/model.py @@ -10,7 +10,6 @@ def d_out(text): class Construct(object): config = None - handle = None def __init__(self, config=None, handle=None, *args,**kwargs): """ @@ -24,17 +23,25 @@ class Construct(object): if not self.config: self.config = config or g_config - if not self.handle: - self.handle = handle or self.config.handle_factory(config=self.config) + self.init_handle = handle + @property + def handle(self): + if not self.init_handle: + self.init_handle = self.config.handle_factory(config=self.config) + + return self.init_handle + def commit(self): if self.handle is not None: self.handle.commit() else: raise AttributeError("Cannot call commit without localized handle.") + def close(self): - self.handle.close() + if self.init_handle: + self.init_handle.close() def rollback(self): if self.handle is not None:
Lazy-init handle in the model.
py
diff --git a/endpoints/__init__.py b/endpoints/__init__.py index <HASH>..<HASH> 100644 --- a/endpoints/__init__.py +++ b/endpoints/__init__.py @@ -33,4 +33,4 @@ from .users_id_token import get_current_user, get_verified_jwt, convert_jwks_uri from .users_id_token import InvalidGetUserCall from .users_id_token import SKIP_CLIENT_ID_CHECK -__version__ = '2.4.4' +__version__ = '2.4.5'
Bump subminor version (<I> -> <I>) (#<I>) Fixes tests for versions of Python where logging.debug() was calling time.time(). Adds extra imports to the base endpoints package.
py
diff --git a/rollyourown/seo/admin.py b/rollyourown/seo/admin.py index <HASH>..<HASH> 100644 --- a/rollyourown/seo/admin.py +++ b/rollyourown/seo/admin.py @@ -69,12 +69,27 @@ def register_seo_admin(admin_site, metadata_class): admin_site.register(metadata_class._meta.get_model('view'), ViewAdmin) +class MetadataFormset(generic.BaseGenericInlineFormSet): + def _construct_form(self, i, **kwargs): + """ Override the method to change the form attribute empty_permitted """ + form = super(MetadataFormset, self)._construct_form(i, **kwargs) + # Monkey patch the form to always force a save. + # It's unfortunate, but necessary because we always want an instance + # Affect on performance shouldn't be too great, because ther is only + # ever one metadata attached + form.empty_permitted = False + form.has_changed = lambda: True + return form + + def get_inline(metadata_class): attrs = { 'max_num': 1, + 'extra': 1, 'model': metadata_class._meta.get_model('modelinstance'), 'ct_field': "_content_type", 'ct_fk_field': "_object_id", + 'formset': MetadataFormset, } return type('MetadataInline', (generic.GenericStackedInline,), attrs)
Inlines now always save a metadata instance, meaning that the model metadata will work for models where no metadata is specified (so long as they are added or edited in the admin).
py
diff --git a/parsl/addresses.py b/parsl/addresses.py index <HASH>..<HASH> 100644 --- a/parsl/addresses.py +++ b/parsl/addresses.py @@ -10,7 +10,10 @@ import logging import platform import requests import socket -import fcntl +try: + import fcntl +except ImportError: + fcntl = None # type: ignore import struct import typeguard import psutil @@ -85,6 +88,7 @@ def address_by_interface(ifname: str) -> str: Name of the interface whose address is to be returned. Required. """ + assert fcntl is not None, "This function is not supported on your OS." s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) return socket.inet_ntoa(fcntl.ioctl( s.fileno(),
Improve support for Windows (#<I>) Changes made in my efforts to get Parsl working minimally on Windows. Do not crash when fcntl is not found. Addresses #<I>, though I would not claim I will fix it completely.
py
diff --git a/examples/classifier/modelprocess2.py b/examples/classifier/modelprocess2.py index <HASH>..<HASH> 100644 --- a/examples/classifier/modelprocess2.py +++ b/examples/classifier/modelprocess2.py @@ -48,7 +48,7 @@ Y = Y.ravel() X_train, X_test, Y_train, Y_test = train_test_split(X,Y) scaler = StandardScaler() scaler.fit(X_train) - +joblib.dump(scaler,'test_scaler.pkl')#scaler Dump for webapps print("Size of Training set => %d"%X_train.shape[0]) print("Size of Test set => %d"%X_test.shape[0]) @@ -66,7 +66,7 @@ nn = MLPClassifier(hidden_layer_sizes=(8,8,7),solver='lbfgs')#activation='logist # max_iter=500,solver='sgd',activation='logistic') print(nn) nn.fit(X_train,Y_train) -joblib.dump(nn,'nn-%s.pkl'%time.ctime()) +joblib.dump(nn,'nn-%s.pkl'%time.ctime())#change dump name to test_nn.pkl for webapps Y_pred = nn.predict(X_test) print(" accuracy => ",accuracy_score(Y_pred.ravel(),Y_test))
Create scaler dump for webapps
py
diff --git a/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py b/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py index <HASH>..<HASH> 100644 --- a/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py +++ b/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py @@ -331,7 +331,7 @@ class KubernetesState(OpenMetricsBaseCheck): else: node = self._label_to_tag('node', sample[self.SAMPLE_LABELS], scraper_config) condition = self._label_to_tag('condition', sample[self.SAMPLE_LABELS], scraper_config) - message = "{} is currently reporting {}".format(node, condition) + message = "{} is currently reporting {} = {}".format(node, condition, label_value) if condition_map['service_check_name'] is None: self.log.debug("Unable to handle {} - unknown condition {}".format(service_check_name, label_value))
include node condition value in check message (#<I>)
py
diff --git a/src/transformers/generation_stopping_criteria.py b/src/transformers/generation_stopping_criteria.py index <HASH>..<HASH> 100644 --- a/src/transformers/generation_stopping_criteria.py +++ b/src/transformers/generation_stopping_criteria.py @@ -35,7 +35,7 @@ class StoppingCriteria(ABC): """Abstract base class for all stopping criteria that can be applied during generation.""" @add_start_docstrings(STOPPING_CRITERIA_INPUTS_DOCSTRING) - def __call__(self, input_ids: torch.LongTensor, score: torch.FloatTensor, **kwargs) -> bool: + def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool: raise NotImplementedError("StoppingCriteria needs to be subclassed")
Fix StoppingCriteria ABC signature (#<I>) Change `score` -> `scores` because the argument is not positional-only, so you need consistently named parameters for the subclasses. The subclasses appear to favor `scores` over `score`.
py
diff --git a/pandas/core/groupby/ops.py b/pandas/core/groupby/ops.py index <HASH>..<HASH> 100644 --- a/pandas/core/groupby/ops.py +++ b/pandas/core/groupby/ops.py @@ -1047,7 +1047,6 @@ class BinGrouper(BaseGrouper): ---------- bins : the split index of binlabels to group the item of axis binlabels : the label list - filter_empty : bool, default False mutated : bool, default False indexer : np.ndarray[np.intp] @@ -1069,17 +1068,20 @@ class BinGrouper(BaseGrouper): """ + bins: np.ndarray # np.ndarray[np.int64] + binlabels: Index + mutated: bool + def __init__( self, bins, binlabels, - filter_empty: bool = False, mutated: bool = False, indexer=None, ): self.bins = ensure_int64(bins) self.binlabels = ensure_index(binlabels) - self._filter_empty_groups = filter_empty + self._filter_empty_groups = False self.mutated = mutated self.indexer = indexer
CLN: remove unused filter_empty from BinGrouper (#<I>)
py
diff --git a/ontquery/__init__.py b/ontquery/__init__.py index <HASH>..<HASH> 100644 --- a/ontquery/__init__.py +++ b/ontquery/__init__.py @@ -914,12 +914,12 @@ class SciCrunchRemote(SciGraphRemote): class InterLexRemote(OntService): # note to self - host = 'uri.interlex.org' - port = '' - host_port = f'{host}:{port}' if port else host known_inverses = ('', ''), - def __init__(self, *args, **kwargs): + def __init__(self, *args, host='uri.interlex.org', port='', **kwargs): + self.host = host + self.port = port + import rdflib # FIXME self.Graph = rdflib.Graph self.RDF = rdflib.RDF @@ -934,6 +934,10 @@ class InterLexRemote(OntService): # note to self super().__init__(*args, **kwargs) @property + def host_port(self): + return f'{self.host}:{self.port}' if self.port else self.host + + @property def predicates(self): return {} # TODO
ilx remote host and port at construction rather than spec time
py
diff --git a/tests/engine2_test.py b/tests/engine2_test.py index <HASH>..<HASH> 100644 --- a/tests/engine2_test.py +++ b/tests/engine2_test.py @@ -150,20 +150,7 @@ random_seed=0 'maximum_distance': '0' } - params, expected_files = engine2.parse_config(source) - - # In order for us to reuse the existing input, we need to associate - # each input with a successful job. - job = engine2.prepare_job(getpass.getuser()) - - job.hazard_calculation = engine2.create_hazard_calculation( - job.owner, params, expected_files.values()) - job.status = 'complete' - job.save() - - source.seek(0) params, files = engine2.parse_config(source) - self.assertEqual(expected_params, params) self.assertEqual(['site_model_file'], files.keys()) self.assertEqual('acbd18db4cc2f85cedef654fccc4a4d8',
tests/engine2_test: Removed some more test junk. Former-commit-id: be<I>df0a<I>f<I>f<I>ce6f8ca1b<I>cd<I>
py
diff --git a/cobald/parasites/condor_limits/adapter.py b/cobald/parasites/condor_limits/adapter.py index <HASH>..<HASH> 100644 --- a/cobald/parasites/condor_limits/adapter.py +++ b/cobald/parasites/condor_limits/adapter.py @@ -14,7 +14,10 @@ def query_limits(query_command, key_transform): except ValueError: continue else: - resource_limits[resource] = float(value) + try: + resource_limits[resource] = float(value) + except ValueError: + pass return resource_limits
condor: invalid values are ignored during queries
py
diff --git a/src/psd_tools/user_api/layers.py b/src/psd_tools/user_api/layers.py index <HASH>..<HASH> 100644 --- a/src/psd_tools/user_api/layers.py +++ b/src/psd_tools/user_api/layers.py @@ -45,7 +45,31 @@ def group_layers(decoded_data): elif divider.type == SectionDivider.BOUNDING_SECTION_DIVIDER: # group ends - group_stack.pop() + + if len(group_stack) == 1: + # This means that there is a BOUNDING_SECTION_DIVIDER + # without an OPEN_FOLDER before it. Create a new group + # and move layers to this new group in this case. + + # Assume the first layer is a group + # and convert it to a group: + layers = group_stack[0]['layers'] + group = layers[0] + + # group doesn't have coords: + for key in 'top', 'left', 'bottom', 'right': + if key in group: + del group[key] + + group['layers'] = layers[1:] + group['closed'] = False + + # replace moved layers with newly created group: + group_stack[0]['layers'] = [group] + + else: + finished_group = group_stack.pop() + assert finished_group is not root else: warnings.warn("invalid state")
Fixed group parsing when OPEN_FOLDER is implicit. See GH-5.
py
diff --git a/tests/test_parser.py b/tests/test_parser.py index <HASH>..<HASH> 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -295,6 +295,22 @@ def test_comment_after_escape(): hi\\%""") assert len(list(soup2.document.contents)) == 3 + soup3 = TexSoup(r""" + \documentclass{article} + \usepackage{graphicx} + \begin{document} + \begin{equation} + \scalebox{2.0}{$x = + \begin{cases} + 1, & \text{if } y=1 \\ + 0, & \text{otherwise} + \end{cases}$} + \end{equation} + \end{document} + """) + assert soup3.equation + assert soup3.scalebox + def test_items_with_labels(): """Items can have labels with square brackets such as in the description
new test case, alreay fixed, fixes #<I>
py
diff --git a/tests/pytests/unit/states/test_cmd.py b/tests/pytests/unit/states/test_cmd.py index <HASH>..<HASH> 100644 --- a/tests/pytests/unit/states/test_cmd.py +++ b/tests/pytests/unit/states/test_cmd.py @@ -155,7 +155,7 @@ def test_script_runas_no_password(): "changes": {}, "result": False, "comment": "", - "commnd": "Must supply a password if runas argument is used on Windows.", + "command": "Must supply a password if runas argument is used on Windows.", } patch_opts = patch.dict(cmd.__opts__, {"test": False}) @@ -198,8 +198,6 @@ def test_call(): specified in the state declaration. """ name = "cmd.script" - # func = 'myfunc' - ret = {"name": name, "result": False, "changes": {}, "comment": ""} flag = None
Fix typo and remove superfluous comment
py