text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str, int, str Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str=None, v3: str=None, v4: int=DEFAULT_PAGE_SIZE, v5: str=None) -> Dict: v6 = {'$orderby': v2} if v2 else {} if v3: ...
Imports: ```python import numpy as np from pandas._libs.tslibs import OutOfBoundsDatetime, Timestamp from pandas.tseries.offsets import DateOffset, Tick, generate_range import typing ``` Type definitions: Input Types: Timestamp, Timestamp, int, DateOffset Output Type: Tuple[np.ndarray, str] Dependencies: ```python def...
Imports: ```python import typing ``` Type definitions: Input Types: json_rpc.JsonRPCRequest Output Type: Union[json_rpc.JsonRPCResponse, json_rpc.JsonRPCError] Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: json_rpc.JsonRPCRequest) -> Union[json_rpc.JsonRPCResponse, json_rpc.JsonRPCError]:...
Imports: ```python import typing ``` Type definitions: Input Types: classfile.MemberInfo Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: classfile.MemberInfo): self.accessFlags = v1.AccessFlags self.name = v1.Name self.descriptor = v1.Descriptor ```
Imports: ```python import typing ``` Type definitions: Input Types: list, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list, v2: str): for v3 in range(len(self.syllabus_dict_list)): v4 = self.syllabus_dict_list[v3] if v4['kougi'] == v1['kougi'] and v4['...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float): v1 = float(v1) self.__balance += v1 print(f'Erfolgreich {v1} eingezahlt!') ```
Imports: ```python import typing ``` Type definitions: Input Types: bytes Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes) -> int: if self.debug: print('-> ' + str(v1)) return self.connection.write(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame, float, float, int, int Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: float=0.5, v3: float=0.5, v4: int=50, v5: int=200) -> pd.DataFrame: v6 = v1['price'].rolling(v4).mean(...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict: v1 = {} if hasattr(self, 'session_id') and self.session_id is not None: v1['session_id'] = self.session_id return v1 ```
Imports: ```python import pandas as pd import geopandas as gpd from scipy.interpolate import interp1d from scipy.spatial import distance_matrix import typing ``` Type definitions: Input Types: list, str, list, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list=None, v2...
Imports: ```python import typing ``` Type definitions: ```python @dataclass class v0: v1: str v2: str v3: str v4: UUID = uuid4() v5: Dict = field(default_factory=dict) v6: Union[List, Dict] = field(default_factory=dict) v7: Dict = field(default_factory=dict) v8: Dict = field(default_fact...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1 = self.lwc_source.categorize_bits.quality_bits return {key: v1[key] for v2 in ('radar', 'lidar')} ```
Imports: ```python import numpy import typing ``` Type definitions: Input Types: numpy.ndarray, Optional[int], bool, Optional[int] Output Type: numpy.ndarray Dependencies: ```python @njit('float32[:,:,:], float32[:,:,:], uint32[:,:], uint32', nogil=True) def v0(v1: numpy.ndarray, v2: numpy.ndarray, v3: numpy.ndarray, ...
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int]) -> int: v2 = {v1[0]: False} for v3 in range(1, len(v1)): if v1[v3] in v2: v2[v1[v3]] = True else: ...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: int, v2: StructuredStatement, v3: Optional[str]=None): self.statement = v0.sanitize_goal_statement(v2, v3) self.goal_id = v1 self.claim_label = v3 def v4(self) -> v0: return v0(sel...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=True): v2 = [] for v3 in self.image_dir.rglob('**/*'): if v3.suffix.lower() in ('.png', '.jpg', '.jpeg'): v2.append(v3) v4...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[str]: self._maybe_refresh() if self._tickers is None: self._fetch_info() assert self._tickers is not None return list(self._ticke...
Imports: ```python from PIL import Image, ImageDraw import typing ``` Type definitions: Input Types: Image.Image, int, int Output Type: Image.Image Dependencies: Function Name: v0 Function: ```python def v0(v1: Image.Image, v2: int, v3: int) -> Image.Image: v4 = ImageDraw.Draw(v1) (v5, v6) = v1.size v4.li...
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 = len(self.priority_queue) self.beta = self.compute_beta(self.n_get_sample_called) v3...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> None: super().set_state(v1) self.random_search.set_state(v1['random_search']) self.lineages = v1['lineages'] self._queue = v1['queue'...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: Tuple[int, float] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float) -> Tuple[int, float]: self.update_layers() for (v2, v3) in enumerate(self[:-1]): if v3.depth <= v1 < v3.depth_base: ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: tuple[str, bool] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> tuple[str, bool]: self._log.debug('Video cache: %s', self._video_file_cache) try: return (self._video_file_cache[v1], True)...
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 = [] for v2 in self.buckets: v3 = v2.to_dict() v1.append(v3) v4 = self.name v5: Dict[str, Any] = {} ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, int, bool, bool Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: int=1, v3: bool=True, v4: bool=True) -> np.ndarray: if v4 and v2 >= np.unique(v1).size: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray): (v2, v3) = v1.shape self.input = v1 if self.kernel_size > v2 or self.kernel_size > v3: raise Arithmet...
Imports: ```python from pandas._libs import algos, hashtable, lib from pandas._libs.hashtable import unique_label_indices from pandas._typing import IndexKeyFunc, Shape, npt from pandas.core.dtypes.common import ensure_int64, ensure_platform_int, is_extension_array_dtype from pandas.core.dtypes.generic import ABCMultiI...
Imports: ```python import typing ``` Type definitions: Input Types: Tuple[int, ...] Output Type: 'FockBasis' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tuple[int, ...]) -> 'FockBasis': v2 = [0] * self.d for v3 in v1: v2[v3] = 1 return self + v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Tuple[float, int] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tuple[float, int]=None) -> bool: if v1 is None: v1 = self.state return v1[0] <= self.MIN_ENERGY or v1[1] >= self.MAX_SETS ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = {'A': 'A', 'C': 'C', 'G': 'G', 'T': 'U'} return ''.join((v2[t] for v3 in v1.upper())) ```
Imports: ```python import itertools as it from collections import defaultdict import typing ``` Type definitions: ```python v0 = Dict[str, int] ``` ```python v1 = Tuple[List[str], List[str]] ``` Input Types: IO, bool Output Type: Any Dependencies: ```python def v2(v3: List[str], v4: Dict[str, str]) -> Optional[Dict[str...
Imports: ```python 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.ac.q1(v1) v3 = self.ac.q2(v1) return (v2, v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: AsyncGenerator[bytes, None] Dependencies: Function Name: v0 Function: ```python async def v0() -> AsyncGenerator[bytes, None]: for v1 in range(1024): yield (b'123456789abcdef\n' * 64) ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: dict) -> list: v2 = tuple(v1['Functional'].keys()) v3 = ['_'.join((v1['Summary']['Subject ID'], 'ses-' + b.split('session ')[1].split(',')[0], 'task-' + b.s...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: Tuple[None, List[Tuple[int]]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2) -> Tuple[None, List[Tuple[int]]]: if len(v1) > 0: raise ValueError(f'{self.__class__.__name__} does not accept co...
Imports: ```python import typing ``` Type definitions: ```python class v0(Enum): v1 = 'r' v2 = 'rb' v3 = 'r' v4 = 'rb' v5 = 'a' v6 = 'a' v7 = 'w' v8 = 'wb' v9 = 'w' v10 = 'wb' v11 = 'r+' v12 = 'rb+' v13 = 'r+' v14 = 'rb+' v15 = 'auto' ``` Input Types: str, v0,...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: np.ndarray) -> bool: v3 = v1[:, 0:1] v4 = v2[0:1, :] return np.nanmax(np.abs(v1 - v3)) == 0 and np....
Imports: ```python import typing ``` Type definitions: Input Types: str, List[str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: List[str]) -> str: for v3 in v2: v4 = v3[0] if v4 == 'x': (v5, v6) = [int(x) for v7 in v3[1:].split('/')] ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[int]: if len(self.actions) == 0: return [] v1 = self.get_selected_actions() if len(v1) == 0: return [] v2 = min((a.min_fr...
Imports: ```python import logging import sys import typing ``` Type definitions: Input Types: Optional[bool], Optional[PathLike], Union[int, str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: Optional[bool]=True, v2: Optional[PathLike]=None, v3: Union[int, str]='INFO') -> None: ...
Imports: ```python import contextlib import typing ``` Type definitions: Input Types: asyncio.subprocess.Process Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(v1: asyncio.subprocess.Process) -> None: with contextlib.suppress(ProcessLookupError): v1.kill() await v1....
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Any] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, Any]): self._on_execution = None self._result = dict() v1 = self._get_parameters_data(v1) if self.task_descriptor.type_task...
Imports: ```python import typing ``` Type definitions: Input Types: str, List[nodes.Argument] Output Type: List[nodes.Argument] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: List[nodes.Argument]) -> List[nodes.Argument]: if v1 in ('__init_subclass__', '__class_getitem__'): if v2[...
Imports: ```python import numpy as np from numpy.linalg import solve import typing ``` Type definitions: ```python class v0: def __init__(self, v1: car.CarParams): """ Args: CP: Car Parameters """ self.m = v1.mass self.j = v1.rotationalInertia self.l = v1.wheelbase ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(v1: str): v2: aio_pika.Queue = await self.channel.get_queue(v1, ensure=True) async with v2.iterator() as v3: async for v4 in v3: yield v...
Imports: ```python import pandas as pd from pandas import DataFrame import typing ``` Type definitions: Input Types: Any, Any Output Type: DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1='value', v2='1min') -> DataFrame: if self.strategies: v3 = [] for v4 in self.stra...
Imports: ```python import asyncio import typing ``` Type definitions: Input Types: int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(v1: int, v2: int): print(f'function started') await asyncio.sleep(5) print(f'function finished') return v1 + v2 ```
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor=None, v2: torch.Tensor=None) -> None: if isinstance(v1, float): v1 = v1 * torch.randn(self.size, d...
Imports: ```python import typing ``` Type definitions: Input Types: aiohttp.ClientSession, str, str Output Type: bytes Dependencies: Function Name: v0 Function: ```python async def v0(v1: aiohttp.ClientSession, v2: str, v3: str) -> bytes: v4 = f'{v2}/{v3}/{v3}.gif'.lower() async with v1.get(v4) as v5: ...
Imports: ```python import ctypes import ctypes.util import typing ``` Type definitions: Input Types: str, object, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: object, v3: int): if v1 == 'mkl': v2.mkl_set_num_threads(ctypes.byref(ctypes.c_int(v3))) elif v...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1 = None v2 = '' v3 = '' v4 = '' v5 = 0 v6 = 0 v7 = '' v8 = '' v9 = False v10 = False def __init__(self, v11: List[Tuple[str, int]], v12: str, v13: str, v14: str, v15: int, v16: int, v17: str, v18: s...
Imports: ```python import argparse import os import typing ``` Type definitions: Input Types: Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1) -> str: if os.path.isdir(v1): return v1 else: raise argparse.ArgumentTypeError(f'readable_dir:{v1} is not a valid pa...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Tuple[int, int] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Tuple[int, int]: if self._warmup_param in self.state: (v1, v2) = self.state[self._warmup_param]['warmup'].tolist() else: v1 = 0 ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> int: v3 = v1.split(' ') v4 = 0 v5 = frozenset(v2) for v6 in v3: if v6 and len(set(v6) & v5) < 1: v4 +=...
Imports: ```python import re import warnings from multiprocessing import cpu_count import spacy from nltk.stem import WordNetLemmatizer from spacy.lang.en import English from tqdm import tqdm import typing ``` Type definitions: Input Types: List[str], str, Union[str, List[str]], bool Output Type: List[str] Dependencie...
Imports: ```python import typing ``` Type definitions: Input Types: List[Tensor], int, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[Tensor], v2: int, v3: str): (v4, v5) = v1 (v6, v7, v8) = self._calculate_edl_factors(v4) v9 = self.loss_function(v6, v5) ...
Imports: ```python import re import typing ``` Type definitions: Input Types: str, List[str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: List[str]=None) -> str: if not v1: return '' v3: bool = v1[0] == '_' v4: bool = v1[-1] == '_' if v1.isupper(): ...
Imports: ```python import json from rdkit import Chem import typing ``` Type definitions: Input Types: List[Chem.rdchem.Mol], str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Chem.rdchem.Mol], v2: str='geometries.json') -> None: v3 = [Chem.MolToPDBBlock(mol) for v4 in v1] ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Dict[str, int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, **v2) -> Dict[str, int]: v3 = self._execute_callable_magic('estimate', v1, **v2) return {operation_name: int(count) for (v4, v5) in v3.items(...
Imports: ```python import typing ``` Type definitions: Input Types: rclpy.task.Future Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: rclpy.task.Future): self.result_message = v1.result() self.result_status = v1.result().status self.result_status_string = self.status_...
Imports: ```python import json import typing ``` Type definitions: ```python v0 = Dict[str, str] ``` Input Types: Output Type: Optional[v0] Dependencies: Function Name: v1 Function: ```python def v1(self) -> Optional[v0]: v2: Optional[v0] = None v3 = self.get_binaries_file_path() if v3.exists(): w...
Imports: ```python import torch import torch.nn.functional as F from torch.autograd import Function import typing ``` Type definitions: Input Types: torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor) -> torch.Tensor: if not isinstance(v1, torch.Tens...
Imports: ```python import requests import typing ``` Type definitions: Input Types: List, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List, v2: str='RandomRoom'): v3 = requests.post(f'{self.URL}/room/create', json={'users': ','.join(v1), 'roomName': v2, 'key': self.us...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: str): self.text = v1 self.pos = 0 @property def v2(self): if self.pos == len(self.text): return None return self.text[self.pos] def v3(self): self.pos ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: v1 = self.pongRequired self.pongRequired = False return v1 ```
Imports: ```python from torch import Tensor from torch.utils.data import DataLoader, IterableDataset, Dataset import typing ``` Type definitions: Input Types: Dataset, int Output Type: DataLoader Dependencies: Function Name: v0 Function: ```python def v0(v1: Dataset, v2: int=64) -> DataLoader: v3 = DataLoader(v1,...
Imports: ```python from datetime import datetime, timezone import typing ``` Type definitions: Input Types: Output Type: Optional[datetime] Dependencies: ```python def v0(v1: str): v2 = v1[:-1] return datetime.strptime(v2, _SQLITE_TS_FORMAT) ``` Function Name: v3 Function: ```python def v3(self) -> Optional[d...
Imports: ```python import typing ``` Type definitions: Input Types: BaseException, Any Output Type: str Dependencies: ```python def v0(v1: BaseException, v2: Any) -> Dict[str, Any]: v3 = hash_stacks.current.hash_reason v4 = hash_stacks.current.hash_source v5 = type_util.get_fqn_type(v2) if v4 is None o...
Imports: ```python import difflib import typing ``` Type definitions: Input Types: str, str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: str) -> None: self.source_config = v1 self.candidate_config = v2 self.device_diff = v3 v4 = difflib....
Imports: ```python import typing ``` Type definitions: Input Types: Iterable[int], Dict[int, Dict[int, int]], bool Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: Iterable[int], v2: Dict[int, Dict[int, int]], v3: bool) -> int: v4 = 0 v5 = 0 v6 = list(v1) while v6: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0() -> None: import budget.load.balances import budget.load.transactions import budget.analyze assert True ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, connection.Connection, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, v3: connection.Connection, v4): v5 = list() for v6 in range(v4): (v7, v8) = self._work(v1, v2) v5.a...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: for v2 in v1.statements: self.gen_stmt(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: List[Callable] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[Callable]): self._middlewares += v1 self._build_middlewares_chain() ```
Imports: ```python import curses import curses.ascii import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: curses.nocbreak() self.stdscr.keypad(False) curses.echo() curses.endwin() self.loop.stop() ```
Imports: ```python import multiprocessing as mp import typing ``` Type definitions: Input Types: int, int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int) -> None: del signum, frame global interrupted v3 = True v4 = mp.current_process().name if v4 is n...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: deque[HanoiTowerDisk]=deque()) -> None: self.__disks: deque[HanoiTowerDisk] = v1 assert self.__check_order(), 'disks order error' self.__hash: int = 0 self.__calc_hash() return ...
Imports: ```python import numpy as np from numpy.linalg import norm import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray, np.ndarray, np.ndarray, float Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: np.ndarray, v3: np.ndarray, v4: np.ndarray, ...
Imports: ```python import typing ``` Type definitions: Input Types: cir.FieldConversion, t.Optional[t.Dict[str, t.Any]] Output Type: t.Dict[str, t.Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: cir.FieldConversion, v2: t.Optional[t.Dict[str, t.Any]]=None) -> t.Dict[str, t.Any]: v3 = {'t...
Imports: ```python import torch from torch import Tensor import typing ``` Type definitions: Input Types: torch.Tensor, Any, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2=None, v3=None, v4=True): v5: Optional[Tensor] = None if v3 is None: v5 ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Tuple[int, int, int] Dependencies: Function Name: v0 Function: ```python def v0(v1) -> Tuple[int, int, int]: v2 = max(v1) v3 = min(v1) return (v3, v2, v2 - v3) ```
Imports: ```python import os import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str=_SGE.STD_TOPOL): with open(os.path.join(v1, v2), 'r') as v3: self.top_lines = v3.readlines() ```
Imports: ```python import typing ``` Type definitions: Input Types: List[float], float Output Type: Optional[float] Dependencies: ```python def v0(v1): return 0 if not v1 else sum(v1) / len(v1) ``` Function Name: v2 Function: ```python def v2(v3: List[float], v4: float=1) -> Optional[float]: if not v3: ...
Imports: ```python import re import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: ```python def v0(v1: str): return re.match('^[a-z]-', v1, re.I) ``` ```python def v2(v3: str): return re.match('^[a-z]', v3, re.I) ``` ```python def v4(v5: list, v6: callable): for v7 in v5: ...
Imports: ```python import random import numpy as np import typing ``` Type definitions: ```python class v0: def __init__(self, v1: Union[List[float], List[int]], v2: Union[List[int], List[float]], v3: Union[List[int], List[float]], v4: float, v5: int, v6: float=0, v7: float=0): assert len(v1) == len(v2), '...
Imports: ```python import typing ``` Type definitions: Input Types: sqlite3.Cursor, str, Optional[tuple[Any, ...]] Output Type: sqlite3.Cursor Dependencies: Function Name: v0 Function: ```python def v0(v1: sqlite3.Cursor, v2: str, v3: Optional[tuple[Any, ...]]=None) -> sqlite3.Cursor: if v3 is None: v4 = ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> int: v1 = sorted(set([int(c) for v2 in v1 if v2.isdigit()]), reverse=True) if v1 and len(v1) >= 2: return v1[1] return -1 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: str): v2 = {} for v3 in v1.split('&'): v4 = str(v3).split('=', 1) if len(v4) < 2: continue (v5, v6) = v4 v2[v5] = v6 return v2 ``` Function...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: typing.Tuple[typing.Union[str, None]] Dependencies: Function Name: v0 Function: ```python def v0(v1) -> typing.Tuple[typing.Union[str, None]]: v2 = v1.find_all('tr')[0] v3 = v2.text.strip() v4 = v3.split(' - ') return...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: List Dependencies: Function Name: v0 Function: ```python def v0(self, v1='') -> List: v1 = v1 if v1 else self.turn if self._pieces_remaining[v1] == 0: return [] else: return self._board.valid_moves(v1) ```
Imports: ```python from datetime import datetime, timezone import typing ``` Type definitions: Input Types: datetime, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: datetime, v2): if v1.tzinfo is None: v1 = v1.astimezone(timezone.utc) return v1.astimezone(tim...
Imports: ```python import os import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = os.path.join(self.checkpoint_dir, 'best_model.pth') self.t_logger.info('Saving best model ...') self._save_model(v1) ```
Imports: ```python import pandas as pd import numpy as np import warnings import typing ``` Type definitions: Input Types: Any Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1) -> pd.DataFrame: v2 = pd.DataFrame.from_dict({'x': [np.nan], 'y': [np.nan], 'z': [np.nan], 'origin...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=None) -> np.ndarray: if v1 is None: raise ValueError('`column` must be specified when calling .to_numpy() on Arrow blocks.') if v1 no...
Imports: ```python import torch import typing ``` Type definitions: Input Types: Union[int, float, Tuple[float, float]], Any Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[int, float, Tuple[float, float]], v2=torch.float32) -> torch.Tensor: if isinstance(v1, tuple):...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: NoReturn Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> NoReturn: if v1: v2 = os.path.abspath(os.path.expanduser(v1)) if os.path.exists(v2): self._extension_file...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any): v2 = id(v1) if v2 in self.visited: return False self.visited.add(v2) return True ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[str]: if 'ntags' not in self.columns: raise ValueError("Tags column 'ntags' not present. Either use the notes table or merge it into your tab...
Imports: ```python import typing ``` Type definitions: ```python class v0(object): def __init__(self, v1: Text, v2: Optional[Text]=''): """Construct an instance of TfxArtifact. Each instance of TfxArtifact wraps an Artifact and its type internally. When first created, the artifact will have an emp...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int, int, [] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int, v3: []): if np.random.binomial(1, v1) == 1: return np.random.choice(v2) return np.random.choice(np.where(v3 ...
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray): assert self.graph.graph_index is not None, 'Environment need to be reset' assert not self.is_done(), 'Environment has already been t...