language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
epoch_callback_metrics = _processed_outputs[3] # -------------------------- # Structured Result (auto epoch end) # -------------------------- elif is_result_obj: epoch_log_metrics, epoch_progress_bar_metrics = self.__auto_reduce_results_on_epoch_end(epoch_output) re...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n opt_outputs = time_reduced_outputs[0].__class__.reduce_on_epoch_end(time_reduced_outputs)\r\n```", "severity": "minor", "line": 26 } ]
1
python
issue_domain=DOMAIN, severity=ir.IssueSeverity.WARNING, translation_key="deprecated_yaml", translation_placeholders={ "domain": DOMAIN, "integration_title": INTEGRATION_TITLE, }, ) async def async_setup_entry( hass: HomeAssistant, config_entry: Confi...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n (\r\n OpenEVSESensor(\r\n config_entry.data[CONF_HOST],\r\n config_entry.runtime_data,\r\n config_entry.entry_id,\r\n description,\r\n )\r\n for description in SENSOR_TYPES\r\n ...
1
python
#!/usr/bin/env python from setuptools import find_packages, setup setup( name="redis", description="Python client for Redis database and key-value store", long_description=open("README.md").read().strip(), long_description_content_type="text/markdown", keywords=["Redis", "key-value store", "databas...
Review this code and list any quality issues.
[ { "issue": "Version should be 5.2.1 as master always refers to latest stable version. 5.3.0 is in beta so it's only for now in 5.3 version branch", "severity": "minor", "line": 11 } ]
1
python
import ast import re class Category: def __init__(self): pass @staticmethod def create_category(name): if name == "criteria_tag": return CategoryHardPrompt() elif name == "if_tag": return CategoryIF() elif name == "math_tag": return Cate...
Review this code and list any quality issues.
[ { "issue": "```\r\n- category_tag\r\n - criteria_v0.1\r\n - specificity\r\n - ...\r\n - math_v0.1\r\n - math\r\n - if_v0.1\r\n - if\r\n - score\r\n```", "severity": "minor", "line": 11 } ]
1
python
[T('2013-12-31'), T('2013-12-31 23'), 67, np.nan, np.nan], [T('2014-01-01'), T('2014-01-01 22'), 65, np.nan, np.nan], [T('2014-01-01'), T('2014-01-01 23'), 65, np.nan, 1], [T('2014-01-01'), T('2014-01-01 22'), 66, np.nan, np.nan], ...
Review this code and list any quality issues.
[]
0
python
return result return sync_endpoint @conn_retry("FastAPI server", "Starting FastAPI server") def __start_fastapi(self): logger.info( f"[{self.service_name}] Starting RPC server at http://{api_host}:{self.get_port()}" ) server = uvicorn.Server( uvicor...
Review this code and list any quality issues.
[ { "issue": "I don't think database.py calls super().cleanup() yet on their cleanup implementation?", "severity": "minor", "line": 26 } ]
1
python
"dataType": ["text"], }, { "name": "app_id", "dataType": ["text"], }, ], }, ] } self.cl...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if ids:\r\n```", "severity": "minor", "line": 26 } ]
1
python
with tm.assert_produces_warning(FutureWarning, match=msg): result = s.str.contains("foo", na="foo") if any_string_dtype == "object": expected = Series(["foo", "foo", "foo"], dtype=np.object_) elif any_string_dtype.na_value is np.nan: expected = Series([True, True, True], dtype=np.bool_) ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n```\r\n\r\nThat should already happen via the fixture, I think?", "severity": "minor", "line": 26 } ]
1
python
self.chars = self._gen_chars(lines_str_list) self.lines = [list(self.chars), [self.alignment] * self.chars.__len__()] self.lines_initial_positions = [line.get_center() for line in self.lines[0]] self.add(*self.lines[0]) self.move_to(np.array([0, 0, 0])) if self.alignment: ...
Review this code and list any quality issues.
[ { "issue": "While we are at it... 😅 \r\n\r\n```suggestion\r\n for line_no in range(len(lines_str_list)):\r\n```", "severity": "minor", "line": 26 } ]
1
python
"""Block for searching issues on Linear""" class Input(BlockSchemaInput): term: str = SchemaField(description="Term to search for issues") credentials: CredentialsMetaInput = linear.credentials_field( description="Linear credentials with read permissions", required_scopes={L...
Review this code and list any quality issues.
[]
0
python
async def widget(self): """|coro| Returns the widget of the guild. .. note:: The guild must have the widget enabled to get this information. Raises ------- Forbidden The widget for this guild is disabled. HTTPException Retri...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n async def edit_widget(self, *, enabled: bool = utils.MISSING, channel: Optional[abc.Snowflake] = utils.MISSING) -> None:\r\n```", "severity": "minor", "line": 26 } ]
1
python
class FourZeroStudioArchiveIE(FourZeroStudioBaseIE): _VALID_URL = r'https?://0000\.studio/(?P<uploader_id>[^/]+)/broadcasts/(?P<id>[^/]+)/archive' IE_NAME = '0000studio:archive' _TESTS = [{ 'url': 'https://0000.studio/mumeijiten/broadcasts/1290f433-fce0-4909-a24a-5f7df09665dc/archive', 'info...
Review this code and list any quality issues.
[ { "issue": "comments returned by infodict is supposed to have a specific form\r\n```\r\n comments: A list of comments, each with one or more of the following\r\n properties (all but one of text or html optional):\r\n * \"author\" - human-readable name of the co...
1
python
not aware of the context of the test framework. Using the `wait_until()` members from `BitcoinTestFramework` or `P2PInterface` class ensures the timeout is properly scaled. Furthermore, `wait_until()` from `P2PInterface` class in `p2p.py` has a preset lock. """ timeout = timeout * timeout_factor ...
Review this code and list any quality issues.
[ { "issue": "nano nit:\r\n\r\nconsider adding a docstring to the new export_env_build_path function. Its purpose was clear in the old context, but a comment would be helpful now that it's a standalone utility.", "severity": "major", "line": 26 } ]
1
python
mob = self.ellipse_to_mobject(shape) elif isinstance(shape, se.Polygon): mob = self.polygon_to_mobject(shape) elif isinstance(shape, se.Polyline): mob = self.polyline_to_mobject(shape) elif isinstance(shape, se.Text): mob = self.text_to...
Review this code and list any quality issues.
[]
0
python
as .. math:: A_k = \\sum_{m=0}^{n-1} a_m \\exp\\left\\{-2\\pi i{mk \\over n}\\right\\} \\qquad k = 0,\\ldots,n-1. The DFT is in general defined for complex inputs and outputs, and a single-frequency component at linear frequency :math:`f` is represented by a complex exponential :math:`a_m = \\exp\\{2\\pi i\\,f...
Review this code and list any quality issues.
[]
0
python
elif isinstance(item, BetaThinkingBlock): items.append(ThinkingPart(content=item.thinking, signature=item.signature, provider_name=self.system)) elif isinstance(item, BetaMCPToolUseBlock): call_part = _map_mcp_server_use_block(item, self.system) builtin_tool_c...
Review this code and list any quality issues.
[ { "issue": "I think we should do this in `ModelRequestNode`, so that it'll work for all models, not just Anthropic.\r\n\r\nThat would mean that it wouldn't trigger `FallbackModel` to try another model, but that will be possible once we do https://github.com/pydantic/pydantic-ai/issues/3640.", "severity": "m...
1
python
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and relat...
Review this code and list any quality issues.
[ { "issue": "I guess this should be `gs.np_float`?", "severity": "minor", "line": 24 } ]
1
python
QueriesTable, MetaHandlerInfoTable, ] def __init__(self, session): self.session = session self.integration_controller = session.integration_controller self.project_controller = ProjectController() self.database_controller = session.database_controller self.persi...
Review this code and list any quality issues.
[ { "issue": "can it lead to slowing down when files datanode is requested several times?", "severity": "major", "line": 26 } ]
1
python
) self._move_into_position(width, height) def _ensure_valid_file(self): """Reads self.file_name and determines whether the given input file_name is valid. """ if self.file_name is None: raise Exception("Must specify file for SVGMobject") if self.file_nam...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n config.get_dir(\"assets_dir\") / self.file_name,\r\n config.get_dir(\"assets_dir\") / (str(self.file_name) + \".svg\"),\r\n config.get_dir(\"assets_dir\") / (str(self.file_name) + \".xdv\"),\r\n self.file_path,\r\n Path(str(sel...
1
python
'title': 'Mr. Siro - video', 'description': 'md5:5bdcf45e955dc1b8d7f518f322ffef36', }, 'playlist_mincount': 15, }] def _fetch_page(self, user_id, url_type, page): url_type = 'user-list-song' if url_type == 'bai-hat' else 'user-list-video' return self._call_api(url_ty...
Review this code and list any quality issues.
[ { "issue": "`else 'aSingle'` doesn't make sense. The lambda should only return bool", "severity": "minor", "line": 26 } ]
1
python
def _sleep(self, timeout, video_id, msg_template=None): if msg_template is None: msg_template = '%(video_id)s: Waiting for %(timeout)s seconds' msg = msg_template % {'video_id': video_id, 'timeout': timeout} self.to_screen(msg) time.sleep(timeout) def _extract_f4m_format...
Review this code and list any quality issues.
[ { "issue": "this is unreachable now. Similar for the other functions", "severity": "minor", "line": 26 } ]
1
python
if managed_policy.get("PolicyName") == managed_policy_name: return True return False def role_newer_than_x_days(role: Dict, days: int) -> bool: """ Checks a role dictionary to determine if it is newer than the specified number of days :param role: An AWS role dictionary (from a boto3 get_...
Review this code and list any quality issues.
[ { "issue": "Nit: The body of this function could just be `return role.get(\"RoleName\").endswith(\"InstanceProfile\")`", "severity": "minor", "line": 26 } ]
1
python
dagbag = DagBag(dag_folder=str(dag_file), bundle_path=tmp_path, include_examples=False) # Check import was successful assert len(dagbag.dags) == 1 assert not dagbag.import_errors dag = dagbag.get_dag("test_import") assert dag is not None assert str(tmp_path) in dag.desc...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n from airflow.sdk import DAG\n```", "severity": "minor", "line": 26 } ]
1
python
self._merge_subtitles(subs, target=subtitles) if caption_url := traverse_obj(video_data, ('captionPath', {url_or_none})): subtitles.setdefault('en', []).append({'url': caption_url, 'ext': 'vtt'}) return { 'id': video_id, 'display_id': display_id, 'formats...
Review this code and list any quality issues.
[ { "issue": "IMO we can trust that they won't use fake month numerals... and if they do, who cares?\r\n```suggestion\r\n _VALID_URL = r'https?://(?:www\\.)?tvw\\.org/\\d{4}/\\d{2}/(?P<id>[^/?#]+)'\r\n```", "severity": "minor", "line": 26 } ]
1
python
"""Generate chat completion stream as JSON strings.""" async for chunk in self._chat_chunk_stream(command_id): assert not isinstance(chunk, ImageChunk) if chunk.finish_reason == "error": error_response = ErrorResponse( error=ErrorInfo( ...
Review this code and list any quality issues.
[ { "issue": "Why did you make this change here but inconsistently in this file?", "severity": "minor", "line": 26 } ]
1
python
for xid in range(n_experts): ename = f"model.layers.{bid}.mlp.experts.{xid}.{w_name}.weight" datas.append(self._experts[bid][ename]) del self._experts[bid][ename] data_torch = torch.stack(datas, dim=0) merg...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n@ModelBase.register(\"HunYuanDenseV1ForCausalLM\")\r\n```", "severity": "minor", "line": 26 } ]
1
python
'url': 'https://ca.bbcollab.com/collab/ui/session/playback/load/b6399dcb44df4f21b29ebe581e22479d', 'only_matching': True, }, { 'url': 'https://eu.bbcollab.com/recording/51ed7b50810c4444a106e48cefb3e6b5', 'only_matching': True, }, { 'url': '...
Review this code and list any quality issues.
[ { "issue": "- Looks like authorization is not always required, yes? Get token by `parse_qs()` and clean the headers dict by `filter_dict()`.\r\n- The `base_url` is used multiple times. Let's make a `_call_api` function to be more Object-Oriented.", "severity": "critical", "line": 26 } ]
1
python
] SPATIAL_CROP_GUIDANCE_TEST_CASE_3 = [ {"keys": ["image"], "guidance": "guidance", "spatial_size": [3, 3], "margin": 0}, DATA_8, np.array( [ [ [[47, 48, 49], [57, 58, 59], [67, 68, 69]], [[147, 148, 149], [157, 158, 159], [167, 168, 169]], ...
Review this code and list any quality issues.
[ { "issue": "I don't think changing this dictionary affects anything, it just adds the default values for these parameters. The addition here I think can be omitted.\r\n```suggestion\r\n {\"keys\": [\"pred\"], \"ref_image\": \"image\", \"mode\": \"nearest\"},\r\n```", "severity": "minor", "line": 26 ...
1
python
Leaf(token.DOT, ".") for _ in range(3) ] @property def is_def(self) -> bool: """Is this a function definition? (Also returns True for async defs.)""" try: first_leaf = self.leaves[0] except IndexError: return False try: second_leaf: O...
Review this code and list any quality issues.
[ { "issue": "Doesn't this also match something like `def f(x): y = ...`?", "severity": "minor", "line": 26 } ]
1
python
if any(not p.is_cuda for p in preds): preds = [p.cpu() for p in preds] # ensure CPU if at least one is on CPU if self.mode == "mean": prob = MeanEnsemble()(preds) return prob2class(cast(torch.Tensor, prob), dim=0, keepdim=True, sigmoid=sigmoid) elif self.mode == "vo...
Review this code and list any quality issues.
[ { "issue": "to make it a list here, the texts should be aligned ... like this https://github.com/Project-MONAI/MONAI/blob/0a001156003bbd485db9aa3b40692a7a157189c4/monai/data/meta_tensor.py#L85-L89", "severity": "minor", "line": 26 } ]
1
python
the provided value or calculates a default based on available system memory. Args: object_store_memory: The user-specified object store memory size in bytes. If None, a default size will be calculated. Returns: The resolved object store memory size in bytes. """ if object_s...
Review this code and list any quality issues.
[ { "issue": "It looks like there was an issue with performance on a 16GB macbook many years ago. We've added a lot of code to limit plasma size to 2GB on a 16GB mac with an environment variable, some config vars. https://github.com/ray-project/ray/pull/21224/files\r\n\r\nMight be an opportunity to nuke this and ...
1
python
# Android player_response does not have microFormats which are needed for # extraction of some data. So we return the initial_pr with formats # stripped out even if not requested by the user # See: https://github.com/yt-dlp/yt-dlp/issues/501 prs.append({**initial_pr, 'str...
Review this code and list any quality issues.
[]
0
python
supports_function_calling: bool supports_reasoning_effort: bool supports_prompt_cache: bool supports_stop_words: bool # Pattern tables capturing current behavior. Keep patterns lowercase. FUNCTION_CALLING_PATTERNS: list[str] = [ # Anthropic families 'claude-3-7-sonnet*', 'claude-3.7-sonnet*', ...
Review this code and list any quality issues.
[ { "issue": "I think the patterns above should work for bedrock too?", "severity": "minor", "line": 26 } ]
1
python
# NOTE: this is a workaround for the rendering "unstandard markdown" # in rich. The chatbots output treat "\n" as a new line for # better compatibility with real-world text. However, rendering # in markdown would break the format. It is because standard markdown ...
Review this code and list any quality issues.
[]
0
python
Tests ----- Check that creating a :class:`~.MathTex` works:: >>> MathTex('a^2 + b^2 = c^2') # doctest: +SKIP MathTex('a^2 + b^2 = c^2') Check that double brace group splitting works correctly:: >>> t1 = MathTex('{{ a }} + {{ b }} = {{ c }}') # doctest: +SKIP >>> len(t1.sub...
Review this code and list any quality issues.
[]
0
python
def initialize_engine(api_key, model_name): """Initialize the SambaNova inference engine.""" return SambanovaInferenceEngine( model_params=ModelParams(model_name=model_name), generation_params=GenerationParams( batch_size=1, ), remote_params=RemoteParams( ...
Review this code and list any quality issues.
[]
0
python
params: Optional[List[Any]] = None, ) -> None: """Subscribe a function to be called on `Job^` status change. The subscription is applied to all jobs created from the sequence's execution. Note: Notification will be available only for jobs created after this subscription. ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n params (Optional[List[Any]]): The parameters to be passed to the _callback_.\r\n```", "severity": "minor", "line": 26 } ]
1
python
Args: id: Unique identifier for this AgentOS instance name: Name of the AgentOS instance description: Description of the AgentOS instance version: Version of the AgentOS instance agents: List of agents to include in the OS teams: List of teams to i...
Review this code and list any quality issues.
[ { "issue": "We should use official DeprecationWarning s", "severity": "minor", "line": 26 } ]
1
python
# https://packaging.python.org/guides/single-sourcing-package-version/ # http://blog.ionelmc.ro/2014/05/25/python-packaging/ PATH_ROOT = os.path.dirname(__file__) builtins.__LIGHTNING_SETUP__ = True import pytorch_lightning # noqa: E402 def load_requirements(path_dir=PATH_ROOT, file_name='base.txt', comment_char='#...
Review this code and list any quality issues.
[ { "issue": "Any chance you could add tests for those functions ?", "severity": "minor", "line": 26 } ]
1
python
self.play(LaggedStart( dot1.animate.shift(RIGHT * 4), dot2.animate.shift(RIGHT * 4), dot3.animate.shift(RIGHT * 4), lag_ratio=0.25, run_time=4 )) """ def __init__( self, *animatio...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n :class:`~.Animation` to apply to mobject.\r\n```", "severity": "minor", "line": 26 } ]
1
python
def _get_minute_spot_value(self, asset, column, dt, ffill=False): reader = self._get_pricing_reader('minute') if not ffill: try: return reader.get_value(asset.sid, dt, column) except NoDataOnDate: if column != 'volume': return ...
Review this code and list any quality issues.
[]
0
python
'title': 'Forsaken By Hope Studio Clip', 'description': 'Forsaken By Hope Studio Clip — Смотреть онлайн', 'upload_date': '19700101', 'timestamp': 0, 'thumbnail': r're:https://[^/]+/impf/7vN3ACwSTgChP96OdOfzFjUCzFR6ZglDQgWsIw/KPaACiVJJxM\.jpg\?size=800x450&quality=96&keep_...
Review this code and list any quality issues.
[ { "issue": "This is how the regex should be if `_html_search_meta` wasnt available\r\n\r\n```suggestion\r\n r'<meta[^>]+itemprop\\s*=\\s*\"name\"[^>]+content\\s*=\\s*\"([^\">]+)\"',\r\n```", "severity": "minor", "line": 26 } ]
1
python
self.destinations[1]["node"].wait_for_inv([inv]) self.log.info("Checking getprivatebroadcastinfo reports final_state after it is received back") pbinfo = tx_originator.getprivatebroadcastinfo() info = [t for t in pbinfo["transactions"] if t["wtxid"] == txs[0]["wtxid"]] assert_equal(len(...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n self.log.info(\"Checking abortprivatebroadcast fails for non-existent transaction\")\n assert_raises_rpc_error(-5, \"Transaction not in private broadcast queue\",\n tx_originator.abortprivatebroadcast, \"0\" * 64)\n```", "severity": "c...
1
python
name = element[0] desc = element[1] properties_doc = "" property_list: List[Dict[str, Any]] = [] property_indices: List[int] = [] properties = resolve_inherit( name, desc["properties"], desc.get("inherits", None)...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n # Append properties doc to element doc\r\n```", "severity": "minor", "line": 26 } ]
1
python
}, { # First capture is a 302 redirect intermediary page. 'url': 'https://web.archive.org/web/20050214000000/http://www.youtube.com/watch?v=0altSZ96U4M', 'info_dict': { 'id': '0altSZ96U4M', 'ext': 'mp4', 'title': '0altSZ96U4M' ...
Review this code and list any quality issues.
[ { "issue": "You may want to use `_html_search_regex` instead of `strip_or_none(self._search_regex` here", "severity": "minor", "line": 26 } ]
1
python
httpx_logger = logging.getLogger('httpx') httpx_logger.setLevel( logging.DEBUG if get_configured_log_level(self._configuration) <= logging.DEBUG else logging.WARNING ) if not _logger: _logger = logging.getLogger(__name__) self._logger = _logger ...
Review this code and list any quality issues.
[ { "issue": "Isn't type inference enough here?", "severity": "minor", "line": 26 } ]
1
python
session = KedroSession.create(mock_package_name, fake_project) session.close() mock_logging.assert_not_called() @pytest.mark.usefixtures("mock_settings_context_class") def test_default_store( self, fake_project, fake_session_id, caplog, mock_package_name ): caplog.set_level...
Review this code and list any quality issues.
[]
0
python
gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain, ) with tempfile.NamedTemporaryFile() as temp_file: self.log.info("Downloading data from blob: %s", self.blob_name) azure_hook.get_file( file_path=temp_file.name, ...
Review this code and list any quality issues.
[ { "issue": "See my comment in the original issue regarding breaking changes (relevant to all related PRs):\nhttps://github.com/apache/airflow/issues/11323#issuecomment-3797323872", "severity": "minor", "line": 26 } ]
1
python
'title': 'EP:15 | Music Marketing (Likes) - Part 2', 'description': 'md5:0588c43e27be46423e183076fa071177', 'timestamp': 1502250336, 'upload_date': '20170809', 'uploader': 'SWM', 'uploader_id': '9780658', 'duration': 1063.42, 'view_coun...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n episode_id = self._match_id(url)\r\n query = {}\r\n if key := traverse_obj(url, ({parse_qs}, 'key', 0)):\r\n query = {'key': key}\r\n```\r\n\r\nimport `traverse_obj` from `..utils.traversal` and `parse_qs` from `..utils`", "severity": "minor", ...
1
python
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) @pytest.mark.parametrize( ("entity_id", "new_value", "called_function_name"), [ ("time.home_assistant_test_bedtime_alarm", "20:00:00", "set_bedtime_alarm"), ( "time.home_assistant_test_bedtime_end_...
Review this code and list any quality issues.
[]
0
python
from .const import DOMAIN from .coordinator import ( PowerfoxConfigEntry, PowerfoxDataUpdateCoordinator, PowerfoxReportDataUpdateCoordinator, ) PLATFORMS: list[Platform] = [Platform.SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: PowerfoxConfigEntry) -> bool: """Set up Powerfox from a...
Review this code and list any quality issues.
[ { "issue": "Not a fan of stringified error messages as you'll end up with mixed language strings in the UI", "severity": "minor", "line": 26 } ]
1
python
class VKPlayBaseIE(InfoExtractor): _RESOLUTIONS = { 'tiny': '256x144', 'lowest': '426x240', 'low': '640x360', 'medium': '852x480', 'high': '1280x720', 'full_hd': '1920x1080', 'quad_hd': '2560x1440', } def _extract_initial_state(self, url, video_id): ...
Review this code and list any quality issues.
[ { "issue": "fixing typo from my suggestion\r\n```suggestion\r\n elif format_id == 'dash':\r\n```", "severity": "minor", "line": 26 } ]
1
python
pipeline = modular_pipeline( [node(identity, "A", "B"), node(return_none, "B", "C")] ) catalog = DataCatalog({"A": MemoryDataset("42")}) pattern = "Saving 'None' to a 'Dataset' is not allowed" with pytest.raises(DatasetError, match=pattern): ThreadRunner().run(pip...
Review this code and list any quality issues.
[]
0
python
Documentation ------------- - https://pytorch-lightning.readthedocs.io/en/latest - https://pytorch-lightning.readthedocs.io/en/stable """ _root_logger = logging.getLogger() _logger = logging.getLogger(__name__) _logger.setLevel(logging.INFO) # if root logger has handlers, propagate messages up and let root logger proc...
Review this code and list any quality issues.
[ { "issue": "so you determined that this is not needed anymore? is it ok with the docs build?", "severity": "minor", "line": 26 } ]
1
python
self.socket_send_timeout_ms = config.get_extra_config_value( "p2p_socket_send_timeout_ms", DEFAULT_SOCKET_SEND_TIMEOUT_MS ) # Load max retry count from extra_config self.max_retry_count = config.get_extra_config_value("p2p_max_retry_count", 3) # tp rank is worker id for now...
Review this code and list any quality issues.
[ { "issue": "If this is a TODO comment, it would be better if you add you name here.\r\ne.g. TODO(chunxiaozheng) : location is not used for now", "severity": "minor", "line": 26 } ]
1
python
number_of_data = 1000 texts, embeddings, ids, metadatas, _ = utils.create_data( number_of_data=number_of_data, embedding_dim=EMBEDDING_DIM ) # initialize vector store object: vector_store = DeepLakeVectorStore( path="./deeplake_vector_store", overwrite=True, verbose=True...
Review this code and list any quality issues.
[]
0
python
kwargs={'fix_imports': False}) for allow_pickle in [True, False]: self.assert_not_deprecated(np.save, args=sample_args, kwargs={'allow_pickle': allow_pickle}) self.assert_deprecated(np.save, args=sample_args, ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n # pickle files. This may be fine, but needs to be done with some care since\r\n```", "severity": "minor", "line": 26 } ]
1
python
} ) # Gradient must be synchronized if zero2 is enabled. https://github.com/hpcaitech/ColossalAI/blob/44d4053fec005fe0b06b6bc755fdc962463145df/colossalai/booster/plugin/hybrid_parallel_plugin.py#L1500 ctx = ( nullcontext() if need_update or self.booster.plugin.zero_stage...
Review this code and list any quality issues.
[]
0
python
'creator': '李荣浩 / 朱正廷 / 陈立农 / 尤长靖 / ONER灵超 / ONER木子洋 / 杨非同 / 陆定昊', 'timestamp': 1522944000, 'upload_date': '20180405', 'description': 'md5:3650af9ee22c87e8637cb2dde22a765c', 'subtitles': {'lyrics': [{'ext': 'lrc'}]}, "duration": 256, 'thumbnail': r...
Review this code and list any quality issues.
[ { "issue": "how is this `album_artist` value an empty string when the extraction code ends with `or None`?", "severity": "major", "line": 26 } ]
1
python
self._sort_formats(formats) for f in formats: f.setdefault('http_headers', {}).update(headers) for text_track in json_data.get('text_tracks', []): if text_track.get('kind') != 'captions': continue text_track_url = url_or_none(text_track.get('src')) ...
Review this code and list any quality issues.
[ { "issue": "this will fail if poster is `None`\r\nA better way would be to assign poster_url to this and then run the rest of the code only if poster_url exists", "severity": "critical", "line": 26 } ]
1
python
url = getattr(settings, 'AUTOMATION_ANALYTICS_URL', None) if not url: logger.error('AUTOMATION_ANALYTICS_URL is not set') return False rh_user = getattr(settings, 'REDHAT_USERNAME', None) rh_password = getattr(settings, 'REDHAT_PASSWORD', None) with open(path, 'rb') as f: files...
Review this code and list any quality issues.
[ { "issue": "we should condition this call to `s.post` on `if rh_user and rh_password:`\r\n\r\nand if either are None, we'll log the error in the lines below", "severity": "minor", "line": 26 } ]
1
python
# This provider has no authentication methods configured at all configured_providers.append(False) logger.debug( f"Block {block_cls.__name__} has a required credentials field {field_name} that has no provider - Treating as valid" ) continue # If p...
Review this code and list any quality issues.
[ { "issue": "This log message is misleading. The condition is checking if OAuth environment variables are not configured, not if there's 'no provider'. The message should reflect the actual issue: OAuth credentials not configured.\n```suggestion\n f\"Block {block_cls.__name__} has a requir...
1
python
and self.parent_page.has_workflow ): return self.submit_action() else: return self.save_action() def get_page_subtitle(self): return self.page_class.get_verbose_name() def get_edit_message_button(self): return messages.button( reverse("wagtai...
Review this code and list any quality issues.
[ { "issue": "Issue: These should match the existing restriction names (`BaseViewRestriction.RESTRICTION_CHOICES`).", "severity": "minor", "line": 26 } ]
1
python
if "instruction" in raw_sample or "input" in raw_sample: messages.append( { "role": "user", "content": [ {"type": "text", "value": raw_sample.get("instruction", "") + raw_sample.get("input", "")} ], "loss_weight": 0....
Review this code and list any quality issues.
[ { "issue": "Can we use the huggingface dpo data format? https://huggingface.co/datasets/HuggingFaceH4/orca_dpo_pairs", "severity": "minor", "line": 26 } ]
1
python
raise RuntimeError( "AWQ quantization requires autoawq library.\n" "Install with: `pip install autoawq`\n" ) if not torch.cuda.is_available(): raise RuntimeError( "AWQ quantization requires a GPU. " "Please use a machine wi...
Review this code and list any quality issues.
[]
0
python
else: # If this is not the last chunk, add the "response" field value to full_response and print it if not chunk.get("done"): response_piece = chunk.get("response", "") full_response += response_piece ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n response = requests.head(url)\r\n if response.status_code != 404:\r\n return # Blob already exists, no need to upload\r\n response.raise_for_status()\r\n```", "severity": "minor", "line": 26 } ]
1
python
return False return start + offset_time <= dt_util.now(start.tzinfo) class CalendarEntityDescription(EntityDescription, frozen_or_thawed=True): """A class that describes calendar entities.""" class CalendarEntity(Entity): """Base class for calendar event entities.""" entity_description: CalendarEnt...
Review this code and list any quality issues.
[ { "issue": "Lets set an `_attr_color` that entities can set directly.\r\n\r\n(This could also be used by tests)", "severity": "minor", "line": 26 } ]
1
python
from typing import TYPE_CHECKING from typing_extensions import override import numpy as np from numpy.typing import NDArray import torch import genesis as gs from genesis.engine.entities.rigid_entity.rigid_entity import RigidEntity from .aabb import AABB from .ray import Plane, Ray, RayHit from .vec3 import Pose, Qu...
Review this code and list any quality issues.
[ { "issue": "Could you delay torch import inside the function using it? Because it will initialise CUDA runtime, which depends on environment variables, so the later it is imported the more leeway it gives to the end-user for modifying these environment variables at runtime.", "severity": "minor", "line"...
1
python
How rolls are determined. Default is 'volume'. adjustment : str, optional Method for adjusting lookback prices between rolls. Options are 'mul', 'add', and None. Default is 'mul'. Returns ------- continuous_future : ContinuousFuture The continuous fu...
Review this code and list any quality issues.
[]
0
python
cmd += ["--url", url, "--progress", "False", "--source", "monaihosting"] command_line_tests(cmd) for file in bundle_files: file_path = os.path.join(tempdir, bundle_name, file) self.assertTrue(os.path.exists(file_path)) class TestLoad(unittest.Tes...
Review this code and list any quality issues.
[]
0
python
dataset = self.get(ds_name) if dataset is None: error_msg = f"Dataset '{ds_name}' not found in the catalog" # Flag to turn on/off fuzzy-matching which can be time consuming and # slow down plugins like `kedro-viz` if suggest: matches = difflib.get...
Review this code and list any quality issues.
[ { "issue": "Can (should?) we add a method to remove a dataset? Either ``pop()`` or ``del`` (I saw elsewhere you did not ant to maintain all dict like methods, but I think this may be useful). I think it could be useful when one copy a catalog, filter a pipeline and just want to get some datasets associated to t...
1
python
# Python 3-compatible code, so only try Python 3 grammar. grammars = [] # If we have to parse both, try to parse async as a keyword first if not supports_feature(target_versions, Feature.ASYNC_IDENTIFIERS): # Python 3.7+ grammars.append( pygram.python_grammar_no_print_statement_n...
Review this code and list any quality issues.
[ { "issue": "What is the motivation behind this change?", "severity": "minor", "line": 26 } ]
1
python
type=parse_date, help="Only export chats created on or after this date. Format: YYYY-MM-DD", ) parser.add_argument( "--to-date", type=parse_date, help="Only export chats created on or before this date. Format: YYYY-MM-DD", ) parser.add_argument( "--user-id", ...
Review this code and list any quality issues.
[ { "issue": "Could we use `action=\"store_true\"` for these filters? Would just keep it consistent with other boolean args for this and other scripts", "severity": "minor", "line": 26 } ]
1
python
import re import urllib.parse from .common import InfoExtractor from ..utils import ( determine_ext, extract_attributes, int_or_none, parse_duration, traverse_obj, try_get, url_or_none, ) class TV5MondePlusIE(InfoExtractor): IE_NAME = 'TV5MONDE' IE_DESC = 'TV5MONDE' _VALID_URL...
Review this code and list any quality issues.
[ { "issue": "if they're the same, `IE_NAME` alone should suffice\r\n```suggestion\r\n```", "severity": "minor", "line": 18 } ]
1
python
def _real_extract(self, url): display_id = self._match_id(url) query = { 'embedded': 'false', 'mcV6': 'true' } headers = {} if self._get_cookies(self._TOKEN_URL).get('ams'): token = self._download_json( self._TOKEN_URL, displa...
Review this code and list any quality issues.
[ { "issue": "We don't want to throw an additional warning if the token couldn't even be fetched.\r\nI would also not print the age rating, as for unverified accounts it is `None`.\r\n```suggestion\r\n if decoded_token.get('age_rating') != 18:\r\n self.report_warning('Account is ...
1
python
c1 = self.get_delta_from_queue().new_element.arrow_vega_lite_chart id1 = c1.id # Second render with different data but same key and selection mode df2 = pd.DataFrame({"a": [10, 20, 30], "b": [40, 50, 60]}) st.vega_lite_chart( df2, spec, ...
Review this code and list any quality issues.
[ { "issue": "The parameterized test only includes one test case, which makes the parameterization unnecessary. Consider either removing the parameterization decorator and directly implementing the test with the single case, or adding more meaningful test cases that exercise different selection mode changes (e.g....
1
python
'duration': 58.5585, } }, { 'url': 'https://gettr.com/post/p4iahp', 'info_dict': { 'id': 'p4iahp', 'title': 'md5:b03c07883db6fbc1aab88877a6c3b149', 'description': 'md5:741b7419d991c403196ed2ea7749a39d', 'ext': 'mp4', 'uploader': 'Ne...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n user_data = try_get(api_data, lambda x: x['result']['aux']['uinf'][post_data['uid']]) or {}\r\n```\r\nno point using `.get` inside `try_get`", "severity": "minor", "line": 26 } ]
1
python
train_loader = pl.DataLoader(train_dataset, 64) valid_dataset = nni.trace(MNIST)('data/mnist', download=True, train=False, transform=transform) valid_loader = pl.DataLoader(valid_dataset, 64) return pl.Classification( train_dataloader=train_loader, val_dataloaders=valid_loader, limit_train_b...
Review this code and list any quality issues.
[ { "issue": "Please put this in algo test. I'd like to keep `test_experiment` as minimal as possible.", "severity": "minor", "line": 26 } ]
1
python
from __future__ import annotations import asyncio import inspect import logging from loguru import logger from crawlee.crawlers import HttpCrawler, HttpCrawlingContext # Configure loguru interceptor to capture standard logging output class InterceptHandler(logging.Handler): def emit(self, record: logging.LogRe...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n```\r\n\r\nDo we need the __future__ annotations for an doc code example?", "severity": "minor", "line": 2 } ]
1
python
) ) ): group_index = self.group_index enabled_tensors = [ posixpath.join( group_index, (x if isinstance(x, str) else "/".join(x)) ) for x in item ] ...
Review this code and list any quality issues.
[]
0
python
def begin(self) -> None: self.method_args = [self.function(self.mobject.get_center())] super().begin() class FadeToColor(ApplyMethod): """Animation that changes color of an mobject. Examples -------- .. manim:: FadeToColorExample class FadeToColorExample(Scene): ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n \"\"\"Animation that scales a mobject by a certain factor.\r\n```", "severity": "minor", "line": 26 } ]
1
python
if ( requests[0].header.exec_endpoint not in self._executor.requests and __default_endpoint__ not in self._executor.requests ): self.logger.debug( f'skip executor: mismatch request, exec_endpoint: {requests[0].header.exec_endpoint}, requests: {self._executor.r...
Review this code and list any quality issues.
[ { "issue": "Why do we change the argument naming internally? can't we use `docs_by_executor` everywhere instead of `as_list`?", "severity": "minor", "line": 26 } ]
1
python
csv_dn.write(original_content) def test_write_with_header_pandas(tmp_csv_file): csv_dn = CSVDataNode("foo", Scope.SCENARIO, properties={"path": tmp_csv_file}) _DataManagerFactory._build_manager()._repository._save(csv_dn) df = pd.DataFrame([{"a": 1, "b": 2, "c": 3}, {"a": 4, "b": 5, "c": 6}]) csv_dn....
Review this code and list any quality issues.
[]
0
python
""" punctuation = string.punctuation + hanzi.punctuation punctuation = set([char for char in punctuation]) punctuation.difference_update(set("!@#$%&()<>?|,.\"'")) out = [] for char in text: if char in punctuation: continue else: out.append(char) return ...
Review this code and list any quality issues.
[]
0
python
return get_first( args, [('VISITOR_DATA', ('INNERTUBE_CONTEXT', 'client', 'visitorData'), ('responseContext', 'visitorData'))], expected_type=str) @functools.cached_property def is_authenticated(self): return bool(self._generate_sapisidhash_header()) _PO_TOKEN_CACHE = None ...
Review this code and list any quality issues.
[ { "issue": "Pass data sync id too\r\n\r\nInvestigate whether session index is used", "severity": "minor", "line": 26 } ]
1
python
"0": [{"result": {"delay": 120.0, "done": False}}], } assert_action_trace(expected_trace) @pytest.mark.parametrize("wait_for_stop_scripts_after_shutdown", [True]) async def test_shutdown_after( hass: HomeAssistant, caplog: pytest.LogCaptureFixture ) -> None: """Test stopping scripts at shutdown.""" ...
Review this code and list any quality issues.
[ { "issue": "This change converts valid Python 3 syntax to deprecated Python 2 syntax. In Python 3, multiple exceptions must be caught using parentheses: `except (ExceptionA, ExceptionB):`. The Python 2 syntax `except ExceptionA, ExceptionB:` is not valid in Python 3 and will cause a syntax error. This line shou...
1
python
) -> NodeExecutionStats: log_metadata = LogMetadata( user_id=node_exec.user_id, graph_eid=node_exec.graph_exec_id, graph_id=node_exec.graph_id, node_eid=node_exec.node_exec_id, node_id=node_exec.node_id, block_name="-", ) e...
Review this code and list any quality issues.
[]
0
python
def get_puzzle_and_solution_for_coin( generator: BlockGenerator, coin: Coin, height: int, constants: ConsensusConstants ) -> SpendInfo: try: puzzle, solution = get_puzzle_and_solution_for_coin_rust( generator.program, generator.generator_refs, constants.MAX_BLOCK_COST...
Review this code and list any quality issues.
[]
0
python
if isinstance( f, (models.DateField, models.TimeField, models.ForeignKey) ): row_classes.append("nowrap") row_class = SafeString(' class="%s"' % " ".join(row_classes)) # If list_display_links not defined, add the link tag to the first # fie...
Review this code and list any quality issues.
[]
0
python
def __init__( self, config: ModelConfig, size: Optional[int] = None, low_precision: bool = False, elementwise_affine: Optional[bool] = None, ): super().__init__(config) self.normalized_shape = (size or config.d_model,) self.eps = 1e-05 self.low...
Review this code and list any quality issues.
[ { "issue": "This is redundant since buffers default to no grad.\r\n```suggestion\r\n```", "severity": "minor", "line": 26 } ]
1
python
msg = ( 'Type Exception: %s\n' 'Error Message: %s\n' 'URL requested: %s\n' 'Request method: %s\n' 'Handler class name: %s\n' % ( exception_type, error_message, url, request_method, ...
Review this code and list any quality issues.
[ { "issue": "else raise exception\r\n\r\nOr, do \r\n```\r\n if XYZ:\r\n ...\r\n else:\r\n assert that it's the remaining condition\r\n ...\r\n```\r\n\r\nThen, you properly handle all cases, not just a few.", "severity": "minor", "line": 26 } ]
1
python
destination: The stream into which the dataset contents should be written kwargs: Csv parameters for dumping/writing """ items: list[dict] = [] limit = 1000 offset = 0 while True: list_items = await self._resource_client.list_items(limit=limit, offset=off...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n kwargs: Additional keyword arguments for `json.dump`.\r\n```", "severity": "minor", "line": 26 } ]
1
python
'x-disco-client': 'WEB:UNKNOWN:dplus-india:prod', 'x-disco-params': 'realm=dplusindia', 'origin': 'https://www.discoveryplus.in', 'referer': 'https://www.discoveryplus.in/', } show_url = 'https://ap2-prod-direct.discoveryplus.in/cms/routes/show/{}?include=default'.for...
Review this code and list any quality issues.
[ { "issue": "```suggestion page_num = total_pages = 0\r\n while page_num <= total_pages:\r\n if page_num == 0:\r\n total_pages = try_get(season_json, lambda x: x['meta']['totalPages'], int) or 0\r\n episodes_json = self._download_json(\r\n ...
1
python
NodeExecutionEntry( user_id=DEFAULT_USER_ID, graph_id="test_graph", node_id="test_node", graph_exec_id="test_graph_exec", node_exec_id="test_node_exec", block_id=AITextGeneratorBlock().id, data={ "model": "gpt-4-turbo", ...
Review this code and list any quality issues.
[]
0
python
) from diffusers.utils import logging from ..testing_utils import backend_empty_cache, numpy_cosine_similarity_distance, require_accelerator, torch_device class ModularPipelineTesterMixin: """ It provides a set of common tests for each modular pipeline, including: - test_pipeline_call_signature: chec...
Review this code and list any quality issues.
[ { "issue": "I think it's better to name this \"output_name\" \n since`output_type` is a standard pipeline argumnet", "severity": "minor", "line": 26 } ]
1
python
context = tf.fill([batch_size, 1], start_token) def step(hparams, tokens, past=None): lm_output = model.model(hparams=hparams, X=tokens, past=past, reuse=tf.AUTO_REUSE) logits = lm_output['logits'][:, :, :hparams.n_vocab] presents = lm_output['present'] presents.set_shape(model.pas...
Review this code and list any quality issues.
[ { "issue": "i would remove the `first=True` flag, and change output to just be tf.zeros([batch_size, 0]) or something like that", "severity": "major", "line": 26 } ]
1
python
try: result = func(**kwargs) return result except Exception as err: if print_error: print(err) sleep(sleep_for) raise WaitForException( f"func: {func}, didn't return within specified timeout: {timeout_}" ) def parse_csv(text: str) ->...
Review this code and list any quality issues.
[ { "issue": "Is this used anywhere? Or is this left-over from trying to get the notebook working in the e2e tests?", "severity": "minor", "line": 26 } ]
1
python
return for config in platform_config: if not config.get(KNX_ADDRESS) and ( new_uid_base := config.get(FanSchema.CONF_SWITCH_ADDRESS) ): break else: _LOGGER.info( "No YAML entry found to migrate fan entity '%s' unique_id from '%s'. Removing entry", ...
Review this code and list any quality issues.
[ { "issue": "`EntityRegistry.async_update_entity(..., new_unique_id=...)` will raise `ValueError` if `new_uid` is already in use by another KNX fan entity. Right now that exception would bubble up and can abort platform setup. Consider checking `ent_reg.async_get_entity_id(Platform.FAN, DOMAIN, new_uid)` first (...
1
python
except PydanticSerializationError as e: raise TypeError(f'Unsupported type for XML formatting: {e}') from e self._mapping_to_xml(element, mapping, path) return element if isinstance(value, Iterable): for n, item in enumerate(value): # pyright: ignore[reportUn...
Review this code and list any quality issues.
[ { "issue": "had to reformat a bit to reduce complexity, [C901](https://docs.astral.sh/ruff/rules/complex-structure/)", "severity": "major", "line": 26 } ]
1
python
"embedding_tensor": embedding_tensor, "embedding": True if embedding is not None else False, "return_tensors": return_tensors, "return_view": return_view, }, ) exec_option = exec_option or self.exec_option utils.parse_search_args( ...
Review this code and list any quality issues.
[ { "issue": "@adolkhan Why is this necessary if we just return None? `TQL` query and `get_embedding` are fundamentally contradictory?", "severity": "minor", "line": 26 } ]
1