language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
class BaseCloudLLMEntity(Entity): """Cloud LLM conversation agent.""" def __init__(self, cloud: Cloud[CloudClient], config_entry: ConfigEntry) -> None: """Initialize the entity.""" self._cloud = cloud self._entry = config_entry async def _prepare_chat_for_generation( self, ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n and last_message[\"role\"] == \"user\"\n```", "severity": "minor", "line": 26 } ]
1
python
# Since the C code does not support striding using strides. # The dimensions are used instead. X = _copy_array_if_base_present(X) # Convert the vector to squareform. _distance_wrap.to_vector_from_squareform_wrap(X, v) return v else: raise ValueError("The first argume...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n The triangle inequality states that for any three points ``i``, ``j``, and ``k``:\r\n ``D[i,k] <= D[i,j] + D[j,k]``\r\n```", "severity": "minor", "line": 26 } ]
1
python
i4.conjugate() A.conjugate() B0.conjugate() i4.cumprod() A.cumprod() A.cumprod(out=B1) i4.cumsum() A.cumsum() A.cumsum(out=B1) i4.max() A.max() A.max(axis=0) A.max(keepdims=True) A.max(out=B0) i4.mean() A.mean() A.mean(axis=0) A.mean(keepdims=True) A.mean(out=B0) i4.min() A.min() A.min(axis=0) A.min(keepdims=True)...
Review this code and list any quality issues.
[]
0
python
2000-01-01,1,2 2000-01-02,,4 2000-01-03,5,6 """ origin_df = pd.read_csv(io.StringIO(st), header=None) origin_df.columns = ["datetime", "a", "b"] origin_df.set_index("datetime", inplace=True, drop=True) df = origin_df.copy() CSZFillna(fields_group=None).__c...
Review this code and list any quality issues.
[ { "issue": "Why is this function required?", "severity": "minor", "line": 26 } ]
1
python
"""Delete a previously sent message.""" chat_id = self.get_target_chat_ids(chat_id)[0] message_id, _ = self._get_msg_ids(kwargs, chat_id) _LOGGER.debug("Delete message %s in chat ID %s", message_id, chat_id) deleted: bool = await self._send_msg( self.bot.delete_message, ...
Review this code and list any quality issues.
[]
0
python
def random_bitflip(data): data = list(data) data[random.randrange(len(data))] ^= (1 << (random.randrange(8))) return bytes(data) def get_fee(tx_size, feerate_btc_kvb): """Calculate the fee in BTC given a feerate is BTC/kvB. Reflects CFeeRate::GetFee""" feerate_sat_kvb = int(feerate_btc_kvb * Decim...
Review this code and list any quality issues.
[ { "issue": "tiny nit: if `duration < delay`, then `delay` should be set to duration?", "severity": "minor", "line": 26 } ]
1
python
async def async_step_usb(self, discovery_info: UsbServiceInfo) -> ConfigFlowResult: """Handle usb discovery.""" await self.async_set_unique_id(discovery_info.serial_number) self._abort_if_unique_id_configured() self.data[CONF_DEVICE] = discovery_info.device self.context["title_...
Review this code and list any quality issues.
[ { "issue": "The errors parameter is unnecessary for a confirmation-only dialog. Since you're calling _set_confirm_only() at line 55, this form cannot have errors. Remove the errors={} parameter from async_show_form for clarity and consistency with other confirmation dialogs.\n```suggestion\n\n```", "severit...
1
python
filename: checkpoint filename. Can contain named formatting options to be auto-filled. Example:: # save any arbitrary metrics like `val_loss`, etc. in name # saves a file like: my/path/epoch=2-val_loss=0.02-other_metric=0.03.ckpt >>> checkpoint_callback = Mo...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n appended with a version count starting with ``v1``.\r\n```", "severity": "minor", "line": 26 } ]
1
python
def test_wrong_target(self, questions_file): """Test error, when target fuction does not generate required column.""" with pytest.raises(ValueError) as exc_info: # target_fn will generate the "answer", but not ground truth. evaluate(data=questions_file, evaluators={"g": F1ScoreEv...
Review this code and list any quality issues.
[ { "issue": "I think these are more like unit-test instead of e2e tests.", "severity": "minor", "line": 26 } ]
1
python
if axis[0] == 0 and axis[1] == 0: # axis = [0, 0, z] case is common enough it's worth # having a shortcut sgn = 1 if axis[2] > 0 else -1 cos_a = math.cos(angle) sin_a = math.sin(angle) * sgn return [ [cos_a, sin_a, 0], [-sin_a, cos_a, 0], ...
Review this code and list any quality issues.
[ { "issue": "https://docs.manim.community/en/latest/contributing/documentation.html#adding-type-hints-to-functions-and-parameters Union[int, float]) to float", "severity": "minor", "line": 26 } ]
1
python
def test_group(self): class Index: def __init__(self, value): self.value = value def __index__(self): return self.value # A single group m = re.match('(a)(b)', 'ab') self.assertEqual(m.group(), 'ab') self.assertEqual(m.group...
Review this code and list any quality issues.
[ { "issue": "To reduce the diff: create a helper function that checks the match object directly:\r\n\r\n```py\r\ndef test_match_getitem(self):\r\n for ...:\r\n with self.subTest(...):\r\n self.do_test_match_getitem(match_fn, pat)\r\n\r\ndef do_test_match_getitem(self, match_fn, pat):\r\n ...
1
python
return self.pos_emb[:seq_len] # type: ignore pos_emb = self.rotary_emb(seq_len, device=device) self.register_buffer("pos_emb", pos_emb, persistent=False) return pos_emb def attention( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, attention_bias: Optional[torch.FloatTens...
Review this code and list any quality issues.
[ { "issue": "is F.scaled_dot_product_attention calling the desired flash attention kernel with keys and values having the attention head dim as 1?", "severity": "minor", "line": 26 } ]
1
python
string_data = serializers.serialize( format, [t1, t2, t3], use_natural_primary_keys=True, use_natural_foreign_keys=True, ) NaturalKeyThing.objects.all().delete() objs_with_deferred_fields = [] for obj in serializers.deserialize( format, string_data, handle_forward...
Review this code and list any quality issues.
[]
0
python
try: if self.ws: await self.ws.close() except Exception: _log.debug('Ignoring exception soft disconnecting from voice', exc_info=True) finally: self.ip = MISSING self.port = MISSING self.state = with_state s...
Review this code and list any quality issues.
[ { "issue": "Just to be clear, you're resetting the state to `set_guild_voice_state` here if it fails?", "severity": "critical", "line": 26 } ]
1
python
def test_status(): r = DataRequest() r.docs.extend([Document()]) r.add_exception(ValueError('intentional_error')) byte_array = DataRequestProto.SerializeToString(r) deserialized_request = DataRequestProto.FromString(byte_array) assert not deserialized_request.is_decompressed assert deserial...
Review this code and list any quality issues.
[ { "issue": "This should be callig the regular DataRequest contstructor, this is a unit test independent of the Proto optimization we have in serializer", "severity": "minor", "line": 26 } ]
1
python
import sys import re import requests import json prelines = 10 postlines = 10 def find_errors_in_log_file(): if len(sys.argv) < 2: print("Usage: python loganalysis.py <filename>") return log_file_path = sys.argv[1] with open(log_file_path, 'r') as log_file: log_lines = log_file.readlines() error...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n# prelines and postlines represent the number of lines of context to include in the output around the error\r\nprelines = 10\r\n```", "severity": "minor", "line": 7 } ]
1
python
kb_name = tool['source'] executor = skill_tool.get_command_executor() kb = _get_knowledge_base(kb_name, skill.project_id, executor) if not kb: raise ValueError(f"Knowledge base not found: {kb_name}") kb_table = executor.session.kb_controller.get_table(kb.name, kb.project_id...
Review this code and list any quality issues.
[ { "issue": "Would prefer to not have inline imports", "severity": "minor", "line": 26 } ]
1
python
# Close OpenGL window here instead of waiting for the main thread to # finish causing the window to stay open and freeze if renderer is not None and renderer.window is not None: renderer.window.close() if config["output_file"] is None: ...
Review this code and list any quality issues.
[ { "issue": "Wouldn't it be better to add the fix for colab right here? I.e.,\r\n\r\n```suggestion\r\n embed = config[\"media_embed\"]\r\n if embed is None and \"google.colab\" in str(get_ipython()):\r\n embed = True\r\n elif embed is None:\r\n ...
1
python
' [Line 1\n' ' LooooooooooongestLine2\n' ' LongerLine 3 ,\n' ' None]],\n' ' dtype=object)' ) def test_nested_array_repr(self): a = np.empty((2, 2), dtype=object) a[0, 0] = np.eye(2) a[0, 1] = np...
Review this code and list any quality issues.
[ { "issue": "Hypothesis is supposed to be thread-safe. I'd like to understand this a little better.", "severity": "minor", "line": 26 } ]
1
python
#!/usr/bin/env python3 """ Multi-node / multi-GPU Genesis ✕ PyTorch DDP demo ================================================= Single machine, 2 GPUs: torchrun --standalone --nnodes=1 --nproc_per_node=2 examples/ddp_multi_gpu.py """ import os, argparse, random, numpy as np import torch, torch.nn as nn, torch.dist...
Review this code and list any quality issues.
[ { "issue": "Could you add a description of what this script does, and how to check if it is working as expected?", "severity": "minor", "line": 3 } ]
1
python
import base64 import hashlib import itertools import functools import math import re from .common import InfoExtractor, SearchInfoExtractor from ..compat import ( compat_parse_qs, compat_urlparse, compat_urllib_parse_urlparse ) from ..utils import ( ExtractorError, filter_dict, float_or_none, ...
Review this code and list any quality issues.
[ { "issue": "I think we usually put classes at the top of the list", "severity": "minor", "line": 22 } ]
1
python
iframe = try_call(lambda: get_element_text_and_html_by_tag('iframe', webpage)[1]) or '' iframe_src = url_or_none(extract_attributes(iframe).get('src')) if not iframe_src: raise ExtractorError('No playlist or embed found in webpage') elif re.match(r'https?://(?:\w+\.)?...
Review this code and list any quality issues.
[ { "issue": "I'd do:\r\n```py\r\n entries.append({\r\n **entry,\r\n 'track_number': track_number,\r\n ...\r\n })\r\n```\r\nbut not a biggie", "severity": "minor", "line": 26 } ]
1
python
def as_oracle(self, compiler, connection, **extra_context): if not connection.features.supports_uuid4_function: raise NotSupportedError("UUID4 requires Oracle version 23ai or later.") return self.as_sql(compiler, connection, function="UUID", **extra_context) class UUID7(Func): function...
Review this code and list any quality issues.
[ { "issue": "This will help when grepping for `PY314` three years from now. :-)\n```suggestion\n # PY314: When dropping support for 3.14, remove the entire method.\n def as_sqlite(self, compiler, connection, **extra_context):\n```", "severity": "minor", "line": 26 } ]
1
python
if is_mapped(ti.task): # If we get here, it could be that we are moving from non-mapped to mapped # after task instance clearing or this ti is not yet expanded. Safe to clear # the db references. ti.clear_db_references(session=session) try: ...
Review this code and list any quality issues.
[ { "issue": "This is (now) just a formatting change, so lets undo it\r\n\r\n```suggestion\r\n if not schedulable.are_dependencies_met(session=session, dep_context=dep_context):\r\n```", "severity": "minor", "line": 26 } ]
1
python
from collections import OrderedDict from typing import Any, List, Optional, Tuple import torch import torch.cuda from torch.nn import Module from torch.utils._pytree import SUPPORTED_NODES, LeafSpec, TreeSpec, _is_leaf, tree_flatten, tree_map, tree_unflatten def tree_map_hf(fn: Any, pytree: Any): flat_args, spec...
Review this code and list any quality issues.
[ { "issue": "Do you need to update `_detach()` with `tree_flatten_hf()`?", "severity": "minor", "line": 26 } ]
1
python
from .common import InfoExtractor from ..utils import clean_html from ..utils.traversal import ( find_element, 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_]+)' ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n _TESTS = [{\r\n```", "severity": "minor", "line": 14 } ]
1
python
config_entry.add_to_hass(hass) await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done() assert config_entry.state is state @pytest.mark.parametrize( ("state", "exception"), [ ( ConfigEntryState.SETUP_RETRY, HTTPStatusError( ...
Review this code and list any quality issues.
[ { "issue": "The type annotation for `exception` parameter is inconsistent with the parametrized test data. The data includes both exception instances (lines 135-139) and an exception class (line 140). The type hint should be `type[Exception] | Exception` to accurately reflect what's being passed, or all test pa...
1
python
import base64 import binascii import datetime as dt import hashlib import hmac import json import os import urllib.parse from .common import InfoExtractor from ..utils import ExtractorError, int_or_none from ..utils.traversal import get_first, traverse_obj class GoPlayIE(InfoExtractor): _VALID_URL = r'https?://(...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\nclass GoPlayIE(InfoExtractor):\r\n IE_NAME = 'play.tv'\r\n IE_DESC = 'PLAY (formerly goplay.be)'\r\n```", "severity": "major", "line": 15 } ]
1
python
self._bind_var_val(on_action_name, on_action) on_action = on_action_name else: _warn("download() on_action is invalid.") content_str = self._get_content("Gui.download", content, False) self.__send_ws_download(content_str, str(name), str(on_action) if on_action...
Review this code and list any quality issues.
[ { "issue": "This should not be optional. ... or how come would it be?", "severity": "minor", "line": 26 } ]
1
python
def calc_last( sensor_values: list[tuple[str, float, State]], ) -> tuple[dict[str, str | None], float | None]: """Calculate last value.""" last_updated: datetime | None = None last_entity_id: str | None = None last: float | None = None for entity_id, state_f, state in sensor_values: if l...
Review this code and list any quality issues.
[ { "issue": "Empty sequences are false. Should be condensed to:\r\n```suggestion\r\n if sensor_values:\r\n```", "severity": "minor", "line": 26 } ]
1
python
return post, files class CustomWSGIRequest(WSGIRequest): multipart_parser_class = CustomMultiPartParser payload = FakePayload( "\r\n".join( [ "--boundary", 'Content-Disposition: form-data; name="name"', ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n # This assertion would FAIL without the multipart_parser_class change\n```", "severity": "critical", "line": 26 } ]
1
python
logger = get_logger() async def process_and_search(num_of_searches): start_time = time.time() await cognee.cognify() await asyncio.gather( *[ cognee.search(query_text="Tell me about AI", query_type=SearchType.GRAPH_COMPLETION) for _ in range(num_of_searches) ] ...
Review this code and list any quality issues.
[ { "issue": "You don't need `pathlib.Path` to wrap `join`.", "severity": "minor", "line": 26 } ]
1
python
Best for: Finding functions, classes, implementation patterns. Returns: Structured code information with context and relationships. **CYPHER**: Direct graph database queries using Cypher syntax. Best for: Advanced users, specific graph traversals, debugging. Retu...
Review this code and list any quality issues.
[]
0
python
), ((gu.ti_rotvec_to_quat, gu.ti_quat_to_rotvec), ([3], [4]), ((gs.EPS,), (gs.EPS,))), ): ti_args = [] for shape_arg in (*shape_args, shape_args[0]): ti_type = ti.Vector if len(shape_arg) == 1 else ti.Matrix ti_arg = ti_type.field(*shape_arg, dtype=gs.ti_float, shape=...
Review this code and list any quality issues.
[]
0
python
@pytest.mark.parametrize("storage_method", ["local", "s3"]) def test_snapshots_recovery(self, qdrant_container_factory, storage_method, tmp_path): """Test snapshot creation, download, and recovery with both local and S3 storage.""" if storage_method == "s3": # For S3 testing, we'd need a...
Review this code and list any quality issues.
[ { "issue": "I'm a bit confused if this does this steps:\n\n```sh\ndocker volume create snapshots\ndocker volume create tempdir\ndocker volume create storage\n\ndeclare DOCKER_IMAGE_NAME=qdrant-snapshots\n#declare DOCKER_IMAGE_NAME=qdrant/qdrant:snapshots\ndeclare CONTAINER_NAME=qdrant-snapshots-container\n\ndoc...
1
python
def run_test(self): self.log.info("basic tests using OP_TRUE challenge") self.log.info('getmininginfo') mining_info = self.nodes[0].getmininginfo() assert_equal(mining_info['blocks'], 0) assert_equal(mining_info['chain'], 'signet') assert 'currentblocktx' not in mining_i...
Review this code and list any quality issues.
[ { "issue": "Thanks for adding the helper. But now it's inconsistent with the `check_getblockchaininfo` helper. No strong preference for which style to use.\r\n\r\nMaybe make it `def check_getmininginfo(self, node_idx, signet_idx):` and `check_getblockchaininfo(self, node_idx, signet_idx) ` and put them above `r...
1
python
ImageStatsKeys.INTENSITY: None, } super().__init__(stats_name, report_format) self.update_ops(ImageStatsKeys.INTENSITY, SampleOperations()) def __call__(self, data): # Input Validation Addition if not isinstance(data, dict): raise TypeError(f"Input data must be ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n f\"Image data under '{self.image_key}' must have at least 3 dimensions, but got shape {image.shape}.\"\r\n```", "severity": "minor", "line": 26 } ]
1
python
hass, HOMEASSISTANT_DOMAIN, "deprecated_yaml", breaks_in_ha_version="2026.8.0", is_fixable=False, issue_domain=DOMAIN, severity=ir.IssueSeverity.WARNING, translation_key="deprecated_yaml", translation_placeholders={ "domain": DOMAIN, ...
Review this code and list any quality issues.
[]
0
python
to_return[k] = t bias_name = k.split("lora_")[0] + "bias" lora_bias_names.add(bias_name) elif "bias" in k: maybe_lora_bias[k] = t for k, t in maybe_lora_bias: if bias_name in lora_bias_names: to_return[bias_name] = t els...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if model_args.flash_attn:\r\n```", "severity": "minor", "line": 26 } ]
1
python
} ) return returned_memories parsed_messages = parse_messages(messages) if self.config.custom_fact_extraction_prompt: system_prompt = self.config.custom_fact_extraction_prompt user_prompt = f"Input:\n{parsed_messages}" else: system...
Review this code and list any quality issues.
[ { "issue": "**Note** this early return, added in PR #2744 means the the fact update llm call won't be made and means the test that expected two llm.generate_response calls now should only expect 1. That expectation is updated in this PR.", "severity": "minor", "line": 26 } ]
1
python
DEFAULT_CLOSE_ON_DISCONNECT_REASONS: list[rtc.DisconnectReason.ValueType] = [ rtc.DisconnectReason.CLIENT_INITIATED, rtc.DisconnectReason.ROOM_DELETED, rtc.DisconnectReason.USER_REJECTED, ] @dataclass class TextInputEvent: text: str info: rtc.TextStreamInfo participant: rtc.RemoteParticipant ...
Review this code and list any quality issues.
[ { "issue": "Can we make a dataclass containing both the participant and the track?", "severity": "minor", "line": 26 } ]
1
python
self._server._ws.emit( "message", payload, to=self.__get_ws_receiver(), ) time.sleep(0.001) except Exception as e: # pragma: no cover _warn(f"Exception raised in WebSocket communication in '{self.__f...
Review this code and list any quality issues.
[ { "issue": "@dinhlongviolin1 I'd like your input on this ...", "severity": "minor", "line": 26 } ]
1
python
# Extract the downloaded nightly version if os.path.isdir(destination_folder): print("The nightly folder {} has already been extracted.".format(destination_folder)) else: self.extract_nightly(nightlies_folder, destination_folder, destination_file) return self.get_executa...
Review this code and list any quality issues.
[]
0
python
# note: mergekit-extract-lora flip and transpose A and B # here we only need to transpose token_embd.lora_a, see llm_build_inp_embd() if "token_embd.weight" in dest_name: lora_a = lora_a.T yield (dest_name + ".lora_a", lora_a) ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n remote_hf_model_id=base_model_id,\r\n```", "severity": "minor", "line": 26 } ]
1
python
cast = [] for star in series_meta.get('starring', []): cast.append(strip_or_none(star.get('name'))) for star in series_meta.get('creator', []): cast.append(strip_or_none(star.get('name'))) for star in series_meta.get('writer', []): cast.append(strip_or_none(st...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n entries.append(self._entries('https://api.rctiplus.com/api/v2/program/%s/episode?season=%s' % (series_id, season['season']),\r\n display_id, 'Downloading season %s episode entries' % season['season'], metadata))\r\n\r\n entries...
1
python
assert waveform.dtype == np.float64 class TestSquareWaveform: def test_unique(self, xp): t = xp.linspace(0, 2*np.pi, 1000) y = waveforms.square(t) assert y.shape == t.shape unique = np.unique(y) assert set(unique).issubset({-1.0, 1.0}) def test_dtype(self, xp): ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n xp_assert_close(fraction_high, xp.asarray(duty, dtype=xp.float64)[()], rtol=1e-8)\r\n```", "severity": "minor", "line": 26 } ]
1
python
checkout_version = checkout elif kedro_version_match_starters: checkout_version = version else: checkout_version = "main" if "PySpark" in tools and "Kedro Viz" in tools: # Use the spaceflights-pyspark-viz starter if both PySpark and Kedro Viz are chosen. cookiecutter_args["d...
Review this code and list any quality issues.
[ { "issue": "Shouldn't this just be `cookiecutter_args[\"checkout\"] = checkout_version` as well?", "severity": "minor", "line": 26 } ]
1
python
# Check if path is relative and resolve it if not path.is_absolute(): path = (file_path.parent / path).resolve() # Skip if file does not exist for "model", this is handled by the server if not path.exists() and command == "FROM": ...
Review this code and list any quality issues.
[ { "issue": "the above example strips the newlines so join it back with newlines\r\n```suggestion\r\n modelfile_content = '\\n'.join(processed_lines)\r\n```", "severity": "minor", "line": 26 } ]
1
python
elif target_channels == "RG": if texture.shape[2] == 1: texture = np.repeat(texture, 2, axis=2) else: texture = texture[:, :, (0, 1)] elif target_channels == "GB": if texture.shape[2] == 1: texture = np.repeat(texture, 2, axis=2...
Review this code and list any quality issues.
[ { "issue": "Same `tx` us not a good variable name.", "severity": "minor", "line": 26 } ]
1
python
@pytest.mark.xfail_with_pyarrow_strings def test_to_hdf_distributed(c): pytest.importorskip("numpy") pytest.importorskip("pandas") from dask.dataframe.io.tests.test_hdf import test_to_hdf test_to_hdf() @ignore_sync_scheduler_warning @pytest.mark.parametrize( "npartitions", [ 1, ...
Review this code and list any quality issues.
[ { "issue": "This still seems to be problematic for me; I'm not sure why it could be removed.", "severity": "minor", "line": 26 } ]
1
python
llama_guard_shield: model: Llama-Guard-3-1B excluded_categories: [] disable_input_check: false disable_output_check: false enable_prompt_guard: false memory: - provider_id: provider1 provider_type...
Review this code and list any quality issues.
[]
0
python
def _is_param_for_specific_executor(key_name: str) -> bool: """Tell if a key is for a specific Executor ex: 'key' is for every Executor whereas 'my_executor__key' is only for 'my_executor' :param key_name: key name of the param :return: return True if key_name is for specific Executor, False otherwise...
Review this code and list any quality issues.
[]
0
python
def test_select_related_memory_leak(self): self.setup_gc_debug() list(Species.objects.select_related("genus")) self.assert_no_memory_leaks() def test_certain_fields(self): """ The optional fields passed to select_related() control which related models we pull in. Thi...
Review this code and list any quality issues.
[]
0
python
inputs = [] sampling_params = [] for tokens, audio_array in tokenized_list: num_samples = audio_array.shape[0] max_tokens = audio_config.num_audio_tokens(num_samples) - len(tokens) - 1 sampling_params.append(SamplingParams(temperature=0.0, max_tokens=max_tokens)) input_dict = {...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n@pytest.mark.skip(reason=\"Voxtral streaming is not yet public\")\n```", "severity": "minor", "line": 26 } ]
1
python
raise ValueError( "`dist_reduce_fx` must be callable or one of ['mean', 'sum', 'cat', None]" ) if isinstance(default, torch.Tensor): self.register_buffer(name, default) else: setattr(self, name, default) self._defaults[name] = deepcopy(defaul...
Review this code and list any quality issues.
[ { "issue": "@teddykoker @SkafteNicki also when we are using dist_sync_on_step as True, that should be a no_grad op. Since DDP will expect grads to be computed only for this GPU and then sync those when backpropagating.\r\n\r\nSo https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightnin...
1
python
@overload def __init__(self, model: torch.nn.Module, config_list: List[Dict], evaluator: Evaluator, existed_wrappers: Dict[str, ModuleWrapper] | None = None): ... def __init__(self, model: torch.nn.Module, config_list: List[Dict], evaluator: Evaluator, \ existed_wrappe...
Review this code and list any quality issues.
[ { "issue": "what if `quant_scheme` is None", "severity": "minor", "line": 26 } ]
1
python
def ltrim(col: "ColumnOrName") -> Column: """ Trim the spaces from left end for the specified string value. .. versionadded:: 1.5.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- col : :class:`~pyspark.sql.Column` or str target column to work on. ...
Review this code and list any quality issues.
[]
0
python
from typing import Dict, Iterator, List, Mapping, Optional, OrderedDict, Tuple import torch import torch.nn as nn from packaging.version import Version from torch.optim import Optimizer from torch.utils._pytree import tree_map from colossalai.tensor.d_tensor import ( is_customized_distributed_tensor, is_distr...
Review this code and list any quality issues.
[ { "issue": "group file is not essential to be safetensors, as it does not store tensors", "severity": "minor", "line": 26 } ]
1
python
# Create an instance to get the class, then call class methods reader_instance = reader_factory_method() reader_class = reader_instance.__class__ supported_strategies = reader_class.get_supported_chunking_strategies() supported_content_types = reader_class.get_supported_content_types() ...
Review this code and list any quality issues.
[ { "issue": "Do we need reader_id? it's not present in `reader`?", "severity": "minor", "line": 26 } ]
1
python
f.update({ 'abr': int(mobj.group(2)), 'ext': mobj.group(1).lower(), }) formats.append(f) for item in (try_get(episode, lambda x: x['audio']['items']) or []): item_url = item.get('url') if not (item_url and i...
Review this code and list any quality issues.
[]
0
python
updated_at=datetime.fromisoformat( comment.get('updated_at', '').replace('Z', '+00:00') ) if comment.get('updated_at') else datetime.fromtimestamp(0), system=False, # GitHub doesn't have system comments in the same ...
Review this code and list any quality issues.
[ { "issue": "should we put any reasonable limits on this? It could be a lot of data/tokens...", "severity": "minor", "line": 26 } ]
1
python
class OTLPMetricsExporterProvider(OTLPExporterProvider): def __init__(self, logger) -> None: super().__init__(logger, ExporterType.METRIC) def get_exporter(self, **kwargs): try: from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter class ...
Review this code and list any quality issues.
[ { "issue": "This part is duplicated. Can It be moved into a base class and make it work for both trace and metrics exporters?", "severity": "major", "line": 26 } ]
1
python
tool_call_approved=approved, partial_output=allow_partial, ) pyd_allow_partial = 'trailing-strings' if allow_partial else 'off' validator = tool.args_validator if isinstance(call.args, str): args_dict = validator.validate_json( ...
Review this code and list any quality issues.
[ { "issue": "- I don't think we need to repeat the tool name as the model will have it in context anyway (since this part becomes to the tool call result part)\r\n- `RetryPromptPart.model_response()` will already add a `Fix the errors and try again.` suffix, so the message would end in `Please try a different ap...
1
python
2, "Should be FOH16 on session with roll.") self.assertEqual(window.loc['2016-03-01', cf], 2, "Should be FOH16 on session after roll.") # Advance the window a month. window = self.data_portal.get_history_window( ...
Review this code and list any quality issues.
[]
0
python
clause = f"(implies d{enc} {pred_str})" assertion = f"(assert {clause})" assertions.append(assertion) declarations = "\n".join(declarations) assertions = "\n".join(assertions) s.from_string(declarations) s.from_string(assertions) return s known_functions = { Add: '+',...
Review this code and list any quality issues.
[ { "issue": "Something weird is going on down here. This line shouldn't be changed.", "severity": "minor", "line": 26 } ]
1
python
bootstrap = protect.bootstrap nvr_info = bootstrap.nvr auth_user = bootstrap.users.get(bootstrap.auth_user_id) # Check if API key is missing if not protect.is_api_key_set() and auth_user and nvr_info.can_write(auth_user): try: new_api_key = await protect.create_api_key( ...
Review this code and list any quality issues.
[ { "issue": "They should get the popup already when you raise `ConfigEntryAuthFailed` so I don't think we need to start it manually as well.\r\n\r\n```suggestion\r\n```", "severity": "critical", "line": 26 } ]
1
python
| Exception, ) -> None: """Handle notifications from the MCP server, invalidating caches as needed.""" if isinstance(message, mcp_types.ServerNotification): # pragma: no branch if isinstance(message.root, mcp_types.ToolListChangedNotification): self._cached_tools = None ...
Review this code and list any quality issues.
[ { "issue": "952 closed https://github.com/modelcontextprotocol/python-sdk/issues/952", "severity": "minor", "line": 26 } ]
1
python
Treatment for floating-point underflow. invalid : {'ignore', 'warn', 'raise', 'call', 'print', 'log'}, optional Treatment for invalid floating-point operation. Returns ------- old_settings : dict Dictionary containing the old settings. See also -------- seterrcall : Set a c...
Review this code and list any quality issues.
[ { "issue": "It's not really a safety note, it's more of a usage note. Maybe \"Concurrency notes\"?\n\nAlso concurrency is better because this all applies to asyncio as well.", "severity": "minor", "line": 26 } ]
1
python
_get_default_model_params(), remote_params=remote_params ) conversation1 = Conversation( messages=[ Message( content="Hello world!", role=Role.USER, ), Message( content="Hello again!"...
Review this code and list any quality issues.
[]
0
python
hidden_re = re.compile(r'API|TOKEN|KEY|SECRET|PASS', re.I) urlpass_re = re.compile(r'^.*?://[^:]+:(.*?)@.*?$') safe_env = dict(env) for k, v in safe_env.items(): if k == 'AWS_ACCESS_KEY_ID': continue elif k.startswith('ANSIBLE_') and not k.startswith('ANSIBLE_NET') and not k.star...
Review this code and list any quality issues.
[ { "issue": "Is `RESOURCE_SERVICE_PATH` a new setting? Do we need installer changes to add it?", "severity": "minor", "line": 26 } ]
1
python
previous_state: TaskInstanceState | None, task_instance: RuntimeTaskInstance | TaskInstance, error: None | str | BaseException, ): """Execute when task state changes to FAIL. previous_state can be None.""" @hookspec def on_task_instance_skipped( previous_state: TaskInstanceState | None, task_insta...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n (on_dag_run_success/on_dag_run_failed) which may have access to all task states.\n```", "severity": "critical", "line": 26 } ]
1
python
logger.debug(f"Columns in response: {df.columns.tolist()}") # Check if we have a rerank_model configured in KB params rerank_model = self._kb.params.get("rerank_model") if rerank_model and query_text: # Use reranker for relevance score try: logger.info(f"U...
Review this code and list any quality issues.
[ { "issue": "what kind of error we expect here? \r\nI would leave only expected exceptions. If user has error because openai balance is empty, should he know about it (and see this error)?", "severity": "minor", "line": 26 } ]
1
python
class SyncOrAsyncAuth(httpx.Auth): """ A mock authentication scheme that uses a different implementation for the sync and async cases. """ def __init__(self) -> None: self._lock = threading.Lock() self._async_lock = asyncio.Lock() def sync_auth_flow( self, request: http...
Review this code and list any quality issues.
[ { "issue": "is there a reason these were not marked `@pytest.mark.usefixtures(\"async_environment\")` ?", "severity": "minor", "line": 26 } ]
1
python
def deferred_tool(x: int) -> int: # pragma: no cover return x + 1 result = agent.run_sync('test early strategy') messages = result.all_messages() # Verify no tools were called after final result assert tool_called == [] # Verify we got tool returns for all calls ...
Review this code and list any quality issues.
[]
0
python
interaction = data['interaction'] self.id: int = int(interaction['id']) self._thinking: bool = interaction.get('response_message_loading', False) self._ephemeral: bool = interaction.get('response_message_ephemeral', False) self.message_id: Optional[int] = utils._get_as_snowflake(intera...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n message = resource.get('message')\r\n activity_instance = resource.get('activity_instance')\r\n if message is not None:\r\n self.resource = InteractionMessage(\r\n state=self._state,\r\n channel=s...
1
python
match = self._py_version_re.search(version) if match: version = version[: match.start()] py_version = match.group(1) if py_version != self._target_python.py_version: return ( LinkType.platform_mismatch, "Python version i...
Review this code and list any quality issues.
[ { "issue": "Do we need to still show cases where `Version` can’t parse the content? Maybe just put them to the end.\r\n\r\nAlternatively, maybe we should just try to do a `split(\".\")` and try to sort each parsable segment as int? Something like\r\n\r\n```python\r\ndef get_version_sort_key(v):\r\n return tu...
1
python
class TempoIE(InfoExtractor): _VALID_URL = r'https?://video\.tempo\.co/\w+/\d+/(?P<id>[\w-]+)' _TESTS = [{ 'url': 'https://video.tempo.co/read/30058/anies-baswedan-ajukan-banding-putusan-ptun-batalkan-ump-dki', 'info_dict': { 'id': '2144275', 'display_id': 'anies-baswedan...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n _, player_key, video_id = next(IVXPlayerIE._extract_embed_urls(url, webpage)).split(':')\r\n```", "severity": "major", "line": 26 } ]
1
python
return tlocal.oid @cached_property def amqp(self): """AMQP related functionality: :class:`~@amqp`.""" return instantiate(self.amqp_cls, app=self) @property def backend(self): """Current backend instance.""" if not hasattr(tlocal, 'backend'): tlocal.backend =...
Review this code and list any quality issues.
[ { "issue": "I'd like to see some validation that this comment is not longer relevant. The `celery.backend.asynchronous.BaseResultConsumer` class is used fairly broadly now and it sounds like messing this up would result in us losing results all over the place. If we have to fix it, I figure we can pass a specif...
1
python
def pin_lora(self, lora_id: int) -> bool: raise NotImplementedError def list_loras(self) -> set[int]: raise NotImplementedError @property def vocab_size(self) -> int: """Get vocabulary size from model configuration.""" return self.model_config.get_vocab_size() def shut...
Review this code and list any quality issues.
[]
0
python
from .common import InfoExtractor from ..utils import ( js_to_json, urlencode_postdata, urljoin, ) class JioSaavnBaseInfoExtractor(InfoExtractor): def _extract_initial_data(self, url, audio_id): webpage = self._download_webpage(url, audio_id) return self._search_json( r'win...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\nclass JioSaavnSongIE(JioSaavnBaseIE):\r\n```", "severity": "minor", "line": 17 } ]
1
python
result = DataFrame({"a": ["test"], "b": [np.nan]}) with pytest.raises(TypeError, match="Invalid value"): result.loc[:, "b"] = result.loc[:, "b"].astype("Int64") def test_iloc_setitem_list_with_cow(self): # GH#60309 with option_context("mode.copy_on_write", True): dft...
Review this code and list any quality issues.
[ { "issue": "Nit: Once the assignment is done, this is no longer a view. Can you change to just \"df\" instead of \"view\".", "severity": "minor", "line": 26 } ]
1
python
print('Loss: {} Accuracy: {}%'.format( test_loss, 100 * correct / len(test_loader.dataset))) print("Inference elapsed_time (whole dataset): {}s".format(time_elasped)) def post_training_quantization_example(train_loader, test_loader, device): model = NaiveModel() config = { 'conv1':{'weigh...
Review this code and list any quality issues.
[]
0
python
'title': 'md5:79f9c8183ea6a35c836923142cf0abcc', 'description': '', 'thumbnail': 'https://cdn.jwplayer.com/v2/media/W86PgQDn/thumbnails/B9gpIxkH.jpg', 'channel': 'León Picarón', 'channel_id': 'leonpicaron', 'timestamp': 1696460362, 'upload_date': '...
Review this code and list any quality issues.
[ { "issue": "Because fatal=False, error will not be raised when download_json fails if the video id does not exist. extract_m3u8_formats_and_subtitles will wait until timeout. This change is made to skip the process if video_data is not available.", "severity": "critical", "line": 26 } ]
1
python
Examples -------- >>> import numpy as np >>> from scipy.stats import expectile >>> a = [1, 4, 2, -1] >>> expectile(a, alpha=0.5) == np.mean(a) True >>> expectile(a, alpha=0.2) 0.42857142857142855 >>> expectile(a, alpha=0.8) 2.5714285714285716 >>> weights = [1, 3, 1, 1] >>...
Review this code and list any quality issues.
[ { "issue": "This was never really needed. It was just a way to save a bisection step, but I think the time savings is negligiible.", "severity": "minor", "line": 26 } ]
1
python
'x-hasura-user-id': '1', 'x-hasura-allowed-roles': ['user', 'editor'], 'x-hasura-default-role': 'user' }) claims_namespace_path = hge_ctx.hge_jwt_claims_ns_path if claims_namespace_path is None: self.claims['https://hasura.io/jwt/claims'] = claims ...
Review this code and list any quality issues.
[ { "issue": "This logic is repeated lot of places in the same file. If possible, can we abstract this into a new function and reuse it?", "severity": "major", "line": 26 } ]
1
python
return tokenizer(examples['text'], padding='max_length', truncation=True) tokenized_datasets = dataset.map(tokenize_function, batched=True) small_train_dataset = tokenized_datasets['train'].shuffle(seed=42).select(range(1000)) small_eval_dataset = tokenized_datasets['test'].shuffle(seed=42).select(range(1000)) from ...
Review this code and list any quality issues.
[ { "issue": "suggest to put these `import`s at the top, which would be more formal", "severity": "minor", "line": 26 } ]
1
python
_TESTS = [{ 'url': 'https://www.filmarchiv.at/de/filmarchiv-on/video/f_0305p7xKrXUPBwoNE9x6mh', 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)', 'info_dict': { 'id': 'f_0305p7xKrXUPBwoNE9x6mh', 'ext': 'mkv', 'title': 'Der Wurstel...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'url': 'https://www.filmarchiv.at/de/filmarchiv-on/video/f_0305p7xKrXUPBwoNE9x6mh',\r\n 'md5': '54a6596f6a84624531866008a77fa27a',\r\n 'info_dict': {\r\n 'id': 'f_0305p7xKrXUPBwoNE9x6mh',\r\n 'ext': 'mp4',\r\n 'title': 'Der Wurs...
1
python
IE_NAME = 'mave:channel' _VALID_URL = r'https?://(?P<id>[\w-]+)\.mave\.digital/?$' _TESTS = [{ 'url': 'https://budem.mave.digital/', 'info_dict': { 'id': 'budem', 'title': 'Все там будем', 'description': 'md5:f04ae12a42be0f1d765c5e326b41987a', }, ...
Review this code and list any quality issues.
[ { "issue": "This limits us to the first 50 entries. Example with more episodes: https://geekcity.mave.digital/\r\nInstead I would use the API and properly paginate https://api.mave.digital/v1/website/geekcity/episodes?view=all&page=1&sort=newest&format=all\r\n\r\nArguably even the single page extractor should h...
1
python
from crawlee._utils.docs import docs_group from crawlee.abstract_http_crawler._http_crawling_context import ParsedHttpCrawlingContext from crawlee.beautifulsoup_crawler._utils import html_to_text @dataclass(frozen=True) @docs_group('Data structures') class BeautifulSoupCrawlingContext(ParsedHttpCrawlingContext[Beauti...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n \"\"\"Convert the parsed HTML content to newline-separated plain text without tags.\"\"\"\r\n```", "severity": "minor", "line": 26 } ]
1
python
Joined = 4 def _create_partition_from_dict(d): topic = d["topic"] partition = d["partition"] return TopicPartition(topic, partition) class ConsumerEventHandler(object): def __init__(self, node, verify_offsets, idx, state=ConsumerState.Dead, revoked_count=0, assigned_count=0, assign...
Review this code and list any quality issues.
[ { "issue": "`ConsumerEventHandler` instantiates every consumer in `ConsumerState.Dead`. During the test, we sometimes read that state before the background thread emits `startup_complete`, so\n the test concluded “this node started and then shut down” even though it never left the default state.\n\n We now ke...
1
python
self.assertEqual(stderr, "") child_pid = int(stdout.strip()) perf_file = pathlib.Path(f"/tmp/perf-{process.pid}.map") perf_child_file = pathlib.Path(f"/tmp/perf-{child_pid}.map") self.assertTrue(perf_file.exists()) self.assertTrue(perf_child_file.exists()) perf_file_cont...
Review this code and list any quality issues.
[ { "issue": "Please remove this line to minimize diff.", "severity": "major", "line": 26 } ]
1
python
return True elif self._upgrade_strategy == "only-if-needed": user_order = _get_with_identifier( self._user_requested, identifier, default=None, ) return user_order is not None return False...
Review this code and list any quality issues.
[ { "issue": "Would a staticmethod work instead as the instance isn't used here? I'm not a huge fan of breaking this out into a helper function", "severity": "major", "line": 26 } ]
1
python
import yaml from awx.main.tests.live.tests.conftest import wait_for_events from awx.main.tasks.host_indirect import build_indirect_host_data from awx.main.models import Job def test_indirect_host_counting(live_tmp_folder, run_job_from_playbook): run_job_from_playbook('test_indirect_host_counting', 'run_task.yml...
Review this code and list any quality issues.
[]
0
python
"""Change user null bios to empty string""" from __future__ import annotations from core.jobs import base_jobs from core.jobs.io import ndb_io from core.jobs.types import job_run_result from core.platform import models import apache_beam as beam MYPY = False if MYPY: # pragma: no cover from mypy_imports import ...
Review this code and list any quality issues.
[]
0
python
get_efficientnet_image_size, ) from .flexible_unet import FLEXUNET_BACKBONE, FlexibleUNet, FlexUNet, FlexUNetEncoderRegister from .fullyconnectednet import FullyConnectedNet, VarFullyConnectedNet from .generator import Generator from .highresnet import HighResBlock, HighResNet from .hovernet import Hovernet, HoVernet, ...
Review this code and list any quality issues.
[]
0
python
print("NOTICE: You have both enabled in-reward kl and kl loss.") # critic if use_critic: critic_config = omega_conf_to_dataclass(config.critic) critic_config.validate(n_gpus, config.data.train_batch_size) if config.data.get("val_batch_size", None) is not None: print( "W...
Review this code and list any quality issues.
[ { "issue": "when would lora_rank be less than 0?", "severity": "minor", "line": 26 } ]
1
python
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import os import re import numpy as np from promptflow._utils.async_utils import async_run_allowing_running_loop from promptflow.core imp...
Review this code and list any quality issues.
[ { "issue": "Can this be changed to a single constant rather than redefined in each eval?", "severity": "minor", "line": 21 } ]
1
python
}, { 'url': 'https://francaisfacile.rfi.fr/fr/podcasts/un-mot-une-histoire/20250317-le-mot-de-david-foenkinos-peut-%C3%AAtre', 'md5': 'db83c2cc2589b4c24571c6b6cf14f5f1', 'info_dict': { 'id': 'WBMZ59441-FLE-FR-20250317', 'title': 'Le mot de David Foenkinos: «peut-être» - U...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n\r\n return {\r\n 'id': data['mediaId'],\r\n 'display_id': display_id,\r\n```", "severity": "minor", "line": 26 } ]
1
python
from awx.main.tasks.receptor import _convert_args_to_cli def test_file_cleanup_scenario(): args = _convert_args_to_cli({'exclude_strings': ['awx_423_', 'awx_582_'], 'file_pattern': '/tmp/awx_*_*'}) assert ' '.join(args) == 'cleanup --exclude-strings=awx_423_ awx_582_ --file-pattern=/tmp/awx_*_*' def test_im...
Review this code and list any quality issues.
[ { "issue": "As per the backlinked issue, the resultant meaning of this was to exclude any directory that has the `\"awx_423_ awx_582_\"` literal in its name. That is, in practical terms, excluding no directories.", "severity": "minor", "line": 6 } ]
1
python
"dtype": "int32", "keypoints": [], "connections": [], "_info": [ "keypoints", "connections", ], # keypoints and connections should be stored in info, not meta }, htype.POINT: {"dtype": "int32"}, htype.JSON: { "dtype": "Any", }, htype.L...
Review this code and list any quality issues.
[ { "issue": "I really like this class, can you write its name capital letter at the beginning? Also can we move all constants to the top of the class? I think they shouldn't be mixed with methods", "severity": "minor", "line": 26 } ]
1