text stringlengths 190 325k |
|---|
Imports:
```python
from math import acos, asin, atan2, cos, degrees, fabs, floor, radians, sin, sqrt, tan
import typing
```
Type definitions:
Input Types: float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float) -> float:
if v1 <= 0:
return 0
v2 = 6356900
v3 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.quality == 192:
return 'Good'
elif self.quality == 0:
return 'Bad'
else:
return 'Unknown'
``` |
Imports:
```python
import pandas as pd
import requests
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: str
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str='20210930') -> pd.DataFrame:
v2 = 'https://datacenter-web.eastmoney.com/api/data/v1/get'
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict):
v2 = []
for v3 in v1['StopCondition']:
v2.append(v3['Name'])
v4 = []
if len(v2) > len(set(v2)):
v4 = set([x for v5 in v2 if v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> Dict:
v3 = self.service.users().messages().attachments().get(userId=self.user_id, messageId=v1, id=v2).execute()
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = self.idx_to_token
v2 = self.pad_token
v3 = self.unk_token
v4 = self.mutable
v5 = locals().copy()
v5.pop('self')
return v5
``... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, Dict[str, Any]
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Dict[str, Any]) -> dict:
v3 = ('PATCH', f'api/2.0/repos/{v1}')
return self._do_api_call(v3, v2)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(IUBase):
def __init__(self, v1: HomeAssistant, v2, v3: int) -> None:
super().__init__(v3)
self._hass = v1
self._coordinator = v2
self._is_enabled: bool = True
self._name: str = None
self._switc... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Value, _collections_abc.Sequence, SupportsInt, SupportsFloat):
def __init__(self, v1: SupportsStringFull | v0=''):
"""
Initializes the StringValue object.
NOTE: if the initial value is not a valid string or another
... |
Imports:
```python
from typing import TYPE_CHECKING, Hashable, Literal, Sequence, Union, cast, final
import numpy as np
from pandas._libs import algos, hashtable as htable, iNaT, lib
from pandas._typing import AnyArrayLike, ArrayLike, DtypeObj, IndexLabel, Scalar, TakeIndexer, npt
from pandas.util._decorators import do... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
try:
self.current_row = next(self.data)
self.eof = False
except StopIteration:
self.eof = True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], int
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: int) -> List[int]:
v3 = set()
for v4 in range(len(v1)):
if v2 - v1[v4] in v3:
return True
v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'ServiceEvent'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'ServiceEvent'):
print('\non_reconnecting')
print(f'Error cause: {v1.get_cause()}')
print(f'Message: {v1.get_message()}')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=None):
v2 = self.get_config('testing')['margin']
if v1:
return v1 + v2
return self.get_config('testing')['timeout'] + v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: str=None) -> str:
if v2 == 'KB':
return str(round(v1 / 1024, 3)) + ' Kilobytes'
elif v2 == 'MB':
return str(round(v1 / (1024 * 1... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str) -> Dict[str, Any]:
try:
if v1:
return json.loads(v1, strict=False)
return {}
except ValueError:
raise ValueError(ERROR_MESSAGES['JSON_... |
Imports:
```python
import requests
import json
import pandas as pd
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str='../input/links.json'):
with open(v1, 'r') as v2:
return json.load(v2)
```
```python
def v3(v4: str):
v5 = {'user-agent': 'Mozi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: (dict,)
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: (dict,)) -> None:
if type(v1) != dict:
raise TypeError('%s.items expects a dict of UUID keys and int-values, but was passed "%s" (%s)' % (self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'pyspark.sql.session.SparkSession', list, list
Output Type: pyspark.sql.dataframe.DataFrame
Dependencies:
```python
def v0(v1: list) -> pyspark.sql.types.StructType:
v2 = []
for v3 in v1:
if v3['type'] == 'string':
if v3['n... |
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=None):
if v2 == self.level or v2 is None:
if v1 in self:
del self.memory[v1]
return True
return False
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = ('func', 'func_name', 'signature', 'typevars', 'arguments', 'type_hints', 'is_generator')
def __init__(self, v2: Callable, v3: Optional[Dict[str, Any]]=None, v4: tuple=None, v5: Dict[str, Any]=None, v6=ForwardRefPolicy.ERROR):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = u'build update'
v2 = u'Author: solano-ci[bot]@users.noreply.github.com\nCommit: [191d34f9da8ff7279b051cd68e44223253e18408](github.com/anirudhjai... |
Imports:
```python
import pandas as pd
import json
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = []
with open(v1, 'r') as v3:
for v4 in v3:
v2.append(json.loads(v4))
v5 = pd.DataFrame(v2)
... |
Imports:
```python
import sys, os
from os.path import exists, isfile, abspath, isabs, dirname, basename, splitext, join
import logging
import typing
```
Type definitions:
Input Types: ns.Namespace
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: ns.Namespace):
v2 = v1.Local._get('lo... |
Imports:
```python
import copy
import numpy as np
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> list:
v2 = copy.deepcopy(v1)
for v3 in range(np.shape(v2)[0]):
if len(v2[v3][0]) >= self.max_length:
... |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types:
Output Type: argparse.Namespace
Dependencies:
Function Name: v0
Function:
```python
def v0() -> argparse.Namespace:
v1 = argparse.ArgumentParser()
v1.add_argument('-i', '--input', required=True, help='path to input file to ov... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
v0 = TypeVar('ET')
```
Input Types: np.ndarray, v0, Optional[Dict[str, Any]]
Output Type: np.ndarray
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: np.ndarray, v3: v0, *, v4: Optional[Dict[str, Any]]=None) -> np.n... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str]) -> None:
v2 = [0] * len(v1)
for v3 in range(len(v1)):
for v4 in range(len(v1[v3])):
if len(v1[v3][v4]) > v2[v3]:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: float
v2: int
v3: Node
v4: int = 0
v5: float = 0
v6: float = 0
v7: Node = None
v8: bool = False
```
Input Types: float
Output Type: v0
Dependencies:
Function Name: v9
Function:
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types: adsk.core.ObjectCollection, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: adsk.core.ObjectCollection, v2: list):
for v3 in v2:
v1.add(v3)
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: ChpSimulator
v2: float = 0.0
v3: Dict[Loc, int] = field(default_factory=dict)
v4: Dict[int, Loc] = field(default_factory=dict)
v5: Dict[SpaceTimeLocation, MeasureResult] = field(default_factory=dict)
def v... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(IntFlag):
v1 = 0
v2 = 1
v3 = 2
v4 = 4
```
```python
@unique
class v5(Enum):
def v6(cls, *v7, **v8):
v9 = len(cls.__members__) + 1
v10 = object.__new__(cls)
v10._value_ = v9
return v10
def ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Node', 'Node'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Node', v2: 'Node') -> None:
self.sender = v1
self.receiver = v2
v1.assign_cchannel(self, v2.name)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any], v2: int) -> None:
for v3 in sorted(v1.keys()):
v4 = v1[v3]
if isinstance(v4, dict):
print(f"{' ' * v2... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.array, np.array, np.array, np.array, np.array
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.array, v2: np.array=np.array([0, 0, 5]), v3: np.array=np.array([1, 0, 0]), v4: np.array=np.arr... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int):
v3 = 0
v4 = np.arange(0, self.shape[0])
v5 = np.arange(0, self.shape[1])
v6 = self.__get_surrounding_tile... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict[str, dict[str, list[tuple]]], str, str, tuple
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict[str, dict[str, list[tuple]]], v2: str, v3: str, v4: tuple) -> None:
if v2 not in v1:
v1[v2] = {}
... |
Imports:
```python
import json
from urllib.error import HTTPError
from urllib.parse import urlparse
from urllib.request import Request, urlopen
import typing
```
Type definitions:
Input Types: str
Output Type: Generator
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Generator:
v2 = R... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = ''
self.cursor += 1
v2 = False
while self._can_read():
v3 = self._pop()
if v2:
if v3 != '\\' and v3 != '"':
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
if self.isFull():
return False
self.data[self.tail] = v1
self.tail = (self.tail + 1) % len(self.data)
self.num_entries +=... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.raw_param.get('kubernetes_version')
if self.mc and self.mc.kubernetes_version is not None:
v1 = self.mc.kubernetes_version
return... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, float, float
Output Type: List[Tuple[int, float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int, v3: float, v4: float) -> List[Tuple[int, float]]:
v5 = [(i, v3 + i / v1 * (v4 - v3)) for v6 in range(v1)]
... |
Imports:
```python
import numpy as np
from sklearn.metrics._pairwise_distances_reduction import PairwiseDistancesReduction, PairwiseDistancesArgKmin, PairwiseDistancesRadiusNeighborhood, _sqeuclidean_row_norms64
from sklearn.metrics import euclidean_distances
from sklearn.utils.fixes import sp_version, parse_version
fr... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, *v1: tuple, **v2: dict):
self._edges: dict = dict()
self._id: str = str()
self._name: str = str()
self._node_type: str = str()
self.id: str = str(uuid.uuid4())
self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str, int
Output Type: Set[str]
Dependencies:
```python
def v0(v1, v2: str, v3: int=0) -> Optional[Set[str]]:
if v3 > MAX_DEPTH:
raise NotifyExpansionLoopError(f'Hit MAX_DEPTH while expanding !!{v2}. Do you have a loop?')
v4 = get_... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0(object):
v1: int = 0
v2: int = 0
v3: int = 0
v4: int = 0
```
Input Types: Iterable[int], Iterable[float], float
Output Type: float
Dependencies:
```python
def v5(v6: Iterable[float], v7: Iterable[float], v8: float=0.5) ... |
Imports:
```python
import pathlib
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: str) -> pathlib.Path:
return pathlib.Path(__file__).with_name(v1)
```
```python
def v2(v3: str, v4: str, v5: bool=False) -> None:
with open(v0(v3), encoding='utf-8') as v6:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1, v2):
pass
```
Function Name: v3
Function:
```python
def v3(self) -> None:
def v4(v5, v6):
pass
v7 = self.Metafunc(v4)
v7.parametrize('x', [1, 2], ids=['basic', 'advanced'])... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = [self.env_begin, self.top_separator, self.header, self.middle_separator, self.env_body, self.bottom_separator, self.env_end]
v2 = '\n'.join([item ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict):
v2 = {}
v3 = [item[1][1] for v4 in iter(v1.items())]
v5 = [v4[1][2] for v4 in iter(v1.items())]
v6 = [v4[1][3] for v4 in iter(v1.items())]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float) -> tuple:
v2 = abs(int(str(v1).split('.')[0])) // 10
v3 = abs(float(v1)) % 10
if v1 < 0:
v3 *= -1
v2 *= -1
return (v2, roun... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Optional[str]:
for v2 in self.pattern_translator_groupings:
(v3, v4, v5) = v2
if v5:
v6 = re.search(... |
Imports:
```python
import numpy as np
from pandas._libs import lib, missing as libmissing
from pandas._typing import ArrayLike, AstypeArg, Dtype, DtypeObj, npt, type_t
from pandas.compat.numpy import function as nv
from pandas.core.dtypes.common import is_bool_dtype, is_float, is_float_dtype, is_integer_dtype, is_list_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: typing.Tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=None, v2=None) -> typing.Tuple:
v3 = self.y_list[self._find_begin_idx(v1):self._find_end_idx(v2)]
if len(v3) == 0:
return (None, No... |
Imports:
```python
from pandas._config import get_option
from pandas._libs import lib
from pandas._typing import Axis, FrameOrSeries, FrameOrSeriesUnion, IndexLabel
from pandas.compat._optional import import_optional_dependency
from pandas.util._decorators import doc
from pandas.core.dtypes.common import is_float
impor... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: list):
assert set(v1) == set(v2)
return {k: v1[k] for v3 in v2}
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[str]
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[str]) -> List[str]:
v2 = set()
v3 = list(v1)
while v3:
v4 = v3.pop()
if v4 in v2:
continue
... |
Imports:
```python
import pandas as pd
from pandas import Series
from pandas.api.types import is_bool_dtype, is_categorical_dtype, is_datetime64_any_dtype, is_interval_dtype, is_numeric_dtype
import typing
```
Type definitions:
Input Types: Series
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Update.message
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Update.message) -> str:
v2 = v1.text or v1.caption
if not v2:
return v2
if v2.startswith(os.getenv('ANNOUNCE_PREFIX')):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
v1 = v1.strip()
if '.' in v1:
while v1 and v1[-1] in ' .0':
v1 = v1[:-1]
return v1
```
Function Name: v2
Function:
```python
def v2(v3: str) -> str:
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: int, v2: int, v3: 'EventQueue', v4: Optional[Sequence[str]], v5: str, v6: bool=True, v7: bool=True, v8: bool=False, v9: bool=False, v10: int=0, v11: Iterable[Sequence[str]]=[], v12: bool=False) -> None:
self.u... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = []
for v3 in range(len(v1)):
v4 = []
for v5 in range(len(v1)):
v6 = v1[v5]
v7 = list(v6)
v4.a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[Hashable]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[Hashable]) -> None:
for v2 in v1:
self._inner_remove_descriptor(v2, no_cache=True)
self.cache_table()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Enum
Output Type: str
Dependencies:
```python
def v0(v1: str) -> bool:
return v1.upper() == v1
```
Function Name: v2
Function:
```python
def v2(v3: Enum) -> str:
v4 = v3.name.strip('_')
return v4 if v4 in ('NA', 'XL') or not v0(v4) else v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes, v2: str='<') -> int:
self.write_var_int(len(v1), v2)
return self.write_bytes(v1)
``` |
Imports:
```python
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import typing
```
Type definitions:
Input Types: Any, Dict, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: Dict, v3: int):
v4 = v2.keys()
v5 = [v1.Rectangle((0, 0), 1, 1, color=v2[label... |
Imports:
```python
import typing
```
Type definitions:
Input Types: grpc.RpcError
Output Type: Any
Dependencies:
```python
def v0(v1: grpc.RpcError) -> Optional[Exception]:
if v1.code() == grpc.StatusCode.UNAVAILABLE:
return None
v2 = v1.details()
return Exception(v2)
```
Function Name: v3
Function... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str, v2: str, v3: Optional[str]=None):
self.name = v1
self.kind = v2
self.definition = v3
```
Input Types: v0
Output Type: Any
Dependencies:
Function Name: v4
Function:
```python
def v4(self, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
v2 = self.tab2.sortable_list_ctrl.GetFocusedItem()
v3 = self.tab2.sortable_list_ctrl.GetItem(v2, 0).GetText()
v4 = self.tab2.sortable_list... |
Imports:
```python
import argparse
from argparse import Namespace
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Namespace
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str]) -> Namespace:
v2 = argparse.ArgumentParser(description='Inherint alpha modelling.')
v2.a... |
Imports:
```python
from .io import call_until_success
import subprocess
import typing
```
Type definitions:
Input Types: str, Optional[str]
Output Type: (str, str, int)
Dependencies:
```python
def v0(*v1, **v2):
v3 = call_until_success(OSError, subprocess.Popen, *v1, **v2)
return v3
```
Function Name: v4
Funct... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if v1 == 'I':
return 'am'
elif v1 == 'you':
return 'are'
else:
return 'is'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: ['PykormModel']
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> ['PykormModel']:
v1 = None
if not self._next_filter:
return self._query()
for v2 in self._next_filter:
v1 = self._query(data... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
self.blink_timer.stop()
self.__blink_show = True
if v1 > 0:
self.frequency = v1
self.blink_timer.setInterval(int(1000 / v1))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Optional[Node]'
Output Type: 'Optional[Node]'
Dependencies:
```python
def v0(v1):
if v1.left:
(v2, v3) = v0(v1.left)
v3.right = v1
v1.left = v3
else:
v2 = v1
if v1.right:
(v4, v5) = v0(v1.right)
... |
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 = v1.split(' ')
for (v4, v5) in enumerate(v3):
if v5.startswith(v2):
return v4 + 1
return -1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1) -> float:
self._value = self._calculate(v1)
assert isinstance(self._value, float) or isinstance(self._value, int)
return self._value
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, str
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: str='') -> pd.DataFrame:
v3 = v1.copy()
v3.rename(columns={v3.columns[v3.shape[1] - 1]: str(v3.columns[v3.shape[1] - ... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: Any
v2: Any
v3: List[Any]
v4: List[Dict[Bytes, Optional[Account]]]
v5: List[Dict[Bytes, Dict[Bytes, Optional[U256]]]]
v6: List[Set[Bytes]]
v7: Root
def __init__(self, v8: Optional[str]=None) -> Non... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int) -> int:
v3 = [[0 for v4 in range(v1)] for v4 in range(v2)]
for v5 in range(v2):
for v6 in range(v1):
if v5 == 0 and v6 ... |
Imports:
```python
import pandas as pd
import Bio
from Bio.Seq import MutableSeq, Seq
from Bio import SeqIO
from Bio.SeqUtils import GC
import typing
```
Type definitions:
Input Types: 'pd.DataFrame', 'tuple', 'tuple'
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: 'str', v2: 'tuple') -> Tuple[str, str, s... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass(frozen=True)
class v0(object):
v1: Tuple[str, ...]
v2: str
v3: ClassVar[Tuple[str, ...]] = (' in: Steel Stainless Aluminum Titanium Wood Plastic', '1/16: 0.0019-0.0036 0.0016-0.0030 0.0021-0.0040 0.00... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence[tf.Tensor]
Output Type: Sequence[tf.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Sequence[tf.Tensor]) -> Sequence[tf.Tensor]:
v2 = []
for (v3, v4) in zip(v1, self._parameters):
if v4.transform ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = v1.split('.')
v3 = v2[0]
v4 = v2[1] or 0
v5 = v2[2] or 0
return [v3, v4, v5]
``` |
Imports:
```python
from datetime import datetime, timezone
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2=None, v3: Optional[LexicalCategory]=None):
self.qid = v1.removeprefix('http://www.wikidata.org/entity/')
self.lemma = v2
self.category = v3
def v... |
Imports:
```python
import os
from shutil import copyfile
import typing
```
Type definitions:
Input Types: dict[str, str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict[str, str]) -> None:
self._log('Copying files to destination')
for v2 in v1.keys():
v3 = v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
try:
return self._name2meta[v1]['is_mixed']
except KeyError:
return None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Iterable
Output Type: Any
Dependencies:
```python
def v0(v1: sqlite3.Connection, *v2, **v3):
return v1.executemany(*v2, **v3)
```
Function Name: v4
Function:
```python
def v4(self, v5: str, v6: Iterable):
def v7(v8: sqlite3.Connection, *... |
Imports:
```python
import asyncio
import traceback
import typing
```
Type definitions:
Input Types: Any, Any, Any, 'BusClient', Any
Output Type: Any
Dependencies:
```python
@contextmanager
def v0(v1: 'BusClient', v2=True):
try:
yield
except (asyncio.CancelledError, LightbusShutdownInProgress):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if not self.bot.get_cog(v1):
self.print(f"BotSetupCog attempted to disable cog '{v1}', but no such cog exists.")
return
s... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: tp.List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> tp.List[str]:
v1: tp.Set[str] = set()
v2: bool = True
while v2:
v2 = False
for (v3, v4) in self.rules.items():
if v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: sublime.View
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: sublime.View) -> float:
v2 = v1.style()
if not v2 or 'background' not in v2:
return 0
v3 = v2['background'].lstrip('#')
v4 = tuple(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: datetime, Dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: datetime, v2: Dict):
v3 = self._stats.get(v1)
if v3:
v3['confirmed'] += v2['confirmed']
v3['deaths'] += v2['deaths']
... |
Imports:
```python
from datasets import Dataset
import typing
```
Type definitions:
Input Types: Union[str, Dataset], Optional[int], bool
Output Type: Union[Tuple[List, List], DataFrame]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, Dataset], v2: Optional[int]=1, v3: bool=True, **v4)... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
@step(output=None)
async def v1() -> None:
pass
``` |
Imports:
```python
import os
import json
import typing
```
Type definitions:
Input Types: str, str, bool
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: bool=False) -> dict:
if v3:
pass
elif v1 in self.scoresSave:
return {'status': False... |
Imports:
```python
import os
import sys
from matplotlib import pyplot as plt
import typing
```
Type definitions:
Input Types: list, list, str
Output Type: Any
Dependencies:
```python
def v0(v1: dict, v2: float, v3: str):
v4 = 1000 * CAR_NUM / v2
v5 = time.time()
v6 = 1 - list(v1.values())[0]
v7 = Fleet... |
Imports:
```python
import typing
```
Type definitions:
Input Types: argparse.ArgumentParser
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: argparse.ArgumentParser) -> None:
v1.add_argument('--tb', '--traceback', help='show the full traceback of critical exceptions', action='store... |
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=None):
v3 = self.resolve(v2)
if v1 in v3:
return v3[v1]
return self._resolve_property_from_os_env(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
while True:
v2 = input(v1.strip(' ') + ' ').lower()
if v2 in ('yes', 'y', 'ye', 'yep', 'yeah'):
return True
eli... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.