language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | crossed_in = np.full(len(detections), False)
crossed_out = np.full(len(detections), False)
if len(detections) == 0:
return crossed_in, crossed_out
if detections.tracker_id is None:
warnings.warn(
"Line zone counting skipped. LineZone requires tracker_id.... | Review this code and list any quality issues. | [
{
"issue": "I believe we use this in similar situations:\r\n\r\n```\r\nin_limits = (cross_products_1 > 0) == (cross_products_2 > 0)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | import pandas as pd
import pytest
import duckdb
import sys
import gc
class TestPandasDFNone(object):
# This used to decrease the ref count of None
def test_none_deref(self):
con = duckdb.connect()
gc.collect()
for _ in range(1000):
df = con.sql("select NULL::VARCHAR as a").... | Review this code and list any quality issues. | [
{
"issue": "Instead of looping in python, we can probably return a million (or more) `range()` result which immediately crashes the interpreter if you want to verify that ;-)\r\n`db.sql('select null::text from range(1000000)').df()`",
"severity": "critical",
"line": 14
}
] | 1 |
python | def _real_extract(self, url):
uploader_id = self._match_id(url)
webpage = self._download_webpage(url, uploader_id, headers={'User-Agent': 'User-Agent:Mozilla/5.0'})
room_id = self._html_search_regex(r'snssdk\d*://live\?room_id=(\d+)', webpage, 'room ID', default=None)
if room_id:
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n formats = self._extract_m3u8_formats(live_url, room_id, 'mp4', live=is_live)\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | }]
def _real_extract(self, url):
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
video_id = self._search_regex(r'omsid\s*=\s*"(\d+)"', webpage, 'video id')
params = {
'nonce': ''.join(random.choices(string.ascii_lowercase + string.digi... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'thumbnail': meta.get('titlepic'),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | "style",
[ConfigurationStyle.LEGACY, ConfigurationStyle.MODERN, ConfigurationStyle.TRIGGER],
)
@pytest.mark.usefixtures("setup_state_lock")
async def test_template_state_boolean_on(hass: HomeAssistant) -> None:
"""Test the setting of the state with boolean on."""
# Ensure the trigger executes for trigger co... | Review this code and list any quality issues. | [
{
"issue": "Why do we need to ensure this? What happens if we don't?",
"severity": "minor",
"line": 26
}
] | 1 |
python | @frame_center.setter
def frame_center(self, point: Point3DLike) -> None:
self._frame_center.move_to(point)
def capture_mobjects(self, mobjects: Iterable[Mobject], **kwargs: Any) -> None:
self.reset_rotation_matrix()
super().capture_mobjects(mobjects, **kwargs)
def get_value_tracker... | Review this code and list any quality issues. | [
{
"issue": "A comment rather than a suggestion for this PR.\r\n\r\n`MatrixMN` seems like the most fit alias _for now_, but we should actually make a new alias specifically for RGBA arrays, since `MatrixMN` is more fit for matrices representing linear maps which are applied on vectors. This was actually part of ... | 1 |
python | self.assertEqual(ref.obj, obj)
def test_can_reference_non_existent(self):
self.assertFalse(Object.objects.filter(id=12345).exists())
ref = ObjectReference.objects.create(obj_id=12345)
ref_new = ObjectReference.objects.get(obj_id=12345)
self.assertEqual(ref, ref_new)
with se... | Review this code and list any quality issues. | [
{
"issue": "Refer to 358fd21c47cdf7bda520ce73c5cfd82bba57827b and where the original test was added in `tests/backends/sqlite/test_features.py`.\r\n\r\nThe way this is currently defined the test is running on all backend when it should be SQLite specific.\r\n\r\nhttps://github.com/django/django/commit/358fd21c4... | 1 |
python | multi = Series(data, index=indexes)
assert isinstance(multi.index, MultiIndex)
# TODO: make this not cast to object in pandas 3.0
@pytest.mark.skipif(
not np_version_gt2, reason="StringDType only available in numpy 2 and above"
)
@pytest.mark.parametrize(
"data",
[
... | Review this code and list any quality issues. | [
{
"issue": "I suppose if/when we support `np.StringDtype`, we can treat the data as masked and then we hopefully won't be comparing `'nan'` to `np.nan`?",
"severity": "minor",
"line": 26
}
] | 1 |
python | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class ElTreceTVIE(InfoExtractor):
IE_DESC = 'El Trece TV (Argentina)'
_VALID_URL = r'https?://(?:www\.)?eltrecetv.com.ar/(?:[\w\-]+)/capitulos/temporada-(?:\d+)/(?P<id>[\w\-]+)/?'
_TESTS = [
{
'u... | Review this code and list any quality issues. | [
{
"issue": "yt-dlp is python3, you don't need these",
"severity": "minor",
"line": 2
}
] | 1 |
python | @check_superuser
def can_add(self, data):
"""
a user can create a job template if they are a superuser, an org admin
of any org that the project is a member, or if they have user or team
based permissions tying the project to the inventory source for the
given action as well ... | Review this code and list any quality issues. | [
{
"issue": "These 2 messages would be fine, but I'd argue the keys (which become keys in the response) should be \"inventory\" and then \"execution_environment\"",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.namespaces = {}
self.enums = {} # FIXIT 'enums' should belong to 'namespaces'
self.parser = hdr_parser.CppHeaderParser(
preprocessor_definitions=preprocessor_definitions
)
self.class_idx = 0
def _is_string_type(self, tp):
"""
Conservative check whe... | Review this code and list any quality issues. | [
{
"issue": "just `char` filed (integer value 0..255 / -128..127) will be handled as string too.",
"severity": "minor",
"line": 26
}
] | 1 |
python | # It would be good to think of better APIs for this that we could include in httpx 2.0
# since variable length tuples (especially of 4 elements) are quite unwieldly
if isinstance(value, tuple):
try:
filename, fileobj, content_type, headers = value # type: ignore
... | Review this code and list any quality issues. | [
{
"issue": "Okay maybe we should instead do it the other way. If the 4-tuple is used, just ignore the `content_type` variable. That'd be okay enough, matches `requests` more closely, and we can forget about fiddly case-based header checking.",
"severity": "minor",
"line": 26
}
] | 1 |
python | async for _items in group_iter:
yield self.response # current state of the response
async def stream_text(self, *, delta: bool = False, debounce_by: float | None = 0.1) -> AsyncIterator[str]:
"""Stream the text result as an async iterable.
!!! note
Result validators wi... | Review this code and list any quality issues. | [
{
"issue": "My suggestion above would mean passing the value through `RunContext` in this case as well... I kinda like having it as a separate arg, but that's harder to justify if we require the `ctx` arg and are in some cases passing it through there anyway",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'live_status': 'is_live',
},
}, {
'url': 'https://roya.tv/live-stream/10000',
'only_matching': True,
}]
def _real_extract(self, url):
media_id = self._match_id(url)
stream_json = self._download_json(f'https://ticket.roya-tv.com/api/v5/fastchannel/{media_id}', media_i... | Review this code and list any quality issues. | [
{
"issue": "The URL will always contain `live-stream`\r\n```suggestion\r\n 'is_live': True,\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
def __init__(self, mobject: Mobject, color: str, **kwargs) -> None:
super().__init__(mobject.set_color, color, **kwargs)
class ScaleInPlace(ApplyMethod):
"""Animation that scales an mobject by a certain factor.
Examples
--------
.. manim:: ScaleInPlaceExample
class ScaleInP... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n \"\"\"Animation that makes a mobject shrink to center.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def return_model(_: list[ModelMessage], info: AgentInfo) -> ModelResponse:
assert info.output_tools is not None
return ModelResponse(
parts=[
ToolCallPart('final_result', {'value': 'final'}),
ToolCallPart('regular_tool', {'x': 1}),
... | Review this code and list any quality issues. | [] | 0 |
python | # Verify IIR filter coefficients with the paper's MATLAB implementation
def test_iir_ba_output(self, xp):
b, a = gammatone(440, 'iir', fs=16000, xp=xp)
b2 = [1.31494461367464e-06, -5.03391196645395e-06,
7.00649426000897e-06, -4.18951968419854e-06,
9.02614910412011e-07]
... | Review this code and list any quality issues. | [
{
"issue": "Copied from my massive docs PR, https://github.com/scipy/scipy/pull/24130/files#diff-87d234831f50304546986134d3e6e8743a6c5032eb7527ff9cf0de6f6b4af5fdR764-R773\r\n\r\n```\r\nThe intention behind testing with different default dtypes is primarily to catch\r\nsubtle bugs that can arise with the ``torch... | 1 |
python | ## Request Parameters
- **search_type** (SearchType): Type of search to perform
- **datasets** (Optional[List[str]]): List of dataset names to search within
- **dataset_ids** (Optional[List[UUID]]): List of dataset UUIDs to search within
- **query** (str): The search query string
... | Review this code and list any quality issues. | [
{
"issue": "Should be `str(payload.search_type)` to avoid: TypeError: Object is not JSON serializable",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert self.execute_model_state is not None
hidden_states, input_batch, kv_connector_output = self.execute_model_state
self.execute_model_state = None # type: ignore
# Non-last PP rank: receive tokens and update state.
# Don't need to sample tokens here - just receive from last rank.
... | Review this code and list any quality issues. | [
{
"issue": "I think it'd be nice if we can do something like\n```suggestion\n if self.use_pp:\n # Broadcast to non-last ranks (handles spec decode multi-token)\n self.pp_handler.maybe_broadcast_sampled_tokens(\n sampler_output, num_sampled, num_rejected\n )... | 1 |
python | cfg.device,
device_ids=[cfg.gpu_ids[local_rank]],
broadcast_buffers=False,
find_unused_parameters=find_unused_parameters,
)
else:
model = build_dp(model, cfg.device, device_ids=cfg.gpu_ids)
data_loader = build_dataloader(
ds_train, # TO DO: convert i... | Review this code and list any quality issues. | [
{
"issue": "MMDet mostly uses mmcv under the hood, without this import you will not be able to use custom defined classes.",
"severity": "minor",
"line": 26
}
] | 1 |
python | super().__init__(args, **kwargs)
async def async_setup(self):
"""
Start the DataRequestHandler and wait for the GRPC and Monitoring servers to start
"""
if self.metrics_registry:
with ImportExtensions(
required=True,
help_text='You need to... | Review this code and list any quality issues. | [
{
"issue": "Same: I believe this should be a Counter and not a Gauge since the number cannot decrease",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
color_index = min(color_index, 1)
mob_color = interpolate_color(
new_colors[i - 1], new_colors[i], color_index
)
mob.set_color(mob_color, family=False)
break
ret... | Review this code and list any quality issues. | [
{
"issue": "**Nitpick (non-blocking)** : You can shorten this by using numpy. \r\nTo get the closest matching value of z_value in `pivots`, you can do something like that `np.abs(pivots - z_value).argmin()`. This will give the index of the closest value. Beware, it can be the value _above_ z_value, so the line ... | 1 |
python | SOURCE_DIR = DATA_DIR.joinpath("source")
SOURCE_DIR.mkdir(exist_ok=True, parents=True)
QLIB_DIR = DATA_DIR.joinpath("qlib")
QLIB_DIR.mkdir(exist_ok=True, parents=True)
class TestDumpData(unittest.TestCase):
FIELDS = "open,close,high,low,volume".split(",")
QLIB_FIELDS = list(map(lambda x: f"${x}", FIELDS))
... | Review this code and list any quality issues. | [] | 0 |
python | pipeline1 = pipeline(
[node(biconcat, ["input", "input1"], ["output1"], name="a")]
)
new_pipeline = pipeline(
[node(biconcat, ["input", "input1"], ["output2"], name="a")]
)
pattern = (
"Pipeline nodes must have unique names. The following node names "
... | Review this code and list any quality issues. | [] | 0 |
python | def random_bitflip(data):
data = list(data)
data[random.randrange(len(data))] ^= (1 << (random.randrange(8)))
return bytes(data)
def get_fee(tx_size, feerate_btc_kvb):
"""Calculate the fee in BTC given a feerate is BTC/kvB. Reflects CFeeRate::GetFee"""
feerate_sat_kvb = int(feerate_btc_kvb * Decim... | Review this code and list any quality issues. | [
{
"issue": "Isn't it a bit aggressive to execute the provided predicate every 0.05 seconds for the entire duration?\r\nBeyond flooding the logs, the predicate likely calls an RPC command that locks `cs_main` or some other important mutex, which slows down the node.\r\n\r\nFor instance, the `feature_assumeutxo.p... | 1 |
python | 'md5': 'fb0ed4f09c495d4ba7ce2eee0bb90de1',
'info_dict': {
'id': '85158620',
'ext': 'mp4',
'title': 'Der Sprungturm-Skandal',
'description': 'md5:709b543c24dc31bbbffee73bccda34ad',
'thumbnail': r're:^https?://.*\.jpg$',
'duration': 69,
... | Review this code and list any quality issues. | [
{
"issue": "- Extract the formats non-fatally with `traverse_obj`: you can use branching (`...`) or filtering (`lambda _, v:`) so that it always returns a list. We can filter here for a truthy value to the `'src'` key\r\n- `entry_protocol=m3u8_native` is the default, so we can omit\r\n- Warn when an unsupported... | 1 |
python | manager_list: list | None = None,
key: str = "training",
transform_list: list | None = None,
) -> Any:
"""
Get all case stats from a partitioned datalist. The function can only be called internally by get_all_case_stats.
Args:
rank: GPU process rank, 0 for CPU pro... | Review this code and list any quality issues. | [
{
"issue": "why do we need image_only=False? it seems it's an updated way to get meta dict",
"severity": "minor",
"line": 26
}
] | 1 |
python | hass,
name,
config,
StateUpdateEntity,
UPDATE_CONFIG_ENTRY_SCHEMA,
)
class AbstractTemplateUpdate(AbstractTemplateEntity, UpdateEntity):
"""Representation of a template update features."""
_entity_id_format = ENTITY_ID_FORMAT
# The super init is not called because Tem... | Review this code and list any quality issues. | [] | 0 |
python | cls._original__init__ = cls.__init__
@classmethod
def set_default(cls, **kwargs) -> None:
"""Sets the default values of keyword arguments.
If this method is called without any additional keyword
arguments, the original default values of the initialization
method of this class a... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n Rotate.set_default(run_time=2, rate_func=rate_functions.linear)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def _real_extract(self, url):
video_id = self._match_id(url)
expires = int_or_none(traverse_obj(parse_qs(url), ('expires', 0)))
if expires and expires <= time_seconds():
raise ExtractorError('The link is expired.', video_id=video_id, expected=True)
webpage = self._download_... | Review this code and list any quality issues. | [
{
"issue": "IMO we can keep this pretty simple since we are only searching within a format URL\r\n```suggestion\r\n m3u8_type = self._search_regex(\r\n r'/hls/(dvr|video)/', traverse_obj(formats, (0, 'url')), 'm3u8 type', default=None)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | Examples
========
>>> from sympy.ntheory.primetest import is_square
>>> is_square(25)
True
>>> is_square(2)
False
References
==========
.. [1] https://mersenneforum.org/showpost.php?p=110896
See Also
========
sympy.core.intfunc.isqrt
"""
if prep:
n = ... | Review this code and list any quality issues. | [
{
"issue": "Since this function calls `as_int(n)` unconditionally it should just do it once at the start `n = as_int(n)`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | if not next_url:
break
def _real_extract(self, url):
collection_slug = self._match_id(url)
channel = self._call_api(
f'https://content.api.nebula.app/content/{collection_slug}/?include=lessons',
collection_slug, note='Retrieving channel')
if channel.... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _VALID_URL = rf'{_BASE_URL_RE}/(?P<series>[\\w-]+)/season/(?P<season_number>\\d+)'\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | ) -> RandSpatialCropSamples:
super().set_random_state(seed, state)
self.cropper.set_random_state(seed, state)
return self
@LazyTransform.lazy_evaluation.setter # type: ignore
def lazy_evaluation(self, value: bool) -> None:
self._lazy_evaluation = value
self.cropper.lazy... | Review this code and list any quality issues. | [] | 0 |
python | help='Do not retrieve video comments unless the extraction is known to be quick (Alias: --no-get-comments)')
filesystem.add_option(
'--load-info-json', '--load-info',
dest='load_info_filename', metavar='FILE',
help='JSON file containing the video information (created with the "--write-info-j... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'profile, separated by a \":\".'))\r\n```\r\nthat is implied",
"severity": "minor",
"line": 26
}
] | 1 |
python | # under the License.
import argparse
from pathlib import Path
import re
import zipfile
def validate_wheel(path):
p = Path(path)
wheels = list(p.glob('*.whl'))
error_msg = f"{len(wheels)} wheels found but only 1 expected ({wheels})"
assert len(wheels) == 1, error_msg
f = zipfile.ZipFile(wheels[0])... | Review this code and list any quality issues. | [
{
"issue": "Is the type checking is split into several PRs, perhaps create sub-issues for clarify as well?",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Directory structure:
# image_crops/
# ├── crop_0.png
# ├── crop_1.png
# ├── crop_2.png
# └── crop_3.png
```
"""
self.target_dir_path = target_dir_path
self.overwrite = overwrite
self.image_name_pattern = image_name... | Review this code and list any quality issues. | [
{
"issue": "The numpy array type annotation syntax is incorrect. The syntax `np.ndarray[np.uint8, Any]` is not valid for numpy type hints. The correct approach used consistently throughout the codebase is `npt.NDArray[np.uint8]` from the `numpy.typing` module.\n```suggestion\n self, image: npt.NDArray[np... | 1 |
python | name='time_taken', description='measure something'
)
with MetricsTimer(summary_metric=summary, histogram=histogram):
_do_something()
# Prometheus samples
summary_count_sample = [
sample.value for sample in list(summary._samples()) if '_count' == sample.name
]
assert 1.0 == summ... | Review this code and list any quality issues. | [] | 0 |
python | class CudaGraphManager:
def __init__(self, vllm_config: VllmConfig, uses_mrope: bool, device: torch.device):
self.vllm_config = vllm_config
self.scheduler_config = vllm_config.scheduler_config
self.uses_mrope = uses_mrope
self.device = device
self.max_model_len = vllm_config... | Review this code and list any quality issues. | [
{
"issue": "I think we could eliminate this and just use non-emptiness of `self.uniform_decode_cudagraph_sizes`?",
"severity": "minor",
"line": 26
}
] | 1 |
python | """Run `pip install google-generativeai` to install dependencies."""
from agno.agent import Agent
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-2.5-flash", url_context=True),
markdown=True,
)
url1 = "https://www.foodnetwork.com/recipes/ina-garten/perfect-roast-chicken-recipe-19... | Review this code and list any quality issues. | [
{
"issue": "Let's print the citations.web_search thing too to show it's there. I just learned about it :)",
"severity": "minor",
"line": 25
}
] | 1 |
python | -------
ManimColor
A random bright :class:`ManimColor`.
"""
curr_rgb = color_to_rgb(random_color())
new_rgb = 0.5 * (curr_rgb + np.ones(3))
return ManimColor(new_rgb)
def random_color() -> ManimColor:
"""Return a random :class:`ManimColor`.
.. warning::
This operation is v... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n \"\"\"A generator for producing random colors from a given list of Manim colors,\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'skip': 'Live might have ended',
},
{
'url': 'https://gem.cbc.ca/live-event/10835',
'info_dict': {
'id': 'live-event/10835',
'ext': 'mp4',
'is_live': True,
'title': r're:^The National \| Biden’s trip wraps up, Paltro... | Review this code and list any quality issues. | [
{
"issue": "these were better with video_id imo, then output will show the actual video id\r\n```suggestion\r\n webpage = self._download_webpage(url, video_id)\r\n video_info = self._search_nextjs_data(webpage, video_id)['props']['pageProps']['data']\r\n```",
"severity": "minor",
"line": 2... | 1 |
python | from wagtail.models import Locale
from wagtail.permissions import locale_permission_policy
from .forms import LocaleForm
from .utils import get_locale_usage
if TYPE_CHECKING:
from django.http import HttpRequest, HttpResponseBase
class LanguageTitleColumn(TitleColumn):
cell_template_name = "wagtaillocales/_l... | Review this code and list any quality issues. | [
{
"issue": "Missing `.count()`:\r\n\r\n```suggestion\r\n return Locale.objects.filter(language_code__in=defined_locales).count() < len(\r\n defined_locales\r\n )\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # flags: --preview --minimum-version=3.10
match maybe, multiple:
case perhaps, 5:
pass
case perhaps, 6,:
pass
match more := (than, one), indeed,:
case _, (5, 6):
pass
case [[5], (6)], [7],:
pass
case _:
pass
# output
match maybe, multiple:
case perhap... | Review this code and list any quality issues. | [] | 0 |
python | def calculate_magic_string_guards(defs, uses, debug=False):
extended_defs = []
for str_ref, str_value in defs:
if str_ref not in uses:
print('warning: unused magic string {str_ref}'
.format(str_ref=str_ref))
continue
# Calculate the most compact guard,... | Review this code and list any quality issues. | [
{
"issue": "I'm not sure if we need the `guards.remove` and `guards.append` at all:\r\n* guard_i is an object reference (I think it is a set) in the guards array(?).\r\n* So if we remove an element from the guard_i then (as it is a reference) the change is reflected in the guard array also.",
"severity": "m... | 1 |
python | from promptflow._utils.flow_utils import is_flex_flow, is_prompty_flow, resolve_flow_path
from promptflow._utils.logger_utils import LoggerFactory
from promptflow._utils.utils import _match_reference
from promptflow._utils.yaml_utils import load_yaml
from promptflow.core._errors import InvalidSampleError, MalformedConn... | Review this code and list any quality issues. | [
{
"issue": "[nitpick] The pattern for loading and rendering the template is repeated; extracting this logic into a shared utility function would improve maintainability.\n```suggestion\n return _render_template(\n template_content=template_content,\n use_sandbox_env=use_sandbox_env,... | 1 |
python | '*********',
'.. contents:: Table of Contents',
' :depth: 2',
'======',
'Client',
'======',
'.. py:class:: MyService.Client',
' These are the available methods:',
' * :py:meth:`sample_operation`',
'========... | Review this code and list any quality issues. | [] | 0 |
python | self.assertEqual("https://localhost", response.json()["host"])
self.assertEqual(self.environment.host, "https://localhost")
self.assertListEqual(["User1"], response.json()["user_classes"])
# simulating edit running load test
response = requests.post(
"http://127.0.0.1:%i/swa... | Review this code and list any quality issues. | [] | 0 |
python | from typing import Any, List, Optional
import inspect
import os
import tempfile
import unittest
from promptflow.client import PFClient
from promptflow.evals import evaluators
from promptflow.evals.evaluators import content_safety
class TestSaveEval(unittest.TestCase):
"""Test saving evaluators."""
... | Review this code and list any quality issues. | [
{
"issue": "Please switch to pytest and add @pytest.mark.unittest mark to the class otherwise I thnk it will be ignored by the CI pipeline.",
"severity": "minor",
"line": 12
}
] | 1 |
python | # Check listunspent before reorg - should have the truc output
unspent_before = self.alice.listunspent()
truc_output_txids = [u["txid"] for u in unspent_before]
assert truc_txid in truc_output_txids
# Trigger the reorg
self.trigger_reorg(fork_blocks)
# After reorg, both... | Review this code and list any quality issues. | [
{
"issue": "Might be worth testing that you can also create + broadcast this transaction. But this doesn't mean all TRUC rules are out the window:\r\n\r\n```diff\r\ndiff --git a/test/functional/wallet_v3_txs.py b/test/functional/wallet_v3_txs.py\r\nindex 85865c3e54f..4728416099b 100755\r\n--- a/test/functional/... | 1 |
python | entries = []
def parse_graphql_video(video):
v_id = video.get('videoId') or video.get('id') or video_id
reel_info = traverse_obj(
video, ('creation_story', 'short_form_video_context', 'playback_video', {dict}))
if reel_... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # sd, hd formats w/o resolution info should be deprioritized below DASH\r\n 'quality': q(format_id) - 3,\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | show_viewer=show_viewer,
show_FPS=False,
)
asset_path = get_hf_dataset(pattern="fridge/*")
fridge = scene.add_entity(
gs.morphs.URDF(
file=f"{asset_path}/fridge/fridge.urdf",
fixed=True,
)
)
@pytest.mark.required
def test_plane_texture_path_preservation(s... | Review this code and list any quality issues. | [
{
"issue": "* No need to build the scene\n * You can remove Scene options if you don't build, they won't be used anyway\n* assert \"texture_path\" in vgeom.vmesh.metadata is still not necessary. pytest will throw a clear exception anyway (plain asserts are being post-processed to ease debugging).\n\n```python\... | 1 |
python | entry = hass.config_entries.async_get_entry(mock_entry.entry_id)
assert entry is not None
assert entry.state is ConfigEntryState.MIGRATION_ERROR
assert entry.version == 1 # Version should remain unchanged on migration failure
async def test_migrate_version_2_no_migration_needed(hass: HomeAssistant) -> No... | Review this code and list any quality issues. | [] | 0 |
python | if self.timed_out():
logger.warning("Task manager has reached time out while processing pending jobs, exiting loop early")
break
blocked_by = self.job_blocked_by(task)
if blocked_by:
self.subsystem_metrics.inc(f"{self.prefix}_tasks_blocked", 1)
... | Review this code and list any quality issues. | [
{
"issue": "I could be wrong, but I think you should back out changes to these lines, but leave everything else. Without this, control actions (like project updates) can put a node over capacity.",
"severity": "critical",
"line": 26
}
] | 1 |
python | if (
Preview.hug_parens_with_braces_and_square_brackets in line.mode
and tail_leaves[0].value
and tail_leaves[0].opening_bracket is head_leaves[-1]
):
inner_body_leaves = list(body_leaves)
hugged_opening_leaves: list[Leaf] = []
hugged_closing_leaves: list[Leaf] = []
... | Review this code and list any quality issues. | [] | 0 |
python | if expected_messages:
# expected-but-not-found
raise JsErrorsDidNotRaise(expected_messages, js_errors)
if js_errors:
# found-but-not-expected
raise JsErrors(js_errors)
def clear_js_errors(self):
"""
Clear all JS errors.
"""
se... | Review this code and list any quality issues. | [
{
"issue": "see my comment above. If it's called `disable_cors_headers()` here, it should also be called `disable_cors_headers` in `dev_server`.\r\nAnd probably in `router`, it should be called `use_cors_headers`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.skip_animations = skip_animations
self.animations_hashes = []
self.num_plays = 0
self.time = 0
self.static_image = None
def init_scene(self, scene):
self.file_writer = SceneFileWriter(
self,
scene.__class__.__name__,
)
def play(self,... | Review this code and list any quality issues. | [
{
"issue": "Thought's on making it info?\r\n```suggestion\r\n logger.info(\"Caching disabled.\")\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from typing import Any, Dict, List, Optional, Tuple, Union
import numpy as np
from supervision.detection.utils import polygon_to_mask, polygon_to_xyxy
from supervision.utils.internal import deprecated
@deprecated(
"`LMM` enum is deprecated and will be removed in "
"`supervision-0.31.0`. Use VLM instead."
)
... | Review this code and list any quality issues. | [
{
"issue": "can we just add `GOOGLE_GEMINI_2_0` and `GOOGLE_GEMINI_2_5` and just add 2 models instead of 6? looks like there is no difference in processing",
"severity": "minor",
"line": 26
}
] | 1 |
python | @click.option(
"-R",
"--rebase",
is_flag=True,
show_default=True,
help="Rebase project if already checked out",
)
@click.option(
"-w",
"--workdir",
default=str(DEFAULT_WORKDIR),
type=click.Path(exists=False),
show_default=True,
help="Directory Path for repo checkouts",
)
@cli... | Review this code and list any quality issues. | [
{
"issue": "I get you seem to really like correct grammar - but what does removing this space achieve?",
"severity": "minor",
"line": 26
}
] | 1 |
python | from embedchain.loaders.base_loader import BaseLoader
from embedchain.utils import clean_string
def get_header(text: str, header: str) -> str:
start_string_position = text.find(header)
pos_start = text.find(":", start_string_position) + 1
pos_end = text.find("\n", pos_start)
header = text[pos_start:po... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n logging.info(f\"Gmail Loader: {len(documents)} mails found for query- {query}\")\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | module, function = extract_module_and_class(train_config.data.custom_dataset.collate_fn)
if module is None:
if train_config.data.custom_dataset.module is None:
module, _ = extract_module_and_class(train_config.data.custom_dataset.name)
else:
... | Review this code and list any quality issues. | [] | 0 |
python | async def requirement(self):
return await self.docs.get(filename=REQUIREMENT_FILENAME)
@property
def git_repo(self) -> GitRepository:
return self._git_repo
@property
def workdir(self) -> Path:
return Path(self.git_repo.workdir)
@property
def srcs(self) -> FileRepositor... | Review this code and list any quality issues. | [
{
"issue": "134-136\r\nreturn bool(code_files)",
"severity": "minor",
"line": 26
}
] | 1 |
python | if isinstance(e.cause, HTTPError) and e.cause.status == 400:
raise ExtractorError(self._parse_json(
e.cause.response.read().decode(), xid)['error_description'], expected=True)
raise
self._set_dailymotion_cookie('access_token' if use... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n (?:(?:www|touch|geo)\\.)?dailymotion\\.[a-z]{2,3}/(?:(?:(?:(?:embed|swf|\\#)/)|player(?:/\\w+)?\\.html\\?)?video|swf)|\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | entities=entities, vectorstore=description_embedding_store
)
else:
# load description embeddings to an in-memory lancedb vectorstore
# and connect to a remote db, specify url and port values.
description_embedding_store = LanceDBVectorStore(
collection_name=collection_nam... | Review this code and list any quality issues. | [
{
"issue": "\"final\" throughout here may be helpful for clarity due to our parquet naming convention (i.e., based on the step name), but it seems a bit specific as an API. \"nodes\", \"entities\" etc. is more semantically correct. Thoughts?",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.checkpoint_engine.save(state_dict, path)
self.checkpoint_engine.commit(tag)
return True
def empty_partition_cache(self):
"""
Release GPU memory consumed by offloaded model parameters.
"""
if hasattr(self.optimizer, 'empty_partition_cache'):
self.op... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n self.module.compile(backend=backend, **compile_kwargs)\r\n```\r\nnn.Module.compile returns None",
"severity": "minor",
"line": 26
}
] | 1 |
python | all_points, dim=dim, key=direction[dim]
)
return result
# Pseudonyms for more general get_critical_point method
def get_edge_center(self, direction) -> np.ndarray:
return self.get_critical_point(direction)
def get_corner(self, direction) -> np.ndarray:
return self.get_... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n \"\"\"Get coordinates of the middle of the path that forms the :class:`~.Mobject`\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | if getattr(self, "gradient_checkpointing", False) and self.training and arg_value:
logger.warning_once(
"`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`."
)
arg_val... | Review this code and list any quality issues. | [
{
"issue": "If we default to true, it will break all encoder and encoder-decoder models. \r\n\r\nImo, we should properly add an `is_causal` flag to all models where it's obvious and default to None, i.e. don't do anything",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
seed: Optional[int] = SchemaField(
description="Random seed. Set for reproducible generation",
default=None,
title="Seed",
advanced=True,
)
style_type: StyleType = SchemaField(
description="Style type to apply, applicable for V_2 and ... | Review this code and list any quality issues. | [
{
"issue": "nit:\r\n```suggestion\r\n custom_color_palette: Optional[list[str]] = SchemaField(\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | class DouyuBaseIE(InfoExtractor):
def _download_cryptojs_md5(self, video_id):
for url in [
'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
'https://cdn.bootcdn.net/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
]:
js_code = self._download_webp... | Review this code and list any quality issues. | [
{
"issue": "I think we can do this\r\n```suggestion\r\n return urllib.parse.parse_qs(result)\r\n```\r\nUnless there are multiple values per param that we need to filter out",
"severity": "minor",
"line": 26
}
] | 1 |
python | class TestRealFernet:
def test_encryption(self):
"""Encryption should produce encrypted output different from input."""
from cryptography.fernet import MultiFernet
key = Fernet.generate_key()
real_fernet = _RealFernet(MultiFernet([Fernet(key)]))
msg = b"secret message"
... | Review this code and list any quality issues. | [] | 0 |
python | # https://docs.glomex.com/publisher/video-player-integration/javascript-api/
quot_re = r'["\']'
regex = fr'''(?x)
<iframe[^>]+?src=(?P<q>{quot_re})(?P<url>
(?:https?:)?{cls._BASE_PLAYER_URL_RE}\?(?:(?!(?P=q)).)+
)(?P=q)'''
for mobj in re.finditer(regex, w... | Review this code and list any quality issues. | [
{
"issue": "Ditto for `re.finditer`.\r\n\r\n```suggestion\r\n for script in re.findall(r'<script[^<]*>.+?</script>', webpage):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def duration_filter(s):
start_end = s['segment']
# Ignore entire video segments (https://wiki.sponsor.ajay.app/w/Types).
if start_end == (0, 0):
return False
# Ignore milliseconds difference at the start.
if start_end[0] <= 1:
s... | Review this code and list any quality issues. | [
{
"issue": "To clarify, `description` is present if and only if categories is 'chapter', correct? Is there any case where a chapter doesn't have description or where a sponsor has one?",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'tbr': f.get('tbr') or tbr,
'width': f.get('width') or width,
'height': f.get('height') or height,
'format_id': f.get('format_id') if not tbr else format_id,
'vcodec': vcodec,
})
... | Review this code and list any quality issues. | [] | 0 |
python | from graphrag.prompts.index.community_report import (
COMMUNITY_REPORT_PROMPT,
)
from graphrag.prompts.index.entity_extraction import GRAPH_EXTRACTION_PROMPT
from graphrag.prompts.index.summarize_descriptions import SUMMARIZE_PROMPT
from graphrag.prompts.query.drift_search_system_prompt import DRIFT_LOCAL_SYSTEM_PR... | Review this code and list any quality issues. | [] | 0 |
python | import re
from .common import InfoExtractor
from ..utils import (
float_or_none,
int_or_none,
traverse_obj,
)
class AcFunVideoIE(InfoExtractor):
_VALID_URL = r'(?x)https?://(?:www\.acfun\.cn/v/)ac(?P<id>[_\d]+)'
_TESTS = [{
'url': 'https://www.acfun.cn/v/ac35457073',
'info_dict':... | Review this code and list any quality issues. | [
{
"issue": "Is the whole site geo-restricted? If possible, add a non-restricted test",
"severity": "minor",
"line": 26
}
] | 1 |
python | @ModelBase.register("JambaForCausalLM")
class JambaModel(TextModel):
model_arch = gguf.MODEL_ARCH.JAMBA
def get_vocab_base_pre(self, tokenizer) -> str:
del tokenizer # unused
return "default"
def set_vocab(self):
if (self.dir_model / "tokenizer.model").is_file():
self... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n assert max(vocab.values()) < vocab_size\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def _real_extract(self, url):
m_url = self._match_valid_url(url)
video_id = m_url.group('id')
blog = m_url.group('blog_name')
url = f'http://{blog}.tumblr.com/post/{video_id}/'
webpage, urlh = self._download_webpage_handle(url, video_id)
redirect_url = urlh.geturl()
... | Review this code and list any quality issues. | [
{
"issue": "sus formatting bro.\r\nWeird that flake8 didn't find it problematic.\r\nBut anyways, this is confusing to read.",
"severity": "minor",
"line": 26
}
] | 1 |
python | _TEST = {
'url': 'https://player.radiozet.pl/Podcasty/Nie-Ma-Za-Co/O-przedmiotach-szkolnych-ktore-przydaja-sie-w-zyciu',
'md5': 'e03665c316b4fbc5f6a8f232948bbba3',
'info_dict': {
'id': '42154',
'display_id': 'O-przedmiotach-szkolnych-ktore-przydaja-sie-w-zyciu',
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n podcast_id = self._html_search_regex(r'<div.*?\\sid=\"player\".*?\\sdata-id=[\\'\"]([[^\\'\"]+)['\"]',\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | fail(
f"'request' is a reserved word for fixtures, use another name:\n {location}",
pytrace=False,
)
return fixture_definition
# TODO: paramspec/return type annotation tracking and storing
class FixtureFunctionDefinition:
def __init__(
self,
*,... | Review this code and list any quality issues. | [
{
"issue": "I wonder if it wouldn't be simpler to keep `self._fixture_function` bound to `instance` instead of keeping `_instance` and binding it lazily? Is there a reason why it needs to be lazy?",
"severity": "minor",
"line": 26
}
] | 1 |
python | "Another error",
"yet\nAnother\nError",
]
job.stacktrace = fake_stacktraces
assert job.stacktrace == fake_stacktraces
def test_notification_job(task):
subscribe = MagicMock()
submission = _SubmissionManagerFactory._build_manager()._create(task.id, task._ID_PREFIX, task.config_id)
job ... | Review this code and list any quality issues. | [] | 0 |
python | for more information.
"""
backend = Orientation.backend
def __init__(
self,
keys: KeysCollection,
axcodes: str | None = None,
as_closest_canonical: bool = False,
labels: Sequence[tuple[str, str]] | None = None,
allow_missing_keys: bool = False,
lazy:... | Review this code and list any quality issues. | [
{
"issue": "Spelling error: 'appliable' should be 'applicable'.\n```suggestion\n where applicable, or (('L', 'R'), ('P', 'A'), ('I', 'S'))``\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert result == expected
with freezegun.freeze_time("2023, 8, 15"):
result = get_since_until("previous calendar quarter")
expected = (datetime(2023, 4, 1), datetime(2023, 7, 1))
assert result == expected
with freezegun.freeze_time("2023, 10, 15"):
result = get_since_until("pre... | Review this code and list any quality issues. | [] | 0 |
python | class PlayVidsIE(PeekVidsIE):
_VALID_URL = r'https?://(?:www\.)?playvids\.com/(?:embed/|[^/]{2}/)?(?P<id>[^/?#]*)'
_TESTS = [{
'url': 'https://www.playvids.com/U3pBrYhsjXM/pc/dane-jones-cute-redhead-with-perfect-tits-with-mini-vamp',
'md5': '2f12e50213dd65f142175da633c4564c',
'info_dict'... | Review this code and list any quality issues. | [
{
"issue": "don't do clever tricks for test definition. Define them literally. You can also make the rest only_matching",
"severity": "minor",
"line": 26
}
] | 1 |
python | z_axis_config
Arguments to be passed to :class:`~.NumberLine` that influence the z-axis.
z_normal
The direction of the normal.
num_axis_pieces
The number of pieces used to construct the axes.
light_source
The direction of the light source.
depth
Currently non-func... | Review this code and list any quality issues. | [
{
"issue": "Isn't `Sequence[float]` sufficient here?\r\n```suggestion\r\n z_normal: Sequence[float] = DOWN,\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert 'User-Agent' in headers
assert isinstance(headers, HttpHeaders)
assert headers['User-Agent'] in USER_AGENT_POOL
def test_get_user_agent_header_chromium() -> None:
"""Test that the User-Agent header is generated correctly for Chromium."""
header_generator = HeaderGenerator()
headers = header... | Review this code and list any quality issues. | [] | 0 |
python | # This example covers advanced startup options and uses some real world examples for why you may need them.
import asyncio
import logging
import os
from typing import Optional
import asyncpg # asyncpg is not a dependency of the discord.py, and is only included here for illustrative purposes.
import discord
from dis... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n initial_extensions: List[str],\r\n```",
"severity": "minor",
"line": 19
}
] | 1 |
python | async def on_shutdown():
file_utils.remove_folder(project.dir)
async def export(q: Q):
shutil.make_archive('app', 'zip', '.', project.dir)
q.app.zip_path, = await q.site.upload(['app.zip'])
q.page["meta"].script = ui.inline_script(f'window.open("{q.app.zip_path}", "_blank");')
os.remove("app.zip")... | Review this code and list any quality issues. | [
{
"issue": "I think using a proper table would be a better fit both in terms of UI and UX. The dependency removal can work on selection basis: Display \"Remove selected\" button, enabled only when selected > 0.",
"severity": "minor",
"line": 26
}
] | 1 |
python | Args:
api_key: The API key for authenticating with the Mem0 API. If not provided,
it will attempt to use the MEM0_API_KEY environment variable.
host: The base URL for the Mem0 API. Defaults to "https://api.mem0.ai".
organization: (Deprecated) The name of the orga... | Review this code and list any quality issues. | [
{
"issue": "Let's remove support for this since we have already passed the 0.1.40 version long back.",
"severity": "minor",
"line": 26
}
] | 1 |
python | .. note::
The type of target inferred with `"auto"` may not be the desired target
type used for modeling. For example, if the target consisted of integers
between 0 and 100, then :func:`~sklearn.utils.multiclass.type_of_target`
will infer the target as `"multiclass"`. In ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n `target_type`,\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from __future__ import annotations as _annotations
import asyncio
import functools
import inspect
import re
import time
import uuid
from collections.abc import AsyncIterable, AsyncIterator, Awaitable, Callable, Iterable, Iterator
from contextlib import asynccontextmanager, suppress
from contextvars import ContextVar
f... | Review this code and list any quality issues. | [
{
"issue": "We should update/remove https://ai.pydantic.dev/durable_execution/temporal/#instructions-functions-output-functions-and-history-processors",
"severity": "minor",
"line": 1
}
] | 1 |
python | Simple example with two tags:
.. code-block:: console
$ luigi --module my_tasks MyTask --tags '{"role": "web", "env": "staging"}'
It can be used to define dynamic parameters, when you do not know the exact list of your parameters (e.g. list of
tags, that are dynamically constructed outside Luigi)... | Review this code and list any quality issues. | [
{
"issue": "Will this work if a list contains a dict or a list?",
"severity": "minor",
"line": 26
}
] | 1 |
python | Raises:
ValueError: If results have inconsistent keys or non-tensor values
"""
if not results:
return {}
# Get keys from first result and verify consistency
expected_keys = set(results[0].keys())
for i, result in enumerate(results[1:], 1):
if ... | Review this code and list any quality issues. | [
{
"issue": "note that this simple padding logic isn't compatible with all VLM models. Consider adding a note about it\r\n\r\n(delegating everything to `processor` was the original motivation for adding this collator)",
"severity": "minor",
"line": 26
}
] | 1 |
python | The path can be configured via CLI option or environment variable.
Raises ``pytest.UsageError`` if the configured path does not exist.
"""
value = _get_config_option_or_env(
pytestconfig, "--browser-state-path", "STREAMLIT_E2E_BROWSER_STATE_PATH"
)
if not value:
return None
path ... | Review this code and list any quality issues. | [
{
"issue": "The `external_host_url` and `external_iframe_selector` fixtures are defined and documented, but they are never actually used in the codebase. When `external_host_url` is provided, the code should navigate to that URL and then switch to the iframe containing the Streamlit app using the provided selec... | 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": "You should set the max_concurrency to 1 or the test may fail from time to time due to multiple threads making requests you cannot guarantee that it will happen in order.",
"severity": "critical",
"line": null
}
] | 1 |
python | def _handle_tasks_stuck_in_queued(self, session: Session = NEW_SESSION) -> None:
"""
Handle the scenario where a task is queued for longer than `task_queued_timeout`.
Tasks can get stuck in queued for a wide variety of reasons (e.g. celery loses
track of a task, a cluster can't further ... | Review this code and list any quality issues. | [
{
"issue": "We don't do this in main, do you think that should be updated too? or is it 2.* specific? If latter, why?",
"severity": "minor",
"line": 26
}
] | 1 |
python | This estimator has native support for missing values (NaNs) for
random splits. During training, a random threshold will be chosen
to split the non-missing values on. Then the non-missing values will be sent
to the left and right child based on the randomly selected threshold, while
the missing values wi... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n node, and \"poisson\" which uses reduction in Poisson deviance to find splits, also using the mean of each terminal node.\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def _get_frame(self):
if not hasattr(self, "_frame"):
raise RuntimeError(f"Page '{type(self).__name__}' was not registered correctly.")
return self._frame
def _get_module_name(self) -> t.Optional[str]:
return (
None
if (frame := self._get_frame()) is None... | Review this code and list any quality issues. | [
{
"issue": "What would you expose ' get_style()' for?",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
def stopping_fn(engine: Engine) -> Any:
return engine.state.metrics[metric_name]
return stopping_fn
def stopping_fn_from_loss() -> Callable[[Engine], Any]:
"""
Returns a stopping function for ignite.handlers.EarlyStopping using the loss value.
"""
def stopping_fn(engine: Engine)... | Review this code and list any quality issues. | [
{
"issue": "This will have to be made the last argument in the constructor otherwise any invocation using only positional arguments will break.",
"severity": "minor",
"line": 26
}
] | 1 |
python | native_unit_of_measurement=UnitOfElectricPotential.VOLT,
device_class=SensorDeviceClass.VOLTAGE,
entity_category=EntityCategory.DIAGNOSTIC,
),
"nomoutv": SensorEntityDescription(
key="nomoutv",
translation_key="nominal_output_voltage",
native_unit_of_measurement=UnitOfEle... | Review this code and list any quality issues. | [] | 0 |
python | if not r_id.isdigit():
r_id = f'ref:{r_id}'
result.update({
'_type': 'url_transparent',
'url': smuggle_url(
self.BRIGHTCOVE_URL_TEMPLATE % (p_id, r_id), {'geo_countries': ['JP']}),
'ie_key': 'BrightcoveNew',
})
return result
... | Review this code and list any quality issues. | [
{
"issue": "This looks not correct. \r\nFor streak backend , all ref_id will prepend \"ref:\" , no matter it is digits or not. For example: https://tver.jp/episodes/epwkfr091w",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Mock page and image objects
mock_page = MagicMock()
mock_image_obj = MagicMock()
# Simulate a PNG image
# PNG magic bytes: \x89PNG\r\n\x1a\n
png_bytes = b"\x89PNG\r\n\x1a\n some image data"
def mock_extract(buf, fb_format=None):
buf.write(png_bytes)
mock_image_ob... | Review this code and list any quality issues. | [
{
"issue": "Modifying the DEFAULT_ID class attribute in a test affects the shared FakeUploadFile class across tests, which can cause test isolation issues. This mutation could affect other tests that run after this one if they use the same fixture. Consider creating a new instance-specific attribute or resettin... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.