text
stringlengths
190
325k
Imports: ```python import cv2 import numpy as np import torch from torch import nn from torch.nn import functional as F from torch.nn.parallel import DataParallel from torch.optim.lr_scheduler import ReduceLROnPlateau from torch.serialization import load, save from torch.utils.data import DataLoader import typing ``` T...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = {} v3 = '' v4 = 0 for v5 in range(len(v1)): v6 = v1[v5] if v6 in v2: v4 = max(v2.get(v6) + 1, v4) ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = '' if self.connected: v1 = self.ser.readline().decode() return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int]) -> bool: v2: int = 1 v3 = len(v1) while v2 < v3 and v1[v2] > v1[v2 - 1]: v2 += 1 if v2 == 1 or v2 == v3: retur...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, List[str], str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str=None, v3: List[str]=None, v4: str=None) -> str: v5 = {'mutation($input: register_agent_input!)': {'register_agent(input: $...
Imports: ```python from bisect import bisect_left import typing ``` Type definitions: Input Types: List[Tensor], List[float] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[Tensor], v2: List[float]) -> int: v3 = len(v1) v4 = [x[0] for v5 in sorted(enumerate(v2), reve...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> str: if not v1.startswith('/'): print('incorrectly formatted href' + v1) exit() for v3 in v2: if 'href' in v3: ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> bool: v3 = {'accepted': 0, 'queued': 1, 'sent': 2, 'delivered': 3, 'undelivered': 3, 'failed': 3, 'received': 3} return v3[v1.low...
Imports: ```python from typing import Any, Tuple, TypeVar, Union, Hashable, Sized, _SpecialForm, Generic import typing ``` Type definitions: Input Types: Tuple[str, ...] Output Type: Any Dependencies: ```python def v0(v1: Any, v2: Any) -> bool: if v2.__origin__ != v1.__origin__: return False if tuple((...
Imports: ```python import typing ``` Type definitions: Input Types: list, int Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list, v2: int) -> list: self._backtrack(v1, v2, []) return self.res ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Callable[[], 'sqlutil.Database'] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Callable[[], 'sqlutil.Database']: if not v1: raise TypeError('Path flag must be set') return lambda : self....
Imports: ```python from importlib import util import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: ```python def v0(v1: str) -> typing.Optional[typing.Any]: v2 = util.find_spec('Automation') if v2 is None and (not _showedWarning): print('Failed to build mod distribution i...
Imports: ```python import typing ``` Type definitions: Input Types: 'cirq.ActOnDensityMatrixArgs' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'cirq.ActOnDensityMatrixArgs'): v1.target_tensor = self.target_tensor.copy() v1.available_buffer = [b.copy() for v2 in self.av...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.close_task is None: self.close_task = self.get_loop().create_task(self._close()) ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: 'CallTransactionBuilder' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> 'CallTransactionBuilder': self._params = v1 return self ```
Imports: ```python import typing ``` Type definitions: Input Types: keras.Model, np.ndarray, str, bool, int Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: keras.Model, v2: np.ndarray, v3: str, v4: bool=True, v5: int=1) -> np.ndarray: v6: np.ndarray = v1.predict(x=v2, verbos...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int): if v1 <= 1998 and v1 >= 0: v2 = '8' for v3 in range(v1): v2 += '=' v2 += 'D' return v2 elif v1 >= -1998 and ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._print_file_syntax_results() self._print_imports_results() self._print_schema_results() self._print_layouts_results() self._print_fe...
Imports: ```python import typing ``` Type definitions: Input Types: str, Dict[str, float] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Dict[str, float]) -> None: v3 = self._get_nexthop_mac() if v3 and v3 in v2: self._update_metrics(v1, v2[v3], 'nextho...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> bool: v2 = self.field(v1) if v2 is not None: return v2.generated raise Exception('Field %s not found!' % v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1) -> str: v2 = None try: v3 = v1.get('rn').split('/')[3].split('[')[1].strip(']') v4 = v1.get('rn').split('/')[2].strip('protpaths-') v5...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: List[float], bool Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: List[float], v2: bool=False) -> int: v3 = min(v1) if v2 else max(v1) v4 = [index for (v5, v6) in enumerate(v1) if v6 == v3] ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, Optional[bool] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: Optional[bool]=False): if v2 not in self.VALID_EMPHASIS_LEVELS: raise ValueError('The level provided to empha...
Imports: ```python import hashlib from binascii import unhexlify import typing ``` Type definitions: Input Types: dict Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> str: v2 = self.get_transaction_hex(v1, remove_sigs=True) v3 = hashlib.sha256() v3.update(unh...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> str: v2 = self.__get_pl_by_id(v1) if v2 >= 0: self.__data.pop(v2) return 'Playlist deleted' return 'No playlist found' ```
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: str, v2: str, v3: str, v4: str, v5: str, *, v6: int=25, v7: int=5): self.sleep_time = v7 self.retries = v6 self.stack_name = v1 self.rancher_url = v3 self.service_name = v2 ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> float: v2: float = 3.0 v3: int = 1 for v4 in range(2, v1, 2): v2 += v3 * 4 / (v4 * (v4 + 1) * (v4 + 2)) v3 = v3 * -1 return ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1) -> pd.DataFrame: v2 = v1.pivot(index='userId', columns='movieId', values='rating') v2[~v2.isna()] = 1 v2.fillna(0, inplace=True) return v2 ``...
Imports: ```python import typing ``` Type definitions: ```python v0 = NewType('Graph', DefaultDict[Node, Set[Node]]) ``` Input Types: v0, str Output Type: None Dependencies: ```python def v1(v2: v0) -> str: v3 = ['digraph {'] for (v4, v5) in v2.items(): v4 = str(v4).replace('-', '_') if not v5: ...
Imports: ```python from typing import List, cast import torch from torch import Tensor, einsum from typing import Any, Callable, Iterable, List, Set, Tuple, TypeVar, Union, cast import typing ``` Type definitions: Input Types: Tensor, int Output Type: Tensor Dependencies: ```python def v0(v1: Tensor, v2=1) -> bool: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: with self.assertRaisesRegexp(NotImplementedError, 'Subclasses of DeviceSystemContext should implement domain validation.'): self.device_system_co...
Imports: ```python import typing ``` Type definitions: ```python v0 = namedtuple('Option', ['option', 'settingName']) ``` Input Types: List[v0] Output Type: Any Dependencies: Function Name: v1 Function: ```python def v1(self, v2: List[v0]): self.options.extend([o.option for v3 in v2]) self._setSchema(self._cus...
Imports: ```python import gzip import os import typing ``` Type definitions: Input Types: str, bool Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: bool=True) -> str: (v3, v4) = list(os.path.split(v1)) v5 = '.pkl' if not v2 else '.pkl.gz' v6 = 'partial-' + v4.repla...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[str] Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self, *v2: str, v1: Optional[str]=None) -> Optional[str]: for v3 in v2: v4 = self.get(v3) if v4 is not None: return v4...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: Structure Output Type: pd.DataFrame Dependencies: ```python def v0(v1: Structure) -> pd.DataFrame: v2 = v1.id.upper() v3 = {} for v4 in v1: for v5 in v4: v6 = v5.id v7 = f'{v2}:{v4.id}:{v...
Imports: ```python import typing ``` Type definitions: Input Types: float, float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float): self.windDataCounter -= 1 self.windSpeed = v1 self.windDirection = v2 self.windDataSpeed.append(v1) self.windDat...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str): async with self._client.get(self._make_url('/api/v3/ticker/24hr'), params={'symbol': v1}) as v2: return await v2.json() ```
Imports: ```python import torch from torch import nn import typing ``` Type definitions: Input Types: torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor) -> torch.Tensor: (v2, v3, v4) = self.to_qkv(v1).unbind(0) v5 = torch.einsum('... i d, ...
Imports: ```python import tensorflow as tf from tensorflow.python.keras.utils import tf_utils import typing ``` Type definitions: Input Types: int, Dict Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: Dict) -> None: tf.keras.callbacks.TensorBoard.on_epoch_end(self, ...
Imports: ```python import cv2 from scipy import signal import typing ``` Type definitions: Input Types: Any, Any Output Type: np.array Dependencies: Function Name: v0 Function: ```python def v0(v1, v2=0) -> np.array: v3 = signal.gaussian(v1, v1 // 3).reshape(1, v1) v3 = v3 * v3.transpose() v4 = cv2.getRot...
Imports: ```python import typing ``` Type definitions: Input Types: 'Vm' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'Vm'): for v2 in self.vms.values(): if v1 in v2: v2.remove(v1) self.vms[v1.app].append(v1) ```
Imports: ```python from matplotlib import pyplot as plt import pandas as pd from statsmodels.tsa.arima.model import ARIMA import typing ``` Type definitions: Input Types: str, int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int) -> None: v3 = 0 if type(v2) n...
Imports: ```python import typing ``` Type definitions: Input Types: int, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: str) -> str: v3 = len(v2) v4 = [''] * v3 for v5 in range(v3): v4[v5] = v2[v5 * v1 % len(v4)] return str.join('', v4) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.verify_exists_vm_size('westus2', 'Standard_D8a_v3', True) assert self._platform._locations_data_cache v1 = self._platform._get_location_key(...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, int, int, int Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: int, v3: int, v4: int) -> np.ndarray: if v2 * v3 != v1.shape[0]: raise ValueError("Sizes o...
Imports: ```python import typing ``` Type definitions: Input Types: Union[Dict[Text, Any], List[Any]] Output Type: List[Any] Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[Dict[Text, Any], List[Any]]) -> List[Any]: if isinstance(v1, list): return v1 elif isinstance(v1, dict): ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any, Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1=0.0, v2=0.0, v3=0.0, v4=0.0, v5=1.0, *, v6=None) -> None: if v6 is not None: v6 = tuple(v6) self.mglo.clear(v1, v2, v3,...
Imports: ```python import pandas as pd import numpy as np import typing ``` Type definitions: Input Types: int, Tuple, Tuple, int, int Output Type: pd.DataFrame Dependencies: ```python def v0(v1): v2 = v1.strftime('%Y-%m') v3 = str(np.random.randint(1, v1.daysinmonth)) return f'{v2}-{v3.zfill(2)}' ``` Func...
Imports: ```python import os import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if os.path.exists(self.expected_file) and os.path.isfile(self.expected_file): os.remove(self.expected_file) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict[str, Any]: self.assert_connected() self.update(new_tasks=False, allow_shutdown=False) v1 = self._payload_template() v1['data']['oper...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> list: try: v2 = self._ulog.get_dataset(v1).data except: print('InAirDetector: {:s} not found in log.'.format(v1))...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: argparse.Namespace): self.options = v1 self.collected_logs = [] self.collected_failures = [] self.fail_count = 0 self.expectedfail_count = 0 self.unexpectedpass_count = ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str, list, dict, dict, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: str=None, v4: list=None, v5: dict=None, v6: dict=None, v7: bool=False): v8 = (v6 or {}).copy() v8['p...
Imports: ```python import typing ``` Type definitions: Input Types: int, np.ndarray, int, float, bool, float, List[np.ndarray], bool Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: np.ndarray, v3: int, v4: float, v5: bool, v6: float=None, v7: List[np.ndarray]=None, v8: b...
Imports: ```python import numpy as np from sklearn.cluster import DBSCAN import typing ``` Type definitions: Input Types: Any, Any, Any, Any Output Type: (np.array, np.dtype, list) Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4=1.5) -> (np.array, np.dtype, list): if v1.size == 0: ...
Imports: ```python import json import os from pathlib import Path from tqdm import tqdm import numpy as np import cv2 import typing ``` Type definitions: Input Types: Path, Path, Tuple[int, int], Any Output Type: Any Dependencies: ```python def v0(v1: Path, v2: int): with open(v1, 'r') as v3: v4 = v2 / 2 ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict[str, Dict[str, str]] Dependencies: Function Name: v0 Function: ```python def v0() -> Dict[str, Dict[str, str]]: v1 = {} v1['name'] = '工藝材料' v1['id'] = 'craft-materials' v2 = {} v2['craft-materials'] = '工藝材料' ...
Imports: ```python import typing ``` Type definitions: Input Types: List, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List, v2: int): self.nodes.extend(v1) self.importance = max(self.importance, v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: 'Collection[Party]' Dependencies: Function Name: v0 Function: ```python def v0(self) -> 'Collection[Party]': with self._lock: return list(self._party_impls) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, Any Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2) -> float: v3 = self._get_costs(v1, v2) assert v3 >= 0.0 assert type(v3) == float or type(v3) == np.float64, type(v3) ...
Imports: ```python import typing ``` Type definitions: Input Types: List Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List): v2 = 'member' v3 = 'member.json' v4 = {'users': v1} self.save_dict(v4, f'{v2}/{v3}') return ```
Imports: ```python import numpy as _np import typing ``` Type definitions: ```python v0 = _ty.TypeVar('_Arr') ``` ```python v1 = _ty.Callable[..., v0] ``` ```python v2 = _ty.Callable[..., _np.ndarray] ``` Input Types: v2, v1[v0] Output Type: v1[v0] Dependencies: Function Name: v3 Function: ```python def v3(self, v4: v...
Imports: ```python import os import ctypes import typing ``` Type definitions: Input Types: os.PathLike Output Type: bytes Dependencies: ```python def v0(v1: os.PathLike) -> str: v1 = os.fspath(v1) v2 = ctypes.windll.kernel32.GetShortPathNameW(v1, None, 0) v3 = ctypes.create_unicode_buffer(v2 + 1) ctyp...
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: bytearray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int]) -> bytearray: v2 = bytearray() for v3 in v1: v4 = bytes(self.get_colour(v3)) v2.append(v4[0]) v2.append(v...
Imports: ```python import typing ``` Type definitions: Input Types: str, int, int, bool Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int=48, v3: int=1, v4: bool=False) -> dict: v5 = self._preprocess_audio(v1) return self._model.predict(audio_path=v1, signal=v...
Imports: ```python import typing ``` Type definitions: ```python class v0(NamedTuple): v1: float v2: float ``` Input Types: Optional[v0], Optional[v0] Output Type: Any Dependencies: Function Name: v3 Function: ```python def v3(self, v4: Optional[v0]=None, v5: Optional[v0]=None): if v4: self.beam_px...
Imports: ```python from pathlib import Path import typing ``` Type definitions: Input Types: Any, str | Path, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any, v2: str | Path, v3: bool=True, **v4): v2 = Path(v2) if not isinstance(v1, self.dtypes): raise Ty...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any, Any Output Type: bool Dependencies: ```python @lru_cache() @wrap_norm_prefix def v0(v1: str, *, v2: Tuple[RelationHint, ...], v3: Tuple[str, ...], v4: bool, v5: bool, v6: bool, v7: bool=False) -> nx.DiGraph: v8 = nx.DiGraph() v9...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool) -> None: if v1: self.__write('OUT 1') else: self.__write('OUT 0') return ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): if 'kind' in v1: v2: str = v1['kind'] if v2.endswith('List'): v3 = v2[:-4] for v4 in v1['items']: ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: list[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> list[str]: if self.fiducial_marks is None: raise ValueError('No fiducial marks available.') v2: dict[str, str] = {mark.filename: m...
Imports: ```python import typing ``` Type definitions: Input Types: dict, list Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: dict, v2: list) -> list: v3 = [] for v4 in v2: v3.append({'Id': v4['Id'], 'TargetType': v1[v4['Id']], 'Data': v4['Data']}) return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Tuple[int, int] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> Tuple[int, int]: v2 = v1.split('..') if len(v2) == 1: return (int(v2[0]), int(v2[0])) elif len(v2) == 2: return (int(v...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Tuple[str, str] Dependencies: ```python def v0(): try: with open(CACHED_GPS_COORD_FILE_PATH) as v1: v2 = v1.readlines() if len(v2) != 2: logger.warning('Expected to find 2 lines in GPS ...
Imports: ```python import typing ``` Type definitions: Input Types: 'ExchangeBase' Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'ExchangeBase') -> Optional[str]: if self.position_close: v2 = None else: v2 = self._get_collateral_token(v1) r...
Imports: ```python from urllib.parse import quote_plus import typing ``` Type definitions: Input Types: str, str, bool Output Type: Union[List, Dict] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str=None, v3: bool=None) -> Union[List, Dict]: v4 = {'include_deleted': v3, 'timestamp...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.object_path = '' self.object_signature = None self.object_type = None ```
Imports: ```python import os import platform from subprocess import check_output, CalledProcessError, STDOUT import typing ``` Type definitions: Input Types: Any Output Type: str Dependencies: ```python def v0() -> str: v1 = platform.system() if v1 == 'Windows': if get_java_architecture() == '32bit': ...
Imports: ```python from datetime import date, datetime, timedelta from polars.utils import _timedelta_to_pl_duration from polars import internals as pli from polars.datatypes import DataType, Date, Datetime, Float64, Int32, Object, UInt32, py_type_to_dtype import typing ``` Type definitions: ```python class v0: de...
Imports: ```python import uuid import typing ``` Type definitions: Input Types: Iterable, int, bool Output Type: Any Dependencies: ```python def v0(v1: 'Session', v2: str, v3: str, v4: int, v5=True, v6=False): if isinstance(v3, int): raise ValueError(f'{v3} {v2}') v7 = '.'.join([v3, v2]) if _get_fr...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if self.host in v1 and v1.startswith('http'): return v1 if not v1.startswith('/'): v1 = '/' + v1 v2 = 'https' if self._use_htt...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Any], Dict[str, Any], int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, Any], v2: Dict[str, Any], v3: int) -> None: self.log_scalars({k: v for (v4, v5) in v1.items() if isinstance(v5, (...
Imports: ```python import typing ``` Type definitions: ```python @dataclass(repr=False) class v0(Generic[_T]): v1 = ('value', 'size') v2: _T v3: int def __repr__(self) -> str: return repr(self.value) ``` ```python v4 = TypeVar('_T') ``` Input Types: Hashable Output Type: v0[v4] | None Dependenc...
Imports: ```python import typing ``` Type definitions: Input Types: float, float Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float=1) -> float: v3 = self.average * self.n_items + v1 * v2 self.n_items = self.n_items + v2 self.average = v3 / self.n_item...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, Any, list, int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3: list, v4: int=100000, v5=None): v6 = 0.001 v7 = v3.__len__() v8 = np.eye(v7) for v9 in range(1, v4): ...
Imports: ```python import typing ``` Type definitions: ```python v0 = NewType('HawaiianWord', str) ``` Input Types: v0, int Output Type: str Dependencies: Function Name: v1 Function: ```python def v1(v2: v0, v3: int) -> str: v4 = {'h': 'h', 'k': 'k', 'l': 'l', 'm': 'm', 'n': 'n', 'p': 'p', "'": "'"}.get(v2[v3]) ...
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=-1, v2: int=1) -> None: (self._stage_rank, self._stage_world_size) = (v1, v2) self._run_event('on_stage_start') while self.stage_epoch_ste...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray, int, int, float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: np.ndarray, v3: int, v4: int, v5: float): v6 = v1[v4] - v1[v3] v7 = np.sqrt(v2[v3, v3] ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self) -> None: if self._async_unsub_dispatcher_connect: self._async_unsub_dispatcher_connect() self._async_unsub_dispatcher_connect = None sel...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self) -> np.ndarray: v1 = self._cfg.tau_initial if len(self._game) <= self._cfg.num_sampling_moves else self._cfg.tau_final v2 = self._N ** (1 / v1) if v2...
Imports: ```python import typing ``` Type definitions: Input Types: Any, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: bool=False): v3 = f'{v1.qualified_name} {v1.signature}' if any(v1.aliases): v3 += ' | Aliases: ' v3 += ', '.join((f'`{alias}`'...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict, **v2: typing.Any): assert self.resolver self.resolver.resolve_schema(v1) return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self) -> float: for v1 in self.__optimizer.param_groups: return v1['lr'] ```
Imports: ```python import typing ``` Type definitions: ```python v0 = Union[None, bool, ModuleType] ``` Input Types: Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1() -> v0: global _pyarrow_dataset if _pyarrow_dataset is None: try: from pyarrow import dataset as ...
Imports: ```python import typing ``` Type definitions: Input Types: List[str], str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str], v2: str) -> bool: for v3 in sorted(v1): v2 = v2.replace(v3, '') return len(v2) == 0 ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> None: for v2 in range(1, 11): print(f'{v1:2} x {v2:2}: {v1 * v2:2}') ```
Imports: ```python import os import tensorflow as tf import typing ``` Type definitions: Input Types: Any, int Output Type: Any Dependencies: ```python def v0(v1, v2, v3: str=''): nonlocal i for (v4, v5) in zip(v1, v2): if limit is None or limit == -1 or i < limit: tf.io.write_file(tf.const...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray) -> np.ndarray: v2 = v1.shape[0] v3 = self.num_obj v4 = np.zeros((v2, v3, v3)) return v4 ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> dict: if 'subjects' in v1: for v2 in v1['subjects']: if 'term' in v2: v2['term'] = self._replace_special_char...
Imports: ```python import typing ``` Type definitions: ```python class v0(namedtuple('_Coach', ['id', 'name', 'bio', 'available', 'birth_year', 'gender', 'languages', 'need', 'rights', 'housing'])): def v1(cls, *, v2: Optional[int]=None, v3: str, v4: str, v5: bool=True, v6: int, v7: str, v8: Dict[str, int], v9: Co...