text
stringlengths
190
325k
Imports: ```python import inspect import typing ``` Type definitions: Input Types: Callable Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Callable): v2 = inspect.signature(v1).parameters return {arg: self.hyper_params[arg] for v3 in v2.keys() & self.hyper_params.keys()}...
Imports: ```python import tensorflow as tf from tensorflow.python.saved_model import loader_impl import typing ``` Type definitions: Input Types: List[tf.train.Example] Output Type: Generator[Mapping[Text, Any], None, None] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[tf.train.Example]) -...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): self._data = v1 self.__log.info('data:{}'.format(self._data)) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self) -> list: v1 = self._getLeftestDerivationPosition() v2 = self._getToppestDerivationPosition() v3 = self.blobsObject.blobs[v2:v2 + 8] v3 = [row[v1:v1 + ...
Imports: ```python import numpy as np from numpy import ndarray as array import typing ``` Type definitions: Input Types: Output Type: (Dict[str, array], Dict[str, Real], Dict[str, Tuple[Real, ...]]) Dependencies: Function Name: v0 Function: ```python def v0() -> (Dict[str, array], Dict[str, Real], Dict[str, Tuple[R...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> bool: if os.path.exists(v1): self.log('Path exists: {}'.format(v1)) return True else: self.log('Path does not...
Imports: ```python import sklearn from sklearn.mixture import GaussianMixture import sklearn.base import typing ``` Type definitions: Input Types: np.ndarray, int, Dict[Any, Any] Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray, v2: int, v3: Dict[Any, Any]) -> np...
Imports: ```python import numpy as np import pandas as pd from numpy.random import RandomState import typing ``` Type definitions: Input Types: int, str, float, int, int, str, bool, float, int Output Type: pd.DataFrame Dependencies: ```python def v0(v1: int, v2: str, v3: List[List[float]], v4: str='1D', v5=False, v6: ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str): if len(v1) != len(v2): raise ValueError('Undefined for sequences of unequal length.') v3 = 0 for v4 in range(len(v1)): ...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python class v0: v1 = 'BasePlayer' def __init__(self, v2: EasyDict, v3: str, v4: 'BattleSharedPayoff', v5: str, v6: str, v7: int) -> None: """ Overview: Initialize base player metadata Arguments: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: 'Point' Dependencies: Function Name: v0 Function: ```python def v0(self) -> 'Point': self.drop_dim('b') return self ```
Imports: ```python import torch import typing ``` Type definitions: Input Types: Any, list, list, Any Output Type: Any Dependencies: ```python def v0(v1, v2: list, v3: list, v4=True): if not v4: raise NotImplementedError('Pinball_loss does not support loss over the horizon') v5 = 0.0 for (v6, v7) i...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> str: v2 = '(§|§§|Art(\\.{,1}))\\s' v2 += '(\\s|[0-9]+(\\.{,1})|[a-z]|Abs\\.|Abs|Satz|Halbsatz|S\\.|Nr|Nr\\.|Alt|Alt\\.|f\\.|ff\\.|und|bis|\\,|;|\\s' ...
Imports: ```python import requests import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str): assert self.imdb_key, 'No imdb_key specified' v3 = self.imdb_urls.get(v2) assert v3, f'No such category: {v2}' ...
Imports: ```python import json import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: with open(self.json_path, 'w') as v1: json.dump(self.loaded, v1, sort_keys=True) ```
Imports: ```python import logging import sys import typing ``` Type definitions: Input Types: str Output Type: logging.Logger Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> logging.Logger: v2 = logging.StreamHandler(stream=sys.stdout) v2.setLevel(logging.INFO) v2.setFormatter(loggi...
Imports: ```python from decimal import Decimal import typing ``` Type definitions: Input Types: Output Type: float Dependencies: ```python def v0(v1): v2 = float(v1) if v2 == float('inf') or v2 == float('-inf'): return int(v1) else: return v2 ``` ```python def v3(v4, v5): v6 = Decimal(...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: v2 = '' v3 = 0 if not v1: return v2 for v4 in range(len(v1)): if v1[v4] == '(': v3 = v4 elif v1...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> dict: v2 = [] for (v3, v4) in v1.items(): v5 = self.builder.make_variable(v3) v6 = self.builder.make_value(v4[0]) v7 ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> bytes: v2 = v1.encode('utf-16le') return v2 ```
Imports: ```python from spacy.scorer import PRFScore, Scorer from spacy.training import Example from spacy.util import registry import typing ``` Type definitions: Input Types: Iterable[Example] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Iterable[Example]): v2 = PRFScore() ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: for v1 in self._sdk_config.metric_readers: v1.collect() return True ```
Imports: ```python from threading import Event, Lock, Thread, current_thread import typing ``` Type definitions: Input Types: Callable, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Callable, v2: str, *v3: object, **v4: object) -> None: v5 = Thread(target=self._thread_...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, **v1) -> None: self._scan_lines = v1['ScanLines'] self._scan_line_bytes = v1['ScanLineBytes'] self._scan_line_stride = v1['ScanLineStride'] self._plan...
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) -> int: for v3 in range(v2, -1, -1): if v3 in self._snap and v1 in self._snap[v3]: return self._snap[v3][v1] retu...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.env.__exit__() self.env = None ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: for (v1, v2, v2) in self.nested_documents_specs: self.columns_to_ignore.append(v1) ```
Imports: ```python import shutil import multiprocessing import typing ``` Type definitions: Input Types: List[str], pathlib.Path Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str], v2: pathlib.Path): v3 = ((file, v2) for v4 in v1) with multiprocessing.Pool() as v5:...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> bool: if not v1 and (not v2): return True if not v1 or not v2: return False if len(v1) != len(v2): re...
Imports: ```python import typing ``` Type definitions: Input Types: int, Any Output Type: tuple Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2=1) -> tuple: while v1 % v2 != 0: v2 -= 1 v3 = int(v1 / v2) return (v2, v3) ```
Imports: ```python import math import typing ``` Type definitions: Input Types: object, object Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: object, v2: object) -> list: v3 = v1.year v4 = v2.year v5 = math.ceil(v1.month / 3) v6 = [] for v7 in range(v3, v4 +...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: Optional[datetime.timedelta], v0 Output Type: Union[str, v0] Dependencies: Function Name: v1 Function: ```python def v1(v2: Optional[datetime.timedelta], *, v3: v0='‒∶‒‒') -> Union[str, v0]: if v2 is None: r...
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 = 3600 v3: int = 60 (v4, v5) = divmod(v1, v2) (v6, v7) = divmod(v5, v3) return f'{int(v4):02}:{int(v6):02}:{v7:05.2f}' ``...
Imports: ```python import typing ``` Type definitions: Input Types: str, dict, int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: dict, v3: int=0, v4: int=0): v5 = self.__web_element(v2, v3, v4) v5.click() v5.clear() v5.send_keys(v1) return self...
Imports: ```python import typing ``` Type definitions: Input Types: google.api_core.page_iterator.HTTPIterator Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: google.api_core.page_iterator.HTTPIterator) -> List[str]: v2 = [] for v3 in v1: v2.append(v3.name) v4...
Imports: ```python import sys, os, shutil, subprocess import typing ``` Type definitions: Input Types: int, str Output Type: Any Dependencies: ```python def v0(v1: str): v2: str = v1 + '~' shutil.move(v1, v2) with open(v2, 'r') as v3: v4 = v3.read().replace('\r\n', '\n') v5 = open(v1, 'a') ...
Imports: ```python import hashlib import typing ``` Type definitions: ```python @dataclass class v0: v1: Type v2: TypeScriptCode v3: dict @property def v4(self): if issubclass(self.type, Serializer): v5 = get_serializer_prefix(self.type) else: v5 = self.type....
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: str=None) -> dict: v4 = f'/users/{v1}/mailFolders' if v3: v4 += f'/{v3}/childFolders' v5 = {'displayName': v2} ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: float Dependencies: ```python def v0(): v1 = int(input('Enter an number: ')) return v1 * 2 ``` Function Name: v2 Function: ```python def v2() -> float: v3 = float(v0()) return v3 ```
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('_K') ``` ```python v1 = TypeVar('_V') ``` Input Types: Sequence[Tuple[v0, v1]], v0 Output Type: v1 Dependencies: Function Name: v2 Function: ```python def v2(v3: Sequence[Tuple[v0, v1]], v4: v0) -> v1: for (v5, v6) in v3: if v4 ...
Imports: ```python import typing ``` Type definitions: Input Types: cil_ast.InstructionNode Output Type: cil_ast.InstructionNode Dependencies: Function Name: v0 Function: ```python def v0(self, v1: cil_ast.InstructionNode) -> cil_ast.InstructionNode: self.instructions.append(v1) return v1 ```
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: v2 = os.path.join(v1, 'data.pd') self.data.to_pickle(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: str, v3: str): v1.add_argument('--logdir', type=str, default='logs', help='The directory where the logs will be created (default: logs)') v1.add...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T', bound='PybindParser') ``` Input Types: declarations.calldef_members.destructor_t, IO Output Type: None Dependencies: Function Name: v1 Function: ```python def v1(self: Type[v0], v2: declarations.calldef_members.destructor_t, v3: IO) -> ...
Imports: ```python import typing ``` Type definitions: ```python class v0(object): v1 = '\x1b[42;33m' v2 = '\x1b[m' v3 = '{' v4 = '}' v5 = '\x1b[44;33m' v6 = [' ', '\n', '.', ',', ':', ';'] v7: Propaganda_Techniques = None def __init__(self, v8: anwol.AnnotationWithOutLabel=None, v9: st...
Imports: ```python import requests import typing ``` Type definitions: Input Types: Any, Any Output Type: requests.Response Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, *v3, **v4) -> requests.Response: v5 = getattr(requests, v1) v4.setdefault('headers', self._headers) v4.setdef...
Imports: ```python import typing ``` Type definitions: Input Types: bs4.BeautifulSoup Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: bs4.BeautifulSoup) -> str: v2 = v1.find('p', class_='conditionbox-info-txt conditionbox-info-txt--all') or v1.find('p', class_='conditionbox-info-tx...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = self.re.compile(self._chapter_re) return v1.search(self.chapter).group(1) ```
Imports: ```python from datetime import datetime, timedelta import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self) -> None: v1 = datetime.now() await self.record_health() v2 = max(self.poll_delay_s, 0.5) await self.run...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v1 = v1.replace('--', 'DOUBLEDASH') if v1.endswith('-'): v1 = v1[:-1] + 'SINGLEDASH' return v1 ```
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 = {0: os.path.join(v1, 'init.ckpt')} for v3 in os.listdir(v1): if v3.endswith('ckpt') and v3.startswith('epoch'): v4 = ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```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] = ...
Imports: ```python import re import typing ``` Type definitions: Input Types: Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Optional[str]: for v1 in self.pr.get_files(): v2 = re.match('changes/\\d+-(\\w*).md', v1.filename) if not v2: co...
Imports: ```python import typing ``` Type definitions: Input Types: int, str Output Type: dict Dependencies: ```python def v0(v1: int, v2: str) -> List[str]: v3 = v1 // 2 v4 = {'left': 0, 'right': 0, 'up': 0, 'down': 0} for (v5, v6) in enumerate(v2): if v6 == 'O': v7 = v5 % v1 ...
Imports: ```python import typing ``` Type definitions: ```python class v0(Enum): v1 = 0 v2 = 1 v3 = 2 v4 = 3 v5 = 4 v6 = 5 v7 = 6 v8 = 7 v9 = 8 v10 = 9 v11 = 10 v12 = 11 v13 = 12 v14 = 13 v15 = 14 v16 = 15 v17 = 16 v18 = 17 v19 = 18 v20 = 1...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: list) -> list: v2 = [] for v3 in range(len(v1)): if v1[v3] in v2: None else: v2.append(v1[v3]) ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Optional[IO[AnyStr]] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> Optional[IO[AnyStr]]: try: return open(v1, 'r') except FileNotFoundError: return None ```
Imports: ```python import typing ``` Type definitions: ```python class v0(BaseClient): def __init__(self, v1: str, v2: bool, v3: bool, v4: str, v5: Dict): v6 = v5.get('identifier') v7 = v5.get('password') if v6 == API_USERNAME: self.base_headers = {'Version': v4, 'SEC': v7} ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1) -> None: while True: (v2, v3) = await v1.wait_for('reaction_add', check=self._check) await self._dispatch(v2, v3) ```
Imports: ```python import sqlite3 import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.conn = sqlite3.connect(self.db_path, check_same_thread=False) self.cur = self.conn.cursor() ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> int: if v1 < 0 or self.max_value <= v1: return 0 return self.__fw.get_range(v1, v1 + 1) ```
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.compile('^', re.M).sub(' ', v1).strip() v1 = re.compile(' +$', re.M).sub('', v1) return v1 ```
Imports: ```python import pandas as pd import numpy as np import typing ``` Type definitions: Input Types: Any, str, Any Output Type: Any Dependencies: ```python def v0(v1, v2): v3 = list(v1.columns) v4 = v2 for v5 in v3: v4 = v4 + ' & ' + str(v5) v4 = v4 + ' \\\\' + '\n' + '\\hline' + '\n' ...
Imports: ```python from json import load import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> Any: v2: Any try: with open(file=v1, mode='r') as v3: v2 = load(v3) v3.close() return v2...
Imports: ```python import json import typing ``` Type definitions: Input Types: str, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: int): v3 = [] with open('db/accounts.json', 'r') as v4: for (v5, v6) in json.load(v4).items(): if v6['host'] == ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: try: self.__mangas = self._get_manga_list_from_file() except: self.update() ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.array Output Type: np.array Dependencies: ```python def v0(v1): print('\n[red]INPUT ERROR:[/red]') print(f'Each `Detection` object should have a property `points` of shape (num_of_points_to_track, 2), not {v1.shape}. Chec...
Imports: ```python import functools import typing ``` Type definitions: ```python v0 = TypeVar('PartialT') ``` Input Types: Callable[..., v0] Output Type: Callable[..., v0] Dependencies: Function Name: v1 Function: ```python def v1(v2: Callable[..., v0], *v3: Any, **v4: Any) -> Callable[..., v0]: v5 = functools.pa...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, int, int, Optional[bool], Optional[list], Optional[dict], Optional[dict], 'microstrategy_api.task_proc.task_prod.TaskProc' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=0, v2: int=0, v3: int=10000...
Imports: ```python import typing ``` Type definitions: Input Types: bytes, bytes, Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes, v2: bytes, *, v3=None) -> None: v4 = self.absolute_path(v1) self.container.set(v4, v2, store_batch=v3) ```
Imports: ```python import os import typing ``` Type definitions: Input Types: Any, Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> str: v3 = v1[1] if not os.path.isabs(v3): v3 = os.path.join(v2, v3) v4 = v1[2] if not os.path.isabs(v4): v4 = os...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.emitter.emit_line('line;') self.emitter.emit_line('a {') self.emitter.emit_line('f();') self.emitter.emit_line('}') assert self.emit...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> int: v2 = self.x - v1.x v3 = self.y - v1.y return (v2 ** 2 + v3 ** 2) ** 0.5 ```
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: Tuple[NamedTuple] Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame) -> Tuple[NamedTuple]: v2 = tuple(v1.itertuples(name='scientist', index=False)) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Union[List, Tuple], Union[List, Tuple] Output Type: Tuple[int] Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[List, Tuple], v2: Union[List, Tuple]) -> Tuple[int]: v3 = tuple((v1.index(o) for v4 in v2)) return v3 ```
Imports: ```python import logging import os import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = logging.getLogger('ops') if not os.path.isdir('plugins/adversary/.logs'): os.mkdir('plugins/adversary/.logs') ...
Imports: ```python import typing ``` Type definitions: Input Types: bytes, int Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: bytes, v2: int) -> float: v3 = v1[v2] << 8 | v1[v2 + 1] if v3 > 32768: v3 = v3 - 65536 return float(v3) / 10 ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, str Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: str) -> np.ndarray: v3 = v1[:, :, 0] * 0.299 + v1[:, :, 1] * 0.587 + v1[:, :, 2] * 0.114 v4 = np.append(...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('_T') ``` Input Types: Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(self) -> v0: if not hasattr(self, 'data'): self.page.pull() return self.data ```
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 = {} if self._kwargs is None else dict(self._kwargs) v2.update(self.params_to_dict()) return v1 in v2.keys() ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1) -> None: assert v1.prefixize('key1') == 'TEST_KEY1' assert v1.unprefixize('TEST_KEY1') == 'key1' ```
Imports: ```python from itertools import product import typing ``` Type definitions: Input Types: str Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> list: v2 = {'2': ['a', 'b', 'c'], '3': ['d', 'e', 'f'], '4': ['g', 'h', 'i'], '5': ['j', 'k', 'l'], '6': ['m', 'n', 'o'], '...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import init from torch.nn import LSTM, Linear, BatchNorm1d, Parameter from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence, PackedSequence import typing ``` Type definitions: Input Types: torch.Tenso...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: jnp.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: jnp.ndarray): v2 = v1.mean(axis=0) v3 = np.abs(v1 - v2).max() v4 = 0.5 * v3 * v3 return (v2, v4) ```
Imports: ```python import typing ``` Type definitions: Input Types: str, bool, int, int Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: bool=False, v3: int=0, v4: int=999) -> list: v5 = self.get(f'{self.CONFIG_PREFIX}/domain/{self.domain_uuid}/devices/devicerecords/...
Imports: ```python from datetime import datetime import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.start = datetime.now().replace(day=1) self.end = datetime.now() ```
Imports: ```python import json import typing ``` Type definitions: Input Types: str, str Output Type: Union[List, Any] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str='utf-8') -> Union[List, Any]: with open(v1, 'r', encoding=v2) as v3: v4 = json.load(v3) v3.close() ...
Imports: ```python from random import shuffle, randrange import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> int: v2 = 10 v3 = 30 v4 = 60 v5 = 150 if v1 <= 1: v6 = v4 v7 = v5 else: ...
Imports: ```python import weakref import typing ``` Type definitions: Input Types: Window.Window Output Type: None Dependencies: ```python def v0(): self.__dialogs.remove(weakref.ref(dialog)) ``` Function Name: v1 Function: ```python def v1(self, v2: Window.Window) -> None: def v3(): self.__dialogs.re...
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._check_connection() self._dispatch('post', self._optimize_url(v1)) ```
Imports: ```python import sys import sympy as sym import typing ``` Type definitions: Input Types: Union[list, sym.Matrix, sym.Expr], List[str], str Output Type: Tuple[list, int] Dependencies: ```python def v0(v1: Union[list, sym.Matrix, sym.Expr], v2: List[str], v3: str='[pp]'): v4 = [0, 1, 2, 4, 5, 8] v5 = [...
Imports: ```python import typing ``` Type definitions: Input Types: object, List[str] Output Type: object Dependencies: Function Name: v0 Function: ```python def v0(self, v1: object, v2: List[str]) -> object: for v3 in v2: v4 = getattr(v1, v3, None) if v4 is not None: v1 = v4() ret...
Imports: ```python import xarray as xr import typing ``` Type definitions: Input Types: esa_safe.PathType, T.Any, T.Optional[T.Dict[str, str]] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: esa_safe.PathType, v2: T.Any, v3: T.Optional[T.Dict[str, str]]=None) -> None: v4 = xr.open...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> bool: v2 = (self._p2[0] - self._p1[0], self._p2[1] - self._p1[1]) v3 = (v1[0] - self._p1[0], v1[1] - self._p1[1]) return v2[0] * v3[1] - v2[1] *...
Imports: ```python import typing ``` Type definitions: Input Types: Any, bool, str, bool, bool Output Type: Any Dependencies: ```python def v0(v1: int): if v1 == 1: return 9 elif v1 == 2: return 3 elif v1 == 4: return 7 elif v1 == 6: return 6 else: return v1 ...
Imports: ```python import typing ``` Type definitions: Input Types: str, dict Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: dict) -> bool: v3 = 0 for v4 in v1.split(' '): try: v5 = v2[v4.lower()] v3 += 1 except: pa...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python class v0: def __init__(self, v1: np.array=None, v2: np.array=None): if v1 is not None: self.palette = v1 v3 = np.linspace(0, 255, len(v1), dtype=np.uint8) v4 = v1[:, 0] v5 = v...
Imports: ```python import os import typing ``` Type definitions: ```python class v0: def __init__(self) -> None: self.gh = Github(login_or_token=os.environ['GITHUB_ISSUE_TOKEN']) def v1(self, v2: str, v3: int, v4: bool=True) -> None: v5 = self.gh.get_repo(v2).get_pull(v3) if v5.mergeab...
Imports: ```python import string import typing ``` Type definitions: Input Types: str Output Type: (str, str) Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> (str, str): v2 = string.ascii_letters + string.digits + '_' v3 = 0 while v3 < len(v1) and v1[v3] in v2: v3 += 1 r...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1): self.label = tk.Label() self.input = tk.Entry() self.id = v1 self.data = None def v2(self, v3, v4): if self.input.cget('text'): self.hide() self.label ...