text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, *v2, **v3) -> Dict:
(v4, v5) = v2
if not v1:
v1['accumulated_score'] = 0.0
v1['sample_count'] = 0
v6 = self.entropy(v4, v5).... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list[str]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> list[str]:
v1 = []
async for v2 in self.client.list_repository_names():
v1.append(v2)
return v1
``` |
Imports:
```python
from collections import defaultdict
from qiskit.circuit.quantumcircuit import QuantumCircuit
from qiskit.circuit.barrier import Barrier
from qiskit.pulse.schedule import Schedule
from qiskit.scheduler.config import ScheduleConfig
from qiskit.scheduler.lowering import lower_gates
import typing
```
Typ... |
Imports:
```python
from warnings import warn
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any, v2: Any=None) -> Any:
try:
return super().__getitem__(v1)
except KeyError:
v3 = self.get('target')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], int
Output Type: List[Dict[str, float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: int=-1) -> List[Dict[str, float]]:
v3 = self.preprocess_input(v1)
v4 = (self.model.predict(sentence, k=v2) ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = collections.namedtuple('IndexEntry', ['ctime', 'mtime', 'dev', 'ino', 'mode', 'uid', 'gid', 'size', 'sha', 'flags'])
```
Input Types: BinaryIO, Dict[bytes, v0], Optional[int]
Output Type: None
Dependencies:
```python
def v1(v2, v3):
v4 = v2.tell(... |
Imports:
```python
from collections import defaultdict, deque
from heapq import heappop, heappush
import typing
```
Type definitions:
Input Types: int, int, int, int, int, int, defaultdict, list
Output Type: Any
Dependencies:
```python
def v0(v1: int, v2: defaultdict):
v3 = []
v4 = defaultdict(lambda : INF)
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: List[str], np.ndarray, np.ndarray
Output Type: Any
Dependencies:
```python
def v0(v1: List[int], v2: np.ndarray, v3: np.ndarray):
if len(v1) != 3:
raise RuntimeError('Invalid specified index: %s' % (v1,))
if v1[0] >=... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> str:
(v2, v3, v4) = super().visit_AnnAssign(v1)
return f'{v3} {v2} = {v4};'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], str, List[str]
Output Type: Tuple[int, bytes]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: str, v3: List[str]) -> Tuple[int, bytes]:
if self.to_default_recipients:
v3.extend(self.default_r... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict:
v1 = f'{self.base_url}/seasons/{self.season}/segments/0/leagues/{self.league_id}'
v2 = {'view': 'mSettings'}
v3 = self._get(url=v1, params=v2)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float, float, Any, Optional[int]
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *, v1: float=0.1, v2: float=0.8, v3: float=0.1, v4=True, v5: Optional[int]=None) -> dict:
if v4:
self.splits.update... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: List[str]) -> str:
v3 = self.generate_noise(v2)
return v1 + ' ' + v3 + '.'
``` |
Imports:
```python
import inspect
import typing
```
Type definitions:
Input Types: Union[object, Type[Any]], dict[str, inspect.Signature]
Output Type: bool
Dependencies:
```python
def v0(v1: Union[object, Type[Any]], v2: bool=True) -> list[types.FunctionType]:
v3 = name_methods(item=v1, exclude_private=v2)
ret... |
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.placeholder_start in v1:
v2 = self.placeholder_re.fullmatch(v1)
if v2:
return self.parser.config.get_placeholder(v... |
Imports:
```python
from tensorflow.math import erf
from tensorflow.random import stateless_uniform
from tensorflow.random import stateless_normal as normal
import tensorflow as tf
from tensorflow.python.ops import numpy_ops as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, np.ndarray, bool... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict):
v2 = 0
for v3 in v1.keys():
for v4 in v1[v3]:
print((v2, v4))
v2 += 1
``` |
Imports:
```python
import subprocess
from os import environ, path
from tempfile import TemporaryDirectory
import typing
```
Type definitions:
Input Types: str, str, Optional[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: Optional[str]=None):
if v3 is None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, pd.DataFrame]
Output Type: Dict[str, List[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, pd.DataFrame]) -> Dict[str, List[str]]:
v2 = {}
for (v3, v4) in v1.items():
assert 'label' in v4.column... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int) -> str:
for v3 in range(0, len(v1), 2 * v2):
v1 = v1[:v3] + v1[v3:v2 + v3][::-1] + v1[v2 + v3:]
return v1
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not isinstance(self.__param, (float, np.ndarray)):
v1 = f'{self.__name} must be a float or numpy.ndarray.'
raise Ty... |
Imports:
```python
from pathlib import Path
from numpy import genfromtxt, ndarray, linspace, where, logical_and, mean, isnan, full, nan
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[ndarray, ndarray, ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Tuple[ndarra... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool, v2: str, v3: str):
if v1:
self.assertions.append((v1, v2))
else:
self.exit_code = 1
self.error_count += 1
... |
Imports:
```python
from collections import OrderedDict
import typing
```
Type definitions:
Input Types: Language, List[str], List[int]
Output Type: OrderedDict[int, List[OrderedDict[str, str]]]
Dependencies:
```python
def v0(v1: Doc) -> List[OrderedDict[str, str]]:
def v2(v3: Token) -> OrderedDict[str, str]:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Dict], str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Dict], v2: str, v3: str) -> str:
v4 = v1.get(v2)
if isinstance(v4, str):
return v4
else:
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str):
if len(v1) != len(v2):
raise ValueError('Length of hex strings do not match')
v3 = bytes.fromhex(v1)
v4 = bytes.fromhex(v2)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, str, Union[int, float]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame, v2: str, v3: Union[int, float]=0):
v1[v2].replace(to_replace=v3, method='ffill', inplace=True)
return v1
... |
Imports:
```python
from collections import defaultdict
from datetime import timezone as Timezone
import typing
```
Type definitions:
```python
class v0(TypedDict):
v1: str
v2: float
v3: float
v4: str
```
Input Types: Any, Any
Output Type: List[v0]
Dependencies:
```python
def v5(v6) -> List[v0]:
v7 =... |
Imports:
```python
import json
from json.decoder import JSONDecodeError
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.get_track_info()
return v1['item']['album']['artists'][0]['name']
``` |
Imports:
```python
import numpy as np
import numpy.ma as ma
from pandas._config import get_option
from pandas._libs import algos as libalgos, lib, properties
from pandas._libs.hashtable import duplicated
from pandas._libs.lib import no_default
from pandas._typing import AggFuncType, AnyArrayLike, ArrayLike, Axes, Axis,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
if len(v1.strip()) == 0:
return False
v2 = len(self.__all_russian_letters | {'-'}) == len(self.__all_russian_letters | {'-'} | se... |
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:
self.mask_files = {}
if self.io_handler.isdir(v1):
v2 = set(self.io_handler.ls(v1))
for v3 in self.images():
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> tuple:
v3 = self._devide(v1 << self.PARITY_SIZE + v2)
return (v3, v1 if v3 else 0, [''] if v3 else ['CI'])
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[LeafConnector, Stream]
```
Input Types: Any, bool
Output Type: Optional[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2, v3: bool=False) -> Optional[v0]:
self._fileholder = v2
if not v3:
return self
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor) -> torch.Tensor:
v1 = v1.unsqueeze(1)
v1 = self.conv(v1)
(v2, v3, v4, v5) = v1.size()
v1 = self.out(v1.transpose... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1: Any) -> None:
self.path.parent.mkdir(parents=True, exist_ok=True)
self.file = self.path.open('a') if self.append else self.path.open('w')
if not sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'isqlcursor.ISqlCursor'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'isqlcursor.ISqlCursor') -> None:
if self.notify_begin_transaction_:
v1.transactionBegin.emit()
``` |
Imports:
```python
import pathlib
import typing
```
Type definitions:
Input Types: str, zipfile.ZipFile
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: zipfile.ZipFile):
v3 = pathlib.Path('subtitles/')
v1 = pathlib.Path(v1)
v4 = v1.name
v5 = v3 / v4
v2.writ... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3) -> None:
if v1 is None:
raise ValueError('OS environments not content "CLIENT_SECRET"')
if v3 is None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Optional[Dict[str, List[torch.Tensor]]], Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: Optional[Dict[str, List[torch.Tensor]]]=None, v3=None):
v4 = v1.size(0)
if v2 is not None:
v5 ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Dict
Output Type: Tuple[Any, float, bool, Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict) -> Tuple[Any, float, bool, Dict]:
if v1 is not None:
for v2 in ['throttle', 'brake']:
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: v0, int
Output Type: bool
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0, v3: int) -> bool:
self._enforce_type(v2)
if self._ensure_list_respects_max_size():
with self._lock:
... |
Imports:
```python
from subprocess import run, PIPE
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str):
v4 = ['diamond', 'makedb', '--in', v2, '--db', v3]
run(v4, check=True, cwd=v1, stdout=PIPE,... |
Imports:
```python
import csv
import typing
```
Type definitions:
Input Types: str, int, Any
Output Type: List[Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int=0, v3=',') -> List[Any]:
v4 = []
with open(v1, 'rt') as v5:
v6 = csv.reader(v5, delimiter=v3, quotechar='|')
... |
Imports:
```python
import os.path
from os import path
from pandas import DataFrame
import pandas as pd
from pathlib import Path
from shutil import copyfile
import typing
```
Type definitions:
Input Types: Any, list, str, list
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
for (v3, v4) in enumerate(v1.col... |
Imports:
```python
import numpy as np
from PIL import Image
import typing
```
Type definitions:
Input Types: torch.Tensor, Optional[str]
Output Type: None
Dependencies:
```python
def v0(v1: torch.Tensor) -> np.ndarray:
v2 = v1.cpu().detach().numpy()
v2 = einops.rearrange(v2, 'b c h w -> b h w c')
return v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: sparse.csr_matrix
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: sparse.csr_matrix):
self.backward = v1.dot(self.backward)
return self
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = ('func', 'func_name', 'signature', 'typevars', 'arguments', 'type_hints')
def __init__(self, v2: Callable, v3=None, v4: tuple=None, v5: Dict[str, Any]=None):
self.func = v2
self.func_name = function_name(v2)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: dict):
try:
del v2[v1]
v2['count'] = v2['count'] - 1
except KeyError:
pass
``` |
Imports:
```python
import numpy as np
from numpy.lib.ufunclike import fix
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray) -> np.ndarray:
v2 = len(v1)
v3 = np.random.uniform(-self.alpha, self.al... |
Imports:
```python
import json
import typing
```
Type definitions:
```python
class v0(Enum):
v1 = 'dataType.keyword'
v2 = 'lowercaseDescription.keyword'
v3 = 'fdcId'
v4 = 'publishedDate'
```
Input Types: str, list, int, int, v0, Any, str, Any
Output Type: Any
Dependencies:
```python
def v5(v6, v7, v8=No... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types:
Output Type: typing.NoReturn
Dependencies:
```python
def v0(v1: int, v2: typing.List[typing.Tuple[int],]) -> typing.NoReturn:
v3 = FenwickTree(v1)
for (v4, v5, v6) in v2:
v5 -= 1
if v4 == 0:
v3[v5] = v6
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Tuple[str, str]]
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[Tuple[str, str]]) -> dict:
v2 = {}
for (v3, v4) in v1:
if not hasattr(self, v3) or not v4 in self._raw_data:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'TagWriter'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'TagWriter') -> None:
for v2 in self.embedded_objects:
v1.write_tags(v2)
``` |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float) -> float:
if self._oldest_doc_timestamp is None:
return -math.inf
try:
return v1 - self._oldest_doc_timestamp
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v1 = str(v1)
return v1.isdigit() and len(v1) == 5
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
v1 = True
if self._is_not is not self._actual.ok:
return
v2 = f"Response status expected to be within [200..299] range, was '{self.... |
Imports:
```python
from os import path
from hashlib import md5
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = None
if path.isfile(v1):
v3 = open(v1, 'rb')
v4 = md5()
v4.update(v3.read())
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for ((v1, v2), v3) in sorted(self.action_value.items()):
print(f'{v1}: {v2} = {v3:.5f}')
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1: Dict[str, Tuple] = {'project': ('Python', 'env', []), 'author': ('unknown', 'env', []), 'project_copyright': ('', 'html', [str]), 'copyright': (lambda c: c.project_copyright, 'html', [str]), 'version': ('', 'env', []), 'release': ('', 'e... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> DataFrame:
v2 = super().get_data_frame(v1)
v2['index'] = v2.index.values[::-1]
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame):
v2 = self.count_vect.transform(v1['lemmatized_text'])
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: typing.Generator[None, bytes, None]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> typing.Generator[None, bytes, None]:
v1 = (yield)
while v1:
v1 = (yield)
yield
``` |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.stdscr.getch()
if v1 == ord('w') and self.direction != 2:
self.direction = 0
if v1 == ord('d') and self.direction !... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, Dict[str, int], Dict[str, int]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: Dict[str, int], v3: Dict[str, int]) -> str:
v4 = ''
v5 = range(v2['x'] - v1 // 2, v2['x'] + v1 // 2 + 1)
v6 = ran... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> int:
if len(v1) == 0:
return 0
v2 = {}
v3 = 1
for v4 in v1:
if v4 in v2.keys():
continue
... |
Imports:
```python
from collections.abc import Mapping
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: Iterable[v0], Type[v0], Mapping
Output Type: Optional[v0]
Dependencies:
```python
def v1(v2: Any, v3: Mapping) -> bool:
for (v4, v5) in v3.items():
v6 = getattr(v2, v4, NOV... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: pd.DataFrame, pd.DataFrame
Output Type: Any
Dependencies:
```python
def v0(v1: np.array, v2: np.array, v3: np.array) -> float:
v4 = np.sort(v1[v3])[::-1]
if v4[0] == v4[1]:
(v5, v6) = np.where(v1 == v4[0])[0]
els... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
if v1 < self.warmup_iterations:
v2 = [(self.warmup_lr_ratio * lr if self.warmup_lr_ratio is not None else self.warmup_lr_init) + v... |
Imports:
```python
import os
from os import listdir
from os.path import dirname
from shutil import copyfile, copytree, rmtree
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0() -> str:
return os.path.join(dirname(__file__), os.pardir, 'airflow', 'providers')
```
``... |
Imports:
```python
import operator
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: Vector
v2: Optional[_BinaryTreeNode]
v3: Optional[_BinaryTreeNode]
def __repr__(self):
return pprint.pformat(tuple(self))
```
Input Types:
Output Type: None
Dependencies:
```python
def v4... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types:
Output Type: Coroutine[Any, Any, NoReturn]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> Coroutine[Any, Any, NoReturn]:
await self.broker.connect()
await self.broker.subscribe(self.broker_channel)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, Optional[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=1, v2: Optional[int]=None) -> int:
assert v1 >= 1
v3 = self.cursor_position_col if v2 is None else v2
return self.translate_row_c... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = self._get_user(v1)
v3 = {'mci_id': v2.mci_id, 'vendor_id': '' if v2.vendor_id is None else v2.vendor_id, 'regis... |
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.xtrain, self.ytrain, self.theta) = self._prepare_data(v1, v2)
self.gradient_descent()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, int]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, int]):
try:
del self.responses[v1]
except KeyError:
pass
``` |
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 v1 in self._matches_found:
self._matches_found[v1].append(v2)
else:
self._matches_found[v1] = [v2]
``` |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: Dict, Union[List, Set]
Output Type: Dict
Dependencies:
```python
def v0(v1: str, v2: bool, v3: Any) -> bool:
return v1 not in v3 and (not v2) or (v1 in v3 and (not isinstance(v3[v1], dict)))
```
```python
def v4(v5: set) -> Dict:
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if not 'index.php/' in v1:
raise ValueError('Unrecognized URL format. Expected: https://x.com/index.php/slug-here/')
if v1.endswith('/'):
... |
Imports:
```python
import logging
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int, int, str
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: int, v3: int, v4: str='increase') -> Dict[str, Any]:
v5 = np.argmin
v... |
Imports:
```python
from os import system
import typing
```
Type definitions:
Input Types: int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=80, v2: int=30) -> None:
assert isinstance(v1, int), f"Invalid 'width' data type : {type(v1)}. Expected an int."
assert ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Any
Output Type: str
Dependencies:
```python
def v0(v1, v2, v3):
return {'id': v2, 'body': v3, 'author': {'login': v1}}
```
Function Name: v4
Function:
```python
def v4(self, v5: str, v6: str='test_login', v7='@taktyk-bot .') -> str:
... |
Imports:
```python
import socket
import typing
```
Type definitions:
Input Types:
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Optional[str]:
if socket.getfqdn().endswith('.tools.eqiad.wmflabs'):
return socket.gethostname()
return None
``` |
Imports:
```python
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: str, List[Any], str, List[Any], str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: List[Any], v3: str, v4: List[Any], v5: str):
(v6, v7) = plt.subplots()
v7.plot(v2, v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.play_obj is not None and self.play_obj.is_playing():
self.play_obj.stop()
if self.thread.is_alive():
self.thread.terminate()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict, v3: str) -> None:
v4 = {v3: v2.get(v3, None)}
v5 = self.get_first_object_id_from_query(collection_name=v1, query=v4)
prin... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
async with self.lock:
if not self.push_running or self.subscriptions:
return
self.push_running = False
self.dis... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = typing.Union[Alt, Seq, str]
```
Input Types: list[str]
Output Type: v0
Dependencies:
```python
def v1(*v2: v0) -> v0:
v3 = []
for v4 in v2:
if isinstance(v4, Alt):
v3.extend(v4.choices)
else:
v3.append(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2=True):
v3 = v1.split()
for v4 in v3:
if v4 not in self.word_index and v2:
self.word_index[v4] = len(self.word_index)
... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
if isinstance(v1, list):
for v3 in range(len(v1)):
if torch.is_tensor(v1[v3]) or isinstance(v1[v3], float):
v1[v3] += torch.mean(v2[v3])... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path, List[str]
Output Type: List[Tuple[Path, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: List[str]) -> List[Tuple[Path, str]]:
v3 = []
if v1.is_dir():
v3 = [(path, path.parent.relative_to(v1).as_pos... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: 'Package'
Output Type: Dict[str, Union[str, Dict[str, str]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Package') -> Dict[str, Union[str, Dict[str, str]]]:
v2 = {}
if v1.name in self._hashes... |
Imports:
```python
import os
from pprint import pprint
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: List[str]) -> List[str]:
v3 = []
for (v4, v5, v6) in os.walk(v1):
if '__init__.py' not i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]):
for v2 in v1:
v3 = v2.split('/')
v4 = v3[-1]
self.data_files[v2] = {'file_name': v4, 'object_key': v2, 'kgx_compli... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float):
v2 = self._max_width
if v2 is not None:
v1 = min(v2, v1)
self._width = max(v1, self._min_width)
``` |
Imports:
```python
import os
from fnmatch import fnmatch
from os.path import splitext
from pathlib import Path
import typing
```
Type definitions:
Input Types: List[str], List[str], str
Output Type: Any
Dependencies:
```python
def v0(v1: List[str], v2: List[str], v3: str):
if v1:
for v4 in v1:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Mapping, Sequence, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Mapping, v2: Sequence, v3):
for v4 in v2:
if v4 not in v1:
return v3
else:
v1 = v1[v4]
return v1
``... |
Imports:
```python
import pandas as pd
from pandas import DataFrame
from .calendar import iter_once, iter_window
import typing
```
Type definitions:
Input Types: DataFrame, Union[List[str], str], str
Output Type: DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: DataFrame, v2: Union[List[str], ... |
Imports:
```python
from math import sqrt
import typing
```
Type definitions:
Input Types: int
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> List[int]:
v2 = int(sqrt(v1))
while v1 % v2 != 0:
v2 -= 1
return [v1 // v2, v2]
``` |
Imports:
```python
import re
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] = []
if isinstance(v1, str):
v2 = re.split(',|\\s|;', v1)
return [x.strip() for v3 in v2 if v3.st... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.