language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
'id': 'de571ac1-5edc-42e2-8ec2-bdac83ad4a31', 'filesize': 928116, 'ext': 'mp4', 'title': 'nuuh' } }] }] _TOKEN = None def _entries(self, file_id): # Get file list requesturl = f'https://api.gofile.io/getContent?contentId={...
Review this code and list any quality issues.
[ { "issue": "Can u give an example of the `vnd.mts`?", "severity": "minor", "line": 26 } ]
1
python
) youtube_ie = YoutubeIE() youtube_ie.set_downloader(self._downloader) info = youtube_ie._real_extract(webpage_data['videoId']) # replace the YouTube metadata by the Digiview one info['title'] = webpage_data.get('titre') or info['title'] info['description'] = webpage_da...
Review this code and list any quality issues.
[ { "issue": "Instead of passing custom ffmpeg args, just return a `section_start` and `section_end` time. Something like this should work:\r\n```suggestion\r\n clip_id = video_data['videoId']\r\n return {\r\n '_type': 'url_transparent',\r\n 'url': f'https://www.youtube.com/wat...
1
python
return _SubmissionManagerFactory._build_manager()._hard_delete(SubmissionId(entity_id)) raise ModelNotFound("NOT_DETERMINED", entity_id) def get_scenarios( cycle: Optional[Cycle] = None, tag: Optional[str] = None, is_sorted: Optional[bool] = False, descending: Optional[bool] = False, sort_key:...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n what key scenarios are sorted. The sorting is in increasing order for dates, in alphabetical order \r\n for name and id, in lexographical order for tags.\r\n```", "severity": "minor", "line": 26 } ]
1
python
# fix cross filter references fixed = config.copy() cross_filter_global_config = fixed.get("metadata", {}).get( "global_chart_configuration", {} ) scope_excluded = cross_filter_global_config.get("scope", {}).get("excluded", []) if scope_excluded: cross_filter_global_config["scope"][...
Review this code and list any quality issues.
[ { "issue": "Do we know of any scenario in which `chart_config` would not be a `dict`? Or are we just playing safe here? I honestly don't know how strict this schema is", "severity": "minor", "line": 26 } ]
1
python
("expanded", PropertyType.boolean_or_list, True), ("filter", PropertyType.boolean), ("hover_text", PropertyType.dynamic_string), ("height", PropertyType.string_or_number), ("id",), ("value_by_id", PropertyType.boolean), ("mu...
Review this code and list any quality issues.
[ { "issue": "property names have to be aligned (and in a pythonic way)\r\n`showProgress `=> `show_value`", "severity": "minor", "line": 26 } ]
1
python
class AuxTransformBox(OffsetBox): aux_transform: Transform offset_transform: Transform ref_offset_transform: Transform def __init__(self, aux_transform: Transform) -> None: ... def add_artist(self, a: martist.Artist) -> None: ... def get_transform(self) -> Transform: ... # does not accept a...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n borderpad: float | tuple[float, float] = ...,\r\n```", "severity": "minor", "line": 26 } ]
1
python
errors["base"] = "invalid_auth" except Exception: _LOGGER.exception("Unexpected exception during reauth") errors["base"] = "unknown" else: # Verify reauth is for the same device await self.async_set_unique_id(info["device_id"]) ...
Review this code and list any quality issues.
[ { "issue": "IMO it's better here to `self.add_suggested_values_to_schema` with both reauth entry data and user input, that way if you enter your password wrong on the first attempt you don't have to enter the user again and I also like adding both user and password there", "severity": "critical", "line"...
1
python
@pytest.fixture async def client_with_logfire(temporal_env: WorkflowEnvironment) -> Client: return await Client.connect( f'localhost:{TEMPORAL_PORT}', plugins=[PydanticAIPlugin(), LogfirePlugin()], ) # Can't use the `openai_api_key` fixture here because the workflow needs to be defined at the ...
Review this code and list any quality issues.
[ { "issue": "Let's make this an inline lambda as it's very simple", "severity": "minor", "line": 26 } ]
1
python
staticOutput=self.static_output, uiType=self.block_type.value, ) async def execute(self, input_data: BlockInput, **kwargs) -> BlockOutput: if error := self.input_schema.validate_data(input_data): raise BlockValueError( message=f"Unable to execute block with i...
Review this code and list any quality issues.
[ { "issue": "I think we need to move this to `_execute` then wrap it in try except for any other exception that is not a blockerror re-raise it with BlockUnknownError", "severity": "major", "line": 26 } ]
1
python
----- This method is meant to be used with ``toolz.merge_with`` to merge adjustment mappings. In case of a collision ``adjustment_lists`` contains two lists, existing adjustments at index 0 and new adjustments at index 1. When there are no collisions, ``adjustment_lists`` contains a single list. Pa...
Review this code and list any quality issues.
[ { "issue": "Since you're copying anyway, another way to write this might be: `adjustment_lists[front_idx] + adjustment_lists[back_idx]`", "severity": "minor", "line": 26 } ]
1
python
import base64 import itertools import json import uuid from .common import InfoExtractor from ..utils import ( js_to_json, traverse_obj, urljoin, ) class CaracolTvPlayIE(InfoExtractor): _VALID_URL = r'https?://play\.caracoltv\.com/videoDetails/(?P<id>[^/?]+)' _NETRC_MACHINE = 'caracoltv-play' ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n _VALID_URL = r'https?://play\\.caracoltv\\.com/videoDetails/(?P<id>[^/?#]+)'\r\n```", "severity": "minor", "line": 15 } ]
1
python
self._report_alerts([('ERROR', yt_error)], fatal=False) # Downloading page may result in intermittent 5xx HTTP error # Sometimes a 404 is also recieved. See: https://github.com/ytdl-org/youtube-dl/issues/28289 # We also want to catch all other network exceptio...
Review this code and list any quality issues.
[ { "issue": "use `e.msg`. ExtractorError has these properties:\r\n```py\r\n self.msg = msg\r\n self.traceback = tb\r\n self.expected = expected\r\n self.cause = cause\r\n self.video_id = video_id\r\n self.ie = ie\r\n self.exc_info = sys.exc_info()\r\n```", "se...
1
python
face.u2 = u2 face.v1 = v1 face.v2 = v2 faces.set_fill(color=self.fill_color, opacity=self.fill_opacity) faces.set_stroke( color=self.stroke_color, width=self.stroke_width, opacity=self.stroke_opacity, ) self.add(*faces) ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n \"\"\"A sphere.\r\n```", "severity": "minor", "line": 26 } ]
1
python
class StoreValueBlock(Block): """ This block allows you to provide a constant value as a block, in a stateless manner. The common use-case is simply pass the `input` data, it will `output` the same data. The block output will be static, the output can be consumed multiple times. """ class Input...
Review this code and list any quality issues.
[ { "issue": "This still makes very little sense to a normal person \r\n\r\ntry replacing static with something like kept output?", "severity": "minor", "line": 26 } ]
1
python
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project import functools from collections.abc import Callable from typing import Any, ParamSpec, TypeVar from torch import fx as fx from vllm import envs from vllm._aiter_ops import rocm_aiter_ops from vllm.config impor...
Review this code and list any quality issues.
[ { "issue": "Renamed to `RocmAiterRMSNormQuantFusionPass` for clarity", "severity": "minor", "line": 21 } ]
1
python
def _search_results(self, query): def get_video_data(metadata): for search_result in metadata.get('results', []): video_id_ind, video_type = self._TYPES.get(str_or_none(traverse_obj(search_result, ('content_type', 'raw'))), (None, None)) video_id = traverse_obj(search...
Review this code and list any quality issues.
[ { "issue": "```py\r\nfor page_number in itertools.count(1):\r\n ...\r\n note='Downloading search results page %d%s' % (page_number, format_field(total_pages, template=' of ~%d'),\r\n ...\r\n QUERY_DATA['page']['current'] = page_number\r\n total_pages = ...\r\n if total_pages <= page_number...
1
python
from mlc_chat.quantization import Quantization from .baichuan_model import BaichuanConfig, BaichuanForCausalLM def huggingface(model_config: BaichuanConfig, quantization: Quantization) -> ExternMapping: """Returns a parameter mapping that maps from the names of MLC LLM parameters to the names of Huggi...
Review this code and list any quality issues.
[]
0
python
remote_url=None, remote_serde=None, pipelined_backend=False, save_decode_cache=self.save_decode_cache, enable_blending=self.enable_blending, blend_recompute_ratio=0.15, blend_min_tokens=self.blend_min_tokens, blend_separator="[BLEND_SEP]", blend_add_specia...
Review this code and list any quality issues.
[ { "issue": "Why are we returning empty `[]` when mla is not enabled? Shouldn't we return all worker ids?", "severity": "minor", "line": 26 } ]
1
python
The :code:`[z_min, z_max, z_step]` values of the z-axis. x_length The length of the x-axis. y_length The length of the y-axis. z_length The length of the z-axis. z_axis_config Arguments to be passed to :class:`~.NumberLine` that influence the z-axis. z_normal ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n x_range: Optional[Union[List[float], np.ndarray]] = (-6, 6, 1),\r\n```", "severity": "minor", "line": 26 } ]
1
python
import socket from time import sleep from typing import TYPE_CHECKING, Any, Iterable, TypeVar, Callable from redis.exceptions import ConnectionError, TimeoutError T = TypeVar("T") if TYPE_CHECKING: from redis.backoff import AbstractBackoff class Retry: """Retry a specific number of times after a failure"""...
Review this code and list any quality issues.
[ { "issue": "We support Python 3.8, where this is not yet available. You can use `Tuple[Type[Exception], ...]` and import them from `typing`.", "severity": "minor", "line": 20 } ]
1
python
}, { 'url': 'https://www.nicovideo.jp/series/12312/', 'info_dict': { 'id': '12312', 'title': 'バトルスピリッツ お勧めカード紹介(調整中)', }, 'playlist_mincount': 103, }, { 'url': 'https://nico.ms/series/203559', 'only_matching': True, }] def _real_extrac...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n return self.playlist_from_matches(\r\n traverse_obj(json_data, ('itemListElement', ..., 'url')), list_id, title, ie=NiconicoIE)\r\n```", "severity": "minor", "line": 26 } ]
1
python
r'https?://v\.redd\.it/(?P<id>[^/?#&]+)', reddit_video['fallback_url'], 'video_id', default=display_id) dash_playlist_url = playlist_urls[0] or f'https://v.redd.it/{video_id}/DASHPlaylist.mpd' hls_playlist_url = re.sub(r'(f=[^&]+)', r'\1%2CsubsAll', playlist_urls[1]) or f'https:...
Review this code and list any quality issues.
[ { "issue": "`caption_url` can go here\r\n```suggestion\r\n caption_url = f'https://v.redd.it/{video_id}/wh_ben_en.vtt'\r\n if not subtitles and self._is_valid_url(caption_url, video_id, item='subtitle'):\r\n```", "severity": "minor", "line": 26 } ]
1
python
from_hex, msg_headers, CBlockHeader, ) from test_framework.p2p import ( P2PInterface, ) from test_framework.test_framework import BitcoinTestFramework # Timeouts (in minutes) CHAIN_SYNC_TIMEOUT = 20 * 60 HEADERS_RESPONSE_TIME = 2 * 60 class P2POutEvict(BitcoinTestFramework): def set_test_params(self)...
Review this code and list any quality issues.
[ { "issue": "8fa272d: can we call `test_node` variable `peer` instead? `add_outbound_p2p_connection` returns `P2PInterface` objects and not a `TestNode` object like `test_node` implies.", "severity": "minor", "line": 26 } ]
1
python
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .rumble import RumbleEmbedIE from .youtube import YoutubeIE from ..utils import clean_html class Funker530IE(InfoExtractor): _VALID_URL = r'https?:\/\/(?:www\.)?funker530\.com\/video\/(?P<id>[^\/]+)\/?' ...
Review this code and list any quality issues.
[ { "issue": "Tests are only running the first item in this list. How do I get it to run the embedded YouTube video test as well?", "severity": "minor", "line": 14 } ]
1
python
schema = {'properties': {'my_dict': {'type': 'object', 'additionalProperties': {'type': 'string'}}}} assert _has_dict_typed_params(schema) is True def test_has_dict_typed_params_nested_dict(): """Test detection of nested dict types.""" from pydantic_ai.models.openai import _has_dict_typed_params # pyrigh...
Review this code and list any quality issues.
[ { "issue": "I'd prefer to test this with a tool function that actually has a `dict` argument, or a `BaseModel` argument that itself has a `dict` field, instead of testing the schemas directly.\r\n\r\nSo maybe can we build an agent with a tool like that, then run it, and test that a warning was emitted?", "s...
1
python
location=TEST_DATASET_LOCATION, job_id=job_id, project_id=TEST_GCP_PROJECT_ID, deferrable=True, ) with pytest.raises(AirflowException) as exc: op.execute(MagicMock()) assert str(exc.value) == f"BigQuery job {real_job_id} failed: True" @pytes...
Review this code and list any quality issues.
[]
0
python
"task": log_entry.data["workflow"]["task"]["title"], } except (KeyError, TypeError): return _("Workflow task resubmitted. Workflow resumed") @actions.register_action("wagtail.workflow.cancel") class CancelWorkflowActionFormatter(WorkflowLogFormatter): label =...
Review this code and list any quality issues.
[ { "issue": "Suggestion: Let Django / the app server deal with setting the content length. \r\n```suggestion\r\n```", "severity": "minor", "line": 26 } ]
1
python
'awx_hosts_total': 1.0, 'awx_hosts_total': 1.0, 'awx_schedules_total': 1.0, 'awx_inventory_scripts_total': 1.0, 'awx_sessions_total': 0.0, 'awx_sessions_total': 0.0, 'awx_sessions_total': 0.0, 'awx_custom_virtualenvs_total': 0.0, 'awx_running_jobs_total': 0.0, 'awx_instance_capacity'...
Review this code and list any quality issues.
[]
0
python
return q_idx >= kv_idx # ===== torch op registrations ===== # Registrations are required for fullgraph tracing compatibility # TODO: this is only required because the beta release FA3 does not have it. There is a PR adding # this but it was never merged: https://github.com/Dao-AILab/flash-attention/pull/1590 @_cust...
Review this code and list any quality issues.
[ { "issue": "Currently, fullgraph tracing for compile is failing with:\r\n\r\n```bash\r\ntorch._dynamo.exc.Unsupported: Operator does not support running with fake tensors\r\n Explanation: \r\n Hint: see https://docs.google.com/document/d/1GgvOe7C8_NVOMLOCwDaYV1mXXyHMXY7ExoewHqooxrs/edit#heading=h.64r4npvq0w0 ...
1
python
#!/usr/bin/env python3.6 x = 123456789 x = 1_2_3_4_5_6_7 x = 1E+1 x = 0xb1AcC x = 0.00_00_006 x = 12_34_567J x = .1_2 x = 1_2. # output #!/usr/bin/env python3.6 x = 123456789 x = 1_2_3_4_5_6_7 x = 1e1 x = 0xb1acc x = 0.00_00_006 x = 12_34_567j x = 0.1_2 x = 1_2.0
Review this code and list any quality issues.
[]
0
python
def _extract_player_responses(self, clients, video_id, webpage, master_ytcfg, player_url, identity_token): initial_pr = None if webpage: initial_pr = self._extract_yt_initial_variable( webpage, self._YT_INITIAL_PLAYER_RESPONSE_RE, video_id, 'initial player res...
Review this code and list any quality issues.
[ { "issue": "The condition `is_agegated` AND `client.endswith('_agegate')` never seems to apply. Because if an agegate client fails, the status is `UNPLAYABLE` and `desktopLegacyAgeGateReason` does not exist in the response. This is not covered by the `_is_agegated()` function. In my case, the creator client is ...
1
python
if not has_thread: if data.get('newly_created'): if thread.parent.__class__ is ForumChannel: thread.parent.last_message_id = thread.id # type: ignore self.dispatch('thread_create', thread) else: self.dispatch('thread_join', th...
Review this code and list any quality issues.
[ { "issue": "This dispatch call should be outside of the `if` block as otherwise the event is only dispatched when the thread is cached.", "severity": "major", "line": 26 } ]
1
python
Returns ------- DataFrame, or a ``{sheetname: DataFrame, ...}`` dict if reading multiple sheets. Examples -------- Read the "data" worksheet from an OpenOffice spreadsheet file into a DataFrame. >>> pl.read_ods( ... source="test.ods", ... sheet_name="data", ... ) # doctest...
Review this code and list any quality issues.
[]
0
python
) if strict: raise ValueError("GenerationConfig is invalid: \n" + info_message) else: attributes_with_issues = list(minor_issues.keys()) warning_message = ( f"The following generation flags are not valid and may be ignored: {at...
Review this code and list any quality issues.
[]
0
python
def test_read_csv_raises_on_no_files(): fn = ".not.a.real.file.csv" try: dd.read_csv(fn) assert False except OSError as e: assert fn in str(e) def test_read_csv_has_deterministic_name(): with filetext(csv_text) as fn: a = dd.read_csv(fn) b = dd.read_csv(fn) ...
Review this code and list any quality issues.
[]
0
python
'skip_download': True, }, }, { # live stream 'url': 'https://platform.wim.tv/embed/?live=28e22c22-49db-40f3-8c37-8cbb0ff44556&autostart=true', 'info_dict': { 'id': '28e22c22-49db-40f3-8c37-8cbb0ff44556', 'ext': 'm3u8', 'title': 'Streaming MSmotorTV...
Review this code and list any quality issues.
[ { "issue": "other extractors use groupname `url`. Use that for consistency", "severity": "major", "line": 26 } ]
1
python
if not sample_path.exists(): raise IOError(f"sample path {sample_path} does not exist or cannot be accessed") taste = sample_path.open("rb").read(8) return taste def is_runtime_ida(): return importlib.util.find_spec("idc") is not None def is_runtime_ghidra(): try: currentProgram # t...
Review this code and list any quality issues.
[ { "issue": "thoughts on importing this at the top?", "severity": "minor", "line": 26 } ]
1
python
import itertools from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( determine_ext, bool_or_none, int_or_none, parse_qs, try_get, unified_timestamp, url_or_none, ) class RutubeBaseIE(InfoExtractor): def _download_api_info(self, video_id, qu...
Review this code and list any quality issues.
[ { "issue": "secret should just be passed as part of `query`. Same below", "severity": "critical", "line": 19 } ]
1
python
resource_name = resource_name.split("/")[-1] return resource_name async def get_resource_sub_type_for_arn(arn: str) -> str: resource_name = arn.split(":")[5] if "/" in resource_name: return resource_name.split("/")[0] return "" async def get_url_for_resource( arn, resource_type=None,...
Review this code and list any quality issues.
[ { "issue": "Nice stuff!\r\n\r\nI think we need to handle the situation where `account_id` is `None` here. This function was generally only used for known resources previously. But if we pass in an S3 bucket ARN for an unknown resource, I'd expect this to be None. \r\n\r\nWe should try to adhere to the relativel...
1
python
def __ipow__(self, d_value: Union[float, int]): """adds ``**=`` syntax to exponentiate the value of the ValueTracker""" self.set_value(self.get_value() ** d_value) return self def __isub__(self, d_value: Union[float, int]): """adds ``-=`` syntax to decrement the value of the ValueTr...
Review this code and list any quality issues.
[ { "issue": "I am not convinced that `ExponentialValueTrackers` actually make sense to keep around. From looking at the video, it doesn't seem like the different interpolation actually happens -- and even if it did, the same effect can probably be achieved by passing a custom `rate_function` for `.animate`. \r\n...
1
python
if selected_backend == AttentionBackendEnum.TRITON_ATTN: logger.info("Using Triton Attention backend.") return AttentionBackendEnum.TRITON_ATTN.get_path() if selected_backend == AttentionBackendEnum.ROCM_ATTN: logger.info("Using Rocm Attention backend.") return A...
Review this code and list any quality issues.
[]
0
python
@staticmethod def _get_expert_ckpt_name(checkpoints_path, layer_id, expert_id, tag, mpu=None): mp_rank = 0 if mpu is None else mpu.get_model_parallel_rank() if layer_id <= -1: # Used to support old checkpoint loading ckpt_name = os.path.join(checkpoints_path, '' if tag is Non...
Review this code and list any quality issues.
[ { "issue": "Is this not needed to guarantee `zero_pp_rank_0_mp_rank_0*` for checkpoint loading in zero stage 3 (line 3020)?\n\n```suggestion\n mp_placeholder=\"0\" if self.load_universal_checkpoint() else \"*\",\n```", "severity": "minor", "line": 26 } ]
1
python
---------- y_true : array-like y_pred : array-like sample_weight : array-like, default=None Returns ------- type_true : one of {'multilabel-indicator', 'multiclass', 'binary'} The type of the true target data, as output by ``utils.multiclass.type_of_target``. y_true : arr...
Review this code and list any quality issues.
[ { "issue": "Putting the new raise ValueError below the `type_of_target` checks, because we need to raise the \n\"legacy multi-label data representation\" error from `sklearn/utils/multiclass.py` first. (test__check_targets_sparse_inputs fails otherwise)", "severity": "critical", "line": 26 } ]
1
python
info["background"] = canvas.copy_from_bbox(canvas.figure.bbox) def onmove(self, event): axs = [ax for ax in self.axes if ax.contains(event)[0]] if self.ignore(event) or not axs or not event.canvas.widgetlock.available(self): return ax = cbook._topmost_artist(axs) xdata, ...
Review this code and list any quality issues.
[]
0
python
MAR_i8: MaskedNDArray[np.int64] MAR_subclass: MaskedNDArraySubclass MAR_1d: np.ma.MaskedArray[tuple[int], np.dtype[Any]] assert_type(MAR_1d.shape, tuple[int]) assert_type(MAR_f4.dtype, np.dtype[np.float32]) assert_type(int(MAR_i8), int) assert_type(float(MAR_f4), float) assert_type(np.ma.min(MAR_b), np.bool) assert...
Review this code and list any quality issues.
[]
0
python
return wrapper def multiclass_auc_decorator() -> Callable: def wrapper(func_to_decorate: Callable) -> Callable: @wraps(func_to_decorate) def new_func(*args, **kwargs) -> torch.Tensor: results = [] for class_result in func_to_decorate(*args, **kwargs): x, y =...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n max_fpr: float = None,\r\n```", "severity": "minor", "line": 26 } ]
1
python
self.target_copy, ] def get_all_families_zipped(self) -> Iterable[tuple]: # more precise typing? mobs = [ self.mobject, self.starting_mobject, self.target_copy, ] return zip(*[mob.family_members_with_points() for mob in mobs]) def interpolat...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n Fades one mobject into another. Transform M1 is shown M2 does not change, only M1\r\n```", "severity": "minor", "line": 26 } ]
1
python
file="meshes/duck.obj", scale=second_scale, pos=(1.0, 0, 1.0), quat=(1, 0, 0, 0), ), ) scene.build() assert len(seen_paths) == 2, "Expected 2 cache paths, got %d" % len(seen_paths) assert len(seen_results) == 2, "Expected 2 convex decomposition results, got %...
Review this code and list any quality issues.
[ { "issue": "You have `assert_array_equal` for this but no big deal.", "severity": "minor", "line": 26 } ]
1
python
self.generate(self.nodes[0], 6) # Create tx and bump it to store 'replaced_by_txid' and 'replaces_txid' data within the transactions. # Additionally, store an extra comment within the original tx. extra_comment = "don't discard me" original_tx_id = wallet.sendtoaddress(address=wallet.ge...
Review this code and list any quality issues.
[ { "issue": "nit: for sake of completeness, could also unload `wo_wallet` here (as done in the next manual keys import subtests)", "severity": "minor", "line": 26 } ]
1
python
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import importlib import os import sys from typing import Optional, cast from nni.typehint import Literal __all__ = ['set_default_framework', 'get_default_framework', 'shortcut_module', 'shortcut_framework'] framework_type = Literal['pytorch', ...
Review this code and list any quality issues.
[ { "issue": "PEP 8 suggest to place this before `import`.", "severity": "minor", "line": 11 } ]
1
python
from .common import InfoExtractor from ..utils import ( traverse_obj, extract_attributes, remove_start, unescapeHTML, url_or_none, str_or_none, int_or_none, ) class ZaikoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?zaiko\.io/event/(?P<id>\d+)/stream(?:/\d+)+' _TESTS = [{ ...
Review this code and list any quality issues.
[ { "issue": "sort (and remove `remove_start` if applying suggestion below)\r\n```suggestion\r\nfrom ..utils import (\r\n extract_attributes,\r\n int_or_none,\r\n str_or_none,\r\n traverse_obj,\r\n unescapeHTML,\r\n url_or_none,\r\n)\r\n```", "severity": "critical", "line": 10 } ]
1
python
"g": [10, 10, 10, 20, 20, 30], "a": [0, 0, 0, 0, 0, 0], "b": [1, 1, 1, 1, 1, 1], "c": [11, 12, 13, 21, 22, 31], } ) # head if not groupby: q = df.lazy().select(lit.head(len)) else: q = df.lazy().group_by("g").agg(lit.head(len)) assert q.co...
Review this code and list any quality issues.
[ { "issue": "expected is just the same as df", "severity": "minor", "line": 26 } ]
1
python
def interpolate_submobject( self, submobject: "Mobject", starting_submobject: "Mobject", alpha: float ) -> None: submobject.points = starting_submobject.points submobject.apply_function( self.function_at_time_t(alpha), **self.apply_function_kwargs ) class SmoothedVector...
Review this code and list any quality issues.
[]
0
python
future.set_result(None) return True if mode == "abort": aborted_reqs = self.scheduler.finish_requests( None, RequestStatus.FINISHED_ABORTED ) if output_queue is not None: self._send_abort_outputs(output_queue, aborted_reqs) ...
Review this code and list any quality issues.
[ { "issue": "Are we okay with sleep level=0 always retaining prefix cache?", "severity": "major", "line": 26 } ]
1
python
# from https://www.klarna.com/uk/ # with data-video-src expect_dict( self, self.ie._parse_html5_media_entries( 'https://www.directvnow.com', r''' <video loop autoplay muted class="responsive-video block-kl__video video-on-medium"> ...
Review this code and list any quality issues.
[ { "issue": "Could u split this up to be more readable?", "severity": "major", "line": 26 } ]
1
python
def _parse_content(self, content, url): video_id = content['dataMediaId'] config = self._download_json( content['dataConfig'], video_id, 'Downloading config JSON') title = config['info']['title'] services = config['services'] caronte = self._download_json(services['ca...
Review this code and list any quality issues.
[ { "issue": "we shouldn't return the geo verification headers in the info dict; this defeats the purpose of `--geo-verification-proxy` since the download itself will be using the proxy then too", "severity": "minor", "line": 26 } ]
1
python
# collision mesh uses default color self._preprocess() def _build(self): pass def _preprocess(self): # compute file name via hashing for caching self._gsd_path = mu.get_gsd_path( self._init_verts, self._init_faces, self._material.sdf_cell_siz...
Review this code and list any quality issues.
[ { "issue": "should we delete the corrupted cache file?", "severity": "major", "line": 26 } ]
1
python
def test_log_sizes(self, subtests): # TODO: this isn't super stable between different devices for f, sz in self.log_sizes.items(): rate = LOGS_SIZE[f.name]/60. minn = rate * TEST_DURATION * 0.5 maxx = rate * TEST_DURATION * 1.5 with subtests.test(file=f.name): assert minn < sz < ...
Review this code and list any quality issues.
[ { "issue": "actually next run was 7ms with lower std too, maybe just slightly inconsistent due to no nice + no prio", "severity": "minor", "line": 26 } ]
1
python
docstring_format: DocstringFormat require_parameter_descriptions: bool strict: bool | None sequential: bool | None requires_approval: bool function_schema: _function_schema.FunctionSchema """ The base JSON schema for the tool's parameters. This schema may be modified by the `prepare` fu...
Review this code and list any quality issues.
[ { "issue": "Why not `: bool = False`? `strict` is the exception because `None` means \"determine if the JSON schema is strict-compatible\"", "severity": "minor", "line": 26 } ]
1
python
self.log.info("Restarting node to stop at height %d", PAUSE_HEIGHT) self.restart_node(1, extra_args=[ f"-stopatheight={PAUSE_HEIGHT}", *self.extra_args[1]]) # Finally connect the nodes and let them sync. # # Set `wait_for_connect=False` to avoid a race between performing con...
Review this code and list any quality issues.
[ { "issue": "Since you are checking the length of `chainstates`, maybe it is clear to put the index `1` instead of `-1`. That way, I believe it is easier to see that you are accessing the second chainstate.\n\nAre you sure the `assert_greater_than_or_equal` is needed? I don't see why `snapshot_height` would be h...
1
python
Parameters ---------- rows The number of rows in the grid. cols The number of columns in the grid. buff The gap between grid cells. To specify a different buffer in horizontal and vertical direction, a tuple of two values can be given. The ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n Defines a list of heights for certain rows (top to bottom). If the list contains `None`, the corresponding row will fit its height automatically based\r\n on the highest element in that row.\r\n```", "severity": "minor", "line": 26 } ]
1
python
# Index object we construct here, xref GH#56161 idx = Index(keys, dtype=keys.dtype, name=index_name) if ( bins is None and not sort and isinstance(values, (DatetimeIndex, TimedeltaIndex)) and values.inferred_freq is not None ...
Review this code and list any quality issues.
[ { "issue": "I think you can just do `idx.freq = values.inferred_freq`", "severity": "minor", "line": 26 } ]
1
python
assert rgb_array_to_png_bytes(data.rgb) == png_snapshot @pytest.mark.required def test_destroy_unbuilt_scene_with_camera(): """Test that destroy on an unbuilt scene with cameras doesn't crash.""" scene = gs.Scene(show_viewer=False) scene.add_entity(morph=gs.morphs.Plane()) scene.add_sensor(gs.sensors....
Review this code and list any quality issues.
[ { "issue": "Same. I think it should crash.", "severity": "critical", "line": 26 } ]
1
python
def _real_extract(self, url): video_id = self._match_id(url) headers = self.geo_verification_headers() webpage, urlh = self._download_webpage_handle(url, video_id, headers=headers) if not self._match_valid_url(urlh.url): return self.url_result(urlh.url) headers['Refe...
Review this code and list any quality issues.
[ { "issue": "should we just warn the user instead and extract the preview format?", "severity": "major", "line": 26 } ]
1
python
if actual_client in INNERTUBE_CLIENTS: if actual_client not in all_clients: clients.append(client_name) all_clients.add(actual_client) return # Android player_response does not have microFormats which are needed for ...
Review this code and list any quality issues.
[]
0
python
self.init_gl_points() self.init_gl_colors() Container.__init__(self, **kwargs) @classmethod def animation_override_for(cls, animation_class): if animation_class in cls.animation_overrides: return cls.animation_overrides[animation_class] return None @classmetho...
Review this code and list any quality issues.
[ { "issue": "Not returning anything means returning `None`, so I think this is redundant.", "severity": "minor", "line": 26 } ]
1
python
from .common import InfoExtractor from ..utils import ( traverse_obj, ExtractorError, # GeoRestrictedError, ) class NetverseBaseIE(InfoExtractor): def get_required_json(self, url, data=None): match = self._match_valid_url(url).groupdict() display_id, sites_type = match['display_id'], m...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n display_id, sites_type = self._match_valid_url(url).group('display_id', 'type')\r\n```", "severity": "minor", "line": 12 } ]
1
python
return system_prompt, generate_prompt # ============================================================================= # Tokenization utility functions # These functions are extracted from ToolAgentLoop for reusability in external # projects like remote rollout servers. # ==============================================...
Review this code and list any quality issues.
[ { "issue": "It's a bit redundant here, we can safely pass `tools=None` to processor.apply_chat_template?", "severity": "minor", "line": 26 } ]
1
python
""" Numerical integration or quadrature for a smooth function f with known values at x_i This method is the classical approach of summing 'Equally Spaced Abscissas' Method 1: "Extended Trapezoidal Rule" """ def method_1(boundary, steps): """ This function implements the extended trapezoidal rule for numeri...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n```\r\nSee previous comment", "severity": "minor", "line": 8 } ]
1
python
has_branched = True if __debug__ and callable(key): inspect.signature(key).bind(None, None) key_func = functools.partial(apply_key, key) objs = itertools.chain.from_iterable(map(key_func, objs)) return has_branched, objs def _traverse_obj(obj, path, us...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n inspect.signature(key).bind(None, None) # Verify function signature\r\n```", "severity": "minor", "line": 26 } ]
1
python
The unique ID for the strategy. Will become the strategy ID if not None. order_id_tag : str, optional The unique order ID tag for the strategy. Must be unique amongst all running strategies for a particular trader ID. oms_type : OmsType, optional The order management system type for the ...
Review this code and list any quality issues.
[ { "issue": "@sunlei I renamed this to a more neutral `event_logging` to avoid a redundant affirmative.\r\n\r\nWe could also consider making it something like `event_log_level` as well, since this new behavior still logs warning and above level events?", "severity": "minor", "line": 26 } ]
1
python
ModelRequestPart = Annotated[ SystemPromptPart | UserPromptPart | ToolReturnPart | RetryPromptPart, pydantic.Discriminator('part_kind') ] """A message part sent by Pydantic AI to a model.""" @dataclass(repr=False) class ModelRequest: """A request generated by Pydantic AI and sent to a model, e.g. a message fr...
Review this code and list any quality issues.
[ { "issue": "I like the description from `ToolReturn.metadata`:\r\n\r\n```suggestion\r\n \"\"\"Additional data that can be accessed programmatically by the application but is not sent to the LLM.\"\"\"\r\n```", "severity": "minor", "line": 26 } ]
1
python
'thumbnail': 'https://nbg-img.fite.tv/img/548677_460x260.jpg', 'description': 'Сезон 3 Епизод 25' }, }, { 'url': 'https://play.nova.bg/video/igri-na-volqta/season-3/igri-na-volqta-2021-09-20-1/548227', 'md5': '5fd61b8ecbe582fc021019d570965d58', ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n m3u8_url = self._download_json( f'https://nbg-api.fite.tv/api/v2/videos/{video_id}/streams', video_id,\r\n headers={'x-flipps-user-agent': 'Flipps/75/9.7'})[0]['url']\r\n```\r\nGH won't let me align the text properl...
1
python
@patch("oumi.core.configs.params.model_params.logger") def test_post_init_config_file_present(mock_logger, tmp_path: Path): with open(f"{tmp_path}/config.json", "w"): pass with open(f"{tmp_path}/adapter_config.json", "w"): pass params = ModelParams(model_name=str(tmp_path)) params.final...
Review this code and list any quality issues.
[]
0
python
from .huggingface import HuggingFaceModel return HuggingFaceModel(model_name, provider=provider) else: raise UserError(f'Unknown model: {model}') # pragma: no cover def cached_async_http_client(*, provider: str | None = None, timeout: int = 600, connect: int = 5) -> httpx.AsyncClient: """Cac...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n # Since there is no API from `functools.cache` to clear the cache for a specific\r\n```", "severity": "major", "line": 26 } ]
1
python
'thumbnail': r're:https?://resources\.newspicks\.com/.+\.(?:jpe?g|png)', 'timestamp': 1719086400, 'upload_date': '20240622', }, }] def _real_extract(self, url): series_id = self._match_id(url) video_id = traverse_obj(parse_qs(url), ('movieId', -1, {str}, {require...
Review this code and list any quality issues.
[ { "issue": "If the provided `duration` is only accurate to the minute (rather than the second), then it's not worth extracting IMO, since such an inaccurate duration could potentially cause problems with postprocessing.\r\n```suggestion\r\n```", "severity": "major", "line": 26 } ]
1
python
yield { 'id': str(item['id']), 'title': item.get('title'), 'description': item.get('description'), 'formats': formats, 'subtitles': subtitle, 'duration': parse_duration(item.get('duration')), ...
Review this code and list any quality issues.
[ { "issue": "Conventionally, the name `_entries` is used", "severity": "minor", "line": 26 } ]
1
python
"""Checks if a process is listening to the port. Args: port: int. The port number. Returns: bool. True if port is open else False. """ with contextlib.closing( socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s: return bool(not s.connect_ex(('localhost', port))) ...
Review this code and list any quality issues.
[]
0
python
) as client, ): agent_definition = await client.agents.create_agent( model=ai_agent_settings.model_deployment_name, name="GithubAgent", instructions="You are a microsoft/semantic-kernel Issue Triage Agent. " "You look at all issues that have the tag: 'triage' ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n thread: AzureAIAgentThread | None = None\r\n```", "severity": "minor", "line": 26 } ]
1
python
from .engine_config import ExecutionEngineConfig __all__ = ['RetiariiExeConfig'] def execution_engine_config_factory(engine_name): # FIXME: may move this function to experiment utils in future cls = _get_ee_config_class(engine_name) if cls is None: raise ValueError(f'Invalid execution engine name:...
Review this code and list any quality issues.
[ { "issue": "Can you prefix it with underscore?", "severity": "minor", "line": 26 } ]
1
python
"""The interface to the Replicate API.""" import os from ..framework.provider_interface import ProviderInterface class ReplicateInterface(ProviderInterface): """Implements the ProviderInterface for interacting with Replicate's APIs.""" def __init__(self): """Set up the Replicate client using the API...
Review this code and list any quality issues.
[ { "issue": "Can you make the url here an ENV variable and set the hardcoded value as a fallback? This will need to be added to the `.env.sample` as well. Something like\r\n\r\n`REPLICATE_BASE_URL=\"\"` in the .env.sampel\r\n\r\nThen in client initialization use:\r\n\r\n`os.getenv(\"REPLICATE_BASE_URL\", \"https...
1
python
[ ( Vector(start=Point(x=0.0, y=0.0), end=Point(x=0.0, y=0.0)), None, pytest.raises(ValueError), ), ( Vector(start=Point(x=1.0, y=1.0), end=Point(x=1.0, y=1.0)), None, pytest.raises(ValueError), ), ( ...
Review this code and list any quality issues.
[]
0
python
* If True, the file is downloaded and the data is sent to the model as bytes. * If False, the URL is sent directly to the model and no download is performed. """ identifier: str | None = None """Identifier for the file URL, such as a unique ID. This identifier can be provided to the model in a mes...
Review this code and list any quality issues.
[ { "issue": "For this not to be a breaking change, this needs to added at the end so that previous initializations that didn't use keyword arguments still work.", "severity": "minor", "line": 26 } ]
1
python
return key assert False def check_script(script): if isinstance(script, str): script = bytes.fromhex(script) # Assuming this is hex string if isinstance(script, bytes) or isinstance(script, CScript): return script assert False class TestFrameworkScriptUtil(unittest.TestCase): de...
Review this code and list any quality issues.
[ { "issue": "This works! Following the hint from https://github.com/bitcoin/bitcoin/pull/29415#discussion_r2160767733 I could integrate it into the tests of https://github.com/bitcoin/bitcoin/pull/29415 to try to send two transactions that have the same txid and different wtxid.\r\n\r\nHowever using it is a bit ...
1
python
.. code-block:: python import qlib import logging from qlib.log import get_module_logger, set_global_logger_level qlib.init() tmp_logger_01 = get_module_logger("tmp_logger_01", level=logging.INFO) tmp_logger_01.info("1. tmp_logger_01 info show") ...
Review this code and list any quality issues.
[ { "issue": "The function name is too long...\r\nYou can use a shorter name (e.g. use `cm` to replace contextmanger)", "severity": "major", "line": 26 } ]
1
python
from .common import InfoExtractor from ..utils import parse_iso8601 class PrankCastIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?prankcast\.com/.*/showreel/(?P<id>\d+)-(?P<display_id>.+)' _TESTS = [{ 'url': 'https://prankcast.com/Devonanustart/showreel/1561-Beverly-is-back-like-a-heart-attack-'...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n _VALID_URL = r'https?://(?:www\\.)?prankcast\\.com/[^/?#]+/showreel/(?P<id>\\d+)-(?P<display_id>[^/?#]+)'\r\n```", "severity": "minor", "line": 6 } ]
1
python
self._test_cow_mutation(mutation) @support.cpython_only def test_cow_setstate(self): # __setstate__ should cause buffer to be released. memio = self.ioclass(b'foooooo') state = memio.__getstate__() def mutation(memio): memio.__setstate__(state) self._test_cow...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n def test_write_concurrent_mutation(self):\r\n # Prevent crashes when buf.write() concurrently mutates 'buf'.\r\n # See: https://github.com/python/cpython/issues/143378.\r\n\r\n```", "severity": "critical", "line": 26 } ]
1
python
def _get_retry_delay(self, attempt: int) -> float: """Calculate the delay before the next retry attempt.""" if self.exponential_backoff: return self.delay_between_retries * (2**attempt) return self.delay_between_retries def _is_retryable_error(self, error: ModelProviderError) ->...
Review this code and list any quality issues.
[ { "issue": "The non-retryable status codes should include 404 (Not Found). If a model ID or endpoint doesn't exist, retrying won't resolve the error. Add 404 to the set of non_retryable_codes.\n```suggestion\n non_retryable_codes = {400, 401, 403, 404, 413, 422}\n```", "severity": "minor", "line"...
1
python
'id': 'I2DL/12349/PRES', 'ext': 'mp4', 'title': 'Lecture 3: Introduction to Neural Networks', 'series': 'Introduction to Deep Learning (IN2346)', } }, { # Camera only 'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM', 'md5': 'e04189d92ff2f56aed...
Review this code and list any quality issues.
[ { "issue": "this can be non-fatal\r\n```suggestion\r\n lecture_title = self._html_search_regex(r'<h1[^>]*>([^<]+)</h1>', webpage, 'title', fatal=False)\r\n```", "severity": "minor", "line": 26 } ]
1
python
Passes value through unchanged """ if payload is None: return self.default_value return payload def postprocess(self, value: Any) -> Any: """ Parameters: value: Value to store in local storage Returns: Passes value through unchange...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n \"\"\"BrowserState components should not break wrapper grouping chains.\"\"\"\r\n```", "severity": "minor", "line": 26 } ]
1
python
obj = self.model(**kwargs) self._for_write = True obj.save(force_insert=True, using=self.db) return obj create.alters_data = True async def acreate(self, **kwargs): return await sync_to_async(self.create)(**kwargs) acreate.alters_data = True def _prepare_for_bulk_crea...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n objs_without_pk.append(obj)\r\n```\r\nI'm not sure if I've missed something but I can change to the following without any bulk_create test failures. Are we missing a test for this or can it be simplified?", "severity": "critical", "line": 26 } ]
1
python
stupid_format_method_bug = ( "Some really long string that just so happens to be the {} {} to force the 'format'" " method to hang over the line length boundary. This is pretty annoying.".format( "perfect", "length" ) ) class A: def foo(): os.system( "This is a regression t...
Review this code and list any quality issues.
[]
0
python
pos = list(current.keys())[0].find('[0-9]') if pos == -1: # no wildcard expressions left to specialize in the glob return list(current.keys()) char_sets = {} for g, p in current.items(): char_sets[g] = sorted({path[pos] for path in p}) if sum(len(s) fo...
Review this code and list any quality issues.
[ { "issue": "https://github.com/spotify/luigi/pull/2834/files#diff-b81d2935d10c6b5ffb3685b1f91fe1d3R533 looks a bit weird now.", "severity": "minor", "line": 26 } ]
1
python
ref = stats.kstest(vals, stats.cauchy.cdf, _no_deco=True) assert np.all(np.isfinite(res)) assert_equal(res, ref) assert not np.isnan(res.statistic) assert not np.isnan(res.pvalue) # missing: no test that uses *args class TestKSOneSample: """ Tests kstest and ks_samp 1-samp...
Review this code and list any quality issues.
[ { "issue": "I guess you've now folded the attribute check into `_testOne`?", "severity": "minor", "line": 26 } ]
1
python
terminating_pod, ] returned_pod = op.find_spark_job(context) assert returned_pod is pending_pod def test_find_spark_job_picks_succeeded( self, mock_is_in_cluster, mock_parent_execute, mock_create_namespaced_crd, mock_get_namespaced_custom_object_sta...
Review this code and list any quality issues.
[ { "issue": "Fix the value assigned to `task_name` as well. This test appears to be for 'Succeeded' pods.", "severity": "minor", "line": 26 } ]
1
python
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import pytest from promptflow._sdk.entities import AzureOpenAIConnection, CustomConnection from .._azure_utils import DEFAULT_TEST_TIMEOU...
Review this code and list any quality issues.
[]
0
python
"name": "Agnes" } }]""" expected = "(serializers.article:pk=1) field_value was 'doesnotexist'" with self.assertRaisesMessage(DeserializationError, expected): for obj in serializers.deserialize("json", test_string, ignore=False): obj.save() def test_he...
Review this code and list any quality issues.
[ { "issue": "We avoid preambles like \"ensure\"", "severity": "minor", "line": 26 } ]
1
python
def test_set_page_config_sidebar_expanded(self): st.set_page_config(initial_sidebar_state="expanded") c = self.get_message_from_queue().page_config_changed assert c.initial_sidebar_state == PageConfigProto.EXPANDED def test_set_page_config_sidebar_collapsed(self): st.set_page_config...
Review this code and list any quality issues.
[ { "issue": "[nit] Small thing, but I would combine these two tests for invalid values.", "severity": "minor", "line": 26 } ]
1
python
["Y"], axis=axis, block_size=block_size, ) ] graph = helper.make_graph( nodes, "test", [ helper.make_tensor_value_info("X", TensorProto.INT8, input_shape), ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n shape = (2, 3)\r\n```", "severity": "minor", "line": 26 } ]
1
python
"""BuilderConfig for Spark.""" features: Optional[datasets.Features] = None def reorder_dataframe_by_partition(df: "pyspark.sql.DataFrame", new_partition_order: List[int]): # get the first partition and place it in new dataframe df_combined = df.select("*").where(f"part_id = {new_partition_order[0]}").dr...
Review this code and list any quality issues.
[ { "issue": "Instead of keeping track of partition sizes, it may be cleaner to just keep the part_id column but delete it from the row dict map before yielding it", "severity": "minor", "line": 26 } ]
1