diff
stringlengths 139
3.65k
| message
stringlengths 8
627
| diff_languages
stringclasses 1
value |
|---|---|---|
diff --git a/taxi/commands/status.py b/taxi/commands/status.py
index <HASH>..<HASH> 100644
--- a/taxi/commands/status.py
+++ b/taxi/commands/status.py
@@ -3,12 +3,11 @@ from __future__ import unicode_literals
import click
from ..timesheet.parser import ParseError
-from .base import cli, get_timesheet_collection_for_context, AliasedCommand
+from .base import cli, get_timesheet_collection_for_context
from .types import DateRange
-@cli.command(cls=AliasedCommand, aliases=['stat'],
- short_help="Show a summary of your entries.")
+@cli.command(short_help="Show a summary of your entries.")
@click.option('-d', '--date', type=DateRange(),
help="Only show entries of the given date.")
@click.option('-f', '--file', 'f', type=click.Path(dir_okay=False),
|
Don't use AliasedCommand for status since it's already matched by prefix
|
py
|
diff --git a/pywb/rewrite/regex_rewriters.py b/pywb/rewrite/regex_rewriters.py
index <HASH>..<HASH> 100644
--- a/pywb/rewrite/regex_rewriters.py
+++ b/pywb/rewrite/regex_rewriters.py
@@ -137,10 +137,10 @@ class JSLocationRewriterMixin(object):
(r'(?<=document\.)cookie', RegexRewriter.add_prefix(prefix), 0),
#todo: move to mixin?
- (r'(?<=[\s=(){])(top)\s*(?:[!}()]|==|$)',
+ (r'(?<=[\s=(){])(top)\s*(?:[!})]|==|$)',
RegexRewriter.add_prefix(prefix), 1),
- (r'^(top)\s*(?:[!}()]|==|$)',
+ (r'^(top)\s*(?:[!})]|==|$)',
RegexRewriter.add_prefix(prefix), 1),
(r'(?<=window\.)(top)',
|
rewrite: top rewrite: avoid rewriting 'top('
|
py
|
diff --git a/src/unity/python/turicreate/toolkits/image_classifier/_annotate.py b/src/unity/python/turicreate/toolkits/image_classifier/_annotate.py
index <HASH>..<HASH> 100644
--- a/src/unity/python/turicreate/toolkits/image_classifier/_annotate.py
+++ b/src/unity/python/turicreate/toolkits/image_classifier/_annotate.py
@@ -19,7 +19,6 @@ import turicreate as __tc
from sys import platform as __platform
import array as _array
-from mxnet.io import DataBatch as __DataBatch
def _warning_annotations():
print(
|
Fix mxnet being imported on turicreate import (#<I>) Once again, we are importing mxnet on turicreate import. Seems the place it's being imported is not even used (at all). Removing it. We have a unit test for this, but it's flaky due to some lambda worker issues, so it's not running at the moment.
|
py
|
diff --git a/django_select2/views.py b/django_select2/views.py
index <HASH>..<HASH> 100644
--- a/django_select2/views.py
+++ b/django_select2/views.py
@@ -56,8 +56,6 @@ class Select2View(JSONResponseMixin, View):
term = request.GET.get('term', None)
if term is None:
return self.render_to_response(self._results_to_context(('missing term', False, [], )))
- if not term:
- return self.render_to_response(self._results_to_context((NO_ERR_RESP, False, [], )))
try:
page = int(request.GET.get('page', None))
|
Removed empty term validation. Why are you validating that term is filled? If I want to suggest values immediately after opening select2 input, I specify select2_options {"minimumResultsForSearch": 0, "minimumInputLength": 0,}. Why isn't this valid case? Maybe I'm missing something, but see it very useful to suggest, for example, last used values immediately after opening select2 field. Thanks!
|
py
|
diff --git a/jira/resources.py b/jira/resources.py
index <HASH>..<HASH> 100644
--- a/jira/resources.py
+++ b/jira/resources.py
@@ -1000,7 +1000,7 @@ def dict2resource(raw, top=None, options=None, session=None):
or a ``PropertyHolder`` object (if no ``self`` link is present).
"""
if top is None:
- top = type(str('PropertyHolder'), (object,), raw)
+ top = PropertyHolder(raw)
seqs = tuple, list, set, frozenset
for i, j in iteritems(raw):
@@ -1078,3 +1078,8 @@ def cls_for_resource(resource_literal):
else:
# Generic Resource cannot directly be used b/c of different constructor signature
return UnknownResource
+
+
+class PropertyHolder(object):
+ def __init__(self, raw):
+ __bases__ = raw # noqa
|
Make JIRA resources work with pickle Fixes #<I>
|
py
|
diff --git a/ga4gh/cli.py b/ga4gh/cli.py
index <HASH>..<HASH> 100644
--- a/ga4gh/cli.py
+++ b/ga4gh/cli.py
@@ -576,7 +576,7 @@ class GetVariantRunner(AbstractGetRunner):
super(GetVariantRunner, self).__init__(args)
def run(self):
- self._run(self._httpClient.runGetVariant)
+ self._run(self._httpClient.getVariant)
class BenchmarkRunner(SearchVariantsRunner):
|
Fix client runGetVariant error Issue #<I>
|
py
|
diff --git a/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py b/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
index <HASH>..<HASH> 100644
--- a/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
+++ b/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
@@ -82,7 +82,7 @@ def service_ctrl(
try:
counters = fb303_wrapper('counters', port, trans_factory, prot_factory)
for counter in counters:
- print "%s: %d" % (counter, counters[counter])
+ print "%s: %d" % (counter.encode('utf-8'), counters[counter])
return 0
except:
print "failed to get counters"
|
THRIFT-<I>: (scribe ctrl counters) fix encoding in name of counter avoiding outage in monitoring Client: fb<I> This closes #<I>
|
py
|
diff --git a/foursquare/__init__.py b/foursquare/__init__.py
index <HASH>..<HASH> 100644
--- a/foursquare/__init__.py
+++ b/foursquare/__init__.py
@@ -641,11 +641,9 @@ class Foursquare(object):
def get_next(self):
""" Get the next multi response and verify"""
- if not self.has_remaining:
- if not self.requester.get_requests:
- return None
+ if not self.responses and self.requester.get_requests:
self.responses = self.get_all()['responses']
- if not self.has_remaining:
+ if not self.responses:
return None
response = self.responses.pop(0)
meta = response.get('meta')
|
multi get_next() controll flow changed for readability
|
py
|
diff --git a/host/calibrate_plsr_dac.py b/host/calibrate_plsr_dac.py
index <HASH>..<HASH> 100644
--- a/host/calibrate_plsr_dac.py
+++ b/host/calibrate_plsr_dac.py
@@ -79,7 +79,7 @@ class PlsrDacScan(ScanBase):
fit_plt, = plt.plot(x, fit_fn(x), '--k')
plt.title('PlsrDAC calibration')
plt.xlabel('PlsrDAC')
- plt.ylabel('voltage [V]')
+ plt.ylabel('voltage [mV]')
plt.grid(True)
plt.legend([data_plt, fit_plt], ["data", str(fit_fn)], loc=0)
if show:
|
ENH: unit in mV not V
|
py
|
diff --git a/test_flask_pymemcache.py b/test_flask_pymemcache.py
index <HASH>..<HASH> 100644
--- a/test_flask_pymemcache.py
+++ b/test_flask_pymemcache.py
@@ -15,7 +15,7 @@ class TestFlaskPyMemcache(TestCase):
app.config['PYMEMCACHE'] = {
'server': ('localhost', 11211),
'key_prefix': b'px',
- 'close_on_teardown': True}
+ 'close_on_teardown': False}
memcache.init_app(app)
with app.app_context():
|
test: close_on_teardown=False Get from second connection may be executed before Set on first connection. This cause test failure.
|
py
|
diff --git a/salt/version.py b/salt/version.py
index <HASH>..<HASH> 100644
--- a/salt/version.py
+++ b/salt/version.py
@@ -105,7 +105,7 @@ class SaltStackVersion(object):
'Nitrogen' : (2017, 7),
'Oxygen' : (2018, 3),
'Fluorine' : (2019, 2),
- 'Neon' : (MAX_SIZE - 99, 0),
+ 'Neon' : (3000),
'Sodium' : (MAX_SIZE - 98, 0),
'Magnesium' : (MAX_SIZE - 97, 0),
'Aluminium' : (MAX_SIZE - 96, 0),
|
one more neon/<I> update
|
py
|
diff --git a/example/rnn/bucket_io.py b/example/rnn/bucket_io.py
index <HASH>..<HASH> 100644
--- a/example/rnn/bucket_io.py
+++ b/example/rnn/bucket_io.py
@@ -24,8 +24,9 @@ def default_read_content(path):
def default_build_vocab(path):
content = default_read_content(path)
content = content.split(' ')
- idx = 1 # 0 is left for zero-padding
the_vocab = {}
+ idx = 1 # 0 is left for zero-padding
+ the_vocab[' '] = 0 # put a dummy element here so that len(vocab) is correct
for word in content:
if len(word) == 0:
continue
|
fix a bug in vocabulary size reporting in bucket_io.py
|
py
|
diff --git a/categories/management/commands/import_categories.py b/categories/management/commands/import_categories.py
index <HASH>..<HASH> 100644
--- a/categories/management/commands/import_categories.py
+++ b/categories/management/commands/import_categories.py
@@ -29,7 +29,7 @@ class Command(BaseCommand):
"""
return Category.objects.create(
name=string.strip(),
- slug=slugify(string.strip()),
+ slug=slugify(string.strip())[:49],
parent=parent,
order=order
)
|
Ensure that the slug is always within the <I> characters it needs to be.
|
py
|
diff --git a/internetarchive/item.py b/internetarchive/item.py
index <HASH>..<HASH> 100644
--- a/internetarchive/item.py
+++ b/internetarchive/item.py
@@ -32,7 +32,6 @@ from fnmatch import fnmatch
from logging import getLogger
from time import sleep
import math
-from xml.dom.minidom import parseString
from xml.parsers.expat import ExpatError
try:
@@ -230,11 +229,9 @@ class Item(BaseItem):
"""
url = '{}//{}/services/check_identifier.php'.format(self.session.protocol,
self.session.host)
- params = dict(identifier=self.identifier)
- r = self.session.get(url, params=params)
- p = parseString(r.text)
- result = p.getElementsByTagName('result')[0]
- availability = result.attributes['code'].value
+ params = dict(output='json', identifier=self.identifier)
+ response = self.session.get(url, params=params)
+ availability = response.json()['code']
return availability == 'available'
def get_task_summary(self, params=None, request_kwargs=None):
|
Further simplify the code extraction logic by requesting JSON instead of XML, resulting in a dictionary lookup instead of the traversal of a DOM.
|
py
|
diff --git a/pyad2usb/devices.py b/pyad2usb/devices.py
index <HASH>..<HASH> 100644
--- a/pyad2usb/devices.py
+++ b/pyad2usb/devices.py
@@ -655,7 +655,7 @@ class SocketDevice(Device):
ctx.use_privatekey_file(self.ssl_key)
ctx.use_certificate_file(self.ssl_certificate)
ctx.load_verify_locations(self.ssl_ca, None)
- ctx.set_verify(SSL.VERIFY_PEER | SSL.VERIFY_FAIL_IF_NO_PEER_CERT | SSL.VERIFY_CLIENT_ONCE, self._verify_ssl_callback)
+ ctx.set_verify(SSL.VERIFY_PEER, self._verify_ssl_callback)
self._device = SSL.Connection(ctx, self._device)
|
Removed ignored SSL verify flags.
|
py
|
diff --git a/cli/sawtooth_cli/identity.py b/cli/sawtooth_cli/identity.py
index <HASH>..<HASH> 100644
--- a/cli/sawtooth_cli/identity.py
+++ b/cli/sawtooth_cli/identity.py
@@ -332,7 +332,7 @@ def _do_identity_policy_list(args):
output = [policy.name]
for entry in policy.entries:
output.append(
- Policy.Type.Name(entry.type) + " " + entry.key)
+ Policy.EntryType.Name(entry.type) + " " + entry.key)
writer.writerow(output)
except csv.Error:
raise CliException('Error writing CSV')
@@ -341,7 +341,7 @@ def _do_identity_policy_list(args):
for policy in printable_policies:
value = "Entries: "
for entry in policy.entries:
- entry_string = Policy.Type.Name(entry.type) + " " \
+ entry_string = Policy.EntryType.Name(entry.type) + " " \
+ entry.key
value += entry_string + " "
output[policy.name] = value
|
Update Policy.Type to EntryType in identity cli This change was left out during <I> release changes in identity.proto file. This fixes identity cli app crashing for cmd options addressed in this commit.
|
py
|
diff --git a/ngram.py b/ngram.py
index <HASH>..<HASH> 100644
--- a/ngram.py
+++ b/ngram.py
@@ -102,7 +102,7 @@ class ngram:
"""
if ic is None: ic = self.__ic
if only_alnum is None: only_alnum = self.__only_alnum
- if padding is None: padding = 'X' * self.__padding
+ if padding is None: padding = u'\xa0' * self.__padding
if noise is None: noise = self.__noise
seen = {}
@@ -117,7 +117,7 @@ class ngram:
if seen.has_key(tmpstr): continue
seen[tmpstr] = 1
- tmpstr = padding + tmpstr + padding
+ tmpstr = padding + tmpstr.replace(u'\xa0', ' ') + padding
length = len(tmpstr)
for i in xrange( length - self.__ngram_len + 1 ):
ngram = tmpstr[i:i+self.__ngram_len]
@@ -165,7 +165,7 @@ class ngram:
if self.__ic: string = string.lower()
for char in self.__noise:
string = string.replace(char, '')
- string = 'X' * self.__padding + string + 'X' * self.__padding
+ string = u'\xa0' * self.__padding + string.replace(u'\xa0', ' ') + u'\xa0' * self.__padding
numgram = len(string) - self.__ngram_len + 1
|
[svn r4] exhuma's patch to use unicode non-breaking space as the padding character
|
py
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,8 +11,6 @@ try:
except (IOError, ImportError):
long_description = 'Always know what to expect from your data. (See https://github.com/great-expectations/great_expectations for full description).'
-exec(open('great_expectations/version.py').read())
-
config = {
'description': 'Always know what to expect from your data.',
'author': 'The Great Expectations Team',
|
Remove extraneous version reference in setup.py
|
py
|
diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py
index <HASH>..<HASH> 100644
--- a/src/_pytest/junitxml.py
+++ b/src/_pytest/junitxml.py
@@ -311,7 +311,7 @@ def record_xml_attribute(request):
attr_func = add_attr_noop
xml = getattr(request.config, "_xml", None)
- if xml.family != "xunit1":
+ if xml is not None and xml.family != "xunit1":
request.node.warn(
PytestWarning(
"record_xml_attribute is incompatible with junit_family: "
|
Ensure xml object is viable before testing family type
|
py
|
diff --git a/indra/assemblers/pysb_assembler.py b/indra/assemblers/pysb_assembler.py
index <HASH>..<HASH> 100644
--- a/indra/assemblers/pysb_assembler.py
+++ b/indra/assemblers/pysb_assembler.py
@@ -586,7 +586,10 @@ def set_base_initial_condition(model, monomer, value):
sites_dict = {}
for site in monomer.sites:
if site in monomer.site_states:
- sites_dict[site] = monomer.site_states[site][0]
+ if site == 'loc' and 'cytoplasm' in monomer.site_states['loc']:
+ sites_dict['loc'] = 'cytoplasm'
+ else:
+ sites_dict[site] = monomer.site_states[site][0]
else:
sites_dict[site] = None
mp = monomer(**sites_dict)
|
Make cytoplasm default initial compartment if it exists
|
py
|
diff --git a/OpenSSL/test/test_ssl.py b/OpenSSL/test/test_ssl.py
index <HASH>..<HASH> 100644
--- a/OpenSSL/test/test_ssl.py
+++ b/OpenSSL/test/test_ssl.py
@@ -1912,7 +1912,7 @@ class ConnectionTests(TestCase, _LoopbackMixin):
client_socket, server_socket = socket_pair()
# Fill up the client's send buffer so Connection won't be able to write
# anything.
- msg = b"x" * 1024
+ msg = b"x" * 512
for i in range(1024):
try:
client_socket.send(msg)
|
Fill the send buffer with smaller strings in order to more completely fill it. This makes the test pass on OS X. Previously it failed with the wrong exception type probably because there was enough room left in the send buffer for the handshake to start.
|
py
|
diff --git a/hamlpy/test/hamlpy_test.py b/hamlpy/test/hamlpy_test.py
index <HASH>..<HASH> 100644
--- a/hamlpy/test/hamlpy_test.py
+++ b/hamlpy/test/hamlpy_test.py
@@ -103,6 +103,13 @@ class HamlPyTest(unittest.TestCase):
hamlParser = hamlpy.Compiler()
result = hamlParser.process(haml)
eq_(html, result)
+
+ def test_inline_variables_with_special_characters_are_parsed_correctly(self):
+ haml = "%h1 Hello, #{person.name}, how are you?"
+ html = "<h1>Hello, {{ person.name }}, how are you?</h1>\n"
+ hamlParser = hamlpy.Compiler()
+ result = hamlParser.process(haml)
+ eq_(html, result)
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
|
Added an additional test for interpolation
|
py
|
diff --git a/galpy/df_src/streamdf.py b/galpy/df_src/streamdf.py
index <HASH>..<HASH> 100644
--- a/galpy/df_src/streamdf.py
+++ b/galpy/df_src/streamdf.py
@@ -166,6 +166,23 @@ class streamdf:
out= numpy.arccos(numpy.sum(self._progenitor_Omega*self._dsigomeanProgDirection)/numpy.sqrt(numpy.sum(self._progenitor_Omega**2.)))/numpy.pi*180.
if out > 90.: return out-180.
+ def freqEigvalRatio(self):
+ """
+ NAME:
+ freqEigvalRatio
+ PURPOSE:
+ calculate the ratio between the largest and 2nd-to-largest
+ eigenvalue of dO/dJ (if this is big, a 1D stream will form)
+ INPUT:
+ (none)
+ OUTPUT:
+ ratio between eigenvalues of dO / dJ
+ HISTORY:
+ 2013-12-05 - Written - Bovy (IAS)
+ """
+ return numpy.sqrt(self._sortedSigOEig)[2]\
+ /numpy.sqrt(self._sortedSigOEig)[1]
+
def estimateTdisrupt(self,deltaAngle):
"""
NAME:
|
add function that returns the ration between the largest and second-to-largest eigenvalue of dOdJ
|
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
@@ -379,6 +379,20 @@ def _make_parser_test(LEXER, PARSER):
x = g.parse('Hello HelloWorld')
self.assertSequenceEqual(x.children, ['HelloWorld'])
+ def test_token_collision2(self):
+ # NOTE: This test reveals a bug in token reconstruction in Scanless Earley
+ # I probably need to re-write grammar transformation
+
+ g = _Lark("""
+ !start: "starts"
+
+ %import common.LCASE_LETTER
+ """)
+
+ x = g.parse("starts")
+ self.assertSequenceEqual(x.children, ['starts'])
+
+
# def test_string_priority(self):
# g = _Lark("""start: (A | /a?bb/)+
# A: "a" """)
|
Added a test suggested by James McLaughlin
|
py
|
diff --git a/jsonrpcserver/http_server.py b/jsonrpcserver/http_server.py
index <HASH>..<HASH> 100644
--- a/jsonrpcserver/http_server.py
+++ b/jsonrpcserver/http_server.py
@@ -6,7 +6,7 @@ https://docs.python.org/3/library/http.server.html
import logging
try:
# Python 2
- import SimpleHTTPServer as HTTPServer
+ from BaseHTTPServer import HTTPServer
from BaseHTTPServer import BaseHTTPRequestHandler
except ImportError:
# Python 3
|
Fixed HTTPServer import problem for Python2 While calling methods.serve_forever() (using Python 2), I was receiving the error "TypeError: 'module' object is not callable". This is because jsonrpcserver.http_server is importing HTTPServer from SimpleHTTPServer rather than BaseHTTPServer, which results in HTTPServer being a module rather than a class. This now imports from BaseHTTPServer.
|
py
|
diff --git a/salt/utils/event.py b/salt/utils/event.py
index <HASH>..<HASH> 100644
--- a/salt/utils/event.py
+++ b/salt/utils/event.py
@@ -208,8 +208,8 @@ class SaltEvent(object):
The linger timeout must be at least as long as this timeout
'''
self.push = self.context.socket(zmq.PUSH)
- # bug in 0MQ default send timeout of -1 (inifinite) is not infinite
try:
+ # bug in 0MQ default send timeout of -1 (inifinite) is not infinite
self.push.setsockopt(zmq.SNDTIMEO, timeout)
except AttributeError:
# This is for ZMQ < 2.2 (Caught when ssh'ing into the Jenkins
|
Reposition comment to bring it into context.
|
py
|
diff --git a/test/rowcache_invalidator.py b/test/rowcache_invalidator.py
index <HASH>..<HASH> 100755
--- a/test/rowcache_invalidator.py
+++ b/test/rowcache_invalidator.py
@@ -101,9 +101,9 @@ def teardown():
replica_tablet.teardown_mysql()]
utils.wait_procs(teardown_procs, raise_on_error=False)
- utils.zk_teardown()
master_tablet.kill_vttablet()
replica_tablet.kill_vttablet()
+ utils.zk_teardown()
utils.kill_sub_processes()
utils.remove_tmp_files()
master_tablet.remove_tree()
|
changed the kill order to kill vttablet before tearing down zk or other sub_processes.
|
py
|
diff --git a/openquake/calculators/base.py b/openquake/calculators/base.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/base.py
+++ b/openquake/calculators/base.py
@@ -142,6 +142,9 @@ class BaseCalculator(with_metaclass(abc.ABCMeta)):
"""
Update the current calculation parameters and save engine_version
"""
+ if ('hazard_calculation_id' in kw and
+ kw['hazard_calculation_id'] is None):
+ del kw['hazard_calculation_id']
vars(self.oqparam).update(**kw)
self.datastore['oqparam'] = self.oqparam # save the updated oqparam
attrs = self.datastore['/'].attrs
|
Ssetting `hazard_calculation_id` in the job.ini is now possible
|
py
|
diff --git a/pyrax/clouddns.py b/pyrax/clouddns.py
index <HASH>..<HASH> 100644
--- a/pyrax/clouddns.py
+++ b/pyrax/clouddns.py
@@ -483,15 +483,15 @@ class CloudDNSManager(BaseManager):
"""
def _fmt_error(err):
# Remove the cumbersome Java-esque message
- details = err["details"].replace("\n", " ")
+ details = err.get("details", "").replace("\n", " ")
if not details:
- details = err["message"]
- return "%s (%s)" % (details, err["code"])
+ details = err.get("message", "")
+ return "%s (%s)" % (details, err.get("code", ""))
- error = resp_body["error"]
+ error = resp_body.get("error", "")
if "failedItems" in error:
# Multi-error response
- faults = error["failedItems"]["faults"]
+ faults = error.get("failedItems", {}).get("faults", [])
msgs = [_fmt_error(fault) for fault in faults]
msg = "\n".join(msgs)
else:
|
Improved error handling in DNS calls. GitHub #<I>
|
py
|
diff --git a/spacy/tests/regression/test_issue5230.py b/spacy/tests/regression/test_issue5230.py
index <HASH>..<HASH> 100644
--- a/spacy/tests/regression/test_issue5230.py
+++ b/spacy/tests/regression/test_issue5230.py
@@ -1,3 +1,4 @@
+# coding: utf8
import warnings
import numpy
|
issue<I>: added unicode declaration at top of the file
|
py
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -108,14 +108,18 @@ class FetchPatchelfCommand(Command):
filename = os.path.basename(self.patchelf_url)
with pushd(self.download_dir, makedirs=True, exist_ok=True):
- self.announce('Downloading {}...'.format(self.patchelf_url),
- log.INFO)
- urlretrieve(self.patchelf_url, filename)
+ if ( os.path.exists(filename) and
+ self.sha256sum(filename) == self.sha256_hash ):
+ self.announce('Using cached {}'.format(filename))
+ else:
+ self.announce('Downloading {}...'.format(self.patchelf_url),
+ log.INFO)
+ urlretrieve(self.patchelf_url, filename)
- if self.sha256sum(filename) != self.sha256_hash:
- raise RuntimeError(
- "{} doesn't match checksum".format(filename)
- )
+ if self.sha256sum(filename) != self.sha256_hash:
+ raise RuntimeError(
+ "{} doesn't match checksum".format(filename)
+ )
class BuildPatchelfCommand(Command):
|
Use cached patchelf tarball if it's found and the SHA matches
|
py
|
diff --git a/quark/plugin.py b/quark/plugin.py
index <HASH>..<HASH> 100644
--- a/quark/plugin.py
+++ b/quark/plugin.py
@@ -60,11 +60,11 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2):
def __init__(self):
db_api.configure_db()
- models.BASEV2.metadata.create_all(db_api._ENGINE)
self.net_driver = (importutils.import_class(CONF.QUARK.net_driver))()
self.net_driver.load_config(CONF.QUARK.net_driver_cfg)
self.ipam_driver = (importutils.import_class(CONF.QUARK.ipam_driver))()
self.ipam_reuse_after = CONF.QUARK.ipam_reuse_after
+ models.BASEV2.metadata.create_all(db_api._ENGINE)
def _make_network_dict(self, network, fields=None):
res = {'id': network.get('id'),
|
Moved db load for future use
|
py
|
diff --git a/anyconfig/backend/xml.py b/anyconfig/backend/xml.py
index <HASH>..<HASH> 100644
--- a/anyconfig/backend/xml.py
+++ b/anyconfig/backend/xml.py
@@ -161,7 +161,7 @@ def _dicts_have_unique_keys(dics):
return len(set(key_itr)) == sum(len(d) for d in dics)
-def _sum_dicts(dics, to_container=dict):
+def _merge_dicts(dics, to_container=dict):
"""
:param dics: [<dict/-like object must not have same keys each other>]
:param to_container: callble to make a container object
@@ -190,7 +190,7 @@ def _process_children(elem, dic, subdic, children, to_container=dict,
# .. note:: Another special case can omit extra <children> node.
sdics = [subdic] + subdics
if _dicts_have_unique_keys(sdics):
- dic[elem.tag] = _sum_dicts(sdics, to_container)
+ dic[elem.tag] = _merge_dicts(sdics, to_container)
elif not subdic: # No attrs nor text and only these children.
dic[elem.tag] = subdics
else:
|
refactor: rename of a function, s/_sum_dicts/_merge_dicts/g
|
py
|
diff --git a/python/tests/phonenumberutiltest.py b/python/tests/phonenumberutiltest.py
index <HASH>..<HASH> 100755
--- a/python/tests/phonenumberutiltest.py
+++ b/python/tests/phonenumberutiltest.py
@@ -2006,3 +2006,6 @@ class PhoneNumberUtilTest(unittest.TestCase):
self.assertEquals(('1', '41234567'),
phonenumberutil._maybe_strip_national_prefix_carrier_code("0141234567",
metadataXY))
+ self.assertEquals(('', '01412345'),
+ phonenumberutil._maybe_strip_national_prefix_carrier_code("01412345",
+ metadataXY))
|
Add extra UT case to restore <I>% coverage
|
py
|
diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -191,7 +191,7 @@ html_context = {
# html_split_index = False
# If true, links to the reST sources are added to the pages.
-# html_show_sourcelink = True
+html_show_sourcelink = False
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True
|
Remove 'view source' links from docs Closes #<I>
|
py
|
diff --git a/ppb/sprites.py b/ppb/sprites.py
index <HASH>..<HASH> 100644
--- a/ppb/sprites.py
+++ b/ppb/sprites.py
@@ -137,9 +137,6 @@ class RectangleShapeMixin:
"""
A Mixin that provides a rectangular area to sprites.
- You should include RectangleShapeMixin before your BaseSprite in your
- parent classes.
-
Classes derived from RectangleShapeMixin default to the same size and
shape as all ppb Sprites: A 1 game unit by 1 game unit square. Just set
the width and height in your constructor (Or as class attributes) to
|
Removes additional detail on where to put RectangleShapeMixin in your parent class definitions.
|
py
|
diff --git a/andes/models/exciter/excbase.py b/andes/models/exciter/excbase.py
index <HASH>..<HASH> 100644
--- a/andes/models/exciter/excbase.py
+++ b/andes/models/exciter/excbase.py
@@ -117,3 +117,32 @@ class ExcBase(Model):
# Note:
# Subclasses need to define `self.vref0` in the appropriate place.
# Subclasses also need to define `self.vref`.
+
+
+class ExcVsum():
+ """
+ Subclass for exciter model.
+ """
+
+ def __init__(self):
+ self.UEL = Algeb(info='Interface var for under exc. limiter',
+ tex_name='U_{EL}',
+ v_str='0',
+ e_str='0 - UEL'
+ )
+ self.OEL = Algeb(info='Interface var for over exc. limiter',
+ tex_name='O_{EL}',
+ v_str='0',
+ e_str='0 - OEL'
+ )
+ self.Vs = Algeb(info='Voltage compensation from PSS',
+ tex_name='V_{s}',
+ v_str='0',
+ e_str='0 - Vs'
+ )
+ self.vref = Algeb(info='Reference voltage input',
+ tex_name='V_{ref}',
+ unit='p.u.',
+ v_str='vref0',
+ e_str='vref0 - vref'
+ )
|
Added subclass ExcVsum for exciter model.
|
py
|
diff --git a/flask_unchained/bundle.py b/flask_unchained/bundle.py
index <HASH>..<HASH> 100644
--- a/flask_unchained/bundle.py
+++ b/flask_unchained/bundle.py
@@ -14,6 +14,10 @@ class ModuleNameDescriptor:
class NameDescriptor:
def __get__(self, instance, cls):
+ if cls.app_bundle:
+ if '.' not in cls.module_name:
+ return cls.module_name
+ return cls.module_name.rsplit('.', 1)[-1]
return snake_case(cls.__name__)
|
set the app_bundle bundle name from its module name
|
py
|
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -268,7 +268,7 @@ issuetracker_project = 'PyCQA/pydocstyle'
def generate_error_code_table():
- from violations import ErrorRegistry
+ from pydocstyle.violations import ErrorRegistry
with open(os.path.join('snippets', 'error_code_table.rst'), 'wt') as outf:
outf.write(ErrorRegistry.to_rst())
|
Attempt to fix docs build.
|
py
|
diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -38,7 +38,7 @@ master_doc = 'index'
# General information about the project.
project = u'scriptine'
-copyright = u'2009, Oliver Tonnhofer'
+copyright = u'2009-2013 Oliver Tonnhofer'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -47,7 +47,7 @@ copyright = u'2009, Oliver Tonnhofer'
# The short X.Y version.
version = '0.2'
# The full version, including alpha/beta/rc tags.
-release = '0.2.0a1'
+release = '0.2.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
|
bumped version in docs
|
py
|
diff --git a/py3status/py3.py b/py3status/py3.py
index <HASH>..<HASH> 100644
--- a/py3status/py3.py
+++ b/py3status/py3.py
@@ -1049,7 +1049,6 @@ class Py3:
if output_oneline:
msg += " ({output})"
msg = msg.format(cmd=pretty_cmd, error=retcode, output=output_oneline)
- self.log(msg)
raise exceptions.CommandError(
msg, error_code=retcode, error=error, output=output
)
|
core: some commands expectedly return non 0 output, dont log them
|
py
|
diff --git a/tests.py b/tests.py
index <HASH>..<HASH> 100644
--- a/tests.py
+++ b/tests.py
@@ -143,9 +143,12 @@ class KVPersistenceTest(unittest.TestCase):
th.start()
try:
q1.get()
- with self.assertRaises(sqlite3.OperationalError) as cm:
+ with self.assertRaises(sqlite3.OperationalError) as cm1:
with kv2.lock(): pass
- self.assertEqual(cm.exception.message, 'database is locked')
+ self.assertEqual(cm1.exception.message, 'database is locked')
+ with self.assertRaises(sqlite3.OperationalError) as cm2:
+ kv2['a'] = 'b'
+ self.assertEqual(cm2.exception.message, 'database is locked')
finally:
q2.put(None)
th.join()
|
extra assertion: make sure any write is blocked
|
py
|
diff --git a/jarn/mkrelease/scm.py b/jarn/mkrelease/scm.py
index <HASH>..<HASH> 100644
--- a/jarn/mkrelease/scm.py
+++ b/jarn/mkrelease/scm.py
@@ -1,5 +1,6 @@
import os
import re
+import tee
from operator import itemgetter
from os.path import abspath, join, expanduser, dirname, exists, isdir, isfile
@@ -272,8 +273,9 @@ class Subversion(SCM):
def create_tag(self, dir, tagid, name, version, push):
url = self.get_url_from_sandbox(dir)
- rc = self.process.system(
- 'svn copy -m"Tagged %(name)s %(version)s." "%(url)s" "%(tagid)s"' % locals())
+ rc, lines = self.process.popen(
+ ('svn copy -m"Tagged %(name)s %(version)s." "%(url)s" "%(tagid)s"' % locals()),
+ echo=tee.NotEmpty())
if rc != 0:
err_exit('Tag failed')
return rc
|
Use NotEmpty filter in Subversion.create_tag only.
|
py
|
diff --git a/kombine/sampler.py b/kombine/sampler.py
index <HASH>..<HASH> 100644
--- a/kombine/sampler.py
+++ b/kombine/sampler.py
@@ -12,9 +12,10 @@ from scipy.stats import chisquare
from .clustered_kde import optimized_kde, TransdimensionalKDE
-def print_fn(iter, test_size, acc, pbar):
- pbar.set_postfix_str('| single_step_acceptence = {0} | test_stepsize = {1} >= 16'.format(acc,test_size), refresh=False)
- pbar.update(iter - pbar.n)
+def print_fn(iter, test_size, acc, pbar=None):
+ if pbar is not None:
+ pbar.set_postfix_str('| single_step_acceptence = {0} | test_stepsize = {1} >= 16'.format(acc,test_size), refresh=False)
+ pbar.update(iter - pbar.n)
def in_notebook():
|
change logic to not fail with progress=False
|
py
|
diff --git a/assemblerflow/generator/inspect.py b/assemblerflow/generator/inspect.py
index <HASH>..<HASH> 100644
--- a/assemblerflow/generator/inspect.py
+++ b/assemblerflow/generator/inspect.py
@@ -474,8 +474,8 @@ class NextflowInspector:
len([x for x in vals if x["status"] in good_status]))
# Get number of bad samples
- inst["bad_samples"] = "{}".format(
- len([x for x in vals if x["status"] not in good_status]))
+ # inst["bad_samples"] = "{}".format(
+ # len([x for x in vals if x["status"] not in good_status]))
# Get average time
time_array = [self.hms(x["realtime"]) for x in vals]
@@ -646,7 +646,9 @@ class NextflowInspector:
txt_fmt = curses.A_DIM
else:
ref = self.process_stats[process]
- vals = [ref["completed"], ref["bad_samples"], ref["realtime"],
+ vals = [ref["completed"],
+ len(self.processes[process]["failed"]),
+ ref["realtime"],
ref["maxmem"], ref["avgread"],
ref["avgwrite"]]
txt_fmt = curses.A_BOLD
|
Added different listener to failed processe/sample
|
py
|
diff --git a/src/canmatrix/canmatrix.py b/src/canmatrix/canmatrix.py
index <HASH>..<HASH> 100644
--- a/src/canmatrix/canmatrix.py
+++ b/src/canmatrix/canmatrix.py
@@ -1564,11 +1564,11 @@ class CanMatrix(object):
if ecu in self.ecus:
self.ecus.remove(ecu)
for frame in self.frames:
- if ecu.name in frame.transmitters:
- frame.transmitters.remove(ecu.name)
+ frame.del_transmitter(ecu.name)
+
for signal in frame.signals:
- if ecu.name in signal.receivers:
- signal.receivers.remove(ecu.name)
+ signal.del_receiver(ecu.name)
+
frame.update_receiver()
def update_ecu_list(self): # type: () -> None
|
- rely on del_transmitter and del_receiver (#<I>) Thanks!
|
py
|
diff --git a/anyconfig/backend/properties_.py b/anyconfig/backend/properties_.py
index <HASH>..<HASH> 100644
--- a/anyconfig/backend/properties_.py
+++ b/anyconfig/backend/properties_.py
@@ -54,17 +54,17 @@ class PropertiesParser(Base.ConfigParser):
# return load_impl(config_fp, cls.container())
@classmethod
- def load(cls, config_path, *args, **kwargs):
+ def load(cls, config_path, **kwargs):
return load_impl(open(config_path), cls.container())
@classmethod
- def dumps(cls, data, *args, **kwargs):
+ def dumps(cls, data, **kwargs):
config_fp = StringIO()
dump_impl(data, config_fp)
return config_fp.getvalue()
@classmethod
- def dump(cls, data, config_path, *args, **kwargs):
+ def dump(cls, data, config_path, **kwargs):
"""TODO: How to encode nested dicts?
"""
dump_impl(data, open(config_path, 'w'))
|
[properties backend] follow internal API changes in base class
|
py
|
diff --git a/tagging_autocomplete/views.py b/tagging_autocomplete/views.py
index <HASH>..<HASH> 100644
--- a/tagging_autocomplete/views.py
+++ b/tagging_autocomplete/views.py
@@ -11,10 +11,14 @@ except ImportError:
def list_tags(request):
max_results = getattr(settings, 'MAX_NUMBER_OF_RESULTS', 100)
+ search_contains = getattr(settings, 'TAGGING_AUTOCOMPLETE_SEARCH_CONTAINS', False)
try:
- tags = [{'id': tag.id, 'label': tag.name, 'value': tag.name}
- for tag in Tag.objects.filter(name__istartswith=request.GET['term'])[:max_results]]
+ term = request.GET['term']
except MultiValueDictKeyError:
raise Http404
-
+ if search_contains:
+ objects = Tag.objects.filter(name__icontains=term)
+ else:
+ objects = Tag.objects.filter(name__istartswith=term)
+ tags = [{'id': tag.id, 'label': tag.name, 'value': tag.name} for tag in objects[:max_results]]
return HttpResponse(json.dumps(tags), content_type='text/json')
|
Added ability to suggest tags that contain given term.
|
py
|
diff --git a/spyderlib/widgets/externalshell/namespacebrowser.py b/spyderlib/widgets/externalshell/namespacebrowser.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/externalshell/namespacebrowser.py
+++ b/spyderlib/widgets/externalshell/namespacebrowser.py
@@ -39,7 +39,8 @@ class NamespaceBrowser(QWidget):
self.shellwidget = None
self.is_internal_shell = None
- self.is_visible = False
+
+ self.is_visible = True # Do not modify: light mode won't work!
self.setup_in_progress = None
|
Spyder light mode's variable explorer was broken: fixed!
|
py
|
diff --git a/magic.py b/magic.py
index <HASH>..<HASH> 100644
--- a/magic.py
+++ b/magic.py
@@ -31,7 +31,7 @@ class Magic:
"""
- def __init__(self, mime=False, mime_encoding=False, magic_file=None):
+ def __init__(self, mime=False, magic_file=None, mime_encoding=False):
"""
Create a new libmagic wrapper.
|
reorder Mime args to preserve compatability
|
py
|
diff --git a/pcef/core/modes/code_completion.py b/pcef/core/modes/code_completion.py
index <HASH>..<HASH> 100644
--- a/pcef/core/modes/code_completion.py
+++ b/pcef/core/modes/code_completion.py
@@ -74,7 +74,7 @@ class CodeCompletionMode(Mode, QtCore.QObject):
QtCore.QObject.__init__(self)
self.__currentCompletion = ""
self.__triggerKey = None
- self.__jobRunner = DelayJobRunner(self, nbThreadsMax=1, delay=700)
+ self.__jobRunner = DelayJobRunner(self, nbThreadsMax=1, delay=500)
self.__providers = []
self.__tooltips = {}
self.__cursorLine = -1
|
Adapted delay (still need more tests, especially with jedi)
|
py
|
diff --git a/spinoff/util/logging.py b/spinoff/util/logging.py
index <HASH>..<HASH> 100644
--- a/spinoff/util/logging.py
+++ b/spinoff/util/logging.py
@@ -240,9 +240,12 @@ def _do_write(level, *args, **kwargs):
(os.getpid(), levelname, loc, logname, statestr, logstring)),
file=OUTFILE, *(args + (comment,)))
if dump_parent_caller:
- file, lineno, caller_name, caller = get_calling_context(frame.f_back)
- loc = "%s:%s" % (file, lineno)
- print("\t(invoked by) %s %s %s" % (get_logname(caller), caller_name, loc), file=OUTFILE)
+ parent_frame = frame
+ for i in range(dump_parent_caller):
+ parent_frame = parent_frame.f_back
+ file_, lineno, caller_name, caller = get_calling_context(parent_frame)
+ loc = "%s:%s" % (file_, lineno)
+ print(" " * (i + 1) + "(invoked by) %s %s %s" % (get_logname(caller), caller_name, loc), file=OUTFILE)
except Exception:
# from nose.tools import set_trace; set_trace()
print(RED, u"!!%d: (logger failure)" % (level,), file=sys.stderr, *args, **kwargs)
|
Allow logging of arbitrarily many callers
|
py
|
diff --git a/rllib/examples/custom_logger.py b/rllib/examples/custom_logger.py
index <HASH>..<HASH> 100644
--- a/rllib/examples/custom_logger.py
+++ b/rllib/examples/custom_logger.py
@@ -59,7 +59,7 @@ class MyPrintLogger(Logger):
# Custom init function.
print("Initializing ...")
# Setting up our log-line prefix.
- self.prefix = self.config.get("prefix")
+ self.prefix = self.config.get("logger_config").get("prefix")
def on_result(self, result: dict):
# Define, what should happen on receiving a `result` (dict).
|
[rllib] Read "logger_config" first before "prefix". (#<I>)
|
py
|
diff --git a/sphinx_gallery/gen_rst.py b/sphinx_gallery/gen_rst.py
index <HASH>..<HASH> 100644
--- a/sphinx_gallery/gen_rst.py
+++ b/sphinx_gallery/gen_rst.py
@@ -197,9 +197,9 @@ def split_code_and_text_blocks(source_file):
return blocks
-def codestr2rst(codestr):
+def codestr2rst(codestr, lang='python'):
"""Return reStructuredText code block from code string"""
- code_directive = "\n.. code-block:: python\n\n"
+ code_directive = "\n.. code-block:: {0}\n\n".format(lang)
indented_block = indent(codestr, ' ' * 4)
return code_directive + indented_block
@@ -457,8 +457,7 @@ def execute_script(code_block, example_globals, image_path, fig_count,
print(80 * '_')
figure_list = []
- exception_msg = indent(formatted_exception, ' ' * 4)
- image_list = '.. container:: sphx-glr-traceback \n\n{0}'.format(exception_msg)
+ image_list = codestr2rst(formatted_exception, 'pytb')
# Overrides the output thumbnail in the gallery for easy identification
broken_img = os.path.join(glr_path_static(), 'broken_example.png')
|
Highlight python traceback Sphinx with Pygments provides syntax highlighting for python traceback messages is the same way as for python code. Use those
|
py
|
diff --git a/bcbio/rnaseq/count.py b/bcbio/rnaseq/count.py
index <HASH>..<HASH> 100644
--- a/bcbio/rnaseq/count.py
+++ b/bcbio/rnaseq/count.py
@@ -27,7 +27,7 @@ def combine_count_files(files, out_file=None, ext=".fpkm"):
"Some count files in %s do not exist." % files
for f in files:
assert file_exists(f), "%s does not exist or is empty." % f
- col_names = [os.path.basename(os.path.splitext(x)[0]) for x in files]
+ col_names = [os.path.basename(x.replace(ext, "")) for x in files]
if not out_file:
out_dir = os.path.join(os.path.dirname(files[0]))
out_file = os.path.join(out_dir, "combined.counts")
|
When combining counts, trim off multiple extensions if passed in.
|
py
|
diff --git a/discord/client.py b/discord/client.py
index <HASH>..<HASH> 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -109,6 +109,7 @@ class Client:
self.gateway = None
self.voice = None
self.session_id = None
+ self.connection = None
self.sequence = 0
self.loop = asyncio.get_event_loop() if loop is None else loop
self._listeners = []
@@ -1827,7 +1828,9 @@ class Client:
log.debug(request_logging_format.format(method='GET', response=response))
yield from utils._verify_successful_response(response)
data = yield from response.json()
- server = self.connection._get_server(data['guild']['id'])
+ server = None
+ if self.connection is not None:
+ server = self.connection._get_server(data['guild']['id'])
if server is not None:
ch_id = data['channel']['id']
channels = getattr(server, 'channels', [])
|
Client.get_invite now works without a websocket connection
|
py
|
diff --git a/sysconfig.py b/sysconfig.py
index <HASH>..<HASH> 100644
--- a/sysconfig.py
+++ b/sysconfig.py
@@ -36,10 +36,8 @@ if (os.name == 'nt' and
# python_build: (Boolean) if true, we're either building Python or
# building an extension with an un-installed Python, so we use
# different (hard-wired) directories.
-# Setup.local is available for Makefile builds including VPATH builds,
-# Setup.dist is available on Windows
def _is_python_source_dir(d):
- for fn in ("Setup.dist", "Setup.local"):
+ for fn in ("Setup", "Setup.local"):
if os.path.isfile(os.path.join(d, "Modules", fn)):
return True
return False
|
bpo-<I>: Rename Modules/Setup.dist to Modules/Setup (GH-<I>) bpo-<I>: Rename Modules/Setup.dist to Modules/Setup Remove the necessity to copy the former manually to the latter when updating the local source tree.
|
py
|
diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py
index <HASH>..<HASH> 100644
--- a/buildozer/targets/android.py
+++ b/buildozer/targets/android.py
@@ -303,6 +303,7 @@ class TargetAndroid(Target):
if not self.buildozer.file_exists(pa_dir):
system_p4a_dir = self.buildozer.config.getdefault('app', 'android.p4a_dir')
if system_p4a_dir:
+ system_p4a_dir = realpath(system_p4a_dir)
cmd('ln -s {} ./python-for-android'.format(system_p4a_dir),
cwd = self.buildozer.platform_dir)
else:
|
Added realpath modifier to p4a_dir token
|
py
|
diff --git a/src/python/dxpy/scripts/dx_build_app.py b/src/python/dxpy/scripts/dx_build_app.py
index <HASH>..<HASH> 100755
--- a/src/python/dxpy/scripts/dx_build_app.py
+++ b/src/python/dxpy/scripts/dx_build_app.py
@@ -23,6 +23,7 @@ logging.basicConfig(level=logging.WARNING)
logging.getLogger('requests.packages.urllib3.connectionpool').setLevel(logging.ERROR)
import os, sys, json, subprocess, argparse
+import platform
import py_compile
import re
import shutil
@@ -394,7 +395,11 @@ def _check_file_syntax(filename, temp_dir, override_lang=None, enforce=True):
except OSError:
pass
def check_bash(filename):
- subprocess.check_output(["/bin/bash", "-n", filename], stderr=subprocess.STDOUT)
+ if platform.system() == 'Windows':
+ logging.warn(
+ 'Skipping bash syntax check due to unavailability of bash on Windows.')
+ else:
+ subprocess.check_output(["/bin/bash", "-n", filename], stderr=subprocess.STDOUT)
if override_lang == 'python2.7':
checker_fn = check_python
|
PTFM-<I> Skip dx build bash syn check on Windows Summary: Don't run the bash syntax check on bash applets when the current system is a Windows machine, since bash is not likely to be in the path. Test Plan: Built dxpy with the change and manually tested dx build on Windows. Reviewers: brogoff, nicolasbockg Reviewed By: nicolasbockg Differential Revision: <URL>
|
py
|
diff --git a/useraudit/urls.py b/useraudit/urls.py
index <HASH>..<HASH> 100644
--- a/useraudit/urls.py
+++ b/useraudit/urls.py
@@ -1,4 +1,4 @@
-from django.conf.urls import patterns, include, url
+from django.conf.urls import include, url
from .views import reactivate_user
app_name = "useraudit"
|
Django <I> support when including useraudit's urls
|
py
|
diff --git a/bitshares/wallet.py b/bitshares/wallet.py
index <HASH>..<HASH> 100644
--- a/bitshares/wallet.py
+++ b/bitshares/wallet.py
@@ -209,9 +209,10 @@ class Wallet():
"""
account = self.rpc.get_account(name)
for authority in account["active"]["key_auths"]:
- key = self.getPrivateKeyForPublicKey(authority[0])
- if key:
- return key
+ try:
+ return self.getPrivateKeyForPublicKey(authority[0])
+ except:
+ pass
return False
def getAccountFromPrivateKey(self, wif):
|
Fix getActiveKeyForAccount failing when multiple keys installed
|
py
|
diff --git a/sentinelhub/geopedia.py b/sentinelhub/geopedia.py
index <HASH>..<HASH> 100644
--- a/sentinelhub/geopedia.py
+++ b/sentinelhub/geopedia.py
@@ -248,3 +248,12 @@ class GeopediaFeatureIterator(GeopediaService):
"""
for feature in self:
yield feature['properties'].get(field, [])
+
+ def add_query(self, query=None):
+ """ Add query, e.g. f12345 = 2015
+
+ :param query: query string
+ :type query: str
+ """
+ if query:
+ self.query['filterExpression'] += ' && ' + query
|
Added method to extend query sent to geopedia, allowing filtering directly on geopedia.
|
py
|
diff --git a/config.py b/config.py
index <HASH>..<HASH> 100644
--- a/config.py
+++ b/config.py
@@ -85,7 +85,7 @@ PACKAGES_EXCLUDE = [
'invenio.modules.archiver',
'invenio.modules.cloudconnector',
'invenio.modules.comments',
- 'invenio.modules.communities', # remove with invenio/modules/communities
+ 'invenio.modules.communities',
'invenio.modules.deposit',
'invenio.modules.documentation',
'invenio.modules.documents',
|
global: communities module leftovers removal * Cleans communities module leftovers.
|
py
|
diff --git a/tcex/tcex_local.py b/tcex/tcex_local.py
index <HASH>..<HASH> 100644
--- a/tcex/tcex_local.py
+++ b/tcex/tcex_local.py
@@ -10,6 +10,7 @@ import subprocess
import sys
import time
import zipfile
+import platform
# from builtins import bytes
from setuptools.command import easy_install
@@ -259,7 +260,10 @@ class TcExLocal:
contents = os.listdir(app_path)
# create build directory
- tmp_path = os.path.join(os.sep, 'tmp', 'tcex_builds')
+ if platform == "win32":
+ tmp_path = os.path.join("c:",os.sep,'temp','tcex_builds')
+ else:
+ tmp_path = os.path.join(os.sep, 'tmp', 'tcex_builds')
if not os.path.isdir(tmp_path):
os.mkdir(tmp_path)
|
package : fix windows platform temp folder creation
|
py
|
diff --git a/pygooglechart.py b/pygooglechart.py
index <HASH>..<HASH> 100644
--- a/pygooglechart.py
+++ b/pygooglechart.py
@@ -32,7 +32,7 @@ import copy
# Helper variables and functions
# -----------------------------------------------------------------------------
-__version__ = '0.2.1'
+__version__ = '0.2.2'
__author__ = 'Gerald Kaszuba'
reo_colour = re.compile('^([A-Fa-f0-9]{2,2}){3,4}$')
|
- version bump to <I>
|
py
|
diff --git a/examples/ccxt.pro/py/binance-watch-spot-futures-balances-continuously.py b/examples/ccxt.pro/py/binance-watch-spot-futures-balances-continuously.py
index <HASH>..<HASH> 100644
--- a/examples/ccxt.pro/py/binance-watch-spot-futures-balances-continuously.py
+++ b/examples/ccxt.pro/py/binance-watch-spot-futures-balances-continuously.py
@@ -39,8 +39,10 @@ async def main():
'binancecoinm',
]
exchanges = [getattr(ccxtpro, exchange_id)(config) for exchange_id in exchange_ids]
- loops = [print_balance_continuously(exchange) for exchange in exchanges]
- await gather(*loops)
+ printing_loops = [print_balance_continuously(exchange) for exchange in exchanges]
+ await gather(*printing_loops)
+ closing_tasks = [exchange.close() for exchange in exchanges]
+ await gather(*closing_tasks)
loop = get_event_loop()
|
examples/ccxt.pro/py/binance-watch-spot-futures-balances-continuously.py minor edit
|
py
|
diff --git a/djournal/admin.py b/djournal/admin.py
index <HASH>..<HASH> 100644
--- a/djournal/admin.py
+++ b/djournal/admin.py
@@ -1,10 +1,21 @@
'''Admin specification for Djournal.'''
+from datetime import datetime
+
from django.contrib import admin
from djournal.models import Entry
class EntryAdmin(admin.ModelAdmin):
- pass
+ exclude = ('author', 'created', 'modified')
+
+ def save_model(self, request, obj, form, change):
+ if not change:
+ obj.author = request.user
+ obj.created = datetime.now()
+
+ obj.modified = datetime.now()
+
+ obj.save()
admin.site.register(Entry, EntryAdmin)
|
Add autofill/exclude of author, created and modified fields in admin.
|
py
|
diff --git a/raiden/utils/typing.py b/raiden/utils/typing.py
index <HASH>..<HASH> 100644
--- a/raiden/utils/typing.py
+++ b/raiden/utils/typing.py
@@ -156,7 +156,7 @@ TransactionHash = NewType('TransactionHash', T_TransactionHash)
# This should be changed to `Optional[str]`
SuccessOrError = Tuple[bool, Optional[str]]
-BlockSpecification = Union[str, T_BlockNumber]
+BlockSpecification = Union[str, T_BlockNumber, T_BlockHash]
ChannelMap = Dict[ChannelID, 'NettingChannelState']
|
Block Specification should include the blockhash
|
py
|
diff --git a/botskeleton/outputs/output_birdsite.py b/botskeleton/outputs/output_birdsite.py
index <HASH>..<HASH> 100644
--- a/botskeleton/outputs/output_birdsite.py
+++ b/botskeleton/outputs/output_birdsite.py
@@ -45,7 +45,7 @@ class BirdsiteSkeleton(OutputSkeleton):
self.owner_handle = f.read().strip()
else:
self.ldebug("Couldn't find OWNER_HANDLE, unable to DM...")
- self.owner_handle = None
+ self.owner_handle = ""
self.auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
self.auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)
@@ -105,7 +105,7 @@ class BirdsiteSkeleton(OutputSkeleton):
def send_dm_sos(self, message: str) -> None:
"""Send DM to owner if something happens."""
- if self.owner_handle is not None:
+ if self.owner_handle:
try:
self.api.send_direct_message(user=self.owner_handle, text=message)
|
use the fact that empty sequences are false
|
py
|
diff --git a/src/urh/dev/native/LimeSDR.py b/src/urh/dev/native/LimeSDR.py
index <HASH>..<HASH> 100644
--- a/src/urh/dev/native/LimeSDR.py
+++ b/src/urh/dev/native/LimeSDR.py
@@ -15,7 +15,7 @@ class LimeSDR(Device):
SEND_FIFO_SIZE = 5 * SEND_SAMPLES
LIME_TIMEOUT_RECEIVE_MS = 10
- LIME_TIMEOUT_SEND_MS = 1000
+ LIME_TIMEOUT_SEND_MS = 500
BYTES_PER_SAMPLE = 8 # We use dataFmt_t.LMS_FMT_F32 so we have 32 bit floats for I and Q
DEVICE_LIB = limesdr
|
set send timeout to <I> ms
|
py
|
diff --git a/motor/core.py b/motor/core.py
index <HASH>..<HASH> 100644
--- a/motor/core.py
+++ b/motor/core.py
@@ -1066,6 +1066,7 @@ class AgnosticCursor(AgnosticBaseCursor):
__motor_class_name__ = 'MotorCursor'
__delegate_class__ = Cursor
address = ReadOnlyProperty()
+ conn_id = ReadOnlyProperty()
count = AsyncRead()
distinct = AsyncRead()
explain = AsyncRead()
|
MOTOR-<I> Restore MotorCursor.conn_id property.
|
py
|
diff --git a/vc_vidyo/indico_vc_vidyo/zodbimport.py b/vc_vidyo/indico_vc_vidyo/zodbimport.py
index <HASH>..<HASH> 100644
--- a/vc_vidyo/indico_vc_vidyo/zodbimport.py
+++ b/vc_vidyo/indico_vc_vidyo/zodbimport.py
@@ -97,7 +97,7 @@ class VidyoImporter(Importer):
continue
value = match.group(0)
elif old == 'additionalEmails':
- value = list(set(value) | {x.getEmail() for x in option_value(opts['admins'])})
+ value = list(set(value) | {x.email for x in option_value(opts['admins'])})
VidyoPlugin.settings.set(new, value)
db.session.commit()
|
VC/Vidyo: Don't call legacy method in zodb import
|
py
|
diff --git a/can/util.py b/can/util.py
index <HASH>..<HASH> 100644
--- a/can/util.py
+++ b/can/util.py
@@ -153,7 +153,9 @@ def load_config(path=None, config=None, context=None):
config_sources = [
given_config,
can.rc,
- lambda _context: load_environment_config(_context),
+ lambda _context: load_environment_config( # pylint: disable=unnecessary-lambda
+ _context
+ ),
lambda _context: load_environment_config(),
lambda _context: load_file_config(path, _context),
lambda _context: load_file_config(path),
|
Disable unnecessary lambda pylint warning. This line is more readable and consistent with the other lines with the use of lambda
|
py
|
diff --git a/src/arcrest/manageags/_clusters.py b/src/arcrest/manageags/_clusters.py
index <HASH>..<HASH> 100644
--- a/src/arcrest/manageags/_clusters.py
+++ b/src/arcrest/manageags/_clusters.py
@@ -369,7 +369,7 @@ class Cluster(BaseAGSServer):
url = self._url + "/editProtocol"
params = {
"f" : "json",
- "tcpClusterPort" : str(clusterProtocolObj)
+ "tcpClusterPort" : str(clusterProtocolObj.value['tcpClusterPort'])
}
return self._do_post(url=url,
param_dict=params,
|
Fixed editProtocol method of class Clusters In _clusters.py, edited editProtocol() method to use the correct tcpClusterPort element (string from integer instead of dictionary).
|
py
|
diff --git a/fablib.py b/fablib.py
index <HASH>..<HASH> 100644
--- a/fablib.py
+++ b/fablib.py
@@ -37,7 +37,8 @@ def cron(name, timespec, user, command, environ=None):
envstr = '\n'.join('{}={}'.format(k, v)
for k, v in environ.iteritems())
entry = '{}\n{}'.format(envstr, entry)
- put(StringIO(entry), path, use_sudo=True, mode=0o644)
+ chput(StringIO(entry), path, use_sudo=True,
+ mode=0o644, user='root', group='root')
def hasrole(role):
|
Fix cron helper to set root ownership
|
py
|
diff --git a/pyspider/scheduler/scheduler.py b/pyspider/scheduler/scheduler.py
index <HASH>..<HASH> 100644
--- a/pyspider/scheduler/scheduler.py
+++ b/pyspider/scheduler/scheduler.py
@@ -518,7 +518,7 @@ class Scheduler(object):
project._selected_tasks = False
project._send_finished_event_wait = 0
- self.newtask_queue.put({
+ self._postpone_request.append({
'project': project.name,
'taskid': 'on_finished',
'url': 'data:,on_finished',
|
fix potential scheduler block when `on_finished` triggered when newtask_queue is full ref #<I>
|
py
|
diff --git a/src/streamlink/plugins/ine.py b/src/streamlink/plugins/ine.py
index <HASH>..<HASH> 100644
--- a/src/streamlink/plugins/ine.py
+++ b/src/streamlink/plugins/ine.py
@@ -15,7 +15,7 @@ class INE(Plugin):
(.*?)""", re.VERBOSE)
play_url = "https://streaming.ine.com/play/{vid}/watch"
js_re = re.compile(r'''script type="text/javascript" src="(https://content.jwplatform.com/players/.*?)"''')
- jwplayer_re = re.compile(r'''jwplayer\(".*?"\).setup\((\{.*\})\);''', re.DOTALL)
+ jwplayer_re = re.compile(r'''jwConfig\s*=\s*(\{.*\});''', re.DOTALL)
setup_schema = validate.Schema(
validate.transform(jwplayer_re.search),
validate.any(
|
plugins.ine: update to extract the relocated jwplayer config Update to fix a small change in the jwplayer embed code, fixes #<I>.
|
py
|
diff --git a/intranet/apps/emerg/views.py b/intranet/apps/emerg/views.py
index <HASH>..<HASH> 100644
--- a/intranet/apps/emerg/views.py
+++ b/intranet/apps/emerg/views.py
@@ -15,6 +15,8 @@ logger = logging.getLogger(__name__)
def check_emerg():
status = True
message = None
+ if not settings.FCPS_EMERGENCY_PAGE:
+ return None, None
r = requests.get("{}?{}".format(settings.FCPS_EMERGENCY_PAGE, int(time.time())))
res = r.text
|
ignore fcps emerg when not set
|
py
|
diff --git a/urlfetch/__init__.py b/urlfetch/__init__.py
index <HASH>..<HASH> 100644
--- a/urlfetch/__init__.py
+++ b/urlfetch/__init__.py
@@ -145,7 +145,13 @@ def _encode_multipart(data, files):
#body.write(b(content_type))
return content_type, body.getvalue()
+
+class Headers(object):
+ ''' Headers
+ to simplify fetch() interface, class Headers helps to manipulate parameters
+ '''
+ pass
class Response(object):
@@ -168,8 +174,7 @@ class Response(object):
if kwargs.get('prefetch', False):
self._body = self._r.read()
- self.close()
-
+ self.close()
@classmethod
def from_httplib(cls, r, **kwargs):
|
class Headers added to simplify of manipulation header parameters
|
py
|
diff --git a/test.py b/test.py
index <HASH>..<HASH> 100644
--- a/test.py
+++ b/test.py
@@ -14,11 +14,16 @@ def identity(f, *a, **k):
def f1():
"f1"
+def getfname(func):
+ fname = os.path.basename(func.func_globals['__file__'])
+ return os.path.splitext(fname)[0] + '.py'
+
def test0():
- assert os.path.basename(identity.func_globals['__file__']) == 'test.py'
+ this = getfname(identity)
+ assert this == 'test.py', this
print(identity.__doc__)
def test1():
- assert os.path.basename(f1.func_globals['__file__']) == 'test.py'
+ this = getfname(f1)
+ assert this == 'test.py', this
print(f1.__doc__)
-
|
Fixed two tests of the decorator module
|
py
|
diff --git a/autograd/util.py b/autograd/util.py
index <HASH>..<HASH> 100644
--- a/autograd/util.py
+++ b/autograd/util.py
@@ -148,7 +148,7 @@ def flatten(value):
if not value:
return np.array([]), lambda x : constructor()
flat_pieces, unflatteners = zip(*map(flatten, value))
- split_indices = np.cumsum([len(vec) for vec in flat_pieces])
+ split_indices = np.cumsum([len(vec) for vec in flat_pieces[:-1]])
def unflatten(vector):
pieces = np.split(vector, split_indices)
@@ -159,7 +159,7 @@ def flatten(value):
elif isinstance(getval(value), dict):
items = sorted(iteritems(value), key=itemgetter(0))
keys, flat_pieces, unflatteners = zip(*[(k,) + flatten(v) for k, v in items])
- split_indices = np.cumsum([len(vec) for vec in flat_pieces])
+ split_indices = np.cumsum([len(vec) for vec in flat_pieces[:-1]])
def unflatten(vector):
pieces = np.split(vector, split_indices)
|
splits indices in flatten don't need the last elt
|
py
|
diff --git a/wikitextparser/wikitextparser.py b/wikitextparser/wikitextparser.py
index <HASH>..<HASH> 100644
--- a/wikitextparser/wikitextparser.py
+++ b/wikitextparser/wikitextparser.py
@@ -79,7 +79,7 @@ class WikiText(WikiText):
self._common_init(string, spans)
def _common_init(self, string, spans):
- if type(string) is list:
+ if isinstance(string, list):
self._lststr = string
else:
self._lststr = [string]
|
rewrite "type(string) is list" as "isinstance(string, list)"
|
py
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -28,5 +28,5 @@ setup(name='python-amazon-simple-product-api',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=True,
- install_requires=["bottlenose"],
+ install_requires=["bottlenose", "lxml"],
)
|
Added lxml as an requirement
|
py
|
diff --git a/salt/states/dockerio.py b/salt/states/dockerio.py
index <HASH>..<HASH> 100644
--- a/salt/states/dockerio.py
+++ b/salt/states/dockerio.py
@@ -229,7 +229,7 @@ def pulled(name, force=False, *args, **kwargs):
<http://docs.docker.io/en/latest/reference/commandline/cli/#import>`_).
NOTE that we added in SaltStack a way to authenticate yourself with the
Docker Hub Registry by supplying your credentials (username, email & password)
- using pillars. For more information, see salt.modules.dockerio execution
+ using pillars. For more information, see salt.modules.dockerio execution
module.
name
@@ -256,7 +256,7 @@ def pulled(name, force=False, *args, **kwargs):
def pushed(name):
- '''
+ '''
Push an image from a docker registry. (`docker push`)
.. note::
@@ -268,7 +268,7 @@ def pushed(name):
<http://docs.docker.io/en/latest/reference/commandline/cli/#import>`_).
NOTE that we added in SaltStack a way to authenticate yourself with the
Docker Hub Registry by supplying your credentials (username, email & password)
- using pillars. For more information, see salt.modules.dockerio execution
+ using pillars. For more information, see salt.modules.dockerio execution
module.
name
|
Fixing pylint violations in dockerio
|
py
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@ test_requirements = [str(ir.req) for ir in
setup(
name='rip',
version='0.0.1',
- description='A python framework for writing restful apis.',
+ description='A python framework for writing restful APIs.',
long_description=readme + '\n\n' + history,
author='Aplopio developers',
author_email='devs@aplopio.com',
|
Correcting a minor typo in setup.py
|
py
|
diff --git a/pysnmp/entity/rfc3413/cmdrsp.py b/pysnmp/entity/rfc3413/cmdrsp.py
index <HASH>..<HASH> 100644
--- a/pysnmp/entity/rfc3413/cmdrsp.py
+++ b/pysnmp/entity/rfc3413/cmdrsp.py
@@ -251,7 +251,7 @@ class BulkCommandResponder(CommandResponderBase):
if nonRepeaters:
rspVarBinds = contextMibInstrumCtl.readNextVars(
- reqVarBinds[:nonRepeaters], (acFun, acCtx)
+ reqVarBinds[:int(nonRepeaters)], (acFun, acCtx)
)
else:
rspVarBinds = []
|
sequence index must be integer (in Python < <I>)
|
py
|
diff --git a/packages/vaex-core/vaex/dataframe.py b/packages/vaex-core/vaex/dataframe.py
index <HASH>..<HASH> 100644
--- a/packages/vaex-core/vaex/dataframe.py
+++ b/packages/vaex-core/vaex/dataframe.py
@@ -5900,7 +5900,8 @@ class DataFrameLocal(DataFrame):
def _filtered_range_to_unfiltered_indices(self, i1, i2):
assert self.filtered
- count = self.count() # force the cache to be filled
+ self._fill_filter_mask()
+ count = len(self)
assert i2 <= count
cache = self._selection_mask_caches[FILTER_SELECTION_NAME]
mask_blocks = iter(sorted(
@@ -6069,7 +6070,7 @@ class DataFrameLocal(DataFrame):
return result
else:
if not raw and self.filtered and filtered:
- count_check = len(self) # fill caches and masks
+ self._fill_filter_mask() # fill caches and masks
mask = self._selection_masks[FILTER_SELECTION_NAME]
if _DEBUG:
if i1 == 0 and i2 == count_check:
|
🐛 fill masks for non-parallel evaluate
|
py
|
diff --git a/couchbase/views/params.py b/couchbase/views/params.py
index <HASH>..<HASH> 100644
--- a/couchbase/views/params.py
+++ b/couchbase/views/params.py
@@ -510,9 +510,9 @@ class Query(object):
Returns the (uri_part, post_data_part) for a long query.
"""
uristr = self._encode(omit_keys=True)
- kstr = ""
+ kstr = "{}"
- klist = self._real_options.get('keys', None)
+ klist = self._real_options.get('keys', UNSPEC)
if klist != UNSPEC:
kstr = '{{"keys":{0}}}'.format(klist)
|
PYCBC-<I>, PYCBC-<I>: Don't send invalid JSON in POST when no keys We might still want to consider what to do in this case, but sending 'None' is certainly wrong :) Change-Id: I<I>f<I>f<I>cc1f<I>a<I>e<I>ea<I> Reviewed-on: <URL>
|
py
|
diff --git a/gns3server/compute/docker/__init__.py b/gns3server/compute/docker/__init__.py
index <HASH>..<HASH> 100644
--- a/gns3server/compute/docker/__init__.py
+++ b/gns3server/compute/docker/__init__.py
@@ -200,7 +200,10 @@ class Docker(BaseManager):
if progress_callback:
progress_callback("Pulling '{}' from docker hub".format(image))
- response = yield from self.http_query("POST", "images/create", params={"fromImage": image}, timeout=None)
+ try:
+ response = yield from self.http_query("POST", "images/create", params={"fromImage": image}, timeout=None)
+ except DockerError as e:
+ raise DockerError("Could not pull the '{}' image from Docker Hub, please check your Internet connection (original error: {})".format(image, e))
# The pull api will stream status via an HTTP JSON stream
content = ""
while True:
|
Add explicit error when trying to pull a Docker image from Docker Hub without Internet access. Fixes #<I>.
|
py
|
diff --git a/tests/test_llcp_llc.py b/tests/test_llcp_llc.py
index <HASH>..<HASH> 100644
--- a/tests/test_llcp_llc.py
+++ b/tests/test_llcp_llc.py
@@ -264,7 +264,6 @@ class TestLogicalLinkController:
threading.Timer(0.01, collect_and_dispatch, (llc,)).start()
assert llc.resolve(name) == sap
-
# -------------------------------------------------------------------------
# Test As Target
# -------------------------------------------------------------------------
|
Fix flake8 error "too many blank lines"
|
py
|
diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py
index <HASH>..<HASH> 100644
--- a/testing/acceptance_test.py
+++ b/testing/acceptance_test.py
@@ -410,15 +410,20 @@ class TestInvocationVariants:
"*1 passed*"
])
+ def join_pythonpath(what):
+ cur = py.std.os.environ.get('PYTHONPATH')
+ if cur:
+ return str(what) + ':' + cur
+ return what
empty_package = testdir.mkpydir("empty_package")
- monkeypatch.setenv('PYTHONPATH', empty_package)
+ monkeypatch.setenv('PYTHONPATH', join_pythonpath(empty_package))
result = testdir.runpytest("--pyargs", ".")
assert result.ret == 0
result.stdout.fnmatch_lines([
"*2 passed*"
])
- monkeypatch.setenv('PYTHONPATH', testdir)
+ monkeypatch.setenv('PYTHONPATH', join_pythonpath(testdir))
path.join('test_hello.py').remove()
result = testdir.runpytest("--pyargs", "tpkg.test_hello")
assert result.ret != 0
|
propogate current PYTHONPATH
|
py
|
diff --git a/grimoirelab/toolkit/_version.py b/grimoirelab/toolkit/_version.py
index <HASH>..<HASH> 100644
--- a/grimoirelab/toolkit/_version.py
+++ b/grimoirelab/toolkit/_version.py
@@ -1,2 +1,2 @@
# Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440
-__version__ = "0.1.6"
+__version__ = "0.1.7"
|
Update version number to <I>
|
py
|
diff --git a/keanu-python/keanu/plots/traceplot.py b/keanu-python/keanu/plots/traceplot.py
index <HASH>..<HASH> 100644
--- a/keanu-python/keanu/plots/traceplot.py
+++ b/keanu-python/keanu/plots/traceplot.py
@@ -1,7 +1,7 @@
try:
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
-except ImportError: # mpl is optional
+except ImportError: # mpl is optional
pass
import numpy as np
|
Apply gradlew formatApply.
|
py
|
diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100755
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -36,7 +36,7 @@ class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return Mock()
-MOCK_MODULES = ['Bio', 'biopython', 'emase', 'g2gtools', 'pysam', 'tables', 'numpy', 'scipy', 'scipy.sparse', 'scipy.interpolate', 'matplotlib', 'matplotlib.pyplot']
+MOCK_MODULES = ['Bio', 'biopython', 'emase', 'pysam', 'tables', 'numpy', 'scipy', 'scipy.sparse', 'scipy.interpolate', 'matplotlib', 'matplotlib.pyplot']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
import gbrs
|
Updated docs/conf.py
|
py
|
diff --git a/pipenv/cli.py b/pipenv/cli.py
index <HASH>..<HASH> 100644
--- a/pipenv/cli.py
+++ b/pipenv/cli.py
@@ -909,7 +909,7 @@ def uninstall(package_name=False, more_packages=False, three=None, python=False,
click.echo(crayons.blue(c.out))
if pipfile_remove:
- norm_name = pep426_name(package_name)
+ norm_name = pep423_name(package_name)
if norm_name in project._pipfile['dev-packages'] or norm_name in project._pipfile['packages']:
click.echo('Removing {0} from Pipfile...'.format(crayons.green(package_name)))
else:
|
Fixes Typo ... Fixes typo and closes #<I> ...
|
py
|
diff --git a/angr/analyses/cgc.py b/angr/analyses/cgc.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/cgc.py
+++ b/angr/analyses/cgc.py
@@ -36,11 +36,22 @@ class CGC(Analysis):
return False
+ @staticmethod
+ def check_for_eip_control(p):
+ if not p.reachable:
+ return False
+ # Try to constrain successor to 0x41414141 (see if we control eip)
+ for succ in p.next_run.unconstrained_successors:
+ if succ.se.solution(succ.ip, 0x41414141):
+ p.state.add_constraints(succ.ip == 0x41414141)
+ return True
+ return False
+
def __init__(self):
# make a CGC state
s = self._p.initial_state()
s.get_plugin('cgc')
- self.e = self._p.surveyors.Explorer(start=self._p.exit_to(self._p.entry, state=s), find=self.check_path)
+ self.e = self._p.surveyors.Explorer(start=self._p.exit_to(self._p.entry, state=s), find=self.check_for_eip_control)
self.e.run()
self.vuln_path = (self.e.found + self.e.errored)[0]
|
added a function to search for a controlled eip in the cgc analysis
|
py
|
diff --git a/src/trackers/base.py b/src/trackers/base.py
index <HASH>..<HASH> 100644
--- a/src/trackers/base.py
+++ b/src/trackers/base.py
@@ -129,7 +129,7 @@ class IssueTracker():
try:
text = issue_data['text']
childs = issue_data.get('childs', {})
- except (KeyError, TypeError):
+ except (KeyError, TypeError, AttributeError):
text = issue_data
childs = {}
print "{} * {} - {}".format(" " * indent, issue_id, text)
|
Preventive additional AttributeError to except clause
|
py
|
diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/dependencies.py b/datadog_checks_dev/datadog_checks/dev/tooling/dependencies.py
index <HASH>..<HASH> 100644
--- a/datadog_checks_dev/datadog_checks/dev/tooling/dependencies.py
+++ b/datadog_checks_dev/datadog_checks/dev/tooling/dependencies.py
@@ -61,7 +61,7 @@ def load_base_check(req_file, dependencies, errors, check_name=None):
if line.startswith('CHECKS_BASE_REQ'):
try:
dep = line.split(' = ')[1]
- req = Requirement(dep.strip("'"))
+ req = Requirement(dep.strip("'\""))
except (IndexError, InvalidRequirement) as e:
errors.append(f'File `{req_file}` has an invalid base check dependency: `{line}`\n{e}')
return
|
Allow double quote on requirement (#<I>) * Allow double quote on requirement
|
py
|
diff --git a/eulfedora/views.py b/eulfedora/views.py
index <HASH>..<HASH> 100644
--- a/eulfedora/views.py
+++ b/eulfedora/views.py
@@ -33,7 +33,7 @@ Using these views (in the simpler cases) should be as easy as::
from __future__ import unicode_literals
import logging
-from django.contrib.auth import views as authviews
+from django.contrib.auth import login
from django.http import HttpResponse, Http404, HttpResponseBadRequest, \
StreamingHttpResponse
from django.views.decorators.http import require_http_methods, condition
@@ -498,7 +498,7 @@ def login_and_store_credentials_in_session(request, *args, **kwargs):
you need the functionality.**
'''
- response = authviews.login(request, *args, **kwargs)
+ response = login(request, *args, **kwargs)
if request.method == "POST" and request.user.is_authenticated:
# on successful login, encrypt and store user's password to use for fedora access
request.session[FEDORA_PASSWORD_SESSION_KEY] = encrypt(request.POST.get('password'))
|
Removes deprecated authviews.login
|
py
|
diff --git a/multiqc/modules/seqyclean/seqyclean.py b/multiqc/modules/seqyclean/seqyclean.py
index <HASH>..<HASH> 100644
--- a/multiqc/modules/seqyclean/seqyclean.py
+++ b/multiqc/modules/seqyclean/seqyclean.py
@@ -17,7 +17,8 @@ class MultiqcModule(BaseMultiqcModule):
# Initialise the parent object
super(MultiqcModule, self).__init__(name='SeqyClean', anchor='seqyclean',
href="https://github.com/ibest/seqyclean",
- info="These graphs analyze the seqyclean files created during the pipeline. There are two associated graphs. The first one shows the total number of pairs kept and discarded. The second breaks down the reasons why certain pairs were discarded.")
+ info=""" is a pre-processing tool for NGS data able to do filtering of adapters,
+ vector / contaminants, quality trimming, poly A/T trimming and trimming of overlapping paired reads.""")
# Parse logs
self.seqyclean = dict()
|
Update multiqc/modules/seqyclean/seqyclean.py
|
py
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.