language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
sw = Utils.Stopwatch() files = [] if pytest_report_file: files.append(pytest_report_file) else: pytest_report_file = ResultTranslator.PYTEST_RESULT_FILE if logfile: files.append(logfile) with ContextManager.cd(cwd): # Construct the...
Review this code and list any quality issues.
[ { "issue": "Storing and printing the entire pytest output could be memory-intensive for large test suites. Consider limiting the output size or only capturing it when necessary for timeout detection.\n```suggestion\n # Avoid printing arbitrarily large pytest output to stdout/logs.\n max_ou...
1
python
self.mini_wallet.send_to(from_node=n0, scriptPubKey=w_skp, amount=1 * COIN) self.mini_wallet.send_to(from_node=n0, scriptPubKey=w2_skp, amount=10 * COIN) self.generate(n0, nblocks=1, sync_fun=self.no_op) assert_equal(n0.getblockcount(), FINAL_HEIGHT) assert_equal(n1.getblock...
Review this code and list any quality issues.
[ { "issue": "I would have done it as a function and avoided these long additional variable names, this would save us a line below as well where the actual test additions are.\r\n\r\n```suggestion\r\n # Error message for wallets that need blocks before the snapshot height.\r\n def loading_error(heig...
1
python
self.user.save() editors = Group.objects.get(name="Editors") self.user.groups.add(editors) session = EditingSession.objects.create( user=self.user, content_type=ContentType.objects.get_for_model(Advert), object_id=snippet.pk, last_seen_at=TIMESTAM...
Review this code and list any quality issues.
[ { "issue": "I noticed we don't have assertions for the messaging when the conflict is caused by the same user (in a different session). We have assertions in other test methods where the conflict is caused by a different user.\n\nJust adding this for completeness sake.", "severity": "minor", "line": 26 ...
1
python
The number of samples taken of the :class:`Dot3D`. A tuple can be used to define different resolutions for ``u`` and ``v`` respectively. Examples -------- .. manim:: Dot3DExample :save_last_frame: class Dot3DExample(ThreeDScene): def construct(self): se...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n resolution: int | tuple[int, int] | None = (8, 8),\n```", "severity": "minor", "line": 26 } ]
1
python
"squeeze", "std", "subtract", "sum", "swapaxes", "take", "tan", "tanh", "trace", "transpose", "true_divide", "var", "where", "zeros", "zeros_like", ] _ShapeT = TypeVar("_ShapeT", bound=tuple[int, ...]) _ShapeT_co = TypeVar("_ShapeT_co", bound=tuple[int, ...], cov...
Review this code and list any quality issues.
[ { "issue": "like this it matches\r\n\r\nhttps://github.com/numpy/numpy/blob/5079d8a988f95d2d0a9d931b71b7d663b6efd856/numpy/_typing/_array_like.py#L26", "severity": "minor", "line": 26 } ]
1
python
def _real_extract(self, url): language, type_, video_id, part = self._match_valid_url(url).group('language', 'type', 'id', 'part') if not language: language = 'en' api_type = 'concert' if type_ == 'work' else type_ vid_info = self._download_json( f'https://api.di...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'entries': self._entries(\r\n videos, language, type_, thumbnail=thumbnail, album_artists=album_artists),\r\n```", "severity": "minor", "line": 26 } ]
1
python
self.json_body.body = [("rich_text", RichText("<h2>hello world</h2>"))] self.json_body.save() # the body should now be a stream consisting of a single rich_text block fetched_body = JSONStreamModel.objects.get(id=self.json_body.id).body self.assertIsInstance(fetched_body, StreamValue) ...
Review this code and list any quality issues.
[ { "issue": "Maybe I should also write about the crash or the issue that has been fixed, otherwise the reasoning behind this small change compared to the original test may be unclear to a new reader?", "severity": "critical", "line": 26 } ]
1
python
'info_dict': { 'id': 'squeakyhelplesswisent', 'ext': 'mp4', 'title': 'Hotwife Legs Thick', 'timestamp': 1636287915, 'upload_date': '20211107', 'uploader': 'ignored52', 'duration': 16, 'view_count': int, 'like_cou...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'tags': list,\r\n```", "severity": "minor", "line": 26 } ]
1
python
"num_attention_heads": 16, "num_key_value_heads": 8, "head_dim": 256, "sliding_window": 1024, "layer_types": None, # Will be auto-generated based on sliding_window_pattern "sliding_window_pattern": 6, # Every 6th layer is full attention...
Review this code and list any quality issues.
[]
0
python
player_config = self._download_json( urljoin('https://btvplus.bg', player_url), video_id)['config'] videojs_data = self._search_json( r'videojs\(["\'][^"\']+["\'],', player_config, 'videojs data', video_id, transform_source=js_to_json) formats = [] subtitles ...
Review this code and list any quality issues.
[ { "issue": "`clean_html` already strips IIRC, but this doesn't really matter I guess\r\n```suggestion\r\n 'title': (\r\n strip_or_none(self._og_search_title(webpage, default=None))\r\n or clean_html(get_element_by_class('product-title', webpage))),\r\n```", "severity...
1
python
""" sampling_eps = sampling_eps if sampling_eps is not None else self.config.sampling_eps timesteps = jnp.linspace(1, sampling_eps, num_inference_steps) return state.replace(timesteps=timesteps) def set_sigmas( self, state: ScoreSdeVeSchedulerState, num_inference_st...
Review this code and list any quality issues.
[]
0
python
vector_io_adapter.openai_attach_file_to_vector_store = AsyncMock() # Create batch batch = await vector_io_adapter.openai_create_vector_store_file_batch( vector_store_id=store_id, params=OpenAICreateVectorStoreFileBatchRequestWithExtraBody(file_ids=file_ids) ) # Test filtering by completed stat...
Review this code and list any quality issues.
[]
0
python
def load_block_list( block_list: list[FullBlock], constants: ConsensusConstants ) -> tuple[dict[uint32, bytes32], uint64, dict[bytes32, BlockRecord]]: difficulty = uint64(constants.DIFFICULTY_STARTING) sub_slot_iters = uint64(constants.SUB_SLOT_ITERS_STARTING) height_to_hash: dict[uint32, bytes32] = {} ...
Review this code and list any quality issues.
[ { "issue": "I think you should remove the variable declaration on line 1853 as well. Maybe even rename this variable to `prev_tx_height`", "severity": "minor", "line": 26 } ]
1
python
Query: $query Answer: """ # noqa:E501 DEFAULT_PROMPT_WITH_MEM0_MEMORY = """ You are a Q&A expert system. Your responses must always be rooted in the context provided for each query. You are also provided with the conversation history and memories with the user. Make sure to use relevant context from conversation hist...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\nMemories/Preferences:\r\n```", "severity": "minor", "line": 26 } ]
1
python
be added during the animation. subcaption_duration The duration for which the specified subcaption is added. If ``None`` (the default), the run time of the animation is taken. subcaption_offset An offset (in seconds) for the start time of the a...
Review this code and list any quality issues.
[ { "issue": "Why are you subtracting the `run_time` here? And if this is intended, we have two different `offset`s, which is rather confusing, isn't it?", "severity": "minor", "line": 26 } ]
1
python
>>> x.is_commutative True Create a symbol with assumptions: >>> y = Symbol('y', positive=True) >>> y.is_real True >>> y.is_positive True Assumptions affect simplification: >>> from sympy import sqrt >>> z = Symbol('z', positive=True) >>> sqrt(z**2) z Greek letter...
Review this code and list any quality issues.
[ { "issue": "You should avoid adding spaces or newlines unnecessarily. There should not be any changes that don't do anything.", "severity": "minor", "line": 26 } ]
1
python
'id': '1' } ws_client.send(obj) with pytest.raises(queue.Empty): ev = ws_client.get_ws_event(3) def test_start_after_stop(self, ws_client): self.test_start(ws_client) self.test_stop(ws_client) ''' Refer: https://github.com/apollographql/subscriptions...
Review this code and list any quality issues.
[]
0
python
'md5': '37a6c3381599381ff53a7e1e0575c0bc', 'info_dict': { 'id': 'F_xQzS2jwb3', 'ext': 'mp4', 'title': 'Turbo du 07/09/2014 : Renault Twingo 3, Bentley Continental GT Speed, CES, Guide Achat Dacia...', 'description': 'Turbo du 07/09/2014 : Renault Twingo 3, Bentley...
Review this code and list any quality issues.
[ { "issue": "Here I would actually call their API to extract the metadata\r\n```suggestion\r\n def custom_decode(text):\r\n STANDARD_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\r\n CUSTOM_ALPHABET = 'VIOUSLYABCDEFGHJKMNPQRTWXZviouslyabcdefghjkmnpqrt...
1
python
@register_evaluation_function("count_letters") def count_letters( task_params: EvaluationTaskParams, inference_engine: BaseInferenceEngine, ) -> dict[str, Any]: """Custom evaluation function registered as `count_letters`.""" dataset = LetterCountGrpoDataset(split="test") # TODO: OPE-1155: Add suppor...
Review this code and list any quality issues.
[ { "issue": "super nit: Add a comment to explain this, if you think it's needed", "severity": "minor", "line": 26 } ]
1
python
# coding: utf-8 """ Workflow mgmgt + task scheduling + dependency resolution. """ __author__ = 'The Luigi Authors' __contact__ = 'https://github.com/spotify/luigi' __license__ = 'Apache License 2.0' __version__ = '2.8.10' __status__ = 'Production'
Review this code and list any quality issues.
[]
0
python
self.assertContains(response, "Unordered object #3") self.assertContains(response, "Unordered object #2") self.assertNotContains(response, "Unordered object #1") response = self.client.get( reverse("admin:admin_views_unorderedobject_changelist") + "?p=2" ) self.assert...
Review this code and list any quality issues.
[]
0
python
'description': 'md5:6d00cd658394fa1a5071200d3ed4be05', 'duration': 1419, 'age_limit': 0, 'comment_count': int, 'upload_date': '20181003', 'thumbnail': 'https://i.ytimg.com/vi_webp/yiDOExw2aSA/maxresdefault.webp', 'availability': 'public', ...
Review this code and list any quality issues.
[ { "issue": "regex fix + this should be non-fatal if we want to be able to use the API call route\r\n```suggestion\r\n youtube_id = self._search_regex(\r\n r'var\\s*YOUTUBE_VIDEO\\s*=\\s*[\\'\"]+(?P<yt_id>[\\w-]+)', webpage, 'youtube_id', fatal=False)\r\n```", "severity": "minor", "line...
1
python
""" if percentage < 0 or percentage >= 1: raise ValueError("Percentage must be in the range [0, 1).") target_points = max(int(len(polygon) * (1 - percentage)), 3) if len(polygon) <= target_points: return polygon epsilon = 0 approximated_points = polygon while True: ep...
Review this code and list any quality issues.
[]
0
python
} } def _call_api(self, podcast_id, display_id): return self._download_json( f'https://player.radiozet.pl/api/podcasts/getPodcast/(node)/{podcast_id}/(station)/radiozet', display_id) def _real_extract(self, url): display_id = self._match_id(url) webpage = se...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'creator': strip_or_none(traverse_obj(data, ('presenter', 0, 'title'))),\r\n```", "severity": "minor", "line": 26 } ]
1
python
node = self.nodes[3] nonexistent_wallet_file = self.nodes[0].datadir_path / 'nonexistent_wallet.bak' wallet_name = "res0" assert_raises_rpc_error(-8, "Backup file does not exist", node.restorewallet, wallet_name, nonexistent_wallet_file) not_created_wallet_file = node.wallets_path / wall...
Review this code and list any quality issues.
[]
0
python
np.all(result.x <= self.limits[1]) and np.all(self.limits[0] <= result.x)): DE_result.fun = result.fun DE_result.x = result.x DE_result.jac = result.jac # to keep internal state consistent self.population_energies[0] = r...
Review this code and list any quality issues.
[ { "issue": "`partial` has not been imported, so this fails. How did the tests pass?", "severity": "critical", "line": 26 } ]
1
python
mock_acompletion.assert_called_once() call_kwargs = mock_acompletion.call_args[1] assert call_kwargs["stream_options"] == {"include_usage": True} async def test_chat_completion_preserves_existing_stream_options(self, mixin_with_model_store): """Test that existing stream_opti...
Review this code and list any quality issues.
[]
0
python
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( determine_ext, extract_attributes, int_or_none, ) class TV5MondePlusIE(InfoExtractor): IE_DESC = 'TV5MONDE+' _VALID_URL = r'https?://(?:www\.)?(?:tv5mondeplus|revoir\.tv5monde)\.com/tou...
Review this code and list any quality issues.
[ { "issue": "why are existing tests being removed?", "severity": "minor", "line": 19 } ]
1
python
args_validator=tool.function_schema.validator, call_func=tool.function_schema.call, is_async=tool.function_schema.is_async, timeout=tool_def.timeout, ) return tools async def call_tool( self, name: str, tool_args: dict[str, Any], ctx: RunC...
Review this code and list any quality issues.
[ { "issue": "Can we raise a `ModelRetry(f'Timed out after {timeout} seconds.')` instead, and leave the retry wrapping to the logic in `ToolManager`?", "severity": "minor", "line": 26 } ]
1
python
else: formats.append({ 'url': f'{video_format["url"]}{video_response["fn"]}?vkey={video_response["fvkey"]}', 'ext': 'mp4', }) identifier = video_response.get('br') format_response = traverse_obj( api_response, ('fl', 'f...
Review this code and list any quality issues.
[ { "issue": "format_id and fornat_name can be inlined\r\n\r\nformat_response.get('drm') != 0 should be enough for has_drm", "severity": "minor", "line": 26 } ]
1
python
self.config.model = "llama3.1:70b" self.client = Client(host=self.config.ollama_base_url) self._ensure_model_exists() def _ensure_model_exists(self): """ Ensure the specified model exists locally. If not, pull it from Ollama. """ local_models = self.client.list()["mo...
Review this code and list any quality issues.
[]
0
python
'UNARY_NEGATIVE': 42, 'UNARY_NOT': 43, 'WITH_EXCEPT_START': 44, 'BINARY_OP': 45, 'BUILD_CONST_KEY_MAP': 46, 'BUILD_LIST': 47, 'BUILD_MAP': 48, 'BUILD_SET': 49, 'BUILD_SLICE': 50, 'BUILD_STRING': 51, 'BUILD_TUPLE': 52, 'CALL': 53, 'CALL_FUNCTION_EX': 54, 'CALL_INTRINSI...
Review this code and list any quality issues.
[]
0
python
PartDeltaEvent( index=1, delta=ToolCallPartDelta(args_delta='n Fr', tool_call_id='srvtoolu_01FYcUbzEaqqQh1WBRj1QX3h') ), PartDeltaEvent( index=1, delta=ToolCallPartDelta(args_delta='anc', tool_call_id='srvtoolu_01FYcUbzEaqqQh1WBRj1QX3h') ), ...
Review this code and list any quality issues.
[]
0
python
@pytest.mark.parametrize("N", np.arange(2, 512)) @pytest.mark.parametrize("dtype", [np.int32, np.uint32, np.int64, np.uint64]) def test_argsort_int(N, dtype): rnd = np.random.RandomState(1100710816) # (1) random data with min and max values minv = np.iinfo(dtype).min maxv = np.iinfo(dtype).max arr =...
Review this code and list any quality issues.
[ { "issue": "maybe we should pin the values down with modern `default_rng`?\r\n\r\nOne other thing I checked was how slow the test might be (do we want a `slow` marker for the large array handling?). It didn't seem too bad (< 1 s for each case locally on an ARM Mac), though it is in the top 10 slowest for this m...
1
python
fh.write("\n".join(data)) res = np.loadtxt(fname, dtype=str, delimiter=" ", max_rows=nmax) os.remove(fname) assert len(res) == nmax @pytest.mark.parametrize("nskip", (0, 10000, 12345, 50000, 67891, 100000)) def test_skiprow_exceeding_maxrows_exceeding_chunksize(tmpdir, nskip): # tries to read a file in...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n res = np.loadtxt(fname, dtype='str', delimiter=\" \", skiprows=nskip, max_rows=60000)\r\n```", "severity": "minor", "line": 26 } ]
1
python
other ``path_arc`` fields are set as attributes, but a ``path_func`` is not generated from it. replace_mobject_with_target_in_scene Controls which mobject is replaced when the transformation is complete. If set to True, ``mobject`` will be removed from the scene and ``target_mobject`` will ...
Review this code and list any quality issues.
[ { "issue": "At this point i don't question how python works ... but shouldn't this code result in an error if `path_func` is `None` because it is never set ?", "severity": "minor", "line": 26 } ]
1
python
import requests from loguru import logger from oasst_backend.config import settings from oasst_backend.models.message import Message ROOT_ENDPOINT = "https://discord.com/api/v10" def send_new_report_message( message: Message, label_text: str, ) -> None: if settings.DISCORD_API_KEY is None or settings.DIS...
Review this code and list any quality issues.
[ { "issue": "maybe rename to `maybe_send_discord_report_message`", "severity": "minor", "line": 9 } ]
1
python
Dimensions as individual arguments >>> for index in np.ndindex(3, 2, 1): ... print(index) (0, 0, 0) (0, 1, 0) (1, 0, 0) (1, 1, 0) (2, 0, 0) (2, 1, 0) Same dimensions - but in a tuple ``(3, 2, 1)`` >>> for index in np.ndindex((3, 2, 1)): ... print(index) (0, 0, ...
Review this code and list any quality issues.
[ { "issue": "This text seems fine for a release note. But since the interface is unchanged, I would leave it out if the user documentation.", "severity": "minor", "line": 26 } ]
1
python
"""Remove every updater. Parameters ---------- recursive : :class:`bool` Whether to recursively call ``clear_updaters`` on all submobjects. Returns ------- :class:`Mobject` ``self`` See also -------- :meth:`remove_updater...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n def match_updaters(self, mobject: \"Mobject\") -> \"Mobject\":\r\n```", "severity": "minor", "line": 26 } ]
1
python
) rendered_query = sql_template_processor.process_template( query_model.sql.strip().strip(";"), **execution_context.template_params, ) self._validate(execution_context, rendered_query, sql_template_processor) return rendered_query ...
Review this code and list any quality issues.
[ { "issue": "If I understand this code block correctly, the current code is designed to skip the uncleared_variables check whenever there is a block in the Jinja template that includes variable declarations.\r\n\r\nThis means the entire _validation() block becomes meaningless. To revise it according to its inten...
1
python
def __init__( self, hass: HomeAssistant, client: Teltasync, config_entry: TeltonikaConfigEntry, base_url: str, ) -> None: """Initialize the coordinator.""" super().__init__( hass, _LOGGER, name="Teltonika", updat...
Review this code and list any quality issues.
[]
0
python
with open( file=CONNECTION_FILE, mode="r", ) as f: dev_connections = json.load(f) if conn_name not in dev_connections: raise ValueError(f"Connection '{conn_name}' not found in dev connections.") model_config = AzureOpenAIModelConfiguration(**dev_connections[conn_name]["valu...
Review this code and list any quality issues.
[]
0
python
Wait until the given message appear in the console. If the message was already printed in the console, return immediately. Note: it must be the *exact* string as printed by e.g. console.log. timeout is expressed in milliseconds. If it's None, it will use playwright's own default value,...
Review this code and list any quality issues.
[ { "issue": "What about something like:\r\n```\r\nif text in self.console.all.lines:\r\n return\r\nwith self.page.expect_console_message(pred, timeout=timeout):\r\n pass\r\n```\r\nthere would still be a race condition where the message appears between the two checks, but it would be much less likely.\r\n\r...
1
python
), [ (TENSOR_4x4[..., :2, :2], (0, 0)), (TENSOR_4x4[..., :2, 2:], (0, 2)), (TENSOR_4x4[..., 2:, :2], (2, 0)), (TENSOR_4x4[..., 2:, 2:], (2, 2)), ], TENSOR_4x4, ] # explicit chunk size TEST_CASE_12_CHUNKS = [ dict(merged_shape=TENSOR_4x4.shape, chunks=(1, 1, 2, 2)), [...
Review this code and list any quality issues.
[ { "issue": "Got this error when using zarr==3.0.1\r\n```\r\n======================================================================\r\nERROR: test_zarr_avg_merger_patches_16 (tests.inferers.test_zarr_avg_merger.ZarrAvgMergerTests.test_zarr_avg_merger_patches_16)\r\n-----------------------------------------------...
1
python
resp = self.execute(sql) calls = mock_handler().query.call_args_list assert len(calls[0][0][0].columns) == 1 assert calls[0][0][0].values == [[3]] assert resp.affected_rows == 1 sql = "insert into pg.tasks (a, b) values (3, 4)" resp = self.execute(sql) assert len...
Review this code and list any quality issues.
[]
0
python
compose_rate_limits_cache: dict[int, dict[ProtocolMessageTypes, Union[RLSettings, Unlimited]]] = {} # this class is used to configure the *rate* limit for a message type. The # limits are counts and size per 60 seconds. @dataclasses.dataclass(frozen=True) class RLSettings: # if true, messages affect and are limit...
Review this code and list any quality issues.
[ { "issue": "not sure it's wrong, but it seems a bit odd that `aggregate_limit.aggregate_limit` is `False`. maybe this value is unused.\n\n> [!NOTE]\n> just formatting change here for clarity\n\n\n```suggestion\naggregate_limit = RLSettings(\n aggregate_limit=False,\n frequency=1000,\n max_size=100 * 1...
1
python
'media' : Literal['image'], 'name' : str, 'format' : ImageFormat, 'size' : int, 'path' : str, 'metadata' : ImageMetadata }) VideoAsset = TypedDict('VideoAsset', { 'id' : AssetId, 'created_at' : datetime, 'expires_at' : datetime, 'type' : AssetType, 'media' : Literal['video'], 'name' : str, 'format' : VideoF...
Review this code and list any quality issues.
[]
0
python
import gstaichi as ti import numpy as np import trimesh import genesis as gs import genesis.utils.geom as gu import genesis.utils.mesh as mu from genesis.engine.entities.particle_entity import ParticleEntity class PBDBaseEntity(ParticleEntity): """ Base class for PBD entity. """ def _add_to_solver(s...
Review this code and list any quality issues.
[ { "issue": "I have more or less the same remarks than for FEM.", "severity": "minor", "line": 1 } ]
1
python
if element in ["Resource", "NotResource", "NotPrincipal"]: policy[element] = list(set(policy[element])) else: policy[element] = list(set([x.lower() for x in policy[element]])) modified_elements = set() for i in range(len(policy[element])): ...
Review this code and list any quality issues.
[ { "issue": "> Only one allowed_tag\r\n has to be configured in the role for ConsoleMe to be allowed to sync.\r\n\r\nFor this line, if there are 2 tag key/value pairs in the config, and the role only contains one of them, it won't allow the role. Meaning that _all_ allowed_tag key/value pairs need to be prese...
1
python
'id': 'VOD00041606', 'title': '花千骨', }, 'playlist_count': 51, # 50 episodes + 1 trailer }, { 'url': 'https://www.litv.tv/vod/drama/content.do?brc_id=root&id=VOD00041610&isUHEnabled=true&autoPlay=1', 'md5': 'b90ff1e9f1d8f5cfcd0a44c3e2b34c7a', 'info_dict': { ...
Review this code and list any quality issues.
[ { "issue": "Can we change the name of the `seasons_list` var since it is not actually a `list`? It makes the code hard to read. `playlist_data` would fine, since that is the name of the var being passed to it in `_real_extract()`\r\n\r\nAlso, can we inline the id and title in the `playlist_result()`?", "sev...
1
python
def consume_ping_output(ping_putput, request_per_round): """Consume ping output. Output example: PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=118 time=17.7 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=118 time=17.7 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=118 t...
Review this code and list any quality issues.
[ { "issue": "Why is 1 okay? Firecracker's net device should be a lossless channel, so we should never observe any packet loss :thinking:", "severity": "minor", "line": 26 } ]
1
python
): if unsloth_vllm_standby and os.environ.get("UNSLOTH_VLLM_STANDBY", "0") != "1": raise RuntimeError("Unsloth: UNSLOTH_VLLM_STANDBY is True, but UNSLOTH_VLLM_STANDBY is not set to 1!") pass if model_types is None: raise RuntimeError( "Unsloth: Please use...
Review this code and list any quality issues.
[ { "issue": "Move this to a global set at the top like FORCE_FLOAT32", "severity": "major", "line": 26 } ]
1
python
value (`str` or `dict`): A string with the absolute video file path, a dictionary with keys: - `path`: String with absolute or relative video file path. - `bytes`: The bytes of the video file. token_per_repo_id (`dict`, *optional*): ...
Review this code and list any quality issues.
[ { "issue": "The docstring said that `value` could just be the `str` path, but that case was not handled.\r\n\r\nI took the liberty of creating the `Example` `TypedDict` to try to improve the typing in this class.", "severity": "minor", "line": 26 } ]
1
python
NetEaseMusicIE, NetEaseMusicListIE, NetEaseMusicMvIE, NetEaseMusicProgramIE, NetEaseMusicSingerIE, ) from .netverse import ( NetverseIE, NetversePlaylistIE, NetverseSearchIE, ) from .netzkino import NetzkinoIE from .newgrounds import ( NewgroundsIE, NewgroundsPlaylistIE, Newgroun...
Review this code and list any quality issues.
[]
0
python
StatisticMetaData, ) from homeassistant.components.recorder.statistics import ( async_add_external_statistics, get_last_statistics, statistics_during_period, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, UnitOfEnergy, UnitOfVolume from h...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n@dataclass(frozen=True)\r\n```\r\nwe can make it frozen, right?", "severity": "minor", "line": 26 } ]
1
python
import ray import torch from verl import DataProto from verl.single_controller.base import Worker from verl.single_controller.base.decorator import Dispatch, register from verl.single_controller.ray.base import ( RayClassWithInitArgs, RayResourcePool, RayWorkerGroup, ) @ray.remote class Actor(Worker): ...
Review this code and list any quality issues.
[ { "issue": "What's self.world_size here? Could you add an assertion self.world_size == 4?", "severity": "minor", "line": 26 } ]
1
python
# flags: --preview { "is_update": (up := commit.hash in update_hashes) } # output {"is_update": (up := commit.hash in update_hashes)}
Review this code and list any quality issues.
[]
0
python
import base64 import litellm import instructor from typing import Type from pydantic import BaseModel from cognee.modules.data.processing.document_types.open_data_file import open_data_file from cognee.exceptions import InvalidValueError from cognee.infrastructure.llm.llm_interface import LLMInterface from cognee.infr...
Review this code and list any quality issues.
[ { "issue": "Why are we getting LiteLLM and litellm loggers? Do we need both?", "severity": "minor", "line": 26 } ]
1
python
if mla is enabled, default is 0; - if mla_lookup_server_worker_id < 0, start lookup server on all workers - if mla_lookup server_worker_id >= 0, start lookup server on the given worker """ def __init__( self, vllm_config: "VllmConfig", ): metadata, config = create_lm...
Review this code and list any quality issues.
[ { "issue": "The loop for range is not suitable for `self.mla_lookup_server_worker_id >= 0` i guess,\r\nWould you like to generate a list and add all rank into it? You can loop by use that list instead of the `range(rank)`, maybe this can make code clearer than before, WDYT?", "severity": "minor", "line"...
1
python
""" Build the BVH from the axis-aligned bounding boxes (AABBs). """ self.compute_aabb_centers_and_scales() self.compute_morton_codes() self.radix_sort_morton_codes() self.build_radix_tree() self.compute_bounds() @ti.kernel def compute_aabb_centers_and_sca...
Review this code and list any quality issues.
[ { "issue": "I would recommend this instead: `self.scale[i_b][i] = ti.select(scale[i] > gs.EPS, 1.0 / scale[i], 1.0)`", "severity": "minor", "line": 26 } ]
1
python
self.add(im1, im2, im3) self.wait(1) class ImageInterpolationTest(Scene): def construct(self): img = ImageMobject(np.uint8([[63, 0, 0, 0], [0, 127, 0, 0], [0, 0, 191, 0], [0, 0, 0...
Review this code and list any quality issues.
[ { "issue": "Suggestion : i understood that you shift each image to they can appear on the final frame. Could you add a little comment explaining it ? Thanks !", "severity": "minor", "line": 26 } ]
1
python
if '>Programmet er ikke længere tilgængeligt' in webpage: raise ExtractorError( 'Video %s is not available' % raw_video_id, expected=True) video_id = self._search_regex( (r'data-(?:material-identifier|episode-slug)="([^"]+)"', r'data-resource="[^>"]+mu/progr...
Review this code and list any quality issues.
[ { "issue": "can radio pages also have a `dr.dk/radio` url?\r\n\r\nmaybe we should do it like this:\r\n\r\n```diff\r\n _VALID_URL = r'''(?x)\r\n https?://\r\n (?:\r\n- (?:www\\.)?dr\\.dk/(?:tv/se|nyheder|(?:radio|lyd)(?:/ondemand)?)/(?:[^...
1
python
unsupported_keys = {"sampling_rate", "load_audio_from_video"} & kwargs.keys() if unsupported_keys: for key in unsupported_keys: kwargs.pop(key) logger.warning( f"{', '.join(sorted(unsupported_keys))} {'is' if len(unsupported_keys) == 1 else 'are'} not supp...
Review this code and list any quality issues.
[ { "issue": "use `text_kwargs` instead of creating new `tokenizer_kwargs`?\n\n```python\ntext_kwargs = output_kwargs[\"text_kwargs\"]\n...\n\ntext_kwargs[\"return_tensors\"] = None # let's not return tensors here\nencoded_instruct_inputs = self.tokenizer.apply_chat_template(conversations, **text_kwargs)\n```", ...
1
python
""" backend = ClassesToIndices.backend def __init__( self, keys: KeysCollection, indices_postfix: str = "_cls_indices", num_classes: int | None = None, image_key: str | None = None, image_threshold: float = 0.0, output_shape: Sequence[int] | None = None,...
Review this code and list any quality issues.
[ { "issue": "if it's feasible in general, perhaps we consider subsampling when generating the indices?\r\n\r\nhttps://github.com/Project-MONAI/MONAI/blob/9e33ff25f34ebd11e026c49634743d9389564765/monai/transforms/utils.py#L332-L341", "severity": "minor", "line": 26 } ]
1
python
for flags in ([], ['buffered']): i = nditer(a, flags, buffersize=buffersize) assert_equal(iter_iterindices(i), list(range(24))) i.iterindex = 2 assert_equal(iter_iterindices(i), list(range(2, 24))) i = nditer(a, flags, order='F', buffersize=buffersize) assert_equal(iter_...
Review this code and list any quality issues.
[]
0
python
f"Duplicate user class names: {key} is defined in both {previous_path} and {new_path}\n" ) sys.exit(1) user_classes[key] = value available_user_classes[key] = value available_user_tasks[key] = value.tasks or {} if len(stats.PERCENTILES_TO...
Review this code and list any quality issues.
[ { "issue": "Maybe we wanna scratch the `available_` prefix from all of these instead of adding it to user_classes?", "severity": "minor", "line": 26 } ]
1
python
from tests.v1.utils import ( check_method_signatures, get_abstract_methods, get_all_methods_from_base, get_methods_implemented_in_class, ) class TestImplementationCompleteness: """Test that wrapper implementations implement all base interface methods""" @pytest.mark.parametrize( "base...
Review this code and list any quality issues.
[]
0
python
channel_id = self._match_id(url) try: stream_data = self._download_json( f'https://api.ttinglive.com/api/channels/{channel_id}/stream', channel_id, query={'option': 'all'}) except ExtractorError as e: if isinstance(e.cause, HTTPError) and e.cause....
Review this code and list any quality issues.
[ { "issue": "I don't think this does anything?\r\n```suggestion\r\n```", "severity": "minor", "line": 26 } ]
1
python
from .newstube import NewstubeIE from .newsy import NewsyIE from .nextmedia import ( NextMediaIE, NextMediaActionNewsIE, AppleDailyIE, NextTVIE, ) from .nexx import ( NexxIE, NexxEmbedIE, ) from .nfb import NFBIE from .nfhsnetwork import NFHSNetworkIE from .nfl import ( NFLIE, NFLArticle...
Review this code and list any quality issues.
[]
0
python
Pytorch Lightning with Neptune. Args: api_key: Required in online mode. Neptune API token, found on https://neptune.ai. Read how to get your `API key <https://docs.neptune.ai/python-api/tutorials/get-started.html#copy-api-token>`_. It is recommended to keep i...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n experiment_id: Optional. Default is ``None``. The ID of the existing experiment.\r\n If specified, connect to experiment with experiment_id in project_name.\r\n Input arguments \"experiment_name\", \"params\", \"properties\" and \"tags\" will be overrid...
1
python
default_step = 1 if x_range is None: x_range = [ round(-config["frame_x_radius"]), round(config["frame_x_radius"]), default_step, ] elif len(x_range) == 2: x_range = [*x_range, default_step] if y_range is None: ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n def coords_to_point(self, *coords: ManimFloat):\r\n```\r\n\r\nThis is what got me confused regarding my other comment", "severity": "minor", "line": 26 } ]
1
python
# 3. New CE but old Pro FW -> It doesn't supply the mac using DNS-SD but we can read it (returning the EMPTY_MAC) # 4. New CE and new Pro FW -> Both DNS-SD and a read gives us the mac # If we can't get the mac, we use DEFAULT_DISCOVERY_UNIQUE_ID as an ID, so we can always configure a single MotionMount. Most households...
Review this code and list any quality issues.
[ { "issue": "`except ConnectionError, socket.gaierror:` is invalid Python 3 syntax. Use `except (ConnectionError, socket.gaierror):` (same issue repeats in the zeroconf step below).", "severity": "minor", "line": 26 } ]
1
python
The tasks manager assumes that you will only update the tasks you fetched. The mongo fetch one and update will make it date updating secure. .. note:: Assumption: the data in MongoDB was encoded and the data out of MongoDB was decoded Here are four status which are: STATUS_WAITING: waiti...
Review this code and list any quality issues.
[ { "issue": "`task_pool` could be `None` if `TaskManger.list` is called.\r\nAdd docs about it in case that other contributors have similar confisions.", "severity": "minor", "line": 26 } ]
1
python
return None @property def media_position(self) -> int | None: """Position of current playing media in seconds.""" if self.coordinator.data.media is not None and self._media_playback_trackable(): return self.coordinator.data.media.position return None @property def ...
Review this code and list any quality issues.
[]
0
python
import inspect import re import textwrap from collections.abc import Iterator from pathlib import Path from typing import Any, Callable import moderngl import numpy as np import numpy.typing as npt from cloup import Context from moderngl import Attribute from typing_extensions import Self from typing import TYPE_CHECK...
Review this code and list any quality issues.
[ { "issue": "I would love to make the `Any` type more specific. Any ideas of what it should be?", "severity": "minor", "line": 26 } ]
1
python
m3u8_url, info = self._parse_video_data(video_data) formats, subtitles = self._extract_m3u8_formats_and_subtitles( m3u8_url, video_id, 'mp4', live=info['is_live']) info.update({ 'formats': formats, 'subtitles': subtitles, }) return info class NuumLi...
Review this code and list any quality issues.
[ { "issue": "I'd just do this since we don't want to continue extraction unless truthy\r\n```suggestion\r\n if not traverse_obj(channel_info, ('channel', 'channel_is_live')):\r\n```", "severity": "major", "line": 26 } ]
1
python
assert_allclose(expected, W) @pytest.mark.parametrize("solver", SOLVERS) @pytest.mark.parametrize("csr_container", CSR_CONTAINERS) def test_large_sparse_matrix(solver, global_random_seed, csr_container): # Solvers either accept large sparse matrices, or raise helpful error. # Non-regression test for pull-requ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n # Liblinear freezes when X.max() ~ 1e100, see issue #7486.\r\n # We preemptively raise an error when X.max() > 1e30.\r\n```", "severity": "minor", "line": 26 } ]
1
python
'grouped': array( [[-0.500, 0.500, -0.500, 0.500], [-0.500, 0.500, 1.250, -1.250], [-0.500, 0.500, 1.250, -1.250], [-0.500, 0.500, -0.500, 0.500]], ), 'grouped_masked': array( [[nan, 0.000, -0.500, 0.500]...
Review this code and list any quality issues.
[]
0
python
headless=False, ) # Create a WARC archive file a prepare the writer. archive = 'example2.warc.gz' with open(archive, 'wb') as output: writer = WARCWriter(output, gzip=True) # Create a WARC info record to store metadata about the archive. warcinfo_payload = { 'softwa...
Review this code and list any quality issues.
[ { "issue": "`on(\"requestfinished\")` returns a `Request` instance ([docs](https://playwright.dev/python/docs/api/class-page#page-event-request-finished)), so an additional `.response()` call is needed.", "severity": "minor", "line": 26 } ]
1
python
def log_unsupported_format_error(): logger.error("-" * 80) logger.error(" Input file does not appear to be a PE or ELF file.") logger.error(" ") logger.error( " capa currently only supports analyzing PE and ELF files (or shellcode, when using --format sc32|sc64)." ) logger.error(" If you...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n logger.error(\" CAPE report is empty or only contains little useful data: %s\", error)\r\n```", "severity": "minor", "line": 26 } ]
1
python
has_cursor = self._has_cursor if has_cursor and cursor_line_style and cursor_row == line_index: line.stylize(cursor_line_style) # Selection styling if start != end and selection_top_row <= line_index <= selection_bottom_row: # If this row intersects with the selection r...
Review this code and list any quality issues.
[]
0
python
if lang and ext: subtitles.setdefault(lang, []).append({ 'ext': ext, 'url': initial_state_json[key] }) subtitles[lang].append({ 'ext': 'srt', 'url': f'{remove_end(initial_state_json[key], "vtt...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'age_limit': self._AGE_RATINGS_MAPPER.get(\r\n initial_state_json.get('internal_age_rating'))\r\n```", "severity": "minor", "line": 26 } ]
1
python
cu_seqlens=cu_seqlens, rotary_pos_emb=rotary_pos_emb, position_embeddings=position_embeddings, **kwargs, ) hidden_states = hidden_states + self.mlp(self.norm2(hidden_states)) return hidden_states class Qwen3_5VisionModel(Qwen3_5PreTrainedModel): config: ...
Review this code and list any quality issues.
[]
0
python
rich_pretty_install.assert_called() def test_rich_traceback_not_installed(mocker, default_logging_config): rich_traceback_install = mocker.patch("rich.traceback.install") rich_pretty_install = mocker.patch("rich.pretty.install") rich_handler = { "class": "kedro.logging.RichHandler", "rich_...
Review this code and list any quality issues.
[]
0
python
super().__init__(**kwargs) async def _open_page(self, context: BasicCrawlingContext) -> AsyncGenerator[BrowserPageContext, None]: if self._browser_pool is None: raise ValueError('Browser pool is not initialized.') # Create a new browser page crawlee_page = await self._browser_p...
Review this code and list any quality issues.
[ { "issue": "I'd just rename this one to `_navigate`.", "severity": "minor", "line": 26 } ]
1
python
NiconicoIE, NiconicoPlaylistIE, NiconicoUserIE, NiconicoSeriesIE, NiconicoHistoryIE, NicovideoSearchDateIE, NicovideoSearchIE, NicovideoSearchURLIE, NicovideoTagURLIE, ) from .ninecninemedia import ( NineCNineMediaIE, CPTwentyFourIE, ) from .ninegag import NineGagIE from .ninenow...
Review this code and list any quality issues.
[]
0
python
o_stats = o o = {k: v.priority for k, v in o.items()} try: cmap = kwargs.pop("cmap") except KeyError: cmap = plt.cm.plasma if isinstance(cmap, str): import matplotlib.pyplot as plt cmap = getattr(plt.cm, cmap) def label(x): ...
Review this code and list any quality issues.
[]
0
python
self, api: SwitchBotAPI, device: Device | Remote, coordinator: SwitchBotCoordinator, ) -> None: """Initialize the image entity.""" super().__init__(api, device, coordinator) self.access_tokens: deque[str] = deque(["switchbot_art_frame_token"]) self._image_cont...
Review this code and list any quality issues.
[ { "issue": "shouldn't we only update the image when the image actually changed? Or is it a static URL?", "severity": "minor", "line": 26 } ]
1
python
"id": webhook.id, "userId": webhook.user_id, "provider": webhook.provider, "credentialsId": webhook.credentials_id, "webhookType": webhook.webhook_type, "resource": webhook.resource, "events": webhook.events, "config": Json(webhook.conf...
Review this code and list any quality issues.
[]
0
python
from typing import Any, TypeAlias, TypeVar, cast import numpy as np from numpy import dtype, generic import numpy.typing as npt from numpy._typing import _Shape _ScalarT = TypeVar("_ScalarT", bound=generic) MaskedArray: TypeAlias = np.ma.MaskedArray[_Shape, dtype[_ScalarT]] MAR_b: MaskedArray[np.bool] = np.ma.Masked...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n_ScalarT = TypeVar(\"_ScalarT\", bound=np.generic)\r\n```", "severity": "minor", "line": 8 } ]
1
python
b01_trait._props_data = deepcopy(Q7_B01_PROPS) async def query_values_side_effect(protocols): return b01_trait._props_data b01_trait.query_values = AsyncMock(side_effect=query_values_side_effect) # Add API methods that update the state when called async def start_clean_side_effect(): ...
Review this code and list any quality issues.
[ { "issue": "The test fixture is missing the `set_mode` mock method. The test at line 245 calls `q7_device.b01_q7_properties.set_mode.side_effect = RoborockException`, but `set_mode` is not defined in the `create_b01_q7_trait()` function. You need to add `b01_trait.set_mode = AsyncMock()` in the fixture creation...
1
python
assert_raises_rpc_error(-32603, "Unable to load UTXO snapshot", node.loadtxoutset, dump_output_path) self.restart_node(0, extra_args=self.extra_args[0]) def test_snapshot_in_a_divergent_chain(self, dump_output_path): n0 = self.nodes[0] n3 = self.nodes[3] n4 = self.nodes[4] a...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n self.log.info('Ensuring background validation finishes')\r\n```", "severity": "minor", "line": 26 } ]
1
python
book_type = options.book_name.split(".")[-1] support_type_list = list(BOOK_LOADER_DICT.keys()) if book_type not in support_type_list: raise Exception( f"now only support files of these formats: {','.join(support_type_list)}" ) book_loader = BOOK_LOADER_DICT.get(book_type) as...
Review this code and list any quality issues.
[ { "issue": "let us put it in here since other translator do not has this attr\r\nhttps://github.com/yihong0618/bilingual_book_maker/blob/fa9e375a8ec8c94759dfad0c1c7f7704b1ab99ec/book_maker/cli.py#L295-L307", "severity": "minor", "line": 26 } ]
1
python
"""j -> i""" cur_dist = (self.particles_reordered[i, i_b].pos - self.particles_reordered[j, i_b].pos).norm(gs.EPS) rest_dist = ( self.particles_info_reordered[i, i_b].pos_rest - self.particles_info_reordered[j, i_b].pos_rest ).norm(gs.EPS) target_dist = self._particle_size ...
Review this code and list any quality issues.
[]
0
python
expected_exception: Exception, expected_exception_msg: str, ) -> None: """Test Habitica cast skill action exceptions.""" habitica.cast_skill.side_effect = raise_exception with pytest.raises(expected_exception, match=expected_exception_msg): await hass.services.async_call( DOMAIN, ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n with pytest.raises( \n ServiceValidationError, \n check=lambda e: e.translation_key == \"service_config_entry_not_found\", \n ): \n```", "severity": "minor", "line": 26 } ]
1
python
AT_EQUITIES = EquityCalendarDomain(CountryCode.AUSTRIA, 'XWBO') AU_EQUITIES = EquityCalendarDomain(CountryCode.AUSTRALIA, 'XASX') BE_EQUITIES = EquityCalendarDomain(CountryCode.BELGIUM, 'XBRU') BR_EQUITIES = EquityCalendarDomain(CountryCode.BRAZIL, 'BVMF') CA_EQUITIES = EquityCalendarDomain(CountryCode.CANADA, 'XTSE') ...
Review this code and list any quality issues.
[ { "issue": "According to [iso](https://www.iso.org/iso-3166-country-codes.html), the alpha2 code for South Korea is \"KR\" not \"SK\":\r\n\r\n```python\r\n> from iso3166 import countries_by_name\r\n> countries_by_name['KOREA, REPUBLIC OF']\r\nCountry(name=u'Korea, Republic of', alpha2='KR', alpha3='KOR', numeri...
1
python
except ValueError: R = R.add_gens([sinh(c_expr), cosh(c_expr)]) p = p.set_ring(R) x = x.set_ring(R) c = c.set_ring(R) t1, t2 = R(sinh(c_expr)), R(cosh(c_expr)) else: try: t1, t2 = R(sinh(c)), R(cosh(c)) ...
Review this code and list any quality issues.
[ { "issue": "Can you add this function to the docs in `doc/src/modules/polys/ringseries.rst` and also make a better docstring?", "severity": "minor", "line": 26 } ]
1
python
'start': sub_range_start, 'end': sub_range_start + int(splitted_byte_range[0]), } fragments.append({ 'frag_index': frag_index, 'url': frag_url, 'decrypt_info': decrypt_info, ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n decrypt_info['URI'] = urljoin(man_url, decrypt_info['URI'])\r\n```\r\nThe urljoin in utils should handle this", "severity": "minor", "line": 26 } ]
1
python
loss=loss, logits=lm_logits, past_key_values=outputs.past_key_values, hidden_states=outputs.hidden_states, attentions=outputs.attentions, cross_attentions=outputs.cross_attentions, ) @staticmethod def gpt2_double_heads_model_forward( s...
Review this code and list any quality issues.
[]
0
python
import nni.retiarii.evaluator.pytorch.lightning as pl import nni.retiarii.strategy as strategy from nni.experiment import RemoteMachineConfig from nni.retiarii import serialize from nni.retiarii.experiment.pytorch import RetiariiExperiment, RetiariiExeConfig from torchvision import transforms from torchvision.datasets ...
Review this code and list any quality issues.
[]
0