language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | from deeplake.core.dataset import Dataset
import numpy as np
def check_rechunk(ds: "Dataset"):
rechunk = []
for key, tensor in ds.tensors.items():
if not tensor.meta.sample_compression and not tensor.meta.chunk_compression:
engine = tensor.chunk_engine
num_chunks = engine.num_c... | Review this code and list any quality issues. | [
{
"issue": "what if after transform, tensor is has all Nones but no max shape and dtype?",
"severity": "minor",
"line": 15
}
] | 1 |
python | ), 1)
season_id = bangumi_info.get('season_id') or []
season_number = season_id and next((
idx + 1 for idx, e in enumerate(
bangumi_info.get('seasons') or [])
if e.get('season_id') == season_id
), None)
aid = traverse_obj(bangumi_info, ('episodes... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n **traverse_obj(bangumi_info, {\r\n 'series': ('series', 'series_title', {str}),\r\n 'series_id': ('series', 'series_id', {str_or_none}),\r\n 'thumbnail': ('square_cover', {url_or_none}),\r\n }),\r\n 'titl... | 1 |
python | initial_err_perc = 0.5,
err_step = 0.05
)
if sampled_requests: # Only add non-empty groups
grouped_requests.append((ts, sampled_requests))
ts += interval_ms
if ts > duration_ms:
break
# Move to the next time range
... | Review this code and list any quality issues. | [
{
"issue": "I suggest to have all `--trace-type` listed here.",
"severity": "minor",
"line": 26
}
] | 1 |
python | def test_padded_struct_array(self):
dt1 = np.dtype(
[('a', 'b'), ('b', 'i'), ('sub', np.dtype('b,i')), ('c', 'i')],
align=True)
x1 = np.arange(dt1.itemsize, dtype=np.int8).view(dt1)
self._check_roundtrip(x1)
dt2 = np.dtype(
[('a', 'b'), ('... | Review this code and list any quality issues. | [
{
"issue": "The ones we shouldn't just delete when finalizing would be nice to just replace immediately, but also not a big thing.",
"severity": "minor",
"line": 26
}
] | 1 |
python | raise TypeError("The `raw` flag implies the `noStrict` flag")
elif 'onlyStrict' in flags:
raise TypeError(
"The `raw` flag is incompatible with the `onlyStrict` flag")
elif self.get_include_list():
raise TypeError(
"The `raw... | Review this code and list any quality issues. | [
{
"issue": "We still need this trick, because run-test-suite-test262.py concatenates args.runtime and args.engine with space.",
"severity": "minor",
"line": 26
}
] | 1 |
python | from typing import Any, Optional
from embedchain.config.base_config import BaseConfig
from embedchain.helpers.json_serializable import register_deserializable
@register_deserializable
class Mem0Config(BaseConfig):
def __init__(self, api_key: str, top_k: Optional[int] = 10):
self.api_key = api_key
... | Review this code and list any quality issues. | [] | 0 |
python | params="u_min,u_max,v_min,v_max",
since="v0.8.0",
until="v0.9.0",
message="Use u_range and v_range instead.",
)
def __init__(
self,
func: Callable[[float, float], np.ndarray],
u_range: Sequence[float] = [0, 1],
v_range: Sequence[float] = [0, 1],
re... | Review this code and list any quality issues. | [
{
"issue": "should still be `super()`\r\n```suggestion\r\n super().__init__(**kwargs)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | onUploaded = self.upload_button.click(
fn=lambda: gr.update(visible=True),
outputs=[self.upload_progress_panel],
).then(
fn=self.index_fn,
inputs=[
self.files,
self.reindex,
self._app.settings_state,
... | Review this code and list any quality issues. | [] | 0 |
python | metrics = trainer.logger_connector.callback_metrics
# backward compatibility... need to deprecate
if self.monitor is None and 'val_loss' in metrics:
self.monitor = 'val_loss'
if self.monitor is None and 'checkpoint_on' in metrics:
self.monitor = 'checkpoint_on'
... | Review this code and list any quality issues. | [
{
"issue": "Can we rename `del_list` to something clearer like `existing_filepath`? I understand you are reusing the name in the `_update_best_and_save` method but the usage here is unrelated to the fact that it will be deleted later",
"severity": "minor",
"line": 26
}
] | 1 |
python | expected_alert_banner_msg = (
"(PY1001): Unable to install package(s) 'opsdroid'. "
"Reason: Can't find a pure Python 3 Wheel for package(s) 'opsdroid'"
)
alert_banner = self.page.wait_for_selector(".alert-banner")
assert expected_alert_banner_msg in alert_banner.inner_t... | Review this code and list any quality issues. | [] | 0 |
python | ctx.exit(2)
try:
exclude_regex = re_compile_maybe_verbose(exclude)
except re.error:
err(f"Invalid regular expression for exclude given: {exclude!r}")
ctx.exit(2)
try:
force_exclude_regex = (
re_compile_maybe_verbose(force_exclude) if force_exclude else None
... | Review this code and list any quality issues. | [
{
"issue": "I feel like this should also obey the force_exclude_regex. It will be surprising if I force-exclude a file and it gets included anyway because it's in a directory I included.",
"severity": "minor",
"line": 26
}
] | 1 |
python | 4) return the result or raise the expected exception.
Returns:
- The prompt result (str) if no exception expected.
- None if an exception is expected and raised.
"""
with create_pipe_input() as pipe:
session = get_session_prompter(input=pipe, output=DummyOutput())
with ThreadPoo... | Review this code and list any quality issues. | [] | 0 |
python | ext_domain, extr_id = self._search_regex(
r'https://(?P<ext_domain>[\w.-]+\.\w{3})/embed/(?P<extr_id>\d+)/',
webpage, 'embed info', group=('ext_domain', 'extr_id'), fatal=True)
info_json = self._download_json(
self._gen_info_url(ext_domain, extr_id), video_id,
no... | Review this code and list any quality issues. | [
{
"issue": "if we're using index `0` for the download url we should probably use it here too, yeah?\r\n```suggestion\r\n 'ext': traverse_obj(video_json, (0, 'format', {determine_ext})),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def extract_insn_mnemonic_features(
fh: FunctionHandle, bb: BBHandle, ih: InsnHandle
) -> Iterator[Tuple[Feature, Address]]:
"""parse instruction mnemonic features"""
insn: ghidra.program.database.code.InstructionDB = ih.inner
yield Mnemonic(insn.getMnemonicString().lower()), ih.address
def extract_i... | Review this code and list any quality issues. | [
{
"issue": "`ref` may be `None` which causes a `RuntimeError` exception.",
"severity": "minor",
"line": 26
}
] | 1 |
python | @pytest.mark.parametrize(
"wallet_environments",
[{"num_environments": 1, "blocks_needed": [2], "reuse_puzhash": True, "trusted": True}],
indirect=True,
)
@pytest.mark.limit_consensus_modes(reason="irrelevant")
@pytest.mark.anyio
async def test_get_farmed_amount(wallet_environments: WalletTestFramework) -> ... | Review this code and list any quality issues. | [
{
"issue": "Wonder what happened to this one? (I suspect you've added `| None` to a signature)",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'id': ('id', {str}),
'title': ('longTitle', {str}),
'duration': ('duration', {int_or_none}),
'timestamp': ('broadcastedOn', {parse_iso8601}),
}))
page_data = call_api(0)
full_id = join_nonempty(playlist_id, seas... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'https://api.ardaudiothek.de/graphql', urn,\r\n data=json.dumps({\r\n 'query': query,\r\n 'variables': {'id': urn},\r\n }).encode(), headers={\r\n 'Content-Type': 'application/json',\r\n })['da... | 1 |
python | if path_db is not None:
con = sqlite3.connect(path_db)
cursor = con.cursor()
cursor.execute(
"CREATE TABLE IF NOT EXISTS server_bench"
"(name TEXT, n_parallel INTEGER, prompt_source TEXT, n_prompts INTEGER, "
"n_predict INTEGER, n_predict_min INTEGER, seed_off... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n plt.title(name or \"\")\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | logcdf = distributions.norm.logcdf(w)
logsf = distributions.norm.logsf(w)
sig = array([15, 10, 5, 2.5, 1])
critical = around(_Avals_norm / (1.0 + 0.75/N + 2.25/N/N), 3)
elif dist == 'expon':
w = y / xbar
fit_params = 0, xbar
logcdf = distributions.expon.logcdf(w)
... | Review this code and list any quality issues. | [] | 0 |
python | def _extract_item(self, item, fatal):
item_id = item['id']
title = item.get('name') or item['title']
formats = []
for k, v in (item.get('source') or {}).items():
if not v:
continue
if k in ('mp4', 'hls'):
for res, video_url in v.it... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if type_url == \"video-clip\":\r\n```\r\nPass `type_url` as an argument too.",
"severity": "minor",
"line": 26
}
] | 1 |
python | _TESTS = [{
'url': 'http://mp3.zing.vn/album/Lau-Dai-Tinh-Ai-Bang-Kieu-Minh-Tuyet/ZWZBWDAF.html',
'info_dict': {
'_type': 'playlist',
'id': 'ZWZBWDAF',
'title': 'Lâu Đài Tình Ái',
},
'playlist_count': 9,
}, {
'url': 'http://mp3.zing.vn/play... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n return self.playlist_result(entries(), traverse_obj(data, 'id', 'encodeId'), traverse_obj(data, 'name', 'title'))\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
"""
if not all(isinstance(m, VMobject) for m in vmobjects):
raise TypeError("All submobjects must be of type VMobject")
return super().add(*vmobjects)
def __add__(self, vmobject):
return VGroup(*self.submobjects, vmobject)
def __iadd__(self, vmobject):
ret... | Review this code and list any quality issues. | [
{
"issue": "it would be better to use typing. https://docs.manim.community/en/latest/contributing/typings.html",
"severity": "minor",
"line": 26
}
] | 1 |
python | __all__ = ["TrueDot", "DotCloud"]
import numpy as np
from ...constants import ORIGIN, RIGHT, UP
from ...utils.color import YELLOW
from .opengl_point_cloud_mobject import OpenGLPMObject
class DotCloud(OpenGLPMObject):
def __init__(
self, color=YELLOW, stroke_width=2.0, radius=2.0, density=10, **kwargs
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n self.points = np.array(self.generate_points(), dtype=np.float32)\r\n```",
"severity": "minor",
"line": 22
}
] | 1 |
python | return body
@override
def _convert_api_output_to_conversation(
self, response: dict[str, Any], original_conversation: Conversation
) -> Conversation:
"""Converts a SambaNova API response to a conversation.
Args:
response: The API response to convert.
origina... | Review this code and list any quality issues. | [
{
"issue": "Also validate `len(choices) ==1 `, `>0` , etc ?",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import (
clean_podcast_url,
get_element_by_id,
parse_iso8601,
traverse_obj,
)
class ApplePodcastsIE(InfoExtractor):
_VALID_URL = r'https?://podcasts\.apple\.com/(?:[^/]+/)?podcast(?:/[^/]+){1,2}.*?\bi=(?P<id>\d+)'
_TESTS = [{
'url': 'https... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n)\r\nfrom ..utils.traversal import traverse_obj\r\n```",
"severity": "minor",
"line": 7
}
] | 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\noptions = [(\"a\", \"Option A\"), (\"b\", \"Option B\"), (\"c\", \"Option C\"), (\"d\", \"Option D\")]\r\n```",
"severity": "minor",
"line": 18
}
] | 1 |
python | ]
),
"menu": lambda gui, control_type, attrs: _Builder(
gui=gui,
control_type=control_type,
element_name="MenuCtl",
attributes=attrs,
)
.set_attributes(
[
("active", PropertyType.dynamic_boolean, True),
... | Review this code and list any quality issues. | [] | 0 |
python | self, intent_obj: intent.Intent, conversation_command: str
) -> bool:
"""Validate that a conversation command can be executed."""
from homeassistant.components.conversation import ( # noqa: PLC0415
ConversationEntity,
ConversationEntityFeature,
ConversationInput,... | Review this code and list any quality issues. | [
{
"issue": "Is there any reason we're not simply doing this?\r\n```suggestion\r\n if ConversationEntityFeature.CONTROL in conversation_agent.supported_features:\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | edge
The direction to seek bounding box edge of mobject.
point_color
Initial color of the mobject before growing to its full size. Leave empty to match mobject's color.
Examples
--------
.. manim :: GrowFromEdgeExample
class GrowFromEdgeExample(Scene):
def construc... | Review this code and list any quality issues. | [
{
"issue": "Edges, in the same way as directions, are usually conceptually vectors. `Mobject.get_critical_point()` is typed to accept a vector (which should have been typed as `Vector3DLike` instead of just `Vector3D`):\r\n```suggestion\r\n edge: Vector3DLike,\r\n```",
"severity": "minor",
"line"... | 1 |
python | request.last_proxy_tier = proxy_tier
request.forefront = True
if proxy_tier is not None:
urls = self._proxy_tier_tracker.get_tier_urls(proxy_tier)
else:
urls = self._proxy_tier_tracker.all_urls
elif self._proxy_urls:
urls = sel... | Review this code and list any quality issues. | [
{
"issue": "Did the `request is not None` condition cause any trouble here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | },
}]
def _real_extract(self, url):
host, series_id = self._match_valid_url(url).group('host', 'id')
html = self._download_webpage(url, series_id)
pageprops = self._search_nextjs_data(html, series_id)['props']['pageProps']
geo_countries = traverse_obj(pageprops, ('itemDetailsDa... | Review this code and list any quality issues. | [
{
"issue": "instead of duplicating the `item_url`/`smuggle_url` code, I would move it into a function. could refactor like this:\r\n```suggestion\r\n def item_result(item):\r\n item_url = iri_to_uri(f'https://www.{host}/watch/{item[\"item_id\"]}/{item[\"title\"]}')\r\n if geoblocked... | 1 |
python | <children title="child">null</children>
<location title="Location">null</location>
</ExamplePydanticFields>
</children>
<location title="Location">Australia</location>\
"""
)
assert (
format_as_xml(DataItem(user1=data, user2=data.model_copy()), include_field_info=True)
== """\
<user1>
<... | Review this code and list any quality issues. | [] | 0 |
python | with torch.no_grad():
config = CONFIG_MAP[args.model]
config.pad_token_id = config.eos_token_id
model = transformers.LlamaForCausalLM(config).cuda()
model = model.eval()
tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/llama-tokenizer")
if args.dtype == "fp... | Review this code and list any quality issues. | [
{
"issue": "Keeping the order to `model, tokenizer, inference_config` would be better to me.",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
# Ignores dim_to_match and stretch; result will always be a circle
# TODO: Perhaps create an ellipse class to handle single-dimension stretching
# Something goes wrong here when surrounding lines?
# TODO: Figure out and fix
self.replace(mobject, dim_to_match, stretch)
... | Review this code and list any quality issues. | [
{
"issue": "point and radius aren't optional if I am not mistaken.",
"severity": "minor",
"line": 26
}
] | 1 |
python | torch.distributed.all_reduce(
loss, op=torch.distributed.ReduceOp.AVG, group=self.engine.get_data_parallel_group()
)
loss = loss.item()
# For grad_norm, we do not perform all reduce because it is already been done when clipping grad
grad_norm = metrics.pop("grad_norm", None)... | Review this code and list any quality issues. | [
{
"issue": "make sure it works if images_seqlens = None",
"severity": "minor",
"line": 26
}
] | 1 |
python | # SPDX-License-Identifier: Apache-2.0
# Standard
from collections import OrderedDict
from typing import Any, Dict
import time
# First Party
from lmcache.logging import init_logger
from lmcache.observability import LMCStatsMonitor
from lmcache.utils import CacheEngineKey
from lmcache.v1.storage_backend.cache_policy.bas... | Review this code and list any quality issues. | [
{
"issue": "Genimi did a good catch here. We can have\r\n```python3\r\nself.chunk_hash_to_init_timestamp: dict[int, float] = {}\r\n```",
"severity": "minor",
"line": 23
}
] | 1 |
python | # Mempools should match via 1P1C p2p relay
self.num_nodes = 2
# Don't test trickling logic
self.noban_tx_relay = True
def add_output_to_create_multi_result(self, result, output_value=0):
""" Add output without changing absolute tx fee
"""
assert len(result["tx"].vou... | Review this code and list any quality issues. | [
{
"issue": "```diff\r\n- def create_ephemeral_dust_package(self, *, tx_version, dust_tx_fee=0, dust_value=0, num_dust_outputs=1, extra_sponsors=None):\r\n+ def create_ephemeral_dust_package(self, *, tx_version, dust_tx_fee=0, dust_value=0, num_dust_outputs=1, extra_sponsor_coins=None):\r\n```\r\n\r\nNit for ver... | 1 |
python | node.bumpmocktime(GETDATA_TX_INTERVAL)
honest_peer.wait_for_getdata([parent_txid_int])
honest_peer.send_and_ping(msg_tx(tx_parent["tx"]))
# 6. After parent is accepted, orphans should be reconsidered.
# The real child should be accepted and the fake one rejected. This may happen in eith... | Review this code and list any quality issues. | [
{
"issue": "nit: logging here seems excessive considering a failure of the assert makes it obvious what went wrong",
"severity": "critical",
"line": 26
}
] | 1 |
python | b_revision: Optional[str] = None,
) -> (T, T, U):
"""
Performs an A/B-test using the given test runner between the specified revision, and the currently checked out revision.
The specified revisions will be checked out in temporary directories, with `test_runner` getting executed in the
repository root.... | Review this code and list any quality issues. | [
{
"issue": "I don't understand why do they clash? What is the use context here? If we are running in Buildkite, we will have the 2 directories set up for us, and if they don't then there's nothing to clash against?",
"severity": "minor",
"line": 26
}
] | 1 |
python | a, b = 7, Rational(5, 3)
polys = [jacobi(n, a, b, x), gegenbauer(n, a, x), chebyshevt(n, x),
chebyshevu(n, x), legendre(n, x), hermite(n, x), laguerre(n, x),
assoc_laguerre(n, a, x)]
for p in polys:
integral = manualintegrate(p, x)
for deg in [-2, -1, 0, 1, 3, 5, 8]:
... | Review this code and list any quality issues. | [] | 0 |
python | # Shuffle the rows in the DataFrame.
df = df.sample(frac=1)
# Split the DataFrame into two DataFrames, one for titling tasks and one for writing tasks.
writing_tasks = df.iloc[:num_writing_tasks]
titling_tasks = df.iloc[num_writing_tasks:]
prepared_data = []
# Loop through the writing tasks and process them.
for ind... | Review this code and list any quality issues. | [
{
"issue": "please use `pd.isna(instruction)` or something similar, the \"nan\" is an artifact from converting NaN (missing/None) to string",
"severity": "minor",
"line": 26
}
] | 1 |
python | if split is None:
split = str(self.split) if self.split is not None else "train"
if not re.match(_split_re, split):
raise ValueError(f"Split name should match '{_split_re}' but got '{split}'.")
if branch != "deprecated":
warnings.warn(
"'branch' was ... | Review this code and list any quality issues. | [
{
"issue": "Alternatively:\r\n```suggestion\r\n if revision is not None and not revision.startswith(\"refs/pr/\"):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | infer_state.is_context_stage = True # set prefill stage, notify attention layer
infer_state.context_mem_index = infer_state.cache_manager.alloc(infer_state.total_token_num)
infer_state.init_block_loc(infer_state.block_loc, infer_state.seq_len, seq_length,
... | Review this code and list any quality issues. | [
{
"issue": "Swap codes between 129~142 lines and codes between144~152 lines to avoid redundant code, “position_ids = None”",
"severity": "minor",
"line": 26
}
] | 1 |
python | def __init__(self, lr_scheduler_class: Callable, *args, **kwargs):
args = list(args)
if 'optimizer' in kwargs:
kwargs['optimizer'] = None
else:
args[0] = None
super().__init__(lr_scheduler_class, *args, **kwargs)
def call(self, optimizer: Optimizer) -> _LRSch... | Review this code and list any quality issues. | [
{
"issue": "You can use `.trace_symbol`, `.trace_args` and `.trace_kwargs`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | def _remove_ngc_prefix(name: str, prefix: str = "monai_") -> str:
if name.startswith(prefix):
return name[len(prefix) :]
return name
def _download_from_ngc(
download_path: Path, filename: str, version: str, remove_prefix: str | None, progress: bool
) -> None:
# ensure prefix is contained
f... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n huggingface_hub.snapshot_download(repo_id=repo_id, revision=version, local_dir=extract_path)\r\n```\r\n\r\n`local_dir_use_symlinks=\"auto\"` is not wrong but it's already the default value for that so you can forget it :)",
"severity": "critical",
"line": 26
}
] | 1 |
python | """kedro is a CLI for managing Kedro projects.
This module implements commands available from the kedro CLI.
"""
from __future__ import annotations
import importlib
import sys
import traceback
from collections import defaultdict
from pathlib import Path
from typing import TYPE_CHECKING, Any
import click
import clic... | Review this code and list any quality issues. | [
{
"issue": "Should we not replace the following `click.MultiCommand` with `Group` instead of this? I don't suppose this helps with maintaining backwards compatibility or even if we want to?",
"severity": "minor",
"line": 21
}
] | 1 |
python | expand_power_base, expand_power_exp, arity
from .evalf import PrecisionExhausted, N
from .containers import Tuple, Dict
from .exprtools import gcd_terms, factor_terms, factor_nc
from .parameters import evaluate
from .kind import UndefinedKind, NumberKind, BooleanKind
from .traversal import preorder_traversal, bottom_up... | Review this code and list any quality issues. | [] | 0 |
python | new_line = line.clone()
new_line.comments = line.comments.copy()
try:
append_leaves(new_line, line, LL[: string_idx - 1])
except BracketMatchError:
# HACK: I believe there is currently a bug somewhere in
# right_hand_split() that is causing brackets to not be ... | Review this code and list any quality issues. | [] | 0 |
python | ("function", "details", "permission"),
[
("is_authorized_dag", DagDetails(team_name="team-a"), "Dag:team-a#LIST"),
("is_authorized_connection", ConnectionDetails(team_name="team-a"), "Connection:team-a#LIST"),
("is_authorized_variable", VariableDetails(team_name="team-a"), "V... | Review this code and list any quality issues. | [
{
"issue": "Can you please use a decorator? That makes it easier to read",
"severity": "minor",
"line": 26
}
] | 1 |
python | if path_in_package_dist not in registered_paths[package_name]:
raise exceptions.DependencyException(
f"""
"{package_name}" is registered but the path requested is not valid.
The path requested: "{path_in_package_dist}"
List of registered paths: {registered_paths}
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n Layout must be a single dash component, a list of dash components\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def _build_registered_operators() -> dict[str, dict[int | None, type[OpRun]]]:
return build_registered_operators_any_domain(globals().copy())
def load_op(
domain: str,
op_type: str,
version: None | int,
custom: Any = None,
) -> Any:
"""Loads the implemented for a specified operator.
Args:... | Review this code and list any quality issues. | [] | 0 |
python | MYPY_FILES_ARGS = ['git', 'ls-files', 'test/functional/*.py', 'contrib/devtools/*.py']
ENABLED = (
'E101,' # indentation contains mixed spaces and tabs
'E112,' # expected an indented block
'E113,' # unexpected indentation
'E115,' # expected an indented block (comment)
'E116,' # unexpected inde... | Review this code and list any quality issues. | [
{
"issue": "In commit: lint: Remove python whitespace and shadowing lint rules \r\nThis seems reasonable to me, but not available without the `--preview` argument",
"severity": "minor",
"line": 26
}
] | 1 |
python | config_dataset_path=None,
formatter_name=dataset_conf.formatter,
dataset_name=dataset_conf.dataset_name,
dataset_path=dataset_conf.path,
meta_file_train=dataset_conf.meta_file_train,
meta_file_val=dataset_conf.meta_file_val,
disable_cuda=False,
... | Review this code and list any quality issues. | [] | 0 |
python | raise ValueError(
"The currently selected model is a realtime model but use_realtime is False"
)
elevenlabs_api_key = api_key if is_given(api_key) else os.environ.get("ELEVEN_API_KEY")
if not elevenlabs_api_key:
raise ValueError(
"ElevenLabs API k... | Review this code and list any quality issues. | [
{
"issue": "We can use `return self._opts.model_id` here as well.",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Copyright 2025 - Oumi
#
# 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 agreed to in writing, softw... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\nOUMI_GITHUB_RAW = \"https://raw.githubusercontent.com/oumi-ai/oumi/main\"\r\n```\r\n\r\nLet's make this the top level directory so users can request samples from `/configs/examples` or `/configs/projects` as well",
"severity": "minor",
"line": 25
}
] | 1 |
python | cur_duration = 0
max_part_duration = int(session['output_split_hours']) * 3600
needs_split = total_duration > (int(session['output_split_hours']) * 2) * 3600
for idx, (file, dur) in enumerate(zip(chapter_files, durations)):
if session['cancellation_req... | Review this code and list any quality issues. | [
{
"issue": "Incorrect syntax for dictionary method call. `session.get` should be called with parentheses: `session.get('cancellation_requested')`. This syntax error will cause the code to fail at runtime.",
"severity": "critical",
"line": 26
}
] | 1 |
python | 'info_dict': {
'id': '71621339',
'ext': 'mp4',
'title': 'md5:4c91ea82760fe0fffb71b8c3aa7295fc',
'thumbnail': r're:^https://uploads\.cdn\.triller\.co/.+\.jpg$',
'description': 'md5:4c91ea82760fe0fffb71b8c3aa7295fc',
'uploader': 'charlidamelio',
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n username, video_uuid = self._match_valid_url(url).group('username', 'id')\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | surface_plane.set_style(fill_opacity=1)
surface_plane.set_fill_by_value(axes=axes, colorscale=[(RED, -0.5), (YELLOW, 0), (GREEN, 0.5)], axis=2)
self.add(axes, surface_plane)
"""
if "colors" in kwargs and colorscale is None:
colorscale = kwargs.pop("col... | Review this code and list any quality issues. | [
{
"issue": "A `ParsableManimColor` may be a tuple, so one must be careful. Checking that the elements are tuples isn't enough.\n\nRight now, there's one way I can think of in order to separate both cases:\n```suggestion\n if type(colorscale[0]) is tuple and len(colorscale[0]) == 2:\n```\nbecause color tu... | 1 |
python | update_index_id: str | None,
memprofile: bool,
nocache: bool,
reporter: ReporterType,
config_filepath: str | None,
emit: list[TableEmitterType],
dryrun: bool,
skip_validations: bool,
output_dir: str | None,
):
"""Run the pipeline with the given config."""
progress_reporter = crea... | Review this code and list any quality issues. | [] | 0 |
python | def target_temperature(self):
"""Return the temperature we are trying to reach."""
return self._unit.thermostat
@property
def hvac_mode(self):
"""Return hvac target hvac state."""
mode = self._unit.mode
if not self._unit.is_on:
return HVACMode.OFF
re... | Review this code and list any quality issues. | [
{
"issue": "⚠️ Every time this property is accessed it logs this warning, thus it will flood logs. This needs a guard to only log once.",
"severity": "minor",
"line": 26
}
] | 1 |
python | _AUS_TV_PARENTAL_GUIDELINES = {
'P': 0,
'C': 7,
'G': 0,
'PG': 0,
'M': 14,
'MA15+': 15,
'MAV15+': 15,
'R18+': 18,
}
_PLAYER_API = 'https://www.sbs.com.au/api/v3'
_CATALOGUE_API = 'https://catalogue.pr.sbsod.com/'
def _call_api(self, video_i... | Review this code and list any quality issues. | [
{
"issue": "one-time use var/functions that can be inlined instead, as i did in my suggestions below\r\n```suggestion\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | self,
mobject: "Mobject",
copy_submobjects: bool = True,
match_center: bool = False,
match_height: bool = False,
match_width: bool = False,
):
"""Edit points, colors and submobjects to be identical
to another :class:`~.Mobject`
Examples
------... | Review this code and list any quality issues. | [
{
"issue": "Without having tested it: is this separate clause really necessary? If so, what is the difference to\r\n```py\r\nif match_height:\r\n mobject.match_height(self)\r\nif match_width:\r\n mobject.match_width(self)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | result = await hass.config_entries.flow.async_configure(result["flow_id"])
assert result["type"] is FlowResultType.ABORT
assert result["reason"] == "already_configured"
@pytest.mark.usefixtures("current_request_with_host", "use_cloud")
async def test_duplicate_dhcp_entry(
hass: HomeAssistant,
hass_cl... | Review this code and list any quality issues. | [] | 0 |
python | # get command from existing connection should not be rejected
await client.execute_command("get x")
# reject set due to oom
with pytest.raises(redis.exceptions.ResponseError):
await client.execute_command("set x y")
if admin_port:
# new client create should also fail if admin port was ... | Review this code and list any quality issues. | [] | 0 |
python | 'description': 'md5:7fe8e3d5806f96002e55f190d1d94479',
'uploader': 'The Voice',
'uploader_id': 'NBCTheVoice',
'upload_date': '20191029',
},
}],
'params': {
'playlistend': 2,
},
'expected_warnings': ['HTTP Error 404',... | Review this code and list any quality issues. | [
{
"issue": "rename `meta` to `video`: this will minimize the diff",
"severity": "minor",
"line": 26
}
] | 1 |
python | if transpose:
# for vector operations, we need a DataFrame to be a single-row,
# not a single-column, in order to operate against non-DataFrame
# vectors of the same length. But convert to two rows to avoid
# single-row special cases in datetime arithmetic
... | Review this code and list any quality issues. | [] | 0 |
python | # % if cookiecutter.package_manager in ['poetry', 'uv']
import subprocess
import shutil
import re
import sys
manager = "{{cookiecutter.package_manager}}"
manager_text = manager.title()
# % if cookiecutter.package_manager == 'poetry'
version_regex = r'Poetry \(version 2\..*\)'
r_version = '2.x'
# % elif cookiecutter.pa... | Review this code and list any quality issues. | [] | 0 |
python | f"`{prop_key}` field of DataNodeConfig"
f" `{data_node_config_id}` must be populated with a List value.",
)
if data_node_config_id != DataNodeConfig._DEFAULT_KEY:
properties_to_check_at_least_one = [
DataNodeConfig._OPTIONAL_READ_FUNCTION_G... | Review this code and list any quality issues. | [
{
"issue": "`prop_type` is the value in the `_PROPERTIES_TYPES` dictionary. Today, it must be a Python type.\r\n\r\nCan we imagine `prop_type` being either a type or a list of types? Then, we should check that the type of `prop_value ` is among the types in the `prop_type` list of types.\r\n\r\nDoes it make sen... | 1 |
python | was called.
.. warning::
The value passed as `method` are not currently considered
stable across pandas releases.
"""
if isinstance(other, NDFrame):
if other.attrs:
# We want attrs propagation to have minimal performance
... | Review this code and list any quality issues. | [
{
"issue": "Remove references to concat I think.",
"severity": "minor",
"line": 26
}
] | 1 |
python | else:
self.out_count += 1
crossed_out[i] = True
return self.in_count, self.out_count
elif self.count_condition == "center_point_crossed":
for i, (xyxy, _, confidence, class_id, tracker_id) in enumerate(detections):
if tracker_id i... | Review this code and list any quality issues. | [
{
"issue": "Please do not include comments in code :)",
"severity": "minor",
"line": 26
}
] | 1 |
python | formats.append({
**traverse_obj(video, {
'url': 'url',
'format_id': ('definition', {lambda x: f'http-{x or "0"}'}),
'width': ('width', {int_or_none}),
'height': ('height', {int_or_none}),
'filesize': (('t... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'description': (('description', 'description_en', 'description_cn'), {str}),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'ext': 'mp4',
'title': 'nuuh.mp4'
}
}]
def _real_extract(self, url):
file_id = self._match_id(url)
# Create guest account
accountdata = self._download_json_handle('https://api.gofile.io/createAccount', 'Gofile', note='Getting a new guest account')
status = a... | Review this code and list any quality issues. | [
{
"issue": "only return files that are videos and audio\r\nif a link has none then raise no video file error",
"severity": "minor",
"line": 26
}
] | 1 |
python | if data_type == DataInputType.DICT:
doc = Document.from_dict(data)
return doc, DataInputType.DICT
if data_type == DataInputType.AUTO or data_type == DataInputType.DOCUMENT:
if isinstance(data, Document):
# if incoming is already primitive type Document, then all good, best practi... | Review this code and list any quality issues. | [
{
"issue": "u are removing these `_kwargs` I think it is not needed to spend time on this",
"severity": "minor",
"line": 26
}
] | 1 |
python | url: The request URL.
method: The HTTP method.
headers: The HTTP headers.
payload: The data to be sent as the request body.
keep_url_fragment: A flag indicating whether to keep the URL fragment.
use_extended_unique_key: A flag indicating whether to include a hashed payload in the... | Review this code and list any quality issues. | [
{
"issue": "One more typo, sorry :slightly_smiling_face: it should be `normalized_session`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | class Solver(RBC):
def __init__(self, scene: "Scene", sim: "Simulator", options):
self._uid = gs.UID()
self._sim = sim
self._scene = scene
self._dt: float = options.dt
self._substep_dt: float = options.dt / sim.substeps
self._init_gravity = getattr(options, "gravity",... | Review this code and list any quality issues. | [
{
"issue": "It is already None. No need to set it again.",
"severity": "minor",
"line": 26
}
] | 1 |
python | sequence_length = 10
num_channels = 4
sizes = (32, 32)
generator = torch.manual_seed(0)
noise = floats_tensor((batch_size, num_channels) + sizes)
input_ids = torch.randint(1, sequence_length, size=(batch_size, sequence_length), generator=generator)
pipeline_inputs = {
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # Overriding because (1) text encoder LoRAs are not supported in Flux 2 and (2) because the Flux 2 single block\r\n # QKV projections are always fused, it has no `to_q` param as expected by the original test.\r\n def test_lora_fuse_nan(self):\r\n```\r\nI think adding a com... | 1 |
python | reload(sys)
sys.setdefaultencoding('utf-8')
import json
from xml.etree import ElementTree
import re
from requests import HTTPError
from ._html_unescaping import unescape
from ._errors import (
VideoUnavailable,
TooManyRequests,
YouTubeRequestFailed,
NoTranscriptFound,
TranscriptsDisabled,
... | Review this code and list any quality issues. | [
{
"issue": "That's what I meant by static property of `_TranscriptParser` 😊 \r\n```python\r\nclass _TranscriptParser(object):\r\n _FORMATTING_TAGS = [ \r\n # ...\r\n ]\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | Parameters
----------
link : RigidLink
The target link.
local_point : torch.Tensor or None, shape (3,)
Coordinates of the point in the link’s *local* frame.
If None, the link origin is used (back-compat).
Returns
-------
jacobian : tor... | Review this code and list any quality issues. | [
{
"issue": "`p_local = torch.as_tensor(local_point, dtype=gs.tc_float, device=gs.device)`",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'Clips': '''query ($page: Int!, $user: String!, $game: Int) {
videos: clips(search: createdDate, page: $page, user: $user, mobile: false, game: $game) {
data { %s %s }
}
}''' % (_FIELDS, _EXTRA_FIELDS),
'Montages': '''query ($page: Int!, $user: String!) {
videos: montages(sea... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n return urljoin('https://allstar.gg/u/', path)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | Create a context object by providing the root of a Kedro project and
the environment configuration subfolders (see ``kedro.config.OmegaConfigLoader``)
Raises:
KedroContextError: If there is a mismatch
between Kedro project version and package version.
Args:
project_path: Project ... | Review this code and list any quality issues. | [
{
"issue": "This should still be pre-fixed by the underscore to be consistent with the other arguments.",
"severity": "minor",
"line": 26
}
] | 1 |
python | video_url = traverse_obj(video_data, ('video', 'meta', 'mp4_url'), 'mp4_url')
if video_url:
resolutions = {'1080': '1920', '720': '1280', '540': '960', '360': '640', '234': '416'}
height = url_basename(video_url).split('-')[1].split('p')[0]
formats.append({
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'description': traverse_obj(video_data, 'summary', 'excerpt', 'video_hero_text'),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from_connection.addnode(node=ip_port, command="onetry", v2transport=peer_advertises_v2)
else:
# skip the optional third argument if it matches the default, for
# compatibility with older clients
from_connection.addnode(ip_port, "onetry")
if not wait_for_connect:
... | Review this code and list any quality issues. | [
{
"issue": "nit: \r\n`check it by waiting for a ping`\r\nThe code waits for successful pongs rather than pings.",
"severity": "minor",
"line": 26
}
] | 1 |
python | for param in sig.parameters.values(): # type: ignore
if param.kind == param.VAR_KEYWORD:
call_kwargs.update(kwargs)
break
try:
# Check if it's an async generator function
if isasyncgenfunction(func):
# For async generators, ca... | Review this code and list any quality issues. | [
{
"issue": "`_aload_or_create_session` to denote it's async? not sure if we follow that convention in the Workflow files",
"severity": "minor",
"line": 26
}
] | 1 |
python | post_data, [('creator', 'urlname')], f'{base_url}/channel/%s/home') or None
common_info = {
'uploader_url': uploader_url,
'channel_url': urljoin(f'{uploader_url}/', traverse_obj(post_data, ('channel', 'urlname'))),
'availability': self._availability(needs_subscription=True),... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n f'{self._BASE_URL}/api/v2/cdn/delivery', media_id, query={\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | NiconicoPlaylistIE,
NiconicoUserIE,
NiconicoSeriesIE,
NiconicoHistoryIE,
NicovideoSearchDateIE,
NicovideoSearchIE,
NicovideoSearchURLIE,
NicovideoTagURLIE,
)
from .ninecninemedia import (
NineCNineMediaIE,
CPTwentyFourIE,
)
from .ninegag import NineGagIE
from .ninenow import NineNowI... | Review this code and list any quality issues. | [] | 0 |
python | #!/usr/bin/env python3
# Copyright (c) The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.
import os
import shlex
import subprocess
import sys
def run(cmd, **kwargs):
print("+ " + shlex.join(cmd), flush=True)
tr... | Review this code and list any quality issues. | [
{
"issue": "Doing `os.environ['BASE_READ_ONLY_DIR']` would rather raise a `KeyError` and the failure pinpoints the source of failure better",
"severity": "critical",
"line": 26
}
] | 1 |
python | If the checkpoint name is not found.
"""
for key in self._tgt_keys:
self._tgt_buffer[key] = list(self._ckpt[ckpt_name]["_tgt_buffer"][key])
def reset_grad(self):
"""
Clear all stored gradient-related buffers.
This resets the target buffer and clears any queried... | Review this code and list any quality issues. | [] | 0 |
python | # Ensure all fields in input_schema and output_schema are annotated SchemaFields
for field_name, field in [*input_schema.items(), *output_schema.items()]:
if field.annotation is None:
raise ValueError(
f"{block.name} has a field {field_name} that is not annotated"... | Review this code and list any quality issues. | [
{
"issue": "nit: inverted logic is a bit confusing, also it's simpler\r\n\r\n```\r\nif is_....:\r\n filtered_blocks[block_id] = block_cls\r\nelse:\r\n logger.error(...\r\n```\r\n\r\nthe continue is not even needed",
"severity": "minor",
"line": 26
}
] | 1 |
python | async def _token_request(self, data: dict) -> dict:
"""Make a token request.
Raises OAuth2TokenRequestError on token request failure.
"""
session = async_get_clientsession(self.hass)
data["client_id"] = self.client_id
if self.client_secret:
data["client_secr... | Review this code and list any quality issues. | [
{
"issue": "The empty except block silently suppresses exceptions without any logging. Consider at least logging that an error occurred when attempting to retrieve the response text for debugging purposes.\n```suggestion\n except (ClientError, UnicodeDecodeError) as err:\n _LOG... | 1 |
python | from __future__ import annotations
from manim import *
from manim.utils.testing.frames_comparison import frames_comparison
__module_test__ = "mobjects"
@frames_comparison(base_scene=ThreeDScene)
def test_PointCloudDot(scene):
p = PointCloudDot()
scene.add(p)
@frames_comparison
def test_become(scene):
... | Review this code and list any quality issues. | [] | 0 |
python | from __future__ import annotations
from typing import TYPE_CHECKING, overload
from sympy.core import S, Add, Expr, Basic, Mul, Pow, Rational
from sympy.core.logic import fuzzy_not
from sympy.assumptions import ask, Q # type: ignore
if TYPE_CHECKING:
from sympy.logic.boolalg import Boolean
from typing impor... | Review this code and list any quality issues. | [
{
"issue": "Removing this newline isn't needed",
"severity": "minor",
"line": 10
}
] | 1 |
python | video_id = f'{channel_id}-{short_id}'
webpage = self._download_webpage(url, video_id)
# Format: "TITLE — Подкаст «CHANNEL»"
page_title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')
match = re.search(r'^(.+?)\s*—\s*(.+?)«(.+?)»', page_title)
title = match.... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _API_BASE_URL = 'https://api.mave.digital/'\r\n\r\n def _real_extract(self, url):\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | assert cp is not a
cp.v[...] = 0.0
assert np.allclose(a.v, [1.0, 2.0, 3.0])
assert np.allclose(cp.v, [0.0, 0.0, 0.0])
# repr and tensor conversion
assert "Vec3(" in repr(a)
t = a.as_tensor()
assert isinstance(t, torch.Tensor)
assert t.dtype == torch.float32
assert np.allclose(t.cpu(... | Review this code and list any quality issues. | [
{
"issue": "`assert_allclose((q.w, q.x, q.y, q.z), (1, 0, 0, 0))`",
"severity": "minor",
"line": 26
}
] | 1 |
python | class StackListBuilds(Subcommand):
"""List available distributions (both built-in and custom)"""
def __init__(self, subparsers: argparse._SubParsersAction):
super().__init__()
self.parser = subparsers.add_parser(
"list",
prog="llama stack list",
description="... | Review this code and list any quality issues. | [] | 0 |
python | weight_type: {``"square"``, ``"simple"``, ``"uniform"``}. Type of function to transform
ground truth volume into a weight factor. Defaults to ``"square"``.
Raises:
ValueError: When the `reduction` is not one of MetricReduction enum.
"""
@deprecated_arg_default(
"reduction",
... | Review this code and list any quality issues. | [
{
"issue": "SUM_CHANNEL should also be considered here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | if subentry.subentry_type == SUBENTRY_TYPE_SWITCHABLE_OUTPUT
]
monitored_outputs = outputs + switchable_outputs
controller = AsyncSatel(host, port, hass.loop, zones, monitored_outputs, partitions)
result = await controller.connect()
if not result:
raise ConfigEntryNotReady("Controller fa... | Review this code and list any quality issues. | [
{
"issue": "If you omit the name, it will use the entry title",
"severity": "minor",
"line": 26
}
] | 1 |
python | - network_mode (str): Network mode (e.g., "host")
- command (str/list): Override default container command
- remove (bool): Auto-remove container after exit (default: True)
- exit_on_error (bool): If True (default), raises RuntimeError when Qdrant fails to start.
I... | Review this code and list any quality issues. | [] | 0 |
python | 'title': 'Lau Lại Đầu Từ',
'description': 'Cùng xem xưa và nay có gì khác biệt nhé!',
'thumbnail': r're:^https?://kenh14cdn\.com/.*\.png$',
},
'playlist_count': 6,
}]
def _real_extract(self, url):
playlist_id = self._match_id(url)
webpage = self._download... | Review this code and list any quality issues. | [
{
"issue": "merge master again, import `update_url` from utils:\r\n```suggestion\r\n ({url_or_none}, {(update_url(query=None)})))\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Since you can't own fractional shares (at least in this
# example), we want to make sure that our target amount is
# no more than a share's value away from our current
# holdings.
target_value = self.portfolio.portfolio_value * 0.002
position_value = self.po... | Review this code and list any quality issues. | [
{
"issue": "Do we want a test for actually ordering more than one asset at a time?",
"severity": "minor",
"line": 26
}
] | 1 |
python | with socket.create_connection((dest["actual_to_addr"], dest["actual_to_port"])) as conn_to:
forward_sockets(self.conn, conn_to)
else:
logger.debug(f"Can't serve the connection to {requested_to}: the destinations factory returned None")
else:
... | Review this code and list any quality issues. | [
{
"issue": "I checked that this works as expected - without it some ports are below `49152` and with it the selected ports are above (for a couple of dozen tries).\n\nThis covers only the port for the Socks5 server itself, but not ports used by the P2P listeners, created with `network_event_loop.create_server()... | 1 |
python | }
}, {
'url': 'https://www.harpodeon.com/preview/Behind_the_Screen/421838710',
'md5': '7979df9ca04637282cb7d172ab3a9c3b',
'info_dict': {
'id': '421838710',
'ext': 'mp4',
'title': 'Behind the Screen',
'description': 'A woman tries to break into ... | Review this code and list any quality issues. | [
{
"issue": "clean this up similar to above suggestions",
"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.