language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | Retrieves the theme name for the current user.
"""
user = context["request"].user
theme_name = (
user.wagtail_userprofile.theme
if hasattr(user, "wagtail_userprofile")
else "system"
)
contrast_name = (
user.wagtail_userprofile.contrast
if hasattr(user, "wagtai... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n Retrieves the color-scheme of the active theme for current user.\r\n```\r\n\r\nJust a small typo.",
"severity": "minor",
"line": 26
}
] | 1 |
python | }, {
'url': 'https://naba.lsm.lv/lv/embed/?id=182901&show=0&theme=white&size=16x9',
'only_matching': True,
}, {
'url': 'https://radioteatris.lsm.lv/lv/embed/?id=176439&show=0&theme=white&size=16x9',
'only_matching': True,
}, {
'url': 'https://lr1.lsm.lv/lv/pleijeris/?embe... | Review this code and list any quality issues. | [
{
"issue": "for readability\r\n```suggestion\r\n media_json = self._parse_json(media_data, video_id, transform_source=js_to_json)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # single video example
'url': 'https://cooking.nytimes.com/guides/50-how-to-make-mac-and-cheese',
'md5': '64415805fe0b8640fce6b0b9def5989a',
'info_dict': {
'id': '100000005835845',
'ext': 'mp4',
'title': 'How to Make Mac and Cheese',
'description':... | Review this code and list any quality issues. | [
{
"issue": "we should try to remove any of the fields we're not using for metadata from the query",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.start_node(1, extra_args=self.extra_args[1])
self.connect_nodes(0, 1)
self.sync_all()
# Wallet automatically scans blocks older than key on startup
assert_equal(self.nodes[1].getbalance(), NUM_HD_ADDS + 1)
out = self.nodes[1].rescanblockchain(0, 1)
assert_equal(out['... | Review this code and list any quality issues. | [] | 0 |
python | point1
The first point.
point2
The second point.
Returns
-------
Union[float, np.ndarray]
The midpoint of the points
"""
return center_of_mass([point1, point2])
def line_intersection(
line1: Sequence[np.ndarray], line2: Sequence[np.ndarray]
) -> np.ndarray:
"""... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n The second line segment.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | _VALID_URL = r'https://www\.monstercat\.com/release/(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.monstercat.com/release/742779548009',
'playlist_count': 20,
'info_dict': {
'title': 'The Secret Language of Trees',
'id': '742779548009',
'thumbnail': 'https:/... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'track_number': int_or_none(try_call(lambda: get_element_by_class('py-xsmall', td))),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | self._available = False
@property
def icon(self) -> str:
"""Return the icon."""
if self._target_asset == "EUR":
return "mdi:currency-eur"
if self._target_asset == "GBP":
return "mdi:currency-gbp"
if self._target_asset == "USD":
return "mdi:cur... | Review this code and list any quality issues. | [
{
"issue": "Inconsistent application of maxsplit optimization. The first split on line 294 correctly adds `maxsplit=1`, but the second split should also include it for consistency and performance. Both operations are splitting the same `tracked_asset_pair` format (e.g., \"BTC/USD\") and only need the first spli... | 1 |
python | masked_target[mask] = 0
# reshape the logist and target
# reshape the vocab_logits to [bath_size * seq_len, vocab_size]
# reshape the labels to [bath_size * seq_len]
logits_2d = vocab_logits.view(-1, partition_vocab_size)
masked_target_1d = masked_target.view(-1)
# extr... | Review this code and list any quality issues. | [
{
"issue": "Align this with PyTorch parameter where ignore index is configurable.",
"severity": "minor",
"line": 26
}
] | 1 |
python | },
{
'url': 'https://www.cda.pl/smiechawaTV/folder/2664592/vfilm',
'info_dict': {
'id': '2664592',
'title': 'VideoDowcipy - wszystkie odcinki',
},
'playlist_count': 71,
},
{
'url': 'https://www.cda.pl/Del... | Review this code and list any quality issues. | [
{
"issue": "Lets inline this\r\n```suggestion\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert icom.is_fsspec_url("gs://pandas/somethingelse.com")
# the following is the only remote URL that is handled without fsspec
assert not icom.is_fsspec_url("http://pandas/somethingelse.com")
assert not icom.is_fsspec_url("random:pandas/somethingelse.com")
assert not icom.is_fsspec_url("/local/path")
... | Review this code and list any quality issues. | [
{
"issue": "I could also keep testing this but CPython warns about using `open(..., encoding=None)`: `EncodingWarning: 'encoding' argument not specified`. In this case we *are* explicitly specifying `None` but I don't think CPython can tell the difference.",
"severity": "minor",
"line": 26
}
] | 1 |
python | def visit_Call(self, node):
p = ParseCall()
p.visit(node.func)
ast.NodeVisitor.generic_visit(self, node)
if p.ls[-1] == 'simplefilter' or p.ls[-1] == 'filterwarnings':
if getattr(node.args[0], "value", None) == "ignore":
if not self.__filename.name.startswith... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n```\r\nI'll just apply the deletion.",
"severity": "minor",
"line": 26
}
] | 1 |
python | # The code is left like this to be reused for future deprecations
MIN_SUPPORTED, MIN_RECOMMENDED = (3, 7), (3, 7)
current_version = sys.version_info[:2]
if current_version < MIN_RECOMMENDED:
msg = ('Support for Python version %d.%d has been deprecated. '
'See http... | Review this code and list any quality issues. | [
{
"issue": "This isnt needed imo. The security risk is because servers may allow users to pass arbitrary URLs to yt-dlp. If the server allows arbitrary options, there are other options (like `--exec`) which are far more concerning",
"severity": "critical",
"line": 26
}
] | 1 |
python | if is_last or (page_n > pages_total if pages_total else is_last is not False):
return
def _real_extract(self, url):
channel_name = self._match_id(url)
channel_info = self._download_json(f'{_API_BASE_URL}user/{channel_name}', channel_name)
channel_id = channel_info['id']
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\nclass RokfinSearchIE(SearchInfoExtractor):\r\n IE_NAME = 'rokfin:search'\r\n IE_DESC = 'Rokfin Search'\r\n _SEARCH_KEY = 'rkfnsearch'\r\n\r\n _TYPES = {\r\n 'video': (('id', 'raw'), 'post'),\r\n 'audio': (('id', 'raw'), 'post'),\r\n 'stream': ((\"con... | 1 |
python | """Test that ONNX model saves when input is tuple of tensors"""
class CustomModel(BoringModel):
def forward(self, x, y=None):
return super().forward(x)
def test_onnx_export(model, input_sample):
file_path = os.path.join(tmpdir, "model.onnx")
model.to_onnx(file_path, input_sa... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _assert_onnx_export(model, input_sample)\r\n\r\n # NamedTuple input\r\n input_sample = namedtuple('sample', ['x', 'y'])\r\n input_sample = input_sample(x=torch.randn(1, 32), y=torch.randn(1, 32))\r\n _assert_onnx_export(model, input_sample)\r\n\r\n with pytest.rai... | 1 |
python | # Form / Text / Alignment
# Use #text align to control alignment of text.
# #form
# ---
from h2o_wave import site, ui
text = 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Vel nesciunt ab commodi pariatur fugiat sapiente?'
page = site['/demo']
page['example'] = ui.form_card(
box='1 1 3 7',
items=[... | Review this code and list any quality issues. | [
{
"issue": "Please add a screenshot of this example to `website/docs/examples/assets` to make docs build pass.",
"severity": "minor",
"line": 1
}
] | 1 |
python | def evaluate(
*,
evaluation_name: Optional[str] = None,
target: Optional[Callable] = None,
data: Optional[str] = None,
evaluators: Optional[Dict[str, Callable]] = None,
evaluator_config: Optional[Dict[str, Dict[str, str]]] = {},
azure_ai_project: Optional[Dict] = None,
output_pat... | Review this code and list any quality issues. | [
{
"issue": "Maybe give a better method name. `_rename_columns_conditionally`",
"severity": "minor",
"line": 26
}
] | 1 |
python | conf_path = default_datadir / "bitcoin.conf"
conf_path.write_text(f"datadir={node.datadir_path}\n{conf_text}")
# 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 = no... | Review this code and list any quality issues. | [
{
"issue": "adding negative value to the values makes this test to fail.\r\nshould we also prevent passing negative integers?",
"severity": "critical",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from .youtube import YoutubeIE
from ..utils import parse_iso8601, url_or_none
from ..utils.traversal import traverse_obj
class NerdCubedFeedIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?nerdcubed\.co\.uk/?(?:$|[#?])'
_TEST = {
'url': 'http://www.nerdcubed.co.uk... | Review this code and list any quality issues. | [
{
"issue": "Personally, I'd remove one indentation like:\r\n```suggestion\r\n def _extract_video(self, feed_entry):\r\n return self.url_result(\r\n```\r\n```py\r\n return self.playlist_result(\r\n map(self._extract_video, traverse_obj(feed, ('videos', lambda _, v: v['id']))),\r\n ... | 1 |
python | await async_client.execute_command("SAVE", "DF")
assert await async_client.flushall()
await async_client.execute_command(
"DFLY",
"LOAD",
"tiered-entries-summary.dfs",
)
# Compare captures
assert await DebugPopulateSeeder.capture(async_client) == start_capture
@pytest.mark... | Review this code and list any quality issues. | [
{
"issue": "Spelling error: \"tieried\" should be \"tiered\".",
"severity": "minor",
"line": 26
}
] | 1 |
python | MiniWallet,
)
from test_framework.script_util import valid_witness_malleate_tx
class MempoolWtxidTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = False
def run_test(self):
node = self.nodes[0]
wallet = MiniWallet(node)
... | Review this code and list any quality issues. | [
{
"issue": "d1a2e27: any reason for removing this line? (comment mentions submitting parent to mempool)",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import (
float_or_none,
int_or_none,
js_to_json,
url_or_none,
)
from ..utils.traversal import traverse_obj
class XiaoHongShuIE(InfoExtractor):
_VALID_URL = r'https?://www\.xiaohongshu\.com/explore/(?P<id>[\da-f]+)'
IE_DESC = '小红书'
_TESTS = [{
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\nimport functools\r\n\r\nfrom .common import InfoExtractor\r\n```",
"severity": "major",
"line": 3
}
] | 1 |
python | }
)
return {**token, **new_token}
async def _token_request(self, data: dict) -> dict:
"""Make a token request.
Raises OAuth2TokenRequestError on token request failure.
"""
session = async_get_clientsession(self.hass)
data["client_id"] = self.client_id
... | Review this code and list any quality issues. | [
{
"issue": "Shouldn't we keep checking for the `error` parameter in the response body? After all, that's a required parameter according to the spec:\n\nhttps://www.rfc-editor.org/rfc/rfc6749#section-5.2\n\nI think we can try to include both the error and the error description in the detail. The improvement this... | 1 |
python | return torch.cuda.get_device_properties(device_index).total_memory
def _get_nvml_gpu_id(self, torch_gpu_id):
"""
credit: https://discuss.pytorch.org/t/making-pynvml-match-torch-device-ids-cuda-visible-devices/103020
Remap torch device id to nvml device id, respecting CUDA_VISIBLE_DEVICES.
... | Review this code and list any quality issues. | [] | 0 |
python | def _check_user_info(self, user_info):
if not user_info:
self.report_warning('Unable to extract user info')
elif user_info.get('private') and not user_info.get('followed_by_me'):
raise ExtractorError('This video is private', expected=True)
elif traverse_obj(user_info, 'bl... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n video_set = video_info.get('video_set') or []\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def create_checkpoint_engine(config_params, groups, zero_stage, has_moe_layers, optimize_dp_state):
if config_params is not None:
if config_params.checkpoint_config[CHECKPOINT_WRITER] is not None:
writer_config = config_params.checkpoint_config[CHECKPOINT_WRITER]
dp_writer_config = c... | Review this code and list any quality issues. | [
{
"issue": "Why not\n```suggestion\n from .datastates_checkpoint_engine import DataStatesCheckpointEngine\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | if value is None:
if variable_entity.required:
raise ValueError(f"{variable_entity.variable} is required in input form")
# Use default value and continue validation to ensure type conversion
value = variable_entity.default
# If default is also None, return... | Review this code and list any quality issues. | [] | 0 |
python | def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("alpaca")
class CodeLlamaAdapter(BaseModelAdapter):
"""The model adapter for Code Llama"""
def match(self, model_path: str):
return "codellama" in model_path.lower()
def load_model(self, model_... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n return \"phind-codellama-\" in model_path.lower()\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | _provider_name=self._provider.name,
_provider_url=self._provider.base_url,
_provider_timestamp=first_chunk.create_time,
)
async def _map_messages( # noqa: C901
self, messages: list[ModelMessage], model_request_parameters: ModelRequestParameters
) -> tuple[ContentDict | ... | Review this code and list any quality issues. | [
{
"issue": "We should add `TODO: Remove workaround when <link to my issue comment> is resolved`",
"severity": "minor",
"line": 26
}
] | 1 |
python | video_urls = []
video_files = video.get('video_files')
if isinstance(video_files, list):
video_urls.extend(video_files)
elif isinstance(video_files, dict):
video_urls.extend(video_files.values())
video_urls = list(set(video_urls))
video_prefix = video_u... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n height = int_or_none(list(filesh.keys())[0])\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | ) or
os.path.exists('/dev/nvidiactl') or
os.path.exists('/dev/nvidia0')
)
) or
(
os.name == 'nt' and (
(has_cmd('wmic') and (
'nvidia' in try_cmd(
'wmic... | Review this code and list any quality issues. | [
{
"issue": "File handle is opened but never explicitly closed. This can lead to resource leaks, especially if this code runs frequently or if an exception occurs. Use a context manager (with statement) to ensure the file is properly closed.",
"severity": "major",
"line": 26
}
] | 1 |
python | keepdims: bool = False,
) -> floating: ...
@overload
def matrix_norm(
x: ArrayLike,
/,
*,
ord: float | L["fro", "nuc"] | None = "fro",
keepdims: bool = False,
) -> Any: ...
@overload
def vector_norm(
x: ArrayLike,
/,
*,
axis: None = None,
ord: float | None = 2,
keepdims: boo... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n axis: SupportsInt | SupportsIndex | tuple[int, ...],\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | label = _("Workflow: resume task")
def format_message(self, log_entry):
try:
return _("Resubmitted '%(task)s'. Workflow resumed") % {
"task": log_entry.data["workflow"]["task"]["title"],
}
except (KeyError, TypeError):
... | Review this code and list any quality issues. | [
{
"issue": "Issue: It feels surprising that `OPTIONS` methods aren't handled by the page class at all. Could this be moved into `serve`?",
"severity": "minor",
"line": 26
}
] | 1 |
python | e = SpiderFootEvent(evt, eventData + " [" + site + "]",
self.__name__, event)
self.notifyListeners(e)
pasteData = self.queryPaste(eventData)
if pasteData is None:
return None
sites = {
"Pastebin": "https://pastebin.com... | Review this code and list any quality issues. | [
{
"issue": "Won't `site`' just be the URL of the paste site? It should be the URL of the actual paste itself on that paste site.",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'id': video_id,
'title': title,
'formats': self._extract_png_formats(vidplayer_id),
'is_live': True,
}
class RTVETelevisionIE(InfoExtractor):
IE_NAME = 'rtve.es:television'
_VALID_URL = r'https?://(?:www\.)?rtve\.es/television/[^/]+/[^/]+/(?P<id>\d+).shtml'
_TE... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'series': try_get(info, lambda x: x['programInfo']['title']),\r\n```\r\nor \r\n```py\r\n 'series': traverse_obj(info, ('programInfo', 'title')),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | log = get_logger(__name__)
class TaskCompleter(BaseAgent):
agent_type = "pythagora"
display_name = "Pythagora"
async def run(self) -> AgentResponse:
current_task_index1 = self.current_state.tasks.index(self.current_state.current_task) + 1
self.next_state.action = f"Task #{current_task_ind... | Review this code and list any quality issues. | [
{
"issue": "we should either update how trace_code_event works or add data to each trace. Here are some suggestions of what data might be useful:\r\n- number of epics (is it the initial app or feature?)\r\n- number of all tasks (is it the last task? Could be that we have most iterations on the last task because... | 1 |
python | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none, format_field
class LastFMPlaylistBaseIE(InfoExtractor):
def _entries(self, url, playlist_id):
webpage = self._download_webpage(url, playlist_id)
start_page_number ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n start_page_number = int(self._search_regex(\r\n r'\\bpage=(\\d+)', url, 'page', default=None)) or 1\r\n\r\n last_page_number = int(self._search_regex(\r\n r'>(\\d+)</a>[^<]*</li>[^<]*<li[^>]+class=\"pagination-next', webpage, 'last_page', default... | 1 |
python | },
{
'url': 'https://nekohacker.com/wp-content/uploads/2022/11/04-Crystal-World.mp3',
'md5': 'd8e59a48061764e50d92386a294abd50',
'info_dict': {
'id': '04-Crystal-World',
'ext': 'mp3',
'title': 'Crysta... | Review this code and list any quality issues. | [
{
"issue": "For readability, just use a new variable instead of redefining `webpage` since then the name is no longer accurate\r\n```suggestion\r\n playlist_id = self._match_id(url)\r\n webpage = self._download_webpage(url, playlist_id)\r\n playlist = get_element_by_class('playlist', webpag... | 1 |
python | """Perform Mood's test for equal scale parameters.
Mood's two-sample test for scale parameters is a non-parametric
test for the null hypothesis that two samples are drawn from the
same distribution with the same scale parameter.
Parameters
----------
x, y : array_like
Arrays of sample ... | Review this code and list any quality issues. | [
{
"issue": "Repeating for convenience:\r\n\r\n<img width=\"839\" height=\"140\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e57238d0-8fc0-4ebd-ac83-feea1261314f\" />\r\n\r\nWe calculated $\\phi$ as `phi`, but it has a lot of terms that don't correspond with the $a_i$. There are two reasons it... | 1 |
python | @dataclasses.dataclass
class BasePoTokenPolicy:
required: bool = False
# Try fetch a PO Token even if it is not required.
recommended: bool = False
not_required_for_premium: bool = False
@dataclasses.dataclass
class GvsPoTokenPolicy(BasePoTokenPolicy):
not_required_with_player_token: bool = False
... | Review this code and list any quality issues. | [
{
"issue": "can we pull the `GVS_PO_TOKEN_POLICY` dict out into its own constant (`WEB_GVS_PO_TOKEN_POLICY`?) so that we can use it in `WEB_PO_TOKEN_POLICIES` as well as `web_creator`, `web_music` and `mweb`?",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'release_date': '20230619',
'thumbnail': r're:https://images.vkplay.live/public_video_stream/12279401/preview\?change_time=\d+',
'view_count': int,
'concurrent_view_count': int,
'like_count': int,
'categories': ['EVE Online'],
'live_status': 'is_li... | Review this code and list any quality issues. | [
{
"issue": "`UserNotLive` is more appropriate here, and will allow users to `--wait-for-video`\r\n```suggestion\r\n formats = self._extract_formats(stream_info, username)\r\n if not formats and not traverse_obj(stream_info, ('isOnline', {bool})):\r\n raise UserNotLive(video_id=usern... | 1 |
python | self.stop_node(0)
with self.nodes[0].assert_debug_log(expected_msgs=['SetNetworkActive: false\n']):
self.start_node(0, extra_args=['-nonetworkactive'])
self.stop_node(0)
with self.nodes[0].assert_debug_log(expected_msgs=['SetNetworkActive: false\n']):
self.start_node(0, ... | Review this code and list any quality issues. | [] | 0 |
python | # flags: --minimum-version=3.10 --preview
match 1:
case _ if (True):
pass
match 1:
case _ if (
True
):
pass
# output
match 1:
case _ if True:
pass
match 1:
case _ if True:
pass | Review this code and list any quality issues. | [
{
"issue": "Add tests with a comment inside the parentheses in various places",
"severity": "minor",
"line": 10
}
] | 1 |
python | pa_version_under14p0 = _palv < Version("14.0.0")
pa_version_under14p1 = _palv < Version("14.0.1")
pa_version_under15p0 = _palv < Version("15.0.0")
pa_version_under16p0 = _palv < Version("16.0.0")
pa_version_under17p0 = _palv < Version("17.0.0")
pa_version_under18p0 = _palv < Version("18.0.0")
pa... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\ndef _safe_fill_null(arr: pa.Array, fill_value) -> pa.Array:\n```\n\nMaybe? that solves the typing error",
"severity": "minor",
"line": 26
}
] | 1 |
python | self,
point: typing.Iterable[typing.Union[float, int]],
) -> float:
"""Returns the proportion along the path of the :class:`VMobject`
a particular given point is at.
Parameters
----------
point (typing.Iterable[float])
The Cartesian coordinates of the poi... | Review this code and list any quality issues. | [
{
"issue": "Please rename to `num_curves` as `nc` isn't a very descriptive name",
"severity": "minor",
"line": 26
}
] | 1 |
python | VGroup(dl, sl).arrange(DOWN).shift(2*LEFT)
VGroup(dr, sr).arrange(DOWN).shift(2*RIGHT)
self.add(dl, dr)
self.wait()
self.play(
ClockwiseTransform(dl, sl),
Transform(dr, sr)
)
self.wai... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n \"\"\"Transforms the points of a mobject along a counterclockwise oriented arc.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | logger.debug(
"Key %s already in cache, skipping store", str(key)
)
continue
start = idx * self.chunk_size
end = start + self.chunk_size
slot_mapping = slot_mapping_tensor[start:end]
... | Review this code and list any quality issues. | [
{
"issue": "supposed to record twice here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | {
"grant_type": "refresh_token",
"client_id": self.client_id,
"refresh_token": token["refresh_token"],
}
)
except ClientResponseError as err:
# I have doubts if this is right exception to raise here. Let's find o... | Review this code and list any quality issues. | [
{
"issue": "Retry should be handled by the integration that initiated the token request.",
"severity": "minor",
"line": 26
}
] | 1 |
python | return self.async_show_form(
step_id="user",
data_schema=STEP_USER_DATA_SCHEMA,
errors=errors,
)
async def async_step_reauth(
self, entry_data: Mapping[str, Any]
) -> ConfigFlowResult:
"""Perform reauthentication upon an API authentication error."""
... | Review this code and list any quality issues. | [
{
"issue": "use \n```\nawait self.async_set_unique_id(\nself._abort_if_unique_id_mismatch\n```\npattern here, you can also check the `self.source` (`SOURCE_USER`/`SOURCE_REAUTH`) in your validation method if that helps",
"severity": "critical",
"line": 26
}
] | 1 |
python | )
self.write_error(500, message="Error occurred deleting role: " + str(e))
return
# if here, role has been successfully deleted
arn = f"arn:aws:iam::{account_id}:role/{role_name}"
await aws.fetch_iam_role(account_id, arn, force_refresh=True)
response_json = {
... | Review this code and list any quality issues. | [
{
"issue": "This will bypass XSRF checking. is this intended?",
"severity": "minor",
"line": 26
}
] | 1 |
python | "cassandra",
"azure",
"redis",
"sqlite3",
"neo4j",
"duckdb",
"opensearchpy",
"supabase",
# Dataframe Libraries:
"polars",
"dask",
"vaex",
"modin",
"pyspark",
"cudf",
"xarray",
"ray",
"geopandas",
"mars",
"tables",
"zarr",
"datasets",
... | Review this code and list any quality issues. | [
{
"issue": "The library 'mistralai' appears twice in the list - once at line 97 and again at line 155. This duplicate entry should be removed.",
"severity": "major",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from ..utils import extract_attributes
class NTSLiveIE(InfoExtractor):
IE_NAME = 'nts.live'
_VALID_URL = r'https?://(?:www\.)?nts\.live/shows/[^/]+/episodes/(?P<id>[^./?#]+)'
_TESTS = [
{
# embedded soundcloud
'url': 'https://www.nts.live/s... | Review this code and list any quality issues. | [
{
"issue": "Updated imports\r\n```suggestion\r\nfrom .common import InfoExtractor\r\nfrom ..utils import parse_iso8601, url_or_none\r\nfrom ..utils.traversal import traverse_obj\r\n```",
"severity": "major",
"line": 2
}
] | 1 |
python | 'title': '11 - Kryptographie - 24.11.2015',
'thumbnail': r're:^https?://.*\.jpg$',
'timestamp': 1606208400,
'upload_date': '20201124',
},
}
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
host = mobj.group('host')
video_id ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n return self._parse_mediapackage(video)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | user=task.user,
table=task.table,
password=task.password)
# Check if the `S3CopyToTable.s3_load_path` class attribute was
# successfully referenced in the `S3CopyToTable.run` method, which is
# in-tu... | Review this code and list any quality issues. | [] | 0 |
python | "https://*.streamlitapp.test",
"https://*.streamlitapp.com",
"https://*.streamlit.run",
"https://*.demo.streamlit.app",
"https://*.head.streamlit.app",
"https://*.staging.streamlit.app",
"https://*.streamlit.app",
]
class AllowedMessageOriginsHandler(_SpecialRequestHandler):
async def get(... | Review this code and list any quality issues. | [
{
"issue": "nit: I think it should be okay to remove this and allow the `/_stcore/health` endpoint be reponsible for setting the browser tab's xsrf",
"severity": "major",
"line": 26
}
] | 1 |
python | from test_framework.util import (
assert_equal,
assert_raises_rpc_error
)
class ReorgsRestoreTest(BitcoinTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)
def set_test_params(self):
self.num_nodes = 3
def skip_test_if_missing_module(self):
... | Review this code and list any quality issues. | [
{
"issue": "Might be in the nit-land but I find reading `25` here distracting. I had to figure out why it's 25 that is because in regtest the subsidy halving interval is 150 and initially a 199 blocks long chain is created in the regtest. The block count at this stage is 215 which is because few blocks were cre... | 1 |
python | from typing import Dict, Optional, Union
from consoleme_default_plugins.plugins.metrics.base_metric import Metric
class DefaultMetric(Metric):
def count(self, metric_name, tags=None):
# TODO(ccastrapel): Having Cloudwatch, Graphite, or other configurtable default metric sources here would be a
# ... | Review this code and list any quality issues. | [] | 0 |
python | LMHarnessTaskParams,
)
from oumi.evaluation.alpaca_eval import evaluate as evaluate_alpaca_eval
from oumi.evaluation.lm_harness import evaluate as evaluate_lm_harness
from oumi.evaluation.platform_prerequisites import check_prerequisites
def evaluate(config: EvaluationConfig) -> list[dict[str, Any]]:
"""Evaluates... | Review this code and list any quality issues. | [] | 0 |
python | ],
workflow="train",
logging_file=_logging_file,
tracking="mlflow",
tracking_uri=path_to_uri(_data_dir) + "/mlflow_1",
experiment_name="monai_eval1",
),
"config_filters_filename": os.path.join(_data_dir, "config_fl_filters.json"),
}
]
TEST_... | Review this code and list any quality issues. | [] | 0 |
python | if callable(self.on_bad_lines):
new_l = self.on_bad_lines(_content)
if new_l is not None:
# Truncate extra elements and warn.
new_l = cast(list[Scalar], new_l)
if len(new_l) > col_len:
... | Review this code and list any quality issues. | [
{
"issue": "This block handles the case of warn and skip, and on L1217 the bad line is being appended. So the comment seems incorrect.",
"severity": "critical",
"line": 26
}
] | 1 |
python | progress_bar = tqdm(
total=total_frames,
disable=not show_progress,
desc=progress_message,
)
exception_in_worker: Exception | None = None
read_finished = False
try:
while True:
read_item = frame_read_queue.get()
... | Review this code and list any quality issues. | [
{
"issue": "The variable `processed_frame` is only assigned inside the try block. If an exception occurs before it's assigned (which is the purpose of this exception handling), the code at line 322 would reference an undefined variable, causing a NameError. However, since line 320 breaks out of the loop when an... | 1 |
python | NiconicoUserIE,
NiconicoSeriesIE,
NiconicoHistoryIE,
NicovideoSearchDateIE,
NicovideoSearchIE,
NicovideoSearchURLIE,
NicovideoTagURLIE,
)
from .ninecninemedia import (
NineCNineMediaIE,
CPTwentyFourIE,
)
from .ninegag import NineGagIE
from .ninenow import NineNowIE
from .nintendo import ... | Review this code and list any quality issues. | [] | 0 |
python | },
]
@classmethod
def suitable(cls, url):
return (
False
if BandcampAlbumIE.suitable(url)
or BandcampIE.suitable(url)
or BandcampWeeklyIE.suitable(url)
else super(BandcampUserIE, cls).suitable(url)
)
def _real_extract(self, ur... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if discography_data:\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | yield quality_str, url
encrypted_data.read(4) # CRC
@staticmethod
def _get_url(alphabet, url_data):
url = ''
f = 0
e = 3
b = 1
for letter in url_data.decode('iso-8859-1'):
if f == 0:
l = int(letter) * 10
f = 1
... | Review this code and list any quality issues. | [
{
"issue": "Let's keep the code english\r\n```suggestion\r\n def _get_alphabet(alphabet_data):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'youtube_include_hls_manifest': opts.youtube_include_hls_manifest,
'encoding': opts.encoding,
'extract_flat': opts.extract_flat,
'live_from_start': opts.live_from_start,
'wait_for_video': opts.wait_for_video,
'mark_watched': opts.mark_watched,
'merge_output_format': opts.... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'plugin_dirs': opts.plugin_dirs,\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert {"name": info["walletname"]} in walletdir_list["wallets"]
# Check backup existence and its non-empty wallet filename
backup_filename = f"default_wallet_{curr_time}.legacy.bak"
backup_path = self.master_node.wallets_path / backup_filename
assert backup_path.exists()
assert... | Review this code and list any quality issues. | [
{
"issue": "In c95b1121809e50322b4bf7fd7868e8d0f2a96199:\r\nthis should be:\r\n```\r\nassert_raises_rpc_error(-4, \"Failed to create database\", self.migrate_and_get_rpc, \"\")\r\n```\r\n\r\nAlso, should pull https://github.com/bitcoin/bitcoin/pull/34221/commits/cbf0bd35bbf312f3b13d92d281d7112e4b43b9c3 from #34... | 1 |
python | def test_flow_load_invalid(self, kwargs, error_message, exception_type):
with pytest.raises(exception_type) as e:
load_flow(**kwargs)
assert error_message in str(e.value)
def test_multiple_flow_load(self):
with pytest.raises(ValidationException) as e:
load_flow(EAGE... | Review this code and list any quality issues. | [
{
"issue": "what's the error message if we passed a folder without yaml in it here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | _TESTS = [{
'url': 'https://cu.tbs.co.jp/program/23601',
'playlist_mincount': 4,
'info_dict': {
'id': '23601',
'categories': ['エンタメ', 'ミライカプセル', '会社', '働く', 'バラエティ', '動画'],
'description': '幼少期の夢は大人になって、どう成長したのだろうか?\nそしてその夢は今後、どのように広がっていくのか?\nいま話題の会社で働く人の「夢の成長」... | Review this code and list any quality issues. | [
{
"issue": "not really necessary but we can make sure we're getting a list\r\n```suggestion\r\n 'categories': ('keywords', ...),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | if not skip_rendering and not self.skip_animation_preview:
self.renderer.render(self, t, self.moving_mobjects)
if self.stop_condition is not None and self.stop_condition():
self.time_progression.close()
break
for animation in self.animations:
... | Review this code and list any quality issues. | [
{
"issue": "Oh, i forgot to comment this in the review: is this change safe?",
"severity": "minor",
"line": 26
}
] | 1 |
python | """
msg = f"get_point_mobject not implemented for {self.__class__.__name__}"
raise NotImplementedError(msg)
def align_points(self, mobject):
count1 = self.get_num_points()
count2 = mobject.get_num_points()
if count1 < count2:
self.align_points_with_larger(mobject... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n def null_point_align(self, mobject: \"Mobject\") -> \"Mobject\":\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .magentamusik import MagentaMusikIE
from .mailru import (
MailRuIE,
MailRuMusicIE,
MailRuMusicSearchIE,
)
from .mainstreaming import MainStreamingIE
from .mangomolo import (
MangomoloLiveIE,
MangomoloVideoIE,
)
from .manoto import (
ManotoTVIE,
ManotoTVLiveIE,
ManotoTVShowIE,
)
from... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\nfrom .mave import (\r\n MaveChannelIE,\r\n MaveIE,\r\n)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | timeout = settings.ANSIBLE_FACT_CACHE_TIMEOUT
last_write_time = None
for host in hosts:
hosts_cached.append(host.name)
if not host.ansible_facts_modified or (timeout and host.ansible_facts_modified < now() - datetime.timedelta(seconds=timeout)):
continue # facts are expired - do n... | Review this code and list any quality issues. | [
{
"issue": "From the failures, it looks like other locations are still expecting a return of a tuple. So your change just needs to be propogated.\r\n\r\nI fully agree with changing the return type of this. It won't be expected to return anything after this. That change just needs to be propagated to the callers... | 1 |
python | class ReactivePowerConverter(BaseUnitConverter):
"""Utility to convert reactive power values."""
UNIT_CLASS = "reactive_power"
_UNIT_CONVERSION: dict[str | None, float] = {
UnitOfReactivePower.MILLIVOLT_AMPERE_REACTIVE: 1 * 1000,
UnitOfReactivePower.VOLT_AMPERE_REACTIVE: 1,
UnitOfRe... | Review this code and list any quality issues. | [
{
"issue": "I would prefer to use the same pattern as `CarbonMonoxideConcentrationConverter`, with `_OZONE_MOLAR_MASS` defined as a top-level constant\r\n\r\n```suggestion\r\n CONCENTRATION_MICROGRAMS_PER_CUBIC_METER: (\r\n _OZONE_MOLAR_MASS / _AMBIENT_IDEAL_GAS_MOLAR_VOLUME * 1e6\r\n )... | 1 |
python | ax.set_title(f"{name}\nEvaluation in {elapsed_time:.2f} seconds")
for name, score in scores.items():
ax.plot([], [], " ", label=f"{name}: {score}")
ax.legend(loc="upper left")
plt.suptitle("Prediction errors of base versus stacked predictors", y=1)
plt.tight_layout()
plt.subplots_adjust(top=0.9)
plt.s... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n# useful signal once those two are included; with\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def _real_extract(self, url):
video_id = urllib.parse.unquote(self._match_id(url))
webpage = self._download_webpage(url, video_id)
data = self._search_json(
r'window\.ltvEmbedPayload\s*=', webpage, 'embed json', video_id)
embed_type = traverse_obj(data, ('source', 'name', {st... | Review this code and list any quality issues. | [
{
"issue": "The other PR made this new path segment optional. Does the old URL format redirect to the new one? Or please explain",
"severity": "minor",
"line": 26
}
] | 1 |
python | _scp_targets_account_or_ou(fake_scp, "100", fake_ous)
)
self.assertFalse(result)
def test_fetch_managed_policy_details(self):
from consoleme.config import config
from consoleme.lib.aws import fetch_managed_policy_details
loop = asyncio.get_event_loop()
result = loo... | Review this code and list any quality issues. | [] | 0 |
python | if initial_zero_point < qmin:
nudged_zero_point = qmin
elif initial_zero_point > qmax:
nudged_zero_point = qmax
else:
nudged_zero_point = torch.round(initial_zero_point)
return scale, nudged_zero_point
def get_bits_length(config, quant_type):
if isinstance(config["quant_bits"]... | Review this code and list any quality issues. | [
{
"issue": "please add a ut for this quantizer",
"severity": "minor",
"line": 26
}
] | 1 |
python | Authenticated git URL if credentials are available, otherwise regular HTTPS URL
"""
try:
repository = await self.verify_repo_provider(
repo_name, is_optional=is_optional
)
except AuthenticationError:
raise Exception('Git provider authentication... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n allow_insecure = bool(os.environ.get('ALLOW_INSECURE_GIT_ACCESS', False))\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def as_xy_int_tuple(self) -> Tuple[int, int]:
return int(self.x), int(self.y)
def as_xy_float_tuple(self) -> Tuple[float, float]:
return self.x, self.y
@dataclass
class Vector:
start: Point
end: Point
def is_in(self, point: Point) -> bool:
v1 = Vector(self.start, self.end)
... | Review this code and list any quality issues. | [
{
"issue": "There are a few things I would like to address.\r\n\r\n1. We generally require function/methods arguments and results to be documented in docstring. This docstring is later used to generate our documentation website automatically. \r\n2. Secondly, we already have [`is_in`](https://github.com/roboflo... | 1 |
python | if isinstance(e, Boolean):
return e
raise TypeError('expecting bool or Boolean, not `%s`.' % e)
@sympify_method_args
class Boolean(Basic):
"""A Boolean object is an object for which logic operations make sense."""
__slots__ = ()
kind = BooleanKind
if TYPE_CHECKING:
from sympy.se... | Review this code and list any quality issues. | [
{
"issue": "This overload over here is redundant, I added it while trying to type `reps` strictly. I'll remove this and push along with fixes you suggest ( if any ).",
"severity": "major",
"line": 26
}
] | 1 |
python | async def _token_request(self, data: dict) -> dict:
"""Make a token request.
Raises OAuth2TokenRequestError on token request failure.
"""
session = async_get_clientsession(self.hass)
data["client_id"] = self.client_id
if self.client_secret:
data["client_secr... | Review this code and list any quality issues. | [
{
"issue": "Maybe set the body to an empty string here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | is_secure = bool(flags & 0x0001)
p.skip(4, 'unknown record field 2')
domain_offset = p.read_uint()
name_offset = p.read_uint()
path_offset = p.read_uint()
value_offset = p.read_uint()
p.skip(8, 'unknown record field 3')
expiration_date = _mac_absolute_time_to_posix(p.read_double())
_crea... | Review this code and list any quality issues. | [] | 0 |
python | If tap offload features are not configured, an attempt to send a message will fail with EIO "Input/output error".
More info (search for "TUN_F_CSUM is a must"): https://blog.cloudflare.com/fr-fr/virtual-networking-101-understanding-tap/
"""
vm = uvm_any
port = "81"
out_filename = "/tmp/out.txt"
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n for attempt in Retrying(\r\n stop=stop_after_attempt(10),\r\n wait=wait_fixed(0.1),\r\n reraise=True,\r\n ):\r\n with attempt: \r\n ret = vm.ssh.check_output(f\"sync; cat {out_filename}\")",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'thumbnail': 'http://cfvod.kaltura.com/p/1719221/sp/171922100/thumbnail/entry_id/1_anruz3wy/version/100031',
'duration': 1930,
},
'params': {
'skip_download': True,
},
}, {
'url': 'https://www.telebaern.tv/telebaern-news/montag-1-oktober-2018-ganze-sendung-133... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n entry_id = traverse_obj(data, (\r\n lambda _, v: v['__typename'] == 'KalturaData', 'kalturaId', any, {require('kaltura id')}))\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
items = []
accounts_d = async_to_sync(get_account_id_to_name_mapping)()
cloudtrail_errors = {}
cloudtrail_errors_j = red.get(
config.get(
"celery.cache_cloudtrail_errors_by_arn.redis_key",
"CLOUDTRAIL_ERRORS_BY_ARN",
)
)
if cloudtrail_errors_j:
... | Review this code and list any quality issues. | [
{
"issue": "I think this should have a default value to prevent a json loading error, ie:\r\n\r\n`ujson.loads(role_details.get(\"policy\", {))`",
"severity": "minor",
"line": 26
}
] | 1 |
python | return RGBColorState.YELLOW
if 90 < hue <= 160:
return RGBColorState.GREEN
if 150 < hue <= 210:
return RGBColorState.TURQUOISE
if 210 < hue <= 270:
return RGBColorState.BLUE
if 270 < hue <= 330:
return RGBColorState.PURPLE
return RGBColorState.RED
class HomematicipO... | Review this code and list any quality issues. | [
{
"issue": "1. What is `on` and `off` for effect?\n2. Also, what does this resolve to? Because ideally these are lowercase and snake_case, so we can translate them via a translation key (would be cool to have here as well)",
"severity": "minor",
"line": 26
}
] | 1 |
python | "developed by DeepSeek Company, and you only answer questions related to computer science. "
"For politically sensitive questions, security and privacy issues, "
"and other non-computer science questions, you will refuse to answer.\n"
),
)
_register_template(
name="default",
format_user=St... | Review this code and list any quality issues. | [
{
"issue": "duplicate new line, remove format_assistant",
"severity": "major",
"line": 26
}
] | 1 |
python | storage_options: StorageOptions | None = None,
if_sheet_exists: ExcelWriterIfSheetExists | None = None,
engine_kwargs: dict[str, Any] | None = None,
**kwargs,
) -> None:
# Use the xlsxwriter module as the Excel writer.
from xlsxwriter import Workbook
engine_kwargs = ... | Review this code and list any quality issues. | [
{
"issue": "i removed `type: ignore` as it was showing ci check fail.",
"severity": "critical",
"line": 26
}
] | 1 |
python | class SmartTubPump(SmartTubEntity, SwitchEntity):
"""A pump on a spa."""
def __init__(
self, coordinator: DataUpdateCoordinator[dict[str, Any]], pump: SpaPump
) -> None:
"""Initialize the entity."""
super().__init__(coordinator, pump.spa, "pump")
self.pump_id = pump.id
... | Review this code and list any quality issues. | [
{
"issue": "Could we make this translatable?",
"severity": "minor",
"line": 26
}
] | 1 |
python | from urllib.request import * # noqa: F403
from .. import compat_os_name
from ..compat_utils import passthrough_module
import sys
passthrough_module(__name__, 'urllib.request')
del passthrough_module
if compat_os_name == 'nt':
# On older python versions, proxies are extracted from Windows registry erroneously. [... | Review this code and list any quality issues. | [
{
"issue": "I think it makes sense to start with lowest version and always use `<=`/`<`\r\n```suggestion\r\n (3, 9, 13) <= sys.version_info < (3, 10) # https://docs.python.org/3.9/whatsnew/changelog.html#python-3-9-13-final\r\n or (3, 10, 5) <= sys.version_info # https://docs.python.org/... | 1 |
python | 'info_dict': {
'id': 'jetlag_14',
},
'playlist_mincount': 8,
}]
def _entries(self, data):
base_url = 'https://nebula.tv'
for episode in traverse_obj(data, ('episodes')):
episode_id = traverse_obj(episode, ('video', 'id'))
metadata = self._extr... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n series, season_id = self._match_valid_url(url).group('series', 'season_number')\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | worker_id = kwargs['worker']
batched_params, _ = self._state.get_batcher(worker_id, family)
if batched_params:
unbatched_params = {
param: value
for param, value in six.iteritems(params)
if param not in batched_params
}
else... | Review this code and list any quality issues. | [
{
"issue": "The parameter name `message` maybe be should be renamed to `content` or `payload` throughout to make it easier to follow. I at least got confused that `message` became `content` in the scheduler.",
"severity": "minor",
"line": 26
}
] | 1 |
python | def _perform_login(self, username, password):
captcha = self._download_json(
'https://www.reddit.com/api/requires_captcha/login.json', None,
'Checking login requirement')['required']
if captcha:
raise ExtractorError('Reddit is requiring captcha before login', expected... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n options = traverse_obj(self._get_cookies('https://www.reddit.com/'), (\r\n '_options', 'value', {urllib.parse.unquote}, {json.loads}, {dict})) or {}\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | ``(0, 0, 0)`` if we find a nontrivial divisor of ``n``.
Examples
========
>>> from sympy.ntheory.primetest import _lucas_extrastrong_params
>>> _lucas_extrastrong_params(101)
(12, 4, 1)
>>> _lucas_extrastrong_params(15)
(0, 0, 0)
References
==========
.. [1] OEIS A217719: Extr... | Review this code and list any quality issues. | [
{
"issue": "The main thing to do here is to add an explicit type annotations to the functions rather than adding code so that a type checker infers the types.",
"severity": "minor",
"line": 26
}
] | 1 |
python | # what data to be loaded from data source
# For IDE auto-completion.
self.instruments = instruments
self.start_time = start_time
self.end_time = end_time
self.fetch_orig = fetch_orig
if init_data:
with TimeInspector.logt("Init data"):
self.set... | Review this code and list any quality issues. | [
{
"issue": "`**kwargs` should be used to tell if user are config `start_time` to None or don't want to config the setting.",
"severity": "minor",
"line": 26
}
] | 1 |
python | is_neox_style: bool,
dtype: torch.dtype,
):
super().__init__(
head_size, rotary_dim, max_position_embeddings, base, is_neox_style, dtype
)
def _compute_inv_freq(self, base: float) -> torch.Tensor:
inv_freqs = super()._compute_inv_freq(base)
inv_freqs = inv_fr... | Review this code and list any quality issues. | [] | 0 |
python | camera_lookat=(0.0, 0.0, 0.5),
camera_fov=40,
),
show_viewer=args.vis,
rigid_options=gs.options.RigidOptions(
# constraint_solver=gs.constraint_solver.Newton,
),
show_FPS=False,
)
########################## entities ##########################
... | Review this code and list any quality issues. | [
{
"issue": "The parameter 'data_part' is not used in the function. Consider removing it to simplify the function signature or update the function to utilize it if necessary.\n```suggestion\ndef run(gpu_id, func):\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | threading.Thread(target=_telemetry, daemon=True).start()
_DEFAULT_GRPC_OPTION = [
('grpc.max_send_message_length', -1),
('grpc.max_receive_message_length', -1),
# for the following see this blog post for the choice of default value https://cs.mcgill.ca/~mxia3/2019/02/23/Using-gRPC-in-Production/
('grp... | Review this code and list any quality issues. | [
{
"issue": "Shouldn't this also be filled with all options in `_DEFAULT_GRPC_OPTION` that are not given in `option_from_args`? Right now it looks like as soon as the user specifies one option in `option_from_args`, all of our defaults will be ignored.",
"severity": "minor",
"line": 26
}
] | 1 |
python | }]
def _real_extract(self, url):
video_id = self._match_id(url)
base_id, ac_idx = self._search_regex(r'(?P<id>aa[_\d]+)(?:\?ac=(?P<ac_idx>\d+))?', video_id,
'ac_idx_parse', group=['id', 'ac_idx']) or (None, None)
if base_id is not None:
... | Review this code and list any quality issues. | [
{
"issue": "```py\r\n season_number = season_id and next((...))\r\n```\r\nsame below",
"severity": "minor",
"line": 26
}
] | 1 |
python | from backend.util.workspace_storage import shutdown_workspace_storage
try:
future = asyncio.run_coroutine_threadsafe(
shutdown_workspace_storage(), self.execution_loop
)
future.result(timeout=5)
except Exception as e:
logger.warning(f"[CoP... | Review this code and list any quality issues. | [] | 0 |
python | @overload
def sort(
a: _ArrayT,
axis: SupportsIndex = -1,
kind: _SortKind | None = None,
order: str | Sequence[str] | None = None,
endwith: bool | None = True,
fill_value: _ScalarLike_co | None = None,
*,
stable: Literal[False] | None = False,
) -> _ArrayT: ...
@overload
def sort(
a:... | Review this code and list any quality issues. | [
{
"issue": "there are some edge-cases related to overloads and protocols where this can matter\r\n\r\n```suggestion\r\ndef compressed(x: ArrayLike) -> ndarray[tuple[int], dtype[Any]]: ...\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.