language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | from collections.abc import Mapping
from core.workflow.enums import NodeType
from core.workflow.nodes.base.node import Node
LATEST_VERSION = "latest"
# Mapping is built by Node.get_node_type_classes_mapping(), which imports and walks core.workflow.nodes
NODE_TYPE_CLASSES_MAPPING: Mapping[NodeType, Mapping[str, type[... | Review this code and list any quality issues. | [] | 0 |
python | @staticmethod
def field_to_template(tmpl):
if re.match(r'[a-zA-Z_]+$', tmpl):
return f'%({tmpl})s'
from ..YoutubeDL import YoutubeDL
err = YoutubeDL.validate_outtmpl(tmpl)
if err:
raise err
return tmpl
@staticmethod
def format_to_regex(fmt):
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if re.fullmatch(ALLOWABLE_GROUP_NAME_RE, fmt):\r\n # convert a single field name into regex pattern that matches the entire input\r\n return rf'(?s)(?P<{fmt}>.+)'\r\n if not re.search(rf'%\\({ALLOWABLE_GROUP_NAME_RE}\\)s', fmt):\r\n re... | 1 |
python | video_id = self._search_regex(
(r'<iframe[^>]+\bsrc=["\'](?:https?:)?//(?:api\.play-backend\.iprima\.cz/prehravac/embedded|prima\.iprima\.cz/[^/]+/[^/]+)\?.*?\bid=(p\d+)',
r'data-product="([^"]+)">',
r'id=["\']player-(p\d+)"',
r'playerId\s*:\s*["\']player-(p\d+)',
... | Review this code and list any quality issues. | [
{
"issue": "unnecessary\r\n```suggestion\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'modified_date': str,
'description': 'ExtraTerrestrial Tuesday!',
'uploader': 'clarissaisshy',
'uploader_id': '8113',
'uploader_url': 'https://erocast.me/clarissaisshy',
'thumbnail': 'https://erocast.s3.us-east-2.wasabisys.com/1220418/conversions/1696179247-lg... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n return {\r\n 'id': video_id,\r\n 'formats': self._extract_m3u8_formats(\r\n data.get('file_url') or data['stream_url'], video_id, 'm4a', m3u8_id='hls'),\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | def extract_format(page, version):
json_str = self._html_search_regex(
r'player_data=(\\?["\'])(?P<player_data>.+?)\1', page,
'%s player_json' % version, fatal=False, group='player_data')
if not json_str:
return
player_data = self._pars... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n c_quality = next((k for k, v in qualities.items() if v == c_quality), c_quality)\r\n```\r\nalso give a proper name for `c_quality`. maybe `video_quality`?",
"severity": "minor",
"line": 26
}
] | 1 |
python | do_normalize (`bool`, *optional*, defaults to `True`):
Whether to normalize the image. Can be overridden by the `do_normalize` parameter in the `preprocess`
method.
image_mean (`float` or `List[float]`, *optional*, defaults to `IMAGENET_STANDARD_MEAN`):
Mean to use if normali... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n do_convert_rgb: Optional[bool] = None,\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Legacy name, left for integrations.
FileMode = Mode
def supports_feature(target_versions: Set[TargetVersion], feature: Feature) -> bool:
return all(feature in VERSION_TO_FEATURES[version] for version in target_versions)
def find_pyproject_toml(path_search_start: Tuple[str, ...]) -> Optional[str]:
"""Find ... | Review this code and list any quality issues. | [
{
"issue": "Lets add some logging (atleast @ debug level) so we at least tell the user why their config is not being picked up.\r\n- Could save hours of debugging for someone one day\r\n- Silent swallowing at debug level is evil",
"severity": "critical",
"line": 26
}
] | 1 |
python | @flag_value
def failed_to_mention_some_roles_in_thread(self):
""":class:`bool`: Returns ``True`` if the message failed to mention some roles in a thread
and add their members to the thread.
.. versionadded:: 2.0
"""
return 256
@flag_value
def suppress_notifications(... | Review this code and list any quality issues. | [
{
"issue": "I think this should be `@flag_value` instead of alias_flag_value (in case this was missed due to oversight) 👍🏼",
"severity": "minor",
"line": 26
}
] | 1 |
python | from lib.classes.tts_engines.common.headers import *
from lib.classes.tts_engines.common.preset_loader import load_engine_presets
class Tacotron2(TTSUtils, TTSRegistry, name='tacotron'):
def __init__(self, session:DictProxy):
try:
self.session = session
self.cache_dir = tts_dir
... | Review this code and list any quality issues. | [
{
"issue": "`__init__` invokes `self.load_engine()` before `self.model_path` is computed, but `load_engine()` now relies on `self.model_path` to set `self.tts_key` and call `_load_api()`. This makes initialization crash with `AttributeError`. Resolve `iso_dir/sub` and set `self.model_path` (and samplerate) befo... | 1 |
python | ``popsize * (N - N_equal)`` individuals. This keyword is overridden if
an initial population is supplied via the `init` keyword. When using
``init='sobol'`` the population size is calculated as the next power
of 2 after ``popsize * (N - N_equal)``.
tol : float, optional
Relative tole... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n rng : `numpy.random.Generator`, optional\r\n```\r\nPer the SPEC: \"Also note the suggested language for the rng parameter docstring, which encourages the user to pass a Generator or None, but allows for other types accepted by numpy.random.default_rng (captured by the type annot... | 1 |
python | if hasattr(signal, "SIGUSR1"):
return
try:
# send a message to the process to trigger stack trace dump on Windows
# it might not work if the event loop is already blocked
logger.info(
"sending DumpStackTraceRequest message to process", extra=self.... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n if self._proc.is_alive():\n self._proc.terminate()\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'episode_number': 1,
'chapters': [{'start_time': 0.0, 'end_time': 439.88}, {'start_time': 439.88, 'end_time': 1685.84}, {'start_time': 1685.84, 'end_time': 2682.0}],
},
}, {
'url': 'https://mediasetinfinity.mediaset.it/video/matrix/puntata-del-25-maggio_F309013801000501',
'md5': ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'categories': ['Informazione'],\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # invoked by request_wikipedia
def update_message(state: State, json, event_type: str, for_date: str, idx: int):
if isinstance(json, dict):
# response initial message
set_message(state, f"{event_type} for {for_date}: \n", idx)
for event in json.get(event_type, []):
time.sleep(0.... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n# Set a new message or append to an existing message.\r\n# Return the message index in the list.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | object_list = context["object_list"]
headers = list(result_headers(view))
num_sorted_fields = 0
for h in headers:
if h["sortable"] and h["sorted"]:
num_sorted_fields += 1
context.update(
{
"result_headers": headers,
"num_sorted_fields": num_sorted_fiel... | Review this code and list any quality issues. | [] | 0 |
python | self.pyscript_run(
"""
<py-script id="pys">
import asyncio
import js
from pyodide.ffi import to_js
async def coro(delay):
await asyncio.sleep(delay)
return(delay)
async def get_results():
... | Review this code and list any quality issues. | [
{
"issue": "this seems very obscure. What does it do and more importantly, why is it needed?",
"severity": "minor",
"line": 26
}
] | 1 |
python | v = np.interp(T_IDXS_MPC, ModelConstants.T_IDXS, model_msg.velocity.x)
a = np.interp(T_IDXS_MPC, ModelConstants.T_IDXS, model_msg.acceleration.x)
j = np.zeros(len(T_IDXS_MPC))
else:
x = np.zeros(len(T_IDXS_MPC))
v = np.zeros(len(T_IDXS_MPC))
a = np.zeros(len(T_IDXS_MPC))
j = np.z... | Review this code and list any quality issues. | [] | 0 |
python | world_info=_WorldInfo(num_nodes=len(node_ips), gpus_per_node=gpus_per_node),
master_address=node_ips[0],
master_port=_DEFAULT_MASTER_PORT,
node_ips=node_ips,
)
def _detect_slurm_process_run_info(env: dict[str, str]) -> Optional[_ProcessRunInfo]:
import torch # Importing torch takes ti... | Review this code and list any quality issues. | [
{
"issue": "@AliliRayane thank you for the fix! `PMI_RANK` is used by some slurm clusters when using `mpi`, could we update to use both in this case?",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
super().contribute_to_class(cls, name, **kwargs)
cls._meta.auto_field = self
def formfield(self, **kwargs):
return None
class AutoFieldMeta(type):
"""
Metaclass to maintain backward inheritance compatibility for AutoField.
It is intended that AutoFieldMixin become public AP... | Review this code and list any quality issues. | [
{
"issue": "This no longer feeds get_prep_value() into validate_autopk_value(). Should we instead gather the result of `get_db_prep_value` and validate _that_?",
"severity": "minor",
"line": 26
}
] | 1 |
python | @property
def commands(self) -> Set[Command[CogT, ..., Any]]:
"""Set[:class:`.Command`]: A unique set of commands without aliases that are registered."""
return set(self.all_commands.values())
def recursively_remove_all_commands(self) -> None:
for command in self.all_commands.copy().val... | Review this code and list any quality issues. | [] | 0 |
python | with pytest.raises(AssertionError):
TestClassOptional.from_bytes(bytes([]))
TestClassOptional.from_bytes(bytes([0]))
TestClassOptional.from_bytes(bytes([1, 2]))
def test_ambiguous_deserialization_int() -> None:
@streamable
@dataclass(frozen=True)
class TestClassUint(Streamable):
a... | Review this code and list any quality issues. | [
{
"issue": "is there a clear `message=` that could be passed?",
"severity": "minor",
"line": 26
}
] | 1 |
python | "local_extracted_archive": local_extracted_archive.get("test.other"),
"files": dl_manager.iter_archive(archive_path["test.other"]),
},
),
]
return train_splits + dev_splits + test_splits
def _generate_examples(self, files, local_extra... | Review this code and list any quality issues. | [
{
"issue": "@lhoestq is the whole speech data now stored twice in non-streaming mode? Once as the original flac and once as an array of bytes? \r\n\r\nShould we change line 266: from `audio_data[id_] = f.read()` to just `audio_data[id_] = f` and change the line: `audio = {\"path\": transcript[\"file\"], \"bytes... | 1 |
python | 'display_id': 'tvw2',
'title': r're:^TVW-2 Broadcast Channel',
'thumbnail': r're:^https?://.*\.(?:jpe?g|png)$',
'live_status': 'is_live',
},
}]
def _real_extract(self, url):
display_id = self._match_id(url)
webpage = self._download_webpage(url, displa... | Review this code and list any quality issues. | [
{
"issue": "`fatal=True` is the default. I would also inline\r\n```suggestion\r\n return {\r\n 'id': video_id,\r\n 'formats': self._extract_m3u8_formats(m3u8_url, video_id, 'mp4', m3u8_id='hls', live=True),\r\n```",
"severity": "major",
"line": 26
}
] | 1 |
python | def __init__(
self,
key: str,
rows: int | None = None,
) -> None:
self._key = key
self._rows = rows
def validate(self) -> None:
if not results_backend:
raise SupersetErrorException(
SupersetError(
message=__("Result... | Review this code and list any quality issues. | [
{
"issue": "should we log as warning instead since you're logging the error in `superset/sql_lab.py` -> `...if not write_success:` ?",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'description': 'md5:cb6f660850dc5eb7d1ab776ea094959d',
'duration': 2581.0,
'timestamp': 1675160100,
'upload_date': '20230131',
'thumbnail': 'https://epg-image.zdf.de/fotobase-webdelivery/images/e2d7e55a-09f0-424e-ac73-6cac4dd65f35?layout=2400x1350',
'series': ... | Review this code and list any quality issues. | [
{
"issue": "somehow this video changed completely. it also no longer matches what is visible on the webpage. But it also says \"Video no longer available\" on the page, so that might explain the discrepancy. Still let me verify that it matches the player2 behaviour.\r\n\r\n
with pytest.raises(expected, match=match) as exc_info:
res.read()
assert exc_info.type is expected
@pytest.mark.parametrize('raised,expected,match'... | Review this code and list any quality issues. | [] | 0 |
python | wallet_dir = node.wallets_path / wallet_name
os.mkdir(wallet_dir)
res = node.restorewallet(wallet_name, backup_file)
assert_equal(res['name'], wallet_name)
node.unloadwallet(wallet_name)
self.log.info("Test restore succeeds when the target directory contains non-wallet files")
... | Review this code and list any quality issues. | [] | 0 |
python | self._white_color: rl.Color = rl.Color(255, 255, 255, 255)
self._black_bg: rl.Color = rl.Color(0, 0, 0, 166)
self._txt_wheel: rl.Texture = gui_app.texture('icons/chffr_wheel.png', icon_size, icon_size)
self._txt_exp: rl.Texture = gui_app.texture('icons/experimental.png', icon_size, icon_size)
self._rect... | Review this code and list any quality issues. | [
{
"issue": "@deanlee what do you think is cleaner, should parent only dictate width and height, or child?",
"severity": "minor",
"line": 26
}
] | 1 |
python | import cereal.messaging as messaging
from cereal import car
from openpilot.common.params import Params
from openpilot.system.manager.process_config import managed_processes
class TestFeedbackd:
def setup_method(self):
self.pm = messaging.PubMaster(['carState', 'rawAudioData'])
self.sm = messaging.SubMaster(... | Review this code and list any quality issues. | [] | 0 |
python | def _real_extract(self, url):
video_id = self._match_id(url)
page = self._download_webpage(url, video_id)
meta = self._search_json('window.app=', page, 'episode info', video_id)
episode = traverse_obj(meta, ('falcorCache', 'catalog', 'episode', video_id, 'value'))
episode_meta ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n video_url = self._search_regex(r'videoPlaybackUrl:\\s*[\\'\"]([^\\'\"]+)[\\'\"]', tf_js, 'stream API url')\r\n api_key = self._search_regex(r'api_key:\\s*[\\'\"]([^\\'\"]+)[\\'\"]', tf_js, 'stream API key')\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | else:
# ignore background
nonzeros = features[lib.nonzero(features)]
# get number voxels per feature (bincount). argsort[::-1] to get indices
# of largest components.
features_to_keep = lib.argsort(lib.bincount(nonzeros))[::-1]
# only keep the first n non-background indic... | Review this code and list any quality issues. | [
{
"issue": "Hi @heyufan1995 , can you help to finish the doc strings for this function?",
"severity": "minor",
"line": 26
}
] | 1 |
python | Attempt to restore a checkpoint in this priority:
1. from HPC weights if found
2. from `resume_from_checkpoint` file if provided
3. don't restore
"""
self.resume_checkpoint_path = self.hpc_resume_path or self.resume_checkpoint_path
checkpoint_path = self.resume_checkpoin... | Review this code and list any quality issues. | [
{
"issue": "Why is `loaded_checkpoint` public but `_load_optimizer_states` protected?",
"severity": "major",
"line": 26
}
] | 1 |
python | async def test_manual_offline_mode_no_bluetooth_device(
hass: HomeAssistant,
mock_lamarzocco: MagicMock,
mock_config_entry_bluetooth: MockConfigEntry,
freezer: FrozenDateTimeFactory,
) -> None:
"""Test manual offline mode with no Bluetooth device found."""
mock_config_entry_bluetooth.add_to_has... | Review this code and list any quality issues. | [
{
"issue": "The test docstring is too generic. It should clearly describe what specific scenario is being tested. Consider updating to something like \"Test the manual offline mode successfully sets up and updates entities via Bluetooth.\"\n```suggestion\n \"\"\"Test that manual offline mode successfully set... | 1 |
python | "Unsupported lookup 'gt__lt' for DateTimeField or join on the field "
"not permitted, perhaps you meant gt or gte?",
):
Article.objects.filter(pub_date__gt__lt="blahblah")
with self.assertRaisesMessage(
FieldError,
"Unsupported lookup 'gt__lt__foo' for Da... | Review this code and list any quality issues. | [
{
"issue": "We should make sure the error is being tested after the deprecation, perhaps:\r\n```suggestion\r\n # RemovedInDjango70Warning: When the deprecation ends, replace with:\r\n # def test_values_list_flat_empty_error(self):\r\n # msg = \"'flat' is not valid when values_list is called with no... | 1 |
python | self._downloader.cache.store(self._NETRC_MACHINE, 'claims_token', self._claims_token)
return self._claims_token
def _real_initialize(self):
if self.claims_token_valid():
return
self._claims_token = self._downloader.cache.load(self._NETRC_MACHINE, 'claims_token')
def _real_e... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n self.raise_login_required(method='password')\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | assert "reformatted" in result.output
def test_cache_isnt_written_if_no_jupyter_deps_dir(
monkeypatch: MonkeyPatch, tmp_path: local
) -> None:
# Check that the cache isn't written to if Jupyter dependencies aren't installed.
jupyter_dependencies_are_installed.cache_clear()
nb = DATA_DIR / "notebook_tr... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\ndef test_ipynb_flag(tmp_path: pathlib.Path) -> None:\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | .reshape(dims)
.view(np.float16)
)
if tensor_dtype == TensorProto.BFLOAT16:
data = (
np.asarray(tensor.int32_data, dtype=np.int32)
.astype(np.uint16)
.reshape(dims)
)
return data.view(custom_np_types.bfloat16)
if tensor_dtype == T... | Review this code and list any quality issues. | [] | 0 |
python | # We should always be able to get this
assert context["task_instance_key_str"]
task = CustomOperator(task_id="print-params")
runtime_ti = create_runtime_ti(
dag_id="basic_param_dag",
logical_date=logical_date,
task=task,
conf={
... | Review this code and list any quality issues. | [] | 0 |
python | # so we need to handle this with function signature check, and warn user on this
if _kwargs_in_func(start_trace_with_devkit):
logging.debug("compatible promptflow-devkit version, will pass `collection` and `kwargs`...")
logging.debug("collection: %s", collection)
logging.debu... | Review this code and list any quality issues. | [
{
"issue": "shall we move the inject_oepn_api out of the setup_exporter_from_environ function? \r\nSo we don't need to add this strance bool parameter here",
"severity": "minor",
"line": 26
}
] | 1 |
python | async for _items in group_iter:
yield self.response # current state of the response
async def stream_text(self, *, delta: bool = False, debounce_by: float | None = 0.1) -> AsyncIterator[str]:
"""Stream the text result as an async iterable.
!!! note
Result validators wi... | Review this code and list any quality issues. | [
{
"issue": "This means that when streaming text, the validator will never be called without `partial=True` (unless the user explicitly reads the output later), meaning that validation may end up being skipped entirely. I think we should do what we do in `stream_output()` and do one final call after streaming wi... | 1 |
python | simpli = hass.data[DOMAIN][config_entry.entry_id]
# First, simulate failure to stop websocket
await _trigger_requesterror_and_refresh(simpli)
assert simpli._websocket_reconnect_task is None
# Then patch systems to succeed
for system in simpli.systems.values():
system.async_update = AsyncMoc... | Review this code and list any quality issues. | [
{
"issue": "Okay so I understand that the tests probably are not as up to date, but I do want to give the general guideline here. We don't want to touch internals. `hass.data` is considered one.\r\n\r\nSo what we should be doing is\r\n1. Patch the library to raise an error (which I think we do)\r\n2. Trigger a ... | 1 |
python | from .hpkv import HPKVConnector
return HPKVConnector.from_envs(conn_id, executor, **kwargs)
elif backend_name == "PRIS":
from .pris import PrisConnector
return PrisConnector.from_envs(conn_id, executor, **kwargs)
elif backend_name == "MOCK":
from .mock i... | Review this code and list any quality issues. | [] | 0 |
python | (?P<series>browse\.html\?series=)|
(?P<episode>watch.html\?id=)
)(?P<id>[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12})
$"""
_TEST = {
"url": "https://tube.tugraz.at/paella/ui/watch.html?id=f2634392-e40e-4ac7-9ddc-47764aa23d40",
"md5": "a23a3d5c9aaca2b84932fdba66e17145"... | Review this code and list any quality issues. | [
{
"issue": "inline the URLs that are only used once",
"severity": "minor",
"line": 26
}
] | 1 |
python | the data and visualize.
The expected data source is Ignite ``engine.state.output`` and ``engine.state.metrics``.
Default behaviors:
- When EPOCH_COMPLETED, track each dictionary item in
``engine.state.metrics`` in MLFlow.
- When ITERATION_COMPLETED, track expected item in
``... | Review this code and list any quality issues. | [
{
"issue": "I think the arg name should be \"log_dataset\".",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
callback_exec(
response=resp,
on_error=on_error,
on_done=on_done,
on_always=on_always,
continue_on_error=continue_on_error,
logger=self.logger,
)
if self.show_progress:
p... | Review this code and list any quality issues. | [
{
"issue": "shouldn't it be False by default?",
"severity": "minor",
"line": 26
}
] | 1 |
python | def test_request_picklable():
request = httpx.Request("POST", "http://example.org", json={"test": 123})
pickle_request = pickle.loads(pickle.dumps(request))
assert pickle_request.method == "POST"
assert pickle_request.url.path == "/"
assert pickle_request.headers["Content-Type"] == "application/json... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n with pytest.raises(httpx.StreamClosed):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | entries, current_season = [], None
for ep_id, ep, season in paths:
if season:
current_season = season
continue
entries.append(self.url_result(
f'http://www.crunchyroll.com{ep}', CrunchyrollIE.ie_key(), ep_id, season=current_season))
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if self._get_cookies(f'https://beta.crunchyroll.com/{lang}').get('etp_rt'):\r\n grant_type, key = 'etp_rt_cookie', 'accountAuthClientId'\r\n else:\r\n grant_type, key = 'client_id', 'anonClientId'\r\n```\r\nshould make it much si... | 1 |
python | labels = None
with torch.no_grad():
if is_sagemaker_mp_enabled():
raw_outputs = smp_forward_only(model, inputs)
if has_labels or loss_without_labels:
if isinstance(raw_outputs, dict):
loss_mb = raw_outputs["loss"]
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n loss, outputs = self.compute_loss_func(model, inputs, return_outputs=True)\r\n```\r\na typo maybe!",
"severity": "minor",
"line": 26
}
] | 1 |
python | return fut
def interrupt(self) -> None:
self.send_event(ResponseCancelEvent(type="response.cancel"))
def truncate(
self,
*,
message_id: str,
modalities: list[Literal["text", "audio"]],
audio_end_ms: int,
audio_transcript: NotGivenOr[str] = NOT_GIVEN,
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n```\nthis will remove the function calls from the chat context?",
"severity": "minor",
"line": 26
}
] | 1 |
python | torch.manual_seed(0)
vae = AutoencoderKL(
sample_size=32,
in_channels=3,
out_channels=3,
block_out_channels=(4,),
layers_per_block=1,
latent_channels=4,
norm_num_groups=1,
use_quant_conv=False,
use_post_q... | Review this code and list any quality issues. | [] | 0 |
python | graph_id: str,
e: InsufficientBalanceError,
):
shortfall = abs(e.amount) - e.balance
metadata = db_client.get_graph_metadata(graph_id)
base_url = (
settings.config.frontend_base_url or settings.config.platform_base_url
)
# Queue notification for the user
... | Review this code and list any quality issues. | [
{
"issue": "What are these comments can we remove",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'completed': 'stop',
'cancelled': 'error',
'failed': 'error',
}
_OPENAI_ASPECT_RATIO_TO_SIZE: dict[ImageAspectRatio, Literal['1024x1024', '1024x1536', '1536x1024']] = {
'1:1': '1024x1024',
'2:3': '1024x1536',
'3:2': '1536x1024',
}
_OPENAI_IMAGE_SIZE = Literal['auto', '1024x1024', '1024x1536', '153... | Review this code and list any quality issues. | [
{
"issue": "Isn't this also `_AzureContentFilterResultDetail`?\r\n\r\nSee https://learn.microsoft.com/en-us/azure/ai-foundry/openai/reference?view=foundry-classic#contentfilterpromptresults\r\n\r\nAlso looks like there's `profanity` we could support",
"severity": "major",
"line": 26
}
] | 1 |
python | with pytest.raises(NotImplementedError):
_ = env.main_address
with pytest.raises(NotImplementedError):
_ = env.main_port
assert env.world_size() == 2
assert env.global_rank() == 0
assert env.local_rank() == 2
assert env.node_rank() == 1
env.set_global_rank(100)
assert env.glo... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n@mock.patch(\"lightning.fabric.plugins.environments.xla._XLA_GREATER_EQUAL_2_1\", True)\r\n```\r\nmy bad",
"severity": "minor",
"line": 26
}
] | 1 |
python | for shdr in elf.section_headers:
if shdr.type == SHT_STRTAB:
strtab_buf, strtab_sz= shdr.buf, shdr.size
elif shdr.type == SHT_SYMTAB:
symtab_buf, symtab_entsize, symtab_sz = shdr.buf, shdr.entsize, shdr.size
if None in (strtab_buf, symtab_buf):
# executable does not... | Review this code and list any quality issues. | [
{
"issue": "whoa, i've not seen this syntax before! very cool.\r\n\r\ndoes this work on python 3.7+?",
"severity": "minor",
"line": 26
}
] | 1 |
python | f'`{tool.__class__.__name__}` is not supported by `OpenAIResponsesModel`. If it should be, please file an issue.'
)
return tools
def _map_tool_definition(self, f: ToolDefinition) -> responses.FunctionToolParam:
return {
'name': f.name,
'parameters': f.paramet... | Review this code and list any quality issues. | [
{
"issue": "I wonder if we _need_ to check the model name here, or if just `provider_name` would be enough. It'd be worth checking what happens if you get a response from `gpt-4o`, and then send that `provider_response_id` in a new request to `gpt-5` as `previous_response_id`. If that works, I think we can make... | 1 |
python | If the last recorded trade is not at the close, then that day will be
padded with zeros until its close. Any day after that (up to and
including the specified date) will be padded with `minute_per_day`
worth of zeros
Parameters
----------
sid : int
The asset ... | Review this code and list any quality issues. | [
{
"issue": "How about `pd.isnull(last_date)`?",
"severity": "minor",
"line": 26
}
] | 1 |
python | start_function=lambda chapter: float_or_none(
traverse_obj(chapter, ('chapterRenderer', 'timeRangeStartMillis')), scale=1000),
title_function=lambda chapter: traverse_obj(
chapter, ('chapterRenderer', 'title', 'simpleText'), expected_type=str),
duration=duration)
... | Review this code and list any quality issues. | [
{
"issue": "Cosmetic\r\n```suggestion\r\n content_list = traverse_obj(data, (\r\n 'playerOverlays', 'playerOverlayRenderer', 'decoratedPlayerBarRenderer', 'decoratedPlayerBarRenderer', 'playerBar',\r\n 'multiMarkersPlayerBarRenderer', 'markersMap', ..., 'value', 'heatmap', 'heatmapR... | 1 |
python | graph_version: The version of the graph to check
is_sub_agent: Whether this is being executed as a sub-graph.
If `True`, the graph isn't required to be in the user's Library.
Raises:
GraphNotInLibraryError: If the graph is not in the user's library (deleted/archived)
NotAuthoriz... | Review this code and list any quality issues. | [
{
"issue": "why don't we just return instead of pass",
"severity": "minor",
"line": 26
}
] | 1 |
python | def _real_extract(self, url):
video_id = self._match_id(url)
headers = self.geo_verification_headers()
webpage, urlh = self._download_webpage_handle(url, video_id, headers=headers)
if not self._match_valid_url(urlh.url):
return self.url_result(urlh.url)
headers['Refe... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n play_info = self._download_playinfo(traverse_obj(initial_state, ('videoData', 'bvid'), default=video_id),\n initial_state['cid'], headers=headers)\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | ) -> dict:
""" Creating aggregated arguments for standatd pytest skipif, sot the usecase is::
@pytest.mark.skipif(**create_skipif(min_torch="99"))
def test_any_func(...):
...
>>> from pprint import pprint
>>> pprint(create_skipif(min_torch="99"))
{'condition': True, 'reason... | Review this code and list any quality issues. | [
{
"issue": "do we also want to add stuff like this for fairscale, horovod, deepspeed etc.?\r\n\r\nalso isn't this basically also a check for a pytorch version here?",
"severity": "minor",
"line": 26
}
] | 1 |
python | }, DEVELOPMENT_PLAN)
self.project.development_plan = llm_response['plan']
logger.info('Plan for development is created.')
save_progress(self.project.args['app_id'], self.project.current_step, {
"development_plan": self.project.development_plan, "app_data": generate_app_data(self.pr... | Review this code and list any quality issues. | [] | 0 |
python | new_cfg[key] = click.prompt(f"\n{key}", default=value)
console.print("\n", new_cfg)
if click.confirm("Do you want to continue?", default=True, abort=True):
copy_template_files(project_name, template_name)
update_cfg(new_cfg, new_cfg_path)
else:
... | Review this code and list any quality issues. | [
{
"issue": "I don't think this is necesesary (as well as the other instances), but if you'd really like to keep it whilst using the docstring for the help message, there's a click formatting string to bypass outputting to the help page. using \\f\r\n\r\nSee the docs for click here:\r\nhttps://click.palletsproje... | 1 |
python | version = json.load(open(pathlib.Path(root) / "gradio" / "package.json"))["version"]
for entry in (pathlib.Path(root) / "js").iterdir():
if (
entry.is_dir()
and not str(entry.name).startswith("_")
and str(entry.name) not in NOT_COMPONENT
):
print("entr... | Review this code and list any quality issues. | [] | 0 |
python | def __init__(self, **kwargs):
VMobject.__init__(self, **kwargs)
self.set_points_as_corners([UP, UP + RIGHT, RIGHT])
self.set_width(self.width, about_point=ORIGIN)
self.rotate(self.angle, about_point=ORIGIN)
class Arrow(Line):
CONFIG = {
"stroke_width": 6,
"buff": ME... | Review this code and list any quality issues. | [
{
"issue": "Suggestion: I think this behavior should be the default, but it should be optional. Can we add a boolean that would allow the user to propagate the scale() call to the tips?",
"severity": "minor",
"line": 26
}
] | 1 |
python | vmod = "dragonfly_connection=1,db_slice=1,listener_interface=1,main_service=1,rdb_save=1,replica=1,cluster_family=1,engine_shard=1,dflycmd=1,snapshot=1,streamer=1"
args.setdefault("vmodule", vmod)
args.setdefault("jsonpathv2")
if version > 1.27:
args.setdefault("omit_basic_usage")
... | Review this code and list any quality issues. | [
{
"issue": "`S3_ENDPOINT` parsing is fragile: if the env var is provided without a URL scheme (e.g. `localhost:9000`), `urlparse()` treats it as a path and `parsed.netloc` becomes empty, which would pass an empty `--s3_endpoint` to Dragonfly. Consider validating the format (require `http://`/`https://`) or norm... | 1 |
python | def skip_test_function():
pass
def expected_failure_test_function():
pass
class TestMarkTests(SimpleTestCase):
def test_mark_expected_failures_and_skips(self):
test_connection = get_connection_copy()
creation = BaseDatabaseCreation(test_connection)
creation.connection.features.dj... | Review this code and list any quality issues. | [
{
"issue": "I prefer not to add blank lines under the guideline that comments are better to separate any blocks that would otherwise seem to need blank lines.",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'channel_url': 'https://www.youtube.com/channel/UC7fWeaHhqgM4Ry-RMpM2YYw',
'duration': 210,
'view_count': int,
'age_limit': 0,
'webpage_url': 'https://www.youtube.com/watch?v=zEns2dWl00w',
'categories': ['News & Politics'],
'channel': 'TRT World',
... | Review this code and list any quality issues. | [
{
"issue": "Maybe this should also include `'platforms'` as we only ever access that later on?\r\n```suggestion\r\n nuxtjs_data = self._search_nuxt_data(webpage, display_id)['videoData']['content']['platforms']\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | import json
from .brightcove import BrightcoveNewIE
from .common import InfoExtractor
class LaXarxaMesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?laxarxames\.cat/(?:[^/]+/)*?(player|movie-details)/(?P<id>[0-9]+)'
_NETRC_MACHINE = 'laxarxames'
_TOKEN = None
_LOGIN_URL = 'https://www.laxarxame... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _VALID_URL = r'https?://(?:www\\.)?laxarxames\\.cat/(?:[^/]+/)*?(player|movie-details)/(?P<id>\\d+)'\r\n```",
"severity": "minor",
"line": 8
}
] | 1 |
python | roboflow_api_key: str,
model_id: str = "yolov8x-1280",
confidence_threshold: float = 0.3,
iou_threshold: float = 0.7,
) -> None:
"""
Video Processing with Inference and ByteTrack.
Args:
source_video_path: Path to the source video file
target_video_path: Path to the target video ... | Review this code and list any quality issues. | [
{
"issue": "The API key handling logic is redundant and confusing. Line 29 assigns roboflow_api_key to api_key, then line 30 immediately overwrites api_key with the environment variable (falling back to the same api_key). Finally, line 36 assigns it back to roboflow_api_key. This creates unnecessary intermediat... | 1 |
python | def list_actions(self) -> Dict[str, Any]:
"""List all available actions"""
return self._make_request("GET", "/action")
def trigger_action(self, action_request: ActionRequest) -> Dict[str, Any]:
"""Trigger a new action"""
request_data = action_request.to_dict()
print(f"Sendin... | Review this code and list any quality issues. | [
{
"issue": "Maybe this one can be logged with logging.debug, so that we would have some control if we will always see those messages.",
"severity": "critical",
"line": 26
}
] | 1 |
python | import os
import sys
import subprocess
import re
from scriptCommon import catchPath
filenameParser = re.compile( r'\s*.*/(.*\..pp):([0-9]*)(.*)' )
lineNumberParser = re.compile( r'(.*)line="[0-9]*"(.*)' )
hexParser = re.compile( r'(.*)\b(0[xX][0-9a-fA-F]+)\b(.*)' )
#catchPath = os.path.dirname(os.path.realpath( os.p... | Review this code and list any quality issues. | [
{
"issue": "What was the reason for this change? As far as I can see you ignore all the extra parameters, so it makes sense to at least warn about them imho.",
"severity": "minor",
"line": 18
}
] | 1 |
python | f"--threads={PF_SERVICE_WORKER_NUM}",
"promptflow._cli._pf._service:get_app",
]
logger.debug(f"Start Promptflow Service in Unix: {cmd}")
subprocess.Popen(cmd, stdout=subprocess.DEVNULL, start_new_session=True)
def stop_service():
port = get_port_from_config()
if port is not None and is_por... | Review this code and list any quality issues. | [
{
"issue": "add promptflow version here for now, user can call /heartbeat to see pfs version.\r\nActually, if promptflow version is not the same with pfs versio, we will show warning message when start trace",
"severity": "minor",
"line": 26
}
] | 1 |
python | class TaskManagerProjectUpdateMixin(TaskManagerUpdateOnLaunchMixin):
class Meta:
abstract = True
def get_jobs_fail_chain(self):
return list(self.unifiedjob_blocked_jobs.all())
class TaskManagerInventoryUpdateMixin(TaskManagerUpdateOnLaunchMixin):
class Meta:
abstract = True
d... | Review this code and list any quality issues. | [
{
"issue": "I'm a little bit suspicious of this. I don't know that the `blocked_jobs` list is ordered... it might be, but that's really non-obvious looking at it, and the 0 reference, `blocked_jobs[0]` always feels suspicious. If this is well-established, then that's fine, but some code comments could help. Wha... | 1 |
python | assert "install" in report
assert len(report["install"]) == 1
simplewheel_report = _install_dict(report)["simplewheel"]
assert simplewheel_report["metadata"]["name"] == "simplewheel"
assert simplewheel_report["requested"] is True
assert simplewheel_report["is_direct"] is True
url = simplewheel_r... | Review this code and list any quality issues. | [] | 0 |
python | def device_login(self, scopes: List[str]) -> Any:
if not self.app:
self.app = msal.PublicClientApplication(
self.config.client_id,
authority=self.config.authority,
token_cache=self.token_cache,
)
for scope in scopes:
ac... | Review this code and list any quality issues. | [] | 0 |
python | Examples
--------
::
>>> from manim import Square, Rectangle, VGroup, Group, Mobject, VMobject
>>> s, r, m, v = Square(), Rectangle(), Mobject(), VMobject()
>>> vg = VGroup(s, r)
>>> gr = Group(vg, m, v)
>>> gr.get_family()
[Group,... | Review this code and list any quality issues. | [
{
"issue": "Could it be, instead,\r\n```suggestion\r\n list[Mobject]\r\n```\r\n?\r\n\r\n_EDIT: I just noticed that `.get_family()` also has a return type of `list` in its docstring. It would be cool if both of them were `list[Mobject]`._",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'https://bandcamp.com/api/bcradio_api/1/get_show',
show_id,
'Downloading Show Data.',
data=json.dumps({'id': show_id}).encode(),
headers={
'Content-Type': 'application/json',
'Origin': 'https://bandcamp.com',
'Referer': 'htt... | Review this code and list any quality issues. | [
{
"issue": "Ensure the variable is set.\r\n```suggestion\r\n thum_url = f'https://f4.bcbits.com/img/000{thum_id}_171.jpg' if thum_id else None\r\n```\r\nOr use `format_field()`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | webpage = self._download_webpage(url, video_id)
player_data, media_data = self._html_search_regex(
r'LR\.audio\.Player\s*\([^{]*(?P<player>\{.*?\}),(?P<media>\{.*\})\);',
webpage, 'player json', group=('player', 'media'))
player_json = self._parse_json(player_data, video_id, js... | Review this code and list any quality issues. | [
{
"issue": "I would format like so, but not sure:\r\n```suggestion\r\n title = traverse_obj(\r\n media_json, ('audio', lambda _, v: v['id'][1:] == id[1:], 'title',\r\n {lambda x: x and f'{x} - Video Version'}), get_all=False)\r\n```",
"severi... | 1 |
python | # Re-check for conflicts between named and alias storages
self._check_name_alias_conflict(
cls,
name=name,
alias=alias,
storage_client_cache_key=storage_client_cache_key,
)
# Create new insta... | Review this code and list any quality issues. | [
{
"issue": "This has to happen without interruption. Otherwise, the \"cache pre-check\" without a lock could fail in weird ways.\n\nCan you add comments for our future selves that there should be no `await`s in this range?",
"severity": "critical",
"line": 26
}
] | 1 |
python | pipeline_model_mapping = (
{
"feature-extraction": ChameleonModel,
"text-generation": ChameleonForConditionalGeneration,
}
if is_torch_available()
else {}
)
def setUp(self):
self.model_tester = ChameleonModelTester(self)
self.config_tester... | Review this code and list any quality issues. | [] | 0 |
python | def test_unique(self, xp):
t = xp.linspace(0, 2*np.pi, 1000)
y = square(t)
assert y.shape == t.shape
unique = np.unique(_xp_copy_to_numpy(y))
assert set(unique).issubset({-1.0, 1.0})
def test_dtype(self, xp):
waveform = square(xp.asarray(1, dtype=xp.float32),
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n @pytest.mark.parametrize(\"duty,expected\", [(1., 1), (0., -1)])\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'page_age': None,
'title': 'San Francisco, CA Current Weather - The Weather Network',
'type': 'web_search_result',
'url': 'https://www.theweathernetwork.com/en/city/us/california/san-francisco/current?_guid_iss_=1',
... | Review this code and list any quality issues. | [] | 0 |
python | logging.error(f"🪵🪵🪵🪵🪵🪵 {file} 🪵🪵🪵🪵🪵🪵")
shutil.copy(file, test_failed_path)
# Clean up
try:
os.remove(LAST_LOGS)
except OSError:
pass
# tests results we get on the "call" state
# but we can not copy logs until "teardown" state because the server isn't stoped
# so we... | Review this code and list any quality issues. | [
{
"issue": "I recommend creating log_dir if it doesn't exist.",
"severity": "minor",
"line": 26
}
] | 1 |
python | return cast(SonarrConfigEntry, entry)
async def _handle_api_errors[_T](func: Callable[[], Awaitable[_T]]) -> _T:
"""Handle API errors and raise HomeAssistantError with user-friendly messages."""
try:
return await func()
except exceptions.ArrAuthenticationException as ex:
raise HomeAssistan... | Review this code and list any quality issues. | [] | 0 |
python | assert self.get_cached_last_failed(pytester) == []
assert result.ret == 0
@pytest.mark.parametrize("quiet", [True, False])
@pytest.mark.parametrize("opt", ["--ff", "--lf"])
def test_lf_and_ff_prints_no_needless_message(
self, quiet: bool, opt: str, pytester: Pytester
) -> None:
... | Review this code and list any quality issues. | [] | 0 |
python | 'id': '9841',
'ext': 'mp4',
'title': 'Fruits Basket - Episode 1',
'description': 'md5:14be2f72c3c96809b0ca424b0097d336',
'series': 'Fruits Basket',
'duration': 1437,
'release_date': '20190405',
'comment_count': int,
'average... | Review this code and list any quality issues. | [
{
"issue": "Try running the test locally after commenting out `skip`",
"severity": "minor",
"line": 26
}
] | 1 |
python | )
else:
model = build_dp(model, cfg.device, device_ids=cfg.gpu_ids)
data_loader = build_dataloader(
ds_train, # TO DO: convert it to for loop if we will suport concatting several datasets
train_images_tensor,
train_masks_tensor,
train_boxes_tensor,
train_labels_... | Review this code and list any quality issues. | [
{
"issue": "MMdet supports only two types of runners, IterBasedRunner and EpochBasedRunner. Putting elif just in case someone will want to use their own custom implemented runner",
"severity": "minor",
"line": 26
}
] | 1 |
python | os.environ["PYGLET_HEADLESS"] = "1"
IS_INTERACTIVE_VIEWER_AVAILABLE = has_display or has_egl
TOL_SINGLE = 5e-5
TOL_DOUBLE = 1e-9
IMG_STD_ERR_THR = 1.0
IMG_NUM_ERR_THR = 0.001
def pytest_make_parametrize_id(config, val, argname):
if isinstance(val, Enum):
return val.name
if isinstance(val, type):
... | Review this code and list any quality issues. | [
{
"issue": "I would rather only add the option if supported.",
"severity": "minor",
"line": 26
}
] | 1 |
python | class BinExport2Analysis:
def __init__(self, be2: BinExport2, idx: BinExport2Index, buf: bytes):
self.be2: BinExport2 = be2
self.idx: BinExport2Index = idx
self.buf: bytes = buf
self.base_address: int = 0
self.thunks: Dict[int, int] = {}
self._find_base_address()
... | Review this code and list any quality issues. | [
{
"issue": "we could optionally import these nested names directly to avoid having to namespace them (which is a little noisy imho).",
"severity": "minor",
"line": 26
}
] | 1 |
python | self.thread_local = bool(thread_local)
self.local = threading.local() if self.thread_local else SimpleNamespace()
self.raise_on_release_error = raise_on_release_error
self.local.token = None
self.register_scripts()
def register_scripts(self):
cls = self.__class__
cli... | Review this code and list any quality issues. | [
{
"issue": "I think that here you should catch LockError - it can also raise a LockError if for example, release has already been called (you can see PR #3534 for more details). The same applies to the sync lock.py code. And with this change, a new unit test can also be added, covering the LockError case.",
... | 1 |
python | """Loads configuration from environment variables"""
self._config[kinds.ENV_VAR].update(
self._normalized_keys(":env:", self.get_environ_vars())
)
def _normalized_keys(
self, section: str, items: Iterable[Tuple[str, Any]]
) -> Dict[str, Any]:
"""Normalizes items to c... | Review this code and list any quality issues. | [
{
"issue": "I've not looked closely but this isn't merely changing the documentation but _also_ the implementation. For a PR titled \"Fix documentation\", that seems incorrect.\r\n\r\nCould you elaborate on why fixing the documentation to match existing behaviour requires a change in the implementation? I don't... | 1 |
python | # Add the requests to the RQ in batches
await request_queue.add_requests_batched(requests, wait_for_all_requests_to_be_added=True)
# Ensure the batch was processed correctly
assert await request_queue.get_total_count() == request_count
# Fetch and validate each request in the queue
for original_re... | Review this code and list any quality issues. | [] | 0 |
python | 'height': int_or_none(data.get('height')),
'fps': int_or_none(data.get('fps')),
})
playlist.append({
'id': '%s_part%d' % (video_id, i + 1),
'title': title,
'duration': vid_data['data']['clipsDuration'][i],
'... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n r'publishTime:\\s*[\"\\'](\\d+-\\d+-\\d+ \\d+:\\d+)[\"\\']', webpage, 'publish time', fatal=False))\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | block.ref_count += 1
if block.ref_count == 1:
self._init_block_ids.pop(block_id)
def decrease_ref_count(self, block_id: int) -> None:
"""Decreases the reference count of a given (block_id). If the reference count reaches 0, the block is no longer
in use, and becomes initialized ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n def reset_redundant_block(self, block_id: int) -> None:\r\n```\r\nif this is what it is doing",
"severity": "minor",
"line": 26
}
] | 1 |
python | params=[
"pyarrow",
pytest.param(
"fastparquet", marks=pytest.mark.filterwarnings("ignore::FutureWarning")
),
]
)
def engine(request):
pytest.importorskip(request.param)
import dask.dataframe as dd
if dd._dask_expr_enabled() and request.param == "fastparquet":
... | Review this code and list any quality issues. | [
{
"issue": "Would you mind leaving a comment pointing to the upstream issue so we know when we can remove these skips?",
"severity": "minor",
"line": 26
}
] | 1 |
python | elif query_config is not None and query_config.where is not None:
where = query_config.where
else:
where = {}
if self.config.id is not None:
where.update({"app_id": self.config.id})
# We cannot query the database with the input query in case of an image sear... | Review this code and list any quality issues. | [
{
"issue": "You probably dont need two variables, right? \r\n\r\nCan just change `data` variable name to `contexts` and use that throughout?",
"severity": "minor",
"line": 26
}
] | 1 |
python | self._merge_subtitles(subs, target=subtitles)
if caption_url := traverse_obj(video_data, ('captionPath', {url_or_none})):
subtitles.setdefault('en', []).append({'url': caption_url, 'ext': 'vtt'})
return {
'id': video_id,
'display_id': display_id,
'formats... | Review this code and list any quality issues. | [
{
"issue": "IMO we can trust that they won't use fake month numerals... and if they do, who cares?\r\n```suggestion\r\n _VALID_URL = r'https?://(?:www\\.)?tvw\\.org/\\d{4}/\\d{2}/(?P<id>[^/?#]+)'\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | y = np.searchsorted(np.quantile(y, q), y)
return X_dense.astype("float32"), X, y, w
@pytest.mark.filterwarnings("ignore:.*friedman_mse.*:FutureWarning")
@pytest.mark.parametrize(
"Tree, criterion",
[
*product(REG_TREES.values(), REG_CRITERIONS),
*product(CLF_TREES.values(), CLF_CRITERIONS... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n pytest.xfail(\"Poisson criterion is faulty for now\")\r\n```",
"severity": "critical",
"line": 26
}
] | 1 |
python | 'url': 'https://tver.jp/corner/f0062178',
'only_matching': True,
}, {
'url': 'https://tver.jp/feature/f0062413',
'only_matching': True,
}, {
'url': 'https://tver.jp/episode/79622438',
'only_matching': True,
}, {
# subtitle = ' '
'url': 'https://tver.jp... | Review this code and list any quality issues. | [
{
"issue": "shouldn't main be non-fatal too? since error message dont depend on it",
"severity": "minor",
"line": 26
}
] | 1 |
python | for chunk in answer:
streamed_answer = streamed_answer + chunk
yield chunk
self.memory.chat_memory.add_ai_message(streamed_answer)
logging.info(f"Answer: {streamed_answer}")
def query(self, input_query: str, contexts: List[str], config: BaseLlmConfig = None, dry_run=False):
... | Review this code and list any quality issues. | [
{
"issue": "Not a great idea to put try/except around several lines of code. Can you please change this to make sure we only wrap the line where the exception is happened?",
"severity": "minor",
"line": 26
}
] | 1 |
python | @_lmcache_nvtx_annotate
def lookup_unpin(self, lookup_id: str) -> None:
if lookup_id in self.lookup_pins:
assert self.storage_manager is not None
for location, keys in self.lookup_pins.pop(lookup_id).items():
self.storage_manager.batched_unpin(keys, [location])
@... | Review this code and list any quality issues. | [
{
"issue": "nit: \r\n```python\r\n if self.kv_events_enabled and events := self.kv_events:\r\n self.kv_events = []\r\n return events\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.