text
stringlengths
190
325k
Imports: ```python from os import path, getcwd import typing ``` Type definitions: ```python class v0: def __init__(self, v1, v2=[]): self._name = v1 self._operands = v2 self._parent = None @property def v3(self): return self._name @v4.setter def v4(self, v5): ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1) -> list: v2 = list() for v3 in v1: v2.append([tuple(map(int, v3[0].split(','))), tuple(map(int, v3[1].split(',')))]) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: self.canvas.delete('all') for v2 in range(self.nr * self.nc): self._draw_cell(v1[v2], v2) ```
Imports: ```python from os import path import typing ``` Type definitions: Input Types: str Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Optional[str]: if not path.exists(v1): return None v2 = self.storage.all(with_archived=True) self.emit...
Imports: ```python import typing ``` Type definitions: Input Types: 'ArrayManager', Any Output Type: 'ArrayManager' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'ArrayManager', v2) -> 'ArrayManager': v3 = self.arrays v4 = v1.arrays v5 = [v2(left, right) for (v6, v7) in zip(v3, v4)]...
Imports: ```python from typing import Any, List, Optional, Tuple, Union, Dict, cast, Callable import typing ``` Type definitions: ```python v0 = Union[sqlite3.Connection, ConnectionPlus] ``` Input Types: v0, str Output Type: sqlite3.Cursor Dependencies: ```python @contextmanager def v1(v2: v0): if not hasattr(v2, '...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: tuple Dependencies: Function Name: v0 Function: ```python def v0(self) -> tuple: v1 = 'get_text_color' v2 = '\n Public Function get_text_color(measurable)\n Dim oR long\n Dim oG long\n Dim...
Imports: ```python import numpy as np from numpy.core.fromnumeric import ndim from numpy.core.records import get_remaining_size import typing ``` Type definitions: Input Types: list, int Output Type: Any Dependencies: ```python def v0(v1: np.ndarray, v2): v3 = [] for v4 in v2: v3.append(v4.shape[1]) ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: v1 = 0 for v2 in self.documents: for v3 in v2.sentences: v1 += len(v3.entities) return v1 ```
Imports: ```python from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union, cast import typing ``` Type definitions: Input Types: int Output Type: Optional[int] Dependencies: ```python def v0(v1: LoggingTransaction) -> List[Tuple[str, str, int, int, str, bool, str, int]]: v2 = '' if before: ...
Imports: ```python import pandas as pd import numpy as np import os import typing ``` Type definitions: Input Types: str, str, int, str, Any, Any, Any, Any, Any, Any Output Type: Any Dependencies: ```python def v0(v1: pd.DataFrame, v2='candid'): v3 = ['SN Ia', 'SN Ia-91T-like', 'SN Ia-91bg-like', 'SN Ia-CSM', 'SN ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, Any Output Type: Any Dependencies: ```python def v0(v1): if v1: return v1.strip().lower() return '' ``` Function Name: v2 Function: ```python def v2(v3: str, v4: str, v5): if v4 in ['NN', 'NNP']: if v5[v5.noun == ...
Imports: ```python import typing ``` Type definitions: Input Types: Optional['IntCode'] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional['IntCode']=None): v2 = self.queue.pop() self.on_input(v2, v1, last=True) return v2 ```
Imports: ```python import csv import typing ``` Type definitions: Input Types: Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1='') -> str: if not v1: v1 = f'{self.nem_filename()}.csv' with open(v1, 'w', newline='') as v2: v3 = csv.writer(v2, quoting=csv...
Imports: ```python import datetime from itertools import groupby import typing ``` Type definitions: Input Types: str Output Type: datetime.timedelta Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> datetime.timedelta: v1 = v1.lower() (v2, v3) = ([], []) v4 = {'h': 'hours', 'hour': '...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: v0, Sequence[str], Sequence[any] Output Type: None Dependencies: Function Name: v1 Function: ```python def v1(v2: v0, v3: Sequence[str], v4: Sequence[any]) -> None: if len(v3) != len(v4): raise AssertionErro...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.restart_count += 1 for v1 in (self._started, self._stopped, self._shutdown, self._crashed): v1.clear() self._crash_reason = None ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> bool: v3 = False if isinstance(v1, int) and (v2 == 'SMALLINT' or v2 == 'INTEGER' or v2 == 'BIGINT' or (v2 == 'NUMERIC') or (v2 == 'SERIAL')): ...
Imports: ```python import pickle import typing ``` Type definitions: Input Types: Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1=None, v2: int=None): super().dumps() with open(self._getCacheFilePath(), 'wb') as v3: pickle.dump({'data': v1, 'timeout': self...
Imports: ```python import typing ``` Type definitions: Input Types: Tensor, Tensor, Optional[Tensor], float Output Type: Tuple[Tensor, Tensor, Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor, v2: Tensor, v3: Optional[Tensor]=None, v4: float=1.0) -> Tuple[Tensor, Tensor, Tensor]: ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: with open(v1) as v2: self._config.read_string(f'[{self.section}]\n' + v2.read()) ```
Imports: ```python import typing ``` Type definitions: Input Types: float, float, float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float, v3: float): self.__center = [v1, v2, v3] return self ```
Imports: ```python import typing ``` Type definitions: Input Types: str, Dict[str, Any] Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Dict[str, Any]) -> Dict[str, Any]: v2.update({'fee': {'currency': self.get_pair_quote_currency(v1), 'cost': v2['cost'] *...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self) -> None: if self.was_login_executed: await self.logout() await self._session.close() ```
Imports: ```python import typing ``` Type definitions: Input Types: Callable Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Callable): if not v1.__module__: return v1.__qualname__ return '%s.%s' % (v1.__module__, v1.__qualname__) ```
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 = {'Content-Type': 'application/json'} if self.token: v1['Authorization'] = self.user_id + ' ' + self.token return...
Imports: ```python import typing ``` Type definitions: Input Types: dict, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: dict, v2: int=0) -> int: for v3 in v1.values(): v4 = 0 if v3 == 0 else 1 v2 = 2 * v2 + v4 return v2 ```
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: Output Type: pd.Series Dependencies: Function Name: v0 Function: ```python def v0(self) -> pd.Series: v1 = pd.Series(dtype=float) v2 = None if self.criteria_start == 0 else self.criteria_start v3 = None if self.criter...
Imports: ```python import os import zipfile import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str): with zipfile.ZipFile(v2, mode='a') as v3: v4 = os.path.basename(v1) v3.write(v1, arcname=v4) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: dict Dependencies: ```python def v0(v1) -> bool: return hasattr(v1, 'optimizer') ``` Function Name: v2 Function: ```python def v2(v3) -> dict: if v0(v3): v4 = {'scheduler': v3.state_dict(), 'optimizer': v3.optimizer.st...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str]) -> str: if len(v1) == 1: return v1[0] elif len(v1) == 3 and v1[0] == v1[1]: return v1[0] + ',' + v1[2] elif len(v1) == 3 ...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: float) -> str: if v1 > 3600: return f'{v1 / 3600:2.2f} h' elif v1 > 60: return f'{v1 / 60:2.2f} min' return f'{v1:2.2f} s' ```
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=True) -> float: if self.is_final() and v1: return -1e309 return self.latest_metric ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, attr.Attribute, int Output Type: NoReturn Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: attr.Attribute, v3: int) -> NoReturn: if v3 < 0: raise ValueError(f'Expected `{v2.name}` to be non-negative, found `{v3}`.')...
Imports: ```python import os import typing ``` Type definitions: Input Types: Dict[str, str], Union[str, Path] Output Type: Any Dependencies: ```python def v0(v1: Path) -> Path: try: return v1.relative_to(os.getcwd()) except ValueError: return v1 ``` Function Name: v2 Function: ```python def v2...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.array Output Type: Tuple[np.array, Tuple] Dependencies: Function Name: v0 Function: ```python def v0(v1: np.array) -> Tuple[np.array, Tuple]: v2 = np.max(v1, axis=0) v3 = np.min(v1, axis=0) v1 = (v1 - v3) / (v2 - v3)...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._run_event('on_experiment_start') for self.stage in self.experiment.stages: self._run_stage() self._run_event('on_experiment_end') `...
Imports: ```python import operator from collections import defaultdict from collections import OrderedDict import typing ``` Type definitions: Input Types: Union[int, float], Dict Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[int, float], v2: Dict) -> int: v3 = getatt...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: with self.nested('waiting for the X11 server'): while True: v1 = 'journalctl -b SYSLOG_IDENTIFIER=systemd | ' + 'grep "Reached target...
Imports: ```python import fnmatch import typing ``` Type definitions: Input Types: 'creation.ResourceSubclass', str Output Type: bool Dependencies: ```python def v0(v1: typing.Optional[str], v2: str) -> bool: return fnmatch.fnmatch((v1 or '').lower(), (v2 or '*').lower()) ``` Function Name: v3 Function: ```python ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=None): for v2 in self.materials: if v2.name == v1: return v2 return None ```
Imports: ```python import logging import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str): logging.debug('Sending %s: %s', self.client_id, v1) await self.websocket.send_text(v1) ```
Imports: ```python import typing ``` Type definitions: ```python v0 = google.protobuf.message.Message ``` Input Types: str, v0, Optional[int], Optional[int], Optional[int] Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(self, *, v2: str, v3: v0, v4: Optional[int]=DEFAULT_WAIT_FOR_READY_SEC, ...
Imports: ```python import math import typing ``` Type definitions: Input Types: dict[int, list[str]] Output Type: int Dependencies: ```python def v0(v1: list[str], v2: set[str]) -> int: return sum([1 for v3 in v1 if v3 in v2 or v3[::-1] in v2]) ``` Function Name: v4 Function: ```python def v4(v5: dict[int, list[st...
Imports: ```python from typing import Any, TypedDict, cast import typing ``` Type definitions: ```python class v0: v1: Callable v2: Any v3: str def __init__(self, v4: Any=None) -> None: """Instantiate a selector.""" if v4 is None: v4 = {} self.config = self.CONFIG_SC...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: int): self.put_rotated_diamond(v1, v2, v3, 'black') self.put_rotated_diamond(int(v1 * 0.6), v2, v3, 'white') ```
Imports: ```python import typing ``` Type definitions: ```python v0 = Any ``` ```python v1 = Dict ``` ```python v2 = List ``` Input Types: Any, Coroutine, v1[v0, Coroutine], List[v0] Output Type: None Dependencies: ```python def v3(v4: Any, v5: v2[v0]) -> v0: if v4.end < v5[0] or v4.start > v5[-1]: return N...
Imports: ```python import typing ``` Type definitions: Input Types: List[Dict[str, Any]] Output Type: List[Any] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Dict[str, Any]]) -> List[Any]: v2: List[Any] = [] for v3 in v1: for v4 in v3: v2.append(v3[v4]) return v2 ...
Imports: ```python import argparse from getpass import getpass import typing ``` Type definitions: Input Types: Output Type: argparse.Namespace Dependencies: Function Name: v0 Function: ```python def v0() -> argparse.Namespace: v1 = argparse.ArgumentParser(description='This script will create a SVM, volume and t...
Imports: ```python import typing ``` Type definitions: Input Types: Type Output Type: Callable Dependencies: ```python def v0(v1: Type) -> Callable: v2 = v1.__name__ if not hasattr(klass, v2): raise AttributeError(f'{klass} has no method named {v2} to inherit from') v3 = v1.__doc__ or '' v1.__d...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = os.getenv(v1) if not v2: raise Exception('Environment var must be set: %s' % v1) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1: List[Tuple[str, float]] = [('5.0', 5.0), ('10.0', 10.0), ('-5.0', -5.0), ('-10.0', -10.0), ('5 / 2', 2.5), ('2.5 * 2.0 + 7.0', 12.0)] for (v2, v3...
Imports: ```python import typing ``` Type definitions: Input Types: List, float, float Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: List, v2: float, v3: float) -> None: v1.append((v2, v3, -0.1)) v1.append((v2, v3, 0.1)) v1.append((v2 * 0.95, v3 * 0.95, -0.1)) v1.app...
Imports: ```python import math import random import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self) -> float: v1 = self.const if self.alpha_num > 0: v1 += self.inv_alpha_arr.dot(self.square_buf[-self.alpha_num:]) if sel...
Imports: ```python import csv import logging import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: logging.info('>>> Loading in aliases file.') v1 = {} with open(self.sequence_aliases_fp, 'r') as v2: v3 = csv.r...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1 = dict() v1['coordinates'] = self.coordinates() for (v2, v3) in self.fields.items(): v1[v2] = v3 return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Optional[Dict[str, Dict[str, Any]]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Optional[Dict[str, Dict[str, Any]]]: v2 = self.get_style(v1) if v2: return v2.get('ColorMappings') r...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False) -> int: v2 = [] v3 = [] return len(self.build_inputs_with_special_tokens(v2, v3 if v1 else None)) ```
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame, pd.DataFrame, int, int Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: pd.DataFrame, v3: int=10, v4: int=1) -> float: v5 = v1.price.min() * v3 v6 = v2.price.min() * v4 v7 =...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): v2 = f'{self.endpoint}/v1/unit-reservation-buffers/{v1}' v3 = self._headers() return self._delete(v2, json={'data': {'type': 'unit-reservation...
Imports: ```python import typing ``` Type definitions: ```python v0 = np.int8 ``` Input Types: np.ndarray, v0, int, Any, Any Output Type: bool Dependencies: Function Name: v1 Function: ```python def v1(v2: np.ndarray, v3: v0, v4: int, v5, v6) -> bool: if v4 >= 3 and v3 < 7: v7 = v2[v4 - 3:v4 + 1, v3] ...
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v1 = re.sub('[−‒—]', '–', v1) v1 = re.sub('[‐‑]', '-', v1) v1 = re.sub('\\s*?(–)\\s*?', ' \\g<1> ', v1) return v1 ```
Imports: ```python import socketserver import threading import logging import typing ``` Type definitions: ```python class v0(object): def __init__(self, v1: bc.GameMap, v2=logging.DEBUG, v3='server.log', v4=10000, v5=50, v6=False, v7=0): self.terminal_viewer = v6 self.extra_delay = v7 self...
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._delete_request(f'{self._base_url}/accounts/{v1}') return v2 ```
Imports: ```python import cv2 import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray, int Output Type: np.ndarray Dependencies: ```python def v0(v1: np.ndarray, v2: int, v3: bool=False) -> np.ndarray: if v3: v4 = np.zeros(v1.shape[:2], dtype=np.uint8) v4 = cv2.pu...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = '\n def g(ar: Readonly[List[int]]):\n (a, b) = arr\n c = readonly(5)\n c = a\n c = b\n ' ...
Imports: ```python import torch from torch import nn import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, torch.Tensor, Optional[torch.Tensor], Optional[torch.Tensor], Optional[torch.Tensor] Output Type: Tuple[torch.Tensor, torch.Tensor, torch.Tensor] Dependencies: ```python @torch.jit.script d...
Imports: ```python import typing ``` Type definitions: Input Types: dict, dict Output Type: None Dependencies: ```python def v0(v1: dict, v2) -> float: v3 = v1['presupuesto semanal'] + v1['adicional semana'] - v2 return v3 ``` ```python def v4(v5: dict) -> float: v6 = 0 if v5['carro']: v6 += 45...
Imports: ```python import os import typing ``` Type definitions: Input Types: Any Output Type: List[Tuple[str, str]] Dependencies: Function Name: v0 Function: ```python def v0(v1) -> List[Tuple[str, str]]: v2 = [] if not os.path.exists(v1): return v2 with os.scandir(v1) as v3: for v4 in v3...
Imports: ```python import typing ``` Type definitions: Input Types: nx.MultiDiGraph Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: nx.MultiDiGraph): for (v2, v3) in list(v1.nodes(data=True)): v4 = v3['pb'] v5 = 0 while v5 < len(v4.input): if v4....
Imports: ```python import typing ``` Type definitions: Input Types: str, Iterable[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Iterable[str]) -> None: self._choice = None if not self._cleaned_up: self._choice = self.win.query_choice(v1, v2) s...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1) -> int: try: return int(v1, 0) except ValueError: v1 = '0x' + v1 return int(v1, 16) ```
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: float) -> str: v2 = int(v1) v3 = int(v2 / 3600) v4 = int((v2 - v3 * 3600) / 60) v5 = int(v2 - v3 * 60 * 60 - v4 * 60) return '{:0>2d}:{:0>2d}:{:...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Optional[str]: self.logger.debug('Looking up direction: %s', v1) return self._get_value(key=v1, source=self._directions) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3) -> str: for v4 in v1.get_pipelines(v2, v3): v5 = v1.get_workflows(v4['id'])[0] if v5['status'] == 'success': print(f...
Imports: ```python from pathlib import Path import typing ``` Type definitions: Input Types: Union[str, Path] Output Type: Any Dependencies: ```python def v0(v1: Union[str, Path]) -> Path: if not isinstance(v1, Path): v1 = Path(v1) return v1 ``` Function Name: v2 Function: ```python def v2(v3: Union[st...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[Tuple[str, str]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[Tuple[str, str]]: v1 = self.metadata v2 = [] for v3 in self.metadata_file_types: v4 = v1.spec[v3].file_ext v5 = v...
Imports: ```python import argparse import typing ``` Type definitions: Input Types: argparse.ArgumentParser, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: argparse.ArgumentParser, v2: int=2048): v3 = v1.add_parser('create-key', help='Create a key', description='You can set a ...
Imports: ```python import datetime as dt import typing ``` Type definitions: Input Types: dt.datetime, int Output Type: dt.datetime Dependencies: Function Name: v0 Function: ```python def v0(v1: dt.datetime, v2: int) -> dt.datetime: if v1 is None: raise ValueError('start_date_time has no value') if v2...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Iterable Dependencies: Function Name: v0 Function: ```python def v0(self) -> Iterable: v1 = self.query or {} v2 = list(self.target.distinct(self._target_keys_field, criteria=v1)) v3 = [] for v4 in v2: if isinstan...
Imports: ```python import typing ``` Type definitions: ```python v0 = Callable[[], ParseResult] ``` ```python v1 = tuple[bool, tuple['Node']] ``` Input Types: v0, int, int Output Type: v0 Dependencies: ```python def v2(v3, v4: v0, v5: int, v6: int=-1) -> v1: v7 = v3.get_position() v8 = v7 v9 = () v10 = ...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, str], bool Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, str], *, v2: bool=True) -> str: v3 = '' for v4 in sorted(v1): v5 = v1[v4] if v2: v5 = v5.replace('\n', ...
Imports: ```python import math import numpy as np import typing ``` Type definitions: Input Types: np.array, np.array, int Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: np.array, v2: np.array, v3: int=64) -> list: v4 = v1.shape[1] v5 = [] v6 = list(np.random.permutation(...
Imports: ```python import torch import typing ``` Type definitions: Input Types: typing.Dict[str, torch.Tensor] Output Type: typing.Dict[str, torch.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: typing.Dict[str, torch.Tensor]) -> typing.Dict[str, torch.Tensor]: v2 = {} for v3 in ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if self.namespace is not None: return v1 + f' -n {self.namespace}' return v1 ```
Imports: ```python import inspect import typing as t import typing ``` Type definitions: Input Types: hikari.MessageCreateEvent Output Type: t.Optional[context_.prefix.PrefixContext] Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: hikari.MessageCreateEvent, cls: t.Type[context_.prefix.Prefi...
Imports: ```python from math import ceil import typing ``` Type definitions: Input Types: int, int, dict Output Type: [dict] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=1, v2: int=50, v3: dict=False) -> [dict]: v4 = [] v3 = {} if not v3 else v3 if not str(v1).isnumeric() or in...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list) -> list: v2 = v1[0].str.contains('https://pbs.twimg.com/|.png|.jpg').astype(int).values v2 = v2.reshape(-1, 1) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: bool=True): v3 = self.pushlist if v2 and v3.hasSpy(v1['id_str']): return True if not v1['default_profile_image'] and (not v1['prot...
Imports: ```python import math import typing ``` Type definitions: Input Types: Union[int, float], Union[int, float] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[int, float], v2: Union[int, float]) -> str: if not isinstance(v1, int) and (not isinstance(v1, float)): ...
Imports: ```python import torch import torch.nn as nn import typing ``` Type definitions: Input Types: torch.Tensor Output Type: Tuple[torch.Tensor, torch.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: v2 = self.cls_score(self.cls_s...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F import typing ``` Type definitions: Input Types: List[torch.Tensor], List[torch.Tensor] Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[torch.Tensor], v2: List[torch.Tensor]) -> to...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self._x < len(self._s): self._s = self._s[:self._x] + self._s[self._x + 1:] ```
Imports: ```python import functools from contextlib import closing from io import StringIO import typing ``` Type definitions: Input Types: typing.Sequence[typing.Mapping], bool, typing.Sequence[typing.Text] Output Type: Any Dependencies: ```python def v0(v1: typing.Sequence[typing.Mapping], v2: int=5) -> typing.List[...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): with self.signal_queue_lock: self.signal_queue.append(v1) self.signal_queue_counter.release() ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: if self._src == 'dict': if not isinstance(self._dict, dict): raise TypeError(f'Unexpected type. Expected a dict, received a {type(sel...
Imports: ```python import typing ``` Type definitions: ```python @nice_repr class v0: def __init__(self, v1: str, v2: dict, v3: dict, v4: dict, v5: dict, v6: float): self.problem_features = v2 self.pipeline_features = v3 self.environment_features = v4 self.feature_types = v5 ...
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int=0) -> int: if v2 == 1: v1 += self.__bpos elif v2 == 2: v1 += self.dir_entry.get_size() elif v2 != 0: raise...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, int, Tuple[int, int] Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: int, v4: Tuple[int, int]) -> bytes: v5 = self.get_page(v1, v2, v3) return v5.get_tile(v4) ```
Imports: ```python import matplotlib.pyplot as plt import re import typing ``` Type definitions: Input Types: bool, tuple, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False, v2: tuple=('WTX-0{0,4}', ''), v3: str=None): if self.w_matrix.shape[1] not in (1, 2, 3): ...