language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
from .nextmedia import ( NextMediaIE, NextMediaActionNewsIE, AppleDailyIE, NextTVIE, ) from .nexx import ( NexxIE, NexxEmbedIE, ) from .nfb import ( NFBIE, NFBSeriesIE, ) from .nfhsnetwork import NFHSNetworkIE from .nfl import ( NFLIE, NFLArticleIE, NFLPlusEpisodeIE, NFLP...
Review this code and list any quality issues.
[]
0
python
"file_type": "attn_procs_weights", "framework": "pytorch", } state_dict = _fetch_state_dict( pretrained_model_name_or_path_or_dict=pretrained_model_name_or_path_or_dict, weight_name=weight_name, use_safetensors=use_safetensors, local_files_onl...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n is_non_diffusers_format = any(k.startswith(\"diffusion_model.\") for k in state_dict)\r\n```", "severity": "minor", "line": 26 } ]
1
python
self.assertEqual(sanitize_path('\\\\?\\UNC/ComputerName/abc'), '\\\\?\\UNC\\ComputerName\\abc') self.assertEqual(sanitize_path('\\\\?\\C:\\abc'), '\\\\?\\C:\\abc') self.assertEqual(sanitize_path('\\\\?\\C:/abc'), '\\\\?\\C:\\abc') self.assertEqual(sanitize_path('\\\\?\\C:\\ab?c\\de:f'), '\\\\?\...
Review this code and list any quality issues.
[ { "issue": "In the [CPython source](https://github.com/python/cpython/blob/3.13/Lib/ntpath.py#LC510), a simpler tactic like this (what I would have expected) is used:\r\n```suggestion\r\n try:\r\n from nt import _path_normpath as nt_path_normpath\r\n except ImportError:\r\n n...
1
python
from openai import AzureOpenAI from promptflow.connections import AzureOpenAIConnection from promptflow.tracing import trace class MyClass: def __init__(self, connection: AzureOpenAIConnection): self._connection = connection def __call__(self, question: str, stream: bool) -> str: clinet = Az...
Review this code and list any quality issues.
[]
0
python
from ... import core as tp sc = tp.get(id) self.__dict__ = sc.__dict__ def __hash__(self): return hash(self.id) def __eq__(self, other): return isinstance(other, Scenario) and self.id == other.id def __setattr__(self, name: str, value: Any) -> None: if self.__CHEC...
Review this code and list any quality issues.
[ { "issue": "The `protected_attribute_name` is not used outside of the `_get_attributes()` right?\r\n\r\nWe probably can move the `_validate_id()` inside the `_get_attributes()` to make it cleaner.\r\n```suggestion\r\n def _get_attributes(self, attribute_name) -> Union[Sequence, Task, DataNode]:\r\n pr...
1
python
plural = "" if len_reports == 1 else "s" self._log.info(f"Received {len(reports)} PositionStatusReport{plural}") return reports def _handle_ws_message(self, raw: bytes) -> None: # noqa: C901 try: ws_message = self._decoder_ws_msg_general.decode(raw) ws_message_chann...
Review this code and list any quality issues.
[ { "issue": "Perhaps add an `else` block here too which logs an error when a message with an unknown channel is received.", "severity": "minor", "line": 26 } ]
1
python
self._set_vocab_gpt2() else: self._set_vocab_sentencepiece() self.gguf_writer.add_add_space_prefix(False) def set_gguf_parameters(self): hparams = self.hparams # some default values are not specified in the hparams self.gguf_writer.add_context_length(hparams...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n rope_scaling = hparams[\"rope_scaling\"]\r\n```", "severity": "minor", "line": 26 } ]
1
python
formats = [] for stream in traverse_obj(stream_info, ( 'data', 0, 'playerUrls', lambda _, v: url_or_none(v['url']) and v['type'])): url = stream['url'] format_id = str_or_none(stream['type']) if format_id in ('hls', 'live_hls', 'live_playback_hls') or '.m3u8' ...
Review this code and list any quality issues.
[ { "issue": "This could return `[None]`, so let's do:\r\n```suggestion\r\n 'categories': ('category', 'title', {str}, {lambda x: [x] if x else None}),\r\n```", "severity": "minor", "line": 26 } ]
1
python
# from jupyter_book.cli import main as commands @pytest.mark.parametrize( "toc_file", ( "_toc_numbered.yml", # Numbered at top-level "_toc_numbered_depth.yml", # Numbered at top-level, limited to depth 1 "_toc_numbered_parts.yml", # Numbered at top-level w/ parts "_toc_numbe...
Review this code and list any quality issues.
[ { "issue": "is there a reason that all of this is commented out?", "severity": "minor", "line": 26 } ]
1
python
Input: keys: the keys of the corresponding objects memory_objs: the memory_objs of the corresponding keys """ raise NotImplementedError def support_batched_async_contains(self) -> bool: return True async def batched_async_contains( self, lookup_i...
Review this code and list any quality issues.
[ { "issue": "We don't have batched_exists now?", "severity": "major", "line": 26 } ]
1
python
if audio_download: formats.append({ 'url': audio_download, 'format_id': 'audio', 'vcodec': 'none', }) if not formats: external = playerData.get('external') if isinstance(external, dict): service = ex...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n tags = try_get(playerData, lambda x: x['targeting']['tag'].split(','))\r\n```\r\ncan be inlined in return", "severity": "minor", "line": 26 } ]
1
python
if len(tasks) >= max_simulation_results: break if len(tasks) >= max_simulation_results: break for task in asyncio.as_completed(tasks): sim_results.append(await task) progress_bar.update(1) progress_bar.close() retu...
Review this code and list any quality issues.
[ { "issue": "Nit: May be we should do \r\n```python\r\nfor key in ('conversation_starter', 'group_of_people', 'metadata'):\r\n template_parameters.pop(key, None)\r\n```", "severity": "minor", "line": 26 } ]
1
python
'series': ('custom_data', 'program_name'), }) tf_url = urljoin( url, self._search_regex(r'<script src=["\'](/assets/tf\.[^"\']+\.js)["\']', page, 'stream API config') ) tf_js = self._download_webpage(tf_url, video_id, note='Downloading stream API config') ...
Review this code and list any quality issues.
[ { "issue": "- avoid redefining built-ins like `format`\r\n - use `_merge_subtitles()`\r\n - IMO don't use `i` as var name if it's not an index value\r\n - if multiple m3u8 URLs, make m3u8 extraction non-fatal so that 1 bad URL doesn't throw\r\n ```suggestion\r\n for src in traverse_obj(source_meta, ('sou...
1
python
host=task.host, update_id=task.task_id, user=task.user, table=task.table, password=task.password, ) # Check if the `S3CopyToTable.s3_load_path` class attribute was # successfully referenced in the `S3CopyToTable.run` method, which is # in-...
Review this code and list any quality issues.
[ { "issue": "Since this is what is defined as the default, you should be able to just `task = DummyS3CopyToTableKey()`. Right?", "severity": "minor", "line": 26 } ]
1
python
elif item.column == "relevance" and item.op.value != FilterOperator.GREATER_THAN_OR_EQUAL.value: raise ValueError( f"Invalid operator for relevance: {item.op.value}. Only GREATER_THAN_OR_EQUAL is allowed." ) elif item.column == TableField.C...
Review this code and list any quality issues.
[ { "issue": "keyword_query is the same as query_text. this is extra block, you can just use 'query_text' below \r\n(keyword_column_name - is always TableField.CONTENT.value)", "severity": "minor", "line": 26 } ]
1
python
@classmethod def animation_override_for( cls, animation_class: Type["Animation"] ) -> "Optional[Callable[[Mobject, ...], Animation]]": """Returns the function defining a specific animation override for this class. Parameters ---------- animation_class The ani...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n \"\"\"Initializes animation overrides marked with the :func:`~.override_animation`\r\n```", "severity": "minor", "line": 26 } ]
1
python
) verify_harmony_messages( messages, [ { "role": "tool", "name": "functions.empty_tool", "content": "", "channel": "commentary", }, ], ) def test_tool...
Review this code and list any quality issues.
[]
0
python
sequence_parallelism_mode if sequence_parallelism_mode is not None else "all_to_all" ) assert ( self.sequence_parallelism_mode in SUPPORT_SP_MODE ), f"Sequence parallelism mode {self.sequence_parallelism_mode} is not in the supported list {SUPPORT_SP_MODE}" ...
Review this code and list any quality issues.
[]
0
python
""" def __init__(self, sensor_options: "SensorOptions", sensor_idx: int, sensor_manager: "SensorManager"): self._options: "SensorOptions" = sensor_options self._idx: int = sensor_idx self._manager: "SensorManager" = sensor_manager self._cache_idx: int = -1 # cache_idx is set by the...
Review this code and list any quality issues.
[ { "issue": "I don' think it is the right way to do it. The cache buffer length should be the same for all sensors, and the sensor manager should use `read_delay_step = max(sensor._read_delay_steps for sensor in self._sensors)` to determine how many data mush be stored in cache. It will make everything much easi...
1
python
# playback_ev is valid only if the first frame was already played if playback_ev.synchronized_transcript is not None: forwarded_text = playback_ev.synchronized_transcript else: forwarded_text = "" if forwarded_text: ...
Review this code and list any quality issues.
[ { "issue": "Was this some duplicated logic?", "severity": "major", "line": 26 } ]
1
python
self._build_render_params(prompt), ) return engine_prompts def post_process( self, model_output: Sequence[PoolingRequestOutput], request_id: str | None = None, **kwargs, ) -> IOProcessorOutput: num_prompt_tokens = 0 response_data = [] for ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n sparse_embedding[token_id] = max(weight, sparse_embedding.get(token_id, 0.0))\n```", "severity": "minor", "line": 26 } ]
1
python
help="Optional display comma separated names", ) parser.add_argument( "--limit-worker-concurrency", type=int, default=5, help="Limit the model concurrency to prevent OOM.", ) parser.add_argument("--stream-interval", type=int, default=2) parser.add_argument("--no-register", action="store_true") worker_a...
Review this code and list any quality issues.
[]
0
python
'title': json_info.get('broadcast_title') or self._og_search_title(webpage), 'display_id': display_id, 'url': f'{json_info["broadcast_url"]}{json_info["recording_hash"]}.mp3', 'timestamp': start_date, 'uploader': uploader, 'channel_id': json_info.get('user_id'...
Review this code and list any quality issues.
[ { "issue": "`channel_id` needs to be a string", "severity": "minor", "line": 26 } ]
1
python
'ext': 'm4a' }] for fmt in autoplay['video_link']: formats.append({ 'format_id': 'video-%s' % fmt['name'], 'url': fmt['url'], 'protocol': 'm3u8_native', 'width': fmt['level'] * autoplay['video_width'] // autoplay['video_height']...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n return {\r\n 'id': video_id,\r\n 'title': title,\r\n 'description': description,\r\n 'timestamp': float_or_none(autoplay['publish_time'], scale=1000),\r\n 'duration': float_or_none(autoplay['video_length'], scale=1000),\...
1
python
np.int32(1) >>> np.sum([[0, 1], [0, 5]]) 6 >>> np.sum([[0, 1], [0, 5]], axis=0) array([0, 6]) >>> np.sum([[0, 1], [0, 5]], axis=1) array([1, 5]) >>> np.sum([[0, 1], [np.nan, 5]], where=[False, True], axis=1) array([1., 5.]) If the accumulator is too small, overflow occurs: >>> ...
Review this code and list any quality issues.
[ { "issue": "This message could do with an update", "severity": "minor", "line": 26 } ]
1
python
start = perf_counter_ns() try: yield finally: diff = perf_counter_ns() - start self._put_result(name, diff, caller.filename, caller.lineno) def profile_callable(self, name=None): """ Decorator which can be applied to a function which profiles any ...
Review this code and list any quality issues.
[ { "issue": "Normal methods should have 'self', rather than '_self', as their first parameter.", "severity": "minor", "line": 26 } ]
1
python
""" self.update_frame(scene, ignore_skipping=True) self.camera.get_image().show() def save_static_frame_data( self, scene: Scene, static_mobjects: Iterable[Mobject], ) -> PixelArray | None: """Compute and save the static frame, that will be reused at each frame ...
Review this code and list any quality issues.
[ { "issue": "For consistency with other methods and variables `self.static_image` should ideally be renamed to `self.static_frame`, but that can be done in another PR.", "severity": "minor", "line": 26 } ]
1
python
"--verbose", action="append_const", const="verbose", dest="features", help=("The console will be used to output verbose information about the " "OpenSK application. This also automatically activates --debug."), ) main_parser.add_argument( "--no-u2f", action=RemoveCons...
Review this code and list any quality issues.
[ { "issue": "If this default is `False` and the target is opensk, can you please print the warning from above?\r\n```\r\n info(\"Your device is not yet configured, and lacks some functionality. \"\r\n \"If you run into issues, this command might help:\\n\\n\"\r\n \"./tools/configure.py \...
1
python
# flags: --preview """ 87 characters ............................................................................ """
Review this code and list any quality issues.
[]
0
python
Args: batch_size: Number of embeddings to generate per content type Returns: Dict with stats per content type and overall totals """ results_by_type = {} total_processed = 0 total_success = 0 total_failed = 0 # Process content types in explicit order processing_order = ...
Review this code and list any quality issues.
[]
0
python
"database_id": database.id, "table_name": datasource_name, } if catalog: filters["catalog"] = catalog if schema: filters["schema"] = schema return db.session.query(cls).filter_by(**filters).all() @classmethod def query_datasources_by_permissi...
Review this code and list any quality issues.
[ { "issue": "@betodealmeida these two methods are a bit of a hack, where from my understanding the inheritance scheme is non linear in some specific cases, so we need to cherry pick some methods to skip a level of inheritance. \r\n\r\nPR still achieves the goal of de-duping logic, but doesn't fully fix the inher...
1
python
'view_count': 'numViews', 'comment_count': 'numComments', 'timestamp': ('createdAt', {unified_timestamp}), 'modified_timestamp': ('updatedAt', {unified_timestamp}), 'thumbnail': ('file', 'id', {str}, { lambda x: f'https://files.iwara.tv...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if username and password:\r\n self._get_media_token()\r\n\r\n return {'Authorization': f'Bearer {self._MEDIATOKEN}'} if self._MEDIATOKEN else None\r\n```", "severity": "critical", "line": 26 } ]
1
python
# # dask documentation build configuration file, created by # sphinx-quickstart on Sun Jan 4 08:58:22 2015. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n# Build docs with option disabled until we move dask-expr over, otherwise\r\n```", "severity": "minor", "line": 17 } ]
1
python
utils.check_output( f"{clippy_tracing} --action strip --suffix log_instrument:: --cfg-attr 'feature =\"tracing\"' --path {p}" ) @pytest.fixture(scope="module") def instrumented_binary(): """Build and provide the path to an instrumented Firecracker binary.""" binary_path = build_instrumente...
Review this code and list any quality issues.
[ { "issue": "is the purpose of calling these to check they aren't captured by tracing? If so, we probably should have an assertion for that.", "severity": "minor", "line": 26 } ]
1
python
CTxOut, MAX_OP_RETURN_RELAY, ) from test_framework.script import ( CScript, OP_RETURN, ) from test_framework.test_framework import BitcoinTestFramework from test_framework.test_node import TestNode from test_framework.util import assert_raises_rpc_error from test_framework.wallet import MiniWallet from ran...
Review this code and list any quality issues.
[ { "issue": "```python\r\n self.expected_stderr = [\r\n \"\", # node 0 has no deprecated options\r\n \"Warning: Options '-datacarrier' or '-datacarriersize' are set but are marked as deprecated. They will be removed in future versions.\",\r\n \"Warning: Options '-datacarr...
1
python
import torch.fx as fx from torch._higher_order_ops.auto_functionalize import auto_functionalized from torch._inductor.pattern_matcher import PatternMatcherPass from torch.distributed._symmetric_memory import enable_symm_mem_for_group from vllm.config import VllmConfig from vllm.config.utils import Range from vllm.dist...
Review this code and list any quality issues.
[ { "issue": "cc @ProExpertProg refactored a bit here to move None to the top", "severity": "major", "line": 26 } ]
1
python
# If the model response is a tool_call_started, add the tool call to the run_response elif ( model_response_event.event == ModelResponseEvent.tool_call_started.value ): # Add tool calls to the run_response tool_executions_list = model_response_event.tool_executio...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n if session.session_data is not None and session.session_data.get(\"session_state\") is not None:\n```", "severity": "minor", "line": 26 } ]
1
python
if dst_device == "cuda": dst_device = f"cuda:{torch.cuda.current_device()}" storage_backends: OrderedDict[str, StorageBackendInterface] = OrderedDict() if config.enable_nixl: if config.enable_xpyd: # First Party from lmcache.v1.storage_backend.nixl_backend_v3 import Nix...
Review this code and list any quality issues.
[ { "issue": "this is a bit unclear: previously, I could have omitted to specify the inclusion of local_cpu and the rest of the engines would have received it anyway as a buffer, now it requires explicit indication.", "severity": "minor", "line": 26 } ]
1
python
raise NotImplementedError __repr__ = _utils.dataclasses_no_defaults_repr @dataclass(init=False, repr=False) class VideoUrl(FileUrl): """A URL to a video.""" url: str """The URL of the video.""" _: KW_ONLY kind: Literal['video-url'] = 'video-url' """Type identifier, this is available on...
Review this code and list any quality issues.
[ { "issue": "Please move the `*` ahead of `force_download` so all arguments other than `url` need to be keywords arguments -- same for the other subclasses", "severity": "minor", "line": 26 } ]
1
python
super().__init__( id="3ae02219-d540-47cd-9c78-3ad6c7d9820a", description="Manages HubSpot companies - create, update, and retrieve company information", categories={BlockCategory.CRM}, input_schema=HubSpotCompanyBlock.Input, output_schema=HubSpotCompanyBlock.O...
Review this code and list any quality issues.
[]
0
python
'title': 'Norðmenn tala ekki um annað en prinsessuna', 'categories': ['frettir'], 'description': 'md5:53e2623ae79e1355778c14f5b557a0cd', 'display_id': 'nordmenn-tala-ekki-um-annad-en-prinsessuna', 'duration': 138, 'thumbnail': r're:https?://www\.visir\.is/.+',...
Review this code and list any quality issues.
[ { "issue": "Hmm, this is still fatal if `date_str` splits into a list with a length != 3\r\n\r\nWe could do this:\r\n```suggestion\r\n # date string is in the format of \"21. janúar 2026\"\r\n date_elements = traverse_obj(webpage, (\r\n {find_element(cls='article-item__date')}, {clean_h...
1
python
self.await_produced_messages(producer) self.session_timeout_sec = 60 consumer = self.setup_consumer(self.TOPIC, static_membership=True, group_protocol=group_protocol) self.num_consumers = num_conflict_consumers conflict_consumer = self.setup_consumer(self.TOPIC, static_membership=True,...
Review this code and list any quality issues.
[ { "issue": "Same num_rebalances issue as [L126](https://github.com/apache/kafka/pull/16845/files#r1711605858)", "severity": "minor", "line": 26 } ]
1
python
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Desc : zhipuai LLM from https://open.bigmodel.cn/dev/api#sdk from enum import Enum import json from tenacity import ( after_log, retry, retry_if_exception_type, stop_after_attempt, wait_fixed, ) from requests import ConnectionError import zhipuai ...
Review this code and list any quality issues.
[ { "issue": "Module `metagpt.utils.ahttp_client` not found.", "severity": "minor", "line": 23 } ]
1
python
) from livekit.agents.llm import function_tool from livekit.plugins import deepgram, openai, silero logger = logging.getLogger("long-running-function") logger.setLevel(logging.INFO) load_dotenv() # This example shows how to interrupt a long running function call. # A tool execution won't be canceled after the associ...
Review this code and list any quality issues.
[]
0
python
class CheckPoliciesHandler(BaseAPIV2Handler): async def post(self): """ POST /api/v2/policies/check """ policy = tornado.escape.json_decode(self.request.body) analyzed_policy = analyze_policy_string(policy) findings = analyzed_policy.findings enhanced_finding...
Review this code and list any quality issues.
[ { "issue": "Let's pull this out into a utility function so we can keep this handler clean. We could even do the same with the Parliament call.\r\n\r\nI'm thinking something like:\r\n```python\r\ndef access_analyzer_validate(policy):\r\n ...\r\n return transformed_aa_response_dict\r\n```", "severity": ...
1
python
- `zarr.storage.FSStore` for Zarr v2 with storage options - The original URL/path if no storage options are provided """ # Cannot directly import FSStore from storage. from zarr import storage storage_options = storage_options or {} if storage_options: if _zarr_v3(): re...
Review this code and list any quality issues.
[ { "issue": "@dcherian thoughts on this API?", "severity": "minor", "line": 26 } ]
1
python
import s3fs from typing import BinaryIO, Union from contextlib import asynccontextmanager from cognee.infrastructure.files.storage.s3_config import get_s3_config from cognee.infrastructure.utils.run_async import run_async from cognee.infrastructure.files.storage.FileBufferedReader import FileBufferedReader from .stora...
Review this code and list any quality issues.
[ { "issue": "token can be None here, it's not mandatory for S3 connection", "severity": "minor", "line": 26 } ]
1
python
'channel_id': 'did:plc:6ttyq36rhiyed7wu3ws7dmqj', 'thumbnail': 'https://video.bsky.app/watch/did%3Aplc%3A6ttyq36rhiyed7wu3ws7dmqj/bafkreih4xf5k22urq5kytjbnlj2djnzmlrqnvotnglmoy35mkpobrwtota/thumbnail.jpg', 'timestamp': 1729731642, 'comment_count': int, 're...
Review this code and list any quality issues.
[ { "issue": "this isn't a POST request; is the `content-type` header necessary? what about `accept`?\r\n```suggestion\r\n video_id, query={\r\n```", "severity": "minor", "line": 26 } ]
1
python
'ext': ext, }) return { 'id': video_id, 'title': title, 'formats': formats, 'description': description, 'duration': duration, 'thumbnail': try_get(video_params, lambda vi: 'https:' + compat_b64de...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if not items:\r\n raise ExtractorError('Video is not available', video_id=video_id, expected=True)\r\n```", "severity": "major", "line": 26 } ]
1
python
<script type="py">import js; js.console.log("A", 1<2, 1>2)</script> <script type="py">import js; js.console.log("B <div></div>")</script> <py-script>import js; js.console.log("C", 1<2, 1>2)</py-script> <py-script>import js; js.console.log("D <div></div>")</py-script> """ ...
Review this code and list any quality issues.
[]
0
python
# SPDX-License-Identifier: Apache-2.0 # Standard from typing import Dict, Optional # Third Party import msgspec class AsyncLookupMsg(msgspec.Struct, tag=True): # type: ignore """Base class for async lookup messages""" def describe(self) -> str: return "" class LookupRequestMsg(AsyncLookupMsg): ...
Review this code and list any quality issues.
[]
0
python
config_entry: MockConfigEntry, ) -> None: """Test various errors when registering a new device.""" await async_setup_component(hass, "http", {}) config_entry.add_to_hass(hass) await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done() assert config_entry.st...
Review this code and list any quality issues.
[]
0
python
allocator = resource_manager._op_resource_allocator allocator.update_budgets( limits=global_limits, ) # Both unbounded operators get shared GPU allocation # GPU flows through normal allocation, both get GPU budget > 0 assert allocator._op_budgets[o2].gpu > 0 ...
Review this code and list any quality issues.
[]
0
python
def check_fee_estimates_btw_modes(self, node, expected_conservative, expected_economical): fee_est_conservative = node.estimatesmartfee(1, estimate_mode="conservative")['feerate'] fee_est_economical = node.estimatesmartfee(1)['feerate'] assert_equal(fee_est_conservative, expected_conservative) ...
Review this code and list any quality issues.
[ { "issue": "```Suggestion\r\n # conservative mode will consider longer time horizons while economical mode does not\r\n```", "severity": "minor", "line": 26 } ]
1
python
'timestamp': 1745403328, 'upload_date': '20250423', 'uploader': 'ディズニープラス公式', 'uploader_id': 'DisneyPlusJP', 'uploader_url': 'https://twitter.com/DisneyPlusJP', 'view_count': int, }, }] def _real_extract(self, url): broadcast_type, dis...
Review this code and list any quality issues.
[ { "issue": "I find it very harmful to readability and maintainability to use an assignment expression when the variable you're assigning to is going to be used outside of the conditional path.\r\n\r\ne.g.\r\n```py\r\nif foo := bar():\r\n print(f'bashonly approves of using {foo} in this code path')\r\n\r\n# b...
1
python
from mindsdb.utilities import log import json import requests _FINANCIAL_MODELING_URL = 'https://financialmodelingprep.com/api/v3/' logger = log.getLogger(__name__) class FinancialModelingHandler(APIHandler): name = "financial_modeling" def __init__(self, name, connection_data: dict, **kwargs): sup...
Review this code and list any quality issues.
[ { "issue": "Can we give this table a more meaningful name? We should definitely remove `_table` from the name. Maybe `historial_prices` or something else you think is more appropriate?", "severity": "minor", "line": 26 } ]
1
python
data_set = data_set._copy( # pylint: disable=protected-access _version=version ) return data_set def load(self, name: str, version: str = None) -> Any: """Loads a registered data set. Args: name: A data set to be loaded. version: Option...
Review this code and list any quality issues.
[ { "issue": "This could be nicely rewritten to:\r\n```\r\nmatches = (parse(pattern, data_set_name) for pattern in data_set_patterns.keys())\r\nreturn next(filter(None, matches), None)\r\n```", "severity": "minor", "line": 26 } ]
1
python
if opts.ffmpeg_location is not None: opts.ffmpeg_location = expand_path(opts.ffmpeg_location) if opts.user_agent is not None: opts.headers.setdefault('User-Agent', opts.user_agent) if opts.referer is not None: opts.headers.setdefault('Referer', opts.referer) if opts.no_sponsorblock...
Review this code and list any quality issues.
[ { "issue": "My suggestion used items so we can write `\"{policy}\" is not a valid color policy for {name}`. Not a big deal, but idk why you changed it.", "severity": "minor", "line": 26 } ]
1
python
self.thread = threading.Thread( target=self.process_responses_from_workers, daemon=True ) self.thread.start() # default backoff time self.lookup_backoff_time = 0.01 if config.extra_config is not None: self.lookup_backoff_time = float( conf...
Review this code and list any quality issues.
[ { "issue": "It would be nice if you could add your id to the todo comment.\r\nSomething like `TODO(zirui): num_computed_tokens is passed in`", "severity": "minor", "line": 26 } ]
1
python
from __future__ import annotations from dataclasses import dataclass from enum import Enum from typing import TYPE_CHECKING import numpy as np import pyarrow import pyarrow.compute as pc from ray.data.datatype import DataType from ray.data.expressions import pyarrow_udf if TYPE_CHECKING: from ray.data.expressio...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n) -> Optional[pyarrow.Array]\n```", "severity": "minor", "line": 25 } ]
1
python
Example: :: >>> from kedro.framework.session import KedroSession >>> from kedro.framework.startup import bootstrap_project >>> from pathlib import Path >>> # If you are creating a session outside of a Kedro project (i.e. not using >>> # `kedro run` or `kedro jupyter`), you ...
Review this code and list any quality issues.
[ { "issue": "Previously we called `.resolve()` on all options `project_path` as well as `Path.cwd()` and now only on `_find_kedro_project(Path.cwd()).resolve()`, why did that change?", "severity": "minor", "line": 26 } ]
1
python
start_session=start, end_session=end, trading_calendar=trading_calendar, capital_base=capital_base, data_frequency=data_frequency, ), metrics_set=metrics_set, blotter=blotter, benchmark_returns=benchmark_retu...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'No ``benchmark_spec`` was provided, and'\r\n ' ``zipline.api.set_benchmark`` was not called in'\r\n ' ``initialize``.'\r\n```", "severity": "minor", "line": 26 } ]
1
python
'upload_date': '20211111', 'thumbnail': 'https://www.rtvs.sk/media/a501/image/file/2/0916/robin.jpg', } }] def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) iframe_id = self._search_regex( r'<ifr...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n self._sort_formats(formats)\r\n```\r\nThis must be always run", "severity": "minor", "line": 26 } ]
1
python
log.info("DB: Creating index coin_parent_index") await conn.execute("CREATE INDEX IF NOT EXISTS coin_parent_index on coin_record(coin_parent)") async with conn.execute("SELECT 1 FROM coin_record LIMIT 1") as cursor: is_new_db = await cursor.fetchone() is None if is_n...
Review this code and list any quality issues.
[ { "issue": "this is not right. you only use the new index on the first ever run of the full node. You should base this in whether the index exists or not", "severity": "minor", "line": 26 } ]
1
python
# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 # DeepSpeed Team # Automatic Tensor Parallelism import re from torch import nn from .replace_policy import replace_policies from typing import Optional import torch from deepspeed import comm as dist from .layers import LinearAllreduce, Lin...
Review this code and list any quality issues.
[ { "issue": "Won't it be simpler to modify callers to pass device='cpu' when `keep_module_on_host=True`?", "severity": "minor", "line": 20 } ]
1
python
'width': ('width', {int_or_none}), 'height': ('height', {int_or_none}), 'vcodec': ('videoCodec', {str}), 'acodec': ('audioCodec', {str}), 'abr': ('audioBitrate', {int_or_none}), 'vbr': ('videoBitrate', {int_or_none}), 'audio...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n **thumbnail_info,\r\n```", "severity": "minor", "line": 26 } ]
1
python
factor : float, optional The factor by which the color should be darker, by default 0.2, which results in a slightly darker color Returns ------- ManimColor The darker ManimColor See Also -------- :meth:`lighter` """ a...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n The factor (as a float ratio) by which the color should be lighter. By default 0.2,\r\n which results in a slightly lighter color.\r\n```", "severity": "minor", "line": 26 } ]
1
python
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from contextlib import contextmanager from .expm import MLflowExpManager from .exp import Experiment from .recorder import Recorder from ..utils import Wrapper class QlibRecorder: """ A global system that helps to manage the experiments...
Review this code and list any quality issues.
[ { "issue": "Thanks for pointing this out! \r\n\r\nApparently, adding `uri` argument in this method will not change the one defined in the `config` file. Therefore, the next time when user call this function in the same experiment, they have to also specify this argument with the same value. Otherwise, inconsist...
1
python
""" send_telemetry( "Permissions API Endpoint Invoked", user.id, additional_properties={ "endpoint": f"POST /v1/permissions/users/{str(user_id)}/tenants", "user_id": str(user_id), "tenant_id": str(tenant_id), "co...
Review this code and list any quality issues.
[ { "issue": "Would be great to update Docstring to mention that other users that have has_user_management_permission (Like users who belong to the Admin role)\n\nCan also handle the operations added in endpoints from this PR.", "severity": "critical", "line": 26 } ]
1
python
yield (state, state.to_gradio_chatbot()) + (disable_btn,) * 5 try: data = {"text": ""} for i, data in enumerate(stream_iter): if data["error_code"] == 0: output = data["text"].strip() conv.update_last_message(output + "▌") # conv.update_la...
Review this code and list any quality issues.
[]
0
python
"""Cleans up tracing instrumentation from the Firecracker binary.""" clippy_tracing = get_binary("clippy-tracing") for p in PATHS_TO_INSTRUMENT: utils.check_output( f"{clippy_tracing} --action strip --suffix log_instrument:: --cfg-attr 'feature =\"tracing\"' --path {p}" ) @pytest.f...
Review this code and list any quality issues.
[ { "issue": "I think `vm.spawn` waits for the API server to start if log_level is \"Info\" or above. Is it not sufficient for some reason? Pylint doesn't look happy with it ([style check](https://buildkite.com/firecracker/firecracker-pr/builds/14961#019a4f94-6307-4575-b98a-811b5b38df09)).", "severity": "mino...
1
python
videos = self._get_entries_for_date(search_url, query, start_date, endDate=end_date) for video in videos: yield video def _get_spans_for_range(self, url, query, startDate, endDate): page_50_results = self._get_entries_for_date(url, query, startDate, endDate=endDate, pageNumber=5...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n results = self._download_webpage(\r\n url, None, note='Extracting results from page %s for date %s to %s' % (pageNumber, startDate, endDate),\r\n query={\r\n 'Search_key': query,\r\n 'page': str(pageNumb...
1
python
Alias, DataNode, DependenciesMapping, Task, TaskRef, _get_dependencies, convert_dict, execute_graph, no_function_cache, resolve_aliases, ) from dask.base import tokenize from dask.core import keys_in_tasks, reverse_dict from dask.optimization import SubgraphCallable from dask.sizeof ...
Review this code and list any quality issues.
[ { "issue": "nit: I personally don't like that this shadows `convert_legacy_graph` from `dask._task_spec`. A more explicit name could highlight that this has some additional assertions baked in.", "severity": "minor", "line": 26 } ]
1
python
tags = traverse_obj(post, ('record', 'langs'), default=[]) if label_list := post.get('labels'): tags.extend(label.get('val') for label in label_list) return { 'id': video_id, 'title': f'{uploader} on Bluesky', **video_info, 'uploader': uploade...
Review this code and list any quality issues.
[ { "issue": "The remainder I would restructure to have a generic extraction method that can then be called with the separate sub paths:\r\n```suggestion\r\n entries = []\r\n # app.bsky.embed.video.view/app.bsky.embed.external.view\r\n entries.extend(self._extract_videos(post, video_id))\r\n ...
1
python
# under the License. from __future__ import annotations from fastapi import HTTPException, Request from fastapi.responses import JSONResponse from starlette.middleware.base import BaseHTTPMiddleware from airflow.api_fastapi.app import get_auth_manager from airflow.api_fastapi.auth.managers.base_auth_manager import CO...
Review this code and list any quality issues.
[]
0
python
assert ( self.dtype in _DTYPE_MAPPING ), f"Expected the dtype string argument to be in {list(_DTYPE_MAPPING.keys())} but found an unknown dtype: {self.dtype}" self.dtype = _DTYPE_MAPPING[self.dtype] assert ( self.dtype in _ALLOWED_DTYPES ), f"Expected ...
Review this code and list any quality issues.
[ { "issue": "Please credits in README as well (See how we credits to vLLM in README)", "severity": "minor", "line": 26 } ]
1
python
# Verify total_expected = expected_box_v_area + expected_cyl_v_area + expected_loft_v_area self.assertAlmostEqual( complex_obj.VerticalArea.Value, total_expected, places=3, msg=f"Failed to aggregate vertical areas of mixed types. Expected {total_expected}...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n # semi-elliptical faces for the top and bottom.\n```\nNitpick: as per the projection being elliptical", "severity": "minor", "line": 26 } ]
1
python
}, 'playlist_count': 519, }, { # single season 'url': 'https://netverse.id/webseries/kelas-internasional', 'info_dict': { 'id': 'kelas-internasional', 'title': 'Kelas Internasional', }, 'playlist_count': 203, }] def parse_single_season...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n for season in traverse_obj(json_data, ('seasons', ..., 'id')):\r\n```", "severity": "minor", "line": 26 } ]
1
python
assert disp.n_classes <= len(np.unique(colors, axis=0)) if plot_method == "pcolormesh" and response_method == "predict": # pcolormesh with predict uses ListedColormap cmap = mpl.colors.ListedColormap(colors) assert disp.surface_.cmap == cmap elif plot_method != "contour": cmaps ...
Review this code and list any quality issues.
[ { "issue": "I would prefer to distinctly name and set the actual number of blobs in the data and the expected n_classes attribute value as distinct test parameters to better convey the expectations of this test.\r\n\r\n```suggestion\r\n@pytest.mark.parametrize(\r\n \"estimator, n_blobs, expected_n_classes\",...
1
python
snapshotter.get_client_sample() assert snapshotter.active is True async def test_snapshot_pruning_removes_outdated_records( snapshotter: Snapshotter, event_manager: LocalEventManager, default_memory_info: MemoryInfo ) -> None: # Set the snapshot history to 2 hours snapshotter._SNAPSHOT_HISTORY = ...
Review this code and list any quality issues.
[ { "issue": "@Mantisus I meant that this order should not matter", "severity": "minor", "line": 26 } ]
1
python
""" Combine "map_classes_to_indices" and "generate_label_classes_crop_centers" functions, return crop center coordinates. Args: label: use the label data to get the indices of every class. spatial_size: spatial size of the ROIs to be sampled. num_samples: total sample centers to be gene...
Review this code and list any quality issues.
[ { "issue": "The `if-else` expression is redundant here, being `indices` in either case, was this meant to be something else?", "severity": "minor", "line": 26 } ]
1
python
new_entities = [] for device_id in new_device_ids: coord = switch_coords[device_id] device = coord.data.device assert isinstance(device, SwitchDevice) new_entities.append(WattsVisionSwitch(coord, device)) known_device_ids.update(new_device_ids) as...
Review this code and list any quality issues.
[ { "issue": "why do we set the name to None, what does this exactly do?", "severity": "minor", "line": 26 } ]
1
python
'url': inner['url'], } quality_information = re.search(r'([0-9]{3,4})x([0-9]{3,4})-([0-9]{2})p-([0-9]{3,4})kbit', inner['url']) if quality_information: stream_format['width'] = int_or_none(quality_information.group(1)) ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n loader_str = unescapeHTML(self._search_regex(r\"data-(?:new-)?hr-mediaplayer-loader='([^']*)'\", webpage, 'ardloader'))\r\n```", "severity": "critical", "line": 26 } ]
1
python
import argparse import os import shutil from typing import Optional, Sequence CURR_DIR = os.path.abspath(os.getcwd()) OPPIA_TOOLS_DIR = os.path.join(CURR_DIR, '..', 'oppia_tools') FULL_STACK_TEST_VIDEO_RECORDING_DIR = os.path.join( CURR_DIR, '..', 'oppia_full_stack_test_video_recordings') _PARSER = argparse.Argum...
Review this code and list any quality issues.
[]
0
python
status = "500 Server Error" output = b"Nope!" response_headers = [ ("Content-type", "text/plain"), ] try: raise exc() except exc: exc_info = sys.exc_info() start_response(status, response_headers, exc_info=exc_info) return [output] def log_to_wsgi_log_buffer(...
Review this code and list any quality issues.
[]
0
python
} for key, url in (get_video_info('thumbnail') or {}).items() if url], 'description': clean_html(get_video_info('description')), 'uploader': traverse_obj(api_data, ('owner', 'nickname'), ('channel', 'name'), ('community', 'name')), 'uploader_id': str_or_none(traverse_obj(api_data, ('...
Review this code and list any quality issues.
[ { "issue": "could do this\r\n```suggestion\r\n if not comments_info.get('server'):\r\n return\r\n\r\n danmaku = traverse_obj(self._download_json(\r\n f'{comments_info[\"server\"]}/v1/threads', video_id, data=json.dumps({\r\n```", "severity": "minor", "line": 26 } ]
1
python
from abc import ABCMeta from .. import config # from .mobject import Mobject # cannot import since this is cyclic from .opengl_mobject import OpenGLMobject from .types.opengl_vectorized_mobject import OpenGLVMobject class ConvertToOpenGL(ABCMeta): """Metaclass for swapping (V)Mobject with its OpenGL counterpart...
Review this code and list any quality issues.
[ { "issue": "I don't think it is necessary to keep this comment around.\r\n\r\n```suggestion\r\n```", "severity": "minor", "line": 5 } ]
1
python
registration_response = self._download_json( 'https://api-registrations.logmeininc.com/registrations', video_id, data=json.dumps(registration_data).encode(), expected_status=409, headers={'Content-Type': 'application/json'}, note='Register user', ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'is_live': False\r\n }\r\n```", "severity": "minor", "line": 26 } ]
1
python
memory_obj.invalidate() total_freed_size += memory_obj.meta.phy_size if new_free_block is None: new_free_block = FreeBlock( start=memory_obj.meta.address, size=memory_obj.meta.phy_size ) curr_start += memory_obj.meta.phy_size ...
Review this code and list any quality issues.
[]
0
python
self.update_frame(scene) self.file_writer.save_final_image(self.get_image()) self.file_writer.finish() def get_image(self) -> Image.Image: """Returns an image from the current frame. Returns ------- PIL.Image The PIL image of the array. """ ...
Review this code and list any quality issues.
[ { "issue": "I'm not too familliar with `Image`, how did you choose these parameters and what do they mean in this context? If possible it might be worth a description in the docstring.", "severity": "minor", "line": 26 } ]
1
python
integrator = gs.integrator.approximate_implicitfast substeps = 1 armature = 0.0 elif mode == 1: integrator = gs.integrator.implicitfast substeps = 4 armature = 0.0 elif mode == 2: integrator = gs.integrator.Euler substeps = 1 armature = 2.0 # ...
Review this code and list any quality issues.
[]
0
python
def write(self, items): nonlocal stream_writers if self.wandb_run is not None: self.wandb_run.log( { "timestamp": self.wandb_run.config["timestamp"], **items, } ) ...
Review this code and list any quality issues.
[ { "issue": "Why not to yield only 'profiler_step' since the other argument is used? \nI would recommend doing this and extending the API later if necessary.", "severity": "minor", "line": 26 } ]
1
python
def _print_Rational(self, expr): return '{}/{}'.format(expr.p, expr.q) def _print_Half(self, expr): return self._print_Rational(expr) def _print_frac(self, expr): return self._print_Mod(Mod(expr.args[0], 1)) def _print_Symbol(self, expr): name = super()._print_Symbol(expr...
Review this code and list any quality issues.
[ { "issue": "Let's move this to `AbstractPythonCodePrinter`.", "severity": "major", "line": 26 } ]
1
python
@pytest.mark.parametrize( "setting_name,setting_value,raises", [ ('INSIGHTS_TRACKING_STATE', None, True), ('INSIGHTS_TRACKING_STATE', False, True), ('INSIGHTS_TRACKING_STATE', True, False), ('INSIGHTS_TRACKING_STATE', 'Steve', False), ('INSIGHT...
Review this code and list any quality issues.
[]
0
python
self._mqtt_config_fn = partial( create_mqtt_config, device_id=self._device_id, country=country, override_mqtt_url=mqtt_url, ssl_context=ssl_context, ) self._mqtt_client: MqttClient | None = None self._added_legacy_entities: set[str] = ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n async with asyncio.TaskGroup() as tg:\n async def _init(device: Device) -> None:\n await device.initialize(mqtt)\n self._devices.append(device)\n\n for device in mqtt_devices:\n ...
1
python
'url': r're:^https://.*\.pvvstream.pro/.*extra=', 'quality': '480', 'ext': 'mp4', }, { 'url': r're:^https://.*\.pvvstream.pro/.*extra=', 'quality': '720', 'ext': 'mp4', }, ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n m = self._html_search_regex(rf'/{video_id}\\?(?:.*&)?m=([^&\"\\'\\s,]+)', webpage, 'm')\r\n```\r\nwhat's m? Use a better name", "severity": "minor", "line": 26 } ]
1
python
prompt: str | Sequence[_messages.UserContent] | None = None """The original user prompt passed to the run.""" messages: list[_messages.ModelMessage] = field(default_factory=list) """Messages exchanged in the conversation so far.""" tracer: Tracer = field(default_factory=NoOpTracer) """The tracer to ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n \"\"\"Whether the output passed to an output validator is partial.\"\"\"\r\n```", "severity": "minor", "line": 26 } ]
1
python
col_to_overwrites, idx, last_per_qtr, qtrs_with_estimates, requested_qtr_data, sid, sid_to_idx[sid], columns, ) quarter_shi...
Review this code and list any quality issues.
[]
0
python
) graph = x.sum(axis=1, split_every=20) from dask.order import order if keep_self: # Keeping self adds a layer that cannot be fused dsk = collections_to_dsk([x, graph], optimize_graph=optimize) else: dsk = collections_to_dsk([graph], optimize_graph=optimize) dependencies, de...
Review this code and list any quality issues.
[ { "issue": "What are we using the `drift` for?", "severity": "minor", "line": 26 } ]
1
python
long_description_content_type="text/markdown", author="Willi Ballenthin, Moritz Raabe", author_email="william.ballenthin@mandiant.com, moritz.raabe@mandiant.com", url="https://www.github.com/mandiant/capa", project_urls={ "Documentation": "https://github.com/mandiant/capa/tree/master/doc", ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n \"ruff==0.0.259\",\r\n```", "severity": "minor", "line": 26 } ]
1