Dataset Viewer
Auto-converted to Parquet Duplicate
language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
) def valid_addon(value: Any) -> str: """Validate value is a valid addon slug.""" value = VALID_ADDON_SLUG(value) hass = async_get_hass_or_none() if hass and (addons := get_addons_info(hass)) is not None and value not in addons: raise vol.Invalid("Not a valid add-on slug") return value ...
Review this code and list any quality issues.
[ { "issue": "`SCHEMA_APP` reuses `valid_addon`, which raises `vol.Invalid(\"Not a valid add-on slug\")` when the slug is unknown. For the new `app_*` services this produces an inconsistent error message (users will see \"add-on\" for an \"app\" field). Consider adding a dedicated `valid_app` wrapper (same valida...
1
python
webpage = self._download_webpage(url, video_id) data_setup = self._search_json( r'<div[^>]+class="[^"]*videoPlayer[^"]*"[^>]*data-setup=\'', webpage, 'data_setup', video_id) formats, subtitles = self._extract_png_formats_and_subtitles(data_setup['idAsset']) return { ...
Review this code and list any quality issues.
[ { "issue": "they single quote the json and don't escape html special chars (`\"`=>`&quot;`)?", "severity": "critical", "line": 26 } ]
1
python
f['abr'] = int(abr) if protocol == 'hls': protocol = 'm3u8' if ext == 'aac' else 'm3u8_native' else: protocol = 'http' f.update({ 'format_id': '_'.join(format_id_list), 'protocol': protocol, 'preference':...
Review this code and list any quality issues.
[ { "issue": "Should we suggest sleep args to user?", "severity": "minor", "line": 26 } ]
1
python
# Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """A test which checks that the secret hiding enable kernel builds successfully.""" import pytest from framework import utils @pytest.mark.timeout(600) @pytest.mark.secret_hiding def test_build_hiding_ker...
Review this code and list any quality issues.
[]
0
python
self.color_lookup: ColorLookup = color_lookup @staticmethod 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 = t...
Review this code and list any quality issues.
[]
0
python
"""Run `pip install google-generativeai` to install dependencies.""" from agno.agent import Agent from agno.models.google import Gemini agent = Agent( model=Gemini(id="gemini-2.5-flash", url_context=True), markdown=True, ) url1 = "https://www.foodnetwork.com/recipes/ina-garten/perfect-roast-chicken-recipe-19...
Review this code and list any quality issues.
[ { "issue": "Let's print the citations.web_search thing too to show it's there. I just learned about it :)", "severity": "minor", "line": 25 } ]
1
python
xp_assert_close(stats.yeojohnson_llf(16, -data), xp.asarray(12.418595783381280, dtype=xp.float64), rtol=1e-7) # 2. Test overflow xp_assert_close(stats.yeojohnson_llf(-20, data), xp.asarray(12.360966379200528, dtype=xp.float64), rtol=1e-7) xp_assert...
Review this code and list any quality issues.
[ { "issue": "FWIW, when I poked around locally I could delete the `tolist()` call and `spin test -t scipy/stats/tests/test_morestats.py -b all` still passed \"ok.\"\n\nWhat's the purpose? Just purity to provide an array-like rather than NumPy array proper to a given backend?", "severity": "minor", "line"...
1
python
@classmethod def membership(cls) -> Self: """A factory method that creates a :class:`Permissions` with all "Membership" permissions from the official Discord UI set to ``True``. .. versionadded:: 1.7 """ return cls(0b10000000000001100000000000000000000000111) @classmeth...
Review this code and list any quality issues.
[ { "issue": "might wanna add versionchanged", "severity": "minor", "line": 26 } ]
1
python
class StringData(BaseModel): text: str # This will have a name like "Result[StringData]" which needs sanitization OutputType = [Result[StringData], Result[int]] ''' mod = create_module(module_code) m = TestModel() agent = Agent(m, output_type=mod.OutputType) agent.run_sync('Hello') # The...
Review this code and list any quality issues.
[ { "issue": "I'd like to add this (the snapshot will be filled in automatically when you run the test so that we see the names we ended up with.\r\n\r\n```suggestion\r\n tool_names = [tool.name for tool in m.last_model_request_parameters.output_tools]\r\n assert tool_names == snapshot()\r\n```", "sever...
1
python
def _real_extract(self, url): base_url, maybe_id = self._match_valid_url(url).groups() page = self._download_webpage(url, maybe_id) video_id = self._search_regex( r"_icareus\['itemId'\]\s*=\s*'(\d+)'", page, "video_id") api_base = self._search_regex( r'var\s+publi...
Review this code and list any quality issues.
[ { "issue": "metad can be directly put into the info_dict", "severity": "minor", "line": 26 } ]
1
python
num_gpus: Optional[int], memory: Optional[int], ray_remote_args: Dict[str, Any], ) -> Dict[str, Any]: """Convert the given resources to Ray remote args. Args: num_cpus: The number of CPUs to be added to the Ray remote args. num_gpus: The number of GPUs to be added to the Ray remote args...
Review this code and list any quality issues.
[ { "issue": "Nit: This `util.py` is kind of a kitchen sink file. If this utility function is only used by the Kafka implementation, it might be better located in `kafka_datasource.py`", "severity": "major", "line": 26 } ]
1
python
and first_child.type == token.STRING and child.children[1].type == token.NEWLINE ): continue break elif first_child.type == syms.import_from: module_name = first_child.children[1] if not isinstance(module_name, Leaf) or module_nam...
Review this code and list any quality issues.
[ { "issue": "I don't think we should do this, as it changes visible output (due to the debug f-string). It's unlikely that people rely on that, sure, but I really don't want running Black to affect the output of a program.", "severity": "critical", "line": 26 } ]
1
python
@pytest.fixture(autouse=True) def _isolate_test_environment(prepare_test_env: Callable[[], None]) -> None: """Isolate the testing environment by resetting global state before and after each test. This fixture ensures that each test starts with a clean slate and that any modifications during the test do not...
Review this code and list any quality issues.
[]
0
python
import json import html import re from .common import InfoExtractor from ..utils import traverse_obj class ZaikoIE(InfoExtractor): _VALID_URL = r'https://zaiko\.io/event/(?P<id>\d+)/stream(?:/\d+)+' _TESTS = [{ 'url': 'https://zaiko.io/event/324868/stream/20571/20571', 'info_dict': { ...
Review this code and list any quality issues.
[ { "issue": "Match `http` and `www.` too since they work/redirect in browser\r\n```suggestion\r\n _VALID_URL = r'https?://(?:www\\.)?zaiko\\.io/event/(?P<id>\\d+)/stream(?:/\\d+)+'\r\n```", "severity": "minor", "line": 10 } ]
1
python
# KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. import logging import re from typing import Any, Optional from flask import current_app as app from flask_babel import gettext as __ from superset.commands.base import BaseCommand...
Review this code and list any quality issues.
[ { "issue": "Rendering templates before validation makes sense to avoid spurious syntax errors. Two quick questions:\r\n\r\n1. Is template processing gated by the ENABLE_TEMPLATE_PROCESSING feature flag elsewhere, or should we guard this call here if the flag is off?\r\n1. If template processing raises an error ...
1
python
'info_dict': { 'id': 'Congressional Chronicle - Members of Congress, Hearings and More | C-SPAN.org', 'title': 'Congressional Chronicle - Members of Congress, Hearings and More', 'description': 'md5:54c264b7a8f219937987610243305a84', 'ext': 'mp4' } }] def...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n f.setdefault('http_headers', {}).update({\r\n 'Referer': basic_url + '/',\r\n 'Origin': basic_url,\r\n 'Accept': '*/*',\r\n 'Sec-Fetch-Dest': 'empty',\r\n 'Sec-Fetch-Mode': 'cors',\r\n ...
1
python
register_widget_result.value_changed, ) def create_mappings( options: Sequence[T], format_func: Callable[[T], str] = str ) -> tuple[list[str], dict[str, int]]: """Iterates through the options and formats them using the format_func. Returns a tuple of the formatted options and a mapping of the formatt...
Review this code and list any quality issues.
[ { "issue": "**suggestion (non-blocking):** Because these functions validate _and_ also have a possible side-effect of changing state, consider either:\n\n1. Giving them either a name that makes the potential for side-effects clearer.\n2. Refactoring this into 2 different functions and have the widget layer comp...
1
python
current_token = torch.tensor(batch_token_ids[batch_id], dtype=torch.long, device=logits.device) curretn_socre = torch.gather(current_logit, 0, current_token) curretn_socre = torch.where(curretn_socre < 0, curretn_socre * penalty, curretn_socre / penalty) logits_list.append(current_l...
Review this code and list any quality issues.
[]
0
python
@classmethod def from_capa(cls, meta, rules: RuleSet, capabilities: MatchResults) -> "ResultDocument": rule_matches: Dict[str, RuleMatches] = {} for rule_name, matches in capabilities.items(): rule = rules[rule_name] if rule.meta.get("capa/subscope-rule"): co...
Review this code and list any quality issues.
[ { "issue": "let's use the method provided by pydantic: https://docs.pydantic.dev/usage/models/#helper-functions", "severity": "major", "line": 26 } ]
1
python
... def release(self) -> None: self.renderer.release() def post_construct(self) -> None: """Run post-construct hooks, and clean up the file writer.""" if self.file_writer.num_plays: self.file_writer.finish() # otherwise no animations were played elif config....
Review this code and list any quality issues.
[]
0
python
func( [ "c", "d", "e", ] # preserve me ) func([x for x in "short line"]) func([x for x in "long line long line long line long line long line long line long line"]) func([x for x in [x for x in "long line long line long line long line long line long line long line"]]) func({"short l...
Review this code and list any quality issues.
[ { "issue": "Can you also add tests for `**` unpacking (as mentioned by @Avasam)?", "severity": "minor", "line": 26 } ]
1
python
if file_url and determine_ext(file_url) in MEDIA_EXTENSIONS.audio: yield self._parse_entry(episode) def _real_extract(self, url): playlist_id = self._match_id(url) api_url = f'{self._API_BASE}/shows/{playlist_id}' self.write_debug(f'API URL: {api_url}') api_data = ...
Review this code and list any quality issues.
[ { "issue": "Again, I don't see the point to this excessive logging\r\n```suggestion\r\n api_data = self._download_json(\r\n f'{self._API_BASE}/shows/{playlist_id}', playlist_id,\r\n note='Downloading show data from API')\r\n```", "severity": "minor", "line": 26 } ]
1
python
model_selector.change( clear_history, None, [state, chatbot, textbox, imagebox] + btn_list ) textbox.submit( add_text, [state, model_selector, textbox, imagebox], [state, chatbot, textbox, imagebox] + btn_list, ).then( bot_response, [state, temperature, top_p...
Review this code and list any quality issues.
[ { "issue": "Can you try to use a global variable instead of passing it as a gradio element?", "severity": "minor", "line": 26 } ]
1
python
@pytest.fixture(scope="session") def browser_type_launch_args(request): """ Override the browser_type_launch_args defined by pytest-playwright to support --devtools. NOTE: this has been tested with pytest-playwright==0.3.0. It might break with newer versions of it. """ # this calls the "ori...
Review this code and list any quality issues.
[ { "issue": "this is superfluous. `HTTPServer` is a subclass of `socketserver.SocketServer`, and the class is already stored as `RequestHandlerClass`:\r\nhttps://github.com/antocuni/cpython/blob/deaf509e8fc6e0363bd6f26d52ad42f976ec42f2/Lib/socketserver.py#L201-L206", "severity": "minor", "line": 26 } ]
1
python
def test_HubDatasetModuleFactoryWithScript(self): factory = HubDatasetModuleFactoryWithScript( SAMPLE_DATASET_IDENTIFIER, download_config=self.download_config, dynamic_modules_path=self.dynamic_modules_path, ) module_factory_result = factory.get_module() ...
Review this code and list any quality issues.
[]
0
python
from .common import InfoExtractor from ..utils import traverse_obj class WhypIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?whyp\.it/tracks/(?P<number_id>[0-9_-]+)/(?P<display_id>[a-zA-Z0-9_-]+)' _TEST = { 'url': 'https://www.whyp.it/tracks/18337/home-page-example-track-b4kq7', 'md5': 'c...
Review this code and list any quality issues.
[ { "issue": "this change depends on the suggested change to `_VALID_URL`\r\n```suggestion\r\n unique_id = self._match_id(url)\r\n```", "severity": "minor", "line": 26 } ]
1
python
from . import data from . import finance from . import gens from . import utils from .utils.calendars import get_calendar from .utils.run_algo import run_algorithm from ._version import get_versions __version__ = get_versions()['version'] del get_versions # These need to happen after the other imports. from . algorith...
Review this code and list any quality issues.
[ { "issue": "+1 glad we will catch this early in the future", "severity": "minor", "line": 26 } ]
1
python
({"Accept": "application/json"}, does_not_raise()), ({123: 456.789}, does_not_raise()), # Convert numbers to strings ( {"Accept": ["application/json"]}, pytest.raises(vol.error.MultipleInvalid), ), # Value is not a string ({1: None}, pytest.raises(vol.error.Mult...
Review this code and list any quality issues.
[ { "issue": "What happens in this case? Headers are only allowed to be a string, so it should fail right?", "severity": "critical", "line": 26 } ]
1
python
error_params = ["Reduction failed at followed parameters:"] for param in self.param2name: if not is_ddp_ignored(param) and not getattr(param, "_gemini_reduced"): error_params.append(self.param2name[param]) error_str = "\n\t".join(error_params) rais...
Review this code and list any quality issues.
[ { "issue": "`backward_by_grad()` shoud not be called, since Gemini is not compatible with pipeline. Raise a runtime error here.", "severity": "critical", "line": 26 } ]
1
python
[], index=ser.index[:0], columns=["open", "high", "low", "close"] ) tm.assert_frame_equal(result, expected, check_dtype=False) else: expected = ser[:0].copy() tm.assert_series_equal(result, expected, check_dtype=False) tm.assert_index_equal(result.index, expected.index) asser...
Review this code and list any quality issues.
[]
0
python
# If no metadata filters tracked yet, all keys are considered invalid if valid_metadata_filters is None or not valid_metadata_filters: invalid_keys = list(filters.keys()) log_warning(f"No valid metadata filters tracked yet. All filter keys considered invalid: {invalid_keys}") ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n async def async_validate_filters(self, filters: Optional[Dict[str, Any]]) -> Tuple[Dict[str, Any], List[str]]:\n \"\"\"Return a tuple containing a dict with all valid filters and a list of invalid filter keys\"\"\"\n```\n\ndocstring as it's public", "severity": "minor",...
1
python
# you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if version_geq(get_package_version('zarr'), \"3.0.0\"):\r\n```\r\n`get_package_version` should return a string, and `version_geq` does the conversion anyway.", "severity": "minor", "line": 26 } ]
1
python
# Free-threaded (also known as nogil) CPython is a version of CPython that aims at # enabling efficient multi-threaded use cases by removing the Global Interpreter # Lock (GIL). # # If you want to try out free-threaded Python, the recommendation is to use # Python 3.14, that has fixed a number of issues compared to Pyt...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n# Probability calibration of classifiers with temperature scaling is available in\n```", "severity": "minor", "line": 26 } ]
1
python
from yt_dlp.extractor.common import InfoExtractor from yt_dlp.utils import ExtractorError, mimetype2ext, traverse_obj class BerufeTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?web\.arbeitsagentur\.de/berufetv/[a-z\-/]+/film;filmId=(?P<id>[a-zA-Z\d\-_]+)' _TESTS = [{ 'url': 'https://web.arbeit...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\nfrom .common import InfoExtractor\r\nfrom ..utils import ExtractorError, mimetype2ext, traverse_obj\r\n```", "severity": "major", "line": 2 } ]
1
python
snapshotter.get_event_loop_sample() with pytest.raises(RuntimeError, match='Snapshotter is not active.'): snapshotter.get_client_sample() with pytest.raises(RuntimeError, match='Snapshotter is already active.'): async with snapshotter, snapshotter: pass async with snapshotter:...
Review this code and list any quality issues.
[]
0
python
).values_list("group", flat=True) q |= Q(groups__in=add_groups) & Q(pk=instance.owner_id) return ( get_user_model() ._default_manager.filter(is_active=True) .filter(q) .distinct() ) def users_with_permission_for_instance( self, a...
Review this code and list any quality issues.
[ { "issue": "As mentioned in https://github.com/wagtail/wagtail/issues/12628#issuecomment-2559800970, while we're here, we should also add the `bulk_delete` permission here to be consistent with other \"user has any page permission\" checks", "severity": "critical", "line": 26 } ]
1
python
from ..mobject.types.vectorized_mobject import VGroup __all__ = ["AnimationGroup", "Succession", "LaggedStart", "LaggedStartMap"] DEFAULT_LAGGED_START_LAG_RATIO: float = 0.05 class AnimationGroup(Animation): """Plays a group or series of :class:`~.Animation`. Parameters ---------- animations ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n ``n.nn`` means the next animation will play when ``nnn%`` of the current animation has played.\r\n```", "severity": "minor", "line": 26 } ]
1
python
# inter-process communication. Be aware that switching the default joblib # backend and testing that everything works well with free-threaded is a # long-term ongoing effort. # %% # Temperature scaling in `CalibratedClassifierCV` # ----------------------------------------------- # Probability calibration of classifier...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n# with 3 classes.\n```", "severity": "minor", "line": 26 } ]
1
python
'timestamp': 1661152289, }, 'params': {'format': 'ba[ext=mp3]'} }] _WEBPAGE_TESTS = [{ 'url': 'https://www.rova.nz/home/podcasts/socrates-walks-into-a-bar/the-trolley-problem---episode-1.html', 'info_dict': { 'id': 'VID02494', 'ext': 'mp4', 't...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n for mobj in re.finditer(\r\n rf'''(?x)<div\\s+\\bid=[\"']Player-Attributes-JWID[^>]+\\b\r\n data-request-url=[\"']{cls._VALID_URL_BASE_RE}[\"'][^>]+\\b\r\n data-asset-id=[\"']{cls._VALID_URL_ID_RE}[\"']''', webpage\r\n ):\r\n```", ...
1
python
return bool(match and match.group(0)) def gen_python_files( paths: Iterable[Path], root: Path, include: Pattern[str], exclude: Pattern[str], extend_exclude: Optional[Pattern[str]], force_exclude: Optional[Pattern[str]], report: Report, gitignore: Optional[Dict[Path, PathSpec]], *, ...
Review this code and list any quality issues.
[ { "issue": "Doesn't seem like this needs to be a nested function.", "severity": "minor", "line": 26 } ]
1
python
"What type of app do you want to build?", choices=common.APP_TYPES ) if answer is None: print("Exiting application.") exit(0) while 'unavailable' in answer: print("Sorry, that option is not available.") answer = styled_select( "What type of app do you wa...
Review this code and list any quality issues.
[ { "issue": "do we want to then fill in project description?", "severity": "minor", "line": 26 } ]
1
python
def as_bgr(self) -> Tuple[int, int, int]: """ Returns the color as a BGR tuple. Returns: Tuple[int, int, int]: BGR tuple. Example: ``` >>> color.as_bgr() (255, 0, 255) ``` """ return self.b, self.g, self.r ...
Review this code and list any quality issues.
[ { "issue": "Do we need `cls._GREEN`? Can't we just return `cls.from_hex(\"#00ff00\")`?", "severity": "minor", "line": 26 } ]
1
python
r""" Add methods from `AutoConfig` to the pipeline. Parameters: pipeline (`Pipeline`): The pipeline to which the methods will be added. """ for attr_name in dir(AutoConfig): attr_value = getattr(AutoConfig, attr_name) if callable(attr_value) and not attr_name.startsw...
Review this code and list any quality issues.
[]
0
python
instead of the quantiles Return ------ binning_thresholds : ndarray of shape(min(max_bins, n_unique_values) - 1,) The increasing numeric values that can be used to separate the bins. A given value x will be mapped into bin value i iff bining_thresholds[i - 1] < x <= binning_threshol...
Review this code and list any quality issues.
[ { "issue": "Same here, those are no longer midpoints since we use `method=\"average_inverted_cdf\"`.", "severity": "minor", "line": 26 } ]
1
python
The callback function must return an integer error status that is zero if something went wrong and one otherwise. If an error occurs, you should normally set the python error status with an informative message before returning, otherwise a default error message is set by the calling function. In ad...
Review this code and list any quality issues.
[ { "issue": "This should use `sliding_window_view` rather than a for loop. Something along the lines of\r\n\r\n```\r\nIn [1]: from numpy.lib.stride_tricks import sliding_window_view\r\n\r\nIn [2]: x = np.array([1, 2, 3, 4, 5], dtype=np.float64)\r\n\r\nIn [3]: v = sliding_window_view(x, 3)\r\n\r\nIn [4]: v.max()\...
1
python
@pytest.mark.parametrize( 'worktype', ('remote', 'local'), ) def test_tagless_image(podman_image_generator, worktype): """ Ensure podman images on Control and Hybrid nodes are deleted during cleanup. """ podman_image_generator() dangling_image = next((image for image in get_podman_images() ...
Review this code and list any quality issues.
[ { "issue": "My only nit pick about this test is now that this call with run _both_ the control & execution forms of the logic. Meaning it will run `ansible_runner.cleanup.run_cleanup(runner_cleanup_kwargs)` before the command over receptor. So if you're testing that the CLI args do not error, this test is suffi...
1
python
omit=WARMUP_SEC, ) # Print the fio command in the log and run it rc, stdout, stderr = microvm.ssh.run(f"cd /tmp; {cmd}") assert rc == 0, stderr assert stderr == "" fio_json_path = Path(test_output_dir / "fio.json") with open(fio_json_path, "w", encoding="utf-8")...
Review this code and list any quality issues.
[ { "issue": "I admittedly don't quite see why this change to this function is needed?", "severity": "minor", "line": 26 } ]
1
python
'ext': 'mp4', 'title': 'Siberi võmm / Operatsioon "Öö"', 'thumbnail': r're:https://.+\.jpg(?:\?c=\d+)?$', # 'description': 'md5:53cabf3c5d73150d594747f727431248', 'description': 'md5:8ef98f38569d6b8b78f3d350ccc6ade8', 'upload_date': '20170523', 'ti...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'manifest_url': manifest_url,\r\n```\r\n\r\nshould just use `manifest_url` key here?", "severity": "minor", "line": 26 } ]
1
python
# Check if KV connector requires PIECEWISE mode for CUDA graphs if ( self.compilation_config.cudagraph_mode.has_full_cudagraphs() and self.kv_transfer_config is not None and self.kv_transfer_config.is_kv_transfer_instance ): # Lazy ...
Review this code and list any quality issues.
[ { "issue": "I think this performance bit is a bit too \"scary\", suggesting that a connector that moves all the layers at once might actually be more performant than one that \"streams\" them.", "severity": "major", "line": 26 } ]
1
python
assert_allclose(state.vel, 0.0, tol=2e-2) # Landed vertically pos = tensor_to_array(state.pos.squeeze(0)) BV, *_ = igl.bounding_box(pos) entity_center = 0.5 * (BV[0] + BV[-1]) if coupler_type == gs.options.SAPCouplerOptions: tol = 1e-2 if material_model == "linear_co...
Review this code and list any quality issues.
[ { "issue": "hope we can reduce the time and mark them required in the near future", "severity": "minor", "line": 26 } ]
1
python
'url': 'https://www.philo.com', 'only_matching': True, }, { # https://github.com/yt-dlp/yt-dlp/issues/3533 'url': 'https://www.mech-plus.com/', 'only_matching': True, }, { 'url': 'https://watch.mech-plus.com/', 'only_matching': True, }, { # https://git...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n return r'https?://(?:www\\.)?(?:%s)' % '|'.join(rf'(?:{s})' for s in cls.UNSUPPORTED_URLS)\r\n```", "severity": "minor", "line": 26 } ]
1
python
import math from .common import InfoExtractor from ..utils import ( InAdvancePagedList, int_or_none, str_or_none, traverse_obj, unified_strdate, url_or_none, ) class SubsplashVideoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?subsplash\.com/u/[^/]+/media/d/(?P<id>\w+)' _TESTS =...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'thumbnail': r're:https?://.*\\.(?:jpg|png)$',\r\n```\r\nSee https://discord.com/channels/807245652072857610/1112613156934668338/1293369656098160702. `re.match` is used here when running tests(which matches from the start of the string already)", "severity": "minor",...
1
python
from .common import InfoExtractor from ..utils import ( js_to_json, urlencode_postdata, urljoin, ) class JioSaavnBaseIE(InfoExtractor): def _extract_initial_data(self, url, audio_id): webpage = self._download_webpage(url, audio_id) return self._search_json( r'window\.__INIT...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n)\r\nfrom ..utils.traversal import traverse_obj\r\n\r\n```", "severity": "minor", "line": 7 } ]
1
python
subscribers = hass.data[DATA_WS_SUBSCRIBERS] subscribers.add((connection, msg["id"])) @callback def cancel_subscription() -> None: subscribers.remove((connection, msg["id"])) connection.subscriptions[msg["id"]] = cancel_subscription connection.send_message(websocket_api.result_message(msg[...
Review this code and list any quality issues.
[ { "issue": "The websocket schema for `frontend/update_panel` allows calls with only `url_path` (no fields to update), which will still schedule a save and fire `EVENT_PANELS_UPDATED`. Add a `cv.has_at_least_one_key(\"title\", \"icon\", \"require_admin\", \"show_in_sidebar\")` constraint so the command is reject...
1
python
def loop_version(peer_url): while True: requests.get(f"{peer_url}/", timeout = 0.5) def loop_cluster_info(peer_url): while True: requests.get(f"{peer_url}/collections/test_collection/cluster", timeout = 0.5) def test_shard_snapshot_deadlock(tmp_path: pathlib.Path): assert_project_root() ...
Review this code and list any quality issues.
[]
0
python
data = json.loads(recv) if not isinstance(data, dict): continue if data.get('type') == 'stream': m3u8_url = data['data']['uri'] qualities = data['data']['availableQualities'] break elif data.get('type') == 'disconnect': ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if not isinstance(value, dict):\r\n```", "severity": "minor", "line": 26 } ]
1
python
if conan_version < scm.Version("2.0.0"): self.cpp_info.names["cmake_find_package"] = "Catch2" self.cpp_info.names["cmake_find_package_multi"] = "Catch2" # Catch2 self.cpp_info.components["catch2base"].names["cmake_find_package"] = "Catch2" self.cpp_info.compon...
Review this code and list any quality issues.
[ { "issue": "Please do specify `cmake_target_name` similar to\r\nhttps://github.com/conan-io/conan-center-index/blob/master/recipes/catch2/3.x.x/conanfile.py#L168\r\n\r\nThat way you would be able to correctly use `Catch2::Catch2WithMain` target instead of the lowercase.", "severity": "minor", "line": 26...
1
python
self, icon_path: str, position: Position = Position.TOP_CENTER, icon_size: float = 0.2, color: Union[Color, ColorPalette] = ColorPalette.default(), color_lookup: ColorLookup = ColorLookup.CLASS, ): """ Args: icon_path (str): path of the icon in png...
Review this code and list any quality issues.
[ { "issue": "I'd throw an exception here. This will be consistent with the behavior of other annotators when they do not receive basic configuration data.", "severity": "minor", "line": 26 } ]
1
python
# We have two possible solutions: # 1. keep batch norm always in fp32. This is hard for gemini, as it use chunks. # 2. patch sync bn or write a new on. This is relatively easy, but we need to test it. # model = nn.SyncBatchNorm.convert_sync_batchnorm(model, None) # wrap ...
Review this code and list any quality issues.
[ { "issue": "We should not catch this error, as we can not handle it.", "severity": "minor", "line": 26 } ]
1
python
'provider_response_id': None, 'finish_reason': 'content_filter', 'run_id': IsStr(), 'metadata': None, } ] ) def test_responses_azure_prompt_filter_error(allow_model_requests: None) -> None: mock_client = MockOpenAIResponses.create_mock( ...
Review this code and list any quality issues.
[ { "issue": "Not sure what \"sync\" is meant to indicate here", "severity": "minor", "line": 26 } ]
1
python
return self.orchestration.refresh_token( data={ "refreshToken": refresh_token, }, api_key=api_key, )["extensions"]["sdk"]["token"] # Edge case where a bug in a working-in-progress version of # https://github.com/psf/black/pull/3370 causes an infinite recursion. assert ( lon...
Review this code and list any quality issues.
[]
0
python
if self._ws is None: _logger.debug('disconnect: No connection.') return try: _wait(self._ws.close()) _logger.debug('Connection closed by client.') except Exception as e: _logger.warning(f'Failed to close connection: {repr(e)}') self._w...
Review this code and list any quality issues.
[ { "issue": "Looks like a warning or critical.", "severity": "minor", "line": 26 } ]
1
python
self.stop_nodes() raise if self.options.coveragedir is not None: for node in self.nodes: coverage.write_all_rpc_commands(self.options.coveragedir, node.rpc) def stop_node(self, i, expected_stderr='', wait=0): """Stop a bitcoind test node""" self.node...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n peers_dat = self.nodes[i].chain_path / \"peers.dat\"\r\n```\r\n\r\nnit: You can use `/` to join paths", "severity": "minor", "line": 26 } ]
1
python
return [points[i : i + nppc] for i in range(0, len(points), nppc)] def get_bezier_tuples(self): return self.get_bezier_tuples_from_points(self.points) def get_subpaths_from_points(self, points): nppc = self.n_points_per_curve diffs = points[nppc - 1 : -1 : nppc] - points[nppc::nppc] ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n Subpaths are ranges of curves with each pair of consecutive\r\n curves having their end/start points coincident.\r\n```", "severity": "minor", "line": 26 } ]
1
python
def train_model(queue: Queue, max_epochs: int, ckpt_path: Path) -> Trainer: dataloader = DataLoader(QueueDataset(queue), num_workers=1, batch_size=None, persistent_workers=True) trainer = Trainer( max_epochs=max_epochs, enable_progress_bar=False, enable_checkpointing=False, devic...
Review this code and list any quality issues.
[ { "issue": "how or when it would return trainer as None?", "severity": "minor", "line": 26 } ]
1
python
""" result_df = source_df if mapping_config: column_mapping = {} pattern_prefix = "data." for map_to_key, map_value in mapping_config.items(): match = re.search(r"^\${([^{}]+)}$", map_value) if match is not None: pattern = match.group(1...
Review this code and list any quality issues.
[ { "issue": "Let's say after processing the evaluator config, mapping becomes to \"new_col\": ${run.outputs.col1}\r\nWhat we want to archieve here is to 1) drop col1 if it already exists in data, 2) rename outputs.col1 to new_col. Is my understanding correct?", "severity": "minor", "line": 26 } ]
1
python
@console_ns.route("/apps/<uuid:app_id>/workflows/draft") class DraftWorkflowApi(Resource): @console_ns.doc("get_draft_workflow") @console_ns.doc(description="Get draft workflow for an application") @console_ns.doc(params={"app_id": "Application ID"}) @console_ns.response(200, "Draft workflow retrieved s...
Review this code and list any quality issues.
[ { "issue": "The comment mentions \"return None (initiate graph by frontend)\" but the code above at line 436-437 explicitly raises DraftWorkflowNotExist() when workflow is falsy, so this endpoint never returns None. The comment is misleading and should be removed or corrected to reflect the actual behavior.\n``...
1
python
def load_json_chapters(filepath:str)->list: try: with open(filepath, "r", encoding="utf-8") as f: return json.load(f) except Exception as e: print(f"load_json_chapters() error: {e}") return [] def save_json_chapters(session_id:str, filepath:str)->bool: try: sessi...
Review this code and list any quality issues.
[ { "issue": "The `check_connex` function is defined as a local function inside `build_interface()` in `lib/gradio.py` and cannot be called from `lib/core.py`. This function needs to be moved to module-level scope in either `lib/core.py` or another importable location to be accessible.", "severity": "minor", ...
1
python
import logging from injector import inject, singleton from private_gpt.settings.settings import Settings from llama_index.core.storage.docstore import BaseDocumentStore, SimpleDocumentStore from llama_index.core.storage.index_store import SimpleIndexStore from llama_index.core.storage.index_store.types import BaseInde...
Review this code and list any quality issues.
[ { "issue": "I'd call it \"simple\" instead of \"local\" to better reflect the option being selected, given postgres can also be local", "severity": "minor", "line": 22 } ]
1
python
def _find_var_positional_arg(self) -> str | None: """Find the name of the VAR_POSITIONAL argument( *args), if any.""" for k, v in self.signature.parameters.items(): if v.kind == inspect.Parameter.VAR_POSITIONAL: return k return None def _create_cell_with_text(text: ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if rich_console is not None:\r\n rich_console.Console().print(\"\")\r\n rich_console.Console().print(rich_syntax.Syntax(cell, \"python\", theme=\"monokai\", line_numbers=False))\r\n```\r\n\r\nAlso, just wondering why this doesn't use `get_console` inste...
1
python
knotsp = phi[::5] knotdata = data[::5, ::5] # calculate spline coefficients lats, lons = meshgrid(theta, phi) lut_lsq = LSQSphereBivariateSpline(lats.ravel(), lons.ravel(), data.T.ravel(), knotst, knotsp) self.lut_lsq = lut_lsq s...
Review this code and list any quality issues.
[]
0
python
"""Unregister a memory object from timeout monitoring.""" obj_id = id(memory_obj) with self._objects_lock: if obj_id in self._pinned_objects: del self._pinned_objects[obj_id] logger.debug( "Unregistered pinned object %s from timeout monitor...
Review this code and list any quality issues.
[]
0
python
if block.get('type') not in ['media', 'video']: continue parse_media(block.get('model')) return self.playlist_result( entries, playlist_id, playlist_title, playlist_description) def extract_all(pattern): return list(fil...
Review this code and list any quality issues.
[ { "issue": "convert to seconds, and we can inline this in the append call\r\n```suggestion\r\n timestamp = traverse_obj(next_data, (\r\n ..., 'contents', lambda _, v: v['type'] == 'timestamp', 'model',\r\n 'timestamp', {functools.partial(int_or_none, scale=10...
1
python
"dataset#data": [{"image": self.filename}], "postprocessing#transforms#2#output_postfix": "seg", "output_dir": self.data_dir, } # test standard MONAI model-zoo config workflow inferer = ConfigWorkflow( workflow_type="infer", config_file=config_file...
Review this code and list any quality issues.
[ { "issue": "Hi @Nic-Ma ,\r\n When using `LoadImage` , all the meta data is correct for the consequencial preprocessing. However, in a streaming environment, sometimes images are loading from other libraries, how could we ensure that all meta data is ready for using?\r\n\r\nThanks, \r\nBin", "severity": "...
1
python
self._function_toolset = _AgentFunctionToolset( tools, max_retries=self._max_tool_retries, output_schema=self._output_schema ) self._dynamic_toolsets = [ DynamicToolset[AgentDepsT](toolset_func=toolset) for toolset in toolsets or [] if not isinstance(tools...
Review this code and list any quality issues.
[ { "issue": "Could we support lists and functions as well, like on `Agent.__init__`?\r\n\r\nhttps://github.com/pydantic/pydantic-ai/blob/a2883d26c538a4033143ce10198b37fcebd5669d/pydantic_ai_slim/pydantic_ai/agent/__init__.py#L166-L169", "severity": "minor", "line": 26 } ]
1
python
predict_fns = [] for endpoint in client.endpoints.values(): if not isinstance(endpoint, Endpoint): raise TypeError( f"Expected endpoint to be an Endpoint, but got {type(endpoint)}" ) if endpoint.backend_fn: dep_config = next( d for ...
Review this code and list any quality issues.
[ { "issue": "Noticed a separate issue where if you reload the page, the chatbot history doesn't clear.", "severity": "minor", "line": 26 } ]
1
python
def foo( # type: Foo x): pass # output def foo( # type: Foo x, ): pass
Review this code and list any quality issues.
[]
0
python
# Get all credentials fields from input schema credentials_fields = block.input_schema.get_credentials_fields() if not credentials_fields: logger.debug( f"Block {block_cls.__name__} has no credentials fields - Treating as valid" ) return True # Check required credentials...
Review this code and list any quality issues.
[ { "issue": "In what case can `provider_name` be `None` or `\"\"` here?", "severity": "minor", "line": 26 } ]
1
python
path = base_path if is_base else os.path.join('test', 'compare', browser, grp, img_name) os.makedirs(os.path.dirname(path), exist_ok=True) sub_selector = ' > *' if 'ui.form_card' in code_str else '' card_name = match[0][2] if match[0][2] != 'meta' else match[1][2] selector = f'[data-tes...
Review this code and list any quality issues.
[]
0
python
break # Store the complete message msg = Message("assistant", output) msg = msg.replace(quiet=True) manager.append(msg) yield f"data: {flask.json.dumps({'role': 'assistant', 'content': output, 'stored': True})}\n\n" # Recu...
Review this code and list any quality issues.
[ { "issue": "This is fine, but in dev mode/staging/CI we actually want to see the errors. Consider adding some kind of flag which includes more details when not running \"prod\" (or when a dev-mode env variable is given, so it can be enabled).", "severity": "minor", "line": 26 } ]
1
python
assert "prefixes" in res or b"prefixes" in res @skip_if_server_version_lt("2.9.50") async def test_client_pause(self, r: RedisCluster) -> None: node = r.get_primaries()[0] assert await r.client_pause(1, target_nodes=node) assert await r.client_pause(timeout=1, target_nodes=node) ...
Review this code and list any quality issues.
[]
0
python
'title': "Mrgo4hrs2023's Uploads - Videos", }, 'playlist_mincount': 32, }, { 'url': 'https://motherless.com/u/Happy_couple?t=v', 'info_dict': { 'id': 'Happy_couple', 'title': "Happy_couple's Uploads - Videos", }, 'playlist_mincount': 8, }] ...
Review this code and list any quality issues.
[ { "issue": "instead of redefining all of this just to modify the pagination request query, I think we could do this:\r\n```suggestion\r\n _EXTRA_QUERY = {'t': 'v'}\r\n```\r\n\r\nand then in the playlist baseclass, add this:\r\n```py\r\n _EXTRA_QUERY = {}\r\n```\r\nand in the baseclass' `_real_extract()`, ...
1
python
msg = (f'{free_bytes / 1e9} GB memory required, but environment variable ' f'NPY_AVAILABLE_MEM={env_value} set') else: mem_free = _get_mem_available() if mem_free is None: msg = ("Could not determine available memory; set NPY_AVAILABLE_MEM " "environmen...
Review this code and list any quality issues.
[ { "issue": "Nit: I'd probably lift this expression out to a variable assignment, then use the f-string referring to the variable name. Simpler expressions like `indents[k]` in an earlier file are probably fine, but in a regex, which is already a second problem, this is a pileup of punctuation.\r\n\r\nI get it i...
1
python
import asyncio import platform import fire import sys sys.path.append("../../") from examples.werewolf_game.werewolf_game import WerewolfGame from examples.werewolf_game.roles import Moderator, Villager, Werewolf, Guard DEFAULT_PLAYER_SETUP = """ Game setup: Player1: Villager, Player2: Villager, Player3: Werewolf, Pl...
Review this code and list any quality issues.
[ { "issue": "Try to avoid such code as much as possible", "severity": "minor", "line": 4 } ]
1
python
command, timeout, check=check, ) def check_output(self, cmd_string, timeout=None, *, debug=False): """Same as `run`, but raises an exception on non-zero return code of remote command""" return self.run(cmd_string, timeout, check=True, debug=debug) def _exec(self...
Review this code and list any quality issues.
[]
0
python
@pytest.mark.skipif(torch.cuda.device_count() < 2, reason="test requires multi-GPU machine") def test_full_loop_dp(tmpdir): reset_seed() dm = BoringDataModule() model = BoringModel() trainer = Trainer( default_root_dir=tmpdir, max_epochs=1, weights_summary=None, acceler...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n # TODO: Add end-to-end test for: assert result[0]['test_acc'] > 0.8\r\n```", "severity": "minor", "line": 26 } ]
1
python
if remaining_rows != 0: break return register_io_source(io_source=generator, schema=schema) text = """ Hello This is some text It is spread over multiple lines This allows it to read into multiple rows. """.strip() f = io.BytesIO(bytes(text, encoding="utf-8")) assert_serie...
Review this code and list any quality issues.
[]
0
python
def get_download_speed_limit(coordinator: QBittorrentDataCoordinator) -> int: """Get current download speed.""" server_state = cast(Mapping, coordinator.data.get("server_state")) return cast(int, server_state.get("dl_rate_limit")) def get_upload_speed_limit(coordinator: QBittorrentDataCoordinator) -> int:...
Review this code and list any quality issues.
[ { "issue": "Same issue as `alltime_dl`: `return value or None` will turn a real `0` lifetime upload into `None`. Consider filtering only the transient reset case (for example: if previous observed value was non-zero and the API briefly reports `0`, keep the previous value or return `None` for that update) so ne...
1
python
entity_description: KrakenSensorEntityDescription _attr_state_class = SensorStateClass.MEASUREMENT _attr_has_entity_name = True def __init__( self, kraken_data: KrakenData, tracked_asset_pair: str, description: KrakenSensorEntityDescription, ) -> None: """Initia...
Review this code and list any quality issues.
[ { "issue": "Inconsistent application of maxsplit optimization. Line 228 correctly adds `maxsplit=1` for the first split, but line 229 should also add it for consistency and performance. Both lines are splitting the same `tracked_asset_pair` format (e.g., \"BTC/USD\") and only need the result of splitting on the...
1
python
Parameters ---------- link : RigidLink The target link. local_point : torch.Tensor or None, shape (3,) Coordinates of the point in the link’s *local* frame. If None, the link origin is used (back-compat). Returns ------- jacobian : tor...
Review this code and list any quality issues.
[ { "issue": "`p_local = torch.as_tensor(local_point, dtype=gs.tc_float, device=gs.device)`", "severity": "minor", "line": 26 } ]
1
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
62