text
stringlengths
190
325k
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Text Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Text) -> np.ndarray: v2 = [self._v2i[ch] for v3 in v1.split('/') if v3 in self._v2i] return np.array(v2, dtype=np.int64) ```
Imports: ```python from rdkit import Chem import typing ``` Type definitions: Input Types: str, Optional[str] Output Type: Tuple[bool, bool] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: Optional[str]=None) -> Tuple[bool, bool]: v3 = False with open(v1, 'r') as v4: v5 = v4.re...
Imports: ```python import json import os import typing ``` Type definitions: ```python v0 = Dict[str, Any] ``` Input Types: str Output Type: List[v0] Dependencies: ```python def v1(v2: str) -> float: v3 = v2.split(' ') v4 = v3[0].replace('T', ' ') v5 = dateutil.parser.parse(v4) v6 = v5.timestamp() i...
Imports: ```python import os import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: ```python def v0(v1: str): global CLIENT if not v1: raise UserResolvableError('Hark Cloud endpoint not set', '') try: v2 = os.environ['HASURA_ADMIN_SECRET'] except KeyEr...
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.get_feature_flags() if v2 and v1 in v2: return v2[v1] return False ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, **v2): v2.update(locals()) v3 = {'tags': ['cellularGateway', 'configure', 'portForwardingRules'], 'operation': 'updateDeviceCellularGatewayPortForw...
Imports: ```python import keras.utils from keras import Sequential, Model, layers from keras.preprocessing.sequence import pad_sequences import typing ``` Type definitions: Input Types: Model, Dict[str, int], int, List[Tuple[str, int]] Output Type: List[Tuple[str, int, str]] Dependencies: ```python def v0(v1, v2, v3, ...
Imports: ```python import typing ``` Type definitions: Input Types: [] Output Type: [[str]] Dependencies: Function Name: v0 Function: ```python def v0(v1: []) -> [[str]]: v2 = '' v3 = [] for v4 in v1: if v4.startswith('?'): v4 = v4[1:] if v4 not in v3: v3.append(v4)...
Imports: ```python import typing ``` Type definitions: ```python class v0(Common): def __init__(self, v1=0, v2=0, v3=0): self.x = v1 self.y = v2 self.z = v3 self.sorting = 0 self.normal = 0 def v4(self): if not self.normal: return f'{self.x} {self.y}...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=-2) -> int: v2 = self.collect_legal_coordinates() if v2 == (-1, -1): return -1 if v1 == -2: return 9 if self.state.ravel()[v...
Imports: ```python import copy import typing ``` Type definitions: Input Types: dict, dict, str, int Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict, v2: dict, v3: str, v4: int) -> dict: v5 = copy.deepcopy(v2) v6 = v1['components'][v3] v7 = v1['id'] v8 = v1[...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: 'bool' Dependencies: Function Name: v0 Function: ```python def v0(self) -> 'bool': if not self.queue: return False self.queue[self.start] = None self.start = (self.start + 1) % self.max_size return True ```
Imports: ```python import logging import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: self.update_rotor_positions() v2 = self.encode_rotor_right_left(len(self.rotors) - 1, v1) v3 = self.reflector.encode(v2)...
Imports: ```python import logging import numpy as np import typing ``` Type definitions: Input Types: int, bool Output Type: Iterator[Tuple[List[str], Dict[str, torch.Tensor]]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: bool=None) -> Iterator[Tuple[List[str], Dict[str, torch.Tensor]...
Imports: ```python import torch import torch.nn.functional as F import torch.nn as nn from torch import Tensor import typing ``` Type definitions: Input Types: Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(self) -> Tensor: v1 = torch.tanh(self.conv1(self.x, self.pos_edge_index, s...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> list: self._hosts.remove(v1) return self.hosts ```
Imports: ```python import typing ``` Type definitions: Input Types: pathlib.Path, pathlib.Path Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: pathlib.Path, v2: pathlib.Path) -> bool: if not v1.is_absolute() or not v2.is_absolute(): raise ValueError("Argument 'parent' and ...
Imports: ```python import re import typing ``` Type definitions: Input Types: str, str, str Output Type: Tuple[str, Optional[str]] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3: str='date') -> Tuple[str, Optional[str]]: if v2 == 'Y': v4 = 'y(ear)?' elif v2 == 'M' and ...
Imports: ```python from subprocess import Popen, PIPE import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=None): v2 = v1 or self.command_line_client v3 = f'Could not test run "{v2} --help"!' try: v4 = Popen(...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self) -> pd.DataFrame: v1 = {k: [v] for (v2, v3) in self.get_statistics().items()} return pd.DataFrame.from_dict(v1, orient='columns') `...
Imports: ```python from itertools import product import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: ```python def v0(v1: int, v2: int) -> List[Tuple[int, int]]: return [(r0, c0) for (v3, v4) in product({v1 - 1, v1, v1 + 1}, {v2 - 1, v2, v2 + 1}) if 0 <= v3 < 10 and 0 <= v4 < 10 and...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: if not v1: raise KeyError('Invalid store group name') self._child_list.append(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: assert not self.empty() v1 = self.curr.value if self._number_of_elems == 1: self.curr = None else: v2 = self.curr.prev_node ...
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray, v2: np.ndarray, **v3) -> None: (v4, v5) = self._apply_preprocessing(v1, v2, fit=True) self.model.fit(v4, v5, **v3) s...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[Any] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[Any]: self._eval() if self._ort_value is None: return [] return self._ort_value.numpy().tolist() ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: dict) -> dict: for (v2, v3) in v1.items(): if isinstance(v3, np.ndarray): v4 = np.nan_to_num(v3, nan=123456789, posinf=1e...
Imports: ```python import typing ``` Type definitions: Input Types: Any, discord.Message Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(v1, v2: discord.Message): if not v2.guild: return commands.when_mentioned_or(v1.default_prefix)(v1, v2) v3 = v1.prefixes.get(v2.gui...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = self.driver.current_url + v1 return self.driver.get(v2) ```
Imports: ```python from copy import copy import typing ``` Type definitions: ```python v0 = Union[Vector, Location, Shape, Sketch] ``` ```python v1 = TypeVar('T', bound='Workplane') ``` Input Types: Iterable[v0] Output Type: v1 Dependencies: Function Name: v2 Function: ```python def v2(self: v1, v3: Iterable[v0]) -> v...
Imports: ```python import math import typing ``` Type definitions: ```python class v0(BatcherSchedulerConfig): v1: float = 5 ``` Input Types: int, v0, int Output Type: int Dependencies: Function Name: v2 Function: ```python def v2(self, v3: int, v4: v0, v5: int) -> int: if v5 > self.get_max_steps(): re...
Imports: ```python import json import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str): v3 = 'SELECT count(url) from ' + v1 try: v4 = self._client.query(v3 + ' where time > now() - ' + v2) v5 ...
Imports: ```python import torch, math import typing ``` Type definitions: Input Types: Any, int, bool Output Type: Any Dependencies: ```python def v0(v1, v2: int=10, v3: int=2): assert v2 > 0, 'The number of sifting times should be at least one.' v1 = torch.as_tensor(v1).double() v4 = v1.device v5 = v1...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.update() self.timeout_add(self.update_interval, self.timer_setup) ```
Imports: ```python from datetime import date, datetime, timedelta from math import isnan import typing ``` Type definitions: ```python @dataclass class v0: v1: v1 v2: float ``` Input Types: List[v0], date, date Output Type: Any Dependencies: ```python def v3(v4: List[v0], v5: int): v6 = v5 while v6 >= 0...
Imports: ```python import re import typing ``` Type definitions: Input Types: str, List[str] Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: List[str]) -> List[str]: v3 = [] v4 = ''.join(v2) v5 = '.*warnings\\.filter.*' if bool(re.search(v5, v4)): ...
Imports: ```python import math import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: Tuple[float, float, float] Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray) -> Tuple[float, float, float]: v1 = np.round(v1, decimals=7) if v1[2][0] != 1 and v1[...
Imports: ```python import collections import typing ``` Type definitions: Input Types: pd.Series, int, str, bool Output Type: Any Dependencies: ```python def v0(v1: str, v2: int): return zip(*[v1[i:] for v3 in range(v2)]) ``` Function Name: v4 Function: ```python def v4(v5: pd.Series, v6: int, v7: str=' ', v8: boo...
Imports: ```python import typing ``` Type definitions: Input Types: Token, Token Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Token, v2: Token): (v3, v4, v5, v6) = self.get_gender_number_info(v1, directly=True) (v7, v8, v9, v10) = self.get_gender_number_info(v2, direct...
Imports: ```python import typing ``` Type definitions: ```python @dataclass_json @dataclass class v0: v1: List[str] = field(default_factory=list) def v2(self, v3: List[str]) -> v0: self.LoadtypesForPostprocessing = v3 return self v4: Optional[str] = '' def v5(self, v6: str) -> v0: ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): v2 = list() v3 = self.show_question.find().sort('_id', -1).limit(10).skip(v1) for v4 in v3: del v4['_id'] v2.append(v4) re...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> bool: try: v2 = input('Would you like to proceed with iteration {}? [y/N]'.format(v1)) if v2 != 'y': return False els...
Imports: ```python import typing ``` Type definitions: Input Types: str, List[str], Union[hlapi.CommunityData, hlapi.UsmUserData], str, int, int, hlapi.SnmpEngine, hlapi.ContextData Output Type: List[Dict[str, str]] Dependencies: ```python def v0(v1: Any) -> Any: try: return int(v1) except (ValueError,...
Imports: ```python import re import typing ``` Type definitions: Input Types: str, str, str, Optional[int] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: str, v4: Optional[int]=None) -> bool: v5 = False v6 = self.get_line_info_from_file(fn=v1) v7 =...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: for v2 in self.data: if v2['variable_name'].lower() == v1.lower(): self.accumulator += int(v2['value']) ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): if v1 < len(self._categories) and v1 > -1: self._categories.remove(self._categories[v1]) ```
Imports: ```python import typing ``` Type definitions: ```python @dataclasses.dataclass(frozen=True) class v0: v1: typing.Dict['Category', int] v2: typing.Dict['Category', int] v3: typing.Dict['Categorization', typing.Set['Category']] v4: str = '' v5: typing.Optional[int] = None v6: typing.Optio...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[str], Literal['sequence', 'frame'] Output Type: Optional[str] Dependencies: ```python def v0(v1: str): if v1 not in ['sequence', 'frame']: raise ValueError(f"kind has to be either 'sequence' or 'frame': {v1}") ``` ```python def v2...
Imports: ```python import torch import torch.nn as 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 = self.pooling(v1.rename(None)) v2.names = ('B', 'N', 'E') v2...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, **v3) -> Dict[str, Any]: v4 = {} if self._serializer: v4 = self._serializer(self, v1, v2, **v3) elif self._serializer_cl...
Imports: ```python from string import ascii_letters import typing ``` Type definitions: Input Types: List[str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str]) -> str: v2: dict = {idx: letter for (v3, v4) in enumerate(ascii_letters, start=1)} if v1[0].islower(): ...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: ```python def v0(v1: str) -> str: return os.path.abspath(os.path.join('..', v1)) ``` Function Name: v2 Function: ```python def v2(v3: str) -> str: v4 = v0('sens_maps') v3 = v3.replace('-', '_')....
Imports: ```python import typing ``` Type definitions: Input Types: Any, bool, bool Output Type: List[pygsheets.Cell] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: bool=True, v3: bool=True) -> List[pygsheets.Cell]: v4 = [] for v5 in self.list_ws(): v4 += v5.find(v1, matchCas...
Imports: ```python import typing ``` Type definitions: Input Types: list[list[int]] Output Type: list[tuple[int, int]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list[list[int]]) -> list[tuple[int, int]]: v2 = [] for v3 in v1: v2 += zip(v3, v3[1:] + v3[:1]) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1) -> int: v2 = v1.find_all('span', class_='macro-value') if len(v2) != 0: return int(v2[0].get_text()) else: return int(v1.get_text()) ```
Imports: ```python import typing ``` Type definitions: Input Types: int, Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2={}) -> int: if v1 == 1 or v1 == 2: return v1 if v1 in v2: return v2[v1] else: v2[v1] = self.climbStairs(v1 - 1,...
Imports: ```python from math import isnan import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self) -> float: v1 = self.raw_param.get('spot_max_price', float('nan')) if isnan(v1): v1 = -1 if self.agentpool and self.agentpo...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: 'ConverterBase' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any) -> 'ConverterBase': self.data_to_convert = v1 return self ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = str(self.pos) if self.length is not None: v1 += f'/{self.length}' return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Dict Output Type: Any Dependencies: ```python def v0(v1): v2 = v1.get('properties', {}) for v3 in v2: if 'datetime' in v3: v4 = v2[v3] if isinstance(v4, str): v2[v3] = default_utc(ciso8601.parse_...
Imports: ```python import threading import typing ``` Type definitions: Input Types: list, Queue Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2: Queue) -> None: print('Creating data and putting it on the queue') for v3 in v1: v4 = threading.Event() v2...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> int: v2 = v1 - 1 if v2 == 0: v2 = self.datalen while v2 in self.picked: v2 -= 1 if v2 == 0: v2 = self.da...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=0) -> float: if v1 < 0: raise ValueError(f'tax_exemption_amount should be a positive number, but received {v1} instead.') v2 = 0.05 if...
Imports: ```python from itertools import chain, combinations, product import numpy as np from scipy.cluster.hierarchy import fcluster, linkage from scipy.spatial.distance import squareform import typing ``` Type definitions: Input Types: Structure, Any Output Type: int Dependencies: Function Name: v0 Function: ```pyt...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: 'GenerationInfoByTarget' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> 'GenerationInfoByTarget': if v1 not in self._info.keys(): raise RuntimeError('Could not find target in GenerationInfoBy...
Imports: ```python import torch from torch import Tensor import typing ``` Type definitions: Input Types: Dict[str, Tensor], str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, Tensor], v2: str) -> None: v3 = 0 v4 = self.param_names(0, v2, no_suffix=True)['weig...
Imports: ```python import os import shutil import re import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: str): for (v3, v4) in v1: try: v5 = re.sub('\\W+', '', v4) except Exception: pr...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> bytes: self.cursor += v1 return self.stream[self.cursor - v1:self.cursor] ```
Imports: ```python import re import requests import typing ``` Type definitions: Input Types: str, str Output Type: (str, requests.session) Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str) -> (str, requests.session): v3 = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleW...
Imports: ```python import sys import os import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: if sys.platform.startswith('linux'): return os.path.join('/etc', self.config_directory_name) else: raise self._not...
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 v1: if v3 not in v2: v2[v3] = 1 else: v2[v3] += 1 print(v2) v4 = '' while l...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor, Union[torch.Tensor, _k2.RaggedInt] Output Type: Union[torch.Tensor, _k2.RaggedInt] Dependencies: ```python def v0(v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor: v3 = _IndexSelectFunction.apply(v1, v2) return v3...
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int) -> int: assert v1 >= 0 assert v2 >= 0 v3: int = (v1 + v2) * (v1 + v2 + 1) // 2 + v2 return v3 ```
Imports: ```python import tensorflow.python as tf from tensorflow.contrib import slim from tensorflow.python import keras import tensorflow.python.keras.backend as K from tensorflow.python.keras.layers import * import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: [keras.Model, keras.Model] Depen...
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.cache[self.cache_pointer][1] self.cache_pointer += 1 return v1 ```
Imports: ```python import numpy as np from pandas._libs import algos, hashtable, lib from pandas._libs.hashtable import unique_label_indices from pandas._typing import IndexKeyFunc from pandas.core.dtypes.common import ensure_int64, ensure_platform_int, is_extension_array_dtype from pandas.core.dtypes.generic import AB...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: super().prepare_for_removal() self.mc.events.remove_handlers_by_keys(self._control_events) self._control_events = list() self.stop() ```
Imports: ```python import warnings import torch.distributed as dist import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0() -> int: if not dist.is_available(): warnings.warn('Torch distributed is not available; returning 0 for global ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: t.Iterator[int] Dependencies: Function Name: v0 Function: ```python def v0(v1) -> t.Iterator[int]: with open(v1, 'r') as v2: v3 = v2.readline() yield from (int(fish) for v4 in v3.split(',')) ```
Imports: ```python import os import logging import configparser import typing ``` Type definitions: Input Types: argparse.ArgumentParser Output Type: job_config.JobConfig Dependencies: ```python def v0(v1: argparse.ArgumentParser): logging.info('Reading schema of the BQ table : {}'.format(v1.bq_table)) v2 = bq...
Imports: ```python import csv import typing ``` Type definitions: Input Types: Any, list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: list): print('Writing to csv...') with open(v1, 'a', newline='') as v3: v4 = csv.writer(v3) for v5 in v2: v4....
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): self.interpreter = tf.lite.Interpreter(model_path=v1) self.interpreter.allocate_tensors() self.input_details = self.in...
Imports: ```python from .io import dump, group_and_sort, load, parse import typing ``` Type definitions: Input Types: str, int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: int) -> None: v3 = load(v1, v2).frames assert len(v3) == 10 assert v3[0].url == 'https://...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Dict[str, int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=None) -> Dict[str, int]: v2 = dict(zip(self.model_data['genres']['name'], self.model_data['genres']['id'])) if v1 is not None: v2...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Union[list, None] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Union[list, None]: if self.mode != 'r': v1 = "Invalid operation, cannot read from a file opened in 'w' mode." raise IOError(v1) ...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('TValue') ``` Input Types: Optional[int] Output Type: Optional[v0] Dependencies: Function Name: v1 Function: ```python def v1(self, v2: Optional[int]) -> Optional[v0]: if v2 is None: return None return self.entries[v2][1] ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1) -> None: self.output_border.refresh() pass ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: Any, v2=['True', 'true', 'False', 'false']) -> bool: if v1 is None: return False if isinstance(v1, bool): return True if isinstance(...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0() -> int: v1 = self.example_user('hamlet') self.login_user(v1) v2 = self.send_stream_message(v1, 'Scotland', topic_name='editing', content='before edit') ret...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: for v1 in reversed(self.lines): if v1: break else: self.lines.pop() if len(self.lines) == 2: if self....
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.assertSuppressErrors({2: [{'code': '0', 'description': 'Some error'}]}, '\n def foo() -> None:\n # FIXME[]\n ...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python class v0: def __init__(self, v1: DimensionalSystem, v2: Iterable[float]): v3 = np.asarray(v2).astype(float) assert len(v3) == len(v1) self.e = v3 self.dimsys = v1 def __repr__(self) -> str: ...
Imports: ```python from cgitb import text import math import typing ``` Type definitions: Input Types: str, tuple, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: tuple, v3: int) -> int: v4 = len(v1) if v3 < 0: v3 = v3 * -1 v5 = math.ceil(v3 / mat...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> list: v2 = self.get_type_list('object_types') v3 = [t for v4 in v2 if v1.startswith(v4 + '_')] return v3 ```
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: int): self._id = int(v1) self._enabled = True self._words: List[WordPattern] = [] def v2(self, v3: Union[int, v0]): if isinstance(v3, v0): return self._id == v3._id ...
Imports: ```python import typing ``` Type definitions: Input Types: py.path.local Output Type: None Dependencies: ```python def v0(v1: OTBNSim) -> ExecutionStats: v1.run(verbose=False, collect_stats=True) assert v1.state.ext_regs.read('ERR_BITS', False) == 0 assert v1.stats return v1.stats ``` ```pytho...
Imports: ```python import numpy as np from numpy import ndarray import typing ``` Type definitions: Input Types: ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, float Output Type: Tuple[ndarray, ndarray] Dependencies: ```python def v0(v1: ndarray, v2: ndarray, v3: ndarray, v4: ndarray, v5: ndarray, v6: ...
Imports: ```python import typing ``` Type definitions: Input Types: List[List[int]] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[List[int]]) -> None: v2 = len(v1) v3 = v2 // 2 for v4 in range(v3): self.helper(v1, v4) ```
Imports: ```python import typing ``` Type definitions: Input Types: Path, Namespace Output Type: Path Dependencies: ```python def v0(v1: Path) -> Path: v2 = 1 v3 = v1.with_stem(f'{v1.stem}^{v2}') while v3.is_dir(): v2 += 1 v3 = v1.with_stem(f'{v1.stem}^{v2}') return v3 ``` Function Name...
Imports: ```python import torch import torch.fx import torch.fx.experimental.fx_acc.acc_ops as acc_ops import typing ``` Type definitions: Input Types: torch.fx.GraphModule Output Type: Any Dependencies: ```python def v0(v1: torch.fx.Node): v2 = len(v1.meta['tensor_meta'].shape) v3 = list((i % v2 for v4 in v1....
Imports: ```python import json import typing ``` Type definitions: Input Types: Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self) -> Any: assert self.schema_content != '', 'Schema content must not be empty' return json.loads(self.schema_content) ```