language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | 'id': '471591',
'ext': 'mp4',
'title': 'md5:e8fbb8de57011a3255db0beca69af73d',
'creator': 'Giuseppe Di Leo',
'location': 'Napoli',
'timestamp': 1460044800.0,
'upload_date': '20160407',
'description': 'md5:5e15a789a2fe4d67da8d1366996e89e... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n formats, subtitles = self._extract_m3u8_formats_and_subtitles(\r\n video_info['playlist'][0]['sources'][0]['src'], video_id)\r\n```",
"severity": "major",
"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 | import logging
import contextlib
from typing import List, Tuple, Iterator
import ghidra
import capa.features.extractors.ghidra.global_
from capa.features.common import Feature
from capa.features.address import Address, AbsoluteVirtualAddress
from capa.features.extractors.base_extractor import FeatureExtractor
curren... | Review this code and list any quality issues. | [] | 0 |
python | # re-enable previous widget and show event to allow it to update state if needed (e.g. refresh after settings change)
prev_widget = self._nav_stack.widgets[-2]
print('Re-enabling and show_event for', prev_widget.__class__.__name__)
# prev_widget.show_event()
prev_widget.set_enabled(True)
print('Pop... | Review this code and list any quality issues. | [
{
"issue": "The block that returns the active widget appears to be accidentally indented inside `pop_widget` (likely leftover from a commented-out `get_active_widget` method). As written, `pop_widget` will return the current top widget/None after popping, and the intended `get_active_widget` API doesn't exist. ... | 1 |
python | coinbase.deserialize(coinbase_data)
assert_equal(coinbase.vin[0].prevout.hash, 0)
self.log.debug("Wait for a new template")
waitoptions = self.capnp_modules['mining'].BlockWaitOptions()
waitoptions.timeout = timeout
waitoptions.feeThreshold... | Review this code and list any quality issues. | [
{
"issue": "In https://github.com/bitcoin/bitcoin/commit/fac12f7cf9ebc0b906bbb20ae126cf7e7552fdbb _test: fix interface_ipc.py template destruction_: similar to my comment above, this only shows that `waitNext()` returns immediately if fees have gone up before the call, but the original intent was to show that a... | 1 |
python | 'url': 'https://www.pornflip.com/embed/bLcDFxnrZnU',
'only_matching': True,
},
]
_HOST = 'www.pornflip.com'
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(
'https://{}/sv/{}'.format(self._HOST, video_id), video_i... | Review this code and list any quality issues. | [
{
"issue": "`age_limit` must be set of NSFW websites",
"severity": "minor",
"line": 26
}
] | 1 |
python | os.remove("app.zip")
@app('/ide', on_startup=on_startup, on_shutdown=on_shutdown)
async def serve(q: Q):
if not q.app.initialized:
# Prod.
if os.path.exists('base-snippets.json') and os.path.exists('component-snippets.json'):
q.app.snippets1, q.app.snippets2, = await q.site.upload(['bas... | Review this code and list any quality issues. | [
{
"issue": "Can we do something more general like\r\n```suggestion\r\n elif q.args.dropdown:\r\n q.user.view = q.args.dropdown\r\n q.page['header'].items[3].dropdown.value = q.args.dropdown\r\n```\r\n\r\nWould require changing elifs to ifs though.",
"severity": "minor",
"line": 26
}
] | 1 |
python | except StopIteration:
txn = None
if expected['transaction'] is None:
self.assertIsNone(txn)
else:
self.assertIsNotNone(txn)
for key, value in expected['transaction'].items():
self.assertEquals(value, txn[key])
... | Review this code and list any quality issues. | [
{
"issue": "It looks like the only thing we use this for is `self.minutes[0]`. Do we need the whole minutes array?",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
@dataclass
class BatchInfo:
"""
Information to be passed and used for a batch of sequences.
"""
max_batch_size: int
kv_max_split_num: int
num_heads: int
head_dim: int
sequences_set: OrderedSet[Sequence] = None
is_prompts: bool = True
device: torch.device = None
dtype: to... | Review this code and list any quality issues. | [
{
"issue": "Post init seems to be redundant here. You could just set the default values.",
"severity": "minor",
"line": 26
}
] | 1 |
python | - :class:`~oumi.core.configs.judge_config.JudgeConfig`
- :class:`~oumi.core.configs.judge_config.JudgeAttribute`
- :class:`~oumi.core.configs.judge_config.JudgeAttributeValueType`
- :class:`~oumi.core.configs.judge_config_v2.JudgeConfig`
- :class:`~oumi.core.configs.params.judge_params.JudgeOutputType`
... | Review this code and list any quality issues. | [
{
"issue": "This should be plural, \"Params\". See our naming conventions here: https://github.com/oumi-ai/oumi/tree/main/src/oumi/core/configs/params",
"severity": "minor",
"line": 26
}
] | 1 |
python | except Exception as e: # pragma: no cover
_warn(
f"Exception raised in '{lib_name}.get_data({lib_name}, payload, {user_var_name}, value)'", # noqa: E501
e,
)
if not isinstance(ret_payloa... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if page_path in [\"/\", \"\"]:\r\n```\r\nMore efficient don't you think?",
"severity": "major",
"line": 26
}
] | 1 |
python | Sample weights.
Returns
-------
fps : ndarray of shape (n_thresholds,)
A count of false positives, at index i being the number of negative
samples assigned a score >= thresholds[i]. The total number of
negative samples is equal to fps[-1] (thus true negatives are given by
fp... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n >>> fps, tps, thresholds = binary_classification_curve(y_true, y_scores)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
transport_manager_info[transport_name] = TransportManagerInfo(
transport_manager_class, devices
)
if transport_name not in DEFAULT_TRANSPORTS:
has_custom_transports = True
DEFAULT_TRANSPORTS = ["NIXL", "GLOO", "NCCL", "CUDA_IPC"]
register_tensor_transport("NIXL", ["cuda", "cpu"], Nixl... | Review this code and list any quality issues. | [] | 0 |
python | open(f())
open(b"foo")
byte_str = b"bar"
open(byte_str)
def bytes_str_func() -> bytes:
return b"foo"
open(bytes_str_func())
# https://github.com/astral-sh/ruff/issues/17693
os.stat(1)
os.stat(x)
def func() -> int:
return 2
os.stat(func())
def bar(x: int):
os.stat(x)
# https://github.com/astral-sh/ru... | Review this code and list any quality issues. | [] | 0 |
python | 'description': self._og_search_description(webpage),
'uploader': uploader,
'view_count': int_or_none(view_count),
'average_rating': float_or_none(average_rating),
'thumbnail': self._og_search_thumbnail(webpage),
'formats': formats,
'duration': None... | Review this code and list any quality issues. | [
{
"issue": "any reason this isnt just\r\n```suggestion\r\n if meta.get('premium') and not meta.get('premium_free'):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | Raises
------
:exc:`ValueError`
If ``point`` does not lie on the curve.
:exc:`Exception`
If the :class:`VMobject` has no points.
"""
self.throw_error_if_no_points()
nc = self.get_num_curves()
vmob_length = sum(self.get_nth_curve_length(i) ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n\r\n alpha = total_length / vmob_length\r\n return alpha\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | series_meta = traverse_obj(meta, {
'title': 'program_name',
'channel': 'media_name',
'thumbnail': (('thumbnail_c', 'thumbnail_p'), {url_or_none}),
}, get_all=False)
if headline_id:
return self._extract_episode_info(
traverse_obj(meta, (
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n```\r\nthis should be `'params': {'skip_download': True},`, but playlists aren't downloaded anyways so it can be removed",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert len(kedro_cli.global_groups) == 2
assert kedro_cli.global_groups == [cli, global_commands]
assert len(kedro_cli.project_groups) == 1
assert kedro_cli.project_groups == [
project_commands,
]
result = CliRunner().invoke(kedro_cli, [])
assert result.exit_... | Review this code and list any quality issues. | [] | 0 |
python | if self.layout == "grid":
return []
else:
columns = [
BulkActionsColumn("bulk_actions"),
ImagePreviewColumn(
"preview",
label=_("Preview"),
accessor="image",
classname="image-p... | Review this code and list any quality issues. | [
{
"issue": "Since we're already going down the route of doing the query as part of the main query, I wonder if we should just allow ordering and see what happens in the wild?",
"severity": "minor",
"line": 26
}
] | 1 |
python | torch.nn.BatchNorm2d
The new batchnorm module
"""
in_masks, output_mask, _ = masks
assert isinstance(norm, nn.BatchNorm2d)
in_mask = in_masks[0]
# N, C, H, W
_, remained_in = convert_to_coarse_mask(in_mask, 1)
_, remained_out = convert_to_coarse_mask(output_mask, 1)
if remained_... | Review this code and list any quality issues. | [] | 0 |
python | LinearTransformationScene.__init__(
self,
show_coordinates=True,
leave_ghost_vectors=True,
**kwargs
)
def construct(self):
matrix = [[1, 1], [0, 1]]
self.apply_matrix(matrix)
... | Review this code and list any quality issues. | [] | 0 |
python | import urllib.parse
from .common import InfoExtractor
from ..utils import (
ExtractorError,
clean_html,
get_element_by_id,
int_or_none,
join_nonempty,
js_to_json,
qualities,
url_or_none,
urljoin,
)
from ..utils.traversal import traverse_obj
class KukuluLiveIE(InfoExtractor):
_... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n clean_html,\r\n filter_dict,\r\n get_element_by_id,\r\n```",
"severity": "minor",
"line": 7
}
] | 1 |
python | # See the License for the specific language governing permissions and
# limitations under the License.
#
from luigi.target import Target
class MongoTarget(Target):
""" Target for a resource in MongoDB """
def __init__(self, mongo_client, index, collection):
"""
:param mongo_client: MongoCli... | Review this code and list any quality issues. | [
{
"issue": "personally, i'd prefer the use of `str.format()` or f-strings",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | Review this code and list any quality issues. | [] | 0 |
python | # Pass metadata to the function if it requires it
if function_name in ["add_memory", "update_memory"]:
function_args["metadata"] = metadata
function_result = function_to_call(**function_args)
# Fetch the memory_id from the response
res... | Review this code and list any quality issues. | [
{
"issue": "You have to consider the graph memory as well in the return statement",
"severity": "major",
"line": 26
}
] | 1 |
python | class EbayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ebay\.com/itm/(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.ebay.com/itm/194509326719',
'info_dict': {
'id': '194509326719',
'ext': 'mp4',
'title': 'WiFi internal antenna adhesive for wifi 2.4GHz wi... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n self.report_warning(f'Unsupported format {key}', video_id)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # create OTLP span exporter if endpoint is set
otlp_span_exporter = OTLPSpanExporterWithTraceURL(endpoint=endpoint)
tracer_provider: TracerProvider = trace.get_tracer_provider()
if not getattr(tracer_provider, TRACER_PROVIDER_PFS_EXPORTER_SET_ATTR, False):
_logger.info("have not set ... | Review this code and list any quality issues. | [
{
"issue": "will this record too many ids?",
"severity": "minor",
"line": 26
}
] | 1 |
python | base_color: Optional[str] = None,
**kwargs,
):
"""
Core logging method that handles message formatting and output.
Args:
level: Log level for this message
message: Message template string
tag: Tag for the message
params: Parameters to ... | Review this code and list any quality issues. | [] | 0 |
python | def _real_extract(self, url):
blog_1, blog_2, video_id = self._match_valid_url(url).groups()
blog = blog_2 or blog_1
url = f'http://{blog}.tumblr.com/post/{video_id}'
webpage, urlh = self._download_webpage_handle(
url, video_id, headers={'User-Agent': 'WhatsApp/2.0'}) # wha... | Review this code and list any quality issues. | [
{
"issue": "maybe these would be better?\r\n\r\nif we want the content dicts from all branches:\r\n```suggestion\r\n content_json = traverse_obj(post_json, ((('trail', 0), None), 'content', ..., {dict}))\r\n```\r\n\r\n \r\n\r\nor if we want the exact same results as the original line of code (only t... | 1 |
python | # see: https://bugs.python.org/issue26660.
# So on error, we will attempt to clear the readonly bits and re-attempt the cleanup
shutil.rmtree(tmpdir, onerror=_remove_readonly)
# Obtain config, either from a file or from interactive user prompts.
extra_context = _get_extra_context(
prompts_requi... | Review this code and list any quality issues. | [
{
"issue": "@AhdraMeraliQB, thank you for the excellent work, the code is much clearer now! \r\nAlso, to further streamline our approach, perhaps we could consider this modification:\r\n```\r\nif not starter_alias:\r\n print_selection_and_prompt_info()\r\n```\r\nBy consolidating all printing operations into a... | 1 |
python | # pylint: disable=inconsistent-return-statements
def first(self, *names):
for name in names:
value = self.get(name)
if value:
return value
if not names:
return next(iter(self), {})
def create_callback_id(output, inputs):
# A single dot within... | Review this code and list any quality issues. | [] | 0 |
python | msg='special transformations should act on current element')
self.assertEqual(traverse_obj(etree, ('country', 0, ..., 'text()', {int_or_none})), [1, 2008, 141100],
msg='special transformations should act on current element')
self.assertEqual(traverse_obj(_TEST_DATA, [(100, 1.2)... | Review this code and list any quality issues. | [
{
"issue": "~~I don't understand this. Could you explain?~~\r\n\r\nShouldn't it be:\r\n\r\n```\r\n('dict', 'None', 100, 1.2) => [100, 1.2]\r\nany => 100\r\n{float} => 100\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | The previous timestep in the diffusion process. If negative, uses `final_alpha_cumprod`.
Returns:
`torch.Tensor`:
The variance for the current timestep.
"""
alpha_prod_t = self.alphas_cumprod[timestep]
alpha_prod_t_prev = self.alphas_cumprod[prev_timestep] if... | Review this code and list any quality issues. | [] | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.