language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
"""Diagnostics support for Met.no integration.""" from typing import Any from homeassistant.components.diagnostics import async_redact_data from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE from homeassistant.core import HomeAssistant from .coordinator import MetWeatherConfigEntry TO_REDACT = [ CONF...
Review this code and list any quality issues.
[]
0
python
feature["token_type_ids"] = token_type_ids[i] features: Dict[str, "torch.Tensor"] = super().__call__(features) if self.model is not None and hasattr(self.model, "get_rope_index"): # for qwen2vl mrope features["position_ids"], features["rope_deltas"] = self.model.get_rope_index( ...
Review this code and list any quality issues.
[ { "issue": "We recommend to build pos ids before https://github.com/hiyouga/LLaMA-Factory/blob/382e932228d1bcfcdee0a25ee3f1977226f1c433/src/llamafactory/data/collator.py#L133 and let data collator to pad this", "severity": "minor", "line": 26 } ]
1
python
'url': 'https://video.hockeycanada.ca/en/c/mwc-remembering-the-wild-ride-in-riga.112307', 'info_dict': { 'id': '112307', 'title': 'MWC: Remembering the wild ride in Riga', 'ext': 'mp4', 'duration': 322, 'timestamp': 1716235607, 'upload_date...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'thumbnail': r're:^https?://wpmedia01-a\\.akamaihd\\.net/en/asset/public/image/.+',\r\n```", "severity": "minor", "line": 26 } ]
1
python
import re from typing import Any from jinja2 import BaseLoader, Environment from pydantic import Field from backend.data.block import Block, BlockCategory, BlockOutput, BlockSchema from backend.util import json jinja = Environment(loader=BaseLoader()) class MatchTextPatternBlock(Block): class Input(BlockSchema...
Review this code and list any quality issues.
[ { "issue": "nit: does this actually work on any", "severity": "minor", "line": 15 } ]
1
python
"ModelRunnerOutput", tuple["SchedulerOutput", "GrammarOutput", "IntermediateTensors"], ]: # This method is used by Ray Compiled Graph to execute the model, # and it needs a special logic of self.setup_device_if_necessary() self.setup_device_if_necessary() ...
Review this code and list any quality issues.
[ { "issue": "I think this makes sense but we probably want to update the comment here; `mm_features` are not raw images but rather preprocessed multimodal data.", "severity": "minor", "line": 26 } ]
1
python
'channel': 'deutschlandfunk' } }, { 'info_dict': { 'id': '47e1a096', 'title': r're:Rückkehr Russlands im Fechten [-/] "Fassungslos, dass es einfach so passiert ist"', 'ext': 'mp3', 'duration': 602...
Review this code and list any quality issues.
[ { "issue": "`skip_download` isn't needed for playlist tests\r\n```suggestion\r\n 'params': {'skip_download': 'm3u8'}\r\n```", "severity": "minor", "line": 26 } ]
1
python
# Form / Copyable Text # Use copyable text component to enable user quick text copy pasting. # #copyable_text # --- from h2o_wave import site, ui multiline_content = '''Wave is truly awesome. You should try all the features!''' big_multiline_content = '''Wave is truly awesome. You should try all the features! Like ha...
Review this code and list any quality issues.
[]
0
python
backend: str, sigpaths: List[str], should_save_workspace=False, disable_progress=False, ) -> FeatureExtractor: """ raises: UnsupportedFormatError UnsupportedArchError UnsupportedOSError """ if format_ not in (FORMAT_SC32, FORMAT_SC64, FORMAT_CAPE): if not is_suppor...
Review this code and list any quality issues.
[ { "issue": "`encoding` doesn't have any meaning if the text file is not opened in text mode (`rt`). recommend sticking to binary mode (`rb`) and letting json decode from utf-8, as expected.\r\n\r\n```suggestion\r\n with open(path, \"rb\") as f:\r\n```", "severity": "minor", "line": 26 } ]
1
python
cached_storage = _get_from_cache_by_id(storage_class=storage_class, id=id) if cached_storage: return cached_storage # Purge on start if configured if configuration.purge_on_start: await storage_client.purge_on_start() # Lock and create new storage async with _creation_lock:...
Review this code and list any quality issues.
[ { "issue": "It looks kind of strange as the arguments for the `__init__` are now redundant as the storage_info contains first two args as well. Maybe it would be more suitable to create an alternate constructor. \r\n\r\n(Btw. there is a risk that redundant and directly passed arguments `id` or `name` would not...
1
python
else: return torch.device("cuda" if torch.cuda.is_available() else "cpu") class Dropout(nn.Dropout): def forward(self, input: torch.Tensor) -> torch.Tensor: if self.p == 0.0: return input else: return F.dropout(input, self.p, self.training, self.inplace) class Lay...
Review this code and list any quality issues.
[ { "issue": "This would actually need to be:\r\n\r\n```suggestion\r\n if elementwise_affine or (elementwise_affine is None and self.config.layer_norm_with_affine):\r\n```", "severity": "minor", "line": 26 } ]
1
python
import re from .common import InfoExtractor from ..utils import ( clean_html, float_or_none, get_element_by_class, get_element_by_id, get_element_html_by_class, get_elements_by_class, int_or_none, unified_timestamp, urlencode_postdata, ) class NubilesPornIE(InfoExtractor): _NE...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n _VALID_URL = r'''(?x)\r\n https://members.nubiles-porn.com/video/watch/(?P<id>\\d+)\r\n (?:/(?P<display_id>[\\w\\-]+-s(?P<season>\\d+)e(?P<episode>\\d+)))?\r\n '''\r\n```\r\nURL need not have display_id", "severity": "minor", "line": 19 } ]
1
python
w2_weight_scale=w2_weight_scale, layer=layer, ) @pytest.mark.parametrize("m,n,k", MNK_FACTORS) @pytest.mark.parametrize("e", NUM_EXPERTS) @pytest.mark.parametrize("topk", TOP_KS) @pytest.mark.parametrize("activation", [MoEActivation.SILU, MoEActivation.RELU2_NO_MUL]) def test_flashinfer_per_tensor...
Review this code and list any quality issues.
[]
0
python
import os import sys if os.name != "posix": sys.exit(0) import _posixshmem name = f"/rp_posixshmem_{os.getpid()}" fd = _posixshmem.shm_open(name, os.O_CREAT | os.O_EXCL | os.O_RDWR, 0o600) os.close(fd) _posixshmem.shm_unlink(name)
Review this code and list any quality issues.
[]
0
python
f"Check logs for OOM or other errors in the checkpoint subprocess.") raise RuntimeError(f"[{ENGINE_NAME}] Checkpoint commit timed out after {timeout_seconds} seconds. " f"Process alive: {self._check_process_alive()}") def create(self, info: CheckpointCommitInfo): self.co...
Review this code and list any quality issues.
[ { "issue": "This condition is also checked by the new `_check_process_alive()` and so there seems to be some redundancy and inconsistency.", "severity": "minor", "line": 26 } ]
1
python
.. manim :: UnwriteReverseTrue class UnwriteReverseTrue(Scene): def construct(self): text = Tex("Alice and Bob").scale(3) self.add(text) self.play(Unwrite(text,reverse=True)) """ def __init__( self, vmobject: VMobject, ...
Review this code and list any quality issues.
[ { "issue": "These two will already saved in the parent class: https://github.com/aebkea/manim/blob/unwrite/manim/animation/creation.py#L273-L274", "severity": "minor", "line": 26 } ]
1
python
if len(self.nodes_manager.slots_cache[slot]) < 2: return None node_idx = 1 else: node_idx = 0 return slot_cache[node_idx] def keyslot(self, key: EncodableT) -> int: """ Find the keyslot for a given key. See: https://redis.io/docs/man...
Review this code and list any quality issues.
[ { "issue": "I know that Python is dynamic, but do we really need to check type? It's clearly defined in signature and the argument is required, IDE should highlight that wrong type is given and we shouldn't expect that someone uses it by violating an API.\r\n\r\nAgain given the fact that property is public and ...
1
python
a_format.update({ 'width': int(m.group('width')), 'height': int(m.group('height')), }) def is_logged_in(self): return bool(self._get_cookies(self._API_BASE).get('auth_token')) def _call_api(self, path, video_id, query={}, graphql=False): cookies = se...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n result, last_error = None, None\r\n```", "severity": "minor", "line": 26 } ]
1
python
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence Parameters ---------- lw : float or list of floats """ if lw is None: lw = self._get_default_linewidth() ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n If a list, the individual elements are assigned to the elements of the\n```", "severity": "minor", "line": 26 } ]
1
python
return { **formats[0], 'fps': int_or_none(info.get('frameRate')), 'width': int_or_none(info.get('width')), 'height': int_or_none(info.get('height')), 'vcodec': vcodec, 'acodec': acodec, 'tbr': float_or_none(info.get('avgBitrate')), ...
Review this code and list any quality issues.
[ { "issue": "It looks to me like all these three should be merged into a single function", "severity": "minor", "line": 26 } ]
1
python
) -> Dict[DataNodeConfig, DataNode]: data_node_configs = [Config.data_nodes[dnc.id] for dnc in data_node_configs] dn_configs_and_owner_id = [] for dn_config in data_node_configs: scope = dn_config.scope owner_id: Union[Optional[SequenceId], Optional[ScenarioId], Optional[...
Review this code and list any quality issues.
[ { "issue": "I don't understand the way of getting the config id from a config.", "severity": "minor", "line": 26 } ]
1
python
in_attr = list(get_elements_by_attribute('data', 'video-tag', elem)) return list(filter(None, map(clean_html, in_class or in_attr))) def _extract_page_tags(self, webpage): tags = self._html_search_meta('article:tag', webpage) or '' return list(filter(None, map(lambda x: x.strip(), tags.spli...
Review this code and list any quality issues.
[ { "issue": "appropriate changes to valid_url will make these redundant", "severity": "minor", "line": 26 } ]
1
python
'instead of the id, but the id depends on the date.', }, { 'url': 'https://rtrfm.com.au/show-episode/breakfast-2021-11-11/', 'md5': '396bedf1e40f96c62b30d4999202a790', 'info_dict': { 'id': 'breakfast-2021-11-11', 'ext': 'mp3', ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'skip_download': 'This audio has expired',\r\n```", "severity": "minor", "line": 26 } ]
1
python
@property def account(self): account = db.session.query(Account).where(Account.id == self.account_id).first() return account @property def annotation_create_account(self): account = db.session.query(Account).where(Account.id == self.account_id).first() return account class...
Review this code and list any quality issues.
[ { "issue": "```suggestion\nclass MessageAnnotation(TypeBase):\n```\n\nConsider also changing this?", "severity": "minor", "line": 26 } ]
1
python
'duration': 5180.184, 'thumbnail': r're:^https?://.+', 'title': 'Day 1: Opening Session of the Grand Jury Proceeding', 'timestamp': 1644080997.164, 'upload_date': '20220205', } }, { 'url': 'https://gettr.com/streaming/psfmeefcc1', 'info_dict': ...
Review this code and list any quality issues.
[ { "issue": "make the `_call_api` function return the `['result']`", "severity": "minor", "line": 26 } ]
1
python
from typing import List, Any, Optional, Set import json import logging from langchain_core.documents import Document from langchain_core.retrievers import BaseRetriever from pydantic import Field, PrivateAttr logger = logging.getLogger(__name__) DEFAULT_QUESTION_REFORMULATION_TEMPLATE = """Given the original questio...
Review this code and list any quality issues.
[ { "issue": "Just curious, did you come up with this prompt yourself or is it a known prompt?", "severity": "minor", "line": 11 } ]
1
python
}, { 'url': 'https://rumble.com/live-videos', 'playlist_mincount': 19, 'info_dict': { 'id': 'live-videos', 'title': 'Live Videos', 'description': 'Live videos on Rumble.com', 'age_limit': 0, }, }, { 'url': 'https://rumble.com/se...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n try:\r\n url_info = next(RumbleEmbedIE.extract_from_webpage(self._downloader, url, webpage))\r\n```", "severity": "major", "line": 26 } ]
1
python
- Undo and Reset: Click the center of the chart to return to the top level. Start exploring and discover interesting trends in the data! """ gr.Markdown(topic_markdown) frame = """ <iframe width="100%" scrolling="no" style="height: 800px; bo...
Review this code and list any quality issues.
[ { "issue": "Let's probably not push this info here. it'll be hard to maintain/update.", "severity": "minor", "line": 26 } ]
1
python
self._idx: int = sensor_idx self._manager: SensorManager = sensor_manager self._cache_idx: int = -1 # cache_idx is set by the SensorManager during the scene build phase # =============================== implementable methods =============================== @gs.assert_unbuilt def build(sel...
Review this code and list any quality issues.
[ { "issue": "0 by default; something like lidar have `n`, and imu has `0` (special return processing)", "severity": "minor", "line": 26 } ]
1
python
class TriangleExample(Scene): def construct(self): triangle_1 = Triangle() triangle_2 = Triangle().scale(2).rotate(60*DEGREES) tri_group = Group(triangle_1, triangle_2).arrange(buff=1) self.add(tri_group) """ def __init__(self, **kwarg...
Review this code and list any quality issues.
[ { "issue": "Add typings in the function parameters\r\nSee: https://docs.manim.community/en/latest/contributing/typings.html", "severity": "minor", "line": 26 } ]
1
python
recv_object_tensor, recv_object_size_tensor.item()) if ( isinstance(unpickle_object, torch.Tensor) and unpickle_object.device.index != torch.cuda.current_device() ): unpickle_object = unpickle_object.cuda() return unpickle_object def _check_if_fast_send_av...
Review this code and list any quality issues.
[ { "issue": "I didn't find another stream. I think the synchronization is not necessary, right?", "severity": "minor", "line": 26 } ]
1
python
return self.__started_time def take_buf(self) -> list[rtc.AudioFrame]: frames = self.__acc_frames self.__acc_frames = [] return frames def __aiter__(self) -> AsyncIterator[rtc.AudioFrame]: return self async def __anext__(self) -> rtc.AudioFrame: frame = await self....
Review this code and list any quality issues.
[ { "issue": "if I understand correctly, the issue is the silent duration is not counted when both input and output buffers are empty. so it's not only the duration after the first response to the time user enables the mic, but also before the first response generated (LLM + TTS time).\n\ncan we record the time t...
1
python
buckets = [(args.resolution, args.resolution)] logger.info(f"Using parsed aspect ratio buckets: {buckets}") # Dataset and DataLoaders creation: train_dataset = DreamBoothDataset( instance_data_root=args.instance_data_dir, instance_prompt=args.instance_prompt, class_prompt=args.class...
Review this code and list any quality issues.
[ { "issue": "This seems like an FSDP-agnostic change. I don't think we have to guard it?", "severity": "minor", "line": 26 } ]
1
python
# Modify original dict session_state["value"] = 2 session_state["new_key"] = "added" # Changes should be reflected in RunOutput assert run_output.session_state == {"value": 2, "new_key": "added"} # Event should get updated state event = create_run_completed_event(from_run_response=run_output) ...
Review this code and list any quality issues.
[]
0
python
ALL FIELDS MUST BE `openai_` PREFIXED SO YOU CAN MERGE THEM WITH OTHER MODELS. """ openai_supports_strict_tool_definition: bool = True """This can be set by a provider or user if the OpenAI-"compatible" API doesn't support strict tool definitions.""" openai_supports_sampling_settings: bool = True ...
Review this code and list any quality issues.
[ { "issue": "This is specific to `OpenAIChatModel` and doesn't affect `OpenAIResponsesModel` so let's prefix with `openai_chat_`", "severity": "minor", "line": 26 } ]
1
python
The azimuthal angle to start and end at. u_min The radius at the apex. checkerboard_colors Show checkerboard grid texture on the cone. Examples -------- .. manim:: ExampleCone :save_last_frame: class ExampleCone(ThreeDScene): def construct(self): ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n v_range: tuple[float, float] = (0, TAU),\n```", "severity": "minor", "line": 26 } ]
1
python
["fold1 (AUC = 0.80)", "fold2 (AUC = 0.70)"], ), (None, ["fold1", "fold2"], [{"c": "blue"}, {"c": "red"}], ["fold1", "fold2"]), ], ) def test_roc_curve_display_default_labels( pyplot, roc_auc, name, curve_kwargs, expected_labels ): """Check the default labels used in the display.""" fpr ...
Review this code and list any quality issues.
[ { "issue": "Note that `pos_label` is not needed for roc_auc because it is the same regardless of `pos_label`, but it is needed for `average_precsion_score` (which will also use the `_check_pos_label_statistics` helper)", "severity": "major", "line": 26 } ]
1
python
path_vars = ( ('ANSIBLE_COLLECTIONS_PATHS', 'collections_paths', 'requirements_collections', '~/.ansible/collections:/usr/share/ansible/collections'), ('ANSIBLE_ROLES_PATH', 'roles_path', 'requirements_roles', '~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles'), ('ANSIBLE...
Review this code and list any quality issues.
[ { "issue": "@jessicamack around here, in particular, we would like to check the feature flag to tell if the indirect host counting is enabled. How do I do that?", "severity": "minor", "line": 26 } ]
1
python
padding=1, adn_ordering="A", act="SWISH", ), Convolution( spatial_dims=spatial_dims, in_channels=channel_in, out_channels=channel_out, strides=2, ke...
Review this code and list any quality issues.
[ { "issue": "Previous the `conv_out` didn't follow the activation layer, is this adding expected here?\r\nAlso will the name changing influence anything here?", "severity": "minor", "line": 26 } ]
1
python
formats = [i for i in formats if i.get('url')] if not formats: # fallback, should be barely used for url in set(traverse_obj(media_info, (..., {url_or_none}))): if 'label=' in url: format_id, resolution = self._search_regex( r'label=(\w+)&...
Review this code and list any quality issues.
[ { "issue": "We should also do this, since the `UserIE` is also using this function, so that video downloads are recorded under `WeiboIE` in the download archive\r\n```suggestion\r\n 'extractor_key': WeiboIE.ie_key(),\r\n 'extractor': WeiboIE.IE_NAME,\r\n 'formats': self._extract...
1
python
source_code = "" source_code_name = "" function_name = "" stack = [{"line": 1, "column": 1, "name": "", "lines": [], "offsets": []}] new_function_list = {} result = "" while True: if data...
Review this code and list any quality issues.
[ { "issue": "Is the source code Latin-1 encoded? Isn't it UTF-8 by default? It seems that at other places, e.g., when decoding `JERRY_DEBUGGER_EVAL_RESULT_END` or `JERRY_DEBUGGER_OUTPUT_RESULT_END`, UTF-8 encoding is used.", "severity": "critical", "line": 26 } ]
1
python
_TESTS = [{ 'url': 'https://www.croatian.film/en/films/74757', 'info_dict': { 'id': '1131431769', 'title': '\u201dPOTOP\u201d, r. Kristijan Krajn\u010dan , (EN + HRsub)', 'uploader': 'croatian.film', 'uploader_id': 'user94192658', 'uploader_url...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if errors := traverse_obj(api_data, ('errors', lambda _, v: v['code'])):\r\n```", "severity": "minor", "line": 26 } ]
1
python
type=str, default=None, help="Voice dir for tortoise model", ) args = parser.parse_args() # print the description if either text or list_models is not set check_args = [ args.text, args.list_models, args.list_speaker_idxs, args.list_language_idxs, ...
Review this code and list any quality issues.
[ { "issue": "just indentation changes from lines\r\n368-417 and\r\n420-531.\r\nUse hide whitespace to see changes better.", "severity": "minor", "line": 26 } ]
1
python
Currently, there are two backends supported: ANTLR, and Lark. The default setting is to use the ANTLR backend, which can be changed to Lark if preferred. Use ``backend="ANTLR"`` for the ANTLR-based parser, and ``backend="Lark"`` for the Lark-based parser. The ``...
Review this code and list any quality issues.
[ { "issue": "I guess this example can be removed, so that ANTLR remains the only dependency for this doctest. This is how it is done in the [`sample`](https://github.com/sympy/sympy/blob/395e820b114d2b169483354f1f4ee2f439faa292/sympy/stats/rv.py#L1063-L1160) function in [`stats/rv.py`](https://github.com/sympy/s...
1
python
else: self._attr_native_value = value self.last_changed_time = time elif self.vera_device.category == veraApi.CATEGORY_POWER_METER: self._attr_native_value = self.vera_device.power elif self.vera_device.is_trippable: tripped = self.vera_device.is_tripp...
Review this code and list any quality issues.
[ { "issue": "The Vera integration does not use `has_entity_name` pattern. However, setting both `_attr_name` and `_name` is redundant. The `_name` property is already handled by the parent `VeraEntity` class and setting it here will override the parent's implementation. Only `_attr_name` should be set, or consid...
1
python
Here's another example showing how to use this for more advanced things such as learning rate warm-up: .. code-block:: python # learning rate warm-up def optimizer_step(self, epoch, batch_idx, optimizer, optimizer_idx, optimize...
Review this code and list any quality issues.
[ { "issue": "doesn't on_tpu imply we already know device exists?", "severity": "minor", "line": 26 } ]
1
python
default=1, help="Tensor Parallelism Degree. Valid when using colossalai as dist plan.", ) parser.add_argument( "--placement", type=str, default='cpu', help="Placement Policy for Gemini. Valid when using colossalai as dist plan.", ) parser.add_argument( "--...
Review this code and list any quality issues.
[]
0
python
The final stroke opacity of the mobjects emitted from the broadcast, by default 0. initial_width The initial width of the mobjects, by default 0.0. remover Whether the given mobject should be removed from the scene after the animation, by default True. lag_ratio The time between each...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n mobject: \"VMobject\",\r\n```", "severity": "minor", "line": 26 } ]
1
python
video = self._download_json( 'https://%s/v1/ansvideos/findByUuid' % (base_api_tmpl % org), uuid, query={'uuid': uuid})[0] title = video['headlines']['basic'] is_live = video.get('status') == 'live' urls = [] formats = [] for s in video.get('streams', []):...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n f['format_id'] = 'rtmp-{:.0f}'.format(f['vbr'])\r\n```", "severity": "minor", "line": 26 } ]
1
python
def group( self, *args: t.Any, **kwargs: t.Any ) -> t.Union[t.Callable[[t.Callable[..., t.Any]], "Group"], "Group"]: """A shortcut decorator for declaring and attaching a group to the group. This takes the same arguments as :func:`group` and immediately registers the created group wi...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n (func,) = args\r\n```", "severity": "minor", "line": 26 } ]
1
python
assert uninstall_addon.call_count == 0 assert entry.state is ConfigEntryState.NOT_LOADED assert len(hass.config_entries.async_entries(DOMAIN)) == 0 assert "Failed to stop the Z-Wave JS app" in caplog.text stop_addon.side_effect = None stop_addon.reset_mock() create_backup.reset_mock() uninst...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n assert \"Failed to create a backup of the Z-Wave JS app\" in caplog.text\n```", "severity": "critical", "line": 26 } ]
1
python
for i in range(len(images)): start_index = image_num_patches_indices[i - 1] if i > 0 else 0 end_index = image_num_patches_indices[i] image_video_patches.append(image_pixel_values[start_index:end_index]) if len(videos) != 0 and video_pixel_values is not None: ...
Review this code and list any quality issues.
[ { "issue": "put this function before process_messages", "severity": "minor", "line": 26 } ]
1
python
run_span.set_attribute( 'final_result', ( final_result.output if isinstance(final_result.output, str) else json.dumps(InstrumentedModel.serialize_an...
Review this code and list any quality issues.
[ { "issue": "Do we need this here? On the state it's already a list right?", "severity": "minor", "line": 26 } ]
1
python
matched_ = [pattern_ for pattern_ in patterns_ if re.match(pattern_, name_)] assert len(matched_) <= 1, f'Got more than one matching patterns={matched_} for {name_}' if matched_: pattern_ = matched_[0] unmatched_patterns.discard(pattern_) return pattern_ retur...
Review this code and list any quality issues.
[]
0
python
---------- .. [1] :doi:`J. Cohen (1960). "A coefficient of agreement for nominal scales". Educational and Psychological Measurement 20(1):37-46. <10.1177/001316446002000104>` .. [2] `R. Artstein and M. Poesio (2008). "Inter-coder agreement for computational linguistics". Computa...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n warnings.warn(msg, UndefinedMetricWarning, stacklevel=2)\n return True\n return False\n```", "severity": "minor", "line": 26 } ]
1
python
params_list.append(f"{param.name}: {deref_value}") else: value: str = "" if param.value is None else param.value params_list.append(f"{param.name}: {value}") return params_list class VMRayExtractor(DynamicFeatureExtractor): def __init__(self, analysis: VMRayAnalysis): ...
Review this code and list any quality issues.
[]
0
python
# FunctionTransformer( # lambda x: torch.tensor(x.to_numpy().astype(np.float32), device="cuda")) # , # CalibratedClassifierCV( # RidgeClassifierCV(alphas=alphas), method="temperature" # ), # ) # with sklearn.config_context(array_api_dispatch=True): # ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n# We would be very interested by user feedback. Here are a few things you can\n```", "severity": "minor", "line": 26 } ]
1
python
) return self def apply_function_to_position(self, function): self.move_to(function(self.get_center())) return self def apply_function_to_submobject_positions(self, function): for submob in self.submobjects: submob.apply_function_to_position(function) return...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n \"\"\"Applies a complex function to a :class:`Mobject`.\r\n```", "severity": "minor", "line": 26 } ]
1
python
"thumbnail": "https://i.ytimg.com/vi/zEns2dWl00w/maxresdefault.jpg", "description": "The great lakes of Kenya are a major tourist attraction, and support the livelihoods of millions of residents. But in recent years, their levels have been steadily rising, wreaking havoc. \n\nAlexandria Majalla spoke to loc...
Review this code and list any quality issues.
[ { "issue": "Like count is int\r\n```suggestion\r\n 'like_count': int,\r\n```", "severity": "minor", "line": 26 } ]
1
python
assert not unexpected_gif_path.exists(), "Found an unexpected gif file at " + str( unexpected_gif_path ) expected_mp4_path = ( tmp_path / "videos" / "simple_scenes" / "480p15" / str(custom_name + ".mp4") ) assert expected_mp4_path.exists(), "mp4 file not found at " + str(expected_mp4_p...
Review this code and list any quality issues.
[]
0
python
''' def genDevId(): def genNumBlock(): return ''.join([str(random.randrange(10)) for i in range(6)]) return '-'.join([genNumBlock() for i in range(4)]) payload = { 'client_id': self._CLIENT_ID, 'recaptcha_pubkey': 'null', 'reca...
Review this code and list any quality issues.
[ { "issue": "why? This code is being commented out, no?", "severity": "minor", "line": 26 } ]
1
python
'queue1': queue1, 'queue2': queue2, 'queue3': queue3, } # Make queue1 and queue3 fail with different errors def bind_side_effect(connection, queue): if queue.name == 'queue1': raise ValueError("Queue1 binding failed") elif queue.na...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n \"delivery exchanges (2 sub-exceptions)\"\n```", "severity": "minor", "line": 26 } ]
1
python
tm.assert_extension_array_equal(result, expected) def test_comparison_methods_array(comparison_op, dtype, dtype2): op_name = f"__{comparison_op.__name__}__" a = pd.array(["a", None, "c"], dtype=dtype) other = pd.array([None, None, "c"], dtype=dtype2) result = comparison_op(a, other) # ensure ope...
Review this code and list any quality issues.
[ { "issue": "For this case of comparing with NA, we already have a dedicated test just above, so removing it here", "severity": "minor", "line": 26 } ]
1
python
""" boto-powered S3 client. """ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, **kwargs): from boto.s3.key import Key options = self._get_s3_config() options.update(kwargs) if aws_access_key_id: options['aws_access_key_id'...
Review this code and list any quality issues.
[ { "issue": "Please use self._s3 = None in the constructor, so that this check will be simply `if self._s3: return self._s3`", "severity": "minor", "line": 26 } ]
1
python
area_name = None if area.areaInfo and area.areaInfo.locationInfo: area_name = area.areaInfo.locationInfo.locationName if area_name: segments.append( Segment( id=str(area.areaID), name=area_name, ...
Review this code and list any quality issues.
[ { "issue": "The conversion of segment IDs to integers on line 200 could raise a ValueError if invalid (non-numeric) segment IDs are passed. While segment IDs normally originate from the device itself and should always be numeric strings, the method could receive invalid input from manual service calls or if the...
1
python
requests, replicas, endpoint=endpoint, metadata=metadata, timeout=timeout, retries=retries, ) return result else: self._logger.debug( f'no available connections for deployment {dep...
Review this code and list any quality issues.
[]
0
python
fatal=False) timestamp = unified_timestamp(self._html_search_regex( (r'<dt>\s*Uploaded\s*</dt>\s*<dd>([^<]+</dd>\s*<dd>[^<]+)', r'<dt>\s*Uploaded\s*</dt>\s*<dd>([^<]+)'), webpage, 'timestamp', default=None)) duration = parse_duration(self._html_search_regex( ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if video_type_description == 'Audio File':\r\n```", "severity": "minor", "line": 26 } ]
1
python
return content[0] if len(content) == 1 else content async def call_tool( self, name: str, tool_args: dict[str, Any], ctx: RunContext[Any], tool: ToolsetTool[Any], ) -> ToolResult: if self.tool_prefix: name = name.removeprefix(f'{self.tool_prefix}_') ...
Review this code and list any quality issues.
[ { "issue": "What do you think about putting `annotations` and `outputSchema` (see [source](https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/types.py#L850-L856)) in here as well, so that the user has access to everything exposed by the MCP server?\r\n\r\n```suggestion\r\n m...
1
python
class AsyncIteratorWriter: """Allow writing to an AsyncIterator using blocking I/O. The class implements a blocking write method writing to the async iterator, as well as a close and tell methods. In addition, the abort method can be used to abort any ongoing write operation. """ def __init__...
Review this code and list any quality issues.
[ { "issue": "Should you also check for `self._aborted` here?", "severity": "minor", "line": 26 } ]
1
python
}, 'playlist_mincount': 2, }, { 'url': 'https://abema.tv/video/title/193-132', 'info_dict': { 'id': '193-132', 'title': '真心が届く~僕とスターのオフィス・ラブ!?~', 'description': 'md5:9b59493d1f3a792bafbc7319258e7af8', }, 'playlist_mincount': 16, }, { ...
Review this code and list any quality issues.
[ { "issue": "With mincount, we can't know whether only the season has been downloaded.\r\n```suggestion\r\n 'playlist_count': 31,\r\n```", "severity": "minor", "line": 26 } ]
1
python
teams.remove('FIN') data['title'] = join_nonempty(join_nonempty(*teams, delim='-'), f"({strftime_or_none(data['timestamp'], '%Y-%m-%d')})", delim=' ') return data class VolejTVClubPlaylistIE(VolejTVBaseIE): IE_NAME = 'volejtv:club' _VALID_URL = r'https?://...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n for entry in traverse_obj(entries, ('data', lambda _, v: v['id'])):\r\n```", "severity": "minor", "line": 26 } ]
1
python
return None def _real_extract(self, url: str) -> dict[str, Any]: video_id: str = self._match_id(url) if re.search(r'(?:(programas|peliculas-e-documentais|informativos-g24|deportes|xeracion-zeta))', url, re.I): raise ExtractorError('''This category contains too many items. Pl...
Review this code and list any quality issues.
[ { "issue": "Why is this fatal?\r\nGenerally, all metadata should be non-fatal and using `traverse_obj`", "severity": "minor", "line": 26 } ]
1
python
python -m monai.bundle run_workflow --meta_file <meta path> --config_file <config path> # Set the workflow to other customized BundleWorkflow subclass: python -m monai.bundle run_workflow --workflow CustomizedWorkflow ... Args: workflow: specified bundle workflow name, should be a string o...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n raise ValueError(f\"Argument `workflow` must be a bundle workflow class name or subclass of BundleWorkflow, got: {workflow_name}.\")\r\n```", "severity": "minor", "line": 26 } ]
1
python
bool: True if the current process is the master process, False otherwise """ rank = dist.get_rank(group=process_group) return rank == 0 def is_node_master(self) -> bool: """ Check if the current process is the master process on the current node (local rank is 0). Re...
Review this code and list any quality issues.
[]
0
python
msg='Inventory {inventory_id} host facts: updated {updated_ct}, cleared {cleared_ct}, unchanged {unmodified_ct}, took {delta:.3f} s', add_log_data=True, ) def finish_fact_cache(destination, log_data, job_id=None, inventory_id=None): log_data['inventory_id'] = inventory_id log_data['updated_ct'] = 0 log_...
Review this code and list any quality issues.
[ { "issue": "This materializes all the ansible facts for all the hosts in the inventory into memory.\r\n\r\nWith the current structure, I believe you can avoid that by simply removing the `list(` and adding an `.iterator()` to the queryset. It won't load the queryset into memory right away. And the iterator allo...
1
python
import uvicorn from fastapi import FastAPI from verl.utils.net_utils import get_free_port logger = logging.getLogger(__file__) def get_max_position_embeddings(hf_config) -> int: max_len = getattr(hf_config, "max_position_embeddings", None) if max_len is None: text_config = getattr(hf_config, "text_c...
Review this code and list any quality issues.
[ { "issue": "we should keep sock alive here", "severity": "minor", "line": 26 } ]
1
python
instrument: InstrumentationSettings | bool | None = None, history_processors: Sequence[HistoryProcessor[AgentDepsT]] | None = None, event_stream_handler: EventStreamHandler[AgentDepsT] | None = None, **_deprecated_kwargs: Any, ): """Create an agent. Args: model: ...
Review this code and list any quality issues.
[ { "issue": "Ah here's the link! Let's explicitly call it `Pydantic validation context`, instead of \"Additional\"", "severity": "minor", "line": 26 } ]
1
python
is_suspicious, pattern = check_last_line_suspicious(content) assert is_suspicious assert pattern is not None assert "header start" in pattern def test_check_last_line_suspicious_colon(): """Test that content ending with colon is NOT flagged (removed due to false positives).""" content = "Some cont...
Review this code and list any quality issues.
[]
0
python
# SPDX-License-Identifier: Apache-2.0 # Standard from typing import Dict, Optional # Third Party import msgspec class AsyncLookupMsg(msgspec.Struct, tag=True): # type: ignore """Base class for async lookup messages""" def describe(self) -> str: return "" class LookupRequestMsg(AsyncLookupMsg): ...
Review this code and list any quality issues.
[]
0
python
drop_rate : float Drop rate of the MLP projection in MSA and FFN. attn_drop_rate : float Drop rate of attention. drop_path_rate : float Drop path rate. pre_norm : bool Whether to use pre_norm. Otherwise post_norm is used. global_pool : bool Whether to use global p...
Review this code and list any quality issues.
[ { "issue": "We don't use `References` any more.", "severity": "minor", "line": 26 } ]
1
python
warn(f'Incomplete chapter {idx}') elif chapters[-1]['start_time'] <= chapter['start_time'] <= duration: chapters.append(chapter) elif chapter not in chapters: issue = (f'{chapter["start_time"]} > {duration}' if chapter['start_time'] > duration ...
Review this code and list any quality issues.
[ { "issue": "This seems overengineered. Instead of passing functions, this can be done inline using `traverse_obj` in the caller, like this:\r\n```py\r\n scale_mili = functools.partial(float_or_none, scale=1000)\r\n generate_end = lambda point: point.get('timeRangeStartMillis') + point.get('markerD...
1
python
Args: trainer: A Trainer instance. mode: Search strategy to update the batch size: - ``'power'``: Keep multiplying the batch size by 2, until we get an OOM error. - ``'binsearch'``: Initially keep multiplying by 2 and after encountering an OOM error do a binary s...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n max_val: Maximum batch size limit, to prevent overly large or inefficient batch sizes.\r\n```", "severity": "major", "line": 26 } ]
1
python
from models.dataset import Document as DatasetDocument from models.model import App, AppAnnotationSetting, AppMode, Conversation, MessageAnnotation, UploadFile from models.oauth import DatasourceOauthParamConfig, DatasourceProvider from models.provider import Provider, ProviderModel from models.provider_ids import Data...
Review this code and list any quality issues.
[ { "issue": "Seems it's a general logic that can be used for any redis lock, can we move it to api/libs?", "severity": "minor", "line": 26 } ]
1
python
import random from typing import TYPE_CHECKING from crawlee._types import HttpHeaders from crawlee.fingerprint_suite._consts import ( COMMON_ACCEPT, COMMON_ACCEPT_LANGUAGE, PW_CHROMIUM_HEADLESS_DEFAULT_SEC_CH_UA, PW_CHROMIUM_HEADLESS_DEFAULT_SEC_CH_UA_MOBILE, PW_CHROMIUM_HEADLESS_DEFAULT_SEC_CH_UA_...
Review this code and list any quality issues.
[ { "issue": "I guess we should just enumerate whatever we consider to be common headers here.", "severity": "minor", "line": 26 } ]
1
python
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops._op import OpRunUnaryNum def sigmoid(x: np.ndarray) -> np.ndarray: result = np.empty_like(x) gt_zero = x > 0 le_zero = ~gt_zero result[gt_zer...
Review this code and list any quality issues.
[ { "issue": "The boolean mask x > 0 is computed twice on line 13 (once for indexing result, once for indexing x), causing unnecessary overhead. The mask should be computed once and reused for both operations.\n```suggestion\n pos_mask = x > 0\n neg_mask = ~pos_mask\n x_pos = x[pos_mask]\n x_neg = x[n...
1
python
service_calls: list[ServiceCall], target_lights: list[str], target_switches: list[str], condition_target_config: dict, entity_id: str, entities_in_target: int, condition: str, target_state: str, other_state: str, ) -> None: """Test the light state condition with the 'any' behavior.""...
Review this code and list any quality issues.
[ { "issue": "the downside of this approach is that if it got 2 calls, this will also pass. I would suggest keeping it as it was here.\n\nmaybe keep the old method `calls_after_trigger()`, and make `has_single_call_after_trigger()` just call it too, to that the rest of the test is kept simple.", "severity": "...
1
python
def test_output_locking_when_writeback_diff(self) -> None: with cache_dir() as workspace: for tag in range(0, 4): src = (workspace / f"test{tag}.py").resolve() with src.open("w") as fobj: fobj.write("print('hello')") with patch("black.M...
Review this code and list any quality issues.
[]
0
python
_registry: ClassVar[dict["NodeType", dict[str, type["Node"]]]] = {} def __init_subclass__(cls, **kwargs): # type: ignore[override] super().__init_subclass__(**kwargs) # Skip base class itself if cls is Node: return # Only register concrete subclasses that define node_ty...
Review this code and list any quality issues.
[ { "issue": "The `try ... except` statement should be remove. It seems unnecessary.", "severity": "minor", "line": 26 } ]
1
python
if json_data.get('error_subcode') == 'CLIENT_GEO': self.raise_geo_restricted(msg=message) elif json_data.get('error_code') == 'INVALID_POLICY_KEY' and not policy_key_extracted: policy_key = None store_pk(None) ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n (self._parse_brightcove_metadata(vid, vid['id'], headers)\r\n```", "severity": "minor", "line": 26 } ]
1
python
""" output = self.input_rearrange(self.qkv(x)) q, k, v = output[0], output[1], output[2] if self.attention_dtype is not None: q = q.to(self.attention_dtype) k = k.to(self.attention_dtype) if self.use_flash_attention: x = F.scaled_dot_product_attentio...
Review this code and list any quality issues.
[ { "issue": "Should be `att_mat = att_mat.masked_fill(causal_mask[:, :, : query.shape[-2], : query.shape[-2]] == 0, float(\"-inf\"))` ???", "severity": "minor", "line": 26 } ]
1
python
uf_arity = {} # Handle bare function heads (symbols that are functions but not called) for head in expr.atoms(UndefinedFunction): uf_arity.setdefault(str(head), None) # Handle function calls like f(a), g(x,y) if AppliedUndef is not None: calls = expr.atoms(AppliedUndef) else: ...
Review this code and list any quality issues.
[ { "issue": "You don't need a function here. This would probably be better:\r\n```python\r\nif not isinstance(pred, AppliedPredicate) or pred.function not in supported_predicates:\r\n continue\r\n```\r\nSingle line helper functions are generally not a good idea as they make the code less readable.", "sever...
1
python
path = Path(f"{STDIN_PLACEHOLDER}{str(path)}") if path.suffix == ".ipynb" and not jupyter_dependencies_are_installed( warn=verbose or not quiet ): continue if verbose: out(f'Found input source: "{path}"', fg="blue") source...
Review this code and list any quality issues.
[]
0
python
from cognee.infrastructure.databases.graph import get_graph_engine from cognee.infrastructure.engine.models.DataPoint import DataPoint from cognee.infrastructure.llm.LLMGateway import LLMGateway from cognee.modules.pipelines.tasks.task import Task from cognee.modules.engine.models.Entity import Entity from cognee.tasks...
Review this code and list any quality issues.
[ { "issue": "In general, let's try to make this object as light as possible, so we don't have more stuff in memory than needed.", "severity": "major", "line": 26 } ]
1
python
'ext': 'mp3', }, }, { 'url': 'https://francaisfacile.rfi.fr/fr/actualit%C3%A9/20250305-r%C3%A9concilier-les-jeunes-avec-la-lecture-gr%C3%A2ce-aux-r%C3%A9seaux-sociaux', 'md5': '4f33674cb205744345cc835991100afa', 'info_dict': { 'id': '202503...
Review this code and list any quality issues.
[ { "issue": "With the json data we can now extract some info. Additionally I would use the json ld data as a fallback:\r\n```suggestion\r\n return {\r\n 'id': audio_id,\r\n 'title': self._html_extract_title(webpage),\r\n **self._search_json_ld(webpage, audio_id, fatal=Fals...
1
python
import re from urllib import parse from .common import InfoExtractor from ..utils import ( extract_attributes, unified_timestamp, url_or_none, ) from ..utils.traversal import traverse_obj class N1InfoAssetIE(InfoExtractor): _VALID_URL = r'https?://best-vod\.umn\.cdn\.united\.cloud/stream\?asset=(?P<i...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\nimport urllib.parse\r\n```", "severity": "minor", "line": 2 } ]
1
python
'json_tricks': JSON_TRICKS_VERSION, 'pyyaml': PYYAML_VERSION, 'nni': NNI_VERSION } def version_check(expect: dict, raise_error: bool = False) -> None: current_ver = version_dump() for package in expect: # version could be list due to serialization exp_version: tuple | None =...
Review this code and list any quality issues.
[ { "issue": "function name is not clear, maybe `torch_version_is_2`?", "severity": "minor", "line": 26 } ]
1
python
'ext': 'mp4', 'timestamp': 1546387200, 'description': 'md5:8856ce10239161bd2596ac335b9f9bfb', 'upload_date': '20190102', 'title': 'Overnight Oats', 'creator': 'Genevieve Ko', 'thumbnail': r're:https?://\w+\.nyt.com/images/.*\.jpg', } }]...
Review this code and list any quality issues.
[ { "issue": "inline this traversal in the return\r\n\r\n*except* for the `videoSrc` URL, let's do format extraction first and keep that out of this dict\r\n\r\nalso `upload_date` is unnecessary as explained above, unless the `timestamp` value is unavailable on some pages", "severity": "major", "line": 26...
1
python
self.index.add(np.array(embeddings).astype(np.float32)) self.chunk_ids.extend([chunk.chunk_id for chunk in chunks]) # Save updated index await self._save_index() async def delete_chunk(self, chunk_id: str) -> None: if chunk_id not in self.chunk_ids: return ...
Review this code and list any quality issues.
[]
0
python
Returns: Detections: A new Detections object. Example: ```python import cv2 import supervision as sv from mmdet.apis import init_detector, inference_detector image = cv2.imread(<SOURCE_IMAGE_PATH>) model = init_detector(<CONFI...
Review this code and list any quality issues.
[ { "issue": "Could we make `id2label` `Optional` and make it `None` by default?", "severity": "minor", "line": 26 } ]
1
python
clone = copy.copy(self) # Combine with existing predicate using AND clone._predicate_expr = ( predicate_expr if clone._predicate_expr is None else clone._predicate_expr & predicate_expr ) return clone @PublicAPI class Datasource(_DatasourceProjecti...
Review this code and list any quality issues.
[ { "issue": "I think this example might confuse readers because it ignores the specified `parallelism`. Could you revise the example to make it simple but still valid?\r\n\r\nAlso, I think this example would be more illustrative if we explicitly listed the keyword-parameters rather than using **read_args.", ...
1
python
import json from .common import InfoExtractor from ..utils import ExtractorError, traverse_obj class CanalsurmasIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?canalsurmas\.es/videos/(?P<id>\d+)' _TESTS = [ { 'url': 'https://www.canalsurmas.es/videos/44006-el-gran-queo-1-lora-del-ri...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\nfrom ..utils import determine_ext, parse_iso8601, url_or_none\r\nfrom ..utils.traversal import traverse_obj\r\n```", "severity": "minor", "line": 4 } ]
1