language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
def _emit_events(self, span: Span, events: list[Event]) -> None: if self.event_mode == 'logs': for event in events: self.event_logger.emit(event) else: attr_name = 'events' span.set_attributes( { attr_name: json.dump...
Review this code and list any quality issues.
[ { "issue": "Why can't we use the proper type?", "severity": "minor", "line": 26 } ]
1
python
relinker_info = self._extract_relinker_info(video['content_url'], video_id) self._sort_formats(relinker_info['formats']) thumbnails = [] for _, value in media.get('images', {}).items(): if value: thumbnails.append({ 'url': urljoin(url, value), ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n alt_title = join_nonempty(media.get('subtitle'), media.get('toptitle'), delim=' - ')\r\n```", "severity": "minor", "line": 26 } ]
1
python
'http://bangumi.bilibili.com/jsonp/seasoninfo/%s.ver' % bangumi_id, bangumi_id, transform_source=strip_jsonp)['result'] entries = [{ '_type': 'url_transparent', 'url': smuggle_url(episode['webplay_url'], {'no_bangumi_tip': 1}), 'ie_key': BiliBiliIE.ie_key(), ...
Review this code and list any quality issues.
[ { "issue": "I think you can take the query as an argument and avoid using **kwargs", "severity": "minor", "line": 26 } ]
1
python
ret = super(BaseVariableDataSerializer, self).to_representation(obj) return parse_yaml_or_json(ret.get('variables', '') or '{}') def to_internal_value(self, data): data = {'variables': json.dumps(data)} return super(BaseVariableDataSerializer, self).to_internal_value(data) class Inventory...
Review this code and list any quality issues.
[ { "issue": "I did some googling, and it looks like the proper way of solving this is not populating the choices at the module import time but pushing it further towards the serializer instance initialization. So the class attribute definition would look like this:\r\n\r\n```suggestion\r\n source = serializer...
1
python
) from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntryState from homeassistant.core import HomeAssistant from homeassistant.util import dt as dt_util from homeassistant.util.location import LocationInfo from . import ENTRY_CONFIG, init_integration from tests.common import MockConfigEntry, async_fire_ti...
Review this code and list any quality issues.
[ { "issue": "I think it would be better to make this a fixture (`with patch... yield`) in `conftest.py`, in conjunction with `@pytest.mark.usefixtures(xyz)`.", "severity": "minor", "line": 26 } ]
1
python
return _decorator monkeypatch.setattr(console_ns, "route", _noop_route) module_name = "controllers.console.workspace.load_balancing_config" sys.modules.pop(module_name, None) module = importlib.import_module(module_name) return module def _mock_user(role: TenantAccountRole) -> SimpleNamespace: ...
Review this code and list any quality issues.
[]
0
python
#!/usr/bin/env python3 # Copyright (c) 2014-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the RPC HTTP basics.""" from test_framework.test_framework import BitcoinTestFramework from test_...
Review this code and list any quality issues.
[ { "issue": "I'm not sure about this but shouldn't this be `socket.timeout`? As we're using `sock.recv` and not `getresponse()`?", "severity": "minor", "line": 26 } ]
1
python
'ext': 'mp4', 'title': 'Resum | UA Horta — UD Viladecans', 'type': 'video/mp4', }, 'skip': 'Requires login', }] def _perform_login(self, username, password): login = self._download_json( 'https://api.laxarxames.cat/Authorization/SignIn', None, note='L...
Review this code and list any quality issues.
[ { "issue": "Is this actually used as a cookie, or do you just want to pass the data between the `_perform_login` and `_real_extract` functions?\r\nIf it's the latter, you can just write the token to `self._TOKEN` or similar.", "severity": "major", "line": 26 } ]
1
python
results = [] for item in opts.ordering: if hasattr(item, "resolve_expression") and not isinstance( item, OrderBy ): item = item.desc() if descending else item.asc() if isinstance(item, OrderBy): resul...
Review this code and list any quality issues.
[]
0
python
cls._topics_registrations_list[registration.topic] = {registration} return registration.registration_id, registration.queue @classmethod def unregister(cls, registration_id: str): """Unregister a listener. Example usage: ```python registration_id, registered_queue = N...
Review this code and list any quality issues.
[ { "issue": "This is not correct. we only provide the registration_id to unregister.", "severity": "minor", "line": 26 } ]
1
python
LOG.error(self.log_data) raise if self.screen_pid: # Killing screen will send SIGHUP to underlying Firecracker. # Needed to avoid false positives in case kill() is called again. self.expect_kill_by_signal = True utils.run_cmd(f"kill -9 {self.screen_pi...
Review this code and list any quality issues.
[ { "issue": "Also could be replaced by `psutil.Process()`", "severity": "minor", "line": 26 } ]
1
python
#!/usr/bin/env python3 # Copyright (c) 2017-2022 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test external signer. Verify that a bitcoind node can use an external signer command. See also wallet_...
Review this code and list any quality issues.
[ { "issue": "note: from https://docs.python.org/3/library/sys.html#sys.executable, there are no guarantees that `sys.executable` returns a Python path\r\n\r\n> A string giving the absolute path of the executable binary for the Python interpreter, on systems where this makes sense. If Python is unable to retrieve...
1
python
video, (('baseUrl', 'base_url'), {self._FORMAT_ID_RE.search}, 1), ('id', {str_or_none}), get_all=False), 'format': format_names.get(video.get('id')), } for video in traverse_obj(play_info, ('dash', 'video', ...))) if formats: self.check_missing_formats(play_info,...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'duration': ('timelength', {functools.partial(float_or_none, scale=1000)}),\r\n```", "severity": "minor", "line": 26 } ]
1
python
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing p...
Review this code and list any quality issues.
[ { "issue": "We removed this config because it was no longer used. Please update `airflow-core/src/airflow/cli/commands/config_command.py` as well to no longer mark this config as removed.", "severity": "minor", "line": 26 } ]
1
python
if num > 0 and reason not in ["out_of_memory", "denied", "not_found"]: raise AssertionError(f"GET {reason}: {num}") def test_ext_handle_put_and_get_with_prefix(cache_mgr_fixture): shape, spec, cache_mgr, param = cache_mgr_fixture if ( spec.block_layout == KVCacheBlockLayout.LCND and...
Review this code and list any quality issues.
[ { "issue": "Will idx be greater than the number of blocks?", "severity": "minor", "line": 26 } ]
1
python
# Model for this Team model: Optional[Model] = None # --- Team settings --- # Team UUID (autogenerated if not set) id: Optional[str] = None # Name of the team name: Optional[str] = None # If this team is part of a team itself, this is the role of the team role: Optional[str] = None ...
Review this code and list any quality issues.
[ { "issue": "We have to keep the old setting and make both work. We can raise a deprecation warning for the old one. But it has to be backwards compatible", "severity": "minor", "line": 26 } ]
1
python
... "A": ["foo", "bar", "foo", "bar", "foo", "bar"], ... "B": ["one", "one", "two", "three", "two", "two"], ... "C": [1, 5, 5, 2, 5, 5], ... "D": [2.0, 5.0, 8.0, 1.0, 2.0, 9.0], ... } ... ) >>> grouped = df.groupby("A")[["C", "D"]] ...
Review this code and list any quality issues.
[ { "issue": "The column labels should be aligned to the right most character from the value.\n\n```python\ndf = pd.DataFrame({\"aa\": [100, 100, 200], \"bb\": [300, 400, 500]})\nprint(df)\n# aa bb\n# 0 100 300\n# 1 100 400\n# 2 200 500\n```\n\n\n```suggestion\n C D\n 0 4.0 6.0...
1
python
from torch.nn import Module class CompressorSchema: def __init__(self, data_schema: List[Dict], model: Module, logger: Logger): assert isinstance(data_schema, list) self.data_schema = data_schema self.compressor_schema = Schema(self._modify_schema(data_schema, model, logger)) def _mod...
Review this code and list any quality issues.
[]
0
python
from .common import InfoExtractor from ..utils import ( get_element_by_id, js_to_json, traverse_obj, ExtractorError, ) import base64 class IxiguaIE(InfoExtractor): _VALID_URL = r'https?://(?:\w+\.)?ixigua\.com/(?:video/)?(?P<id>[0-9]+).+' _TEST = { 'url': 'https://www.ixigua.com/699688...
Review this code and list any quality issues.
[ { "issue": "this is incorrect.\r\nset it manually below", "severity": "critical", "line": 17 } ]
1
python
import time import os import pytest from dash import Dash, dcc, html, Input, Output @pytest.mark.skipif( os.getenv("CIRCLECI") is not None, reason="geolocation is disabled on CI" ) def test_geol001_position(dash_dcc): dash_dcc.driver.execute_cdp_cmd( "Emulation.setGeolocationOverride", {"latit...
Review this code and list any quality issues.
[]
0
python
pages_index = {} if len(tables) == 1: df = list(tables.values())[0] pages_files[0] = df else: # file has several pages, create a new one with info df = pd.DataFrame(tables.keys(), columns=["Tables"]) pages_files[0] = df for i, page_...
Review this code and list any quality issues.
[ { "issue": "Maybe we create new FileNotFound error and catch it https://github.com/mindsdb/mindsdb/blob/355644b15760077fa609fe27a4aeb91f6cbe227e/mindsdb/api/http/namespaces/file.py#L212 to be more des criptive", "severity": "minor", "line": 26 } ]
1
python
TensorProto.FLOAT8E5M2FNUZ, [7], [0, 0.5, 1, 50000, 96, -0.0000001, 0.0000001], ) ynp = numpy_helper.to_array(y) expected = np.array( [0, 0.5, 1, 49152, 96, 0, 0], dtype=ml_dtypes.float8_e5m2fnuz ) np.testing.assert_equal(ynp.view(np.uint8), ex...
Review this code and list any quality issues.
[]
0
python
max_session_rotations: Maximum number of session rotations per request. The crawler rotates the session if a proxy error occurs or if the website blocks the request. The session rotations are not counted towards the `max_request_retries` limit. max_crawl_depth: Specifies the ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n status_message_logging_interval: Interval for logging the crawler status messages.\r\n```", "severity": "minor", "line": 26 } ]
1
python
return [(self.map_tensor_name(name), data_torch)] def _is_vision_tensor(self, name: str) -> bool: return "vision_tower" in name or "multi_modal_projector" in name def _is_audio_tensor(self, name: str): return any(p in name for p in ["audio", "codebook", "conformer", "depth_embedding", "depthfo...
Review this code and list any quality issues.
[ { "issue": "Not a change request, but I'm wondering if we should introduce an `extra_model_files()` API in near future @CISC @compilade ?\n\nSomething like this:\n\n```py\nclass LFM2ColBertModel(LFM2Model):\n def extra_model_dir():\n return [self.dir_model / \"1_Dense\" / \"model.safetensors\"]\n# ten...
1
python
rules: RuleSet, capabilities: MatchResults, result: capa.engine.Result, ) -> "Match": success = bool(result) node = node_from_capa(result.statement) children = [Match.from_capa(rules, capabilities, child) for child in result.children] # logic expression, like `and`,...
Review this code and list any quality issues.
[]
0
python
class TokenResponse(WorkerResponseBase): response_type: Literal["token"] = "token" text: str log_prob: float | None token_id: int class GeneratedTextResponse(WorkerResponseBase): response_type: Literal["generated_text"] = "generated_text" text: str finish_reason: Literal["length", "eos_tok...
Review this code and list any quality issues.
[ { "issue": "this belongs to a PR stacked on top of this one", "severity": "minor", "line": 26 } ]
1
python
assert config_entry.state is ConfigEntryState.SETUP_RETRY @pytest.mark.parametrize( ("state", "exception"), [ ( ConfigEntryState.SETUP_ERROR, OAuth2TokenRequestReauthError(domain=DOMAIN, request_info=Mock()), ), ( ConfigEntryState.SETUP_RETRY, ...
Review this code and list any quality issues.
[ { "issue": "The type annotation for `exception` parameter is inconsistent with the parametrized test data. The data includes both exception instances (lines 98, 102) and an exception class (line 106). The type hint should be `type[Exception] | Exception` to accurately reflect what's being passed, or all test pa...
1
python
'fresnels': ':func:`~sympy.functions.special.error_functions.fresnels`', 'fresnelc': ':func:`~sympy.functions.special.error_functions.fresnelc`', # Elliptic integrals 'elliptic_k': ':func:`~sympy.functions.special.elliptic_integrals.elliptic_k`', 'elliptic_e': ':func:`~sympy.functions.s...
Review this code and list any quality issues.
[ { "issue": "The key 'rf' in FUNCTION_LINKS should be 'RisingFactorial' instead. When extracting function names using atom.func.__name__ on line 68, the name returned will be 'RisingFactorial' (the actual class name), not 'rf' (which is just an alias). This means formulas using rf will not have their function li...
1
python
openai_top_logprobs: int """Include log probabilities of the top n tokens in the response.""" openai_user: str """A unique identifier representing the end-user, which can help OpenAI monitor and detect abuse. See [OpenAI's safety best practices](https://platform.openai.com/docs/guides/safety-best-prac...
Review this code and list any quality issues.
[ { "issue": "Can we do this only if `self.system == 'azure'`?", "severity": "minor", "line": 26 } ]
1
python
formats.extend(fmts) self._merge_subtitles(subs, target=subtitles) if caption_url := traverse_obj(video_data, ('captionPath', {url_or_none})): subtitles.setdefault('en', []).append({'url': caption_url, 'ext': 'vtt'}) return { 'id': video_id, 'display_id':...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n IE_NAME = 'tvw:news'\r\n```", "severity": "minor", "line": 26 } ]
1
python
class File: """A general util for file operations.""" @classmethod async def write(cls, root_path: Path, filename: str, content: bytes) -> Path: """Write the file content to the local specified path. Args: root_path: The root path of file, such as "/data". filename:...
Review this code and list any quality issues.
[ { "issue": "If it's a general save func, log info should't contain `docx`", "severity": "minor", "line": 26 } ]
1
python
'num_trials': 6, 'range_num_images_per_batch': [1, 20], 'range_num_sw_batch_size': [1, 20] } } ALGO: the name of algorithm. It could be one of algorithm names (e.g., 'dints') or 'unversal' which ...
Review this code and list any quality issues.
[ { "issue": "Maybe we can commit less line changes by:\r\n```\r\nif gen_algo.skip_bundlegen:\r\n log.info(...)\r\n continue\r\n\r\nif gpu_customization:\r\n ...\r\n```", "severity": "minor", "line": 26 } ]
1
python
@pytest.mark.parametrize( "model_name, matches_fn, model_kwargs, hf_overrides, use_deepgemm", [ (*llama3_8b_fp8, False), (*qwen3_a3b_fp8, False), pytest.param( *llama4_scout_fp8, False, marks=pytest.mark.skipif( not current_platform.is_...
Review this code and list any quality issues.
[ { "issue": "you can add `attn_backend` to the parametrize list for the model, or have the model list and backends be set according to the platform e.g. https://github.com/vllm-project/vllm/blob/main/tests/compile/passes/test_fusion_attn.py#L223", "severity": "minor", "line": 26 } ]
1
python
assert_equal(self.nodes[0].gettransaction(bump2)["confirmations"], 1) assert_equal(tx2 in self.nodes[1].getrawmempool(), True) self.connect_nodes(0, 1) self.sync_blocks() self.expect_wallet_notify([(bump2, blockheight2, blockhash2), (tx2, -1, UNCONFIRMED_HASH_STRING)]) ...
Review this code and list any quality issues.
[ { "issue": "nit: isn't \"at least\" imprecise, and you need _more than_ 6 blocks?\r\nThe validation codes uses `>` instead of `>=` and the test fails if I create just 6 blocks on top of the tip.", "severity": "critical", "line": 26 } ]
1
python
from sympy.matrices.expressions.hadamard import HadamardProduct from sympy.matrices.expressions.inverse import Inverse from sympy.matrices.expressions.matexpr import (MatrixExpr, MatrixSymbol) from sympy.matrices.expressions.special import Identity, OneMatrix from sympy.matrices.expressions.transpose import Transpose f...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if expr.free_symbols & x.free_symbols:\r\n```", "severity": "minor", "line": 26 } ]
1
python
super().__init__(None, run_time=run_time, **kwargs) # quick fix to work in opengl setting: self.mobject.shader_wrapper_list = [] def begin(self) -> None: pass def finish(self) -> None: pass def clean_up_from_scene(self, scene: "Scene") -> None: pass def update...
Review this code and list any quality issues.
[ { "issue": "This is my fault\r\n```suggestion\r\n :meth:`.Mobject.add_animation_override`\r\n```", "severity": "minor", "line": 26 } ]
1
python
) register_template( name="zephyr", format_user=StringFormatter(slots=["<|user|>\n{{content}}", {"eos_token"}, "<|assistant|>\n"]), format_system=StringFormatter(slots=["<|system|>\n{{content}}", {"eos_token"}]), default_system="You are Zephyr, a helpful assistant.", ) register_template( name="z...
Review this code and list any quality issues.
[ { "issue": "It is `False` by default, you can remove this line", "severity": "major", "line": 26 } ]
1
python
else: params_not_in_partition.append(tensor) current_index = current_index + tensor_size return params_in_partition, params_not_in_partition, first_offset def zero_grad(self, set_to_none=False): """ Zero FP16 parameter grads. """ # FP32 grad sho...
Review this code and list any quality issues.
[ { "issue": "I don't think this is necessary since these are our pointers which should never be exposed externally (e.g., to autograd).", "severity": "minor", "line": 26 } ]
1
python
shrink: bool = True, order: _OrderKACF | None = None, ) -> _MaskedArray[_ScalarT]: ... @overload def __new__( cls, data: object, mask: _ArrayLikeBool_co = nomask, dtype: DTypeLike | None = None, copy: bool = False, subok: bool = True, ndmin: in...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n return_scalar: bool = False,\r\n ) -> MaskedArray[_ShapeT, _DTypeT]: ...\r\n```", "severity": "minor", "line": 26 } ]
1
python
return (value, None) @staticmethod def _get_variable_hash_names( gui: "Gui", attributes: t.Dict[str, t.Any], hash_names: t.Optional[t.Dict[str, str]] = None ) -> t.Dict[str, str]: if hash_names is None: hash_names = {} hashes = {} # Bind potential function and ex...
Review this code and list any quality issues.
[ { "issue": "What would be the 'else' part?", "severity": "minor", "line": 26 } ]
1
python
} def _real_extract(self, url): video_id = self._match_id(url) return self.url_result( 'http://www.bilibili.tv/video/av%s/' % video_id, ie=BiliBiliIE.ie_key(), video_id=video_id) class BiliIntlBaseIE(InfoExtractor): _API_URL = 'https://api.bili{}/intl/gateway' def...
Review this code and list any quality issues.
[ { "issue": "isnt it better to do\r\n```\r\nif not video_res.get('url'):\r\n continue\r\nformats.append(...)\r\n```\r\n\r\nsame below", "severity": "minor", "line": 26 } ]
1
python
# NOTE: If you change the font styling CSS, then be sure the check for # svg.fonttype = none in `lib/matplotlib/testing/compare.py::convert` remains in # sync. Also be sure to re-generate any SVG using this mode, or else such tests # will fail to use the right converter for the expected images, ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n weight = fm.weight_dict.get(prop.get_weight(), prop.get_weight)\n```\nwould this handle both the string and int case?", "severity": "minor", "line": 26 } ]
1
python
validation_result = ( self.validate(value) if "changed" in self.validate_on else None ) self.post_message(self.Changed(self, value, validation_result)) # If this is the first time the value has been updated, set the cursor position to the end if self._initial_value: ...
Review this code and list any quality issues.
[]
0
python
Conversation( name="starchat", system_template="<system>{system_message}\n", roles=("<|user|>", "<|assistant|>"), messages=(), offset=0, sep_style=SeparatorStyle.CHATML, sep="<|end|>", stop_token_ids=[0, 49155], stop_str="<|end|>", ) ) # Baich...
Review this code and list any quality issues.
[ { "issue": "Could you clarify why the stop token IDs are being deleted? Are they no longer required?\r\nDid you test the CLI and check whether the model can stop successfully?", "severity": "minor", "line": 26 } ]
1
python
file_element.get('file') for file_element in traverse_obj( data, ('files', lambda _, v: url_or_none(v.get('file')))) if file_element.get('file') and determine_ext(file_element.get('file')) == 'm3u8'), None) if needs_private_auth and m3u8_url and strm_id: self._request_we...
Review this code and list any quality issues.
[ { "issue": "filtering is non-fatal inside traversal, revert\r\n```suggestion\r\n traverse_obj(data, ('files', lambda _, v: url_or_none(v['file']))), start=1):\r\n```", "severity": "minor", "line": 26 } ]
1
python
NetEaseMusicListIE, NetEaseMusicMvIE, NetEaseMusicProgramIE, NetEaseMusicSingerIE, ) from .netverse import ( NetverseIE, NetversePlaylistIE, NetverseSearchIE, ) from .netzkino import NetzkinoIE from .newgrounds import ( NewgroundsIE, NewgroundsPlaylistIE, NewgroundsUserIE, ) from .ne...
Review this code and list any quality issues.
[]
0
python
return detections.tracker_id[detection_idx] def resolve_text_background_xyxy( center_coordinates: Tuple[int, int], text_wh: Tuple[int, int], position: Position, ) -> Tuple[int, int, int, int]: center_x, center_y = center_coordinates text_w, text_h = text_wh if position == Position.TOP_LEFT: ...
Review this code and list any quality issues.
[]
0
python
def build_entity(id, name, entity_type, description): return Entity( id=UUID(id), name=name, is_a=entity_type, description=description, ) # endregion async def consolidate_entity_descriptions(nodes) -> List[DataPoint]: system_prompt = render_prompt(prompt_name, {}) en...
Review this code and list any quality issues.
[ { "issue": "Could we move the EntityType resolution into get_entity_neighborhood so that each node's dict already comes with its resolved EntityType, instead of re-querying the graph later in consolidate_entity_descriptions? This way we could probably avoid the inner loop altogether.", "severity": "minor", ...
1
python
chn_input = torch.ones((1, 1, 3)) chn_target = torch.ones((1, 1, 3)) loss = FocalLoss(include_background=False) loss(chn_input, chn_target) with self.assertWarns(Warning): chn_input = torch.ones((1, 3, 3)) chn_target = torch.ones((1, 3, 3)) ...
Review this code and list any quality issues.
[ { "issue": "We have [this definition](https://github.com/Project-MONAI/MONAI/blob/01711cf7e3af991aabc92cc3fdf4c0b65949e65e/tests/test_utils.py#L874C1-L874C14) to use in place of this line if you want. Another approach is to have a `device` argument and use the `parameterized.expand` decorator [like here](https:...
1
python
self.log.debug('Wallet file timestamp after calling info: {}'.format(timestamp_after)) self.log_wallet_timestamp_comparison(timestamp_before, timestamp_after) # # TODO: Wallet tool info should not write to the wallet file. # This assertion should be uncommented and succeed: # ass...
Review this code and list any quality issues.
[]
0
python
import importlib.resources import json import sys from typing import Any def get_schema(tool_name: str = "cibuildwheel") -> Any: "Get the stored complete schema for black's settings." assert tool_name == "black", "Only black is supported." loc = "resources/black.schema.json" if sys.version_info < (3...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\ndef get_schema(tool_name: str = \"black\") -> Any:\r\n```", "severity": "minor", "line": 7 } ]
1
python
def write_frame(self, frame_or_renderer): """ Used internally by Manim to write a frame to the FFMPEG input buffer. Parameters ---------- frame : np.array Pixel array of the frame. """ if config["use_opengl_renderer"]: renderer = f...
Review this code and list any quality issues.
[]
0
python
'channel_is_verified': False, 'thumbnail': r're:^https?://.*\.jpg$', 'timestamp': 1705510344, 'upload_date': '20240117', 'live_status': 'is_live', 'view_count': int, 'concurrent_view_count': int, }, 'skip': 'The channel is not curre...
Review this code and list any quality issues.
[ { "issue": "maybe we should do this just in case? not a mandatory change\r\n```suggestion\r\n if thumbnail_template and '{type}' in thumbnail_template:\r\n```", "severity": "minor", "line": 26 } ]
1
python
assert len(lr_sched) == len(freq) == 0 # opt tuple of 2 lists model.configure_optimizers = lambda: ([opt_a], [scheduler_a]) optim, lr_sched, freq = trainer.init_optimizers(model) assert len(optim) == len(lr_sched) == 1 assert len(freq) == 0 assert optim[0] == opt_a assert lr_sched[0] == dic...
Review this code and list any quality issues.
[ { "issue": "This is undoing the usage of `ref_lr_sched` (see diff)\r\n\r\nProbably comes from a messed merge", "severity": "minor", "line": 26 } ]
1
python
# and functions non-CPU devices, such as GPUs, can be used # to perform the computation. As a result performance is improved # and integration with these libraries is easier. # # In scikit-learn 1.8, several estimators and functions have been updated to # support array API compatible inputs, for example PyTorch tensors...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n# Here is an excerpt of using a feature engineering preprocessor on the CPU,\r\n# followed by :class:`calibration.CalibratedClassifierCV`\r\n# and :class:`linear_model.RidgeCV` together on a GPU with the help of PyTorch:\r\n```", "severity": "minor", "line": 26 } ]
1
python
report_conflict('--id', 'useid', '--output', 'outtmpl', val2=opts.outtmpl.get('default')) report_conflict('--remux-video', 'remuxvideo', '--recode-video', 'recodevideo') report_conflict('--sponskrub', 'sponskrub', '--remove-chapters', 'remove_chapters') report_conflict('--sponskrub', 'sponskrub', '--sponsor...
Review this code and list any quality issues.
[]
0
python
from __future__ import unicode_literals from .common import InfoExtractor class ParliamentLiveUKIE(InfoExtractor): IE_NAME = 'parliamentlive.tv' IE_DESC = 'UK parliament videos' _VALID_URL = r'(?i)https?://(?:www\.)?parliamentlive\.tv/Event/Index/(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]...
Review this code and list any quality issues.
[ { "issue": "Is the space before Mozilla intentional?", "severity": "minor", "line": 26 } ]
1
python
from .apply_method import pruning_apply_methods, quant_apply_methods from .config import select_modules_by_config from .setting import INPUT_PREFIX, OUTPUT_PREFIX, canonicalize_settings from .target_space import ( TargetSpace, TargetType, PruningTargetSpace, QuantizationTargetSpace, DistillationTarg...
Review this code and list any quality issues.
[ { "issue": "it would be better to update docstring to explain the value field of `config`", "severity": "minor", "line": 26 } ]
1
python
Indeterminate for the formal power series. Defaults to ``t``. Returns ======= FormalPowerSeries The Molien series as a SymPy formal power series. Examples ======== >>> from sympy.combinatorics.named_groups import SymmetricGroup >>> S3 = SymmetricGr...
Review this code and list any quality issues.
[ { "issue": "It is more efficient to collect terms in a list and add them with `Add(*terms)`.", "severity": "major", "line": 26 } ]
1
python
xyxy=detections.xyxy, resolution_wh=self.frame_resolution_wh ) clipped_detections = replace(detections, xyxy=clipped_xyxy) all_clipped_anchors = np.array( [ np.ceil(clipped_detections.get_anchors_coordinates(anchor)).astype(int) for anchor in self.trig...
Review this code and list any quality issues.
[]
0
python
'view_count': int, 'tags': ['Alle Trailer', 'Movie', 'Verleih'], 'uploader_id': 'x6nd9k', }, }] def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(f'https://www.moviepilot.de/movies/{video_id}/trailer', video_id) ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'thumbnail': self._html_search_meta('thumbnailURL', webpage),\r\n```\r\nthat is the default!", "severity": "minor", "line": 26 } ]
1
python
return # Validation phase (step 8) skipped, i.e. # # (1) this extractor does not implement client-side ID-token validation; # (2) Rokfin does not supply Subject Identifier. self._access_mgmt_tokens = access_mgmt_tokens def _logout(self): LOGOUT_URL = 'https://secur...
Review this code and list any quality issues.
[ { "issue": "Why are you looking at ALL cookies in the jar?", "severity": "minor", "line": 26 } ]
1
python
disk_size=job.resources.disk_size, disk_tier=job.resources.disk_tier, ) sky_task = sky.Task( name=job.name, setup=job.setup, run=job.run, envs=job.envs, workdir=job.working_dir, num_nodes=job.num_nodes, ) sky_task.set_file_mounts(job.file_mounts) ...
Review this code and list any quality issues.
[]
0
python
for j in range(len(ops)): for k in range(len(ops[j])): operands.append(ops[j][k]) return all(n == operands[0] for n in operands) def dereference_ptr(insn: ghidra.program.database.code.InstructionDB): addr_code = OperandType.ADDRESS | OperandType.CODE to_deref = insn.getAddress(0) ...
Review this code and list any quality issues.
[ { "issue": "See my comment above. Can we follow a more generic approach, similar to what we see in the IDA extractor code linked above?", "severity": "major", "line": 26 } ]
1
python
**async_client_kwargs: Any, ) -> None: """A default constructor. Args: persist_cookies_per_session: Whether to persist cookies per HTTP session. additional_http_error_status_codes: Additional HTTP status codes to treat as errors. ignore_http_error_status_codes: H...
Review this code and list any quality issues.
[ { "issue": "Is there any potential drawback in sharing this context for all clients? Or are there any scenarios where different contexts for different clients would be desired?", "severity": "minor", "line": 26 } ]
1
python
Parameters: mask (np.ndarray): A binary mask represented as a 2D NumPy array of shape `(H, W)`, where H and W are the height and width of the mask, respectively. Returns: List[np.ndarray]: A list of polygons, where each polygon is represented by a NumPy array of ...
Review this code and list any quality issues.
[ { "issue": "Please update the `docstrings` for both `from_lmm` and `from_vlm` to include examples demonstrating how to use the classes argument, similar to what we did for `from_paligemma`. I also noticed that our Qwen2.5VL example is missing the `classes` argument. Let’s add it there as well.", "severity":...
1
python
stack = [{"line": 1, "column": 1, "name": "", "lines": [], "offsets": []}] new_function_list = {} result = "" while True: if data is None: return "Error: connection lost during source code receiv...
Review this code and list any quality issues.
[ { "issue": "Same question here for source code names.", "severity": "minor", "line": 26 } ]
1
python
raise_no_default("log", base) return default try: value_float = float(value) return math.log(value_float, base_float) except (ValueError, TypeError): if default is _SENTINEL: raise_no_default("log", value) return default @s...
Review this code and list any quality issues.
[ { "issue": "This change converts valid Python 3 syntax to deprecated Python 2 syntax. In Python 3, multiple exceptions must be caught using parentheses: `except (ExceptionA, ExceptionB):`. The Python 2 syntax `except ExceptionA, ExceptionB:` is not valid in Python 3 and will cause a syntax error. This line shou...
1
python
`keepdims` will be passed through to the `mean` or `sum` methods of sub-classes of `ndarray`. If the sub-classes methods does not implement `keepdims` any exceptions will be raised. where : array_like of bool, optional Elements to include in the mean. See `~numpy.ufunc.reduce` for details. ...
Review this code and list any quality issues.
[]
0
python
.. manim:: ArrangeSumobjectsExample :save_last_frame: class ArrangeSumobjectsExample(Scene): def construct(self): s= VGroup(*[Dot().shift(i*0.1*RIGHT*np.random.uniform(-1,1)+UP*np.random.uniform(-1,1)) for i in range(0,15)]) s.shift(UP).se...
Review this code and list any quality issues.
[ { "issue": "You caught one spelling mistake but not the other 😛\r\n```suggestion\r\n .. manim:: ShuffleSubmobjectsExample\r\n```", "severity": "minor", "line": 26 } ]
1
python
self.nodes[0].submitheader(block.serialize().hex()) assert_equal(self.nodes[0].getblockchaininfo()["headers"], self.nodes[0].getblockchaininfo()["blocks"] + 1) self.log.info("Invalidate block 2 on node 0 and verify we reorg to node 0's original chain") badhash = self.nodes[1].getblockhash(2) ...
Review this code and list any quality issues.
[]
0
python
# TODO: Post-process inference results # TODO: Return inference results return inference_conversations def _format_instructions( self, sample: dict, instruction_messages: Conversation, ) -> Conversation: """Format the instructions for the sample.""" new_...
Review this code and list any quality issues.
[ { "issue": "is it intentional not to deep_copy and so mutate the original conversation? if so, maybe we should document this with a comment", "severity": "minor", "line": 26 } ]
1
python
parse_duration, parse_filesize, extract_attributes, int_or_none, ) class VuploadIE(InfoExtractor): _VALID_URL = r'https://vupload\.com/v/(?P<id>[a-z0-9]+)' _TESTS = [{ 'url': 'https://vupload.com/v/u28d0pl2tphy', 'md5': '9b42a4a193cca64d80248e58527d83c8', 'info_dict': { ...
Review this code and list any quality issues.
[ { "issue": "try `transform_source=js_to_json` instead of manually replacing", "severity": "minor", "line": 26 } ]
1
python
from __future__ import unicode_literals import re from urllib.parse import ( parse_qs, urlparse, ) from .common import InfoExtractor from ..utils import ( determine_ext, ExtractorError, extract_attributes, find_xpath_attr, get_element_by_attribute, get_element_by_class, int_or_none...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\nimport urllib\r\n```", "severity": "minor", "line": 7 } ]
1
python
}, json=msg, timeout=aiohttp.ClientTimeout(total=30, sock_connect=self._conn_options.timeout), ) as resp: resp.raise_for_status() # Extract trace_id from response headers trace_id = resp.headers.get("Trace-Id") or resp.headers....
Review this code and list any quality issues.
[ { "issue": "```suggestion\n```\nremove it since it's not used", "severity": "minor", "line": 26 } ]
1
python
import json from .common import InfoExtractor from ..utils import ( int_or_none, parse_iso8601, str_or_none, traverse_obj, url_or_none, urljoin, ) class KhanAcademyBaseIE(InfoExtractor): _VALID_URL_TEMPL = r'https?://(?:www\.)?khanacademy\.org/(?P<id>(?:[^/]+/){%s}%s[^?#/&]+)' def _p...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'url': video['youtubeId'],\r\n 'id': video['youtubeId'],\r\n 'ie_key': 'Youtube',\r\n **traverse_obj(video, {\r\n 'display_id': ('id', {str_or_none}),\r\n```\r\n\r\n`id` should be same as inner extractor (youtube). It's mis...
1
python
Example: ```python >>> import supervision as sv >>> image = ... >>> detections = sv.Detections(...) >>> percentage_bar_annotator = sv.BoundingBoxAnnotator() >>> annotated_frame = percentage_bar_annotator.annotate( ... scene=image....
Review this code and list any quality issues.
[ { "issue": "please, let's move border mapping logic to separate function / method", "severity": "minor", "line": 26 } ]
1
python
lk_oai_debug = int(os.getenv("LK_OPENAI_DEBUG", 0)) OpenAIModels = Literal[ "openai/gpt-5", "openai/gpt-5-mini", "openai/gpt-5-nano", "openai/gpt-4.1", "openai/gpt-4.1-mini", "openai/gpt-4.1-nano", "openai/gpt-4o", "openai/gpt-4o-mini", ] GoogleModels = Literal[ "google/gemini-2.5...
Review this code and list any quality issues.
[ { "issue": "`gpt-oss-120b` is still support on baseten as `openai/gpt-oss-120b`\n\nhttps://docs.google.com/spreadsheets/d/1RhLAgmOhtrIRYeL1OLVrkCt73ZY8C3k0n5NNRvUolTg/edit?gid=561069390#gid=561069390", "severity": "minor", "line": 26 } ]
1
python
# Adding more bins to the mapper yields the same results (same thresholds) mapper_2 = _BinMapper(n_bins=min(256, n_distinct * 3) + 1) binned_2 = mapper_2.fit_transform(data) assert_allclose(mapper_1.bin_thresholds_[0], mapper_2.bin_thresholds_[0]) assert_array_equal(binned_1, binned_2) def test_binma...
Review this code and list any quality issues.
[ { "issue": "I think we should directly compare the `bin_thresholds_` attributes instead of transformed data. It's more explicit to debug in case of failures.", "severity": "critical", "line": 26 } ]
1
python
#!/usr/bin/env python3 # Copyright (c) 2019-2022 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Useful Script constants and utils.""" import unittest from test_framework.script import ( CScript,...
Review this code and list any quality issues.
[ { "issue": "Unrelated to this PR since it's a refactor, but if we e.g. ever need more than two same-txid-different-wtxid transactions, we could remove the OP_IF branching and use something simpler like OP_DROP OP_TRUE as witness script.", "severity": "major", "line": 26 } ]
1
python
finish_points, path_func=utils.paths.straight_path(), run_time=2, ) ) self.wait() """ if len(args) > 0: return interpolate(*args) return interpolate def path_along_circles( arc_angle: float, ci...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n The centers of each point's quasicircle to rotate around.\r\n```", "severity": "minor", "line": 26 } ]
1
python
"env_converter": int, }, "priority_limit": { "type": Optional[int], "default": None, "env_converter": int, }, "internal_api_server_include_index_list": { "type": Optional[list[int]], "default": None, "env_converter": _to_int_list, }, "internal_api_...
Review this code and list any quality issues.
[]
0
python
scene = gs.Scene( show_viewer=show_viewer, ) hand = scene.add_entity( gs.morphs.URDF( file="urdf/panda_bullet/hand.urdf", fixed=True, ), ) scene.build() assert scene.rigid_solver.n_equalities == 1 qvel = scene.rigid_solver.dofs_state.vel.to_numpy(...
Review this code and list any quality issues.
[ { "issue": "We already have a simple pendulum model, and this kind of inline URDF model is not aligned with the rest of the unit tests.", "severity": "minor", "line": 26 } ]
1
python
try: positions = trimesh_to_particles_pbs(mesh, p_size, sampler, pos=pos) except gs.GenesisException: sampler = "random" if sampler in ("random", "regular"): positions = _box_to_particles( p_size=p_size, pos=pos, size=size, sam...
Review this code and list any quality issues.
[]
0
python
def patch_config( config: "PretrainedConfig", tokenizer: "PreTrainedTokenizer", model_args: "ModelArguments", init_kwargs: Dict[str, Any], is_trainable: bool, ) -> None: if model_args.compute_dtype is None: # priority: bf16 > fp16 > fp32 if model_args.infer_dtype != "auto" and not is_tr...
Review this code and list any quality issues.
[]
0
python
magic_trailing_comma=not skip_magic_trailing_comma, experimental_string_processing=experimental_string_processing, ) if config and verbose: out(f"Using configuration from {config}.", bold=False, fg="blue") if code is not None: then = datetime.utcnow() try: format...
Review this code and list any quality issues.
[ { "issue": "Are you sure `--color` works on windows? I would've assumed `wrap_stream_for_windows` would be necessary here. \r\n\r\nExample:\r\n\r\nhttps://github.com/psf/black/blob/754eecf69eed0bdc75fe224c19a702a4f0676807/src/black/__init__.py#L698-L716", "severity": "minor", "line": 26 } ]
1
python
logger = logging.getLogger('awx.main.tasks.jobs') def with_path_cleanup(f): @functools.wraps(f) def _wrapped(self, *args, **kwargs): try: return f(self, *args, **kwargs) finally: for p in self.cleanup_paths: try: if os.path.isdir(p): ...
Review this code and list any quality issues.
[ { "issue": "`kwargs = uj.get_start_kwargs() or {}`\r\n\r\nThen you can delete the if condition below.", "severity": "minor", "line": 26 } ]
1
python
'md5': 'ba2fdbc1242fc16771c7695d271ec355', 'info_dict': { 'id': '8891337', 'ext': 'mp3', 'title': 'Máte po celé sezóně poslouchání Čelistí právo na wellness, nebo můžete být rádi, že jste vůbec naživu? Poslechněte si filmově kritickou bilanci všeho, co v uplynulých měsících s...
Review this code and list any quality issues.
[ { "issue": "use regex if get_element_text_and_html_by_tag doesnt work", "severity": "minor", "line": 26 } ]
1
python
def test_truc_acceptance(self): node = self.nodes[0] self.log.info("Test a child of a TRUC transaction cannot be more than 1000vB") tx_v3_parent_normal = self.wallet.send_self_transfer(from_node=node, version=3) self.check_mempool([tx_v3_parent_normal["txid"]]) tx_v3_child_heavy ...
Review this code and list any quality issues.
[ { "issue": "a few more 1000s not changed:\r\n\r\nL104 `assert_greater_than_or_equal(tx_v3_child_almost_heavy[\"tx\"].get_vsize() + tx_v3_child_almost_heavy_rbf[\"tx\"].get_vsize(), 1000)`\r\n\r\nL194 `assert_greater_than(node.getmempoolentry(tx_v3_child_large[\"txid\"])[\"vsize\"], 1000)`", "severity": "min...
1
python
def test_empty_queryset(self): self.assertEqual( Page.get_first_root_node(), Page.objects.none().first_common_ancestor() ) def test_empty_queryset_strict(self): with self.assertRaises(Page.DoesNotExist): Page.objects.none().first_common_ancestor(strict=True) def...
Review this code and list any quality issues.
[ { "issue": "This test file is for page queryset specifically. We don't have one for Task models, but the closest is probably this:\r\n\r\nhttps://github.com/wagtail/wagtail/blob/dbeafb7b115bfab446407bba63c34eb853cc60e1/wagtail/tests/test_workflow.py#L28\r\n\r\nCould we move this test method to that existing tes...
1
python
# Shift labels to predict the next token, and remove the tail logit predicting <EOS> sp_size > 1 and (not is_share_sp_tp(sp_mode)) # TODO:support sp labels = labels[..., 1:] logits = logits[..., :-1, :] labels = labels.contiguous() logits = logits.contiguous() assert labels.shape == logits....
Review this code and list any quality issues.
[ { "issue": "non-dist version is not correct, you should also gather from labels.\r\n\r\nPlease check the original implementation as well.", "severity": "minor", "line": 26 } ]
1
python
_TESTS = [{ 'url': 'https://web.arbeitsagentur.de/berufetv/studienberufe/wirtschaftswissenschaften/wirtschaftswissenschaften-volkswirtschaft/film;filmId=DvKC3DUpMKvUZ_6fEnfg3u', 'md5': '041b6432ec8e6838f84a5c30f31cc795', 'info_dict': { 'id': 'DvKC3DUpMKvUZ_6fEnfg3u', 'ext...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n meta = traverse_obj(\r\n movie_metadata, ('metadaten', lambda _, i: video_id == i['miId']),\r\n get_all=False, default={})\r\n```", "severity": "minor", "line": 26 } ]
1
python
link_a = torch.tensor([cube1.base_link.idx], dtype=gs.tc_int, device=gs.device) link_b = torch.tensor([cube2.base_link.idx], dtype=gs.tc_int, device=gs.device) rigid.add_weld_constraint(link_a, link_b) scene.step() welds = rigid.get_weld_constraints(as_tensor=True, to_torch=False) env_id = 0 if "e...
Review this code and list any quality issues.
[ { "issue": "Just do `assert_allclose(cube1.get_vel(), cube2.get_vel(), tol=1e-7)`", "severity": "minor", "line": 26 } ]
1
python
class PercentileFilter(SingleInputMixin, Filter): """ A Filter representing assets falling between percentile bounds of a Factor. Parameters ---------- factor : zipline.pipeline.factor.Factor The factor over which to compute percentile bounds. min_percentile : float [0.0, 1.0] T...
Review this code and list any quality issues.
[]
0
python
# a shorter arrow has a shorter tip and smaller stroke width arrow_5 = Arrow(start=ORIGIN, end=config.top).shift(LEFT * 4) arrow_6 = Arrow(start=config.top + DOWN, end=config.top).shift(LEFT * 3) g3 = Group(arrow_5, arrow_6) self.add(Group(g1, g2, g3).arr...
Review this code and list any quality issues.
[ { "issue": "Same as the previous comment.\r\n```suggestion\r\n middle_group = VGroup()\r\n```", "severity": "minor", "line": 26 } ]
1
python
transcript = transcript_list.find_transcript(['de', 'en']) # or just filter for manually created transcripts transcript = transcript_list.find_manually_created_transcript(['de', 'en']) # or automatically generated ones transcript = transcript_list.find_generated_transcr...
Review this code and list any quality issues.
[ { "issue": "`preserve_formatting` should also be added to `get_transcripts`", "severity": "minor", "line": 26 } ]
1
python
return (prev_sample,) return SchedulerOutput(prev_sample=prev_sample) def scale_model_input(self, sample: torch.Tensor, *args, **kwargs) -> torch.Tensor: """ Ensures interchangeability with schedulers that need to scale the denoising model input depending on the current timestep. ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n Compute the previous sample x_(t-δ) from the current sample x_t using formula (9) from the [PNDM paper](https://huggingface.co/papers/2202.09778).\n\n```", "severity": "minor", "line": 26 } ]
1
python
def _extract_ondemand(self, ondemand_id): ondemand_termtoken, ondemand_type, info_dict = self._extract_ondemand_info(ondemand_id) formats = self._extract_formats( None, ondemand_id, ondemand_id=ondemand_id, ondemand_termtoken=ondemand_termtoken, ondemand_type=ondemand...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n return self._extract_video(self._match_id(url))\r\n```", "severity": "major", "line": 26 } ]
1
python
helper = importlib.import_module(f"homeassistant.helpers.{helper_name}") wrapped = ModuleWrapper(self._hass, helper) setattr(self, helper_name, wrapped) return wrapped def bind_hass(func: _CallableT) -> _CallableT: """Decorate function to indicate that first argument is hass. The use ...
Review this code and list any quality issues.
[ { "issue": "`helper` is not a good name.\r\n\r\nMaybe call it `component_dependencies_impl` since this is the actual implementation and `_async_component_dependencies` is just a wrapper?", "severity": "major", "line": 26 } ]
1
python
def wait_for_no_elements(self, selector, timeout=None): """Explicit wait until an element is NOT found. timeout defaults to the fixture's `wait_timeout`.""" until( # if we use get_elements it waits a long time to see if they appear # so this one calls out directly to exec...
Review this code and list any quality issues.
[]
0