language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | def inject_arrow_table_documentation(arrow_table_method):
def wrapper(fn):
fn.__doc__ = arrow_table_method.__doc__ + (fn.__doc__ if fn.__doc__ is not None else "")
fn.__doc__ = fn.__doc__.replace("pyarrow.Table", "Table")
if hasattr(arrow_table_method, "__annotations__"):
fn.__an... | Review this code and list any quality issues. | [
{
"issue": "I think this function is not necessary, we can call pa.memory map directly",
"severity": "major",
"line": 26
}
] | 1 |
python | },
}
]
def _real_extract(self, url):
webpage = self._download_webpage(url, self._match_id(url))
video_props = json.loads(re.search(
r'<script\s?id=\"__NEXT_DATA__\"\s?type=\"application/json\">({.+})</script>',
webpage).group(1))['props']['pageProps']['video']
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'view_count': int_or_none(video_props['view_count']),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # SPDX-License-Identifier: Apache-2.0
# Standard
from dataclasses import dataclass
from enum import IntEnum, auto
from typing import Optional
import struct
# Third Party
import torch
# First Party
from lmcache.utils import CacheEngineKey
from lmcache.v1.memory_management import MemoryFormat
MAX_KEY_LENGTH = 150
cl... | Review this code and list any quality issues. | [
{
"issue": "Sorry but I didn't mean to add `s` at end; do you mind changing to `ClientCommand`?",
"severity": "minor",
"line": 18
}
] | 1 |
python | tables_list.append(f'{database}.{table}')
# use list databases
database = ','.join(set(s.params['database'] for s in skills))
db = MindsDBSQL(
engine=self.get_command_executor(),
database=database,
metadata=self.get_command_executor().session.integration_cont... | Review this code and list any quality issues. | [
{
"issue": "I wonder how providing multiple descriptions, DBs, & tables all at once as context will affect the performance of the agent. Something to keep in mind if we run into issues with this approach.",
"severity": "major",
"line": 26
}
] | 1 |
python | # Update the differentiable contact data.
gjk_state.contact_pos[i_b, insert_id] = contact_pos
gjk_state.normal[i_b, insert_id] = contact_normal
gjk_state.diff_penetration[i_b, insert_id] = diff_penetration
# Update the non-differentiable contact data for the backward pass.
gjk_s... | Review this code and list any quality issues. | [
{
"issue": "`gjk_state.is_col[i_b] = n_contacts > 0`",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'like_count': int,
},
'playlist_count': 3,
}]
def _extract_from_url(self, url, video_id):
webpage = self._download_webpage(url, video_id)
def extract_metadata(webpage):
def extract_format(video_dict):
formats = []
for i, url in enumer... | Review this code and list any quality issues. | [
{
"issue": "watch line length, this is too long",
"severity": "major",
"line": 26
}
] | 1 |
python | min_value = 1 << (3 + 8 + 8 + 8)
elif (b & 0b11111110) == 0b11111100:
# 1 + 8 + 8 + 8 + 8 + 8 bits length prefix
mask = 0b00000001
prefix_len = 5
min_value = 1 << (2 + 8 + 8 + 8 + 8)
atom_len = b & mask
for i in range(prefix_len):
atom_len <<= 8
offset += 1
... | Review this code and list any quality issues. | [
{
"issue": "This is invalid. Wouldn't canonical representations be required to be valid?",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
program = (
"import matplotlib as mpl; "
"import matplotlib.pyplot as plt; "
"import matplotlib.cbook as cbook; "
"import matplotlib.patches as mpatches"
)
subprocess_run_for_testing(
[sys.executable, "-OO", "-c", program],
env={**os.environ, "MPLBACKEND":... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n with pytest.raises(matplotlib.ExecutableNotFoundError, match='Timed out'):\r\n print(matplotlib._get_executable_info.__wrapped__('inkscape'))\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | return False
msg = '\nAll required packages are installed.'
print(msg)
return self.check_dictionary()
except Exception as e:
error = f'install_python_packages() error: {e}'
print(error)
return False
def check_dictiona... | Review this code and list any quality issues. | [
{
"issue": "Printing the entire device_info dictionary may produce unclear output. Consider printing specific fields like device_info['name'] or device_info['tag'] to provide a clearer message matching the format of the removed print statements (e.g., '---> Hardware detected: JETSON').\n```suggestion\n ... | 1 |
python | #!/usr/bin/env python3
# Copyright (c) The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.
import os
import shlex
import subprocess
import sys
def run(cmd, **kwargs):
print("+ " + shlex.join(cmd), flush=True)
tr... | Review this code and list any quality issues. | [
{
"issue": "Similar to this comment, https://github.com/bitcoin/bitcoin/pull/33639#discussion_r2448346644\n\nmaybe avoid using concats (e.g. via *list)",
"severity": "minor",
"line": 26
}
] | 1 |
python | },
'playlist_mincount': 50
}]
def _real_extract(self, url):
username, story_id = self._match_valid_url(url).groups()
story_info_url = f'{username}/{story_id}/?__a=1' if username == 'highlights' else f'{username}/?__a=1'
story_info = self._download_json(f'https://www.instagram.c... | Review this code and list any quality issues. | [
{
"issue": "For storyIE, can you add a test that doesn't need login?",
"severity": "minor",
"line": 26
}
] | 1 |
python | if __name__ == "__main__":
args = parse_args()
if args.video_in != "":
run_ffmpeg(args)
if args.run_colmap:
run_colmap(args)
AABB_SCALE = int(args.aabb_scale)
SKIP_EARLY = int(args.skip_early)
IMAGE_FOLDER = args.images
TEXT_FOLDER = args.text
OUT_PATH = args.out
print(f"outputting to {OUT_PATH}...")
came... | Review this code and list any quality issues. | [
{
"issue": "Could all the ''-strings be changed to \"\"-strings?",
"severity": "minor",
"line": 26
}
] | 1 |
python | "né": "births",
"dead": "deaths",
"mort": "deaths",
}
user_agent = "https://taipy.io/demo"
# the list of messages
messages: list[tuple[str, str, str]] = [] # (Message id, message, sender)
# the users
users = [
["wikipedia", Icon("https://www.wikipedia.org/static/apple-touch/wikipedia.png", "Wikipedia")],... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if (pos := msg_content.find(text)) > -1:\r\n```\r\nmay be less readable. Your choice.",
"severity": "minor",
"line": 26
}
] | 1 |
python | Unix systems.
May raise:
- RuntimeError: if the current user has no homedir
- PermissionError: if the current process cannot access the user's homedir
"""
if sys.platform == "win32":
# Windows
user_config_path = Path.home() / ".black"
else:
config_root = os.environ.get("... | Review this code and list any quality issues. | [] | 0 |
python | "Options:",
" --help Show this message and exit.",
]
def test_removing_multiline_marker(runner):
@click.group()
def cli():
pass
@cli.command()
def cmd1():
"""\b
This is command with a multiline help text
which should not be rewrapped.
The output o... | Review this code and list any quality issues. | [
{
"issue": "Add this as a comment, docstrings are meant to describe a test not add comments.",
"severity": "minor",
"line": 26
}
] | 1 |
python | standardize = bool(standardize)
sample = xp.moveaxis(sample, axis, -1)
sample = xp.sort(sample, axis=-1) if not sorted else sample
return sample, order, axis, sorted, standardize
def _br(x, *, r=0, xp):
n = x.shape[-1]
x = xp.expand_dims(x, axis=-2)
x = xp.broadcast_to(x, x.shape[:-2] + (r.s... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n binom_rpk_k = xpx.lazy_apply(special.binom, r+k, k)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'ext': 'mp3',
'title': 'T.N.T 29 de outubro',
'description': None,
'release_date': '20231029',
'thumbnail': r're:https://radiocomercial.pt/upload/[^.]+.jpg',
'season': 2023
}
}]
def _real_extract(self, url):
video_id, season = self._ma... | Review this code and list any quality issues. | [
{
"issue": "mb for the regex colliding previously. I wanted to also match URLs that have query parameters or use anchors. Hopefully this works:\r\n```suggestion\r\n _VALID_URL = r'https?://(?:www\\.)?radiocomercial\\.pt/podcasts/(?P<id>[\\w-]+)(?:/\\D*(?P<season>\\d+))?/?(?:$|[?#])'\r\n```",
"severity": ... | 1 |
python | def _perform_login(self, username, password):
urlh = self._request_webpage(
'https://tube.tugraz.at/Shibboleth.sso/Login?target=/paella/ui/index.html',
None, fatal=False, note='downloading login page', errnote='unable to fetch login page')
if not urlh:
return
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if not self._html_search_regex(\r\n r'<p\\b[^>]*>(Bitte geben Sie einen OTP-Wert ein:)</p>',\r\n content, 'TFA prompt', default=None):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # flake8: noqa: F401
from ._user_array_impl import __doc__, container | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n# ruff: noqa: F401\r\n```",
"severity": "minor",
"line": 1
}
] | 1 |
python | run_config = RunConfiguration()
run_config.environment.python.user_managed_dependencies = True
run_config.environment.docker.enabled = True
run_config.environment.docker.base_image = args.docker_image
run_config.target = compute_target
run_config.node_count = 1
config = ScriptRunConfig(source_di... | Review this code and list any quality issues. | [
{
"issue": "~~`status` is never updated in loop body, so the result is deterministic............~~",
"severity": "minor",
"line": 26
}
] | 1 |
python | pagination_list = self._search_regex(
r'(?s)class="[^"]*pagination-list[^"]*"[^>]*>(.+?)</ul>', webpage, 'pagination_list', fatal=False,
default=None)
if pagination_list:
last_page = max(map(int_or_none, re.findall(r'(\d+)', pagination_list)))
return last_page
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n return self._download_webpage(\r\n url, playlist_id, query={'page': current_page_number},\r\n note='Downloading page %d%s' % (current_page_number, format_field(last_page_number, template='of %d'))\r\n```\r\nWhat's with the logic behind not setting curre... | 1 |
python | cols: Optional[int] = None,
buff: Union[float, Tuple[float, float]] = MED_SMALL_BUFF,
cell_alignment: np.ndarray = ORIGIN,
row_alignments: Optional[str] = None, # "ucd"
col_alignments: Optional[str] = None, # "lcr"
row_heights: Optional[Iterable[Optional[float]]] = None,
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n The vertical alignment for each row (top to bottom). Accepts the following characters: ``\"u\"`` -\r\n up, ``\"c\"`` - center, ``\"d\"`` - down.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | -----
任务: 参考 ##讨论目标 和 ##讨论记录 进一步询问你感兴趣的细节,字数不多于150字
特别注意1:你只是单纯地询问,不要赞同或否定任何人的任何观点
特别注意2:本次输出,仅包含 ##OUTPUT 这一主题,不要增加、减少或改变主题。输出时,以'##OUTPUT'开头,然后马上换行,再正式输出内容,仔细参考"##Format example"中的格式。
"""
FORMAT_EXAMPLE = """
##
##OUTPUT
...(请在这里输出你想询问的细节)
##
##
"""
OUTPUT_MAPPING = {
"OUTPUT": (str, ...),
}
class DetailMi... | Review this code and list any quality issues. | [
{
"issue": "You can add a brief description here, for example, to provide more detail when given a clear goal and context.",
"severity": "minor",
"line": 26
}
] | 1 |
python | console.log(f'beforePyScriptExec called')
console.log(f'before_src:{src}')
def afterPyScriptExec(self, interpreter, src, pyScriptTag, result):
console.log(f'afterPyScriptExec called')
console.log(f'after_src:{src}')
def onUserError(self, config):
console.log('onUserError called... | Review this code and list any quality issues. | [
{
"issue": "`pyScriptTag` is a `pyodide.ffi.JsProxy` and I was unable to get the `id`.\r\n\r\nI have removed this for now...since it wasn't testing something of any significant value I guess...\r\nBut of course, if there's a way to resolve this, we should re-add this stuff...",
"severity": "minor",
"lin... | 1 |
python | def _get_formats(element) -> list:
return [NubilesPornIE._get_format(i) for i in get_elements_html_by_class('edge-download-item', element)]
@staticmethod
def _get_format(element: str) -> dict:
res = parse_resolution(get_element_text_and_html_by_tag('div', element)[1])
url = extract_attr... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n video_id = self._match_valid_url(url).group('id')\r\n page = self._download_webpage(url, video_id)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | resume_resp.headers = {"content-length": "12"}
resume_resp.status_code = 206
responses = [incomplete_resp, resume_resp]
_http_get_mock = MagicMock(side_effect=responses)
# Mock the session's adapters to have a cache controller
mock_adapter = MagicMock(spec=CacheControlAdapter)
mock_controller ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # Create a mock for the session adapters\r\n adapters_mock = MagicMock(return_value=mock_adapter)\r\n\r\n with (\r\n patch.object(Downloader, \"_http_get\", _http_get_mock),\r\n patch.object(session, \"get_adapter\", adapters_mock),\r\n ):\r\n```\r\n\r\nTh... | 1 |
python | assert thinking_part.signature is not None
return _ReasoningEncrypted(
type=data.type,
id=thinking_part.id,
format=data.format,
index=data.index,
data=thinking_part.signature,
)
else:
assert_never(data.type)
class _OpenRouterFunct... | Review this code and list any quality issues. | [
{
"issue": "Please subclass the type from OpenAI SDK and override only the field we need to (i.e. `function`)",
"severity": "minor",
"line": 26
}
] | 1 |
python | normalized_0 = F.softmax(out_last_tokens)
normalized_1 = F.softmax(out_shared_prefix_last_tokens)
torch.testing.assert_close(normalized_0, normalized_1, rtol=1e-3, atol=1e-4)
def test_config(self):
self.config_tester.run_common_tests()
def test_shift_right(self):
config... | Review this code and list any quality issues. | [
{
"issue": "since V1 doesn't exist in mt5, let's simply remove these tests. We can as well delete `# Copied from` or use `# Ignore Copy`",
"severity": "minor",
"line": 26
}
] | 1 |
python | round(0x40 * (self.height - y + text.x * sin + text.y * cos))]
)
bitmap = font._render_glyph(
text.index, get_hinting_flag(),
RenderMode.NORMAL if gc.get_antialiased() else RenderMode.MONO)
buffer = np.asarray(bitmap.buffer)
if not gc.get_a... | Review this code and list any quality issues. | [
{
"issue": "Might want to set minimum height/width as is done in the mathtex case.",
"severity": "minor",
"line": 26
}
] | 1 |
python | },
}, {
'info_dict': {
'id': 'BQ0dTpOhuHT',
'ext': 'mp4',
'title': 'Video 2',
'thumbnail': r're:^https?://.*\.jpg',
'view_count': int,
},
}, {
'info_dict': {
'id': 'BQ0dT7R... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'General metadata extraction failed',\r\n 'Main webpage is locked behind the login page',\r\n```",
"severity": "critical",
"line": 26
}
] | 1 |
python | `percentile_plus_one_indices` can exceed max index when `percentile_indices`
is already at max index.
Note that when `g` (Hyndman and Fan) / `fraction_above` is greater than 0,
`j+1` (Hyndman and Fan) / `percentile_plus_one_indices` is calculated but
never used, so it does not matter what this value is.... | Review this code and list any quality issues. | [
{
"issue": "We don't want to change this behavior as part of this PR, but it's very likely that many things are ill-defined in scikit-learn with all 0 weighted data.\r\n\r\n```suggestion\r\n# XXX: is this really what we want? Shouldn't we raise instead?\r\n# https://github.com/scikit-learn/scikit-learn/issues/3... | 1 |
python | start: datetime.datetime, offset_time: datetime.timedelta
) -> bool:
"""Have we reached the offset time specified in the event title."""
if offset_time == datetime.timedelta():
return False
return start + offset_time <= dt_util.now(start.tzinfo)
class CalendarEntityDescription(EntityDescription, f... | Review this code and list any quality issues. | [
{
"issue": "I have an outstanding comment about developer documentation https://developers.home-assistant.io/docs/core/entity/calendar/ -- please update those docs describing the responsibilities of someone implementing a calendar integration with respect to color, and attach to this PR. I think it should menti... | 1 |
python | self._attr_name = nasweb_thermostat.name
self._attr_target_temperature_step = 1.0
self._attr_min_temp = -50
self._attr_max_temp = 50
self._attr_has_entity_name = True
self._attr_should_poll = False
self._attr_unique_id = f"{DOMAIN}.{self._thermostat.webio_serial}.thermost... | Review this code and list any quality issues. | [
{
"issue": "This could be moved to a new class `NaswebEntity`, it's the same for all nasweb entities. OK to do that in a separate PR.",
"severity": "minor",
"line": 26
}
] | 1 |
python | from toolz import partition_all
def roll_dates_to_previous_session(sessions, *dates):
"""
Roll `dates` to the last session of `calendar`. Return input date if it
is a valid session.
Parameters
----------
sessions : pandas.tseries.index.DatetimeIndex
The list of valid session dates.
... | Review this code and list any quality issues. | [
{
"issue": "Is the extra whitespace here intentional?",
"severity": "minor",
"line": 20
}
] | 1 |
python | # # more consistent results setting it to right before the end
video_length = [str(float((qs.get('len') or ['1.5'])[0]) - 1)]
qs.update({
'ver': ['2'],
'cpn': [cpn],
'cmt': video_length,
'el': 'detailpage', # otherwise defaults to... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n headers=self._generate_webpage_headers())\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | return Bbox.null()
def intersects_path(self, other, filled=True):
"""
Return whether if this path intersects another given path.
If *filled* is True, then this also returns True if one path completely
encloses the other (i.e., the paths are treated as filled).
"""
r... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n Return a new path with each segment is divided into *steps* parts.\n```\nNote that \"segment\" is the term for one \"step\" (c.f. https://matplotlib.org/devdocs/api/path_api.html#matplotlib.path.Path.iter_segments)\n\nEdit: I've just read one maybe \"each LINETO step ...\"",
... | 1 |
python | detached,
worker_env=None,
):
"""Initialize the worker group by creating new workers from a resource pool.
Args:
resource_pool: Resource pool for worker allocation
ray_cls_with_init: Class with initialization arguments for workers
bin_pack: Whether to use... | Review this code and list any quality issues. | [] | 0 |
python | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | Review this code and list any quality issues. | [
{
"issue": "For the doc-strings of args, please follow the other code style, for example:\r\nhttps://github.com/Project-MONAI/MONAI/blob/dev/monai/data/dataset.py#L81\r\n\r\nThanks.",
"severity": "minor",
"line": 22
}
] | 1 |
python | if self.msgid_plural is None:
self.msgid_plural = msgid_plural
self.locations.add(Location(filename, lineno))
self.is_docstring |= is_docstring
def key_for(msgid, msgctxt=None):
if msgctxt is not None:
return (msgctxt, msgid)
return msgid
class TokenEater:
def __init_... | Review this code and list any quality issues. | [
{
"issue": "Will this be retained in the AST version or is it solely for `eater.messages`?",
"severity": "minor",
"line": 26
}
] | 1 |
python | data=None,
freq: Frequency | lib.NoDefault = lib.no_default,
tz=lib.no_default,
ambiguous: TimeAmbiguous = "raise",
dayfirst: bool = False,
yearfirst: bool = False,
dtype: Dtype | None = None,
copy: bool | None = None,
name: Hashable | None = None,
) -... | Review this code and list any quality issues. | [
{
"issue": "Can you create a `@classmethod` (place it in `indexes/base.py` near `_raise_scalar_data_error`), that encapsulates this logic and can be called here instead?",
"severity": "minor",
"line": 26
}
] | 1 |
python | "axes3d.mouserotationstyle": ["azel", "trackball", "sphere", "arcball"],
"axes3d.trackballsize": validate_float,
"axes3d.trackballborder": validate_float,
# scatter props
"scatter.marker": _validate_marker,
"scatter.edgecolors": validate_string,
"date.epoch": _validate_date,
"date.auto... | Review this code and list any quality issues. | [
{
"issue": "Move this down with framealpha.",
"severity": "major",
"line": 26
}
] | 1 |
python | except ValueError as e:
logger.error("Configuration loading failed: %s", e)
raise
except Exception as exc:
logger.error("An error occurred while loading the configuration: %s", exc)
raise
self.loop = loop
self.local_cpu_backend = local_cpu_backend... | Review this code and list any quality issues. | [
{
"issue": "The log has been printed in parent class `RemoteConnector`, is the `init_chunk_meta` method need to override here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | else:
start = current_time.replace(microsecond=0, second=0, minute=0)
if not end:
if minutely:
end = start.replace(microsecond=0, second=0) + timedelta(minutes=1)
else:
end = start.replace(microsecond=0, second=0, minute=0) + timedelta(hours=1)
start_timestamp... | Review this code and list any quality issues. | [
{
"issue": "A little more context would be appreciated, because you don't get line numbers or anything. If a log statement looks absurdly redundant, you're doing it right. Like `f'Caught known error due to existing partition: {e}'`",
"severity": "minor",
"line": 26
}
] | 1 |
python | from huggingface_hub import hf_hub_download
from oumi.utils.logging import logger
HUGGINGFACE_CACHE = ".cache/huggingface"
def get_local_filepath_for_gguf(
repo_id: str, filename: str, cache_dir=HUGGINGFACE_CACHE
) -> str:
"""Return a local path for the provided GGUF file, downloading it if necessary.
... | Review this code and list any quality issues. | [
{
"issue": "nit: I suggest to do this:\r\n\r\n```\r\ncache_dir = Path(cache_dir)\r\n\r\ngguf_local_file_path = (cache_dir / filename) # Already a Path!\r\n\r\n\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | 'description': strip_or_none(item_desc),
})
for resp in (initial_data.get('data') or {}).values():
name = resp.get('name')
if name == 'media-experience':
parse_media(try_get(resp, lambda x: x['data']['initialItem']['mediaItem'], dict))
... | Review this code and list any quality issues. | [
{
"issue": "I think you're getting a list when you expected a dict because the traversal is branching. If there might be multiple videos, let the calling code handle it, or make the traversal return the first dict found. \r\n```suggestion\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | bundle_generator = BundleGen(
algos=self.algos,
algo_path=self.work_dir,
templates_path_or_url=self.templates_path_or_url,
data_stats_filename=self.datastats_filename,
data_src_cfg_name=self.data_src_cfg_name,
)
if ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if self.train or (auto_train_choice and not self.cache[\"train\"]):\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | corx = np.delete(np.delete(corx, k, axis=1), k, axis=0)
px = np.delete(np.delete(px, k, axis=1), k, axis=0)
assert_allclose(corx, cory, atol=1e-14)
assert_allclose(px, py, atol=1e-14)
def test_nan_policy_bug_12411(self):
m = 5
n = 10
x = self.rng.standard_normal((m, ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n corr = np.array([[np.nan, np.nan, np.nan, np.nan],\r\n [np.nan, np.nan, np.nan, np.nan],\r\n [np.nan, np.nan, 1., -1.],\r\n [np.nan, np.nan, -1., 1.]])\r\n```",
"severity": "minor",
"line": 26
... | 1 |
python | communication_dtype: Optional[torch.dtype] = None,
overlap_communication: bool = False,
partition_grad: bool = False, # stage 2 flag
cpu_offload: bool = False, # cpu offload
dp_process_group: ProcessGroup = None, # the dp pg for comm
tp_process_group:... | Review this code and list any quality issues. | [
{
"issue": "If it's None, we should use global group to avoid errors.",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
profiler = AdvancedProfiler(dirpath=tmp_path, dump_stats=True)
action_name = f"before{char}after"
with profiler.profile(action_name):
pass
profiler.describe()
prof_files = [f for f in os.listdir(tmp_path) if f.endswith(".prof")]
assert len(prof_files) == 1
prof_name = prof_file... | Review this code and list any quality issues. | [] | 0 |
python | wallet.importpubkey(def_wallet.getaddressinfo(reused_imported_addr)["pubkey"])
imported_utxos = self.create_outpoints(def_wallet, outputs=[{reused_imported_addr: 2}])
def_wallet.lockunspent(False, imported_utxos)
# Send funds to the test wallet
reused_addr = wallet.getnewaddress()
... | Review this code and list any quality issues. | [
{
"issue": "nit: extra line here?\r\n```suggestion\r\n assert_equal(magic, BTREE_MAGIC)\r\n\r\n def test_blank(self):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | async with vehicle.wakelock:
times = 0
while vehicle.coordinator.data["state"] != TeslaFleetState.ONLINE:
try:
if times == 0:
cmd = await vehicle.api.wake_up()
else:
cmd = await vehicle.api.vehicle()
stat... | Review this code and list any quality issues. | [] | 0 |
python | 'info_dict': {
'id': '1942',
'ext': 'mp4',
'title': "Il draghetto Gris\u00f9 (4 episodi)",
'release_date': '20220129',
'thumbnail': 're:.+\\.png',
'description': 'md5:5328cbe080b93224712b6f17fcaf2c01',
'modified_date': "20200520",
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if ((isinstance(e.cause, HTTPError) and e.cause.code == 500)\r\n or isinstance(e.cause, JSONDecodeError)):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Inline
# Create an inline (horizontal) list of components.
# ---
from h2o_wave import main, app, Q, ui
@app('/demo')
async def serve(q: Q):
all_justify = ['start', 'end', 'center', 'between', 'around']
all_align = ['start', 'end', 'center']
justify_choices = [ui.choice(opt, opt) for opt in all_justify]... | Review this code and list any quality issues. | [
{
"issue": "Since `all_*` lists are hardcoded, you can be sure that `q.args` value, if specified, is within the list. You can further simplify:\r\n\r\n```suggestion\r\n justify_current = q.args.justify if q.args.justify else 'start'\r\n align_current = q.args.align if q.args.align else 'center'\r\n```",
... | 1 |
python | def _real_initialize(self):
homepage = self._download_webpage(
'https://murrtube.net', None, note='Getting session token')
data = self._hidden_inputs(homepage)
self._download_webpage(
'https://murrtube.net/accept_age_check', None, 'Set age cookie', data=urlencode_postdata... | Review this code and list any quality issues. | [
{
"issue": "use `get_element_by_class` (with `clean_html`) from utils instead IMO\r\n\r\n```suggestion\r\n 'uploader': clean_html(get_element_by_class('pl-1 is-size-6 has-text-lighter', video_page)),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
# index = len(items) // 2 when trying to find the median
# (value of index when items is sorted)
# invalid input
if index >= len(items) or index < 0:
return None
pivot = items[random.randint(0, len(items) - 1)]
count = 0
smaller, equal, larger = _partition(items, pivot)
c... | Review this code and list any quality issues. | [
{
"issue": "Since this is an application of the quick_select algorithm, can you move it to its own file?",
"severity": "minor",
"line": 26
}
] | 1 |
python | [
[ 38.2946, 51.6963 ],
[ 73.5318, 51.5014 ],
[ 56.0252, 71.7366 ],
[ 41.5493, 92.3655 ],
[ 70.7299, 92.2041 ]
]),
'ffhq': numpy.array(
[
[ 192.98138, 239.94708 ],
[ 318.90277, 240.1936 ],
[ 256.63416, 314.01935 ],
[ 201.26117, 371.41043 ],
[ 313.08905, 371.15118 ]
])
}
def warp_face(temp_fram... | Review this code and list any quality issues. | [
{
"issue": "There is no need to keep the old code, it's still in the git history - please remove this.",
"severity": "major",
"line": 26
}
] | 1 |
python | # Negative too-small index (< -len) -> null when null_on_oob=True
df = pl.DataFrame({"value": [1, 2]})
out = df.select(v=pl.col("value").get(-3, null_on_oob=True))
assert out["v"].to_list() == [None]
def test_get_null_index_does_not_raise() -> None:
# null index propagates to null, regardless of nul... | Review this code and list any quality issues. | [
{
"issue": "I feel these parametrized tests are enough. Why do we have both these parametrized tests and also specific tests above (like `test_get_int128_uint128_null_on_oob_false_raises`)?",
"severity": "minor",
"line": 26
}
] | 1 |
python | import base64
import hashlib
import json
import random
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
ExtractorError,
float_or_none,
orderedSet,
str_or_none,
try_get,
)
class GloboIE(InfoExtractor):
_VALID_URL = r'(?:globo:|https?://... | Review this code and list any quality issues. | [
{
"issue": "md5s that keep changing are useless to test for. `skip_download` the tests",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'only_matching': True,
}]
@staticmethod
def _extract_embed_url(webpage):
mobj = re.search(
r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?instagram\.com/p/[^/]+/embed.*?)\1',
webpage)
if mobj:
return mobj.group('url')
blockquote_el = ge... | Review this code and list any quality issues. | [
{
"issue": "Do we lose metadata with this? If so, explain that in the warning. If not, warning isn't needed",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
Try to reuse existing deadline UUIDs if the deadline definitions haven't changed.
Returns None if Deadline hashes are not all identical, indicating they need to be updated.
:param existing_deadline_uuids: List of UUID strings from existing serialized dag
:param new_deadline_data: L... | Review this code and list any quality issues. | [
{
"issue": "Is it possible to have multiple DeadlineAlertModels with the same property but different IDs?\n\nDeadlineAlertModel(id=1, reference=\"the same\"...)\nDeadlineAlertModel(id=2, reference=\"the same\"...)\n\nIf it's possible, it looks incorrect to use `__eq__` to me. Comparing those attributes directly... | 1 |
python | selection_mode : "single-row", "multi-row", "single-column", \
"multi-column", "single-cell", "multi-cell", or Iterable of these
The types of selections Streamlit should allow when selections are
enabled with ``on_select``. This can be one of the following:
- "multi-row"... | Review this code and list any quality issues. | [
{
"issue": "Corrected spacing in docstring: removed extra space before closing parenthesis.\n```suggestion\n ``\"NaN\"``, ``\"-\"``, or ``\"\"``). If this is ``None`` (default),\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | criterion = loss_fn
sharded_model, sharded_optimizer, criterion, _, _ = booster.boost(sharded_model, sharded_optimizer, criterion)
return org_model, org_optimizer, sharded_model, sharded_optimizer, criterion, booster
def run_forward_backward_with_hybrid_plugin(org_model: Module, sharded_model: Module, shard... | Review this code and list any quality issues. | [
{
"issue": "Can you modify date generation function instead of hardcode here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import (
int_or_none,
str_to_int,
try_get,
url_or_none,
unified_strdate,
parse_duration,
)
class TEDIE(InfoExtractor):
IE_NAME = 'ted'
_VALID_URL = r'''(?x)
(?P<proto>https?://)
(?P<type>www|embed(?:-ssl)?)(?P<urlmain>\.te... | Review this code and list any quality issues. | [
{
"issue": "Can you remove these comments?\r\nThey are completely unnecessary and annoying....idk how they were allowed to be merged last time",
"severity": "minor",
"line": 26
}
] | 1 |
python | # coding: utf-8
from .common import InfoExtractor
class VimmIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vimm\.tv/c/(?P<id>[0-9a-z-]+)'
_TESTS = [{
'url': 'https://www.vimm.tv/c/calimeatwagon',
'info_dict': {
'id': 'calimeatwagon',
'ext': 'mp4',
'tit... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n formats = self._extract_m3u8_formats(\r\n f'https://www.vimm.tv/hls/{channel_id}.m3u8', channel_id, 'mp4', m3u8_id='hls', live=True)\r\n self._sort_formats(formats)\r\n```",
"severity": "major",
"line": 20
}
] | 1 |
python | def __init__(self, ma): ...
def __iter__(self): ...
def __getitem__(self, indx): ...
def __setitem__(self, index, value): ...
def __next__(self): ...
class MaskedArray(ndarray[_ShapeT_co, _DTypeT_co]):
__array_priority__: Any
def __new__(cls, data=..., mask=..., dtype=..., copy=..., subok=..., ... | Review this code and list any quality issues. | [
{
"issue": "According to pyright:\r\n\r\n> Overload 6 for \"view\" overlaps overload 7 and returns an incompatible type\r\n\r\nSo we need to make `type[_ArrayT]` and `DTypeLike` disjoint. That's not all that difficult:\r\n\r\n```py\r\nDTypeLike: TypeAlias = _DTypeLike[Any] | _VoidDTypeLike | str | None\r\n```\r... | 1 |
python | self.translation_domain = "homeassistant"
self.translation_key = "oauth2_helper_refresh_failed"
self.translation_placeholders = {"domain": domain}
self.generate_message = True
class OAuth2RefreshTokenTransientError(OAuth2RefreshTokenError):
"""Recoverable error to indicate flow could not r... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n \"\"\"Initialize OAuth2RefreshTokenReauthError.\"\"\"\n```",
"severity": "critical",
"line": 26
}
] | 1 |
python | llm=llm,
tts=tts,
allow_interruptions=allow_interruptions,
)
self._include_time = include_time
self._current_dob: date | None = None
self._current_time: time | None = None
self._dob_update_speech_handle: SpeechHandle | None = None
async def on_enter(... | Review this code and list any quality issues. | [] | 0 |
python | # Handle different transformers versions for Vision2Seq models
import transformers
from packaging import version
if version.parse(transformers.__version__) >= version.parse("4.54.0"):
# transformers >= 4.54.0 uses AutoModelForImageText... | Review this code and list any quality issues. | [
{
"issue": "Infer from model structure doesn't sound like a reliable approach, and it can introduce security risks. Actually, there's already a specialized field for user to pass wether they want to trust remote code or not. https://github.com/verl-project/verl/blob/a8d5bf9d2164de9558447e014a8cbe380c72a44e/verl... | 1 |
python | class InventorySourceSchedulesList(SubListCreateAPIView):
name = _("Inventory Source Schedules")
model = models.Schedule
serializer_class = serializers.ScheduleSerializer
parent_model = models.InventorySource
relationship = 'schedules'
parent_key = 'unified_job_template'
class InventorySource... | Review this code and list any quality issues. | [
{
"issue": "This needs to be imported from `aws.main.utils.plugins` now:\r\n```suggestion\r\n if parent.source not in compute_cloud_inventory_sources():\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def cli_app(
self,
input: Optional[str] = None,
user: str = "User",
emoji: str = ":sunglasses:",
stream: bool = False,
markdown: bool = False,
exit_on: Optional[List[str]] = None,
**kwargs: Any,
) -> None:
"""Run an interactive command-line int... | Review this code and list any quality issues. | [] | 0 |
python | return extra_kwargs == set(), extra_kwargs
def run_cmd(cmd_list: list[str], **kwargs: Any) -> subprocess.CompletedProcess:
"""
Run a command by using ``subprocess.run`` with capture_output=True and stderr=subprocess.STDOUT
so that the raise exception will have that information. The argument `capture_outpu... | Review this code and list any quality issues. | [
{
"issue": "Was there a specific reason to use this pattern rather than `outputs = str(e.stdout)`? If stdout and stderr aren't going to contain much text this would be fine but if they are large blocks of output we might want to use `textwrap.indent` to format things a little.",
"severity": "minor",
"l... | 1 |
python | _high_priority_queue: SimpleQueue[TransactionQueueEntry]
peer_size_limit: int
log: logging.Logger
def __init__(self, peer_size_limit: int, log: logging.Logger) -> None:
self._list_cursor = 0
self._queue_length = asyncio.Semaphore(0) # default is 1
self._index_to_peer_map = []
... | Review this code and list any quality issues. | [
{
"issue": "we want to service high fee per cost first, right? If the priority queue sort low values first, I think it would be easier to just use cost per fee as the key. Either way, I think it warrants a comment. Intuitively, high priority comes first.",
"severity": "minor",
"line": 26
}
] | 1 |
python | if num > 0 and reason not in ["out_of_memory", "denied", "not_found"]:
raise AssertionError(f"GET {reason}: {num}")
def test_ext_handle_put_and_get_with_prefix(cache_mgr_fixture):
shape, spec, cache_mgr, param = cache_mgr_fixture
if (
spec.block_layout == KVCacheBlockLayout.LCND
and... | Review this code and list any quality issues. | [
{
"issue": "Will idx be greater than the number of blocks?",
"severity": "minor",
"line": 26
}
] | 1 |
python | from contextlib import ExitStack as DoesNotRaise
import numpy as np
import pytest
import supervision as sv
DETECTION_BOXES = np.array(
[
[35.0, 35.0, 65.0, 65.0],
[60.0, 60.0, 90.0, 90.0],
[85.0, 85.0, 115.0, 115.0],
[110.0, 110.0, 140.0, 140.0],
[135.0, 135.0, 165.0, 165.... | Review this code and list any quality issues. | [
{
"issue": "Consider using the `mock_detections` function here. You can find it in `test/test_utils.py`.",
"severity": "minor",
"line": 23
}
] | 1 |
python | Source:
https://github.com/scipy/scipy/blob/main/tools/lint_diff.py
Unlike pycodestyle, ruff by itself is not capable of limiting
its output to the given diff.
"""
print("Running Ruff Check...")
command = ["ruff", "check"]
if fix:
command.append("-... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if retcode:\r\n sys.exit(retcode)\r\n```\r\n\r\nIMO better to exit early.",
"severity": "minor",
"line": 26
}
] | 1 |
python | # retrieve the latest modified cache file
cache_files = list(cache_dir.glob("*.cache"))
if not cache_files:
logger.debug("no rule cache files found")
return False
latest_cache_file = max(cache_files, key=os.path.getmtime)
cache_timestamp = os.path.getmtime(latest_cache_file)
# thes... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n def ts_to_str(ts):\r\n return datetime.fromtimestamp(ts).strftime(\"%Y-%m-%d %H:%M:%S\")\r\n\r\n logger.warning(\r\n \"latest rule code file %s (%s) is newer than the latest rule cache file %s (%s)\",\r\n latest_rule_code_file,\r\n ... | 1 |
python | ):
from ray._private.worker import global_worker
with self._cache_lock:
assert isinstance(tensor_transport_meta, NixlTransportMetadata)
gpu_object_store = global_worker.gpu_object_manager.gpu_object_store
self._managed_meta_nixl.pop(obj_id, None)
tensors ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n def _record_and_get_meta_if_duplicate(\n```\nusually internal methods are prefixed with _ bc python doesn't have private",
"severity": "major",
"line": 26
}
] | 1 |
python | class GoToStageIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?gotostage\.com/channel/[a-z0-9]+/recording/(?P<id>[a-z0-9]+)/watch'
_TESTS = [{
'url': 'https://www.gotostage.com/channel/8901680603948959494/recording/60bb55548d434f21b9ce4f0e225c4895/watch',
'md5': 'ca72ce990cdcd7a2bd152f7217e... | Review this code and list any quality issues. | [
{
"issue": "I see you are using metadata[0] everywhere. So why not just do this instead:\r\n```suggestion\r\n metadata = self._download_json(\r\n 'https://api.gotostage.com/contents?ids=%s' % video_id,\r\n video_id,\r\n note='Downloading video metadata',\r\n er... | 1 |
python | colors["node0"] = "\033[0;34m" # BLUE
colors["node1"] = "\033[0;32m" # GREEN
colors["node2"] = "\033[0;31m" # RED
colors["node3"] = "\033[0;33m" # YELLOW
colors["reset"] = "\033[0m" # Reset font color
log_events = read_logs(testdir)
if args.html:
print_logs_html(lo... | Review this code and list any quality issues. | [
{
"issue": "nit: I don't like it either, but the [rules claim](https://peps.python.org/pep-0008/#inline-comments):\r\n> Inline comments should be separated by at least two spaces from the statement \r\n```suggestion\r\n chain = 'regtest' # fallback to regtest\r\n```",
"severity": "minor",
"l... | 1 |
python | import pypdfium2.raw as pdfium_c
# Magic bytes for image format detection: (magic_bytes, extension, mime_type)
IMAGE_FORMATS = [
(b"\xff\xd8\xff", "jpg", "image/jpeg"),
(b"\x89PNG\r\n\x1a\n", "png", "image/png"),
(b"\x00\x00\x00\x0c\x6a\x50\x20\x20\x0d\x0a\x87\x0a", ... | Review this code and list any quality issues. | [
{
"issue": "The seek(0) call on line 113 is unnecessary because getvalue() doesn't depend on the current position in the BytesIO stream. It always returns all bytes written to the buffer. This line can be removed.\n```suggestion\n\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | for member in zipf.infolist():
file_path = member.filename
if member.is_dir():
continue
if file_path is None:
continue
if os.path.basename(file_path).startswith((".", "__")):
# skipping hidden files
continue
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # Set block_size=0 to get faster streaming\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import int_or_none, mimetype2ext, parse_iso8601, traverse_obj, url_or_none
class BlueskyIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:bsky\.app|main\.bsky\.dev)/profile/(?P<handle>[^/]+)/post/(?P<id>[0-9a-zA-Z]+)'
_TESTS = [{
'url': 'https://bsk... | Review this code and list any quality issues. | [
{
"issue": "Imo. Let's also support `at://` urls\r\n```suggestion\r\n _VALID_URL = [\r\n r'https?://(?:www\\.)?(?:bsky\\.app|main\\.bsky\\.dev)/profile/(?P<handle>[^/]+)/post/(?P<id>\\w+)',\r\n r'at://(?P<handle>[^/]+)/app.bsky.feed.post/(?P<id>\\w+)',\r\n ]\r\n```",
"severity": "minor",... | 1 |
python | part_tensor = trim_audio(part_tensor.squeeze(), self.params['samplerate'], 0.001, trim_audio_buffer).unsqueeze(0)
self.audio_segments.append(part_tensor)
if not re.search(r'\w$', part, flags=re.UNICODE) and part[-1] != '—':
... | Review this code and list any quality issues. | [
{
"issue": "The text processing logic `re.sub(r'\\s+', ' ', default_sml_pattern.sub('', sentence)).strip()` is duplicated across all six TTS engine files (yourtts.py, xtts.py, vits.py, tacotron.py, fairseq.py, and bark.py). This duplication makes the code harder to maintain - if this logic needs to be updated o... | 1 |
python | Build wheel package:
$ NNI_RELEASE=2.0 python setup.py build_ts
$ NNI_RELEASE=2.0 python setup.py bdist_wheel -p manylinux1_x86_64
for jupyterlab 2.x package:
$ JUPYTER_LAB_VERSION=2.3.1 NNI_RELEASE=2.0 python setup.py build_ts
$ JUPYTER_LAB_VERSION=2.3.1 NNI_RELEASE=2.0 python setup.py bdist_wheel -p manylin... | Review this code and list any quality issues. | [
{
"issue": "Please add try-catch for this import. The script should not crash when building machine has not installed jupyter.\r\nAnd I personally suggest put this and `jupyter_lab_version = ...` into a function `get_jupyter_lab_version()`.",
"severity": "critical",
"line": 26
}
] | 1 |
python | # Bad case: it is not in the index
with self.assertRaises(KeyError):
print(sd.loc[1])
print(sd.loc["foo"])
# Test slicing
print(sd.loc[:"foo"])
print(sd.loc[:, "g":])
def test_sorting(self):
sd = idd.MultiData(np.arange(4).reshape(2, 2), index=["foo",... | Review this code and list any quality issues. | [] | 0 |
python | ValueError('Some value error cde'), # Same type and similar message to previous, considered the same.
ValueError(
'Another value error efg'
), # Same type, but too different message to previous, considered different.
]:
try:
raise error # Errors raised on same line... | Review this code and list any quality issues. | [] | 0 |
python | if isinstance(e.cause, HTTPError) and e.cause.status == 412:
raise ExtractorError(
'Request is blocked by server (412), please wait and try later.', expected=True)
raise
status_code = response['code']
if status_code == -401:
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # hidden-mode collection doesn't show its videos in uploads; extract as playlist instead\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | # This maintains the constraint across all iterations while letting model
# decide freely whether to call a tool or respond
allowed_tool_names = {
tool["function"]["name"]
for tool in processed_tool_choice.allowed_tools.tools
if... | Review this code and list any quality issues. | [
{
"issue": "nit: should we validate max_output_tokens value against a different lower bound before reaching here? A good place could be in openai_responses.py (e.g: https://github.com/llamastack/llama-stack/blob/main/src/llama_stack/providers/inline/agents/meta_reference/responses/openai_responses.py#L383)\r\n\... | 1 |
python | import asyncio
from cognee.context_global_variables import (
graph_db_config as context_graph_db_config,
vector_db_config as context_vector_db_config,
)
from cognee.infrastructure.databases.relational import (
create_db_and_tables as create_relational_db_and_tables,
)
from cognee.infrastructure.databases.v... | Review this code and list any quality issues. | [] | 0 |
python | def _on_track_unavailable(
self, publication: rtc.RemoteTrackPublication, participant: rtc.RemoteParticipant
) -> None:
if (
not self._publication
or self._publication.sid != publication.sid
or participant.identity != self._participant_identity
):
... | Review this code and list any quality issues. | [
{
"issue": "Do you think the livekit-rtc `package` should be responsible for directly updating the credentials?",
"severity": "critical",
"line": 26
}
] | 1 |
python | Args:
data: the value to be saved by provided save method.
Raises:
DatasetError: when underlying save method raises error.
FileNotFoundError: when save method got file instead of dir, on Windows.
NotADirectoryError: when save method got file instead of dir, on Un... | Review this code and list any quality issues. | [
{
"issue": "They key is already a string, right?",
"severity": "minor",
"line": 26
}
] | 1 |
python | if include_base64_content and self.content:
result["content"] = self.to_base64()
return {k: v for k, v in result.items() if v is not None}
class Video(BaseModel):
"""Unified Video class for all use cases (input, output, artifacts)"""
# Core content fields (exactly one required)
url: ... | Review this code and list any quality issues. | [] | 0 |
python | gpu_object_store = global_worker.gpu_object_manager.gpu_object_store
duplicate_obj_id = gpu_object_store.get_duplicate_objects(
src_obj_id, src_gpu_object
)
if duplicate_obj_id is not None:
meta = self._get_meta(duplicate_obj_id)
if meta is None:
... | Review this code and list any quality issues. | [
{
"issue": "Can you add a comment explaining the args to this function?",
"severity": "minor",
"line": 26
}
] | 1 |
python | import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.select import (
ATTR_OPTION,
DOMAIN as SELECT_DOMAIN,
SERVICE_SELECT_OPTION,
)
from homeassistant.const import ATTR_ENTITY_ID, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import d... | Review this code and list any quality issues. | [
{
"issue": "Typo in docstring: \"binary select platform\" should be \"select platform\" (the select platform is not a binary sensor platform).\n```suggestion\n \"\"\"Set up IntelliClima integration with only the select platform.\"\"\"\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def get_placeholder_mask(
self,
input_ids: torch.LongTensor,
image_ids: torch.LongTensor,
):
"""
Replace image placeholder tokens in input_ids with actual image token ids from VQVAE.
Args:
input_ids (`torch.LongTensor` of shape `(batch_size, seq_len)`):
... | Review this code and list any quality issues. | [
{
"issue": "This one doesn't actually avoid a sync, since it has to be implicitly converted to a Python bool for the `if` statement! It's fine to leave it, though.",
"severity": "minor",
"line": 26
}
] | 1 |
python | lyric = traverse_obj(info_lyric, ('data', 'file'))
subtitles = {
'origin': [{
'url': lyric,
}],
} if lyric else None
album = item.get('album') or {}
return {
'id': item_id,
'title': title,
'formats': formats,
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n self._request_webpage(HEADRequest(self._DOMAIN), None, note='Updating cookies')\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | ....................
|------------------------------------------------------------|
^^ ^
AB C
|------------------------------------------------------------|
^^^^^^^^... | Review this code and list any quality issues. | [] | 0 |
python | properties[cls._OPTIONAL_WRITE_FUNCTION_ARGS_GENERIC_PROPERTY] = write_fct_args
return cls.__configure(id, DataNodeConfig._STORAGE_TYPE_VALUE_GENERIC, scope, validity_period, **properties)
@classmethod
def _configure_in_memory(
cls,
id: str,
default_data: Optional[Any] = None,
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n relevant tasks will run even if they are skippable (see the\r\n [Task configs page](../../userman/scenario_features/task-orchestration/scenario-config.md#from-task-configurations)\r\n for more details).\r\n```",
"severity": "minor",
... | 1 |
python | proof_xs,
),
)
)
return responses
except Exception as e:
self.harvester.log.error(f"Unknown error: {e}")
return []
async def lookup_challenge(
... | Review this code and list any quality issues. | [
{
"issue": "im not sure that we would want the filtering done in the prover and not in chia-blockchain for maintainability, unless we expect to wrap the v2prover like we did with v1 then we can filter in the wrapper\r\n\r\nalso this is not relevant to v1 plots right ? so im leaning into doing the filtering here... | 1 |
python | # custom path
# saves a file like: my/path/epoch=0.ckpt
>>> checkpoint_callback = ModelCheckpoint(dirpath='my/path/')
By default, dirpath is ``None`` and will be set at runtime to the location
specified by :class:`~pytorch_lightning.trainer.trainer.Trainer`'s
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n Example:\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.