language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | media_id = player_info.get('mediaId')
if not media_id:
clip_id = player_info['clipId']
feed = self._download_json(
f'http://tpfeed.cbc.ca/f/ExhSPC/vms_5akSXx4Ng_Zn?byCustomValue={{:mpsReleases}}{{{clip_id}}}',
clip_id, fatal=False)
if feed:
... | Review this code and list any quality issues. | [
{
"issue": "Can we can still get entries via the old code? If so, this should be non-fatal",
"severity": "minor",
"line": 26
}
] | 1 |
python | def get_exe_version(exe, args=['--version'],
version_re=None, unrecognized='present'):
""" Returns the version of the specified executable,
or False if the executable is not present """
out = _get_exe_version_output(exe, args)
return detect_exe_version(out, version_re, unrecognized) ... | Review this code and list any quality issues. | [] | 0 |
python | def extract_site_specific_field(field):
# A number of sites have custom-prefixed keys, e.g. 'cbc$seasonNumber'
return next((info[k] for k in info if k.endswith(f'${field}') and info[k] != ''), None)
info_media_type = extract_site_specific_field('programmingType')
if not info_med... | Review this code and list any quality issues. | [
{
"issue": "Can be inlined\r\n```suggestion\r\n 'media_type': extract_site_specific_field('programmingType') or extract_site_specific_field('type'),\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | from luigi.scheduler import DISABLED, DONE, FAILED, PENDING, \
UNKNOWN, RUNNING, BATCH_RUNNING, UPSTREAM_RUNNING, Scheduler
luigi.notifications.DEBUG = True
WORKER = 'myworker'
@attr('scheduler')
class SchedulerApiTest(unittest.TestCase):
def setUp(self):
super(SchedulerApiTest, self).setUp()
... | Review this code and list any quality issues. | [
{
"issue": "Good start. This is fine as other tests didn't assume this.",
"severity": "minor",
"line": 26
}
] | 1 |
python | {"a": list("lmnopqr"), "b": [7, 6, 5, 4, 3, 2, 1]}, index=list("lmnopqr")
)
pdf5r = pd.DataFrame({"c": list("abcd"), "d": [5, 4, 3, 2]}, index=list("abcd"))
pdf6l = pd.DataFrame(
{"a": list("cdefghi"), "b": [7, 6, 5, 4, 3, 2, 1]}, index=list("cdefghi")
)
pdf6r = pd.DataFrame({"c": list("aba... | Review this code and list any quality issues. | [] | 0 |
python | })
for resp in traverse_obj(initial_data, ('data', lambda _, v: v.get('name'))):
name = resp['name']
for resp in (initial_data.get('data') or {}).values():
name = resp.get('name')
if name == 'media-experience':
parse_media(try_... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n next_data = traverse_obj(self._search_nextjs_data(webpage, playlist_id, default={}),\r\n ('props', 'pageProps', 'page'))\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | async def wait_for_block():
new_waitoptions = self.capnp_modules['mining'].BlockWaitOptions()
new_waitoptions.timeout = timeout * 60 # 1 minute wait
new_waitoptions.feeThreshold = 1
template7 = await mining_wait_next_template(template6, sta... | Review this code and list any quality issues. | [
{
"issue": "In abd9a2fe1002995a410d884025b8b2479bc9f194 _ipc mining: provide default option values (incompatible schema change)_: review note: changing this from 0 to the new default 400 is harmless. Ditto for `blockReservedWeight`.\n\nUsing defaults also improves test readability. When custom value shows up, i... | 1 |
python | from multiprocessing.pool import Pool
from synthesizer import audio
from functools import partial
from itertools import chain
from encoder import inference as encoder
from pathlib import Path
from utils import logmmse
from tqdm import tqdm
import numpy as np
import librosa
def preprocess_dataset(datasets_root: Path,... | Review this code and list any quality issues. | [
{
"issue": "Why not\r\n```suggestion\r\n input_dirs = [dataset_root.joinpath(subfolder.strip()) for subfolder in subfolders.split(\",\")]\r\n```",
"severity": "minor",
"line": 19
}
] | 1 |
python | bounds = bounds[:-1]
if getattr(dist, 'pdf', False):
data = dist.rvs(*ref, size=N, random_state=rng)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", "overflow encountered", RuntimeWarning)
res = stats.fit(dist, data, bounds, method=method,
... | Review this code and list any quality issues. | [] | 0 |
python | 'thumbnail': r're:^https?://.+\.jpg',
'comment_count': int,
'duration': 18014,
'play_count': int,
'view_count': int,
'timestamp': 1611694774,
'like_count': int,
'uploader': 'Fernanda Rivas🎶',
'uploader_id': 'fernanda_rivasg... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n self._search_regex(r'window\\.data\\s=\\s({.+?});', webpage, 'video info'),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | import time
from pathlib import Path
CONTAINER_NAME = "bitcoin-linter"
def run(cmd, **kwargs):
print("+ " + shlex.join(cmd), flush=True)
kwargs.setdefault("check", True)
try:
return subprocess.run(cmd, **kwargs)
except Exception as e:
sys.exit(str(e))
def get_worktree_mounts(repo_ro... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n f\"--volume={gitdir}:{gitdir}\",\n```\n\notherwise:\n\n```\nfatal: Unable to create '/btc/bitcoin/.git/worktrees/34391/index.lock': Read-only file system \n```\n\nalternatively, could get rid `gitdir` and just mount `main_gitdir` (without `ro` ):\n\n```diff\ndiff --git a/ci/li... | 1 |
python | class CoinbaseTxData:
version: int
sequence: int
scriptSigPrefix: bytes
witness: Optional[bytes]
blockRewardRemaining: int
requiredOutputs: list[bytes]
lockTime: int
# Test may be skipped and not have capnp installed
try:
import capnp # type: ignore[import] # noqa: F401
except ImportEr... | Review this code and list any quality issues. | [
{
"issue": "In \"test: have {create_block,wait_next}_template return None\" 8bf30b371379532a4d2c8e7414a1595a89002c71\r\n\r\nIs there a realistic scenario where the template returned by create_block_template is None?",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import clean_html
from ..utils.traversal import (
find_element,
find_elements,
traverse_obj,
)
class FilmArchivIE(InfoExtractor):
IE_NAME = 'FILMARCHIV ON'
_VALID_URL = r'https?://(?:www\.)?filmarchiv\.at/de/filmarchiv-on/video/(?P<id>[0-9a-zA-Z_]+)'
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'thumbnail': r're:https://cdn\\.filmarchiv\\.at/f_0305/p7xKrXUPBwoNE9x6mh_v1/poster\\.jpg',\r\n```",
"severity": "minor",
"line": 21
}
] | 1 |
python | )
self._move_into_position(width, height)
def _ensure_valid_file(self):
"""Reads self.file_name and determines whether the given input file_name
is valid.
"""
if self.file_name is None:
raise Exception("Must specify file for SVGMobject")
if self.file_nam... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n config.get_dir(\"assets_dir\") / self.file_name,\r\n config.get_dir(\"assets_dir\") / (str(self.file_name) + \".svg\"),\r\n config.get_dir(\"assets_dir\") / (str(self.file_name) + \".xdv\"),\r\n self.file_path,\r\n Path(str(sel... | 1 |
python | an = (cn + 0.221157*u - 0.147981*u**2
- 2.071190*u**3 + 4.434685*u**4 - 2.706056*u**5)
anm1 = (cnm1 + 0.042981*u - 0.293762*u**2
- 1.752461*u**3 + 5.682633*u**4 - 3.582633*u**5)
phi = ((mTm - 2*mn**2) / (1 - 2*an**2) if n <= 5
else (mTm - 2*mn**2 - 2*mnm1**2) / (1 - 2*an**2 - 2*... | Review this code and list any quality issues. | [
{
"issue": "<img width=\"796\" height=\"130\" alt=\"image\" src=\"https://github.com/user-attachments/assets/cc16ac6e-b6f3-404b-8103-5db90128c1ec\" />",
"severity": "minor",
"line": 26
}
] | 1 |
python | # does not change. Day 3, we start getting returns
expected_daily['returns'] = np.array([
0.0,
0.0,
# 1000 shares * gain of 1
(100000.0 + 1000.0)/100000.0 - 1.0,
# 2000 shares * gain of 1, capital change of +5000
(151000.0 + 2000.0)/151000.... | Review this code and list any quality issues. | [] | 0 |
python | out(error_msg if report.return_code else "All done! ✨ 🍰 ✨")
if code is None:
click.echo(str(report), err=True)
ctx.exit(report.return_code)
def get_sources(
*,
ctx: click.Context,
src: Tuple[str, ...],
quiet: bool,
verbose: bool,
include: Pattern[str],
exclude: Opt... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n using_default_exclude = exclude is None\r\n exclude = re_compile_maybe_verbose(DEFAULT_EXCLUDES) if exclude is None else exclude\r\n gitignore: Optional[PathSpec] = None\r\n root_gitignore = get_gitignore(root)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | defs.OpSchema.FormalParameter(
"out", "float", param_option=OpSchema.FormalParameterOption.Variadic
),
],
attributes=[
defs.OpSchema.Attribute("out_len", defs.OpSchema.AttrType.INTS)
],
)
def func(ctx: onnx.shape_in... | Review this code and list any quality issues. | [
{
"issue": "you should use self.assertEqual, when it fails, the displayed messages tells why.",
"severity": "critical",
"line": 26
}
] | 1 |
python | from ..utils import (
int_or_none,
traverse_obj,
url_or_none,
)
class StacommuBaseIE(WrestleUniverseBaseIE):
_NETRC_MACHINE = 'stacommu'
_API_HOST = 'api.stacommu.jp'
_LOGIN_QUERY = {'key': 'AIzaSyCR9czxhH2eWuijEhTNWBZ5MCcOYEUTAhg'}
_LOGIN_HEADERS = {
'Accept': '*/*',
'Cont... | Review this code and list any quality issues. | [
{
"issue": "When a login is required, we need to let the users know that `--username`/`--password`/`--netrc` is needed and cookies won't work. This is admittedly a bit cringe, but `method='password'` doesn't belong anywhere in the wrestleuniverse baseclass, so I think it's what we need to do\r\n```suggestion\r\... | 1 |
python | 'id': 'ochenlichnoe',
'title': 'Очень личное',
'description': 'md5:ee36a6a52546b91b487fe08c552fdbb2',
},
'playlist_mincount': 20,
}, {
'url': 'https://geekcity.mave.digital/',
'info_dict': {
'id': 'geekcity',
'title': 'Мужчины в трико',... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n yield self._create_entry(channel_id, channel_meta, ep)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | self._download_json(api, video_id=song_id, note='Dummy request to update cookie')
info = self._download_json(api, video_id=song_id)
return self._process_data(info.get('data'), song_id, type_url)
def get_api_with_signature(self, name_api, param):
sha256 = self.sha256_params(''.join(f'{k}={v... | Review this code and list any quality issues. | [
{
"issue": "Why change existing tests? The old URL still works in browser",
"severity": "minor",
"line": 26
}
] | 1 |
python | from metagpt.actions.action import Action
from metagpt.config2 import Config
from metagpt.const import TEST_DATA_PATH
from metagpt.context import Context
from metagpt.provider.llm_provider_registry import create_llm_instance
from metagpt.roles.role import Role
def test_set_llm():
config1 = Config.default()
co... | Review this code and list any quality issues. | [] | 0 |
python | from .common import InfoExtractor
from ..utils import (
get_element_by_id,
js_to_json,
traverse_obj,
ExtractorError,
)
import base64
class IxiguaIE(InfoExtractor):
_VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+'
_TEST = {
'url': 'https://www.ixigua.com/699688... | Review this code and list any quality issues. | [
{
"issue": "this is incorrect.\r\nset it manually below",
"severity": "critical",
"line": 17
}
] | 1 |
python | # Copyright 2021-2024 Avaiga Private Limited
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n<|menu|lov={options}|not active|>\r\n```",
"severity": "minor",
"line": 22
}
] | 1 |
python | if reverse:
cmd = ["hdc", "rport", f"tcp:{port}", f"tcp:{port}"]
else:
cmd = ["hdc", "fport", f"tcp:{port}", f"tcp:{port}"]
print(f"Setting up HDC port forwarding: {' '.join(cmd)}")
result = subprocess.run(cmd, capture_output=True, text=True, timeout=10)
if result.stdout.startswith("[Fai... | Review this code and list any quality issues. | [
{
"issue": "How about moving this check into the port forward function?",
"severity": "minor",
"line": 26
}
] | 1 |
python | dtype=pl.Duration("ns"),
),
"categorical": pl.Series(
["apple", "banana", "apple"], dtype=pl.Categorical
),
"list_duration": [
[timedelta(days=1), timedelta(hours=2)],
[timedelta(minutes=30)],
None,
... | Review this code and list any quality issues. | [
{
"issue": "One more thing we can do here - could we also add a test the `DataFrame` pycapsule roundtrip here - i.e. `pl.DataFrame(PyCapsuleStreamWrap(df))`",
"severity": "minor",
"line": 26
}
] | 1 |
python | ("datatable(x:int) [1, 2, 3] | take 100", 100),
(
"""
Table1 | where msg contains 'abc;xyz'
| limit 5
""",
5,
),
("table | take five", None),
],
)
def test_get_kql_limit_value(kql: str, expected: str) -> None:
assert KustoKQLStatement(kql, "kust... | Review this code and list any quality issues. | [] | 0 |
python | }, {
# adult content
'url': 'https://vod.sooplive.co.kr/player/70395877',
'only_matching': True,
}, {
# subscribers only
'url': 'https://vod.sooplive.co.kr/player/104647403',
'only_matching': True,
}, {
# private
'url': 'https://vod.sooplive.co.kr/... | Review this code and list any quality issues. | [
{
"issue": "Let's require `strm_id` if `needs_private_auth`\r\n\r\n(import `require` from `..utils.traversal`)\r\n```suggestion\r\n strm_id = None\r\n # For subscriber-only VODs, we need to call private_auth.php to get CloudFront cookies\r\n needs_private_auth = traverse_obj(data, ('sub_upl... | 1 |
python | def extract_all_features_rec(self, statement) -> Set[Feature]:
"""
recursively extracts all feature statements from a given rule statement.
returns:
set: A set of all feature statements contained within the given feature statement.
"""
feature_set: Set[Feature] = set... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n def _extract_all_features_rec(self, statement) -> Set[Feature]:\r\n feature_set: Set[Feature] = set()\r\n\r\n for child in statement.get_children():\r\n if isinstance(child, Statement):\r\n feature_set.update(self._extract_all_features_rec... | 1 |
python | 'age_limit': 18,
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
data = self._download_json(f'https://odkmedia.io/odx/api/v3/playback/{video_id}/', video_id,
fatal=False, headers={'service-name': 'odk'},
... | Review this code and list any quality issues. | [
{
"issue": "If you want to keep the 3.8+ syntax, then this PR can't be merged until after we remove support for 3.7, and I will come back to review this part afterwards",
"severity": "minor",
"line": 26
}
] | 1 |
python | flush=True,
)
def _dict_append(in_dict, key, fn):
try:
in_dict[key] = fn() if callable(fn) else fn
except BaseException:
in_dict[key] = "UNKNOWN for given OS"
def get_system_info() -> OrderedDict:
"""
Get system info as an ordered dictionary.
"""
output: OrderedDict = Ord... | Review this code and list any quality issues. | [] | 0 |
python | # Whether to discard partial chunks
self._discard_partial_chunks = (
vllm_config.kv_transfer_config.get_from_extra_config(
"discard_partial_chunks", False
)
or not config.save_unfull_chunk
)
self._lmcache_chunk_size = config.chunk_size
... | Review this code and list any quality issues. | [
{
"issue": "nice, now we can also debug the scheduler independently",
"severity": "critical",
"line": 26
}
] | 1 |
python | def listify(obj):
"""Converts obj to a list intelligently.
Examples
--------
.. code-block:: pycon
>>> listify("str")
['str']
>>> listify((1, 2))
[1, 2]
>>> listify(len)
[<built-in function len>]
"""
if isinstance(obj, str):
return [obj]
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n) -> tuple[list[T], list[U]]:\r\n```\r\nAccording to the implementation. Am I right?",
"severity": "minor",
"line": 26
}
] | 1 |
python | text += data
yield {"text": text, "error_code": 0}
def cohere_api_stream_iter(
client_name: str,
model_id: str,
messages: list,
temperature: Optional[
float
] = None, # The SDK or API handles None for all parameters following
top_p: Optional[float] = None,
max_new_toke... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n```\r\n\r\ncohere>=5.0.1 should pick up CO_API_KEY correctly but will fix the issue with accepting None!",
"severity": "minor",
"line": 26
}
] | 1 |
python | self._LOGOUT_DEVICES_API = f'{self._HOMEPAGE}/logout_devices/?next=/'
self._CONTENT_API = f'{self._HOMEPAGE}/api/v2.4/contents/{{content_id}}/'
self._HLS_AES_URI = f'{self._HOMEPAGE}/api/v2.5/video_contents/{{content_id}}/key/'
def _get_logged_in_username(self, webpage):
if self._LOGIN_API ... | Review this code and list any quality issues. | [
{
"issue": "Can be simplified; `fatal=False` is redundant if there is a `default`, and `name` arg doesn't matter if it will never throw/warn\r\n```suggestion\r\n r'(Your username / email and password)', logged_page, 'auth fail', default=None):\r\n```",
"severity": "critical",
"line": 26
}
] | 1 |
python | # Give the script some time to start running
await asyncio.sleep(0.01)
# Send another packet that will be received while the script is running
writer.write(PACKET2.encode())
# The last batch has to be big enough, so the script will finish before it is fully consumed
writer.write(PACKET3.encode())
... | Review this code and list any quality issues. | [] | 0 |
python | return get_requirement("placeholder" + extras.lower()).extras
def _set_requirement_extras(req: Requirement, new_extras: Set[str]) -> Requirement:
"""
Returns a new requirement based on the given one, with the supplied extras. If the
given requirement already has extras those are replaced (or dropped if no... | Review this code and list any quality issues. | [
{
"issue": "Is this the only way to write this under the upgrade rules, is there not some one-liner that's acceptable? e.g.\r\n\r\n```python\r\nextras = f\"[{','.join(sorted(new_extras))}]\" if new_extras else \"\"\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | import gc
from django.db.models.base import ModelState, ModelStateFieldsCacheDescriptor
from django.test import SimpleTestCase
from .models import CycleChild, CycleParent
class ModelStateTests(SimpleTestCase):
def test_fields_cache_descriptor(self):
self.assertIsInstance(ModelState.fields_cache, ModelSt... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n```\nThanks for the method name change. Now we can lose the docstring (we avoid \"Ensure ...\" preambles anyway.)",
"severity": "minor",
"line": 17
}
] | 1 |
python | # home/tests.py
from django.test import TestCase
from wagtail.models import Page
from home.models import HomePage
class HomeSetUpTests(TestCase):
"""
Tests steps needed by follow up tests
"""
def test_root_create(self):
Page.objects.get(pk=1)
def test_homepage_create(self):
root... | Review this code and list any quality issues. | [
{
"issue": "What is this actually testing?\r\n\r\nDo we need some assertions here?\r\n\r\nSame for the test above.",
"severity": "minor",
"line": 19
}
] | 1 |
python | # %%
# API changes in logistic regression
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# After the deprecation (version 1.5) and removal (now in 1.8) of the `multi_class`
# parameter in `LogisticRegression` and `LogisticRegressionCV`, the bookkeeping goes
# on. The goal for `LogisticRegressionCV` is to fix types and shapes of ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n# A further deprecation is related to the `penalty` parameter in both\n```\nBetter, maybe?",
"severity": "minor",
"line": 26
}
] | 1 |
python | @register.simple_tag()
def workflow_status_with_date(workflow_state):
translation_context = {
"finished_at": naturaltime(workflow_state.current_task_state.finished_at),
"started_at": naturaltime(workflow_state.current_task_state.started_at),
"task_name": workflow_state.current_task_state.tas... | Review this code and list any quality issues. | [
{
"issue": "Sorry for the back and forth on structure here but a few changes I will do when merging but wanted to explain.\r\n\r\n1. Let's use tuples for the shortcuts -> `{\"label\": _(\"Copy\"), \"shortcut\": f\"{modifier} + c\"}` would be `(_(\"Copy\"), f\"{modifier} + c\")`. This is a bit easier to read wh... | 1 |
python | 'chrome131': ImpersonateTarget('chrome', '131', 'macos', '14'),
'chrome131_android': ImpersonateTarget('chrome', '131', 'android', '14'),
'chrome133a': ImpersonateTarget('chrome', '133', 'macos', '15'),
'firefox133': ImpersonateTarget('firefox', '133', 'macos', '14'),
'safari18_0': Imper... | Review this code and list any quality issues. | [
{
"issue": "this seems to fix the problem I mentioned above\r\n```suggestion\r\n target: name if curl_cffi_version >= (0, 9) else curl_cffi.requests.BrowserType[name]\r\n for name, target in dict(sorted(itertools.chain.from_iterable(\r\n targets.items()\r\n for version, targe... | 1 |
python | call_user_app_builder_with_args_if_necessary(return_unbound_deployment, {})
def test_basic_no_args(self):
def build_function(args):
return self.A.bind()
assert isinstance(
call_user_app_builder_with_args_if_necessary(build_function, {}),
Application,
)
... | Review this code and list any quality issues. | [] | 0 |
python | import argparse
import logging
import time
import asyncio
import openai
import json
import io
import traceback
from typing import List
from utils import (load_workload, wrap_prompt_as_chat_message)
logging.basicConfig(level=logging.INFO)
async def send_request_streaming(client: openai.AsyncOpenAI,
... | Review this code and list any quality issues. | [
{
"issue": "is multi-threading necessary for this client?",
"severity": "minor",
"line": 21
}
] | 1 |
python | from typing import List, TypeVar, Optional, Tuple
from contextlib import ExitStack as DoesNotRaise
import pytest
import numpy as np
from supervision.classification.core import Classifications
T = TypeVar("T")
@pytest.mark.parametrize(
'class_id, confidence, expected_result, exception',
[
(
... | Review this code and list any quality issues. | [
{
"issue": "I think we need to test with different `k` values. Do not assume that it is always `len(class_id)`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | f"{some_function_call(j.right)})"
),
}
# Complex string concatenations with a method call in the middle.
code = (
(" return [\n")
+ (
", \n".join(
" (%r, self.%s, visitor.%s)"
% (attrname, attrname, visit_name)
for attrname, visit_name in names
... | Review this code and list any quality issues. | [
{
"issue": "Let's keep these but adjust the output formatting. That way, we at least keep testing that these don't crash.",
"severity": "critical",
"line": 26
}
] | 1 |
python | # A Context Menu is an app command that can be run on a member or on a message by rightclicking.
# It always takes an interaction as its first parameter and a Member, Message or Union of both as its second parameter.
# This context menu only works for members
@client.tree.context_menu(name='Joindate')
async def show_j... | Review this code and list any quality issues. | [
{
"issue": "Not that I think this example should be used as-is but maybe it'd be \"cooler\" to also make an embed with the message information. Something like this:\r\n\r\n```py\r\nembed = discord.Embed(title='Reported Message')\r\nif message.content:\r\n embed.description = message.content\r\n\r\nembed.set_... | 1 |
python | track_info = tralbum.get('trackinfo')
if not track_info:
raise ExtractorError('The page doesn\'t contain any tracks')
# Only tracks with duration info have songs
entries = [
self.url_result(
urljoin(url, t['title_link']), BandcampIE.ie_key(),
... | Review this code and list any quality issues. | [
{
"issue": "Sorry, I had a missing `=`: what I meant was `r'https?://(?:www\\.)?bandcamp\\.com(?:/radio)?/?\\?.*?(?<=[?&])show=(?P<id>\\d+)'`:\r\n* `https?://(?:www\\.)?bandcamp\\.com(?:/radio)?/?\\?` to match the scheme://domain possibly followed by `/radio` and then possibly by `/`, before `?` that introduces... | 1 |
python | _, playlist_json = self._call_api(
input_data, query={'page': page_num + 1}, season=season_id, custom_id=custom_id,
force_endpoint_type=force_endpoint_type, input_type=input_type)
for slug in traverse_obj(playlist_json, ('response', ..., 'data', ..., 'slug')):
yield self.url_... | Review this code and list any quality issues. | [
{
"issue": "What's the point of pagedlist if you are yielding from it??",
"severity": "minor",
"line": 26
}
] | 1 |
python | def append_vectorized_mobject(self, vectorized_mobject: VMobject) -> None:
if self.has_new_path_started():
# Remove last point, which is starting
# a new path
self.points = self.points[:-1]
self.append_points(vectorized_mobject.points)
def apply_function(
... | Review this code and list any quality issues. | [
{
"issue": "This one would probably also be autofixed:\r\n```suggestion\r\n axis: Vector3DLike = OUT,\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'live_status': 'was_live',
'thumbnail': r're:^https?://[\w.-]+/\w+/\w+',
},
'params': {
'skip_download': True,
'ignore_no_formats_error': True,
},
}, {
'url': 'https://asobistage.asobistore.jp/event/ijigenfes_utagassen/player/day1',
'only_m... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n raise ExtractorError(f'Unknown error: {error!r}')\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | container_id = context.get('userContextId')
break
elif context.get('l10nID'):
if re.match(r'userContext([^\.]+)\.label', context.get('l10nID')).group() == container:
container_id = context.get('userContextId')
break
if container... | Review this code and list any quality issues. | [
{
"issue": "In this case, load only cookies from \"no container\"",
"severity": "minor",
"line": 26
}
] | 1 |
python | def __repr__(self) -> str:
return (
f"InputMetaData(block_tables={self.block_tables}, "
f"sequence_lengths={self.sequence_lengths}, "
f"fd_inter_tensor={self.fd_inter_tensor}, "
f"batch_size={self.batch_size}, "
f"is_prompts={self.is_prompts}, "
... | Review this code and list any quality issues. | [
{
"issue": "Maybe you wanna revise the type hinting by referencing to `dtype`",
"severity": "minor",
"line": 26
}
] | 1 |
python | traceback_clear()
if sys.version_info >= (3, 5, 0):
tb_ = exc.__traceback__
while tb_ is not None:
if str(tb_.tb_frame.__repr__) == frame_list[0]:
assert len(tb_.tb_frame.f_locals) == 0
tb_ = tb_.tb_next
... | Review this code and list any quality issues. | [] | 0 |
python | def test_issue_26513():
assert limit(abs((-x/(x+1))**x), x ,oo) == exp(-1)
assert limit((x/(x + 1))**x, x, oo) == exp(-1)
raises (NotImplementedError, lambda: limit((-x/(x+1))**x, x, oo))
def test_issue_26916():
assert limit(Ei(x)*exp(-x), x, +oo) == 0
assert limit(Ei(x)*exp(-x), x, -oo) == 0
de... | Review this code and list any quality issues. | [
{
"issue": "There should be two blank lines between the top-level test functions.",
"severity": "minor",
"line": 26
}
] | 1 |
python | scene.step()
# Check that the sphere did not move, and the slightly squished
state = sphere.get_state()
center = state.pos.mean(axis=(0, 1))
assert_allclose(center[:2], 0.0, tol=0.01)
assert center[2] < SPHERE_RADIUS - 0.02
# Check that the ant is laying on top of the sphere
robot_pos = ro... | Review this code and list any quality issues. | [
{
"issue": "If it is only used once, inline the value on the assert itself. This will improve readability.",
"severity": "minor",
"line": 26
}
] | 1 |
python | log = f.readlines()
error_pos = [
index for index, line in enumerate(log) if line.startswith("!")
]
if error_pos:
with open(tex_file, "r") as g:
tex = g.readlines()
logger.error("LaTeX... | Review this code and list any quality issues. | [
{
"issue": "Was this meant to be an f-string? Currently it just prints `LaTeX compilation error: {log[error_pos][2:])}`. Seems to have an extra parenthesis as well. Also, making this an f-string causes an error since `error_pos` is a list of integers. @clarfonthey could you please explain what was the rationale... | 1 |
python | self.client_id = user_input[CONF_CLIENT_ID]
self.client_secret = user_input[CONF_CLIENT_SECRET]
self.access_token = user_input[CONF_ACCESS_TOKEN]
instance, account, errors = await self.hass.async_add_executor_job(
self.check_connection
)
if not... | Review this code and list any quality issues. | [
{
"issue": "`description_placeholders` includes `example_url`, but the `config.step.reconfigure.description` string does not reference `{example_url}`. Consider removing the unused placeholder (or update the translation string to use it) to avoid confusion and keep placeholders in sync with translations.",
... | 1 |
python | return self
def suspend_updating(self, recurse=True):
self.updating_suspended = True
if recurse:
for submob in self.submobjects:
submob.suspend_updating(recurse)
return self
def resume_updating(self, recurse=True, call_updater=True):
self.updating_su... | Review this code and list any quality issues. | [] | 0 |
python | 'getcomments': True,
'skip_download': True,
'ignore_no_formats_error': True,
},
},
{
'url': 'https://player.pia-live.jp/stream/4JagFBEIM14s_hK9aXHKf3k3F3bY5eoHFQxu68TC6krJdu0GVBVbVy01IwpJ6J3qBEm3d9TCTt1d0eWpsZGj7DrOjVOmS7GAWGwyscMgiThopJvzgWC4H5b-7... | Review this code and list any quality issues. | [
{
"issue": "We want this to be fatal, no?\r\n```suggestion\r\n html, f'variable {variable}', group='value')\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | line_kwargs={"color": "tab:red"},
)
ax.set_title(f"{name}\nEvaluation in {elapsed_time:.2f} seconds")
for name, score in scores.items():
ax.plot([], [], " ", label=f"{name}: {score}")
ax.legend(loc="upper left")
plt.suptitle("Prediction errors of base versus stacked predictors", y=1)
plt.tight... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n# We see that in this case, the HGBT model dominates, with the spline\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def json2srt(self, json_data):
srt_data = ''
for idx, line in enumerate(json_data.get('body') or []):
srt_data += (f'{idx + 1}\n'
f'{srt_subtitles_timecode(line["from"])} --> {srt_subtitles_timecode(line["to"])}\n'
f'{line["content"]}\n\n')
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n for s in traverse_obj(video_info, (\r\n 'data', 'subtitle', 'subtitles', lambda _, v: v['subtitle_url'] and v['lan'])):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | if self.model is not None:
_logger.warning('Already bound a model, will unbind it before bind a new model.')
self.unbind_model()
self.model = model
self._ori_model_attr.update({
'training_step': model.training_step,
'configure_optimizers': model.configure... | Review this code and list any quality issues. | [
{
"issue": "why `module_name_param_dict` can be None?",
"severity": "minor",
"line": 26
}
] | 1 |
python | })
def _get_comments_reply(self, root_id, next_id=0, display_id=None):
comment_api_raw_data = self._download_json(
'https://api.bilibili.tv/reply/web/detail', display_id,
note=f'Downloading reply comment of {root_id}',
query={
'platform': 'web',
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if not traverse_obj(comment_api_raw_data, ('data', 'cursor', 'is_end')):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | [
pytest.param(False, id='without use_incognito_pages'),
pytest.param(True, id='with use_incognito_pages'),
],
)
async def test_isolation_cookies(*, use_incognito_pages: bool, httpbin: URL) -> None:
sessions_ids: list[str] = []
sessions_cookies: dict[str, dict[str, str]] = {}
response_co... | Review this code and list any quality issues. | [
{
"issue": "The nesting could be reduced here using early returns.",
"severity": "minor",
"line": 26
}
] | 1 |
python | from dotenv import load_dotenv
from livekit.agents import (
Agent,
AgentServer,
AgentSession,
AgentTask,
JobContext,
RoomInputOptions,
RunContext,
cli,
)
from livekit.agents.beta.workflows import GetEmailTask, TaskGroup
from livekit.agents.llm import function_tool
from livekit.plugins i... | Review this code and list any quality issues. | [
{
"issue": "open() is a blocking IO function, we should use aiofiles",
"severity": "minor",
"line": 26
}
] | 1 |
python | # keepdims=True doesn't currently work for lazy arrays
return _stats_py.trim_mean(x, proportiontocut, axis=-1)[..., xp.newaxis]
Nis = [sample.shape[-1] for sample in samples]
Ycis = [func(sample) for sample in samples]
Ntot = sum(Nis)
# compute Zij's
Zijs = [xp.abs(sample - Yc) for sam... | Review this code and list any quality issues. | [
{
"issue": "```python3\r\nimport torch as xp\r\nfrom scipy import special\r\nx = xp.asarray(7., dtype=xp.float32)\r\nspecial.fdtrc(5., 6., x).dtype # torch.float64\r\n```\r\nI'd think this should either fail (e.g. `special_gammainc(): argument 'input' (position 1) must be Tensor, not float`) or maintain the dt... | 1 |
python | max_new_tokens = 30 - prompt_token_ids.shape[-1]
# Static Cache + export
exported_program = convert_and_export_with_cache(model)
ep_generated_ids = TorchExportableModuleWithStaticCache.generate(
exported_program=exported_program, prompt_token_ids=prompt_token_ids, max_new_tokens=max... | Review this code and list any quality issues. | [
{
"issue": "We are also bound by having kernels, no?",
"severity": "minor",
"line": 26
}
] | 1 |
python | results.append((full_name,) +
validate_rst_syntax(text, file_full_name, dots=dots))
return results
def main(argv):
"""
Validates the docstrings of all the pre decided set of
modules for errors and docstring standards.
"""
parser = ArgumentParser(usage=__doc__.lstrip())
... | Review this code and list any quality issues. | [
{
"issue": "unless I'm missing something, the line above could be removed by doing something like\r\n\r\n```suggestion\r\n module_names = args.module_names + [\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | await async_manipulate_test_data(hass, hmip_device, "dimLevel", 1, channel=1)
ha_state = hass.states.get(entity_id)
assert ha_state.state == STATE_ON
assert ha_state.attributes[ATTR_BRIGHTNESS] == 255
assert ha_state.attributes[ATTR_COLOR_MODE] == ColorMode.BRIGHTNESS
assert ha_state.attributes[ATTR... | Review this code and list any quality issues. | [] | 0 |
python | if self.is_bdb_compiled():
self.import_deterministic_coinbase_privkeys()
self.check_addmultisigaddress_errors()
self.log.info('Generating blocks ...')
self.generate(self.wallet, 149)
self.moved = 0
for self.nkeys in [3, 5]:
for self.nsigs in [2, 3]:
... | Review this code and list any quality issues. | [
{
"issue": "Thanks for adding the comment, helpful!",
"severity": "minor",
"line": 26
}
] | 1 |
python | </document>
Here is the chunk we want to situate within the whole document
<chunk>
{CHUNK_CONTENT}
</chunk>
Please give a short succinct context to situate this chunk within the overall document for the purposes of improving search retrieval of the chunk. Answer only with the succinct context and nothing else."""
... | Review this code and list any quality issues. | [
{
"issue": "is it ok if the text can have other tags apart from `chunk` and `document`? maybe we should remove every tags (open and close tags)?",
"severity": "minor",
"line": 26
}
] | 1 |
python | self._html_search_regex(r'(?s)<span\s+class="subjectName">\s*<img\s*[^<]+>\s*([^<]+?)</span>', webpage, 'title', fatal=False))
class NhkForSchoolProgramListIE(InfoExtractor):
_VALID_URL = r'https?://www\.nhk\.or\.jp/school/(?P<id>(?:%s)/[a-zA-Z0-9_-]+)' % (
'|'.join(re.escape(s) for s in NhkForSchoolSubje... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n title = self._og_search_title(webpage, fatal=False) or self._html_extract_title(webpage, fatal=False) or self._html_search_regex(r'<h3>([^<]+?)とは?\\s*</h3>', webpage, 'title', fatal=False)\r\n title = re.sub(r'\\s*\\|\\s*NHK\\s+for\\s+School\\s*$', '', title) if title... | 1 |
python | host="localhost",
statement_cache_size=0
)
try:
rows_new_conn = await new_conn.fetch("SELECT * FROM test_rename ORDER BY id")
assert len(rows_new_conn) == 2, f"Expected 2 rows from new connection, got {len(rows_new_conn)}"
assert rows_new_conn[0]['email_ad... | Review this code and list any quality issues. | [] | 0 |
python | ),
(
DETECTION_TENSORS,
TARGET_TENSORS,
CLASSES,
0.3,
0.5,
GOOD_CONF_MATRIX,
DoesNotRaise(),
),
(
DETECTION_TENSORS,
TARGET_TENSORS,
CLASSES,
0.6,
0.5,
... | Review this code and list any quality issues. | [] | 0 |
python | if EXTRA_ENV_LINK_ARGS is None:
EXTRA_ENV_LINK_ARGS = ""
if "linux" in sys.platform or "darwin" in sys.platform:
EXTRA_ENV_LINK_ARGS += " -lpthread"
if check_linker_need_libatomic():
EXTRA_ENV_LINK_ARGS += " -latomic"
if "linux" in sys.platform:
EXTRA_ENV_LINK_ARGS += " -... | Review this code and list any quality issues. | [
{
"issue": "Heads up: for better or worse, we set the line length to 80 characters - it'll come up after we run the CI.\n\nhttps://google.github.io/styleguide/pyguide.html#32-line-length",
"severity": "minor",
"line": 26
}
] | 1 |
python | from pathlib import Path
from typing import Any, Dict, Tuple
from ray.serve.config import AutoscalingContext
logger = logging.getLogger("ray.serve")
class FileBasedAutoscalingPolicy:
"""Scale replicas based on a target written to a JSON file.
A background asyncio task re-reads the file every ``poll_interva... | Review this code and list any quality issues. | [] | 0 |
python | ),
TrunkProcessEnum.POSTGRES: TrunkProcessData(
name=TrunkProcessEnum.POSTGRES.value,
entrypoint=start_postgres,
port=config['api']['postgres']['port'],
args=(config.cmd_args.verbose,)
),
TrunkProcessEnum.JOBS: TrunkProcessData(
name=Tr... | Review this code and list any quality issues. | [
{
"issue": "@StpMax, please take a look. When I start ML_TASK_QUEUE worker it also tries to run http service. I think it is unexpected behavior",
"severity": "minor",
"line": 26
}
] | 1 |
python | if jwt:
headers = {'Authorization': 'Bearer ' + jwt}
course_api = self._download_json(
f'https://api.itpro.tv/api/urza/v3/consumer-web/course?url={course_name}&brand=00002560-0000-3fa9-0000-1d61000035f3',
course_name, headers=headers, note='Fetching data from cour... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n raise self.raise_login_required()\r\n```\r\ndue to some recent changes, method is now automatically determined",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'uploader': 'Jérémie Mercier',
'uploader_id': 'UCeN_qQV829NYf0pvPJhW5dQ',
'like_count': int,
'upload_date': '20211218',
'thumbnail': 'https://scw.divulg.org/cb-medias4/images/0z4Kms8pi8I/maxres.jpg',
},
'params': {'skip_download': True},
}]
def _r... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n fmts, subs = self._extract_mpd_formats_and_subtitles(mpd_url, video_id, mpd_id='dash', fatal=False)\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | x_min, x_max = np.min(cols), np.max(cols)
y_min, y_max = np.min(rows), np.max(rows)
bboxes[i, :] = [x_min, y_min, x_max, y_max]
return bboxes
def mask_to_polygons(mask: np.ndarray) -> List[np.ndarray]:
"""
Converts a binary mask to a list of polygons.
Parameters:
mask... | Review this code and list any quality issues. | [] | 0 |
python | def init_to_get_rotary(self, base=10000, use_elem=False):
self.config.head_dim_ = self.config.hidden_size // self.config.num_attention_heads
if not hasattr(self.config, "rope_scaling"):
rope_scaling_factor = 1.0
else:
rope_scaling_factor = self.config.rope_scaling.factor if self.config.rope_... | Review this code and list any quality issues. | [
{
"issue": "This is weird. If just `pass` when an error is raised, then why even use `try` statement?",
"severity": "minor",
"line": 26
}
] | 1 |
python | tmp_fh = tempfile.NamedTemporaryFile(dir=resample_tmp, suffix=".wav", delete=False)
tmp_path = tmp_fh.name
tmp_fh.close()
sf.write(tmp_path,wav_numpy,expected_sr,subtype="PCM_16")
return tmp_path
def _set_voice(self)->bool:
self.params['voice_path'] = (
self.sess... | Review this code and list any quality issues. | [
{
"issue": "The variable `SML_TAG` is not imported. It's defined in `lib/conf_models.py` but not exported through `lib/__init__.py`. Add `SML_TAG` to the imports in `lib/__init__.py` to make it accessible.",
"severity": "minor",
"line": 26
}
] | 1 |
python | ]
def format_func(x):
return x["name"]
formatted_options, formatted_option_to_option_index = create_mappings(
complex_options, format_func
)
serde = MultiSelectSerde(
complex_options,
formatted_options=formatted_options,
forma... | Review this code and list any quality issues. | [
{
"issue": "This import of module streamlit is redundant, as it was previously imported [on line 25](1).",
"severity": "minor",
"line": 26
}
] | 1 |
python | #!/usr/bin/env python3
import urllib.request
vendor = {
"https://github.com/nlohmann/json/releases/latest/download/json.hpp": "vendor/nlohmann/json.hpp",
"https://github.com/nlohmann/json/releases/latest/download/json_fwd.hpp": "vendor/nlohmann/json_fwd.hpp",
# sync manually
# "https://raw.github... | Review this code and list any quality issues. | [] | 0 |
python | self.index.add(np.array(embeddings).astype(np.float32))
self.chunk_ids.extend([chunk.chunk_id for chunk in chunks])
# Save updated index
await self._save_index()
async def delete_chunk(self, chunk_id: str) -> None:
if chunk_id not in self.chunk_ids:
return
... | Review this code and list any quality issues. | [] | 0 |
python | ExtractorError,
dict_get,
int_or_none,
merge_dicts,
parse_qs,
parse_age_limit,
parse_iso8601,
str_or_none,
try_get,
unescapeHTML,
url_or_none,
)
class ERTFlixBaseIE(InfoExtractor):
_VALID_URL = r'ertflix:(?P<id>[\w-]+)'
_TESTS = [{
'url': 'ertflix:monogramma-pra... | Review this code and list any quality issues. | [
{
"issue": "What is the purpose of this extractor?",
"severity": "major",
"line": 26
}
] | 1 |
python | if ext == 'm3u8':
fmts, subs = self._extract_m3u8_formats_and_subtitles(source.get('src'), video_id)
formats.extend(fmts)
self._merge_subtitles(subs, target=subtitles)
else:
formats.append({'url': source.get('src'), 'ext': 'mp4'})
retur... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'thumbnails': [{'url': thumbnail} for thumbnail in traverse_obj(nextjs_json, ('default_thumbnails', ...)],\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | import asyncio
import gc
import os
import re
import subprocess
import time
import requests
import atexit
import json
from typing import (
TYPE_CHECKING,
Any,
AsyncGenerator,
AsyncIterator,
Dict,
List,
Optional,
Sequence,
)
import psutil
# Import SGLang correctly
import sglang as sgl
im... | Review this code and list any quality issues. | [
{
"issue": "Please add `if_sglang_available` util function to packages.py https://github.com/hiyouga/LLaMA-Factory/blob/0dbce72fb8b03ea2c20809f3334c54d2106ff5c2/src/llamafactory/extras/packages.py#L98-L99",
"severity": "minor",
"line": 24
}
] | 1 |
python | 'duration': 30
},
}],
'skip': 'paid lesson'
}, {
'url': 'https://gaismasmandalas.getcourse.io/ATLAUTSEVBUT',
'only_matching': True,
}]
_DOMAINS = [
'academymel.online',
'marafon.mani-beauty.com',
]
_BASE_URL_RE = rf'https?://(?:(?!player02\... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n r'<form[^>]+\\bclass=\"[^\"]*\\bstate-login[^\"]*\"[^>]+\\bdata-xdget-id=\"([^\"]+)\"',\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # SPDX-License-Identifier: Apache-2.0
# Standard
from dataclasses import dataclass
from enum import IntEnum, auto
from typing import Optional
import struct
# Third Party
import torch
# First Party
from lmcache.utils import CacheEngineKey
from lmcache.v1.memory_management import MemoryFormat
MAX_KEY_LENGTH = 150
cl... | Review this code and list any quality issues. | [
{
"issue": "Sorry but I didn't mean to add `s` at end; do you mind changing to `ServerReturnCode`?",
"severity": "minor",
"line": 26
}
] | 1 |
python | }
if api_versions
else None,
)
await self.async_set_unique_id(serial_number, raise_on_progress=False)
self._abort_if_unique_id_configured()
return self.async_create_entry(
title=f"PoolDose {serial_number}",
data={CONF_HOST: hos... | Review this code and list any quality issues. | [
{
"issue": "you can use `self.add_suggested_values_to_schema`, that will also accept `None`",
"severity": "minor",
"line": 26
}
] | 1 |
python | if not base_format:
return
base_url = re.sub(r'(Manifest\(.*?),filter=[\w-]+(.*?\))', r'\1\2', base_format['url'])
url = re.sub(r'(Manifest\(.*?),format=[\w-]+(.*?\))', r'\1\2', base_url)
secret_xml = self._download_xml(url, video_id, note='Downloading secret XML', fatal=False)
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n **base_format,\r\n 'format_id': join_nonempty('sec', height),\r\n 'url': re.sub(r'(QualityLevels\\()\\d+(\\))', fr'\\1{bitrate}\\2', base_url),\r\n 'width': int_or_none(video_quality.attrib.get('MaxWidth'))... | 1 |
python | res, ex = self._run_with_optimizer(f, TIER2_THRESHOLD)
self.assertEqual(res, TIER2_THRESHOLD)
self.assertIsNotNone(ex)
uops = get_opnames(ex)
# v + 1 should be constant folded
self.assertNotIn("_BINARY_OP", uops)
def test_for_iter_gen_frame(self):
def f(n):
... | Review this code and list any quality issues. | [
{
"issue": "Please add a testing a normal constant too, e.g. `a is 1`",
"severity": "minor",
"line": 26
}
] | 1 |
python | The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFR... | Review this code and list any quality issues. | [
{
"issue": "It's not on the role object, it's under the `colors` key\r\n```suggestion\r\n colors: RoleColours\r\n```\r\n\r\nRoleColours should be added as its independent type class:\r\n```py\r\nclass RoleColours(TypedDict):\r\n primary_color: int\r\n secondary_color: Optional[int]\r\n tertiary_colo... | 1 |
python | 'b': '"{}"',
'c': '[]',
'd': '"[]"',
}
)),
{
'object': {},
'objectStr': '{}',
'array': [],
'arrayStr': '[]',
}
)
def test_js_to_json_realworld(self):
... | Review this code and list any quality issues. | [] | 0 |
python | 0: 'The username does not exist or you have entered the wrong password.',
-1: 'The username does not exist or you have entered the wrong password.',
-3: 'You have entered your username/password incorrectly.',
-7: 'You cannot use your Global AfreecaTV account to access Korean AfreecaT... | Review this code and list any quality issues. | [
{
"issue": "Minor regex fix...but is this `video_id = ...` even necessary though? The `video_id` is always matched from the URL, yeah? Are there any tests/examples that need this?\r\n```suggestion\r\n r'vod\\.afreecatv\\.com/player/(\\d+)/', webpage, 'title', default=video_id)\r\n```",
"severity"... | 1 |
python | @pytest.mark.parametrize("filename", ["filename.csv", "filename with blanks.csv"])
@pytest.mark.parametrize("revision", [None, "v2"])
def test_dataset_url(repo_id, filename, revision):
url = hf_dataset_url(repo_id=repo_id, filename=filename, revision=revision)
assert url == f"https://huggingface.co/datasets/{re... | Review this code and list any quality issues. | [] | 0 |
python | f"Failed node execution {node_exec.node_exec_id}: {e}"
)
if stats is not None:
stats.error = e
@classmethod
@func_retry
def on_graph_executor_start(cls):
configure_logging()
set_service_name("GraphExecutor")
cls.db_client = get_db_client... | Review this code and list any quality issues. | [] | 0 |
python | ----------
bar_type : BarType
The type of bar to subscribe to.
contract : IBContract
The Interactive Brokers contract details for the instrument.
use_rth : bool
Whether to use regular trading hours (RTH) only.
handle_revised_bars : bool
Whe... | Review this code and list any quality issues. | [
{
"issue": "Lets keep using snake case for local vars.",
"severity": "minor",
"line": 26
}
] | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.