text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: List[int], int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: int) -> int: if v2 == 1: return 0 v3 = sum(v1) v4 = v3 % v2 if v4 == 0: return 0 v5 = {0: -1} ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str) -> str: if v1 == '': return self._cr_config['credentials'][v2] return self._cr_config[v1]['credentials'][v2] ```
Imports: ```python from tensorflow.compiler.xla import xla_data_pb2 from tensorflow.compiler.xla.experimental.xla_sharding import xla_sharding import typing ``` Type definitions: Input Types: tf.Variable Output Type: tf.Variable Dependencies: Function Name: v0 Function: ```python def v0(self, v1: tf.Variable) -> tf.V...
Imports: ```python import json from http import HTTPStatus from json import JSONDecodeError import typing ``` Type definitions: Input Types: Response Output Type: Any Dependencies: ```python def v0(v1: str): try: v2 = json.loads(v1) if isinstance(v2, dict) and 'detail' in v2: return v2[...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: Union[pd.Series, ndarray, list[ndarray]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.DataFrame) -> Union[pd.Series, ndarray, list[ndarray]]: assert self.estimatorPool is no...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: if self.display.nrql: v1 = f' {self.display.nrql}' else: v1 = '' if self.condition: v2 = f' WHERE {self.condition.nrql}' ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, *v1: Any, **v2: Any) -> Any: v1 = self._input_to_device(v1) v2 = self._input_to_device(v2) return self.module(*v1, **v2) ```
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('_Member', bound=Optional['IntegrityBase']) ``` Input Types: v0, str Output Type: None Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0, v3: str) -> None: v4 = False for v5 in self.manifest['entries']: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, Tuple[int, int] Output Type: Any Dependencies: ```python def v0(v1: np.ndarray): (v2, v3, v4, v5) = [i[:, 0] for v6 in np.split(v1, [1, 2, 3], axis=1)] v7 = [v2 - 0.5 * v4, v3 - 0.5 * v5, v2 + 0.5 * v4, v3 + 0.5 ...
Imports: ```python from tqdm import tqdm import typing ``` Type definitions: Input Types: str, Optional[dict], Optional[dict], str, Optional[Callable], int, bool, str, bool Output Type: list[dict] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Optional[dict]=None, v3: Optional[dict]=Non...
Imports: ```python import typing ``` Type definitions: Input Types: 'List[int]', 'Optional[str]' Output Type: bool Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: 'List[int]', v2: 'Optional[str]'=None) -> bool: if not self.check_connection(): return False if not v1: ...
Imports: ```python import typing ``` Type definitions: Input Types: str, List[str], str, str, int, Sequence[str], bool Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: List[str], v3: str, v4: str, v5: int, v6: Sequence[str], v7: bool) -> str: v1 += self._add_comments(...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str]) -> List[str]: v2 = [] for v3 in v1: if v3.endswith('.so'): v3 = v3[:-3] if v3.startswith('lib'): ...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.DataFrame) -> pd.DataFrame: v2 = v1.drop(list(self.columns), axis='columns', errors='ignore').copy() for v3 in self.columns: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Tuple[Dataset, Dataset] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Tuple[Dataset, Dataset]: (v1, v2) = super().pre_process_data() if 'agent_position' in self.config['data_features']: v1.subsets[0...
Imports: ```python import numpy as np from numpy.random import choice import typing ``` Type definitions: Input Types: Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: int=None): if v2 is None: v2 = self.batch_size v3 = self.data v4 = self.starts[v...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[Type] Output Type: Optional[Tuple] Dependencies: Function Name: v0 Function: ```python def v0(v1: Optional[Type]) -> Optional[Tuple]: if v1 and hasattr(v1, '__args__'): return v1.__args__ return None ```
Imports: ```python import re import requests import typing ``` Type definitions: Input Types: str Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> dict: v2 = {} v3 = {'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,applic...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str='.'): for v2 in self.timeseries_metric.keys(): self.timeseries_metric[v2]['TimeStamps'] = self.timestamps self.export(self.metric, exportpat...
Imports: ```python import re import typing ``` Type definitions: Input Types: Sequence[str], str, str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: Sequence[str], v2: str, v3: str) -> bool: if v3 == '^$': return True (v4, v5) = (re.compile(v2), re.compile(v3)) fo...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self: 'ContextElement', v1: int) -> int: for (v2, v3) in self._dilatations[::-1]: if v2 <= v1: v1 -= v3 return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any) -> Any: v2 = v1 for (v3, v4) in enumerate(self): if v4.__class__.__name__ == 'ModulePointer': v2 = v4.forward(x=v2)[0] ...
Imports: ```python import base64 import logging from base64 import b64encode from urllib.parse import urlencode, quote import typing ``` Type definitions: Input Types: str Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Dict: v2 = {'key': self.key if self.key is not ...
Imports: ```python import copy import typing ``` Type definitions: Input Types: Dict[str, Any], Dict[str, Any] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, Any], v2: Dict[str, Any]): v1 = copy.deepcopy(v1) for (v3, v4) in v2.items(): v5 = v3.split('.') ...
Imports: ```python import typing ``` Type definitions: Input Types: float, Sequence[int] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: Sequence[int]) -> str: v3 = 'parts' if v1 > 90.0: v3 = 'lost' elif v1 < 50.0: if v2[0] / len(v2) < 0.3: ...
Imports: ```python import random import typing ``` Type definitions: Input Types: str, List[float] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: List[float]) -> str: v3 = random.randint(0, 3) if v2 is None or len(v2) != 4: v2 = self.alphas v4 = self...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = '' for v3 in range(len(v1)): if v3 == 0: v2 += v1[v3].upper() elif v1[v3 - 1] in [' ', '-']: v2 += v...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str): assert v1 await self._ensure_subscribed('trade', v1) return self.data[v1]['trade'] ```
Imports: ```python import typing ``` Type definitions: Input Types: np.array, int Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.array, v2: int) -> dict: v3 = {} v4 = v1.shape[1] / v2 v5 = {1: 1, 2: 3, 4: 5} for v6 in v5: (v7, v8, v9) = (v1 == v6).non...
Imports: ```python import math from statistics import mean, harmonic_mean import typing ``` Type definitions: Input Types: ty.Sequence[ty.Set], ty.Sequence[ty.Set] Output Type: ty.Tuple[float, float, float] Dependencies: Function Name: v0 Function: ```python def v0(v1: ty.Sequence[ty.Set], v2: ty.Sequence[ty.Set]) ->...
Imports: ```python import typing ``` Type definitions: Input Types: float, float Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: float) -> float: v3 = v1 * v2 + (1 - v1) * (1 - v2) / 3 return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: with self._lock: self.is_disposed = True self.singles = [] self.exception = None self._value = (False, None) ```
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: pd.DataFrame, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: int): v3 = pd.DataFrame(v1['outputs'].tolist(), columns=[f'output{i}' for v4 in range(v2)]) v1 = pd.concat...
Imports: ```python import numpy as np from numpy import dot from numpy.linalg import norm import typing ``` Type definitions: Input Types: Any, Any Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> float: v3 = dot(v1, v2) / (norm(v1) * norm(v2)) return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: List[torch.Tensor], Any Output Type: Tuple[torch.Tensor, torch.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[torch.Tensor], v2) -> Tuple[torch.Tensor, torch.Tensor]: v3 = self.evaluator_1(*v1) v4 = self.eva...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1: 'ColumnAccessor' v2: Optional[cudf.core.index.BaseIndex] v3: Optional[List] def __init__(self, v4=None, v5=None): if v4 is None: v4 = {} self._data = cudf.core.column_accessor.ColumnAccessor(v4) ...
Imports: ```python import inspect import typing ``` Type definitions: Input Types: typing.Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: typing.Any) -> bool: v2 = getattr(v1, '__aiter__', None) return inspect.isfunction(v2) or inspect.ismethod(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: str, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: bool): v3 = self._instance.media_new_location(v1) if v2 else self._instance.media_new_path(v1) self._player.set_media(v3) v3.release(...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.set_falling_piece() v1 = self.playfield.clear_full_lines() if v1 > 0: self.raise_on_lines_cleared_event(v1) self.get_next_piece_...
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int) -> Dict: v3 = self._raw_jira.sprint_info(v1, v2) return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: str, int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int) -> str: while len(v1) > v2: v3 = [] for v4 in range(0, len(v1), v2): v5 = 0 for v6 in range(v4, m...
Imports: ```python import typing ``` Type definitions: Input Types: int, bool Output Type: Optional[chess.Move] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: bool) -> Optional[chess.Move]: v3 = -9999 v4: Optional[chess.Move] = None for v5 in self.board.legal_moves: ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=-1) -> int: if v1 == -1: return super().get_id() else: self._used.add(v1) return v1 ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray): v2 = np.float64 v3 = np.array(np.append(v1, np.fliplr(v1), axis=1), v2) v3 = np.array(np.append(v3, np.flipud(v3), ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3) -> float: v4 = v1[v1[v2] == v3] return len(v4.index) / len(v1.index) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Union[None, Iterable[int]] Output Type: Optional[Tuple[float, float, float, float]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[None, Iterable[int]]=None) -> Optional[Tuple[float, float, float, float]...
Imports: ```python import typing ``` Type definitions: Input Types: int, dict Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: int, v2: dict): self.add_next(v1, v2) await self.play(ignore_shuffle=True) ```
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor: v3 = self.class_weights[v2].to(v2.device) v4 = v1 * v3 return v4 ``...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: v1 = self.inner_widget.hex.get_selection() if v1 is None: return 0 (v2, v3) = v1 v4 = v3 - v2 + 1 return v4 ```
Imports: ```python import typing ``` Type definitions: Input Types: 'QGraphicsSceneHoverEvent' Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'QGraphicsSceneHoverEvent') -> None: self.hovered = False self.update() self.socket.socket_label.hide() ```
Imports: ```python import typing ``` Type definitions: Input Types: str, bool, Optional[str], bool, Optional[str] Output Type: str Dependencies: ```python @lru_cache() def v0(v1: str, v2: str=SINGULAR_NAME_SUFFIX) -> str: v3 = inflect_engine.singular_noun(v1) if v3 is False: v3 = f'{v1}{v2}' return...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, Dict[str, List[Union[float, str]]], Callable[[np.ndarray], np.ndarray], List[str], Dict[int, List[str]], Dict[int, Dict[str, float]], Dict[str, List[float]], List[str], Any Output Type: List[np.ndarray] Dependencies: Fu...
Imports: ```python import typing ``` Type definitions: Input Types: Dict, str Output Type: Dict Dependencies: ```python @requiresMcVersion(2529, 'Support for hexadecimal color values was added in 1.16 (20w17a)') def v0(v1: Dict, v2: str) -> Dict: if len(v2) != 7: raise ValueError(f'Required hexadecimal str...
Imports: ```python import typing ``` Type definitions: Input Types: List[Tuple[int]] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[Tuple[int]]=None): v2 = self._create_placeholders(v1) v3 = [self._self] + v2 if self.is_method else v2 self._build(v3) ```
Imports: ```python from datetime import datetime, timedelta import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = datetime.now() return '_'.join([v1, str(v2.minute), str(v2.second)]) ```
Imports: ```python import typing ``` Type definitions: Input Types: str, int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int) -> str: if v2 >= len(v1): return '0' if '0' in v1: v3 = v1.index('0') if v2 >= v3: return self.re...
Imports: ```python import os import shlex import stat from pathlib import Path import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0(v1: str, *v2) -> plumbum.commands.BaseCommand: def v3(v4) -> bool: return command_path.is_file() and bool(stat.S_IMODE(v4.stat()...
Imports: ```python import re import typing ``` Type definitions: Input Types: List[Dict[str, Any]], Optional[float] Output Type: str Dependencies: ```python def v0(v1: List[Dict[str, Any]]) -> Tuple[float, float, float]: v2: List[float] = [] for (v3, v4) in enumerate(v1): v5 = v4['index'] v6 = ...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[dict] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[dict]=None): if self.log_metrics: v1 = v1 or {} v2 = v1.get('gp_model', None) self.our_step = self.model.n_evals...
Imports: ```python import asyncio import cv2 import typing ``` Type definitions: Input Types: Output Type: Optional[str] Dependencies: ```python async def v0() -> Optional[str]: v1 = _start_camera() v2 = (640, 480) v3 = None v4 = None v5 = 'Signature Request QR Code Scanner' cv2.namedWindow(v5...
Imports: ```python from pathlib import Path import pandas as pd import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.DataFrame) -> None: v2 = Path(self._get_save_path(self._filepath, self._version)) v2.parent.mk...
Imports: ```python import os import typing ``` Type definitions: Input Types: str, Any Output Type: List[str] Dependencies: ```python def v0(v1: str) -> List[str]: v2 = [] for v3 in os.listdir(v1): v4 = os.fsdecode(v3) if v4.endswith(cts.MD_EXT) or v4.endswith(cts.TXT_EXT): v2.appen...
Imports: ```python import typing ``` Type definitions: Input Types: Callable[..., Any] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Callable[..., Any]) -> None: v2 = [((self.table.key, self.key), False), ((self.table.key, self.name), True)] for (v3, v4) in v2: ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str, dict, bool, list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: str='mean', v4: dict={}, v5: bool=False, v6: list=['organ', 'model_type']): v7 = [] v8 = [] for (v9, v...
Imports: ```python import random import typing ``` Type definitions: Input Types: List[int], int, int, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: int, v3: int, v4: int) -> int: if v2 == v3: return v1[v2] v5 = random.randint(v2, v3) v5 =...
Imports: ```python from PIL import Image import typing ``` Type definitions: Input Types: List[str], List[Tuple[int, int]] Output Type: List[Tuple[str, str]] Dependencies: ```python def v0(v1): try: if v1 == (1920, 1080): return 'Desktop' elif v1 == (1080, 1920): return 'Mob...
Imports: ```python from collections import OrderedDict import typing ``` Type definitions: Input Types: OrderedDict, OrderedDict Output Type: Tuple[OrderedDict, OrderedDict] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: OrderedDict, v2: OrderedDict) -> Tuple[OrderedDict, OrderedDict]: v3 = ...
Imports: ```python import typing ``` Type definitions: Input Types: float, float Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float) -> None: if v2 > 0: self.zoom /= 1.5 else: self.zoom *= 1.5 self.zoom = max(0.0025, min(1, self.zoom)) ...
Imports: ```python import torch from torch import nn from torch.nn.utils import rnn import typing ``` Type definitions: Input Types: torch.LongTensor, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.LongTensor, v2: int): v3 = torch.arange(v2, device=self.device) ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str) -> None: await self.clear_temporaries(v1) await super().remove_sid(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: tuple, tuple Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: tuple, v2: tuple) -> list: (v3, v4, v5, v6, v7, v8, v9, v10) = v1[:8] (v11, v12, v13, v14, v15, v16, v17, v18) = v2 v19 = v11 - v12 / v16 - v12 ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: if v1[len(v1) - 1] != '.': return v1[0].upper() + v1[1:] + '.' return v1[0].upper() + v1[1:] ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self) -> np.ndarray: if self.__eigsolcalled: (v1, v2) = self.__eig_solver.getSolution() else: v1 = None return v1 ```
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1=0, v2=0, v3=0, v4=0, v5=0): self.pos = v1 if v2 == 2 or v3 == 2: v2 -= 1 v3 -= 1 self.hap = v2 self.hap1 = v3 self.ps = v4 self.idx = v5 def ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> list: if v1 in self.pred_dict: return self.pred_dict[v1] return [] ```
Imports: ```python import typing ``` Type definitions: ```python class v0(BaseClient): def __init__(self, v1: str, v2: str, v3: str, v4: str, v5: bool, v6: bool): super().__init__(base_url=v2, verify=v5) self._username = v3 self._password = v4 self._tenant = v1 self._proxies...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list): v2 = {} for v3 in v1: v4 = v3.get('code', 0) if v4 == -4004: v3['value'] = None elif v4 != 0: co...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Any], str, Optional[bool] Output Type: str Dependencies: ```python def v0(v1: Dict[str, Any], v2: str, v3: Optional[bool]=False) -> str: v2 += ' on' return get_pull_request_event_message(get_user_username(v1), v2, v1['pullrequest']['...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: List[dict] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> List[dict]: v2 = [] try: v3 = int(v1) except ValueError: v3 = 3 for v4 in range(v3): v2.append({'name': f'comma...
Imports: ```python import typing ``` Type definitions: ```python v0 = List[Inch] ``` Input Types: str Output Type: v0 Dependencies: ```python def v1(v2: str) -> Dict[str, int]: v3 = pattern.match(v2) if not v3: raise ValueError(f"Could not parse '{v2}'") return {'x': int(v3.group('x')), 'y': int(v3....
Imports: ```python import typing ``` Type definitions: Input Types: Union[int, float] Output Type: NoReturn Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[int, float]) -> NoReturn: if self.floating_action_button: self.floating_action_button.text = self.action_text_button ```
Imports: ```python import typing ``` Type definitions: Input Types: Union[Dict[str, Union[float, np.ndarray]], List, Tuple, np.ndarray] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[Dict[str, Union[float, np.ndarray]], List, Tuple, np.ndarray]=None): if v1 is None: ...
Imports: ```python from pathlib import Path import typing ``` Type definitions: Input Types: tp.Optional[Path], bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: tp.Optional[Path]=None, v2: bool=False) -> None: v3 = self.format_filetypes.get(self.format, 'txt') if v1 ...
Imports: ```python from torch.optim import Optimizer import typing ``` Type definitions: Input Types: Union[Type[Optimizer], Tuple[Type[Optimizer], ...]], str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[Type[Optimizer], Tuple[Type[Optimizer], ...]], v2: str='optim...
Imports: ```python import typing ``` Type definitions: Input Types: KoiParser.LineContext Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: KoiParser.LineContext): self.file_contents.append(self.current_line) self.current_line = [] ```
Imports: ```python import typing ``` Type definitions: Input Types: Callable[..., None] Output Type: 'BasePopulation' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Callable[..., None], **v2) -> 'BasePopulation': self.evaluate(lazy=True) v1(self, **v2) return self ```
Imports: ```python from PIL import Image import numpy as np import sys import os import typing ``` Type definitions: Input Types: pathlib.Path Output Type: Any Dependencies: ```python def v0(v1: np.ndarray, v2: str, v3: np.ndarray, v4: str, v5=np.mean): if len(v2) == len(v4): for (v6, v7) in zip(v2, v4): ...
Imports: ```python import typing ``` Type definitions: ```python v0 = Union[int, slice, Indices1D, Indices2D] ``` Input Types: Dict[str, Any], v0 Output Type: Any Dependencies: Function Name: v1 Function: ```python def v1(self, v2: Dict[str, Any], v3: v0): if not self.isnull: self._assert_keys_exist(v2.key...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.doc.objects for (v2, v3) in self.items(): v1.delete_entity(v3) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Union[List[Any], np.ndarray], int, Any Output Type: Union[List[Any], np.ndarray] Dependencies: ```python def v0(v1: List[Any], v2: int, v3: List[Any]) -> List[Any]: v1 = v1[:v2] while len(v1) < v2: v1.append(v3) ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.request_type == 'shell': self.write('# ') elif self.request_type == 'exec': assert self.chan is not None self.chan.cl...
Imports: ```python import typing ``` Type definitions: Input Types: list, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2: str): with open(v2, 'w') as v3: print('Writing solution file ' + v2 + '...') for v4 in v1: v3.write(f'{v4[0]} {v4[1]}\...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.g_service.startThread() self.gui.quit() ```
Imports: ```python from scipy.io import wavfile from scipy.fft import fft, fftfreq from scipy.stats.mstats import gmean import numpy as np import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self) -> float: v1 = gmean(self.fft) v2 = n...
Imports: ```python import warnings import numpy as np import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self) -> float: warnings.filterwarnings('ignore', category=RuntimeWarning) v1 = self.true * np.log2(2 * self.true / (self.true +...
Imports: ```python from collections import defaultdict import typing ``` Type definitions: Input Types: str, Any, Optional[str], int Output Type: dict Dependencies: ```python def v0(v1: str, v2: int=4, v3: bool=False) -> Tuple[int, dict]: v4 = v1.split() v5 = defaultdict(int) for v6 in range(1, v2 + 1): ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=600) -> None: v2 = 'yes | petalinux-config' if 'plnx_config_component' in self.config: v2 += f" -c {self.config['plnx_config_component']}" ...
Imports: ```python import torch import typing ``` Type definitions: Input Types: Any, Any Output Type: Tuple[torch.Tensor, float, torch.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2='bilinear') -> Tuple[torch.Tensor, float, torch.Tensor]: (v3, v4) = (self.image_height, self.image...
Imports: ```python import numpy as np import os from tqdm import tqdm import math import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any, Any, Any, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4, v5, v6, v7, v8: bool=False): v9 = 0 v10 = 0 ...
Imports: ```python import typing ``` Type definitions: Input Types: th.Tensor, th.Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: th.Tensor, v2: th.Tensor): (v3, v4) = self.forward(v1, v2, self.action_dist_num) v2 = v3.mean(dim=1) return v2 ```