language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | # Send to legacy address type so that we will have an ecdsa signature with a measurable effect on the feerate
default_wallet.sendtoaddress(wallet.getnewaddress(address_type="legacy"), 10)
self.generate(self.nodes[0], 1)
assert_equal(wallet.listunspent(), watchonly.listunspent())
ret_ad... | Review this code and list any quality issues. | [
{
"issue": "In f66d5bc0990cc4f82c40aea3e13232fb6b883d31 \"wallet: introduce \"tx amount exceeds balance when fees are included\" error\"\n\nProviding the default for `next()` shouldn't be necessary.\n\nThis could probably be replaced by using `utxo = wallet.listunspent()[0]` instead of looking for the 0.15's in... | 1 |
python | assert_equal(total_txs, len(self.nodes[0].listtransactions("*", 99999)))
# Test getaddressinfo on external address. Note that these addresses are taken from disablewallet.py
assert_raises_rpc_error(-5, "Invalid or unsupported Base58-encoded address.", self.nodes[0].getaddressinfo, "3J98t1WpEZ73CNmQviec... | Review this code and list any quality issues. | [
{
"issue": "https://github.com/bitcoin/bitcoin/actions/runs/19238750700/job/54998849583?pr=33842#step:12:208:\n\n```\n File \"D:\\a\\bitcoin\\bitcoin/test/functional/wallet_basic.py\", line 550, in run_test\n\n assert vout[\"ischange\"]\n\n ~~~~^^^^^^^^^^^^\n\nKeyError: 'ischange'",
"severity"... | 1 |
python | **traverse_obj(data, ('activeEpisodeData', {
'url': ('audio', {urljoin(self._API_BASE_URL)}),
'id': ('id', {str}),
'title': ('title', {str}),
'description': ('description', {clean_html}),
'duration': ('duration', {int_or_none}),
... | Review this code and list any quality issues. | [
{
"issue": "We probably want to also include URLs with query args or anchors, right?\r\n```suggestion\r\n _VALID_URL = r'https?://(?P<id>[\\w-]+)\\.mave\\.digital/?(?:$|[?#])'\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | if input_tensors[0].shape[chunk_dim] % chunk_size != 0:
raise ValueError(
f"The dimension to be chunked {input_tensors[0].shape[chunk_dim]} has to be a multiple of the chunk "
f"size {chunk_size}"
)
num_chunks = input_tensors[0].shape[chunk_dim] // chunk_... | Review this code and list any quality issues. | [
{
"issue": "Should have been clearer - this one should probably stay too, for the same remote model reasons!",
"severity": "minor",
"line": 26
}
] | 1 |
python | from langchain.schema import Document
import pytest
from mindsdb.integrations.utilities.rag.rerankers.reranker_compressor import LLMReranker, RerankerConfig
@pytest.mark.asyncio
async def test_openai_reranker():
openai_reranker = LLMReranker()
openai_reranker.model_post_init(None)
results = await openai_... | Review this code and list any quality issues. | [] | 0 |
python | [['E', 'GHIJ', 'HIJKLMNOP', 'DEFGHIJ'],
['CDE', 'ABCDEFGHIJKLMNOPQ', 'DEFGHIJKLMNOPQRS', 'ABCDEFGHIJK'],
['DEFGHIJKLMNOPQR', 'DEFGHI', 'DEFGHIJ', 'FGHIJK'],
['EFGHIJKLM', 'EFGHIJKLMNOPQRS', 'ABCDEFGHI', 'DEFGHIJ']],
dtype=object,
)
la = LabelArray(data,... | Review this code and list any quality issues. | [
{
"issue": "Why are we using fail fast on all of these? are the tests that slow?\r\n\r\nAlso, why is it `__` instead of just `_`?",
"severity": "critical",
"line": 26
}
] | 1 |
python | messages=[
Message(
content="Hello world!",
role=Role.USER,
),
Message(
content="Hello again!",
role=Role.USER,
),
],
metadata={"foo": "bar"},
... | Review this code and list any quality issues. | [] | 0 |
python | return parser_class.instance()
def add_config_path(path):
"""Select config parser by file extension and add path into parser.
"""
if not os.path.isfile(path):
warnings.warn("Config file does not exist: {path}".format(path=path))
return False
# select parser by file extension
_base... | Review this code and list any quality issues. | [
{
"issue": "This `if not parser_class.enabled` is checked at least twice here. Can that be extracted into a method or something for DRY programming purposes?",
"severity": "major",
"line": 26
}
] | 1 |
python | install_dir = meson._get_site_packages(build_dir)
os.environ['PYTHONPATH'] = install_dir
if xp_markers:
os.environ['SCIPY_ARRAY_API'] = '1'
cmd = [sys.executable, os.path.join('tools', 'check_xp_untested.py')]
util.run(cmd)
if installed_files:
cmd = [sys.executable, os.path... | Review this code and list any quality issues. | [
{
"issue": "why `abspath` in one but not the other?",
"severity": "minor",
"line": 26
}
] | 1 |
python | _VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos/(?:detail/)?(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://www.agalega.gal/videos/288664-lr-ninguencheconta',
'md5': '04533a66c5f863d08dd9724b11d1c223',
'info_dict': {
'id': '288664',
'title': 'Roberto e Ángel Martín ... | Review this code and list any quality issues. | [
{
"issue": "The playlist_id comment was intended for the playlist extractor",
"severity": "major",
"line": 26
}
] | 1 |
python | ("2.1.0", "airflow celery worker"),
],
)
def test_default_command_and_args_airflow_version(self, airflow_version, expected_arg):
docs = render_chart(
values={
"airflowVersion": airflow_version,
},
show_only=["templates/workers/worker-deployment... | Review this code and list any quality issues. | [
{
"issue": "Personally, I would split tests to test particular arguments and this one left only for testing `enabled` flag",
"severity": "minor",
"line": 26
}
] | 1 |
python | unsupported_model_settings = OpenAIModelProfile.from_profile(self.profile).openai_unsupported_model_settings
for setting in unsupported_model_settings:
model_settings.pop(setting, None)
try:
extra_headers = model_settings.get('extra_headers', {})
extra_headers.setdef... | Review this code and list any quality issues. | [
{
"issue": "If a `openai_previous_response_id` was explicitly set, I think we should not do the stuff we do above, and assume the user only passed in the messages in message history that they actually meant to send",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'age_limit': 18
}
}]
def _gen_info_url(self, ext_domain, extr_id, lifetime=86400):
""" This function is a reverse engineering from the website javascript """
result = '/'.join(str(int_or_none(extr_id) // i * i) for i in (1_000_000, 1_000, 1))
return f'https://{ext_domain}/api/js... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n webpage, 'embed info', group=('ext_domain', 'extr_id'))\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | if member == 'pow':
assertion(len(argvals) == 2, 'takes two arguments')
return argvals[0] ** argvals[1]
raise self.Exception(f'Unsupported Math method {member}', expr)
if member == 'split':
assertion(argvals, 'takes... | Review this code and list any quality issues. | [
{
"issue": "Perhaps this?\n```suggestion\n return obj[slice(*argvals, None)]\n```\nIf not, then we should at least `obj[:]` in the first one. `.slice()` is a shallow copy.",
"severity": "minor",
"line": 26
}
] | 1 |
python | tx.nLockTime = node.getblockcount() + 1
self.check_mempool_result(
result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'non-final'}],
rawtxs=[tx.serialize().hex()],
)
self.log.info('A transaction that is locked by BIP68 sequence logic')
tx =... | Review this code and list any quality issues. | [
{
"issue": "nit\r\n```suggestion\r\n data_len = int(MAX_STANDARD_TX_WEIGHT / WITNESS_SCALE_FACTOR) - tx.get_vsize() - 5 - 4 # -5 for PUSHDATA4 and -4 for script size\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | response = self._download_json(
f'https://chaturbate.{tld}/get_edge_hls_url_ajax/', video_id,
data=urlencode_postdata({'room_slug': video_id}),
headers={
**self.geo_verification_headers(),
'X-Requested-With': 'XMLHttpRequest',
'Accept':... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'is_live': True,\r\n 'age_limit': 18,\r\n 'formats': self._extract_m3u8_formats(m3u8_url, video_id, ext='mp4', live=True),\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | from typing import List, Literal, Optional
from agno.knowledge.chunking.strategy import ChunkingStrategy
from agno.knowledge.document.base import Document
from agno.knowledge.embedder.base import Embedder
from agno.utils.log import log_info
def _get_chonkie_embedder_wrapper(embedder: Embedder):
"""Create a wrapp... | Review this code and list any quality issues. | [
{
"issue": "Saw in the chonkie source code that they use `np.float32`. We should do the same",
"severity": "minor",
"line": 23
}
] | 1 |
python | `ContinuousDistribution`; e.g., `scipy.stats.Normal`.
.. note::
`make_distribution` does not work perfectly with all instances of
`rv_continuous`. Known failures include `levy_stable` and `vonmises`,
and some methods of some distributions will not support array shape
parameters.
... | Review this code and list any quality issues. | [
{
"issue": "Right now, this looks redundant. If you intended it to be, maybe mention \"see below\".\r\n```suggestion\r\n separate parametrization of the distribution. If multiple parameterizations\r\n are specified, ``dist``'s class must also define a method\r\n ``_process_parame... | 1 |
python | def __pow__(self: _MaskedArray[object_], other: Any, /) -> Any: ...
@overload
def __pow__(self: _MaskedArray[Any], other: _ArrayLikeObject_co, /) -> Any: ...
# Keep in sync with `ndarray.__rpow__` (minus the `mod` parameter)
@overload
def __rpow__(self: _MaskedArray[_NumberT], other: int | np.bool,... | Review this code and list any quality issues. | [] | 0 |
python | Args:
message: A message object
"""
_rich_traceback_guard = True
if message.no_dispatch:
return
try:
message_hook = message_hook_context_var.get()
except LookupError:
pass
else:
message_hook(message)
wi... | Review this code and list any quality issues. | [
{
"issue": "I don't think we need the \">>>\", that was just to indicate a message being sent.",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'uploader_id': '3506358525001',
'title': 'Roblox | WimbleWorld ',
'duration': 101440.0,
'tags': ['features', 'kids'],
'timestamp': 1656500867,
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
account = '3506358525001'
... | Review this code and list any quality issues. | [
{
"issue": "`language` is a format field, so we can leave it out\r\n```suggestion\r\n **traverse_obj(metadata, {\r\n 'title': 'title',\r\n 'description': 'description',\r\n 'duration': ('metadata', 'duration', {parse_duration}),\r\n }),\r\n```",... | 1 |
python | assert_type(np.linalg.matrix_rank(AR_i8), Any)
assert_type(np.linalg.matrix_rank(AR_f8), Any)
assert_type(np.linalg.matrix_rank(AR_c16), Any)
assert_type(np.linalg.matrix_rank(SC_f8), Literal[0, 1])
assert_type(np.linalg.matrix_rank(AR_f8_1d), Literal[0, 1])
assert_type(np.linalg.matrix_rank(float_list_1d), Literal[0, ... | Review this code and list any quality issues. | [] | 0 |
python | def run(self, inputs: Any, **kwargs: Any) -> tuple[Any, ...]: # noqa: ARG002
"""Abstract function."""
return (None,)
class Backend:
"""Backend is the entity that will take an ONNX model with inputs,
perform a computation, and then return the output.
For one-off execution, users can use r... | Review this code and list any quality issues. | [
{
"issue": "I don't see the benefit in doing that. We lose some information. device is not used but I tihnk it is easier to keep it if anybody wants to use this piece of code and create his own backend.",
"severity": "minor",
"line": 26
}
] | 1 |
python | "WORLD_SIZE": str(world_size),
"MASTER_ADDR": master_addr,
"MASTER_PORT": master_port,
"TORCHELASTIC_USE_AGENT_STORE": "False",
}
remote_config = {
"scheduling_strategy": PlacementGroupSchedulingStrategy(
placement_group=placement_group,
placement_group_b... | Review this code and list any quality issues. | [
{
"issue": "would you mind commenting this function is code?",
"severity": "minor",
"line": 26
}
] | 1 |
python | test_coin_records[coin.name()] = CoinRecord(coin, uint32(20), uint32(0), False, uint64(2000))
async def get_coin_records(coin_ids: Collection[bytes32]) -> list[CoinRecord]:
ret: list[CoinRecord] = []
for name in coin_ids:
r = test_coin_records.get(name)
if r is not None:
... | Review this code and list any quality issues. | [
{
"issue": "This is unrelated to the patch (addressed in the addendum), it's a result of altering `add_spendbundle`'s failure path.",
"severity": "critical",
"line": 26
}
] | 1 |
python | if not dash_path:
self.report_warning(f'Unknown format id: {bid}. It is currently not being extracted')
continue
format_data = traverse_obj(self._download_json(
urljoin('https://cache-video.iq.com', dash_path), video_id,
note=f'Downloading form... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n self.report_warning('This preview video is limited%s' % format_field(preview_time, template='to %s seconds')\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | if not chunk.metadata:
chunk.metadata = {}
logger.warning("Chunk metadata was empty, creating new metadata dictionary")
metadata = chunk.metadata
doc_id = str(metadata.get(self.doc_id_key, ''))
logger.debug(f"Processing chunk with metadata: {metadata},... | Review this code and list any quality issues. | [
{
"issue": "suggestion: simpler is `if row.get('chunk_id') is not None:`",
"severity": "minor",
"line": 26
}
] | 1 |
python | class_token_logprob = None
for token_logprob in token_logprobs:
if token_logprob.token in ["1", "2", "3", "4"]:
class_token_logprob = token_logprob
break
# If we couldn't find a class token, fall back to the last non-empty token
if class_token_logprob... | Review this code and list any quality issues. | [
{
"issue": "[nitpick] The comment should also include logging the selected class token for debugging purposes, as mentioned in the PR description that a new log 'Reranker selected_class_token' was added but is not visible in the code changes.",
"severity": "critical",
"line": 26
}
] | 1 |
python | local_cpu_backend.memory_allocator.close()
def test_get_blocking_key_not_exists(self, local_cpu_backend):
"""Test get_blocking() when key doesn't exist."""
key = create_test_key("nonexistent")
result = local_cpu_backend.get_blocking(key)
assert result is None
local_cpu_bac... | Review this code and list any quality issues. | [] | 0 |
python | support_etc = _combine_docs(CustomDistribution, include_examples=False).lstrip()
docs = [
f"This class represents `scipy.stats.{dist.name}` as a subclass of "
"`ContinuousDistribution`.",
f"The `repr`/`str` of class instances is `{repr_str}`.",
f"The PDF of the distribution is define... | Review this code and list any quality issues. | [
{
"issue": "This highlights that the public interface for `parameters` and `support` combine the ideas of a domain and a parameter. I definitely think that's good for the public interface for the sake of simplicity. Do we agree that it's still good to make the distinction privately? If you think it's fine to le... | 1 |
python | formats.append({
'format_id': f'{quality}-audioonly',
'url': quality_meta['hlsaddr_audioonly'][0],
'ext': 'm4a',
'vcodec': 'none',
'quality': quality_priority,
})
def _real_extract(self, url):
video_id = self._match... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n streams = [\r\n ('high', 'Z'),\r\n ('low', 'ForceLow'),\r\n ]\r\n formats = []\r\n for (desc, code) in streams:\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | '''Returns the videos of the playlist'''
webpage = self._download_webpage(url, name, 'Downloading playlist webpage')
json = self._extract_info(webpage, 'json')
playlist = try_get(json, lambda x: x['props']['pageProps']['playlist'], dict)
playlist_id = playlist.get('id')
playlist... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n playlist_entries = [self._parse_playlist(s) for s in seasonlist if s.get('seasonNumber') == season]\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
class BTVPlusIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?btvplus\.bg/produkt/predavaniya/(?P<id>\d+)/.*'
_TESTS = [{
'url': 'https://btvplus.bg/produkt/predavaniya/60119/sezon-1/ostrovat-na-100-te-grivni-sezon-1-epizod-11-02-10-2024',
'info_dict': {
... | Review this code and list any quality issues. | [
{
"issue": "Don't need the trailing part of the regex and might as well match the other sections\r\n```suggestion\r\n _VALID_URL = r'https?://(?:www\\.)?btvplus\\.bg/produkt/(?:predavaniya|seriali|novini)/(?P<id>\\d+)'\r\n```",
"severity": "minor",
"line": 5
}
] | 1 |
python | assert self._api.websocket
await self._async_cancel_websocket_loop()
self._websocket_reconnect_task = self._hass.async_create_task(
self._async_start_websocket_loop()
)
self.entry.async_on_unload(
self._api.add_refresh_token_callback(async_handle_... | Review this code and list any quality issues. | [
{
"issue": "`return_exceptions` is `False` by default.",
"severity": "minor",
"line": 26
}
] | 1 |
python | return np.arccos(np.dot(v1 / np.linalg.norm(v1), v2 / np.linalg.norm(v2)))
def angle_of_vector(vector: Sequence[float]) -> float:
"""Returns polar coordinate theta when vector is project on xy plane.
Parameters
----------
vector : Sequence[float]
The vector to find the angle for.
Returns... | Review this code and list any quality issues. | [
{
"issue": "Is this really a sequence of floats? Shouldn't it be a np.ndarray?",
"severity": "minor",
"line": 26
}
] | 1 |
python | def comma_api_source(sr: SegmentRange, mode: ReadMode) -> list[LogPath]:
route = Route(sr.route_name)
rlog_paths = [route.log_paths()[seg] for seg in sr.seg_idxs]
qlog_paths = [route.qlog_paths()[seg] for seg in sr.seg_idxs]
# comma api will have already checked if the file exists
def valid_file(fn):
re... | Review this code and list any quality issues. | [] | 0 |
python | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import strip_or_none
class On24IE(InfoExtractor):
IE_NAME = 'on24'
IE_DESC = 'ON24'
_VALID_URL = r'''(?x)
(?:
... | Review this code and list any quality issues. | [
{
"issue": "add all the keys you are returning\r\n\r\nif this doesn't have them then add another test which has those",
"severity": "minor",
"line": 26
}
] | 1 |
python | raise ValueError(
f"{cls.__qualname__} can only have one CredentialsMetaInput field"
)
elif (
len(credentials_fields) == 1
and credentials_fields[0] != CREDENTIALS_FIELD_NAME
):
raise ValueError(
f"CredentialsMetaInput field... | Review this code and list any quality issues. | [] | 0 |
python | 'ext': 'mp4',
'upload_date': '20231009',
'title': 'מבצע חרבות ברזל',
'timestamp': 1696851301,
},
}]
_WEBPAGE_TESTS = [{
'url': 'https://www.maariv.co.il/news/law/Article-1044008',
'info_dict': {
'id': '3611585',
'duration': 75,
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if hls_url := traverse_obj(data, ('video', 'url', {url_or_none})):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | @pytest.fixture(autouse=True)
def auth_client():
"""Mock a pycync.Auth client."""
with patch(
"homeassistant.components.cync.config_flow.Auth", autospec=True
) as sc_class_mock:
client_mock = sc_class_mock.return_value
client_mock.user = MOCKED_USER
client_mock.username = MOC... | Review this code and list any quality issues. | [
{
"issue": "So this whole fixture is returning the lights right? Shouldn't we patch it at the mock (so the light that the CyncHome returns) instead of patching the method?",
"severity": "minor",
"line": 26
}
] | 1 |
python | registry=metrics_registry,
namespace='jina',
labelnames=('runtime_name',),
).labels(runtime_name)
self._successful_requests_metrics = Gauge(
'number_of_successful_requests',
'Number of successful requests',
registry... | Review this code and list any quality issues. | [
{
"issue": "Can we rename e to `excpetion` or something a bit more verbose ? I find it hard to read the code otherwise",
"severity": "minor",
"line": 26
}
] | 1 |
python | help='The name of the project and the directory that will be created to contain it. '
'If none is given, you will be prompted.'
),
] = None,
template: Annotated[
Union[str | None],
typer.Option(help='The template to be used to create the project. If none is given, you will be... | Review this code and list any quality issues. | [] | 0 |
python | from .common import InfoExtractor
from ..utils import (
traverse_obj,
unified_timestamp,
int_or_none,
)
from collections import OrderedDict
class MicrosoftEmbedIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?microsoft\.com/en-us/videoplayer/embed/(?P<id>[a-z0-9A-Z]+)'
_TESTS = [{
'ur... | Review this code and list any quality issues. | [
{
"issue": "Fill this out fully till the download test passes",
"severity": "minor",
"line": 19
}
] | 1 |
python | _TESTS = []
def _real_extract(self, url):
domain, video_id = self._match_valid_url(url).groups()
return self._extract_aetn_info(domain, 'id', video_id, url)
class BiographyIE(AENetworksBaseIE):
_VALID_URL = r'https?://(?:www\.)?biography\.com/video/(?P<id>[^/?#&]+)'
_TESTS = [{
'u... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'skip': '404 Not Found',\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | Returns
-------
codes : ndarray
An integer NumPy array that's an indexer into the original
ArrowArray.
uniques : ArrowArray
An ArrowArray containing the unique values of `self`.
.. note::
uniques will *not* contain an entry for the... | Review this code and list any quality issues. | [
{
"issue": "A reminder to update all examples changed here to use `ArrowExtentionArray`",
"severity": "minor",
"line": 26
}
] | 1 |
python | def __init__(self, mobject: Mobject, scale_factor: float, **kwargs) -> None:
super().__init__(mobject.scale, scale_factor, **kwargs)
class ShrinkToCenter(ScaleInPlace):
def __init__(self, mobject: Mobject, **kwargs) -> None:
super().__init__(mobject, 0, **kwargs)
class Restore(ApplyMethod):
... | Review this code and list any quality issues. | [
{
"issue": "I feel like this may be better suited as a parameter.",
"severity": "minor",
"line": 26
}
] | 1 |
python | prerun_receivers = signals.task_prerun.receivers
postrun_receivers = signals.task_postrun.receivers
success_receivers = signals.task_success.receivers
from celery import canvas
signature = canvas.maybe_signature # maybe_ does not clone if already
def on_error(request, exc, state=FAILURE, call_err... | Review this code and list any quality issues. | [
{
"issue": "I believe that `I.state` is a string, but that can always be tightened up in the future.\r\n\r\n```suggestion\r\n call_errbacks: bool = True) -> Tuple[Info, Any, str, Any]:\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from ._auth import (
TEST_BOT_CREDENTIALS,
TEST_BOT_CREDENTIALS_INPUT,
DiscordBotCredentialsField,
DiscordBotCredentialsInput,
)
# Keep backward compatibility alias
DiscordCredentials = DiscordBotCredentialsInput
DiscordCredentialsField = DiscordBotCredentialsField
TEST_CREDENTIALS = TEST_BOT_CREDENTIA... | Review this code and list any quality issues. | [
{
"issue": "we can't use \"ThreadArchiveDuration\".ONE_HOUR.value or something on this? :D",
"severity": "minor",
"line": 26
}
] | 1 |
python | def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
if re.search(r'alert\(["\']This video has been deleted', webpage):
raise ExtractorError(
'Video %s has been deleted' % video_id, expected=True)
vide... | Review this code and list any quality issues. | [
{
"issue": "single-quote URL, and you could simplify it like this:\r\n```suggestion\r\n data = self._download_json(\r\n 'https://api.m.afreecatv.com/station/video/a/view',\r\n video_id, headers={'Referer': url}, data=urlencode_postdata({\r\n 'nTitleNo'... | 1 |
python | freq = self.market_opens.index.freq
day = TEST_CALENDAR_START + freq
minute = self.market_opens[day]
data = DataFrame(
data={
'open': [15.0],
'high': [17.0],
'low': [11.0],
'close': [15.0],
'volume': [10... | Review this code and list any quality issues. | [] | 0 |
python | 'params': {'skip_download': 'm3u8'},
}]
def _real_initialize(self):
if not self._get_cookies(self._BASE_URL).get('sails.sid'):
self.raise_login_required()
class FloatplaneChannelBaseIE(InfoExtractor):
"""Subclasses must set _ENTRY_IE_TYPE, _BASE_URL and _PAGE_SIZE"""
def _fetch_p... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n self._RESULT_IE, id=post['id'], title=post.get('title'),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | video_id, fatal=False,
query={
'platform_uid': self._PLATFORM_UID,
'platform_token': self._PLATFORM_TOKEN,
}, headers={
'x-tver-platform-type': 'web'
})
additional_content_info = traverse_obj(
additional_info, ('res... | Review this code and list any quality issues. | [
{
"issue": "use join_nonempty. This will crash if any of these is `None`",
"severity": "critical",
"line": 26
}
] | 1 |
python | config_url = url + '&form=json'
config_url = config_url.replace('swf/', 'config/')
config_url = config_url.replace('onsite/', 'onsite/config/')
config = self._download_json(config_url, video_id, 'Downloading config')
if 'releaseUrl' in config:
release_url ... | Review this code and list any quality issues. | [
{
"issue": "Before this patch, ThePlatform extraction for CBC videos yielded only the direct http format, which is why the additional m3u8 formats check is needed.\r\n\r\nThere are other sites where the m3u8 formats are already extracted initially, and we would be duplicating the formats by extracting them agai... | 1 |
python | if version_check and version_check(sys.version_info):
pytest.skip(f'Python {sys.version} version does not have the required validation for this test.')
with handler() as rh:
with pytest.raises(RequestError, match=match) as exc_info:
validate_and_send(rh, req)
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n (lambda: urllib3.exceptions.HTTPError(), TransportError),\r\n (lambda: requests.exceptions.RequestException(), RequestError),\r\n # Needs a response object\r\n # (lambda: requests.exceptions.TooManyRedirects(), HTTPError),\r\n # ruff: enable[PLW01... | 1 |
python | self._context: dict[str, Any] = {}
self.env: Environment = SandboxedEnvironment(undefined=DebugUndefined)
self.set_context(**kwargs)
# custom filters
self.env.filters["where_in"] = WhereInMacro(database.get_dialect())
self.env.filters["to_datetime"] = to_datetime
def set_co... | Review this code and list any quality issues. | [
{
"issue": "Let's move this to the top of the file, per convention.",
"severity": "major",
"line": 26
}
] | 1 |
python | label_map = {
'unlisted': 'unlisted',
'private': 'private',
'members only': 'members_only',
'live': 'is_live',
'premium': 'premium'
}
badge_types = set()
for badge in traverse_obj(renderer, ('badges', ..., 'metadataBadgeRenderer'), def... | Review this code and list any quality issues. | [
{
"issue": "not really a fan of this but idk if there's a better way",
"severity": "minor",
"line": 26
}
] | 1 |
python | from model_training.custom_datasets.toxic_conversation import ProsocialDialogue, ProsocialDialogueExplaination
from model_training.custom_datasets.translation import WMT2019, DiveMT, TEDTalk
from sklearn.model_selection import train_test_split
from torch.utils.data import Dataset, Subset
QA_DATASETS = list(QADataset.D... | Review this code and list any quality issues. | [
{
"issue": "please use ',' at the end to have one entry per line.",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
if not step_details.tool_calls:
return None
items: list[FunctionCallContent] = []
tool_calls: list[
RunStepDeltaCodeInterpreterToolCall | RunStepDeltaFileSearchToolCall | RunStepDeltaFunctionToolCall
] = cast(
list[RunStepDeltaCodeInterpreterToolCall | RunStepDeltaFileSearc... | Review this code and list any quality issues. | [] | 0 |
python | @app.callback(
Output("test-out", "children"),
Input("button1", "n_clicks"),
Input("button2", "n_clicks", allow_optional=True),
prevent_inital_call=True,
)
def display(n, n2):
return f"{n} - {n2}"
dash_duo.start_server(app)
dash_duo.wait_for_text_to_equal("#butto... | Review this code and list any quality issues. | [] | 0 |
python | Collaborations:
What contractual agreements does this StringTransformer have with other
StringTransfomers? Such collaborations should be eliminated/minimized
as much as possible.
"""
__name__: Final = "StringTransformer"
# Ideally this would be a dataclass, but unfortunately mypyc ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n * Err(CannotTransform), if no match could be made.\r\n```\r\nI think the old wording was correct, but this suggested wording is more clear.",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'modified_date': '20231020',
'release_timestamp': 1697261769,
'release_date': '20231014',
'channel': 'アイドルマスター',
'channel_id': 'idolmaster',
},
}]
def _get_survapi_header(self, video_id):
request_token = self._download_json(
'https://a... | Review this code and list any quality issues. | [
{
"issue": "No need for single use variables\r\n```suggestion\r\n return {\r\n 'formats': self._extract_m3u8_formats(vod_data['ex_content']['streaming_url'], video_id),\r\n }\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | # right now they default to float64. If we have them default to float16, they will
# need to determine result_type when input is not float16 (overhead).
# Test _solve_bounded bracket logic, and decide what to do about warnings
# Get test coverage to 100%
# Raise when distribution method returns wrong shape/dty... | Review this code and list any quality issues. | [
{
"issue": "It was clearly my intent to do that at the time.\r\nhttps://github.com/scipy/scipy/blob/ef1eb04c96905419e65ca1e204dd164cd84134de/scipy/optimize/_chandrupatla.py#L494-L503\r\n\r\nIt looks like tests pass whether they are set to NaN or not. If there really was a problem with it, we worked around it, s... | 1 |
python | super().__init__(
map_args=[
target_shuffle_max_block_size,
upstream_map_fn,
random_shuffle,
random_seed,
],
reduce_args=[random_shuffle, random_seed],
)
@staticmethod
def map(
idx: int,
... | Review this code and list any quality issues. | [
{
"issue": "nit: Please create context manager for it (to use here and in _map_task)",
"severity": "minor",
"line": 26
}
] | 1 |
python | def get_smooth_cubic_bezier_handle_points(points):
points = np.array(points)
num_handles = len(points) - 1
dim = points.shape[1]
if num_handles < 1:
return np.zeros((0, dim)), np.zeros((0, dim))
# Must solve 2*num_handles equations to get the handles.
# l and u are the number of lower an... | Review this code and list any quality issues. | [] | 0 |
python | req.data.docs = DocList[input_doc_list_model]([data])
if body.header is None:
req.header.request_id = req.docs[0].id
resp = await caller(req)
status = resp.header.status
if status.code == jina_pb2.StatusProto.ERROR:
raise HTTPExce... | Review this code and list any quality issues. | [
{
"issue": "The following code works, but I did not allow get since it doesn't work with gateway deployments.\r\n\r\n```python\r\nmethods=['GET', 'POST'],\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | self._playlist_urls = set()
self.cache = Cache(self)
stdout = sys.stderr if self.params.get('logtostderr') else sys.stdout
self._out_files = Namespace(
out=stdout,
error=sys.stderr,
screen=sys.stderr if self.params.get('quiet') else stdout,
consol... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n stream_name = {sys.stdout: 'stdout', sys.stderr: 'stderr'}[stream]\r\n```\r\nAnything else means code is broken from our side.",
"severity": "critical",
"line": 26
}
] | 1 |
python | else:
try:
_yarn('ts/jupyter_extension')
_yarn('ts/jupyter_extension', 'build')
except Exception:
_print('Failed to build JupyterLab extension, skip for develop mode', color='yellow')
_print(traceback.format_exc(), color='yellow')
def symlink_nni_node():... | Review this code and list any quality issues. | [
{
"issue": "Using `+` to glue two paths is not recommended.",
"severity": "minor",
"line": 26
}
] | 1 |
python | def any_np_pt(x: NdarrayOrTensor, axis: int | Sequence[int]) -> NdarrayOrTensor:
"""`np.any` with equivalent implementation for torch.
For pytorch, convert to boolean for compatibility with older versions.
Args:
x: input array/tensor.
axis: axis to perform `any` over.
Returns:
... | Review this code and list any quality issues. | [] | 0 |
python | return self.db_engine_spec.get_text_clause(clause)
def _get_series_orderby(
self,
series_limit_metric: Metric,
metrics_by_name: dict[str, SqlMetric],
columns_by_name: dict[str, TableColumn],
template_processor: BaseTemplateProcessor | None = None,
) -> Column:
if... | Review this code and list any quality issues. | [
{
"issue": "The parent method seems more complete, handling cases where `column` is not a dict. This is one of the major problems with code duplication, things get fixed in one place but not another. :(",
"severity": "minor",
"line": 26
}
] | 1 |
python | return decorator
def describe(**parameters: Union[str, locale_str]) -> Callable[[T], T]:
r"""Describes the given parameters by their name using the key of the keyword argument
as the name.
Example:
.. code-block:: python3
@app_commands.command()
@app_commands.describe(member='the me... | Review this code and list any quality issues. | [
{
"issue": "The first line of docstring is used as the command's description. You should also add it.\r\n```suggestion\r\n \"\"\"Bans a member\r\n\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | obj = VGroup()
assert len(obj.submobjects) == 0
obj + VMobject()
assert len(obj.submobjects) == 0
obj += VMobject()
assert len(obj.submobjects) == 1
with pytest.raises(TypeError):
obj += Mobject()
assert len(obj.submobjects) == 1
with pytest.raises(TypeError):
# If only o... | Review this code and list any quality issues. | [] | 0 |
python | c = cons(a, usedforsecurity=False)
if c.name in self.shakes:
c.hexdigest(16)
else:
c.hexdigest()
def test_algorithms_guaranteed(self):
self.assertEqual(hashlib.algorithms_guaranteed,
set(_algo for _algo in self.supported_hash_names
... | Review this code and list any quality issues. | [
{
"issue": "Move the sysconfig stuff outside the loop please.",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'upload_date': '20240911',
'description': r're:^Bluesky now has video!',
'thumbnail': r're:^https://video.bsky.app/watch/.*\.jpg$',
'alt_title': 'Bluesky video feature announcement',
'uploader': 'Bluesky',
'channel': 'bsky.app',
'uploader_id': 'did... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'title': r're:clockwork banana: \"alright.',\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'series': try_get(content, lambda x: x['Media']['Name']),
'tags': tags,
'categories': categories,
'duration': float_or_none(content_package.get('Duration')),
'formats': formats,
'thumbnails': thumbnails,
}
if content_package.get('HasClosedCapt... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _VALID_URL = r'https?://(?:www\\.)?cp24\\.com/news/(?P<id>[^?#]+)'\r\n```\r\nand use this id for the webpage download message\r\nand maybe also return as `display_id`",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
],
fill=0,
stack=False,
)
# Ray Data Metrics (Cluster Autoscaler)
# Default threshold for scaling up is 75% (0.75)
DEFAULT_CLUSTER_SCALING_UP_UTIL_THRESHOLD = 75
CLUSTER_CPU_UTILIZATION_PANEL = Panel(
id=122,
title="Cluster utilization % (CPU)",
description="Average cluster CPU utilization p... | Review this code and list any quality issues. | [
{
"issue": "Will a dotted line automatically be added for a new `threshold`?",
"severity": "minor",
"line": 26
}
] | 1 |
python | import logging
import os # noqa: F401
import chromadb
from chromadb.utils import embedding_functions # noqa: F401
from embedchain.vectordb.base_vector_db import BaseVectorDB
class ChromaDB(BaseVectorDB):
"""Vector database using ChromaDB."""
def __init__(self, db_dir=None, ef=None, host=None, port=None):... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\nfrom chromadb.utils import embedding_functions\r\n```",
"severity": "minor",
"line": 5
}
] | 1 |
python | "country=china",
"country=venezuela",
)
for file in files:
assert file in (
*[f"{i}-cool.parquet" for i in range(df.npartitions)],
"_common_metadata",
"_metadata",
)
actual = dd.read_parquet(fn, engine=engine... | Review this code and list any quality issues. | [
{
"issue": "What do you think about parametrizing instead?\r\n\r\n```\r\n@pytest.mark.parametrize(\"engine\", [\r\n\tpytest.param(\"fastparquet\", marks=pytest.mark.xfail(PANDAS_GT_200, reason=\"fastparquet reads as int64 while pyarrow does as int32\")),\r\n\t\"pyarrow\"\r\n])\r\n```",
"severity": "critical... | 1 |
python | from deeplake.core.vectorstore import utils
from deeplake.core.vectorstore.vector_search import vector_search
from deeplake.core.vectorstore.vector_search import dataset as dataset_utils
from deeplake.core.vectorstore.vector_search import filter as filter_utils
from deeplake.util.bugout_reporter import feature_report_... | Review this code and list any quality issues. | [
{
"issue": "shouldn't this be `None` by default. That's what we do everywhere else in the deeplake repo and it works well, so I think we should adhere to conventions we have elsewhere in order to de-risk edge cases not working.",
"severity": "critical",
"line": 26
}
] | 1 |
python | is_map = isinstance(padder, MapTransform)
# check result is the same regardless of input type
for im_type in TEST_NDARRAYS_ALL:
with self.subTest(im_type=im_type):
input_image = im_type(im)
input_data = {"img": im_type(i... | Review this code and list any quality issues. | [] | 0 |
python | },
}
]
def _real_extract(self, url):
match = self._match_valid_url(url)
# Extract the video id, language and type from the url
_id = match.group('id')
_lang = match.group('lang')
_type = match.group('type')
base_url = f'https://msapifo-prod-me.weyyak.z5... | Review this code and list any quality issues. | [
{
"issue": "inline `video_duration` in return",
"severity": "minor",
"line": 26
}
] | 1 |
python | if math.isnan(val):
return 'NaN'
if val == 0:
return '0'
if math.isinf(val):
return '-Infinity' if val < 0 else 'Infinity'
if radix == 10:
# TODO: implement special cases
...
ALPHABET = b'0123456789abcdefghijklmnopqrstuvwxyz.-'
result = collections.deque()
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # if we need to round, propagate potential carry through fractional part\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from genesis.repr_base import RBC
if TYPE_CHECKING:
from genesis.engine.scene import Scene
from genesis.engine.simulator import Simulator
class Solver(RBC):
def __init__(self, scene: "Scene", sim: "Simulator", options):
self._uid = gs.UID()
self._sim = sim
self._scene = scene
... | Review this code and list any quality issues. | [
{
"issue": "What about removing `B: int` from the input arguments and just do `self._B = self._sim._B` inside this method? Then call `super.build()` in all derived implementations of `Solver`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | # save dataset
return (
pcoll_examples
| "Get values" >> beam.Values()
| "Save to parquet"
>> beam.io.parquetio.WriteToParquet(
self._parquet_path, self._schema, shard_name_template="-SSSSS-of-NNNNN.parquet"
)
)
def finaliz... | Review this code and list any quality issues. | [
{
"issue": "`Path` replaces `://` with `:/` no ? This can be an issue for those writing datasets in a cloud storage\r\n\r\n```python\r\n>>> from pathlib import Path\r\n>>> Path(\"gs://foo\")\r\nPosixPath('gs:/foo')\r\n```\r\n\r\nMaybe do the change only if it's a local path ?",
"severity": "minor",
"lin... | 1 |
python | qlib_uri: str = "git+https://github.com/microsoft/qlib#egg=pyqlib",
exp_folder_name: str = "run_all_model_records",
wait_before_rm_env: bool = False,
wait_when_err: bool = False,
):
"""
Please be aware that this function can only work under Linux. MacOS and Windows will be su... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n it could be URI on the remote or local path (NOTE: the local path must be an absolute path)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | prom_ver = "3.8.1"
prom_url = f"https://github.com/prometheus/prometheus/releases/download/v{prom_ver}/prometheus-{prom_ver}.linux-amd64.tar.gz"
lint_errors = frozenset(
(
"no help text",
"""should have "_total" suffix""",
"""should not have "_count" suffix""",
... | Review this code and list any quality issues. | [
{
"issue": "The downloaded binary should be verified for integrity using a checksum (SHA256) before execution. Without verification, a compromised download or man-in-the-middle attack could result in executing malicious code. Consider adding checksum validation after downloading the tarball.",
"severity": "... | 1 |
python | id=tool_call.id,
function=Function(
arguments=json_dumps(tool_call.tool_args),
name=tool_call.tool_name,
),
)
for tool_call in content.tool_calls
]
return param
LOGGER.warning(... | Review this code and list any quality issues. | [] | 0 |
python | attentions_not_sliding = model(**inputs, output_attentions=True).attentions
for layer_attention in attentions_not_sliding:
self.assertFalse((layer_attention[:, :, ~sliding_mask] == 0).all().item())
@slow
@require_torch_accelerator
@pytest.mark.torch_compile_test
def test_tor... | Review this code and list any quality issues. | [
{
"issue": "fixes failures observed in https://huggingface.co/datasets/hf-internal-testing/transformers_daily_ci/raw/3fed21c3fdb63a1b19d6030d493139a947135fd3/2026-01-06/ci_results_run_models_gpu/new_failures_with_bad_commit_grouped_by_authors.json",
"severity": "critical",
"line": 26
}
] | 1 |
python | 'subtitles': subtitles,
'duration': parse_duration(json_api_data.get('duration')),
'timestamp': parse_iso8601(json_api_data.get('timestamp'))
}
def _real_extract(self, url):
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
ap... | Review this code and list any quality issues. | [
{
"issue": "should be an InAdvancePagedList with page_size=1",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'info_dict': {
'id': '6996881461559165471',
'ext': 'mp4',
'title': '盲目涉水风险大,亲身示范高水位行车注意事项',
'description': '本期《懂车帝评测》,我们将尝试验证一个夏日大家可能会遇到的关键性问题:如果突发暴雨,我们不得不涉水行车,如何做才能更好保障生命安全。',
'tag': 'video_car'
},
# thumbnail url keep changing
'skip... | Review this code and list any quality issues. | [
{
"issue": "`42:13: F841 local variable 'audio_data' is assigned to but never used`",
"severity": "minor",
"line": 26
}
] | 1 |
python | libc.free(out[0])
else:
text_str = rl.ffi.string(text).decode("utf-8", "replace")
except Exception as e:
text_str = f"[Log decode error: {e}]"
if log_level == rl.TraceLogLevel.LOG_ERROR:
cloudlog.error(f"raylib: {text_str}")
elif log_level == rl.TraceLogLevel.LOG_WAR... | Review this code and list any quality issues. | [
{
"issue": "btw something about drawing these points slows down rendering on the comma four, any optimizations we can make?",
"severity": "major",
"line": 26
}
] | 1 |
python | Use 0 when ``Y`` contains the output of :term:`decision_function`
(classifier).
Use 0.5 when ``Y`` contains the output of :term:`predict_proba`.
If None, the threshold is assumed to be half way between
neg_label and pos_label.
Returns
-------
y_o... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n xp, is_array_api = get_namespace(Y)\r\n\r\n if is_array_api and self.sparse_input_ and not _is_numpy_namespace(xp):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # % if cookiecutter.enable_apify_integration
from apify import Actor
# % endif
# % block import required
# % endblock
# % if cookiecutter.http_client == 'curl-impersonate'
from crawlee.http_clients.curl_impersonate import CurlImpersonateHttpClient
# % elif cookiecutter.http_client == 'httpx'
from crawlee.http_clients._... | Review this code and list any quality issues. | [
{
"issue": "Interesting trick! Could you use line expressions (`# % if ...`) here like in the rest of the file?",
"severity": "minor",
"line": 23
}
] | 1 |
python | raise ValueError("points and rgbas must have same length")
self.rgbas = np.append(self.rgbas, rgbas, axis=0)
return self
def set_color(
self, color: ParsableManimColor = YELLOW, family: bool = True
) -> Self:
rgba = color_to_rgba(color)
mobs = self.family_members_with_po... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n list(map(color_to_rgba, color_gradient_as_list(*colors, len(self.points)))),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | bert_model = model_fn()
with shared_tempdir() as tempdir:
pretrained_path = os.path.join(tempdir, "pretrained")
bert_model.config.save_pretrained(save_directory=pretrained_path)
plugin = GeminiPlugin(**placement_config, enable_tensor_parallelism=enable_tensor_parallelism, tp_size=tp_size, ... | Review this code and list any quality issues. | [
{
"issue": "Maybe `enable_tensor_parallelism` can be removed from the test arguments, else this test will become to slow.",
"severity": "major",
"line": 26
}
] | 1 |
python | open_command = 'start'
elif 'osx' in os_name or 'darwin' in os_name:
open_command = 'open'
else:
open_command = 'xdg-open'
subprocess.run(
[open_command,
os.path.join(self.actual_directory, failed_image + TestResults.ACTUAL_SUFFIX)])
subp... | Review this code and list any quality issues. | [] | 0 |
python | The size category of each bounding box, matching
the enum values of ObjectSizeCategory. Shaped (N,).
Example:
>>> import numpy as np
>>> from supervision.metrics.utils.object_size import get_bbox_size_category
>>> xyxy = np.array([
... [0, 0, 31, 31], # 961 (Small)
... | Review this code and list any quality issues. | [] | 0 |
python | 'url': 'https://utexas.app.box.com/s/2x6vanv85fdl8j2eqlcxmv0gp1wvps6e',
'info_dict': {
'id': '787379022466',
'ext': 'mp4',
'title': 'Webinar recording: Take the Leap!.mp4',
'uploader': 'Patricia Mosele',
'timestamp': 1615824864,
'upload_dat... | Review this code and list any quality issues. | [
{
"issue": "use `traverse_obj` so we don't throw during error handling (which should be `expected=True`, right?)\r\n\r\nthen let's intentionally KeyError if there's no `itemID`, since we need it for the next request\r\n```suggestion\r\n shared_item = traverse_obj(post_stream_data, ('/app-api/endusera... | 1 |
python | self._dt: float = options.dt
self._substep_dt: float = options.dt / sim.substeps
self._init_gravity = getattr(options, "gravity", None)
self._gravity = None
self._entities: list[Entity] = gs.List()
# force fields
self._ffs = list()
def _add_force_field(self, force_f... | Review this code and list any quality issues. | [
{
"issue": "You cannot do that. Overwriting instance methods is very hacky and should only be used in last resort. Why would this be required in the first place? It is required by `set_gravity`, then just update `set_gravity` accordingly to avoid relying on this mechanism.",
"severity": "minor",
"line":... | 1 |
python | if changed:
self._update_layout_rects()
def set_parent_rect(self, parent_rect: rl.Rectangle) -> None:
"""Can be used like size hint in QT"""
self._parent_rect = parent_rect
@property
def is_pressed(self) -> bool:
return any(self._is_pressed)
@property
def enabled(self) -> bool:
return... | Review this code and list any quality issues. | [] | 0 |
python | dat = np.array(memoryview(b'1.0'))
assert_equal(dat, [49, 46, 48])
assert_(dat.dtype.type is np.uint8)
# test array interface
a = np.array(100.0, dtype=np.float64)
o = type("o", (object,),
{"__array_interface__": a.__array_interface__})
assert_equal(np.array(o, dtype=np.float64), a... | Review this code and list any quality issues. | [
{
"issue": "Although other tests in this same file also check HAS_REFCOUNT with `if`, I think it might be better to use a skipif test instead, so the test doesn't pass silently. See, for example: https://github.com/numpy/numpy/blob/83402f7a43363e8041b8f297fdd4f76a7fa9fea1/numpy/_core/tests/test_arrayprint.py#L... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.