language string | code-snippit string | instruction string | flaws list | flaw_count int64 |
|---|---|---|---|---|
python | enforce_eager: Whether to enforce eager execution. Defaults to True.
If False, will use eager mode and CUDA graph in hybrid mode.
max_num_seqs: Maximum number of sequences per iteration.
"""
if not vllm:
raise RuntimeError(
"vLLM is not installed. ... | Review this code and list any quality issues. | [
{
"issue": "you could replace with model_params.model_kwargs.get(key)",
"severity": "minor",
"line": 26
}
] | 1 |
python | return True
@property
def is_up_to_date(self) -> bool:
"""Indicate if this data node is up-to-date.
Returns:
False if a preceding data node has been updated before the selected data node
or the selected data is invalid.<br/>
True otherwise.
"""
... | Review this code and list any quality issues. | [
{
"issue": "The logic of this block will always return `False`.\r\n\r\nIt should be like:\r\n```suggestion\r\n if self.is_valid:\r\n from ..scenario.scenario import Scenario\r\n from ..taipy import get_parents\r\n\r\n parent_scenarios: Set[Scenario] = get_parents(self)[\"... | 1 |
python | """
Alternative of scipy.stats.entropy, to not add `scipy` dependency
:param values: Input distribution
:return: The calculated entropy.
"""
# normalize & filter
total = sum(values)
values = [i / total for i in values if i > 0]
# calc
return -sum([pk * math.log(pk) for pk in values])... | Review this code and list any quality issues. | [
{
"issue": "counting braces is not reliable, if brace is part of string (more probable than having nested {}) it makes json invalid \r\n`{\"a\": 1, \"b\": \"}\"}` => `{\"a\": 1, \"b\": \"}`\r\n`{\"a\": 1, \"b\": \"{\"}` => `{\"}`",
"severity": "minor",
"line": 26
}
] | 1 |
python | :class:`~sklearn.model_selection.GridSearchCV` or
:class:`~sklearn.model_selection.RandomizedSearchCV`.
Instead, you can :ref:`create a scorer object <scoring_adapt_metric>` using
:func:`~sklearn.metrics.make_scorer`, with any desired parameter settings.
See the `Examples` section for details.
Ref... | Review this code and list any quality issues. | [
{
"issue": "Could you please re-add those lines with the updated values?\r\n\r\nThe change is expected because we those are tiny datasets where the type of interpolation matters a lot, and this PR changes the interpolation method from `linear` to `averaged_inverted_cdf` to ensure mathematical consistency betwee... | 1 |
python | Return a Handle: an opaque object with a cancel() method that
can be used to cancel the call.
The delay can be an int or float, expressed in seconds. It is
always relative to the current time.
Each callback will be called exactly once. If two callbacks
are scheduled for exactly... | Review this code and list any quality issues. | [
{
"issue": "Would this still work in the browser context? 🤔",
"severity": "minor",
"line": 26
}
] | 1 |
python | model_chunk: Union[ModuleList, Module],
model_chunk_id: int,
input_obj: Optional[dict],
criterion: Callable,
accum_loss: Optional[torch.Tensor] = None,
outputs: Optional[List[Any]] = None,
) -> Union[torch.Tensor, dict]:
"""Forward one step of the pipeline
Arg... | Review this code and list any quality issues. | [] | 0 |
python | self._user: User = state.store_user(data['user'])
self.guild: Guild = guild
self.joined_at: Optional[datetime.datetime] = utils.parse_time(data.get('joined_at'))
self.premium_since: Optional[datetime.datetime] = utils.parse_time(data.get('premium_since'))
self._roles: utils.SnowflakeList... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n f' bot={self._user.bot} nick={self.nick!r} guild={self.guild!r}>'\r\n```\r\n\r\nNo need to add it to the repr.",
"severity": "minor",
"line": 26
}
] | 1 |
python | yield self.get_nth_curve_function(n)
def get_curve_functions_with_lengths(
self, **kwargs
) -> typing.Iterable[typing.Tuple[typing.Callable[[float], np.ndarray], float]]:
"""Gets the functions and lengths of the curves for the mobject.
Parameters
----------
**kwargs
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n return self.get_points()[-1]\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from taipy.gui import Gui, Icon, State, get_state_id, invoke_callback, invoke_long_callback
# The Wikipedia API used to generate content for a date
wiki_url = "https://en.wikipedia.org/api/rest_v1/feed/onthisday/{type}/{month}/{day}"
event_types = {
"happen": "events",
"passé": "events",
"born": "births",
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n# Initialize the user state\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | func = method.__func__
mobject.add_updater(lambda m: func(m, *args, **kwargs))
return mobject
def f_always(method, *arg_generators, **kwargs):
"""
More functional version of always, where instead
of taking in args, it takes in functions which output
the relevant arguments.
"""
assert_i... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n \"\"\"Redraw the mobject constructed by a function every frame.\r\n\r\n This function returns a mobject with an attached updater that\r\n continuously regenerates the mobject according to the\r\n specified function.\r\n\r\n Parameters\r\n ----------\r\n func\r\... | 1 |
python | """Check that the persist context works with fingerprints."""
check_data: dict[str, Any] = {}
crawler = PlaywrightCrawler(
http_client=HttpxHttpClient(header_generator=None, headers={'user-agent': 'My User-Agent'})
)
@crawler.router.default_handler
async def request_handler(context: Playwr... | Review this code and list any quality issues. | [
{
"issue": "Could you please add one assert that checks that such configuration is actually set when passed to the `PlaywrightCrawler`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | ('gaussian', 'gauss', 'gss'): (gaussian, True),
('general cosine', 'general_cosine'): (general_cosine, True),
('general gaussian', 'general_gaussian', 'general gauss',
'general_gauss', 'ggs'): (general_gaussian, True),
('general hamming', 'general_hamming'): (general_hamming, True),
('hamming', 'ha... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n This function is a wrapper for the window functions provided in the\r\n `scipy.signal.windows` namespace.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'location': 'US',
'release_year': 2011,
'thumbnail': r're:https?://.+\.jpg',
},
}, {
# DRM protected
'url': 'https://www.netzkino.de/details/second-best',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
... | Review this code and list any quality issues. | [
{
"issue": "`int_or_none` and `traverse_obj` are already doing enough filtering here\r\n```suggestion\r\n 'age_limit': ('fskRating', {int_or_none}),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'Failed to download m3u8 information: HTTP Error 404: NOT FOUND',
],
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
attrs = extract_attributes(get_element_html_by_attribute('type', 'VideoStream', webpage) or '')
... | Review this code and list any quality issues. | [
{
"issue": "same here\r\n```suggestion\r\n 'duration': traverse_obj(metadata, ('duration', {parse_duration})),\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | @contextmanager
def suppressed_cache_errors() -> Generator[None, None, None]:
"""If we can't access the cache then we can just skip caching and process
requests as if caching wasn't enabled.
"""
try:
yield
except OSError:
pass
class SafeFileCache(SeparateBodyBaseCache):
"""
... | Review this code and list any quality issues. | [
{
"issue": "i vaguely recall this can happen on devpi for non-finalized wheels,\r\nhowever its also highly unlikely\r\n\r\nbeing race-safe on pypi goes a long way however",
"severity": "minor",
"line": 26
}
] | 1 |
python | k: v
for k, v in cudagraph_sizes.items()
if v <= max_num_tokens and v >= uniform_decode_query_len
}
return cudagraph_sizes, uniform_decode_cudagraph_sizes
def capture_graphs(
cudagraph_sizes: dict[int, int],
device: torch.device,
capture_fn: Callable,
capture_cudagr... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n size, capture_cudagraph_mode, **capture_kwargs\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | }, {
'url': 'https://vod.tvp.pl/dla-dzieci,24/laboratorium-alchemika-odcinki,309338',
'only_matching': True,
}]
def _entries(self, seasons, playlist_id):
for season in seasons:
episodes = self._api_request(
f'vods/serials/{playlist_id}/seasons/{season["id"]}/... | Review this code and list any quality issues. | [
{
"issue": "`title` is not mandatory in a playlist, but there should be an ID. Also, could use `playlist_result()` method; consider extracting `metadata['mainCategory']['name']` as a category.\r\n```suggestion\r\n return self.playlist_result(\r\n self._entries(seasons, playlist_id),\r\n ... | 1 |
python | # Override config values at runtime by specifying the component id and its new value:
python -m monai.bundle run training --net#input_chns 1 ...
# Override config values with another config file `/path/to/another.json`:
python -m monai.bundle run evaluating --net %/path/to/another.json ...
... | Review this code and list any quality issues. | [
{
"issue": "Currently, we are testing the `--tracking mlflow` here:\r\nhttps://github.com/Project-MONAI/MONAI/blob/dev/tests/test_integration_bundle_run.py#L127\r\nIf you really want to complete the `--tracking clearml_XXX` feature in this PR, please add some unit tests to your test file according to the above ... | 1 |
python | {
'url': 'https://radiocomercial.pt/podcasts/convenca-me-num-minuto/t3/convenca-me-num-minuto-que-os-lobisomens-existem',
'md5': '47e96c273aef96a8eb160cd6cf46d782',
'info_dict': {
'id': 'convenca-me-num-minuto-que-os-lobisomens-existem',
'ext': 'mp3',
... | Review this code and list any quality issues. | [
{
"issue": "Actually sorry, this would be better to still check if the metadata is correct:\r\n```suggestion\r\n 'params': {\r\n # inconsistant md5\r\n 'skip_download': True,\r\n },\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | await key_value_store.persist_autosaved_values()
# Request handler was called twice
assert request_handler_calls == 2
# Increment of global state happened only once
assert (await key_value_store.get_value(f'{BasicCrawler._CRAWLEE_STATE_KEY}_0'))['counter'] == 1
async def test_adaptive_crawling_statis... | Review this code and list any quality issues. | [] | 0 |
python | signage_point_times=[time.time() for _ in range(consensus_constants.NUM_SPS_SUB_SLOT)],
full_node_store=FullNodeStore(consensus_constants),
log=logging.getLogger(name),
db_path=db_path,
wallet_sync_queue=asyncio.Queue(),
)
@contextlib.asynccontextmanager
... | Review this code and list any quality issues. | [
{
"issue": "What about adding a `.empty()` or such method to the coin store and protocol itself?",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'id': '9ad5e58a-f26f-49f7-8b1d-68f0629485b7-1770059257365',
'ext': 'mp4',
'title': 'Norðmenn tala ekki um annað en prinsessuna',
'categories': ['frettir'],
'description': 'md5:53e2623ae79e1355778c14f5b557a0cd',
'display_id': 'nordmenn-tala-ekki-um-annad-en-pri... | Review this code and list any quality issues. | [
{
"issue": "We should validate that the string we're constructing is actually an `upload_date`\r\n\r\nIf applying my `MONTH_NAMES` suggestion from above, we can do this:\r\n\r\n```suggestion\r\n upload_date = None\r\n if date_str := traverse_obj(webpage, (\r\n {find_element(cls='article... | 1 |
python | default_query: _t.Mapping[str, object] | None = None
http_client: _httpx.Client | None = None
_ApiType = _te.Literal["openai", "azure"]
api_type: _ApiType | None = _t.cast(_ApiType, _os.environ.get("OPENAI_API_TYPE"))
api_version: str | None = _os.environ.get("OPENAI_API_VERSION")
azure_endpoint: str | None = _os.... | Review this code and list any quality issues. | [
{
"issue": "This feels like it could be brittle and cause some weird behaviour if we access `self.api_key` in multiple places for the same request.\n\nMy gut is that we could just not support callable api keys for the module client?",
"severity": "minor",
"line": 26
}
] | 1 |
python | LL = line.leaves
string_parser = StringParser()
rpar_idx = string_parser.parse(LL, string_idx)
for leaf in (LL[string_idx - 1], LL[rpar_idx]):
if line.comments_after(leaf):
yield TErr(
"Will not strip parentheses which have comments attached to t... | Review this code and list any quality issues. | [
{
"issue": "These similar cases still crash:\r\n- `echo '(\"x\" % 3)(1)' | black -`.\r\n- `echo '(\"x\" % 3) ** 1' | black -`.\r\nCould you fix these too?\r\n\r\n(Essentially, we should skip anything lower in https://docs.python.org/3/reference/expressions.html#operator-precedence than % is.)",
"severity": ... | 1 |
python | 'server.address': 'example.com',
'server.port': 8000,
'model_request_parameters': {
'function_tools': [],
'builtin_tools': [],
'output_mode': 'text',
'output_ob... | Review this code and list any quality issues. | [] | 0 |
python | config_list: list
List on pruning configs
optimizer: torch.optim.Optimizer
Optimizer used to train model
pruning_algorithm: str
algorithms being used to prune model
trainer: function
Function used to train the model.
Users should write ... | Review this code and list any quality issues. | [
{
"issue": "if only `TaylorFOWeightFilterPruner` supports `global_sort`, suggest to put this argument in `TaylorFOWeightFilterPruner`.",
"severity": "minor",
"line": 26
}
] | 1 |
python | row_alignments: Optional[str] = None, # "ucd"
col_alignments: Optional[str] = None, # "lcr"
row_heights: Optional[Iterable[Optional[float]]] = None,
col_widths: Optional[Iterable[Optional[float]]] = None,
flow_order: str = "rd",
**kwargs,
) -> "Mobject":
"""Arrange ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n The vertical alignment for each row (top to bottom). Accepts the following characters: `\"u\"` - \r\n up, `\"c\"` - center, `\"d\"` - down.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | class PolygramRoundCorners(Scene):
def construct(self):
star = Star(outer_radius=2)
shapes = VGroup(star)
shapes.add(star.copy().round_corners(radius=0.1))
shapes.add(star.copy().round_corners(radius=0.25))
... | Review this code and list any quality issues. | [
{
"issue": "What happens if I pass `radius=1`? Given that `type(1) is float` yields `False`, you rather might want to use `isinstance(radius, (int, float))` instead.",
"severity": "minor",
"line": 26
}
] | 1 |
python | from qlib.utils.time import get_day_min_idx_range
if typing.TYPE_CHECKING:
from qlib.rl.data.base import BaseIntradayBacktestData
from qlib.rl.data.native import IntradayBacktestData
def _get_all_timestamps(
start: pd.Timestamp,
end: pd.Timestamp,
granularity: pd.Timedelta = ONE_MIN,
include_... | Review this code and list any quality issues. | [
{
"issue": "I think making exchange return data without missing will make it more elegant.\r\nPlease add TODO here.",
"severity": "minor",
"line": 26
}
] | 1 |
python | values = self._ndarray
result = value_counts(values, sort=False, dropna=dropna)
index_arr = self._from_backing_data(np.asarray(result.index._data))
index = Index(index_arr, name=result.index.name)
return Series(result._values, index=index, name=result.name, copy=False)
def _quanti... | Review this code and list any quality issues. | [
{
"issue": "While having an `else` clause that actually cannot work doesn't seem great (and so this change might be good anyway), looking at the code above (`if res_values.dtype == self._ndarray.dtype:`), I am wondering if the problem might not be that `quantile_with_mask` is not returning the correct dtype in ... | 1 |
python | from .common import InfoExtractor
from ..utils import clean_html
from ..utils.traversal import find_elements, traverse_obj
class FilmArchivIE(InfoExtractor):
IE_NAME = 'FILMARCHIV ON'
_VALID_URL = r'https?://(?:www\.)?filmarchiv\.at/de/filmarchiv-on/video/(?P<id>[0-9a-zA-Z_]+)'
_TESTS = [{
'url': ... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n title = self._html_search_regex(r'(?s)<title-div\\b[^>]*>([^<]+)</title-div>', webpage, 'title')\r\n```\r\nlets avoid `.+?`",
"severity": "minor",
"line": 26
}
] | 1 |
python | -------
callable
A wrapped version of *init_func* that handles the optional *axis*.
Notes
-----
If the wrapped constructor defines *axis* as its first argument, the
parameter is preserved when present. Otherwise, the value `None` is injected
as the first argument.
Examples
----... | Review this code and list any quality issues. | [
{
"issue": "Shouldn't the keyword-argument version be passed as the `axis` if it's there?\r\n```suggestion\r\n # Remove 'axis' from kwargs to avoid double assignment\r\n return init_func(self, kwargs.pop('axis', None), *args, **kwargs)\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | entry.add_to_hass(hass)
with patch(
"homeassistant.components.fritz.coordinator.FritzConnectionCached",
side_effect=error,
):
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
assert entry.state is ConfigEntryState.SETUP_RETRY
async ... | Review this code and list any quality issues. | [
{
"issue": "bonus points if we also type those fixtures in the future",
"severity": "minor",
"line": 26
}
] | 1 |
python | inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = image.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_object_detection(
outputs=outp... | Review this code and list any quality issues. | [
{
"issue": "Let's make it more compact and drop those extra new lines.",
"severity": "minor",
"line": 26
}
] | 1 |
python | stdout=log_stdout,
stderr=log_stderr),
testdir,
log_stdout,
log_stderr))
if not self.jobs:
raise IndexError('pop from empty list')
# Print remaining runni... | Review this code and list any quality issues. | [
{
"issue": "is it still correct to claim that we're sleeping?",
"severity": "minor",
"line": 26
}
] | 1 |
python | entry = MockConfigEntry(domain=DOMAIN, data=MOCK_USER_DATA)
entry.add_to_hass(hass)
with patch("homeassistant.components.fritz.PLATFORMS", [Platform.BINARY_SENSOR]):
assert await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
await snapshot_platform(hass... | Review this code and list any quality issues. | [
{
"issue": "The `PLATFORMS` patch in this test is scoped only around creating and adding the `MockConfigEntry`, so by the time `async_setup` is called outside the context manager the original platform list is already restored and the patch has no effect. To keep the test intention clear and consistent with the ... | 1 |
python | y1_list_list_indicator = [list(a) for a in y1_list_array_indicator]
y2_list_list_indicator = [list(a) for a in y2_list_array_indicator]
for name in MULTILABELS_METRICS:
metric = ALL_METRICS[name]
# XXX cruel hack to work with partial functions
if isinstance(metric, partial):
... | Review this code and list any quality issues. | [] | 0 |
python | from __future__ import annotations
from dataclasses import dataclass
from typing import Annotated, Any
from pydantic import BaseModel, Field
_BYTES_PER_KB = 1024
_BYTES_PER_MB = _BYTES_PER_KB**2
_BYTES_PER_GB = _BYTES_PER_KB**3
_BYTES_PER_TB = _BYTES_PER_KB**4
class Ratio(BaseModel):
"""Represents ratio of mem... | Review this code and list any quality issues. | [
{
"issue": "I believe we could add `gt=0.0` and `le=1.0` constraints to `available_memory_ratio` in `Configuration` for consistency.",
"severity": "major",
"line": 17
}
] | 1 |
python | async def async_send_command(
self,
command: str,
params: dict[str, Any] | list[Any] | None = None,
**kwargs: Any,
) -> None:
"""Send a command to a vacuum cleaner."""
await self.send(command, params)
async def get_maps(self) -> ServiceResponse:
"""Get ma... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n parts = seg_id.split(\":\", maxsplit=1)\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from __future__ import annotations
from typing import TYPE_CHECKING
from protego import Protego # type: ignore[import-untyped]
from yarl import URL
from crawlee._utils.web import is_status_code_client_error
if TYPE_CHECKING:
from typing_extensions import Self
from crawlee.http_clients import HttpClient
... | Review this code and list any quality issues. | [
{
"issue": "Could we please rather update the project toml rather than using a type ignore?",
"severity": "minor",
"line": 5
}
] | 1 |
python | self.index_map = dict(zip(self.idx_list, range(len(self))))
self._is_sorted = False
def __getitem__(self, i: int):
return self.idx_list[i]
def _convert_type(self, item):
"""
After user creates indices with Type A, user may query data with other types with the same info.
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # NOTE: It is hard to consider every case at first. \r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | @staticmethod
def _metric_attributes(executor_endpoint, executor, runtime_name):
return {
'executor_endpoint': executor_endpoint,
'executor': executor,
'runtime_name': runtime_name,
}
def _record_request_size_prometheus(self, requests):
for req in req... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n def _record_docs_processed_monitoring(self, requests, docs):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def __init__(self, keys: KeysCollection, name: str, allow_missing_keys: bool = False, *args, **kwargs) -> None:
MapTransform.__init__(self, keys, allow_missing_keys)
self.name = name
self.trans = TorchVision(name, *args, **kwargs)
def __call__(self, data: Mapping[Hashable, NdarrayOrTensor])... | Review this code and list any quality issues. | [
{
"issue": "The same comments about the RandomizableTrait inherit with the array version.\r\nAnd what's this `apply_same_transform` arg used for? In MONAI, we always apply the same transform on the sequence keys, such as image and label. Is there a typical case here users may want apply different transforms on... | 1 |
python | 'ie_key': BiliBiliIE.ie_key(),
'timestamp': parse_iso8601(episode.get('update_time'), delimiter=' '),
'episode': episode.get('index_title'),
'episode_number': int_or_none(episode.get('index')),
} for episode in season_info['episodes']]
entries = sorted(entries, key=l... | Review this code and list any quality issues. | [
{
"issue": "This is a Space Video extractor, right?\r\n\r\nWe could add another extractor specifically for the main page of a Space, e.g. https://space.bilibili.com/3985676 , extracting the links of the webpage\r\n\r\n```suggestion\r\n _VALID_URL = r'https?://space\\.bilibili\\.com/(?P<id>\\d+)/video'\r\n```... | 1 |
python | s = SomeOf()
self.assertEqual(s.random.getstate(), random.Random(0).getstate())
s.set_random_state(1, None)
self.assertEqual(s.random.getstate(), random.Random(1).getstate())
def update_transform_count(self, counts, output):
if output % 2 == 0:
counts[0] += 1
if ... | Review this code and list any quality issues. | [
{
"issue": "Could you please also help add some combination tests here? Something like:\r\nhttps://github.com/Project-MONAI/MONAI/blob/a8302eca3fc31554d4bd30fae84150766ce13472/tests/test_random_order.py#L43",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from .francetv import FranceTVIE
class LumniIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?lumni\.fr/video/(?P<id>\w+)'
_TESTS = [{
'url': 'https://www.lumni.fr/video/l-homme-et-son-environnement-dans-la-revolution-industrielle',
'md5': '960e8240c4f2c7a2... | Review this code and list any quality issues. | [
{
"issue": "I think it would be better to move this extractor to francetv.py, they're closely related",
"severity": "major",
"line": 5
}
] | 1 |
python | If `True`, any non-compatible object will first be
converted into a string and then traversed into.
@returns The result of the object traversal.
If successful, `get_all=True`, and the path branches at least once,
th... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n assert len(key) == 1, 'Set should only be used to wrap transformations'\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | spend_data=spend_data,
fast_forward_spends=self.fast_forward_spends,
)
new_bundle_coin_spends[new_coin_spend.coin.name()] = BundleCoinSpend(
coin_spend=new_coin_spend,
eligible_for_dedup=spend_data.eligible_for_dedup,
eligible_for_f... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n # get_conditions_from_spendbundle raises a ValueError with an error code\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
class InaIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|m)\.)?ina\.fr/.*(?:video|audio)/(?P<id>[\w\d_]+).*'
_TESTS = [{
'url': 'https://www.ina.fr/video/I12055569/francois-hollande-je-crois-que-c-est-clair-video.html',
'md5': 'c5a09e5cb5604ed10709f06e7a3... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _VALID_URL = r'https?://(?:(?:www|m)\\.)?ina\\.fr/(?:[^/]+/)?(?:video|audio)/(?P<id>\\w+)'\r\n```",
"severity": "minor",
"line": 5
}
] | 1 |
python | operator = RedshiftDeleteClusterSnapshotOperator(
task_id="test_snapshot",
cluster_identifier="test_cluster",
snapshot_identifier="test_snapshot",
wait_for_completion=False,
)
validate_template_fields(operator)
class TestResumeClusterOperator:
def te... | Review this code and list any quality issues. | [] | 0 |
python | --------
.. manim:: UsingRotate
class UsingRotate(Scene):
def construct(self):
self.play(
Rotate(
Square(side_length=0.5).shift(UP * 2),
angle=2*PI,
about_point=ORIGIN,
... | Review this code and list any quality issues. | [
{
"issue": "For the same reason as before:\n```suggestion\n axis: Vector3DLike = OUT,\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'display_id': 'ref:gaki_20250525',
'duration': 1450,
'episode': '放送開始36年!方正ココリコが選ぶ神回&地獄回!',
'episode_id': '000000010172808',
'episode_number': 255,
'genres': ['variety'],
'live_status': 'not_live',
'modified_date': '20250525',
... | Review this code and list any quality issues. | [
{
"issue": "is there any way for us to return the old `video_id` as `_old_archive_ids`?",
"severity": "minor",
"line": 26
}
] | 1 |
python | # it will enter mempool individually
self.ctr += 1
parent_result2 = self.wallet.create_self_transfer(
fee=DEFAULT_FEE,
utxo_to_spend=coin2,
sequence=MAX_BIP125_RBF_SEQUENCE - self.ctr,
)
# Child that spends both, violating cluster size rule due
... | Review this code and list any quality issues. | [] | 0 |
python | def head_args(self, args):
"""Set the arguments for the `head` of this Deployment.
.. # noqa: DAR101
"""
self.pod_args['head'] = args
@property
def uses_before_args(self) -> Namespace:
"""Get the arguments for the `uses_before` of this Deployment.
.. # noqa: ... | Review this code and list any quality issues. | [] | 0 |
python | operation_name = xform_name(self._action_model.request.operation)
# Unlike the simple action above, a batch action must operate
# on batches (or pages) of items. So we get each page, construct
# the necessary parameters and call the batch operation.
for page in parent.pages():
... | Review this code and list any quality issues. | [
{
"issue": "Make sure there's no extra white space added.",
"severity": "minor",
"line": 26
}
] | 1 |
python | @staticmethod
def _build_notification_continuation_query(ctoken):
query = {
'ctoken': ctoken
}
return query
def _notification_menu_entries(self, headers, max_requests):
continuation_list = [None]
request_count = 0
entries = []
while request_co... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n yield entry\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | with TemporaryDirectory() as workspace:
root = Path(workspace)
junction_dir = root / "junction"
junction_target_outside_of_root = root / ".."
os.system(f"mklink /J {junction_dir} {junction_target_outside_of_root}")
report = black.Report(verbose=True)
... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n source, _ = read_data(\"miscellaneous\", \"missing_final_newline\")\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | },
},
{
# new video_id format
'url': 'https://www.nbc.com/quantum-leap/video/bens-first-leap-nbcs-quantum-leap/NBCE125189978',
'info_dict': {
'id': 'NBCE125189978',
'ext': 'mp4',
'title': 'Ben\'s First Leap | NBC\'s Quan... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n 'categories': ['Series/Quantum Leap 2022'],\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def distance_transform_edt(
img: NdarrayOrTensor, sampling: None | float | list[float] = None, force_scipy: bool = False
) -> NdarrayOrTensor:
"""
Euclidean distance transform, either GPU based with CuPy / cuCIM
or CPU based with scipy.ndimage.
Choice depends on cuCIM being available or scipy can be... | Review this code and list any quality issues. | [
{
"issue": "When we implement non-spatial dimensions and we care about performance here, I think we should use the option to pass in a preallocated torch tensor/numpyarray with the final dimension using the [distances and indices parameter](https://docs.rapids.ai/api/cucim/nightly/api/#cucim.core.operations.mor... | 1 |
python | continue
# channel_masks is a list, each element is None or a vector, for example:
# [[0, 1, 1, 0, 0], [0, 0, 1, 1, 0], None], None means no channel
# is pruned.
channel_masks = []
fine_grained = False
for name in dset:
if name in s... | Review this code and list any quality issues. | [
{
"issue": "should it be ``isinstance(m, nn.Linear)``?",
"severity": "minor",
"line": 26
}
] | 1 |
python | max_length=255,
verbose_name=_("object id"),
)
submitted_for_moderation = models.BooleanField(
verbose_name=_("submitted for moderation"), default=False, db_index=True
)
created_at = models.DateTimeField(db_index=True, verbose_name=_("created at"))
user = models.ForeignKey(
s... | Review this code and list any quality issues. | [
{
"issue": "This means that the `content_object` is always an instance of the specific page type. I don't think there's a downside to this as all tests seem to pass (after some minor adjustments in this PR) and we even considered enforcing that `save_revision()` is called with a specific page object (#8573).",
... | 1 |
python | from dataclasses import dataclass
@dataclass
class GPUDevice:
node_id: str
gpu_id: int
status: str = 'free'
def __eq__(self, o) -> bool:
return self.node_id == o.node_id and self.gpu_id == o.gpu_id
def __lt__(self, o) -> bool:
if self.node_id < o.node_id:
return True
... | Review this code and list any quality issues. | [
{
"issue": "Suggest, e.g.,\r\n\r\n`Literal['idle', 'busy', 'unknown'] = 'idle'`",
"severity": "minor",
"line": 8
}
] | 1 |
python | control_type=control_type,
element_name="Alert",
attributes=attrs,
)
.set_value_and_default(var_type=PropertyType.dynamic_string)
.set_attributes(
[
("severity", PropertyType.dynamic_string),
("variant", PropertyType.dynamic_str... | Review this code and list any quality issues. | [
{
"issue": "no need for these to be dynamic (string is enough)",
"severity": "minor",
"line": 26
}
] | 1 |
python | hidden_dim: int
"""The hidden dimension aka embedding size."""
num_kv_heads: int
"""The number of key value (KV) heads for the attention layer."""
def get_bytes_per_unit(dtype: torch.dtype) -> int:
"""Gets the number of bytes used per memory unit given the torch dtype.
A memory unit is essential... | Review this code and list any quality issues. | [
{
"issue": "nit: bytes is a also a built-in Python type. Can we rename to something like num_bytes?",
"severity": "minor",
"line": 26
}
] | 1 |
python | logger.error(f"Error processing notification: {e}")
return False
def run_service(self):
logger.info(f"[{self.service_name}] Started notification service")
# Set up queue consumers
channel = self.run_and_wait(self.rabbit.get_channel())
immediate_queue = self.run_and_wai... | Review this code and list any quality issues. | [
{
"issue": "Could this not cause an infinite loop, of requeueing failed messages, which are then reprocessed, which fails and requeue's them again. \r\n\r\nA mechanism to avoid this inf loop needs to be added.",
"severity": "critical",
"line": 26
}
] | 1 |
python | )
if self.same_count:
s = "s" if self.same_count > 1 else ""
report.append(f"{self.same_count} file{s} {unchanged}")
if self.failure_count:
s = "s" if self.failure_count > 1 else ""
report.append(
click.style(f"{self.failure_count} file{s} ... | Review this code and list any quality issues. | [
{
"issue": "One of Black's dependencies already imports this, so there's no point in deferring the import here.",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .common import InfoExtractor
from .art19 import Art19IE
from ..utils import (
ExtractorError,
extract_attributes,
get_elements_html_by_class,
traverse_obj,
)
class RideHomeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ridehome\.info/show/techmeme-ride-home/(?P<id>[\w-]+)(?:/|$)'
_... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\nfrom .art19 import Art19IE\r\nfrom .common import InfoExtractor\r\nfrom ..utils import extract_attributes, get_elements_html_by_class\r\nfrom ..utils.traversal import traverse_obj\r\n```",
"severity": "major",
"line": 9
}
] | 1 |
python | warn: bool = False,
) -> Iterator[Tag]:
"""
Yields the tags for a generic interpreter.
The tags consist of:
- <interpreter>-<abi>-<platform>
The "none" ABI will be added if it was not explicitly provided.
"""
if not interpreter:
interp_name = interpreter_name()
interp_versi... | Review this code and list any quality issues. | [] | 0 |
python | data = self._download_json(f'https://odkmedia.io/odx/api/v3/playback/{video_id}/', video_id,
fatal=False, headers={'service-name': 'odk'},
query={'did': random_uuidv4()}, expected_status=(403, 404))
if not data.get('result'):
rais... | Review this code and list any quality issues. | [
{
"issue": "if the `data['result']` suggestion from above is applied\r\n```suggestion\r\n for track in traverse_obj(data, ('text_tracks', lambda _, v: url_or_none(v['url']))):\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | corrected = lin / corr.reshape(1, 1, 3)
max_val = corrected.max() + 1e-10
normalized = corrected / max_val
srgb = np.clip(linear_to_srgb(normalized), 0.0, 1.0)
out_rgb8 = (srgb * 255.0 + 0.5).astype(np.uint8)
return cv.cvtColor(out_rgb8, cv.COLOR_RGB2BGR)
def annotate(img_bgr: np.ndarray, title: ... | Review this code and list any quality issues. | [
{
"issue": "Set a default image, same as cpp sample.",
"severity": "minor",
"line": 26
}
] | 1 |
python | _api_config = None
def _extract_extended_description(self, episode_id, aa_vinfo2, aa_vinfo3):
service, area = aa_vinfo2.split(",")
if not self._api_config:
self._api_config = self._download_xml('https://www.nhk.or.jp/radio/config/config_web.xml',
... | Review this code and list any quality issues. | [
{
"issue": "single quotes and use traversal with `{str}` imo",
"severity": "minor",
"line": 26
}
] | 1 |
python | "inputs",
"batch_size",
"sequence_length",
"datetime",
"test_times",
"QPS",
"average_latency_ms",
"latency_variance",
"latency_90_percentile",
"latency_95_percentile",
"latency_99_percentile",
... | Review this code and list any quality issues. | [] | 0 |
python | model = self.model_class(**init_dict)
if not getattr(model, "_supports_group_offloading", True):
return
model.to(torch_device)
model.eval()
_ = model(**inputs_dict)[0]
torch.manual_seed(0)
init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_commo... | Review this code and list any quality issues. | [
{
"issue": "I think it would make more sense to parameterize test on offload_type instead of record_stream",
"severity": "minor",
"line": 26
}
] | 1 |
python | mobject: Mobject, direction: np.ndarray[np.float64] = RIGHT, rate: float = 0.1
) -> Mobject:
"""Shift the mobject by `rate*direction` every second
Parameters
----------
mobject
The mobject to shift
direction
The direction to shift
rate
Amount of direction to be covered i... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # construct a square which is continuously\r\n # shifted to the right\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | async def cat_get_name(self, request: CATGetName) -> CATGetNameResponse:
wallet = self.service.wallet_state_manager.get_wallet(id=request.wallet_id, required_type=CATWallet)
name: str = wallet.get_name()
return CATGetNameResponse(wallet_id=request.wallet_id, name=name)
@marshal
async de... | Review this code and list any quality issues. | [] | 0 |
python | 'only_matching': True,
}]
def _extract_content_from_block(self, block):
details = traverse_obj(block, {
'id': ('sourceId', {str}),
'uploader': ('bylines', ..., 'renderedRepresentation', {str}),
'duration': (('duration', 'length', ...), {int_or_none}),
'up... | Review this code and list any quality issues. | [
{
"issue": "`merge_dicts` is particularly useful when you're merging 2 dicts that may share the same keys, but the values of the shared keys may be `None` in one dict -- it will prioritize the values that are not `None`. Here we can just unpack IMO\r\n```suggestion\r\n return {\r\n **detai... | 1 |
python | #!/usr/bin/env python3
# Copyright (c) 2021 The Dogecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""PayTxFee QA test.
# Tests wallet behavior of -paytxfee in relation to -mintxfee
"""
from test_framework.t... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n self.nodes = [] # all nodes will be configured with minrelaytxfee of 0.001\r\n```",
"severity": "minor",
"line": 22
}
] | 1 |
python | if pygram.python_grammar_soft_keywords not in grammars and matches_grammar(
src_txt, pygram.python_grammar_soft_keywords
):
original_msg = exc.args[0]
msg = f"{original_msg}\n{PY310_HINT}"
raise InvalidInput(msg) from None
if matches_grammar(src_txt, pygr... | Review this code and list any quality issues. | [] | 0 |
python | interface_serial_number: int,
) -> None:
"""Initialize a Lunatone light."""
super().__init__(coordinator)
self._device_id = device_id
self._interface_serial_number = interface_serial_number
self._device = self.coordinator.data[self._device_id]
self._attr_unique_id = f... | Review this code and list any quality issues. | [
{
"issue": "The available property should check if the device still exists in the coordinator data. If a device is removed from the hub, line 135 in _handle_coordinator_update will raise a KeyError when trying to access self.coordinator.data[self._device_id]. Consider adding a check like: return super().availab... | 1 |
python | downloader.add_option(
'--abort-on-unavailable-fragments', '--no-skip-unavailable-fragments',
action='store_false', dest='skip_unavailable_fragments',
help='Abort download if a fragment is unavailable (Alias: --no-skip-unavailable-fragments)')
downloader.add_option(
'--keep-fragments... | Review this code and list any quality issues. | [] | 0 |
python | 'ext': 'mp3',
'url': f'https://loopstream01.apa.at/?channel={loop_station}&id={item_id}',
'_old_archive_ids': [make_archive_id(old_ie, video_id)],
'title': data.get('title'),
'description': clean_html(data.get('subtitle')),
'duration': try_... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n _VALID_URL = rf'https?://sound\\.orf\\.at/podcast/(?P<station>{_STATION_RE})/(?P<show>[a-zA-Z0-9_-]+)/(?P<id>[a-zA-Z0-9_-]+)'\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | from typing import Any, List, Optional
import inspect
import os
import tempfile
import unittest
from promptflow.client import PFClient
from promptflow.evals import evaluators
from promptflow.evals.evaluators import content_safety
class TestSaveEval(unittest.TestCase):
"""Test saving evaluators."""
... | Review this code and list any quality issues. | [
{
"issue": "Please switch to pytest and add @pytest.mark.unittest mark to the class otherwise I thnk it will be ignored by the CI pipeline.",
"severity": "minor",
"line": 12
}
] | 1 |
python | euler : tuple, shape (3,), optional
The euler angle of the entity in degrees. This follows scipy's extrinsic x-y-z rotation convention.
Defaults to (0.0, 0.0, 0.0).
quat : tuple, shape (4,), optional
The quaternion (w-x-y-z convention) of the entity. If specified, `euler` will be ignored. De... | Review this code and list any quality issues. | [
{
"issue": "`tile_size` would make more sense?",
"severity": "minor",
"line": 26
}
] | 1 |
python | 'duration': 33.08,
'episode': '0',
'episode_id': '3179360900145',
'episode_number': 0,
'ext': 'mp4',
'id': 'pbs-pub-aa9397e9-ec2b-45f9-9148-7ce71b690b45$vid-04c67438-4866-4f5c-8978-51d173c0074b',
'release_timestamp': 1699160400,
'releas... | Review this code and list any quality issues. | [
{
"issue": "All `/vrtnu/a-z` links are redirecting to `/vrtmax/a-z`, so if wanted I can fully remove support for those URLs as well",
"severity": "minor",
"line": 26
}
] | 1 |
python | # Need to wait for entity to be added after enabling
await hass.async_block_till_done()
ha_state, hmip_device = get_and_check_entity_basics(
hass, mock_hap, entity_id, entity_name, device_model
)
assert ha_state.state == "15.0"
assert ha_state.attributes[ATTR_UNIT_OF_MEASUREMENT] == PERCEN... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\n hass: HomeAssistant,\n default_mock_hap_factory: HomeFactory,\n entity_registry: er.EntityRegistry,\n) -> None:\n \"\"\"Test HomematicipSmokeDetectorAlarmCounter.\"\"\"\n entity_id = \"sensor.rauchwarnmelder_smoke_alarm_counter\"\n entity_name = \"Rauchwarnmelder sm... | 1 |
python | )
except APIStatusError as e:
if model_response := _check_azure_content_filter(e, self.system, self.model_name):
return model_response
if (status_code := e.status_code) >= 400:
raise ModelHTTPError(status_code=status_code, model_name=self.model_name, body=... | Review this code and list any quality issues. | [
{
"issue": "This shouldn't be needed anymore",
"severity": "minor",
"line": 26
}
] | 1 |
python | from ..utils.color import interpolate_color
from ..utils.iterables import list_update
from ..utils.iterables import remove_list_redundancies
from ..utils.paths import straight_path
from ..utils.simple_functions import get_parameters
from ..utils.space_ops import angle_of_vector
from ..utils.space_ops import get_norm
fr... | Review this code and list any quality issues. | [
{
"issue": "If it is fine can you do [typing](https://docs.python.org/3/library/typing.html)?",
"severity": "minor",
"line": 26
}
] | 1 |
python | wait_until(lambda: len(consumer.dead_nodes()) == self.num_consumers - keep_alive, timeout_sec=10,
err_msg="Timed out waiting for the consumers to shutdown")
for node in consumer.nodes[keep_alive:]:
consumer.start_node(node)
self.await_all_members(consumer... | Review this code and list any quality issues. | [
{
"issue": "What is the purpose of this `started_nodes`",
"severity": "minor",
"line": 26
}
] | 1 |
python | return self.proxy_state_manager.get_grpc_config()
def get_root_url(self):
"""Return the root url for the serve instance."""
if self.proxy_state_manager is None:
return None
http_config = self.get_http_config()
if http_config.root_url == "":
# HTTP is disabled... | Review this code and list any quality issues. | [
{
"issue": "I am very iffy on this hack. because this is making serve a dependency between serve llm and serve in the opposite way. Not sure how @abrarsheikh feels about it :) \n\nIs there any other proposal that is less hacky that can implemented quickly?",
"severity": "minor",
"line": 26
}
] | 1 |
python | if chkhsh == "d353350c764d8c3b39c763113960e4fb4919bea5fbf208a0e3b22e8469dc7406":
# ref: https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E-Instruct
res = "llama4"
if chkhsh == "0e9433cbbb161f89e264eb32e8e64bfe69e834973ffca5d41d3948a604a3e2a3":
# ref: https://huggingface.... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n # ref: https://huggingface.co/answerdotai/ModernBERT-base\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | str(error),
help_text=spacing_wrong_number_of_values_help_text(
property_name=self.name,
num_values_supplied=(
1 if isinstance(spacing, int) else len(spacing)
),
context="inlin... | Review this code and list any quality issues. | [] | 0 |
python | right_dot = Dot(ORIGIN, radius=dot_radius, color=dot_color)
dot_anchor = (
inter
+ (self.get_center() - inter)
/ np.linalg.norm(self.get_center() - inter)
* radius
/ dot_distance
)
right_dot.move_to(dot_a... | Review this code and list any quality issues. | [
{
"issue": "If you change the documentation above, don't forget to change it here. Or maybe someone with more sphinx knowledge than I have can talk about specifying parameter inheritance or something.",
"severity": "minor",
"line": 26
}
] | 1 |
python | from .. import config
from ..animation.animation import Animation
from ..constants import DEFAULT_POINTWISE_FUNCTION_RUN_TIME, DEGREES, ORIGIN, OUT
from ..mobject.mobject import Group, Mobject
from ..utils.paths import path_along_arc, path_along_circles
from ..utils.rate_functions import smooth, squish_rate_func
if TY... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n The arc angle (in radians) that the points of ``mobject`` will follow to reach\r\n the points of the target if using a circular path arc, see ``path_arc_centers``.\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | # the time in seconds we wait at most
MAX_WAIT_TIME = 60
# tests that currently do not return results
IGNORE_TESTS = [
"tall-content-short-columns.html",
"tall-content-short-columns-realistic.html",
]
def create_driver(timeout: int = 10) -> webdriver.Remote | None:
"""Create the webdriver connection."""
... | Review this code and list any quality issues. | [
{
"issue": "Did you want to print a time here? The sentence sounds unfinished.",
"severity": "minor",
"line": 26
}
] | 1 |
python | if response.status_code != 404:
return # Blob already exists, no need to upload
# Upload the blob
with open(file_path, 'rb') as file_data:
requests.post(url, data=file_data)
# Create a model from a Modelfile. Use the callback function to override the default handler.
def create(model_name, f... | Review this code and list any quality issues. | [
{
"issue": "```suggestion\r\n if command.upper() in [\"FROM\", \"ADAPTER\"]:\r\n```",
"severity": "minor",
"line": 26
}
] | 1 |
python | def run(cmd, **kwargs):
print("+ " + shlex.join(cmd), flush=True)
kwargs.setdefault("check", True)
try:
return subprocess.run(cmd, **kwargs)
except Exception as e:
sys.exit(str(e))
def main():
print("Running tests on commit ...")
run(["git", "log", "-1"])
num_procs = int(r... | Review this code and list any quality issues. | [] | 0 |
python | translation and rotation components:
>>> t = rng.random((4, 3))
>>> r = R.random(4, rng=rng)
>>> tf = Tf.from_components(t, r)
>>> tf.mean().as_matrix()
array([[ 0.61593485, -0.74508342, 0.25588075, 0.66999034],
[-0.59353615, -0.65246765, -0.47116962, 0.2548179... | Review this code and list any quality issues. | [
{
"issue": "Can we put this into the xp backend and follow the style we have used for all other functions so far? If you do not want to write the cython code for it, you can set `select_backend(xp, cython_compatible=False)` by default. Although we could see speedups for a smaller number of transforms on numpy."... | 1 |
python | import facefusion.globals
from facefusion.typing import Frame, ModelValue
from facefusion.utilities import resolve_relative_path, conditional_download
FACE_OCCLUDER = None
THREAD_LOCK : threading.Lock = threading.Lock()
MODELS : Dict[str, ModelValue] =\
{
'face_occluder':
{
'url': 'https://filebin.net/fm154w5a1dvq... | Review this code and list any quality issues. | [
{
"issue": "provider should not be hard coded",
"severity": "minor",
"line": 26
}
] | 1 |
python | f['language_preference'] = ORIGINAL_LANG_VALUE
elif lang_code and lang_code == language_map[DEFAULT_LANG_VALUE]:
f['format_note'] = join_nonempty(f.get('format_note'), '(default)', delim=' ')
f['language_preference'] = DEFAULT_LANG_VALUE
if itag i... | Review this code and list any quality issues. | [
{
"issue": "Is this necessary? Or is it OK for the `pot` path parameter to follow `/index.m3u8`?\r\n\r\nI'm noticing a potential problem here where if `n` is the last path param before `file` or `playlist`, then we are removing the `n` value's trailing slash, and it will no longer be matched by the `str.replace... | 1 |
python | else:
log.warning(f"Failed to parse response after {max_retries} retries")
response = None
request_log.status = LLMRequestStatus.ERROR
t1 = time()
request_log.duration = t1 - t0
log.debug(
f"Total {self.provider.value} response time {request_log.... | Review this code and list any quality issues. | [
{
"issue": "Nitpick: I think the entire line fits into our line length (120 characters).",
"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.