language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | 'dash_period_id', 'dash_period_idx')]
# create merged formats
stream_numbers = collections.defaultdict(int)
groups = {}
formats = []
for period in periods:
for f in period['formats']:
format_key = tuple(f[k] for k in shared_keys)
if 'f... | Review this code and list any quality issues. | [
{
"issue": "This overwrites each other. The lists inside should be appended to instead",
"severity": "minor",
"line": 26
}
] | 1 |
python | # from http://www.cnet.com/videos/tesla-model-s-a-second-step-towards-a-cleaner-motoring-future/
'url': 'http://link.theplatform.com/s/kYEXFC/22d_qsQ6MIRT',
'info_dict': {
'id': '22d_qsQ6MIRT',
'ext': 'flv',
'description': 'md5:ac330c9258c04f9d7512cf26b9595409',
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'skip': 'Dead link',\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def _real_extract(self, url):
station = self._match_id(url)
area = traverse_obj(self._configuration_arg('area'), 0) or "tokyo"
config = self._download_xml('https://www.nhk.or.jp/radio/config/config_web.xml', None, 'Downloading area information')
data = config.find(f'.//data//area[.="{ar... | Review this code and list any quality issues. | [
{
"issue": "I prefer this formatting/indent, but I guess either is fine\r\n```suggestion\r\n 'url': 'url',\r\n 'width': ('width', {int_or_none}),\r\n 'height': ('height', {int_or_none}),\r\n })),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | HTMLElement = xml.etree.ElementTree.Element
ResponseHeaders = MutableMapping[str, str]
# Used in the @lru_cache polyfill.
F = TypeVar('F')
class LruCache(Protocol):
def __call__(self, maxsize=None):
# type: (Optional[int]) -> Callable[[F], F]
raise NotImplementedError
... | Review this code and list any quality issues. | [
{
"issue": "A comment mentioning Python 2 (\"Fallback to noop_lru_cache in Python 2\") would increase the chances we'll clean this when dropping python 2 support",
"severity": "major",
"line": 26
}
] | 1 |
python | def test_dataloader(self):
return DataLoader(RandomDataset(32, 64))
class BoringDataModule(LightningDataModule):
def __init__(self, data_dir: str = './'):
super().__init__()
self.data_dir = data_dir
self.non_picklable = None
self.checkpoint_state: Optional[str] = None
... | Review this code and list any quality issues. | [
{
"issue": "I think the tests that require `non_picklable` should subclass and override setup(), just as we do for BoringModel",
"severity": "minor",
"line": 26
}
] | 1 |
python | renderer.add_frame = Mock(wraps=renderer.add_frame)
scene.render()
assert renderer.add_frame.call_count == config["frame_rate"]
assert renderer.update_frame.call_count == config["frame_rate"]
assert_file_exists(config["output_file"])
def test_skipping_status_with_from_to_and_up_to(using_temp_config, d... | Review this code and list any quality issues. | [] | 0 |
python | dhw_config is not None
and dhw_config.reduced_setpoint is not None
and dhw_config.reduced_setpoint.value is not None
):
self._attr_min_temp = dhw_config.reduced_setpoint.value
else:
self._attr_min_temp = 10.0 # Default minimum
# For max_temp: Use... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n return BSBLAN_TO_HA_OPERATION_MODE.get(getattr(operating_mode, \"value\", None))\n```\n\nThis will safe you pain in writing tests and still does the same trick. :)",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Micro controllers
self.controller_pull_socket = get_zmq_socket(
self.zmq_context,
self.controller_urls["pull"],
protocol="tcp",
role=zmq.PULL, # type: ignore[attr-defined]
bind_or_connect="bind",
)
if self.controller_urls["reply"] i... | Review this code and list any quality issues. | [
{
"issue": "Prefer putting these definitions into `_setup_socket_metrics`. This is not required tho.",
"severity": "minor",
"line": 26
}
] | 1 |
python | "api_key": "test-api-key",
},
)
assert result2["type"] is FlowResultType.FORM
assert result2["errors"] == {"base": "protect_version"}
# Now test recovery with valid version
bootstrap.nvr = nvr
with (
patch(
"homeassistant.components.unifiprotect.config_flow.... | Review this code and list any quality issues. | [
{
"issue": "Consider making these 2 a shared fixture as well",
"severity": "minor",
"line": 26
}
] | 1 |
python | }
"""
name = lazy_gettext("Owner")
arg_name = "owners"
def apply(self, query: Query, value: Optional[Any]) -> Query:
user_model = security_manager.user_model
like_value = "%" + cast(str, value) + "%"
return query.filter(
or_(
# could be made to handl... | Review this code and list any quality issues. | [] | 0 |
python | d = indices[-1]
cos_freq, sin_freq = rope_freq(offset * scale, d, rotary_dim, theta, qkv_dtype)
cos = cos_freq * buffer[indices]
sin = sin_freq * tir.if_then_else(
d < rotary_dim // 2,
-buffer[indices[:-1] + (d + rotary_dim // 2,)],
buffer[indices[:-1] + (d - rotary_dim // 2,)],
... | Review this code and list any quality issues. | [
{
"issue": "I'm not exactly sure about substituting `32` with `bdx` in the entire `_attention_prefill()` and `_attention_prefill_ragged()`; is it the intended semantics?",
"severity": "minor",
"line": 26
}
] | 1 |
python | async def widget(self):
"""|coro|
Returns the widget of the guild.
.. note::
The guild must have the widget enabled to get this information.
Raises
-------
Forbidden
The widget for this guild is disabled.
HTTPException
Retri... | Review this code and list any quality issues. | [
{
"issue": "Both parameters should be optional, also channel can be set to none.",
"severity": "minor",
"line": 26
}
] | 1 |
python | if mobj is None:
raise ExtractorError('Could not get video ID; visit the URL manually and use the redirection URL')
url = mobj.group()
return {
'_type': 'url',
'url': url
}
# Sometimes the siteurl is an alias, we get the real o... | Review this code and list any quality issues. | [
{
"issue": "Instead of going through a try/except, you can set fatal=False and raise error if stream is None\r\n\r\nalso, use `raise_login_required(method='cookies')` to give a better error message",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert_equal(fundedtx['fee'] * COIN, tx_size * 10)
# Using the other output should have 72 byte sigs
rawtx = wallet.createrawtransaction([ext_utxo], [{self.nodes[0].getnewaddress(): 13}])
ext_desc = self.nodes[0].getaddressinfo(ext_addr)["desc"]
fundedtx = wallet.fundrawtransaction(rawt... | Review this code and list any quality issues. | [
{
"issue": "From `(273 when high-s)`, I assume this considers a signed input but the docs of `createrawtransaction` and `fundrawtransaction` say that these commands don't generate a signed transaction. So this max weight check on picking 1472 inputs of 273 WU each internally seems to be dependent only on the `w... | 1 |
python | 'url': 'https://weyyak.com/en/movie/233255/8-Seconds',
'md5': 'fe740ae0f63e4d1c8a7fc147a410c564',
'info_dict': {
'id': '233255',
'ext': 'm3u8',
'title': '8 Seconds',
'duration': 6490,
},
},
]
def _real_e... | Review this code and list any quality issues. | [
{
"issue": "- if we are not returning the `video_id` var in the info_dict, it's better to not use a var at all\r\n - if there is only 1 video/format URL, it can be fatal\r\n - do not do `re.sub`, we want to extract the master m3u8, not a single media playlist\r\n```suggestion\r\n video_details = self._do... | 1 |
python | 'title': 'ZAIKO STREAMING TEST',
'alt_title': '[VOD] ZAIKO STREAMING TEST_20210603(Do Not Delete)',
'uploader_id': '454',
'uploader': 'ZAIKO ZERO',
'release_timestamp': 1583809200,
'thumbnail': r're:^https://[\w.-]+/\w+/\w+',
'thumbnails': 'maxcoun... | Review this code and list any quality issues. | [
{
"issue": "The rest of the extractor seemed to be written to be non-fatal all the way down to the expected `raise_no_formats` call. Will making this line fatal have any ill effect? (I'm just asking a question, not requesting a change here)",
"severity": "major",
"line": 26
}
] | 1 |
python | for source in entry.get('sources', []):
formats.extend(self._process_source_entry(source, part_id) or [])
self._sort_formats(formats)
return {
'id': part_id,
'title': entry.get('title'),
'duration': int_or_none(entry.get('duration')),
'formats... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n entries = [\r\n self._extract_video_info(url, video['id'], contentResource[video['id']], video)\r\n for video in playlist]\r\n```\r\n\r\nYou can also change the signature of `_extract_video_info` to make this even simpler",
"severity": "major",
... | 1 |
python | return img
class DataStats(Transform):
"""
Utility transform to show the statistics of data for debug or analysis.
It can be inserted into any place of a transform chain and check results of previous transforms.
It support both `numpy.ndarray` and `torch.tensor` as input data,
so it can be used in... | Review this code and list any quality issues. | [
{
"issue": "Thanks for the PR! I suggest using `meta_info` or another argument instead of `meta_tensor` to avoid confusion.",
"severity": "minor",
"line": 26
}
] | 1 |
python | SERVICE_TURN_OFF,
lambda mock: mock.safebrowsing.disable.assert_called_once(),
),
(
"filtering",
SERVICE_TURN_ON,
lambda mock: mock.filtering.enable.assert_called_once(),
),
(
"filtering",
SERVICE_TURN_OFF,
... | Review this code and list any quality issues. | [
{
"issue": "`test_switch_actions` applies `@pytest.mark.usefixtures(\"entity_registry_enabled_by_default\")` twice (once above the parametrization and again immediately above the test). Drop the duplicate marker to reduce noise and avoid confusion about which fixtures are required.\n```suggestion\n\n```",
"... | 1 |
python | if current_tag is not None:
non_standard_tag = re.fullmatch(r'[0-9a-f]{7,40}', current_tag)
if (
(non_standard_tag is None and current_tag != device_info['tag']) or
(non_standard_tag is not None and ... | Review this code and list any quality issues. | [
{
"issue": "Undefined variable `nump_version` used in condition. This should be `numpy_version` (defined on line 465).\n```suggestion\n if Version(torch_version) <= Version('2.2.2') and numpy_version and numpy_version >= Version('2.0.0'):\n```",
"severity": "minor",
"line"... | 1 |
python | inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = image.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_object_detection(
outputs=outp... | Review this code and list any quality issues. | [
{
"issue": "While we're at it, let's make the code more defensive.\r\n\r\nI've reviewed the [image_processing_detr.py](https://github.com/huggingface/transformers/blob/fed27ffc7ec62837dca9bbfc83442eb3678ee026/src/transformers/models/detr/image_processing_detr.py#L744) in `transformers` and it turns out, with in... | 1 |
python | ],
"notes": (
"Create a Service Account via GCP console with access to "
"BigQuery datasets. For CSV/Excel uploads, also install pandas_gbq."
),
"warnings": [
"Google BigQuery Python SDK is not compatible with gevent. "
"Use a worker type other tha... | Review this code and list any quality issues. | [
{
"issue": "I think it would be better to just make `encrypted_extra_sensitive_fields: set[str] | dict[str, str]` for now, and where we consume it we do:\r\n\r\n```python\r\nfields = (\r\n {field: field for field in encrypted_extra_sensitive_fields}\r\n if isinstance(encrypted_extra_sensitive_fields, set)... | 1 |
python | 'age_limit': 6,
},
'params': {
'skip_download': True,
},
}, {
'url': 'https://tv.nrk.no/serie/backstage/sesong/1/episode/8',
'info_dict': {
'id': 'MSUI14000816',
'ext': 'mp4',
'title': 'Backstage - 8. episode',
'desc... | Review this code and list any quality issues. | [
{
"issue": "The working test-case could have this entry, say after the `'url'` line. It indicates that the test-case is expected to fail if any IE (key) in the list is not `_WORKING`: \r\n```py\r\n 'add_ie': [NRKIE.ie_key()],\r\n```",
"severity": "critical",
"line": 26
}
] | 1 |
python | # coding: utf-8
from __future__ import unicode_literals
import re
from urllib.parse import (
parse_qs,
urlparse,
)
from .common import InfoExtractor
from ..utils import (
clean_html,
determine_ext,
ExtractorError,
extract_attributes,
get_element_by_class,
get_element_html_by_id,
HE... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n parse_qs,\r\n unescapeHTML,\r\n```",
"severity": "critical",
"line": 16
}
] | 1 |
python | return -torch.abs(tensor)
class MetricCollection(nn.ModuleDict):
"""
MetricCollection class can be used to chain metrics that have the same
call pattern into one single class.
Args:
metrics: One of the following
* list or tuple: if metrics are passed in as a list, will use the
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n If ``metrics`` is not a ``list``, ``tuple`` or a ``dict``.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | aligned_buffer = base_buffer[offset : offset + size]
# Need to return the base buffer as well in order to prevent GC
return base_buffer, aligned_buffer
class TensorMemoryObj(MemoryObj):
"""
Wraps a raw flat tensor with some metadata
"""
monitor = LMCStatsMonitor.GetOrCreate()
def __init... | Review this code and list any quality issues. | [
{
"issue": "nit: can we change the variable name to make it more explicit that this list is something like the \"prefix sum\" of the group lengths instead of the length of each group?",
"severity": "minor",
"line": 26
}
] | 1 |
python | train_dataset = DreamBoothDataset(
instance_data_root=args.instance_data_dir,
instance_prompt=args.instance_prompt,
class_prompt=args.class_prompt,
class_data_root=args.class_data_dir if args.with_prior_preservation else None,
class_num=args.num_class_images,
buckets=buck... | Review this code and list any quality issues. | [
{
"issue": "Can we try\r\nhttps://github.com/sayakpaul/flux-image-editing/blob/a3fc48fd692c704cc8afaf70058abdc444de5af6/train.py#L80C5-L83C36",
"severity": "minor",
"line": 26
}
] | 1 |
python | system_instruction=system_instruction,
temperature=model_settings.get('temperature'),
top_p=model_settings.get('top_p'),
max_output_tokens=model_settings.get('max_tokens'),
stop_sequences=model_settings.get('stop_sequences'),
presence_penalty=model_settings.ge... | Review this code and list any quality issues. | [
{
"issue": "We should still include all the other fields we build below, like finish reason, timestamp, provider response ID etc. Just `parts` should be `[]` (like in the `if candidate.content is None or candidate.content.parts is None:` branch below).",
"severity": "minor",
"line": 26
}
] | 1 |
python | async def test_services(
hass: HomeAssistant,
mock_light_profiles,
mock_light_entities: list[MockLight],
) -> None:
"""Test the provided services."""
setup_test_component_platform(hass, light.DOMAIN, mock_light_entities)
assert await async_setup_component(
hass, light.DOMAIN, {light.DOM... | Review this code and list any quality issues. | [
{
"issue": "Minor tweak to alight with other implementations",
"severity": "minor",
"line": 26
}
] | 1 |
python | backends = [
(BACKEND_AUTO, "(default) detect appropriate backend automatically"),
(BACKEND_VIV, "vivisect"),
(BACKEND_PEFILE, "pefile (file features only)"),
(BACKEND_BINJA, "Binary Ninja"),
(BACKEND_DOTNET, ".NET"),
(BACKEND_FREEZE, "capa freeze"... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n help=\"provide a list of comma-separated function virtual addresses to analyze (static analysis).\",\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | self._initialize = kwargs.pop('initialize', noop)
self._handle_data = kwargs.pop('handle_data', noop)
self._before_trading_start = kwargs.pop(
'before_trading_start',
None,
)
self._analyze = kwargs.pop('analyze', None)
self.event_m... | Review this code and list any quality issues. | [
{
"issue": "So this is probably unnecessary, since the message inside the error that you're raising is the same as this. Either you probably want that assert, in which case, you're going to get an `AssertionError` with that message, or you want to raise the `ZeroCapitalError`, in which case you could probably p... | 1 |
python | return None
local_deploy = os.environ.get('LOCAL_DEPLOYMENT', None)
key = LITE_LLM_API_KEY
if not local_deploy:
# Get user info to add to litellm
token_manager = TokenManager()
keycloak_user_info = (
await token_manager.get_user_info_from_user_... | Review this code and list any quality issues. | [] | 0 |
python | assert png == png_snapshot
@pytest.mark.required
def test_rasterizer_camera_sensor_n_envs_attached_camera():
if sys.platform == "darwin":
pytest.skip(
"Batched rendering with Rasterizer backend is not supported on this machine because it requires OpenGL 4.2."
)
scene = gs.Scene(
... | Review this code and list any quality issues. | [
{
"issue": "You could remove the plane. Not sure that adding a surface is relevant here but as you want.",
"severity": "minor",
"line": 26
}
] | 1 |
python | return f"{base} ({info})"
SCHEMA_MISMATCH_FIELDS_TO_SHOW = 20
def _schema_to_fields(schema: Optional["Schema"]) -> Dict[str, str]:
# Helper function for converting Schemas into List of FieldRepr
if schema is None:
return {}
import pyarrow as pa
if isinstance(schema, pa.Schema):
ret... | Review this code and list any quality issues. | [
{
"issue": "You should be able to assume that the schema is either pyarrow or pandasblockschema, so the fallback is unneccessary. What you can do is check `isinstance(schema, pa.Schema)`, then if it's not that `assert isinstance(schema, PandasBlockSchema)`",
"severity": "minor",
"line": 26
}
] | 1 |
python | # -----------------------------------------------------------------------------------------
import datetime
import re
import time
import typing as t
import requests # type: ignore[import-untyped]
from taipy.gui import Gui, Icon, State, get_state_id, invoke_callback, invoke_long_callback
# The Wikipedia API used to ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n# The two users of this app\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | class OAuth2TokenAuthProvider(AuthProvider):
"""
JWT token authentication provider that validates a JWT token and extracts access attributes.
This should be the standard authentication provider for most use cases.
"""
def __init__(self, config: OAuth2TokenAuthConfig):
self.config = config
... | Review this code and list any quality issues. | [
{
"issue": "fork this off into a `_ensure_jwks_client(self)` method",
"severity": "minor",
"line": 26
}
] | 1 |
python | ])
def test_span_selector(ax, orientation, onmove_callback, kwargs):
# Also test that span selectors work in the presence of twin axes or for
# outside-inset axes on top of the axes that contain the selector. Note
# that we need to unforce the axes aspect here, otherwise the twin axes
# forces the orig... | Review this code and list any quality issues. | [
{
"issue": "Why leave only one `do_event` here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.log.debug("Create a template")
opts = self.capnp_modules['mining'].BlockCreateOptions()
opts.useMempool = True
opts.blockReservedWeight = 4000
opts.coinbaseOutputMaxAdditionalSigops = 0
template = await stack.enter_async_context(destro... | Review this code and list any quality issues. | [
{
"issue": "In fac12f7cf9ebc0b906bbb20ae126cf7e7552fdbb _test: fix interface_ipc.py template destruction_:\r\n\r\nI think the original intention here was to demonstrate that `generate` interrupts an ongoing `waitNext()`.\r\n\r\nNow it only shows that `waitNext()` returns immediately if the tip has changes befor... | 1 |
python | base_path = hub_dataset_repo_path + (base_path or "")
if size > 0:
resolved_data_files = resolve_pattern(pattern, base_path)
assert len(resolved_data_files) == size
else:
with pytest.raises(FileNotFoundError):
resolve_pattern(pattern, base_path)
@pytest.mark.parametrize("pa... | Review this code and list any quality issues. | [] | 0 |
python | # we fallback to the highest cost.
if tx_info is not None:
# At this point we have no transactions with zero cost
assert tx_info.advertised_cost > 0
top_tx_advertised_cost = tx_info.advertised_cost
else:
top_... | Review this code and list any quality issues. | [
{
"issue": "this also seems risky, are you sure you can't get stuck spinning infinitely here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | {
# Original source: http://www.uscourts.gov/cameras-courts/state-washington-vs-donald-j-trump-et-al
'url': 'https://player.piksel.com/v/v80kqp41',
'md5': '753ddcd8cc8e4fa2dda4b7be0e77744d',
'info_dict': {
'id': 'v80kqp41',
'ext': 'mp4',
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n url = urljoin(host, f'/ws/ws_{resource}/api/{app_token}/mode/json/apiv/5')\r\n response = traverse_obj(\r\n self._download_json(url, display_id, query=query, fatal=fatal), ('response', {dict})) or {}\r\n failure = traverse_obj(response, ('failure', '... | 1 |
python | # Matter labels can be used to modify the entity name
# by appending the text.
if name_modifier := self._get_name_modifier():
self._name_postfix = name_modifier
# make sure to update the attributes once
self._update_from_device()
def _find_matching_labels(self) -> list[... | Review this code and list any quality issues. | [] | 0 |
python | return True
elif other is False or other is pd_NA:
return pd_NA
return NotImplemented
__ror__ = __or__
def __xor__(self, other):
if other is False or other is True or other is pd_NA:
return pd_NA
return NotImplemented
__rxor__ = __xor__
__array... | Review this code and list any quality issues. | [
{
"issue": "I cannot find where `maybe_dispatch_ufunc_to_dunder_op` is supposed to be defined.",
"severity": "minor",
"line": 26
}
] | 1 |
python | for i in range(1, 1024):
res = np.loadtxt(["," * i], delimiter=",", dtype=bytes, max_rows=10)
assert len(res) == i + 1
@pytest.mark.parametrize("nmax", (10000, 50000, 55000, 60000))
def test_maxrows_exceeding_chunksize(nmax):
# tries to read all of the file,
# or less, equal, greater than _load... | Review this code and list any quality issues. | [
{
"issue": "Maybe also add `123_456` or so (not a multiple of 50000).",
"severity": "minor",
"line": 26
}
] | 1 |
python | Return the given text with ampersands, quotes and angle brackets encoded
for use in HTML.
Always escape input, even if it's already escaped and marked as such.
This may result in double-escaping. If this is a concern, use
conditional_escape() instead.
"""
return SafeString(html.escape(str(text)... | Review this code and list any quality issues. | [
{
"issue": "Nit: Suggest keeping the comment as prose\n```suggestion\n# Escape every ASCII character with a value less than 32 (C0) and 127-159(C1).\n```",
"severity": "critical",
"line": 26
}
] | 1 |
python | **traverse_obj(programme, {
'categories': 'keywords',
'id': ('tv_episode_info', 'show_content_id'),
'description': ('custom_data', 'program_description'),
'series': ('custom_data', 'program_name'),
'title': ('custom_data', 'program_name'),
... | Review this code and list any quality issues. | [
{
"issue": "same as above\r\n```suggestion\r\n playlist_id = self._match_id(url)\r\n page = self._download_webpage(url, playlist_id)\r\n meta = self._search_json('window\\.app\\s*=', page, 'playlist info', playlist_id)\r\n playlist = traverse_obj(meta, ('falcorCache', 'playList', pla... | 1 |
python | """Diagnostics support for Lunatone integration."""
from typing import Any, Final
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.core import HomeAssistant
from .coordinator import LunatoneConfigEntry
TO_REDACT: Final[list[str]] = []
async def async_get_config_entry_diagnosti... | Review this code and list any quality issues. | [
{
"issue": "If there is nothing to redact... we can just as well omit this :)",
"severity": "minor",
"line": 10
}
] | 1 |
python | }, {
'url': 'https://www.bilibili.com/medialist/detail/ml1103407912',
'only_matching': True,
}]
def _real_extract(self, url):
fid = self._match_id(url)
list_info = self._download_json(
f'https://api.bilibili.com/x/v3/fav/resource/list?media_id={fid}&pn=1&ps=20',
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'title': ('title', {str}),\r\n 'description': ('intro', {str}),\r\n 'uploader': ('upper', 'name', {str}),\r\n 'uploader_id': ('upper', 'mid', {str_or_none}),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | return lifespan
except (ValueError, TypeError):
return lifespan
def resync(self, app: FastAPI) -> None:
"""Resync the AgentOS to discover, initialize and configure: agents, teams, workflows, databases and knowledge bases."""
self._initialize_agents()
self._initialize_te... | Review this code and list any quality issues. | [
{
"issue": "So when we add a router, the docs route does not get added by default?",
"severity": "minor",
"line": 26
}
] | 1 |
python | return None
return utils.parse_time(self._incidents_data.get('invites_disabled_until'))
@property
def dms_paused_until(self) -> Optional[datetime.datetime]:
"""Optional[:class:`datetime.datetime`]: If DMs are paused, returns when DMs
will get enabled in UTC, otherwise returns None.
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n return utils.parse_time(self._incidents_data.get('dm_spam_detected_at'))\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.firstAddrnServices = message.addrs[0].nServices
def wait_for_addr(self, timeout=5):
test_function = lambda: self.last_message.get("addr")
self.wait_until(test_function, timeout=timeout)
def send_getdata_for_block(self, blockhash):
getdata_request = msg_getdata()
getdata_requ... | Review this code and list any quality issues. | [] | 0 |
python | )
)
if starved_pools:
query = query.where(TI.pool.not_in(starved_pools))
if starved_dags:
query = query.where(TI.dag_id.not_in(starved_dags))
if starved_tasks:
query = query.where(tuple_(TI.dag_id, TI.task_id).not_in(star... | Review this code and list any quality issues. | [
{
"issue": "The window function limits selection to `max_active_tasks` per dag_run without considering currently executing tasks. For example, if a dag_run has 3 tasks already executing and `max_active_tasks=4`, this query would select 4 scheduled tasks (since `row_num` goes 1-4), but only 1 can actually be que... | 1 |
python | # Ensure that the stream is only run once
output_schema = ctx.deps.output_schema
async def _run_stream() -> AsyncIterator[_messages.HandleResponseEvent]: # noqa: C901
if not self.model_response.parts:
# we got an empty response.
# this s... | Review this code and list any quality issues. | [
{
"issue": "Since we already pass in `ctx`, we don't need a new arg do we?",
"severity": "minor",
"line": 26
}
] | 1 |
python | STATS_TYPE_WIDTH = 8
"""Default interval for how frequently results are written to console."""
CONSOLE_STATS_INTERVAL_SEC = 2
"""Default interval for how frequently results are written to history."""
HISTORY_STATS_INTERVAL_SEC = 5
"""Default interval for how frequently CSV files are written if this option is configu... | Review this code and list any quality issues. | [
{
"issue": "Maybe put lowest percentile first?",
"severity": "minor",
"line": 26
}
] | 1 |
python | "I is not the you are",
]
PROCESSED_TEXTS = list(map(
lambda text: text.lower().replace('.', '').replace(',', '').replace('!', '').replace(';', '').split(' '),
TEXTS
))
def bm25_collection_setup(
collection_name='test_collection',
):
response = request_with_validation(
api='/collections/{... | Review this code and list any quality issues. | [] | 0 |
python | 'key': 'efbb3ec0b8246f61adf1764c5a51213a',
'iv': '80621d19a1f19167b64cedb415b05d1c',
},
},
'params': {
'skip_download': 'm3u8',
},
}, {
'url': 'https://www.stacommu.jp/en/live/d2FJ3zLnndegZJCAEzGM3m',
'only_matching': True,
}]
... | Review this code and list any quality issues. | [
{
"issue": "While at it, should the client version be updated?\r\n```suggestion\r\n 'X-Client-Version': 'Chrome/JsCore/9.23.0/FirebaseCore-web',\r\n```\r\nNote: I didn't test this, but only looked at the JS.",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert inspect.signature(np.exp) == np.exp.__signature__
assert np.atan.__signature__ != np.atan2.__signature__
sig11 = inspect.signature(np.sin)
assert "x" in sig11.parameters
assert "x1" not in sig11.parameters
assert sig11.parameters["out"].default is None
sig21 = inspect.signature(np.add)
... | Review this code and list any quality issues. | [
{
"issue": "I'd check maybe one or two `gufuncs` as well, like `vecdot` or `matmul`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | default=True,
validator=validate_bool,
description="Use mathtext if there is an even number of unescaped dollar signs."
),
_Param(
"text.usetex",
default=False,
validator=validate_bool,
description="use latex for all text handling. The following fonts are "
... | Review this code and list any quality issues. | [
{
"issue": "There is no `tex`, I think?\n```suggestion\n \"- 'latex+dvipng': The same as 'latex', with the exception that Agg-based \"\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | for filename in files_with_intrinsics:
print("Reading intrinsics from", filename)
storage = cv.FileStorage(filename, cv.FileStorage_READ)
camera_matrix = storage.getNode('cameraMatrix').mat()
if camera_matrix is None:
camera_matrix = st... | Review this code and list any quality issues. | [
{
"issue": "I propose to print a message that the same K and distortion is applied for all cameras.",
"severity": "minor",
"line": 26
}
] | 1 |
python | elif isinstance(value, datetime):
dt = value.astimezone(timezone.utc) if value.tzinfo else value.replace(tzinfo=timezone.utc)
else:
raise TypeError(f"Unsupported type for RFC3339 conversion: {type(value)!r}")
dt = dt.replace(microsecond=(dt.microsecond // 1000) * 1000)
return dt.isoformat(t... | Review this code and list any quality issues. | [
{
"issue": "please include the options. this context may be useful for debugging",
"severity": "critical",
"line": 26
}
] | 1 |
python | _autowrap_check(self, fn.__globals__, self._autowrap_function_ids, self.autowrap_leaf_pairs, self.agfunc_dict)
result = fn(*args_tail, **kwargs)
elif kind == 'call_module':
assert isinstance(target, str)
mod = self.fetch_attr(target)
if self.cp... | Review this code and list any quality issues. | [
{
"issue": "a little concern is could a module result be a customized data structure? i.e., when I take `BertModel` as a leaf module and it return an output like `BertOuput`?",
"severity": "minor",
"line": 26
}
] | 1 |
python | crop_vision_frame = cv2.warpAffine(close_vision_frame, cv2.invertAffineTransform(close_matrix), (512, 512), borderMode = cv2.BORDER_REPLICATE)
return crop_vision_frame
def process_edtalk(crop_vision_frame : VisionFrame, temp_audio_frame : AudioFrame) -> VisionFrame:
lip_syncer_weight = state_manager.get_item('lip_s... | Review this code and list any quality issues. | [
{
"issue": "please introduce LipSyncerWeight - similar to\r\n\r\n```\r\nFaceEnhancerWeight : TypeAlias = NDArray[Any]\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | logger.info(f"enable_sleep_mode: {self.config.enable_sleep_mode}")
if not self.config.enable_sleep_mode:
from verl.utils.device import set_expandable_segments
set_expandable_segments(True)
quantization = self.config.quantization
if quantization is not None:
i... | Review this code and list any quality issues. | [
{
"issue": "We can disable sleep mode in standalone:\r\n```python\r\n\"enable_sleep_mode\": self.rollout_mode != RolloutMode.STANDALONE\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'skip_download': True,
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
video_data = self._download_json(
'https://watch-cdn.product.api.espn.com/api/product/v3/watchespn/web/event?id=%s' % video_id, video_id)['page']['contents']
title = video_data[... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n formats = self._extract_m3u8_formats(\r\n asset['stream'], video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls')\r\n self._sort_formats(formats)\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import traverse_obj
class S4CIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?s4c\.cymru/clic/programme/(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.s4c.cymru/clic/programme/861362209',
'info_dict': {
'id': '861362209',
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n },\r\n }, {\r\n```",
"severity": "minor",
"line": 18
}
] | 1 |
python | 'title': '뭉쳐야 찬다3 2회 예고편 - A매치로 향하는 마지막 관문💥',
'description': 'md5:d48b51a8655c84843b4ed8d0c39aae68',
'duration': 46.0,
'release_date': '20231015',
'age_limit': 15,
'thumbnail': 'https://fs.jtbc.co.kr//joydata/CP00000001/prog/enter/soccer3/img/20231008_210957_... | Review this code and list any quality issues. | [
{
"issue": "I think this should be the `display_id` instead of the `id`. The `VO...` should be the id instead.",
"severity": "minor",
"line": 26
}
] | 1 |
python | from ...constants import *
from ...mobject.opengl_mobject import OpenGLMobject
from ...utils.bezier import interpolate
from ...utils.color import BLACK, WHITE, YELLOW, color_gradient, color_to_rgba
from ...utils.iterables import resize_with_interpolation
class OpenGLPMObject(OpenGLMobject):
shader_folder = "true_... | Review this code and list any quality issues. | [
{
"issue": "I'm not entirely sure, but `reset_points` feels a little redundant since `init_data` already defines these attributes.",
"severity": "minor",
"line": 26
}
] | 1 |
python | Type,
)
@register_dataset("allenai/pixmo-cap")
class PixmoCapDataset(VisionLanguageSftDataset):
"""Dataset class for the `allenai/pixmo-cap` dataset."""
default_dataset = "allenai/pixmo-cap"
@override
def transform_conversation(self, example: dict) -> Conversation:
"""Transform the example i... | Review this code and list any quality issues. | [
{
"issue": "is there a USER text query ? \r\n\r\nIf not, we may want to add a hardcoded taskspeciffc prompt, something like this: https://github.com/oumi-ai/oumi/blob/3720d477900026fd47e8ce7e2562c0e5f981e648/src/oumi/datasets/vision_language/flickr30k.py#L37 \r\nto give LLM some instruction what to do .",
... | 1 |
python | pass
await crawler.run(['https://example.com', str(httpbin)])
assert mock_hook.call_count == 2
async def test_proxy_set() -> None:
proxy_value = 'http://1111:1111'
mock_handler = mock.AsyncMock(return_value=None)
crawler = PlaywrightCrawler(proxy_configuration=ProxyConfiguration(proxy_urls=[prox... | Review this code and list any quality issues. | [
{
"issue": "Could you please add some explanatory comments to the test? Thank you.",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.play(vector_field.animate.become(ArrowVectorField(func)))
self.wait()
Returns
-------
`Callable[[np.ndarray], np.ndarray]`
The scaled vector field function.
"""
return lambda p: func(p * scalar)
def fit_to_coordinate_system(self, coordi... | Review this code and list any quality issues. | [
{
"issue": "This parameter is documented but not used?",
"severity": "minor",
"line": 26
}
] | 1 |
python | test_input = "a" * 30 # 30 'a's without a 'b' at the end
# This should be handled by timeout protection or pattern detection
start_time = asyncio.get_event_loop().time()
results = []
async for output_name, output_data in block.run(
ExtractTextInformationBlock.Input(
... | Review this code and list any quality issues. | [] | 0 |
python | precision='fp16',
initial_scale=1)
booster = Booster(plugin=plugin, **booster_kwargs)
# ==============================
# Prepare Dataloader
# ==============================
data_builder = GLUEDataBuilder(model_name,
plugin,
... | Review this code and list any quality issues. | [
{
"issue": "Lazy init context does not support `from_pretrained()` now. It's not essential in this example. You can remove it.",
"severity": "minor",
"line": 26
}
] | 1 |
python | from cognee.infrastructure.databases.vector import get_vector_engine
from cognee.modules.retrieval.base_retriever import BaseRetriever
from cognee.modules.retrieval.exceptions.exceptions import NoDataError
from cognee.infrastructure.databases.vector.exceptions.exceptions import CollectionNotFoundError
logger = get_log... | Review this code and list any quality issues. | [
{
"issue": "Same I would delete this because of the enum where we instantiate all the retrievers that we have.",
"severity": "minor",
"line": 26
}
] | 1 |
python | # modified from SequentialPipelineBlocks to include loop_expected_configs
@property
def expected_configs(self):
expected_configs = []
for block in self.sub_blocks.values():
for config in block.expected_configs:
if config not in expected_configs:
ex... | Review this code and list any quality issues. | [] | 0 |
python | Which class best represents the relevance?
""",
},
],
temperature=self.temperature,
n=self.n,
logprobs=self.logprobs,
top_logprobs=self.top_logprobs,
max_tokens=self.max_tokens,
)
# Extract response ... | Review this code and list any quality issues. | [
{
"issue": "The fallback to the last token when no class token is found could result in the same bug that was originally being fixed. Consider adding additional validation or a more robust fallback strategy, such as checking if the last token contains any numeric characters or returning an error/default score i... | 1 |
python | bar = Rectangle(
height=bar_h,
width=bar_w,
stroke_width=self.bar_stroke_width,
fill_opacity=self.bar_fill_opacity,
)
pos = UP if (value >= 0) else DOWN
bar.next_to(self.c2p(bar_number + 0.5, 0), pos, buff=0)
return bar
def _add_bars(... | Review this code and list any quality issues. | [
{
"issue": "Well, it isn't really changed by this PR but the typing for this constructor is wrong for `label_constructor` it should be `Type[VMobject]` instead of `VMobject` see https://docs.python.org/3/library/typing.html#typing.Type",
"severity": "critical",
"line": 26
}
] | 1 |
python | @abstractproperty
def mask(self):
"""
A Filter representing asset/date pairs to include while
computing this Term. (True means include; False means exclude.)
"""
raise NotImplementedError('mask')
@abstractproperty
def dependencies(self):
"""
A diction... | Review this code and list any quality issues. | [
{
"issue": "this comment should be updated",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'view_count': int,
'comment_count': int,
},
}, {
# 720p
'url': 'https://www.mojevideo.sk/video/358c8/dva_nissany_skyline_strielaju_v_londyne.html',
'only_matching': True,
}, {
# 720p
'url': 'https://www.mojevideo.sk/video/2455d/gopro_hero4_session_nova... | Review this code and list any quality issues. | [
{
"issue": "This is the same as the page_id in decimal. I would use the ID in the URL as the video_id and then use this one only for the request, probably with a fallback to `str(int(video_id, 16))`",
"severity": "minor",
"line": 26
}
] | 1 |
python | for tool_call in message.tool_calls:
if tool_call.get("id") in tool_call_ids_to_remove:
should_remove = True
break
if not should_remove:
filtered_messages.append(message)
run_response.messages = filtered_messages
def scrub_history_messa... | Review this code and list any quality issues. | [] | 0 |
python | 'height': height,
} for i in range(first, last + 1)]
def _real_extract(self, url):
mobj = self._match_valid_url(url)
video_id, host = mobj.group('id', 'host')
for display_id_key in ('display_id', 'display_id_2'):
if display_id_key in mobj.groupdict():
dis... | Review this code and list any quality issues. | [
{
"issue": "apparently now some pages have the config url as a hidden input value, add a check for that\r\n```suggestion\r\n inputs = self._hidden_inputs(webpage)\r\n \r\n if not cfg_url:\r\n cfg_url = inputs.get('config')\r\n\r\n if not cfg_url and inputs.get('vkey') ... | 1 |
python | class SysLogHandlerWrapper(logging.handlers.SysLogHandler):
"""
Override the priority_map :class:`SysLogHandler`.
.. warning::
This messages at DEBUG and INFO are therefore not stored by ASL, (ASL = Apple System Log)
which in turn means they can't be printed by syslog after the fact. You ca... | Review this code and list any quality issues. | [
{
"issue": "we can remove this since, it will be swallowed by `kwargs`",
"severity": "major",
"line": 26
}
] | 1 |
python | " **and_very_long_keyword_arguments\n"
"):\n"
" pass\n"
),
headers={blackd.PYTHON_VARIANT_HEADER: "3.5"},
)
self.assertEqual(response.status, 204)
response = await client.post(
"/",
... | Review this code and list any quality issues. | [
{
"issue": "Please move this up to the top of the file. Otherwise lgtm.",
"severity": "major",
"line": 26
}
] | 1 |
python | )
if not traverse_obj(login, ('AuthorizationToken', 'Token')):
raise ExtractorError('Login failed', expected=True)
else:
self._TOKEN = login['AuthorizationToken']['Token']
def _real_extract(self, url):
video_id = self._match_id(url)
if not self._TOKEN:
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if not traverse_obj(media_play_info, ('ContentUrl', {str})):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | codec_options: dict[str, str]
Additional low-level codec options that will be pass to ffmpeg. Empty by default.
save_on_reset: bool, optional
Whether to save the data on reset. If True, a counter will be added to the filename and incremented on each
reset. Defaults to False.
"""
fps... | Review this code and list any quality issues. | [
{
"issue": "this line will run during import time, which will trigger error if `IS_PYAV_AVAILABLE=False`",
"severity": "minor",
"line": 26
}
] | 1 |
python | "write_to_template": 'version = "{version}"\n',
},
description="The uncompromising code formatter.",
long_description=get_long_description(),
long_description_content_type="text/markdown",
keywords="automation formatter yapf autopep8 pyfmt gofmt rustfmt",
author="Łukasz Langa",
author_email=... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n \"tomli>=0.2.6,<2.0.0\",\r\n```\r\nI would much appreciate this upper bound for the version. There's many open source projects afraid to make any changes, ever, due to the fear of downstream projects breaking. Luckily we have a solution: semantic versions. Let's use them :wi... | 1 |
python | face.u2 = u2
face.v1 = v1
face.v2 = v2
faces.set_fill(color=self.fill_color, opacity=self.fill_opacity)
faces.set_stroke(
color=self.stroke_color,
width=self.stroke_width,
opacity=self.stroke_opacity,
)
self.add(*faces)
... | Review this code and list any quality issues. | [
{
"issue": "Just as mentioned in the other comment: every docstring **needs** to start with a one-line summary. Please add back something along the lines of\r\n\r\n```suggestion\r\n \"\"\"A mobject representing a three-dimensional sphere.\r\n```\r\n\r\n(feel free to commit your own suggestion instead.)",
... | 1 |
python | if dtype == object:
res_values = res_values.astype(object, copy=False)
elif is_string_dtype(dtype):
# mypy doesn't infer dtype is an ExtensionDtype
string_array_cls = dtype.construct_array_type() # type: ignore[union-attr]
res_values = string_array_cls._from_sequ... | Review this code and list any quality issues. | [
{
"issue": "This comment repeats the code, can you remove it.",
"severity": "minor",
"line": 26
}
] | 1 |
python | return parser.parse_args()
def load_model_and_tokenizer(model_path, device="auto"):
print("Loading model and tokenizer using AutoTokenizer:", model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n val = getattr(obj, attr) if hasattr(obj, attr) else default\r\n print(f\"{label}\", val)\r\n```\r\nSometimes f.ex. `bos_token_id` is `null`, in that case it's useful to print that.\r\n\r\nAlso, you weren't using `default`, change the code (and remove `default`) if the... | 1 |
python | if (block_idx + 1) * BLOCK_SIZE >= prompt_len:
mask = block < prefill_len
mask &= block >= prompt_len
output_tokens = tl.load(
all_token_ids_ptr + req_state_idx * all_token_ids_stride + block, mask=mask
)
tl.atomic_add(
output_bin_counts_ptr
+ ... | Review this code and list any quality issues. | [
{
"issue": "Indexing a tensor like this will create a new tensor unless it's an assignment (so this won't actually modify the original tensors)\n\n```suggestion\n prompt_bin_mask[idx_mapping] = 0\n output_bin_counts[idx_mapping] = 0\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | class GridLayout(Layout):
"""Used to layout Widgets into a grid."""
name = "grid"
def __init__(self) -> None:
self.min_column_width: int | None = None
self.stretch_height: bool = False
"""Stretch the height of cells to be equal in each row."""
self.regular: bool = False
... | Review this code and list any quality issues. | [
{
"issue": "Is this grid size actually columns/rows rather than width/height?",
"severity": "minor",
"line": 26
}
] | 1 |
python | import psutil
from facefusion import state_manager
from facefusion.types import DiskMetrics, ExecutionDevice, MemoryMetrics, Metrics, NetworkMetrics, ProcessorMetrics
def get_metrics_set() -> Metrics:
drive_path = Path(state_manager.get_temp_path()).anchor
return\
{
'execution_devices': detect_graphic_devices(... | Review this code and list any quality issues. | [
{
"issue": "keep this file stateless, forward execution_providers via argument",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
Test agent logs retrieval with message files and agent thought files.
"""
fake = Faker()
# Create test data
app, account = self._create_test_app_and_account(db_session_with_containers, mock_external_service_dependencies)
conversation, message = self._create_test_conv... | Review this code and list any quality issues. | [
{
"issue": "The `MessageFile` model now expects string values for `type`, `transfer_method`, and `created_by_role` fields since it uses `TypeBase` with auto-generated `__init__`. The enum values should be converted to strings using `.value` property:\n- `type=FileType.IMAGE.value` \n- `transfer_method=FileTrans... | 1 |
python | import dataclasses
import json
import os
import random
import time
from datetime import datetime
from typing import List, Optional, Tuple, Dict
import openai
import asyncio
import logging
from transformers import PreTrainedTokenizerBase
from vllm.engine.arg_utils import EngineArgs
from vllm.utils import FlexibleArgu... | Review this code and list any quality issues. | [
{
"issue": "@happyandslow Can you help review the benchmark changes?",
"severity": "major",
"line": 6
}
] | 1 |
python | def test_splitfilepath_blob_nested(self):
container, blob = self.client.splitfilepath("abc/cde/xyz.txt")
self.assertEquals(container, "abc")
self.assertEquals(blob, "cde/xyz.txt")
def test_create_delete_container(self):
import datetime
import hashlib
m = hashlib.md5(... | Review this code and list any quality issues. | [
{
"issue": "Each method should have it's own tests. Why are they all being crammed into this one test?",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
self.equality_info[i_e, i_b].eq_type = gs.ti_int(gs.EQUALITY_TYPE.WELD)
self.equality_info[i_e, i_b].eq_obj1id = l1
self.equality_info[i_e, i_b].eq_obj2id = l2
for i_3 in range(3):
self.equality_info[i_e, i_b].eq_data[i_3 + 3] = pos1[i_3]
... | Review this code and list any quality issues. | [
{
"issue": "you should not have to keep track go the original env indices.",
"severity": "minor",
"line": 26
}
] | 1 |
python | rates = self.FX_RATES_RATE_NAMES + [DEFAULT_FX_RATE]
currencies = self.FX_RATES_CURRENCIES
# For every combination of rate name and quote currency...
for rate, quote in itertools.product(rates, currencies):
# Choose N random distinct days...
for ndays in 1, 2, 7, 20:
... | Review this code and list any quality issues. | [] | 0 |
python | self.__adapter_for_type: t.Dict[str, t.Callable] = {}
self.__type_for_variable: t.Dict[str, str] = {}
self.__warning_by_type: t.Set[str] = set()
def _get_adapted_lov(self, lov: t.Any, var_type: str) -> _AdaptedLov:
return _AdaptedLov(lov, var_type)
def _add_for_type(self, type_name: st... | Review this code and list any quality issues. | [
{
"issue": "this 2 lines could go into the _AdaptedLov.get method",
"severity": "minor",
"line": 26
}
] | 1 |
python | storage_client: StorageClient | None = None,
request_manager: RequestManager | None = None,
session_pool: SessionPool | None = None,
proxy_configuration: ProxyConfiguration | None = None,
http_client: HttpClient | None = None,
request_handler: Callable[[TCrawlingContext], Awaitab... | Review this code and list any quality issues. | [
{
"issue": "the option should be called just `id` as in the JS version, right?",
"severity": "minor",
"line": 26
}
] | 1 |
python | await self._write_response_object(response_object, input, messages)
async def _write_response_object(
self,
response_object: OpenAIResponseObject,
input: list[OpenAIResponseInput],
messages: list[OpenAIMessageParam],
) -> None:
if self.sql_store is None:
rais... | Review this code and list any quality issues. | [
{
"issue": "this made me realize that the table name was hardcoded 🤦🏻",
"severity": "minor",
"line": 26
}
] | 1 |
python | if mobj:
resolutions[mobj.group('format_id')] = (
int(mobj.group('width')), int(mobj.group('height')))
for fmt_stream in fmt_stream_map:
fmt_stream_split = fmt_stream.split('|')
if len(fmt_stream_split) < 2:
con... | Review this code and list any quality issues. | [
{
"issue": "Also needs `confirm` to download larger files\r\n```suggestion\r\n 'export': 'download',\r\n 'confirm': 't',\r\n```",
"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.