language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
"credentials": TEST_CREDENTIALS_INPUT, "payload": example_payload, }, test_credentials=TEST_CREDENTIALS, test_output=[ ("payload", example_payload), ("triggered_by_user", example_payload["sender"]), ("event", example_pay...
Review this code and list any quality issues.
[ { "issue": "AFAICS this is redundant with the `GitHubReadPullRequestBlock`, which has an output for this. Since diffs can be rather large (and take a while to fetch?? not sure), I'd prefer not fetching it by default.", "severity": "minor", "line": 26 } ]
1
python
return True class HomeAssistantRequest(web.Request): """Home Assistant request object.""" async def json(self, *, loads: JSONDecoder = json_loads) -> Any: """Return body as JSON.""" # json_loads is a wrapper around orjson.loads that handles # bytes and str. We can pass the bytes direc...
Review this code and list any quality issues.
[]
0
python
# Distributed under the MIT software license, see the accompanying # file COPYING or https://opensource.org/license/mit. """Exercise the utils via json-defined tests.""" from test_framework.test_framework import BitcoinTestFramework import difflib import json import logging import os import subprocess from pathlib im...
Review this code and list any quality issues.
[ { "issue": "[This](https://github.com/bitcoin/bitcoin/blob/fa2f1c55b7da729eb6bb9f88bf48459235cc2664/test/CMakeLists.txt#L39-L47) code effectively symlinks/copies the entire `test/functional` subdirectory into the build tree.\r\n\r\nWhy not use it the same way we do in other functional tests? For example, grep f...
1
python
"credentials": { "id": llama_api_credentials.id, "provider": llama_api_credentials.provider, "type": llama_api_credentials.type, }, }, cost_amount=cost, ) for model, cost in MODEL_COST.items() if ...
Review this code and list any quality issues.
[]
0
python
] @classmethod def remove_onnx_files(cls, beam_search_onnx_only: bool = False): if os.path.exists(cls.beam_search_onnx_path): os.remove(cls.beam_search_onnx_path) if os.path.exists(cls.beam_search_onnx_path + ".data"): os.remove(cls.beam_search_onnx_path + ".data") ...
Review this code and list any quality issues.
[]
0
python
import contextlib import io import logging import uuid from collections.abc import Iterator from configs import dify_config from core.rag.extractor.blob.blob import Blob from core.rag.extractor.extractor_base import BaseExtractor from core.rag.models.document import Document from extensions.ext_database import db from...
Review this code and list any quality issues.
[ { "issue": "The class docstring is outdated and doesn't reflect the new parameters added to the constructor. The Args section should include tenant_id and user_id parameters in addition to file_path.\n```suggestion\n file_path: Path to the file to load.\n tenant_id: ID of the tenant associated wit...
1
python
_VALID_URL = r'''(?x) https?://tube\.tugraz\.at/paella/ui/watch.html\?id= (?P<id>[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}) ''' _TESTS = [{ 'url': 'https://tube.tugraz.at/paella/ui/watch.html?id=f2634392-e40e-4ac7-9ddc-47764aa23d40', 'md5': 'a23a3d5c9aaca2b84932fdba66e...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n episode_info = traverse_obj(episode_data, ('search-results', 'result'), default={'id': video_id})\r\n```", "severity": "minor", "line": 26 } ]
1
python
:type input_query: str :param config: The `BaseLlmConfig` instance to use as configuration options. This is used for one method call. To persistently use a config, declare it during app init., defaults to None :type config: Optional[BaseLlmConfig], optional :param dry_run: A dry run does...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n logging.info(\"Cache enabled. Checking cache...\")\r\n```", "severity": "major", "line": 26 } ]
1
python
from openai import AsyncOpenAI from pydantic_ai.profiles import ModelProfile from pydantic_ai.profiles.openai import OpenAIJsonSchemaTransformer, OpenAIModelProfile, openai_model_profile from pydantic_ai.providers import Provider from pydantic_ai_slim.pydantic_ai.models import cached_async_http_client try: from o...
Review this code and list any quality issues.
[ { "issue": "Can we have this read the URL from the client, like we do in `OpenAIProvider`? That way we don't need to set it explicitly in `__init__`", "severity": "minor", "line": 26 } ]
1
python
"Current rule supports fusing MapBatches->StreamingRepartition, but received: " f"{type(up_op).__name__} -> {type(down_op).__name__}" ) name = up_op.name + "->" + down_op.name down_logical_op = self._op_map.pop(down_op) up_logical_op = self._op_map.pop(up_op) assert...
Review this code and list any quality issues.
[ { "issue": "We'd not be blocking any subsequent fusion like that \n\nLet's add a test that we're able to fuse multiple ops like this:\n\n - Map > Map > SR\n - Map > SR > SR", "severity": "minor", "line": 26 } ]
1
python
Vnn = Vnn.reshape(bsz, n_heads, cached_len, head_dim) pass # else: # Knn, Vnn = Knn, Vnn # pass # Attention if bsz == 1: Qn *= self.scalar # See https://github.com/ggerganov/llama.cpp/issues/7805#issuecomment-2153349963 # It seems like doing (Q * scalar) @ K is better than (...
Review this code and list any quality issues.
[]
0
python
formats = [] video = self._download_json( 'https://playback.video.globo.com/v4/video-session', video_id, f'Downloading resource info for {video_id}', headers={'Content-Type': 'application/json'}, data=json.dumps({ 'player_type': 'mirakulo_8k_hdr', ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if determine_ext(main_source['url']) == 'mpd':\r\n```", "severity": "minor", "line": 26 } ]
1
python
('docs', 'Wave docs', 'https://wave.h2o.ai/docs/getting-started'), ('discussions', 'Discussions', 'https://github.com/h2oai/wave/discussions'), ('blog', 'Blog', 'https://wave.h2o.ai/blog'), ('cloud', 'H2O AI Cloud', 'https://h2o.ai/platform/ai-cloud/'), ('h2o', 'H2O', 'https://www.h2o.ai...
Review this code and list any quality issues.
[ { "issue": "Is this needed if we already set the size on the layout level?\r\n```suggestion\r\n box='code',\r\n```", "severity": "minor", "line": 26 } ]
1
python
def __init__(self, model_id: int, data: dict[str, Any]): self._properties = data.copy() self._model_id = model_id self._model: Optional[Database] = None self._validator: Optional[type[BaseSQLValidator]] = None def run(self) -> list[dict[str, Any]]: """ Validates a SQ...
Review this code and list any quality issues.
[ { "issue": "Could you add a brief comment or a tiny docstring explaining expected semantics of process_template here (e.g., whether it always returns a string, whether it may mutate the SQL, and what exceptions it may raise)? Also, please consider defensive handling/logging if process_template fails (so the val...
1
python
* self._font_size / DEFAULT_FONT_SIZE ) @font_size.setter def font_size(self, font_val): # TODO: use pango's font size scaling. if font_val <= 0: raise ValueError("font_size must be greater than 0.") else: self.scale(font_val / self.font_size)...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n def _text2svg(self, color: Color | None):\n```", "severity": "minor", "line": 26 } ]
1
python
partition_key = get_tensor_vdb_index_key( self.key, commit_id, f"{id}_{info['name']}" ) self.storage[partition_key] = incr_data_map[info["name"]] else: self.storage[ ...
Review this code and list any quality issues.
[ { "issue": "@azat-manukyan We should probably modify this api so the default `id` is \"hsnw_1\", because right now, that's the only hard coded name that works in the search.... I think. @Sounakal", "severity": "minor", "line": 26 } ]
1
python
gui._bind_var_val(var_name, None) else: encoded_var_name = gui._bind_var(var_name) var_val[var_name] = _getscopeattr_drill(gui, encoded_var_name) var_map[var_name] = encoded_var_name ...
Review this code and list any quality issues.
[ { "issue": "Not too sure about how and what happens if `lambda_expr` indeed,,,", "severity": "minor", "line": 26 } ]
1
python
Raises: Exception. The exploration id is invalid or corresponds to an exploration which isn't published yet. """ exploration_id_list = [] for node in story_nodes: assert node.exploration_id is not None exploration_id_list.append(node.exploratio...
Review this code and list any quality issues.
[ { "issue": "Shouldn't you gate this with \"if serial chapter launch flag is switched off\"? (And maybe add a comment)", "severity": "minor", "line": 26 } ]
1
python
def __init__( self, browser_pool: BrowserPool | None = None, browser_type: BrowserType | None = None, browser_options: Mapping[str, Any] | None = None, page_options: Mapping[str, Any] | None = None, headless: bool | None = None, **kwargs: Unpack[BasicCrawlerOption...
Review this code and list any quality issues.
[ { "issue": "This comment was not updated to reflect change in the code.", "severity": "minor", "line": 26 } ]
1
python
})) or {}).get('accessToken') if access_token: self._HEADERS = {'authorization': 'Bearer ' + access_token} except ExtractorError as e: message = None if isinstance(e.cause, HTTPError) and e.cause.status == 401: resp = self._parse_json( ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n self.raise_login_required('This video requires a subscription', method='password')\r\n```", "severity": "minor", "line": 26 } ]
1
python
'youtube_include_hls_manifest': opts.youtube_include_hls_manifest, 'encoding': opts.encoding, 'extract_flat': opts.extract_flat, 'live_from_start': opts.live_from_start, 'wait_for_video': opts.wait_for_video, 'mark_watched': opts.mark_watched, 'merge_output_format': opts....
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n```\r\n\r\nas this is not a `YoutubeDL` opt", "severity": "minor", "line": 26 } ]
1
python
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. fro...
Review this code and list any quality issues.
[ { "issue": "If zarr isn't present the variable `directory_store` won't exist, there should be a default value for this so that it always does.", "severity": "minor", "line": 26 } ]
1
python
query = { 'id': creator_id, 'limit': self._PAGE_SIZE, 'fetchAfter': page * self._PAGE_SIZE, } if channel_id: query['channel'] = channel_id page_data = self._download_json( f'{self._BASE_URL}/api/v3/content/creator', display_id, ...
Review this code and list any quality issues.
[ { "issue": "same here\r\n```suggestion\r\n f'{self._BASE_URL}/api/v3/creator/named',\r\n display_id, query={'creatorURL[0]': creator})[0]\r\n```", "severity": "minor", "line": 26 } ]
1
python
'loginId': username, 'loginPassword': password, 'Token.Default': cltft_token, 'op': 'nextPage', }), headers={'Referer': urlh.url}) def _real_extract(self, url): video_id = self._match_id(url) webpage, urlh = self._download_webpage_handle( ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'This URL is for a pass ticket instead of a player page', expected=True)\r\n```", "severity": "minor", "line": 26 } ]
1
python
if self.mempool_manager.get_spendbundle(spend_name) is not None: self.mempool_manager.remove_seen(spend_name) return MempoolInclusionStatus.SUCCESS, None if self.mempool_manager.peak is None: return MempoolInclusionStatus.FAILED, Err.MEMPOOL_NOT_INITIALIZED ...
Review this code and list any quality issues.
[ { "issue": "Just because the peer has disconnected, we can still ban it, right? To prevent it from reconnecting any time soon", "severity": "minor", "line": 26 } ]
1
python
monkeypatch.setattr("os.environ.get", mock_getenv) assert os.environ.get("SCIPY_ARRAY_API") != "1" with pytest.raises( RuntimeError, match="scipy's own support is not enabled.", ): get_namespace(X_xp) def test_move_to_array_api_conversions_cupy_to_torch(): ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n \"\"\"Check conversion of NumPy to torch.\"\"\"\r\n```", "severity": "minor", "line": 26 } ]
1
python
if sleep <= 0: raise ValueError("Sleep for scrolling scraper value must be greater than 0.") if scroll < 5000: raise ValueError("Scroll value for scrolling scraper must be greater than or equal to 5000.") from playwright.async_api import async_playwright ...
Review this code and list any quality issues.
[]
0
python
if skipna and mask is not None: values = values.copy() np.putmask(values, mask, 0) elif not skipna and mask is not None and mask.any(): return np.nan with np.errstate(invalid="ignore", divide="ignore"): mean = values.sum(axis, dtype=np.float64) / count if axis is not None: ...
Review this code and list any quality issues.
[ { "issue": "Could you also mention and maybe link to where Scipy does a similar calculation?", "severity": "minor", "line": 26 } ]
1
python
v_line = self.get_vertical_line( self.i2gp(x_val, graph), color=line_color, line_func=line_func, ) T_label_group.add(triangle, v_line) return T_label_group def __matmul__(self, coord: Point3D | Mobject): if isinstance(coord, Mobject): ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n return self.coords_to_point(coord)\r\n```\r\n?\r\nProbably a test would be nice", "severity": "minor", "line": 26 } ]
1
python
self.__last_playback_ev = ev self.emit("playback_finished", ev) async def wait_for_playout(self) -> PlaybackFinishedEvent: """ Wait for the past audio segments to finish playing out. Returns: PlaybackFinishedEvent: The event that was emitted when the audio finished play...
Review this code and list any quality issues.
[ { "issue": "For STT and TTS, we directly expose the capabilities dataclass:\r\nhttps://github.com/livekit/agents/blob/2c84fc9e7cdb3878456e01a31d66fe442d01ad2c/livekit-agents/livekit/agents/tts/tts.py#L88\r\n\r\nLet's do the same here", "severity": "minor", "line": 26 } ]
1
python
Create a CredentialType for discovered credential plugins. By default, this function will attempt to acquire the globally distributed lock (postgres advisory lock). If the lock is acquired the method will call the underlying method. If the lock is NOT acquired the method will NOT call the under...
Review this code and list any quality issues.
[ { "issue": "Similarly to the interfaces repo, try to avoid untyped kwargs. Eventually, this will let type checkers find bugs for you.", "severity": "critical", "line": 26 } ]
1
python
Parameters ---------- path : str Path to an HDF5 daily pricing file. """ return cls.from_file(h5py.File(path)) @property def countries(self): """A set-like object of the country codes supplied by this reader. """ return viewkeys(self._readers)...
Review this code and list any quality issues.
[ { "issue": "Why the switch from `.loc` to `.get` here? It looks like they have the same behavior:\r\n\r\n```\r\nIn [6]: s\r\nOut[6]:\r\na 1\r\nb 2\r\ndtype: int64\r\n\r\nIn [7]: s.get(['a', 'c'])\r\nOut[7]:\r\na 1.0\r\nc NaN\r\ndtype: float64\r\n\r\nIn [8]: s.loc[['a', 'c']]\r\nOut[8]:\r\na 1.0\r...
1
python
prefetch_related_objects(deque([book]), "authors") self.assertCountEqual( book.authors.all(), [self.author1, self.author2, self.author3] ) # custom iterable class MyIterable: def __iter__(self_inner): yield book prefetch_related_objects(M...
Review this code and list any quality issues.
[ { "issue": "Note that this is under the \" # empty iterable\" comment but is not an empty iterable. There's no asserts, other than you showing that this doesn't error, not sure what is being tested here", "severity": "minor", "line": 26 } ]
1
python
response_time_ms=response_time, details="Connection successful", ) except Exception as e: response_time = int((time.time() - start_time) * 1000) return ComponentHealth( status=HealthStatus.UNHEALTHY, provider="unknown", ...
Review this code and list any quality issues.
[ { "issue": "(note to self) we can create a protocol with `health_check` method for all components here", "severity": "minor", "line": 26 } ]
1
python
'rate': 0, **self._calc_sign(js_sign_func, video_id, room_id), } stream_formats = [self._download_json( f'https://www.douyu.com/lapi/live/getH5Play/{room_id}', video_id, note="Downloading livestream format", data=urlencode_postdata(form_data))] fo...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'display_id': ('url', {str}, {lambda i: i[1:]}),\r\n 'title': ('room_name', {unescapeHTML}),\r\n 'description': ('show_details', {str}),\r\n 'uploader': ('nickname', {str}),\r\n 'thumbnail': ('room_src', {ur...
1
python
self._html_search_regex(r'(?s)<span\s+class="subjectName">\s*<img\s*[^<]+>\s*([^<]+?)</span>', webpage, 'title', fatal=False)) class NhkForSchoolProgramListIE(InfoExtractor): _VALID_URL = r'https?://www\.nhk\.or\.jp/school/(?P<id>(?:%s)/[a-zA-Z0-9_-]+)' % ( '|'.join(re.escape(s) for s in NhkForSchoolSubje...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n title = self._og_search_title(webpage, fatal=False) or self._html_extract_title(webpage, fatal=False) or self._html_search_regex(r'<h3>([^<]+?)とは?\\s*</h3>', webpage, 'title', fatal=False)\r\n title = re.sub(r'\\s*\\|\\s*NHK\\s+for\\s+School\\s*$', '', title) if title...
1
python
return fmts def _parse_mpd_formats_and_subtitles(self, *args, **kwargs): periods = self._parse_mpd_periods(*args, **kwargs) return self._merge_mpd_periods(periods) def _merge_mpd_periods(self, periods): """ Combine all formats and subtitles from an MPD manifest into a single li...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n format_key = tuple(v for k, v in f.values() if k not in (\r\n 'format_id', 'fragments', 'manifest_stream_number'))\r\n```", "severity": "minor", "line": 26 } ]
1
python
# can be combined to, i.e. multiply the different dimensions return tuple( map( lambda x: reduce(mul, x), product(*chunks[start : stop + 1]), ) ) def _smooth_chunks(ileft, ii, max_in_chunk, result_inchunks): # The previous step squashed the whole dimension into a si...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n # ((2, 2), (2, 1)) and the output chunks to ((4, 2, 4, 2), )\r\n # In this case, the individual chunks do not hold a contiguous sequence.\r\n # For example, the first chunk is [[0, 1], [3, 4]].\r\n```", "severity": "minor", "line": 26 } ]
1
python
f"Graph density: {len(self.edges) / (len(self.nodes) * (len(self.nodes) - 1)) if len(self.nodes) > 1 else 0:.4f}" ) except (ValueError, TypeError) as e: logger.error(f"Error projecting graph: {str(e)}") raise e except Exception as e: logger.error(f"Unexpe...
Review this code and list any quality issues.
[ { "issue": "Maybe this is again too detailed.", "severity": "minor", "line": 26 } ]
1
python
circle_red.shift(LEFT) circle_blue.shift(RIGHT) gr = VGroup(circle_red, circle_green) gr2 = VGroup(circle_blue) # Constructor uses add directly self.add(gr,gr2) self.wait() gr += gr2 # Add group to an...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n Use :meth:`.Mobject.copy` to create a separate copy which can then\r\n be added to the group.\r\n```", "severity": "minor", "line": 26 } ]
1
python
import re from psycopg2.extensions import adapt from django.db.models import ( CharField, Expression, Field, FloatField, Func, Lookup, TextField, Value, ) from django.db.models.expressions import CombinedExpression, register_combinable_fields from django.db.models.functions import Cast...
Review this code and list any quality issues.
[ { "issue": "Have you looked into psycopg3 compatibility? We have some `if is_psycopg3:` branches.", "severity": "minor", "line": 3 } ]
1
python
You must have :attr:`~Permissions.manage_roles` to do this. .. versionchanged:: 1.6 Can now pass ``int`` to ``colour`` keyword-only parameter. .. versionadded:: 2.0 The ``display_icon`` keyword-only parameter was added. .. versionchanged:: 2.0 This function...
Review this code and list any quality issues.
[ { "issue": "``Union``s with ``None`` should be replaced with ``Optional``\r\n```suggestion\r\n secondary_colour: Optional[Union[:class:`Colour`, :class:`int`]]\r\n The secondary colour for the role.\r\n tertiary_colour: Optional[Union[:class:`Colour`, :class:`int`]]\r\n The t...
1
python
return _('Credentials of type insights and vault are disallowed for scm inventory sources.') elif source == 'openshift_virtualization' and cred and cred.credential_type.kind != 'kubernetes': return _('Credentials of type kubernetes is requred for openshift_virtualization inventory sources.') ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if self.source in discover_available_cloud_provider_plugin_names():\r\n```", "severity": "minor", "line": 26 } ]
1
python
encoding = "latin1" chunks.append((bytes, encoding)) return str(make_header(chunks)) return str(h) result = {} for field, multi in METADATA_FIELDS: if field not in msg: continue key = json_name(field) if multi: value: Union[str...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n payload = cast(str, msg.get_payload())\r\n```\r\n\r\nSince `msg` is not multipart, we have a guarantee that the payload will be a string.", "severity": "minor", "line": 26 } ]
1
python
def set_geom_friction(self, friction, geoms_idx): self._kernel_set_geom_friction(geoms_idx, friction) @ti.kernel def _kernel_set_geom_friction(self, geoms_idx: ti.i32, friction: ti.f32): self.geoms_info[geoms_idx].friction = friction def set_geoms_friction(self, friction, geoms_idx=None, *...
Review this code and list any quality issues.
[ { "issue": "I think it would be better to refactor `_sanitize_1D_io_variables` to support your use case. Here you are abusing the output tensor, which is not great.\r\n\r\n```python\r\n_, link1_idx, envs_idx = self._sanitize_1D_io_variables(\r\n None, link1_idx, self.n_links, envs_idx, idx_name=\"links_idx\"...
1
python
CONF_PASSWORD: PASSWORD, } @pytest.fixture(name="data_latest_event", scope="package") def data_latest_event_fixture() -> JsonObjectType: """Define latest event data.""" return load_json_object_fixture("latest_event_data.json", "simplisafe") @pytest.fixture(name="data_sensor", scope="package") def data_s...
Review this code and list any quality issues.
[ { "issue": "The `data_subscription` fixture returns a dict keyed by `SYSTEM_ID` (an `int`), but the return type is annotated as `JsonObjectType` (string-keyed JSON mapping), which is why a `# type: ignore[return-value]` was added. It would be better to fix the typing by changing the fixture (and any dependent a...
1
python
'author': traverse_obj(post, ('author', 'displayName')), 'author_id': author_did, 'author_thumbnail': traverse_obj(post, ('author', 'avatar'), expected_type=url_or_none), 'author_url': f'https://bsky.app/profile/{author_handle}', 'author_is_uploader': 'Yes' if author_did ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n meta = self._download_json(\r\n 'https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread',\r\n video_id, headers={'Content-Type': 'application/json'}, query={\r\n 'uri': f'at://{did}/app.bsky.feed.post/{video_id}',\r\n ...
1
python
'availability': 'public', 'view_count': int, 'channel': 'Helen & Douglas House', 'comment_count': int, 'uploader_url': 'http://www.youtube.com/user/helendouglashouse', 'duration': 253, 'channel_url': 'https://www.youtube.com/channel/UCTChGezrZVmlYl...
Review this code and list any quality issues.
[ { "issue": "will never happen because of `.+` in regex\r\n```suggestion\r\n```", "severity": "minor", "line": 26 } ]
1
python
import torch import genesis as gs def main(): parser = argparse.ArgumentParser() parser.add_argument("-v", "--vis", action="store_true", default=False) parser.add_argument("-c", "--cpu", action="store_true", default=False) args = parser.parse_args() gs.init(backend=gs.cpu if args.cpu else gs.gpu...
Review this code and list any quality issues.
[]
0
python
'episode': 'The Cup Runneth Over', 'episode_id': 'schitts-creek/s01e01', 'duration': 1309, 'categories': ['comedy'], }, 'params': {'format': 'bv'}, # No format has audio and video combined 'skip': 'Geo-restricted to Canada', }, { # geo-restricted ...
Review this code and list any quality issues.
[ { "issue": "get rid of constants that are used only once", "severity": "minor", "line": 26 } ]
1
python
is_sorted: Optional[bool] = False, descending: Optional[bool] = False, sort_key: Optional[Literal["name", "id", "config_id", "creation_date", "tags"]] = "name", ) -> List[Scenario]: """Retrieve a list of existing scenarios filtered by cycle or tag. This function allows you to retrieve a list of scenari...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n If no filtering criterion is provided, this method returns all existing scenarios.\r\n If is_sorted is set to true, the scenarios are sorted by sort_key. If an incorrect\r\n or no sort_key is provided, the scenarios are sorted by name.\r\n```", "severity": ...
1
python
if backend != BACKEND_VIV: logger.debug("skipping library code matching: only supported by the vivisect backend") return [] if input_format != FORMAT_PE: logger.debug("skipping library code matching: signatures only supports PE files") return [] try: if args.is_default_...
Review this code and list any quality issues.
[ { "issue": "let's move this outside of the try block, otherwise looks great", "severity": "major", "line": 26 } ]
1
python
font_size: float = DEFAULT_FONT_SIZE, line_spacing: float = -1, font: str = "", slant: str = NORMAL, weight: str = NORMAL, t2c: dict[str, str] = None, t2f: dict[str, str] = None, t2g: dict[str, tuple] = None, t2s: dict[str, str] = None, t2w: dict[s...
Review this code and list any quality issues.
[ { "issue": "I think it is unintuitive if a warning is logged when the user doesn't specify a font. The current default argument for `font` is the empty string `\"\"`, should this be special-cased?\r\n\r\n(This is also the reason why the doctests are currently failing in the pipeline.)", "severity": "critica...
1
python
# SnippetViewSet historically allows overriding the URL prefix via the # get_admin_base_path method or the admin_base_path attribute, so preserve that here return self.get_admin_base_path() @cached_property def url_namespace(self): # SnippetViewSet historically allows overriding the URL...
Review this code and list any quality issues.
[]
0
python
self.basis_points = basis_points self.percentage = self.basis_points / 10000.0 self.volume_limit = volume_limit def __repr__(self): return """ {class_name}( basis_points={basis_points}, volume_limit={volume_limit}, ) """.strip().format( class_name=self.__class__.__name__...
Review this code and list any quality issues.
[ { "issue": "Any reason not to use the `raise LiquidityExceeded()` pattern we use in `VolumeShareSlippage` for this?", "severity": "minor", "line": 26 } ]
1
python
"finite_env_type": env_config["parallel_mode"], "concurrency": env_config["concurrency"], "val_every_n_iters": trainer_config.get("val_every_n_epoch", None), "callbacks": callbacks, } vessel_kwargs = { "episode_per_iter": trainer_config["episode_per_collect"], "update_kwa...
Review this code and list any quality issues.
[ { "issue": "Suggest making the final test optional.", "severity": "minor", "line": 26 } ]
1
python
wait = pytestconfig.getoption("--profile-wait") warmup = pytestconfig.getoption("--profile-warmup") active = pytestconfig.getoption("--profile-active") repeat = pytestconfig.getoption("--profile-repeat") schedule = torch.profiler.schedule(wait=wait, warmup=warmup, active=active, repeat=repeat) act...
Review this code and list any quality issues.
[ { "issue": "I don't get it. What not just use the context as it is designed to be used instead of calling __enter__ and __exit__ manually?", "severity": "minor", "line": 26 } ]
1
python
async def farm_block(self, puzzle_hash: bytes32 = bytes32(b"0" * 32)) -> tuple[list[Coin], list[Coin]]: # Fees get calculated fees = uint64(0) for item in self.mempool_manager.mempool.all_items(): fees = uint64(fees + item.fee) # Rewards get created next_block_height...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n additions = []\r\n removals = []\r\n```\r\n\r\nIt looks like you could just call this `additions` and have it be assigned if there is a block.", "severity": "minor", "line": 26 } ]
1
python
result = await self._http_client.crawl( request=context.request, session=context.session, proxy_info=context.proxy_info, statistics=self._statistics, ) yield HttpCrawlingContext.from_basic_crawling_context(context=context, http_response=result.http_respon...
Review this code and list any quality issues.
[ { "issue": "Did you check the equivalent method in `PlaywrightCrawler` as well? Any chance we could deduplicate this?", "severity": "major", "line": 26 } ]
1
python
notification_type: The notification type. This can be one of "success", "info", "warning", or "error".<br/> To remove the last notification, set this parameter to the empty string. message: The text message to display. system_notification: If True, the system will also show the n...
Review this code and list any quality issues.
[ { "issue": "should return state._gui._notify(....)", "severity": "minor", "line": 26 } ]
1
python
generator=generator, gen_kwargs=gen_kwargs, split=split, **kwargs, ) def read(self): # Build iterable dataset if self.streaming: dataset = self.builder.as_streaming_dataset(split=self.split) # Build regular (map-style) dataset ...
Review this code and list any quality issues.
[ { "issue": "Same as above, use `self.builder.config.split`.", "severity": "minor", "line": 26 } ]
1
python
with pytest.raises(ssl.SSLError): context = httpx.SSLContext() context.load_cert_chain(cert_pem_file) def test_load_ssl_config_no_verify(): context = httpx.SSLContext(verify=False) assert context.verify_mode == ssl.VerifyMode.CERT_NONE assert context.check_hostname is False def test_SSLC...
Review this code and list any quality issues.
[]
0
python
'uploader_id': '698', }, 'params': { 'skip_download': True, }, }] def _real_extract(self, url): video_id = self._match_id(url) self._download_webpage('https://globo-ab.globo.com/v2/selected-alternatives?experiments=player-isolated-experiment-02&skipImpressio...
Review this code and list any quality issues.
[ { "issue": "Confirm whether this (and below changes) works with the existing tests", "severity": "minor", "line": 26 } ]
1
python
# Extract device information from mDNS metadata. serial = discovery_info.properties.get("serial_number") device_name = discovery_info.properties.get("device_name") model_type = discovery_info.properties.get("model_type") json_api_enabled = discovery_info.properties.get("json_api_enabled"...
Review this code and list any quality issues.
[ { "issue": "If I read your code correct, the `_async_validate_credentials` can crash and raises exceptions Where in this `async_step_reconfigure` are we catching them? :)", "severity": "critical", "line": 26 } ]
1
python
#!/usr/bin/env python # Copyright (c) ONNX Project Contributors # Copyright (c) ONNX Project Contributors # # SPDX-License-Identifier: Apache-2.0 # NOTE: This is deprecated in favour of protogen's own .pyi generation method. # See: https://github.com/onnx/onnx/pull/6096 # Taken from https://github.com/dropbox...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n# NOTE: This is deprecated in favor of protogen's own .pyi generation method.\r\n```", "severity": "minor", "line": 9 } ]
1
python
voice_dir=pth_voice_dir, **fine_tuned_params ) self.engine.to(devices['CPU']['proc']) del result msg = f"Saved file: {pth_voice_file}" print(msg) re...
Review this code and list any quality issues.
[ { "issue": "Debug print statement should be removed before merging to production. This appears to be leftover debugging code that will pollute logs during normal operation.\n```suggestion\n\n```", "severity": "critical", "line": 26 } ]
1
python
def _real_extract(self, url): webpage = self._download_webpage(url, None) id = self._search_regex(r'data-video-id\s?=\s?\"([^\"]+)\"', webpage, 'id') data_json = self._download_json(f'https://cdn.jwplayer.com/v2/media/{id}', id) video_json = data_json['playlist'][0] formats = [] ...
Review this code and list any quality issues.
[ { "issue": "just use `self._parse_jwplayer_data`", "severity": "minor", "line": 26 } ]
1
python
material=fem_material_linear, ) # Build the scene scene.build() # Run simulation for _ in range(200): scene.step() for entity in scene.entities: state = entity.get_state() pos = state.pos.detach().cpu().numpy() min_pos_z = np.min(pos[..., 2]) assert_all...
Review this code and list any quality issues.
[ { "issue": "Why forcing GPU? Why not marking this test as required?", "severity": "minor", "line": 26 } ]
1
python
@marshal_with(api_based_extension_fields) def get(self, id): api_based_extension_id = str(id) _, tenant_id = current_account_with_tenant() return APIBasedExtensionService.get_with_tenant_id(tenant_id, api_based_extension_id) @api.doc("update_api_based_extension") @api.doc(descripti...
Review this code and list any quality issues.
[ { "issue": "Using `api.payload` directly removes the input validation that `reqparse.RequestParser` provided (type checking, required field validation). Consider using `api.expect()` with a model to maintain input validation and API documentation, or add explicit validation after this line to ensure 'name', 'ap...
1
python
self.host_xfer_buffers: dict[str, torch.Tensor] = {} if self.device_type == "cpu": self.use_host_buffer = False else: self.use_host_buffer = self.kv_buffer_device == "cpu" # reserve different cores for start_load_kv() from model_forward() if self.device_type == "...
Review this code and list any quality issues.
[ { "issue": "You can use current_platform.get_nixl_memory_type() by `impl xpu.py::get_nixl_memory_type()`\nSo you don't need to update line 951.", "severity": "major", "line": 26 } ]
1
python
return False, status_key_occurrences return True, None def distance_transform_edt( img: NdarrayOrTensor, sampling: None | float | list[float] = None, return_distances: bool = True, return_indices: bool = False, distances: NdarrayOrTensor | None = None, indices: NdarrayOrTensor | None = Non...
Review this code and list any quality issues.
[ { "issue": "And this should be (num_channels, H[, W [, D ]]) right? Since we only support up to 3D images.", "severity": "minor", "line": 26 } ]
1
python
"enable_assertion_pass_hook" ) else: self.enable_assertion_pass_hook = False self.source = source self.scope: tuple[ast.AST, ...] = () self.variables_overwrite: defaultdict[tuple[ast.AST, ...], dict[str, str]] = ( defaultdict(dict) ) def r...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n case ast.Expr(value=ast.Constant(value=str() as doc)) if expect_docstring:\r\n```\r\nThis will be faster even if it doesn't look as nice. `str(doc)` will always do the `__match_args__` lookup which will be slow.", "severity": "major", "line": 26 } ]
1
python
required = tuple(int(x) for x in min_version_str.split(".")[:2]) return mod_version >= required def exact_version(the_module: Any, version_str: str = "", *_args: Any) -> bool: """ Returns True if the module's __version__ matches version_str """ if not hasattr(the_module, "__version__"): wa...
Review this code and list any quality issues.
[]
0
python
await add_blocks_in_batches(default_400_blocks, trusted_full_node_api.full_node) await add_blocks_in_batches(default_1000_blocks[:400], untrusted_full_node_api.full_node) with ( patch_request_handler(api=untrusted_full_node_api, handler=register_for_ph_updates), caplog.at_level(logging.INFO), ...
Review this code and list any quality issues.
[ { "issue": "From what I see I think they just had a thinko about asserting `only_trusted_peer`'s return (which happens by default in `time_out_assert`) and asserting `time_out_assert` instead.", "severity": "minor", "line": 26 } ]
1
python
logger.debug('Adding env vars to bash') # don't log the values obs = self.run(CmdRunAction(cmd)) if not isinstance(obs, CmdOutputObservation) or obs.exit_code != 0: raise RuntimeError( f'Failed to add env vars [{env_vars.keys()}] to environment: {obs.content...
Review this code and list any quality issues.
[ { "issue": "Not sure why this is being removed, is it checked outside this method?", "severity": "minor", "line": 26 } ]
1
python
def close_group(self, s): return "close_group overridden" renderer = PathEffectRenderer([path_effects.Normal()], CustomRenderer()) assert renderer.open_group('s') == "open_group overridden" assert renderer.close_group('s') == "close_group overridden" @check_figures_equal() def test_simpleLin...
Review this code and list any quality issues.
[ { "issue": "`rho` is not used since `shadow_color` is specified. You can also pass this directly to `plot`:\r\n```suggestion\r\n ax_test.plot(x, y, linewidth=5,\r\n path_effects=[\r\n\t\t path_effects.SimpleLineShadow(offset=(0, 0), shadow_color='blue')])\r\n\r\n ax_ref.plot(x, y, line...
1
python
_customize_graph() register( 'NAMED_URL_FORMATS', field_class=fields.DictField, read_only=True, label=_('Formats of all available named urls'), help_text=_('Read-only list of key-value pairs that shows the standard format of all available named URLs.')...
Review this code and list any quality issues.
[]
0
python
def _fire_event( self, event_name: str, client_id: t.Optional[str] = None, payload: t.Optional[t.Dict[str, t.Any]] = None ): Timer(interval=0.1, function=self.__do_fire_event, args=(event_name, client_id, payload), ).start() def __do_fire_event( self, eve...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if this_sid:\r\n```\r\nOr did I missed something?", "severity": "minor", "line": 26 } ]
1
python
) result.index.names = values.names # error: Incompatible types in assignment (expression has type # "ndarray[Any, Any] | DatetimeArray | TimedeltaArray | PeriodArray | Any", # variable has type "ndarray[tuple[int, ...], dtype[Any]]") counts = result._values ...
Review this code and list any quality issues.
[ { "issue": "Can you combine the bottom `if` into the top `if`? (I think you had it like this before", "severity": "minor", "line": 26 } ]
1
python
data_file_paths = { "zip_text_path": zip_text_path, "zip_text_with_dir_path": zip_text_with_dir_path, "text_path": text_path, } data_files = str(data_file_paths[data_file]) expected_size = 8 if data_file.startswith("zip") else 4 ds = load_dataset("text", split="train", data_files...
Review this code and list any quality issues.
[ { "issue": "I guess this was for debugging", "severity": "critical", "line": 26 } ]
1
python
t = d_v0 / (d_v0 - d_v1) polygon_vertices[:, i] = pos_v0 + t * (pos_v1 - pos_v0) # Compute tirangle area and centroid if i >= 2: e1 = polygon_vertices[:, i - 1] - polygon_vertices[:, 0] e2 = polygon_vertices[:, ...
Review this code and list any quality issues.
[ { "issue": "I do not recommend using `ti.static` here, because changing the value would trigger recompilation, which is not undesirable. Moreover, the benefits for making it static is basically zero here.", "severity": "minor", "line": 26 } ]
1
python
register_widget_result.value_changed, ) def create_mappings( options: Sequence[T], format_func: Callable[[T], str] = str ) -> tuple[list[str], dict[str, int]]: """Iterates through the options and formats them using the format_func. Returns a tuple of the formatted options and a mapping of the formatt...
Review this code and list any quality issues.
[ { "issue": "**suggestion (non-blocking):** Because these functions validate _and_ also have a possible side-effect of changing state, consider either:\n\n1. Giving them either a name that makes the potential for side-effects clearer.\n2. Refactoring this into 2 different functions and have the widget layer comp...
1
python
_empty_cuda_cache(self.save_mem) if self.in_channels != self.out_channels: x = self.nin_shortcut(x) _empty_cuda_cache(self.save_mem) out = x + h out_tensor: torch.Tensor = convert_to_tensor(out) return out_tensor class MaisiEncoder(nn.Module): """ Conv...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n include_fc: whether to include the final linear layer in the attention block. Default to False.\r\n```", "severity": "minor", "line": 26 } ]
1
python
# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 # MIT License Copyright (c) UChicago Argonne LLC, operator of Argonne National Laboratory. # DeepSpeed Team
Review this code and list any quality issues.
[ { "issue": "Please use Apache-2 license for consistency with the project.", "severity": "minor", "line": 4 } ]
1
python
) scene.add_entity( gs.morphs.Box( size=(0.4, 0.4, 0.4), pos=(0.0, 0.0, 0.18), ) ) scene.build(n_envs=args.num_env, env_spacing=(0.5, 0.5)) scene.rigid_solver.collider.detection() gs.ti.sync() from genesis.engine.solvers.rigid.rigid_solver_decomp import ...
Review this code and list any quality issues.
[ { "issue": "```python\r\n pytest.skip(\r\n \"fast cache not supported on mac gpus when using ndarray, because mac gpu only supports up to 31 kernel\"\r\n \" parameters, and we need more than that.\"\r\n )\r\n```", "severity": "major", "line": 26 } ]
1
python
) @pytest.mark.parametrize( 'deployment_config', [_deployment_yaml_path, _deployment_yaml_with_exec_config_path], ) def test_flow_deployment(deployment_config): flow = Flow().add(deployment=deployment_config) with flow: docs = flow.post(on='/', inputs=DocumentArray.empty(3)) assert le...
Review this code and list any quality issues.
[ { "issue": "do assertions outside the context manager", "severity": "minor", "line": 26 } ]
1
python
import asyncio from os import path import lancedb from pydantic import BaseModel from lancedb.pydantic import LanceModel, Vector from typing import Generic, List, Optional, TypeVar, Union, get_args, get_origin, get_type_hints from cognee.exceptions import InvalidValueError from cognee.infrastructure.engine import Data...
Review this code and list any quality issues.
[ { "issue": "Locks need to be part of database instance and not global locks", "severity": "minor", "line": 20 } ]
1
python
lr.fit(X, Y) elo_scores = SCALE * lr.coef_[0] + INIT_RATING # calibrate llama-13b to 800 if applicable if "mixtral-8x7b-instruct-v0.1" in models.index: elo_scores += 1114 - elo_scores[models["mixtral-8x7b-instruct-v0.1"]] return ( pd.Series(elo_scores[:p], index=models.index).sort_value...
Review this code and list any quality issues.
[ { "issue": "should we keep this list of style elements somewhere else not as default argument?", "severity": "minor", "line": 26 } ]
1
python
if not next_url: break def _real_extract(self, url): collection_slug = self._match_id(url) channel = self._call_api( f'https://content.api.nebula.app/content/{collection_slug}/?include=lessons', collection_slug, note='Retrieving channel') if channel....
Review this code and list any quality issues.
[ { "issue": "why did this get reverted after applying my suggestions?\r\n```suggestion\r\n IE_NAME = 'nebula:season'\r\n _VALID_URL = rf'{_BASE_URL_RE}/(?P<series>[\\w-]+)/?season/(?P<season_number>\\d+)'\r\n```", "severity": "minor", "line": 26 } ]
1
python
from .common import InfoExtractor from ..utils import ( HEADRequest, ExtractorError, determine_ext, merge_dicts, unescapeHTML, ) class Ant1NewsGrBaseIE(InfoExtractor): @staticmethod def _scale_thumbnails_to_max_width(formats, thumbnails, url_width_re): _keys = ('width', 'height') ...
Review this code and list any quality issues.
[ { "issue": "You can make this a common function", "severity": "minor", "line": 26 } ]
1
python
path = THIS_DIR / "data" / "include_exclude_tests" include = "" exclude = r"/exclude/|a\.py" src = "-" report = black.Report() stdin_filename = str(path / "b/exclude/a.py") expected = [Path(f"__BLACK_STDIN_FILENAME__{stdin_filename}")] sources = list( ...
Review this code and list any quality issues.
[ { "issue": "typo :)\r\n```suggestion\r\n # Extend exclude shouldn't exclude stdin_filename since it is mimicking the\r\n```", "severity": "minor", "line": 26 } ]
1
python
from .common import InfoExtractor class BibelTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?bibeltv\.de/mediathek/videos/(?:crn/)?(?P<id>\d+)' _TESTS = [{ 'url': 'https://www.bibeltv.de/mediathek/videos/329703-sprachkurs-in-malaiisch', 'md5': '252f908192d611de038b8504b08bf97f', ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n video_data = traverse_obj(\r\n self._search_nextjs_data(self._download_webpage(url, crn_id), crn_id),\r\n ('props', 'pageProps', 'videoPageData', 'videos', 0, {dict}))\r\n```", "severity": "minor", "line": 26 } ]
1
python
if not return_dict: return ( pred_prev_sample, pred_original_sample, ) return DDPMParallelSchedulerOutput(prev_sample=pred_prev_sample, pred_original_sample=pred_original_sample) def batch_step_no_noise( self, model_output: torch.Tens...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n Current discrete timesteps in the diffusion chain. This is a tensor of integers.\n```", "severity": "minor", "line": 26 } ]
1
python
super().notify_style_update() self.rebuild() def rebuild(self) -> None: """Rebuild the content of the block if we have a source token.""" if self._token is not None: self.build_from_token(self._token) def build_from_token(self, token: Token) -> None: """Build the bl...
Review this code and list any quality issues.
[ { "issue": "Wouldn't `\"\\s+\"` included spaces and tabs?\r\n\r\nThere isn't much benefit in compiling the regex here. The `re` module has its own cache. I'd suggest moving the `re.compile` to module scope, or omitting and and let the `re` module do the caching.", "severity": "major", "line": 26 } ]
1
python
) text_encoder_two = class_two.from_pretrained( args.pretrained_model_name_or_path, subfolder="text_encoder_2", revision=args.revision, variant=args.variant ) return text_encoder_one, text_encoder_two def log_validation( pipeline, args, accelerator, pipeline_args, epoch, to...
Review this code and list any quality issues.
[ { "issue": "I think this is only needed for the intermediate validation. Do we need to check for that?", "severity": "minor", "line": 26 } ]
1
python
query = step.query query.from_table = Identifier("df_table") if step.add_absent_cols and isinstance(query, Select): query_cols = set() def f_all_cols(node, **kwargs): if isinstance(node, Identifier): query_cols.add(node.parts[-1]) ...
Review this code and list any quality issues.
[ { "issue": "I think is better to replace `inject_values` function and use `get_fill_param_fnc' function instead (which is used by other steps to fill parameter values):\r\n```\r\nfill_params = get_fill_param_fnc(self.steps_data)\r\nquery_traversal(query, fill_params)\r\n```", "severity": "minor", "line"...
1
python
from wagtail.models import Locale from wagtail.permissions import locale_permission_policy from .forms import LocaleForm from .utils import get_locale_usage if TYPE_CHECKING: from django.http import HttpRequest, HttpResponseBase class LanguageTitleColumn(TitleColumn): cell_template_name = "wagtaillocales/_l...
Review this code and list any quality issues.
[ { "issue": "Missing `.count()`:\r\n\r\n```suggestion\r\n return Locale.objects.filter(language_code__in=defined_locales).count() < len(\r\n defined_locales\r\n )\r\n```", "severity": "minor", "line": 26 } ]
1
python
import json import os from typing import Dict, List, Optional, Union, Any from openai import OpenAI from mem0.configs.llms.base import BaseLlmConfig from mem0.llms.base import LLMBase class OpenAILLM(LLMBase): def __init__(self, config: Optional[BaseLlmConfig] = None): super().__init__(config) ...
Review this code and list any quality issues.
[ { "issue": "Hey, what do we need to import these?", "severity": "minor", "line": 3 } ]
1
python
playlist_id = self._match_id(url) api_url = f'{self._API_BASE}/shows/{playlist_id}' self.write_debug(f'API URL: {api_url}') api_data = self._download_json( api_url, playlist_id, note='Downloading show data from API', ) self.write_debug(f'API response ke...
Review this code and list any quality issues.
[ { "issue": "Can inline the title/description extraction. For description, I would also use the actual description instead of the extract\r\n```suggestion\r\n self._entries(api_data), playlist_id,\r\n **traverse_obj(api_data, ('entry', {\r\n 'title': ('title', {str}),\r\n ...
1
python
@property def base_url(self) -> str: return self._client.meta.endpoint_url @property def client(self) -> BaseClient: return self._client def model_profile(self, model_name: str) -> ModelProfile | None: provider_to_profile: dict[str, Callable[[str], ModelProfile | None]] = { ...
Review this code and list any quality issues.
[ { "issue": "we can get rid of the new `_strip_geo_prefix` function, (we went from 5 lines to 25 for the same thing)\r\nlet's simply fix the check\r\n\r\n```python\r\n # Split the model name into parts\r\n parts = model_name.split('.', 2)\r\n\r\n # Handle regional prefixes\r\n if len(...
1