language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
-------- .. manim:: FillByValueExample :save_last_frame: class FillByValueExample(ThreeDScene): def construct(self): resolution_fa = 42 self.set_camera_orientation(phi=75 * DEGREES, theta=-120 * DEGREES) axes = ...
Review this code and list any quality issues.
[ { "issue": "I would suggest the 'axis' parameter to simply take in the numbers 0, 1, 2 rather than a string. This is more inline with other methods such as `.stretch` as well as removes the indices variable while the ranges could just be a list.", "severity": "minor", "line": 26 } ]
1
python
region = data.get('region') if city: geoInfo += city + ", " if region: geoInfo += region + ", " if country: geoInfo += country + " " if zipcode: geoInfo += zipcode + ". " evt = SpiderFootEvent("...
Review this code and list any quality issues.
[ { "issue": "Please remove paces after `[` and before `]`.", "severity": "minor", "line": 26 } ]
1
python
ANSIBLE_PARAMIKO_RECORD_HOST_KEYS = False # Force ansible in color even if we don't have a TTY so we can properly colorize # output ANSIBLE_FORCE_COLOR = True # If tmp generated inventory parsing fails (error state), fail playbook fast ANSIBLE_INVENTORY_UNPARSED_FAILED = True # Additional environment variables to be...
Review this code and list any quality issues.
[]
0
python
vector : np.ndarray, list, tuple The vector to show. integer_label : bool, optional Whether or not to round the value displayed. in the vector's label to the nearest integer clean_up : bool, optional Whether or not to remove whatever this met...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n x_coord, y_coord = array.get_entries()\r\n```\r\nI think it would be better like this as it might be easier to understand. It does more or less the same thing you suggested.", "severity": "minor", "line": 26 } ]
1
python
image_required=True, rebuild_image=True, *, secret=None, force=False, ): mock(name=name, rebuild_image=rebuild_image) return ( HubExecutor( uuid='hello', name=name, tag='v0', image_name=f'jin...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n assert image_name in {'jinahub/DummyExecutor', 'jinahub/jina-ai/DummyExecutor'}\r\n```", "severity": "minor", "line": 26 } ]
1
python
from .common import InfoExtractor from ..utils import extract_attributes class NTSLiveIE(InfoExtractor): IE_NAME = 'nts.live' _VALID_URL = r'https?://(?:www\.)?nts\.live/shows/[^/]+/episodes/(?P<id>[^./?#]+)' _TESTS = [ { # embedded soundcloud 'url': 'https://www.nts.live/s...
Review this code and list any quality issues.
[ { "issue": "Updated imports\r\n```suggestion\r\nfrom .common import InfoExtractor\r\nfrom ..utils import parse_iso8601, url_or_none\r\nfrom ..utils.traversal import traverse_obj\r\n```", "severity": "major", "line": 2 } ]
1
python
f"{'Listing all agents in' if not query else 'Searching'} " f"user library{'' if not query else f' for: {query}'}" ) results = await library_db().list_library_agents( user_id=user_id, # type: ignore[arg-type] search_term=search...
Review this code and list any quality issues.
[]
0
python
from ..common._check_dependencies import _check_dependency_is_installed if util.find_spec("boto3"): import boto3 from taipy.common.config.common.scope import Scope from .._version._version_manager_factory import _VersionManagerFactory from ..exceptions.exceptions import MissingRequiredProperty from .data_node im...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n - *aws_s3_bucket_name* (`str`): The Amazon Web Services (AWS) S3 bucket to read\r\n from and to write the data to.\r\n - *aws_s3_object_key* (`str`): The Amazon Web Services (AWS) S3 object key to read\r\n or write.\r\n\r\n```", "severity": "minor", "lin...
1
python
}) var dash_path = '/dash?' + enc_params.join('&'); dash_path += '&vf=' + cmd5x(dash_path); dash_paths[bid] = dash_path; }); return JSON.stringify(dash_paths); })); saveAndExit(); ''' def _extract_vms_player_js(self, webpage, video_id): ...
Review this code and list any quality issues.
[ { "issue": "Let's keep the original var name the same, and name the new var `replacement_map` for clarity\r\n\r\nWe can't rely on the JS var always being named `e` in the replacement map `end_pattern`, so let's change that to `\\w+` and make the pattern a bit more specific elsewhere\r\n\r\nI also think we shoul...
1
python
from __future__ import annotations from typing import Protocol from crawlee._utils.docs import docs_group @docs_group('Functions') class BlockRequestsFunction(Protocol): """A function for blocking unwanted HTTP requests during page loads in PlaywrightCrawler. It simplifies the process of blocking specific ...
Review this code and list any quality issues.
[ { "issue": "Oh, this is risky as it could become easily outdated if we update the value of `_DEFAULT_BLOCK_REQUEST_URL_PATTERNS`. I would prefer not to mention it here, or alternatively, we could consider inlining the variable's value directly into the docstring, if it is possible.", "severity": "minor", ...
1
python
}, 'params': { 'format': 'bv', 'skip_download': True, }, }] def _real_extract(self, url): video_type, display_id, video_id = self._match_valid_url(url).groups() if 'show' in video_type: video_type = 'episode' data_json = self._downlo...
Review this code and list any quality issues.
[ { "issue": "By the way, can this be inline? If the values don't exist, we'll get None by default", "severity": "minor", "line": 26 } ]
1
python
'uploader': 'ManyakisArt', 'duration': 5, 'age_limit': 18, } } def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) video_url = self._search_regex( r'href="(https?://xhamster\.com/(?:mo...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n _VALID_URL = rf'https?://(?:[^/?#]+\\.)?{XHamsterIE._DOMAINS}/(?:(?P<user>users)|creators)/(?P<id>[^/?#&]+)'\r\n```\r\nwouldn't hurt to fix this up in the other `_VALID_URL`s as well, imo", "severity": "minor", "line": 26 } ]
1
python
snapshot test and loaded from during restore test. """ return cpu_template if cpu_template else "none" @pytest.mark.skipif( PLATFORM != "aarch64", reason="This is aarch64 specific test.", ) def test_host_vs_guest_cpu_features_aarch64(uvm_nano): """Check CPU features host vs guest""" vm = uvm...
Review this code and list any quality issues.
[ { "issue": "So for the feature to disappear, both host and guest kernel need the commit?", "severity": "minor", "line": 26 } ]
1
python
from __future__ import annotations """ Unit tests for the external dataset controller payload schemas. These tests focus on Pydantic validation rules so we can catch regressions in request constraints (e.g. max length changes) without exercising the full Flask/RESTX request stack. """ import pytest from pydantic imp...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n payload = {\n```\n\nit's just dict[str, str]", "severity": "minor", "line": 22 } ]
1
python
UNIFORM_VEC2 = rl.ShaderUniformDataType.SHADER_UNIFORM_VEC2 UNIFORM_VEC4 = rl.ShaderUniformDataType.SHADER_UNIFORM_VEC4 class ShaderState: _instance: Any = None @classmethod def get_instance(cls): if cls._instance is None: cls._instance = cls() return cls._instance def __init__(self): if S...
Review this code and list any quality issues.
[]
0
python
elif gap is None: return GapSize.NONE raise StreamlitInvalidColumnGapError(gap=gap, element_type=element_type) def validate_horizontal_alignment(horizontal_alignment: HorizontalAlignment) -> None: valid_horizontal_alignments = ["left", "center", "right", "distribute"] if horizontal_alignment not ...
Review this code and list any quality issues.
[ { "issue": "The docstring parameter type should match the type annotation. The function signature uses `text_alignment: TextAlignment`, but the docstring states `text_alignment : Any`. Update the docstring to reflect the actual type:\n\n```python\ntext_alignment : TextAlignment\n The text alignment value to ...
1
python
pos : tuple of float, shape (3,) The position of the camera in the scene, specified as (x, y, z). lookat : tuple of float, shape (3,) The point in the scene that the camera is looking at, specified as (x, y, z). up : tuple of float, shape (3,) The up vector of the cam...
Review this code and list any quality issues.
[ { "issue": "Do not skip line unless it would exceed 120 linewidth otherwise.", "severity": "minor", "line": 26 } ]
1
python
pyd_allow_partial = 'trailing-strings' if allow_partial else 'off' validator = tool.args_validator if isinstance(call.args, str): args_dict = validator.validate_json( call.args or '{}', allow_partial=pyd_allow_partial, context=ctx.validation_context ...
Review this code and list any quality issues.
[ { "issue": "What do you think of implementing this on `FunctionToolset.call_tool` instead? Then I believe `ToolManager` should be able to stay untouched, as the default timeout can be passed by the agent into the `FunctionToolset`/`Tool` instances as is done with `max_retries`.\r\n\r\nThe downside is that this ...
1
python
import json import logging import sqlite3 import time import uuid from typing import Any, Dict, List, Optional from embedchain.constants import SQLITE_PATH from embedchain.memory.message import ECBaseChatMessage from embedchain.memory.utils import merge_metadata_dict """ app_id: saves the app_id of the embedchain app...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n CREATE TABLE IF NOT EXISTS chat_history (\r\n```\r\n\r\nTo be consistent with other codebase.", "severity": "minor", "line": 21 } ]
1
python
start = start_date.asm8 end = end_date.asm8 sid_selector, out_buf_indexer = self._make_sid_indexers(assets) date_slice = self._compute_date_range_slice(start, end) n_dates = date_slice.stop - date_slice.start n_query_sids = len(assets) n_valid_sids = len(self.sids) ...
Review this code and list any quality issues.
[ { "issue": "Not changed here, but reading this again I think this might just be `np.s_[:, date_slice]`?", "severity": "minor", "line": 26 } ]
1
python
import pytest from manim import * from ..utils.GraphicalUnitTester import GraphicalUnitTester from ..utils.testing_utils import get_scenes_to_test class BraceSharpnessTest(Scene): def construct(self): line = Line(LEFT * 3, RIGHT * 3).shift(UP * 4) for sharpness in [0, 0.25, 0.5, 0.75, 1, 2, 3, ...
Review this code and list any quality issues.
[]
0
python
@lru_cache() def find_user_pyproject_toml() -> Path: r"""Return the path to the top-level user configuration for black. This looks for ~\.black on Windows and ~/.config/black on Linux and other Unix systems. May raise: - RuntimeError: if the current user has no homedir - PermissionError: if th...
Review this code and list any quality issues.
[]
0
python
import re def extract_diff(response): """ Extracts the diff from a response formatted in different ways """ if response is None: return None diff_matches = [] other_matches = [] pattern = re.compile(r"\<([\w-]+)\>(.*?)\<\/\1\>", re.DOTALL) for code, match in pattern.findall(res...
Review this code and list any quality issues.
[]
0
python
f = ( Flow( tracing=False, metrics=True, metrics_exporter_host='localhost', metrics_exporter_port=4317, port=12345, ) .add(name='name1') .add(name='name2', needs=['gateway']) .add(name='name3', needs=['name1', 'name2'], ...
Review this code and list any quality issues.
[ { "issue": "can u do these assertions outside the context manager? I believe, if there is an error and ctxt manager is left, it may not be called", "severity": "minor", "line": 26 } ]
1
python
arr = np.arange(10).reshape(2, 5) out = np.compress([0, 1], arr, axis=0) assert_equal(out, tgt) tgt = [[1, 3], [6, 8]] out = np.compress([0, 1, 0, 1, 0], arr, axis=1) assert_equal(out, tgt) def test_truncate(self): tgt = [[1], [6]] arr = np.arange(10).reshap...
Review this code and list any quality issues.
[]
0
python
"""III SDK client initialization for Motia framework.""" import os from pathlib import Path from typing import Any try: import tomllib except ImportError: try: import tomli as tomllib # type: ignore[no-redef] except ImportError: tomllib = None # type: ignore[assignment] from iii import ...
Review this code and list any quality issues.
[ { "issue": "Include this lib at the pyproject; otherwise, we will always get a None from the _read_project_name", "severity": "minor", "line": 8 } ]
1
python
from .config import ( Any, Bool, ConfigType, ConfigTypeAttributes, Int, Path, #  String, #  resolve_to_config_type, #  DEFAULT_TYPE_ATTRIBUTES, ) from .config import ( Any, Bool, ConfigType, ConfigTypeAttributes, Int, no_comma_here_yet #  and some commen...
Review this code and list any quality issues.
[ { "issue": "Could you remove some extraneous code here? I think most of the imports on this line can go for example, and most of the cases in `class C` below aren't really relevant either. I'd want this test file to have only comments with nbsps and elements that are directly related (e.g., to test behavior aro...
1
python
""" Test that Gemini 2.5 Pro models have function calling enabled by default. This includes testing various model name formats with different prefixes. """ # Mock the model info response mock_get_model_info.return_value = { 'max_input_tokens': 8000, 'max_output_tokens': 2000, } ...
Review this code and list any quality issues.
[]
0
python
) key = 'traversed-executors' for doc in docs: if key not in doc.tags: doc.tags[key] = [] traversed = list(doc.tags.get(key)) traversed.append(self._name) doc.tags[key] = traversed doc.tags['parallel'] = self.runtime_args.repli...
Review this code and list any quality issues.
[]
0
python
# one of: 'tiny', 'low', etc.; see _get_quality for full list formats.append({ 'url': url, 'ext': 'mp4', 'format_id': _type, }) for format in formats: # .../type/<d>/... or ...&type=<d>&... format...
Review this code and list any quality issues.
[ { "issue": "This can be simplified. I also prefer explicitly naming all hls/dash formats instead of checking if the string contains either.\r\n```suggestion\r\n def _extract_formats(self, player_urls, video_id):\r\n formats = []\r\n mp4_types = ('tiny', 'lowest', 'low', 'medium', 'high', 'full_...
1
python
"messages": [ { "role": "user", "content": [ { "type": "image_url", "image_url": {"url": "http://example.com/image.png"}, }, ...
Review this code and list any quality issues.
[ { "issue": "nit: Let's only keep necessary comments and remove this.", "severity": "major", "line": 26 } ]
1
python
) -> dict[str, CredentialsMetaInput]: """ Extract credential requirements as a dict keyed by field name. Args: credentials_input_schema: The credentials_input_schema from a Graph object Returns: Dict mapping field name to CredentialsMetaInput """ credentials: dict[str, Credenti...
Review this code and list any quality issues.
[]
0
python
'title': 'Episode 4', 'episode': 'Episode 4', 'description': '', 'series': 'Wild Water', 'season': 'Season 1', 'season_number': 1, 'episode_number': 4, 'thumbnail': str, 'duration': 1653, ...
Review this code and list any quality issues.
[ { "issue": "use regex for `thumbnail`.\r\n\r\n`str` is only acceptable where the value is expected to be completely different every time the test is run, e.g. livestreams", "severity": "minor", "line": 26 } ]
1
python
markevery=slice(2, None, 3), capsize=4, c='C0', fmt='o') ax_ref.plot(x[2::3], y[2::3] + 0.2, 'o', c='C0', zorder=2.1) ax_ref.errorbar(x[2::3], y[2::3] + 0.2, yerr[2::3], capsize=4, c='C0', fmt='none') # Check that passing an iterable to markevery/errorevery works. ...
Review this code and list any quality issues.
[ { "issue": "'-' is the default linestyle. The test is thus not very strong. It would pass if `elinestyle` is just ignored. Use another linestyle such as '--' for the test.", "severity": "minor", "line": 26 } ]
1
python
result = pytester.runpytest( str(p1), "--pdbcls=really.invalid:Value", syspathinsert=True ) result.stdout.fnmatch_lines( [ "*= FAILURES =*", "E * --pdbcls: could not import 'really.invalid:Value': No module named *really*", ] ) assert result.ret == 1 ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n@pytest.mark.xfail(sys.version_info >= (3, 14), reason=\"see https://github.com/python/cpython/issues/124703\")\r\n```", "severity": "critical", "line": 26 } ]
1
python
video_id = self._match_id(url) # it could be anything that is a valid JS function name callback = random.choice(( 'jebac_pis', 'jebacpis', 'ziobro', 'sasin70', 'sasin_przejebal_70_milionow_PLN', 'tvp_is_a_state_propaganda_service',...
Review this code and list any quality issues.
[ { "issue": "Maybe more defensive, and expect a reported error?\r\n```py\r\n error = self._parse_json(datastr[5:], video_id, fatal=False)\r\n # or use traverse_obj() ...\r\n error_desc = try_get(error, lambda x: x[0]['desc'], str)\r\n\r\n if error_desc == 'Obiekt wymag...
1
python
A custom page for external application that can be added to Taipy GUI""" def __init__( self, resource_handler: ResourceHandler, binding_variables: t.Optional[t.List[str]] = None, metadata: t.Optional[t.Dict[str, t.Any]] = None, **kwargs, ) -> None: if binding_var...
Review this code and list any quality issues.
[]
0
python
setup( name="black", use_scm_version={ "write_to": "_version.py", "write_to_template": 'version = "{version}"\n', }, description="The uncompromising code formatter.", long_description=get_long_description(), long_description_content_type="text/markdown", keywords="automation ...
Review this code and list any quality issues.
[ { "issue": "I think the idea is that end-user, non-dev dependencies should not be pinned and should be as loose as possible. Does it work like this?\r\n\r\n```suggestion\r\n \"regex\",\r\n```", "severity": "minor", "line": 26 } ]
1
python
parser.add_argument("--no-deepspeed", dest="deepspeed", action="store_false") parser.add_argument("--wandb-entity", type=str, default="open-assistant") parser.add_argument("--rng_seed", type=int, help="rng seed") parser.set_defaults(deepspeed=False) if notebook: args, remaining = parser.parse_k...
Review this code and list any quality issues.
[ { "issue": "I don't think this logic is correct, but I can correct it after merge in the improve_small_rm branch..", "severity": "minor", "line": 26 } ]
1
python
with patch.object( table, "make_sqla_column_compatible", side_effect=mock_make_compatible ): # Call the method result_select_exprs, result_groupby_columns = ( table._apply_series_others_grouping( select_exprs, groupby_all_columns, g...
Review this code and list any quality issues.
[]
0
python
manifest = call_playback_api('manifest', {'preferredCdn': 'akamai'}) video_id = try_get(manifest, lambda x: x['id'], str) or video_id if manifest.get('playability') == 'nonPlayable': self._raise_error(manifest['nonPlayable']) playable = manifest['playable'] formats = [] ...
Review this code and list any quality issues.
[ { "issue": "IMO it would make more sense to do this stuff in the `_extract_nrk_formats` method (where we are already performing some URL surgery), and it could be simplified too\r\n\r\n```diff\r\n def _extract_nrk_formats(self, asset_url, video_id):\r\n+ asset_url = update_url_query(asset_url, {\r\n+...
1
python
class MCPTools(Toolkit): """ A toolkit for integrating Model Context Protocol (MCP) servers with Agno agents. This allows agents to access tools, resources, and prompts exposed by MCP servers. Can be used in three ways: 1. Direct initialization with a ClientSession 2. As an async context manage...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n tool_name_prefix: Optional[str] = \"\",\n```", "severity": "minor", "line": 26 } ]
1
python
), ) def _typecheck_input(self, mobject: Mobject | None) -> None: if mobject is None: logger.debug("Animation with empty mobject") elif not isinstance(mobject, (Mobject, OpenGLMobject)): raise TypeError("Animation only works on Mobjects") def __str__(self) -...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if self.run_time <= 0:\r\n```", "severity": "minor", "line": 26 } ]
1
python
pc = np.vstack((world_x, world_y, world_z)).T point_cloud_h = np.hstack((pc, np.ones((pc.shape[0], 1)))) if world: point_cloud_world = (pose @ point_cloud_h.T).T point_cloud_world = point_cloud_world[:, :3].reshape(depth.shape[0], depth.shape[1], ...
Review this code and list any quality issues.
[ { "issue": "Are self.near and self.far defined?", "severity": "minor", "line": 26 } ]
1
python
from typing import Any, Optional from embedchain.config.base_config import BaseConfig from embedchain.helpers.json_serializable import register_deserializable @register_deserializable class Mem0Config(BaseConfig): def __init__(self, api_key: str, top_k: Optional[int] = 10): self.api_key = api_key ...
Review this code and list any quality issues.
[]
0
python
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Desc : zhipuai LLM from https://open.bigmodel.cn/dev/api#sdk from enum import Enum import json from tenacity import ( after_log, retry, retry_if_exception_type, stop_after_attempt, wait_fixed, ) from requests import ConnectionError import zhipuai ...
Review this code and list any quality issues.
[ { "issue": "Module `metagpt.utils.ahttp_client` not found.", "severity": "minor", "line": 23 } ]
1
python
return documents_and_batch_fields, 200 @service_api_ns.route( "/datasets/<uuid:dataset_id>/documents/<uuid:document_id>/update_by_text", "/datasets/<uuid:dataset_id>/documents/<uuid:document_id>/update-by-text", ) class DocumentUpdateByTextApi(DatasetApiResource): """Resource for update documents.""" ...
Review this code and list any quality issues.
[ { "issue": "The raw payload is being used without Pydantic validation. Unlike the second file which uses `Parser.model_validate(api.payload)`, this implementation bypasses the validation that the Pydantic model should provide. This can lead to runtime errors and inconsistent behavior. Consider validating the pa...
1
python
return _DataManagerFactory._build_manager()._delete(DataNodeId(entity_id)) if _is_submission(entity_id): return _SubmissionManagerFactory._build_manager()._hard_delete(SubmissionId(entity_id)) raise ModelNotFound("NOT_DETERMINED", entity_id) def get_scenarios( cycle: Optional[Cycle] = None, ta...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n is_sorted (bool): The option to sort scenarios. The default sorting key is name.\r\n descending (bool): The option to sort scenarios on the sorting key in descending order.\r\n sort_key (Literal[\"name\", \"id\", \"creation_date\", \"tags\"]): The optiononal...
1
python
from types import SimpleNamespace import logging import jq logger = logging.getLogger(__name__) def build_indirect_host_data(job, event_query: dict): results = [] compiled_jq_expressions = {} # Cache for compiled jq expressions facts_missing_logged = False for event in job.job_events.filter(task__i...
Review this code and list any quality issues.
[ { "issue": "do we need to set the other fields (inventory, host, events etc.) here too?", "severity": "minor", "line": 26 } ]
1
python
api_base=api_base, api_version=api_version, model=model, api_key=api_key, model_type=model_type, **kwargs) self._token_usage_lock = threading.Lock() self.prompt_tokens = 0 self.completion_tokens = 0 def log_usage(self, response): """Log the total tokens from the OpenAI API response....
Review this code and list any quality issues.
[ { "issue": "This class name is unintuitive given that this is not for running OpenAI model (e.g., GPT family). Could you change a name?", "severity": "minor", "line": 26 } ]
1
python
import multiprocessing import subprocess import sys import pytest from .test_public_api import PUBLIC_MODULES # Regression tests for gh-6793. # Check that all modules are importable in a new Python process. # This is not necessarily true if there are import cycles present. def _check_single_module(module): pid...
Review this code and list any quality issues.
[ { "issue": "Sorry to bug you about this again, but I was thinking about this on a hike, and I realized that one of the reasons we get so little information about the Windows ARM failure is that the failure happens inside a process where faulthandler is not enabled. The test is not really intended to find segfau...
1
python
"rms_norm_eps": 1e-06, "rope_theta": 1000000.0, "sliding_window": 32768, "tie_word_embeddings": False, "torch_dtype": "bfloat16", "transformers_version": "4.39.0.dev0", "use_cache": True, "use_sliding_window": False, "vocab_size": 151936, "decoder_...
Review this code and list any quality issues.
[]
0
python
# Pre-migration verification check_comments() # Migrate _, wallet = self.migrate_and_get_rpc("persist_comments") # Post-migration verification check_comments() wallet.unloadwallet() def test_migrate_simple_watch_only(self): self.log.info("Test migrating a wa...
Review this code and list any quality issues.
[ { "issue": "In e7fec273593d825e0e7dbec46a026aacc58c479f \"test: Migration fail recovery w/ `../` in path\"\r\n\r\nI think `failed_watchonly` is the wrong wallet name. Probably best to do `f\"{wallet_name}_watchonly\"`", "severity": "critical", "line": 26 } ]
1
python
Attribute-Based Access Control: The attributes returned by the auth provider are used to determine which resources the user can access. Resources can specify required attributes using the access_attributes field. For a user to access a resource: 1. All attribute categories specified in the resource mus...
Review this code and list any quality issues.
[ { "issue": "From Claude:\n\n The endswith() check is trivially bypassable:\n\n - /admin/delete-users/health → allowed ✓\n - /api/secrets/version → allowed ✓\n - /dangerous-operation/health → allowed ✓\n\n Any attacker can append /health or /version to bypass authentication entirely.\n\n Fix: Use exact pat...
1
python
def test_set_min_leverage(self): def handle_data(algo, data): algo.order_target_percent(algo.sid(self.sidint), .5) algo.record(latest_time=algo.get_datetime()) # Set min leverage to 1. # The algorithm will succeed because it doesn't run for more # than 10 days. ...
Review this code and list any quality issues.
[ { "issue": "This is nicely clear to follow as a reader :+1: .", "severity": "minor", "line": 26 } ]
1
python
content_type = asset.get('type') if content_type and content_type != 'video': self.report_warning(f'Unknown content type: {content_type}' + bug_reports_message(), video_id) formats, subtitles = self._extract_m3u8_formats_and_subtitles(asset['streamingUrl'], video_id) audio_streamin...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'thumbnails': [{'url': thumbnail_url} for thumbnail_url in asset.get('thumbnails') or []],\r\n```", "severity": "minor", "line": 26 } ]
1
python
row_heights: Optional[Iterable[Optional[float]]] = None, col_widths: Optional[Iterable[Optional[float]]] = None, flow_order: str = "rd", **kwargs, ) -> "Mobject": """Arrange submobjects in a grid. Parameters ---------- rows The number of rows in t...
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 \r\n ``None``, the corresponding row will fit its height automatically based\r\n```", "severity": "minor", "line": 26 } ]
1
python
TEST_CASES = [ [{"spatial_dims": 2, "network_type": "squeeze"}, (2, 1, 64, 64), (2, 1, 64, 64)], [ {"spatial_dims": 3, "network_type": "squeeze", "is_fake_3d": True, "fake_3d_ratio": 0.1}, (2, 1, 64, 64, 64), (2, 1, 64, 64, 64), ], [{"spatial_dims": 2, "network_type": "radimagene...
Review this code and list any quality issues.
[ { "issue": "Could you please review all the instances where \"channelwise\" is used? It appears there may be a misnaming issue, even with the wrong name, it doesn't affect the passing of the CI tests.", "severity": "critical", "line": 26 } ]
1
python
import os, platform, json, psutil, subprocess, re from typing import Any class VRAMDetector: def __init__(self): self.system = platform.system().lower() @staticmethod def _fmt(b:int)->float: if not b: return 0.0 return float(f"{b/(1024**3):.2f}") def detect_vram(self, device:s...
Review this code and list any quality issues.
[ { "issue": "The comment has trailing whitespace that should be removed for consistency.\n```suggestion\n # ───────────────────────────── Jetson (Unified Memory)\n```", "severity": "major", "line": 17 } ]
1
python
def _entries(self, data): base_url = 'https://nebula.tv' for episode in traverse_obj(data, ('episodes')): episode_id = traverse_obj(episode, ('video', 'id')) metadata = self._extract_video_metadata(episode) yield self.url_result(smuggle_url(f'{base_url}/videos/{episod...
Review this code and list any quality issues.
[ { "issue": "- line too long\r\n- `series`\r\n- use `traverse_obj`\r\n- there are `title` and `description` fields in the API response, why not just use those?\r\n```suggestion\r\n return self.playlist_result(\r\n self._entries(data), playlist_id,\r\n **traverse_obj(data, {\r\n ...
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
def test_style_rule(self): selector = ".multi-elems" elements = pydom[selector] for el in elements: assert el.style["background-color"] != "red" elements.style["background-color"] = "red" for i, el in enumerate(pydom[selector]): assert elements[i].style[...
Review this code and list any quality issues.
[]
0
python
}, { "relative_package_path": "dcc/{}-shared.js".format(_this_module), "external_url": ( "https://unpkg.com/dash-core-components@{}" "/dash_core_components/dash_core_components-shared.js" ).format(__version__), "namespace": "dash", ...
Review this code and list any quality issues.
[ { "issue": "Can we also delete the following two entries, `async-plotlyjs.js` and its `.map`? And I guess we can remove the `prebuild:js` command in dcc's `package.json` that creates the `plotly.min.js` file referenced here, right?", "severity": "minor", "line": 26 } ]
1
python
f"Client for request {request_id} disconnected, " "cancelling request." ) await send_http_response(msg, 499, send) raise asyncio.CancelledError else: request_task.cancel() status_code_callback("40...
Review this code and list any quality issues.
[ { "issue": "should we put a `if self._user_callable_initialized:` in this if section? that way if replica's user code is not initialized, we won't wait for the min draining period.", "severity": "minor", "line": 26 } ]
1
python
y_type = type_of_target(y_true) if y_type not in ("binary", "multilabel-indicator"): raise ValueError("{0} format is not supported".format(y_type)) if y_type == "binary": return binary_metric(y_true, y_score, sample_weight=sample_weight) check_consistent_length(y_true, y_score, sample_weig...
Review this code and list any quality issues.
[ { "issue": "Maybe we could add a comment about why we are doing this?", "severity": "minor", "line": 26 } ]
1
python
bin_max = np.ceil(token_t_last) + 1 plt.figure() plt.hist(token_t, np.arange(0, bin_max)) plt.xlim(0, bin_max + 1) plt.xlabel("Time [s]") plt.ylabel("Num. tokens generated per second") plt.savefig("gen_rate.png", dpi=240) if __name__ == "__main__": parser = argparse.ArgumentParser( ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n parser.add_argument(\"--seed_offset\", type=int, default=0, help=\"Offset for determining the seeds for pseudorandom prompt/generation lengths. \"\r\n```", "severity": "minor", "line": 26 } ]
1
python
'format': 'bv', 'skip_download': True, }, }] def _real_extract(self, url): video_type, display_id, video_id = self._match_valid_url(url).groups() if 'show' in video_type: video_type = 'episode' API_URL = f'https://api.mxplay.com/v1/web/detail/video?type...
Review this code and list any quality issues.
[ { "issue": "Use traverse_obj\r\n\r\n```python\r\nseries = traverse_obj(data_json, ('container', 'container', 'title'))\r\nseason = traverse_obj(data_json, ('container', 'title'))\r\n```", "severity": "minor", "line": 26 } ]
1
python
batch = self.format_batch(batch) loader_time = time.time() - loader_start_time self.keep_avg_eval.update_values({"avg_loader_time": loader_time}) outputs, _ = self.eval_step(batch, cur_step) # plot epoch stats, artifacts and figures if self.args.rank == 0: ...
Review this code and list any quality issues.
[ { "issue": "IMO we don't need to pass `use_cuda` but use the model's device instead", "severity": "minor", "line": 26 } ]
1
python
pytester.makepyfile( """ from mock import patch from pytest import mark @patch('os.getcwd') @patch('os.path') @mark.slow class TestSimple(object): def test_simple_thing(self, mock_path, mock_getcwd): ...
Review this code and list any quality issues.
[]
0
python
'title': ('title', 'text', {str}), 'description': ('description', 'html', {clean_html}), })), } class TV8ItPlaylistIE(InfoExtractor): IE_DESC = 'TV8 Playlist' _VALID_URL = r'https?://(?:www\.)?tv8\.it/(?!video)[^/#?]+/(?P<id>[^/#?]+)' _TESTS = [{ 'url': 'https:/...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'thumbnail': r're:https://static\\.sky\\.it/.+\\.(png|jpe?g|webp)',\r\n```", "severity": "minor", "line": 26 } ]
1
python
[-0.500, 0.500, nan, 0.000], [-0.500, 0.500, 0.000, nan]] ) } # Changing the classifier dtype shouldn't affect anything. expected['grouped_str'] = expected['grouped'] expected['grouped_masked_str'] = expected['grouped_masked'] self.check_te...
Review this code and list any quality issues.
[]
0
python
logger.debug(wording.get('creating_temp'), __name__.upper()) create_temp(facefusion.globals.target_path) # extract frames logger.info(wording.get('extracting_frames_fps').format(video_fps = facefusion.globals.output_video_fps), __name__.upper()) extract_frames(facefusion.globals.target_path, facefusion.globals.outp...
Review this code and list any quality issues.
[ { "issue": "add to processing of an audio to `tests/test_cli.py`", "severity": "minor", "line": 26 } ]
1
python
search_prompt: str | None = None def to_dict(self) -> dict[str, Any]: d: dict[str, Any] = {"id": self.id, "max_results": self.max_results} if self.search_prompt is not None: d["search_prompt"] = self.search_prompt return d @dataclass class OpenRouterProviderPreferences: ""...
Review this code and list any quality issues.
[ { "issue": "move them to `models.py`? and can we use a TypedDict instead?", "severity": "minor", "line": 26 } ]
1
python
# pyright: reportPrivateUsage=false from __future__ import annotations as _annotations import datetime import os import re from collections.abc import AsyncIterator from typing import Any import pytest from httpx import Timeout from inline_snapshot import Is, snapshot from pydantic import BaseModel from typing_extens...
Review this code and list any quality issues.
[ { "issue": "Please add this only to the lines in question, using `pyright: ignore[reportPrivateUsage]`", "severity": "minor", "line": 1 } ]
1
python
setup_run_process(proc) job = TestSparkSubmitTask() job.run() self.assertEqual(proc.call_args[0][0], ['ss-stub', '--master', 'yarn-client', '--deploy-mode', 'client', '--name', 'AppName', '--class', 'org.test.MyClass', '--jars', 'jars/my.jar', ...
Review this code and list any quality issues.
[]
0
python
import concurrent import hashlib import json import logging import threading import uuid import warnings from datetime import datetime from typing import Any, Dict import pytz from pydantic import ValidationError from mem0.configs.base import MemoryConfig, MemoryItem from mem0.configs.prompts import get_update_memory...
Review this code and list any quality issues.
[ { "issue": "Can you please run the lint command?", "severity": "minor", "line": 24 } ]
1
python
patch.object(config, "is_manually_set", new=mock_is_manually_set), ): bootstrap._print_url(False) out = sys.stdout.getvalue() assert "Local URL: http://localhost:8501/foo" in out assert "Network URL: http://internal-ip:8501/foo" in out @patch("streamlit.net_util.get_int...
Review this code and list any quality issues.
[]
0
python
-------- >>> len(range(1)) 1 >>> len(range(5)) 5 >>> len(range(1, 5)) 4 >>> len(range(0, 5, 2)) 3 >>> len(range(5, 0, -1)) 5 >>> len(range(5, 0, 1)) 0 """ ...
Review this code and list any quality issues.
[ { "issue": "I should probably comment that the algo was taken from CPython", "severity": "minor", "line": 26 } ]
1
python
# Form / Combobox # Use comboboxes to allow users to either choose between available choices or indicate a choice by free-form editing. # #form #combobox # --- from h2o_wave import main, app, Q, ui combobox_choices = ['Cyan', 'Magenta', 'Yellow', 'Black'] @app('/demo') async def serve(q: Q): if q.args.show_input...
Review this code and list any quality issues.
[ { "issue": "This is by design. Since combobox let's you select either predefined options or free text, the value should be able to display arbitrary text that is not among the options also. Please revert this and implement the previous behavior and add the unit test for it so we have it covered for the future."...
1
python
class Date(ElemOperator): def _load_internal(self, instrument, start_index, end_index, freq): _calendar = get_calendar_day(freq=freq) series = self.feature.load(instrument, start_index, end_index, freq) return pd.Series(_calendar[series.index], index=series.index) class Select(PairOperator...
Review this code and list any quality issues.
[ { "issue": "`is None` is better than `!= None`", "severity": "minor", "line": 26 } ]
1
python
parts=[ ToolReturnPart( tool_name='get_image_resource_link', content='See file 1c8566', tool_call_id='call_eVFgn54V9Nuh8Y4zvuzkYjUp', timestamp=IsDatetime(), ),...
Review this code and list any quality issues.
[]
0
python
}, }, { 'url': 'https://coldworldofficial.bandcamp.com/music', 'playlist_mincount': 10, 'info_dict': { 'id': 'coldworldofficial', 'title': 'Discography of coldworldofficial', }, }, { 'url': 'https://nuclearwarnowproductions.bandcamp.com/music', ...
Review this code and list any quality issues.
[ { "issue": "I noticed that this is seriously over capturing. Can you give example why you can't just capture the homepage and /music?", "severity": "minor", "line": 26 } ]
1
python
fmts, subs = self._extract_m3u8_formats_and_subtitles(source.get('src'), video_id) formats.extend(fmts) self._merge_subtitles(subs, target=subtitles) else: formats.append({'url': source.get('src'), 'ext': 'mp4'}) return formats, subtitles def _rea...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'channel_id': traverse_obj(nextjs_json, 'channel', 'channel_slug'),\r\n```", "severity": "minor", "line": 26 } ]
1
python
At its creation, a new scenario is attached to a single cycle, the one that matches its optional _frequency_ and its _creation_date_. The possible frequencies are: - `Frequency.DAILY` - `Frequency.WEEKLY` - `Frequency.MONTHLY` - `Frequency.QUARTERLY` - `Frequency.YEARLY` Attributes: ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n month. During each month (the cycle), he/she will be interested in experimenting with\r\n```", "severity": "minor", "line": 26 } ]
1
python
'34': '720p', '33': '480p', '32': '360p', '31': '270p', } def _real_extract(self, url): id = self._match_id(url) video_data = self._download_json(f'https://tv.nate.com/api/v1/clip/{id}', id) formats = [{ 'url': f_url, 'resolution': self._Q...
Review this code and list any quality issues.
[ { "issue": "`str_or_none` to handle None correctly", "severity": "minor", "line": 26 } ]
1
python
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. from typing import Protocol, runtime_checkable from pydantic import BaseModel from llama_stack.apis.version import LL...
Review this code and list any quality issues.
[ { "issue": "nit. but we should probably use the `LLAMA_STACK_API_...` constants here to ensure that these dont diverge over time.", "severity": "minor", "line": 20 } ]
1
python
) # Patch it as well! model = dispatch_model.patch_peft_model(model, use_gradient_checkpointing) # Patch Tiled MLP # to turn on set UNSLOTH_TILED_MLP to "arctic", "target", or "target:{GB}"" patch_tiled_mlp_choice = os.environ.get( "UNSLOTH_TILED_MLP", "arcti...
Review this code and list any quality issues.
[]
0
python
from typing import Optional from langchain.text_splitter import RecursiveCharacterTextSplitter from embedchain.chunkers.base_chunker import BaseChunker from embedchain.config.add_config import ChunkerConfig from embedchain.helper.json_serializable import register_deserializable @register_deserializable class JsonCh...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\nclass JSONChunker(BaseChunker):\r\n```", "severity": "minor", "line": 11 } ]
1
python
'only_matching': True }, { 'url': 'https://www.patreon.com/m/5932659', 'only_matching': True }] @classmethod def suitable(cls, url): return False if PatreonIE.suitable(url) else super(PatreonCampaignIE, cls).suitable(url) def _entries(self, campaign_id): cursor = No...
Review this code and list any quality issues.
[ { "issue": "Unrelated to this PR: since most overrides for `suitable` follows this pattern, should we have an internal mechanism for this?", "severity": "minor", "line": 26 } ]
1
python
current_workflow_task_state = self.current_workflow_task_state if current_workflow_task_state: return current_workflow_task_state.task.specific @property def status_string(self): if not self.live: if self.expired: return _("expired") elif self...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n def get_lock(self):\r\n```\r\n\r\nThe `get_lock` annotation in `LockableMixin` doesn't have annotation yet, so I'm not sure about adding it only here. Also, we've dropped Python 3.9 support, so we can use the `|` union syntax if we want to add type hints.", "severity": "mino...
1
python
'season': info.get('season'), 'episode_number': info.get('episode'), }) return info_dict class TVPVODBaseIE(InfoExtractor): _API_BASE_URL = 'https://vod.tvp.pl/api/products' def _api_request(self, resource, video_id, **kwargs): return self._download_json( ...
Review this code and list any quality issues.
[ { "issue": "Should these be conditioned to non-empty strings, eg with `strip_or_none(...) or None`?", "severity": "minor", "line": 26 } ]
1
python
{ 'format_id': '0', 'url': main_video_to_download_url, 'resolution': 'Main Video', } ] for format_id, stream_url_object in enumerate(data['video']['stream_urls'], start=1): stream_url = stream_url_object...
Review this code and list any quality issues.
[ { "issue": "this should be inline as well\r\n```suggestion\r\n video_info_list.append({\r\n 'id': media_param,\r\n 'title': main_video_to_download_filename,\r\n 'thumbnail': thumbnail,\r\n 'duration': duration_seconds,\r\n 'fo...
1
python
action="ignore", category=RemovedInDjango70Warning ): clone = clone.annotate(**expressions) clone._fields = fields clone.query.set_values(fields) return clone def values(self, *fields, **expressions): fields += tuple(expressions) clone = self._val...
Review this code and list any quality issues.
[ { "issue": "I think this is always `pk`, but I wasn't 100% sure, so I copied here what's eventually used in `Query.set_values()` when not passing any fields.", "severity": "minor", "line": 26 } ]
1
python
for idx in _extract_m3u8_playlist_indices(manifest_url): format_id = [m3u8_id, None, idx] # Bandwidth of live streams may differ over time thus making # format_id unpredictable. So it's better to keep provided # format_id intact. ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if yt_audio_content_id := last_stream_inf.get('YT-EXT-AUDIO-CONTENT-ID'):\r\n f['language'] = yt_audio_content_id.split('.')[0]\r\n if last_stream_inf.get('DEFAULT') == 'YES':\r\n # Keep val...
1
python
) self.assertEqual(3, len(master.clients)) self.assertEqual(1, len(self.mocked_log.warning)) def test_worker_stats_report_median(self): with mock.patch("locust.rpc.rpc.Server", mocked_rpc()) as server: master = self.get_runner() server.mocked_send(Message("cl...
Review this code and list any quality issues.
[]
0
python
downW_quant, downS, _backward_function, ) ctx.save_for_backward(gateA, gateB, upA, upB, downA, downB, X, e, g) ctx.inplace = inplace return i @staticmethod @torch_amp_custom_bwd def backward(ctx, dY: torch.Tensor): ( gateW, ...
Review this code and list any quality issues.
[ { "issue": "Is this done for accuracy reasons? Otherwise, we generally do quantized forward pass when we can and only dequantize via [`fast_dequantize`](https://github.com/unslothai/unsloth/blob/0779d697e6dc1e78a56053cc53b01c338afdb3ae/unsloth/kernels/utils.py#L443) when needed.", "severity": "minor", "...
1
python
'id': 'e389af9d-1dab-44f2-8788-ee24deb7ff0d', 'ext': 'mp4', 'display_id': 'tldrnewseu-did-the-us-really-blow-up-the-nordstream-pipelines', 'title': 'Did the US Really Blow Up the NordStream Pipelines?', 'description': 'md5:b4e2a14e3ff08f546a3209c75261e789', 'u...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n```\r\nsave it for the proper embed extraction PR", "severity": "major", "line": 26 } ]
1
python
self.wait_for_console( "===PyScript page fully initialized===", timeout=timeout, check_errors=check_errors, ) def pyscript_run(self, snippet, config=""): """ Main entry point for pyscript tests. snippet contains a fragment of HTML which will be p...
Review this code and list any quality issues.
[ { "issue": "+1 for introducing a way to inject extra stuff in the head, but the name `config` sounds wrong.\r\nI would call it `extra_head`, and I would make it a keyword-only argument, i.e.:\r\n```python\r\ndef pyscript_run(self, snippet, *, extra_head=\"\"):\r\n```", "severity": "critical", "line": 26...
1
python
from manim import * def test_zoom(): s1 = Square() s1.set_x(-10) s2 = Square() s2.set_x(10) with tempconfig({"dry_run": True}): scene = MovingCameraScene() scene.add(s1, s2) scene.play(scene.camera.auto_zoom([s1, s2])) assert ( scene.camera.frame_width ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n with tempconfig({\"dry_run\": True, \"quality\": \"low\"}):\r\n```", "severity": "major", "line": 11 } ]
1
python
if hasattr(self, "children"): for child in self.children: assert isinstance(child, (Statement, Feature)) yield child def replace_child(self, existing, new): if hasattr(self, "child"): # this really confuses mypy because the property may not exist ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n feature_set: Set[Feature] = set()\r\n```", "severity": "minor", "line": 26 } ]
1