id stringlengths 24 28 | content stringlengths 121 2.08k |
|---|---|
codereview_python_data_9671 | if not tool.check_if_installed():
tool.install()
- jmeter_version = self.settings.get("version")
jmeter_path = self.settings.get("path", "~/.bzt/jmeter-taurus/{version}/")
jmeter_path = get_full_path(jmeter_path)
download_link = self.settings.get("download... |
codereview_python_data_9673 | except OSError:
# Note: Auxiliary Data is only supported since
# Linux 2.6.21
- warning("Your Linux Kernel does not support Auxiliary Data!")
if isinstance(self, L2ListenSocket):
self.outs = None
else:
this sounds a litt... |
codereview_python_data_9677 | from tqdm.auto import tqdm
from .. import version
-from .util import deprecate
def start_logging(logfile="MDAnalysis.log", version=version.__version__):
```suggestion ``` shouldn't be necessary anymore
from tqdm.auto import tqdm
from .. import version
def start_logging(logfile="MDAnalysis.log", version=version.... |
codereview_python_data_9680 | return value
def __repr__(self):
- return utils.get_repr(self, none_ok=self.none_ok, minval=self.minval,
- maxval=self.maxval, minperc=self.minperc,
maxperc=self.maxperc)
The values passed to the constructor are called `minint` and `maxin... |
codereview_python_data_9681 | .. versionadded:: 0.17.0
.. versionchanged:: 0.19.0
The attached Reader when trajectory=True is now a MemoryReader
"""
if not n_atoms:
n_residues = 0
Add a `.. versionchanged:: 0.21.0` entry.
.. versionadded:: 0.17.0
.. versionchanged:: 0.... |
codereview_python_data_9690 | finding_id = finding_list[0]
to_be_updated_finding = finding_list[1]
- if (finding_id not in new_findings_map and
- to_be_updated_finding['state'] == 'ACTIVE'):
to_be_updated_finding['state'] = 'INACTIVE'
current_time = date_time.... |
codereview_python_data_9695 | trees = model_str[model_str.find('Tree=0'):model_str.find('end of trees')]
more_trees = (one_tree * multiplier).format(*range(2, total_trees))
after_trees = model_str[model_str.find('end of trees'):]
- num_end_spaces = (2**31 - one_tree_size * total_trees)
new_model_str = f"{b... |
codereview_python_data_9697 | return x
def i2repr(self, pkt, x):
- return "%s%s" % (self.i2h(pkt, x), self.unit)
def randval(self):
value = super(ScalingField, self).randval()
The space must be kept.
return x
def i2repr(self, pkt, x):
+ return "%s %s" % (self.i2h(pkt, x), self.unit)
def... |
codereview_python_data_9709 | assert revoc_def_type
tags = cred_def_id.split(":")
- revoc_def = make_state_path_for_revoc_def(tags[0], cred_def_id, revoc_def_type, revoc_def_tag)
revoc_def_id, _, _, _ = self.lookup(revoc_def, isCommitted=False)
if revoc_def is None:
The author DID here is not the author o... |
codereview_python_data_9711 | # Generic per-Column annotation, exactly 1 char per column
# Format: "#=GC <feature> <exactly 1 char per column>"
feature, text = line[5:].strip().split(None, 1)
- # Each feature key could be used more than once,
- # so... |
codereview_python_data_9716 | def test_select_slice(self):
cube = Dataset(self.cube)
- self.assertEqual(cube.select(longitude=(0, 1.01)).data.data,
np.array([[1, 2], [5, 6], [9, 10]], dtype=np.int32))
def test_select_set(self):
Is the extra .01 due to inclusive vs exclusive bounds?
def te... |
codereview_python_data_9721 | """Return a tuple of exceptions meaning 'skip this test', to re-raise.
This is intended to cover most common test runners; if you would
- like another to be added please open an issue or pull request.
"""
# This is a set because nose may simply re-export unittest.SkipTest
exceptions = set()
... |
codereview_python_data_9725 | if frame.ncols < 2:
return
s = self.random_array(frame.ncols - 1, positive=True)
- s = sorted(set(s))
print("[14] Removing columns %r -> ncols = %d"
% (s, frame.ncols - len(s)))
if python_output:
Theoretically, you don't have to either sort or dedu... |
codereview_python_data_9736 | image: TensorLike, channel: int, bins: Optional[int] = 256
) -> tf.Tensor:
"""Scale the data in the channel to implement equalize."""
image_dtype = image.dtype
image = tf.cast(image[:, :, channel], tf.int32)
For line 43 could it clip with 0 ?
image: TensorLike, channel: int, bins: Optional[i... |
codereview_python_data_9737 | from MDAnalysis.tests.datafiles import PDB
import pickle
-import sys
@pytest.fixture(params=[
We can drop these now that we're past 1.0.
from MDAnalysis.tests.datafiles import PDB
import pickle
@pytest.fixture(params=[ |
codereview_python_data_9738 | def resize_rows(self, nrows):
curr_nrows = self.nrows
- try:
self.df.nrows = nrows
- except ValueError as e:
- assert str(e) == "Cannot increase the number of rows in a keyed frame"
- return
if curr_nrows < nrows:
append = [None] * (nr... |
codereview_python_data_9742 | # Options for LaTeX output
# ------------------------
-# Notes for customization
-# https://www.sphinx-doc.org/en/master/latex.html
-# https://github.com/sphinx-doc/sphinx/issues/4136
-
-# Use a latex engine allows for unicode characters in docstrings
latex_engine = "xelatex"
-
-# Docs on xindy: https://www.sphinx-d... |
codereview_python_data_9746 | stmts.append(self.gen_classdef())
return ast.Module(body=stmts)
-
def get_data_source_readers(self):
readers = []
for idx, source in enumerate(self.scenario.get_data_sources(), start=1):
reader_tpl = "reader{idx} = CSVReaderPerThread({params})"
- params =... |
codereview_python_data_9749 | def __repr__(self):
"""Represent the UniGene Record object as a string for debugging."""
- return "<%s> %s %s\n%s" % (
self.__class__.__name__,
self.ID,
self.symbol,
This isn't a very standard ``__repr__`` string, the trailing ``\n`` is most unusual. Do you w... |
codereview_python_data_9754 | kwargs['_env']['ANSIBLE_FORCE_COLOR'] = 'false'
try:
- output = sh.ansible_playbook(playbook, *args, **kwargs)
if self.molecule._args['--debug']:
ansible_env = {k: v for (k, v) in kwargs['_env'].items() if 'ANSIBLE' in k}
other_env = {k: v ... |
codereview_python_data_9759 | 'cloudsqlinstance'
]
- bigquery_type_list = [
- 'dataset',
- ]
-
gsuite_type_list = [
'gsuite_group',
'gsuite_user',
If it is gcp resources, it should go to gcp_type_list
'cloudsqlinstance'
]
gsuit... |
codereview_python_data_9761 | def dynamodb_get_table_stream_specification(table_name):
- stream_specification = {}
- ddb_client = aws_stack.connect_to_service('dynamodb')
try:
- stream_specification = ddb_client.describe_table(TableName=table_name)['Table'].get('StreamSpecification')
except Exception as e:
- LOGGER.in... |
codereview_python_data_9766 | __maintainer__ = __author__
__email__ = "mail@qutebrowser.org"
__version__ = "1.5.0"
-__version_info__ = __version__.split('.')
__description__ = "A keyboard-driven, vim-like browser based on PyQt5."
basedir = os.path.dirname(os.path.realpath(__file__))
Those should be integers, not strings.
__maintainer__ = __... |
codereview_python_data_9777 | chunked = not (request.body is None or 'Content-Length' in request.headers)
- if isinstance(timeout, TimeoutSauce):
- pass
- elif isinstance(timeout, tuple):
try:
connect, read = timeout
timeout = TimeoutSauce(connect=connect, read=read)
... |
codereview_python_data_9784 | from netlib import version
def sysinfo():
data = [
- "Mitmproxy verison: %s" % version.VERSION,
"Python version: %s" % platform.python_version(),
"Platform: %s" % platform.platform(),
]
d = platform.linux_distribution()
t = "Linux distro: %s %s %s" % d
Can we add the open... |
codereview_python_data_9786 | line = inf.readline()
while not len(line.split()) == 5:
line = inf.readline()
while line and not line.startswith('timestep'):
name = line[:8].strip()
I think this has the ability to infinitely loop if a (non HISTORY) file never has 5 tokens on a ... |
codereview_python_data_9790 | variables = re.findall(r'#{(.*?)}', decoded_test, flags=re.DOTALL)
if variables:
- private_facts = await self._explode_private_facts(operation['id'], agent['id'])
- relevant_facts = await self._build_relevant_facts(variables, operation.get('facts', []), private_fa... |
codereview_python_data_9795 | import pandas
from pandas.api.types import is_scalar
-from pandas.compat import to_str, string_types, numpy, cPickle as pkl
import pandas.core.common as com
from pandas.core.dtypes.common import (
_get_dtype_from_object,
can we alias `numpy as numpy_compat` or something like that? It will be confusing if we j... |
codereview_python_data_9800 | @pytest.mark.skipif(executable_not_found("hole"), reason="Test skipped because HOLE not found")
class TestHOLE(object):
- filename = PDB_HOLE
-
@pytest.fixture()
- def H(self, tmpdir):
# keep tempdir around for the whole lifetime of the class
with tmpdir.as_cwd():
- H = HOL... |
codereview_python_data_9802 | if "egg_incubators" in inv_data:
for incubator in inv_data.get("egg_incubators", {}).get("egg_incubator", []):
- incubators.append({"id":incubator.get("item_id", -1), "used":False})
if "pokemon_data" in inv_data:
pokemon ... |
codereview_python_data_9814 | A new DataFrame filled with Booleans.
"""
if level is not None:
- raise NotImplementedError(
- "Mutlilevel index not yet supported " "in Modin"
- )
other = self._validate_other(other, axis)
new_manager = self._data_manager.gt(other=ot... |
codereview_python_data_9815 | if util.verify_vote_signature(block, vote):
return block
else:
- raise ImproperVoteError('Block {block_id} already has in incorrectly signed vote '
'from public key {me}').format(bl... |
codereview_python_data_9817 | Returns:
int: the number of bytes this user's listens take in the dump file
"""
- self.log.info('Dumping user %s...', username)
-
t0 = time.time()
offset = 0
bytes_written = 0
I think this should go away, its noise in the grand scheme of things.
... |
codereview_python_data_9820 | force_search = False
if not utils.supports_selection():
sel = False
- text = utils.get_clipboard(selection=sel)
text_urls = [u for u in text.split('\n') if u.strip()]
if (len(text_urls) > 1 and not urlutils.is_url(text_urls[0]) and
urlutils.get_path_i... |
codereview_python_data_9821 | ri = urlparse(url)
- # Strip port numbers from netloc
if isinstance(url, str):
- host = ri.netloc.split(u':')[0]
- else:
- host = ri.netloc.split(b':')[0]
try:
_netrc = netrc(netrc_path).authenticators(host)
Suggestion: ``` py splitstr = b':' ... |
codereview_python_data_9823 | """Add a child to the Entity."""
entity_id = entity.get_id()
if self.has_id(entity_id):
- raise PDBConstructionException("%s defined twice" % str(entity_id))
entity.set_parent(self)
self.child_list.append(entity)
self.child_dict[entity_id] = entity
This ... |
codereview_python_data_9828 | view_name = "Unknown Image"
return view_name, base.format_dict(multidict.MultiDict(image_metadata))
- def should_render(self, content_type):
- return content_type.startswith("image/") and content_type != "image/svg+xml"
Might be worthy of note that this changes assumes now forward-compa... |
codereview_python_data_9830 | you will need to call :meth:`start_py_workers` before calling :meth:`build` of any
of the pipelines. You can find more details and caveats of both methods in Python's
``multiprocessing`` module documentation.
-`py_callback_pickler` : module or tuple, default = nvidia.dali.pickling
- If `py_start_metho... |
codereview_python_data_9832 | 'type': 'string',
},
'tls_verify': {
- 'type': 'integer',
- 'regex': '^[0-1]$',
}
}
}
This should be a boolean or?
'type': 'string',
},
... |
codereview_python_data_9836 | from __future__ import absolute_import
from __future__ import unicode_literals
from . import misc
-from sys import version_info
import dnf.pycomp
import glob
import logging
You can save one line if you import it from pycomp (`from .pycomp import PY3`).
from __future__ import absolute_import
from __future__ im... |
codereview_python_data_9844 | xlabel(r"frame number $t$")
ylabel(r"native contacts $q_1$")
- if not filename is None:
savefig(filename)
def _plot_qavg_pcolor(self, filename=None, **kwargs):
the old code was actually correct and more pythonic and encouraged.
xlabel(r"frame number $t$")
y... |
codereview_python_data_9845 | int
The number of bits needed
"""
- if self.number_of_edges() >= 0x80000000:
- return 64
- elif self.number_of_nodes() >= 0x80000000:
return 64
else:
return 32
shouldn't be "or"? #edges can be smaller than 2^31 but #nodes is > 2... |
codereview_python_data_9849 | import Bio.Seq
import Bio.SeqRecord
import numpy as np
-from inspect import signature as inspect_signature
from ..lib.util import (cached, convert_aa_code, iterable, warn_if_not_unique,
unique_int_1d)
```suggestion ``` duplicate import (see above on line 40)?
import Bio.Seq
import Bio.S... |
codereview_python_data_9850 | self.follow_redirects = self.config.get('follow-redirects', None)
self.body = self.__get_body()
- def by_priority(self, name, default=None):
val = self.config.get(name, None)
if val is None:
val = self.scenario.get(name, None)
Maybe we should rename it back to `prior... |
codereview_python_data_9851 | "size": int(line_split[3]),
"strand": strand,
"srcSize": int(line_split[5]),
- "leftStatus": None,
- "leftCount": None,
- "rightStatus": None,
- "rightCount": None,
... |
codereview_python_data_9852 | 'Bio.Affy',
'Bio.Cluster',
'Bio.KDTree',
- 'Bio.phenotype'
]
if os.name == 'java':
Ideally that would have included a trailing comma, so that next time an entry is added to the list it is a one line change. But there's no real need to change it now.
'Bio.Affy',
'Bio.Cluster',
'Bio.K... |
codereview_python_data_9853 | except (
expat.ExpatError, SocketServer.socket.error,
xmlrpclib.Fault) as exception:
- logger.warning('Error while making RPC call: {0!s}'.format(exception))
return None
def Close(self):
maybe add "with error" for consistence?
except (
expat.ExpatError, SocketServer... |
codereview_python_data_9860 | This class computes an assignment between the targets and the predictions
based on the costs. The costs are weighted sum of three components:
- classfication cost, regression L1 cost and regression giou cost. The
targets don't include the no_object, so generally there are more
predictions than ta... |
codereview_python_data_9862 | def fcos_target_single(self, gt_bboxes, gt_labels, points, regress_ranges):
num_points = points.size(0)
num_gts = gt_labels.size(0)
- if len(gt_bboxes) == 0:
return gt_labels.new_zeros(num_points), \
gt_bboxes.new_zeros((num_points, 4))
Thanks for fixing t... |
codereview_python_data_9864 | from ..utils import toindex
from .. import backend as F
-__all__ = ['sample_neighbors']
SAMPLING_SERVICE_ID = 6657
INSUBGRAPH_SERVICE_ID = 6658
Why is this under sampling.py? Seems we need a new name for this file or move it to a separate one
from ..utils import toindex
from .. import backend as F
+__all__ = ['... |
codereview_python_data_9865 | def float2str(value, precision=None):
return "{0:.{1}f}".format(value, precision) \
- if (precision is not None) and (not isinstance(value, str)) else str(value)
def add(root, parent=None, decision=None):
"""recursively add node or edge"""
Please remove the brackets and use `stri... |
codereview_python_data_9866 | current_app.logger.error("Error while getting artist_country_codes, {}".format(err), exc_info=True)
error_msg = ("An error occurred while calculating artist_map data, "
"try setting 'force_recalculate' to 'false' to get a cached copy if available"
- "Payload: ... |
codereview_python_data_9867 | class ProjectLocaleQuerySet(models.QuerySet):
def available(self):
"""
- Available project locales belong to translable projects.
"""
return self.filter(
project__disabled=False,
- project__system_project=False,
project__resources__isnull=Fals... |
codereview_python_data_9874 | def _to_int(value):
"""Transforms a value into a database integer (or None)."""
# pylint: disable=no-else-return
if value is None:
return None
elif not value:
Would it make sense to change lines 86-91 to: ``` if not value: return None else: return int(value) ``` Al... |
codereview_python_data_9875 | elif isinstance(data, (Seq, int, float)):
raise TypeError(
"The sequence data given to a MutableSeq object "
- "should be a string or an array "
- "(not a Seq object etc)"
)
else:
self.data = data # assumes the inpu... |
codereview_python_data_9881 | def __repr__(self):
repr_str = self.__class__.__name__
- repr_str += '(transformations={})'.format(self.transforms)
return repr_str
Thanks! You may also change the key here from `transformations` to `transforms`.
def __repr__(self):
repr_str = self.__class__.__name__
+ ... |
codereview_python_data_9894 | async def explode_agents(self, criteria: object = None) -> object:
agents = await self.dao.get('core_agent', criteria)
for a in agents:
- sql = 'SELECT g.id, g.name FROM core_group g JOIN core_group_map m on g.id=m.group_id ' \
- 'WHERE m.agent_id = %s;' % a['id']
- ... |
codereview_python_data_9902 | attrs[attrname] = attr(vals)
if not 'mass' in attrs:
- print('Ive got no masses!')
attrs['mass'] = Masses(np.zeros(natoms))
if not 'charge' in attrs:
attrs['charge'] = Charges(np.zeros(natoms, dtype=np.float32))
No `print` in library code. If necessar... |
codereview_python_data_9905 | import inspect
import mmtf
import numpy as np
-from MDAnalysis.exceptions import FileIOError
from MDAnalysis.lib.util import isstream
from .. import _READERS, _PARSERS, _MULTIFRAME_WRITERS, _SINGLEFRAME_WRITERS
remove (see below)
import inspect
import mmtf
import numpy as np
from MDAnalysis.lib.util import i... |
codereview_python_data_9907 | )
-def _gen_for_pad_lines_after_first(prefix, s):
- lines = iter(s.splitlines())
- yield next(lines)
- for line in lines:
- yield prefix + line
-
-
def pad_lines_after_first(prefix, s):
"""Apply a prefix to each line in s after the first."""
- return '\n'.join(_gen_for_pad_lines_after_first(pr... |
codereview_python_data_9915 | """A QtWebEngine tab in the browser."""
WIDGET_CLASS = QOpenGLWidget
- history_prepared = []
def __init__(self, win_id, mode_manager, parent=None):
super().__init__(win_id=win_id, mode_manager=mode_manager,
If you assign this here on class level, every `WebEngineTab` will share the same `his... |
codereview_python_data_9921 | Default: None
norm_cfg (dict): dictionary to construct and config norm layer.
Default: dict(type='BN')
- reverse (bool): Reverse the order of planes in layer sequence.
- False for ResNet, True for Houglass. Default: False
"""
def __init__(self,
It is is mo... |
codereview_python_data_9931 | "Text color for the keyhint widget."),
('keyhint.fg.suffix',
- SettingValue(typ.QssColor(), '#FFFF00'),
"Highlight color for keys to complete the current keychain"),
('keyhint.bg',
I think this should be `CssColor` as the color is used inside HTML and n... |
codereview_python_data_9934 | amount=buy_amount,
rate=Price(rate),
fee=Fee(fee),
- fee_currency=buy_asset, # Assumption that mineFee is denominated in outputCurrency
link='',
notes='Trade from ShapeShift',
)
I assume typo ```suggestion fee_currency=buy_asset, # A... |
codereview_python_data_9939 | return st.sampled_from(literals)
if is_annotated_type(thing):
args = thing.__args__
annotated_type = args[0]
return st.from_type(annotated_type)
# Now, confirm that we're dealing with a generic type as we expected
What if `args == ()`? Should we check for this in `is_annot... |
codereview_python_data_9942 | def __init__(self, rename={}, source=None, subscribers=[],
linked=True, **params):
"""
- Mapping allows multiple streams with similar event state to be
- used by remapping parameter names.
Source is an optional argument specifying the HoloViews
datastructu... |
codereview_python_data_9962 | # Publish a simple message to the specified SNS topic
response = sns.publish(
- TopicArn='my-topic-arn',
Message='Hello World!',
)
you should put a demo arn here ```suggestion TopicArn='arn:aws:sns:region:0123456789:my-topic-arn', ```
# Publish a simple message to the specified SNS topic
response... |
codereview_python_data_9967 | import colorama
import jinja2
import m9dicts
-import paramiko
colorama.init(autoreset=True)
-GENERATED_SSH_KEY_LOCATION = '/tmp/molecule_rsa'
-
class LogFilter(object):
def __init__(self, level):
Would be nice to use something that chooses the OS tempdir.
import colorama
import jinja2
import m9dicts
col... |
codereview_python_data_9972 | from zipline.data.data_portal import DataPortal
from zipline.data.minute_bars import BcolzMinuteBarWriter, \
US_EQUITIES_MINUTES_PER_DAY, BcolzMinuteBarReader
-from zipline.data.us_equity_pricing import BcolzDailyBarReader
from zipline.finance.trading import TradingEnvironment
from zipline.protocol import BarD... |
codereview_python_data_9974 | user, password = None, None
try:
net = netrc.netrc(config.val.content.netrc_file)
- if url.port():
authenticators = net.authenticators(
"{}:{}".format(url.host(), url.port())
)
Sorry, didn't notice this before: The default/invalid value for `QUrl.por... |
codereview_python_data_9975 | Args:
weight_decay: A `Tensor`, a floating point value, or a schedule
- that is a `tf.keras.optimizers.schedules.LearningRateSchedule
to decay the variable by, in the update step.
**kwargs: Optional list or tuple or set of `Variable` objects to
... |
codereview_python_data_9980 | for i, ts in enumerate(
self._trajectory[self.start:self.stop:self.step]):
#logger.info("--> Doing frame {} of {}".format(i+1, self.nframes))
- self._single_frame()
#logger.info("Finishing up")
self._conclude()
Is there a reason why this line has to g... |
codereview_python_data_9988 | Negative indices count from the end, such that -1 is the
last tab.
count: The tab index to focus, starting with 1.
- zero_count: The tab index to focus, with 0.
- The special value 0 value focuses the last focused tab.
"""... |
codereview_python_data_9989 | logger = logging.getLogger(__name__)
-c = Monitor()
class Block(object):
Give a more descriptive name to `c`, I think `monitor` is fine. (Yup, we will give a more descriptive name also to `b` one day)
logger = logging.getLogger(__name__)
+monitor = Monitor()
class Block(object): |
codereview_python_data_9991 | ------
NetworkXNotImplemented
The algorithm does not support DiGraph, MultiGraph and MultiDiGraph.
- If the input graph is an instance of one of these classes, a
- :exc:`NetworkXNotImplemented` is raised.
Examples
--------
IMO this last sentence (`If the input graph...`) is r... |
codereview_python_data_9993 | def _dict_config(self, config):
if config and isinstance(config, six.string_types):
- return dict(map(lambda i: i.split('=',1), config.split('|')))
def _text_arg(self, name, value):
if value:
should be a space after the comma here, but not blocking
def _dict_config(self, co... |
codereview_python_data_10002 | from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineScript, QWebEngineHistory
from qutebrowser.config import config
-from qutebrowser.browser import (browsertab, eventfilter, shared, webelem, greasemonkey)
from qutebrowser.browser.webengine import (webview, webengineelem, tabhistory,
... |
codereview_python_data_10003 | # See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
-"""
-Ops for building neural network layers
-"""
from __future__ import absolute_import
from __future__ import division
from __fu... |
codereview_python_data_10007 | Returns a tuple of (width, height) in pixels.
"""
return (plot.state.height, plot.state.height)
Surely it is only the `load_notebook` bit that needs to go?
Returns a tuple of (width, height) in pixels.
"""
return (plot.state.height, plot.state.height)
+
+ @clas... |
codereview_python_data_10008 | :param url: URL to send.
:param headers: dictionary of headers to send.
:param files: dictionary of {filename: fileobject} files to multipart upload.
- :param data: the body to attach the request. If a dictionary is provided, form-encoding will take place.
- :param json: json for the body to attach... |
codereview_python_data_10016 | def ball_throw_reticle_fail_delay(success_prob=0.95):
'''
- Chances to skip the reticle should be constant,
so the wait time before throwing is binomial,
- given that the monster does not interrupt... <- TODO
'''
for trial in range(10):
if random() < success_prob:
break
... |
codereview_python_data_10026 | self.assertRaises(ValueError, list, mmcif._splitline("foo b'ar'"))
def test_verbatim_block(self):
- """Verbatim bocks parsed correctly.
Verbatim blocks delimited by ";...;" should have the final newline
stripped. Whitespace may be stripped from the end of the line but not
Maybe t... |
codereview_python_data_10028 | results: list
Fraction of native contacts for each frame
"""
- assert(grA.universe == grB.universe)
self.u = grA.universe
self.grA, self.grB = grA, grB
You don't want an assert here, do a proper if not x==y: raise ValueError with a nice message
results... |
codereview_python_data_10032 | self.assertRaises(FileNotFoundError, d.get_raw, "alpha")
def test_old_check_same_thread(self):
- """Setting check_same_thread to False doesn't raise an exception"""
d = SeqIO.index_db("Roche/triple_sff_rel_paths.idx")
def reader_thread():
Needs a trailing full... |
codereview_python_data_10037 | return len(self._data) # Seq API requirement
def __getitem__(self, index): # Seq API requirement
- """ Return a subsequence of single letter, use my_seq[index].
>>> my_seq = Seq('ACTCGACGTCG')
>>> my_seq[5]
Unwanted space before "Return"
return len(self._data) # Seq ... |
codereview_python_data_10053 | config.username = raw_input("Username: ")
if not config.password and 'password' not in load:
config.password = getpass("Password: ")
- if config.proxy_ip and len(config.proxy_ip)>0 and config.proxy_ip.count('.') == 3 and all(0<=int(num)<256 for num in config.proxy_ip.rstrip().split('.')):
- ... |
codereview_python_data_10054 | # report to server
# Review Very Carefully for the following line, forbiden ID changed PR:
if bot.config.health_record:
- logger.log('[x] Send anonymous bot health report to server, it can be disabled by config \"health_record\":false in config file', 'red')
- logger.log... |
codereview_python_data_10059 | else:
hatch = concurrency
- wrapper = os.path.join(get_full_path(__file__, step_up=2), "resources", "locustio-taurus-wrapper.py")
if load.duration:
self.env.set({"LOCUST_DURATION": dehumanize_time(load.duration)})
Why have this logic?
else:
hatc... |
codereview_python_data_10060 | return self._read_next_timestep()
@property
def n_frames(self):
# Second line is traj_key, imcom, n_atoms, n_frames, n_records
offsets = []
with open(self.filename, 'r') as f:
f.readline()
- n_frames = int(f.readline().split()[3])
positi... |
codereview_python_data_10063 | """
default_domain = self.scenario.get("default-domain", None)
default_port = self.scenario.get("default-port", None)
- retrieve_resources = self.scenario.get("retrieve-resources", None)
concurrent_pull_size = self.scenario.get("concurrent-pull-size", 4)
timeout = sel... |
codereview_python_data_10066 | 'startpage': QUrl(config.get('general', 'startpage')[0]),
'default-page': config.get('general', 'default-page'),
}
- first_tab_url = self.widget(0).url()
- last_close_url_used = first_tab_url == urls[last_close]
if only_one_tab_open and n... |
codereview_python_data_10067 | from kombu.utils.encoding import bytes_to_str, str_to_bytes
-from celery.five import bytes_if_py2, items, string_t
from .encoding import safe_repr
try:
Perhaps out of scope for this PR, but I wonder if we still need `bytes_if_py2` here.
from kombu.utils.encoding import bytes_to_str, str_to_bytes
+from celery.five... |
codereview_python_data_10069 | def test___repr___empty():
- modin_s = pd.Series()
- pandas_s = pandas.Series()
- assert repr(modin_s) == repr(pandas_s)
@pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
```suggestion def test___repr___empty(): modin_s, pandas_s = pd.Series(), pandas.Series() assert repr(modin_s) == re... |
codereview_python_data_10070 | applied.
""",
deprecation_message="""
-This setting is deprecated and will be removed in a future version. To get
-the future behaviour set ``timeout=hypothesis.unlimited`` instead (which will
-remain valid for a further deprecation period after this setting has gone
-away).
""",
future_default=unlimited,
... |
codereview_python_data_10079 | def _current_title(self):
"""Convenience method to get the current title."""
- title = self._current_widget().title()
- return title if title else "(null)"
def _current_widget(self):
"""Get the currently active widget from a command."""
I'm not sure if this should be handled h... |
codereview_python_data_10087 | The :class:`GSDParser` generates a topology from files for the HOOMD_ code.
-TODO: write info
.. _HOOMD: http://codeblue.umich.edu/hoomd-blue/index.html
-.. _HOOMD XML: http://codeblue.umich.edu/hoomd-blue/doc/page_xml_file_format.html
Classes
-------
this class needs tests (separate to the reader tests). check th... |
codereview_python_data_10092 | if fuzz_target:
engine_impl = engine.get(fuzz_target.engine)
if not engine_impl:
- raise RuntimeError(engine_impl)
self._is_black_box = False
self._engine_impl = engine_impl
Why engine_impl in argument as it is None ? Maybe a message is better 'Engine not found or something'
... |
codereview_python_data_10097 | if directory:
# Path of the sample file that we will read to get the remaining
# columns.
- pd = ParquetDataset(path)
column_names = pd.schema.names
else:
pf = ParquetFile(path)
Do we need to look at all the fi... |
codereview_python_data_10099 | return np.zeros(6, dtype=np.float32)
-def triclinic_vectors(dimensions):
"""Convert ``[lx, ly, lz, alpha, beta, gamma]`` to a triclinic matrix
representation.
If the boxes are always convex, I wonder how this performance compares with the volume calculation available from Qhull via ConvexHull in SciPy
... |
codereview_python_data_10107 | __all__ = ['gspmm']
def reshape_lhs_rhs(lhs_data, rhs_data):
- r""" Reshape the dimension of lhs and rhs data
Parameters
----------
this reshape function seems the same as the one above. can we merge them?
__all__ = ['gspmm']
def reshape_lhs_rhs(lhs_data, rhs_data):
+ r""" Reshape the dimension of... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.