text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1) -> int: v2 = v1.lower() if 'u18' in v2 or 'normal' in v2 or 'sport' in v2: return 0 return 1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: if self.top() is None: return None return self.stack[-1][1] ```
Imports: ```python import math import numpy as np import typing ``` Type definitions: Input Types: 'CLASSIFIER_TYPE', int, float, Optional[int], int, int, int, Callable[[], np.ndarray], Callable[[np.ndarray, int], np.ndarray] Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1:...
Imports: ```python from collections.abc import Iterable import typing ``` Type definitions: Input Types: bool Output Type: list[str] | list[list[str]] Dependencies: ```python def v0(v1): for v2 in v1: if isinstance(v2, Iterable) and (not isinstance(v2, str)): yield from v0(v2) elif ' ' ...
Imports: ```python import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import typing ``` Type definitions: Input Types: list, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list, v2=True): v3 = [] v4 = [] v5 = [] for v6 in v1: v7...
Imports: ```python import torch import torch.autograd.profiler as profiler import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, Any Output Type: Tuple[torch.Tensor, torch.Tensor, torch.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor, v2: torch.Tensor, ...
Imports: ```python import socket import typing ``` Type definitions: Input Types: Any, Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> None: v3 = socket.socket() v4 = v2.getaddr('ctrl', 'coord_addr') v3.connect((v4[0], v4[1])) v3.sendall(v1.command.encode('u...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str): v2 = await self.ledger.network.get_claims_for_name(v1) v3 = await self.resolve(*(f"{claim['name']}#{claim['claim_id']}" for v4 in v2['claims...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: None Dependencies: ```python def v0(v1): from IPython.display import Markdown, display display(Markdown(v1)) ``` Function Name: v2 Function: ```python def v2(v3: List[str]) -> None: v4 = '\n'.join((f'- `{line}`' for ...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: v0 Output Type: Set[Set[v0]] Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0) -> Set[Set[v0]]: v3 = frozenset((open_set for v4 in self.open_sets if v2 in v4)) return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str=None) -> str: v3 = self.get_attdef(v1) if v3 is None: return v2 return v3.dxf.text ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: v2 = 'SELECT tbl_name FROM ic_quranic_tbl_meta_data WHERE language=?' v3 = self._fetch_data(v2, [v1], 1) v4 = v3[0][0] return v4 ``...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self) -> None: v1 = [command.to_dict() for v2 in self._queued_global_application_commands.values() if not v2.__application_command_parent__] if not v1: ...
Imports: ```python import os from copy import deepcopy import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1 = deepcopy(self.all_keys) v1.update({i.lower(): k for (v2, v3) in os.environ.items() if v2.lower() in self.all...
Imports: ```python import typing ``` Type definitions: Input Types: list[int] Output Type: Union[None, tuple[int]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list[int]=None) -> Union[None, tuple[int]]: if v1 is None: return (self.window.frameGeometry().width(), self.window.frameG...
Imports: ```python import math from pathlib import Path import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import typing ``` Type definitions: Input Types: Union[str, List[str]], Union[str, List[str]], int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: List Dependencies: ```python def v0(v1: Dict) -> Dict: v2 = {'Name': v1['@name']} if 'description' in v1: v2['Description'] = v1['description'] if 'ip-netmask' in v1: v2['IP_Netmask'] = v1['ip-netmask'] ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.instrument.query('VOLT?') return float(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, str] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, str]): for (v2, v3) in v1.items(): with open(v2, 'w') as v4: v4.write(v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: logging.Logger Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: logging.Logger) -> None: for v2 in list(v1.handlers): v1.removeHandler(v2) v2.flush() v2.close() ```
Imports: ```python import pandas as pd import typing ``` Type definitions: ```python v0 = Union[Sequence[Any], Mapping[str, Any]] ``` Input Types: Union[str, sql.Composed], Optional[v0] Output Type: pd.DataFrame Dependencies: Function Name: v1 Function: ```python def v1(self, v2: Union[str, sql.Composed], v3: Optional...
Imports: ```python import typing ``` Type definitions: Input Types: List[Tensor], List[Tensor], List[Tensor], List[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Tensor], v2: List[Tensor], v3: List[Tensor], v4: List[str]) -> None: if len({len(v1), len(v2), len(v3), len(...
Imports: ```python import pandas as pd from pandas.errors import ParserError import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: self.logger.debug('%s: filter date range.', self.name) v2 = pd.Timestamp(self.d...
Imports: ```python import typing ``` Type definitions: ```python v0 = Callable[[Node, Node, str], bool] ``` Input Types: str, str, str, v0 Output Type: (bool, List[bool]) Dependencies: Function Name: v1 Function: ```python def v1(self, v2: str, v3: str, v4: str, v5: v0) -> (bool, List[bool]): v6 = [] for v7 in...
Imports: ```python import typing ``` Type definitions: Input Types: bool, Optional[Mapping[str, str]], bool Output Type: Mapping[str, str] Dependencies: Function Name: v0 Function: ```python def v0(self, *, v1: bool=False, v2: Optional[Mapping[str, str]]=None, v3: bool=False) -> Mapping[str, str]: v4 = self._iter...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2=None, v3='.') -> Any: v4 = self.raw for v5 in self.__sub_dicts: v4 = v4.get(v5, None) for v6 in v1.split(v3): if v...
Imports: ```python import random import typing ``` Type definitions: Input Types: Sequence, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Sequence, v2: int): v3 = set() v4 = list(range(len(v1))) while len(v3) != v2: (v5, v6) = tuple(random.sample(v4, 2)) ...
Imports: ```python import typing ``` Type definitions: Input Types: str, bool Output Type: Tuple[List, List] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: bool=True) -> Tuple[List, List]: v1 = v1.upper() v3 = set() v4 = set() v5 = set() v6 = v1.split('//') v7 = ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Dict: v2 = self.normalize_path(v1) v3 = '/labs' + f'{v2}/networks' return self.client.get(v3) ```
Imports: ```python import typing ``` Type definitions: ```python v0 = torch.Tensor ``` Input Types: v0 Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0) -> v0: v3 = super().forward(v2) if self.__padding != 0: return v3[:, :, :-self.__padding] return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Callable Dependencies: ```python def v0(v1, *v2) -> pd.DataFrame: v3 = [val for v4 in self.all_demo_values] v5 = [] if self.is_weekly: v1 = self.back_fill_missing_weekly(df=v1) v1 = func(v1, *v2) if self.is...
Imports: ```python import typing ``` Type definitions: Input Types: str, dict Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: dict) -> str: v3 = [] for (v4, v5) in v2.items(): if v4 in v1: v3.append(v5) return ','.join(v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: str, str, dict Output Type: List[dict] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: dict) -> List[dict]: v4: str = self.SPLITTER_METHOD_TO_GET_UNIQUE_BATCH_IDENTIFIERS_MAPPING[v2] v5: Callable = self....
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if not os.path.isfile(v1): raise RuntimeError("Files does not exist '{}'".format(v1)) v2 = open(v1, 'r') v3 = v2.read() ...
Imports: ```python import typing ``` Type definitions: Input Types: Path, str, Path Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: Path, v2: str='lsd2', v3: Path=Path.cwd() / 'rate.txt') -> None: if v2 == 'lsd2': with v1.open('r') as v4, v3.open('w') as v5: fo...
Imports: ```python import typing ``` Type definitions: ```python v0 = Tuple[Query, List[Location], Rating, dict] ``` Input Types: List[v0], Any Output Type: Dict[str, List[v0]] Dependencies: Function Name: v1 Function: ```python def v1(v2: List[v0], v3=Callable) -> Dict[str, List[v0]]: v4: Dict[str, List[v0]] = {}...
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 = 0.0 (v5, v6) = ([v1.root], 0) while len(v5) > 0: v7 = [] for v8 in v5: for v9 in v8.nodes: ...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1): self.content: any = v1 self.parent: v0 = None self.right: v0 = None self.left: v0 = None self.color: color = color.BLACK ``` ```python class v2: def __init__(self): ...
Imports: ```python from qiskit import circuit from qiskit.circuit.library import standard_gates as gates from qiskit.circuit.parameterexpression import ParameterExpression, ParameterValueType from qiskit.pulse import channels as chans, configuration, exceptions, instructions, macros, library, transforms, utils from qis...
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]: v1 = self._load_args v2 = self._save_args if 'properties' in v1: v3 = v1['properties'].copy() v3.pop('user', ...
Imports: ```python import typing ``` Type definitions: Input Types: int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2): self.graph = [[] for v3 in range(v1 + 1)] self.marked = [0] * (v1 + 1) for v4 in v2: (v5, v6) = v4 self.graph[v5].app...
Imports: ```python import numpy import typing ``` Type definitions: Input Types: 'list[float]' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: 'list[float]'): v2 = numpy.sqrt(numpy.power(v1[0], 2) + v1[1]) v3 = numpy.sqrt(v1[2] * v1[2] + v2 * v2) return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: int Dependencies: ```python def v0(*v1) -> bytes: v2 = b''.join((str(arg).encode('utf-8') for v3 in v1)) return hash_functions[HASH_TYPE](v2).digest() ``` Function Name: v4 Function: ```python def v4(v5, v6, v7) -> i...
Imports: ```python import torch import torch.nn as nn import typing ``` Type definitions: Input Types: torch.Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor): v2 = v1 + self._position_encoding[:, :v1.shape[1]].to(v1.device) v3 = self._dropout_positiona...
Imports: ```python import typing ``` Type definitions: Input Types: bytes Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes): v2 = self._sock.sendall(v1) self._log.debug('sending request %s', v1) return v2 ```
Imports: ```python import typing ``` Type definitions: ```python class v0(so.SubclassableObject, so.DerivableObject, s_abc.Type): v1 = so.SchemaField(s_expr.Expression, default=None, coerce=True, compcoef=0.909) v2 = so.SchemaField(ExprType, default=None, compcoef=0.909) v3 = so.SchemaField(bool, default=Fa...
Imports: ```python import typing ``` Type definitions: ```python v0 = Enum ``` Input Types: Optional[v0], v0 Output Type: bool Dependencies: Function Name: v1 Function: ```python def v1(self, v2: Optional[v0], v3: v0) -> bool: v4 = v2 while v4 is not None: if v3 == v4: return True v...
Imports: ```python from collections import defaultdict import typing ``` Type definitions: ```python v0 = Tuple[str, FrozenSet[str], bool] ``` ```python class v1(DFSNode): def __init__(self, v2: Package, v3: list[Package], v4: v1 | None=None, v5: None | (DirectoryDependency | FileDependency | URLDependency | VCSDe...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Tuple[int, ...], Tuple[int, ...] Output Type: Tuple[Tuple[int, ...], Tuple[int, ...]] Dependencies: Function Name: v0 Function: ```python def v0(v1: Tuple[int, ...], v2: Tuple[int, ...]) -> Tuple[Tuple[int, ...], Tuple[int, ...]]: ...
Imports: ```python import typing ``` Type definitions: Input Types: spec.Workload, Iterator[Tuple[spec.Tensor, spec.Tensor]], spec.OptimizerState, spec.ParameterContainer, spec.Hyperparamters, int, spec.RandomState Output Type: Tuple[spec.Tensor, spec.Tensor] Dependencies: Function Name: v0 Function: ```python def v0...
Imports: ```python from os.path import isdir as osp_isdir, getsize as osp_getsize, join as osp_join, isfile as osp_isfile from os import mkdir as os_mkdir, listdir as os_listdir, remove as os_remove, walk as os_walk, rename as os_rename import typing ``` Type definitions: Input Types: Any Output Type: None Dependencie...
Imports: ```python import os import typing ``` Type definitions: Input Types: pkg_resources.Distribution, str Output Type: str | None Dependencies: Function Name: v0 Function: ```python def v0(v1: pkg_resources.Distribution, v2: str) -> str | None: v3 = os.path.join(v2, v1.project_name) + '.egg-link' if os.pa...
Imports: ```python import typing ``` Type definitions: Input Types: Any, str, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: str, v3=0): v4 = 0 while True: try: v5 = v2.index(v1, v4) except ValueError: return v6 = v5 + le...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Optional[np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> Optional[np.ndarray]: if not self.available[v1]: return None self.available[v1] = False return self.lines[v1] ```
Imports: ```python import typing ``` Type definitions: Input Types: typing.Union[int, str], bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: typing.Union[int, str]=None, v2: bool=False): if v1 == 'all': for v3 in range(1, self.max + 1): self.extract_on...
Imports: ```python import numpy import typing ``` Type definitions: Input Types: float, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: str) -> None: assert not (v1 == self._time).any(), 'this boundary exists already' v3 = numpy.searchsorted(self._time, nu...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Any], List[str] Output Type: bool Dependencies: ```python def v0(v1, v2): if v2 not in v1: return False v3 = v1[v2] if isinstance(v3, str) and v3 == '': return False return True ``` Function Name: v4 Function:...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0(v1: 'TestInterpreter', v2: str, v3: Dict[str, Any], v4: List[Dict[str, Any]]) -> None: v5 = list(execute_query(v1.adapter, v2, v3)) v1.assertCountEqual(v4, v5) ``` Function Name: v6 Function: `...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, **v1) -> None: del kwargs if self._validate_handler: self.mc.events.remove_handler(self._validate_handler) if hasattr(self.mc, 'sounds'): ...
Imports: ```python from collections import Counter import typing ``` Type definitions: Input Types: List[int] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int]): v2 = Counter(v1) for v3 in tuple(v2.keys()): v2[self.jpy_classes[v3]] = v2.pop(v3) return ...
Imports: ```python import asyncio from typing import TYPE_CHECKING, Any, Callable, Dict, List, NamedTuple, Optional, cast import typing ``` Type definitions: Input Types: asyncio.BaseTransport Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: asyncio.BaseTransport) -> None: se...
Imports: ```python import warnings import typing ``` Type definitions: Input Types: Output Type: bytearray Dependencies: Function Name: v0 Function: ```python def v0(self) -> bytearray: warnings.warn('byte_repr is deprecated, directly cast to bytes instead', DeprecationWarning) return bytearray(bytes(self)) ...
Imports: ```python import warnings import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(): with open(str(CONFIG_PATH), 'r') as v1: v2 = yaml.safe_load(v1) return v2 ``` ```python def v3(): v4 = {'Chunked_Data_Path': '', 'PrePd_Data_Path': '', 'Raw_Dat...
Imports: ```python import logging import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.file_entry.get() v2 = self.option_entry.get() logging.info('Execute %s with options %s', v1, v2) self.app.core.execu...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[Any, List[Any]] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[Any, List[Any]]) -> int: v2 = [len(v) for (v3, v4) in v1.items()] if len(v2) == 0: return 0 return max(v2) ```
Imports: ```python import datetime import typing ``` Type definitions: Input Types: Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[str]: assert self.manager is not None v1 = [] v2 = self.manager.iteration v3 = self.manager.epoch_detail if self.trai...
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: Iterator[Tuple[int, int]] Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int) -> Iterator[Tuple[int, int]]: v3 = v1 // 2 v4 = v1 - v3 while v3 > 0 and v4 <= v2: yield (v3, v4) ...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool): self.online_network.set_is_training(v1) if self.has_target: self.target_network.set_is_training(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool) -> dict: v2 = super().describe(v1) v2['model_name'] = self.model_name v2['related_name'] = self.related_name v2['forward_key'] = self.fo...
Imports: ```python import datetime import typing ``` Type definitions: Input Types: str Output Type: datetime.timedelta Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> datetime.timedelta: (v2, v3) = map(int, v1.split(':')) return datetime.timedelta(hours=v2, minutes=v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any, Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, v3, v4) -> None: self.log.info(f'feature=service, event=topic-subscription, topic={self.args.tc_svc_server_topic}') self.message_bro...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: Dict[str, List[str]] Dependencies: ```python def v0(v1: str) -> str: if not len(v1.split('.')) >= 2: raise ValueError(f"version not in expected format: '{v1}'") return '.'.join(v1.split('.')[:2]) ``` Function Nam...
Imports: ```python import logging import torch import torch.nn import torch.optim import typing ``` Type definitions: Input Types: str, torch.nn.Module, bool, str Output Type: Any Dependencies: ```python def v0(v1: Dict[str, Union[float, torch.Tensor]], v2: Dict[str, Union[float, torch.Tensor]]): v3 = {} for (...
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: chr Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int) -> chr: for v3 in self.entity_pos: if (v1, v2) in self.entity_pos[v3]: return v3 return '' ```
Imports: ```python import typing ``` Type definitions: ```python class v0(models.Model): v1 = 40 v2 = 1000 v3 = 40 v4 = 128 v5 = 3000 v6 = 10000 v7 = ['Google', 'Email', 'GitHub', 'LDAP', 'Dev', 'RemoteUser', 'AzureAD', 'SAML', 'GitLab', 'Apple'] v8 = '' v9 = 15 v10: int = models...
Imports: ```python import subprocess import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: ```python def v0(v1: str): return subprocess.run(['kubectl', 'run', 'workload', '--rm', '--tty', '-i', '--restart', 'Never', '--namespace', 'default', '--image', workload['image'], *[x for (v2,...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str='formula_unit') -> None: v2 = self._normalization_factor(v1) self.composition /= v2 self._energy /= v2 ```
Imports: ```python import torch from torch.fx import GraphModule from torch.fx.experimental.proxy_tensor import make_fx from torch._prims.utils import getnvFuserDtype, Number from torch._prims.context import TorchRefsMode import torch.overrides from torch.utils._pytree import tree_map import typing ``` Type definitions...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: pd.Series Dependencies: Function Name: v0 Function: ```python def v0(self) -> pd.Series: v1 = None if self.criteria_start == 0 else self.criteria_start v2 = None if self.criteria_stop == 0 else self.criteria_stop v3 = slice(...
Imports: ```python import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import typing ``` Type definitions: Input Types: int, float, float Output Type: torch.Tensor Dependencies: ```python def v0(v1, v2): return v1.lgamma() + v2.lgamma() - (v1 + v2).lgamma() ``` ```python def v3(v4...
Imports: ```python import os import typing ``` Type definitions: Input Types: str, str Output Type: bool Dependencies: ```python def v0(): v1 = os.path.dirname(os.path.abspath(__file__)) v2 = os.path.join(v1, 'speak-test-ids_2019-11-29.txt') v3 = os.path.join(v1, 'speak-test-ids_2020-05-27.txt') assert...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Optional[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> Optional[int]: if v1 in self.cache: self.hits += 1 self.list.add(self.list.remove(self.cache[v1])) return self.cac...
Imports: ```python import datetime import typing ``` Type definitions: Input Types: range_config_pb2.RangeConfig, bool, bool, Optional[Text] Output Type: Union[Text, List[Text]] Dependencies: ```python def v0(v1: int) -> Tuple[int, int, int]: v2 = UNIX_EPOCH_DATE + datetime.timedelta(v1) return (v2.year, v2.mo...
Imports: ```python import io import typing ``` Type definitions: Input Types: base.String, Optional[base.InputFile], Optional[base.Integer], Optional[base.Integer], Optional[base.Boolean] Output Type: Union[io.BytesIO, io.FileIO] Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: base.String, ...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: Dict[str, List[str]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str]) -> Dict[str, List[str]]: v2 = {} for v3 in self.IDENTIFIERS.keys(): v4 = [tag for v5 in v1 if v5.startswith(v3...
Imports: ```python import typing ``` Type definitions: Input Types: str, bool Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: bool=True) -> str: v3 = f'{self.progress:.2f}% complete, {self.elapsed} elapsed' if v2: return f'{v3} - {v1}' else: r...
Imports: ```python import typing ``` Type definitions: Input Types: List[List[int]], int Output Type: List[int] Dependencies: ```python def v0(v1: List[int]) -> int: if v1[0] == 0: return 0 (v2, v3) = (0, len(v1) - 1) while v2 < v3: v4 = (v2 + v3) // 2 + 1 if v1[v4] == 0: ...
Imports: ```python import requests import typing ``` Type definitions: Input Types: str, dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: dict, **v3): v2.update(v3) v4 = requests.post(self.HOST + v1, json=self.prepare_body(v2)) return v4.json() ```
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: v1, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: v1, v2: str) -> None: v3 = pd.DataFrame(v1) v3.to_csv(v2, header=False, index=False, encoding='UTF-8') print('{} is created.'.for...
Imports: ```python import typing ``` Type definitions: Input Types: str, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int) -> int: if len(v1) < v2: return 0 v3 = min(set(v1), key=v1.count) if v1.count(v3) >= v2: return len(v1) retur...
Imports: ```python import re import typing ``` Type definitions: Input Types: str, Dict, bool Output Type: Union[Dict, List] Dependencies: ```python def v0(v1: str) -> List[str]: v2 = re.compile('\\$metadata#Cellsets\\(Cells\\(([A-Za-z,]+)\\)\\)/\\$entity') v3 = v2.match(v1) if not v3: raise ValueE...
Imports: ```python import matplotlib.pyplot as plt import numpy as np import typing ``` Type definitions: ```python v0 = pd.DataFrame ``` Input Types: Any, v0, str Output Type: None Dependencies: Function Name: v1 Function: ```python def v1(v2: Any, v3: v0, v4: str) -> None: assert hasattr(v2, 'feature_importances...
Imports: ```python import math import numpy as np from scipy.special import expn import typing ``` Type definitions: ```python v0 = namedtuple('NoiseProfile', 'sampling_rate window_size len1 len2 win n_fft noise_mu2') ``` Input Types: Any, v0, Any Output Type: Any Dependencies: ```python def v1(v2, v3): if v3 == np...
Imports: ```python import argparse from argparse import Namespace import typing ``` Type definitions: Input Types: Namespace Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Namespace, cls): if not hasattr(cls, 'add_args'): return v2 = argparse.ArgumentParser(argument_de...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self) -> None: async with self._amqp_pool.acquire() as v1: await v1.set_qos(prefetch_count=1) for (v2, v3) in self.mapping.items(): aw...
Imports: ```python import numpy as np from scipy import interpolate, integrate from scipy import optimize from scipy.interpolate import interp1d import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: v2 = np.arange(0.0, ...
Imports: ```python import typing ``` Type definitions: Input Types: th.Tensor, bool Output Type: Tuple[th.Tensor, th.Tensor, th.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: th.Tensor, v2: bool=False) -> Tuple[th.Tensor, th.Tensor, th.Tensor]: v3 = self.action_dist(v1) v4 = v3.m...
Imports: ```python import numpy as np import numpy.typing as npt import typing ``` Type definitions: ```python class v0: def __init__(self, v1: RotationMatrixLike, v2: VectorLike) -> None: """Frame (transformation) constructor. Basic constructor method of a frame object. The arguments rot ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Callable[[], None] Dependencies: ```python def v0() -> None: v1 = self.get_program_byte() v2 = self.registers['a'] if self.io is not None: self.io.send_output(v1, v2) ``` Function Name: v3 Function: ```python def v3(s...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[int] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[int]=None) -> str: while not self._buffer: try: self._buffer = next(self._iter) except StopIteration: ...