id stringlengths 24 28 | content stringlengths 121 2.08k |
|---|---|
codereview_python_data_11832 | self.string = string
self.expr = expr
- # def analyse_types doesn't exist because nothing needs doing
-
- def coerce_to_pyobject(self, env):
- return self.string
def analyse_as_type(self, env):
# for compatibility when used as a return_type_node, have this interface too
Thi... |
codereview_python_data_11841 | closed_orders = []
transactions = []
for sid, asset_orders in iteritems(self.open_orders):
- asset = self.asset_finder.retrieve_asset(sid)
- for order, txn in self.slippage_func(bar_data, asset, asset_orders):
direction = math.copysign(1, txn.amount)
... |
codereview_python_data_11844 | assert before_resp["result"][DATA] == after_resp["result"][DATA]
def test_reject_with_unacceptable_role_in_constraint(looper,
sdk_wallet_trustee,
sdk_pool_handle):
Why do we remove `CONSTRAINT` here?
... |
codereview_python_data_11849 | file_dict["path"] = path
mime = mimetypes.guess_type(file_dict["path"])[0] or "application/octet-stream"
- file_dict["mime-type"] = mime
self.content_encoding = self.config.get('content-encoding', None)
This changes the behavior. Original behavior was "set if not set", whi... |
codereview_python_data_11852 | numerical stability. Default 1e-7.
Returns:
- AssignResult: The assigned result.
"""
assert gt_bboxes_ignore is None, \
'Only case when gt_bboxes_ignore is None is supported.'
```python :obj:`AssignResult`: ```
numerical stability. D... |
codereview_python_data_11853 | # major version and the minor version in the prebuilt plugin is lower than the requested one.
self.can_install_prebuilt = not self.always_build and \
bool(self.tf_compiler) and \
- (StrictVersion(self.default_cpp_version) >= StrictVersion('5.0') and \
- StrictVers... |
codereview_python_data_11856 | for apkg, advisory, installed in apkg_adv_insts:
advisories.add(advisory2info(advisory, installed))
- for advisory in sorted(advisories, key=lambda x: x.lower()):
- print(advisory)
- print()
This will create an emty line at the end. What about: print("\n".join(sorted(... |
codereview_python_data_11867 | assert str(dt.min(f.A)) == str(f.A.min())
assert str(dt.min(f[:])) == str(f[:].min())
DT = dt.Frame(A=[2, 3, 5, 5, 9, -1, 2.2])
- assert_equals(DT[:, f.A.min()], DT[:, dt.min(f.A)])
\ No newline at end of file
Newline could be again useful here. Btw, normally there is a setting in the editor that cou... |
codereview_python_data_11869 | 'locale/*/LC_MESSAGES/electrum.mo',
]
},
- scripts=['electrum', 'privkey2electrum'],
data_files=data_files,
description="Lightweight Bitcoin Wallet",
author="Thomas Voegtlin",
Leave this out and move the script to the scripts folder.
'locale/*/LC_MESSAGES/elec... |
codereview_python_data_11873 | 'artist_name': data['a{}'.format(append_key)],
'track_name': data['t{}'.format(append_key)],
'release_name': data['b{}'.format(append_key)],
- 'additional_info': {
- 'source': data.get('o{}'.format(append_key), '')
- }
... |
codereview_python_data_11877 | r'.*libc\+\+\.so',
r'.*libc\+\+_shared\.so',
r'.*libstdc\+\+\.so',
- r'.*libc-\d+\.\d+(?:\.\d+)?\.so',
]
IGNORE_CRASH_TYPES_FOR_ABRT_BREAKPOINT_AND_ILLS = [
Isnt this too specific, how about just i think libc-.*\.so should be better?
r'.*libc\+\+\.so',
r'.*libc\+\+_shared\.so',
r'.*... |
codereview_python_data_11879 | <h1>Error 503 Backend is unhealthy</h1>
<p>Backend is unhealthy</p>
<h3>Guru Mediation:</h3>
- <p>Details: cache-sea4476-SEA 1645523397 1698945951</p>
<hr>
<p>Varnish cache server</p>
</body>
This is not a standard library, and should be move down below, and separated from the standard l... |
codereview_python_data_11888 | goal_state_fetched = True
except Exception as e:
msg = u"Exception retrieving the goal state: {0}".format(ustr(traceback.format_exc()))
- logger.warn(msg)
add_event(AGENT_NAME, op=WALAEventOperation.FetchGoalState, versio... |
codereview_python_data_11897 | self.selinux = None
self.disable_route_warning = False
self.jit_enabled = False
@staticmethod
def get_service_name():
It'll be better to defile service_name here, rather than defining in all the child classes. ```suggestion self.service_name = self.get_service_name() ```
... |
codereview_python_data_11899 | self.phases_enabled = False
while not await self.is_closeable():
await asyncio.sleep(10)
- await self.update_operation(services) # TODO: Call no longer needed if method continues to just have an agent update
await self._run_phases(services, p... |
codereview_python_data_11901 | headers = {'content-type': 'application/xhtml+xml'}
content_str = _list_dead_letter_source_queues(QUEUE_ATTRIBUTES, queue_url)
- new_response = Response()
- new_response.status_code = 200
- new_response.headers = headers
- new... |
codereview_python_data_11902 | """Make an educated guess as to whether it would be appropriate to print
the blob.
- The current rules are this will print if:
1. The output from Hypothesis appears to be unsuitable for use with
:func:`~hypothesis.example`.
Clarify that output is printed if both rules match: :func:`~hypothesi... |
codereview_python_data_11904 | min_y = np.maximum(0, min_y + offset)
max_y = np.minimum(h, max_y + offset)
- # clip box
- min_x = np.clip(min_x, 0, w)
- min_y = np.clip(min_y, 0, h)
- max_x = np.clip(max_x, 0, w)
- max_y = np.clip(max_y, 0, h)
# the... |
codereview_python_data_11909 | for r in Selection.unfold_entities(m, "R"):
self.assertEqual(str(r), "R")
if r in fm:
- print(fm[r])
if __name__ == '__main__':
runner = unittest.TextTestRunner(verbosity=2)
You still have a print statement here. Again, can you use something like ``self.assertEqu... |
codereview_python_data_11912 | filtermodel = sortfilter.CompletionFilterModel(model,
parent=completionview)
completionview.set_model(filtermodel)
- direction = 'prev' if count < 0 else 'next'
- for _ in range(abs(count)):
- completionview.completion_item_focus(direction)
... |
codereview_python_data_11913 | return execute_resource_action(resource_id, resources, stack_name, ACTION_DELETE)
-def update_dynamodb_index_resource(resource):
- if resource.get('Properties').get('BillingMode') == 'PAY_PER_REQUEST':
- for index_iterator in range(0, len(resource.get('Properties').get('GlobalSecondaryIndexes'))):
- ... |
codereview_python_data_11920 | url = config.get_edge_url()
headers = aws_stack.mock_aws_request_headers("cloudwatch")
- authorization = mock_aws_request_headers("monitoring")["Authorization"]
headers.update(
{
```suggestion authorization = aws_stack.mock_aws_request_headers("monitoring")["Authorization... |
codereview_python_data_11921 | expect=["Nym {} added".format(idr)])
-def test_send_same_nyms_fails_when_batched(
be, do, poolNodesStarted, newStewardCli):
be(newStewardCli)
Why the tests is called `fails`? It looks like the test checks a positive case.
expect=["Nym {} added".format(idr)])
+def test_send_same_nyms_only... |
codereview_python_data_11923 | from localstack.utils.aws import aws_stack
from localstack.utils.common import short_uid, to_str, save_file, TMP_FILES, mkdir
from localstack.utils.tagging import TaggingService
EVENTS_TMP_DIR = os.path.join(config.TMP_FOLDER, 'cw_events')
nit: we could put this on line 24, to reduce duplication a bit (with lines ... |
codereview_python_data_11935 | concat_data = obj.interface.concatenate([dense_data, obj], datatype=[dtype])
reindexed = concat_data.reindex([xdim, ydim], vdims)
if pd:
- df = reindexed.dframe(copy=False)
df = df.groupby([xdim, ydim], sort=False).first().reset_index()
agg = reindexed.clo... |
codereview_python_data_11936 | # Don't prefix with project name if it's the default project.
return binary
- seperator = '/' if project.startswith('/') else '_'
- project_prefix = project + seperator
if binary.startswith(project_prefix):
return binary
nit: correct spelling is "separator"
# Don't prefix with project name if... |
codereview_python_data_11939 | e_val, e_vec = np.linalg.eig(atomgroup.moment_of_inertia(pbc=pbc))
# Sort
- indices = np.argsort(e_val[::-1])
# Return transposed in more logical form. See Issue 33.
return e_vec[:, indices].T
Reverse the indices, not the e_val because according to the docs for `linalg.eig`, ... |
codereview_python_data_11940 | self.logger.info("Update extension [{0}]".format(update_cmd))
self.launch_command(update_cmd,
timeout=900,
- extension_error_code=1008,
env={'VERSION': version},
ha... |
codereview_python_data_11942 | return fastquery.FastQuery(self.connection)
def get_validators(self, height=None):
- result = list(backend.query.get_validator_set(self.connection, height))[0]
validators = result['validators']
for v in validators:
v.pop('address')
It is cumbersome to do `list(..)[0]... |
codereview_python_data_11943 | else:
scroll_pos = '{:2}%'.format(y)
- fields['scroll_pos'] = '{}'.format(scroll_pos)
fmt = config.get('tabs', 'title-format')
self.tabBar().setTabText(idx, fmt.format(**fields))
This should be `str(scroll_pos)` instead (they do the same, but it's more idiomatic)
... |
codereview_python_data_11944 | expected = assumed_iteration + (params_fit['early_stopping_rounds']
if eval_set_name != 'training'
and assumed_iteration != gbm.n_estimators else 0)
- assert expected == actual
- ... |
codereview_python_data_11957 | This matrix is symmetric with zeros on the diagonal.
.. versionchanged:: 1.0.0
- ``save()`` method has been removed. You can use ``np.save`` on
- :attr:`dist_matrix` instead.
"""
def __init__(self, u, select='all', metric=rmsd, cutoff=1E0-5,
``np.save`` --> ``np.save()`` for consist... |
codereview_python_data_11961 | traceback.print_exc()
async def generate_operation_report(self, op_id, save=False):
- operations = await self.get_service('data_svc').explode_operation(dict(id=op_id))
- operation = operations[0]
operation['result'] = []
for link in operation['chain']:
resu... |
codereview_python_data_11964 | more.
"""
class DFrame(PandasDFrame):
"""
I think it looks better if you add `pass` as well.
more.
"""
+ pass
+
class DFrame(PandasDFrame):
""" |
codereview_python_data_11965 | "Policy": data.get("Policy"),
"Region": region,
"Description": data.get("Description"),
- "Arn": "arn:aws:kms:%s:000000000000:key/%s" % (region, key_id),
"_key_": key,
}
region_details.key_pairs[key_id] = result
Let's better use the `kms_key_arn()` util function fro... |
codereview_python_data_11966 | # initialize, if not done yet
if not hasattr(plugin, "_initialized"):
- LOG.debug("Initializing Lambda executor plugin %s" % plugin.__class__)
plugin.initialize()
plugin._initialized = True
nit: better to use variadic arguments with loggers (re... |
codereview_python_data_11967 | started=worker.started,
state=worker.state,
first_task_display_name=self._first_task_display_name(worker),
- unread_messages=len(worker.rpc_messages),
**worker.info
) for worker in self._state.get_active_workers()]
... |
codereview_python_data_11970 | else:
index = index_len
index_len = len(index)
- index_chunksize = compute_chunksize((len(index), None), num_partitions, axis=0)
if index_chunksize > index_len:
row_lengths = [index_len] + [0 for _ in range(num_partitions - 1)]
else:
This feels a... |
codereview_python_data_11974 | assert r.request.url == pr.request.url
assert r.request.headers == pr.request.headers
def test_response_lines(self):
"""
- iter_lines should be able to handle data dribbling in which might
- not be lined up ideally.
"""
mock_chunks = [
'This \... |
codereview_python_data_11977 | output = self._RunArgparseFormatHelp(argument_parser)
- if tuple(sys.version_info[0:2]) < (3, 6):
- self.assertEqual(output, self._EXPECTED_OUTPUT)
else:
- self.assertEqual(output, self._EXPECTED_OUTPUT_PY3_6)
def testParseOptions(self):
"""Tests the ParseOptions function."""
Please move... |
codereview_python_data_11988 | class PassFailStatus(Reporter, Service, AggregatorListener, WidgetProvider):
def __init__(self):
super(PassFailStatus, self).__init__()
self.criteria = []
Why delete type hints? It helps IDE...
class PassFailStatus(Reporter, Service, AggregatorListener, WidgetProvider):
+ """
+ :type cr... |
codereview_python_data_11989 | from mmcv.runner import auto_fp16, force_fp32
from ..builder import build_loss
-from ..utils import up_sample_like
class BaseSemanticHead(nn.Module, metaclass=ABCMeta):
Need to deal with the semantic head in roi_heads.
from mmcv.runner import auto_fp16, force_fp32
from ..builder import build_loss
+from ..utils i... |
codereview_python_data_12000 | q.title = "Save file to:"
q.text = "Please enter a location for <b>{}</b>".format(
html.escape(url.toDisplayString()))
- q.yank_text = url.toString()
q.mode = usertypes.PromptMode.download
q.completed.connect(q.deleteLater)
q.default = _path_suggestion(suggested_filename)
This shou... |
codereview_python_data_12003 | @utils.benchmark('time', timeout=600)
@utils.parametrize('feat_size', [32, 128, 512])
-@utils.parametrize('num_relations', [3, 6, 12])
-@utils.thread_wrapped_func
-def track_time(feat_size, num_relations):
device = utils.get_bench_device()
dd = {}
candidate_edges = [dgl.data.CoraGraphDataset(verbose=Fa... |
codereview_python_data_12006 | print("Current version: %s. Latest released version: %s" % (
tools.__version__, last_release
))
start_time = time()
Why don't these checks run first? Won't this just tie up a container in Travis otherwise?
print("Current version: %s. Latest released version: %s" % (
tools.__versi... |
codereview_python_data_12007 | props = config.get('properties', {})
metrics = props.get('metrics', {})
is_devshell = metrics.get('environment') == 'devshell'
- is_service_account = 'iam.gserviceaccount.com' in authed_user
print('Read gcloud info: Success')
except ValueError as v... |
codereview_python_data_12015 | return self._get_option_section('ubsan')
def get_hwasan_options(self):
- """Return a list of UBSAN_OPTIONS overrides."""
return self._get_option_section('hwasan')
def get_grammar_options(self):
nit: typo in `UBSAN_OPTIONS`
return self._get_option_section('ubsan')
def get_hwasan_options(self... |
codereview_python_data_12016 | # name: possible binary names (linux/mac and windows)
"vlc": ["vlc", "vlc.exe"],
"mpv": ["mpv", "mpv.exe"],
- "pot": ["potplayer", "potplayermini64.exe", "potplayermini.exe"]
}
if is_win32:
is there even a `potplayer` binary? as this player is windows only.
# name: possible binary names (linu... |
codereview_python_data_12020 | fileName = normalizedWalletFileName(walletName)
walletFilePath = self.walletSaver.saveWallet(
wallet, getWalletFilePath(contextDir, fileName))
- self.logger.debug('Active wallet "{}" saved ({})'.
- format(walletName, walletFilePath))
... |
codereview_python_data_12023 | class TypeName(_TypeName):
name: str # name is used for types in named tuples
maintype: ObjectRef
- subtypes: typing.Union[typing.List[_TypeName], None]
- dimensions: typing.Union[typing.List[int], None]
class FuncParam(Base):
`typing.Union[typing.List[_TypeName], None]` -> `typing.Optional[typing.L... |
codereview_python_data_12025 | <h1>Error 503 Backend is unhealthy</h1>
<p>Backend is unhealthy</p>
<h3>Guru Mediation:</h3>
- <p>Details: cache-sea4441-SEA 1645544078 1005094299</p>
<hr>
<p>Varnish cache server</p>
</body>
can we keep this somewhere inside DGL?
<h1>Error 503 Backend is unhealthy</h1>
<p>Bac... |
codereview_python_data_12027 | self.comm = comm
self._force = False
self._updated = False # Whether the plot should be marked as updated
-
- # Setting up alias
- if 'title' in params and 'title_format' in params:
- if params['title'] != params['title_format']:
- self.warning('The tit... |
codereview_python_data_12040 | import argparse
import os
import os.path as osp
-import sys
from mmcv import Config
Maybe we should delete the imported module in `mmcv.Config`?
import argparse
import os
import os.path as osp
from mmcv import Config |
codereview_python_data_12041 | """
Checks iterator stop condition, gets DALI outputs and perform reset in case of StopIteration
"""
- if self._counter >= self._size and self._size > 0:
if self._auto_reset:
self.reset()
raise StopIteration
```suggestion if self._size > 0 an... |
codereview_python_data_12043 | # Utility functions
def setUp(self):
try:
- with self.assertRaisesRegex(AttributeError, r".+"):
- raise AttributeError('x')
except AttributeError:
self.assertRaisesRegex = self.assertRaisesRegexp
A cleaner solution is to just call `self.assertRaisesReg... |
codereview_python_data_12049 | from six.moves import range
import six
-import logging as log
import itertools
import os.path
import warnings
Is this used anywhere?
from six.moves import range
import six
import itertools
import os.path
import warnings |
codereview_python_data_12050 | import unittest
from os import path
from Bio import SeqIO
-from Bio.SeqFeature import FeatureLocation, AfterPosition, BeforePosition, \
- CompoundLocation, UnknownPosition
class TestReference(unittest.TestCase):
Could you use two import lines, rather than the slash continuation here.
import unittest
from os ... |
codereview_python_data_12052 | import tensorflow as tf
from tensorflow_addons.image import utils as img_utils
from tensorflow_addons.utils import keras_utils
-from tensorflow_addons.utils.types import TensorLike
-from typing import Optional
-def _pad(image: TensorLike, filter_shape: TensorLike, mode: str = "CONSTANT",
constant_values: T... |
codereview_python_data_12068 | @abstractmethod
def cancel(self, order_id, relay_status=True):
raise NotImplementedError('cancel')
@abstractmethod
Should we add a docstring to cancel?
@abstractmethod
def cancel(self, order_id, relay_status=True):
+ """Cancel a single order
+
+ Parameters
+ ----... |
codereview_python_data_12071 | gsuite_dwd_status = self._get_gsuite_dwd_status(summary_data)
- email_content = BaseEmailConnector.render_from_template(
'inventory_summary.jinja',
{'inventory_index_id': self.inventory_index_id,
'timestamp': timestamp,
Should not be leaking the base connector he... |
codereview_python_data_12072 | }
-def convert(in_file, in_format, out_file, out_format, mol_type=None):
"""Convert between two sequence file formats, return number of records.
Arguments:
perhaps we should call this argument `molecule_type` for consistency
}
+def convert(in_file, in_format, out_file, out_format, molecule_type=None):
... |
codereview_python_data_12073 | content = fds.read()
target_lines = [
- "for i in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]",
"self.vars['i'] = str(i)",
"self.loc_mng.get_locator([{'id': self.vars['i']"
I doubt explicit list is the best way to define values. Could we use range() here?
co... |
codereview_python_data_12074 | class ServerConnection(tcp.TCPClient, stateobject.StateObject):
def __init__(self, address, source_address=None):
- if source_address:
- source_address = (source_address, 0)
tcp.TCPClient.__init__(self, address, source_address)
self.via = None
This is a bit confusing (i.e. inc... |
codereview_python_data_12076 | # AppEngine
APPENGINE = 'appengine'
- # KEngine
- KENGINE = 'ke'
resource_types = frozenset([
ORGANIZATION,
This resource is really a cluster. It should be KE_CLUSTER
# AppEngine
APPENGINE = 'appengine'
+ # KE_CLUSTER
+ KE_CLUSTER = 'ke'
resource_types = frozenset([
... |
codereview_python_data_12078 | 'ssl_cert_reqs': ssl.CERT_REQUIRED,
'ssl_ca_certs': '/path/to/ca.crt',
'ssl_certfile': '/path/to/client.crt',
- 'ssl_keyfile': '/path/to/client.key'},
- redis_backend_use_ssl = ... |
codereview_python_data_12079 | from __future__ import absolute_import, division, print_function
from django import forms
from tests.django.toystore.models import (
CouldBeCharming,
This might be worth a helper class to inherit the rest from, e.g. ```python class ReprModelForm(forms.ModelForm): def __repr__(self): """I recommend putting this... |
codereview_python_data_12083 | Returns
-------
succ: iterator
- (node, successors) iterator where `successors` is the list of
- successors of `node`, `node` is a transitive successor of `source`
- and `successors` is non-empty.
Examples
--------
Would it be better to define transitive successor here? Also,... |
codereview_python_data_12085 | def warn(ledger_name, directories_path):
- print('The follow directories will be deleted:')
for path in directories_path:
print(str(path))
```suggestion print('The following directories will be deleted:') ```
def warn(ledger_name, directories_path):
+ print('The following directories will be del... |
codereview_python_data_12091 | 'properties': {
'name': context.properties['database-name'],
'project': context.env['project'],
- 'instance': '$(ref.{}.name)'.format(context.env['deployment'])
}
})
Don't we still want DM to wait to deploy this configuration until the instance is established?
'p... |
codereview_python_data_12092 | # Delete the reduction attribute to inform Keras that it
# should call this class by the __call__(...) method.
- if 'reduction' in dir(self):
delattr(self, 'reduction')
def __call__(self, y_true, y_pred, sample_weight=None):
`hasattr` seems more appropriate here?
# ... |
codereview_python_data_12093 | self.add_argument('--dataset', type=str, default='FB15k',
help='dataset name, under data_path')
self.add_argument('--format', type=str, default='built_in',
- choices=['built_in', 'raw_udd', 'udd'],
- help='the format of the d... |
codereview_python_data_12095 | def _test():
- """Run the Bio.Blast.Applications module's doctests.(PRIVATE)."""
-
import doctest
doctest.testmod(verbose=1)
You need a space not a full stop before the ``(PRIVATE)`` text. Also remove the extra blank link which will cause one of the style checks to fail.
def _test():
+ """Run the Bi... |
codereview_python_data_12098 | content_type = None
length = None
- if not data and json is not None:
content_type = 'application/json'
body = complexjson.dumps(json)
This should really be `if data is None`.
content_type = None
length = None
+ if data == {} and json is not ... |
codereview_python_data_12106 | gt_labels_list=None,
cls_out_channels=1,
sampling=True,
- need_unmap=True):
"""Compute regression and classification targets for anchors.
Args:
Rename `need_unmap` to `unmap`.
gt_labels_list=None,
... |
codereview_python_data_12108 | self.set_group(self.group)
if self.get_label() is None:
raise ValueError("Label should not be None.")
- if isinstance(self._predictor, _InnerPredictor) and self._predictor != self.reference._predictor:
sel... |
codereview_python_data_12109 | that they wish to delete their listens.
"""
if request.method == 'POST':
- if request.form.get('token') == current_user.auth_token:
try:
delete_listens_history(current_user.musicbrainz_id)
except Exception as e:
This message is shown to the user. Let's c... |
codereview_python_data_12124 | import datetime
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
Could you group the oscar imports? PEP8: ``` Imports should be grouped in the following order: standard library imports related third party imports local application/library... |
codereview_python_data_12131 | self.emit_event(
'position_update',
- formatted="Walking from {last_position} to {current_position}, distance left: ({distance} {distance_unit}) ..",
data={
- 'last_position': (last_lat, last_lng, 0),
- 'current_position': (lat, lng, 0),
... |
codereview_python_data_12132 | -from torch.optim import * # noqa: F401, F403
-
from .copy_of_sgd import CopyOfSGD
-from .registry import OPTIMIZERS, TORCH_OPTIMIZERS
-__all__ = ['OPTIMIZERS', 'CopyOfSGD', *TORCH_OPTIMIZERS]
It may not be necessary to expose `TORCH_OPTIMIZERS`.
+from .builder import build_optimizer
from .copy_of_sgd import CopyO... |
codereview_python_data_12137 | new_weight = match.new_weight
old_weight = old_match.new_weight
# Always update the weight if the previous value is the default. This is
# required to deal with specifications that are meant to set the weight above
# 1.0. Otherwise, prioritize only the most penalizing match for this pairing.
How does th... |
codereview_python_data_12139 | if bins or normalize:
raise NotImplementedError(
- "OmniSci' 'value_counts' does not support 'bins' and 'normalize' parameters"
)
new_frame = self._modin_frame.value_counts(
```suggestion "OmniSci' 'value_counts' does not support 'bins' and 'normalize' paramet... |
codereview_python_data_12140 | is visible and bar is a single non-computed property, which we know
will be stored as NULL in the database.
"""
- if (
ir_set.expr is None
and not ir_set.path_id.is_objtype_path()
and ir_set.rptr
Why not just `return` the condition?
is visible and bar is a single non-... |
codereview_python_data_12141 | elif isinstance(data, str): # TODO - What about unicode?
self._data = array.array("u", data)
elif isinstance(data, MutableSeq):
- self._data = array.array("u", data._data)
- else:
# Make no assumptions about the Seq subclass internal storage
se... |
codereview_python_data_12142 | end_level=-1,
add_extra_convs=False,
extra_convs_on_inputs=True,
conv_cfg=None,
normalize=None,
activation=None,
- relu_extra_convs=False,
caffe2_xavier_initialize=False):
... |
codereview_python_data_12144 | pipeline,
dynamic_scale=None,
skip_type_keys=None):
- warnings.warn('dynamic_scale is deprecated. will be removed '
- 'in future releases')
assert isinstance(pipeline, collections.abc.Sequence)
if skip_type_keys is not N... |
codereview_python_data_12151 | """
# TODO: Examine other versions of the file format and if this parser should
# support them.
- return '#Version: 1.5' in line
manager.ParsersManager.RegisterParser(WinFirewallParser)
Why change this?
"""
# TODO: Examine other versions of the file format and if this parser should
#... |
codereview_python_data_12152 | continue
# Sanitizer regular crash (includes ills, abrt, etc).
- if not is_golang:
update_state_on_match(
SAN_ADDR_REGEX,
line,
I don't think we should disable sanitizer stacks completely. what if we have a go crash without go stack and only asan stack (we want to create a a... |
codereview_python_data_12161 | detectedPPMCol = datamap[detectedNuc + ".P"] + 1
# Make a list of the data lines involving the detected
- if str(toResNum) in peaklist.residue_dict(detectedNuc) and str(
- originResNum
- ) in peaklist.residue_dict(detectedNuc):
detectedList = peaklist.residue_dict(detectedNuc)[str(toResN... |
codereview_python_data_12164 | # pass a Mock object as argument.
sig['immutable'] = True
sig = Signature.from_dict(sig)
- # Any child task might error so we need to ensure that they are all
- # capable of calling the linked error signature. This opens the
- # possibility that the task is ca... |
codereview_python_data_12168 | key_value['key'] for key_value in source.key_value_pairs]):
if self.CheckKeyCompatibility(key_path):
find_specs = self.BuildFindSpecsFromRegistryArtifact(key_path)
- self.find_specs_per_source_type[
- artifact_types.TYPE_INDICATOR_WINDOWS_REGISTRY... |
codereview_python_data_12176 | import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf1 # TODO: port TF1 test files?
-from tensorflow_addons.image import _get_boundary_locations
from tensorflow_addons.image import sparse_image_warp
-from tensorflow_addons.image import _get_grid_locations
from tensorflow.python.training imp... |
codereview_python_data_12177 | import sys
from botocore.exceptions import ClientError
sys.path.append('../../..')
from demo_tools.custom_waiter import CustomWaiter, WaitState
Just FYI, this is a little magic and may create some oddities if users copy code elsewhere. That may be acceptable for the example though.
import sys
from botocore.exce... |
codereview_python_data_12178 | for i, (X, y) in enumerate(eval_set):
# when individual eval set is equivalent to training data, skip recomputing parts.
- if id(X) == id(data) and id(y) == id(label):
for parts_idx in range(n_parts):
eval_sets[parts_idx].append('__train__')
I tota... |
codereview_python_data_12194 | """
with csv_writer.write_csv(resource_name, data) as csv_file:
try:
- try:
- snapshot_table_name = self._create_snapshot_table(
- resource_name, timestamp)
- except OperationalError as e:
- # TODO:... |
codereview_python_data_12195 | -def spiral(n):
pass
Could you please change `n` to something more meaningful like `matrix_size`?
+def spiral(size):
pass |
codereview_python_data_12214 | self.bulk_size = self.settings.get("bulk-size", self.bulk_size)
self.browser_open = self.settings.get("browser-open", self.browser_open)
token = self.settings.get("token", "")
- proxy_settings = self.settings.get("proxy", None)
if proxy_settings:
if proxy_settings... |
codereview_python_data_12217 | assert N == 2
assert_almost_equal(cutoff, 10.5, decimal=4)
-def test_pdc_on_off(universe, lipid_heads):
lfls_pbc_on = LeafletFinder(universe, lipid_heads, pbc=True)
lfls_pbc_off = LeafletFinder(universe, lipid_heads, pbc=False)
assert lfls_pbc_on.graph.size() > lfls_pbc_off.graph.size()
Could ... |
codereview_python_data_12220 | machine_id = 0
lines = [line.rstrip('\n') for line in open(filename)]
for line in lines:
- result = line.split(' ')
if len(result) == 2:
port = int(result[1])
elif len(result) == 1:
it'll break if there are multiple spaces.
mach... |
codereview_python_data_12226 | for i, a in enumerate(FastaM10Iterator(open(os.path.join(path, filename)))):
print("#%i, %s" % (i + 1, a))
for r in a:
self.assertEqual(r.seq.alphabet.gap_char, "-")
else:
assert not... |
codereview_python_data_12228 | args.attn_drop,
args.residual)
- model.initialize()
-
- if cuda:
- model.collect_params().reset_ctx(ctx)
# use optimizer
trainer = gluon.Trainer(model.collect_params(), 'adam', {'learning_rate': args.lr})
Move evaluation code into a separate function so that it ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.