text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> Any: v2 = self._get_hook() return v2.trigger_sync(self.sync_id) ```
Imports: ```python import typing ``` Type definitions: Input Types: Union[metrics_api.Metric, metrics_api.Observer] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[metrics_api.Metric, metrics_api.Observer]): v2 = v1.name.strip().lower() with self.instruments_lock: ...
Imports: ```python import typing ``` Type definitions: Input Types: int, numpy.ndarray Output Type: numpy.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: numpy.ndarray) -> numpy.ndarray: v2[:] = self._grid[v1].yx_of_lower_left return v2 ```
Imports: ```python import csv import typing ``` Type definitions: Input Types: int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int): with open('guide/tour.csv', mode='r', encoding='utf-8') as v3: v4 = csv.DictReader(v3, delimiter=',') v5 = [r for v...
Imports: ```python import typing ``` Type definitions: Input Types: xarray.DataArray, Optional[xarray.DataArray], Optional[xarray.DataArray] Output Type: xarray.DataArray Dependencies: Function Name: v0 Function: ```python def v0(v1: xarray.DataArray, v2: Optional[xarray.DataArray]=None, v3: Optional[xarray.DataArray...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: pd.DataFrame, bool, Optional[logging.Logger] Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: bool=True, v3: Optional[logging.Logger]=None) -> pd.DataFrame: v4 = ['int16...
Imports: ```python import typing ``` Type definitions: Input Types: float, float, float, float, float, float, float, float, float, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float, v3: float, v4: float, v5: float, v6: float, v7: float, v8: float, v9: float=0, ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: assert 0 <= self._min_depth return self._min_depth == 0 ```
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray, v2: np.ndarray): self._verify_result_shape(v1, v2) self._verify_distribution(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: bytes Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes) -> bytes: v2 = len(v1) v3 = bytearray(v2) for v4 in range(0, v2, 16): v3[v4:v4 + 16] = v1[v4:v4 + 16][::-1] v5 = bytearray(se...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Optional[str] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: Optional[str]=None): if v2 is None: del self.attributes[v1] return self.attributes[v1] = v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list) -> str: v2 = '' for v3 in v1: v2 += v3 + ', ' return v2[:-2] ```
Imports: ```python import typing ``` Type definitions: Input Types: bool, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: bool, v2: int): nonlocal current_n nonlocal can_use v3 = v1 if not v1: v4 = v2 ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: int, **v3): v4 = np.lib.stride_tricks.sliding_window_view(v1, v2, axis=0, **v3) return v4 ```
Imports: ```python import logging import logging.handlers import typing ``` Type definitions: Input Types: logging.Formatter, int Output Type: logging.Handler Dependencies: Function Name: v0 Function: ```python def v0(v1: logging.Formatter, v2: int) -> logging.Handler: v3 = logging.handlers.SysLogHandler() v3...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: ```python def v0(v1: int): if v1 % 3 != 0: raise ValueError('Invalid Mnemonic code length') v2 = v1 // 3 return v2 ``` ```python def v3(v4: int): if v4 % 3 != 0: raise ValueError('Inva...
Imports: ```python import typing ``` Type definitions: Input Types: float, float, float Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: float, v3: float) -> bool: v4 = abs(v1 - v2) < v3 if v4: pass return v4 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0(v1: str) -> str: for (v2, v3) in STREAM_SOURCE_REDACT_PATTERN: v1 = v2.sub(v3, v1) return v1 ``` Function Name: v4 Function: ```python async def v4(self) -> None: async with self._s...
Imports: ```python import typing ``` Type definitions: Input Types: typing.List[bytes], Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: typing.List[bytes], v2=True): v3 = v1[0] if not all((v3[0] == key[0] for v4 in v1)): raise ValueError('cannot multi-delete a...
Imports: ```python import typing ``` Type definitions: Input Types: pathlib.PosixPath Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: pathlib.PosixPath): v2 = [] for v3 in v1.glob('./*seed*'): v4 = v3 / 'log.txt' with open(v4) as v5: v6 = v5.readline...
Imports: ```python from statsmodels.stats import contingency_tables as _tables import pandas as _pd import typing ``` Type definitions: Input Types: _np.ndarray Output Type: _pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: _np.ndarray) -> _pd.DataFrame: v2 = _tables.StratifiedTable(v1....
Imports: ```python import typing ``` Type definitions: Input Types: PMLParser.TextContext Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: PMLParser.TextContext): v2 = v1.getText() if v2.startswith('#'): self.res.append((v1.start.line, '_', v2[1:], [])) ```
Imports: ```python import typing ``` Type definitions: Input Types: yacc.YaccProduction Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: yacc.YaccProduction): if len(v1) < 3: v1[0] = {'code': ''} else: v1[0] = {'code': 'from_params ' + v1[2] + '\n' + v1[3]['code'...
Imports: ```python import copy import typing ``` Type definitions: Input Types: int, int, list Output Type: Any Dependencies: ```python def v0(v1: int, v2: list, v3: list): v4 = [] for v5 in v2: v6 = [] for v7 in range(v1): v8 = 0 for (v9, v10) in enumerate(v5): ...
Imports: ```python import math import typing ``` Type definitions: Input Types: datetime.timedelta Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: datetime.timedelta) -> str: v2 = v1.total_seconds() v3 = '' if v2 >= 60.0: v4 = math.floor(v2 / 60) v2 -= 60 * ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any, dict Output Type: Any Dependencies: ```python def v0(v1, v2) -> list: return [v1.V1EnvVar(name=env_name, value=env_value) for (v3, v4) in v2.items()] ``` Function Name: v5 Function: ```python def v5(v6, v7, v8, v9, v10, v1...
Imports: ```python 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 = int(v2) return v1.replace(v2, f'[{v3 // 2},{(v3 + 1) // 2}]', 1) ```
Imports: ```python import typing ``` Type definitions: Input Types: aioredis.Redis Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: aioredis.Redis): assert await v1.hincrby('a', '1') == 1 assert await v1.hincrby('a', '1', amount=2) == 3 assert await v1.hincrby('a...
Imports: ```python import subprocess import typing ``` Type definitions: Input Types: Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[str]: if not self.is_tmux_session: return [] return subprocess.check_output(['tmux', 'list-panes', '-F', '#{pane_id}'])...
Imports: ```python import typing ``` Type definitions: Input Types: core_ports.BasePort Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: core_ports.BasePort) -> Dict[str, Any]: v2 = {'port': v1, 'value': v1.get_last_read_value(), 'attrs': await v1.get_attrs()}...
Imports: ```python import operator import numpy as np from pandas._config import get_option from pandas._typing import Axis, FilePathOrBuffer, FrameOrSeries, IndexLabel, Scalar from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import doc import pandas as pd from pandas import I...
Imports: ```python import random import string import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1): v2 = pronouncing.phones_for_word(v1) if len(v2) > 0: v3 = ''.join([x for v4 in v2[0] if v4.isalpha()]).lower() v5 = v3 else: v5 = ...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = 'Scripts' if os.name == 'nt' else 'bin' return os.path.join(v1, v2) ```
Imports: ```python import requests import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: if self.token: v1 = requests.post(f'{self.protocol}://{self.server}/validateToken', data={'token': self.token}) if v1.sta...
Imports: ```python from collections import defaultdict import typing ``` Type definitions: ```python class v0: def __init__(self, v1=0, v2=None, v3=None): self.val = v1 self.left = v2 self.right = v3 ``` Input Types: Optional[v0] Output Type: int Dependencies: ```python def v4(v5: Optional[...
Imports: ```python import typing ``` Type definitions: Input Types: Any, servo.connectors.opsani_dev.OpsaniDevChecks, Any Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1, v2: servo.connectors.opsani_dev.OpsaniDevChecks, v3) -> None: v4 = await v2.run_one(id=f'check_opsa...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: str Output Type: Tuple[np.ndarray, np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> Tuple[np.ndarray, np.ndarray]: v2 = np.load(v1) return (v2['colors'], v2['masks']) ```
Imports: ```python import re import typing ``` Type definitions: Input Types: Output Type: str Dependencies: ```python def v0(cls: tp.Type) -> tp.Tuple[str, str]: v1 = re.compile('(?P<encoder_type>\\w+)Field(?P<type>Encoder|Decoder)') v2 = v1.fullmatch(cls.__name__) if v2 is None: raise NamingErro...
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 = v1.split(' ') v3 = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] v4 = v2[1] v5 = v2[0] ...
Imports: ```python import numpy as np import pandas as pd import typing ``` Type definitions: ```python class v0(Chromatogram): def __init__(self, v1: np.ndarray, v2: np.ndarray, v3: np.ndarray, v4: int, v5: Optional[str]=None): super(v0, self).__init__(v3, v1, mode=v5) self.mz = v2 self.fi...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict: v1 = self.graph_session.make_request(method='get', endpoint='/me/inferenceClassification/overrides') return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Iterator[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Iterator[str]: for v1 in self.imports_by_scope.values(): for v2 in v1: yield v2.name ```
Imports: ```python import typing ``` Type definitions: Input Types: sqlite3.dbapi2.Connection, sqlite3.dbapi2.Cursor, dict Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: sqlite3.dbapi2.Connection, v2: sqlite3.dbapi2.Cursor, v3: dict) -> None: v4 = list(v3.values()) with v1: ...
Imports: ```python import os import io from contextlib import suppress from importlib.abc import ResourceLoader from importlib.machinery import ModuleSpec from io import BytesIO, TextIOWrapper from typing import ContextManager, Iterable, Union from typing import cast from typing.io import BinaryIO, TextIO import typing...
Imports: ```python import typing ``` Type definitions: ```python @dataclass class v0: v1: Mode v2: int = 0 v3: List[Leaf] = field(default_factory=list) v4: Dict[LeafID, List[Leaf]] = field(default_factory=dict) v5: BracketTracker = field(default_factory=BracketTracker) v6: bool = False v7: b...
Imports: ```python import numpy as np from tensorflow.keras.datasets import mnist from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.utils import to_categorical import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: Function Name: v0 Function: ```py...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = v1.lower() return v2.replace('ll', 'ww').replace('l', 'w').replace('hi', 'hi uwu').replace('r', 'w').replace('.', '. o///o').replace('!', '! OWO') ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, Dict[str, str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: Dict[str, str]) -> str: if v3: self.save_guild(v1, **{v2: v3}) return 'Message has been set.' ret...
Imports: ```python import typing ``` Type definitions: Input Types: str, list[str], int Output Type: tuple[list[str], int] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: list[str], v3: int) -> tuple[list[str], int]: v2.append(v1) return (v2, v3 + 1) ```
Imports: ```python import typing ``` Type definitions: Input Types: Tuple[UUID, UUID] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tuple[UUID, UUID]) -> None: (v2, v3) = v1 self._journaldb.commit(v2) self._journaltrie.commit(v3) ```
Imports: ```python import sys import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): if 'number_of_breaks' not in v1.keys(): sys.stdout.write('Not enough data to provide analyzing') return sys.stdout.wr...
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: v2 = iter(v2) return all((c in v2 for v3 in v1)) ```
Imports: ```python import typing ``` Type definitions: ```python class v0(OpenTilePage): v1 = 0 def __init__(self, v2: TiffPage, v3: FileHandle, v4: Jpeg): """Ndpi page that should not be tiled (e.g. overview or label). Image data is assumed to be jpeg. Parameters ---------- ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): self.id = v1 v2 = self._get_job_ref() v3 = v2.get().to_dict() self.name = v3[self.FIELD_NAME] v4 = self._get_tasks_ref() v5 = {tas...
Imports: ```python import numpy as np import cv2 import typing ``` Type definitions: Input Types: Any, int, Any, int Output Type: typing.Tuple[np.ndarray, float] Dependencies: ```python def v0(v1): return 0 if len(v1.shape) == 2 else v1.shape[2] ``` ```python def v2(v3: int, v4: int, v5: int, v6=255) -> np.ndarray...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: List[dict] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=5) -> List[dict]: if v1 <= 0: raise ValueError('num_top_moves is not a positive number.') v2 = self._parameters['MultiPV'] if v1 ...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool): self.user.developer_mode = v1 self.user.save() ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int, int Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int) -> np.ndarray: v3 = np.empty([v1, v2]) for v4 in range(v1): v3[v4, :] = np.random.uniform(-1, 1, [1...
Imports: ```python import typing ``` Type definitions: Input Types: Any, tuple Output Type: None Dependencies: ```python def v0(v1: float) -> str: return '£{:.2f}'.format(v1) ``` ```python def v2(v3, v4) -> str: v5 = v4.get_group(v3).nlargest(5, 'amount').values v6 = [] for v7 in v5: v8 = f"{v7...
Imports: ```python import typing ``` Type definitions: Input Types: discord.Member Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: discord.Member): if v1 == self.author: await self.channel.send(v1.mention + ' You are the author, and cannot leave the game. Execut...
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 < 2: return v1 v2 = 2 v3 = v1 // 2 while v2 <= v3: v4 = (v2 + v3) // 2 v5 = v4 * v4 if v5 < v...
Imports: ```python import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers import typing ``` Type definitions: Input Types: Output Type: keras.models.Sequential Dependencies: Function Name: v0 Function: ```python def v0() -> keras.models.Sequential: v1 = keras.models.Sequential([...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self) -> list: v1 = self.authAPI('GET', f'api/v1/symbols') if isinstance(v1, list): v2 = pd.DataFrame.from_dict(v1) else: v2...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1) -> str: v2 = ['year', 'month', 'day', 'hour', 'minute', 'second', 'microsecond'] v3 = [getattr(v1, attr) for v4 in v2] v5 = ''.join((str(x) + '|' for v6 i...
Imports: ```python import typing ``` Type definitions: Input Types: int, str, str, str, str, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: str, v3: str, v4: str, v5: str, v6: str, v7: str): if v1 is 0: self.__insert(v2, v3, v4, v5, v6, v7) elif...
Imports: ```python import typing ``` Type definitions: Input Types: Dataset Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: Dataset) -> int: if v1._indices is not None: return v1.data.nbytes * len(v1._indices) / len(v1.data) else: return v1.data.nbytes ```
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray) -> bool: assert len(v1.shape) == 2, 'A imagem deve ter apenas 2 dimensões.' (v2, v3) = v1.shape return v1.max() == v1.min() ```
Imports: ```python from matplotlib import pyplot as plt from matplotlib.ticker import FuncFormatter from matplotlib.ticker import FormatStrFormatter import typing ``` Type definitions: Input Types: dict, dict, str, str Output Type: plt.subplots Dependencies: Function Name: v0 Function: ```python def v0(v1: dict, v2: ...
Imports: ```python from pathlib import Path import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v1 = v1.lower() v2 = hex(abs(hash(v1)))[2:] if Path(f'./static/{v2}.mp3').exists(): return (v2, False) se...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, **v1) -> None: if 'command' in v1: v2 = v1.pop('command') self._accept_button.config(command=v2) super().config(**v1) ```
Imports: ```python import typing ``` Type definitions: ```python v0 = int ``` Input Types: Any Output Type: Dict[v0, int] Dependencies: Function Name: v1 Function: ```python def v1(v2) -> Dict[v0, int]: v3 = {} for v4 in v2.split('\n'): if v4 and v4.startswith('cpu'): v5 = v4.split(' ') ...
Imports: ```python import itertools import typing ``` Type definitions: ```python class v0: v1 = logging.getLogger('qupulse.hdawg.waveforms') def __init__(self, v2: Path): """This class coordinates multiple AWGs (channel pairs) using the same file system to store the waveforms. Args: ...
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: if self.allow_indexed: return re.sub('(\\w+)(\\[\\w+\\])', 'IndexedBase(\\1)\\2', v1) else: return v1 ```
Imports: ```python import torch import torch.nn.functional as F import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor: if self.ignore_index is not No...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if not self._request.route.interactive: raise RuntimeError('operation is not supported in non-interactive requests') ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, int, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: int, v3: str=''): v4 = v1[v2] v5 = v4.table(fill=False, stream_name='primary') v6 = v4.table(fill=False, stream_name='bas...
Imports: ```python import typing ``` Type definitions: Input Types: str, List[dict] Output Type: Tuple[bool, int] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: List[dict]) -> Tuple[bool, int]: v3 = False v4 = 0 for v5 in v2: if v5['dataElement'] == v1: v3 = Tr...
Imports: ```python import typing ``` Type definitions: Input Types: Text, Optional[int] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Text, v2: Optional[int]=None) -> int: if v1 in self._special_codepoints: return self._special_codepoints[v1] try: return...
Imports: ```python import argparse import sys import typing ``` Type definitions: ```python @dataclass class v0: v1: io.TextIOWrapper ``` Input Types: Output Type: None Dependencies: ```python def v2(v3: io.TextIOWrapper) -> Iterator[str]: v4 = [line.strip() for v5 in v3.readlines() if v5] for v5 in v4: ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: list Dependencies: ```python def v0(v1, v2): for v3 in range(len(v1)): if v1[v3] == v2: return False if v1[v3] + len(v1) - v3 == v2: return False if v1[v3] - len(v1) + v3 == v2: ...
Imports: ```python import os.path import os import typing ``` Type definitions: Input Types: Output Type: Dict[str, str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict[str, str]: v1 = os.environ.copy() for v2 in self.course.path_append: if v2 not in v1: v1[v2] = ...
Imports: ```python import typing ``` Type definitions: Input Types: Span Output Type: List[List[Token]] Dependencies: Function Name: v0 Function: ```python def v0(v1: Span) -> List[List[Token]]: v2 = [] v3 = 0 for v4 in v1: if (v4.pos_ == 'VERB' or v4.pos_ == 'AUX') and v4.i + 1 < len(v4.doc) and ...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1 = 'BasicChannel' def __init__(self, v2=0) -> None: self.clients = list() self.limit = v2 self.has_limit = v2 == 0 self.message_history = list() self.message_type = str() def v3(self, v4: B...
Imports: ```python import re import typing ``` Type definitions: Input Types: str, Any, Any, Any Output Type: bool Dependencies: ```python def v0(v1: str, v2: str, v3=2) -> bool: v4 = 0 (v1, v2) = (list(v1.lower()), list(v2.lower())) for v5 in range(len(v1)): if v1[v5] != v2[v5]: v4 += ...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): for (v2, v3) in v1.items(): if v2 not in self.__dependencies: self.__dependencies[v2] = v3 else: for (v4, v5...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int, int Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int) -> float: v3 = 1.0 + 1.0 / v1 * (1.0 / self.cluster_similarity_threshold ** 2 - 1.0) v3 *= 1.0 + 1.0 / v2 * (1.0...
Imports: ```python from collections import Counter from copy import deepcopy import typing ``` Type definitions: ```python v0 = int ``` Input Types: List[v0] Output Type: Counter Dependencies: ```python def v1(v2: List[v0]) -> List[int]: v3 = deepcopy(v2) v3.extend([0, max(v2) + 3]) v3.sort() v4 = [this...
Imports: ```python import typing ``` Type definitions: ```python v0 = dict[str, Any | 'NestedDict'] ``` Input Types: list[str], Any Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(v2: list[str], v3: Any, /) -> v0: (v4, v5) = ({}, 0) v6 = v4 if not v2: return v3 for v7...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: v1 = True if self._transport: if not self._transport.is_closing(): v1 = False return v1 ```
Imports: ```python import platform import typing ``` Type definitions: Input Types: Dict[str, Any] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, Any]) -> str: if platform.architecture()[0] == '32bit': v2 = '32' else: v2 = '64' if 'natives' in v1:...
Imports: ```python import os import numpy as np import typing ``` Type definitions: Input Types: str Output Type: List[Tuple[str, Any]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> List[Tuple[str, Any]]: with open(v1, 'r') as v2: v3 = [] for v4 in v2.readlines(): ...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: Output Type: pd.Series Dependencies: Function Name: v0 Function: ```python def v0() -> pd.Series: v1 = pd.Series(range(1, 6), name='Fred') return v1 ```
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: v2 = os.path.join(v1, 'sockets') if not os.path.exists(v2): os.mkdir(v2) return v2 ```
Imports: ```python import sys import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: ```python def v0(v1) -> float: return v1 * v1 ``` Function Name: v2 Function: ```python def v2(v3) -> None: if len(sys.argv) != 2: raise Exception('You must provide exactly one float argum...
Imports: ```python import asyncio import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python async def v0(self) -> int: v1: int = 0 await asyncio.sleep(0.1) while await self.async_update(): await asyncio.sleep(1.0) v1 += 1 ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: str Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=' ') -> List[str]: v2 = '' if 'data_names' not in self.data_code: return [''] v2 += '%ssort1\n' % v1 if self.i...
Imports: ```python import torch import torch.nn.functional as F import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor: v3 = F.pad(v2.cumsum(dim=0), (...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: tuple Dependencies: Function Name: v0 Function: ```python def v0(self) -> tuple: for (v1, v2) in self.data.groupby('image'): v3 = self.get_image_bboxes(v2) yield (v2.iloc[0, 0], v3) ```
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._opc: v1 = v1 + ';*OPC' v2 = repr(v1) if len(v1) < 1024 else f'({len(v1)} bytes)' self._logger.debug(f'write {repr(v2)}') ...
Imports: ```python import typing ``` Type definitions: Input Types: Union[list, str], int, str, str, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[list, str], v2: int, v3: str=',', v4: str='\t', v5: bool=False): if type(v1) is str: v1 = v1.split(v3) v6 = le...