language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | self._add_router(app, interface_router)
if self.a2a_interface and not has_a2a_interface:
from agno.os.interfaces.a2a import A2A
a2a_interface = A2A(agents=self.agents, teams=self.teams, workflows=self.workflows)
self.interfaces.append(a2a_interface)
self._add_rou... | Review this code and list any quality issues. | [
{
"issue": "Why a dict? Rather just add the ID to a list, and if you find it in the list again when you want to add, you have a duplicate.",
"severity": "major",
"line": 26
}
] | 1 |
python | RAY_SERVE_HANDLE_AUTOSCALING_METRIC_PUSH_INTERVAL_S = get_env_float(
"RAY_SERVE_HANDLE_AUTOSCALING_METRIC_PUSH_INTERVAL_S",
10.0,
)
# Async inference task queue metrics push interval.
RAY_SERVE_ASYNC_INFERENCE_TASK_QUEUE_METRIC_PUSH_INTERVAL_S = get_env_float(
"RAY_SERVE_ASYNC_INFERENCE_TASK_QUEUE_METRIC_P... | Review this code and list any quality issues. | [] | 0 |
python | return Project.accessible_objects(self.user, 'use_role').exists()
# if reference_obj is provided, determine if it can be copied
reference_obj = data.get('reference_obj', None)
if self.user.is_superuser:
return True
def get_value(Class, field):
if reference_obj:... | Review this code and list any quality issues. | [
{
"issue": "same here for \"job_template\" -> \"inventory\"",
"severity": "minor",
"line": 26
}
] | 1 |
python | @PrimePredicate.register(Mul)
def _(expr, assumptions):
if expr.is_number:
return _PrimePredicate_number(expr, assumptions)
for arg in expr.args:
if not ask(Q.integer(arg), assumptions):
return None
for arg in expr.args:
if arg.is_number and arg.is_composite:
... | Review this code and list any quality issues. | [
{
"issue": "redundant; functions return None by default",
"severity": "minor",
"line": 26
}
] | 1 |
python | # these derived rules are never meant to be inspected separately,
# they are dependencies for the parent rule,
# so mark it as such.
"lib": True,
# metadata that indicates this is derived from a subscope statement
... | Review this code and list any quality issues. | [
{
"issue": "maybe we should move the rules into the path `internal/limitation/static/file` for symmetry with the dynamic limitations. thoughts @v1bh475u?",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'WARNING': 'warning',
'ERROR': 'error',
'CRITICAL': 'critical',
}
class JinaLogger:
"""
Build a logger for a context.
:param context: The context identifier of the class, module or method.
:param log_config: The configuration file for the logger.
:param suppress_root_logging: ... | Review this code and list any quality issues. | [
{
"issue": "The avoid breaking current behavior, the default value is True.",
"severity": "minor",
"line": 26
}
] | 1 |
python | ):
self.tools = tools
super().__init__(config=config)
def get_llm_model_answer(self, prompt) -> str:
response = self._get_answer(prompt, self.config)
return response
def _get_answer(self, prompt: str, config: BaseLlmConfig) -> str:
messages = []
if config.system... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n chat = ChatOpenAI(\r\n **kwargs,\r\n streaming=config.stream,\r\n callbacks=callbacks,\r\n api_key=api_key,\r\n base_url=base_url,\r\n )\r\n```",
"severity": "minor",
"line": 26... | 1 |
python | @pytest.fixture
def client(app):
"""Create a test client."""
return TestClient(app, raise_server_exceptions=False)
def test_root_path_not_modified(client):
"""Root path '/' should not be modified."""
response = client.get("/")
assert response.status_code == 200
assert "Path: /" in response.tex... | Review this code and list any quality issues. | [] | 0 |
python | The new owner of the guild to transfer ownership to. Note that you must
be owner of the guild to do this.
verification_level: :class:`VerificationLevel`
The new verification level for the guild.
default_notifications: :class:`NotificationLevel`
The new default notific... | Review this code and list any quality issues. | [
{
"issue": "Why are you removing the `Optional` aspect of this?",
"severity": "minor",
"line": 26
}
] | 1 |
python | def test_monaihosting_url_download_bundle(self, bundle_files, bundle_name, url):
with skip_if_downloading_fails():
# download a single file from url, also use `args_file`
with tempfile.TemporaryDirectory() as tempdir:
def_args = {"name": bundle_name, "bundle_dir": tempdir... | Review this code and list any quality issues. | [] | 0 |
python | # 1) It must be a list
assert isinstance(raw_prompt, list), 'Expected prompt to be a list when passing binary'
# 2) The BinaryContent you passed in should be one of the elements
assert image_content in raw_prompt, 'Expected the exact BinaryContent instance to be in the prompt list'
async def test_judge_b... | Review this code and list any quality issues. | [
{
"issue": "Can we instead test `assert call_args == snapshot()` as we have below? When you run the test, the snapshot will be filled in automatically",
"severity": "minor",
"line": 26
}
] | 1 |
python | """Find the path to the distribution's metadata directory.
HACK: This relies on importlib.metadata's private ``_path`` attribute. Not
all distributions exist on disk, so importlib.metadata is correct to not
expose the attribute as public. But pip's code base is old and not as clean,
so we do this to av... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if suffix == \".dist-info\":\r\n name, sep, version = stem.partition(\"-\")\r\n if sep:\r\n return name, version\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | for dt in tout:
self.ufunc_args += [
np.empty(stride_out * self.arrlen, dt)[::stride_out]
]
np.seterr(all='ignore')
def time_unary(self, ufunc, stride_in, stride_out, dtype):
ufunc(*self.ufunc_args)
class UnaryFP(_AbstractUnary):
params = [[uf for uf in... | Review this code and list any quality issues. | [] | 0 |
python | self.play(Create(NumberPlane()))
self.play(Create(brace))
self.wait(2)
"""
def __init__(
self,
point_1: Optional[Sequence[float]],
point_2: Optional[Sequence[float]],
direction: Optional[Sequence[float]] = ORIGIN,
**kwargs
):
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n The :class:`ArcBrace` is smaller for Arcs with smaller radii.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | class InputBlock(InputOutputBlockBase[Any]):
def __init__(self):
super().__init__(categories={BlockCategory.INPUT, BlockCategory.BASIC})
def block_id(self) -> str:
return "c0a8e994-ebf1-4a9c-a4d8-89d09c86741b"
class OutputBlock(InputOutputBlockBase[Any]):
def __init__(self):
super... | Review this code and list any quality issues. | [
{
"issue": "Isn't limiting the placeholder value makes the value essentially enum?\r\nCan we just use enum?",
"severity": "minor",
"line": 26
}
] | 1 |
python | path_arc_axis: np.ndarray = OUT,
path_arc_centers: np.ndarray = None,
replace_mobject_with_target_in_scene: bool = False,
**kwargs,
) -> None:
self.path_arc_axis: np.ndarray = path_arc_axis
self.path_arc_centers: np.ndarray = path_arc_centers
self.path_arc: float = pa... | Review this code and list any quality issues. | [
{
"issue": "I have a (slight) preference for passing keyword arguments as actual keyword arguments.\r\n\r\n```suggestion\r\n self._path_arc,\r\n axis=self.path_arc_axis,\r\n arc_centers=self.path_arc_centers\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'thumbnail': 'https://cdn-02.godresource.com/e42968ac-9e8b-4231-ab86-f4f9d775841f/thumbnail.jpg',
'channel': 'Stedfast Baptist Church',
'upload_date': '20240320',
'title': 'GodResource',
}
}, {
# mp4 link
'url': 'https://new.godresource.com/video/01DXmBbQv... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # the website is oddly giving all request as 404 at first and then loaded with js\r\n webpage = self._download_webpage(url, display_id, expected_status=404)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # file-obj path
fd, fname = mkstemp()
os.close(fd)
with open(fname, "w") as fh:
fh.write("\n".join(data))
res = np.loadtxt(fname, dtype=str, delimiter=" ", max_rows=nmax)
os.remove(fname)
assert len(res) == nmax
@pytest.mark.parametrize("nskip", (0, 10000, 50000, 100000))
def test_skipr... | Review this code and list any quality issues. | [
{
"issue": "You can probably even do `tmpdir / \"test_data.txt`! :)",
"severity": "minor",
"line": 26
}
] | 1 |
python | srcModuleName = event.module
eventData = event.data
if self.errorState:
return None
self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
if self.opts["api_key"] == "":
self.sf.error(
f"You enabled {self.__class__.__name__} but did... | Review this code and list any quality issues. | [
{
"issue": "Please make the score a configurable option so the user can choose what their threshold is.",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'url': 'https://piramide.tv/video/wcYn6li79NgN',
'info_dict': {
'id': 'wcYn6li79NgN',
'ext': 'mp4',
'title': 'ACEPTO TENER UN BEBE CON MI NOVIA\u2026? | Parte 1',
'description': '',
'channel': 'ARTA GAME',
'channel_id': 'arta_game',
... | Review this code and list any quality issues. | [
{
"issue": "Extractors should not set `original_url`.\r\nWe also don't want to overwrite `webpage_url` as the info saved in the infodict should be usable to rerun the extraction exactly as during the initial run.\r\n```suggestion\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | r_no_decode["unicode-string-memoryview"] = unicode_string_view
cached_val = r_no_decode["unicode-string-memoryview"]
# The cached value won't be a memoryview because it's a copy from Redis
assert isinstance(cached_val, bytes)
assert unicode_string == cached_val.decode("utf-8")
def t... | Review this code and list any quality issues. | [] | 0 |
python | data[CONF_URL] = data.pop(CONF_HOST)
data[CONF_API_TOKEN] = data.pop(CONF_API_KEY)
hass.config_entries.async_update_entry(entry=entry, data=data, version=2)
if entry.version < 3:
data = dict(entry.data)
data[CONF_VERIFY_SSL] = True
hass.config_entries.async_update_entry(entr... | Review this code and list any quality issues. | [
{
"issue": "why isn't this a minor version migration?",
"severity": "minor",
"line": 26
}
] | 1 |
python | def convert_embedding(source_face : Face) -> Tuple[Embedding, Embedding]:
embedding = source_face.embedding.reshape(-1, 512)
embedding = forward_convert_embedding(embedding)
embedding = embedding.ravel()
normed_embedding = embedding / numpy.linalg.norm(embedding)
return embedding, normed_embedding
def prepare_cr... | Review this code and list any quality issues. | [
{
"issue": "we are not using negative comparison - it is also model_type, not template",
"severity": "minor",
"line": 26
}
] | 1 |
python | spectrogram = numpy.dot(mel_filter_bank, numpy.abs(spectrogram))
return spectrogram
def detect_audio_duration(audio_path : str) -> Duration:
audio_sample_rate = 48000
audio_sample_size = 16
audio_channel_total = 2
if is_audio(audio_path):
audio_buffer = read_audio_buffer(audio_path, audio_sample_rate, audio_s... | Review this code and list any quality issues. | [
{
"issue": "I suggest we remove this method and just use restrict_trim_audio_frame...\n\nsame with the video (vision.py) equalent",
"severity": "major",
"line": 26
}
] | 1 |
python | 'info_dict': {
'id': 'bebenim',
'ext': 'mp4',
'channel': '릴리ෆ',
'title': r're:앙앙❤ \d{4}-\d{2}-\d{2} \d{2}:\d{2}',
'thumbnail': r're:https://cdn\.pandalive\.co\.kr/ivs/v1/.+/thumb.jpg',
'concurrent_view_count': int,
'like_count': int,
... | Review this code and list any quality issues. | [
{
"issue": "- we can (and should) inline the POST data\r\n- you don't need to include `200` in the `expected_status` tuple; it is implicit\r\n- are there password-protected streams?\r\n- these comments are unnecessary\r\n```suggestion\r\n video_meta = self._download_json(\r\n 'https://api.pand... | 1 |
python | import sys
import traceback
from typing import Callable
from typing import NamedTuple
from typing import TYPE_CHECKING
import warnings
from _pytest.config import Config
from _pytest.tracemalloc import tracemalloc_message
import pytest
if TYPE_CHECKING:
pass
if sys.version_info < (3, 11):
from exceptiongroup... | Review this code and list any quality issues. | [
{
"issue": "Can we use the config [stash](https://docs.pytest.org/en/stable/how-to/writing_hook_functions.html#storing-data-on-items-across-hook-functions) for this instead of a global?\r\n\r\nOf course, `unraisablehook` itself is a global, so it's not like we can really make this plugin safe for multiple concu... | 1 |
python | self.renderer.camera.add_image_mobject_from_camera(self.zoomed_display) # type: ignore[union-attr]
if animate:
self.play(self.get_zoom_in_animation())
self.play(self.get_zoomed_display_pop_out_animation())
self.add_foreground_mobjects(
self.zoomed_camera.frame,
... | Review this code and list any quality issues. | [
{
"issue": "`OpenGLCamera` does not have `frame_height` and `frame_width` attributes.\r\nI have not spent enough time with the OpenGL code yet, so this is my suggested solution.",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Copyright 2025 The HuggingFace Team. All rights reserved.
#
# 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 applicabl... | Review this code and list any quality issues. | [] | 0 |
python | """OpenHands package."""
__version__ = '1.0.1' | Review this code and list any quality issues. | [
{
"issue": "Does this version need to get updated everytime as well now?",
"severity": "minor",
"line": 3
}
] | 1 |
python | if isinstance(x, np.ndarray):
x = x.item()
x = self.dtype.type(x)
if x.size > 1:
raise ValueError("Trying to assign a sequence to an item")
return self._set_intXint(row, col, x)
# Fast path for full-matrix sparse assignm... | Review this code and list any quality issues. | [
{
"issue": "Maybe we could do something fancy here by avoiding the explicit copy when the dtype conversion would copy anyway.",
"severity": "minor",
"line": 26
}
] | 1 |
python | token = self._search_regex(
r"_icareus\['token'\]\s*=\s*'([a-f0-9]+)'", page, "token")
token2 = self._search_regex(
r"""data\s*:\s*{action:"getAsset".*?token:'([a-f0-9]+)'}""", page,
"token2", default=None, fatal=False)
livestream_title = get_element_by_class(
... | Review this code and list any quality issues. | [
{
"issue": "doesn't need to be a var. Same below",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.ensure_clobbered()
host = servo.platform.host_triple()
target_triple = self.target.triple()
if self.enable_code_coverage:
print("Building with code coverage instrumentation...")
# We don't want coverage for build-scripts and proc macros.
kwargs["target_... | Review this code and list any quality issues. | [
{
"issue": "We should be setting all environment variables in one place instead of many places. I think you can do this by passing in an optional sanitizer argument to `build_env()` and calling `build_sanitizer_env` from there. Sorry that I have not spotted this earlier.\n\nSetting up the environment in one pla... | 1 |
python | for rule_name, results in itertools.chain(
# each rule exists in exactly one scope,
# so there won't be any overlap among these following MatchResults,
# and we can merge the dictionaries naively.
all_insn_matches.items(),
all_bb_matches.items(),
a... | Review this code and list any quality issues. | [
{
"issue": "as above, add explicit `elif` case and then raise `NotImplementedError` if its a dynamic extractor.",
"severity": "major",
"line": 26
}
] | 1 |
python | # reference: `id-to-uri.js`
video_uuid = uuid.uuid5(self._DNS_NAMESPACE, 'video')
media_uuid = uuid.uuid5(video_uuid, media_id)
return self._download_json(
self._GRAPHQL_API, media_id, note='Downloading json from GRAPHQL API', data=json.dumps({
'query': self._GRAPHQL... | Review this code and list any quality issues. | [
{
"issue": "I don't think `lead_video_id` should be non-fatal? Or else we need to check before appending it to `media_ids` and we should raise after the playlist_result code path\r\n```suggestion\r\n title = self._html_search_meta(['og:title', 'twitter:title'], webpage)\r\n description = self._htm... | 1 |
python | )['data']['content_providers']
fanclub_id = traverse_obj(fanclub_list_json, (
lambda _, v: v.get('domain') == f'{self._WEBPAGE_BASE_URL}/{channel_name}', 'id'),
get_all=False)
if not fanclub_id:
raise ExtractorError(f'Channel {channel_name} does not exist', expected=T... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _VALID_URL = r'https?://nicochannel\\.jp/(?P<channel>[\\w.-]+)/(?:video|live)/(?P<code>sm\\w+)'\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | wnetwork|
ytv
)\.com|
(?:
hgtv|
foodnetwork|
slice|
history|
showcase|
... | Review this code and list any quality issues. | [
{
"issue": "I don't think we should change the URL just because the browser redirects.\r\nyt-dlp can extract from the original URL (no webpage requests) and we want to still test that it is matched",
"severity": "major",
"line": 26
}
] | 1 |
python | y1 = terrain.length // 2 - platform_size
y2 = terrain.length // 2 + platform_size
min_h = min(terrain.height_field_raw[x1, y1], 0)
max_h = max(terrain.height_field_raw[x1, y1], 0)
terrain.height_field_raw = np.clip(terrain.height_field_raw, min_h, max_h)
return terrain
def discrete_obstacles_terr... | Review this code and list any quality issues. | [
{
"issue": "You mixed in the changes from another PR.",
"severity": "minor",
"line": 26
}
] | 1 |
python | delta = rule / 2
num_clr = max(num_shift_up - cnum.depth - axis_height - delta, min_clr)
den_clr = max(axis_height - delta + den_shift_down - cden.height, min_clr)
# Possible bug in fraction rendering. See GitHub PR 22852 comments.
vlist = Vlist([cnum, ... | Review this code and list any quality issues. | [
{
"issue": "Doesn't axis_height also need to be shrunk here? Again perhaps it makes sense to first shrink the font and then directly extract axis_height/x_height from the shrunk font?",
"severity": "major",
"line": 26
}
] | 1 |
python | assert delete_response.status_code == 404
source_path = get_test_example_file('source.jpg')
with open(source_path, 'rb') as source_file:
source_content = source_file.read()
upload_response = test_client.post('/assets?type=source', headers =
{
'Authorization': 'Bearer ' + access_token
}, files =
[
('... | Review this code and list any quality issues. | [
{
"issue": "assert not ... instead of is None\r\n\r\nif I remember correct the status code checks are always at the end...",
"severity": "minor",
"line": 26
}
] | 1 |
python | """Get normalized price feature ops"""
if shift == 0:
template_norm = "Cut({0}/Ref(DayLast({1}), 240), 240, None)"
else:
template_norm = "Cut(Ref({0}, " + str(shift) + ")/Ref(DayLast({1}), 240), 240, None)"
feature_ops = template_norm.format(
... | Review this code and list any quality issues. | [] | 0 |
python | "group_name1": <handler>
"group_name2": <handler>
}
or
<handler_config> := <handler>
<handler> := DataHandler Instance | DataHandler Config
fetch_kwargs : dict
fetch_kwargs will be used to describe the different arg... | Review this code and list any quality issues. | [
{
"issue": "`self.fetch_kwargs.update(fetch_kwargs)` looks simpler.",
"severity": "minor",
"line": 26
}
] | 1 |
python | "pyaml": ["yaml"],
}
# We use this to exit with a non-zero status code if any check fails
# so that when this is running in CI the job will fail
success = True
def print_errors(file, errors):
global success
if len(errors) > 0:
success = False
print(f"- {file}")
for line in errors:
... | Review this code and list any quality issues. | [] | 0 |
python | ],
)
def test_invalid_checkout(self, starter, repo, fake_kedro_cli, mocker):
mocker.patch(
"cookiecutter.repository.determine_repo_dir",
side_effect=RepositoryCloneFailed,
)
mock_ls_remote = mocker.patch("git.cmd.Git").return_value.ls_remote
mock_ls_remote... | Review this code and list any quality issues. | [] | 0 |
python | else:
rtn = 'riscv32'
return rtn
def host_arch_win():
"""Host architecture check using environ vars (better way to do this?)"""
observed_arch = os.environ.get('PROCESSOR_ARCHITECTURE', 'AMD64')
arch = os.environ.get('PROCESSOR_ARCHITEW6432', observed_arch)
matchup = {
'AMD64' : 'x64',
'arm... | Review this code and list any quality issues. | [
{
"issue": "According to https://github.com/nodejs/gyp-next/blob/main/docs/InputFormatReference.md#processing-order, I think there is no way for us to generate a single `config.gypi` supporting two configurations at the same time, with variable expansions based on configurations, since the variables are expande... | 1 |
python | # From _app.js
CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
CLIENT_SCRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
USER_AGENT = '5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrom... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'user-agent': self._USER_AGENT,\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | self._prewarm_task: weakref.ref[asyncio.Task[None]] | None = None
async def _connect(self, timeout: float) -> T:
"""Create a new connection.
Returns:
The new connection object
Raises:
NotImplementedError: If no connect callback was provided
"""
if s... | Review this code and list any quality issues. | [
{
"issue": "nit: do we still need this line after the while loop?",
"severity": "minor",
"line": 26
}
] | 1 |
python | # mypy: no-warn-unused-ignores
import contextlib
import signal
from typing import Callable, ContextManager, Iterable, Iterator
# Applies on Windows.
if not hasattr(signal, "pthread_sigmask"):
# We're not relying on this behavior anywhere currently, it's just best
# practice.
blocked_signals: Callable[[], ... | Review this code and list any quality issues. | [
{
"issue": "This is probably not needed anymore",
"severity": "minor",
"line": 19
}
] | 1 |
python | f" - **_Too many keys_**: {reference_key_count} (reference) vs {current_key_count} (current). Please verify if there are additional keys that need to be removed."
)
else:
report.append("1. **Test Status:** ✅ **_Passed_**")
# Check for missing or extra keys
current... | Review this code and list any quality issues. | [
{
"issue": "There are two consecutive spaces between \"translation_merger.py\" and the language directory argument. This should be a single space for consistency with standard command formatting.",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'ext': 'mp4',
'title': 'Senate Chamber',
'description': 'Official Recording of Senate Proceedings from the Australian Parliament',
'thumbnail': 'https://aphbroadcasting-prod.z01.azurefd.net/vod-storage/vod-logos/SenateParlview06.jpg',
'upload_date': '20250326',
... | Review this code and list any quality issues. | [
{
"issue": "Same here. We should also extract subtitles\n```suggestion\n formats, subtitles = self._extract_m3u8_formats_and_subtitles(\n video_details['files']['file']['url'], video_id, 'mp4')\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | res = np.loadtxt(txt, dtype=str, delimiter=" ", max_rows=nmax)
assert len(res) == nmax
# file-obj path
fd, fname = mkstemp()
os.close(fd)
with open(fname, "w") as fh:
fh.write("\n".join(data))
res = np.loadtxt(fname, dtype=str, delimiter=" ", max_rows=nmax)
os.remove(fname)
asse... | Review this code and list any quality issues. | [
{
"issue": "Just use `assert_array_equal(expected, res[:, 0])`. And set `expected` earlier so we can re-use it. (I think it is still fine to explicitly check the length, since that is the main thing)",
"severity": "minor",
"line": 26
}
] | 1 |
python | if (now - last_download_time) <= ONE_HOUR:
logger.warn(
"Refusing to download new benchmark data because a "
"download succeeded at %s." % last_download_time
)
return data
except (OSError, IOError, ValueError) as e:
... | Review this code and list any quality issues. | [] | 0 |
python | result = pytester.runpytest_inprocess("--durations=10")
assert result.ret == 0
result.stdout.fnmatch_lines_random(
["*durations*", "*call*test_3*", "*call*test_2*"]
)
result.stdout.fnmatch_lines(
["(8 durations < 0.005s hidden. Use -vv to show these durations.)... | Review this code and list any quality issues. | [
{
"issue": "Not sure what the rationale for this comment is. It was added with `--durations` in 3b9fd3a, 13 years ago. I removed it.",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'QuartzCore', # animation
'Security', # access control and authentication
'UniformTypeIdentifiers', # collection of types that map to MIME and file types
}
PE_ALLOWED_LIBRARIES = {
'ADVAPI32.dll', # legacy security & registry
'bcrypt.dll', # newer security and identity API
'IPHLPAPI.DLL', # IP helper API
'KERNEL32.dll... | Review this code and list any quality issues. | [] | 0 |
python | import json
from .common import InfoExtractor
from ..utils import int_or_none, traverse_obj
class PlaySuisseIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?playsuisse\.ch/(watch|detail)/(.*\?episodeId=)?(?P<id>[0-9]+)?'
_TESTS = [
{
# episode in a series
'url': 'https://w... | Review this code and list any quality issues. | [
{
"issue": "md5 for thumbnail is a bad idea. Can u use `re:` instead",
"severity": "minor",
"line": 25
}
] | 1 |
python | model_chunk: Union[ModuleList, Module],
model_chunk_id: int,
optimizer: OptimizerWrapper,
output_obj: Union[dict, torch.Tensor],
output_obj_grad: Optional[dict],
):
"""Backward dw step of the pipeline; we calculate "dw = x*dy" here;
Args:
model_chunk (Mod... | Review this code and list any quality issues. | [
{
"issue": "Here is the bwd_w with dy=loss, y=output of last layer, x =input of last layer.\r\nShould we set \"retain_graph=True\" at here ?",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'info_dict': {
'id': '192445',
'ext': 'mp4',
'title': 'Gast vernielt Genkse hotelkamer',
'channel': 'VTM',
'channel_id': '867',
'description': 'md5:75fce957d219646ff1b65ba449ab97b5',
'duration': 74,
'genres': ['Documentaries... | Review this code and list any quality issues. | [
{
"issue": "let's avoid shadowing a stdlib module name\r\n```suggestion\r\n video_id = self._match_id(url)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | line
The line to be perpendicular to.
point
The point to pass through.
kwargs
Additional parameters to be passed to the class.
Examples
--------
.. manim:: PerpLineExample
:save_last_frame:
class PerpLineExample(ThreeD... | Review this code and list any quality issues. | [
{
"issue": "Checking whether the cross product, `norm` is different from the zero vector seems to be easier.",
"severity": "minor",
"line": 26
}
] | 1 |
python | c_index = (face.u_index + face.v_index) % n_colors
face.set_fill(colors[c_index], opacity=opacity)
return self
def set_fill_by_value(self, axes: "Mobject", colors: Union[Iterable[Color], Color]):
"""Sets the color of each mobject of a parametric surface to a color relative to its z-valu... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n class FillByValueExample(ThreeDScene):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.edit_rule_path.text(),
self.edit_rule_author.text(),
self.edit_rule_scope.currentText(),
self.edit_analyze.currentIndex(),
)
class CapaExplorerForm(idaapi.PluginForm):
"""form element for plugin interface"""
def __init__(self, name: str, option=Options.NO_ANAL... | Review this code and list any quality issues. | [
{
"issue": "See comment above. Let's keep this and add a line for `self.rulegen_feature_extractor: ... = None`. We should create the associated objects at the beginning of `load_capa_function_results`, once.",
"severity": "major",
"line": 26
}
] | 1 |
python | 'duration': 8559.0,
'tags': list,
'thumbnail': 're:^https?://media.livr.jp/vod/img/.*$',
},
'skip': 'Premium channel subscribers only',
}, {
# Accessible only in the VR SQUARE app
'url': 'https://livr.jp/contents/P126481458',
'only_matching': True,
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n except ExtractorError as e:\r\n if isinstance(e.cause, HTTPError) and e.cause.status == 500:\r\n raise ExtractorError('VR SQUARE app-only videos are not supported', expected=True)\r\n raise\r\n```",
"severity": "major",
"line": 26... | 1 |
python | from pathlib import Path
from promptflow.tracing import trace
from promptflow.core import AzureOpenAIModelConfiguration, Prompty
BASE_DIR = Path(__file__).absolute().parent
class ChatFlow:
def __init__(self, model_config: AzureOpenAIModelConfiguration):
self.model_config = model_config
@trace
d... | Review this code and list any quality issues. | [] | 0 |
python | def _flex_attention_causal_mask_mod(batch_idx, head_idx, q_idx, kv_idx):
return q_idx >= kv_idx
# ===== torch op registrations =====
# Registrations are required for fullgraph tracing compatibility
# Version guard for PyTorch compatibility - custom_op was added in PyTorch 2.4
# TODO: this is only required because... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _custom_op = custom_op_no_op\r\n _register_fake = register_fake_no_op\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | hass, manager.async_event_new_entity(), async_add_sensor
)
)
hass.async_create_task(manager.async_update())
_LOGGER.debug("Sensor setup done")
class GeonetnzVolcanoSensor(SensorEntity):
"""Represents an external event with GeoNet NZ Volcano feed data."""
_attr_icon = DEFAULT_ICON
_att... | Review this code and list any quality issues. | [
{
"issue": "`self._attribution` is initialized but never read or updated; attribution is stored in `_attr_attribution` instead. Removing this unused attribute (or consistently using one field) will reduce confusion.\n```suggestion\n\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | syncid = self._extract_account_syncid(player_ytcfg, master_ytcfg, initial_pr)
sts = self._extract_signature_timestamp(video_id, player_url, master_ytcfg, fatal=False) if player_url else None
headers = self.generate_api_headers(
ytcfg=player_ytcfg, account_syncid=syncid, session_index=session... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n default = ['ios', 'android', 'web']\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | continue # facts are expired - do not write them
filepath = os.sep.join(map(str, [destination, host.name]))
if not os.path.realpath(filepath).startswith(destination):
system_tracking_logger.error('facts for host {} could not be cached'.format(smart_str(host.name)))
continue
... | Review this code and list any quality issues. | [
{
"issue": "If the fix here is legitimate (otherwise why do it?) then we should get rid of the `except OperationalError as exc:` later down here.",
"severity": "minor",
"line": 26
}
] | 1 |
python | remove_start(get_lang_code(sub), 'a-')
for sub in all_captions if sub.get('kind') == 'asr'}
for pr in prs:
pctr = pr['captions']['playerCaptionsTracklistRenderer']
client_name = pr['streamingData'][STREAMING_DATA_CLIENT_NAME]
innertube_client_name = pr['streaming... | Review this code and list any quality issues. | [
{
"issue": "tempted to suggest a shorter attribute name like `premium_exempt` just to make some of these lines shorter lol",
"severity": "minor",
"line": 26
}
] | 1 |
python | height = uint32(max(last_coin_state.created_height or 0, last_coin_state.spent_height or 0))
if height != next_height:
break
coin_states.pop()
return coin_states, next_height
async def rollback_to_block(self, block_index: int) -> dict[bytes32, CoinRecord]:
... | Review this code and list any quality issues. | [
{
"issue": "this is not obvious to me. why do you need to \"launder\" the same-puzzle and same amount bit here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | from ..utils import (
traverse_obj
)
class S4CIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?s4c\.cymru/clic/programme/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://www.s4c.cymru/clic/programme/861362209',
'info_dict': {
'id': '861362209',
'ext': 'mp4',
... | Review this code and list any quality issues. | [
{
"issue": "Use md5 for long descriptions\r\n\r\nReplace value of `description` with `md5:TODO`, run the test; it will fail and output an md5 hash you can use instead",
"severity": "critical",
"line": 26
}
] | 1 |
python | def test_get_old_defined(self):
"""
Ensure `old` complains when only `old` is defined.
"""
msg = "`Manager.old` method should be renamed `new`."
with self.assertWarnsMessage(DeprecationWarning, msg) as ctx:
class Manager(metaclass=RenameManagerMethods):
... | Review this code and list any quality issues. | [] | 0 |
python | def test_one():
sys.stdout.write('!This is stdout!')
sys.stderr.write('!This is stderr!')
logging.warning('!This is a warning log msg!')
assert False, 'Something failed'
"""
)
result = pytester.runpytest("--tb=short")
resul... | Review this code and list any quality issues. | [] | 0 |
python | ################################################
# Generating the Jekyll files for all content
n_skipped_files = 0
n_built_files = 0
case_check = _case_sensitive_fs(BUILD_FOLDER) and local_build
print("Convert and copy notebook/md files...")
for ix_file, page in enumerate(tqdm(list(toc))):
... | Review this code and list any quality issues. | [] | 0 |
python | if plot_info.prover.get_strength() < constants.PLOT_STRENGTH_INITIAL:
self.log.warn(
f"Plot strength ({plot_info.prover.get_strength()}) too low, "
f"cannot be used for farming: {plot_info.prover.get_filename()}"
)
... | Review this code and list any quality issues. | [
{
"issue": "doesn't calculate_iterations_quality return uint64 ?",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'timestamp': 1287584475,
'age_limit': 0,
'duration': 82,
'upload_date': '20101020',
'thumbnail': 'https://s1.dmcdn.net/v/SaMes1WfAm1d6maq_/x720',
'uploader': 'Moviepilot',
'like_count': int,
'view_count': int,
'tags': ['Alle... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'ie_key': DailymotionIE.ie_key(),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def is_supported_predicate(pred):
if not isinstance(pred, AppliedPredicate):
return False
if pred.function in supported_predicates:
return True
return False
# def z3_satisfiable(expr, all_models=False):
# if not isinstance(expr, EncodedCNF):
# exprs = EncodedCNF()
# ... | Review this code and list any quality issues. | [
{
"issue": "You got rid of the docstring I liked",
"severity": "minor",
"line": 26
}
] | 1 |
python | },
'params': {
'skip_download': True,
'ignore_no_formats_error': True
},
'skip': 'Only for subscribers'
}]
def _real_extract(self, url):
video_id = self._match_id(url)
public_data = self._download_json(f'https://pornbox.com/contents/{video_id}', ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n subtitles = {country_code: [{\r\n 'url': f'https://pornbox.com/contents/{video_id}/subtitles/{country_code}',\r\n 'ext': 'srt'\r\n }] for country_code in traverse_obj(public_data, ('subtitles', ...)}\r\n```",
"severity": "minor",
"line": ... | 1 |
python | ranked_query.c.map_index_for_ordering,
)
)
if starved_pools:
query = query.where(TI.pool.not_in(starved_pools))
if starved_dags:
query = query.where(TI.dag_id.not_in(starved_dags))
if starved_tasks:
query ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n task_instances_to_examine = session.scalars(locked_query).all()\n```\n\nNot really related, but let’s fix this potentially wasteful line",
"severity": "minor",
"line": 26
}
] | 1 |
python | """API key validation utilities for gptme."""
import logging
import requests
logger = logging.getLogger(__name__)
# Provider documentation URLs
PROVIDER_DOCS: dict[str, str] = {
"openai": "https://platform.openai.com/account/api-keys",
"anthropic": "https://console.anthropic.com/settings/keys",
"openrou... | Review this code and list any quality issues. | [
{
"issue": "The openai-subscription uses a ChatGPT subscription, not the platform API keys!",
"severity": "minor",
"line": 20
}
] | 1 |
python | 'ImageIO', # read and write image file formats.
'IOKit', # user-space access to hardware devices and drivers.
'IOSurface', # cross process image/drawing buffers
'libobjc.A.dylib', # Objective-C runtime library
'Metal', # 3D graphics
'QuartzCore', # animation
'Security', # access control and authentication
'UniformTypeI... | Review this code and list any quality issues. | [] | 0 |
python | 'duration': 288,
'timestamp': 1571652600,
'upload_date': '20191021',
'series': 'Cahaya Terindah',
'channel': 'RCTI',
},
'params': {
'fixup': 'never',
},
}, { # Extra
'url': 'https://www.rctiplus.com/programs/616/inews-malam... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'format': 'bestvideo',\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | }, {
'url': 'https://www.sbs.com.au/ondemand/news-series/dateline/dateline-2022/dateline-s2022-ep26/2072245827515',
'only_matching': True,
}, {
'url': 'https://www.sbs.com.au/ondemand/tv-series/the-handmaids-tale/season-5/the-handmaids-tale-s5-ep1/2065631811776',
'only_matching': Tru... | Review this code and list any quality issues. | [
{
"issue": "does SBS still have livestreams?",
"severity": "minor",
"line": 26
}
] | 1 |
python | if self.errorState:
return None
self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")
# Don't look up stuff twice
if eventData in self.results:
self.sf.debug(f"Skipping {eventData}, already checked.")
return None
else:
self.... | Review this code and list any quality issues. | [
{
"issue": "`eventName` will always be `EMAILADDR`, right? Better to be explicit, if that's the case.",
"severity": "minor",
"line": 26
}
] | 1 |
python | cur_save_version = save_version
for ds_name, ds in datasets.items():
# TODO: Move to kedro/io/kedro_data_catalog.py when removing DataCatalog
# TODO: Make it a protected static method for KedroDataCatalog
# TODO: Replace with isinstance(ds, CachedDataset) - current implementation avoids cir... | Review this code and list any quality issues. | [
{
"issue": "Can't we check directly for a `MemoryDataset` instance here or this is to avoid circular dependencies?",
"severity": "major",
"line": 26
}
] | 1 |
python | test_xml_data = (
'<django-objects version="1.0">'
'<object model="model_fields.nullablejsonmodel">'
'<field name="value" type="JSONField">%s'
"</field></object></django-objects>"
)
for value, serialized in self.test_values:
with self.subTest(v... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n # RemovedInDjango70Warning.\n @ignore_warnings(category=RemovedInDjango70Warning)\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | mocked_pubmaster.send.assert_called_once()
mt, md = mocked_pubmaster.send.call_args.args
assert mt == msg["type"]
assert isinstance(md, capnp._DynamicStructBuilder)
assert hasattr(md, msg["type"])
mocked_pubmaster.reset_mock()
def test_livestream_track(self, mocker):
fake_msg = mes... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n assert abs(i + packet.pts - (start_pts + (((time.monotonic_ns() - start_ns) * VIDEO_CLOCK_RATE) // 1_000_000_000))) < 450 #5ms\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | return crossed_in, crossed_out
if detections.tracker_id is None:
warnings.warn(
"Line zone counting skipped. LineZone requires tracker_id. Refer to "
"https://supervision.roboflow.com/latest/trackers for more "
"information.",
category... | Review this code and list any quality issues. | [
{
"issue": "Let's remove the comment; we're being fairly explicit that we care about one side later on.",
"severity": "minor",
"line": 26
}
] | 1 |
python | with open(self.ssl_certfile, 'rb') as f:
certificate_chain = f.read()
server_credentials = grpc.ssl_server_credentials(
(
(
private_key,
certificate_chain,
),
)
... | Review this code and list any quality issues. | [
{
"issue": "can't we put this repetitive line in base class so users don't have to worry about the streamer object ?",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Lock
with task_manager_bulk_reschedule():
with advisory_lock(f"{self.prefix}_lock", wait=False) as acquired:
with transaction.atomic():
if acquired is False:
logger.debug(f"Not running {self.prefix} scheduler, another task holds lock")
... | Review this code and list any quality issues. | [
{
"issue": "elsewhere, in this same method you do `ScheduleWorkflowManager().schedule()`, and that looks like the correct pick to me.",
"severity": "minor",
"line": 26
}
] | 1 |
python | ious = []
step = max(
memory_limit
* 1024
* 1024
// (
masks_detection.shape[0]
* masks_detection.shape[1]
* masks_detection.shape[2]
),
1,
)
for i in range(0, masks_true.shape[0], step):
ious.append(_mask_iou_batch_s... | Review this code and list any quality issues. | [
{
"issue": "Is this true? I believe our `xyxyxyxy` are, counterintuively, shaped (N, 4, 2).",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import ExtractorError
class RoyaIE(InfoExtractor):
_VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
_TESTS = [{
'url': 'https://roya.tv/live-stream/1',
'info_dict': {
'id': '1',
'title': r're:Roya TV \d{4}-\d{2}-\d... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\nfrom ..utils.traversal import traverse_obj\r\n```",
"severity": "minor",
"line": 2
}
] | 1 |
python | # Sort predictions by scores in descending order
dt_sorted = np.argsort([-d["score"] for d in dt], kind="stable")
dt = [dt[i] for i in dt_sorted[0:max_det]]
# Load computed ious for the given image and category
ious = (
self.ious[img_id, cat_id][:, gt_sorted]
if ... | Review this code and list any quality issues. | [] | 0 |
python | ns[var] = result
elif name == "inherit":
expr = code[2]
value = self._eval(expr, ns, pos)
defs["__inherit__"] = value
elif name == "def":
name = code[2]
signature = code[3]
parts = code[4]
ns[name] = defs[name] = Templat... | Review this code and list any quality issues. | [
{
"issue": "No need to touch this, it is a vendored tool that we use internally for building the random module's templated code. Maybe someday we can use the new t-string formatting.",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert response.text == "Hello, world!"
@pytest.mark.anyio
async def test_100_continue(server):
headers = {"Expect": "100-continue"}
content = b"Echo request body"
async with httpx.AsyncClient() as client:
response = await client.post(
server.url.copy_with(path="/echo_body"), headers=... | Review this code and list any quality issues. | [] | 0 |
python | about = response.get('about')
thumbnails = []
thumbnails.extend(self._get_thumbnails(traverse_obj(about, ('eyecatch', {dict.items})), ''))
if eyecatch_list := about.get('eyecatchList'):
for num, v in enumerate(eyecatch_list):
thumbnails.extend(self._get_thumbnails(v.i... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n **traverse_obj(response, ('identifierGroup', {\r\n 'series': ('radioSeriesName', {str})\r\n 'series_id': ('radioSeriesId', {str})\r\n 'episode': ('radioEpisodeName', {str})\r\n 'episode_id': ('radioEpisodeId', {... | 1 |
python | Crawls a website and returns a dictionary of URLs and their corresponding content.
Parameters:
- url (str): The starting URL to begin the crawl.
- starting_depth (int, optional): The starting depth level for the crawl. Defaults to 1.
Returns:
- Dict[str, str]: A dictionary wher... | Review this code and list any quality issues. | [
{
"issue": "Resets state to match async_crawl() behavior. Without this, reusing the reader would skip previously visited URLs.",
"severity": "minor",
"line": 26
}
] | 1 |
python | ]
test_microvm.spawn()
if test_microvm.jailer.cgroup_ver == 1:
check_cgroups_v1(test_microvm.jailer.cgroups, test_microvm.jailer.jailer_id)
else:
check_cgroups_v2(test_microvm)
def test_cgroups_custom_parent(uvm_plain, cgroups_info):
"""
Test cgroups when a custom parent cgroup i... | Review this code and list any quality issues. | [] | 0 |
python | key.removeprefix("xtts_"): cast_type(self.session[key])
for key, cast_type in {
"xtts_temperature": float,
#"xtts_codec_temperature": float,
"xtts_length_penalty": float,
... | Review this code and list any quality issues. | [] | 0 |
python | # coding: utf-8
from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_get
)
class GofileIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?gofile\.io/d/(?P<id>[^/]+)'
_TESTS = [{
'url': 'https://gofile.io/d/AMZyDw',
'md5': '774879ad31bc62c23269da8bf490d025',
... | Review this code and list any quality issues. | [
{
"issue": "This format of tests is not correct AFAIK. You are returning a playlist but checking for a file. See 4channel on how to write tests for such cases.",
"severity": "minor",
"line": 11
}
] | 1 |
python | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0])}
```
"""
dataset = copy.deepcopy(self)
dataset.set_transform(transform=transform, columns=columns, output_all_columns=output_all_columns)
return dataset
def ma... | Review this code and list any quality issues. | [
{
"issue": "I think you can revert this change and keep it as None by default :)\r\n\r\nIt's also good practice to avoid having lists or dicts as default parameters, since they can be modified inadvertently",
"severity": "minor",
"line": 26
}
] | 1 |
python | """Alarm sensors for the Venstar Thermostat."""
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryE... | Review this code and list any quality issues. | [
{
"issue": "I am not sure why we need an isinstance here. Like previously we checked if it was None, which is fine, but why do we need to be 100% it's a list? Can it be anything else than list or None?",
"severity": "minor",
"line": 23
}
] | 1 |
python | id = mapped_column(StringUUID, nullable=False, server_default=sa.text("uuid_generate_v4()"))
tenant_id = mapped_column(StringUUID, nullable=False)
api_token_id = mapped_column(StringUUID, nullable=False)
path: Mapped[str] = mapped_column(String(255), nullable=False)
request = mapped_column(sa.Text, null... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\nclass MessageAgentThought(TypeBase):\n```\n\nalso?",
"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.