language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
# lift qpos = franka.inverse_kinematics( link=end_effector, pos=np.array([0.65, 0.0, 0.28]), quat=np.array([0, 1, 0, 0]), ) franka.control_dofs_position(qpos[:-2], motors_dof) for i in range(50): scene.step() # reach qpos = franka.inverse_kinematics( link...
Review this code and list any quality issues.
[ { "issue": "Usually we do not add test in examples", "severity": "minor", "line": 26 } ]
1
python
'categories': [], 'tags': ['Sova'], 'episode': 'Sovkudde', 'season': 'Säsong 1', }, }, { 'url': 'http://urskola.se/Produkter/155794-Smasagor-meankieli-Grodan-i-vida-varlden', 'only_matching': True, }] def _real_extract(self, url): video_id...
Review this code and list any quality issues.
[ { "issue": "Do we even need this check? Are there known keys that fails here?", "severity": "critical", "line": 26 } ]
1
python
self, entities: Optional[List[Any]], ) -> None: """Check for duplicate IDs in a list of entities. Args: entities: List of agents, teams, or workflows Raises: ValueError: If duplicate IDs are found """ if not entities: return ...
Review this code and list any quality issues.
[ { "issue": "Rather raise for all the duplicates at the end. Otherwise the user will get an error, then fix it, then another error on the next try, then fix it, etc.", "severity": "major", "line": 26 } ]
1
python
class ForgotPasswordCheckPayload(BaseModel): email: EmailStr = Field(...) code: str = Field(...) token: str = Field(...) class ForgotPasswordResetPayload(BaseModel): token: str = Field(...) new_password: str = Field(...) password_confirm: str = Field(...) @field_validator("new_password", ...
Review this code and list any quality issues.
[ { "issue": "`ForgotPasswordEmailResponse` does not match the actual response returned by `ForgotPasswordSendEmailApi.post()`: the handler returns only `{result, data}` (see return at line 115), but the schema includes an optional `code` field and makes `data` optional. To keep Swagger accurate, either remove `c...
1
python
"gn", ] # List of libraries that are dependencies of dependencies # These are in the manifest to fetch before the build but not explicitely versioned in vcpkg flatpak_deps_of_deps = [ "brotli", "dav1d", "highway", "libdwarf", "libxml2", "libyuv", "vulkan-memory-allocator", "zstd", ] # ...
Review this code and list any quality issues.
[ { "issue": "Does this mean that we're linking against whatever the kde runtime gives us for these libraries in terms of their versions? These are all pretty critical, wouldn't it be safer to build against the exact same versions as those in vcpkg.json?", "severity": "minor", "line": 26 } ]
1
python
return PinResponse(event_id=ret_msg.event_id, num_tokens=ret_msg.num_tokens) except Exception as e: raise HTTPException(status_code=500, detail=str(e)) from e class CompressRequest(BaseModel): instance_id: str method: str location: str tokens: Optional[List[int]]...
Review this code and list any quality issues.
[]
0
python
import os import numpy from setuptools import Extension, setup NUMPY_INCLUDE = numpy.get_include() setup( ext_modules=[ Extension( "qlib.data._libs.rolling", ["qlib/data/_libs/rolling.pyx"], language="c++", include_dirs=[NUMPY_INCLUDE], ), ...
Review this code and list any quality issues.
[]
0
python
class BoringModel(LightningModule): def __init__(self, in_features: int = 32, out_features: int = 2): """ Testing PL Module Use as follows: - subclass - modify the behavior for what you want class TestModel(BaseTestModel): def training_step(...): ...
Review this code and list any quality issues.
[ { "issue": "why not keep this in hparams??", "severity": "minor", "line": 26 } ]
1
python
self.to_screen(f'{video_id}: URL is invalid, skipping: {e.cause}') continue return { 'url': url, 'filesize': int_or_none(response.headers.get('Content-Length')) } def _raise_if_restricted(self, webpage): page_title = clean_html(get_ele...
Review this code and list any quality issues.
[ { "issue": "1. all of this \"details\" extraction should be moved down near the return for better code flow/readability\r\n2. `uploader_path` and `channel_path` are currently fatal because `get_element_html_by_class` can return `None` and throws when its html input is `None`\r\n3. matching `base_url` in `_VALID...
1
python
yield self.url_result(f'https://www.netverse.id/video/{slug}', NetverseIE) def parse_playlist(self, url, json_data, playlist_id): slug_sample = traverse_obj(json_data, ('related', 'data', ..., 'slug'))[0] season_id_list = [season.get('id') for season in json_data.get('seasons')] for season...
Review this code and list any quality issues.
[ { "issue": "The point of `_` is that it is unused. If you want to use it, give it a name!", "severity": "minor", "line": 26 } ]
1
python
def _s3_get_bytes_range(bucket_name: str, key: str, bytes_start: int, num_bytes: int, max_attempts: int = 2) -> bytes: from botocore.exceptions import ClientError err = None for _ in range(max_attempts): try: return s3_client.get_object( Bucket=bucket_name, Key=key, Rang...
Review this code and list any quality issues.
[ { "issue": "I didn't even know about the `raise from err` syntax.", "severity": "minor", "line": 26 } ]
1
python
from llava.constants import ( IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN, IMAGE_PLACEHOLDER, ) from llava.conversation import conv_templates, SeparatorStyle from llava.model.builder import load_pretrained_model from llava.utils import disable_torch_init from...
Review this code and list any quality issues.
[ { "issue": "these IFs that use two pipelines for processing single-image and multiple image conversation, seems unnecessary as the single image is just a special case of the multiple images, and \"<img_path>\".split(\"\") will just return a list that has a single element, no?", "severity": "minor", "lin...
1
python
from ..compat import compat_os_name from ..utils import ( PostProcessingError, XAttrMetadataError, XAttrUnavailableError, hyphenate_date, write_xattr, ) class XAttrMetadataPP(PostProcessor): """Set extended attributes on downloaded file (if xattr support is found) More info about extended...
Review this code and list any quality issues.
[ { "issue": "I know this is old/dead code but let's move this down to the end of the dict\r\n```suggestion\r\n```", "severity": "major", "line": 26 } ]
1
python
#!/usr/bin/env python3.6 name = "Łukasz" (f"hello {name}", F"hello {name}") (b"", B"") (u"", U"") (r"", R"") (rf"", fr"", Rf"", fR"", rF"", Fr"", RF"", FR"") (rb"", br"", Rb"", bR"", rB"", Br"", RB"", BR"") # output #!/usr/bin/env python3.6 name = "Łukasz" (f"hello {name}", f"hello {name}") (b"", b"") ("", "") (r...
Review this code and list any quality issues.
[ { "issue": "NIT: I feel we should just go to python3 here\r\n```suggestion\r\n#!/usr/bin/env python3\r\n```", "severity": "minor", "line": 15 } ]
1
python
client = aioredis.Redis(port=df_server.port) await client.execute_command("ACL SETUSER kostas ON >kk +@string +@scripting") await client.execute_command("AUTH kostas kk") admin_client = aioredis.Redis(port=df_server.port, decode_responses=True) script_task = asyncio.create_task(client.eval(script, 4, "...
Review this code and list any quality issues.
[ { "issue": "Also I don't remember here is if `asyncio.gather(f1, f2)` preserves argument order. That is, `f1` will execute `before f2`. If that's not the case we should force it. Worth checking the ordering imo -- thinking out loud", "severity": "minor", "line": 26 } ]
1
python
import collections from zipline.assets import Asset, Equity, Future from zipline.assets.futures import FutureChain from zipline.finance.asset_restrictions import Restrictions from zipline.finance.cancel_policy import CancelPolicy from zipline.pipeline import Pipeline from...
Review this code and list any quality issues.
[ { "issue": "should this just be `lstrip()`, or are tabs okay.", "severity": "minor", "line": 26 } ]
1
python
# functions and function_call are deprecated and are replaced by tools and tool_choice. # if both are provided, tools and tool_choice are used and functions and function_call are ignored. if tools: # TODO: add validate_tools params["tools"] = tools # TODO: add validat...
Review this code and list any quality issues.
[ { "issue": "if presence_penalty is not None:", "severity": "minor", "line": 26 } ]
1
python
# Same deal for columns. for name in colnames: col = getattr(generic_non_root, name) with self.assertRaises(ValueError): col.specialize(different_domain) do_checks(MyData, ['col1']) do_checks(MyDataSubclass, ['col1', 'col2']) class D(Dat...
Review this code and list any quality issues.
[]
0
python
if sub_tree == self: if not remainder.has_inverse: raise ValueError( "The shortcut cannot be computed since 'other' " "includes a non-invertible component") return remainder.inverted() # if we have got this far, ...
Review this code and list any quality issues.
[]
0
python
media_id = player_info.get('mediaId') if not media_id: clip_id = player_info['clipId'] feed = self._download_json( f'http://tpfeed.cbc.ca/f/ExhSPC/vms_5akSXx4Ng_Zn?byCustomValue={{:mpsReleases}}{{{clip_id}}}', clip_id, fatal=False) if feed: ...
Review this code and list any quality issues.
[ { "issue": "passing a `default` implies `fatal=False`\r\n```suggestion\r\n 'initial state', display_id, default={}, transform_source=js_to_json)\r\n```", "severity": "minor", "line": 26 } ]
1
python
in the format string. """ import subprocess import re import sys FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS = [ 'FatalErrorf,0', 'fprintf,1', 'tfm::format,1', # Assuming tfm::::format(std::ostream&, ... 'LogConnectFailure,1', 'LogError,0', 'LogWarning,0', 'LogInfo,0', 'LogDebug,1'...
Review this code and list any quality issues.
[ { "issue": "I think we can then also remove the `(\"src/dbwrapper.cpp\", \"vsnprintf(p, limit - p, format, backup_ap)\"),` in `FALSE_POSITIVES` in `run-lint-format-strings.py`?", "severity": "minor", "line": 26 } ]
1
python
import os from typing import Type from pydantic import BaseModel from cognee.infrastructure.llm.LLMGateway import LLMGateway from cognee.infrastructure.llm.config import ( get_llm_config, ) async def extract_content_graph(content: str, response_model: Type[BaseModel]): llm_config = get_llm_config() prom...
Review this code and list any quality issues.
[ { "issue": "Why do we need this if we can provide `graph_prompt_path` through `llm_config`?", "severity": "minor", "line": 14 } ]
1
python
created_at=memory.payload.get("created_at"), updated_at=memory.payload.get("updated_at"), ).model_dump(exclude={"score"}) # Add metadata if there are additional keys excluded_keys = {"user_id", "agent_id", "run_id", "hash", "data", "created_at", "updated_at"} additio...
Review this code and list any quality issues.
[]
0
python
scheduling_strategy=NodeAffinitySchedulingStrategy( worker_node_id, soft=False ), resources={"not_exist": 1}, ).remote() ray.get(actor.get_node_id.remote()) def test_node_affinity_scheduling_strategy_soft_spill_on_unavailable(ray_start_cluster): cluster = ra...
Review this code and list any quality issues.
[]
0
python
'id': '9DFPTnuYi8f2', 'ext': 'mp4', 'title': 'Bitcoin vs The Lighting Network', 'thumbnail': r're:https://res\.cloudinary\.com/.+\.png', 'description': '', 'uploader': 'Tom Bombadil (Freddy78)', } }, { 'url': 'https://streamanity.com/video/...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'https://stream.mux.com/%s.m3u8?token=%s' % (video_info['play_id'], video_info['token']),\r\n```\r\n\r\nthat was my mistake. this should fix it", "severity": "minor", "line": 26 } ]
1
python
# flake8: noqa # ignore the imports import os import pathlib from typing import Any, List, TypeAlias import openapi_spec_validator import pytest import requests from langchain.text_splitter import CharacterTextSplitter from langchain_core.embeddings import Embeddings from llama_index.core.embeddings import BaseEmbeddi...
Review this code and list any quality issues.
[ { "issue": "This part needs to be reformatted according to `isort`:\r\n\r\n```python\r\nfrom pathway.xpacks.llm.document_store import DocumentStoreClient\r\nfrom pathway.xpacks.llm.question_answering import BaseRAGQuestionAnswerer, RAGClient\r\nfrom pathway.xpacks.llm.tests.mocks import FakeChatModel, fake_embe...
1
python
"""The country code for this domain. Returns ------- code : str The two-character country iso3166 country code for this domain. """ def data_query_cutoff_for_sessions(self, sessions): """Compute the data query cutoff time for the given sessions. Paramet...
Review this code and list any quality issues.
[ { "issue": "Thoughts on renaming this to `adjust_forward` or `roll_forward`? `adjust` doesn't tell me as a reader which way the adjustment goes.", "severity": "minor", "line": 26 } ]
1
python
'view_count': ('cnt_info', 'play', {int_or_none}), 'like_count': ('cnt_info', 'thumb_up', {int_or_none}), }))) class BilibiliWatchlaterIE(BilibiliSpaceListBaseIE): _VALID_URL = r'https?://www\.bilibili\.com/watchlater/?(?:[?#]|$)' _TESTS = [{ 'url': 'https://www.bilibili.com/watchl...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n _VALID_URL = r'https?://www\\.bilibili\\.com/(?:medialist/play|list)/(?P<id>\\w+)'\r\n```", "severity": "minor", "line": 26 } ]
1
python
from re import finditer from urllib.parse import urljoin from .common import InfoExtractor from ..utils import join_nonempty, unified_timestamp class CamFMBaseIE(InfoExtractor): def _absolute_url(self, path, root='https://camfm.co.uk'): return urljoin(root, path) class CamFMShowIE(CamFMBaseIE): _VA...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\nimport re\r\nimport urllib.parse\r\n```\r\n\r\nWe use from imports only for internal modules for clarity", "severity": "minor", "line": 2 } ]
1
python
try: os.makedirs(destination, mode=0o700) except FileExistsError: pass if timeout is None: timeout = settings.ANSIBLE_FACT_CACHE_TIMEOUT last_filepath_written = None for host in hosts: if not host.ansible_facts_modified or (timeout and host.ansible_facts_modified < now...
Review this code and list any quality issues.
[ { "issue": "I still expect that this won't work. Again, when going through the `for host in hosts:` loop, many hosts will hit the `continue` statement before here, meaning they won't get into the list. Really, if you run this for the first time, **no** hosts will be in the list, and I legitimately think it will...
1
python
entries = [] # Bandcamp User type 1 page discography_data = re.findall( r'<li data-item-id="([^"]+)[^>]+>\s*<a href="(/[^/]+/[^/"]+)">', webpage, re.MULTILINE, ) if len(discography_data) > 0: for match in discography_data: ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n entries = [self.url_result(urljoin(url, element_url)) for element_id, element_url in discography_data]\r\n```\r\nReturn id and title only if they are actually correct", "severity": "minor", "line": 26 } ]
1
python
from .common import InfoExtractor from ..utils import clean_html from ..utils.traversal import find_element, traverse_obj class UMGDeIE(InfoExtractor): IE_NAME = 'umg:de' IE_DESC = 'Universal Music Deutschland' _VALID_URL = r'https?://(?:www\.)?universal-music\.de/[^/]+/videos/(?P<id>[^/?#]+)' _TESTS...
Review this code and list any quality issues.
[ { "issue": "It's better to match the video `id` directly from the URL when possible, since this makes download archive functionality more efficient (extraction can be skipped altogether if the `id` is already recorded in the archive)\r\n\r\n```suggestion\r\n _VALID_URL = r'https?://(?:www\\.)?universal-music...
1
python
@classmethod def _create_response_message_content( cls: type[_T], response: Response, ai_model_id: str | None = None, name: str | None = None, ) -> "ChatMessageContent": """Create a chat message content object from a choice.""" metadata = cls._get_metadata_from_re...
Review this code and list any quality issues.
[ { "issue": "does this need to be in the class, can't we just separate the _get_metadata..., _collect_items and this function as loose functions?", "severity": "minor", "line": 26 } ]
1
python
for player_url in traverse_obj(player_urls, lambda _, v: url_or_none(v['url'])): url = player_url['url'] format_type = player_url.get('type') if format_type in ('hls', 'hls_live', 'live_ondemand_hls', 'live_playback_hls'): formats.extend(self._extract_m3u8_formats(url...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n auth_data = json.loads(urllib.parse.unquote(auth_cookie.value))\r\n```\r\n\r\nchange import as well", "severity": "critical", "line": 26 } ]
1
python
# choose to localize their reason strings. If the string # isn't utf-8, we fall back to iso-8859-1 for all other # encodings. try: reason = resp.reason.decode("utf-8") except UnicodeDecodeError: reason = resp.reason.decode("iso-8859-1") else: reason = ...
Review this code and list any quality issues.
[ { "issue": "please make this a constant somewhere", "severity": "minor", "line": 26 } ]
1
python
sandbox_runtime_container_image: str | None = None mcp_config: dict | None = None sandbox_api_key: str | None = None max_budget_per_task: float | None = Field(default=None, gt=0) enable_solvability_analysis: bool | None = None v1_enabled: bool | None = None # LLM settings (require admin/owner r...
Review this code and list any quality issues.
[ { "issue": "🔴 **Critical: Breaking API Change**\n\nThis field rename changes the JSON response from `role_name` to `role` for the following API endpoints:\n- `GET /orgs/{org_id}/members` (returns `OrgMemberPage` containing list of `OrgMemberResponse`)\n- `PATCH /orgs/{org_id}/members/{user_id}` (returns `OrgMe...
1
python
class JobJobEventsList(BaseJobEventsList): parent_model = models.Job pagination_class = UnifiedJobEventPagination def get_queryset(self): job = self.get_parent_object() self.check_parent_access(job) return job.get_event_queryset().select_related('host').order_by('start_line') cla...
Review this code and list any quality issues.
[ { "issue": "value includes something else now", "severity": "minor", "line": 26 } ]
1
python
webpage, 'view count', fatal=False)) like_count = str_to_int(self._html_search_regex( (r'>([\d,.]+)\s+Favorites<', r'<strong>Favorited</strong>\s+([^<]+)<'), webpage, 'like count', fatal=False)) upload_date = unified_strdate(self._search_regex( r'class=[...
Review this code and list any quality issues.
[ { "issue": "why change this? was the more relaxed regex causing problems? if not, it should be reverted. is it important to reverse the order? then only reverse the order, don't change the patterns", "severity": "minor", "line": 26 } ]
1
python
# Copyright (c) MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # 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, so...
Review this code and list any quality issues.
[ { "issue": "Thanks for the quick fix. Is there any reason that you are not importing from `collections.abc` here?", "severity": "minor", "line": 16 } ]
1
python
self._entered_count -= 1 if self._entered_count == 0 and self._exit_stack is not None: await self._exit_stack.aclose() self._exit_stack = None async def get_tools(self, ctx: RunContext[AgentDepsT]) -> dict[str, ToolsetTool[AgentDepsT]]: toolsets_tools = await asy...
Review this code and list any quality issues.
[ { "issue": "I don't think we need it here as it's already on the `source_tool` that the `FunctionToolset` will see", "severity": "minor", "line": 26 } ]
1
python
assert res.rows[0] == ["t1", "hello"] # load t2 req = aggregations.AggregateRequest("*").load("t2") res = client.ft().aggregate(req) assert res.rows[0] == ["t2", "world"] # load all req = aggregations.AggregateRequest("*").load() res = client.ft().aggregate(req)...
Review this code and list any quality issues.
[]
0
python
"""Converts the collected texts and tool calls into a single OpenAI `ChatCompletionAssistantMessageParam`. This method serves as a hook that can be overridden by subclasses to implement custom logic for how collected parts are transformed into the final message parameter. Returns: ...
Review this code and list any quality issues.
[ { "issue": "The if and elif repeat `and self.thinkings`, so let's pull it up into its own `if`", "severity": "minor", "line": 26 } ]
1
python
queryset = self.get_queryset() try: obj = self.find_object(queryset, request) if obj is None: raise self.model.DoesNotExist except self.model.DoesNotExist: raise Http404("not found") # Generate redirect url = get_object_detail_url( ...
Review this code and list any quality issues.
[ { "issue": "I'm not sure which one is better:\r\n1. retain all query parameters in `request.GET` except ones used for finding the object i.e. `html_path` in this case, or\r\n2. only retain `fields` explicitly and disregard all other parameters\r\n\r\nIn practice it doesn't really matter because I believe `field...
1
python
partition_input_names = ( OrderedSet( [ x.name for x in read_writes.reads | read_writes.writes if not is_none_layout(x.name) ] ) - output_names ) partition_input_names = Order...
Review this code and list any quality issues.
[]
0
python
field_name, OperationDependency.Type.ALTER, ), ) for name in sorted(related_fields): dependencies.append( OperationDependency( app_label, model_name, name, Operati...
Review this code and list any quality issues.
[]
0
python
help=( "Python versions that should be supported by Black's output. [default: per-file" " auto-detection]" ), ) @click.option( "--pyi", is_flag=True, help=( "Format all input files like typing stubs regardless of file extension (useful" " when piping source on standard in...
Review this code and list any quality issues.
[ { "issue": "A bit jarring to write `--python-cell-magics custom1 --python-cell-magics custom2`. Should we use a comma-separated list instead?", "severity": "minor", "line": 26 } ]
1
python
# Test Empty Dic invalid_config = {} with self.assertRaises(Exception): Config(invalid_config) # Test Invalid Outer Keys invalid_config = {"": ""} with self.assertRaises(Exception): Config(invalid_config) # Test Inner Dictionary invalid_...
Review this code and list any quality issues.
[]
0
python
""" num_removed = 0 for key in keys: num_removed += self.remove(key, force=force) return num_removed @abc.abstractmethod def get_allocator_backend(self) -> "AllocatorBackendInterface": """ Get the allocator backend that is used by the current storage backend ...
Review this code and list any quality issues.
[ { "issue": "If you remove this here, you'd better remove it within remote_backend too.", "severity": "major", "line": 26 } ]
1
python
'info_dict': { 'id': 'e14223c3-7871-ef11-bdfd-000d3a980db3', 'ext': 'm4a', 'view_count': int, 'upload_date': '20240913', 'uploader_id': 'phantommusicofficial', 'timestamp': 1726194897, 'uploader': 'Phantom', 'comment_count':...
Review this code and list any quality issues.
[ { "issue": "not sure if it would be worth it, but alternatively we could add something like a `url_type` capture group to the `_VALID_URL` patterns", "severity": "minor", "line": 26 } ]
1
python
loader_str = unescapeHTML(self._search_regex(r"data-(?:new-)?hr-mediaplayer-loader='([^']*)'", webpage, "ardloader")) loader_data = json.loads(loader_str) info = { 'id': video_id, 'title': title, 'description': description, 'formats': self.extract_formats...
Review this code and list any quality issues.
[ { "issue": "why so complicated?\r\n```py\r\ninfo['thumbnail'] = self._search_regex(..., default=None)\r\n```", "severity": "minor", "line": 26 } ]
1
python
} if any(unsupported): raise ValueError( f"'resume_from' is not supported to be used with the with following parameters: {unsupported}. " ) resume_from = resume_from.name if isinstance(resume_from, Run) else resume_from return self....
Review this code and list any quality issues.
[ { "issue": "add some comment here on this check", "severity": "minor", "line": 26 } ]
1
python
class Porn91IE(InfoExtractor): IE_NAME = '91porn' _VALID_URL = r'(?:https?://)(?:www\.|)91porn\.com/.*([\?&])viewkey=(?P<id>[\w\d]+)' _TESTS = [{ 'url': 'http://91porn.com/view_video.php?viewkey=7e42283b4f5ab36da134', 'md5': 'd869db281402e0ef4ddef3c38b866f86', 'info_dict': { ...
Review this code and list any quality issues.
[ { "issue": "Wrong. Either test def is wrong, or you need to use `_extract_m3u8_formats_and_subtitles` in code", "severity": "critical", "line": 26 } ]
1
python
from typing import Dict, List from facefusion.types import Color, WebcamMode from facefusion.uis.types import JobManagerAction, JobRunnerAction, PreviewMode job_manager_actions : List[JobManagerAction] = [ 'job-create', 'job-submit', 'job-delete', 'job-add-step', 'job-remix-step', 'job-insert-step', 'job-remove-step'...
Review this code and list any quality issues.
[ { "issue": "why is there no alpha channel here?", "severity": "minor", "line": 17 } ]
1
python
False """ # todo: find a better way than try / except try: return find_spec(module_path) is not None except AttributeError: # Python 3.6 return False except ModuleNotFoundError: # Python 3.7+ return False _IS_WINDOWS = platform.system() == "Windows" _APEX_A...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n_TORCH_GREATER_EQUAL_1_6 = LooseVersion(torch.__version__) >= LooseVersion(\"1.6.0\")\r\n_FAIRSCALE_PIPE_AVAILABLE = (\r\n _FAIRSCALE_AVAILABLE and _TORCH_GREATER_EQUAL_1_6\r\n and _get_version('fairscale') <= LooseVersion(\"0.1.3\")\r\n)\r\n```", "severity": "minor", ...
1
python
elif mobj.group('config'): config_url = url + '&form=json' config_url = config_url.replace('swf/', 'config/') config_url = config_url.replace('onsite/', 'onsite/config/') config = self._download_json(config_url, video_id, 'Downloading config') if 'releaseUrl' ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n m3u8_fmts, m3u8_subs = self._extract_m3u8_formats_and_subtitles(\r\n m3u8_url, video_id, m3u8_id='hls', fatal=False)\r\n```", "severity": "major", "line": 26 } ]
1
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": "Nice consolidation of the cases", "severity": "minor", "line": 26 } ]
1
python
---------- number The numeric value to be displayed. It can later be modified using `.set_value()`. num_decimal_places The number of decimal places after the decimal separator. Values are automatically rounded. mob_class The class for rendering digits and units, by default `MathTex`....
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n Size of the font.\r\n```", "severity": "minor", "line": 26 } ]
1
python
usage: PROG [-h] (--foo FOO | --bar BAR) ''' usage_when_not_required = '''\ usage: PROG [-h] [--foo FOO | --bar BAR] ''' help = '''\ options: -h, --help show this help message and exit --foo FOO --bar BAR ''' class TestMutuallyExclusivePo...
Review this code and list any quality issues.
[]
0
python
{ "values": {"list": ["Hello", " World!"]}, "format": "{% for item in list %}{{ item }}{% endfor %}", }, { "values": {}, "format": "{% set name = 'Alice' %}Hello, World! {{ name }}", }, ...
Review this code and list any quality issues.
[]
0
python
} }, { 'url': 'https://funker530.com/video/my-friends-joined-the-russians-civdiv/', 'md5': '', 'info_dict': { 'id': '', 'ext': 'mp4', 'title': 'My “Friends” Joined the Russians - CivDiv', 'thumbnail': r're:^https?://.*\.jpg$', 'uplo...
Review this code and list any quality issues.
[ { "issue": "Is converting it to a list okay if there's only one video? Do I need to do all found videos or is `[0]` ok? There should only be one embedded video on the page.", "severity": "minor", "line": 26 } ]
1
python
_VIDEO_ID_REGEX = r'videoId\s*=\s*"(\d+)"' class TV8ItIE(SkyItVideoIE): # XXX: Do not subclass from concrete IE IE_NAME = 'tv8.it' _VALID_URL = r'https?://(?:www\.)?tv8\.it/(?:show)?video/[0-9a-z-]+-(?P<id>\d+)' _TESTS = [{ 'url': 'https://www.tv8.it/video/ogni-mattina-ucciso-asino-di-andrea-lo-c...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n IE_NAME = 'tv8.it:live'\r\n IE_DESC = 'TV8 Live'\r\n```", "severity": "minor", "line": 26 } ]
1
python
extract ASCII and UTF-16 LE strings from file """ for s in capa.features.extractors.strings.extract_ascii_strings(buf): yield String(s.s), FileOffsetAddress(s.offset) for s in capa.features.extractors.strings.extract_unicode_strings(buf): yield String(s.s), FileOffsetAddress(s.offset) def...
Review this code and list any quality issues.
[]
0
python
m = special.ndtri((i - 3 / 8) / (n + 1 / 4)) u = n**(-0.5) mTm = xp.vecdot(m, m) c = mTm**(-0.5) * m mnm1, mn = m[..., -2], m[..., -1] cnm1, cn = c[..., -2], c[..., -1] an = (cn + 0.221157*u - 0.147981*u**2 - 2.071190*u**3 + 4.434685*u**4 - 2.706056*u**5) anm1 = (cnm1 + 0.042981*u ...
Review this code and list any quality issues.
[ { "issue": "<img width=\"1129\" height=\"78\" alt=\"image\" src=\"https://github.com/user-attachments/assets/5c96c576-f446-4d9f-8fd5-2734f3971537\" />", "severity": "minor", "line": 26 } ]
1
python
temp_file.flush() media_type = detect_media_type(temp_file.name) temp_path = state_manager.get_temp_path() asset_path = os.path.join(temp_path, temp_file.name + '.' + upload_file_extension) process_manager.start() if media_type == 'audio' and ffmpeg.sanitize_audio(temp_file.name, asset_path): asse...
Review this code and list any quality issues.
[ { "issue": "get_asset and get_assets are essential the same, just that one is filtered by id...\n\nthat means if you create an internal API that always works with a list, the code is much simpler cause then you are using [ asset_id ] to make it uniform", "severity": "minor", "line": 26 } ]
1
python
def parse_args(self, test_file): previous_releases_path = os.getenv("PREVIOUS_RELEASES_DIR") or os.getcwd() + "/releases" parser = argparse.ArgumentParser(usage="%(prog)s [options]") parser.add_argument("--nocleanup", dest="nocleanup", default=False, action="store_true", ...
Review this code and list any quality issues.
[ { "issue": "Is it really useful to map one exception type to another for a test-only dev-only debug-only feature? I'd say it seems fine to just use the python built-in exceptions, which should be self-explanatory. I understand that they won't print the method name, but it could make sense to log that either way...
1
python
class Integer(DecimalNumber): """A class for displaying Integers. Examples -------- .. manim:: IntegerExample :save_last_frame: class IntegerExample(Scene): def construct(self): self.add(Integer(number=2.5).set_color(ORANGE).scale(2.5).set_x(-0.5).set_y(0.8...
Review this code and list any quality issues.
[ { "issue": "Line length.\r\n\r\n```suggestion\r\n \"\"\"A class for displaying text that shows \"label = value\" with\r\n the value continuously updated from a :class:`~.ValueTracker`.\r\n```", "severity": "minor", "line": 26 } ]
1
python
If `lmbda` is not None, do the transformation for that value. alpha : float, optional If `lmbda` is None and `alpha` is not None (default), return the ``100 * (1-alpha)%`` confidence interval for `lmbda` as the third output argument. Must be between 0.0 and 1.0. If `lmbda` is not ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n nan_policy : {'propagate', 'omit', 'raise'}\r\n```", "severity": "minor", "line": 26 } ]
1
python
"""Contains utilities to flag a feature as "experimental" in datasets.""" import warnings from functools import wraps from typing import Callable def experimental(fn: Callable) -> Callable: """Decorator to flag a feature as experimental. An experimental feature trigger a warning when used as it might be subj...
Review this code and list any quality issues.
[]
0
python
st.container(key="markdown_complex_tooltip").markdown( "Tooltip with complex markdown", help="""**Bold**, *italic*, and `code` with brackets [x] Links: [Streamlit](https://streamlit.io) Colors: :red[red] :blue[blue] Emoji: 🎉 Array: array[index] Dict: dict[key]""", ) # Custom color directive tests st.header(...
Review this code and list any quality issues.
[ { "issue": "This line is likely over the repo’s Ruff formatting limit (`pyproject.toml` sets `[tool.ruff].line-length = 88`) and will get wrapped by `ruff format`. Please split this `st.container(...).markdown(...)` call across multiple lines like the surrounding examples to keep formatting stable.\n```suggesti...
1
python
# Map of coin ID to SpendConditions spend_conditions = {bytes32(spend.coin_id): spend for spend in conds.spends} if len(new_spend.coin_spends) != len(spend_conditions): # if this happens, the SpendBundle doesn't match the # SpendBundleConditions. return Err.INVALID_S...
Review this code and list any quality issues.
[ { "issue": "Same thing here, the default value suggests that `eligibility_and_additions` may not have the coin ID in it. Which I think would be some internal error or an invalid `SpendBundle`. The new version fails with `Err.INVALID_SPEND_BUNDLE` if this happens", "severity": "critical", "line": 26 } ...
1
python
'formats': formats, }) if len(playlist) == 1: info = playlist[0] info['id'] = video_id else: info = { '_type': 'multi_video', 'entries': playlist, 'id': video_id, 'title': title, ...
Review this code and list any quality issues.
[ { "issue": "Sometimes it is better to only expect `str` instead of transform with `str_or_none` -- e.g. if the value of `subName` is a nested dict, we would be stringifying the entire dict with `str_or_none`. With `str`, it only checks the type and returns `None` if it is not what is expected\r\n```suggestion\r...
1
python
help="Number of concurrent requests to make to the RPC endpoints", type=int, default=DEFAULT_REQUESTS_PER_BATCH, ) def cli( root_path: str, rpc_port: Optional[int], spends_with_conditions: bool, block_spends: bool, additions_and_removals: bool, concurrent_requests: int, start_height:...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n concurrent_requests = max(concurrent_requests, requests_per_batch)\r\n```\r\nI'm not sure what you intended by this division, but I imagine you'd want a lower cap on the batch-size", "severity": "major", "line": 26 } ]
1
python
level="info", handling="auto", value=None, ) ] ), ) ] ) await hass.async_block_till_done() state = hass.states.get(entity_id) assert state assert state.state != ST...
Review this code and list any quality issues.
[ { "issue": "Please follow PEP8 for docstrings. Lines should be shorter than 72 characters. The first line is a header. The header should be a single sentence and fit on the first line. After the header an optional body may follow, separated from the header by a blank line. The body may be multiple sentences and...
1
python
def _get_owned_tickets(self, video_id): for url, name in [ ('https://asobistage-api.asobistore.jp/api/v1/purchase_history/list', 'ticket purchase history'), ('https://asobistage-api.asobistore.jp/api/v1/serialcode/list', 'redemption history'), ]: yield from traverse_o...
Review this code and list any quality issues.
[ { "issue": "we should check if it's not a supported url before doing anything else, and include the unsupported type in the error output\r\n```suggestion\r\n video_type_id = {\r\n 'archive': 'archives',\r\n 'player': 'broadcasts',\r\n }.get(video_type_name)\r\n if not ...
1
python
class ExportDataJsonKwargs(TypedDict): """Keyword arguments for dataset's `export_data_json` method. Args: ensure_ascii: Whether non-ASCII characters should be escaped in the output JSON string. indent: Specifies the number of spaces to use for indentation in the pretty-printed JSON output. ...
Review this code and list any quality issues.
[ { "issue": "Could we please include all possible kwargs for the json/csv dumps?", "severity": "minor", "line": 26 } ]
1
python
if libc_ver < (2, 35): return EXE_MSG_TMPL.format('system glibc version < 2.35', 'issues/13858', STOP_MSG) return None return f'Support for Python version {major}.{minor} has been deprecated. {PYTHON_MSG}' def _get_version_age_warning(): # Only yt-dlp guarantees a stable release at least ...
Review this code and list any quality issues.
[ { "issue": "since we are suppressing all Exceptions and this code is only running for releases where we control the version number, what if we simplified/condensed this a little bit?\r\n```suggestion\r\n with contextlib.suppress(Exception):\r\n last_updated = dt.date(*version_tuple(__version__)[:3])\r...
1
python
def test_create_parser_kwargs(self): """BaseCommand.create_parser() passes kwargs to CommandParser.""" epilog = "some epilog text" parser = BaseCommand().create_parser( "prog_name", "subcommand", epilog=epilog, formatter_class=ArgumentDefaultsHelpF...
Review this code and list any quality issues.
[ { "issue": "Can you tell me the reason this line is needed?", "severity": "minor", "line": 26 } ]
1
python
def test_asarray_xarray_intersphinx_workaround(): # test that the intersphinx workaround in https://github.com/pydata/xarray/issues/4279 works module = xr.DataArray.__module__ try: xr.DataArray.__module__ = "xarray" y = da.asarray(xr.DataArray([1, 2, 3.0])) assert isinstance(y, da.Ar...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\ndef test_polyfit_reshaping():\r\n # Regression test for https://github.com/pydata/xarray/issues/4554\r\n```", "severity": "minor", "line": 26 } ]
1
python
msg='Inventory {inventory_id} host facts: updated {updated_ct}, cleared {cleared_ct}, unchanged {unmodified_ct}, took {delta:.3f} s', add_log_data=True, ) def finish_fact_cache(destination, log_data, job_id=None, inventory_id=None): log_data['inventory_id'] = inventory_id log_data['updated_ct'] = 0 log_...
Review this code and list any quality issues.
[ { "issue": "This materializes all the ansible facts for all the hosts in the inventory into memory.\r\n\r\nWith the current structure, I believe you can avoid that by simply removing the `list(` and adding an `.iterator()` to the queryset. It won't load the queryset into memory right away. And the iterator allo...
1
python
) ) # Alpaca default template register_conv_template( Conversation( name="alpaca", system="Below is an instruction that describes a task. Write a response that appropriately completes the request.", roles=("### Instruction", "### Response"), messages=(), offset=0, se...
Review this code and list any quality issues.
[]
0
python
class JablePlaylistIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?jable.tv/(?:categories|models|tags)/(?P<id>[\w-]+)' _TESTS = [{ 'url': 'https://jable.tv/models/kaede-karen/', 'info_dict': { 'id': 'kaede-karen', 'title': '楓カレン', }, 'playlist_count':...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n self.url_result(player_url, JableIE)\r\n```", "severity": "minor", "line": 26 } ]
1
python
x = 123456789 x = 123456 x = .1 x = 1. x = 1E+1 x = 1E-1 x = 1.000_000_01 x = 123456789.123456789 x = 123456789.123456789E123456789 x = 123456789E123456789 x = 123456789J x = 123456789.123456789J x = 0XB1ACC x = 0B1011 x = 0O777 x = 0.000000006 x = 10000 x = 133333 # output x = 123456789 x = 123456 x = 0.1 x = 1.0 x ...
Review this code and list any quality issues.
[]
0
python
Polars: Blazingly fast DataFrames in Python ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Polars is a fast, open-source library for data manipulation with an expressive, typed API. Basic usage: >>> import polars as pl >>> df = pl.DataFrame({ ... "name": ["Alice", "Bob", "Charlie"], ... "age": [25,...
Review this code and list any quality issues.
[ { "issue": "You can leave off the final `reference/`, and get the right redirect regardless.", "severity": "minor", "line": 26 } ]
1
python
self._rect.y + 16 + scroll_offset, self._title_header.rect.width, self._title_header.rect.height, )) self._warning_label.render(rl.Rectangle( self._rect.x + 16, self._title_header.rect.y + self._title_header.rect.height + 16, self._rect.width - 32, self._warning_label.get_co...
Review this code and list any quality issues.
[ { "issue": "@deanlee does it make sense to always use weak refs for callbacks? Something generic that completely prevents this from happening again", "severity": "minor", "line": 26 } ]
1
python
'timestamp': 1676339547, 'upload_date': '20230214', 'thumbnail': r're:https://learn\.microsoft\.com/video/media/.*\.png', 'subtitles': 'count:14', }, }] def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url,...
Review this code and list any quality issues.
[ { "issue": "do it like this or else you could get `'url': False`\r\n```suggestion\r\n 'thumbnails': ('publicVideo', 'thumbnailOtherSizes', ..., {'url': {url_or_none}}),\r\n```", "severity": "minor", "line": 26 } ]
1
python
return [] # we don't need these if name.startswith("cls.predictions"): return [] if name.startswith("cls.seq_relationship"): return [] if self.cls_out_labels: # For BertForSequenceClassification (direct projection layer) if name == "classifier.w...
Review this code and list any quality issues.
[]
0
python
particles_idx_local : torch.Tensor, shape (n_in_bbox,) Local particle indices within the bounding box. """ bbox_min = torch.tensor(bbox_min, dtype=gs.tc_float, device=gs.device) bbox_max = torch.tensor(bbox_max, dtype=gs.tc_float, device=gs.device) # Get particle positions (...
Review this code and list any quality issues.
[ { "issue": "Do not pass link but rather link_idx. We do not want to pass complex objects as input arguments. It is just asking for trouble in terms of memory management, and it is harder to keep track of the simulation state.", "severity": "major", "line": 26 } ]
1
python
"layers.{bid}.attention.wq_a", # mistral-large ), MODEL_TENSOR.ATTN_Q_B: ( "model.layers.{bid}.self_attn.q_b_proj", # deepseek2 "layers.{bid}.attention.wq_b", # mistral-large ), MODEL_TENSOR.ATTN_KV_A_MQA: ( "model.layers.{bid}.se...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n MODEL_TENSOR.ATTN_KV_B: (\n \"model.layers.{bid}.self_attn.kv_b_proj\", # deepseek2\n ),\n\n MODEL_TENSOR.ATTN_K_B: (\n \"model.layers.{bid}.self_attn.k_b_proj\", # deepseek2\n \"layers.{bid}.attention.k_b_proj\", # mistra...
1
python
yield self._set_webpage_url(self._parse_video_data(video_data)) def _real_extract(self, url): display_id = self._match_id(url) profile_data = self._download_json( urljoin('https://api.allstar.gg/v1/users/profile/', display_id), display_id) user_id = traverse_...
Review this code and list any quality issues.
[ { "issue": "With the change from above of renaming `view` to `query_id`\r\n```suggestion\r\n user_id, f'{username or display_id} - {query_id}')\r\n```", "severity": "minor", "line": 26 } ]
1
python
class ParquetDataNode(DataNode, _FileDataNodeMixin, _TabularDataNodeMixin): """Data Node stored as a Parquet file. The *properties* attribute can contain the following optional entries: - *default_path* (`str`): The default path of the Parquet file used at the instantiation of the data node. -...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n The parameters in *\"write_kwargs\"* have a **higher precedence** than the\r\n top-level parameters which are also passed to Pandas.\r\n```", "severity": "minor", "line": 26 } ]
1
python
"apache_kafka", "apple_tv", "apprise", "aprilaire", "aprs", "apsystems", "aquacell", "aqualogic", "aquostv", "aranet", "arcam_fmj", "arest", "arris_tg2492lg", "aruba", "arve", "arwn", "aseko_pool_live", "assist_pipeline", "asterisk_mbox", "asus...
Review this code and list any quality issues.
[]
0
python
""" from ... import core as tp return tp.unsubscribe_sequence(callback, params, self) def submit( self, callbacks: Optional[List[Callable]] = None, force: bool = False, wait: bool = False, timeout: Optional[Union[float, int]] = None, **properties, ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n If not provided and *wait* is True, the function waits indefinitely.\r\n```", "severity": "minor", "line": 26 } ]
1
python
# transform inputs into Llama2 format messages_to_prompt=prompt_style.messages_to_prompt, completion_to_prompt=prompt_style.completion_to_prompt, verbose=True, ) case "sagemaker": try: from priva...
Review this code and list any quality issues.
[]
0
python
""" scene, liquid = sph_scene sph_solver = scene.sph_solver n_particles = sph_solver.n_particles # Get initial positions for comparison initial_pos = liquid.get_particles_pos().clone() # Run simulation for a few steps num_steps = 5 max_velocities = [] for step in range(num_steps):...
Review this code and list any quality issues.
[ { "issue": "Remove these comments, they do not bring any value. It is already clear from the assert itself.", "severity": "minor", "line": 26 } ]
1
python
scene.get_state() for i in range(1500): scene.step() final_mpm_cube_pos = mpm_cube.get_particles_pos() final_cloth_pos = cloth.get_particles_pos() final_water_pos = water.get_particles_pos() # check if the positions are changed assert (init_mpm_cube_pos - final_mpm_cube_pos).abs().sum(...
Review this code and list any quality issues.
[ { "issue": "You should flag this test as slow if it is (>200s). Beware that it means that it will only run on production CI, so only do this if necessary.", "severity": "major", "line": 26 } ]
1
python
assert exc_info.value.translation_placeholders == {"error": error} async def test_alexa_unique_id_migration( hass: HomeAssistant, mock_amazon_devices_client: AsyncMock, mock_config_entry: MockConfigEntry, device_registry: dr.DeviceRegistry, entity_registry: er.EntityRegistry, ) -> None: """Tes...
Review this code and list any quality issues.
[ { "issue": "The test is changing the parameter order incorrectly. The original code had the correct parameter order: `entity_registry.async_get_or_create(SWITCH_DOMAIN, DOMAIN, ...)` where SWITCH_DOMAIN is the entity domain (\"switch\") and DOMAIN is the integration platform (\"alexa_devices\").\n\nThis change ...
1
python
@dataclass class AGUIEventStream(UIEventStream[RunAgentInput, BaseEvent, AgentDepsT, OutputDataT]): """UI event stream transformer for the Agent-User Interaction (AG-UI) protocol.""" _thinking_text: bool = False _builtin_tool_call_ids: dict[str, str] = field(default_factory=dict) _error: bool = False ...
Review this code and list any quality issues.
[ { "issue": "Does AG-UI document this should be in ms precision?", "severity": "minor", "line": 26 } ]
1
python
def get_simulated_impact(self, order, current_price, current_volume, txn_volume, mean_volume, volatility): eta = self._eta[order.asset.roo...
Review this code and list any quality issues.
[ { "issue": "This should probably also mention that it executes the full order immediately.", "severity": "minor", "line": 26 } ]
1
python
class StreamForm(WagtailAdminModelForm): class Meta: model = JSONMinMaxCountStreamModel fields = ["body"] defer_required_on_fields = ["body"] form_data = nested_form_data( { "body": streamfield( [ ...
Review this code and list any quality issues.
[]
0
python
UptimeKumaSensorEntityDescription( key=UptimeKumaSensor.PORT, translation_key=UptimeKumaSensor.PORT, entity_category=EntityCategory.DIAGNOSTIC, value_fn=lambda m: m.monitor_port, create_entity=lambda t: t in HAS_PORT, ), UptimeKumaSensorEntityDescription( key=Upti...
Review this code and list any quality issues.
[ { "issue": "The state_class for uptime ratio sensors should be MEASUREMENT, not TOTAL. These sensors represent the current uptime percentage over a period (1/30/365 days), which is a measurement at the present time, not a cumulative total. TOTAL state_class is intended for cumulative values like total energy co...
1