text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool, str, bool
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool=True, v3: str='current', v4: bool=True) -> dict:
v5 = dict(account=v1, strict=v2, ledger_index=v3, queue=v4)
return self... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: Dict[str, List[torch.Tensor]]
Output Type: Dict[str, torch.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, List[torch.Tensor]]) -> Dict[str, torch.Tensor]:
v2: Dict[str, torch.Tensor] = {}
for (v3... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0() -> bool:
print('==> Verifying access to the CMX APIs')
try:
v1 = requests.get('https://cmxlocationsandbox.cisco.com/api/location/v2/client... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Dict, Dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Dict, v3: Dict):
self.flush()
self.data_frames.append(([], []))
self.parser.start(self.clazz, self.queue, self.objects, v1, v2,... |
Imports:
```python
from string import punctuation
import typing
```
Type definitions:
Input Types: Iterable[str]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[str]) -> bool:
if v1 in punctuation:
return True
return False
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Session, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Session, v2: str):
v3 = {'RestartReset': 'Restart'}
v4 = v1.put(f'{v2}/php/ajaxSet_status_restart.php', data=json.dumps(v3))
if... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float) -> float:
v2 = int(v1)
return self.p * (1 - self.p) ** (v2 - 1)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('S')
```
Input Types:
Output Type: List[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(self) -> List[v0]:
v2 = []
for v3 in range(self.population_size):
v2.append(self.problem.create_solution())
return v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ScicopiaParser.PrefixedContext
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ScicopiaParser.PrefixedContext):
v2: str = v1.getText()
self.counter += 1
v3 = v2[:v2.index(':')]
if not self.term is... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int):
self.logger.info('rollback utxo_backup to block height: %s', v1)
await self.delete_invalid_utxos_and_backup(v1)
v2 = 'WITH moved_utxos A... |
Imports:
```python
import hashlib
import os
import typing
```
Type definitions:
Input Types: str, bool, Optional[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool=False, v3: Optional[str]=None) -> None:
self._path = v1
self._is_tmp = v2
self._extensi... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: pd.DataFrame, v2: List[str]) -> pd.DataFrame:
v3 = {f'log2_{column_name}': np.log2(v1[column_name]) for v4 in v2}
return v1.assign(**v3)
```
```python... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: 'BinningBase'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'BinningBase'):
if np.array_equal(self.bins, v1.bins):
return (None, None)
elif not self.is_adaptive():
rai... |
Imports:
```python
from typing import Mapping, Iterable, Any, Sequence, List
import typing
```
Type definitions:
Input Types: dict, List[str], Any, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1):
if v1 is None or isinstance(v1, (str, bytes, Mapping)) or (not isinstance(v1, Iterable)):
yield v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: base_worker.WorkerBase, typing.Tuple[str, ...]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: base_worker.WorkerBase, v2: typing.Tuple[str, ...]) -> None:
v1.run('\n'.join([f'del {v}' for v3 in v2]))
se... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
```python
@backoff.on_exception(backoff.expo, requests.exceptions.RequestException)
def v0(v1: str, v2: Dict[str, str]):
v3 = requests.put(v1, json=v2)
v3.raise_for_status()
```
Function Name... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2):
with open(v2, 'w') as v3:
for v4 in v1:
v3.write(str(v4) + '\n')
v3.close()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1: Any) -> str:
v2 = {key: self._converters[key].to_url(value) for (v3, v4) in v1.items()}
return self._builder.format(**v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable[..., bool], int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Callable[..., bool], v2: int, v3: int) -> None:
if v1(v2):
self.eip = v3
self._jumped = True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1, v2) -> None:
v3 = await self.process_message(v2[0])
return v3
``` |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: sqlite3.Cursor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: sqlite3.Cursor):
v2 = []
for v3 in v1.description:
v2.append(v3[0])
v4 = len(v2)
v5 = []
for v6 in v1.fetchall(... |
Imports:
```python
import os
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 not in self.__config__['groups']:
return []
v3 = self.__config__['groups'][v1]
self.__check_cache__(v1, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: (int, int)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int) -> (int, int):
(v3, v4) = (v1, v2)
while v4 % v3 != 0:
(v3, v4) = (v4 % v3, v3)
return (v3, v1 * v2 // v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Callable, v2: bool=False):
v3 = self._get_mapped_items(v1, self.get_items())
return self.set_items(v3, inplace=v2)
``` |
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=45) -> str:
v3 = v1.find('\n\n')
if v3 != -1:
v1 = v1[:v3]
v4 = v1.split()
if not v4:
return ''
if v4[0] == '\x0... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if len(self.args) == 0:
self.do_help()
elif len(self.args) > 0 and self.args[0] == '-v':
self.do_version()
elif len(self.args) > ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: int, **v3):
for v4 in v1:
v5 = v4.proxy.list()['endpoint']
self.benchmark.add_host(v5, v2, **v3)
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: list, str, int, str
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: str):
v3 = CRAWLER_CLASSES.get(v1.lower(), DEFAULT_CRAWLER_CLASS)
return v3(downloader_threads=DOWNLOADER_THREADS, storage={'root_dir': v2})
```
Functio... |
Imports:
```python
import os
import numpy as np
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: pd.DataFrame, str, str, str, bool, bool, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame, v2: str, v3: str=None, v4: str=',', v5: bool=True, v6... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2, v3):
self.key = v1
self.value = v2
self.hash = v3
def __repr__(self) -> str:
return f'Entry("{self.key}", {self.value})'
def v4(self) -> str:
return f'{self.key}: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str], Optional[str], argparse.Namespace
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[str], v2: Optional[str], v3: argparse.Namespace) -> bool:
print('Input file name: %s -- Output file name: %... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Any
```
```python
v1 = Any
```
```python
v2 = Any
```
```python
class v3(DeviceArray):
v4 = ['aval', 'device_buffer', '_npy_value', '_device']
v5 = 100
v6 = True
def __init__(self, v7: core.ShapedArray, v8: Optional[v0], v9: v2):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
```python
def v0(v1: int, v2: int) -> int:
return x * 100 + v1 * 10 + v2
```
Function Name: v3
Function:
```python
def v3(v4: int):
def v5(v6: int, v7: int) -> int:
return v4 * 100 + v6 * 10 + v7
... |
Imports:
```python
import torch
from torch import nn, Tensor
import typing
```
Type definitions:
Input Types: int
Output Type: torch.device
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> torch.device:
if torch.cuda.is_available():
v2 = torch.device(f'cuda:{int(v1)}')
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Any, int, str
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3, v4: int=None, v5: str=None) -> np.array:
try:
return self.load_numpy_analysis_result(v1, v2, v4, v5)
... |
Imports:
```python
import os
from datetime import datetime
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = datetime.now().strftime('%Y-%m-%d %Hh %Mm %Ss')
v3 = os.path.join(v1, v2)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Type, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any, v2: Type, v3: Any=None) -> Any:
try:
return v2(v1)
except (ValueError, TypeError):
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float, float, float, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float, v3: float, v4: float, v5=None) -> None:
v6 = v3 - v1
if v2 < -1:
v7 = 'UNDERLINE'
elif v2 > 0... |
Imports:
```python
import copy as cp
import numpy as np
import typing
```
Type definitions:
Input Types: dict, dict, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: dict, v3: dict):
v4 = cp.deepcopy(v1)
for v5 in v1.keys():
if v1[v5]['list_type'] ==... |
Imports:
```python
from contextlib import suppress
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> None:
with suppress(AttributeError):
v2 = 0
v3 = 0
for v4 in v1.state.train.minibatch_stats:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int) -> None:
v3 = self.tokens
if v1 in v3 and v3[v1] > v2:
v3[v1] = v2 + self.timeToLive
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> np.ndarray:
assert self.lines.shape[0] <= self.x_pixels * self.frames_per_chunk
v1 = np.hstack((self.lines.values, self.lines.valu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> tuple:
for v2 in v1:
yield (v2[0], v2[1])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Any:
assert self.FieldedClass is not None
return self.FieldedClass(self._get_expected_init_dict())
``` |
Imports:
```python
import os
from urllib.parse import urlparse
import typing
```
Type definitions:
Input Types: dict
Output Type: Tuple[str, str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> Tuple[str, str, str]:
v2 = v1['media']
v3 = v2['baseUri']
v4 = v2['token'] if... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
for v2 in self.__links:
if v2[0] == v1:
return True
return False
``` |
Imports:
```python
import os
import sys
from subprocess import PIPE, Popen
import typing
```
Type definitions:
Input Types: str, Sequence[str]
Output Type: int
Dependencies:
```python
def v0() -> dict[str, str]:
v1 = dict(os.environ)
v1['PYTHONPATH'] = os.pathsep.join(sys.path)
return v1
```
Function Name:... |
Imports:
```python
from urllib import parse
import typing
```
Type definitions:
Input Types: dict, dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict={}, v2: dict={}) -> str:
v3 = self.url.split('/')
v4 = '/'
for v5 in v3:
if v5:
if '@' in v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: [str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> [str]:
if self.use_nn:
v2 = self.__pre_split_token(v1)
for v3 in self._id_splitter_nn.split(v2):
for v4 in v3:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Set[str], Any, Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Set[str], v2, v3) -> int:
v4 = next(iter(v1))
self._addNodes(numNodes=v2, nodeType=v4, preemptable=v3)
return self.getNumberOfNodes(n... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[Iterator, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple[Iterator, int]:
v1 = self._validation_sequence_adapter
v2 = 0
v3 = len(v1)
if self._context.hvd_config.use:
v4 = self... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Path, int, int
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path, v2: int, v3: int) -> Tuple[np.ndarray, np.ndarray]:
if self.fixed_window:
v4 = np.empt... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> list:
v2 = []
v3 = []
v4 = len(v1) - 1
for (v5, v6) in enumerate(v1):
if v6 in self.KEYWORDS_LEVEL1:
if v3:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[Exception], Optional[Type]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(*v3: Any, v1: Optional[Exception]=None, v2: Optional[Type]=None) -> None:
if v2 is not None:
for v4 in v3:
if not... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, List[str], Any, Any, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3, v4, v5: List[str], v6, v7, v8: bool=False):
v9 = self.content_email_new_sub.format(v1, v2, v3, v4, v6, v7)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
v2 = {0: 'love', 1: 'fifteen', 2: 'thirty', 3: 'forty'}
return v2[v1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if self.connection and (not self.connection.is_closed()):
return True
if self.pool and (not self.pool._closed):
return True
retur... |
Imports:
```python
import json
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
with open(os.path.join('.', self.data_folder, self.USERS_FILENAME), 'w') as v1:
json.dump(self.contents, v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2: List[str]):
v3 = [rule.split(' -> ')[1] for v4 in v1]
assert set(v3) == set(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'AbstractPlanTranslator'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'AbstractPlanTranslator'):
v2 = v1(self).translate()
self.roles[v1.framework] = v2
return v2
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: Tuple[int], float
Output Type: Tuple[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple[int], v2: float) -> Tuple[int]:
v3 = (1 - v2) ** 0.5
(v4, v5) = v1[-2:]
(v6, v7) = (int(v4 * v3), int(v5 * v... |
Imports:
```python
import scipy.sparse as sp
import typing
```
Type definitions:
Input Types: Any, int, Tuple[int], Optional[int]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: int, v3: Tuple[int], v4: Optional[int]=0):
v5 = sp.coo_matrix(([1.0], ([0], [0])))
v6 = sp.coo_m... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types: int, int, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, *, v2: int, v3: str) -> None:
print(f'({v1 + 1}/{v2}) {v3}: ', end='')
sys.stdout.flush()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.Union[str, bytes]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: t.Union[str, bytes]) -> bool:
v2 = 0 if len(v1) == 1 else 2
if hasattr(self, 'fs_token_uniquifier'):
return v1[v2] == self.fs_t... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.avg_ss += self.spec.integ * self.spec.ss_dt * (self.act - self.avg_ss)
self.avg_s += self.spec.integ * self.spec.s_dt * (self.avg_ss - self.avg_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, list, list, str, str, str
Output Type: Any
Dependencies:
```python
def v0(v1: list):
if v1:
v2 = [f'ifnull(({r}), false)' for v3 in v1]
v1 = ' OR '.join(v2)
return f'AND NOT ({v1})'
else:
return ''
```
```p... |
Imports:
```python
import os
import hashlib
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
(v1, v2) = os.path.splitext(self.name)
return {'kind': self.kind, 'name': self.name, 'path': self.id, 'unix_path': self.unix... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1, **v2) -> None:
for v3 in self:
v3.calculate_lead_time(*v1, **v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[float], List[float], int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[float], v2: List[float], v3: int=7) -> None:
if len(v1) != len(v2):
raise AssertionError(f'List lengths do not match... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: List[dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True) -> List[dict]:
v2 = self.plugins
v3 = 'external_obtain_access_tokens'
if v1:
v2 = self.get_active_plugins()
return [{... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.isReplay = True
self.deactivateOpeningInterface()
self.deactivateGamingInterface()
self.deactivateEndingInterface()
self._setup()
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(StylerRenderer):
def __init__(self, v1: FrameOrSeriesUnion, v2: int | None=None, v3: CSSStyles | None=None, v4: str | None=None, v5: str | tuple | None=None, v6: str | None=None, v7: bool=True, v8: str | None=None, v9: int=5, v10: str='.', v... |
Imports:
```python
import glob
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):
assert self.is_object_in_repo(v1)
v2 = Path(self.git_dir) / 'objects' / v1[0:2]
v3 = Path(v2) / v1[2:]
... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
```python
v0 = Mapping[str, StatList]
```
Input Types:
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self) -> v0:
v2 = self.stats
self.stats = defaultdict(list)
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: 'MTextEditor'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str='^') -> 'MTextEditor':
if v3 not in '^/#':
raise ValueError(f'invalid type symbol: {v3}')
if v3 == '^'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame) -> pd.DataFrame:
v2 = v1[self.cfg.data.event].value_counts().to_dict()
for v3 in self.cfg.data.features.percentage_of_ev... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._rect.height = self._frame_size[1] + self._title_height()
self._rect.width = self._frame_size[0]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: MouseEvent
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: MouseEvent) -> None:
if v1.inaxes == self.ax:
self.annotation.xy = (v1.xdata, v1.ydata)
self.annotation.set_text(self.annotation_tex... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, float
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.ndarray, v3: float=0.05) -> np.ndarray:
v4 = np.clip(v1 - v3 * np.ones_like(v1), 0, 1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v1['domain_param'] = self.domain_param
v1['init_state'] = self.init_state
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: typing.List[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> typing.List[float]:
v1 = len(self.array)
return [i / v1 for v2 in range(v1)]
``` |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: requests.Response, Mapping[str, Any]
Output Type: Iterable[Mapping]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: requests.Response, v2: Mapping[str, Any], **v3) -> Iterable[Mapping]:
v4 = supe... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.host is not None:
return self.host
return self.get_domain()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Tuple[Tuple[float, float], ...]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> Tuple[Tuple[float, float], ...]:
v2 = self.reverse() if v1 else self
v3 = ((v2.min_x, v2.min_y), (v2.min_x, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, str, str, str, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: str, v3: str, v4: str, v5: str, v6: str) -> None:
for v7 in v1:
print()
if v7 == 'LATLONG':
print... |
Imports:
```python
from enum import Enum
import typing
```
Type definitions:
Input Types: Union[Enum, Iterable[Enum]]
Output Type: Any
Dependencies:
```python
def v0(v1: Iterable[Enum], v2):
if v2.user.has_perms(v1):
return True
v3 = getattr(v2, 'app', None)
if v3:
if AccountPermissions.MAN... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, int, Optional[int]
Output Type: Any
Dependencies:
```python
def v0(v1):
return np.arccos(v1) * 180 / 3.14159
```
```python
def v2(v3):
return np.cos(v3 * 3.14159 / 180)
```
```python
def v4(v5: Union[int, float], v6: Un... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str):
self.csv.addLine(v1, v2, v3, -1, -1, -1, -1)
self.view.setVotersListContent()
return None
``` |
Imports:
```python
import re
import json
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
```python
def v0(v1):
v2 = re.search('^jsonp_\\d+_\\((.*?)\\);?$', v1)
return json.loads(v2.group(1) if v2 else '{}')
```
Function Name: v3
Function:
```python
def v3(self, v4: dict):
... |
Imports:
```python
from re import compile
import typing
```
Type definitions:
Input Types: str, str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> dict:
v3 = compile(v2)
v4 = v3.fullmatch(v1)
return {'start': int(v4.group(1)), 'stop': int(v4.group(2)), 'l... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
v2 = self.tokenizer(v1, return_tensors='pt', padding=True, return_length=True, return_token_type_ids=False, return_attention_mask=False, truncation=... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
with self.order_count_lock:
self.order_count += 1
return self.order_count
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> tuple:
v2 = set()
v3 = list()
(v4, v5) = v1.split('\n\n')
for v6 in v4.split('\n'):
v2.add(tuple(map(int, v6.split(','))))
for v... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Callable[..., CoroutineResult]
```
```python
v1 = Callable[..., CoroutineResult]
```
Input Types: v0
Output Type: v1
Dependencies:
```python
@wraps(coro)
async def v2(self, *v3, **v4) -> Any:
return await coro(*v3, **v4)
```
Function Name: v5
Fun... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any], v2: str) -> int:
if v1.get(v2, 0) == 0:
return 0
return 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str):
for v3 in v2.split('/'):
if v3 == '':
continue
v1 = v1[v3]
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence[Any]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Sequence[Any]) -> None:
if hasattr(self.parameter, 'validate'):
for v2 in v1:
self.parameter.validate(v2)
``` |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
from torch.utils.data import dataset
from torch.utils.data.dataset import Dataset
from torch import Tensor
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0... |
Imports:
```python
import os
import random
import torch
import numpy as np
import typing
```
Type definitions:
Input Types: int, bool, bool, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: bool=True, v3: bool=False, v4: bool=False):
random.seed(v1)
np.random.seed(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: float=0):
v4 = []
for v5 in range(0, v2):
v6 = []
for v7 in range(0, v1):
v6.append(v3)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.