language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
"dataset": self.dataset, "cols_to_retain": self.cols_to_retain, "collate_fn": self.collate_fn, "collate_fn_args": self.collate_fn_args, "columns_to_np_types": self.columns_to_np_types, "columns_to_ranks": self.columns_to_ranks, "string_columns": se...
Review this code and list any quality issues.
[ { "issue": "This is probably cleaner than the whole UUID, I agree", "severity": "minor", "line": 26 } ]
1
python
args: tuple[str, ...] """The command-line arguments as passed to :func:`pytest.main`.""" plugins: Sequence[str | _PluggyPlugin] | None """Extra plugins, might be `None`.""" dir: pathlib.Path """The directory from which :func:`pytest.main` was invoked. :type: pathlib.Path""" ...
Review this code and list any quality issues.
[]
0
python
assert row_result_df.shape[0] == len(input_data) out_column = f"outputs.answer.{column}" metric = f"answer.{column}" assert out_column in row_result_df.columns.to_list() assert metric in metrics.keys() assert metrics.get(metric) == np.nanmean(row_result_df[out_column]) a...
Review this code and list any quality issues.
[]
0
python
def construct(self): dotL = Dot(color=DARK_GREY) dotL.shift(2 * RIGHT) dotR = Dot(color=WHITE) dotR.shift(2 * LEFT) dotMiddle = VMobject().interpolate(dotL, dotR, alpha=0.3) self.add(dotL, dotR, dot...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n def become(self, mobject: \"Mobject\", copy_submobjects: bool=True):\r\n```", "severity": "minor", "line": 26 } ]
1
python
:return: the response of this request (self) as an instance of Response """ return Response(request=self.proto) @property def status(self): """ Returns the status from the header field :return: the status object of this request """ return self.proto_wo_d...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n Adds Executor the the request routes\r\n```", "severity": "minor", "line": 26 } ]
1
python
if is_torch_available(): import torch import torch.nn as nn import triton import triton.language as tl from torch.nn import functional as F logger = logging.get_logger(__name__) # Global for the CUTLASS quantization kernel (lazily loaded) _quantization_kernel = None def _get_quantization_kernel...
Review this code and list any quality issues.
[ { "issue": "if the kernel is not compatible, it will raise an error ?", "severity": "minor", "line": 26 } ]
1
python
# ____ _ # | _ \ ___ | | __ _ _ __ ___ # | |_) / _ \| |/ _` | '__/ __| # | __/ (_) | | (_| | | \__ \ # |_| \___/|_|\__,_|_| |___/ # """ Polars: Blazingly fast DataFrames in Python ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Polars is a fast, open-source library for data manipulation with an expressive, ...
Review this code and list any quality issues.
[ { "issue": "This should be `====`, not tildes.", "severity": "minor", "line": 10 } ]
1
python
z_normal The direction of the normal. num_axis_pieces The number of pieces used to construct the axes. light_source The direction of the light source. depth Currently non-functional. gloss Currently non-functional. kwargs : Any Additional arguments to ...
Review this code and list any quality issues.
[ { "issue": "Same as above\r\n```suggestion\r\n light_source: Sequence[float] = 9 * DOWN\r\n```", "severity": "minor", "line": 26 } ]
1
python
import re import base64 import json import urllib from .common import InfoExtractor from .adobepass import AdobePassIE from .once import OnceIE from ..utils import ( determine_ext, dict_get, int_or_none, unified_strdate, unified_timestamp, ) class ESPNIE(OnceIE): _VALID_URL = r'''(?x) ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\nimport base64\r\nimport json\r\nimport re\r\nimport urllib\r\n```", "severity": "minor", "line": 4 } ]
1
python
'thumbnail': 'https://www.ndr.de/fernsehen/screenshot983938_v-contentxl.jpg', 'description': 'md5:700f6de264010585012a72f97b0ac0c9', 'series': 'extra 3', 'channel': 'NDR Fernsehen', 'upload_date': '20201111', 'duration': 1749, } }, { 'url':...
Review this code and list any quality issues.
[ { "issue": "this code is duplicate from the BaseIE\r\nyou can use `_extract_embed` instead like what the extractor was already doing", "severity": "major", "line": 26 } ]
1
python
class LogFilter(logging.Filter): def __init__(self, param=None): self.param = param @staticmethod def match_msg(filter_str, msg): match = False try: if re.match(filter_str, msg): match = True except Exception: pass return match...
Review this code and list any quality issues.
[ { "issue": "@zhupr You can add a parameter like `return_orig_handler_level=False` to control the return value to reuse this function in `set_global_logger_level_contextmanager`.", "severity": "minor", "line": 26 } ]
1
python
if key not in base_config: # if it is not in the default key, then replace it. # ADD if not drop if ec[key] != S_DROP: base_config[key] = ec[key] else: if isinstance(base_config[key], dict) and isinstance(ec[key], dict): ...
Review this code and list any quality issues.
[ { "issue": "https://github.com/microsoft/qlib/blob/main/qlib/data/data.py#L543", "severity": "minor", "line": 26 } ]
1
python
old_path="/hello-world", site=self.example_site, redirect_link="https://www.example.com/hello-world/", ) Redirect.objects.create( old_path="/good-work", site=self.example_site, redirect_link="https://www.example.com/hello-world/", ...
Review this code and list any quality issues.
[ { "issue": "Normally we avoid too much abstraction in unit tests early, I would recommend putting this code (copy/paste) into the individual tests.\r\n\r\nIt feels a bit odd but often in unit tests a bit of duplication can help make the tests easier to understand.\r\n\r\nWhen it gets excessive (e.g. maybe 5+ co...
1
python
'md5': None } }] def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) return next(ZypeIE.extract_from_webpage(self._downloader, url, webpage)) class OfTVPlaylistIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?of....
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n remaining_videos = self._search_json(\r\n r'var\\s*remaining_videos\\s*=', webpage, 'oftv playlists',\r\n playlist_id, contains_pattern=r'\\[.+\\]')\r\n```\r\nshould work, no?", "severity": "minor", "line": 26 } ]
1
python
self.clearml_task = Task.current_task() else: self.clearml_task = Task.init( project_name=project_name, task_name=task_name, output_uri=output_uri, tags=tags, reuse_last_task_id=reuse_last_task_id, contin...
Review this code and list any quality issues.
[ { "issue": "Hi @skinan ,\r\n I think this default value `True` doesn't match the type hint `str`. Is this default value correct? Same comments on `ClearMLImageHandler` class.\r\n\r\nThanks,\r\nBin", "severity": "minor", "line": 26 } ]
1
python
:class:`~.VGroup` A pair of axes. """ return self.axes def get_axis_labels( self, x_label: float | str | Mobject = "x", y_label: float | str | Mobject = "y", ) -> VGroup: """Defines labels for the x_axis and y_axis of the graph. For increased...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n A :class:`~.VGroup` of the labels for the x_axis and y_axis.\r\n```", "severity": "minor", "line": 26 } ]
1
python
raise AttributeError( "Operation not allowed. Please use KedroDataCatalog.add() instead." ) @property def config_resolver(self) -> CatalogConfigResolver: return self._config_resolver def __repr__(self) -> str: return repr(self._datasets) def __contains__(self, data...
Review this code and list any quality issues.
[ { "issue": "Can't we get rid of the `noqa` by using `list` instead of `List` ?", "severity": "minor", "line": 26 } ]
1
python
) as run: yield run @contextmanager def override( self, *, deps: AgentDepsT | _utils.Unset = _utils.UNSET, model: models.Model | models.KnownModelName | str | _utils.Unset = _utils.UNSET, toolsets: Sequence[AbstractToolset[AgentDepsT]] | _utils.Unset = _utils...
Review this code and list any quality issues.
[ { "issue": "not sure if we want to prevent overriding instructions within a workflow? i definitely want to be able to do that since the whole point is we can use an LLM to optimize the system prompt, we're just using override as a way to propagate those instructions.\n\ni'm guessing this is just being defensive...
1
python
# which is a pain. # # so this is a simplifying assumption. return next(iter(vw.filemeta.keys())) def extract_file_export_names(vw: vivisect.VivWorkspace, **kwargs) -> Iterator[Tuple[Feature, Address]]: for va, _, name, _ in vw.getExports(): yield Export(name), AbsoluteVirtualAddress(va) ...
Review this code and list any quality issues.
[ { "issue": "turn this into a util function, since it's repeated a few times?", "severity": "minor", "line": 26 } ]
1
python
} }, { 'url': 'https://www.eltrecetv.com.ar/argentina-tierra-de-amor-y-venganza/capitulos/temporada-2023/atav-2-capitulo-121-del-250923/', 'only_matching': True, }, { 'url': 'https://www.eltrecetv.com.ar/ahora-caigo/capitulos/temporada-2023/programa-de...
Review this code and list any quality issues.
[ { "issue": "Avoid chaining `.get()`s\r\nUse `traverse_obj()` for non-fatal traversal.\r\nBut here it should be fatal if these keys don't exist:\r\n```suggestion\r\n config = self._search_json(\r\n r'Fusion\\.globalContent\\s*=', webpage, 'content', slug)['promo_items']['basic']['embed']['confi...
1
python
({"client_id": "foo"}, "/o/token/", "my_token"), ({}, "/api/gateway/v1/tokens/", "my_personal_token"), ], ) def test_get_oauth2_token_from_gateway(mocker, response, kwargs, url, token): post = mocker.patch("requests.Session.post", return_value=response) base = Base() ret = base.get_oauth2_token(...
Review this code and list any quality issues.
[ { "issue": "Could you rename the generics `kwargs` into something like `auth_creds` to represent what it is?", "severity": "critical", "line": 26 } ]
1
python
NextMediaIE, NextMediaActionNewsIE, AppleDailyIE, NextTVIE, ) from .nexx import ( NexxIE, NexxEmbedIE, ) from .nfb import NFBIE from .nfhsnetwork import NFHSNetworkIE from .nfl import ( NFLIE, NFLArticleIE, NFLPlusEpisodeIE, NFLPlusReplayIE, ) from .nhk import ( NhkVodIE, Nhk...
Review this code and list any quality issues.
[]
0
python
if allocated_blocks: logger.debug(f"Found prefix match for request {request_id} with {len(allocated_blocks)} blocks") cm = self.group_cache_managers[0] cm.block_table[request_id] = allocated_blocks prefix_length = len(allocated_blocks) * self.block_size self._total_p...
Review this code and list any quality issues.
[ { "issue": "very interesting, I would assume we want to delay requests that are getting forked to the next batch to do this async (I might be wrong).", "severity": "critical", "line": 26 } ]
1
python
) -> None: """Test set auto off service failed.""" await init_integration(hass, USERNAME, TOKEN) assert mock_bridge device = DUMMY_HEATER_DEVICE entity_id = f"{SWITCH_DOMAIN}.{slugify(device.name)}" with patch( "homeassistant.components.switcher_kis.entity.SwitcherApi.set_auto_shutdown...
Review this code and list any quality issues.
[ { "issue": "This does not need to be in the patched context (reduce 1 ident)", "severity": "minor", "line": 26 } ]
1
python
} # Option descriptions optdescs = { "days_limit": "Maximum age of data to be considered valid (0 = unlimited)." } # Be sure to completely clear any class variables in setup() # or you run the risk of data persisting between scan runs. results = None def setup(self, sfc, userOpts...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n return [\"IP_ADDRESS\", \"USERNAME\"]\r\n```", "severity": "minor", "line": 26 } ]
1
python
def initial_num_blocks(self) -> Optional[int]: """Get the estimated number of blocks from the logical plan after applying execution plan optimizations, but prior to fully executing the dataset.""" return self._logical_plan.dag.estimated_num_outputs() def schema( self, fetch_...
Review this code and list any quality issues.
[ { "issue": "> we fetch the schema if the plan is read-only even if `fetch_if_missing` is False.\n\nIs this still true", "severity": "minor", "line": 26 } ]
1
python
def test_status(): r = DataRequest() r.docs.extend([Document()]) r.add_exception(ValueError('intentional_error')) byte_array = DataRequestProto.SerializeToString(r) deserialized_request = DataRequestProto.FromString(byte_array) assert not deserialized_request.is_decompressed assert deserial...
Review this code and list any quality issues.
[ { "issue": "This should be callig the regular DataRequest contstructor, this is a unit test independent of the Proto optimization we have in serializer", "severity": "minor", "line": 26 } ]
1
python
# metadata keys # class Keys: class General: TYPE = "general.type" ARCHITECTURE = "general.architecture" QUANTIZATION_VERSION = "general.quantization_version" ALIGNMENT = "general.alignment" FILE_TYPE ...
Review this code and list any quality issues.
[ { "issue": "Isn't `general.sampling` a more appropriate prefix than `general.sampler`?\r\n\r\nUsually, we use \"sampler\" to refer to the object that performs the sampling. Here we are referring to the sampling parameters.", "severity": "minor", "line": 26 } ]
1
python
if not is_multiline_string(leaf): # For the purposes of docstring re-indentation, we don't need to do anything # with single-line docstrings. return False if prev_siblings_are( leaf.parent, [None, token.NEWLINE, token.INDENT, syms.simple_stmt] ): return True # Multi...
Review this code and list any quality issues.
[ { "issue": "If there are multiple tabs at the beginning, shouldn't they be replaced by multiple instances of `\"\\t\".expandtabs()`?", "severity": "minor", "line": 26 } ]
1
python
if (attention_mask is not None and not attention_mask.all()) or (past_key_values and seq_length != 1): full_attention_mask = get_masks( self, input_ids, infer_state.cache_manager.past_key_values_length, padding_mask=attention_mask ) # Run encoder. hid...
Review this code and list any quality issues.
[]
0
python
return wrapper async def consume_from_queue_async(queue: Queue): while True: if queue.qsize() == 0: # If the queue is empty, wait for a while and try again. await asyncio.sleep(0.1) continue item = queue.get_nowait() if item is None: break ...
Review this code and list any quality issues.
[ { "issue": "I suspect if this async for could guarantee the output sequence.\r\n\r\nFor example currently in the queue there is two element 1,2\r\nasync for doesn't guarantee the output sequence is exactly 1,2 2,1 is also valid output.", "severity": "minor", "line": 26 } ]
1
python
args["apollo_rank"] = get("train.apollo_rank") args["apollo_update_interval"] = get("train.apollo_update_interval") args["apollo_scale"] = get("train.apollo_scale") args["apollo_target"] = get("train.apollo_target") # badam config if args["use_badam"]: ar...
Review this code and list any quality issues.
[ { "issue": "the gradio element train.swanlab_logdir is not exist, remove it", "severity": "minor", "line": 26 } ]
1
python
def test_cbsc008_wildcard_prop_callbacks(dash_duo): lock = Lock() app = Dash(__name__) app.layout = html.Div( [ dcc.Input(id="input", value="initial value"), html.Div( html.Div( [ 1.5, None, ...
Review this code and list any quality issues.
[]
0
python
def load(self, session: Session) -> None: self.dag_run_active_tasks_map.clear() self.task_concurrency_map.clear() self.task_dagrun_concurrency_map.clear() query = session.execute( select(TI.dag_id, TI.task_id, TI.run_id, func.count("*")) .where(TI.state.in_(EXECUT...
Review this code and list any quality issues.
[ { "issue": "I _think_ this return value is a Subquery, not a Query (honestly the return type annotation is pretty useless anyway due to the lack of SQLAlchemy support)", "severity": "minor", "line": 26 } ]
1
python
| |--[Bar-{'num': '4'} (PENDING)] | └─--[Bar-{'num': '5'} (PENDING)] |--[Bar-{'num': '1'} (PENDING)] └─--[Bar-{'num': '2'} (PENDING)] └─--[Bar-{'num': '6'} (PENDING)] |--[Bar-{'num': '7'} (PENDING)] | |--[Bar-{'num': '9'} (PENDING)] | └─--[Bar-{'...
Review this code and list any quality issues.
[]
0
python
from .common import InfoExtractor from ..utils import try_call class TempoIE(InfoExtractor): _VALID_URL = r'https?://video\.tempo\.co/\w+/\d+/(?P<id>[\w-]+)' _TESTS = [{ 'url': 'https://video.tempo.co/read/30058/anies-baswedan-ajukan-banding-putusan-ptun-batalkan-ump-dki', 'info_dict': { ...
Review this code and list any quality issues.
[ { "issue": "The code for extracting id looks same. Why does this change?", "severity": "major", "line": 10 } ]
1
python
'description': 'md5:f26c1a85d41c1cffd27a0279254a25c3', 'timestamp': 1653408600, 'upload_date': '20220524', 'thumbnail': r're:https://mediusimg\.event\.microsoft\.com/video-\d+/thumbnail\.jpg.*', }, }] def _real_extract(self, url): video_id = self._match_id(ur...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n r'https?://build\\.microsoft\\.com/[\\w-]+/sessions/(?P<id>[\\da-f-]+)',\r\n r'https?://build\\.microsoft\\.com/[\\w-]+/(?P<id>sessions)/?(?:[?#]|$)',\r\n```", "severity": "minor", "line": 26 } ]
1
python
lora_model = PeftModel.from_pretrained(base_submodule, lora_checkpoint_path) processor = AutoProcessor.from_pretrained(lora_checkpoint_path) print("LoRA weights and processor loaded successfully.") # 4. Merge the LoRA weights into the submodule and unload the LoRA modules merged_submodule = lora_model....
Review this code and list any quality issues.
[ { "issue": "Thought there is no difference between merging LoRA and merging OFT?", "severity": "minor", "line": 26 } ]
1
python
showmeans : bool, default: False Whether to show the mean with a line. showextrema : bool, default: True Whether to show extrema with a line. showmedians : bool, default: False Whether to show the median with a line. side : {'both', 'low', 'high'}, default:...
Review this code and list any quality issues.
[ { "issue": "Little unclear here, do you mean that (color, alpha) supercedes but does not set the artist alpha? So for example linecolor still used the artist alpha?", "severity": "minor", "line": 26 } ]
1
python
local_storage.dump_exception(exception=exception, batch_result=batch_result) # system metrics system_metrics = {} if batch_result: system_metrics.update(batch_result.system_metrics.to_dict()) # token related system_metrics.update( ...
Review this code and list any quality issues.
[ { "issue": "It's not expected that there is no portal url get returned, do you have a but item where we can see more detailed logs?", "severity": "minor", "line": 26 } ]
1
python
set_ydata """ if len(args) == 1: (x, y), = args else: x, y = args self.set_xdata(x) self.set_ydata(y) def recache_always(self): self.recache(always=True) def recache(self, always=False): if always or self._invalidx: x...
Review this code and list any quality issues.
[ { "issue": "There's a fair number of uses of column_stack in the codebase which are always converting two 1D arrays into a (n, 2) 2D array (sometimes also relying on broadcasting) that could probably benefit from a similar treatment; perhaps factor this pattern to a helper function and use it throughout?", ...
1
python
except Exception as e: logging.exception("Exception during handling a request") return web.Response(status=500, headers=headers, text=str(e)) def parse_python_variant_header(value: str) -> Tuple[bool, Set[black.TargetVersion]]: if value == "pyi": return True, set() else: versio...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n raise InvalidVariantHeader(\"Python 2 is not supported\")\r\n```\r\nNIT: my bad if it really means something like \"support was removed\", but this sounds off to me.", "severity": "minor", "line": 26 } ]
1
python
}] def _extract_subtitle(self, webpage, video_id): captions = traverse_obj( self._search_json(r'const\s+captionsConfiguration\s*=', webpage, 'captions', video_id, default=None), ('languageList', ..., { 'url': ('src', {url_or_none}), 'tag': ('srclang',...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n return {\r\n 'id': video_id,\r\n 'title': self._og_search_title(webpage),\r\n 'description': self._og_search_description(webpage),\r\n 'formats': self._extract_ism(\r\n self._search_regex(r'StreamUrl\\s*=\\s*\"([^\"]...
1
python
def _fetch_page(self, url, playlist_id, page): page += 1 webpage = self._download_webpage( f'{url}/{page}', playlist_id, note=f'Downloading page: {page}', expected_status=404) # Note: episodes not available will default to the URL https://radiocomercial.pt/podcasts/<season>. ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n return self.playlist_from_matches(\r\n self._entries(url, playlist_id), playlist_id, title, ie=RadioComercialIE)\r\n```", "severity": "minor", "line": 26 } ]
1
python
"""Returns the blog author details for the given user id. This is a pure getter function that does not create missing models. BlogAuthorDetailsModel should be created when a blog post is first created. Args: user_id: str. The user id of the blog author. strict: bool. Whether to raise an ex...
Review this code and list any quality issues.
[ { "issue": "If we have a strict mode, why aren't we using that when choosing to raise an exception?\r\n\r\nCan we update the domain object to have an \"error state\" and return that instead?", "severity": "minor", "line": 26 } ]
1
python
'only_matching': True, }, { 'url': 'https://radioteatris.lsm.lv/lv/embed/?id=176439&show=0&theme=white&size=16x9', 'only_matching': True, }] def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) player_data, med...
Review this code and list any quality issues.
[ { "issue": "Are there any pages with multiple audio tracks?\r\nSince we only need the URL we can also do:\r\n```suggestion\r\n for url in traverse_obj(media_json, ('audio', 0, 'sources', ..., 'file', {url_or_none})):\r\n if url.endswith('.m3u8'):\r\n formats.extend(self._extract...
1
python
Given a `page` list of objects, a nested dictionary of user_capabilities are returned by id, ex. { 4: {'edit': True, 'start': True}, 6: {'edit': False, 'start': False} } Each capability is produced for all items in the page in a single query Examples of prefetch language: prefet...
Review this code and list any quality issues.
[]
0
python
'only_matching': True, }] def _parse_content(self, content, url): video_id = content['dataMediaId'] config = self._download_json( content['dataConfig'], video_id, 'Downloading config JSON') title = config['info']['title'] services = config['services'] caronte...
Review this code and list any quality issues.
[ { "issue": "let's clean this up a bit: use `update_url` and remove `'m3u8_native'` (it's the default)\r\n```suggestion\r\n update_url(stream, query=cdn), video_id, 'mp4', m3u8_id='hls', headers=geo_headers)\r\n```", "severity": "minor", "line": 26 } ]
1
python
pyrender_viewer = scene.visualizer.viewer._pyrender_viewer assert pyrender_viewer.is_active viewer_rgb, *_ = pyrender_viewer.render_offscreen( pyrender_viewer._camera_node, pyrender_viewer._renderer, rgb=True, depth=False, seg=False, normal=False ) # Render from add_camera add_cam_rgb, *_ =...
Review this code and list any quality issues.
[ { "issue": "Why are you doing this? You need to have very strong motivations to add some xfail. Here you are basically saying that your fix does not work on windows.", "severity": "critical", "line": 26 } ]
1
python
'id': cover_id, 'url': cover_url, }) stats_info = aweme_detail.get('statistics', {}) author_info = aweme_detail.get('author', {}) music_info = aweme_detail.get('music', {}) user_url = self._UPLOADER_URL_FORMAT % (traverse_obj(author_info, ...
Review this code and list any quality issues.
[ { "issue": "Isn't `title` still a required field? You could use:\r\n```py\r\n 'title': aweme_detail.get('desc') or self._generic_title(url)\r\n```\r\n\r\nIf appropriate, override the `_generic_title()` method in the extractor. \r\n\r\nWhereas the next line should use `get()`:\r\n```py\r\n ...
1
python
mapper_2 = _BinMapper(n_bins=min(256, n_distinct * 3) + 1) binned_2 = mapper_2.fit_transform(data) assert_allclose(mapper_1.bin_thresholds_[0], mapper_2.bin_thresholds_[0]) assert_array_equal(binned_1, binned_2) @pytest.mark.parametrize("n_bins", [50, None]) def test_binmapper_weighted_vs_repeated_equiva...
Review this code and list any quality issues.
[ { "issue": "I found an occurrence of a test failure when `global_random_seed=63` when running:\r\n\r\n```\r\nSKLEARN_TESTS_GLOBAL_RANDOM_SEED=\"all\" pytest -vl sklearn/ensemble/_hist_gradient_boosting/tests -k test_binmapper_weighted_vs_repeated_equivalence\r\n```\r\n\r\nCan you reproduce?\r\n\r\nHere is the e...
1
python
for page_number in itertools.count(1): query_data['page']['current'] = page_number search_results = self._run_search_query( data=query_data, note='Downloading search results page %d%s' % (page_number, format_field(total_pages, template=' of ~%d') if total_pages an...
Review this code and list any quality issues.
[ { "issue": "DRY\r\n\r\nYou can instead do:\r\n```py\r\nfor attempt in range(2):\r\n search_results = self._download_json(..., errnote=False, ...)\r\n if search_results:\r\n return search_results\r\n if not attempt:\r\n ... = self._get_search_engine_access_credentials()\r\nraise ExtractorE...
1
python
(r'video\.westernreservepublicmedia\.org', 'Western Reserve PBS (WNEO)'), # http://www.WesternReservePublicMedia.org/ (r'video\.ideastream\.org', 'WVIZ/PBS ideastream (WVIZ)'), # http://www.wviz.org/ (r'video\.kcts9\.org', 'KCTS 9 (KCTS)'), # http://kcts9.org/ (r'video\.basinpbs\.org', 'Basin...
Review this code and list any quality issues.
[ { "issue": "If the `%` formatting causes linting errors:\r\n```suggestion\r\n (?:{})/(?:\r\n```\r\nand revert l.195-6.", "severity": "minor", "line": 26 } ]
1
python
class Orientation(InvertibleTransform, LazyTransform): """ Change the input image's orientation into the specified based on `axcodes`. This transform is capable of lazy execution. See the :ref:`Lazy Resampling topic<lazy_resampling>` for more information. """ backend = [TransformBackends.NUMPY...
Review this code and list any quality issues.
[ { "issue": "As we're changing the default value for this argument, we should use [deprecated_arg_default](https://github.com/Project-MONAI/MONAI/blob/def4222152e18a70455aeebcc3142f2b9bae46d8/monai/utils/deprecate_utils.py#L230) to mark this fact and state what the difference is.", "severity": "minor", "...
1
python
callback=validate_scene_range, help="Start rendering from n_0 until n_1. If n_1 is left unspecified, " "renders all scenes after n_0.", default=None, ), option( "-a", "--write_all", is_flag=True, help="Render all scenes in the input file.", default...
Review this code and list any quality issues.
[ { "issue": "Curiously, this line caused the `%%manim` IPython magic command to break on the second execution of the cell. It needs to be wrapped in `list()`, then it works properly. I'll prepare a PR and do a bugfix release.", "severity": "critical", "line": 26 } ]
1
python
level = Lint.WARN def check_features(self, ctx: Context, features: list[Feature]): for feature in features: if isinstance(feature, (Regex,)): assert isinstance(feature.value, str) pat = feature.value.removeprefix("/") pat = pat.removesuffix("/i")...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n # like \"/test.exe/\" which should be \"/test\\.exe/\"\r\n```", "severity": "minor", "line": 26 } ]
1
python
# DEBUG # self._unif_map = {} def _add_to_context(self): if self._program_id is not None: raise ValueError("Shader program already in context") shader_ids = [] # Load vert shader shader_ids.append(gl_shader_utils.compileShader(self._load(self.vertex_shader), GL_...
Review this code and list any quality issues.
[]
0
python
if (x.get('label') is None) or (x.get('label') == 'category'): categories.append(x.get('name')) # A number of sites have a prefix in front of some info keys followed by a '$' symbol. # Search for known keys with the prefix. for key in info.keys(): if re.match('.*...
Review this code and list any quality issues.
[ { "issue": "this should suffice\r\n```suggestion\r\n 'creator': traverse_obj(info, ('author', {str})) or None,\r\n```", "severity": "critical", "line": 26 } ]
1
python
import operator as op import random import sys import types import warnings from functools import reduce from math import ceil from pathlib import Path from typing import ( TYPE_CHECKING, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Type, TypeVar, Union, ) impo...
Review this code and list any quality issues.
[ { "issue": "relative imports\r\n```suggestion\r\nfrom ..animation.animation import override_animation\r\n```", "severity": "minor", "line": 26 } ]
1
python
dsk = { (outname,) + tuple(chunk_out): (_reshape_blockwise, (x.name,) + tuple(chunk_in), shape) for chunk_in, chunk_out, shape in zip( chunk_tuples, out_chunk_tuples, out_shapes ) } graph = HighLevelGraph.from_collections(outname, dsk, dep...
Review this code and list any quality issues.
[ { "issue": "Should we already validate that the reshaped chunks are compatible?", "severity": "minor", "line": 26 } ]
1
python
device_class=SensorDeviceClass.ENUM, enum={ CurrentAirPurifierStateValues.INACTIVE: "inactive", CurrentAirPurifierStateValues.IDLE: "idle", CurrentAirPurifierStateValues.ACTIVE: "purifying", }, translation_key="air_purifier_state_current", ), Character...
Review this code and list any quality issues.
[ { "issue": "Shouldn't the icon be in the json ?", "severity": "minor", "line": 26 } ]
1
python
known_presets = { "Debug": build_root_dir / "debug", "Distribution": build_root_dir / "distribution", "Release": build_root_dir / "release", "Sanitizer": build_root_dir / "sanitizers", "Swift_Release": build_root_dir / "swift", "Windows_CI": build_root_dir / "release", ...
Review this code and list any quality issues.
[ { "issue": "Why do you need this? If it's needed, a comment explaining why should at least accompany it for future reference.", "severity": "minor", "line": 26 } ]
1
python
'vcodec': 'none', 'acodec': 'mp4a.40.2', 'dynamic_range': None, }) self.assertEqual(parse_codecs('mp4a.40.5,avc1.42001e'), { 'vcodec': 'avc1.42001e', 'acodec': 'mp4a.40.5', 'dynamic_range': None, }) self.assertEqual(parse_codecs...
Review this code and list any quality issues.
[]
0
python
def _real_extract(self, url): video_id = self._match_id(url) self._set_cookie('91porn.com', 'language', 'cn_CN') webpage = self._download_webpage( 'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id) if '作为游客,你每天只可观看10个视频' in webpage: raise Extrac...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n description = self._html_search_regex(\r\n r'<span\\s+class=[\"\\']more title[\"\\']>([^<]+)<br', webpage, 'description', fatal=False)\r\n```\r\nYou realize the .strip negates the whole point of fatal=False, right?", "severity": "minor", "line": 26 } ]
1
python
def construct(self): square = Square() circle = Circle() circle.shift(3 * UP) self.play(CyclicReplace(square, circle)) class FadeInAndOutTest(Scene): def construct(self): square = Square(color=BLUE).shift(2 * UP) annotation = Square(color=BLUE) self.add(anno...
Review this code and list any quality issues.
[ { "issue": "Just to be consistent with other tests\r\n```suggestion\r\n self.play(circ.animate.match_points(square))\r\n```", "severity": "minor", "line": 26 } ]
1
python
endpoint = "scaleset" def _expand_scaleset_machine( self, scaleset_id: UUID_EXPANSION, machine_id: UUID_EXPANSION, *, include_auth: bool = False, ) -> Tuple[models.Scaleset, UUID]: scaleset = self.get(scaleset_id, include_auth=include_auth) if scaleset.n...
Review this code and list any quality issues.
[ { "issue": "I think `initial_size` makes a bit more sense because the scaleset has not been created yet, so a past tense parameter is a little confusing. We want to communicate that this is the size we will initialize the scale set to.", "severity": "minor", "line": 26 } ]
1
python
def _extract_playlist(self, host, type, id): info = self.call_api(host, id, '', type, note='Downloading playlist information', fatal=False) playlist_title = info.get('displayName') playlist_description = info.get('description') playlist_timestamp = unified_timestamp(info.get('createdAt'...
Review this code and list any quality issues.
[ { "issue": "you can add this in the class definition\r\n```py\r\n _TYPES = {\r\n 'a': 'accounts',\r\n ...\r\n }\r\n```\r\nand then do\r\n```py\r\n type = self._TYPES[type]\r\n```\r\n\r\nThen u can also use `'|'.join(_TYPES.keys())` in `_VALID_URL`", "severity": "minor", "line":...
1
python
def _on_console(self, msg): self.console.add_message(msg.type, msg.text) def _on_pageerror(self, error): self.console.add_message("js_error", error.stack) self._js_errors.append(error) def check_js_errors(self, *expected_messages): """ Check whether JS errors were repor...
Review this code and list any quality issues.
[ { "issue": "[fix] You're saying we're raising `JsMultipleErrors` but this code was renamed to `JsErrorsDidNotRaise`. So I think this has to be reworded?", "severity": "minor", "line": 26 } ]
1
python
with the same version, would have to be considered equal """ valid_tags = self._supported_tags support_num = len(valid_tags) build_tag: BuildTag = () binary_preference = 0 link = candidate.link if link.is_wheel: # can raise InvalidWheelFilename ...
Review this code and list any quality issues.
[]
0
python
Args: bundle_name: bundle name. version: version name of the target bundle, if None, the latest version will be used. repo: it should be in the form of "repo_owner/repo_name/". tag: the tag name of the release. auth_token: github personal access token. Returns: a dic...
Review this code and list any quality issues.
[ { "issue": "Doesn't this break backwards compatibility by changing the function signature too much? Adding new members to the signature was less of an issue but removing them like this is going to change how the function is called on the command line and appear to users when they ask Fire what it is. The value ...
1
python
async def do(): await wait_started.wait() await asyncio.sleep(0.1) # Let do_fn be either a callable or an awaitable object if inspect.isawaitable(do_fn): await do_fn else: do_fn() await asyncio.gather(wait(), do()) return result def load_capnp_m...
Review this code and list any quality issues.
[]
0
python
# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 # Apache-2.0 License Copyright (c) UChicago Argonne LLC, operator of Argonne National Laboratory. # DeepSpeed Team from deepspeed.runtime.checkpoint_engine.checkpoint_engine import \ CheckpointEngine, CheckpointCommitInfo from datastate...
Review this code and list any quality issues.
[ { "issue": "I am missing how `datastates` dependency is being handled in this PR?", "severity": "minor", "line": 10 } ]
1
python
'title': 'Real Madrid vs. Real Betis (LaLiga)', 'thumbnail': 'https://s.secure.espncdn.com/stitcher/artwork/collections/media/bd1f3d12-0654-47d9-852e-71b85ea695c7/16x9.jpg?timestamp=202201112217&showBadge=true&cb=12&package=ESPN_PLUS', }, 'params': { 'skip_download': True, ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n video_data = self._download_json(\r\n f'https://watch-cdn.product.api.espn.com/api/product/v3/watchespn/web/playback/event?id={video_id}',\r\n video_id)['playbackState']\r\n```", "severity": "minor", "line": 26 } ]
1
python
def test_init_loggers_file_config(): """Test that init_loggers works with file configuration.""" with tempfile.TemporaryDirectory() as temp_dir: config = get_default_graphrag_config(root_dir=temp_dir) # call init_loggers with file config init_loggers(config=config) logger = log...
Review this code and list any quality issues.
[]
0
python
'duration': 1769.0, 'release_date': '20230717', 'series': 'Abendrot', 'series_id': 'SR1_AB_P', 'thumbnail': r're:https?://.+\.jpg', }, }] def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, vi...
Review this code and list any quality issues.
[ { "issue": "make `cls_common` a class constant", "severity": "minor", "line": 26 } ]
1
python
print("Adding embeddings to vector store") self.vector_store.add( embeddings=embeddings, ids=[t.doc_id for t in input_], ) if self.doc_store: print("Adding documents to doc store") self.doc_store.add(input_) # save the chunks content into m...
Review this code and list any quality issues.
[ { "issue": "The image_origin is a base64 string. You can try adding the base64 image in markdown file like [this](https://stackoverflow.com/questions/50817518/hard-code-markdown-images).\r\n\r\nAfter that, you can try with Markdown preview tool like https://markdownlivepreview.com/\r\n\r\nIf the Markdown couldn...
1
python
device = xm.xla_device(device) super().__init__(device) self.debug = debug self.tpu_local_core_rank = 0 self.tpu_global_core_rank = 0 @property def is_distributed(self) -> bool: return False @parameter_validation def model_to_device(self) -> None: self....
Review this code and list any quality issues.
[ { "issue": "Do we not want to rely on the training type API?", "severity": "minor", "line": 26 } ]
1
python
}, 'skip': 'Video no longer in page', }, { # single video in __INITIAL_DATA__ (was: playlist.sxml URL in playlist param) 'url': 'http://www.bbc.com/sport/0/football/33653409', 'info_dict': { 'id': 'p02xycnp', 'ext': 'mp4', 'title': 'Ronaldo to Man ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n # Testing noplaylist\r\n```", "severity": "minor", "line": 26 } ]
1
python
'info_dict': { 'id': '4759', 'title': '아이키의 떰즈업', }, 'playlist_mincount': 101, }, { 'url': 'https://now.naver.com/s/now.4759?shareHightlight=26601461#highlight=', 'info_dict': { 'id': '4759', 'title': '아이키의 떰즈업', }, 'pla...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n page_size = 15\r\n```\r\nI can see it is being set to a constant...", "severity": "minor", "line": 26 } ]
1
python
self.connection_data = connection_data self.kwargs = kwargs self.connection = None self.is_connected = False def connect(self) -> StatusResponse: """ Set up the connection required by the handler. Returns: HandlerStatusResponse """ if se...
Review this code and list any quality issues.
[ { "issue": "Can we please update this too? Also there are 2 more places we need to update in this class", "severity": "minor", "line": 26 } ]
1
python
tx.nLockTime = node.getblockcount() + 1 self.check_mempool_result( result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'non-final'}], rawtxs=[tx.serialize().hex()], ) self.log.info('A transaction that is locked by BIP68 sequence logic') tx =...
Review this code and list any quality issues.
[ { "issue": "nit\r\n```suggestion\r\n data_len = int(MAX_STANDARD_TX_WEIGHT / WITNESS_SCALE_FACTOR) - tx.get_vsize() - 5 - 4 # -5 for PUSHDATA4 and -4 for script size\r\n```", "severity": "minor", "line": 26 } ]
1
python
{ 'url': 'https://html.com/media/', 'info_dict': { 'title': 'HTML5 Media', 'description': 'md5:933b2d02ceffe7a7a0f3c8326d91cc2a', }, 'playlist_count': 2 } ] def _extract_from_webpage(self, url, webpage): video_id, t...
Review this code and list any quality issues.
[ { "issue": "maybe just \r\n```suggestion\r\nclass QuotedHTMLIE(InfoExtractor):\r\n```", "severity": "major", "line": 26 } ]
1
python
if handle.get_array() is not None: continue except AttributeError: pass for getter_name in getter_names: try: color = getattr(handle, getter_name)() if isinstance(color, np.nda...
Review this code and list any quality issues.
[ { "issue": "AFAICT, the `AttributeError` is only about the `getattr`, so this `try` block is starting to get very much too long. Can we adjust that a bit so that only that line is in the `try`? This also reduces the wrapping a bit.", "severity": "major", "line": 26 } ]
1
python
if format_id == 'hls': hls_formats = self._extract_m3u8_formats( format_url, video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls', fatal=False) self._check_formats(hls_formats, video_id) formats.extend(hls_formats) ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n _VALID_URL = r'https?://(?P<domain>(?:[^/?#]+\\.)?xvideos2?\\.com)/(?:profiles/|amateur-channels/)?[^#]+#quickies/a/(?P<id>\\w+)'\r\n```", "severity": "minor", "line": 26 } ]
1
python
# single season 'url': 'https://netverse.id/webseries/kelas-internasional', 'info_dict': { 'id': 'kelas-internasional', 'title': 'Kelas Internasional', }, 'playlist_count': 203, }] def parse_single_season_playlist(self, page_num, url=None, slug=None, cust...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n slug=slug_sample, custom_id=playlist_id, season=season, endpoint='season')\r\n```", "severity": "minor", "line": 26 } ]
1
python
'This video is DRM protected.', expected=True) if stream_meta.get('is_premium'): sources = self._download_json( 'https://www.vidio.com/interactions_stream.json?video_id=%s&type=livestreamings' % video_id, display_id, note='Downloading premier API JSON') if...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n if stream_meta.get('stream_token_url'):\r\n token_json = self._download_json(\r\n 'https://www.vidio.com/live/%s/tokens' % video_id,\r\n display_id, note='Downloading HLS token JSON', data=b'')\r\n forma...
1
python
'playlist_count': 16, }] def _real_extract(self, url): profile_id = self._match_id(url) entries = [] for page_num in itertools.count(1): profile_data = self._download_json(f'https://yappy.media/api/video/list/{profile_id}?page={page_num}', ...
Review this code and list any quality issues.
[ { "issue": "It's better to use a generator for this.\r\nYou can use `traverse_obj` to safely traverse the JSON object and filter for dicts with a `uuid` key\r\n```suggestion\r\n def entries(profile_id):\r\n for page_num in itertools.count(1):\r\n videos = traverse_obj(self._down...
1
python
assert a.first("no", "k", "nope") is None a.k = 1 assert a.k == 1 assert a["k"] == 1 assert a.first("no", "k", "nope") == 1 a["k"] = 2 assert a.k == 2 assert a["k"] == 2 a.set_read_only(["k"], "boo") with pytest.raises(AttributeError) as err: a.k = 3 assert err.valu...
Review this code and list any quality issues.
[]
0
python
logger.debug(f"Finished processing shard number {rank} of {num_shards}.") transformed_shards[rank] = content else: pbar.update(content) # Avoids PermissionError on Windows (the error: https://github.com/huggingfa...
Review this code and list any quality issues.
[]
0
python
When ``point`` and the control points have different shapes. """ if not all(np.shape(point) == np.shape(c_p) for c_p in control_points): raise ValueError( f"Point {point} and Control Points {control_points} have different shapes." ) control_points = np.array(control_points) n...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n negative *= -1\r\n```\r\n(or `sign *= -1` if it's renamed to that)", "severity": "minor", "line": 26 } ]
1
python
| Type 1 (PDF with usetex) | Type 3 (PDF/PS) | TrueType (PDF) | +==========================+============================+============================+ | One of the oldest types, | Similar to Type 1 in | Newer than previous types, | | introduced by Adobe | terms of introduction ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n Matplotlib uses Type 1 fonts for compatibility with TeX; when the usetex\r\n feature is used with the PDF backend, Matplotlib reads the fonts used by\r\n the TeX engine, which are usually Type 1.\r\n```", "severity": "minor", "line": 26 } ]
1
python
def _generate_tables() -> "pa.Table": """Inner generator that yields tables without renaming.""" try: for batch in fragment.to_batches( columns=data_columns, filter=filter_expr, schema=schema, use_threads=use_threads, ...
Review this code and list any quality issues.
[ { "issue": "@bveeramani Yes. I adjusted _read_batches_from to first add the partition column, then add the path column, making it consistent with the schema.", "severity": "major", "line": 26 } ]
1
python
_LOGGER = logging.getLogger(__name__) PARALLEL_UPDATES = 0 async def async_setup_entry( hass: HomeAssistant, config_entry: CookidooConfigEntry, async_add_entities: AddConfigEntryEntitiesCallback, ) -> None: """Set up the calendar platform for entity.""" coordinator = config_entry.runtime_data ...
Review this code and list any quality issues.
[ { "issue": "if we expect more calendar entities, we can keep the meal_plan suffix, otherwise, unique ids are unique per platform per integration", "severity": "minor", "line": 26 } ]
1
python
# Copyright (c) MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
Review this code and list any quality issues.
[]
0
python
) as mock_get_kind: mock_get_kind.return_value = mock_kind assert ws_local_cache.get_kind() == mock_kind def test_valid_cache(self): mock_sub, mock_rg, mock_ws = str(uuid.uuid4()), str(uuid.uuid4()), str(uuid.uuid4()) # manually create a valid local cache mock_kind =...
Review this code and list any quality issues.
[ { "issue": "change the word mock to something else...\r\nIn these tests.", "severity": "minor", "line": 26 } ]
1
python
'webpage_url': webpage_url, } class NiconicoPlaylistBaseIE(InfoExtractor): _PAGE_SIZE = 100 _API_HEADERS = { 'X-Frontend-ID': '6', 'X-Frontend-Version': '0', 'X-Niconico-Language': 'en-us' } def _call_api(self, list_id, resource, query): "Implement this in chi...
Review this code and list any quality issues.
[ { "issue": "why not just do\r\n```suggestion\r\n def _parse_owner(item):\r\n return {\r\n 'uploader': traverse_obj(item, ('owner', 'name')),\r\n 'uploader_id': traverse_obj(item, ('owner', 'id')),\r\n }\r\n```\r\nreturning `None` when value is unknown is fine", "severi...
1
python
}, get_all=False), 'id': f'{video_id}{format_field(part_id, None, "_p%d")}', '_old_archive_ids': [make_archive_id(self, old_video_id)] if old_video_id else None, 'title': title, 'http_headers': headers, } is_interactive = traverse_obj(video_data, ('rights...
Review this code and list any quality issues.
[ { "issue": "It seems that even for those with flv format, a single-file mp4 format is still available.\r\n```suggestion\r\n if traverse_obj(formats, lambda _, v: v['fragments']):\r\n # choose best quality for multi_video\r\n formats = traverse_obj(formats, la...
1
python
with pytest.raises(AirflowException) as e: getattr(auth_manager, function)(method="GET", user=user) assert "Unexpected error" in str(e.value) @pytest.mark.parametrize( "function", [ "is_authorized_configuration", "is_authorized_connection", "...
Review this code and list any quality issues.
[]
0
python
def object_upload_file(self, Filename, ExtraArgs=None, Callback=None, Config=None): """Upload a file to an S3 object. Usage:: import boto3 s3 = boto3.resource('s3') s3.Object('mybucket', 'hello.txt').upload_file('/tmp/hello.txt') Similar behavior as S3Transf...
Review this code and list any quality issues.
[]
0
python
json_api_data = self._download_json( f'https://www.mlb.com/data-service/en/videos/{video_slug}', display_id) formats, subtitles = [], {} for playback_url in traverse_obj(json_api_data, ('playbacks', ..., 'url')) or []: if determine_ext(playback_url) == 'm3u8': fm...
Review this code and list any quality issues.
[ { "issue": "Why is this not just being passed through to `MLBVideoIE` with a url_result?", "severity": "minor", "line": 26 } ]
1