language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | from typing import Any, Dict
from pydantic import BaseModel, Field, model_validator
class AzureAISearchConfig(BaseModel):
collection_name: str = Field("mem0", description="Name of the collection")
service_name: str = Field(None, description="Azure Cognitive Search service name")
api_key: str = Field(None... | Review this code and list any quality issues. | [
{
"issue": "Can you please elaborate more on what compression is here?",
"severity": "minor",
"line": 11
}
] | 1 |
python | post_auto = get_autoscale_on() if auto is None else auto
set_lim((-0.5, 0.5), auto=auto)
assert post_auto == get_autoscale_on()
fig.canvas.draw()
np.testing.assert_array_equal(get_lim(), (-0.5, 0.5))
@check_figures_equal()
def test_culling(fig_test, fig_ref):
xmins = (-100, -50)
for fig, xmin... | Review this code and list any quality issues. | [] | 0 |
python | store = await self.get_key_value_store()
return await store.get_auto_saved_value(self._CRAWLEE_STATE_KEY, default_value)
async def _save_crawler_state(self) -> None:
store = await self.get_key_value_store()
await store.persist_autosaved_values()
async def get_data(
self,
... | Review this code and list any quality issues. | [] | 0 |
python | path = Path(f"{STDIN_PLACEHOLDER}{str(path)}")
if path.suffix == ".ipynb" and not jupyter_dependencies_are_installed(
warn=verbose or not quiet
):
continue
if verbose:
out(f'Found input source: "{path}"', fg="blue")
source... | Review this code and list any quality issues. | [] | 0 |
python | from .common import InfoExtractor
class Canal1IE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.|noticias\.)?canal1\.com\.co/(?:[^?&])+/(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://canal1.com.co/noticias/napa-i-una-cadena-de-produccion-de-arroz-que-se-quedo-en-veremos-y-abandonada-en-el-departamento-... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _VALID_URL = r'https?://(?:www\\.|noticias\\.)?canal1\\.com\\.co/(?:[^?#&])+/(?P<id>[\\w-]+)'\r\n```",
"severity": "minor",
"line": 5
}
] | 1 |
python | (980, 3.8, 1.5, 0.010750678886113882),
(980, 3.8, 15, 1.0),
(980, 38, 0.0015, 3.0547506e-316),
(980, 38, 0.15, 8.6191646313e-314),
pytest.param(980, 38, 1.5, 1.1824454111413493e-291,
marks=pytest.mark.xfail(
reason="Bug in underlying Boost mat... | Review this code and list any quality issues. | [
{
"issue": "Since the other changes in this PR appear to be in the \"correct direction,\" can you explain what's going on here?\r\n\r\nI checked out your branch locally on ARM Mac and didn't need the looser tol for it to pass--has something got slightly worse on a particular platform or is this some unrelated f... | 1 |
python | pattern=pat,
replacement=repl,
max_replacements=pa_max_replacements,
)
return self._from_pyarrow_array(result)
def _str_capitalize(self) -> Self:
return self._from_pyarrow_array(pc.utf8_capitalize(self._pa_array))
def _str_title(self) -> Self:
return sel... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n\r\n def _str_removeprefix(self, prefix: str):\r\n if prefix == \"\":\r\n return self\r\n starts_with = pc.starts_with(self._pa_array, pattern=prefix)\r\n removed = pc.utf8_slice_codeunits(self._pa_array, len(prefix))\r\n result = pc.if_else... | 1 |
python | (source / 'foo.py').touch()
(source / 'bar.py').touch()
target = self.tmpdir / 'source.pyz'
zipapp.create_archive(str(source), str(target), main='pkg.mod:fn')
with zipfile.ZipFile(str(target), 'r') as z:
self.assertEqual(1, z.namelist().count('__main__.py'))
def test_mai... | Review this code and list any quality issues. | [] | 0 |
python | from cognee.shared.logging_utils import get_logger
from .IngestionData import IngestionData
logger = get_logger(__name__)
# Threshold in seconds above which S3 operations are logged as slow
S3_SLOW_OPERATION_THRESHOLD_SEC = 10.0
def create_s3_binary_data(s3_path: str, name: Optional[str] = None) -> "S3BinaryData":... | Review this code and list any quality issues. | [
{
"issue": "This try/except is redundant. \"content_hash\" is always set in ensure_metadata.",
"severity": "minor",
"line": 26
}
] | 1 |
python | # The health_overview response can be at root level or wrapped in 'content'
# Handle both structures for compatibility
data = event.get("content", event)
activity = data.get("activity", {})
sleep = data.get("sleep")
sleep_day = None
sleep_night = None
minutes_re... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n TRACKER_WELLNESS_STATUS_UPDATED, data[\"petId\"], payload\n```\nWe should not use `.get()` here, ID is a string.",
"severity": "minor",
"line": 26
}
] | 1 |
python | import os
import subprocess
from typing import List, Optional
from facefusion import ffprobe_builder
from facefusion.types import Command
def run_ffprobe(commands : List[Command]) -> subprocess.Popen[bytes]:
commands = ffprobe_builder.run(commands)
process = subprocess.Popen(commands, stderr = subprocess.PIPE, std... | Review this code and list any quality issues. | [
{
"issue": "no, it is not the task of this method to pre-handle process\n\nI also doubt that wait is actual needed\n\nreturn subprocess.Popen(commands, stderr = subprocess.PIPE, stdout = subprocess.PIPE)",
"severity": "minor",
"line": 12
}
] | 1 |
python | for prefix, expected_color_values in expected_values.items():
if col_name.startswith(prefix):
return expected_color_values
return None
for color_column in color_columns:
expected_color_values = get_expected_color_values(color_column)
char... | Review this code and list any quality issues. | [] | 0 |
python | # get log sigma
log_sigma = np.log(np.maximum(sigma, 1e-10))
# get distribution
dists = log_sigma - log_sigmas[:, np.newaxis]
# get sigmas range
low_idx = np.cumsum((dists >= 0), axis=0).argmax(axis=0).clip(max=log_sigmas.shape[0] - 2)
high_idx = low_idx + 1
lo... | Review this code and list any quality issues. | [
{
"issue": "Would be nice to link to Karras paper :)",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'url': 'https://www.douyu.com/topic/ydxc?rid=6560603',
'info_dict': {
'id': '6560603',
'display_id': '6560603',
'ext': 'flv',
'title': 're:^阿余:新年快乐恭喜发财! [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
'description': 're:.*直播时间.*',
'thumbnai... | Review this code and list any quality issues. | [
{
"issue": "This isn't used? (Or if it is used and I am missing it, it would be redundant if the suggestion for `_calc_sign()` is applied)\r\n```suggestion\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
self.assertEqual(report.return_code, 123)
report.failed(Path("e2"), "boom")
self.assertEqual(len(out_lines), 0)
self.assertEqual(len(err_lines), 2)
self.assertEqual(err_lines[-1], "error: cannot format e2: boom")
self.assertEqual(
... | Review this code and list any quality issues. | [] | 0 |
python | attentions = outputs.attentions[0]
attentions.retain_grad()
output_tensor.flatten()[0].backward(retain_graph=True)
if outputs.hidden_states is not None:
self.assertIsNotNone(hidden_states.grad)
if self.has_attentions and outputs.attentions is not None:
self... | Review this code and list any quality issues. | [
{
"issue": "Should be handled by the training tests then so we shouldnt need it; the one above checks a bit more so I'm fine with that test",
"severity": "minor",
"line": 26
}
] | 1 |
python | {
'label': wording.get('face_mask_blur_slider_label'),
'step': 0.01,
'minimum': 0,
'maximum': 1,
'value': facefusion.globals.face_mask_blur,
'interactive': True
}
face_mask_pad_top_slider_args : Dict[str, Any] =\
{
'label': wording.get('face_mask_pad_top_slider_label'),
'step': 0.01,
'minimum': 0,
... | Review this code and list any quality issues. | [] | 0 |
python | class AgentActorBase(ActorBase):
"""A agent actor for multi-agent orchestration running on Agent runtime."""
def __init__(
self,
agent: Agent,
internal_topic_type: str,
exception_callback: Callable[[BaseException], None],
agent_response_callback: Callable[[DefaultTypeAli... | Review this code and list any quality issues. | [] | 0 |
python | "columns": [],
}
with (
freeze_time("2024-01-15"),
app.test_request_context(
json={
"queries": [
{
"filters": [
{
"col": "__timestamp",
... | Review this code and list any quality issues. | [
{
"issue": "Debug print statements should be removed from test code or replaced with proper logging. Consider using `logger.debug()` or removing this entirely.\n```suggestion\n\n```",
"severity": "critical",
"line": 26
}
] | 1 |
python | 'uploader': 'CBCC-NEW',
'chapters': [
{'end_time': 1196.0, 'start_time': 0.0},
{'end_time': 1398.0, 'start_time': 1196.0},
{'end_time': 1753.0, 'start_time': 1398.0},
{'end_time': 2395.0, 'start_time': 1753.0},
{'end_time': 2716... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n '_format_sort_fields': ('res', 'proto'), # Prioritize direct http formats over HLS\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | ]
SIMPLE_CASES_PY2 = [
"numeric_literals_py2",
"python2",
"python2_unicode_literals",
]
EXPERIMENTAL_STRING_PROCESSING_CASES = [
"cantfit",
"comments7",
"long_strings",
"long_strings__edge_case",
"long_strings__regression",
"percent_precedence",
]
PY310_CASES = [
"pattern_matc... | Review this code and list any quality issues. | [
{
"issue": "I guess `mypy` has some advanced analysis for the test case lists, since the hint isn't needed for other lists. Should I:\r\n\r\n1) add hints for all case lists\r\n2) add it just here and remove it when the first entry is added\r\n3) add test infra later?",
"severity": "minor",
"line": 26
... | 1 |
python | video_urls = []
video_files = video.get('video_files')
if isinstance(video_files, list):
video_urls.extend(video_files)
elif isinstance(video_files, dict):
video_urls.extend(video_files.values())
video_urls = list(set(video_urls))
video_prefix = video_u... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n token = filesh.get(str(height))\r\n```\r\n\r\ncan remove the compat_str now",
"severity": "minor",
"line": 26
}
] | 1 |
python | total_frames = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
if end is not None and end > total_frames:
raise Exception("Requested frames are outbound")
start = max(start, 0)
end = min(end, total_frames) if end is not None else total_frames
video.set(cv2.CAP_PROP_POS_FRAMES, start)
return video, ... | Review this code and list any quality issues. | [
{
"issue": "I'd probably call it `iterative_seek`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | for key, value in extract_attributes(page_elem).items():
if key.startswith(':'):
attrs[key[1:]] = self._parse_json(
value, video_id, transform_source=unescapeHTML, fatal=False)
return attrs
class ZaikoIE(ZaikoBaseIE):
_VALID_URL = r'https?://(?:[\w-]+\.)?zai... | Review this code and list any quality issues. | [
{
"issue": "I know you can't actually run this test currently, but if you could, the test would still check for `thumbnail` and ignore `thumbnails`, so let's just do this\r\n```suggestion\r\n 'thumbnail': r're:^https://[\\w.-]+/\\w+/\\w+',\r\n 'thumbnails': 'count:2',\r\n```\r\nand add a `... | 1 |
python | 'format_id': format_id,
'format_note': format_name,
'dynamic_range': 'hdr10' if is_hdr else None,
'has_drm': format_response.get('drm', 0) != 0,
}
for f in formats:
f.update(common_info)
return formats, subtitles
def _extract_video_native_sub... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n api_responses = [self._get_video_api_response(url, video_id, series_id, 'srt', 'hls', 'hd')]\r\n self._check_api_response(api_responses[0])\r\n qualities = traverse_obj(api_responses, (0, 'fl', 'fi', ..., 'name')) or ('shd', 'fhd')\r\n```",
"severity": "min... | 1 |
python | 'isKollectiveAgentInstalled': 'false',
'isEmbed': 'false',
'responseType': 'json',
}
)
delivery = delivery_info['Delivery']
session_start_time = int_or_none(delivery.get('SessionStartTime'))
# Podcast stream is usually the combined streams. W... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'cast': traverse_obj(delivery, ('Contributors', ..., 'DisplayName')),\r\n```\r\njust this should be enough, no?",
"severity": "minor",
"line": 26
}
] | 1 |
python | if initial_value is None:
return None
elif (
self.grad_clip_warmup_steps is None
or self.grad_clip_warmup_factor is None
or step > self.grad_clip_warmup_steps
):
return initial_value
else:
return self.grad_clip_warmup_factor... | Review this code and list any quality issues. | [
{
"issue": "From a cleaner code perspective, maybe it would be better to have just 1 formula and use `self.warmup_min_lr` to set the starting lr. Something like:\r\n```\r\nwarmup_min_lr = self.warmup_min_lr if self.warmup_min_lr is not None else 0.1 * initial_lr\r\n...\r\nreturn warmup_min_lr + (initial_lr - wa... | 1 |
python | 'url': 'https://www.filmarchiv.at/de/filmarchiv-on/video/f_0305p7xKrXUPBwoNE9x6mh',
'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)',
'info_dict': {
'id': 'f_0305p7xKrXUPBwoNE9x6mh',
'ext': 'mkv',
'title': 'Der Wurstelprater zur Kaiserzei... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n og_img = self._html_search_meta('og:image', webpage, 'image URL', fatal=True)\r\n prefix = self._search_regex(\r\n r'/videostatic/([^/]+/[^_]+_[^/]+)/poster.jpg', og_img, 'prefix')\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | links_state=links_state,
) # NOTE: we still compute jacobian for all dofs as we haven't found a clean way to implement this
# copy to multi-link jacobian (only for the effective n_dofs instead of self.n_dofs)
for i_dof in range(n_dofs):
... | Review this code and list any quality issues. | [] | 0 |
python | mode = 'album'
mode_id = '4'
content_id = album_id
url_part = f'aid/{album_id}'
else:
url_parts = ('category', 'category_id') if c_mode == 'category' else ('title', 'channel')
mode = c_mode
mode_id = '1' if c_mode == 'category' else '3'
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n f'{host}/media/ajax/component/boxList/{url_part}', content_id,\r\n query={'page': i, 'page_only': 1}, data=urlencode_postdata(data))\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | TaskInstanceHistory.task_id == ti.task_id,
TaskInstanceHistory.run_id == ti.run_id,
TaskInstanceHistory.map_index == ti.map_index,
TaskInstanceHistory.try_number == old_try_number,
TaskInstanceHistory.task_instance_id == old_ti_id,
... | Review this code and list any quality issues. | [] | 0 |
python | type(self) is MmprojModel:
raise TypeError(f"{type(self).__name__!r} should not be directly instantiated")
if self.is_mistral_format and not _mistral_common_installed:
raise ImportError(_mistral_import_error_msg)
self.dir_model = dir_model
self.ftype = ftype
sel... | Review this code and list any quality issues. | [
{
"issue": "maybe this also work (with `find_hparams` and `optional = True`):\n\n```suggestion\n if \"rope_theta\" not in self.rope_parameters and (rope_theta := self.find_hparams([\"rope_theta\", \"global_rope_theta\", \"rotary_emb_base\"], True)) is not None:\n```",
"severity": "minor",
"li... | 1 |
python | 'url': 'https://mir24.tv/news/16635210/dni-kultury-rossii-otkrylis-v-uzbekistane.-na-prazdnichnom-koncerte-vystupili-zvezdy-rossijskoj-estrada',
'info_dict': {
'id': '16635210',
'title': 'Дни культуры России открылись в Узбекистане. На праздничном концерте выступили звезды российской эст... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n iframe_url = self._search_regex(\r\n r'<iframe\\b[^>]+\\bsrc=[\"\\'](https?://mir24\\.tv/players/[^\"\\']+)',\r\n webpage, 'iframe URL')\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import int_or_none, str_or_none, traverse_obj
class BooyahBaseIE(InfoExtractor):
_BOOYAH_SESSION_KEY = None
def _real_initialize(self):
if not BooyahBaseIE._BOOYAH_SESSION_KEY:
initial_request = self._request_webpage(
'https:/... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n headers={'Booyah-Session-Key': self._BOOYAH_SESSION_KEY}, fatal=False) or {}\r\n```",
"severity": "minor",
"line": 17
}
] | 1 |
python | return os.path.join(get_cache_dir(), "exr")
def get_usd_cache_dir():
return os.path.join(get_cache_dir(), "usd")
def clean_cache_files():
folder = gs.utils.misc.get_cache_dir()
try:
shutil.rmtree(folder)
except:
pass
os.makedirs(folder)
def assert_gs_tensor(x):
if not isins... | Review this code and list any quality issues. | [] | 0 |
python | dn_2_1.last_edit_date = current_datetime + timedelta(6)
assert dn_1_1.is_up_to_date
assert dn_2_1.is_up_to_date
assert dn_1_2.is_up_to_date
assert dn_2_2.is_up_to_date
assert not dn_3.is_up_to_date
dn_2_1.last_edit_date = current_datetime + timedelta(2)
dn_2_2.la... | Review this code and list any quality issues. | [] | 0 |
python | condenser_updates = {}
if agent.condenser and isinstance(agent.condenser, LLMSummarizingCondenser):
condenser_updates["llm"] = agent.condenser.llm.model_copy(update={"metadata": get_llm_metadata(
model_name=agent.condenser.llm.model,
llm_type="condense... | Review this code and list any quality issues. | [
{
"issue": "We didn't raise and error here so the user could be re-directed into the settings setup flow. The current logic will require the user to manually delete their settings file to use the CLI again",
"severity": "critical",
"line": 26
}
] | 1 |
python | import numpy as np
import pandas as pd
from typing import Text, Union
import copy
from ...utils import get_or_create_path
from ...log import get_module_logger
import torch
import torch.nn as nn
import torch.optim as optim
from .pytorch_utils import count_parameters
from ...model.base import Model
from ...data.dataset... | Review this code and list any quality issues. | [
{
"issue": "evaluation metric.\r\nThs comment applies to other modifications",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'title': 'こながめでたい日2024の視聴ページ | PIA LIVE STREAM(ぴあライブストリーム)',
'live_status': 'was_live',
'comment_count': 1000,
},
'params': {
'skip_download': True,
'ignore_no_formats_error': True,
},
},
{
'u... | Review this code and list any quality issues. | [
{
"issue": "The embed players on these five platforms are either scripts or iframes, and they all have a `src` attribute.",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'ext': 'mp4',
'title': 'Siberi võmm / Operatsioon "Öö"',
'thumbnail': r're:https://.+\.jpg(?:\?c=\d+)?$',
# 'description': 'md5:53cabf3c5d73150d594747f727431248',
'description': 'md5:8ef98f38569d6b8b78f3d350ccc6ade8',
'upload_date': '20170523',
'ti... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'manifest_url': manifest_url,\r\n```\r\n\r\nshould just use `manifest_url` key here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert pod.shards[0].args[1].name == 'pod/shard-0/rep-1'
assert pod.shards[0].args[2].name == 'pod/shard-0/rep-2'
assert pod.shards[1].args[0].name == 'pod/shard-1/rep-0'
assert pod.shards[1].args[1].name == 'pod/shard-1/rep-1'
assert pod.shards[1].args[2].name == 'pod/shard-1/rep-2'
... | Review this code and list any quality issues. | [] | 0 |
python | class ArrowTip(VMobject):
r"""Base class for arrow tips.
Examples
--------
Cannot be used directly, only intended for inheritance::
>>> tip = ArrowTip()
Traceback (most recent call last):
...
NotImplementedError: Has to be implemented in inheriting subclasses.
Ins... | Review this code and list any quality issues. | [
{
"issue": "Suggestion: add a \"See also\" section that points to all the pre-defined classes",
"severity": "minor",
"line": 26
}
] | 1 |
python | from os import PathLike
from pathlib import Path
from typing import TYPE_CHECKING, Annotated, Any, Literal, TypeAlias, cast, overload
from urllib.parse import urlparse
import pydantic
import pydantic_core
from genai_prices import calc_price, types as genai_types
from opentelemetry._events import Event # pyright: igno... | Review this code and list any quality issues. | [
{
"issue": "Maybe add a comment asking to check which mime types were included in 3.11+, so that we don't do this unnecessarily when dropping Python versions?\r\n\r\n```suggestion\r\n# TODO check for added mimetypes in Python 3.11 when dropping support for Python 3.10:\r\n```",
"severity": "minor",
"lin... | 1 |
python | candidates: Mapping[str, Iterator[Candidate]],
information: Mapping[str, Iterator[PreferenceInformation]],
backtrack_causes: Sequence[PreferenceInformation],
) -> Iterable[str]:
"""Produce a subset of identifiers that should be considered before others.
Currently pip narrows the fol... | Review this code and list any quality issues. | [] | 0 |
python | if match_dict["children"]:
for child in match_dict.get("children"):
yield from get_locations(child)
def parse_json(capa_data):
"""Parse json produced by capa"""
ghidra_data = []
rules = capa_data["rules"]
for rule in rules.keys():
# loosely coupled location & node data lis... | Review this code and list any quality issues. | [
{
"issue": "Please add a comment explaining what is being indexed",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.gguf_writer.add_expert_used_count(self.hparams["num_experts_per_tok"])
self.gguf_writer.add_expert_feed_forward_length(self.hparams["moe_intermediate_size"])
self.gguf_writer.add_expert_shared_feed_forward_length(self.hparams["moe_shared_expert_intermediate_size"])
self.gguf_wri... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n new_name = name.replace(\"e_score_correction_bias\", \"e_score_correction.bias\")\r\n```\r\nI would prefer this (it's consistent with the naming for all other models), ~but I guess it's too late now.~",
"severity": "minor",
"line": 26
}
] | 1 |
python | If you want to use your own proxies, use the {@apilink ProxyConfigurationOptions.proxyUrls} option. Your list of
proxy URLs will be rotated by the configuration if this option is provided.
"""
def __init__(
self,
*,
proxy_urls: list[str] | None = None,
new_url_function: _New... | Review this code and list any quality issues. | [
{
"issue": "Mypy was very aggressive when I wanted to use **|** on this specific line. I got bullied into using Union",
"severity": "minor",
"line": 26
}
] | 1 |
python | # wait between 3.0 and 10.5 seconds after each task
wait_time = between(3.0, 10.5)
"""
return lambda instance: min_wait + random.random() * (max_wait - min_wait)
def constant(wait_time):
"""
Returns a function that just returns the number specified by the wait_time argument
Exampl... | Review this code and list any quality issues. | [
{
"issue": "The double colon is actually not a typo (though I can definitely see why one would think so 😄). It's ReStructuredText syntax.\r\n\r\nScreenshot of API docs without double `:`:\r\n\r\n",
"s... | 1 |
python | from .nfhsnetwork import NFHSNetworkIE
from .nfl import (
NFLIE,
NFLArticleIE,
)
from .nhk import (
NhkVodIE,
NhkVodProgramIE,
)
from .nhl import NHLIE
from .nick import (
NickIE,
NickBrIE,
NickDeIE,
NickNightIE,
NickRuIE,
)
from .niconico import NiconicoIE, NiconicoPlaylistIE, Nicon... | Review this code and list any quality issues. | [] | 0 |
python | """
# ignore missing values when computing bin thresholds
missing_mask = np.isnan(col_data)
if missing_mask.any():
col_data = col_data[~missing_mask]
# If sample_weight is not None and 0-weighted values exist, we need to
# remove those before calculating the distinct points.
if sample_w... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n from numpy.lib.stride_tricks import sliding_window_view\r\n bin_thresholds = sliding_window_view(distinct_values).mean(axis=1)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import ExtractorError
class EbayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ebay\.com/itm/(?P<id>\d+)'
_TEST = {
'url': 'https://www.ebay.com/itm/194509326719',
'info_dict': {
'id': '194509326719',
'ext': 'mp4',
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n video_json = self._search_json(r'\"video\":', webpage, 'video json', video_id)\r\n```",
"severity": "minor",
"line": 24
}
] | 1 |
python | if isinstance(value, Binary):
return True
elif isinstance(value, bytearray):
return True
elif six.PY3 and isinstance(value, six.binary_type):
return True
return False
def _is_set(self, value):
if isinstance(value, collections_abc.Set):
... | Review this code and list any quality issues. | [
{
"issue": "`isinstance` actually takes a tuple with multiple types, so this can be simplified to:\r\n```\r\nif isinstance(value, (list, tuple)):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | weight_decay (float, optional): weight decay (L2 penalty) (default: 0)
amsgrad (boolean, optional): whether to use the AMSGrad variant of this
algorithm from the paper `On the Convergence of Adam and Beyond`_
(default: False) NOT SUPPORTED in DeepSpeed CPUAdam!
ad... | Review this code and list any quality issues. | [
{
"issue": "@mrwyattii @RezaYazdaniAminabadi Can you please elaborate a bit more on what error/issue you observed when you added this warning?",
"severity": "minor",
"line": 26
}
] | 1 |
python | frontend_user: deps.FrontendUserId = Depends(deps.get_frontend_user_id),
api_client: ApiClient = Depends(deps.get_api_client),
db: Session = Depends(deps.get_db),
):
"""
Get message with the most children from the tree of the provided message.
"""
pr = PromptRepository(db, api_client, frontend_u... | Review this code and list any quality issues. | [
{
"issue": "Could we call the command \"restore\" or simply \"undelete\"?\r\nand maybe add `response_model=None,` to explicitly show that it does not return anything.",
"severity": "minor",
"line": 26
}
] | 1 |
python | if player_url:
self.report_warning(
f'nsig extraction failed: Some formats may be missing\n'
f' n = {query["n"][0]} ; player = {player_url}\n'
f' {bug_reports_message(before="")}',
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n pot_policy: GvsPoTokenPolicy = self._get_default_ytcfg(client_name)['GVS_PO_TOKEN_POLICY'][StreamingProtocol.HTTPS]\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
class BTVPlusIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?btvplus\.bg/produkt/predavaniya/(?P<id>\d+)/.*'
_TESTS = [{
'url': 'https://btvplus.bg/produkt/predavaniya/60119/sezon-1/ostrovat-na-100-te-grivni-sezon-1-epizod-11-02-10-2024',
'info_dict': {
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n player_config = self._download_json(\r\n urljoin('https://btvplus.bg', player_url), video_id)['config']\r\n```",
"severity": "minor",
"line": 25
}
] | 1 |
python | unique_id: str,
color: RGBColor | None = None,
) -> None:
"""Initialize LocalCalendarEntity."""
self._store = store
self._calendar = calendar
self._calendar_lock = asyncio.Lock()
self._event: CalendarEvent | None = None
self._attr_name = name
self._att... | Review this code and list any quality issues. | [
{
"issue": "I don't think we need this\r\n```suggestion\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
unified_timestamp,
urlencode_postdata,
strip_or_none,
)
class ParlerIE(InfoExtractor):
"""Extract videos from posts on parler.com."""
_UUID_RE = r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12... | Review this code and list any quality issues. | [
{
"issue": "set this to `IE_DESC` to set extractor description",
"severity": "major",
"line": 13
}
] | 1 |
python | sys_cuda_major, _ = installed_cuda_version()
torch_cuda_major = int(torch.version.cuda.split('.')[0])
cuda_capability = torch.cuda.get_device_properties(0).major #ignore-cuda
if cuda_capability < 8:
if verbose:
self.warning("NVIDIA Inference is on... | Review this code and list any quality issues. | [] | 0 |
python | import importlib
import os
import shutil
import sys
import unittest
from pathlib import Path
from yt_dlp import Config
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
TEST_DATA_DIR = Path(os.path.dirname(os.path.abspath(__file__)), 'testdata')
sys.path.append(str(TEST_DATA_DIR))
importl... | Review this code and list any quality issues. | [
{
"issue": "should this be moved below where we import from `yt_dlp.plugins`?",
"severity": "minor",
"line": 7
}
] | 1 |
python | 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 NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ... | Review this code and list any quality issues. | [
{
"issue": "Missing version string.\n```rst\n.. versionadded:: 2.6\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | mock_sm.return_value.__exit__ = MagicMock(return_value=False)
with (
patch('storage.user_store.session_maker', mock_sm),
patch.object(
UserStore,
'create_default_settings',
new_callable=AsyncMock,
return_value=None,
),
):
result = ... | Review this code and list any quality issues. | [] | 0 |
python | )
assert response.ok
return collection_name
@pytest.fixture(scope="module")
def phrase_collection():
collection_name = setup_phrase_collection()
yield collection_name
drop_collection(collection_name)
@pytest.mark.parametrize(
"phrase,expected_count,expected_ids,description",
[
(... | Review this code and list any quality issues. | [] | 0 |
python | ulysses_mesh = ctx._parallel_config.context_parallel_config._ulysses_mesh
world_size = ctx._parallel_config.context_parallel_config.ulysses_degree
group = ulysses_mesh.get_group()
B, S_LOCAL, H, D = grad_out.shape
H_LOCAL = H // world_size
grad_out = grad_out.reshape(B, S_LOCAL... | Review this code and list any quality issues. | [
{
"issue": "Bit of a nit, but I would prefer to avoid using camel case for functions. We can name this something like `_templated_unified_attention`",
"severity": "minor",
"line": 26
}
] | 1 |
python | def __init__(self, function: types.MethodType, mobject: Mobject, **kwargs) -> None:
self.function = function
method = mobject.apply_complex_function
super().__init__(method, function, **kwargs)
def _init_path_func(self) -> None:
func1 = self.function(complex(1))
self.path_ar... | Review this code and list any quality issues. | [
{
"issue": "Type hints should, at this point, only be added in the code, not in the docstring.\r\n\r\n```suggestion\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def softfork_active(node, key):
"""Return whether a softfork is active."""
return node.getdeploymentinfo()['deployments'][key]['active']
def set_node_times(nodes, t):
for node in nodes:
node.setmocktime(t)
def check_node_connections(*, node, num_in, num_out):
info = node.getnetworkinfo()
... | Review this code and list any quality issues. | [
{
"issue": "Maybe assert for this at the beginning of the `fill_mempool`\r\n```python\r\n assert_equal(node.getnetworkinfo()['relayfee'], Decimal('0.00001000'))\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | if not is_credentials_field_name(field_name)
}
# Create a triggered preset for the graph
await create_preset(
graph.user_id,
LibraryAgentPresetCreatable(
graph_id=graph.id,
graph_version=graph.version,
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n logger.error(f\"Failed to migrate graph #{graph.id} trigger to preset: {e}\")\n```",
"severity": "critical",
"line": 26
}
] | 1 |
python | 'Content-Length': f'{len(d)}',
'Ytdl-request-proxy': '__noproxy__',
},
data=d)
with self.ydl.urlopen(request) as r:
resp = json.load(r)
# failing at this assertion means that the RPC server went wrong
# (KeyEror incl... | Review this code and list any quality issues. | [
{
"issue": "why use tempfile? Cant `subprocess.PIPE` be used?",
"severity": "minor",
"line": 26
}
] | 1 |
python | # this is not accurate for concurrency > 1
# but I believe it's not worthy to introduce complex logic to fix this
# instead we should support checkpoint (TODO)
for _ in data:
self._suggest()
def _suggest(self):
# returns next parameter set, or None if the space is alread... | Review this code and list any quality issues. | [
{
"issue": "if there is a uniform, this grid search will never end, right?",
"severity": "minor",
"line": 26
}
] | 1 |
python | cur_device_out = torch.chunk(torch_out, tp_size, dim=-1)[groups.get_tensor_model_parallel_rank()]
torch_grad = torch.chunk(torch_linear.weight.grad, tp_size, dim=0)[groups.get_tensor_model_parallel_rank()]
assert torch.allclose(linear.weight.grad, torch_grad.to(get_accelerator().current_device()), atol=... | Review this code and list any quality issues. | [] | 0 |
python | TRACK_API = 'https://www.monstercat.com/api/release/{release_id}/track-stream/{song_id}'
def _extract_tracks(self, table, album_meta):
for td in re.findall(r'<tr[^<]*>((?:(?!</tr>)[\w\W])+)', table): # regex by chatgpt due to lack of get_elements_by_tag
title = traverse_obj(get_element_by_clas... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n date = traverse_obj(html, ({lambda x: get_element_by_class('font-italic mb-medium d-tablet-none d-phone-block', html).partition('Released ')}, 2, {strip_or_none}, {unified_strdate}))\r\n```\r\nThe previous way was fatal, since the `get_element_by...` functions raise an error... | 1 |
python | **(extra_context or {}),
}
request.current_app = self.admin_site.name
return TemplateResponse(
request,
self.object_history_template
or [
"admin/%s/%s/object_history.html" % (app_label, self.opts.model_name),
"admin/%s/object_... | Review this code and list any quality issues. | [
{
"issue": "There's string casting here and then also inside `display_for_value()`, can you walk me through why we need both?",
"severity": "minor",
"line": 26
}
] | 1 |
python | .. versionadded:: 0.17
For a comparison between
:class:`~sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis`
and :class:`~sklearn.discriminant_analysis.LinearDiscriminantAnalysis`, see
:ref:`sphx_glr_auto_examples_classification_plot_lda_qda.py`.
Read more in the :ref:`User Guide <lda_qda... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n This should be left to `None` if `covariance_estimator` is used.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # let the service calls complete.
hass.async_create_task(script_obj.async_stop())
finish_service_event.set()
await hass.async_block_till_done()
assert script_was_running
assert were_no_events
assert not script_obj.is_running
assert len(events) == 0
async def test_delay_basic(hass: HomeAs... | Review this code and list any quality issues. | [
{
"issue": "This change converts valid Python 3 syntax to deprecated Python 2 syntax. In Python 3, multiple exceptions must be caught using parentheses: `except (ExceptionA, ExceptionB):`. The Python 2 syntax `except ExceptionA, ExceptionB:` is not valid in Python 3 and will cause a syntax error. This line shou... | 1 |
python | table_configuration = config.get(
"PoliciesTableConfigHandler.configuration", default_configuration
)
self.write(table_configuration)
class PoliciesHandler(BaseAPIV2Handler):
"""Handler for /api/v2/policies
Api endpoint to list and filter policy requests.
"""
allowed_met... | Review this code and list any quality issues. | [] | 0 |
python | video_info = self._download_json(
f'https://statics.tver.jp/content/episode/{video_id}.json', video_id,
query={'v': '5'}, headers={
'Origin': 'https://tver.jp',
'Referer': 'https://tver.jp/',
})
p_id = video_info['video']['accountID']
r... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n additional_content_info = traverse_obj(\r\n additional_info, ('result', 'episode', 'content'), get_all=False) or {}\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | "string": "test",
"int": 1,
}
],
dtype=pl.Struct(
[
pl.Field(
"date_range",
pl.List(pl.Datetime(time_unit="ms", time_zone="UTC")),
),
pl... | Review this code and list any quality issues. | [] | 0 |
python | self.controller_sasl_mechanism = self.isolated_controller_quorum.controller_sasl_mechanism
prop_file = self.prop_file(node)
self.logger.info("kafka.properties:")
self.logger.info(prop_file)
node.account.create_file(KafkaService.CONFIG_FILE, prop_file)
node.account.create_file(os... | Review this code and list any quality issues. | [
{
"issue": "We missed setting `transaction.version` for isolated kraft, resulting in the cluster using v0. Since this nullifies the suit `use_transactions_v2=True`, we will submit a patch later.",
"severity": "minor",
"line": 26
}
] | 1 |
python | if video_type not in {'series', 'episodes'}:
webpage = self._download_webpage(url, video_id, note='Resolving to new URL')
video_id = self._match_id(self._search_regex(
(r'canonical"\s*href="(https?://tver\.jp/[^"]+)"', r'&link=(https?://tver\.jp/[^?&]+)[?&]'),
web... | Review this code and list any quality issues. | [
{
"issue": "- Since we are extracting the player ID from a static URL, we could instead just hardcode the ID and skip the extra request\r\n- `url_transparent` is not needed here since we are not returning any additional metadata\r\n\r\n```suggestion\r\n # Player ID is taken from .content.brightcove.E... | 1 |
python | from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
RegexNotFoundError,
strip_or_none,
try_get
)
class RCTIPlusBaseIE(InfoExtractor):
def _real_initialize(self):
self._AUTH_KEY = self._download_json(
'https://api.rctiplu... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _VALID_URL = r'https://www\\.rctiplus\\.com/(?:programs/\\d+?/.*?/)?(?P<type>episode|clip|extra|live-event|missed-event)/(?P<id>\\d+)/(?P<display_id>[^/?#&]+)'\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | return response, metadata
elif self.stream_stub:
# TODO: Is this for loop necessary? Isn't the length always one?
for request in requests:
self._record_request_bytes_metric(request.nbytes)
with timer:
... | Review this code and list any quality issues. | [
{
"issue": "may we move it before the response is received? I think it makes semantically more sense",
"severity": "minor",
"line": 26
}
] | 1 |
python | d = {exc: 'value'}
assert exc in s
assert d[exc] == 'value'
def test_tool_retry_error_str():
"""Test that ToolRetryError has a meaningful string representation."""
part = RetryPromptPart(content='Invalid query syntax', tool_name='sql_query')
error = ToolRetryError(part)
assert str(error) == "... | Review this code and list any quality issues. | [
{
"issue": "This is a bit lossy because we don't get to see the original input or error type. Can you see if we can use the same rendering that is used when Pydantic `ValidationError` is raised and printed in terminal? We get the `ErrorDetails` from a `ValidationError` here, so maybe we can pass in the string m... | 1 |
python | .. manim:: GetValueExample
:save_last_frame:
class GetValueExample(Scene):
def construct(self):
line1 = Line(LEFT+(1/3)*UP, RIGHT+(1/3)*DOWN)
line2 = Line(DOWN+(1/3)*RIGHT, UP+(1/3)*LEFT)
angle = Angle(line1, line2, ra... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n r\"\"\"The angle between the lines AB and BC.\r\n```\r\n\r\nThis has to be a raw string because there is a backslash in the body. (Otherwise \\a is interpreted as one character as opposed to \\ and a.)",
"severity": "minor",
"line": 26
}
] | 1 |
python | continue # alchemy session.execute() doesn't support positional params
if parse_version(sqlalchemy.__version__) < (2, 0) and param == ":n":
continue # skip for older sqlalchemy versions
assert_frame_equal(
expected_frame,
pl.read_database(
... | Review this code and list any quality issues. | [
{
"issue": "test renamed to `test_read_database_uri_parameterised` and is further below",
"severity": "minor",
"line": 26
}
] | 1 |
python | TESTS_SAMPLE_POINTS_FROM_LABEL.append(
[{"labels": labels, "label_set": (1, 3, 5), "use_center": use_center}, (3, 1, 3), (3, 1)]
)
TEST_CONVERT_POINTS_TO_DISC = []
for radius in [1, 2]:
for disc in [True, False]:
image_size = (32, 32, 32)
point = torch.randn(3, 1, 3)
point_label... | Review this code and list any quality issues. | [] | 0 |
python | success = False
for i in range(MAX_COMMAND_DEBUG_TRIES):
if success:
break
llm_response = convo.send_message('dev_ops/debug.prompt',
{
'command': command['command'] if command is not None else None,
'user_input': u... | Review this code and list any quality issues. | [] | 0 |
python | 'height': 720,
},
'流畅': {
'width': 800,
'height': 480
}
}
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id=video_id)
json_stream = self._search_regex(r'"stream":\s+"([a-zA-Z0-9+=/]... | Review this code and list any quality issues. | [
{
"issue": "since u didn't answer, I assume this is not expected\r\nIn that case, why not just:\r\n```suggestion\r\n stream_info_list = stream_data['data'][0]['gameStreamInfoList']\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'url': 'https://www.nicovideo.jp/series/12312/',
'info_dict': {
'id': '12312',
'title': 'バトルスピリッツ お勧めカード紹介(調整中)',
'description': '',
'uploader': '野鳥',
'uploader_id': '2275360',
},
'playlist_mincount': 103,
}, {
'url': 'https... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n series = self._call_api(list_id, 'list', {\r\n 'pageSize': 1,\r\n })['detail']\r\n\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
===========================
Vector Quantization Example
===========================
This example shows how one can use :class:`~sklearn.preprocessing.KBinsDiscretizer`
to perform vector quantization on a set of toy image, the raccoon face.
"""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-... | Review this code and list any quality issues. | [
{
"issue": "I think you can remove the full comment between \"Note that depending on the Scipy version\" until \"requires the package pooch to be installed\"",
"severity": "minor",
"line": 21
}
] | 1 |
python | if len(submobs1) == 0:
return self
elif len(submobs2) == 0:
submobs2 = [vmobject]
for sm1, sm2 in zip(*make_even(submobs1, submobs2)):
sm1.match_style(sm2)
return self
def set_color(self, color: ParsableManimColor, family: bool = True)... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n about_edge: Vector3DLike | None = None,\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | label_fill_opacity: Optional[float] = __d_label_fill_opacity
label_stroke_color: Optional[str] = __d_label_stroke_color
label_stroke_opacity: Optional[float] = __d_label_stroke_opacity
label_stroke_size: Optional[float] = __d_label_stroke_size
label_font_size: Optional[float] = __d_label... | Review this code and list any quality issues. | [] | 0 |
python | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none
)
class LastFMPlaylistBaseIE(InfoExtractor):
def _extract_current_page(self, url):
return int_or_none(self._search_regex(
r'\bpage=(\d+)', url, 'page', de... | Review this code and list any quality issues. | [
{
"issue": "this is fatal\r\n```sh\r\n>>> max([1, None, 2, None, 23])\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\nTypeError: '>' not supported between instances of 'NoneType' and 'int\r\n```",
"severity": "minor",
"line": 25
}
] | 1 |
python | gs.logger.info("Ignoring corrupted cache.")
if not is_cached_loaded:
with gs.logger.timer(f"Tetrahedralization with configuration {tet_cfg} and generating `.tet` file:"):
verts, elems = mu.tetrahedralize_mesh(mesh, tet_cfg)
os.makedirs(os.path.dirname(tet_file_path), exist_ok=True)... | Review this code and list any quality issues. | [
{
"issue": "`uvs = np.pad(original_uvs, ((0, len(verts) - n_original), (0, 0)))`",
"severity": "minor",
"line": 26
}
] | 1 |
python | out_d[idx] = _d if (mn - AFFINE_TOL) <= _d <= (mx + AFFINE_TOL) else target
if not align_corners and scale_extent:
warnings.warn("align_corners=False is not compatible with scale_extent=True.")
# compute output affine, shape and offset
new_affine = zoom_affine(affine_, out_d, diago... | Review this code and list any quality issues. | [
{
"issue": "It seems that the pixel dimensions (pixdim) are only updated in the Spacing transformation. This is why I previously suggested that we should only retain the `original_pixdim`, as the latest pixdim can be derived from the metadata in the MetaTensor and the affine transformation.\r\n\r\nAdditionally,... | 1 |
python | 'md5': 'bb47bab0e0802c2a60c24ef079dfe60f',
'info_dict': {
'id': '935718',
'ext': 'mp4',
'title': 'MY FACE REVEAL',
'description': 'md5:ec5901d41808b3746fed90face161612',
'thumbnail': 'https://ods.manyvids.com/1001061960/3aa5397f2a723ec4597e344df66ab845... | Review this code and list any quality issues. | [
{
"issue": "I would set a class constant like\r\n```py\r\n _API_BASE = 'https://www.manyvids.com/bff/store/video'\r\n```\r\nto reduce duplication and line-length",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'url': 'https://www.washingtonpost.com/posttv/world/iraq-to-track-down-antiquities-after-islamic-state-museum-rampage/2015/02/28/7c57e916-bf86-11e4-9dfb-03366e719af8_video.html',
'only_matching': True,
}]
@classmethod
def _extract_urls(cls, webpage):
return re.findall(
r'<iframe... | Review this code and list any quality issues. | [
{
"issue": "why are the md5 changing? is this a fragmented download? In that case, md5 check should be removed",
"severity": "minor",
"line": 26
}
] | 1 |
python | """A pyglet-based interactive 3D scene viewer."""
import copy
import os
import shutil
import sys
import time
import threading
from threading import Event, RLock, Semaphore, Thread
import imageio
import numpy as np
import OpenGL
from OpenGL.GL import *
import genesis as gs
from genesis.ext.pyrender.interaction.viewer... | Review this code and list any quality issues. | [
{
"issue": "Same. Use relative import here.",
"severity": "minor",
"line": 17
}
] | 1 |
python | # Get parent_location based on location, get parent_path based on path.
if module_path.name == "__init__.py":
# If the current module is in a package,
# need to leave the package first and then enter the parent module.
parent_module_path = module_path.parent.p... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # Import modules in subdirectories by module_path\r\n # to ensure assertion rewrites are not missed (#12659).\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | if url_parts is None:
# page is not routable
return
site_id, root_url, page_path = url_parts
return Site.objects.get(id=site_id)
@classmethod
def get_indexed_objects(cls):
content_type = ContentType.objects.get_for_model(cls)
return super().get_indexed_... | Review this code and list any quality issues. | [
{
"issue": "Shouldn’t this have logic to account for `private_page_options`? Avoid defaulting to `public` if it’s not in the list of allowed options?",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.axis_config,
self.z_axis_config,
)
self.z_normal = z_normal
self.num_axis_pieces = num_axis_pieces
self.light_source = light_source
self.dimension = 3
if self.z_axis_config.get("scaling") is None or isinstance(
self.z_axis_config.get("scal... | Review this code and list any quality issues. | [
{
"issue": "With the way log scaling works this would produce unintended effects for LogBase graphs. The `.x_min, x_max` approach is required.",
"severity": "minor",
"line": 26
}
] | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.