language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
def test_argument_parsing__languages(self): parsed_args = YouTubeTranscriptCli('v1 v2 --languages de en'.split())._parse_args() self.assertEqual(parsed_args.video_ids, ['v1', 'v2']) self.assertEqual(parsed_args.json, False) self.assertEqual(parsed_args.languages, ['de', 'en']) def t...
Review this code and list any quality issues.
[]
0
python
self.raise_geo_restricted(countries=self._GEO_COUNTRIES, metadata_available=True) self.raise_no_formats(msg, expected=True) self._sort_formats(formats) subtitles = None lyric = item.get('lyric') if lyric: subtitles = { 'origin': [{ ...
Review this code and list any quality issues.
[ { "issue": "`_proto_relative_url` appends `http:`, so it should be left unchanged", "severity": "minor", "line": 26 } ]
1
python
return self._search_regex(rf'^(?:https?://(?:www\.)?youtube\.com)?/({self._YT_CHANNEL_UCID_RE})', url, 'channel id', default=None) @functools.cached_property def _preferred_lang(self): """ Returns a language code supported by YouTube for the user preferred lang...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n socs = self._youtube_cookies.get('SOCS')\r\n```", "severity": "minor", "line": 26 } ]
1
python
"""Whether to run the browser in headless mode. Currently primarily for Playwright-based features. This option is passed directly to Playwright's `browser_type.launch` method as `headless`. For more details, refer to the Playwright documentation: https://playwright.dev/docs/api/class-browsertype#browser-typ...
Review this code and list any quality issues.
[ { "issue": "I think it's safe to just drop this and never look back.", "severity": "minor", "line": 26 } ]
1
python
'description': 'md5:d41d8cd98f00b204e9800998ecf8427e', 'thumbnail': 'https://cdn.jwplayer.com/v2/media/sEIWvKR7/poster.jpg?width=720', 'duration': 52, 'timestamp': 1631553328, 'upload_date': '20210913', }, 'params': {'skip_download': True} }, { ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'title': 'Fox Business Network - 4:00 PM - 5:00 PM - 1:39:42 pm - 1:42:20 pm',\r\n```", "severity": "minor", "line": 26 } ]
1
python
is_in_dist = self.use_ddp or self.use_ddp2 or self.use_horovod or self.use_tpu need_dist_sampler = is_in_dist and not isinstance(dataloader.sampler, DistributedSampler) if self.replace_sampler_ddp and need_dist_sampler: if not isinstance(dataloader.sampler, (SequentialSampler, RandomSampler)...
Review this code and list any quality issues.
[ { "issue": "I think that this shall be a kind of test once at the beginning when `use_tpu` is set...", "severity": "minor", "line": 26 } ]
1
python
if stop_time is not None: file = update_url_query(file, {'stopTime': stop_time}) stream_id = self._search_regex(r'/o2/sejm/([^/]+)/[^./]+\.livx', file, 'stream id') common_info = { 'url': file, 'duration': duration, } ...
Review this code and list any quality issues.
[ { "issue": "IMO it's cleaner to just make this always non-fatal -- if there are no formats the user has not passed the param it will error upon return anyways\r\n```suggestion\r\n fatal=False) or []\r\n```", "severity": "minor", "line": 26 } ]
1
python
if f'_{known_id}' in m3u8_url: m3u8_id = known_id break else: m3u8_id = None formats.extend(self._extract_m3u8_formats( m3u8_url, video_id, ext='mp4', # ffmpeg skips segments for fast m3u8 pre...
Review this code and list any quality issues.
[ { "issue": "I think we could do this\r\n```suggestion\r\n return self._extract_from_api(video_id, tld) or self._extract_from_webpage(video_id, tld)\r\n```", "severity": "major", "line": 26 } ]
1
python
filtered_props = ( filter_props(props) if (prop_reorder_exceptions is not None and typename in prop_reorder_exceptions) or (prop_reorder_exceptions is not None and "ALL" in prop_reorder_exceptions) else reorder_props(filter_props(props)) ) wildcard_prefixes = repr(parse_wildcards...
Review this code and list any quality issues.
[ { "issue": "And this part seems to be solved by passing `**args` again.", "severity": "minor", "line": 26 } ]
1
python
# Backwards compatibility: old IE result format ie_result = { '_type': 'compat_list', 'entries': ie_result, } self.fix_deprecated_fields(ie_result) if extra_info.get('original_url'): ie_result.setdefault('original_url', extra_info['orig...
Review this code and list any quality issues.
[ { "issue": "Let's not add warning till we've migrated the popular extractors. Otherwise every user just ends up with it\r\n```suggestion\r\n```", "severity": "major", "line": 26 } ]
1
python
if not is_supported_format(path): raise UnsupportedFormatError() if not is_supported_arch(path): raise UnsupportedArchError() if os_ == OS_AUTO and not is_supported_os(path): raise UnsupportedOSError() if format_ == FORMAT_DOTNET: import capa.features.e...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n import binaryninja\n from binaryninja import BinaryView\n```", "severity": "minor", "line": 26 } ]
1
python
'url': 'https://www.southpark.lat/en/collections/29ve08/south-park-heating-up/lydbrc', 'only_matching': True, }, { # clip 'url': 'https://www.southpark.lat/en/video-clips/ct46op/south-park-tooth-fairy-cartman', 'info_dict': { 'id': 'e99d45ea-ed00-11e0-aca6-0026b9414f30', ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n config = self._download_json(\r\n f'http://media.mtvnservices.com/pmt/e1/access/index.html?uri={uri}&configtype=edge&ref={url}',\r\n video_id)\r\n```", "severity": "minor", "line": 26 } ]
1
python
webpage = self._download_webpage(url, video_id) product_url = self._search_regex( r"var videoUrl\s*=\s*['\"]([^'\"]+)['\"];", webpage, 'product player URL') product_url = 'https://btvplus.bg' + product_url player_data = self._download_json(product_url, video_id) ...
Review this code and list any quality issues.
[ { "issue": "For the title searching for `<span class=\"title\">` also matches way too much (every episode title on the page). I changed it to use the og tag.\r\n```suggestion\r\n 'formats': formats,\r\n 'subtitles': subtitles,\r\n 'title': strip_or_none(\r\n self....
1
python
arguments: str call_id: str class ChoiceDelta(BaseModel): role: ChatRole | None = None content: str | None = None tool_calls: list[FunctionToolCall] = Field(default_factory=list) class ChatChunk(BaseModel): id: str delta: ChoiceDelta | None = None usage: CompletionUsage | None = None c...
Review this code and list any quality issues.
[ { "issue": "Do you think this should be inside the llm module vs a global one?", "severity": "minor", "line": 26 } ]
1
python
self.assertIsNone(obj.value) def test_create(self): obj = NullableJSONModel.objects.create(value=JSONNull()) obj.refresh_from_db() self.assertIsNone(obj.value) def test_update(self): obj = NullableJSONModel.objects.create(value={"key": "value"}) NullableJSONModel.object...
Review this code and list any quality issues.
[ { "issue": "I would just explode these out into separate test methods, since the tests don't share state.", "severity": "minor", "line": 26 } ]
1
python
def test_sparkline_expand_data_to_width(): assert ( render(Sparkline([2, 4], width=4)) == f"{GREEN}▁{STOP}{GREEN}▁{STOP}{RED}█{STOP}{RED}█{STOP}" ) def test_sparkline_expand_data_to_width_non_divisible(): assert ( render(Sparkline([2, 4], width=3)) == f"{GREEN}▁{STOP}{GREEN...
Review this code and list any quality issues.
[]
0
python
# Determine position side side = PositionSide.LONG if new_quantity > 0 else PositionSide.SHORT # Create position status report position_report = PositionStatusReport( account_id=self.account_id, instrument_id=instrument.id, position_si...
Review this code and list any quality issues.
[ { "issue": "This just needed to be `self._log.exception(f\"Error handling position update\", e)`, retaining the exception will help with debugging - will update on `develop` branch.\n\n[edit] Will leave it for now as this is standardized with the other exception handling log calls in this module - but worth not...
1
python
import functools import math from .common import InfoExtractor from ..utils import ( InAdvancePagedList, clean_html, int_or_none, parse_iso8601, traverse_obj, urljoin, ) class MaveBaseIE(InfoExtractor): _API_BASE_URL = 'https://api.mave.digital/v1/website' _API_BASE_STORAGE_URL = 'htt...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n def _load_episode_meta(self, channel_id, episode_code, display_id):\r\n```", "severity": "minor", "line": 24 } ]
1
python
session = async_get_clientsession(hass) # Create API connection access_token = partial(_get_access_token, oauth_session) teslemetry = Teslemetry( session=session, access_token=access_token, ) try: calls = await asyncio.gather( teslemetry.metadata(), t...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n LOGGER.exception(\"Setup failed\")\n```\nI wonder if it would be better to log an exception here. Since it feels like this is the last resort we can't handle with \"known exceptions\". Is my observation right?", "severity": "critical", "line": 26 } ]
1
python
DownloadSource.DEFAULT: "openbmb/MiniCPM-2B-sft-bf16", DownloadSource.MODELSCOPE: "OpenBMB/miniCPM-bf16", }, "MiniCPM-2B-DPO-Chat": { DownloadSource.DEFAULT: "openbmb/MiniCPM-2B-dpo-bf16", DownloadSource.MODELSCOPE: "OpenBMB/MiniCPM-2B-dpo-bf16", }, }, ...
Review this code and list any quality issues.
[ { "issue": "Please change name to `MiniCPM4-8B-Chat` or `MiniCPM4-8B-Instruct` so llamafactory can enable chat template for it. https://github.com/hiyouga/LLaMA-Factory/blob/239ced076c93bd08ab2d1de1696447d07a1f9f9f/src/llamafactory/extras/constants.py#L145-L147", "severity": "minor", "line": 26 } ]
1
python
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFR...
Review this code and list any quality issues.
[]
0
python
__all__ = ["ParametricFunction", "FunctionGraph", "ImplicitFunction"] from typing import Callable, Iterable, Sequence import numpy as np from isosurfaces import plot_isoline from manim import config from manim.mobject.graphing.scale import LinearBase, _ScaleBase from manim.mobject.opengl.opengl_compatibility import...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n Determines the length that the function spans in the form of [t_min, t_max[, step=0.01]]. By default ``[0, 1]``\r\n```\r\nTo use the python notation for optional. What do you think? Does this add clarity, or would it be confusing for beginners?", "severity": "minor", ...
1
python
def test_video_assets_enum_values(): """Test that VideoAssets enum members have correct values.""" assert VideoAssets.VEHICLES.value == "vehicles.mp4" assert VideoAssets.MILK_BOTTLING_PLANT.value == "milk-bottling-plant.mp4" assert VideoAssets.VEHICLES_2.value == "vehicles-2.mp4" assert VideoAssets....
Review this code and list any quality issues.
[ { "issue": "Hard-coding the base URL here duplicates the production constant (`BASE_VIDEO_URL` in `supervision/assets/list.py`). Import and use that constant (or build the expectation from `VIDEO_ASSETS`) to avoid test breakage if the base URL changes in one place.", "severity": "major", "line": 26 } ...
1
python
self.maybe_commit() logger.debug(f"Added prompter message {len(content)=} to chat {chat_id}") self.session.refresh(message) return message def initiate_assistant_message(self, parent_id: str, work_parameters: inference.WorkParameters) -> models.DbMessage: logger.info(f"Adding stub a...
Review this code and list any quality issues.
[ { "issue": "Is this the correct way to validate input in fastapi? Please correct me if I'm wrong", "severity": "critical", "line": 26 } ]
1
python
slope (95%): 1.453392 +/- 0.743465 >>> print(f"intercept (95%): {res.intercept:.6f}" ... f" +/- {ts*res.intercept_stderr:.6f}") intercept (95%): 0.616950 +/- 0.544475 """ np = array_namespace(x, y) # needed for vecdot pre NumPy 2.0 TINY = 1.0e-20 axis = -1 n = x.shape[axis] ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n ssxm = np.vecdot(x_, x_, axis=-1) / n\r\n ssym = np.vecdot(y_, y_, axis=-1) / n\r\n ssxym = np.vecdot(x_, y_, axis=-1) / n\r\n```", "severity": "minor", "line": 26 } ]
1
python
assert len(ret) == 3 assert list(ret.iloc[0]) == [21, 3] assert list(ret.iloc[1]) == [1, 1] assert list(ret.iloc[2]) == [2, 2] # -- aggregating / grouping / cases -- case = ''' case when s.id=1 then 10 when s.id=2 then 20 when s.id=...
Review this code and list any quality issues.
[]
0
python
Statistical Computation and Simulation 26, p. 177--203, 1986. .. [2] S. J. Goerg and J. Kaiser, "Nonparametric testing of distributions - the Epps-Singleton two-sample test using the empirical characteristic function", The Stata Journal 9(3), p. 454--465, 2009. """ np = array_namespace(x, y)...
Review this code and list any quality issues.
[ { "issue": "Was it intentional to switch to a strict inequality?", "severity": "minor", "line": 26 } ]
1
python
assert aioclient_mock.call_count == 1 async_fire_time_changed(hass, utcnow() + timedelta(minutes=5)) await hass.async_block_till_done() assert aioclient_mock.call_count == 2 @pytest.mark.parametrize( "side_effect", [ [False] * len(BACKOFF_INTERVALS), [ClientError] * len(BACKOFF_IN...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n side_effect=[side_effect] * len(BACKOFF_INTERVALS),\r\n```", "severity": "minor", "line": 26 } ]
1
python
request.proof_of_space.size, difficulty, request.challenge_chain_sp, ) sp_iters: uint64 = calculate_sp_iters(self.full_node.constants, sub_slot_iters, request.signage_point_index) ip_iters: uint64 = calculate_ip_iters( self.full_node.co...
Review this code and list any quality issues.
[]
0
python
data = self._call_api(asset_id, client) formats, subtitles = self._extract_formats_and_subtitles(data, asset_id) description = self._html_search_meta( ['og:description', 'twitter:description', 'description'], webpage) if description == '…': description = None re...
Review this code and list any quality issues.
[ { "issue": "By convention ids are written first and usually extensions second. Do not change this order.", "severity": "minor", "line": 26 } ]
1
python
def make_table(rows: Sequence[Sequence[str]], width: int = 100) -> str: """Creates a text table using Unicode characters. Args: rows: A list of tuples/lists to be displayed in the table. width: Maximum width of the table. """ if not rows: return '' num_cols = max(len(row) f...
Review this code and list any quality issues.
[]
0
python
def not_joystick(started: bool, params: Params, CP: car.CarParams) -> bool: return started and not params.get_bool("JoystickDebugMode") def long_maneuver(started: bool, params: Params, CP: car.CarParams) -> bool: return started and params.get_bool("LongitudinalManeuverMode") def not_long_maneuver(started: bool, p...
Review this code and list any quality issues.
[]
0
python
# 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 CONDITIONS OF ANY KIND, either express or implied...
Review this code and list any quality issues.
[ { "issue": "\"linear\" => \"linear={false}\" ?", "severity": "minor", "line": 26 } ]
1
python
class LMCacheConnectorV1Impl: def __init__( self, vllm_config: "VllmConfig", role: KVConnectorRole, parent: KVConnectorBase_V1, ): self._parent = parent self.kv_role = vllm_config.kv_transfer_config.kv_role self.worker_count = vllm_config.parallel_config.t...
Review this code and list any quality issues.
[ { "issue": "nit: the validation happens with `hasattr()` and not with with the function `validate_and_set_config_value()`", "severity": "minor", "line": 26 } ]
1
python
output_tokens=0, ) async def stream_search( self, query: str, conversation_history: ConversationHistory | None = None, ) -> AsyncGenerator: """Build local search context that fits a single context window and generate answer for the user query.""" start_time =...
Review this code and list any quality issues.
[ { "issue": "Nit: I think the if may not be necessary, as the for in won't yield any result when None", "severity": "minor", "line": 26 } ]
1
python
CLinear( compressed_state_dict[full_name], target_attr.bias, target_device ), ) for name, child in module.named_children(): child_prefix = f"{prefix}.{name}" if prefix else name apply_compressed_weight( child, compressed_state_dict, target_...
Review this code and list any quality issues.
[]
0
python
from .common import InfoExtractor from .redge import RedCDNLivxIE from ..utils import ( clean_html, js_to_json, strip_or_none, traverse_obj, update_url_query, ) import datetime def is_dst(date): year = date.year # last sunday of march and october, respectively. might break on switch days....
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\ndef is_dst(date):\r\n last_march = datetime.datetime(date.year, 3, 31)\r\n last_october = datetime.datetime(date.year, 10, 31)\r\n last_sunday_march = last_march - datetime.timedelta(days=last_march.isoweekday() % 7)\r\n last_sunday_october = last_october - datetime.time...
1
python
class AzureOpenAISettings(BaseModel): api_key: str azure_endpoint: str api_version: str = Field( "2023_05_15", description="The API version to use for this operation. This follows the YYYY-MM-DD format.", ) embedding_deployment_name: str embedding_model: str = Field( "tex...
Review this code and list any quality issues.
[ { "issue": "It's better idea configure like literal (enum)", "severity": "minor", "line": 26 } ]
1
python
FadeIn(fade_target, target_position=fade_target, **kwargs), ) super().__init__(*anims) self.to_remove = mobject self.to_add = target_mobject def get_shape_map(self, mobject: Mobject) -> dict: shape_map = {} for sm in self.get_mobject_parts(mobject): ...
Review this code and list any quality issues.
[ { "issue": "I would leave this code block as it is because checking every animation if it is a `FadeIn` is a bit too much. As you said earlier the main problem is the cleanup so i would suggest changing that instead.\r\n```suggestion\r\n anim.interpolate(0)\r\n```", "severity": "minor", "line...
1
python
assert cohere_profile is None deepseek_profile = provider.model_profile('deepseek.deepseek-r1') deepseek_model_profile_mock.assert_called_with('deepseek-r1') assert deepseek_profile is not None assert deepseek_profile.ignore_streamed_leading_whitespace is True amazon_profile = provider.model_profi...
Review this code and list any quality issues.
[ { "issue": "can we use the `BEDROCK_GEO_PREFIXES` you defined above here?", "severity": "minor", "line": 26 } ]
1
python
'title': video.get('title'), 'description': video.get('description'), 'thumbnail': thumbnail, 'thumbnails': thumbnails, 'duration': int_or_none(video.get('clip_duration')), 'timestamp': video.get('created_at'), } def _extract_formats_and_subs(self...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n format['language'] = options['language']\r\n```", "severity": "minor", "line": 26 } ]
1
python
mime_type = None for magic, ext, mime in self.IMAGE_FORMATS: if header.startswith(magic): image_ext = ext mime_type = mime break if not image_ext or not mime_type: ...
Review this code and list any quality issues.
[ { "issue": "Image data extracted from PDFs is saved to storage without validation of the actual image content beyond magic bytes. Malformed or malicious image data could potentially be stored and served. Consider adding validation to ensure the extracted bytes form a valid image, or at least impose size limits ...
1
python
def call_command(command, cwd=None, env=None): a = subprocess.run( command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True, text=True, cwd=cwd, env=env, ) return a def test_manim_version_from_command_line(): a = call_command( ...
Review this code and list any quality issues.
[ { "issue": "This assertion will always be true because `manim.__version__` is set the same way as you set `version` above. Instead, there is a already a test [here](https://github.com/ManimCommunity/manim/blob/master/tests/test_version.py) that _should_ be comparing `__version__` to the version in `pyproject.to...
1
python
@staticmethod def _extract_session_index(*data): """ Index of current account in account list. See: https://github.com/yt-dlp/yt-dlp/pull/519 """ for ytcfg in data: session_index = int_or_none(try_get(ytcfg, lambda x: x['SESSION_INDEX'])) if session_in...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if second:\r\n return first, second\r\n return None, first\r\n```\r\nThis is easier to read imo", "severity": "minor", "line": 26 } ]
1
python
"""Create a map dashboard.""" translations = await async_get_translations( hass, hass.config.language, "dashboard", {onboarding.DOMAIN} ) title = translations["component.onboarding.dashboard.map.title"] await dashboards_collection.async_create_item( { CONF_ALLOW_SINGLE_WORD:...
Review this code and list any quality issues.
[ { "issue": "this step should be after 2., right? maybe just make the checks bullet points inside a point 1?", "severity": "minor", "line": 26 } ]
1
python
strict: bool | None = None, ): if inspect.isfunction(output) or inspect.ismethod(output): self._function_schema = _function_schema.function_schema(output, GenerateToolJsonSchema) self.validator = self._function_schema.validator json_schema = self._function_schema.json_sch...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n # instructions, like `BedrockConverseModel('us.meta.llama3-2-11b-instruct-v1:0')`\r\n```", "severity": "minor", "line": 26 } ]
1
python
client = Client() client.configure(provider_configs) messages = [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Who won the world series in 2020?"}, ] # Test OpenAI model open_ai_model = ProviderNames.OPENAI +...
Review this code and list any quality issues.
[]
0
python
def install_excepthook(): sys.excepthook = excepthook def filter_warnings(): # Filter deprecation warning from torch internal usage warnings.filterwarnings( action="ignore", category=UserWarning, message="torch.distributed.*_base is a private function and will be deprecated.*", ...
Review this code and list any quality issues.
[ { "issue": "My editor was loosing its mind because trying to figure out the indentation due to the unmatched \"{\" in `style=\"{\"`. So I just changed this to use the old school formatting.", "severity": "minor", "line": 26 } ]
1
python
parts=[ ToolCallPart(tool_name='tool', args={}, tool_call_id='tool_call_id'), ToolCallPart(tool_name='tool2', args={}, tool_call_id='tool_call_id2'), ], provider_name='openai', ), 'google-gla', ) assert google_response == snapshot( ...
Review this code and list any quality issues.
[ { "issue": "this is a new test so use gemini-2.5-flash instead", "severity": "minor", "line": 26 } ]
1
python
from typing import Optional import torch import torch.nn as nn from ..lora import LoRAModule class Actor(LoRAModule): """ Actor model base class. Args: model (nn.Module): Actor Model. lora_rank (int): LoRA rank. lora_train_bias (str): LoRA bias training mode. """ def __...
Review this code and list any quality issues.
[ { "issue": "You can rename this arg to `input_ids` to avoid hacking.", "severity": "minor", "line": 25 } ]
1
python
ValueError If any weight is < 0, or the sum of the weights is <= 0. ValueError If the normalize parameter is not one of the allowed options. See Also -------- periodogram: Power spectral density using a periodogram welch: Power spectral density by Welch's method csd: Cross spect...
Review this code and list any quality issues.
[ { "issue": "A purely cosmetic suggestion: Separating this text into paragraphs as well as marking `floating_mean` makes this note easier to read:\n\n```suggestion\n The algorithm used will not automatically account for any unknown y offset, unless\n `floating_mean` is ``True``. Therefore, for most use cas...
1
python
await i2.create_index( fix_schema_naming(index_type, [TagField("even"), vector_field]), definition=IndexDefinition(index_type=index_type), ) pipe = async_client.pipeline() for i in range(100): even = "yes" if i % 2 == 0 else "no" if index_type == IndexType.HASH: ...
Review this code and list any quality issues.
[]
0
python
self.tree.copy_global_to(guild=MY_GUILD) await self.tree.sync(guild=MY_GUILD) intents = discord.Intents.default() # In order to use a basic synchronization of the app commands in the setup_hook, # you have replace ... with your bots application_id you find in the developer portal. client = MyClient(intents=i...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n first_value='The first value you want to add something to', \r\n second_value='The value you want to add to the first value',\r\n```\r\n\r\nMagic commas are better for readability.", "severity": "minor", "line": 26 } ]
1
python
import threading import time from .common import FileDownloader from . import HlsFD from ..extractor.afreecatv import _cloudfront_auth_request from ..networking.exceptions import network_exceptions class SoopVodFD(FileDownloader): """ Downloads Soop subscription VODs with required cookie refresh requests ...
Review this code and list any quality issues.
[ { "issue": "BTW, let's just keep this simple\r\n\r\n```suggestion\r\n refresh_params = info_dict['_cookie_refresh_params']\r\n```", "severity": "minor", "line": 24 } ]
1
python
) continue resource_type = resource_types[name] if ( location not in resource_type.locations and len(resource_type.locations) > 0 ): unsupported.append( "%s/%s is unsu...
Review this code and list any quality issues.
[ { "issue": "Previous code should be fine, or you hit an issue with it ? \r\nhttps://docs.python.org/3/library/stdtypes.html#truth-value-testing", "severity": "minor", "line": 26 } ]
1
python
a, b = 0, 2*np.pi x = np.linspace(a, b, N + 1) # nodes y = np.exp(x) with assert_raises(ValueError): make_splrep(x, y, s=1e-8, bc_type="nonsense") @pytest.mark.parametrize("bc_type", ["periodic", None]) @pytest.mark.parametrize("k", [1, 2, 3, 4, 5]) def test_make_spl...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n def test_make_splrep_with_non_c_contiguous_input(self, bc_type):\n # regression test for https://github.com/scipy/scipy/issues/23371\n```", "severity": "minor", "line": 26 } ]
1
python
'title': '芈月傳第1集 霸星芈月降世楚國', 'description': '楚威王二年,太史令唐昧夜觀星象,發現霸星即將現世。王后得知霸星的預言後,想盡辦法不讓孩子順利出生,幸得莒姬相護化解危機。沒想到眾人期待下出生的霸星卻是位公主,楚威王對此失望至極。楚王后命人將女嬰丟棄河中,居然奇蹟似的被少司命像攔下,楚威王認為此女非同凡響,為她取名芈月。', }, 'skip': 'No longer exists', }] def _extract_playlist(self, playlist_data, content_type): a...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n raise ExtractorError('No such content found', expected=True)\r\n```", "severity": "major", "line": 26 } ]
1
python
with pytest.raises(ValueError, match="xtol too small"): method(f, -1e8, 1e7, args=args, xtol=-1e-6, rtol=TOL) with pytest.raises(ValueError, match="rtol too small"): method(f, -1e8, 1e7, args=args, xtol=1e-6, rtol=rtolbad) class TestRidderUnderflow: def test_gh_issue_underflow(self): # Re...
Review this code and list any quality issues.
[ { "issue": "Can you change `test_early_exit_funcalls` to check that the number of evaluations is correct? This checks that it reports 3 evaluations, but the function may have called it fewer or more times.\n\nFor example, many of our tests use a pattern like this:\n\n```\n def test_early_exit_funcalls(self):...
1
python
language="en", response_format="text", temperature=0.0, extra_body={"max_completion_tokens": int(1e6)}, ) out = json.loads(transcription) out_text = out["text"] out_tokens = tok(out_text, add_special_tokens=False)["input_ids"] assert len(out_tokens) < 450 # ~Whisper max outp...
Review this code and list any quality issues.
[ { "issue": "let's merge these tests into a single one with parametrization", "severity": "minor", "line": 26 } ]
1
python
import multiprocessing import os import torch import genesis as gs import argparse def main(): parser = argparse.ArgumentParser() parser.add_argument("-v", "--vis", action="store_true", default=False) parser.add_argument("-c", "--cpu", action="store_true", default=False) args = parser.parse_args() ...
Review this code and list any quality issues.
[ { "issue": "The '--cpu' argument is defined but not used anywhere in the script. Remove it or add logic to support CPU execution if intended.", "severity": "minor", "line": 14 } ]
1
python
"""Resolve the authorization code to tokens.""" request_data: dict = { "grant_type": "authorization_code", "code": external_data["code"], "redirect_uri": external_data["state"]["redirect_uri"], } request_data.update(self.extra_token_resolve_data) retur...
Review this code and list any quality issues.
[ { "issue": "I'd not mention the details here in the log message but link to a docs page that explains that.", "severity": "minor", "line": 26 } ]
1
python
except prisma.errors.PrismaError as e: logger.error(f"Database error adding agent to library: {e}") raise store_exceptions.DatabaseError("Failed to add agent to library") from e ############################################## ########### Presets DB Functions ############# ##############################...
Review this code and list any quality issues.
[ { "issue": "I assume this doesn't make any difference but the new change is recommended?", "severity": "minor", "line": 26 } ]
1
python
self.assertAlmostEqual(self._get_converted_pytorch_model(model2)(torch.randn(1, 3, 3, 3)).abs().sum().item(), 0) def test_valuechoice_getitem_functional_expression(self): @model_wrapper class Net(nn.Module): def __init__(self): super().__init__() self.dro...
Review this code and list any quality issues.
[]
0
python
# retried with the same request data this usually succeeds (1-2 attempts # is usually enough) thus allowing to download the whole file successfully. # To be future-proof we will retry all fragments that fail with any # HTTP error. count += ...
Review this code and list any quality issues.
[ { "issue": "If the download failed, this will return false. We need to deal with it correctly\r\n\r\n```suggestion\r\n if not downloader.real_download(ctx['filename'], ctx):\r\n return False\r\n```", "severity": "critical", "line": 26 } ]
1
python
if canvas._js.tagName != "CANVAS": raise TypeError("Element to snap to must a canvas.") canvas.draw(self, width, height) return canvas def download(self, filename: str = "snapped.png") -> None: """Download the current element (only available for canvas elements) with the f...
Review this code and list any quality issues.
[ { "issue": "I am not sure this works out of the box unless already part on a trusted *click* event ... if that's the case, it's all good.", "severity": "minor", "line": 26 } ]
1
python
class NiconicoChannelPlusBaseIE(InfoExtractor): _WEBPAGE_BASE_URL = 'https://nicochannel.jp' def _call_api(self, path, item_id, *args, **kwargs): return self._download_json( f'https://nfc-api.nicochannel.jp/fc/{path}', video_id=item_id, *args, **kwargs) def _find_fanclub_site_id(self, ...
Review this code and list any quality issues.
[ { "issue": "Since the result is only used for metadata, this should be non-fatal:\r\n```suggestion\r\n def _get_channel_base_info(self, fanclub_site_id):\r\n return traverse_obj(self._call_api(\r\n f'fanclub_sites/{fanclub_site_id}/page_base_info', item_id=f'fanclub_sites/{fanclub_site_id}'...
1
python
) self.blocks = nn.ModuleList(blocks) def forward(self, x: torch.Tensor) -> torch.Tensor: for block in self.blocks: x = block(x) _empty_cuda_cache(self.save_mem) return x class MaisiDecoder(nn.Module): """ Convolutional cascade upsampling from a spatial la...
Review this code and list any quality issues.
[ { "issue": "Same as above for `num_res_blocks`", "severity": "minor", "line": 26 } ]
1
python
"two", "three", "four", ] def test_escaping_of_angle_brackets(self): """ Check that py-script tags escape angle brackets """ self.pyscript_run( """ <py-script>import js; js.console.log(1<2, 1>2)</py-script> <py-scri...
Review this code and list any quality issues.
[]
0
python
os.environ['SUNO_USE_SMALL_MODELS'] = "True" msg_extra += f"<br/>Switching BARK to SMALL models" else: os.environ['SUNO_OFFLOAD_CPU'] = "False" os.environ['SUNO_USE_SMALL_MODELS'...
Review this code and list any quality issues.
[ { "issue": "When `checksum` is true, `session['chapters']` is populated from `json_chapters` here but later in `finalize_audiobook()` the chapters list is always rebuilt from `session['blocks']` and then saved back to the same JSON file. As a result, the loaded JSON chapters are effectively never used for the a...
1
python
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
Review this code and list any quality issues.
[ { "issue": "Try not to reference absolute links like this. Use an internal reference to the module and sphinx will figure out the URL for you.", "severity": "minor", "line": null } ]
1
python
"model": "<MODEL>", }, }, SA_RC, ] def get_data_handler_config( start_time="2008-01-01", end_time="2020-08-01", fit_start_time="<dataset.kwargs.segments.train.0>", fit_end_time="<dataset.kwargs.segments.train.1>", instruments=CSI300_MARKET, ): return { "start_time": sta...
Review this code and list any quality issues.
[ { "issue": "Make sure this will not affect others https://github.com/microsoft/qlib/search?q=get_dataset_config", "severity": "minor", "line": 26 } ]
1
python
'only_matching': True, }, { 'url': 'https://chaturbate.eu/fullvideo/?b=caylin', 'only_matching': True, }, { 'url': 'https://chaturbate.global/siswet19/', 'only_matching': True, }] _ERROR_MAP = { 'offline': 'Room is currently offline', 'private': 'Room is ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n }, fatal=False, impersonate=True) or {}\r\n```", "severity": "minor", "line": 26 } ]
1
python
'high', 'low', 'close', 'volume', 'date', 'dividend', 'split', ], na_values=['NA'], ) df['sid'] = sids[symbol] return df al...
Review this code and list any quality issues.
[]
0
python
import numpy as np import gradio as gr from fastchat.serve.gradio_web_server import ( upvote_last_response, downvote_last_response, flag_last_response, get_model_description_md, acknowledgment_md, bot_response, add_text, clear_history, regenerate, get_ip, disable_btn, ) fro...
Review this code and list any quality issues.
[ { "issue": "load the file once instead of reloading it every time.", "severity": "minor", "line": 26 } ]
1
python
assert fig.canvas.manager.get_window_title() == "Figure 1" if mpl.rcParams["toolbar"] == "toolmanager": # test toolbar button icon LA mode see GH issue 25174 _test_toolbar_button_la_mode_icon(fig) ax.plot([0, 1], [2, 3]) if fig.canvas.toolbar: # i.e toolbar2. fig.canvas.toolbar.dr...
Review this code and list any quality issues.
[ { "issue": "Maybe explicitly add a test here that type(figure.canvas) == FigureCanvasBase? (This would catch any missing super().destroy() call.)", "severity": "minor", "line": 26 } ]
1
python
on = js_to_json('{0xff:0xff}') self.assertEqual(json.loads(on), {'255': 255}) on = js_to_json('{/*comment\n*/0xff/*comment\n*/:/*comment\n*/0xff/*comment\n*/}') self.assertEqual(json.loads(on), {'255': 255}) on = js_to_json('{077:077}') self.assertEqual(json.loads(on), {'63': 6...
Review this code and list any quality issues.
[]
0
python
""" def __init__( self, mobject: Mobject, target_mobject: Mobject, path_arc: float = -np.pi, **kwargs, ) -> None: super().__init__(mobject, target_mobject, path_arc=path_arc, **kwargs) class CounterclockwiseTransform(Transform): """Transforms Mobjects while...
Review this code and list any quality issues.
[ { "issue": "There is a typo here.\r\n\r\n```suggestion\r\n .. manim:: CounterclockwiseTransform2\r\n```", "severity": "minor", "line": 26 } ]
1
python
def trackable_object( self, trackable_id: str ) -> aiotractive.trackable_object.TrackableObject: """Get trackable object by id.""" return self._client.trackable_object(trackable_id) def subscribe(self) -> None: """Start event listener coroutine.""" self._listen_task = as...
Review this code and list any quality issues.
[ { "issue": "Tractive has deprecated the `wellness_overview` message (the API no longer sends these messages), we should remove all code related to `wellness_overview`.", "severity": "minor", "line": 26 } ]
1
python
reverse("wagtailapi_v2:pages:listing"), HTTP_ACCEPT="application/json" ) self.assertEqual(response.status_code, 200) self.assertEqual(response["Content-Type"], "application/json") # Should be valid JSON content = json.loads(response.content.decode("UTF-8")) self.assertI...
Review this code and list any quality issues.
[ { "issue": "Turns out we can't have these tests due to the test mechanism added in #12251... I'll remove them for now and raise a separate PR to change that mechanism.", "severity": "minor", "line": 26 } ]
1
python
import re def extract_scripts_from_codetext(codetext: str): script_names = [] # 提供的文本内容,可能包含多个 [start of ... .py] """ [end of README.rst] [start of sklearn/compose/_target.py] ... 文件内容 ... [end of sklearn/compose/_target.py] [start of another_module/example.py] ... 文件内容 ... [en...
Review this code and list any quality issues.
[ { "issue": "Does this function only aim to support parsing Python code? Because of the regex with a '.py' suffix.", "severity": "minor", "line": 26 } ]
1
python
def construct(self): text = Tex("Alice and Bob").scale(3) self.add(text) self.play(Unwrite(text,reverse=True)) """ def __init__( self, vmobject: VMobject, rate_func: Callable[[float], float] = linear, reverse: bool = False, ...
Review this code and list any quality issues.
[ { "issue": "I have a very slight preference for setting the default value of the `kwarg` to `True` so that `reverse=reverse` can be passed here.\r\n\r\nSemantically, I think it's cleaner if `reverse` acts the same for both `Write` and `Unwrite`.", "severity": "minor", "line": 26 } ]
1
python
return None names = list(relative.parts) if not names: return None if names[-1] == "__init__": names.pop() return ".".join(names) class CouldNotResolvePathError(Exception): """Custom exception raised by resolve_pkg_root_and_module_name.""" def scandir( path: str | os.PathLike...
Review this code and list any quality issues.
[ { "issue": "I would prefer a narrow try/except as done in https://github.com/pytest-dev/pytest/pull/13084, can you please update to use a similar solution?", "severity": "minor", "line": 26 } ]
1
python
try: global_ns = sys.modules[attrs['__module__']].__dict__ except KeyError: global_ns = {} frame = inspect.currentframe() try: if frame is None: local_ns = {} else: if frame.f_back is None: local...
Review this code and list any quality issues.
[]
0
python
# Select the next utterance if self.ui.auto_next_checkbox.isChecked(): self.ui.browser_select_next() elif fpath == "": return else: name = fpath.name speaker_name = fpath.parent.name # Get the wav from the disk. We take th...
Review this code and list any quality issues.
[]
0
python
""" Regression test for https://github.com/astral-sh/ruff/issues/20096 """ from __future__ import annotations from typing import Optional, cast, TypeAlias x: Optional[str] # UP045 x: "Optional[str]" # UP045 cast("Optional[str]", None) # UP045 cast(Optional[str], None) # okay, str | None is...
Review this code and list any quality issues.
[ { "issue": "Can we add some tests for \"Complex\" string annotations (an annotation that uses implicit string concatenation).", "severity": "minor", "line": 15 } ]
1
python
for key, value in CFG_DEFAULTS.items(): if key == "scene_names": new_cfg[key] = template_name + "Template" elif key == "resolution": new_cfg[key] = select_resolution() else: new_cfg[key] = click.prompt(f"\n{key}"...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n \"\"\"Inserts a SCENE to an existing FILE or creates a new FILE.\r\n```", "severity": "minor", "line": 26 } ]
1
python
from .common import InfoExtractor from ..utils import ( ExtractorError, smuggle_url, str_or_none, traverse_obj, ) class TVerIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tver\.jp/(?:(?P<type>lp|corner|series|episodes?|feature|tokyo2020/video)/)+(?P<id>[a-zA-Z0-9]+)' _TESTS = [{ ...
Review this code and list any quality issues.
[ { "issue": "The description values seem to be unstable. I'm getting an extra \\U3000 (ideographic space) in this bit `る! テ` giving `md5:4029cc5f4b1e8090dfc5b7bd2bc5cd0b`, but not reliably. Also `u'md5:66985373a66fed8ad3cd595a3cfebb13` in the 1st test.", "severity": "minor", "line": 26 } ]
1
python
# to the same for cpu rng state cpu_original_rng_state = torch.get_rng_state() torch.manual_seed(seed) self.cpu_rng_state = torch.get_rng_state() torch.set_rng_state(cpu_original_rng_state) def _set_device_rng_state(self, rng_state): set_rng_state(rng_state) def _get_de...
Review this code and list any quality issues.
[]
0
python
size: int | None bytes_received: int = 0 reattempts: int = 0 def is_incomplete(self) -> bool: return bool(self.size is not None and self.bytes_received < self.size) def write_chunk(self, data: bytes) -> None: self.bytes_received += len(data) self.output_file.write(data) de...
Review this code and list any quality issues.
[]
0
python
def _entries(self, playlist_type, playlist_id): playlist_url = f'https://www.bitchute.com/{playlist_type}/{playlist_id}/' def fetch_entries(page_num): data = self._download_json( '%sextend/' % playlist_url, playlist_id, 'Downloading %s page %d' % (playlist_ty...
Review this code and list any quality issues.
[ { "issue": "This gives `/video/None` in the second test case", "severity": "minor", "line": 26 } ]
1
python
using batch_size=20, track_column=id """ ) # test threads check_partition( """ insert into kb_part SELECT id, english FROM pg.ral using batch_size=20, track_column=id, threads = 3 """ ) ...
Review this code and list any quality issues.
[]
0
python
if ( integration.is_built_in or ex.domain not in integration.after_dependencies ): exceptions.append(ex) except Exception as ex: # noqa: BLE001 exceptions.insert(0, ex) if exceptions: raise exce...
Review this code and list any quality issues.
[ { "issue": "Note: prior to #159368, the \"fragment URL\" would have failed only when `skip_pip_packages` was set, which would have been very uncommon and the bug was unnoticed.", "severity": "critical", "line": 26 } ]
1
python
) is not None: entities.extend( ThinQHumidifierEntity(coordinator, description, property_id) for property_id in coordinator.api.get_active_idx( description.key, ActiveMode.READ_WRITE ) ) if entities: async_add_entit...
Review this code and list any quality issues.
[ { "issue": "This doesn't seem to be changes, should we declare it outside of the constructor?", "severity": "minor", "line": 26 } ]
1
python
col_ixs = self.dts.searchsorted(dts, side='right') - 1 row_ixs = self.currencies.get_indexer(bases) try: dataset = self._group[DATA][rate][quote][RATES] except KeyError: raise ValueError( "FX rates not available for rate={}, quote_currency={}." ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n # into the correct order, any columns with values of -1 will pull from\r\n```", "severity": "minor", "line": 26 } ]
1
python
context.set_details(err.details()) context.set_code(err.code()) self.logger.error( f'Error while getting responses from deployments: {err.details()}' ) r = Response() if err.request_id: r.header.reque...
Review this code and list any quality issues.
[ { "issue": "I would rename to `response_id_to_index` or something like that", "severity": "minor", "line": 26 } ]
1
python
yield { 'author': traverse_obj(replies, ('member', 'name')), 'author_id': traverse_obj(replies, ('member', 'mid')), 'author_thumbnail': traverse_obj(replies, ('member', 'face')), 'text': traverse_obj(replies, ('content', 'message')), 'id': ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n def _get_comments(self, video_id, ep_id):\r\n for i in itertools.count(0):\r\n comment_api_raw_data = self._download_json(\r\n 'https://api.bilibili.tv/reply/web/root', video_id,\r\n note=f'Downloading comment page {i}',\r\n ...
1
python
>>> io = DataCatalog() >>> # get data sets where the substring 'raw' is present >>> raw_data = io.list(regex_search='raw') >>> # get data sets which start with 'prm' or 'feat' >>> feat_eng_data = io.list(regex_search='^(prm|feat)') >>> # get data sets which en...
Review this code and list any quality issues.
[ { "issue": "Is this the cache that add matched pattern into catalog? If so why do we need to keep it separately instead of just creating the entry in catalog?", "severity": "major", "line": 26 } ]
1
python
Example: :: >>> from kedro.framework.session import KedroSession >>> from kedro.framework.startup import bootstrap_project >>> from pathlib import Path >>> # If you are creating a session outside of a Kedro project (i.e. not using >>> # `kedro run` or `kedro jupyter`), you ...
Review this code and list any quality issues.
[ { "issue": "Previously we called `.resolve()` on all options `project_path` as well as `Path.cwd()` and now only on `_find_kedro_project(Path.cwd()).resolve()`, why did that change?", "severity": "minor", "line": 26 } ]
1
python
if self.access_token is None: raise ExtractorError('Getting token failed', expected=True) def _real_initialize(self): if not self.access_token: self.raise_login_required('Login is required to access any iPrima content', method='password') def _raise_access_error(self, error_cod...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n r'let\\s+videos\\s*=\\s*([\\'\"])(?P<id>p\\d+)\\1',\r\n```", "severity": "minor", "line": 26 } ]
1
python
"""A camera able to move through a scene. .. SEEALSO:: :mod:`.moving_camera_scene` """ __all__ = ["CameraFrame", "MovingCamera"] import math import operator from numpy import string_ from .. import config from ..camera.camera import Camera from ..constants import * from ..mobject.frame import ScreenRectangl...
Review this code and list any quality issues.
[ { "issue": "I don't like *-imports in library files.\r\n```suggestion\r\nfrom ..constants import LEFT, RIGHT, UP, DOWN, ORIGIN\r\n```", "severity": "minor", "line": 19 } ]
1