text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: ```python def v0(v1: int) -> int: return v1 // 3 - 2 ``` Function Name: v2 Function: ```python def v2(v3: int) -> int: v4 = 0 while v3 > 0: v3 = v0(v3) if v3 > 0: v4 += v3 ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.set_models({'user/1': {'committee_$can_manage_management_level': [1], 'committee_$_management_level': ['can_manage'], 'organization_management_level...
Imports: ```python import collections import typing ``` Type definitions: ```python v0 = Union[Tuple[Hashable, ...], Hashable, dict] ``` ```python v1 = Optional[Union[Tuple[Hashable, ...], Hashable, dict]] ``` ```python v2 = int ``` Input Types: Sequence[Tuple[v2, v1, v0]] Output Type: Sequence[float] Dependencies: Fu...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self): self.result = None self._callbacks = [] def v1(self, v2: Callable) -> None: self._callbacks.append(v2) def v3(self, v4) -> None: self.result = v4 for v5 in self._callback...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F import typing ``` Type definitions: Input Types: (torch.Tensor, torch.Tensor), (torch.Tensor, torch.Tensor, torch.Tensor) Output Type: (torch.Tensor, torch.Tensor, torch.Tensor) Dependencies: Function Name: v0 Function: ```python de...
Imports: ```python import json import typing ``` Type definitions: Input Types: dict, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: dict, v2: str) -> None: with open(v2, 'w') as v3: v3.writelines(json.dumps(v1, sort_keys=True, indent=4)) ```
Imports: ```python import re import typing ``` Type definitions: Input Types: str, List[str], int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: List[str], v3: int) -> str: v4 = f"upstream_{re.sub('[.:]', '_', v1)}_{v3}" return self._render_upstream_block(v2, v3...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: v1 = self.get_battery() if self.last_queried_battery != v1: self.last_queried_battery = v1 return True return False ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: List[str] Dependencies: ```python def v0(v1: List[str]) -> str: for v2 in v1: if not v2: continue v3 = len(v2) - len(v2.lstrip()) return ''.join((' ' for v4 in range(v3))) return '' ``` Func...
Imports: ```python import typing ``` Type definitions: Input Types: List[str], List[str] Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str], v2: List[str]) -> np.ndarray: v3 = self.sess.run([self.sim_scores], feed_dict={self.sts_input1: v1, self.sts_input2: v2})...
Imports: ```python import typing ``` Type definitions: Input Types: dict, dict Output Type: None Dependencies: ```python def v0(v1: dict, *v2, **v3): v4 = utils.get_root_helper() v5 = castellan_key_manager.API(CONF) return encryptors.get_volume_encryptor(*v2, root_helper=v4, connection_info=v1, keymgr=v5, ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any Output Type: Tuple[List[int], Union[float, np.ndarray]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> Tuple[List[int], Union[float, np.ndarray]]: v2 = list(self._dims_not_displayed) v3 = np.arr...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> np.ndarray: v2 = [] v3 = False v4 = set([]) v5 = [] v6 = 0 while not v3: (v7, v3, v8) = self.m...
Imports: ```python import typing ``` Type definitions: Input Types: dict, tuple, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: dict, v2: tuple, v3: int): (v4, v5, v6) = (v1['apply'], v1['factor'], v1['epochs']) if not v4: return (False, 0, [], [v2]) v6[0] += v...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: List['ObjectNode'] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, *v2) -> List['ObjectNode']: v3 = set.intersection(*[set(self.get_memids_by_tag(t)) for v4 in v2]) v5 = [self.get_object_by_id(memid, v1) ...
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: v3 = v1 * 3 v4 = v2 * 1 return v3 - v4 ```
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 = [int(v) for v4 in v1.split('.')] v5 = [int(v4) for v4 in v2.split('.')] while not v3[-1] and len(v3) > 1: v3...
Imports: ```python import argparse from argparse import ArgumentParser import typing ``` Type definitions: Input Types: Any, Any Output Type: ArgumentParser Dependencies: Function Name: v0 Function: ```python def v0(v1, v2=False) -> ArgumentParser: v3 = argparse.ArgumentParser(parents=[v1], add_help=v2) v3.ad...
Imports: ```python import typing ``` Type definitions: Input Types: bytes, str, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes, v2: str=None, v3: str=None, v4: str=None): v2 = self.uploader.get_media_type_for_file_name(v4) v3 = self.uploader.get_encoding_f...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: list) -> str: v2 = [] for v3 in v1: v4 = v3.__name__ v5 = v3().get_rate() v2.append(f'{v4}({v5})') return ', '.join(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: float, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: str) -> str: if v1 == 0: return '0' elif v1 == 1: return v2 elif v1 == -1: return '-' + v2 else: ret...
Imports: ```python import subprocess import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> None: global iperf_server v2 = subprocess.Popen(['iperf3', '-s', '-p', str(v1)], stdout=subprocess.DEVNULL) ```
Imports: ```python import typing ``` Type definitions: ```python @dataclass class v0: v1: int v2: int v3: list[int] @classmethod def v4(cls, v5: t.Iterable[t.Sequence]) -> v0: v6 = None v7 = 0 v8 = [] for v9 in v5: v7 += 1 if v6 is None: ...
Imports: ```python import typing ``` Type definitions: Input Types: List[Dict[str, str]] Output Type: Dict[str, int] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Dict[str, str]]) -> Dict[str, int]: v2 = {} for v3 in v1: v4 = v3['log'].split(' ')[5] if v4 not in v2: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Optional[int] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Optional[int]: if 'schdPsetId' in self.pilotResult: return 1000 return self.pilotResult.get('sceneId') ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): v2 = self._fetch_ids_flag(v1['Attribute']) if v1.get('ObjectReference'): for v3 in v1['ObjectReference']: if self._is_refere...
Imports: ```python import typing ``` Type definitions: Input Types: Connection, str Output Type: Tuple[List[str], List[Tuple]] Dependencies: Function Name: v0 Function: ```python def v0(v1: Connection, v2: str) -> Tuple[List[str], List[Tuple]]: v3 = v1.execute("select * from '{}'".format(v2)) return ([des[0] ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: int Dependencies: ```python def v0(v1: Any) -> Tuple[float, str]: try: assert v1 is not None if isinstance(v1, (int, float)): return (float(v1), '') v1 = str(v1).replace(' ', '').lower() ...
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int) -> None: if v1 == v2: return if v1 >= self.problem.getSize() or v2 >= self.problem.getSize(): return if v1 < 0 o...
Imports: ```python import typing ``` Type definitions: ```python class v0(TypedDict, total=False): v1: str v2: Dict[str, Any] v3: str v4: Dict[str, Any] v5: str v6: str v7: str v8: int v9: str v10: List[int] v11: str v12: str v13: bool v14: Message v15: List[s...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: with self.assertRaises(IOError) as v1: self.clo.options.config_log_file = 'NotValidFile.yaml' self.clo._setup_logging() self.assertEq...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool): for v2 in self.views.values(): v2.set_orientation_labels_visiblility(v1) ```
Imports: ```python import pathlib import typing ``` Type definitions: Input Types: pathlib.Path Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pathlib.Path) -> List[str]: v2 = self.resources(self.default_config)[0].load(pathlib.Path(v1) / self.name) v3 = {pathlib.P...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): global BASE_DIR if not v1.endswith('/'): raise Exception('Directory name must end with "/"') v2 = v1 ```
Imports: ```python import glob import typing ``` Type definitions: Input Types: str Output Type: List[str] Dependencies: ```python def v0(v1: str, v2: List[str]) -> None: with open(v1) as v3: v2.extend(v3.read().splitlines()) ``` Function Name: v4 Function: ```python def v4(v5: str) -> List[str]: v6 = ...
Imports: ```python import typing ``` Type definitions: Input Types: str, dict, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: dict=None, v3: bool=False): v4 = {'statement': v1} if v2: v4['parameters'] = v2 if v3: v4['includeStats'] = Tru...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: Dict[str, Dict[str, Any]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.DataFrame) -> Dict[str, Dict[str, Any]]: v2 = {} for (v3, v4) in v1.iterrows(): v5 = {'company_id': v4['compan...
Imports: ```python import typing ``` Type definitions: Input Types: Type['Statement'] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Type['Statement']) -> bool: if v1.is_statement: if not self.copula is v1.copula: return False if self.subject.equ...
Imports: ```python import typing ``` Type definitions: Input Types: 'Callable[[int], None]' Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'Callable[[int], None]') -> None: for v2 in range(self.n): self.executeZero.acquire() v1(0) if v2 % 2 == 0: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int, int, int Output Type: Dict[Any, Dict[Any, float]] Dependencies: Function Name: v0 Function: ```python def v0(v1: int=100, v2: int=100, v3: int=100000) -> Dict[Any, Dict[Any, float]]: v4 = {} for v5 in range(v1 + 2): ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3) -> None: for v4 in v2.keys(): v5 = v1.get(v4) if v5: if isinstance(v5, str): v5 = float(v5) ...
Imports: ```python import string import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = self.random.choice(['1', '3']) v2 = string.ascii_letters + string.digits return v1 + ''.join((self.random.choice(v2) for v3 in r...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict[str, str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict[str, str]: v1 = {} v2 = self.get_config() for v3 in list(v2.keys()): if v3[0] == b'remote': v1[v3[1].decode('UTF-8')...
Imports: ```python import typing ``` Type definitions: ```python v0 = Tuple[str, Location] ``` Input Types: Set[v0] Output Type: str Dependencies: Function Name: v1 Function: ```python def v1(self, v2: Set[v0]) -> str: if len(v2) == 0: return 'set()' return '{' + ', '.join((f'{self.repr_var(var)}' for ...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: Callable[..., Any] Dependencies: ```python def v0(v1: Callable[..., Any]) -> Callable[..., Any]: setattr(v1, '__aio_request_timeout__', seconds) return v1 ``` Function Name: v2 Function: ```python def v2(*, v3: float) -> Cal...
Imports: ```python import sympy as sp import typing ``` Type definitions: Input Types: Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: int): v3 = [] for v4 in range(v2): v3.append(sp.diff(v1)) return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: bool Dependencies: ```python def v0(v1: str) -> int: if is_ipv6(v1): v2 = ':' v3 = [''] * 8 v4 = 2 v5 = 16 else: v2 = '.' v3 = [''] * 4 v4 = 1 v5 = 10 v6...
Imports: ```python import numpy as np import torch import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self) -> float: with torch.no_grad(): self.model.eval() v1 = [] for v2 in np.unique(self.query_ids_test): ...
Imports: ```python from typing import Dict, Any, Optional, cast, List, Tuple, Iterator import torch import torch.distributed as dist from torch import nn from torch.nn.modules.module import _IncompatibleKeys from torch.nn.parallel import DistributedDataParallel import typing ``` Type definitions: Input Types: Output ...
Imports: ```python import typing ``` Type definitions: Input Types: str, bool Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: bool=False) -> Dict: v3 = 'iserver/account' v4 = 'POST' v5 = {'acctId': v1} v6 = self._make_request(endpoint=v3, req_type=v4, pa...
Imports: ```python import typing ``` Type definitions: Input Types: ty.Dict[Qubit, int], ty.Dict[Qubit, int], QuantumCircuit Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: ty.Dict[Qubit, int], v2: ty.Dict[Qubit, int], v3: QuantumCircuit) -> None: v4 = {val: key for (v5, v6) in v1...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Dict[str, discord.TextChannel] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> Dict[str, discord.TextChannel]: try: v2 = self._subscription_channels[v1] except KeyError: v2 = self....
Imports: ```python import typing ``` Type definitions: Input Types: circuits.CircuitDag, Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: circuits.CircuitDag, v2=linalg.Tolerance.DEFAULT) -> None: for v3 in tuple(v1.nodes): if v2.all_near_zero_mod(v3.val.half_turns, 2):...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._workers.clear() self._listeners.clear() self._lifespan_tasks.clear() self.router.clear() ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Union[int, float, list, np.ndarray] Output Type: Union[float, list, np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[int, float, list, np.ndarray]) -> Union[float, list, np.ndarray]: v2 = (...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[int] Dependencies: ```python def v0(v1: str) -> List[int]: v2 = normalize(v1) if v2[0] == 'n': return [-1] elif v2[0] == 'a': return [-2] else: return [int(a) for v3 in str(v2)] ``` ```python ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int Output Type: Callable Dependencies: ```python def v0(v1, v2): return np.atleast_2d(model.dynamical_system.f(v1).T).T[:, i] ``` ```python @v3.setter def v3(self, v4): self._model = v4 ``` Function Name: v5 Function: ```py...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.array, np.array, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: np.array, v2: np.array, v3: str) -> None: v4 = np.hstack((v1, v2.T)) np.save(v3.replace('.pts', '_pred.npy'), v4.astyp...
Imports: ```python import re import typing ``` Type definitions: Input Types: pd.Series, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.Series, v2: str) -> str: v3 = re.sub('{{object}}', v1['Object'], v1[v2]) v3 = re.sub('{{param}}', v1['Parameter'], v3) v4 = '( {{n...
Imports: ```python from random import uniform import typing ``` Type definitions: Input Types: Output Type: Union[int, float] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Union[int, float]: v1 = uniform(self.min_, self.max_) if self.integer: return int(v1) else: ret...
Imports: ```python import typing ``` Type definitions: ```python class v0(NamedTuple('RecomputeContext', [('is_recomputing', bool), ('seed', tf.Tensor), ('children', Deque['RecomputeContext'])])): def v1(self): return _context_stack.push(self) def v2(self, v3, v4, v5): _context_stack.pop(self)...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool) -> None: v2 = (x for v3 in v1 if v3 not in self.__start_locals) for v4 in v2: self.add(v4) ```
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): self.stars = self.stars[~self.stars['ID'].isin(v1)] return ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: dict[str, str] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> dict[str, str]: v2: dict[str, str] = {} for v3 in v1.splitlines(): v4 = v3.split(':', 1) if len(v4) == 2: v5 = ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: for v2 in v1: if v2.isupper(): return '%s' % v2 ```
Imports: ```python import cv2 as cv import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> None: if self.dim != 2: v2 = cv.split(self.data) self.data = v2[v1] ```
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> Optional[str]: for v3 in self.modules.get(v1, {}).values(): if v3.get('room_id') == v2: return v3.get('t...
Imports: ```python import typing ``` Type definitions: Input Types: bool, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool, v2=None, v3=None): if self._driver.is_keyboard_shown(): if v1: self._driver.hide_keyboard() else: s...
Imports: ```python import typing ``` Type definitions: Input Types: 'mypy.nodes.OverloadedFuncDef' Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'mypy.nodes.OverloadedFuncDef') -> str: v2: Any = v1.items[:] if v1.type: v2.insert(0, v1.type) if v1.impl: ...
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = re.sub('\\s+', ' ', v1).replace(' "', '"').replace('" >', '">').replace(' >', '>').replace('> <', '><').replace('" />', '"/>').replace(' =', ...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('AnyPoint', BoundPoint, PortedPoint) ``` Input Types: Tuple[v0, v0] Output Type: Tuple[v0, v0] Dependencies: Function Name: v1 Function: ```python def v1(v2: Tuple[v0, v0]) -> Tuple[v0, v0]: (v3, v4) = v2 return v2 if v4.is_right_of(...
Imports: ```python import typing ``` Type definitions: ```python v0 = Any ``` Input Types: transform.Params, v0 Output Type: chex.Array Dependencies: Function Name: v1 Function: ```python def v1(v2: transform.Params, v3: v0) -> chex.Array: del params return v3[0] ```
Imports: ```python import typing ``` Type definitions: Input Types: Sequence[str] Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: Sequence[str]) -> List[str]: v2 = [x for v3 in v1 if not v3.startswith('linkedvalue:')] return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): print('Usage: ./test.py [SUBCOMMAND]') print(" Run or update the tests. The default [SUBCOMMAND] is 'run'.") print() print(' SUBCOMMAND:') ...
Imports: ```python import typing ``` Type definitions: Input Types: _pytest.config.Config Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: _pytest.config.Config) -> None: v1.addinivalue_line('markers', 'slow: marks tests as slow (deselect with -m "not slow")') if v1.option.tbst...
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor): v1 = self.encoder(v1) return (self.mu(v1), self.logstd(v1)) ```
Imports: ```python import numpy as np import torch from torch import Tensor import typing ``` Type definitions: Input Types: Union[np.array, torch.Tensor] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[np.array, torch.Tensor]): if isinstance(v1, torch.Tensor): return...
Imports: ```python import typing ``` Type definitions: Input Types: str, int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: int=50) -> str: if len(v1) <= v2: return v1 return v1[:22] + '...' + v1[-v2 + 22 + 3:] ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Optional[gettext.NullTranslations] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Optional[gettext.NullTranslations]: if v1 in self.translators: return self.translators[v1] return self.nu...
Imports: ```python import typing ``` Type definitions: Input Types: list[str], str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: list[str], v2: str='and') -> str: if len(v1) > 2: return f"{', '.join(v1[:-1])}, {v2} {v1[-1]}" return f' {v2} '.join(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1: dict = dict() v1['channel_id'] = self.asString(self.channel_id) v1['active_game'] = self.asBoolean(self.active_game) v1['active_level'] =...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> List[str]: v2: List[str] = [] v3 = '' v4 = False v5 = False for v6 in v1: if v6 in ' \t\n' and (not v4): if v3 !...
Imports: ```python from io import open import typing ``` Type definitions: Input Types: str, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: int=-1): v3 = [] v4 = [] v5 = [] with open(v1) as v6: for v7 in v6: v7 = v7.strip() ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str): v2 = await self._http.get_stream_key(v1, str(self.id)) return v2 ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, int, np.ndarray Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: int, v3: np.ndarray) -> np.ndarray: if v1.shape[0] == v2: return v1 elif v1.shape[0]...
Imports: ```python from difflib import unified_diff from pathlib import Path import typing ``` Type definitions: Input Types: str, str, Optional[str], str Output Type: Any Dependencies: ```python def v0(v1: str, v2: str, v3: str=None): if v3 is None: v3 = v2 v4 = Path(Path(__file__).parent, v1, 'expect...
Imports: ```python import typing ``` Type definitions: Input Types: cirq.AbstractCircuit, cirq.Sweepable, int Output Type: List['cirq.Result'] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: cirq.AbstractCircuit, v2: cirq.Sweepable, v3: int=1) -> List['cirq.Result']: self._validate_circuit([v...
Imports: ```python import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: str): v3 = v1.FILES.get(v2) if v3: setattr(v1.user, v2, v3) v1.user.save() ```
Imports: ```python import typing ``` Type definitions: Input Types: int, object Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: object) -> bool: if v2 is None: return False v3 = v2['voters'] if v1 in v3: return True return False ```
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(v1: np.ndarray) -> np.ndarray: if not np.issubdtype(v1.dtype, np.integer): raise TypeError(f'Arguments to runampl must be int...
Imports: ```python import typing ``` Type definitions: Input Types: str, Callable[[], Optional[str]] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Callable[[], Optional[str]]): v3 = self.backend if v1 not in v3: v3[v1] = v2() return v3.get(v1) ```
Imports: ```python from sklearn import ensemble from sklearn import linear_model from sklearn import model_selection from sklearn import neighbors from sklearn import neural_network import typing ``` Type definitions: Input Types: int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2='back', v3=None): if v2 not in ('front', 'back', 'anywhere'): raise ValueError('cmdline_type cannot be {!r}'.format(v2)) (v4, ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str, v2: str=None) -> None: v3 = await self.check_bucket(name=v2) v4 = v3.blob(v1) return v4.delete() ```
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) = self._create_viz() return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: float, float, int Output Type: Sequence[float] Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: float, v3: int) -> Sequence[float]: assert v3 >= 0 if v3 == 0: return () elif v3 == 1: return (v1,) ...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1: RequestAuthInfo ``` ```python class v2: v3: ResponseAuthInfo ``` Input Types: v2, v0 Output Type: None Dependencies: Function Name: v4 Function: ```python async def v4(self, v5: v2, v6: v0) -> None: await self.refresh_token_if_n...
Imports: ```python import typing ``` Type definitions: Input Types: Union[str, List[str]] Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[str, List[str]]) -> List[int]: if isinstance(v1, str): return self.tokenizer.convert_tokens_to_ids(self.tokenizer.toke...
Imports: ```python import typing ``` Type definitions: Input Types: 'Union[Config.Object, str]', 'Union[Identity.Identity, str]', bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'Union[Config.Object, str]', v2...
Imports: ```python import logging import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if not self.outputs: return logging.info('======================================================= \nOutputs:\n--------') i...