language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | tdobj = tm.box_expected(tdinat, box_with_array)
ts = Timestamp(str_ts)
ts_variants = [
ts,
ts.to_pydatetime(),
ts.to_datetime64().astype("datetime64[ns]"),
ts.to_datetime64().astype("datetime64[D]"),
]
for variant in ts_variants:
... | Review this code and list any quality issues. | [
{
"issue": "You can keep those if you make the timestamp(or timedelta) ns with adding a `.as_unit(\"ns\")` ?",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert (prepare_object_to_dump(CustomClass(
1, "b")) == "CustomClass(a=1, b='b')")
def test_request_logger_log_outputs():
"""Test the new log_outputs functionality."""
# Create a mock logger to capture log calls
mock_logger = MagicMock()
with patch("vllm.entrypoints.logger.logger", mock_logge... | Review this code and list any quality issues. | [
{
"issue": "Please remove the commented-out code",
"severity": "minor",
"line": 26
}
] | 1 |
python | if not capa.ghidra.helpers.is_supported_ghidra_version():
logger.error("unsupported Ghidra version")
return capa.main.E_UNSUPPORTED_GHIDRA_VERSION
if not capa.ghidra.helpers.is_supported_file_type():
logger.error("unsupported file type")
return capa.main.E_INVALID_FILE_TYPE
if ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n popup(\"capa explorer analysis complete.\\nPlease see results in the Bookmarks Window and Namespaces section of the Symbol Tree Window.\") # type: ignore [name-defined] # noqa: F821\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # 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, software
# distributed under the Li... | Review this code and list any quality issues. | [
{
"issue": "I would suggest changing the name of `NewIgniteInfo` to `_IgniteInfo`. Not a blocker though.",
"severity": "minor",
"line": 26
}
] | 1 |
python | def test_process_fast_forward_spends_nothing_to_do() -> None:
"""
This tests the case when we don't have an eligible coin, so there is
nothing to fast forward and the item remains unchanged
"""
sk = AugSchemeMPL.key_gen(b"b" * 32)
g1 = sk.get_g1()
sig = AugSchemeMPL.sign(sk, b"foobar", g1)
... | Review this code and list any quality issues. | [
{
"issue": "I would expect this test to still have the same behavior. Removing it looks a bit suspicious, as if we expect different behavior now. Does this test fail with your changes?",
"severity": "critical",
"line": 26
}
] | 1 |
python | 'episode_number': 2,
'series': 'poker after dark',
'upload_date': '20201216',
'season': 'Season 12',
'episode': 'Episode 2'
},
'params': {'skip_download': True}
}]
def _real_extract(self, url):
id = self._match_id(url)
data_json = ... | Review this code and list any quality issues. | [
{
"issue": "This should be display_id. Don't pass `id` to inner extractor if it will be different at the end",
"severity": "major",
"line": 26
}
] | 1 |
python | def set_aspect(self, aspect, adjustable=None, anchor=None):
"""
Set the aspect ratios.
Parameters
----------
aspect : {'auto', 'equal', 'equalxy', 'equalxz', 'equalyz'}
Possible values:
========= ==================================================
... | Review this code and list any quality issues. | [
{
"issue": "You can't reference parameters.\r\n```suggestion\r\n The *anchor* parameter is not used for 3D axes and will be\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def _validate_head_node_resources_for_local_scheduling(
ray_remote_args: Dict[str, Any],
*,
op_name: str,
required_num_cpus: int = 1,
required_num_gpus: int = 0,
required_memory: int = 0,
) -> None:
"""Ensure the head node has enough resources before pinning work there.
Local paths (``l... | Review this code and list any quality issues. | [
{
"issue": "thinking about this more, are these `if num_cpus > 0` checks necessary? I think if they are 0, then we should catch it when building the insufficient dict (since we default to 0)",
"severity": "minor",
"line": 26
}
] | 1 |
python | return [{'label': theme, 'kind': 13, 'sort_text': '0'} for theme in themes]
elif completion_type == 'icons':
return [{'label': icon, 'kind': 13, 'sort_text': '0'} for icon in fluent_icons]
'''
js_code = ''
with open(os.path.join(example_dir, 'tour.js'), 'r') as f:
js_code = f.read()
... | Review this code and list any quality issues. | [
{
"issue": "No need for being explicit.\r\n\r\n```suggestion\r\n ui.zone('main', zones=[\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'url': 'https://sketch.pixiv.net/@namahyou',
'only_matching': True,
}, {
'url': 'https://sketch.pixiv.net/@8aki',
'only_matching': True,
}]
@classmethod
def suitable(cls, url):
return super(PixivSketchUserIE, cls).suitable(url) and not PixivSketchIE.suitable(url)
de... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n try:\r\n self._call_api(user_id, 'users/current.json', url, 'Investigating reason for request failure')\r\n except ExtractorError as ex:\r\n if ex.cause and ex.cause.code == 401:\r\n raise ExtractorError(f'Pleas... | 1 |
python | np.ndarray: An array of floats containing the area of each detection
in the format of `(area_1, area_2, , area_n)`,
where n is the number of detections.
"""
if self.mask is not None:
return np.array([np.sum(mask) for mask in self.mask])
else:
retur... | Review this code and list any quality issues. | [
{
"issue": "Thanks for noticing the lack of description. I would replace it with something more precise. \r\n\r\nPerforms non-max suppression on detection set. If the detections result from a segmentation model, the IoU mask is applied. Otherwise, box IoU is used.",
"severity": "minor",
"line": 26
}
] | 1 |
python | vod_id = info.get('id') or item_id
# id backward compatibility for download archives
if vod_id[0] != 'v':
vod_id = 'v%s' % vod_id
thumbnail = url_or_none(info.get('previewThumbnailURL'))
if thumbnail:
for p in ('width', 'height'):
thumbnail = thumb... | Review this code and list any quality issues. | [
{
"issue": "int_or_none has a scale parameter",
"severity": "minor",
"line": 26
}
] | 1 |
python | x, y = batch
x = x.view(x.size(0), -1)
if dp:
with torch.no_grad():
output = trained_model(batch, 0)
acc = output["val_acc"]
acc = torch.mean(acc).item()
else:
with torch.no_grad():
y_hat = trained_model(x)
y_hat = y_hat.cpu()
# acc
... | Review this code and list any quality issues. | [
{
"issue": "this makes the simple model complicated, lest move all these to another model",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'url': 'https://www.filmarchiv.at/de/filmarchiv-on/video/f_0306vI3wO0tJIsfrqYFQXF',
'md5': '595385d7f54cb6529140ee8de7d1c3c7',
'info_dict': {
'id': 'f_0306vI3wO0tJIsfrqYFQXF',
'ext': 'mp4',
'title': 'Vor 70 Jahren: Wettgehen der Briefträger in Wien',
'desc... | Review this code and list any quality issues. | [
{
"issue": "can we simplify these regex patterns? it will make this much more readable and compact enough to actually inline in the return now\r\n```suggestion\r\n description = traverse_obj(webpage, (\r\n {find_elements(tag='div', attr='class', value=r'.*\\bborder-base-content\\b', regex=True... | 1 |
python | 'webpage_url': webpage_url,
}
class NiconicoPlaylistBaseIE(InfoExtractor):
_PAGE_SIZE = 100
_API_HEADERS = {
'X-Frontend-ID': '6',
'X-Frontend-Version': '0',
'X-Niconico-Language': 'en-us'
}
def _call_api(self, list_id, resource, query):
"Implement this in chi... | Review this code and list any quality issues. | [
{
"issue": "Isn't this better?\r\n```suggestion\r\n if owner and (owner.get('id') or owner.get('name')):\r\n return {\r\n 'uploader': owner.get('name'),\r\n 'uploader_id': owner.get('id'),\r\n }\r\n return {}\r\n```",
"severity": "minor",
... | 1 |
python | return {"context_length": worker.context_len}
def create_model_worker():
parser = argparse.ArgumentParser()
parser.add_argument("--host", type=str, default="localhost")
parser.add_argument("--port", type=int, default=21002)
parser.add_argument("--worker-address", type=str, default="http://localhost:21... | Review this code and list any quality issues. | [
{
"issue": "1. Read all of these from `supported_models.json`.\r\n2. You should be able to support multiple models listed in `supported_models.json`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | issue_number=42,
title='Handle review comments',
)
request = AppConversationStartRequest(suggested_task=suggested_task)
self.service._apply_suggested_task(request)
assert request.initial_message is not None
assert (
request.initial_message.content[0].tex... | Review this code and list any quality issues. | [
{
"issue": "🟡 Suggestion: Move this import to the top of the file with other imports. Per the project's code quality guidelines, all imports should be at the module level unless there's a specific technical reason (circular imports, conditional imports, etc.).",
"severity": "major",
"line": 26
}
] | 1 |
python | data = {
'password': password,
'grant_type': 'password',
'username': username,
}
if self.get_param('twofactor'):
data['tfa_token'] = self.get_param('twofactor')
def _call_login():
return self._download_json(
self._OAUTH... | Review this code and list any quality issues. | [
{
"issue": "IMO we should raise here\r\n```suggestion\r\n raise ExtractorError(\r\n f'API returned error {': '.join(traverse_obj(response, ((\"error\", \"error_description\"), {str})))}')\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | if v.get('bandwidth'):
format.update({'tbr': v['bandwidth'] / 1000})
if v.get('duration'):
format.update({'filesize_approx': v['bandwidth'] * v['duration'] / 8000})
if v.get('codec'):
format.update(parse_codecs(v['codec']))
if v... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n display_id, video_id = self._match_valid_url(url).groups()\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
await coordinator.async_refresh()
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
webhook_unregister(hass, entry.data[CONF_WEBHOOK_ID])
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if ... | Review this code and list any quality issues. | [
{
"issue": "`except json.decoder.JSONDecodeError, UnicodeDecodeError:` is invalid Python 3 syntax. Use `except (json.decoder.JSONDecodeError, UnicodeDecodeError):`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | except Exception as e:
logger.error(f"Failed to generate LLM continuation: {e}", exc_info=True)
def _log_api_error(
error: Exception,
session_id: str | None = None,
message_count: int | None = None,
model: str | None = None,
retry_count: int = 0,
) -> None:
"""Log detailed API error in... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n if isinstance(error, RateLimitError):\n logger.warning(f\"Rate limit error: {details}\", exc_info=error)\n elif isinstance(error, APIConnectionError):\n logger.warning(f\"API connection error: {details}\", exc_info=error)\n elif isinstance(error, APIStatusError... | 1 |
python | scene.build()
cam1.read()
cam2.read()
shared_metadata = cam1._shared_metadata
assert cam1._shared_metadata is cam2._shared_metadata
assert len(shared_metadata.sensors) == 2
assert shared_metadata.renderer is not None
scene.destroy()
assert shared_metadata.sensors is None
assert sh... | Review this code and list any quality issues. | [
{
"issue": "Could you check consistency with other camera explicitly? That would be much better.",
"severity": "minor",
"line": 26
}
] | 1 |
python | ],
)
# set or append a message returning its index in the list
def set_message(state: State, message: str, idx: t.Optional[int] = None):
if idx is not None and idx < len(state.messages):
msg = state.messages[idx]
state.messages[idx] = (msg[0], message, msg[2])
else:
idx = l... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n# Invoke the Wikipedia API. This is invoked by send_message()\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'skip_download': True,
},
}]
_DOMAIN = 'skyarte'
_VIDEO_ID_REGEX = r'"embedUrl"\s*:\s*"(?:https:)?//player\.sky\.it/player/external\.html\?[^"]*\bid=(\d+)'
class CieloTVItIE(SkyItIE):
IE_NAME = 'cielotv.it'
_VALID_URL = r'https?://(?:www\.)?cielotv\.it/video/(?P<id>[^.]+)\.html'
_TESTS... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'params': {'skip_download': 'm3u8'},\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'format': format_names.get(video.get('id')),
} for video in traverse_obj(play_info, ('dash', 'video', ...)))
if formats:
self.check_missing_formats(play_info, formats)
fragments = traverse_obj(play_info, ('durl', lambda _, v: url_or_none(v['url']), {
'url': ('url', {url... | Review this code and list any quality issues. | [
{
"issue": "To set a proper height, we can use `parse_resolution` from `..utils`:\r\n```suggestion\r\n 'duration': ('timelength', {lambda x: float_or_none(x, scale=1000)}),\r\n }),\r\n **parse_resolution(format_names.get(play_info.get('quality'))),\r\n```",
"... | 1 |
python | from .common import InfoExtractor
from ..utils import parse_iso8601, traverse_obj, try_call, str_or_none, float_or_none, json
class PrankCastIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?prankcast\.com/[^/?#]+/showreel/(?P<id>\d+)-(?P<display_id>[^/?#]+)'
_TESTS = [{
'url': 'https://prankcast.c... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\nimport json\r\n\r\nfrom .common import InfoExtractor\r\n```",
"severity": "major",
"line": 3
}
] | 1 |
python | data={"user_count": 5, "spawn_rate": 5},
)
self.assertEqual(200, response.status_code)
self.assertEqual(None, response.json()["host"])
self.assertEqual(self.environment.host, None)
def test_swarm_run_time(self):
class MyUser(User):
wait_time = constant(1)
... | Review this code and list any quality issues. | [
{
"issue": "Our tests are already a little slow - can you trim it down to maybe 3s?",
"severity": "major",
"line": 26
}
] | 1 |
python | # Copyright (c) MONAI Consortium
# 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, so... | Review this code and list any quality issues. | [] | 0 |
python | breaks_in_ha_version="2026.8",
core_behavior=ReportBehavior.LOG,
integration_domain=self._domain,
)
if err.status == HTTPStatus.TOO_MANY_REQUESTS or 500 <= err.status <= 599:
# Recoverable error
raise OAuth2RefreshTokenTransientErr... | Review this code and list any quality issues. | [
{
"issue": "I think we should consider moving the exception handling to `_token_request` instead. It's closer to the source of the aiohttp call in `_token_request`. If we move it there, we need to update `async_step_creation` to handle the new exceptions instead of aiohttp exceptions.\n\nA benefit of moving it ... | 1 |
python | # getreceivedbylabel should return updated receive total
balance = self.nodes[1].getreceivedbylabel(label)
assert_equal(balance, balance_by_label + Decimal("0.1"))
# Create a new label named "mynewlabel" that has a 0 balance
address = self.nodes[1].getnewaddress()
self.nodes[1].... | Review this code and list any quality issues. | [
{
"issue": "I don't see much value in this, instead of hardcoding the reward you are hardcoding the halving interval while adding 3 LOC that don't contribute anything to the actual test.",
"severity": "minor",
"line": 26
}
] | 1 |
python | from __future__ import annotations
import json
from dataclasses import dataclass
from openhands.core.config.openhands_config import OpenHandsConfig
from openhands.storage import get_file_store
from openhands.storage.data_models.settings import Settings
from openhands.storage.files import FileStore
from openhands.stor... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # Turn on V1 in OpenHands\r\n```",
"severity": "minor",
"line": 25
}
] | 1 |
python | from ..configuration_utils import ConfigMixin, register_to_config
from .scheduling_dpmsolver_sde import BrownianTreeNoiseSampler
from .scheduling_utils import SchedulerMixin, SchedulerOutput
class CosineDPMSolverMultistepScheduler(SchedulerMixin, ConfigMixin):
"""
Implements a variant of `DPMSolverMultistepSc... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n schedule was incorporated in [stabilityai/cosxl](https://huggingface.co/stabilityai/cosxl). The Karras schedule is\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | log_to = subprocess.DEVNULL
generated_file_labels = subprocess.check_output(
[bazel, "query", "--keep_going", "--output=label", kinds_query],
stderr=log_to,
encoding="utf-8",
).splitlines()
print(f"Found {len(generated_file_labels)} generated files...")
# Directly build these la... | Review this code and list any quality issues. | [
{
"issue": "I would skip the commented out bit, and the default is already provided by this action from my understanding.\r\n\r\n```suggestion\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def __enter__(self):
self._gui.__enter__()
return self
def __exit__(self, exc_type, exc_value, traceback):
return self._gui.__exit__(exc_type, exc_value, traceback)
def set_favicon(self, favicon_path: t.Union[str, Path]):
"""Change the favicon for the client of this state.
... | Review this code and list any quality issues. | [
{
"issue": "Whether ` __getitem__()` is abstract (then you don't want the default implementation),\r\nor it is not (then you don't want the `@abstractmethod` decorator)\r\n.",
"severity": "major",
"line": 26
}
] | 1 |
python | -------
rolls - list[tuple(sid, roll_date)]
A list of rolls, where first value is the first active `sid`,
and the `roll_date` on which to hop to the next contract.
The last pair in the chain has a value of `None` since the roll
is after the range.
"""
... | Review this code and list any quality issues. | [
{
"issue": "Super nitpicky, but can we add a newline for legibility here, to separate out the \"initialization\" from the loop?",
"severity": "minor",
"line": 26
}
] | 1 |
python | # This example shows how to use vector config to use QDRANT CLOUD
import os
from dotenv import load_dotenv
from mem0 import Memory
# Loading my API_KEY for OPENAI
load_dotenv()
OPENAI_API_KEY = os.environ.get('OPENAI_API_KEY')
USER_ID = "rajib"
os.environ['OPENAI_API_KEY'] = OPENAI_API_KEY
# creating the config attri... | Review this code and list any quality issues. | [
{
"issue": "Also here you do replace URL with `qdrant_host`",
"severity": "minor",
"line": 15
}
] | 1 |
python | }, {
'url': 'https://videos.cncf.io/topic/kubernetes/video/YAM2d7yTrrI',
'only_matching': True,
}, {
'url': 'https://videos.icts.res.in/video/d7HuP_abpKU',
'only_matching': True,
}]
def _real_extract(self, url):
hostname, video_id = self._match_valid_url(url).group('... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n ie_key = SlidesLiveIE\r\n```\r\nis better imo",
"severity": "minor",
"line": 26
}
] | 1 |
python | ):
SeederBase.__init__(self, types)
self.key_target = key_target
self.data_size = data_size
if collection_size is None:
self.collection_size = math.ceil(data_size ** (1 / 3))
else:
self.collection_size = collection_size
self.huge_value_target = hu... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if seed is not None:\r\n self.seed = seed\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | urlencode_postdata,
)
_ENCODING_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'
def _pk_to_id(media_id):
"""Source: https://stackoverflow.com/questions/24437823/getting-instagram-post-url-from-media-id"""
pk = int(str(media_id).split('_')[0])
return encode_base_n(pk, table=_ENC... | Review this code and list any quality issues. | [
{
"issue": "I'd prefer to do this, and then remove all the `()`s below\r\n```suggestion\r\n @property\r\n def _api_headers(self):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'title': 'ef - a tale of memories Original Soundtrack 2 ~fortissimo~',
'release_year': 2008,
'thumbnail': 'https://www.musicdex.org/storage/album/2rSHkyYBYfB7sbvElpEyTMcUn6toY7AohOgJuDlE.jpg',
},
}]
def _real_extract(self, url):
id = self._match_id(url)
data_json... | Review this code and list any quality issues. | [
{
"issue": "can't this be:\r\n```suggestion\r\nclass MusicdexPageIE(MusicdexBaseIE):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.model_settings = model_settings
self._output_type = output_type
self.instrument = instrument
self._deps_type = deps_type
if mcp_servers := _deprecated_kwargs.pop('mcp_servers', None):
if toolsets is not None: # pragma: no cover
raise TypeError('`mcp_se... | Review this code and list any quality issues. | [
{
"issue": "We can simplify this a bit by dropping this variable as well",
"severity": "major",
"line": 26
}
] | 1 |
python | return positioned_label
def get_axis_labels(
self,
x_label: float | str | Mobject = "x",
y_label: float | str | Mobject = "y",
z_label: float | str | Mobject = "z",
) -> VGroup:
"""Defines labels for the x_axis and y_axis of the graph.
For increased control over... | Review this code and list any quality issues. | [
{
"issue": "The Oxford comma is debatable, but the spelling of VGroup should definitely be corrected :-)\r\n\r\n```suggestion\r\n A :class:`~.VGroup` of the labels for the x_axis, y_axis, and z_axis.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | for file in chapter_files:
if session['cancellation_requested']:
msg = 'Cancel requested'
print(msg)
return None
path = os.path.join(session['chapters_dir'], file).repl... | Review this code and list any quality issues. | [
{
"issue": "Calling assemble_audio_chunks_worker without the required progress_queue and job_id parameters. These should be passed explicitly as None to match the function signature and avoid confusion.",
"severity": "minor",
"line": 26
}
] | 1 |
python | key_points = []
for index, response in enumerate(map_responses):
if not isinstance(response.response, list):
continue
for element in response.response:
if not isinstance(element, dict):
continue
... | Review this code and list any quality issues. | [
{
"issue": "Is it possible to return a suggestion on how to improve results alongside \"I do not know\"?",
"severity": "minor",
"line": 26
}
] | 1 |
python | class LateralLagEstimator:
inputs = {"carControl", "carState", "controlsState", "liveCalibration", "livePose"}
def __init__(self, CP: car.CarParams, dt: float,
block_count: int = BLOCK_NUM, min_valid_block_count: int = BLOCK_NUM_NEEDED, block_size: int = BLOCK_SIZE,
window_sec: float ... | Review this code and list any quality issues. | [
{
"issue": "I would pass it from the outside (with some more generic name `publish_estimate` / `use_estimate` / `..enabled` etc.), so it's consistent with initial lag param restoration.",
"severity": "minor",
"line": 26
}
] | 1 |
python | """This module provides metadata for a Kedro project."""
from __future__ import annotations
import os
import sys
from pathlib import Path
from typing import NamedTuple
if sys.version_info >= (3, 11):
import tomllib
else:
import tomli as tomllib
from kedro import __version__ as kedro_version
from kedro.frame... | Review this code and list any quality issues. | [
{
"issue": "Missing import for `sys` module. The code uses `sys.version_info` but `sys` is not imported.",
"severity": "minor",
"line": 10
}
] | 1 |
python | if not tags:
# use keywords and split with comma (not logged in)
kwds = self._html_search_meta('keywords', webpage, default=None)
if kwds:
tags = [x for x in kwds.split(',') if x]
if not tags:
# find in json (logged in)
... | Review this code and list any quality issues. | [
{
"issue": "That was a really good job to support multiple thumbnails. Thanks @Lesmiscore",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.data = [json.loads(lines[index].strip()) for index in indices[start_index:end_index]]
def __len__(self):
return len(self.data)
def __getitem__(self, index):
# Sample randomly from replies
prompt = self.data[index]["prompt"]
pairs = []
while True:
asse... | Review this code and list any quality issues. | [] | 0 |
python | def _real_extract(self, url):
uploader, room_id = self._match_valid_url(url).group('uploader', 'id')
webpage = self._download_webpage(
url, uploader or room_id, headers={'User-Agent': 'Mozilla/5.0'}, fatal=not room_id)
if webpage:
data = try_call(lambda: self._get_sigi_s... | Review this code and list any quality issues. | [
{
"issue": "revert unnecessary/unrelated formatting change\r\n```suggestion\r\n 'stream_url', 'live_core_sdk_data', 'pull_data', 'stream_data',\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | data=data, headers=headers, query=query, fatal=fatal)
def _call_encrypted_api(self, video_id, param='', msg='API', data={}, query={}, fatal=True):
if not Cryptodome.RSA:
raise ExtractorError('pycryptodomex not found. Please install', expected=True)
private_key = Cryptodome.RSA.generate(... | Review this code and list any quality issues. | [
{
"issue": "revert. this would change the message for wrestleuniverse as well, and 'metadata' is just as accurate, no?\r\n```suggestion\r\n metadata = self._call_api(video_id, msg='metadata', query={'al': lang or 'ja'}, auth=False, fatal=False)\r\n```",
"severity": "critical",
"line": 26
}
] | 1 |
python | # device, so the maximum number of devices supported at the same time is 18.
# On aarch64, IRQs are available from 32 to 127. We always use one IRQ each for
# the VMGenID and RTC devices, so the maximum number of devices supported
# at the same time is 94.
MAX_DEVICES_ATTACHED = {"x86_64": 18, "aarch64": 94}.get(platf... | Review this code and list any quality issues. | [] | 0 |
python | )
await hass.async_block_till_done()
assert result["type"] is FlowResultType.ABORT
assert result["reason"] == "reauth_successful"
assert hass.config_entries.async_entries(DOMAIN)[0].data == {"api_key": "1234"}
assert len(mock_unload_entry.mock_calls) == 1
assert len(mock_setup_entry.mock_ca... | Review this code and list any quality issues. | [
{
"issue": "The parameter type hints for `current_llm_apis` and `suggested_llm_apis` declare `list[str]`, but some of the parametrized values are plain strings (for example `\"assist\"` and `\"non-existent\"`), which makes the annotations inaccurate and can confuse static type checkers. Please update these anno... | 1 |
python | datamodule: Optional[LightningDataModule] = None,
return_predictions: Optional[bool] = None,
ckpt_path: Optional[_PATH] = None,
) -> Optional[_PREDICT_OUTPUT]:
r"""Run inference on your data. This will call the model forward function to compute predictions. Useful to
perform distribu... | Review this code and list any quality issues. | [] | 0 |
python | Determines whether a tip is added to the end of the line.
tip_width : :class:`float`
The width of the tip.
tip_height : :class:`float`
The height of the tip.
include_numbers : :class:`bool`
Determines whether numbers are added to tick marks. The number of decimal places is determined... | Review this code and list any quality issues. | [
{
"issue": "This should make the docs render. \r\n```suggestion\r\n :save_last_frame:\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | context: Context,
name: Path | None = None,
source: dict | None = None,
):
global shader_program_cache
self.context = context
self.name = name
# See if the program is cached.
if (
self.name in shader_program_cache
and shader_program_ca... | Review this code and list any quality issues. | [
{
"issue": "In this case, rather than making an assertion, the code should raise an exception if both `name` and `source` happen to be `None`, like `FullScreenQuad` already does. To do so, instead of the assertion, use the `else` clause to test whether `name is not None`.\r\n\r\nI suggest referencing `self.sour... | 1 |
python | Events, _ = optional_import("ignite.engine", IgniteInfo.OPT_IMPORT_VERSION, min_version, "Events")
if TYPE_CHECKING:
from ignite.engine import Engine
else:
Engine, _ = optional_import("ignite.engine", IgniteInfo.OPT_IMPORT_VERSION, min_version, "Engine")
class ValidationHandler:
"""
Attach validator t... | Review this code and list any quality issues. | [
{
"issue": "Thanks @Nic-Ma for the PR.\r\n\r\nHow do we get these metrics? Now `workflow.evaluator.get_stats()` will only give the best metrics right?",
"severity": "minor",
"line": 26
}
] | 1 |
python | hass.http.register_redirect("/shopping-list", "/todo")
# Developer tools moved to config panel in 2026.2
hass.http.register_redirect("/developer-tools", "/config/developer-tools")
hass.http.register_redirect("/developer-tools/yaml", "/config/developer-tools/yaml")
hass.http.register_redirect(
"... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n for url in (\n \"/developer-tools\",\n \"/developer-tools/yaml\",\n \"/developer-tools/state\",\n \"/developer-tools/action\",\n \"/developer-tools/template\",\n \"/developer-tools/event\",\n \"/developer-tools/statistics\",\n ... | 1 |
python | import sys
from oasst_shared import model_configs
from settings import settings
if __name__ == "__main__":
model_config = model_configs.MODEL_CONFIGS.get(settings.model_config_name)
if model_config is None:
print(f"Unknown model config name: {settings.model_config_name}")
sys.exit(2)
prop ... | Review this code and list any quality issues. | [
{
"issue": "maybe add `len(sys.argv) > 1` check (since everything else is here handled gracefully)",
"severity": "minor",
"line": 14
}
] | 1 |
python | # TODO Here you can use the new registration method to support dynamic registration of roles
if config.reward_model.enable_resource_pool:
if config.reward_model.n_gpus_per_node <= 0:
raise ValueError("config.reward_model.n_gpus_per_node must be greater than 0")
if config.... | Review this code and list any quality issues. | [] | 0 |
python | .. manim:: LaggedStartMapExample
class LaggedStartMapExample(Scene):
def construct(self):
title = Tex("LaggedStartMap").to_edge(UP, buff=LARGE_BUFF)
dots = VGroup(
*[Dot(radius=0.16) for _ in range(35)]
).arrange_in_grid(rows=5... | Review this code and list any quality issues. | [
{
"issue": "The docstring contains an example where `arg_creator` returns a tuple of arguments `(m.set_color, YELLOW)`, contradicting the typehint which was written here before. The return type should actually be `Iterable[Any]`, which makes more sense: this function creates the positional arguments which will ... | 1 |
python | notification_list = traverse_obj(
response, ('actions', 0, 'openPopupAction', 'popup', 'multiPageMenuRenderer', 'sections', 0, 'multiPageMenuNotificationSectionRenderer', 'items'), expected_type=list)
if not notification_list:
notification_list = traverse_obj(
response, (... | Review this code and list any quality issues. | [
{
"issue": "there's also `_get_text` that's similar to traverse_obj but handles youtube's simpletext/runs",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert_equal(block_template_sigops, [0, 4, 4, 4])
# Clear mempool
self.generate(self.wallet, 1, sync_fun=self.no_op)
def test_blockmintxfee_parameter(self):
self.log.info("Test -blockmintxfee setting")
self.restart_node(0, extra_args=['-minrelaytxfee=0', '-persistmempool=0'])
... | Review this code and list any quality issues. | [
{
"issue": "In 47391e967e0b03946c44fb820f09ddab4d624123 \"[test] check miner doesn't select 0fee transactions\"\r\n\r\nI think this supposed to be checking `blockmintxfee_sat_kvb`, not `blockmintxfee_btc_kvb`. Currently it is checking whether the feerate in BTC/kvB is greater than 10 BTC/kvB, which none of the ... | 1 |
python | class CustomInventoryScript(CommonModelNameNotUnique):
class Meta:
app_label = 'main'
ordering = ('name',)
script = prevent_search(
models.TextField(
blank=True,
default='',
help_text=_('Inventory script contents'),
)
)
def get_absolu... | Review this code and list any quality issues. | [
{
"issue": "It'd be best if this wasn't happening during the import time but called in some predictable hook point, early in django's lifecycle.",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.close_movie_pipe()
def write_frame(self, frame_or_renderer):
"""
Used internally by Manim to write a frame to
the FFMPEG input buffer.
Parameters
----------
frame : np.array
Pixel array of the frame.
"""
if config.renderer == "opengl... | Review this code and list any quality issues. | [] | 0 |
python | summary_prompt = DEFAULT_GENERATOR_SUMMARY_PROMPT
provider_manager = ProviderManager()
provider_model_bundle = provider_manager.get_provider_model_bundle(
tenant_id, model_provider_name, ModelType.LLM
)
model_instance = ModelInstance(provider_model_bundle, model_name)
... | Review this code and list any quality issues. | [
{
"issue": "The KeyError exception handling at line 408 silently swallows errors if the default prompt doesn't have a {language} placeholder. This could mask issues if the DEFAULT_GENERATOR_SUMMARY_PROMPT is modified incorrectly in the future. Consider adding a log warning or assertion to ensure the default pro... | 1 |
python | Column,
DateColumn,
TitleColumn,
UsageCountColumn,
)
from wagtail.admin.utils import get_valid_next_url_from_request, set_query_params
from wagtail.admin.views import generic
from wagtail.images import get_image_model
from wagtail.images.exceptions import InvalidFilterSpecError
from wagtail.images.forms imp... | Review this code and list any quality issues. | [
{
"issue": "This should be put in the `BaseMediaFilterSet` so that it's shared with the `DocumentsFilterSet` as well",
"severity": "minor",
"line": 26
}
] | 1 |
python | # We could enforce triple quotes at this point.
quote = quote_char * quote_len
# It's invalid to put closing single-character quotes on a new line.
if quote_len == 3:
# We need to find the length of the last line of the docstring
# to find if we can a... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n and leaf.value[-1 - quote_len] == \"\\n\"\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | }
metadata_url = f'https://vcore-web.ivoox.com/v1/public/audios/{media_id}/download-url'
download_json = self._download_json(metadata_url, media_id, headers=headers)
download_url = download_json['data']['downloadUrl']
url = f'https://ivoox.com{download_url}'
# Formats
fo... | Review this code and list any quality issues. | [
{
"issue": "We can simplify this by making use of the nuxt data directly and using the `_search_json_ld` helper:\r\n```suggestion\r\n data = traverse_obj(self._search_nuxt_data(webpage, media_id), ('data', 'audio'))\r\n formats = []\r\n\r\n direct_download = self._download_json(\r\n ... | 1 |
python | from __future__ import annotations
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Any, AsyncContextManager
if TYPE_CHECKING:
from httpx import Response
from crawlee.base_storage_client._models import (
KeyValueStoreListKeysPage,
KeyValueStoreMetadata,
KeyValueSt... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n Raises:\r\n ValueError: If the key does not exist.\r\n \"\"\"\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | transformers.models.phi.modeling_phi._get_unpad_data = ( # pylint: disable=protected-access
get_unpad_data
)
elif model_type == "phi3":
transformers.models.phi3.modeling_phi3._get_unpad_data = ( # pylint: disable=protected-access
get_unpad_data
... | Review this code and list any quality issues. | [
{
"issue": "`_prepare_4d_causal_attention_mask` has never been used in the Llama's forward pass, this patch will not affect training",
"severity": "minor",
"line": 26
}
] | 1 |
python | def test_video_assets_list():
"""Test that VideoAssets.list() returns all video filenames."""
expected_filenames = [
"vehicles.mp4",
"milk-bottling-plant.mp4",
"vehicles-2.mp4",
"grocery-store.mp4",
"subway.mp4",
"market-square.mp4",
"people-walking.mp4",
... | Review this code and list any quality issues. | [] | 0 |
python | editor_id: Optional[str] = None,
timestamp: Optional[datetime] = None,
comment: Optional[str] = None,
**options: Dict[str, Any]):
"""Creates and adds a new entry in the edits attribute without writing the data.
Arguments:
job_id (Opti... | Review this code and list any quality issues. | [
{
"issue": "`type: ignore` should be banned :-)\r\nat least it should give a list of errors `type: ignore[...]`\r\nbut a cast would be better ifg t is a cast issue ;-)",
"severity": "minor",
"line": 26
}
] | 1 |
python | r'materials/([\da-zA-Z]{10}_[\da-fA-F]{7})/', v_url, 'video id', default=None)
process_video_files(deferred_json)
video_format = video_file.get('format') or determine_ext(v_url)
if video_format == 'm3u8':
formats.extend(self._extract_m3u8_formats(... | Review this code and list any quality issues. | [
{
"issue": "since `series` isn't used anywhere else anymore, we can inline in the return",
"severity": "minor",
"line": 26
}
] | 1 |
python | region=config.speech_region if is_given(config.speech_region) else None,
endpoint=config.speech_endpoint if is_given(config.speech_endpoint) else None,
host=config.speech_host if is_given(config.speech_host) else None,
auth_token=config.speech_auth_token if is_given(config.speech_auth_token) els... | Review this code and list any quality issues. | [
{
"issue": "nit:\r\n```suggestion\r\n if config.punctuation is False:\r\n```\r\n\r\nand according to https://learn.microsoft.com/en-us/azure/ai-services/speech-service/display-text-format?pivots=programming-language-python#punctuation, set it to `explicit` means the STT will recognize the explicitly read pun... | 1 |
python | }
command = sys.argv.pop(1) if len(sys.argv) > 1 else "help"
if command == "train" and (is_env_enabled("FORCE_TORCHRUN") or (get_device_count() > 1 and not use_ray())):
# launch distributed training
max_restarts = os.getenv("MAX_RESTARTS", "0")
rdzv_id = os.getenv("RDZV_ID")
nno... | Review this code and list any quality issues. | [
{
"issue": "Thanks for this new feature! Can we remove the `can_resume_from_checkpoint` flag? Because in most cases, we can resume from the checkpoint.",
"severity": "minor",
"line": 26
}
] | 1 |
python | MouseEvent("button_release_event", fig.canvas, 1, 1)._process()
assert not ann._draggable.got_artist
# A scroll event should not initiate a drag.
MouseEvent("scroll_event", fig.canvas, 1, 1)._process()
assert not ann._draggable.got_artist
# An event outside the annotation should not initiate a drag.... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n text_tuple = AnchoredText(\"tuple\", loc='lower left', borderpad=(5, 5))\n```\nI suggest checking that this gives the same result as passing a float. Then add a case 3 passing two different numbers to make sure we can do that successfully.",
"severity": "minor",
"line": 2... | 1 |
python | def monkeypatch_dialect() -> None:
"""
Monkeypatch dialect to correctly escape single quotes for Databricks.
The Databricks SQLAlchemy dialect (<3.0) incorrectly escapes single quotes by
doubling them ('O''Hara') instead of using backslash escaping ('O\'Hara'). The
fixed version requires SQLAlchemy... | Review this code and list any quality issues. | [
{
"issue": "Small suggestion, leave the import from line 82 and change this to:\n\n```suggestion\n if dialect.__class__ is DatabricksDialect:\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | return False
return True
def convert_sml(self, sml:str)->None:
if sml == TTS_SML['break']['token']:
silence_time = int(np.random.uniform(0.3, 0.6) * 100) / 100
break_tensor = torch.zeros(1, int(self.params['samplerate'] * silence_time)) # 0.4 to 0.7 seconds
self.... | Review this code and list any quality issues. | [
{
"issue": "The return logic in convert_sml is incorrect. When the voice file exists and set_voice succeeds, it returns True. However, when handling 'break' or 'pause' tokens (which are successfully processed), or when the voice file doesn't exist (an error condition), it falls through to return False at the en... | 1 |
python | output = net(test_data, **extra_forward_args_)
if output.shape[1] != output_channels:
raise ValueError(f"output channel number `{output.shape[1]}` doesn't match: `{output_channels}`.")
if output.dtype != output_dtype:
raise ValueError(f"dtype of output data `{output.dtype}` doesn... | Review this code and list any quality issues. | [
{
"issue": "Here you could state the callable accepts the network to save, the path to save to, and a dictionary of extra JSON files (name -> contents) to include with this.",
"severity": "minor",
"line": 26
}
] | 1 |
python | raise TypeError("Attempted to convert a callback into a command twice.")
try:
params = f.__click_params__ # type: ignore
params.reverse()
del f.__click_params__ # type: ignore
except AttributeError:
params = []
help = attrs.get("help")
if help is None:
help =... | Review this code and list any quality issues. | [
{
"issue": "Add `import typing` and use `@typing.overload` for this specific case, I've been doing the same elsewhere around the pallets code.",
"severity": "minor",
"line": 26
}
] | 1 |
python | })
# handle Vimeo embeds
if try_get(attributes, lambda x: x['embed']['provider']) == 'Vimeo':
embed_html = try_get(attributes, lambda x: x['embed']['html'])
v_url = url_or_none(compat_urllib_parse_unquote(
self._search_regex(r'(https(?:%3A%2F%2F|://)player\.vimeo... | Review this code and list any quality issues. | [
{
"issue": "same\r\n```suggestion\r\n return self.url_result(embed_url, **info)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | vllm_config: "VllmConfig",
role: Optional[KVConnectorRole] = None,
kv_cache_config: Optional[Any] = None,
*args: Any,
**kwargs: Any,
):
if args:
logger.warning(
"Unexpected positional args for LMCacheConnectorV1Dynamic: %s",
args,
... | Review this code and list any quality issues. | [
{
"issue": "Why do we have this? IIUC, this would not happen, right?",
"severity": "minor",
"line": 26
}
] | 1 |
python | Reader for minute bar updates stored in HDF5 files.
Parameters
----------
path : str
The path of the HDF5 file from which to source data.
"""
def __init__(self, path):
# There is a bug in `pandas.read_hdf` whereby in Python 3 it fails to
# read the timezone attr of an h5 fil... | Review this code and list any quality issues. | [
{
"issue": "I think 2.10 only requires python 3.7 on conda.",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert result.output == snapshot('Both documents contain the text "Dummy PDF file" at the top of the page.')
async def test_google_model_safety_settings(allow_model_requests: None, google_provider: GoogleProvider):
m = GoogleModel('gemini-1.5-flash', provider=google_provider)
settings = GoogleModelSettings(
... | Review this code and list any quality issues. | [
{
"issue": "Can we replace all the below with `assert body_json == snapshot()`? When you run the test, the snapshot will be filled in. That way we can see the entire structure, same as we did for Azure",
"severity": "minor",
"line": 26
}
] | 1 |
python | def compile_repeated_blocks(self, *args, **kwargs):
"""
Compiles *only* the frequently repeated sub-modules of a model (e.g. the
Transformer layers) instead of compiling the entire model. This
technique—often called **regional compilation** (see the PyTorch recipe
https://docs.p... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n raise ValueError(\r\n \"Both `_repeated_blocks` and `_no_split_modules` attribute are empty. \"\r\n \"Set `_repeated_blocks` for the model to benefit from faster compilation. \"\r\n )\r\n```",
"severity": "minor",
"line": ... | 1 |
python | """
Specify `bundle workflow` to run monai bundle components and workflows.
Typical usage examples:
.. code-block:: bash
# Execute this module as a CLI entry with default ConfigWorkflow:
python -m monai.bundle run_workflow --meta_file <meta path> --config_file <config path>
# Set... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n workflow_class, has_built_in = optional_import(\"monai.bundle\", name=str(workflow_name)) # search built-in\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | #!/usr/bin/env python3
#
# Copyright (c) 2018-2022 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Lint format strings: This program checks that the number of arguments passed
# to a variadic format ... | Review this code and list any quality issues. | [
{
"issue": "What's the added value for extending this linter as well?",
"severity": "minor",
"line": 18
}
] | 1 |
python | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | Review this code and list any quality issues. | [
{
"issue": "For my understanding, we need the second check because the group could be reported as stable by the server but the members may not be reconciled yet. Is my understanding correct?",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert latex(M, mat_str='array') == \
r'\left[\begin{array}{cc}x + 1 & y\\y & x - 1\end{array}\right]'
assert latex(M, mat_str='bmatrix') == \
r'\left[\begin{bmatrix}x + 1 & y\\y & x - 1\end{bmatrix}\right]'
assert latex(M, mat_delim=None, mat_str='bmatrix') == \
r'\begin{bmatrix}x + 1 &... | Review this code and list any quality issues. | [] | 0 |
python | if self.attention_dtype is not None:
q = q.to(self.attention_dtype)
k = k.to(self.attention_dtype)
q = q.view(b, t, self.num_heads, c // self.num_heads).transpose(1, 2) # (b, nh, t, hs)
k = k.view(b, kv_t, self.num_heads, c // self.num_heads).transpose(1, 2) # (b, nh, kv_t, h... | Review this code and list any quality issues. | [
{
"issue": "The `#` in the end seems unnecessary (This is non-blocker comment for a merge)",
"severity": "minor",
"line": 26
}
] | 1 |
python | def __getattr__(key: str):
# These imports need to be lazy to avoid circular import errors
if key == "hash_array":
from pandas.core.util.hashing import hash_array
return hash_array
if key == "hash_pandas_object":
from pandas.core.util.hashing import hash_pandas_object
retur... | Review this code and list any quality issues. | [
{
"issue": "Instead, could you put this warning in the `Appender/Substitution.__init__`s?",
"severity": "minor",
"line": 21
}
] | 1 |
python | if left_key not in output:
output = left_key + "\n" + output
if right_key not in output:
def judge_potential_json(routput: str, left_key: str) -> Union[str, None]:
ridx = routput.rfind(left_key)
if ridx < 0:
return None
... | Review this code and list any quality issues. | [
{
"issue": "add unittest case for `//` like `https://github.com/geekan/MetaGPT/blob/main/tests/metagpt/utils/test_repair_llm_raw_output.py#L131-L141`",
"severity": "minor",
"line": 26
}
] | 1 |
python | * triton.cdiv(EM, META["BLOCK_SIZE_M"])
* triton.cdiv(N, META["BLOCK_SIZE_N"]),
len(lora_a_stacked),
## max_loras + 1 to handle the no-lora case (lora_id == -1)
lora_a_stacked[0].shape[0] + 1,
)
_fused_moe_lora_kernel[grid](
qcurr_hidden_states,
b_ptr,
a_i... | Review this code and list any quality issues. | [
{
"issue": "do we need this and `max_loras`? the naming is confusing.",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'upload_date': '20220722',
'thumbnail': 'https://nbg-img.fite.tv/img/606627_460x260.jpg',
'description': '29 сек',
'view_count': False
},
},
{
'url': 'https://play.nova.bg/video/ochakvaite/season-0/ochakvaite-2022-07-22-cherry-tazi/... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _access_token = None\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | channels/\d+/programs/(?P<id>\d+)'''
_TEST = {
'url': 'https://www.qingting.fm/channels/378005/programs/22257411/',
'md5': '47e6a94f4e621ed832c316fd1888fb3c',
'info_dict': {
'id': '22257411',
'ext': 'mp3',
'title': '用了十年才修改,谁在乎教科书?-睡前消息-蜻蜓FM听头条',
}... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n info = self._search_json(r'window\\.__initStores\\s*=', webpage, 'program info', pid)\r\n```\r\ndon't use regex to get values from JSON. use `_search_json` to find the JSON and parse it.\r\n\r\nif we are only downloading the mobile webpage, the rest of this block can be remo... | 1 |
python | """Support for ESPHome water heaters."""
from __future__ import annotations
from typing import Any, cast
from aioesphomeapi import WaterHeaterInfo, WaterHeaterMode, WaterHeaterState
from homeassistant.components.water_heater import (
WaterHeaterEntity,
WaterHeaterEntityFeature,
)
from homeassistant.const im... | Review this code and list any quality issues. | [
{
"issue": "import from\r\n```\r\nfrom .enum_mapper import EsphomeEnumMapper \r\n```",
"severity": "minor",
"line": 19
}
] | 1 |
python | assert "File replacement cleanup failed" not in caplog.text
def test_write_utf8_file_fails_at_rename_and_remove(
tmpdir: py.path.local, caplog: pytest.LogCaptureFixture
) -> None:
"""Test that if rename and remove both fail, we log the failed cleanup."""
test_dir = tmpdir.mkdir("files")
test_file = Pa... | Review this code and list any quality issues. | [
{
"issue": "The test function signature has been updated to use `tmp_path: Path` fixture as requested, but the test body still uses `tmpdir.mkdir(\"files\")` which is undefined. This should be changed to `tmp_path / \"files\"` and the directory should be created with `.mkdir()`. Additionally, since `tmp_path` i... | 1 |
python | "params": params
},
"gradient_clipping": 1.0
}
hidden_dim = 10
model = SimpleModel(hidden_dim, empty_grad=False)
model, _, _, lr_scheduler = deepspeed.initialize(config=config_dict,
model=model,
... | Review this code and list any quality issues. | [] | 0 |
python | idx = [slice(None)] + [slice(c, min(ceil(c + ln), d)) for c, ln, d in zip(coords, lengths, dims)]
mask[s][idx] = 0
return mask * data + (1 - mask) * data[perm, ...]
def apply_on_labels(self, labels: torch.Tensor):
weights, perm, _ = self._params
nsamples, *dims = labels.shape
... | Review this code and list any quality issues. | [
{
"issue": "Hello, I'm a researcher currently working with CutMix and other similar method. My group and I noticed an inconsistent behavior in CutMix on the segmentation labels on our different machines. After some digging, we think it may come from this PR: before this change, `self.apply_on_labels(labels)` is... | 1 |
python | 'series': '트롤리',
'episode': '이거 다 거짓말이야',
'episode_number': 15,
},
}, {
'url': 'https://programs.sbs.co.kr/enter/fourman/vod/69625/22000508948',
'md5': '41e8ae4cc6c8424f4e4d76661a4becbf',
'info_dict': {
'id': '22000508948',
'ext': 'mp4'... | Review this code and list any quality issues. | [
{
"issue": "`_call_api` is the convention\r\n```suggestion\r\n def _call_api(self, video_id, rscuse=''):\r\n```",
"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.