language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | def _typecheck_input(self, mobject: Mobject | None) -> None:
if mobject is None:
logger.debug("Animation with empty mobject")
elif not isinstance(mobject, (Mobject, OpenGLMobject)):
raise TypeError("Animation only works on Mobjects")
def __str__(self) -> str:
if self... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n f\"{self} has a runtime of <= 0 seconds, which cannot be rendered correctly! please set a runtime > 0\"\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | Task, has_clearml = optional_import("clearml", name="Task")
_, has_tb = optional_import("torch.utils.tensorboard", name="SummaryWriter")
@unittest.skipUnless(has_clearml, "Requires 'clearml' installation")
@unittest.skipUnless(has_tb, "Requires SummaryWriter installation")
class TestHandlerClearMLStatsHandler(unittes... | Review this code and list any quality issues. | [
{
"issue": "Should we also add the close logic to the handler itself? Refer to the MLFlow option:\r\nhttps://github.com/Project-MONAI/MONAI/blob/dev/monai/handlers/mlflow_handler.py#L94\r\nCC @binliunls \r\n\r\nThanks.",
"severity": "minor",
"line": 26
}
] | 1 |
python | """Test the generation of unique ids."""
state_entity_ids = hass.states.async_entity_ids()
for entity_id, unique_id in EXPECTED_ENTITY_IDS.items():
assert entity_id in state_entity_ids
state = hass.states.get(entity_id)
assert state
assert state.state == "100"
entity = e... | Review this code and list any quality issues. | [
{
"issue": "Instead of this, use the `entity_registry_enabled_by_default` fixture in a test which checks the sensor state when they are enabled.\n\nYou can check that they are not enabled by default in a separate test (check that they exist in the entity registry but are disabled and don't have a state).\n\nEx... | 1 |
python | - num_tokens_from_string(prompt, model=encoding_model)
- num_tokens_from_string(entity_types, model=encoding_model)
if entity_types
else 0
)
examples_prompt = ""
min_examples_required = 3
# Iterate over examples, while we have tokens left or examples left
for i, output in e... | Review this code and list any quality issues. | [
{
"issue": "3 examples will potentially generate a huge prompt of over 2000 tokens. I was tying to keep it below that as it is the recommended input size by OpenAI.\r\nDid you see any drawback in your experiments? How big is the resulting prompt with 3 examples?",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
Start the KeepAliveThread.
"""
self._keep_alive_thread = KeepAliveThread(self._scheduler, self._id, self._config.ping_interval)
self._keep_alive_thread.daemon = True
self._keep_alive_thread.start()
return self
def __exit__(self, type, value, traceback):
"... | Review this code and list any quality issues. | [] | 0 |
python | == np.array(
[
[0.96362, 0.0, 0.26726],
[-0.14825, 0.83205, 0.53452],
[-0.22237, -0.5547, 0.80178],
]
)
)
def test_angle_of_vector():
assert angle_of_vector(np.array([1, 1, 1])) == np.pi / 4
assert (
np.round(angle_bet... | Review this code and list any quality issues. | [
{
"issue": "Can you test that\r\n- a ValueError is properly raised when the lines don't line in the xy plane;\r\n- the case where the lines are parallel\r\n- the case where the lines aren't parallel, but the intersection occurs outside the specified line segments",
"severity": "minor",
"line": 26
}
] | 1 |
python | client = TestClient(app)
def test_endpoint_works():
response = client.post("/", json=[1, 2, 3])
assert response.json() == 6
def test_exception_handler_body_access():
response = client.post("/", json={"numbers": [1, 2, 3]})
assert response.json() == IsDict(
# httpx 0.28.0 switches to compact ... | Review this code and list any quality issues. | [
{
"issue": "We can avoid duplicating this with the help of `dirty_equals.IsOneOf`:\r\n```python\r\n {\r\n \"detail\": {\r\n \"errors\": [\r\n {\r\n \"type\": \"list_type\",\r\n \"loc\": [\"body\"],\r\n ... | 1 |
python | tol=0 if platform.machine() == 'x86_64' else 0.024)
def test_connection_patch():
fig, (ax1, ax2) = plt.subplots(1, 2)
con = mpatches.ConnectionPatch(xyA=(0.1, 0.1), xyB=(0.9, 0.9),
coordsA='data', coordsB='data',
axesA=ax2, axesB=ax1,
... | Review this code and list any quality issues. | [] | 0 |
python | 'quality': i,
}
for i, fm in
enumerate(re.findall(r"([a-z0-9]+)\s*:\s*'([^']+)'", formats_str))
]
return {
'id': video_id,
'title': title,
'formats': formats,
'description': description,
'uploader': uploader... | Review this code and list any quality issues. | [
{
"issue": "This is always used as regex, so this would be better imo:\r\n```suggestion\r\n _STATIONS_RE = '|'.join(map(re.escape, (\r\n 'franceculture',\r\n 'franceinfo',\r\n 'franceinter',\r\n 'francemusique',\r\n 'fip',\r\n 'mouv',\r\n )))\r\n```",
"severit... | 1 |
python | coverage_install: Path,
socket_install: Path,
) -> VirtualEnvironment:
venv_type: VirtualEnvironmentType
if request.config.getoption("--use-venv"):
venv_type = "venv"
else:
venv_type = "virtualenv"
# Create the virtual environment
tmpdir = tmpdir_factory.mktemp("virtualenv")
... | Review this code and list any quality issues. | [] | 0 |
python | It can be either:
- `disabled` (default): If a model response will exceed the context window size for a model, the
request will fail with a 400 error.
- `auto`: If the context of this response and previous ones exceeds the model's context window size,
the model will truncate the response to fit ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n \"\"\"The ID of a previous response from the model to use as the starting point for a continued conversation.\r\n\r\n When set to `'auto'`, the request automatically uses the most recent\r\n `provider_response_id` from the message history and omits earlier messages.\r\n\r\... | 1 |
python | # Make a best-effort attempt at parsing metrics.
for be_result in results:
table = Table(
title="Evaluation Results",
title_style="bold magenta",
)
table.add_column("Benchmark", style="cyan")
table.add_column("Metric", style="yellow")
table.add_column(... | Review this code and list any quality issues. | [
{
"issue": "Why `name`? Which backend has this field?",
"severity": "minor",
"line": 26
}
] | 1 |
python | if len(playlist) == 1:
info = playlist[0]
info['id'] = video_id
else:
info = {
'_type': 'multi_video',
'entries': playlist,
'id': video_id,
'title': title,
'duration': traverse_obj(vid_data, ('dat... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'tags': ('data', 'tag', {str.split}),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def test_signature_dtype_type(self):
# Since that will be the normal behaviour (past NumPy 1.21)
# we do support the types already:
float_dtype = type(np.dtype(np.float64))
np.add(3, 4, signature=(float_dtype, float_dtype, None))
@pytest.mark.parametrize("get_kwarg", [
l... | Review this code and list any quality issues. | [
{
"issue": "The preceding test function had the same name. Can you help find a better name?",
"severity": "minor",
"line": 26
}
] | 1 |
python | video_id = str(player_data['contentId'])
title = player_data.get('title') or self._og_search_title(webpage, fatal=False) or \
self._html_search_regex(r'<h\d+\b[^>]+\bclass="article_title">([^<]+)<', webpage, 'title')
upload_date = unified_strdate(
'{}-{}-{}'.format(mobj.group('y... | Review this code and list any quality issues. | [
{
"issue": "As far as I can tell, the site no longer uses wowza. So let's just inline:\r\n```py\r\n'formats': self._extract_m3u8_formats(playlist_url, video_id),\r\n```\r\nRealistically, this whole extractor needs to be rewritten, but you don't need to do that as part of this PR.",
"severity": "major",
... | 1 |
python | log_coins=log_coins,
)
self._mempool_manager = MempoolManager(
get_coin_records=self.coin_store.get_coin_records,
get_unspent_lineage_info_for_puzzle_hash=self.coin_store.get_unspent_lineage_info_for_puzzle_hash,
consensus_constants=self.constants... | Review this code and list any quality issues. | [
{
"issue": "The `.num_unspent` API is badly named and ill-conceived since a count could take a very long time depending on the specifics of the storage mechanism, and is not actually needed for any genuine purpose, so requiring it in the protocol applies an unnecessary constraint. We use a local function that m... | 1 |
python | NiconicoUserIE,
NicovideoSearchDateIE,
NicovideoSearchIE,
NicovideoSearchURLIE,
)
from .ninecninemedia import NineCNineMediaIE
from .ninegag import NineGagIE
from .ninenow import NineNowIE
from .nintendo import NintendoIE
from .nitter import NitterIE
from .njpwworld import NJPWWorldIE
from .nobelprize impor... | Review this code and list any quality issues. | [] | 0 |
python | from crawlee.storage_clients.models import ProcessedRequest
logger = getLogger(__name__)
class SitemapRequestLoaderState(BaseModel):
"""State for sitemap request loader persistence."""
model_config = ConfigDict(populate_by_name=True)
# URL queue and processing state
url_queue: Annotated[deque[str]... | Review this code and list any quality issues. | [
{
"issue": "Can we rather use field docstrings, please?",
"severity": "minor",
"line": 26
}
] | 1 |
python | set1 = {
"x": [1, 2, 3, 4, 4, 4, 8, 9, 10],
"type": "box",
"name": "Set 1"
}
set2 = {
"x": [2, 3, 3, 3, 3, 5, 6, 6, 7],
"type": "box",
"name": "Set 2"
}
data = [set1, set2]
layout = {
"title": {
"text": "Horizontal Box Plot"
}
}
page = """
<|{data}|dashboard|layout={layout}|>... | Review this code and list any quality issues. | [
{
"issue": "Please remove this (useless) port setting - for exposure to users.",
"severity": "major",
"line": 26
}
] | 1 |
python | 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
'thumbnail': 'https://cdn.jwplayer.com/v2/media/sEIWvKR7/poster.jpg?width=720',
'duration': 52,
'timestamp': 1631553328,
'upload_date': '20210913',
},
'params': {'skip_download': True}
}, {
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'title': 'Fox Business Network - 4:00 PM - 5:00 PM - 1:39:42 pm - 1:42:20 pm',\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | res = self.sf.fetchUrl(queryString,
timeout=self.opts['_fetchtimeout'],
useragent=self.opts['_useragent'])
time.sleep(self.opts['pause'])
if res['content'] is None:
self.sf.info(f"No Etherscan data found for {qry}")
... | Review this code and list any quality issues. | [
{
"issue": "This module doesn't appear to be checking if errorState is True anywhere?",
"severity": "minor",
"line": 26
}
] | 1 |
python | default_title = get_default_conversation_title(conversation_id)
if (
conversation.title == default_title
): # attempt to autogenerate if default title is in use
title = await auto_generate_title(
conversation_id, user_id, self.file_store, settings
)
... | Review this code and list any quality issues. | [
{
"issue": "(not a review comment)\r\n\r\nJust a small note here: this is in a callback from an eventstream subscriber that gets run every event, I _think_ it's really any event, regardless if agent, user, environment, state changes. I always get a little concerned to return as soon as possible, if the event is... | 1 |
python | if (len(self._beta) == n_layers):
self.gguf_writer.add_xielu_beta([self._beta[k] for k in sorted(self._beta)])
return []
if name.endswith(".act_fn.eps"):
self._eps[bid] = data_torch.to("cpu").float().item()
if (len(self._eps) == n_layers):
self... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n self.gguf_writer.arch = gguf.MODEL_ARCH_NAMES[self.model_arch]\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'skip': 'Geo-restricted to Canada',
}, {
# geo-restricted to Canada, bypassable
# This video requires an account in the browser, but works fine in yt-dlp
'url': 'https://gem.cbc.ca/media/schitts-creek/s01e01',
'md5': '297a9600f554f2258aed01514226a697',
'info_dict': {
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # TV show playlist, all public videos\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Test specific known skeletons
coco_skeleton = Skeleton.COCO.value
assert 17 in SKELETONS_BY_VERTEX_COUNT # COCO has 17 keypoints
assert SKELETONS_BY_VERTEX_COUNT[17] == coco_skeleton
def test_skeletons_by_edge_count(self):
"""Test SKELETONS_BY_EDGE_COUNT dictionary mapping."""
... | Review this code and list any quality issues. | [
{
"issue": "This test assumes that all skeletons in the Skeleton enum have unique vertex counts. However, if two skeletons happen to have the same number of unique vertices, this test would fail. The test should validate the actual behavior of the code: when multiple skeletons share the same vertex count, the d... | 1 |
python | 'description': 'md5:665bb36ec2a12c5a7f598ee713fc2b54',
},
'playlist_mincount': 11,
}, {
'url': 'https://www3.nhk.or.jp/nhkworld/en/shows/10yearshayaomiyazaki/',
'only_matching': True,
}]
@classmethod
def suitable(cls, url):
return False if NhkVodIE.suitable(url) ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n for episode in traverse_obj(episodes, ('items', lambda _, v: v['url'])):\r\n yield self._extract_episode_info(urljoin(url, episode['url']), episode)\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | #
# Copyright 2016 Quantopian, Inc.
#
# 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 wr... | Review this code and list any quality issues. | [
{
"issue": "(Though see note below re: storing contracts as a list vs tuple.)",
"severity": "minor",
"line": null
}
] | 1 |
python | '''
Create Token class out of example OIDC token response.
'''
return OIDCClient._json_response_to_token(MOCK_TOKEN_RESPONSE)
def test_generate_access_token(oidc_client):
with mock.patch(
'awx.main.utils.analytics_proxy.requests.post',
return_value=mock.Mock(json=lambda: MOCK_TOKEN_RES... | Review this code and list any quality issues. | [] | 0 |
python | return cls._return(obj, id, lambda x: x, memoizing=False)
@classmethod
def _handle_already_processed(
cls, obj, default_function: typing.Callable[[Any], Any]
):
if (
isinstance(
obj,
(
int,
float,
... | Review this code and list any quality issues. | [
{
"issue": "Should this throw an error, or no? Like should we be more strict about being right about what can be hashed?\r\n\r\nRelated: what is 'id' here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | return
# Best effort to wipe NVME
os.system(f"sudo umount {NVME}")
os.system(f"yes | sudo mkfs.ext4 {NVME}")
# Removing data and formatting
rm = os.system("sudo rm -rf /data/*")
os.system(f"sudo umount {USERDATA}")
fmt = os.system(f"yes | sudo mkfs.ext4 {USERDATA}")
if rm == 0 or fmt ... | Review this code and list any quality issues. | [
{
"issue": "it should just continue (exit 0), not power off",
"severity": "minor",
"line": 26
}
] | 1 |
python | async def drain(self) -> None:
if self._activity is None:
raise RuntimeError("AgentSession isn't running")
await self._activity.drain()
def _close_soon(
self,
*,
reason: CloseReason,
drain: bool = False,
error: llm.LLMError | stt.STTError | tts.T... | Review this code and list any quality issues. | [
{
"issue": "nit:\r\n```suggestion\r\n def shutdown(self) -> None:\r\n self._close_soon(error=None, drain=True, reason=CloseReason.USER_INITIATED)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | import re
from collections import namedtuple
from .common import InfoExtractor
from ..utils import (
int_or_none,
)
class RadioComercialBaseExtractor(InfoExtractor):
def _extract_page_content(self, url):
video_id = RadioComercialIE._match_id(url)
webpage = self._download_webpage(url, video_id... | Review this code and list any quality issues. | [
{
"issue": "Then this will need to be\r\n```suggestion\r\n video_id, season = self._match_valid_url(url).group('id', 'season')\r\n```",
"severity": "minor",
"line": 12
}
] | 1 |
python | from manim.mobject.opengl.opengl_mobject import OpenGLGroup, OpenGLMobject
from .. import config
from ..animation.animation import Animation
from ..constants import DEFAULT_POINTWISE_FUNCTION_RUN_TIME, DEGREES, ORIGIN, OUT
from ..mobject.mobject import Group, Mobject
from ..utils.paths import path_along_arc, path_alon... | Review this code and list any quality issues. | [
{
"issue": "Suggestion for a slightly more explicit description\r\n\r\n```suggestion\r\n A function defining the path that the points of the ``mobject`` are being moved\r\n along until they match the points of the ``target_mobject``, see :mod:`.utils.paths`.\r\n```",
"severity": "minor",
"... | 1 |
python | lines = []
p = q.user.wave_process
os.set_blocking(p.stdout.fileno(), False)
while True:
line = p.stdout.readline()
if line:
lines.append(line.decode('utf8'))
code = ''.join(lines)
q.page['logs'].content = f'```\n{code}\n```'
q.page['meta'].script = ui.inline_... | Review this code and list any quality issues. | [] | 0 |
python | serializer_class = serializers.ScheduleSerializer
parent_model = models.InventorySource
relationship = 'schedules'
parent_key = 'unified_job_template'
class InventorySourceActivityStreamList(SubListAPIView):
model = models.ActivityStream
serializer_class = serializers.ActivityStreamSerializer
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n compute_cloud_inventory_sources(), parent.source\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from ..utils import (
clean_html,
determine_ext,
extract_attributes,
get_elements_html_by_class,
int_or_none,
merge_dicts,
mimetype2ext,
parse_iso8601,
remove_end,
remove_start,
str_or_none,
traverse_obj,
unified_strdate,
url_or_none,
)
class NYTimesBaseIE(InfoE... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n for video in traverse_obj(content_media_json, ('renditions', ..., {dict})):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | True
>>> from manim import Scene, Create
>>> class CustomTipExample(Scene):
... def construct(self):
... self.play(Create(arr))
Using a class inherited from :class:`ArrowTip` to get a non-filled
tip is a shorthand to manually specifying the arrow tip style as follows... | Review this code and list any quality issues. | [
{
"issue": "Instead of explicitly importing every arrow tip, we could do something like\r\n```py\r\n import manim.mobject.geometry.tips as arrow_tips\r\n```\r\nwhich would then allow us to access all of the tips in the file via the module, e.g., `arrow_tips.ArrowTriangleTip` and so on. Do you think this ... | 1 |
python | from .base import (
HookCollectorInfo,
DataCollector,
MetricsCalculator,
SparsityAllocator,
TaskGenerator
)
from .data_collector import (
WeightDataCollector,
WeightTrainerBasedDataCollector,
SingleHookTrainerBasedDataCollector
)
from .metrics_calculator import (
NormMetricsCalculato... | Review this code and list any quality issues. | [] | 0 |
python | "value",
"children_left",
"children_right",
"threshold",
"impurity",
"feature",
"n_node_samples",
]:
value = getattr(DecisionTreeClassifier().fit([[0], [1]], [0, 1]).tree_, attr)
# if pointing to freed memory, contents may be arbitrary
assert -... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n X = random_state.rand(10, 2)\n```\n\nI think you just need 2 features for this test to work. It would make it clearer IMO.",
"severity": "minor",
"line": 26
}
] | 1 |
python | async def _pause_on_new_election(self):
with self.election_receiver as ems:
async for message in ems:
if message.clock > self.last_completed_election:
self.paused = True
async def _cleanup_expired_images(self):
"""Periodically clean up expired images ... | Review this code and list any quality issues. | [
{
"issue": "wouldn't this need to be on every api endpoint?",
"severity": "minor",
"line": 26
}
] | 1 |
python | },
]
def _real_extract(self, url):
video_id = self._match_id(url)
info = traverse_obj(
self._download_json(f'https://www.manyvids.com/bff/store/video/{video_id}', video_id),
('data', {dict})) or {}
video_urls = traverse_obj(
self._download_json(f'ht... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n thumbnail = url_or_none(info.get('screenshot')) or url_or_none(info.get('thumbnail'))\r\n```\r\nShouldn't screenshot be preferred over thumbnail? Screenshot is most often higher resolution than thumbnail.",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
from llama_stack.core.datatypes import AccessRule
from llama_stack.core.storage.datatypes import ResponsesStoreReferenc... | Review this code and list any quality issues. | [
{
"issue": "There's a few places in this file that raise ValueErrors but should probably raise the new ones that you introduced IMO",
"severity": "minor",
"line": 1
}
] | 1 |
python | """Streaming, truncating, non-recursive version of :func:`repr`.
Differences from regular :func:`repr`:
- Sets are represented the Python 3 way: ``{1, 2}`` vs ``set([1, 2])``.
- Unicode strings does not have the ``u'`` prefix, even on Python 2.
- Empty set formatted as ``set()`` (Python 3), not ``set([])`` (Python 2)... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\nfrom typing import Any, AnyStr, Callable, Dict, Iterator, List, Sequence, Set, Tuple\r\n```",
"severity": "minor",
"line": 18
}
] | 1 |
python | ("(c0 Int)", "identity(1+1)"),
("(c0 Int)", "identity()"),
("(c0 Int, c1 Int)", "identity(c0, c1, c0)"),
("(c0 Int, c1 Int)", "icebergBucket(c0, c1)"),
("(c0 Int, c1 Int)", "icebergBucket(1, 2)"),
("(c0 Int)", "icebergBucket(c0, 1)"),
("(c0 Int)", "icebergBucket(-1, c0)")... | Review this code and list any quality issues. | [
{
"issue": "Please, use function node.query_and_get_error and check that you indeed have expected error text for each call (and BAD_ARGUMENTS call)",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Drop the node -datadir= argument during this test, because if it is
# specified it would take precedence over the datadir setting in the
# config file.
node_args = node.args
node.args = [arg for arg in node.args if not arg.startswith("-datadir=")]
# Check that correct configur... | Review this code and list any quality issues. | [
{
"issue": "In commit \"init: fix fatal error on '-wallet' negated option value\" (0df52e24363f729210887ca20a47824ba8073617)\r\n\r\nI think this should be extended to test `-nowallet=0`. Maybe consider making this a loop to test both `-nowallet=0` `-nowallet=not_a_boolean`.\r\n\r\nReason: the simplest and most ... | 1 |
python | }
],
)
t_text = (
completion["choices"][0]
.get("message")
.get("content")
.encode("utf8")
.decode()
)
print(t_text)
return t_text
class BEPUB:
def __init__(self, epu... | Review this code and list any quality issues. | [] | 0 |
python | add_session_state_to_context: Optional[bool] = None,
metadata: Optional[Dict[str, Any]] = None,
debug_mode: Optional[bool] = None,
show_message: bool = True,
show_reasoning: bool = True,
show_full_reasoning: bool = False,
console: Optional[Any] = None,
# Add tags ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n \"The 'stream_events' parameter is not needed. Event streaming is now enabled by default when using the aprint_response function.\",\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | e2b_credentials,
mem0_credentials,
nvidia_credentials,
screenshotone_credentials,
]
class IntegrationCredentialsStore:
def __init__(self):
from backend.data.redis import get_redis
self.locks = RedisKeyedMutex(get_redis())
@property
@thread_cached
def db_manager(self) -> "... | Review this code and list any quality issues. | [] | 0 |
python | 'location': 'Napoli',
'timestamp': 1459987200,
'upload_date': '20160407',
'description': 'md5:5e15a789a2fe4d67da8d1366996e89ef',
'thumbnail': 'https://www.radioradicale.it/photo400/0/0/9/0/1/00901768.jpg',
},
'params': {
'skip_download': True,
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n subtitles = {sub.get('srclang') or 'und': [{\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | mock_await_pod_completion,
mock_fetch_requested_container_logs,
data_file,
):
"""
Verifies that find_spark_job picks a Running Spark driver pod over a non-Running pod.
"""
task_name = "test_find_spark_job_prefers_running_pod"
job_spec = yaml.safe_load(data_fi... | Review this code and list any quality issues. | [
{
"issue": "I think you should set a `deletion_timestamp` here as well. As I believe that under your current implementation, this test will still pass if pod phase is not 'Succeeded'. `deletion_timestamp` is the primary criterion for pod selection. Or maybe you could leave it unset. With this test, we want to ... | 1 |
python | this arg is only useful when `eval_workflow` is None.
eval_workflow_name: the workflow name corresponding to the "config_evaluate_filename", default to "train"
as the default "config_evaluate_filename" overrides the train workflow config.
this arg is only useful when `eval_workflow` is N... | Review this code and list any quality issues. | [
{
"issue": "Should this be additional_train_args and move it to the end of the argument list?",
"severity": "minor",
"line": 26
}
] | 1 |
python | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from yt_dlp import utils
class QingTingIE(InfoExtractor):
IE_NAME = 'QingTing'
_VALID_URL = r'''(?x)
(?:https?://)?(?:www\.)?
(?P<m>m\.)?(?:qingting\.fm|qtfm\.cn)/(?(m)v|)
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\nfrom ..utils import traverse_obj\r\n```\r\n`utils` should be a relative import, and import only what is needed from it.\r\n\r\nif changes suggested below are applied, `traverse_obj` will be needed, and `url_or_none` and `ExtractorError` will be unnecessary",
"severity": "major",... | 1 |
python | from typing import Optional
from pydantic import BaseModel, Field, model_validator
class PGVectorConfig(BaseModel):
dbname: str = Field("postgres", description="Default name for the database")
collection_name: str = Field("mem0", description="Default name for the collection")
embedding_model_dims: Option... | Review this code and list any quality issues. | [
{
"issue": "We should not set the default value for embedding_model_dims, host and port. User should specify that.",
"severity": "minor",
"line": 12
}
] | 1 |
python | if int(EXPECTED_FLAGS[section]) != int(flags):
return False
return True
def check_ELF_CONTROL_FLOW(binary) -> bool:
'''
Check for control flow instrumentation
'''
main = binary.get_function_address('main')
content = binary.get_content_from_virtual_address(main, 4, lief.Binary.VA... | Review this code and list any quality issues. | [
{
"issue": "Might want to check `.imported` to make sure it's an imported symbol, just to be sure.",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import (
traverse_obj,
)
class YleAreenaIE(InfoExtractor):
_VALID_URL = r'https?://areena\.yle\.fi/(?P<id>[0-9-]+)'
_TESTS = [{
'url': 'https://areena.yle.fi/1-4371942',
'md5': '932edda0ecf5dfd6423804182d32f8ac',
'info_dict': {
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\nfrom ..utils import traverse_obj\r\n```",
"severity": "minor",
"line": 4
}
] | 1 |
python | break
else: # AKA no-break
version = release = "dev"
print("pip version:", version)
print("pip release:", release)
# -- Options for myst-parser ----------------------------------------------------------
myst_enable_extensions = ["deflist"]
myst_heading_anchors = 3
# -- Options for smartquotes ---------... | Review this code and list any quality issues. | [
{
"issue": "It's discouraged to mix formatting changes together with functional ones. Besides, it makes this place inconsistent with the rest of the module. Could you revert the formatting?",
"severity": "minor",
"line": 26
}
] | 1 |
python | webpage,
'description',
default=None,
),
'thumbnail': self._og_search_thumbnail(webpage),
'uploader': self._html_search_regex(
r'(?s)<span class="author">(.*?)</span>',
webpage,
'uploader',
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n video_data = self._parse_json(\r\n self._search_regex(\r\n r'({\"@type\":\"AudioObject\",\"contentUrl\":\"[^\"]+\",\"duration\":\"[^\"]+\",\"encodingFormat\":\"mp3\",\"potentialAction\":{\"@type\":\"Action\",\"name\":\"ListenAction\"}})', webpage, ... | 1 |
python | """
Base class for all types of sensors.
A sensor must have a read() method that returns the sensor data.
"""
def __init__(self, sensor_options: "SensorOptions", sensor_idx: int, sensor_manager: "SensorManager"):
self._options: "SensorOptions" = sensor_options
self._idx: int = sensor_id... | Review this code and list any quality issues. | [
{
"issue": "You should probably set the absolute tolerance yourself.",
"severity": "minor",
"line": 26
}
] | 1 |
python | """Stop push updates when hass stops."""
await bluetooth_client.disconnect()
entry.async_on_unload(
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, disconnect_bluetooth
)
)
entry.as... | Review this code and list any quality issues. | [] | 0 |
python | start_offset=consume_slice.end_offset,
end_offset=block_slice.end_offset,
)
remaining_blocks.append((block_ref, metadata))
remaining_slices.append(remainder_slice)
rows_to_take = 0
sliced_bundle = RefBundle(
... | Review this code and list any quality issues. | [
{
"issue": "Let's add test for this method",
"severity": "minor",
"line": 26
}
] | 1 |
python | transcription_config = dataclasses.replace(self._transcription_config)
if is_given(language):
transcription_config.language = language
self._stream = SpeechStream(
stt=self,
conn_options=conn_options,
)
return self._stream
def _process_config(sel... | Review this code and list any quality issues. | [
{
"issue": "@longcw is this what you were asking for?",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'responsive_web_graphql_skip_user_profile_image_extensions_enabled': False,
'responsive_web_graphql_timeline_navigation_enabled': True,
'responsive_web_enhance_cards_enabled': False
},
'fieldToggles': {
'withArticleRichContentState': False
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if not self._configuration_arg('legacy_api'):\r\n return self._graphql_to_legacy(\r\n self._call_graphql_api('2ICDjqPd81tulZcYrtpTuQ/TweetResultByRestId', twid), twid)\r\n return traverse_obj(self._call_api(f'statuses/show/{tw... | 1 |
python | ]
if (
self._get_reconfigure_entry().state == ConfigEntryState.LOADED
and user_input[CONF_API_ENDPOINT] != DEFAULT_API_ENDPOINT
and existing_api_endpoint == DEFAULT_API_ENDPOINT
):
# logout existing bot from the official Telegram bot API
# logo... | Review this code and list any quality issues. | [
{
"issue": "move everything out of try that cannot fail",
"severity": "critical",
"line": 26
}
] | 1 |
python | commands.extend([ '-pix_fmt', 'yuv420p', '-colorspace', 'bt709', '-y', temp_output_video_path ])
return run_ffmpeg(commands)
def restore_audio(target_path : str, output_path : str, video_fps : Fps) -> bool:
trim_frame_start = facefusion.globals.trim_frame_start
trim_frame_end = facefusion.globals.trim_frame_end
t... | Review this code and list any quality issues. | [
{
"issue": "can we move that to open_ffmpeg() ?",
"severity": "minor",
"line": 26
}
] | 1 |
python | external_aes_key = traverse_obj(info_dict, ('hls_aes', 'key', {str}))
if external_aes_key:
external_aes_key = binascii.unhexlify(remove_start(external_aes_key, '0x'))
assert len(external_aes_key) in (16, 24, 32), 'Invalid length for HLS AES-128 key'
external_aes_iv = traverse_obj... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n frag_url = urljoin(man_url, line)\r\n```\r\nThe point is that it already handles absolute URLs correctly",
"severity": "minor",
"line": 26
}
] | 1 |
python | if self.access_token is None:
raise ExtractorError('Getting token failed', expected=True)
def _real_initialize(self):
if not self.access_token:
self.raise_login_required('Login is required to access any iPrima content', method='password')
def _raise_access_error(self, error_cod... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n r'let\\s+videos\\s*=\\s*([\\'\"])(?P<id>p\\d+)\\1',\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | sections_output_dir : :class:`pathlib.Path`
where are section videos stored
output_name : str
name of movie without extension and basis for section video names
Some useful attributes are:
"write_to_movie" (bool=False)
Whether or not to write the animations into ... | Review this code and list any quality issues. | [
{
"issue": "I would say that the `scene_name` parameter itself should always be a string, because:\r\n- the name (`scene_name`) suggests a string, not a path\r\n- currently, only strings are passed as `scene_name` in the source code as well\r\n\r\nSo, instead of doing this conversion to string here, I suggest c... | 1 |
python | fmt, subs = self._extract_mpd_formats_and_subtitles(manifest_info.get('src'), display_id, fatal=False)
else:
continue
formats.extend(fmt)
self._merge_subtitles(subs, target=subtitles)
return {
'id': video_id or api_json.get('id'),
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n return merge_dicts(self._call_api(video_id, display_id), {\r\n```\r\n\r\nbut we don't even really need `merge_dicts` here, since `traverse_obj` will not return keys paired with `None` values. We could just unpack `**self._call_api(video_id, display_id)` after the unpacked js... | 1 |
python | job.inventory = mock_inventory
job.execution_environment = execution_environment
job.get_hosts_for_fact_cache = Job.get_hosts_for_fact_cache.__get__(job) # to run original method
job.job_env.get = mock.MagicMock(return_value=private_data_dir)
# creates the task object with job object as instance
m... | Review this code and list any quality issues. | [] | 0 |
python | for entry_point in dist.iter_entry_points():
if entry_point.group == "console_scripts":
console_scripts[entry_point.name] = entry_point.value
elif entry_point.group == "gui_scripts":
gui_scripts[entry_point.name] = entry_point.value
return console_scripts, gui_scripts
def m... | Review this code and list any quality issues. | [
{
"issue": "This requires all paths in `PATH` to exist, which is not necessarily true. So we need to catch FileNotFoundError and ignore those.",
"severity": "minor",
"line": 26
}
] | 1 |
python | kwargs : Any
Additional arguments to be passed to :class:`Axes`.
.. note:: If :attr:`x_length` or :attr:`y_length` are not defined, the plane automatically adjusts its lengths based
on the :attr:`x_range` and :attr:`y_range` values to set the unit_size to 1.
"""
def __init__(
self,... | Review this code and list any quality issues. | [
{
"issue": "@abhi3019's comment hasn't been resolved.\r\n\r\n```suggestion\r\n faded_line_ratio: Optional[float] = 1,\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def name(self, val) -> None:
self.properties["name"] = val
def has_tag(self, tag: str) -> bool:
"""Indicate if the scenario has a given tag.
Arguments:
tag (str): The tag to search among the set of scenario's tags.
Returns:
True if the scenario has the tag ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n params (Optional[List[Any]]): The parameters to be passed to the _callback_.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | " excluded ones. (Useful if you simply want to add to the default)"
),
)
@click.option(
"--force-exclude",
type=str,
callback=validate_regex,
help=(
"Like --exclude, but files and directories matching this regex will be "
"excluded even when they are passed explicitly as arguments."
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n default=os.cpu_count(),\r\n type=int,\r\n show_default=True,\r\n help=\"Number of parallel workers\",\r\n```\r\n\r\nMaybe we could just show the cpu_count in the help output ...",
"severity": "minor",
"line": 26
}
] | 1 |
python | ):
return False
log.debug("Checking if DAG (%s) changed", dag.dag_id)
new_serialized_dag = cls(dag)
serialized_dag_hash = session.scalars(
select(cls.dag_hash).where(cls.dag_id == dag.dag_id).order_by(cls.created_at.desc())
).first()
dag_version = Dag... | Review this code and list any quality issues. | [
{
"issue": "So what happens if not latest_ser_dag? We continue and right new versions?",
"severity": "minor",
"line": 26
}
] | 1 |
python | "write_to": "_black_version.py",
"write_to_template": 'version = "{version}"\n',
},
description="The uncompromising code formatter.",
long_description=get_long_description(),
long_description_content_type="text/markdown",
keywords="automation formatter yapf autopep8 pyfmt gofmt rustfmt",
... | Review this code and list any quality issues. | [
{
"issue": "Prefer to do it like in https://github.com/python/typing/commit/f254d69c56920819b4211f47fdaba6472097dc5c",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.results[eventData] = True
if eventName.startswith("AFFILIATE") and not self.opts['checkaffiliates']:
return
if eventName in ['IP_ADDRESS', 'IPV6_ADDRESS']:
blacklist_type = "BLACKLISTED_IPADDR"
malicious_type = 'MALICIOUS_IPADDR'
elif eventName in ['AFF... | Review this code and list any quality issues. | [
{
"issue": "These should be checked for validity.\r\n\r\nSomething like this (depending on how zero is handled).\r\n\r\n```suggestion\r\n risk_score = ip_info.get('score')\r\n if not risk_score:\r\n # this might been the address is not malicious,\r\n # or might mean that the ... | 1 |
python | 'description': 'md5:bc49c6d64d20610ea1e7daf079a0d013',
'thumbnail': r're:^https?://[^?#]+63b39f6b354977084b85ab54',
'ext': 'mp4',
},
}, {
'url': 'https://noticias.canal1.com.co/noticias/tres-i-el-triste-record-que-impuso-elon-musk-el-dueno-de-tesla-y-de-twitter/',
'in... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n self._search_regex(r'\"embedUrl\"\\s*:\\s*\"([^\"]+)', webpage, 'embed url'),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'url': 'https://www.ina.fr/ina-eclaire-actu/video/cpb8205116303/les-jeux-electroniques',
'md5': '4b8284a9a3a184fdc7e744225b8251e7',
'info_dict': {
'id': 'CPB8205116303',
'ext': 'mp4',
'title': 'Les jeux électroniques',
'description': 'md5:e09f7683dad1cc60b... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'ext': {'video': 'mp4', 'audio': 'mp3'}.get(api_response.get('type')),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import ExtractorError
class EbayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ebay\.com/itm/(?P<id>\d+)'
_TEST = {
'url': 'https://www.ebay.com/itm/194509326719',
'info_dict': {
'id': '194509326719',
'ext': 'mp4',
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _TESTS = [{\r\n 'url': 'https://www.ebay.com/itm/194509326719',\r\n 'info_dict': {\r\n 'id': '194509326719',\r\n 'ext': 'mp4',\r\n 'title': 'HELIX upload [AN_Master_A04B.mp4] - 1666069406072',\r\n },\r\n 'params': {'sk... | 1 |
python | data, ytcfg = self._extract_data(url, item_id)
tabs = traverse_obj(data, ('contents', 'twoColumnBrowseResultsRenderer', 'tabs'), expected_type=list)
if tabs:
selected_tab = self._extract_selected_tab(tabs)
selected_tab_name = selected_tab.get('title', '').lower()
req... | Review this code and list any quality issues. | [
{
"issue": "Hmm I wonder if we should raise an error instead of redirecting to the home tab here?\r\n\r\n@pukkandan",
"severity": "minor",
"line": 26
}
] | 1 |
python | R = TypeVar("R")
@overload
def thread_cached(func: Callable[P, Awaitable[R]]) -> Callable[P, Awaitable[R]]: ...
@overload
def thread_cached(func: Callable[P, R]) -> Callable[P, R]: ...
def thread_cached(
func: Callable[P, R] | Callable[P, Awaitable[R]],
) -> Callable[P, R] | Callable[P, Awaitable[R]]:
thr... | Review this code and list any quality issues. | [] | 0 |
python | @define(order=True)
class KedroStarterSpec:
"""Specification of custom kedro starter template
Args:
alias: alias of the starter which shows up on `kedro starter list` and is used
by the starter argument of `kedro new`
template_path: path to a directory or a URL to a remote VCS repository... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if \"KEDRO_STARTERS_VERSION\" not in os.environ:\r\n```\r\n\r\n? (and everywhere else)",
"severity": "minor",
"line": 26
}
] | 1 |
python | CONF_APP_REG_SECRET,
CONF_AUTHORITY_ID,
CONF_USE_QUEUED_CLIENT,
)
_LOGGER = logging.getLogger(__name__)
class AzureDataExplorerClient:
"""Class for Azure Data Explorer Client."""
def __init__(self, data: Mapping[str, Any]) -> None:
"""Create the right class."""
self._database = data... | Review this code and list any quality issues. | [] | 0 |
python | Returns a list of active :class:`Thread` that the client can access.
This includes both private and public threads.
.. versionadded:: 2.0
Raises
------
HTTPException
The request to get the active threads failed.
Returns
--------
List[:class... | Review this code and list any quality issues. | [] | 0 |
python | @monitor_operation(activity_name="pf.runs.list", activity_type=ActivityType.PUBLICAPI)
def list(
self,
max_results: Optional[int] = MAX_RUN_LIST_RESULTS,
*,
list_view_type: ListViewType = ListViewType.ACTIVE_ONLY,
) -> List[Run]:
"""List runs.
:param max_results:... | Review this code and list any quality issues. | [
{
"issue": "Let's make this private now. \r\nBefore we make this public:\r\n- We need to go through some internal review to. \r\n- And we need to also make the pfazure has parity feature.",
"severity": "minor",
"line": 26
}
] | 1 |
python | # A = C * (mp.digamma(C) - mp.digamma(v / 2))
# B = 0.5 * mp.log(v) + mp.log(mp.beta(v / 2, mp.one / 2))
# h = A + B
# return float(h)
assert_allclose(stats.t.entropy(v), ref, rtol=1e-14)
@pytest.mark.parametrize("methname", ["pdf", "logpdf", "cdf",
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n assert_allclose(res[df_infmask], norm_meth(x[df_infmask]), rtol=3e-15)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | ]
document_ids_filter = kwargs.get("document_ids_filter")
if document_ids_filter:
base_must_conditions.append(
models.FieldCondition(
key="metadata.document_id",
match=models.MatchAny(any=document_ids_filter),
)
... | Review this code and list any quality issues. | [
{
"issue": "Splitting the query into all whitespace-separated tokens and issuing one `scroll()` per token can create an unbounded number of Qdrant requests for long user queries (and repeats work when the same keyword appears multiple times). Consider deduplicating keywords and adding a reasonable cap on how ma... | 1 |
python | The `n` largest elements where ``n=3`` with all duplicates kept. Note
that the returned Series has five elements due to the three duplicates.
>>> s.nlargest(3, keep="all")
France 65000000
Italy 59000000
Malta 434000
Maldives 434000
Brunei ... | Review this code and list any quality issues. | [] | 0 |
python | # When there are no triggered agents, build_microagent_info is not called
conversation_memory.prompt_manager.build_microagent_info.assert_not_called()
def test_conversation_memory_processes_microagent_observation(prompt_dir):
"""Test that ConversationMemory processes RecallObservations correctly."""
# Cre... | Review this code and list any quality issues. | [] | 0 |
python | ]
vector_store.add(
embedding_function=embedding_fn3,
embedding_data=texts,
text=texts,
id=ids,
metadata=metadatas,
)
captured = capsys.readouterr()
output = (
f"Dataset(path='{local_path}', tensors=['embedding', 'id', 'metadata', 'text'])\n\n"
"... | Review this code and list any quality issues. | [] | 0 |
python | for urlpattern in tried or ():
patterns = []
for inner_pattern in urlpattern:
wrapper = {"tried": inner_pattern}
if isinstance(inner_pattern, URLResolver):
wrapper["debug_key"] = "namespace"
wrapper["debug_val"] = inner_pattern.namespace
... | Review this code and list any quality issues. | [
{
"issue": "I don't know whether we need to be concerned or not but we could add `urlpatterns_debug` to the context and leave `urlpatterns` alone or make sure that the structure of `urlpatterns` is backwards compatible for if someone was overwriting the `technical_404.html` template",
"severity": "critical"... | 1 |
python | def test_compile():
vllm_config = VllmConfig()
# Default configuration compiles mm encoder
assert vllm_config.compilation_config.compile_mm_encoder
# forked needed to workaround https://github.com/vllm-project/vllm/issues/21073
@pytest.mark.forked
@pytest.mark.skipif(not current_platform.is_cuda(), reason... | Review this code and list any quality issues. | [] | 0 |
python | b'msghand thread start',
b'net thread start',
b'addcon thread start',
]
if self.is_wallet_compiled():
lines_to_terminate_after.append(b'Verifying wallet')
args = ['-txindex=1', '-blockfilterindex=1', '-coinstatsindex=1']
for terminate_line in lines_to... | Review this code and list any quality issues. | [
{
"issue": "any reason to start the node again? Can't this wait_until be done in check_clean_start?",
"severity": "minor",
"line": 26
}
] | 1 |
python | Args:
bundle_name: bundle name.
version: version name of the target bundle, if None, the latest version will be used.
repo: it should be in the form of "repo_owner/repo_name/".
tag: the tag name of the release.
auth_token: github personal access token.
Returns:
a dic... | Review this code and list any quality issues. | [
{
"issue": "Doesn't this break backwards compatibility by changing the function signature too much? Adding new members to the signature was less of an issue but removing them like this is going to change how the function is called on the command line and appear to users when they ask Fire what it is. The value ... | 1 |
python | #"gpt_cond_len": 512,
#"gpt_batch_size": 1,
"enable_text_splitting": False,
"files": ['config.json', 'model.pth', 'vocab.json', 'ref.wav'],
"voices": {
"ClaribelDervla": "Claribel Dervla", "DaisyStudious": "Daisy Studious", "GracieWise": "Gracie Wise",
"Tamm... | Review this code and list any quality issues. | [] | 0 |
python | program_code = self._search_regex(r"const programCode = '(.*?)';", webpage, 'program code')
prod_configure = self._download_webpage(
self.PLAYER_ROOT_URL + self._search_regex(r'<script [^>]*\bsrc="(/statics/js/s_prod[^"]+)"', webpage, 'prod configure page'),
program_code, headers={'Refe... | Review this code and list any quality issues. | [
{
"issue": "`f'{self.PLAYER_ROOT_URL}/'}` , The trailing slash at the end is to ensure the correct Referer and prevent a 403 error.",
"severity": "minor",
"line": 26
}
] | 1 |
python | credentials=kwargs.get('credentials', None),
timeout=kwargs.get('timeout', None),
)
metadata, response = (
await call_result.trailing_metadata(),
await call_result,
)
if response.code == jina_pb2.... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\nmax_attempts: int = 1\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at: [package root]/LICENSE.txt
# Unless required by applicable law or agreed to in writing... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n \"vivisect==1.1.1\",\r\n```",
"severity": "minor",
"line": 25
}
] | 1 |
python | def get_entrypoints(dist: BaseDistribution) -> Tuple[Dict[str, str], Dict[str, str]]:
console_scripts = {}
gui_scripts = {}
for entry_point in dist.iter_entry_points():
if entry_point.group == "console_scripts":
console_scripts[entry_point.name] = entry_point.value
elif entry_poi... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n dest_path = Path(destfile)\r\n parent_dir = dest_path.parent.resolve()\r\n script_name = dest_path.name\r\n```\r\n\r\nAvoid creating the object repeatedly",
"severity": "minor",
"line": 26
}
] | 1 |
python | @wrap_pyvlx_call_exceptions
async def async_open_cover(self, **kwargs: Any) -> None:
"""Open the cover."""
await self.node.open(wait_for_completion=False)
@wrap_pyvlx_call_exceptions
async def async_set_cover_position(self, **kwargs: Any) -> None:
"""Move the cover to a specific pos... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\nclass VeluxDualRollerPart(StrEnum):\n \"\"\"Enum for the parts of a dual roller shutter.\"\"\"\n\n UPPER = \"upper\"\n LOWER = \"lower\"\n DUAL = \"dual\"\n```\nGenerally enums are uppercase",
"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.