text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: Optional[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[str]) -> None: v2 = self.build_pp_header(v1) self.write(v2) ```
Imports: ```python import base64 import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str) -> str: v3 = f'{v1}:{v2}' v4 = base64.b64encode(v3.encode(encoding='utf-8')) return v4.decode() ```
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int]) -> str: v2 = '' for v3 in range(2, -1, -1): v4 = v1[:] if self.removeIfExits(v4, v3): v2 = str(v3) ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = open(v1 + self.extension, 'r') v3 = v2.readlines() v2.close() return v3 ```
Imports: ```python import random import typing ``` Type definitions: Input Types: int, int, Any Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int, v3=[]) -> List[int]: v4 = list() for v5 in range(v2): v6 = random.randint(0, v1 - 1) while v6 in v...
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = v1.split('/') v2 = v2[-1].split('\\') v2 = v2[-1].split('.') v3 = re.findall('\\d', v2[0]) return int(v3[-1]) ```
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor Output Type: torch.Tensor Dependencies: ```python def v0(v1, v2, v3=1e-06): v4 = 1.0 v5 = torch.sqrt(v2) v6 = v1 / (v5 + v3) (v7, v8, v9) = torch.chunk(v6, 3, dim=1) v10 = torch.cos(v5) v11 = torch.sin...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = [str(i) for v2 in self.puzzle.flatten()] return ' '.join(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Optional[int] Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> Optional[int]: for v2 in range(1, v1): v3 = [] for v4 in range(v1 - 1): v5 = pow(v2, v4, v1) if v5 in v3...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = self.getMediumName() if self.sLink: v1 += ' - ' + self.sLink return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: int, int, Optional[int] Output Type: int Dependencies: ```python def v0(v1: float) -> int: v1 = int(v1) if v1 == 0: return 1 else: return v1 ``` Function Name: v2 Function: ```python def v2(v3: int, v4: int=30, v5: Optional...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: str): self.addedNodes_: List[str] = [] self.removedNodes_: List[str] = [] self.ancestors_: List['Transformation'] = [] self.scopeName_: str = '' self.transID_: str = v1 ...
Imports: ```python import logging import os import typing ``` Type definitions: Input Types: str, int Output Type: logging.StreamHandler Dependencies: ```python def v0() -> logging.Formatter: return logging.Formatter(fmt='[%(levelname)s %(asctime)s] %(output_name)s: %(message)s', datefmt='%m-%d %H:%M:%S') ``` ```p...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: 'Mobject', bool, bool, bool, bool, bool, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'Mobject', v2: bool=True, v3: bool=False, v4: bool=False, v5: bool=False, v6: bool=False, v7: bool=...
Imports: ```python import json import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: dict): v1['metadata']['annotations']['tekton.dev/artifact_items'] = json.dumps(v1['metadata']['annotations']['tekton.dev/artifact_items']) return...
Imports: ```python from io import StringIO import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str): v3 = StringIO(v2) v3.name = v1 return v3 ```
Imports: ```python import re from collections import OrderedDict import typing ``` Type definitions: Input Types: str Output Type: OrderedDict Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> OrderedDict: v2 = [] for v3 in re.findall('\\$\\w+', v1): if v3[1:] not in v2: ...
Imports: ```python import typing ``` Type definitions: ```python class v0(NativeMember, NativeFunction): def __init__(self, v1, v2: BaseConfig, v3: 'NativeObject'=None) -> None: NativeFunction.__init__(self, v1, v2, NativeMethodImplement, v3) NativeMember.__init__(self, v1, v2) self._getter...
Imports: ```python from importlib import import_module import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> Any: try: (v2, v3) = v1.rsplit('.', 1) except ValueError: v4 = f"{v1} doesn't look like a module p...
Imports: ```python import typing ``` Type definitions: Input Types: List[Any] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Any]) -> bool: if v1 is None or isinstance(v1, str): return False for v2 in v1: if not isinstance(v2, (int, float)): r...
Imports: ```python import numpy as np from skimage import filters, transform import typing ``` Type definitions: Input Types: np.ndarray, Tuple[int, int], Tuple[int, int], Tuple[int, int] Output Type: np.ndarray Dependencies: ```python def v0(v1: np.ndarray, v2: Tuple[int, int]) -> np.ndarray: v3 = v1.shape v4...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> float: v3 = self.feature_counts.get(v1, {}).get(v2, 0.0) + self.alpha v4 = self.class_counts[v2] + self.alpha * 2 return v3 ...
Imports: ```python import typing ``` Type definitions: Input Types: list, list Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2: list) -> list: v3 = v1.copy() v4 = v2.copy() v5 = [] v6 = 0 for v7 in v3: while v6 < len(v4) and v7 > v4[v6]: ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): self._check_mutable() self._check_filename(v1) self._client.draft.file_delete(self._parent.id, v1) assert self._entries is not None se...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): if v1.startswith('#'): v1 = v1[1:] return tuple((int(v1[i:i + 2], 16) / 255.0 for v2 in (0, 2, 4))) ```
Imports: ```python import typing ``` Type definitions: Input Types: logging.LogRecord Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: logging.LogRecord) -> str: v2 = super().format(v1) if self.should_color(): for (v3, v4) in self.COLORS: if v1.levelno ...
Imports: ```python import os, sys, multiprocessing, hashlib, ast, time, re import typing ``` Type definitions: Input Types: str, bool Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: bool=True) -> dict: v3 = {} v4 = None if os.path.isdir(v1): for v5 in os.l...
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.packages['object']['pins'] v3 = [index for (v4, v5) in enumerate(v2) if v5['package'] == v1] if len(v3) == 0: raise Exceptio...
Imports: ```python import sys import shutil import logging import subprocess import typing ``` Type definitions: Input Types: argparse.Namespace Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: argparse.Namespace) -> None: if sys.version_info < (3, 8): raise RuntimeError('W...
Imports: ```python import os import sys from pprint import pprint import typing ``` Type definitions: Input Types: List[str] Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str]) -> List[str]: v2 = [] for v3 in v1: if os.path.isfile(v3): v4 = os.p...
Imports: ```python import numpy as np import scipy.sparse as sp import scipy.io as io from scipy.stats import mode import logging import typing ``` Type definitions: ```python class v0: def __init__(self, v1: str, v2: str, v3: bool, v4: int, v5: List[float], v6: Optional[int]=None, v7: int=consts.TOTAL_DROPLET_DEF...
Imports: ```python import typing ``` Type definitions: Input Types: 'ParameterSweep', Union['QubitBaseClass', 'Oscillator'], float, Tuple[Figure, Axes] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: 'ParameterSweep', v2: Union['QubitBaseClass', 'Oscillator'], v3: float, v4: Tuple[Fig...
Imports: ```python import torch from torch.fx.experimental.fx2trt import lower_to_trt import typing ``` Type definitions: Input Types: int, Any Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2, *v3) -> float: with torch.inference_mode(): v2(*v3) torch.cuda.sync...
Imports: ```python from random import randint import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = (randint(0, self.__height), randint(0, self.__width)) while not self.__is_valid_postion(v2): v2 = (randint...
Imports: ```python import typing ``` Type definitions: Input Types: tf.Tensor, int, int Output Type: tf.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: tf.Tensor, v2: int, v3: int=2) -> tf.Tensor: v4 = v1 v1 = BatchNormalization()(v1) v1 = ReLU()(v1) v1 = Conv2D(v2, (1, 1), strid...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, str]) -> str: v2 = v1['content'] v3 = v1['sender_email'] v4 = 'from %s: ' % (v3,) v5 = v4 + v2 return v5 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: if not v1.strip(): return self._groups.append(v1.strip()) ```
Imports: ```python import os import json import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Any, v2: str): os.makedirs(os.path.dirname(v2), exist_ok=True) with open(v2, mode='wt', encoding='utf-8') as v3: json.dump(...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): if self.ref_idx is not None: self.ref_idx = v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, str, list Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1, v2: str='', v3: list=[]): if v1.author.bot: return if 'discord' not in v3: await self.safe_exc(self.handle_invite, v1, ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python @time_box(time_box_enabled=_tbe, file=sys.stdout) def v0() -> None: print('this is sample text for _tbe = False static example') ``` ```python @time_box(time_box_enabled=_tbe, file=sys.stdout) def v1() ->...
Imports: ```python from datetime import datetime from datetime import timedelta import typing ``` Type definitions: Input Types: Any, datetime, datetime Output Type: Tuple[datetime, datetime] Dependencies: Function Name: v0 Function: ```python def v0(v1: Any, v2: datetime, v3: datetime) -> Tuple[datetime, datetime]: ...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('_T') ``` Input Types: v0 Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(v2: v0) -> v0: v2.__module__ = 'neuro_sdk' return v2 ```
Imports: ```python import torch from torch.nn import functional as F import typing ``` Type definitions: Input Types: torch.Tensor, float Output Type: torch.Tensor Dependencies: ```python def v0(): v1 = torch.sqrt(1.0 + m00 - m11 - m22 + eps) * 2.0 v2 = safe_zero_division(m21 - m12, v1) v3 = 0.25 * v1 ...
Imports: ```python import pandas as pd import urllib.request from urllib.parse import urlparse import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: str): v2 = v1.find_all('sitemap') v3 = [] for v4 in v2: v3.append(v4.findNext('loc').text) retu...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2=2): v3 = [] for v4 in range(v1): if v4 % 2 == 0: v3.append(3 ** v4 + 7 * np.math.factorial(v4)) el...
Imports: ```python import random import typing ``` Type definitions: Input Types: Output Type: (int, int) Dependencies: Function Name: v0 Function: ```python def v0(self) -> (int, int): v1 = self.get_pairs_without_edges() if len(v1) == 0: return None (v2, v3) = random.choice(v1) self.add_edge...
Imports: ```python import subprocess import os.path as osp import typing ``` Type definitions: ```python @dataclass class v0: v1: str v2: int v3: float = 1.0 ``` Input Types: int, v0 Output Type: Any Dependencies: ```python def v4(v5: int, v6: v0): v7 = ['python', 'train_net.py', '--eval-only'] v7.e...
Imports: ```python import os import typing ``` Type definitions: Input Types: str, int, float, int, int Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int, v3: float=0.002, v4: int=1, v5: int=1) -> List[str]: v6 = os.getcwd() os.chdir(v1) v7 = [] v...
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: List[int]): if len(v1) <= 1: return for v2 in range(len(v1)): v3 = v2 v4 = v1[v2] for v5 in range(v2, len(v1)): ...
Imports: ```python import torch import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.device = 'cuda:0' self.batch_2d = torch.arange(1, 10).reshape(3, 3)[None, None] ```
Imports: ```python import typing ``` Type definitions: Input Types: board.Board, dict Output Type: Any Dependencies: ```python def v0(v1): print('Command failure: {}. Please try again.'.format(v1)) ``` ```python def v2(v3): if v3.isdigit(): return int(v3) else: v0('Failed to convert argumen...
Imports: ```python import torch import torch.nn.functional as F import typing ``` Type definitions: Input Types: torch.Tensor, List[int] Output Type: torch.Tensor Dependencies: ```python def v0(v1: torch.Tensor) -> torch.Tensor: return F.pad(v1, pad=(1, 1, 1, 1), mode='circular', value=0) ``` Function Name: v2 Fun...
Imports: ```python import typing ``` Type definitions: Input Types: str, int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int, v3: int): self.name = v1 self.width = v2 self.height = v3 ```
Imports: ```python import json import base64 import typing ``` Type definitions: Input Types: str, str, any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: any) -> None: v4 = self.IPC.lrange(name='custome_channels', start=0, end=-1) v5 = [[1, 2], {'a': ...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1, v2=None): self.parent = v2 self.right_child = None self.left_child = None self.data = v1 def v3(self, v4): self.right_child = v4 v4.parent = self def v5(self, ...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False) -> dict: v2 = {} if hasattr(self, 'item_id') and self.item_id: v2['itemId'] = str(self.item_id) elif v1: v2['itemId'] ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: 'FileVariable' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: 'FileVariable'): v2 = v1.getAxis(0) v3 = v1.getAxis(1) v2[0] v4 = v2[-1] v3[0] v5 = v3[-1] v6 = getattr(v2, ...
Imports: ```python import re import json import typing ``` Type definitions: Input Types: str, str, str, str Output Type: Any Dependencies: ```python def v0(v1: str): v2 = [re.sub('(丁目?|番([町丁])|条|軒|線|([のノ])町|地割)', '', v1)] if re.match('^壱', v1) is not None: v2.append('一') v2.append('1') ...
Imports: ```python import os import typing ``` Type definitions: Input Types: int, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int=os.SEEK_SET) -> int: if v2 == os.SEEK_SET: v3 = v1 elif v2 == os.SEEK_CUR: v3 = self._offset + v1 elif v...
Imports: ```python import typing ``` Type definitions: Input Types: Union[Sequence, IO] Output Type: Any Dependencies: ```python def v0(): return iter(source_sequence) ``` Function Name: v1 Function: ```python def v1(self, v2: Union[Sequence, IO]): if hasattr(v2, 'read'): def v3(): while T...
Imports: ```python from qiskit.circuit import QuantumRegister, AncillaRegister from qiskit.circuit.exceptions import CircuitError import typing ``` Type definitions: Input Types: Optional[int] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[int]) -> None: if v1: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: list, list, Any, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list, v2: list, v3, v4, v5=None): for v6 in np.arange(v1[0], v2[0] + self.dx, self.dx): for v7 in np.arange...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> None: if self.on_about_to_close: self.on_about_to_close(v1, v2) ```
Imports: ```python import argparse import typing ``` Type definitions: Input Types: Output Type: argparse.Namespace Dependencies: Function Name: v0 Function: ```python def v0() -> argparse.Namespace: v1 = argparse.ArgumentParser(description='Neural model for NLP') v1.add_argument('--joint_input', type=str, d...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.song_obj is not None: self.download_song(self.song_obj) ```
Imports: ```python import typing ``` Type definitions: ```python @dataclasses.dataclass class v0: v1: str v2: int v3: FrozenSet[str] v4: int v5: int v6: int v7: bool = False def v8(self) -> bool: return 'readonly' in self.flags def v9(self) -> bool: return self.name...
Imports: ```python import os import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: str): if os.path.exists(v2) is False: os.mkdir(v2) self.classifier.save_model(v1, v2) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: pd.DataFrame, pd.DataFrame Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: pd.DataFrame) -> pd.DataFrame: v3 = v1.groupby(['ITEMCODE']).sum()['QUANTITY'].to_frame().res...
Imports: ```python import typing ``` Type definitions: ```python v0 = pytypes.JTensor ``` Input Types: v0, v0 Output Type: None Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0, v3: v0) -> None: self._prng_key = v2 self._global_step = v3 ```
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._get_url('issueLink') + '/' + v1 return self._session.delete(v2) ```
Imports: ```python from copy import deepcopy from rdkit import Chem, RDLogger from rdkit.Chem import Draw import typing ``` Type definitions: Input Types: list, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2=(450, 450)): v3 = deepcopy(v1[0].ph7_mol) for v4 in rang...
Imports: ```python import xarray as xr import numpy as np import typing ``` Type definitions: Input Types: int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2=True): v3 = xr.DataArray(data=np.arange(v1 * 8).reshape(1, 2, v1, 2, 2), dims=['time', 'tile', 'z', 'y', 'x'])...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if v1: return v1[:4] + '-' + v1[4:] ```
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: str, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2=None): v3 = pd.read_csv(v1, delimiter='\t', header=None, nrows=v2) v3.columns = ['STS', 'NLI', 'left', 'right', 'left_num', '...
Imports: ```python import os from importlib import import_module from concurrent.futures import ProcessPoolExecutor, as_completed import typing ``` Type definitions: Input Types: List[Dict[str, str]], Any Output Type: None Dependencies: ```python def v0(v1): print('Job: %s' % str(v1)) v2 = dyn_loader(v1['engin...
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: common_types.TensorType, tf.Tensor Output Type: tf.Tensor Dependencies: ```python def v0(v1: tf.Tensor, v2: tf.Tensor) -> tf.Tensor: with tf.compat.v1.name_scope(None, 'assign_buckets'): v3 = tf.cast(tf.shape(input=...
Imports: ```python import datetime import re import typing ``` Type definitions: Input Types: str, pytz.timezone, pytz.timezone Output Type: Any Dependencies: ```python def v0(v1: pytz.timezone): return datetime.datetime.now(tz=v1).utcoffset().total_seconds() / 60 / 60 ``` Function Name: v2 Function: ```python def...
Imports: ```python import typing ``` Type definitions: Input Types: Dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict): if 'id' in v1: self.id = v1['id'] if 'quality' in v1: self.quality = v1['quality'] if 'icon' in v1: self.icon = v1['...
Imports: ```python import torch from torch.utils.data import Sampler, Dataset import typing ``` Type definitions: Input Types: List[Tuple[torch.Tensor, int]] Output Type: Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor] Dependencies: ```python def v0(v1): return {k: torch.stack([dic[k] for v2 in v1]) ...
Imports: ```python import os import tensorflow as tf from tensorflow.python.framework import type_spec import typing ``` Type definitions: Input Types: tf.keras.Model Output Type: tf.keras.Model Dependencies: Function Name: v0 Function: ```python def v0(self, v1: tf.keras.Model) -> tf.keras.Model: v2 = os.path.jo...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: any Dependencies: Function Name: v0 Function: ```python def v0(self) -> any: try: return float(self.get_text()) except: return self.get_text() ```
Imports: ```python import typing ``` Type definitions: Input Types: int, int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3): self.args[0] = self.args[0][:v1] + v3 + self.args[0][v1 + v2:] return self.args[0] ```
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: List[Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> List[Any]: if v1.endswith(os.path.join('dir', 'builds', 'core-plugins')): return [['core-plugins', [], ['plugin1.zip']]] ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2) -> None: v3 = self.get_goods_account(v1).balance v4 = self.inventory.get_good(v1) * v2 if v4 > v3: self.get_goods_account(v1).debi...
Imports: ```python import os import sys import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = self.get_rule(v1) if v2 is None: print("*** No rule '" + v1 + "' in '" + self._pakefile_class.__module__ + "'. S...
Imports: ```python import typing ``` Type definitions: Input Types: List[List[float]], List[int] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[List[float]], v2: List[int]): self.features = v1 self.labels = v2 ```
Imports: ```python import typing ``` Type definitions: ```python class v0: v1 = ABCMeta v2: int = 0 v3: Any = None v4: int = 1 v5: int = 1 v6: Optional['AVLNode'] = None v7: Optional['AVLNode'] = None v8: Optional['AVLNode'] = None def __init__(self, v9: Any, v10: Optional['AVLNode'...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1 = self.background_data self.background_data = {} return v1 ```
Imports: ```python import pandas as pd from pandas import DataFrame import typing ``` Type definitions: Input Types: str Output Type: DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> DataFrame: v2 = pd.read_csv(v1) v2.columns = map(int, v2.columns) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Timers.Timer Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Timers.Timer): v2 = v1.kwargs['server_id'] v3 = v1.kwargs.get('connection_params', None) if not self.reconnect(v2, v3): v1.redo() ...
Imports: ```python import matplotlib as mpl from matplotlib import pyplot from matplotlib.testing.compare import compare_images import typing ``` Type definitions: Input Types: Path, Path, int Output Type: Any Dependencies: ```python def v0(v1, v2=None): path_actual.mkdir(parents=True, exist_ok=True) v3 = path...
Imports: ```python import math import typing ``` Type definitions: ```python v0 = Tuple[int, int, int] ``` Input Types: v0 Output Type: float Dependencies: Function Name: v1 Function: ```python def v1(v2: v0) -> float: v3 = float(v2[0]) / 255 v4 = float(v2[1]) / 255 v5 = float(v2[2]) / 255 return round...
Imports: ```python import numpy as np from scipy import sparse import typing ``` Type definitions: Input Types: sparse.spmatrix, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: sparse.spmatrix, v2: int): v3 = v1.row - v2 v3 = np.where(v3 < 0, v1.shape[0] + v3, v3) v4 = ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int, int, int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: int) -> None: v4 = self.index.shard_begins[v1] v5 = self.index.shard_ends[v1] - 1 v6 = max(v2, v4) ...
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: tf.Tensor Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: tf.Tensor) -> None: v2 = tf.shape(v1) (v3, v4) = (v2[-2], v2[-1]) tf.assert_equal([v3, v4], [self.outer_dim, self.inn...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: ```python def v0(v1: str) -> bool: return True ``` Function Name: v2 Function: ```python def v2(v3: str) -> bool: if any((c in v3 for v4 in (';', ']', '@'))): return False return v0(f'requirement...
Imports: ```python import torch from torch import nn import torch.distributed import torch.nn.functional as F import typing ``` Type definitions: Input Types: int Output Type: List[List[int]] Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> List[List[int]]: v2 = list(range(torch.cuda.device_...
Imports: ```python import numpy as np from scipy.sparse import spmatrix import typing ``` Type definitions: ```python v0 = Union[Index1D, Tuple[Index1D, Index1D], spmatrix] ``` ```python v1 = Union[slice, int, str, np.int64, np.ndarray] ``` Input Types: v0 Output Type: Tuple[v1, v1] Dependencies: Function Name: v2 Fun...
Imports: ```python import typing ``` Type definitions: Input Types: Any, dict Output Type: Any Dependencies: ```python def v0(v1: list, v2: list): v3 = '' for v4 in range(len(v1)): v5 = ' ' * (v2[v4] - len(v1[v4])) v3 += v1[v4] + v5 return v3 ``` Function Name: v6 Function: ```python def v6...