language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
const char* source; const int length; }; #define DECLARE_JS_CODES \\ struct js_source_all js_codes[] = \\ { \\''' def extract_name(path): special_chars = re.compile(r'[-\\?\'".]') return special_chars.sub('_', os.path.splitext(os.path.basename(path))[0]) def reduce_code(code): code = re.sub(re.compil...
Review this code and list any quality issues.
[ { "issue": "Do we still need the `\\0` here?", "severity": "minor", "line": 26 } ]
1
python
thumbnails = [] i = 0 for source in playback_xml.iterfind( './Period/SupplementalProperty/nvod:Thumbnails/nvod:ThumbnailSet/nvod:Thumbnail/nvod:Source', NS_MAP, ): thumbnails.append({'id': str(i), 'url': source.text.split('?')[0]}) i += 1 ...
Review this code and list any quality issues.
[ { "issue": "Can be combined in to a single `traverse_obj` call:\r\n```suggestion\r\n return {\r\n 'id': video_id,\r\n 'formats': formats,\r\n 'subtitles': subtitles,\r\n **traverse_obj(video_meta, {\r\n 'title': ('videoTitle', {str}),\r\n ...
1
python
def __init__(self, model: TypeChatModel, target_type: type[T]): super().__init__() self._validator = TypeChatValidator(target_type) self._translator = TypeChatTranslator(model, self._validator, target_type) async def handle_request(self, line: str): result = await self._transl...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n async def _handle_json_program_call(self, func: str, args: list[int | float]):\r\n```", "severity": "minor", "line": 26 } ]
1
python
break i, name = i + 1, f'{opt_name}-{i}' # Multiple param groups for the same schduler param_groups = sch.optimizer.param_groups if len(param_groups) != 1: for i, pg in enumerate(param_groups): temp = f'{name}/pg{i + 1}' ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n )\r\n\r\n should_log = should_log and trainer.fast_dev_run\r\n return should_log\r\n```", "severity": "minor", "line": 26 } ]
1
python
def _real_extract(self, url): video_uuid = self._match_id(url) metadata = self._download_json(self._VIDEO_METADATA_URL % video_uuid, video_uuid) video_id = None title = None for section in metadata.get('sections', {}): if section.get('type') == 'Player': ...
Review this code and list any quality issues.
[ { "issue": "And then we can inline the metadata extraction \r\n```suggestion\r\n return self.url_result(\r\n self._BC_URL_TMPL.format(brightcove_video_id), BrightcoveNewIE, brightcove_video_id,\r\n url_transparent=True,\r\n **traverse_obj(metadata, ('sections', lambda _, ...
1
python
) ) def _not_support_combined_queries(self, operation_name): if self.query.combinator: raise NotSupportedError( "Calling QuerySet.%s() after %s() is not supported." % (operation_name, self.query.combinator) ) def _check_operator_query...
Review this code and list any quality issues.
[ { "issue": "Could we avoid the extra indentation level and nested `if`, since all the checks need to hold as an `and`?\n\n```suggestion\n if (\n isinstance(self.query.group_by, tuple)\n # Raise if the pk fields are not in the group_by.\n and self.model._meta.pk\n ...
1
python
def generate(self, num_blocks, **kwargs): """Generate blocks with coinbase outputs to the internal address, and call rescan_utxos""" blocks = self._test_node.generatetodescriptor(num_blocks, self.get_descriptor(), **kwargs) # Calling rescan_utxos here makes sure that after a generate the utxo ...
Review this code and list any quality issues.
[]
0
python
""" def __init__(self, worker, worker_add_run_status=True): self.worker = worker self.task_groups = _summary_dict(worker) self.summary_detailed = summary(worker) self.summary, smiley, _ = self._progress_summary() self.status = True if smiley == ":)" else False self.st...
Review this code and list any quality issues.
[ { "issue": "Where is this logic encoded in current implementation?", "severity": "minor", "line": 26 } ]
1
python
field_class=fields.CharField, default='', allow_blank=True, encrypted=False, read_only=False, label=_('Red Hat Client ID for Analytics'), help_text=_('This client ID is used to send data to Automation Analytics'), category=_('System'), category_slug='system', ) register( 'REDHAT_PAS...
Review this code and list any quality issues.
[ { "issue": "Let me talk this out loud - there is no way to migrate old->new via a data migration, is that correct?\r\n\r\nSo we're just going to drop the old settings.", "severity": "minor", "line": 26 } ]
1
python
pos=(3.0, 0.0, 1.5), lookat=(0.0, 0.0, 0.5), fov=60.0, ) camera = scene.add_sensor(options) n_envs = 2 scene.build(n_envs=n_envs) sphere.set_pos([[0.0, 0.0, 1.0], [0.2, 0.0, 0.5]]) scene.step() data = camera.read() assert data.rgb.shape == (2, 64, 64, 3) assert da...
Review this code and list any quality issues.
[ { "issue": "Just do `rgb_array_to_png_bytes(data.rgb[i]) == png_snapshot`", "severity": "minor", "line": 26 } ]
1
python
"""The model name.""" return f'fallback:{",".join(model.model_name for model in self.models)}' @property def model_id(self) -> str: """The fully qualified model identifier, combining the wrapped models' IDs.""" return f'fallback:{",".join(model.model_id for model in self.models)}' ...
Review this code and list any quality issues.
[]
0
python
for slot in self.slots: if isinstance(slot, str): for name, value in kwargs.items(): if not isinstance(value, str): raise RuntimeError(f"Expected a string, got {value}") slot = slot.replace("{{" + name + "}}", value, 1) ...
Review this code and list any quality issues.
[ { "issue": "can we use `thought_words[0] = thought_words[0].strip()` to remove the `\\n` before regex match?", "severity": "minor", "line": 26 } ]
1
python
if CrunchyrollBaseIE._AUTH_HEADERS and CrunchyrollBaseIE._AUTH_REFRESH > time_seconds(): return if not CrunchyrollBaseIE._BASIC_AUTH: cx_api_param = self._CLIENT_ID[self.is_logged_in] self.write_debug(f'Using cxApiParam={cx_api_param}') CrunchyrollBaseIE._BASIC_A...
Review this code and list any quality issues.
[ { "issue": "Why save the access token and not decode the token and set `self.is_premium` here immediately?", "severity": "minor", "line": 26 } ]
1
python
from .common import InfoExtractor from ..utils import ExtractorError, traverse_obj class RudoVideoIE(InfoExtractor): _VALID_URL = r'https?://rudo\.video/live/(?P<id>[^/]+)' def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) if...
Review this code and list any quality issues.
[ { "issue": "Use single quotes\r\n```suggestion\r\n if 'Streaming is not available in your area.' in webpage:\r\n```", "severity": "minor", "line": 12 } ]
1
python
layers alternate. Increasing this step reduces the total number of experts, making the model more dense-like, which can improve training stability but reduces the total parameter capacity. use_qk_norm (`bool`, *optional*, defaults to `True`): Whether to normalize the Query and Key matric...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n Chunk size for the attention computation. Smaller value enforces more local attention and lowers memory.\n```", "severity": "major", "line": 26 } ]
1
python
def test_s3_multipart(self): # Create the bucket bucket = self.create_bucket_resource(self.bucket_name) bucket.wait_until_exists() # Create the multipart upload mpu = bucket.Object('mp-test.txt').initiate_multipart_upload() self.addCleanup(mpu.abort) # Create an...
Review this code and list any quality issues.
[ { "issue": "This test doesn't assert anything. What about downloading the object and verifying its contents are `b'hello, world!'`?", "severity": "minor", "line": 26 } ]
1
python
assert len(_ScenarioManager._get_primary_scenarios()) == 0 assert len(_ScenarioManager._get_all_by_cycle(cycle_1)) == 2 _ScenarioManager._set_primary(scenario_1) assert len(_ScenarioManager._get_primary_scenarios()) == 1 assert len(_ScenarioManager._get_all_by_cycle(cycle_1)) == 2 assert _Scenario...
Review this code and list any quality issues.
[ { "issue": "E501 Line too long \r\n\r\n```suggestion\r\n scenario_2 = _ScenarioManager._create(scenario_2_cfg,\r\n name=\"A_scenario\",\r\n creation_date=datetime.now() + timedelta(days=2))\r\n scenario_3 = _ScenarioManager....
1
python
from typing import TYPE_CHECKING import numpy as np import taichi as ti import torch import genesis as gs from genesis.options.solvers import CouplerOptions, SAPCouplerOptions from genesis.repr_base import RBC if TYPE_CHECKING: from genesis.engine.simulator import Simulator @ti.data_oriented class Coupler(RBC): ...
Review this code and list any quality issues.
[ { "issue": "Can you fix import formatting / ordering while you are here. \r\n\r\nHere is the rule: You should first import standards libraries, skip line, then ubiquitous third-party libraries (torch, numpy, tqdm...etc), skip line, then random third-party libraries, skip line, then our own custom libraries, ski...
1
python
scene=annotated_frame, detections=detections ) annotated_frame = box_annotator.annotate( scene=annotated_frame, detections=detections ) annotated_frame = label_annotator.annotate( scene=annotated_frame, detections=detections, labels=labels ...
Review this code and list any quality issues.
[ { "issue": "The error message for insufficient arguments should provide more helpful guidance. Consider specifying what arguments are required and providing a usage example, such as: \"Usage: script.py source_video_path target_video_path [confidence_threshold] [iou_threshold]\"\n```suggestion\n scrip...
1
python
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import fire from qlib.tests.data import GetData if __name__ == "__main__": fire.Fire(GetData().qlib_data)
Review this code and list any quality issues.
[ { "issue": "Are you sure this will work correctly for previous commands?", "severity": "minor", "line": 9 } ]
1
python
# download a single file from url, also use `args_file` with tempfile.TemporaryDirectory() as tempdir: def_args = {"name": bundle_name, "bundle_dir": tempdir, "version": version} def_args_file = os.path.join(tempdir, "def_args.json") parser = ConfigParser() ...
Review this code and list any quality issues.
[]
0
python
return True else: return True except Exception as e: error = f'_check_bark_npz() error: {e}' print(error) return False def _tensor_type(self,audio_data:Any)->torch.Tensor: if isinstance(audio_data, torch.Tensor): re...
Review this code and list any quality issues.
[]
0
python
import json import os as _os _basepath = _os.path.dirname(__file__) _filepath = _os.path.abspath(_os.path.join(_basepath, 'package.json')) with open(_filepath) as f: package = json.load(f) package_name = package['name'].replace(' ', '_').replace('-', '_') __version__ = package['version'] from ._imports_ import *...
Review this code and list any quality issues.
[]
0
python
agent_input = node_data.agent_parameters[parameter_name] if agent_input.type == "variable": variable = variable_pool.get(agent_input.value) # type: ignore if variable is None: raise AgentVariableNotFoundError(str(agent_input.value)) parame...
Review this code and list any quality issues.
[ { "issue": "This assignment assigns a variable to itself.\n```suggestion\n # If decoding fails, keep the original string value in parameter_value.\n pass\n```", "severity": "critical", "line": 26 } ]
1
python
old_cursor = cursor cursor = traverse_obj( response, ('itemList', -1, 'createTime', {lambda x: x * 1E3}, {int_or_none})) if not cursor: cursor = old_cursor - 604800000 # jump 1 week back in time if cursor < 1472706000000 or not traverse_obj(response, ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if url.startswith('tiktokuser:'):\r\n sec_uid, user_name = self._match_id(url), None\r\n else:\r\n sec_uid, user_name = None, self._match_id(url)\r\n```", "severity": "minor", "line": 26 } ]
1
python
d30 = dep_graph[FactorTask(product=30).task_id] self.assertEqual(sorted(d30[u'deps']), sorted([FactorTask(product=15).task_id, FactorTask(product=2).task_id])) d2 = dep_graph[FactorTask(product=2).task_id] self.assertEqual(sorted(d2[u'deps']), []) d15 = dep_graph[FactorTask(product=15)...
Review this code and list any quality issues.
[]
0
python
base_class_name = base_class_name.replace("Ptr<","").replace(">","").strip() if base_class_name in self.classes: self.classes[base_class_name].has_smart_ptr = True else: print(base_class_name, ' not found in classes for registering smart pointer us...
Review this code and list any quality issues.
[ { "issue": "This indentation change modifies the logic behavior. Previously, the `for key in type_dict` loop ran for all return types. Now it only runs when `ret_type.startswith('Ptr')`. This means type substitutions from `type_dict` (like `InputArray` → `const cv::Mat&`) will no longer be applied to non-pointe...
1
python
# Call setup function, if any if event.setup: event.setup() # Send mouse events to the application if event.mouse_events: with gui_app._mouse._lock: gui_app._mouse._events.extend(event.mouse_events) # Move to next script event script_index += 1 # Keep sending...
Review this code and list any quality issues.
[ { "issue": "The help text mentions \"tizi/tici\" but the code only supports \"tizi\". Consider updating the help text to just say \"tizi\" or clarifying the relationship between tizi and tici, since the variant is set to \"tizi\" when --big is used.\n```suggestion\n parser.add_argument('--big', action='store_t...
1
python
from ..extras.misc import find_available_port, get_device_count from ..hparams import ( DataArguments, FinetuningArguments, GeneratingArguments, ModelArguments, ) from ..model import load_config, load_tokenizer from ..model.model_utils.quantization import QuantizationMethod from .base_engine import Base...
Review this code and list any quality issues.
[ { "issue": "We could docs it here: Note that SGLangEngine is using the https server for better interaction. See the docs of SGLang: https://docs.sglang.ai/backend/send_request.html", "severity": "minor", "line": 26 } ]
1
python
url=url, method=method, headers=dict(headers) if headers else None, content=payload, extensions={'crawlee_session': session if self._persist_cookies_per_session else None}, ) try: response = await client.send(http_request) except httpx...
Review this code and list any quality issues.
[ { "issue": "I checked now and it looks like the `transport` doesn't need to know the proxy URL since proxying is handled by the `httpx.AsyncClient` (it creates a separate transport for that).", "severity": "minor", "line": 26 } ]
1
python
This is a convenience method to prevent boilerplate from asserting the existence of input_filepath in the generation_params. Args: input_filepath: Path to the input file containing prompts for generation. inference_config: Parameters for inference. Retur...
Review this code and list any quality issues.
[ { "issue": "nit: if the other inference engines follow alphabetical sorting, I'd prefer if this were consistent.", "severity": "minor", "line": 26 } ]
1
python
def test_output_type_structured_dict_unresolvable_ref(): """Test StructuredDict with various unresolvable refs for coverage.""" # Schema with missing ref schema_with_missing_ref = { '$ref': '#/$defs/MissingModel', '$defs': {'ExistingModel': {'type': 'object', 'properties': {'name': {'type': ...
Review this code and list any quality issues.
[ { "issue": "This looks unrelated, can we remove it?", "severity": "minor", "line": 26 } ]
1
python
p99 = histogram.get_value_at_percentile(99) logger.debug( f"{self.__class__.__name__}: " f"Latency Histogram: {total_count} samples recorded:" f"\tp50: {p50:.1f}ms\tp90: {p90:.1f}ms\tp99: {p99:.1f}ms" ) def _read_conversations(self, input_filepath: str) -> list[C...
Review this code and list any quality issues.
[ { "issue": "Nit, here and elsewhere: I'd recommend using `Optional[str]` over `Union[str, None]`. Optional is syntactic sugar for the latter, and it's a bit more concise.", "severity": "minor", "line": 26 } ]
1
python
pattern = ( "Pipeline nodes must have unique names. The following node names " "appear more than once:\n\nFree nodes:\n - a" ) with pytest.raises(ValueError, match=re.escape(pattern)): pipeline1 + new_pipeline def test_conflicting_outputs(self): """Node ...
Review this code and list any quality issues.
[]
0
python
.. manim:: ParaSurface :save_last_frame: class ParaSurface(ThreeDScene): def func(self, u, v): return np.array([np.cos(u) * np.cos(v), np.cos(u) * np.sin(v), u]) def construct(self): axes = ThreeDAxes(x_range=[-4,4], x_length=8) s...
Review this code and list any quality issues.
[ { "issue": "Currently, these are breaking changes since inputting `u_min/u_max` would error out, which I'm generally okay with but would like to avoid when unecessary. Since we have @deprecated_params now, I think we should try to use it here to prevent old code from breaking. I used it in another PR to depreca...
1
python
# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 # DeepSpeed Team try: from packaging import version as pkg_version except ImportError: pkg_version = None from .builder import CUDAOpBuilder, installed_cuda_version import torch class FPQuantizerBuilder(CUDAOpBuilder): BUILD_V...
Review this code and list any quality issues.
[ { "issue": "Could you wrap this in a try/except, similar to other imports of torch inside op_builder? Not having this prevents us from building the whl in an environment where torch isn't installed (this will fix the no-torch workflow).", "severity": "minor", "line": 12 } ]
1
python
if permissions is not MISSING: fields['permissions'] = str(permissions.value) else: fields['permissions'] = '0' actual_colour = colour or color or Colour.default() if isinstance(actual_colour, int): fields['color'] = actual_colour else: fi...
Review this code and list any quality issues.
[ { "issue": "Same as above\r\n```suggestion\r\n```", "severity": "minor", "line": 26 } ]
1
python
join_nonempty, parse_duration, remove_end, str_to_int, unescapeHTML, ) from .common import InfoExtractor class Rule34VideoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?rule34video\.com/videos/(?P<id>\d+)' _TESTS = [ { 'url': 'https://rule34video.com/videos/3065157/sh...
Review this code and list any quality issues.
[ { "issue": "No need to test for None\r\n```suggestion\r\n```", "severity": "minor", "line": 26 } ]
1
python
tensor = ds[tensor] # temp tensors except TensorDoesNotExistError: continue if not tensor.meta.sample_compression and not tensor.meta.chunk_compression: engine = tensor.chunk_engine num_chunks = engine.num_chunks if num_...
Review this code and list any quality issues.
[ { "issue": "can we use intermediate variables to increase code readability?\r\nchunk = engine.get_chunk_from_chunk_id(chunk_id)\r\nand then check rechunk", "severity": "minor", "line": 26 } ]
1
python
from .common import InfoExtractor class BibelTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?bibeltv\.de/mediathek/videos/(?:crn/)?(?P<id>\d+)' _TESTS = [{ 'url': 'https://www.bibeltv.de/mediathek/videos/329703-sprachkurs-in-malaiisch', 'md5': '252f908192d611de038b8504b08bf97f', ...
Review this code and list any quality issues.
[ { "issue": "`self.url_result()`? Also this might be cleaner as traversal with a `dict` key", "severity": "minor", "line": 26 } ]
1
python
# See: https://github.com/yt-dlp/yt-dlp/pull/7094#discussion_r1199746041 self.http_server_thread.daemon = True self.http_server_thread.start() # HTTPS server certfn = os.path.join(TEST_DIR, 'testcert.pem') self.https_httpd = http.server.ThreadingHTTPServer( ('127.0.0...
Review this code and list any quality issues.
[]
0
python
# Warn if bitcoind is already running try: # pgrep exits with code zero when one or more matching processes found if subprocess.run(["pgrep", "-x", "bitcoind"], stdout=subprocess.DEVNULL).returncode == 0: print("%sWARNING!%s There is already a bitcoind process running on this system. Tes...
Review this code and list any quality issues.
[ { "issue": "Since the `MIN_FREE_SPACE` value is a bit of a guess, it might make sense to either make this into a VERY LOUD non-fatal warning, or add an arg like `--non-fatal-disk-space-check` to make it into a warning. That way people running in a bit resource-constrained environments and/or only interested in ...
1
python
return cls.time_marks.pop() @classmethod def get_cost_time(cls): """ Get last time mark from stack, calculate time diff with current time. :return: float Time diff calculated by last time mark with current time. """ cost_time = time() - cls.time_marks.pop() ...
Review this code and list any quality issues.
[]
0
python
from .common import InfoExtractor from ..utils import ( traverse_obj, ) class GraspopIE(InfoExtractor): _VALID_URL = r'https?://vod\.graspop\.be/(?P<lang>fr|nl)/(?P<id>[0-9]+)/(?P<title>.*)/' _TESTS = [{ 'url': 'https://vod.graspop.be/fr/101556/thy-art-is-murder-concert/', 'info_dict': { ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'thumbnail': r're:https://cdn-mds\\.pickx\\.be/festivals/v3/global/original/.+\\.jpg',\r\n```", "severity": "minor", "line": 16 } ]
1
python
'bash': """ _pip_completion() {{ COMPREPLY=( $( COMP_WORDS="${{COMP_WORDS[*]}}" \\ COMP_CWORD=$COMP_CWORD \\ PIP_AUTO_COMPLETE=1 $1 2>/dev/null ) ) }} complete -o default -F _pip_completion {prog} """, 'zsh': """ ...
Review this code and list any quality issues.
[ { "issue": "This could be changed to remove the `eval`, though that would bump the minimum required fish version to fish 3.0.0 (released December 28, 2018).", "severity": "minor", "line": 26 } ]
1
python
from ..notification.event import Event, EventEntityType, EventOperation, _make_event from .job_id import JobId from .status import Status if TYPE_CHECKING: from ..task.task import Task def _run_callbacks(fn): def __run_callbacks(job): fn(job) _TaipyLogger._get_logger().debug(f"{job.id} status...
Review this code and list any quality issues.
[ { "issue": "I believe we want to use * for italic text\r\n\r\n```suggestion\r\n Every time a task is submitted for execution, a new *Job* is created. A job represents a\r\n```", "severity": "minor", "line": 26 } ]
1
python
@overload def __radd__(self: _ArrayInt_co, other: _ArrayLikeInt_co, /) -> NDArray[signedinteger]: ... @overload def __radd__(self: _ArrayFloat_co, other: _ArrayLikeFloat_co, /) -> NDArray[floating]: ... @overload def __radd__(self: _ArrayComplex_co, other: _ArrayLikeComplex_co, /) -> NDArray[complex...
Review this code and list any quality issues.
[]
0
python
from urllib import parse from .common import InfoExtractor from ..networking import HEADRequest from ..utils import ( UserNotLive, determine_ext, float_or_none, int_or_none, merge_dicts, parse_iso8601, str_or_none, traverse_obj, unified_timestamp, url_or_none, ) class KickBase...
Review this code and list any quality issues.
[ { "issue": "`session_token` is the cookie for your logged-in session, right? I don't have that cookie set when I'm not logged in.\r\n\r\nIf so, then we don't need the \"setting up session\" request anymore; in fact, I don't think `_real_initialize` is even necessary either.\r\n\r\n```py\r\n @functools.cached...
1
python
help='Delete downloaded fragments after downloading is finished (default)') downloader.add_option( '--buffer-size', dest='buffersize', metavar='SIZE', default='1024', help='Size of download buffer, e.g. 1024 or 16K (default is %default)') downloader.add_option( '--resize-buffer',...
Review this code and list any quality issues.
[]
0
python
except requests.exceptions.RequestException as e: print(f"An error occurred: {e}") return None, None # Create a blob file on the server if it doesn't exist. def create_blob(digest, file_path): url = f"{BASE_URL}/api/blobs/{digest}" # Check if the blob exists response = requests.head(u...
Review this code and list any quality issues.
[ { "issue": "Instead of reading the entire file into memory, you can use `f` as an iterator directly\r\n\r\n```python\r\nfor line in f:\r\n line = line.strip()\r\n if not line:\r\n continue\r\n\r\n ...\r\n```", "severity": "major", "line": 26 } ]
1
python
except: # transformers <= 4.51.3 includes device arg but > 4.51.3 does not return transformers_version < Version("4.52.0") kwargs = { "sequence_length": 1, "target_length": cache_length, "dtype":...
Review this code and list any quality issues.
[ { "issue": "Oh wait can we move this version check outside as a global to save some CPU time thanks :)", "severity": "major", "line": 26 } ]
1
python
container.children[index + 1], mode=mode ) ): # This means `# fmt: on` is placed right after an indentation # level, and we shouldn't swallow the previous INDENT token. return if children_contains_fmt_on(chil...
Review this code and list any quality issues.
[ { "issue": "Could you update this comment to be more specific what this case looks like in the code being formatted? It's not immediately obvious to me from reading it.", "severity": "minor", "line": 26 } ]
1
python
'Content-Type': 'application/x-www-form-urlencoded', 'Referer': self._LOGIN_URL, 'Authorization': 'Bearer ' + self._ACCCESS_TOKEN }) except ExtractorError as e: msg = 'Unable to login' if isinstance(e.cause, compat_HTTPError) and e....
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n playlist_title = (self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')\r\n or self._og_search_title(webpage))\r\n```\r\nusing `\\` is not prefered", "severity": "minor", "line": 26 } ]
1
python
loss function for highly unbalanced segmentations. DLMIA 2017. The inputs `y_pred` and `y` are expected to be one-hot, binarized batch-first tensors, i.e., NCHW[D]. Example of the typical execution steps of this metric class follows :py:class:`monai.metrics.metric.Cumulative`. Args: include_backg...
Review this code and list any quality issues.
[ { "issue": "Instead of immediately updating the default behavior, we need to provide users with some time to adapt to this change. We should also issue a warning to inform users that the mean_batch behavior is no longer the same as before, since it previously calculated the mean. If users want to retain the pre...
1
python
def get_total_completion_tokens(self): """ Get the total number of completion tokens. Returns: int: The total number of completion tokens. """ return self.total_completion_tokens def get_total_cost(self): """ Get the total cost of API calls. ...
Review this code and list any quality issues.
[ { "issue": "Error string formatting syntax, it's fine for logging.logger, but not loguru.logger.\r\nYou can find this error in your screenshot above.", "severity": "minor", "line": 26 } ]
1
python
r"""Mobjects that inherit from lines and contain a label along the length.""" from __future__ import annotations __all__ = ["LabeledLine", "LabeledArrow"] from manim.constants import * from manim.mobject.geometry.line import Arrow, Line from manim.mobject.geometry.shape_matchers import ( BackgroundRectangle, ...
Review this code and list any quality issues.
[ { "issue": "This is currently unused and could be removed... but maybe this is imported because the new label objects *would* use the constant, `DEFAULT_FONT_SIZE`? This brings up the question of what is a sensible default for font_size... perhaps 15 is too small?", "severity": "minor", "line": 7 } ]
1
python
self._print(arg1), self._print(arg2), ord1, ord2 ) p = MyPrinter() cosm1_1 = cosm1(x).diff(x, evaluate=False) assert p.doprint(cosm1_1) == 'my_custom_cosm1(x, deriv_order=1)' atan2_2_3 = atan2(x, y).diff(x, 2, y, 3, evaluate=False) assert p.doprint(atan2_2_3) == 'my_custom_atan2(x, y, d...
Review this code and list any quality issues.
[ { "issue": "let's also test `SymPyPrinter`", "severity": "minor", "line": 26 } ]
1
python
} ], }, 'params': { 'skip_download': True } }] def _download_info(self, item_id): data = self._download_gql( item_id, [{ 'operationName': 'VideoMetadata', 'variables': { 'channelLogin': '', ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n video = traverse_obj(data, (0, 'data', 'video'))\r\n```", "severity": "minor", "line": 26 } ]
1
python
require_js_player = self._get_default_ytcfg(client).get('REQUIRE_JS_PLAYER') if 'js' in self._configuration_arg('player_skip'): require_js_player = False player_url = None if not player_url and not tried_iframe_fallback and require_js_player: play...
Review this code and list any quality issues.
[ { "issue": "IMO we shouldn't raise like this; we should instead fix #7715, the format selection bug that is causing `best` to select storyboards as a fallback, and then we will properly raise for no formats.\r\n\r\nwe could add the IP block note to the warning though, something like this?\r\n```suggestion\r\n ...
1
python
from typing import TYPE_CHECKING from pydantic import AnyHttpUrl, TypeAdapter from yarl import URL if TYPE_CHECKING: from collections.abc import Iterator from logging import Logger def is_url_absolute(url: str) -> bool: """Check if a URL is absolute.""" url_parsed = URL(url) # We don't use .abs...
Review this code and list any quality issues.
[]
0
python
python -m monai.bundle run_workflow --meta_file <meta path> --config_file <config path> # Set the workflow to other customized BundleWorkflow subclass: python -m monai.bundle run_workflow --workflow CustomizedWorkflow ... Args: workflow: specified bundle workflow name, should be a string o...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n raise ValueError(f\"Argument `workflow` must be a bundle workflow class name or subclass of BundleWorkflow, got: {workflow_name}.\")\r\n```", "severity": "minor", "line": 26 } ]
1
python
'series_id': 64, 'season': 'Season 3', 'season_number': 3, 'episode': 'Episode 1', 'episode_number': 1 } }] def _perform_login(self, username, password): login_webpage = self._download_webpage('https://nubiles-porn.com/login', video_id=None) ...
Review this code and list any quality issues.
[ { "issue": "If regex doesn't match, this shouldn't crash\r\n\r\n```suggestion\r\n channel_id, channel_name = self._search_regex(\r\n r'/video/website/(?P<id>\\d+).+>(?P<name>\\w+).com', get_element_html_by_class('site-link', page),\r\n 'channel', fatal=False, group=('id', 'name')) o...
1
python
'duration': int_or_none(t.get('duration')), 'timestamp': unified_timestamp(content.get('editorialDate')), 'thumbnails': thumbnails, 'chapters': chapters or None, 'episode': title, **traverse_obj(content, ('programmeItem', 0, 'http://zdf.de/rels/target', { ...
Review this code and list any quality issues.
[ { "issue": "I don't understand the `try_call` usage. It doesn't suppress `ExtractorError`, so the fallback will never be used. I would do this:\r\n\r\n```suggestion\r\n player_url = player['content']\r\n\r\n for query in ({'profile': 'player-3'}, None):\r\n try:\r\n conte...
1
python
async def block_dialog(q: Q): q.page['meta'].dialog.closable = False q.page['meta'].dialog.blocking = True await q.page.save() async def on_pip_finish(q: Q): q.page['meta'].dialog.blocking = False q.page['meta'].dialog.closable = True q.page['meta'].dialog.items = get_package_dialog_items() ...
Review this code and list any quality issues.
[ { "issue": "Doesn't this kill the main thread?", "severity": "minor", "line": 26 } ]
1
python
} default_ordering = "-created_at" context_object_name = "images" permission_policy = permission_policy any_permission_required = ["add", "change", "delete"] model = Image filterset_class = ImagesFilterSet show_other_searches = True header_icon = "image" page_title = gettext_lazy("Im...
Review this code and list any quality issues.
[ { "issue": "Should probably update this to https://github.com/wagtail/django-modelsearch/issues/51 instead", "severity": "minor", "line": 26 } ]
1
python
} """ name = lazy_gettext("Owner") arg_name = "owners" def apply(self, query: Query, value: Optional[Any]) -> Query: user_model = security_manager.user_model like_value = "%" + cast(str, value) + "%" return query.filter( or_( # could be made to handl...
Review this code and list any quality issues.
[]
0
python
'is_live': True, 'formats': formats, 'subtitles': subtitles, } class CHZZKVideoIE(InfoExtractor): IE_NAME = 'chzzk:video' _VALID_URL = r'https?://chzzk\.naver\.com/video/(?P<id>\d+)' _TESTS = [{ 'url': 'https://chzzk.naver.com/video/1754', 'only_matching': T...
Review this code and list any quality issues.
[ { "issue": "Already needs to be updated to v2. Getting `'content'` should also be fatal.\r\n```suggestion\r\n video_meta = self._download_json(\r\n f'https://api.chzzk.naver.com/service/v2/videos/{video_id}', video_id,\r\n note='Downloading video info', errnote='Unable to download v...
1
python
@pytest.mark.parametrize("kernel", kernels) def test_lml_without_cloning_kernel(kernel): # Test that clone_kernel=False has side-effects of kernel.theta. gpc = GaussianProcessClassifier(kernel=kernel).fit(X, y) input_theta = np.ones(gpc.kernel_.theta.shape, dtype=np.float64) gpc.log_marginal_likelihood...
Review this code and list any quality issues.
[ { "issue": "I think we should always clone the `kernel` argument passed to test functions: otherwise, mutation of this object can cause other unrelated tests to fail (as is the case in this PR).\r\n\r\n\r\n```suggestion\r\ndef test_lml_gradient(kernel):\r\n # Clone the kernel object prior to mutating it to a...
1
python
variance = sigma**2.0 gaussian_kernel: torch.Tensor = (1.0 / (2.0 * math.pi * variance + 1e-16)) * torch.exp( -torch.sum((xy_grid - mean) ** 2.0, dim=-1) / (2 * variance + 1e-16) ) gaussian_kernel = gaussian_kernel / torch.sum(gaussian_kernel) return gaussian_kernel def get_gaussian_kernel_3d(...
Review this code and list any quality issues.
[ { "issue": "As @ericspod suggested, can we integrate these class into the existing one?", "severity": "minor", "line": 26 } ]
1
python
for path in paths: self.assertIn(str(path), pyi_cache) self.assertNotIn(str(path), normal_cache) def test_pipe_force_pyi(self) -> None: source, expected = read_data("force_pyi") result = CliRunner().invoke( black.main, ["-", "-q", "--pyi"], input=BytesIO(...
Review this code and list any quality issues.
[]
0
python
assert tx_with_min_feerate['txid'] in block_txids assert tx_below_min_feerate['txid'] not in block_template_txids assert tx_below_min_feerate['txid'] not in block_txids def test_timewarp(self): self.log.info("Test timewarp attack mitigation (BIP94)") node = self.nodes[0] ...
Review this code and list any quality issues.
[ { "issue": "In other words for this \"attack\" to succeed the miner needs to run broken software that completely ignores values provided by our own software, which this functional test is supposed to check in the first place.\r\n\r\nIt's important to test that in the presence of a block as far in the future as ...
1
python
during this call. Setting this to False or True overrides the ``lazy`` flag set during initialization for this call. Defaults to None. Raises: ValueError: When ``data_array`` has no spatial dimensions. ValueError: When ``axcodes`` spatiality differs from ``data_array``. ...
Review this code and list any quality issues.
[ { "issue": "This code assumes the 'space' key always exists in meta dictionary. Consider adding a check for key existence or using .get() with a default value to prevent KeyError when the space attribute is missing.\n```suggestion\n space_key = data_array.meta.get(\"space\")\n if space_key...
1
python
season_search = self._download_json( 'https://y1fnzxui30-dsn.algolia.net/1/indexes/everest_search_%s_season_desc_production' % slug, season, headers={ 'Origin': 'https://www.americastestkitchen.com', 'X-Algolia-API-Key': '8d504d0099ed27c1b73708d22871d805', ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'url': f'https://www.americastestkitchen.com{show_path or \"\"}{search_url}',\r\n```", "severity": "minor", "line": 26 } ]
1
python
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. imp...
Review this code and list any quality issues.
[]
0
python
""" return None @property def aws_arn_role_name(self): """ Override to return the arn role name. """ return None @property def aws_session_token(self): """ Override to return the session token. """ return None def _get_s3_con...
Review this code and list any quality issues.
[ { "issue": "This can just be `if not value:` because `None` and `''` equate to False", "severity": "minor", "line": 26 } ]
1
python
import os import pytest import torch import torch.distributed as dist import colossalai from colossalai.context import MOE_CONTEXT from colossalai.nn.layer.moe import load_moe_model, save_moe_model from colossalai.testing import rerun_if_address_is_in_use, spawn from colossalai.utils import get_current_device from co...
Review this code and list any quality issues.
[ { "issue": "Can we remove the dependency of config?", "severity": "minor", "line": 16 } ]
1
python
# Form / Combobox # Use comboboxes to allow users to either choose between available choices or indicate a choice by free-form editing. # #form #combobox # --- from h2o_wave import main, app, Q, ui combobox_choices = ['Cyan', 'Magenta', 'Yellow', 'Black'] @app('/demo') async def serve(q: Q): if q.args.show_input...
Review this code and list any quality issues.
[ { "issue": "Let's do a separate combobox for showing the `required` attr.", "severity": "minor", "line": 25 } ]
1
python
polygon_points.append([x, y]) mask_from_polygon = polygon_to_mask( polygon=np.array(polygon_points), resolution_wh=(image.shape[0], image.shape[1]), ) masks.append(mask_from_polygon) xyxy = np.array(xyxy) masks = n...
Review this code and list any quality issues.
[ { "issue": "There is `polygon_to_mask` available in detection.utils", "severity": "minor", "line": 26 } ]
1
python
# Only remove tuple brackets after `for` for (k, v) in d.items(): print(k, v) # Don't touch tuple brackets after `in` for module in (core, _unicodefun): if hasattr(module, "_verify_python3_env"): module._verify_python3_env = lambda: None # output # Only remove tuple brackets after `for` for k, v in d....
Review this code and list any quality issues.
[ { "issue": "Can you add a test where the for loop target is too long to fit in one line?", "severity": "major", "line": 2 } ]
1
python
@pytest.mark.parametrize( ("mock_return_value", "expected_state"), [ (None, "unknown"), ("on", "on"), ("off", "off"), ("yes", "on"), ("no", "off"), ("charging", "on"), ("not_charging", "off"), ("alert", "on"), ("no_alert", "off"), ], ) ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n mock_connector.get_current_value.return_value = mock_return_value\n```", "severity": "minor", "line": 26 } ]
1
python
), ], ) async def test_send_message_validation_errors( hass: HomeAssistant, config_entry: MockConfigEntry, mock_aiontfy: AsyncMock, payload: dict[str, Any], error_msg: str, ) -> None: """Test publish message service validation errors.""" config_entry.add_to_hass(hass) await hass.con...
Review this code and list any quality issues.
[]
0
python
module = get_module_by_module_path(module_path) cls_or_obj = getattr(module, cls_or_obj) obj = cls_or_obj() if isinstance(cls_or_obj, type) else cls_or_obj wrapper.register(obj) def load_dataset(path_or_obj): """load dataset from multiple file formats""" if isinstance(path_or_obj, pd.DataFrame...
Review this code and list any quality issues.
[ { "issue": "I think this class could be moved into `ops.py`\r\nIt will not be used by any other module", "severity": "minor", "line": 26 } ]
1
python
'info_dict': { 'id': '000000002763', 'title': 'Le Iene', }, 'playlist_count': 7, }, { # TV Show specific playlist (single page) 'url': 'https://www.mediasetplay.mediaset.it/serie-tv/fireforce/episodi_SE000000001556,ST000000002738,sb100013107', 'info_di...
Review this code and list any quality issues.
[ { "issue": "_BY_SUBBRAND is long, so it is justified making it a seperate variable. But the other two doesnt need to be. They are only used in a single place. Better to just put them there", "severity": "minor", "line": 26 } ]
1
python
"""Updates `self` with `block`'s height and `header_hash`.""" assert self.peak_height == block.height - 1 assert len(self.block_hashes) == self.peak_height - self.fork_height assert block.height == self.fork_height + 1 + len(self.block_hashes) self.block_hashes.append(header_hash) ...
Review this code and list any quality issues.
[ { "issue": "I don't think you need to give this a name. This change is unrelated to the essence of this PR and, I think, makes it harder to read. I would say the same thing about `spend_ph`. It adds changes to the diff, even though it's not a material change. I don't believe these compute any hashes.", "sev...
1
python
clf_multi.coefs_paths_[c][fold, :, :-1] for c in clf_multi.classes_ ] coefs = np.swapaxes(coefs, 1, 0).reshape(len(clf_multi.Cs_), -1) norms = np.sum(coefs * coefs, axis=1) # L2 norm for each C assert np.all(np.diff(norms) >= 0) else: ...
Review this code and list any quality issues.
[ { "issue": "Note to our future selves, this is a left-over from https://github.com/scikit-learn/scikit-learn/pull/32073#pullrequestreview-3479367936. I merged #32073 too soon and forgot about it ...", "severity": "minor", "line": 26 } ]
1
python
break continue except Exception: break def push_widget(self, widget: object): assert self._new_modal # disable previous widget to prevent input processing if len(self._nav_stack) > 0: prev_widget = self._nav_stack[-1] prev_widget.set_enabled(False) self._nav_stack....
Review this code and list any quality issues.
[ { "issue": "The comment says pop_widget will re-enable the previous widget and send it a show event, but the implementation only calls `prev_widget.set_enabled(True)`. If widgets rely on `show_event()` to refresh state / reset scrollers when returning from a pushed screen, they won’t run. Consider calling `prev...
1
python
@staticmethod def memory_usage(): alloc = "mem_allocated: {:.4f} GB".format(get_accelerator().memory_allocated() / (1024 * 1024 * 1024)) max_alloc = "max_mem_allocated: {:.4f} GB".format(get_accelerator().max_memory_allocated() / (1024 * 1024...
Review this code and list any quality issues.
[]
0
python
if err is None: passed_models.append(name) else: failed_info[name] = err if early_stop: break if dist.get_rank() == 0: print(f"Init method: {init_method}") print(f"Passed models({len(passed_models)}): {passed_models}\n\n") print(f"...
Review this code and list any quality issues.
[ { "issue": "only 1 micro batch is not suitable", "severity": "major", "line": 26 } ]
1
python
from pydexcom.errors import AccountError, SessionError import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from .const import CONF_SERVER, DOMAIN, SERVER_OUS, SERVER_US _LOGGER = logging.getLogger(__name__) DATA_...
Review this code and list any quality issues.
[]
0
python
assert_array_equal(A.endswith(' '), [[1, 0], [0, 0], [1, 0]]) assert_array_equal(A.endswith('3', 0, 3), [[0, 0], [1, 0], [1, 0]]) def fail(): A.endswith('3', 'fdjk') assert_raises(TypeError, fail) @pytest.mark.parametrize( "dtype, encode", [("U", str), ...
Review this code and list any quality issues.
[ { "issue": "Let's make this line up too\r\n\r\n```suggestion\r\n C = (np.array(['ABCDEFGHIJKLMNOPQRSTUVWXYZ',\r\n '01234567890123456789012345'])\r\n```", "severity": "minor", "line": 26 } ]
1
python
png_bytes = create_png_bytes_from_image_bytes(jpg_bytes) pil_image_reloaded = load_pil_image_from_bytes(png_bytes) assert pil_image_reloaded.size == pil_image.size def test_ensure_pil_image_mode(): pil_image = PIL.Image.new(mode="RGB", size=(32, 48)) assert id(convert_pil_image_mode(pil_image, mode="...
Review this code and list any quality issues.
[]
0
python
log_stderr)) if not self.jobs: raise IndexError('pop from empty list') # Print remaining running jobs when all jobs have been started. if not self.test_list: print("Remaining jobs: [{}]".format(", ".join(j[0] for j in self.jobs))) dot_count = 0 while Tru...
Review this code and list any quality issues.
[ { "issue": "nit: to avoid confusion with previous tuple, since job is a Future now, we might want to name it as `fut` as well to be consistent with above", "severity": "minor", "line": 26 } ]
1
python
# unfortunately we can't type check these cases, since from a typing perspect `foobar_ctx` is valid as a plain tool Tool(foobar_ctx, takes_ctx=False) Tool(foobar_plain, takes_ctx=True) Agent('test', tools=[foobar_ctx], deps_type=int) Agent('test', tools=[foobar_plain], deps_type=int) Agent('test', tools=[foobar_plain]...
Review this code and list any quality issues.
[ { "issue": "If we can't make those give a typing error, then maybe it's not worth adding `TextOutputAgentDepsT` and we can just make it `RunContext[Any]`. \r\n\r\nIdeally, we would go a step further and add `DepsT` to `_OutputSpecItem`, `OutputSpec` etc, so that the user _is_ warned if their `ctx: RunContext[Fo...
1
python
MODEL_TENSOR.V_MMPROJ_FC: ( "model.connector.modality_projection.proj", # SmolVLM ), MODEL_TENSOR.V_MMPROJ_MLP: ( "model.mm_projector.mlp.mlp.{bid}", "vision_model.vision_adapter.mlp.fc{bid}", # llama 4 "mlp1.{bid}", # InternVL "model.aligner....
Review this code and list any quality issues.
[ { "issue": "```suggestion\n \"model.vision_model.embeddings.patch_embedding\", # SmolVLM\n```\nNo need to stack on for every model, the list will get very long that way. :)", "severity": "minor", "line": 26 } ]
1
python
# Copyright 2025 The HuggingFace Inc. 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 appl...
Review this code and list any quality issues.
[ { "issue": "the only test we want here is an integration test", "severity": "minor", "line": 1 } ]
1
python
# Some simple queue module tests, plus some failure conditions # to ensure the Queue locks remain stable. import itertools import random import threading import time import unittest import weakref from test.support import gc_collect, bigmemtest from test.support import import_helper from test.support import threading_h...
Review this code and list any quality issues.
[ { "issue": "Move `import sys` up between `import random` and `import threading`", "severity": "minor", "line": 12 } ]
1
python
is_png_format, modify_atime, write_to_movie, ) from ..utils.sounds import get_full_sound_file_path from .section import DefaultSectionType, Section if TYPE_CHECKING: from manim.renderer.opengl_renderer import OpenGLRenderer def to_av_frame_rate(fps): epsilon1 = 1e-4 epsilon2 = 0.02 if isinst...
Review this code and list any quality issues.
[ { "issue": "Do you know if access to the class is public? I couldn't find it on their docs - so it might be better to just use the stdlib `fractions.Fraction` directly?", "severity": "minor", "line": 26 } ]
1
python
if not tensor.meta.sample_compression and not tensor.meta.chunk_compression: engine = tensor.chunk_engine num_chunks = engine.num_chunks if num_chunks > 1: num_samples = engine.num_samples max_shape = tensor.meta.max_shape ...
Review this code and list any quality issues.
[ { "issue": "what exactly is not supported on gdrive? where is this error coming from?", "severity": "minor", "line": 26 } ]
1
python
# Purpose: Query Twitter for name and location information. # # Author: <bcoles@gmail.com> # # Created: 2018-10-17 # Copyright: (c) bcoles 2018 # Licence: GPL #------------------------------------------------------------------------------- import re from sflib import SpiderFoot, SpiderFootPlugin, ...
Review this code and list any quality issues.
[ { "issue": "As this module doesn't use the API, no need to link to API reference docs.", "severity": "minor", "line": 26 } ]
1
python
settings.__getattr__ = __getattr__ settings.SQL_ALCHEMY_CONN = conn settings.SQL_ALCHEMY_CONN_ASYNC = conn os.environ["AIRFLOW__DATABASE__SQL_ALCHEMY_CONN"] = conn os.environ["AIRFLOW__CORE__SQL_ALCHEMY_CONN"] = conn # From <linux/prctl.h> _PR_SET_DUMPABLE = 4 _PR_GET_DUMPABLE = 3 def _mak...
Review this code and list any quality issues.
[ { "issue": "Should we add a fallback before returning here?\n\n`ctypes.util.find_library(\"c\")` is system-dependent and can return `None` in some Linux/container environments. In that case we silently skip this hardening step.\n\nCould we try `ctypes.CDLL(None, use_errno=True)` as a fallback and then call `prc...
1