language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
sphere = scene.add_entity( morph=gs.morphs.Sphere(pos=(0.0, 0.0, 1.0), radius=0.3), surface=gs.surfaces.Smooth(color=(1.0, 0.5, 0.5)), ) options = gs.sensors.RasterizerCameraOptions( res=(64, 64), pos=(3.0, 0.0, 1.5), lookat=(0.0, 0.0, 0.5), fov=60.0, ) c...
Review this code and list any quality issues.
[ { "issue": "You can move these imports only top level of this file.", "severity": "minor", "line": 26 } ]
1
python
stream_url = traverse_obj(player_meta, ('initial_event_info', 'endpoint', {url_or_none})) formats = self._extract_m3u8_formats( stream_url, video_id, live=True, fatal=False) if stream_url else [] if not formats: self.raise_no_formats(msg, expected=expected) return { ...
Review this code and list any quality issues.
[ { "issue": "https://github.com/yt-dlp/yt-dlp/pull/7347#discussion_r1234217153\r\n```suggestion\r\n _VALID_URL = r'https?://(?:www.)?zaiko\\.io/account/eticket/(?P<id>[\\w=-]{49})'\r\n```", "severity": "minor", "line": 26 } ]
1
python
HF_METRICS_CACHE = Path(os.getenv("HF_METRICS_CACHE", DEFAULT_HF_METRICS_CACHE)) DEFAULT_HF_MODULES_CACHE = os.path.join(HF_CACHE_HOME, "modules") HF_MODULES_CACHE = Path(os.getenv("HF_MODULES_CACHE", DEFAULT_HF_MODULES_CACHE)) DOWNLOADED_DATASETS_DIR = "downloads" DEFAULT_DOWNLOADED_DATASETS_PATH = os.path.join(HF_D...
Review this code and list any quality issues.
[ { "issue": "Should be easier to read this way (this pattern is used in `huggingface_hub` 🙂 ):\r\n\r\n```suggestion\r\n__HF_TRUST_REMOTE_CODE = os.environ.get(\"HF_TRUST_REMOTE_CODE\")\r\nHF_TRUST_REMOTE_CODE: Optional[bool] = (\r\n__HF_TRUST_REMOTE_CODE.upper() in ENV_VARS_TRUE_VALUES if __HF_TRUST_REMOTE_CODE...
1
python
lookup_id, retry_count, ) await self._ensure_peer_connection(peer_init_url, True) else: break except zmq.ZMQError as e: logger.error( "ZMQ e...
Review this code and list any quality issues.
[ { "issue": "@KuntaiDu here also use `force_update` is `True`", "severity": "minor", "line": 26 } ]
1
python
logger.info(f"{filename} not available for resnet{resnet_depth}") filename = f"{medicalnet_huggingface_files_basename}{resnet_depth}.pth" logger.info(f"Trying with {filename}") pretrained_path = hf_hub_download( repo_id=f"{medicalnet_huggingface_repo_b...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n bias_downsample = resnet_depth in (18, 34)\r\n```\r\n\r\nSlightly simpler, I don't think the comment was accurate anyway given the values being checked.", "severity": "minor", "line": 26 } ]
1
python
batch_size=self.num_layers, fmt=self.fmt, busy_loop=self.force_store_wait, ) if memory_objs_multi_layer is None: logger.warning( "Local cpu memory under pressure so" " choosing to not store the KV cache." ...
Review this code and list any quality issues.
[ { "issue": "QQ: When the `tokens` is a tensor, can we make sure that it's not on the GPU? Otherwise, calling `tolist` will force a d2h copy and cause potential stream sync.", "severity": "minor", "line": 26 } ]
1
python
_PAGE_SIZE = 20 _TESTS = [{ 'url': 'http://www.dailymotion.com/search/king of turtles/videos', 'info_dict': { 'id': 'king of turtles', 'title': 'Dailymotion search of king of turtles', }, 'playlist_mincount': 90, }] def _fetch_page(self, term, page): ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n return self.playlist_result(\r\n OnDemandPagedList(functools.partial(self._fetch_page, term), self._PAGE_SIZE), term, term)\r\n```", "severity": "minor", "line": 26 } ]
1
python
"Failed to update profile" ) from e async def get_my_agents( user_id: str, page: int = 1, page_size: int = 20, ) -> backend.server.v2.store.model.MyAgentsResponse: logger.debug(f"Getting my agents for user {user_id}, page={page}") try: agents_with_max_version = await prisma.models...
Review this code and list any quality issues.
[ { "issue": "Doesn't this cause agents acquired from the marketplace to show up in the \"Publish an agent\" dialog?", "severity": "minor", "line": 26 } ]
1
python
token=self.config.token, ) super().__init__(config=self.config) def _initialize(self): """ This method is needed because `embedder` attribute needs to be set externally before it can be initialized. So it's can't be done in __init__ in one step. """ self._g...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n logging.info(f\"[ZillizDB]: found an existing collection {name}, make sure the auto-id is disabled.\")\r\n```", "severity": "minor", "line": 26 } ]
1
python
"""MixUp as described in: Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, David Lopez-Paz. mixup: Beyond Empirical Risk Minimization, ICLR 2018 Class derived from :py:class:`monai.transforms.Mixer`. See corresponding documentation for details on the constructor parameters. """ def apply(self, ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n data_t = convert_to_tensor(data, track_meta=get_track_meta())\r\n if labels is not None:\r\n labels_t = convert_to_tensor(labels, track_meta=get_track_meta())\r\n```\r\nUnless I missed something these lines were redundant?", "severity": "minor", "li...
1
python
def support(self, *, c, mu, sigma): c, mu, sigma = np.broadcast_arrays(c, mu, sigma) left = np.empty_like(c) left[c >= 0] = -np.inf left[c < 0] = mu[c < 0] + sigma[c < 0] / c[c < 0] right = np.empty_like(c) right[c <= 0] =...
Review this code and list any quality issues.
[ { "issue": "I saw an error in the tests if I didn't manually broadcast the arrays like this in these methods.", "severity": "minor", "line": 26 } ]
1
python
return scene, liquid def get_sph_density_pressure(scene, n_particles): """ Helper function to compute and retrieve density and pressure from SPH solver. This triggers the density computation kernel and returns the computed values. Parameters ---------- scene : gs.Scene The built scen...
Review this code and list any quality issues.
[ { "issue": "Could you clarify in comment why this is needed?", "severity": "minor", "line": 26 } ]
1
python
import functools from fastapi import FastAPI from fastapi.testclient import TestClient from .forward_reference_type import forwardref_method def passthrough(f): @functools.wraps(f) def method(*args, **kwargs): return f(*args, **kwargs) return method def test_wrapped_method_type_inference(): ...
Review this code and list any quality issues.
[]
0
python
webpage, 'login form', default=None) if not form: # already logged in, so no more actions to take. return data = self._hidden_inputs(form) data.update({ 'Email': username, 'Password': password, }) login_webpage = self._download_webpage( ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n }))\r\n```", "severity": "minor", "line": 26 } ]
1
python
value description ========= ================================================== 'auto' automatic; fill the position rectangle with data. 'equal' adapt all the axes to have equal aspect ratios. 'equalxy' adapt the x and y axes to have equal aspect ratios....
Review this code and list any quality issues.
[ { "issue": "The `anchor` and `share` parameters should stay documented as long as they are not removed. You should change the content to\r\n```\r\n anchor : None or str or 2-tuple of float, optional\r\n .. deprecated:: 3.11\r\n This parameter has no effect.\r\n\r\n share ...
1
python
angle = Angle(line1, line2, radius=0.4) value = DecimalNumber(angle.get_value(degrees=True), unit="^{\\circ}") value.next_to(angle, UR) self.add(line1, line2, angle, value) """ if degrees: return self.angle_value / DEGREES ...
Review this code and list any quality issues.
[ { "issue": "The type hints (which are not correctly formatted) should be removed. It would be nice to have better parameter descriptions, maybe:\r\n\r\n- A: The endpoint of the first angle leg\r\n- B: The vertex of the angle\r\n- C: The endpoint of the second angle leg\r\n\r\nor something along these lines.", ...
1
python
self._default_ohlc_inverse = 1.0 / metadata.default_ohlc_ratio ohlc_ratios = metadata.ohlc_ratios_per_sid if ohlc_ratios: self._ohlc_inverses_per_sid = ( valmap(lambda x: 1.0 / x, ohlc_ratios)) else: self._ohlc_inverses_per_sid = None self._minute...
Review this code and list any quality issues.
[ { "issue": "I would recommend storing these as the minute since epoch, since that is what the frame of reference of the other values you are comparing against is.\nThis would avoid an extra `/ NANOS_IN_MINUTE` call every time it is used.", "severity": "minor", "line": 26 } ]
1
python
"dataset#data": [{"image": self.filename}], "postprocessing#transforms#2#output_postfix": "seg", "output_dir": self.data_dir, } # test standard MONAI model-zoo config workflow inferer = ConfigWorkflow( workflow_type="infer", config_file=config_file...
Review this code and list any quality issues.
[ { "issue": "Hi @Nic-Ma ,\r\n When using `LoadImage` , all the meta data is correct for the consequencial preprocessing. However, in a streaming environment, sometimes images are loading from other libraries, how could we ensure that all meta data is ready for using?\r\n\r\nThanks, \r\nBin", "severity": "...
1
python
from openhands.storage.secrets.secrets_store import SecretsStore from openhands.storage.settings.settings_store import SettingsStore async def get_provider_tokens(request: Request) -> PROVIDER_TOKEN_TYPE | None: user_auth = await get_user_auth(request) provider_tokens = await user_auth.get_provider_tokens() ...
Review this code and list any quality issues.
[]
0
python
__len__ = _load_data_wrapper(len) keys = _load_data_wrapper(operator.methodcaller("keys")) values = _load_data_wrapper(operator.methodcaller("values")) items = _load_data_wrapper(operator.methodcaller("items")) # Presentation methods __repr__ = _load_data_wrapper(repr) __str__ = _load_data_wrap...
Review this code and list any quality issues.
[ { "issue": "Do we still need to check whether this path exists? Previously we did: \r\n\r\n```\r\nif user_logging_path and Path(user_logging_path).exists():\r\n```", "severity": "minor", "line": 26 } ]
1
python
"""Ingest common office document types into Document for indexing Document types: - pdf - xlsx, xls - docx, doc Args: pdf_mode: mode for pdf extraction, one of "normal", "mathpix", "ocr" - normal: parse pdf text - mathpix: parse pdf text using mathpix ...
Review this code and list any quality issues.
[]
0
python
from argparse import ArgumentParser from typing import List, Tuple import cv2 import numpy import scipy import facefusion.jobs.job_manager import facefusion.jobs.job_store import facefusion.processors.core as processors from facefusion import config, content_analyser, face_classifier, face_detector, face_landmarker, ...
Review this code and list any quality issues.
[ { "issue": "this belongs to `facefusion/processors/typing.py`", "severity": "minor", "line": 24 } ]
1
python
def hierarchical_model_matrix(self) -> npt.NDArray[np.float64]: if self.parent is None: return self.model_matrix model_matrices = [self.model_matrix] current_object = self while current_object.parent is not None: model_matrices.append(current_object.parent.model_...
Review this code and list any quality issues.
[ { "issue": "Can the `Callable` type annotations used here be made more specific?", "severity": "minor", "line": 26 } ]
1
python
class PromptDataset(Dataset): "A simple dataset to prepare the prompts to generate class images on multiple GPUs." def __init__(self, prompt, num_samples): self.prompt = prompt self.num_samples = num_samples def __len__(self): return self.num_samples def __getitem__(self, inde...
Review this code and list any quality issues.
[]
0
python
# Copyright (c) Microsoft. All rights reserved. import asyncio import datetime import os from azure.core.credentials import AccessToken from azure.core.exceptions import ClientAuthenticationError from azure.identity import DefaultAzureCredential from semantic_kernel.agents import ChatCompletionAgent from semantic_ke...
Review this code and list any quality issues.
[ { "issue": "There's a [default auth callback](https://github.com/microsoft/semantic-kernel/blob/d7a76993876b0bd6f325d92d61b00109c43744a1/python/semantic_kernel/core_plugins/sessions_python_tool/sessions_python_plugin.py#L68C9-L69C70) included with the plugin - can we rely on that? It simplifies the sample quite...
1
python
#!/usr/bin/env python3 import os import re import threading import time import urllib.request from enum import IntEnum import pyray as rl from cereal import log from openpilot.system.hardware import HARDWARE from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.lib.button import ...
Review this code and list any quality issues.
[ { "issue": "No need for two spaces between import and variables", "severity": "minor", "line": 19 } ]
1
python
def _perform_login(self, username, password): self.report_login() form_data = { 'username': username, 'password': password, } payload = urlencode_postdata(form_data) request = sanitized_Request(self._LOGIN_URL, payload) request.add_header('Content-...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if resource['type'] in ('dash', ):\r\n```", "severity": "minor", "line": 26 } ]
1
python
assert "2.44.0.abc123-cpu-aarch64" in tags # Empty platform suffix variant (ray cpu alias) assert "2.44.0.abc123-py310-aarch64" in tags assert "2.44.0.abc123-aarch64" in tags def test_pull_request_tags(self): """Test PR builds include pr-{number} prefix.""" ctx = make_ctx( ...
Review this code and list any quality issues.
[ { "issue": "these are a ton of new tests for a small fix.. are all those tests really needed?", "severity": "minor", "line": 26 } ]
1
python
continue total_hp_mem_mib = hp_mem_mib_per_cycle * (i + 1) uvm.hotplug_memory(total_hp_mem_mib) # Increase /dev/shm size as it defaults to half of the boot memory uvm.ssh.check_output( f"mount -o remount,size={total_hp_mem_mib}M -t tmpfs tmpfs /dev/shm" ) u...
Review this code and list any quality issues.
[ { "issue": "It would be nice to mention in the commit message why we do this change.", "severity": "minor", "line": 26 } ]
1
python
if self._mla_worker_id_as0_mode: key = CacheEngineKey( key.fmt, key.model_name, key.world_size, 0, key.chunk_hash ) t1 = time.perf_counter() future = asyncio.run_coroutine_threadsafe(self.connection.get(key), self.loop) try: memory_obj = futur...
Review this code and list any quality issues.
[ { "issue": "If the connection is `None`, are we planning to re-establish the connection?", "severity": "minor", "line": 26 } ]
1
python
}, { 'url': 'https://tver.jp/lp/f0033031', 'only_matching': True, }] BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s' _PLATFORM_UID = None _PLATFORM_TOKEN = None def _real_initialize(self): create_response = self._download_js...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n webpage = self._download_webpage(url, video_id, note='Resolving to new URL')\r\n video_id = self._match_id(self._search_regex(\r\n (r'canonical\"\\s*href=\"(https?://tver\\.jp/[^\"]+)\"', r'&link=(https?://tver\\.jp/[^?&]+)[?&]'),\r\n```", "...
1
python
>>> from colossalai.booster.plugin import TorchFSDPPlugin >>> >>> model, train_dataset, optimizer, criterion = ... >>> plugin = TorchFSDPPlugin() >>> train_dataloader = plugin.prepare_train_dataloader(train_dataset, batch_size=8) >>> booster = Booster(plugin=plugin) >>> ...
Review this code and list any quality issues.
[ { "issue": "If it supports `no_sync`, please overwrite this method", "severity": "minor", "line": 26 } ]
1
python
# A function where, f(0) = 0, f'(0) = initial speed, f'( f-1(1) ) = final speed # Following function obtained when conditions applied to vertical parabola self.speed_modifier = lambda x, init_speed, final_speed: ( (final_speed**2 - init_speed**2) * x**2 / 4 + init_speed * x ) ...
Review this code and list any quality issues.
[]
0
python
Args: y_pred: input data to compute, typical segmentation model output. It must be one-hot format and first dim is batch, example shape: [16, 3, 32, 32]. The values should be binarized. y: ground truth to compute mean dice metric. `y` can be single-channel class indices or in the...
Review this code and list any quality issues.
[ { "issue": "What is the rationale behind putting the dice code into a class? This class doesn't really have much state, whatever is passed to its constructor could be arguments for the function like in the original version. The code using this class creates a new instance each time as well which doesn't let us ...
1
python
return cast(Model, model), tokenizer def shard_and_load( shard_metadata: ShardMetadata, group: Group, on_timeout: TimeoutCallback | None = None, ) -> tuple[nn.Module, TokenizerWrapper]: model_path = build_model_path(shard_metadata.model_meta.model_id) model, _ = load_model(model_path, lazy=True, ...
Review this code and list any quality issues.
[]
0
python
# error message of desktop webpage is in English raise e def _extract_desktop(self, url): start_time = int_or_none(compat_parse_qs( compat_urllib_parse_urlparse(url).query).get('fromTime', [None])[0]) url, smuggled = unsmuggle_url(url, {}) video_id = self._matc...
Review this code and list any quality issues.
[ { "issue": "line too long\r\n```suggestion\r\n if (error == 'The author of this video has not been found or is blocked'\r\n and not smuggled.get('referrer') and mode == 'videoembed'):\r\n return self._extract_desktop(smuggle_url(url, {'referrer': 'https://boosty.to'}))\r\n```", ...
1
python
radius_config The axis config for the radius. Examples -------- .. manim:: PolarPlaneExample :ref_classes: PolarPlane :save_last_frame: polarplane_pi = PolarPlane(azimuth_units="PI radians", size=6, azimuth_label_scale=0.75, radius_config={'number_scale_value': 0.75}).add_...
Review this code and list any quality issues.
[ { "issue": "`Optional` is supposed to be used when the value of the parameter can be `None`.\r\nhttps://docs.manim.community/en/stable/contributing/documentation.html#path-specifications\r\nsee number 4. under reference type specifications. \r\n```suggestion\r\n azimuth_offset: float = 0,\r\n```", "s...
1
python
self.policy_model, self.optimizer, _, _, self.lr_scheduler = self.booster.boost( self.policy_model, self.optimizer, lr_scheduler=self.lr_scheduler ) self.reference_model, *_ = self.booster.boost(self.reference_model) def step(self, step_idx: int, **kwargs) -> Optional[float]: ""...
Review this code and list any quality issues.
[ { "issue": "It is better to add assert to check that the `forward_batch_size` should be divided by microbatchsize * num_generation", "severity": "major", "line": 26 } ]
1
python
# After a full second, the pool should scale down all the way to 1 await asyncio.sleep(0.3) assert pool.desired_concurrency == 1 finally: pool_run_task.cancel() with suppress(asyncio.CancelledError): await pool_run_task async def test_autoscales_uses_desired_concurrency...
Review this code and list any quality issues.
[ { "issue": "I know that `AutoscaledPool` requires this to be awaitable, but shouldn't it then be defined as async?\r\n\r\n```suggestion\r\n async def is_task_ready_function() -> Awaitable[bool]:\r\n return next(is_task_ready_iterator)\r\n```", "severity": "minor", "line": 26 } ]
1
python
# cached Gaussian is restored. random_state, state = self._create_state() random_state.standard_normal() state = random_state.get_state() old = random_state.standard_normal(size=3) random_state.set_state(state) new = random_state.standard_normal(size=3) assert_(np...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n random_state, _ = self._create_state()\r\n```", "severity": "minor", "line": 26 } ]
1
python
# method. hashed = SeparateBodyFileCache.encode(name) parts = list(hashed[:5]) + [hashed] return os.path.join(self.directory, *parts) def get(self, key: str) -> Optional[bytes]: # The cache entry is only valid if both metadata and body exist. metadata_path = self._get_cache_...
Review this code and list any quality issues.
[ { "issue": "According to the docs these `os.supports_*` attributes may raise `NotImplementedError`: https://docs.python.org/3/library/os.html#files-and-directories\r\n\r\nI think logic to handle this case should be added, pip gets run on a lot of exotic platforms.", "severity": "minor", "line": 26 } ]
1
python
classes="hidden" ) # removing or displaying this widget prevents the bug yield Footer() # clicking "Console" in the footer prevents the bug yield RichLog(classes="hidden") def on_ready(self) -> None: self.query_one(RichLog).write("\n".join(f"line #{i}" for i in...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n RichLog { height: 6; }\r\n```", "severity": "minor", "line": 26 } ]
1
python
PortainerCoordinator, PortainerStackData, ) from .entity import ( PortainerContainerEntity, PortainerCoordinatorData, PortainerStackEntity, ) @dataclass(frozen=True, kw_only=True) class PortainerSwitchEntityDescription(SwitchEntityDescription): """Class to hold Portainer switch description.""" ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n turn_on_fn: Callable[[Portainer], Callable[[int, int], Coroutine[Any, Any, None]]]\r\n turn_off_fn: Callable[[Portainer], Callable[[int, int], Coroutine[Any, Any, None]]]\r\n```", "severity": "minor", "line": 26 } ]
1
python
# - If a linked field is regular and is required in the block schema, require the leaf required_fields: set[str] = set() for link in links: field_name = link.sink_name is_dynamic = is_dynamic_field(field_name) # Always use cleaned field name for property key (Anthropi...
Review this code and list any quality issues.
[]
0
python
def as_yolo( self, images_directory_path: Optional[str] = None, annotations_directory_path: Optional[str] = None, data_yaml_path: Optional[str] = None, min_image_area_percentage: float = 0.0, max_image_area_percentage: float = 1.0, approximation_percentage: float ...
Review this code and list any quality issues.
[]
0
python
'live_server_type': 'hls', }) stream_query = self._common_queries({ 'streamReqId': random_uuidv4(), 'is_lhls': '0', }) m3u8_url = update_url_query(servers['stream_server'] + '/%s_master.m3u8' % video_id, stream_query) formats = self._extract_m3u8_form...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n return {\r\n 'id': result_video_id,\r\n 'title': title,\r\n 'description': description,\r\n 'timestamp': float_or_none(enterstudio.get('live_start_ms'), scale=1000),\r\n```", "severity": "minor", "line": 26 } ]
1
python
res = self._download_xml_handle( mpd_url, video_id, note='Downloading MPD manifest' if note is None else note, errnote='Failed to download MPD manifest' if errnote is None else errnote, fatal=fatal, data=data, headers=headers, query=query) if res is False: ...
Review this code and list any quality issues.
[ { "issue": "Pls explain. Leftover from old impl?", "severity": "minor", "line": 26 } ]
1
python
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import datetime import json import typing from dataclasses import dataclass from pathlib import Path from promptflow._sdk._constants impor...
Review this code and list any quality issues.
[ { "issue": "Move these constants inside the class?", "severity": "minor", "line": 19 } ]
1
python
try: out, content_type = _multipart_encode_impl(data, boundary) break except ValueError: if has_specified_boundary: raise boundary = None return out, content_type def dict_get(d, key_or_keys, default=None, skip_false_values=True): if isi...
Review this code and list any quality issues.
[ { "issue": "unnecessary. You can either use try_get or traverse_obj", "severity": "minor", "line": 26 } ]
1
python
"two", "three", "four", ] def test_escaping_of_angle_brackets(self): """ Check that py-script tags escape angle brackets """ self.pyscript_run( """ <py-script>import js; js.console.log(1<2, 1>2)</py-script> <py-scri...
Review this code and list any quality issues.
[]
0
python
REALS = "reals" FAKES = "fakes" LATENTS = "latents" GLOSS = "g_loss" DLOSS = "d_loss" class PostFix(StrEnum): """Post-fixes.""" @staticmethod def _get_str(prefix: str | None, suffix: str) -> str: return suffix if prefix is None else f"{prefix}_{suffix}" @staticmethod def ...
Review this code and list any quality issues.
[]
0
python
# ============================================================ # CPU # ============================================================ if tag is None: name = 'cpu' tag = 'cpu' return (name, tag, msg) def install_python_packages(self)->bool: ...
Review this code and list any quality issues.
[ { "issue": "The ROCm tag format is incorrect. It should be 'rocm{major}.{minor}' (with a dot separator) to match the torch_matrix entries in lib/conf.py (e.g., 'rocm5.5', 'rocm6.0'). The current format 'rocm{major}{minor}' would produce tags like 'rocm55' instead of 'rocm5.5', causing lookup failures.\n```sugge...
1
python
elif model_engine.bfloat16_enabled(): inputs = inputs.bfloat16() targets = targets.bfloat16() loss = model_engine(inputs, targets) model_engine.backward(loss) pre_clip_norm_groups = optimizer._get_norm_groups() pre_clip_global_norm = torch.linal...
Review this code and list any quality issues.
[ { "issue": "Please remove the `print()` so the unit test is not noisy", "severity": "minor", "line": 26 } ]
1
python
@pytest.mark.parametrize("k", [0, 3, -3, 8]) def test_diag_extraction(k): # when input 2d-array is a square numpy array: x = np.arange(64).reshape((8, 8)) assert_eq(da.diag(x, k), np.diag(x, k)) # when input 2d-array is a square dask array: d = da.from_array(x, chunks=(4, 4)) assert_eq(da.diag(d...
Review this code and list any quality issues.
[]
0
python
display_name="Claude Sonnet 4.6", type="model", ), ModelInfo( id="claude-opus-4-6", created_at=datetime.datetime(2026, 2, 4, 0, 0, tzinfo=datetime.UTC), display_name="Claude Opus 4.6", type="model", ), ...
Review this code and list any quality issues.
[]
0
python
tock = loader.TockLoader(args) tock.open() tabs = [tab.TAB(tab_filename)] try: tock.install(tabs, replace="yes", erase=args.erase) except TockLoaderException as e: fatal("Couldn't install Tock application {}: {}".format( self.args.application, str(e))) def get_padding(self): ...
Review this code and list any quality issues.
[]
0
python
) # Pull out video url = status['media_attachments'][0]['url'] # Return the stuff uploader_id = strip_or_none(traverse_obj(status, ('account', 'username'))) post = strip_or_none(clean_html(status.get('content'))) # Set the title, handling case where its too long or emp...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'uploader_url': format_field(uploader_id, None, 'https://truthsocial.com/@%s'),\r\n```", "severity": "minor", "line": 26 } ]
1
python
def assert_set_equal(result, expected, path=(), msg='', **kwargs): _check_sets( result, expected, msg, path, 'element', ) @assert_equal.register(np.ndarray, np.ndarray) def assert_array_equal(result, expected, path=(), ...
Review this code and list any quality issues.
[ { "issue": "You probably also want to handle `'m'` (timedelta) the same way. I'd write that check as:\r\n\r\n```\r\nif result.dtype.kind in 'mM' and expected.dtype == result.dtype:\r\n```", "severity": "minor", "line": 26 } ]
1
python
continue for standard_format in formats_list: if not isinstance(standard_format, dict): continue for standard_format_key in ('url', 'fallback'): standard_url = standard_format....
Review this code and list any quality issues.
[ { "issue": "`xplayerSettings2` seems to work", "severity": "minor", "line": 26 } ]
1
python
'artist': 'Alien Bubblegum', 'genre': 'Punk', 'thumbnail': 'https://mx3.ch/pictures/mx3/file/0101/1551/square_xlarge/pandora-s-box-cover-with-title.png?1627054733', 'title': 'Alien Bubblegum - Wide Awake', } }] def _real_extract(self, url): track_id = self._m...
Review this code and list any quality issues.
[ { "issue": "You can add the file size:\r\n```suggestion\r\n fmt['ext'] = urlhandle_detect_ext(urlh)\r\n fmt['filesize'] = int_or_none(urlh.headers.get('Content-Length'))\r\n```\r\nimport `int_or_none` from `..utils`", "severity": "minor", "line": 26 } ]
1
python
if len(video_data) > 1: entries = [] for v in video_data: video_url = v[0].get('video_url') if not video_url: continue entries.append(self.url_result(urljoin( url, video_url), self.ie_key(), v[0].get('video_i...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n # sd, hd formats w/o resolution info should be deprioritized below DASH\r\n # TODO: investigate if progressive or src formats still exist\r\n preference = -10 if format_id == 'progressive' else -3\r\n```", "se...
1
python
"""Test that instructions are appended after all system prompts in the system prompt string.""" m = AnthropicModel('claude-sonnet-4-5', provider=AnthropicProvider(api_key='test-key')) messages: list[ModelRequest | ModelResponse] = [ ModelRequest( parts=[ SystemPromptPart(con...
Review this code and list any quality issues.
[ { "issue": "I'd prefer `assert anthropic_messages == snapshot()`", "severity": "minor", "line": 26 } ]
1
python
returns = Returns(window_length=window_length) today = datetime64(1, 'ns') assets = arange(3) seed(seed_value) # Seed so we get deterministic results. test_data = abs(randn(window_length, 3)) # Calculate the expected returns expected = (test_data[-1] - test_data[0]) /...
Review this code and list any quality issues.
[ { "issue": "I think we still probably want a length-1 list of inputs here rather than an empty tuple. Ideally, we'd use `SingleInputMixin` to require exactly one input.", "severity": "minor", "line": 26 } ]
1
python
) this_is_a_ridiculously_long_name_and_nobody_in_their_right_mind_would_use_one_like_it = ( 1 # with a comment ) this_is_a_ridiculously_long_name_and_nobody_in_their_right_mind_would_use_one_like_it = [ 1, 2, 3, ] this_is_a_ridiculously_long_name_and_nobody_in_their_right_mind_would_use_one_like_it = (...
Review this code and list any quality issues.
[ { "issue": "Note: formatting improvements!", "severity": "minor", "line": 26 } ]
1
python
((i * period + phase_shift) % (1 + void_len)) for i in range(n) ] dash_ends = [ ((i * period + dash_len + phase_shift) % (1 + void_len)) for i in range(n) ] # due to phase shift being [0...1] range, always the last ...
Review this code and list any quality issues.
[ { "issue": "Again, matter of taste. Feel free to leave as-is.\r\n\r\n```suggestion\r\n elif dash_ends[-1] < dash_len: # if it overflowed\r\n if dash_starts[-1] < 1: # if the beginning of the piece is still in range\r\n dash_starts.append(0)\r\n ...
1
python
for eid in target_climates: set_or_remove_state(hass, eid, states[0]["included"]) await hass.async_block_till_done() await arm_trigger(hass, trigger, trigger_options, trigger_target_config) for state in states[1:]: included_state = state["included"] set_or_remove_state(hass, en...
Review this code and list any quality issues.
[]
0
python
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. # pylint: disable=missing-docstring from typing import Any import os import subprocess import shutil import sys from w...
Review this code and list any quality issues.
[ { "issue": "The ` around gh here probably won't work as we want? Maybe something else to do the format.", "severity": "minor", "line": 26 } ]
1
python
[[time(microsecond=7)]], ), ( pl.Array(pl.Array(pl.UInt8(), 2), 2), b"\x01\x02\x03\x04", [[[1, 2], [3, 4]]], ), ( pl.Array(pl.Int128(), 1), b"\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", [[6]], ...
Review this code and list any quality issues.
[ { "issue": "Can we also add tests for `endianness=\"big\"`", "severity": "minor", "line": 26 } ]
1
python
Args: cmd: List of command parts. **kwargs: Optional keyword arguments passed to `subprocess.run`. Raises: click.exceptions.Exit: If `subprocess.run` returns non-zero code. """ click.echo(" ".join(shlex.quote(c) for c in cmd)) code = subprocess.run(cmd, **kwargs).returncode # n...
Review this code and list any quality issues.
[ { "issue": "Just found out that this function exists after doing this PR, and I noticed that it's used in all the starters...", "severity": "minor", "line": 26 } ]
1
python
# coding: utf-8 from __future__ import unicode_literals import re import json from yt_dlp.extractor.common import InfoExtractor from yt_dlp.compat import ( compat_HTTPError, ) from yt_dlp.utils import ( ExtractorError, urlencode_postdata, ) class DigitalConcertHallIE(InfoExtractor): IE_DESC = 'Digi...
Review this code and list any quality issues.
[ { "issue": "inline this variable. it's used only once", "severity": "minor", "line": 21 } ]
1
python
from __future__ import annotations from .. import config, logger from .plugins_flags import get_plugins, list_plugins __all__ = [ "get_plugins", "list_plugins", ] requested_plugins: set[str] = set(config["plugins"]) missing_plugins = requested_plugins - set(get_plugins().keys()) if missing_plugins: log...
Review this code and list any quality issues.
[ { "issue": "```suggestion\nfrom manim._config import config, logger\n```\nI believe MrDiver and Chopan were trying to move away from these kinds of imports.", "severity": "minor", "line": 3 } ]
1
python
'info_dict': { 'id': '4760120', 'title': 'Feltételeket szabott a főváros', 'ext': 'mp4', 'thumbnail': 'http://hirado.hu/wp-content/uploads/sites/4/2021/09/vlcsnap-2021-09-01-20h20m37s165.jpg' } }, { # petofilive 'url': 'https://petofilive.hu/vi...
Review this code and list any quality issues.
[ { "issue": "display_id was originally used as the id in the original PR, but I found contentId.\r\n\r\nthinking we shouldn't have this fallback and have it error if it can't find the contentId?", "severity": "minor", "line": 26 } ]
1
python
await check("py1.5") await check("2") await check("2.7") await check("py2.7") await check("2.8") await check("py2.8") await check("3.0") await check("pypy3.0") await check("jython3.4") @unittest_run_loop async def test_blackd_pyi(self) -> None: ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n source, _ = read_data(\"miscellaneous\", \"blackd_diff\")\r\n```", "severity": "minor", "line": 26 } ]
1
python
logging_level=logging.INFO, ) try: yield self finally: if self.executor_proxy: async_run_allowing_running_loop(self.executor_proxy.destroy) self._within_init_context = False def resolve_dat...
Review this code and list any quality issues.
[]
0
python
overload, ) from opentelemetry import trace from .. import llm from ..llm import function_tool, utils as llm_utils from ..telemetry import trace_types, tracer from ..types import NOT_GIVEN, NotGivenOr from ..utils import is_given from .speech_handle import SpeechHandle if TYPE_CHECKING: from .agent import Agent ...
Review this code and list any quality issues.
[ { "issue": "I think we may not need to duplicate `create_at`, we not have an AgentHandoff item in 1.3", "severity": "major", "line": 26 } ]
1
python
agent_pattern, replace_agent_model, code, flags=re.DOTALL, ) # Build attributes string attrs_str = f' {{{attrs}}}' if attrs else '' # Indent code lines for proper markdown formatting within tabs # Always add 4 spaces to every line (even empty ones) to preserve annotations ...
Review this code and list any quality issues.
[ { "issue": "Should this really be the first tab? As much as we want to drive people to the Gateway, most people won't, and this may turn them off.", "severity": "minor", "line": 26 } ]
1
python
(SERVICE_PUBLISH, "publish"), (SERVICE_CLEAR, "clear"), (SERVICE_DELETE, "delete"), ], ) async def test_send_message_reauth_flow( hass: HomeAssistant, config_entry: MockConfigEntry, mock_aiontfy: AsyncMock, service: str, call_method, ) -> None: """Test unauthorized exception ...
Review this code and list any quality issues.
[]
0
python
for match in CMAKE_FUNCTION_RE.finditer(text): name = match.group(4) signature = match.group(1).strip() if signature.startswith(name): description, brief, params = process_commands(match.group(2).replace('#', ''), name, group, signature...
Review this code and list any quality issues.
[ { "issue": "`name` isn't used here, so I guess you could even simplify this to `for row in sorted(all_functions.values(), key=sort_functions):` ?", "severity": "major", "line": 26 } ]
1
python
'id': '101569', 'display_id': 'triple-threat-with-lia-lor-malena-morgan-and-dani-daniels', 'ext': 'mp4', 'title': 'Triple Threat With Lia Lor, Malena Morgan And Dani Daniels', 'description': 'md5:285357d9d3a00ce5acb29f39f826dbf6', 'uploader': 'PatrickBush', ...
Review this code and list any quality issues.
[ { "issue": "Add this to `js_to_json` and use it", "severity": "minor", "line": 26 } ]
1
python
Parameters ---------- root_dir : str | Path The root directory of the project. Will search for the config file in this directory. config_filepath : str | Path | None The path to the config file. If None, searches for config file in root and if not found creates a default conf...
Review this code and list any quality issues.
[ { "issue": "Could we change to Path in the signature? Wonder if we can reduce our faulty approach of supporting that many types in method signatures :)", "severity": "minor", "line": 26 } ]
1
python
timer = [None] ping_lock = threading.Lock() current_time = [0] ping_url = info_dict['_bunnycdn_ping_data']['url'] headers = info_dict['_bunnycdn_ping_data']['headers'] secret = info_dict['_bunnycdn_ping_data']['secret'] context_id = info_dict['_bunnycdn_ping_data']['cont...
Review this code and list any quality issues.
[ { "issue": "`except network_exceptions` maybe?", "severity": "minor", "line": 26 } ]
1
python
maxiter=None, disp=False, return_all=False, callback=None, inexact=True, subproblem_maxiter=None, **unknown_options): """ Minimization of scalar function of one or more variables using a trust-region algorithm. Options for the trust-region algorithm...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n subproblem_maxiter : int, optional\r\n```", "severity": "minor", "line": 26 } ]
1
python
- GRAPH_DATABASE_PROVIDER: "kuzu" (default), "neo4j" """ tasks = [ Task(resolve_data_directories, include_subdirectories=True), Task(ingest_data, dataset_name, user, node_set, dataset_id, preferred_loaders), ] await setup() if not user: user = await get_default_user() ...
Review this code and list any quality issues.
[ { "issue": "Is there a way this can happen if we're creating a dataset just before? Maybe this kind of check should be part of the create function if necessary", "severity": "minor", "line": 26 } ]
1
python
bar_data = self.create_bardata( simulation_dt_func=lambda: minute, ) self.assertFalse(bar_data.can_trade(self.ASSET1)) def test_can_trade_equity_same_cal_exchange_closed(self): # verify that can_trade returns true for minutes that are # outside the asset's c...
Review this code and list any quality issues.
[]
0
python
i_j = links_info.joint_start[I_l] I_j = [i_j, i_b] if ti.static(static_rigid_sim_config.batch_joints_info) else i_j joint_type = joints_info.type[I_j] if joint_type == gs.JOINT_TYPE.FREE: pos = ti.Vector( [ ...
Review this code and list any quality issues.
[ { "issue": "I don't think atomic add should be used here.", "severity": "minor", "line": 26 } ]
1
python
import rich from airflowctl.api.client import NEW_API_CLIENT, Client, ClientKind, provide_api_client from airflowctl.api.datamodels.generated import ( BulkActionOnExistence, BulkBodyPoolBody, BulkCreateActionPoolBody, PoolBody, ) @provide_api_client(kind=ClientKind.CLI) def import_(args, api_client: ...
Review this code and list any quality issues.
[ { "issue": "Ok. \"all\" was a bit too much. Pool export does bit contain sensitive data, so we should not remove it.", "severity": "critical", "line": 26 } ]
1
python
raise ImportError( 'Please install the `starlette` package to use `Agent.to_ag_ui()` method, ' 'you can use the `ag-ui` optional group — `pip install "pydantic-ai-slim[ag-ui]"`' ) from e __all__ = [ 'SSE_CONTENT_TYPE', 'StateDeps', 'StateHandler', 'AGUIApp', 'AgentRunCallback', ...
Review this code and list any quality issues.
[ { "issue": "Python 3.9 requires us to use a `Union` here instead of `|`", "severity": "minor", "line": 26 } ]
1
python
try: requested = orderedSet_from_options(values, collections.ChainMap(aliases, {'all': allowed_values}), start=getattr(parser.values, option.dest)) except ValueError as e: raise optparse.OptionValueError(f'wrong {option.metavar} for {opt_st...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n keys, val = variadic(default_key), value\r\n```", "severity": "minor", "line": 26 } ]
1
python
Notes ----- `float16` is not officially part of the Array API spec at the time of writing but scikit-learn estimators and functions can choose to accept it when xp.float16 is defined. Additionally, some devices available within a namespace may not support all floating-point types that the names...
Review this code and list any quality issues.
[ { "issue": "I would rather move that to a new `sklearn/utils/_dataframe.py` submodule instead of duplication.", "severity": "minor", "line": 26 } ]
1
python
def moment(self, order, *args, **kwargs): return super().moment(order, *args, **kwargs) def stats(self, *args, **kwargs): return super().stats(*args, **kwargs) def std(self, *args, **kwargs): return super().std(*args, **kwargs) def support(self, *args, **kwargs): return su...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n doc['Parameters'] = [p for p in doc['Parameters'] if p.name != 'scale']\r\n```", "severity": "minor", "line": 26 } ]
1
python
"color": GREY, "axis_config": { "stroke_color": LIGHT_GREY, }, "axis_config": { "color": GREY, }, "background_line_style": { "stroke_color": GREY, "stroke_width": 1, }, }, ...
Review this code and list any quality issues.
[]
0
python
This can be used to reduce or increase the number of partitions of the bag. """ if npartitions == bag.npartitions: return bag new_name = f"repartition-{npartitions}-{tokenize(bag, npartitions)}" if bag.npartitions > npartitions: ratio = bag.npartitions / npartitions new_part...
Review this code and list any quality issues.
[ { "issue": "This comment about copy seems important. is it necessary to remove the copy?", "severity": "minor", "line": 26 } ]
1
python
raise SkipTest("wallet has not been compiled.") def skip_if_no_wallet_tool(self): """Skip the running test if bitcoin-wallet has not been compiled.""" if not self.is_wallet_tool_compiled(): raise SkipTest("bitcoin-wallet has not been compiled") def skip_if_no_bitcoin_tx(self): ...
Review this code and list any quality issues.
[ { "issue": "Debatable if it should be `bitcoin_bench` (https://github.com/bitcoin/bitcoin/pull/33142/files#diff-e20e1f68486e5c096fdc11bca1cda063aacef524411f011d9c3497eb650c5eafR265) or `bench_bitcoin` (https://github.com/bitcoin/bitcoin/pull/33142/files#diff-e20e1f68486e5c096fdc11bca1cda063aacef524411f011d9c349...
1
python
sections_output_dir : :class:`pathlib.Path` where are section videos stored output_name : str name of movie without extension and basis for section video names Some useful attributes are: "write_to_movie" (bool=False) Whether or not to write the animations into ...
Review this code and list any quality issues.
[ { "issue": "I would say that the `scene_name` parameter itself should always be a string, because:\r\n- the name (`scene_name`) suggests a string, not a path\r\n- currently, only strings are passed as `scene_name` in the source code as well\r\n\r\nSo, instead of doing this conversion to string here, I suggest c...
1
python
if code is None and (verbose or report.change_count or report.failure_count): out() out(error_msg if report.return_code else "All done! ✨ 🍰 ✨") if code is None: click.echo(str(report), err=True) ctx.exit(report.return_code) def get_sources( *, ctx: click.Context, ...
Review this code and list any quality issues.
[ { "issue": "Wouldn't it be simpler to do the initialization (`re_compile_maybe_verbose(DEFAULT_EXCLUDES)` and `get_gitignore(root)`) here? We may waste a little time in the case where we formatting stdin only, but we avoid the confusing `_`-prefixed variables.", "severity": "minor", "line": 26 } ]
1
python
def bar(self, a): return a ** self.b assert_array_equal(vectorize(Foo().bar)(np.arange(9)), np.arange(9) ** 2) assert_array_equal(vectorize(Foo.bar)(Foo(), np.arange(9)), np.arange(9) ** 2) def test_execution_order_ticket_1487(s...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n def test_dtype_promotion_gh_29189(self):\r\n```\r\n(You can't know, but \"ticket\" refers to the track NumPy was running before github.)", "severity": "minor", "line": 26 } ]
1
python
if not is_allowed_url(url): return http_error(400, "Invalid File URL source. Only S3, Dropbox, GitHub, Google Drive and Azure Blob URLs are allowed.") data["file"] = clear_filename(data["name"]) config = Config() is_cloud = config.get("cloud", False) if i...
Review this code and list any quality issues.
[ { "issue": "let also change error message to `f\"Upload limit for file is {MAX_FILE_SIZE >> 20}MB\"`", "severity": "minor", "line": 26 } ]
1
python
@pytest.mark.parametrize("dropna", [False, True, None]) def test_groupby_dropna_pandas(dropna): # The `dropna` arg is not currently supported by pandas # (See #https://github.com/pandas-dev/pandas/pull/21669) # Dask supports the argument for the cudf backend, # but should raise an error for pandas. ...
Review this code and list any quality issues.
[ { "issue": "@mrocklin @TomAugspurger I imagine that we *don't* want a cudf-specific test like this in dask, but do you have any thoughts on a `dropna` test that would be covered by CI? Is `test_groupby_dropna_pandas` sufficient?", "severity": "minor", "line": 26 } ]
1
python
# Copyright 2025 - Oumi # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
Review this code and list any quality issues.
[ { "issue": "Please add tests for this method.", "severity": "minor", "line": 20 } ]
1
python
return real_val def quantize_weight(self, wrapper, **kwargs): config = wrapper.config module = wrapper.module input = kwargs['input_tensor'] # pylint: disable=redefined-builtin weight = copy.deepcopy(wrapper.module.old_weight.data) weight_bits = get_bits_length(config, 'wei...
Review this code and list any quality issues.
[ { "issue": "I will rebase this pr when #3904 is merged into master", "severity": "minor", "line": 26 } ]
1