language
string
code-snippit
string
instruction
string
flaws
list
flaw_count
int64
python
import asyncio from crawlee._types import BasicCrawlingContext from crawlee.crawlers import BeautifulSoupCrawler async def main() -> None: crawler = BeautifulSoupCrawler( # Keep the crawler alive even when there are no requests to be processed at the moment. keep_alive=True, ) def stop_c...
Review this code and list any quality issues.
[]
0
python
import json from .common import InfoExtractor from ..utils import js_to_json, try_get, urljoin class DaystarClipIE(InfoExtractor): IE_NAME = 'daystar:clip' _VALID_URL = r'https?:\/\/player\.daystar\.tv\/(?P<id>\w+)($|\W)' _DOMAIN = 'https://www.lightcast.com/embed/' _TEST = { 'url': 'https://...
Review this code and list any quality issues.
[ { "issue": "wrong extension mate.\r\nLooks like u will have to manually set it to mp4", "severity": "critical", "line": 15 } ]
1
python
logger.error("Supported models:") ModelBase.print_registered_models() sys.exit(0) if args.verbose: logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=logging.INFO) if args.remote: hf_repo_id = args.model from huggingface_hub import snap...
Review this code and list any quality issues.
[ { "issue": "Could we maybe have a list of predefined mapping `model --> n_ctx` instead?\r\n\r\nHaving this as a required param is quite confusing tbh. Ideally it should be inside `params.json`, otherwise we should make it such that users are not required to enter it manually.", "severity": "minor", "lin...
1
python
websession = async_get_clientsession(hass) options = ConnectionOptions(host, data.get(CONF_USERNAME), data.get(CONF_PASSWORD)) return await NettigoAirMonitor.create(websession, options) class NAMFlowHandler(ConfigFlow, domain=DOMAIN): """Config flow for Nettigo Air Monitor.""" VERSION = 1 host:...
Review this code and list any quality issues.
[ { "issue": "`except ApiError, ClientConnectorError, TimeoutError:` is invalid Python 3 syntax and will not parse. Use `except (ApiError, ClientConnectorError, TimeoutError):` (same pattern repeats multiple times in this file).", "severity": "minor", "line": 26 } ]
1
python
note='Fetching channel base info', errnote='Unable to fetch channel base info', )['data']['fanclub_site'] def _get_channel_user_info(self, fanclub_site_id): return self._call_api( f'fanclub_sites/{fanclub_site_id}/user_info', item_id=f'fanclub_sites/{fanclub_site_id}', note=...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n```\r\nNone values is not needed in test defenition", "severity": "minor", "line": 26 } ]
1
python
""" Shared helpers for Human-In-The-Loop (HITL) review functionality. Used by both the dedicated HumanInTheLoopBlock and blocks that require human review. """ import logging from typing import Any, NamedTuple, Optional from prisma.enums import ReviewStatus from backend.data.execution import ExecutionContext, Executi...
Review this code and list any quality issues.
[ { "issue": "nit: i'd prefer a base model from pydantic over named tuple here", "severity": "minor", "line": 19 } ]
1
python
num_generations = config.training.grpo.num_generations if num_generations is not None and global_batch_size % num_generations != 0: logger.warning( f"For {config.training.trainer_type}, " f"global batch size ({global_batch_size}) should be evenly divisible " ...
Review this code and list any quality issues.
[ { "issue": "nit: replace `{TrainerType.TRL_GRPO, TrainerType.VERL_GRPO}` with `(...)` or `[...]`", "severity": "minor", "line": 26 } ]
1
python
logger.warning("Failed to load plugin %s.", name, exc_info=True) num_available_plugins = len(loadable_plugins.keys()) if num_available_plugins == 0: raise ValueError( f"No IOProcessor plugins installed but one is required ({model_plugin})." ) if model_plugin not in loadable_plu...
Review this code and list any quality issues.
[ { "issue": "```suggestion\n activated_plugin_typ = resolve_obj_by_qualname(activated_plugin_cls)\n\n # for backward compatibility, the plugin does not have a renderer argument\n if \"renderer\" not in inspect.signature(activated_plugin_typ.__init__).parameters:\n logger.warning(\n \"T...
1
python
'format_note': format_note, }) formats.extend(m3u8_formats) continue format = { 'format_id': format_id, 'language_preference': lang_pref, 'format_note': format_note, 'width': int_or_none(f.ge...
Review this code and list any quality issues.
[ { "issue": "The `5-i` is asking for mistakes if the list expands\r\n```suggestion\r\n lang_pref = int(''.join('01'[x] for x in (\r\n m.group('vlang') == lc,\r\n bool(m.group('vo')),\r\n m.group('stlang') == lc,\r\n not m....
1
python
'title': 'lamsinka89', 'description': 'RedGifs user lamsinka89, ordered by recent', }, 'playlist_mincount': 391, }, { 'url': 'https://www.redgifs.com/users/lamsinka89?page=3', 'info_dict': { 'id': 'lamsinka89?page=3', ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'note': 'https://github.com/yt-dlp/yt-dlp/issues/7382,\r\n```", "severity": "minor", "line": 26 } ]
1
python
while True: print("The newline above me should be deleted!") while True: print("The newlines above me should be deleted!") while True: while False: print("The newlines above me should be deleted!") with open("/path/to/file.txt", mode="w") as file: file.write("The new line above me i...
Review this code and list any quality issues.
[]
0
python
# change number of users and check that test_start isn't fired again master.start(7, 7) self.assertEqual(1, run_count[0]) # stop and start to make sure test_start is fired again master.stop() master.start(3, 3) self.assertEqual(2, run_count[0]) ...
Review this code and list any quality issues.
[ { "issue": "Using a list here is more or less a hack for modifying values outside the function. I think this can be done in a more obvious way. even using a (properly named) global is preferable.", "severity": "minor", "line": 26 } ]
1
python
def __setattr__(self, key, value): msg = "Operation not allowed! " if key in self.__dict__: msg += "Please change datasets through configuration." else: msg += "Please use DataCatalog.add() instead." raise AttributeError(msg) class DataCatalog: """``DataCata...
Review this code and list any quality issues.
[ { "issue": "These new arguments should also be added to the doc string below.", "severity": "minor", "line": 26 } ]
1
python
next_url = episodes.get('next') if not next_url: break def _real_extract(self, url): collection_slug = self._match_id(url) channel = self._call_api( f'https://content.api.nebula.app/content/{collection_slug}/?include=lessons', collection_slug, not...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n IE_NAME = 'nebula:season'\r\n```", "severity": "minor", "line": 26 } ]
1
python
# from dispatcherd.config import settings as dispatcher_settings from dispatcherd.utils import serialize_task def get_dispatcherd_config(for_service: bool = False) -> dict: """Return a dictionary config for dispatcherd Parameters: for_service: if True, include dynamic options needed for running the dispa...
Review this code and list any quality issues.
[]
0
python
formatted = ds_entry.get_formatted(Mode.sft, "<|endofline|>") assert len(formatted) == 3 assert "length: 100" in formatted[0] assert "quality: 1.0" in formatted[0] assert "humor: 0.0" in formatted[0] assert "creativity: 0.0" in formatted[0] assert "Some context" in formatted[0] assert f"{QA_...
Review this code and list any quality issues.
[]
0
python
webpage = self._download_webpage(url, display_id) initial_state = self._search_json( r'window\.__INITIAL_STATE__\s*=', webpage, 'initial state', display_id, transform_source=js_to_json) note_info = traverse_obj(initial_state, ('note', 'noteDetailMap', display_id, 'note')) video_info...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n formats.extend(traverse_obj(info, (('mediaUrl', ('backupUrls', ...)), {\r\n lambda u: url_or_none(u) and {'url': u, **format_info}})))\r\n```", "severity": "minor", "line": 26 } ]
1
python
from typing import Optional from langchain_community.embeddings import AzureOpenAIEmbeddings from embedchain.config import BaseEmbedderConfig from embedchain.embedder.base import BaseEmbedder from embedchain.models import VectorDimensions class AzureOpenAIEmbedder(BaseEmbedder): def __init__(self, config: Optio...
Review this code and list any quality issues.
[]
0
python
def target_temperature(self): """Return the temperature we are trying to reach.""" return self._unit.thermostat @property def hvac_mode(self): """Return hvac target hvac state.""" mode = self._unit.mode if not self._unit.is_on: return HVACMode.OFF re...
Review this code and list any quality issues.
[ { "issue": "Log message includes the integration name (\"The CoolMaster integration...\"). Home Assistant already prefixes logs with the integration, so this is redundant; consider rewording the warning to omit the integration name and focus on the condition/action (unknown fan speed + removal version).\n```sug...
1
python
class PromptyExecutor(ScriptExecutor): """ This class is used to execute prompty with different inputs. A callable class will be initialized with a prompty file. This callable class will be called when execute line. """ def __init__( self, flow_file: Path, connections: Optio...
Review this code and list any quality issues.
[ { "issue": "shall we add a new type for Promty? Is there any thing we can tell this is a prompty in trace UI?", "severity": "minor", "line": 26 } ]
1
python
input_data=input_data, input_credentials=input_credentials, ) job = self.scheduler.add_job( execute_graph, kwargs=job_args.model_dump(), name=name, trigger=CronTrigger.from_crontab(cron), jobstore=Jobstores.EXECUTION.value, ...
Review this code and list any quality issues.
[ { "issue": "At some point, shouldn't we show these as errors for the execution for debugging?", "severity": "critical", "line": 26 } ]
1
python
InvalidSequence, NonExistingDataNode, NonExistingSequence, NonExistingTask, SequenceAlreadyExists, SequenceTaskDoesNotExistInScenario, ) from ..job.job import Job from ..notification import Event, EventEntityType, EventOperation, Notifier, _make_event from ..sequence.sequence import Sequence from .....
Review this code and list any quality issues.
[ { "issue": "Add identation\r\n\r\n```suggestion\r\n\r\n It is not recommended to instantiate a `Scenario` directly. Instead, it should be\r\n created with the `create_scenario()^` function.\r\n```", "severity": "minor", "line": 26 } ]
1
python
self.assertEqual(mock_open.call_count, 0) def tearDown(self): for fpath in glob(os.path.join(DEFAULT_HOME, 'test_lsf_file_*')): try: os.remove(fpath) except OSError: pass class TestSafeExtract(unittest.TestCase): def setUp(self): self.t...
Review this code and list any quality issues.
[ { "issue": "In many places, you define the f-string `f'test_file_{i}.txt'` multiple times rather than defining as a variable and referencing it. This is minor, but would be cleaner and more resilient to content changes.", "severity": "minor", "line": 26 } ]
1
python
def get(self, key: str, fallback_to_runtime_pattern: bool = False) -> _DS | None: """Get a dataset by name from an internal collection of datasets.""" ... def save(self, name: str, data: Any) -> None: """Save data to a registered dataset.""" ... def load(self, name: str, versio...
Review this code and list any quality issues.
[ { "issue": "I think this method shouldn't be here\r\nSee https://github.com/kedro-org/kedro/blob/c9391d68dbdc86d953d12bc5f4b2f3936d756375/kedro/io/core.py#L943", "severity": "minor", "line": 26 } ]
1
python
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401: resp = self._parse_json(e.cause.read().decode(), None, fatal=False) if resp: error = resp.get('extra_info') or resp.get('error_description') or resp.get('error') if error: ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n f'https://api.digitalconcerthall.com/v2/concert/{video_id}',\r\n video_id, headers={'Accept': 'application/json',\r\n```\r\nuse of f-string is allowed in yt-dlp", "severity": "minor", "line": 26 } ]
1
python
self.extension = f".{extension}" self.makedirs = makedirs def filename(self, patient_no: int, image_name: str, **kwargs) -> Path: sub_path = self.basepath / patient_no if not sub_path.exists(): sub_path.mkdir(parents=True) ...
Review this code and list any quality issues.
[]
0
python
).lower()) ) ) ) and ( has_cmd('nvcc') or has_cmd('nvcc.exe') or os.path.exists('/usr/local/cuda/bin/nvcc') or (os.name == 'nt' and os.environ.get('CUDA_PATH') and os.path.exists(os.path.join(os.environ['CUDA_PATH'], 'bin',...
Review this code and list any quality issues.
[ { "issue": "If toolkit_version_parse returns None (e.g., if the version file content doesn't match the expected patterns), toolkit_version_compare will return None, but the subsequent if-elif chain doesn't handle this case. This will cause the code to fall through to the else clause on line 266, which may not b...
1
python
kwargs.update(chat_template_kwargs) return kwargs def _render_chat_prompt( self, request: ChatCompletionRequest, messages: List[dict[str, Any]], ) -> str: tokenizer = getattr( getattr(self.engine, "tokenizer_manager", None), "tokenizer", None ) ...
Review this code and list any quality issues.
[ { "issue": "I think we can replace this block with something more like:\n```\n kwargs = {}\n if getattr(request, \"tools\", None) is not None:\n kwargs[\"tools\"] = request.tools\n if getattr(request, \"reasoning_effort\", None) is not None:\n kwargs[\"reasoning_effort\"] = request.reasoning_effort...
1
python
m = BedrockConverseModel('us.amazon.nova-micro-v1:0', provider=bedrock_provider) agent = Agent(m) result = await agent.run('What is the capital of France?') assert result.output == snapshot( 'The capital of France is Paris. Paris, officially known as "Ville de Paris," is not only the capital city bu...
Review this code and list any quality issues.
[]
0
python
return query(self, query_string) def sample_by( self, weights: Union[str, list, tuple], replace: Optional[bool] = True, size: Optional[int] = None, ): """Returns a sliced :class:`~deeplake.core.dataset.Dataset` with given weighted sampler applied. To use this, in...
Review this code and list any quality issues.
[]
0
python
"agent-client-protocol package not installed. " "Install with: pip install 'gptme[acp]'" ) session_id = uuid4().hex # Create a temporary directory for the log logdir = Path(tempfile.mkdtemp(prefix=f"gptme-acp-{session_id[:8]}-")) # Get tools and initial pro...
Review this code and list any quality issues.
[ { "issue": "Shouldn't these reuse the conversation storing logic used in LogManager?", "severity": "minor", "line": 26 } ]
1
python
'unicode_escape').split('=')[-1] self._downloader.cookiejar.clear(domain='.google.com', path='/', name='NID') return { 'id': video_id, 'title': title, 'thumbnail': 'https://drive.google.com/thumbnail?id=' + video_id, 'duration': int_or_none(get_value('le...
Review this code and list any quality issues.
[ { "issue": "Add a test with non-piracy content!", "severity": "minor", "line": 26 } ]
1
python
string_processing = auto class Deprecated(UserWarning): """Visible deprecation warning.""" @dataclass class Mode: target_versions: Set[TargetVersion] = field(default_factory=set) line_length: int = DEFAULT_LINE_LENGTH string_normalization: bool = True is_pyi: bool = False is_ipynb: bool = Fa...
Review this code and list any quality issues.
[ { "issue": "The reason I'm using `warnings.warn` and warning *here*, is that if we define the public API soon, then the warning is issued when `Mode` is instantiated. But having it in CLI main works as well. There we could just use Click's output rather than issuing proper warnings.", "severity": "minor", ...
1
python
This function also works with string values. >>> arr4 = pa.array(["z", None, "y", "x"]) >>> pc.max(arr4) <pyarrow.StringScalar: 'z'> """ function_doc_additions["min_max"] = """ Examples -------- >>> import pyarrow as pa >>> import pyarrow.compute as pc >>> arr1 = pa.array([1, 1, 2,...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n Using ``ScalarAggregateOptions`` to control minimum number of non-null values.\r\n```", "severity": "minor", "line": 26 } ]
1
python
document_id = str(document_id) document = self.get_document(dataset_id, document_id) # The role of the current user in the ta table must be admin, owner, dataset_operator, or editor if not current_user.is_dataset_editor: raise Forbidden() if action == "pause": i...
Review this code and list any quality issues.
[ { "issue": "The match statement is missing a wildcard case to handle invalid action values. Although the `action` parameter is typed as `Literal[\"pause\", \"resume\"]`, the Flask route accepts any string value (`<string:action>`). If an invalid action is passed at runtime, none of the cases will match, causing...
1
python
from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( try_get, int_or_none, url_or_none, float_or_none, unified_timestamp, unified_strdate, ) class BannedVideoIE(InfoExtractor): _GRAPHQL_API = 'https://api.infowarsmedia.com/graphql' ...
Review this code and list any quality issues.
[ { "issue": "Why don't you combine all three queries together into one request?", "severity": "minor", "line": 22 } ]
1
python
# Calculate the expected returns expected = (test_data[-1] - test_data[0]) / test_data[0] out = empty((3,), dtype=float) returns.compute(today, assets, out, test_data) check_allclose(expected, out) @parameterized.expand([ (100, 15), (101, 4), (102, 100), ...
Review this code and list any quality issues.
[ { "issue": "Another, more \"functional\" way to write this would be to use [np.concatenate](https://docs.scipy.org/doc/numpy/reference/generated/numpy.concatenate.html) or [np.vstack](https://docs.scipy.org/doc/numpy/reference/generated/numpy.vstack.html#numpy.vstack) to stack the first row, the middle row, and...
1
python
1-d or 2-d array, representing a vector or matrix. Returns ------- Ax : array 1-d or 2-d array (depending on the shape of x) that represents the result of applying this linear operator on x. """ if isinstance(x, LinearOperator): return _Produ...
Review this code and list any quality issues.
[]
0
python
) -> None: super().__init__( serialized_fields={ "application_id": application_id, "job_id": job_id, "cancel_on_kill": cancel_on_kill, }, waiter_name="serverless_job_completed", waiter_args={"applicationId": applicat...
Review this code and list any quality issues.
[ { "issue": "This condition looks misplaced to me?", "severity": "minor", "line": 26 } ]
1
python
import asyncio import json from crawlee import HttpHeaders from crawlee.crawlers import HttpCrawler, HttpCrawlingContext from crawlee.errors import HttpStatusCodeError from crawlee.sessions import SessionPool # Using a placeholder refresh token for this example REFRESH_TOKEN = 'PLACEHOLDER' UNAUTHORIZED_STATUS_CODE =...
Review this code and list any quality issues.
[ { "issue": "Since you already defined UNAUTHORIZED_STATUS_CODE, maybe it can be used in all places where you have literal 401 in this example code.", "severity": "critical", "line": 20 } ]
1
python
}] def _real_extract(self, url): video_id = self._match_id(url) headers = self.geo_verification_headers() webpage, urlh = self._download_webpage_handle(url, video_id, headers=headers) if not self._match_valid_url(urlh.url): return self.url_result(urlh.url) heade...
Review this code and list any quality issues.
[ { "issue": "is this error handling still valid even with the site changes?", "severity": "minor", "line": 26 } ]
1
python
self.renormalize_logits = kwargs.pop("renormalize_logits", None) self.forced_bos_token_id = kwargs.pop("forced_bos_token_id", None) self.forced_eos_token_id = kwargs.pop("forced_eos_token_id", None) self.remove_invalid_values = kwargs.pop("remove_invalid_values", None) self.exponential_d...
Review this code and list any quality issues.
[ { "issue": "Sorry, I'm a bit lost into the motivation the PR and making those values to None (which is usually not a super good idea if they are boolean by essence) - could you give me a bit of context on the PR?", "severity": "minor", "line": 26 } ]
1
python
@gs.assert_built def read(self, envs_idx: List[int] | None = None): """ Read the sensor data (with noise applied if applicable). """ return self._get_return_data_from_tensor(self._cache.get(self._read_delay_steps), envs_idx) @gs.assert_built def read_ground_truth(self, envs_...
Review this code and list any quality issues.
[ { "issue": "You should not squeeze unconditionally.", "severity": "minor", "line": 26 } ]
1
python
assert pool.connection_kwargs["client_name"] == "test-client" def test_invalid_extra_typed_querystring_options(self): with pytest.raises(ValueError): redis.ConnectionPool.from_url( "redis://localhost/2?socket_timeout=_&socket_connect_timeout=abc" ) def test_extr...
Review this code and list any quality issues.
[]
0
python
# Log to each configured logger self.validation_generations_logger.log(self.config.trainer.logger, samples, self.global_steps) def _compute_or_extract_reward( self, batch: DataProto, reward_fn=None, reward_for_val: bool = False, sum_reward: bool = False, ) -> tup...
Review this code and list any quality issues.
[ { "issue": "Add descriptions for `reward_extra_infos`", "severity": "minor", "line": 26 } ]
1
python
# export only what we want to expose as `pyscript` module # but not what is WORKER/MAIN dependent from _pyscript import window, document, IS_WORKER # this part is needed to disambiguate between MAIN and WORKER if IS_WORKER: # in workers the display does not have a default ID # but there is a sync utility from ...
Review this code and list any quality issues.
[ { "issue": "It might be good to define this also in a worker but make it raise a runtime error.", "severity": "minor", "line": 25 } ]
1
python
class MicrosoftLearnSessionIE(InfoExtractor): _VALID_URL = r'https?://learn\.microsoft\.com/(?:[\w\-]+/)?events/[\w\-]+/(?P<id>[^?#/]+)' _TESTS = [{ 'url': 'https://learn.microsoft.com/en-us/events/build-2022/ts01-rapidly-code-test-ship-from-secure-cloud-developer-environments', 'info_dict': { ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n 'timestamp': parse_iso8601(self._html_search_meta('startDate', webpage, 'startDate')),\r\n```", "severity": "minor", "line": 26 } ]
1
python
async def edit_widget(self, *, enabled: bool = None, channel: abc.Snowflake = None) -> None: """|coro| Edits the widget of the guild. You must have the :attr:`~Permissions.manage_guild` permission to use this .. versionadded:: 2.0 Parameters ----------- ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n payload = {}\r\n if channel is not utils.MISSING:\r\n payload['channel_id'] = None if channel is None else channel.id\r\n if enabled is not utils.MISSING:\r\n payload['enabled'] = enabled\r\n\r\n await self._state.http.edit_widget(s...
1
python
self.lora_config = lora_config self.quantization_config = quantization_config self.device = get_accelerator().current_device_name() if device is None else device assert self.lora_config is not None, "DSOptimizedLinear requires a LoRA config" self.zero_shards = self.lora_config.base_weig...
Review this code and list any quality issues.
[ { "issue": "You may want to remove `# Use RS lora for now.` comment as the `math.sqrt(...)` that was removed is the rs-lora technique.", "severity": "minor", "line": 26 } ]
1
python
TITLE = "ReconSpider(For All Scaning)" DESCRIPTION = "ReconSpider is most Advanced Open Source Intelligence (OSINT)" \ " Framework for scanning IP Address, Emails, \n" \ "Websites, Organizations and find out information from" \ " different sources.\n" INSTAL...
Review this code and list any quality issues.
[]
0
python
{ 'url': 'https://play.nova.bg/video/igri-na-volqta/season-3/igri-na-volqta-2021-09-20-1/548227', 'md5': '5fd61b8ecbe582fc021019d570965d58', 'info_dict': { 'id': '548227', 'ext': 'mp4', 'title': 'Игри на волята: България (20.09.2021) - ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n video_id, headers={'x-flipps-user-agent': 'Flipps/75/9.7'})[0]['url']\r\n```", "severity": "minor", "line": 26 } ]
1
python
r'name=["\']authenticity_token["\'] value=["\'](.+?)["\']', signin_page, 'authenticity_token', ), 'utf8': True, }), ) def _real_extract(self, url): display_id = self._match_id(url) webpage = self._download_webpage(url, display_id) if '<di...
Review this code and list any quality issues.
[ { "issue": "again here depends on if you think the description is worthy of a warning \r\n```suggestion\r\n 'description': self._html_search_meta('description', webpage, default=None),\r\n```", "severity": "minor", "line": 26 } ]
1
python
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_KEY = '' SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_SECRET = '' SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_NAME = '' SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_SCOPE = ['user:email', 'read:org'] SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_KEY = '' SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_SECRET = '' SOCIAL_AUTH_GITHUB_ENTERPR...
Review this code and list any quality issues.
[]
0
python
video_id = self._search_regex( r'materials/([\da-zA-Z]{10}_[\da-fA-F]{7})/', v_url, 'video id', default=None) process_video_files(deferred_json) video_format = video_file.get('format') or determine_ext(v_url) if video_format == 'm3u8': ...
Review this code and list any quality issues.
[ { "issue": "This does not need to be fatal.", "severity": "minor", "line": 26 } ]
1
python
def export( self, metrics_data: MetricsData, timeout_millis: float = 10_000, **kwargs, ) -> MetricExportResult: self.f.write(metrics_data.to_json()) self.f.write('\n') self.f.flush() return MetricExportResult.SUCCESS def shutdown(self, timeout_mil...
Review this code and list any quality issues.
[]
0
python
Dictionary-based wrapper of :py:class:`monai.transforms.RandSimulateLowResolution`. Random simulation of low resolution corresponding to nnU-Net's SimulateLowResolutionTransform (https://github.com/MIC-DKFZ/batchgenerators/blob/7651ece69faf55263dd582a9f5cbd149ed9c3ad0/batchgenerators/transforms/resample_transfo...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n upsample_mode: interpolation mode for upsampling operation\r\n```", "severity": "minor", "line": 26 } ]
1
python
def increment_char(c): return chr(ord(c) + 1) result = la.map(increment_char) expected = LabelArray(['A', 'C', 'D'], missing_value='A') assert_equal(result.as_string_array(), expected.as_string_array()) @parameter_space( __fail_fast=True, f=[ lambda ...
Review this code and list any quality issues.
[ { "issue": "should we test that this returns `[None] * len(self.strs)` or was this tested somewhere else?", "severity": "minor", "line": 26 } ]
1
python
thumbnails = [] if url_or_none(player_info.get('thumbnail')): thumbnails.append({ 'id': '0', 'url': player_info['thumbnail'], }) thumbnails.extend(traverse_obj(slides, (..., { 'id': 'id', 'url': 'url', }))) ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n slides_xml = None\r\n if player_info.get('slides_xml_url'):\r\n slides_xml = self._download_xml(\r\n player_info['slides_xml_url'], video_id, fatal=False,\r\n note='Downloading slides XML', errnote='Failed to download slides XM...
1
python
env={ "GIT_COMMITTER_NAME": author.encode(locale.getpreferredencoding()), "GIT_COMMITTER_EMAIL": email, }, ) # Reset the repository to the original hash, but the commits are still # available until the next `git gc`. last_commi...
Review this code and list any quality issues.
[]
0
python
self.assertTrue(strp_output == defaults, "Default values for strptime() are incorrect;" " %s != %s" % (strp_output, defaults)) def test_escaping(self): # Make sure all characters that have regex significance are escaped. # Parentheses are in a purpose...
Review this code and list any quality issues.
[ { "issue": "Please simplify all of these, like so:\n```\ntest_date = \"X\"\nself.assertEqual(\n X.strptime(test_date, \"%X\"),\n X.strptime(test_date, \"XXX\"),\n)\n```", "severity": "major", "line": 26 } ]
1
python
def initialize(self, *args, **kwargs): self.asset = self.sid(kwargs.pop('sid')) def handle_data(self, data): ######## # Buys # ######## # Buy with low limit, shouldn't trigger. self.order(self.asset, 100, limit_price=1) # But with high stop, shouldn't trig...
Review this code and list any quality issues.
[]
0
python
model_request_parameters: ModelRequestParameters, ) -> responses.Response | AsyncStream[responses.ResponseStreamEvent]: tools = ( self._get_builtin_tools(model_request_parameters) + list(model_settings.get('openai_builtin_tools', [])) + self._get_tools(model_request_param...
Review this code and list any quality issues.
[ { "issue": "This can be `==` right? And be merged with the previous `if` statement?", "severity": "minor", "line": 26 } ]
1
python
confidence_threshold: float = 0.5, iou_threshold: float = 0.7, ) -> sv.Detections: """ Detect objects in a frame using a YOLO model, filtering detections by class ID and confidence threshold. Args: frame (np.ndarray): The frame to process, expected to be a NumPy array. model (YO...
Review this code and list any quality issues.
[ { "issue": "The confidence_threshold is being applied twice: first in the model inference call (line 87) with `conf=confidence_threshold`, and then again in the manual filtering (line 90) with `detections.confidence > confidence_threshold`. This redundant filtering is inefficient since the model has already fil...
1
python
import os import glob from typing import List from dotenv import load_dotenv from langchain.document_loaders import ( CSVLoader, EverNoteLoader, PDFMinerLoader, TextLoader, UnstructuredEmailLoader, UnstructuredEPubLoader, UnstructuredHTMLLoader, UnstructuredMarkdownLoader, Unstructu...
Review this code and list any quality issues.
[ { "issue": "This implementation is quite fragile, as @PulpCattel pointed out. It may break with a new version of Chroma.", "severity": "minor", "line": 26 } ]
1
python
'modified_date': '20250225', }, 'playlist_count': 1, }] def _real_extract(self, url): locale, display_id, page_id = self._match_valid_url(url).group('locale', 'display_id', 'id') json_data = self._download_json( f'https://assets.msn.com/content/view/v2/Detail/{local...
Review this code and list any quality issues.
[ { "issue": "I think we can have this be fatal since we raise anyways if it's not a known string value\r\n```suggestion\r\n page_type = json_data['type']\r\n```", "severity": "minor", "line": 26 } ]
1
python
# software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. import argparse from pathlib import Path import re import zip...
Review this code and list any quality issues.
[ { "issue": "How about being a bit stricter\n```suggestion\n assert any(info.filename.split(\"/\")[-1] == filename\n for info in f.filelist), \\\n```", "severity": "minor", "line": 26 } ]
1
python
server = ServerPreset.tinyllama2() LONG_TEXT = """ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehende...
Review this code and list any quality issues.
[ { "issue": "@ggerganov remove this line or set it to `\"on\"`, then run the unit test. Alternatively, edit the unit test on master to run with FA.", "severity": "major", "line": 26 } ]
1
python
Coin(TEST_COIN_ID, IDENTITY_PUZZLE_HASH, uint64(TEST_COIN_AMOUNT - 1)), } expected_cost = mempool_item.bundle_coin_spends[TEST_COIN_ID].cost assert dedup_coin_spends == IdenticalSpendDedup( {TEST_COIN_ID: DedupCoinSpend(solution=solution, cost=expected_cost)} ) def test_dedup_info_eligible_but...
Review this code and list any quality issues.
[]
0
python
Parameters ---------- min_force : float | tuple[float, float, float], optional The minimum detectable absolute force per each axis. Values below this will be treated as 0. Default is 0. max_force : float | tuple[float, float, float], optional The maximum output absolute force per each axis. ...
Review this code and list any quality issues.
[]
0
python
"""Create a :class:`~ray.data.Dataset` from `WebDataset <https://github.com/webdataset/webdataset>`_ files. Args: paths: A single file/directory path or a list of file/directory paths. A list of paths can contain both files and directories. filesystem: The filesystem implementation ...
Review this code and list any quality issues.
[]
0
python
) async with self.blockchain.priority_mutex.acquire(priority=BlockchainMutexPriority.high): pending_tx = await self.mempool_manager.new_peak(self.blockchain.get_tx_peak(), None) assert len(pending_tx.items) == 0 # no pending transactions when starting up ...
Review this code and list any quality issues.
[ { "issue": "The local `mypy` caught this subtle problem (`exit_stack` is already typed in an incompatible way in this scope).", "severity": "minor", "line": 26 } ]
1
python
'id': '9ad5e58a-f26f-49f7-8b1d-68f0629485b7-1770059257365', 'ext': 'mp4', 'title': 'Norðmenn tala ekki um annað en prinsessuna', 'categories': ['frettir'], 'description': 'md5:53e2623ae79e1355778c14f5b557a0cd', 'display_id': 'nordmenn-tala-ekki-um-annad-en-pri...
Review this code and list any quality issues.
[ { "issue": "We should validate that the string we're constructing is actually an `upload_date`\r\n\r\nIf applying my `MONTH_NAMES` suggestion from above, we can do this:\r\n\r\n```suggestion\r\n upload_date = None\r\n if date_str := traverse_obj(webpage, (\r\n {find_element(cls='article...
1
python
self.set_runtime_status(RuntimeStatus.STARTING_RUNTIME) await call_sync_from_async(self.wait_until_alive) if not self.attach_to_existing: self.log('info', 'Runtime is ready.') if not self.attach_to_existing: await call_sync_from_async(self.setup_initial_env) s...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n f'Error: Failed to connect instance {self.container_name} to network {network_name}',\r\n```", "severity": "critical", "line": 26 } ]
1
python
# All should exist now for key, _ in keys_and_values: assert await kvs.record_exists(key) is True # Test some non-existent keys assert await kvs.record_exists('nonexistent1') is False assert await kvs.record_exists('nonexistent2') is False async def test_record_exists_after_purge(kvs: KeyValu...
Review this code and list any quality issues.
[]
0
python
webpage_url = self._search_regex( r'<a class="tgme_widget_message_video_player[^>]+href="([^"]+)"', video, 'webpage URL', fatal=False) if not video_url or not webpage_url: continue formats = [{ 'url': video_url, 'ext...
Review this code and list any quality issues.
[ { "issue": "title/description should be non-fatal", "severity": "minor", "line": 26 } ]
1
python
<head> <link rel="stylesheet" href="{self.http_server_addr}/build/pyscript.css" /> <script defer src="{self.http_server_addr}/build/pyscript.js"></script> {extra_head} </head> <body> {py_config_maybe} {snippet} </body> ...
Review this code and list any quality issues.
[]
0
python
# spend flags, we'll consider coins with odd amount # that share the same puzzle hash and amount as their # spent parents to be potential ff singletons. maybe_ff_singleton = ( addition.amount % 2 == 1 ...
Review this code and list any quality issues.
[ { "issue": "the fact that `spend_sim` reaches into private functions of `CoinStore` has been a problem for a while, and this is making it worse. Is there now way for spend sim to use the same interface as the main blockchain to manipulate the coin store?", "severity": "minor", "line": 26 } ]
1
python
control_coords = c_c = control_points[:, dim] terms = [] for term_power in range(n, -1, -1): outercoeff = choose(n, term_power) term = [] negative = 1 for subterm_num in range(term_power, -1, -1): innercoeff = choose(term_power, subterm_num...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n\r\n bezier_polynom = np.polynomial.Polynomial(terms[::-1])\r\n```", "severity": "minor", "line": 26 } ]
1
python
""" A simple Pipeline algorithm that longs the top 3 stocks by RSI and shorts the bottom 3 each day. """ from six import viewkeys from zipline.api import ( attach_pipeline, date_rules, order_target_percent, pipeline_output, record, schedule_function, ) from zipline.pipeline import Pipeline from ...
Review this code and list any quality issues.
[ { "issue": "just don't include the function if it is empty", "severity": "minor", "line": null } ]
1
python
help=( "Python versions that should be supported by Black's output. [default: per-file" " auto-detection]" ), ) @click.option( "--pyi", is_flag=True, help=( "Format all input files like typing stubs regardless of file extension (useful" " when piping source on standard in...
Review this code and list any quality issues.
[ { "issue": "A bit jarring to write `--python-cell-magics custom1 --python-cell-magics custom2`. Should we use a comma-separated list instead?", "severity": "minor", "line": 26 } ]
1
python
@pytest.mark.parametrize( "estimator, expected_result", [ (KMeans(), True), (GridSearchCV(KMeans(), {"n_clusters": [3, 8]}), True), (Pipeline([("km", KMeans())]), True), (Pipeline([("km_cv", GridSearchCV(KMeans(), {"n_clusters": [3, 8]}))]), True), (SVC(), False), ...
Review this code and list any quality issues.
[ { "issue": "The scope of the test for the code added below is in fact much bigger than this.\n\nCatching the exception in `get_tags()` would also add this functionality for [meta estimators](https://scikit-learn.org/stable/glossary.html#term-meta-estimator), which is to be discussed (see below).\n\nAlso, the te...
1
python
image_token_id: int = getattr(processor, "image_token_id") batch_token_type_ids = [] for token_ids in batch_ids: token_ids = np.array(token_ids) token_type_ids = np.zeros_like(token_ids) token_type_ids[token_ids == image_token_id] = 1 batch_token_type_ids.append(token_type_ids.to...
Review this code and list any quality issues.
[ { "issue": "we can use \r\n`if isinstance(video, list) and all(isinstance(frame, (str, bytes, dict) for frame in video) return True`", "severity": "minor", "line": 26 } ]
1
python
conn_id=TEST_CONN_ID, conn_type="sqlite", password="existing_password", ) session.add(connection) session.commit() body = { "connection_id": TEST_CONN_ID, "conn_type": "sqlite", "password": "***", } response = t...
Review this code and list any quality issues.
[ { "issue": "I would also add an assertion to check that hte `TEST_CONN_ID` wasn't mutated into db, and that no other connection record was created. (I.e the merged connection is not persisted anywhere)", "severity": "minor", "line": 26 } ]
1
python
# Split the input string into lines and iterate over them for line in metrics_str.split("\n"): match = pattern.match(line) if match: # Extracting the operator name, time, and percentage operator_name, time_str, percent_str = match.groups() # Converting percentage ...
Review this code and list any quality issues.
[ { "issue": "Can you add a comment describing we special-case `\"Scheduling\"`? I don't think it'll be completely obvious to readers", "severity": "minor", "line": 26 } ]
1
python
TVCIE, TVCArticleIE, ) from .tver import TVerIE from .tvigle import TvigleIE from .tviplayer import TVIPlayerIE from .tvland import TVLandIE from .tvn24 import TVN24IE from .tvnoe import TVNoeIE from .tvopengr import ( TVOpenGrEmbedIE, TVOpenGrWatchIE, ) from .tvp import ( TVPIE, TVPEmbedIE, TVP...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\nfrom .tvw import (\r\n TvwIE,\r\n TvwTvChannelsIE,\r\n)\r\n```", "severity": "minor", "line": 26 } ]
1
python
base_vm.basic_config(track_dirty_pages=True) base_vm.add_net_iface() base_vm.start() base_vm.wait_for_up() snapshot = base_vm.make_snapshot(snapshot_type) base_snapshot = snapshot base_vm.kill() for i in range(5): vm = microvm_factory.build() vm.spawn() copied_snaps...
Review this code and list any quality issues.
[ { "issue": "We should also test this when restoring from a config file, in a separate test.", "severity": "minor", "line": 26 } ]
1
python
register_snippet(CustomPermissionModel) class RequiredDatePage(Page): deadline = models.DateField() content_panels = [ TitleFieldPanel("title", classname="title"), FieldPanel("deadline"), ] class CommentableJSONPage(Page): commentable_body = CommentableJSONField() uncommentable_...
Review this code and list any quality issues.
[ { "issue": "I wonder if we can reuse some of the existing models, e.g. `EventPageSpeakerAward`, so that we don't add three new models just for testing this.", "severity": "minor", "line": 26 } ]
1
python
async def move(req: MoveRequest): try: event_id = "Move" + str(uuid.uuid4()) msg = MoveMsg( event_id=event_id, old_position=req.old_position, new_position=req.new_position, tokens=req.tokens, copy=req.copy, ...
Review this code and list any quality issues.
[ { "issue": "Why dictionary here? Maybe add a simple comment here?", "severity": "minor", "line": 26 } ]
1
python
term_allow_color = os.getenv('TERM', '').lower() != 'dumb' base_no_color = bool(os.getenv('NO_COLOR')) def process_color_policy(stream): stream_name = {sys.stdout: 'stdout', sys.stderr: 'stderr'}[stream] policy = traverse_obj(self.params, ('color', (stream_name, None), {str}, an...
Review this code and list any quality issues.
[ { "issue": "Should we do this? If `system_deprecation` is truthy, we're either already telling them to update or we're telling them they can't update.\r\n```suggestion\r\n elif self.params.get('warn_when_outdated'):\r\n```", "severity": "minor", "line": 26 } ]
1
python
}] def _fetch_page(self, song_id, type_url, page): page += 1 api = self.get_api_with_signature(name_api=self._SLUG_API[type_url], param={ 'id': song_id, 'type': 'genre', 'page': page, 'count': self._PER_PAGE }) data = self._download_js...
Review this code and list any quality issues.
[ { "issue": "why use `.get` when `_entries` will throw on None anyway?", "severity": "minor", "line": 26 } ]
1
python
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ExtractorError, clean_html, int_or_none, try_get from ..compat import compat_str class DamtomoBaseIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) ...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n```\r\nusing /s* everywhere is already recommended practice", "severity": "minor", "line": 21 } ]
1
python
Typical usage examples: .. code-block:: bash # Execute this module as a CLI entry with default ConfigWorkflow: python -m monai.bundle run_workflow --meta_file <meta path> --config_file <config path> # Set the workflow to other customized BundleWorkflow subclass: python -m monai.bu...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n workflow_class = locate(str(workflow_name)) # search dotted path\r\n```", "severity": "minor", "line": 26 } ]
1
python
for i in itertools.count(): payload = json.dumps({'username': uploader, 'maxResults': 16, 'page': i + 1, 'requestName': 'userPage'}).encode('utf-8') headers = { 'x-csrf-token': authtoken, 'content-type': 'application/json;charset=UTF-8' } f...
Review this code and list any quality issues.
[ { "issue": "should the url always be for VeohIE? if so, just have \r\n```suggestion\r\n VeohIE.ie_key(),\r\n```\r\n\r\notherwise if it can be for any extractor, just leave it blank", "severity": "major", "line": 26 } ]
1
python
if sleep_interval > 0: self.to_screen('Sleeping %s seconds ...' % sleep_interval) time.sleep(sleep_interval) else: self._downloader._first_webpage_request = False if note is None: self.report_download_webpage(video_id) elif note is not Fal...
Review this code and list any quality issues.
[ { "issue": "```suggestion\r\n target = ImpersonateTarget.from_str('' if impersonate is True else impersonate)\r\n```\r\n\r\nis more standard/consistent I would think", "severity": "minor", "line": 26 } ]
1
python
information can be found at: https://github.github.com/gfm. See the ``body`` parameter of |st.markdown|_ for additional, supported Markdown directives. .. |st.markdown| replace:: ``st.markdown`` .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.ma...
Review this code and list any quality issues.
[ { "issue": "Grammatical error: \"a spinner a icon\" should be \"a spinner as an icon\".\n```suggestion\n - ``\"spinner\"``: Displays a spinner as an icon.\n```", "severity": "minor", "line": 26 } ]
1
python
self.assertEqual(mysig, sig_pickled) self.assertTrue(isinstance(sig_pickled, MySignature)) self.assertTrue(isinstance(sig_pickled.parameters['z'], MyParameter)) def test_signature_immutability(self): def test(a): pass ...
Review this code and list any quality issues.
[]
0
python
if self.compressed: module = wrapper.module new_output = self._quantize(output, module.output_scale, module.output_zero_point, module.output_qmin, ...
Review this code and list any quality issues.
[ { "issue": "could you explain more about the case that should recover old_weight to weight?", "severity": "minor", "line": 26 } ]
1
python
"coltypes": [GenericDataType.NUMERIC], "rowcount": 1, } ] } def test_apply_client_processing_csv_format_empty_string(): """ It should be able to process csv results with no data """ result = {"queries": [{"result_format": ChartDataResultFormat.CSV, "data": ""}]...
Review this code and list any quality issues.
[ { "issue": "wondering if you can set as a fixture (?) or reuse one of the fixtures?", "severity": "minor", "line": 26 } ]
1
python
# make some data d = [[100, 100, 100, 100, 200, 320, 450, 80, 20, 600, 310, 800], [20, 23, 50, 11, 100, 420], [120, 120, 120, 140, 140, 150, 180], [60, 60, 60, 60, 300, 300, 5, 5, 5, 5, 10, 300], [555, 555, 555, 30, 30, 30, 30, 30, 100, 100, 100, 100, 30, 30], [30, 30, 30, 30, 40...
Review this code and list any quality issues.
[]
0
python
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from urllib.parse import urlparse import mlflow from filelock import FileLock from mlflow.exceptions import MlflowException, RESOURCE_ALREADY_EXISTS, ErrorCode from mlflow.entities import ViewType import os from typing import Optional, Text from...
Review this code and list any quality issues.
[ { "issue": "@ChiahungTai You can start from these docs.", "severity": "minor", "line": 24 } ]
1