text stringlengths 190 325k |
|---|
Imports:
```python
import inspect
import typing
```
Type definitions:
```python
class v0(Protocol):
def __call__(self, v1: Optional[inspect.Parameter], v2: DependantBase[Any]) -> Optional[DependantBase[Any]]:
...
```
Input Types: v0
Output Type: ContextManager[None]
Dependencies:
```python
def v3(v4: Optio... |
Imports:
```python
import json
import os
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[Optional[str], Optional[str]]
Dependencies:
```python
def v0(v1):
v2 = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'secrets.json')
if not os.path.exists(v2):
RuntimeWarning('... |
Imports:
```python
from collections import defaultdict, deque
import collections.abc
import typing
```
Type definitions:
```python
v0 = xc.Shape
```
Input Types: Any, Any, v0, Any, Any
Output Type: Any
Dependencies:
```python
def v1(v2: v0, v3: Tuple[int, ...], v4: List[Tuple[Tuple[int, ...], v0]]) -> None:
if v2.i... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> List[str]:
with open('stat/history.txt') as v1:
v2 = list(v1.readlines())
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[PurePath]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[PurePath]:
v1 = self.members()
v2 = [f for v3 in v1 if len(v3.parts) == 1 and (v3.match('*.yaml') or v3.match('*.yml'))]
return v2
``` |
Imports:
```python
import shlex
import typing
```
Type definitions:
Input Types: pathlib.Path
Output Type: t.Tuple[str, t.List[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pathlib.Path) -> t.Tuple[str, t.List[str]]:
v2 = []
v3 = []
if self.port:
v3 += ['-p', str(self.... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
```python
def v0(v1: str):
v2 = re.split("([\\(\\)\\s'])", v1)
v3 = [[]]
v4 = list(v2)
v5 = None
while len(v4) > 0:
v6 = v4.pop(0)
if v5 is not None:
v5 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[str]]
Output Type: List[List[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[List[str]]) -> List[List[str]]:
v2 = len(v1)
for v3 in range(v2):
v4 = len(v1[v3]) - 1
v5 = len(v1[v3]) - 1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> bool:
self.reset()
return self.wait_for(v1, topic_name=None)
``` |
Imports:
```python
import glob
import itertools
import os
import typing
```
Type definitions:
Input Types: Union[str, Iterable[str]], str, str
Output Type: Iterable[str]
Dependencies:
```python
def v0(v1: str, v2: str, v3: str='') -> Iterable[str]:
v2 = v2.lstrip('.')
for v4 in sorted(glob.glob(os.path.join(v1... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: float, float, float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float, v3: float, v4: float):
v5 = f'coil_{self.id}_response'
v6 = {v5: {'mepmaxtime': v1, 'mepamplitude':... |
Imports:
```python
from pathlib import Path
import re
import shutil
import subprocess
import hashlib
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> int:
if Path(v1).is_dir():
if not v2.remove_dir:
... |
Imports:
```python
import numpy as np
import scipy.stats as spstats
import typing
```
Type definitions:
Input Types: pd.DataFrame, str, int, str
Output Type: pd.Series
Dependencies:
```python
def v0(v1: pd.DataFrame, v2: str):
v3 = v1.copy().T
v3.index = v3.index.swaplevel(-1, -2)
return v3.T[v2]
```
Funct... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray):
v2 = (v1[:, 0].max(), v1[:, 1].max())
v3 = np.empty((v2[1], v2[0]), dtype=np.ndarray)
for (v4, v5) in zip(v1, v1[1:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: int) -> int:
v1.sort()
v3 = float('inf')
v4 = 0
for v5 in range(len(v1) - 1):
v6 = v5 + 1
v7 = len(v1) - 1
whil... |
Imports:
```python
from random import choice
from random import randint
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int=1, v2: int=100) -> int:
try:
if v1 > 0 and v2 < 101:
return randint(v1, v2)
... |
Imports:
```python
import os
import shutil
import typing
```
Type definitions:
Input Types: Sequence[str]
Output Type: None
Dependencies:
```python
def v0(v1: str) -> None:
try:
os.unlink(v1)
except OSError as e:
if e.errno != errno.ENOENT:
raise
```
```python
def v2(v3: str, v4: bo... |
Imports:
```python
from torch._C import default_generator
import torch
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3) -> torch.Tensor:
v4 = (v2 - v1) * torch.rand(*v3) + v1
return v4
``` |
Imports:
```python
from re import findall
from os import makedirs
from os.path import exists
from astropy.io import fits
from astropy.wcs import WCS
from astropy.nddata import Cutout2D
import typing
```
Type definitions:
Input Types: str, str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```pyt... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[Tuple[float, float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Optional[Tuple[float, float]]:
try:
v2 = self.es.search(index=v1, size=0, aggs={'min_watermark': {'min': {'field':... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union['_Subject', '_ObjSubject', '_NoneSubject', '_StringSubject', '_BoolSubject', '_NumericSubject', '_ListOrTupleSubject', '_SetSubject', '_DictSubject', '_DateTimeSubject', '_DateSubject', '_CallableSubject']
```
Input Types: str
Output Type: v0
D... |
Imports:
```python
from io import StringIO
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = StringIO()
for v3 in v1.splitlines():
v3 = v3.strip()
if v3:
v2.write(v3)
v2... |
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 = ['expand', 'macros', 'in', v1]
return self.run(v2)
``` |
Imports:
```python
import requests
import json
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
```python
def v0(v1) -> dict:
v2 = v1['datasource']
v3 = int(v2.split('__')[0])
v4 = v2.split('__')[1]
v5 = []
if v1.get('metric', None) is not None:
v5.append... |
Imports:
```python
import typing
```
Type definitions:
Input Types: WebDriver
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: WebDriver):
v2 = '.jp-NotebookPanel:not(.lm-mod-hidden) button.validate-button'
v1.find_element_by_css_selector(v2).click()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: 'ReplyAction'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> 'ReplyAction':
self.latency = v1
return self
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, float
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: float=1e-06) -> np.ndarray:
v3 = np.linalg.norm(self.vectors, axis=0)
for v4 in range(3):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict[str, Any], Collection[str], Any
Output Type: dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict[str, Any], v2: Collection[str], v3: Any) -> dict[str, Any]:
if v1:
assert set(v1) == set(v2), 'Objects ar... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = 0
v2 = 0
v3 = -1
while v2 < self._iterrations:
v3 = -1 if v3 == -4 else v3
if v2 == -1:
v1 = 3
elif v2... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: str, Iterable[str]
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: str):
v3 = np.zeros((len(v1) + 1, len(v2) + 1), dtype=np.bool)
v3[0, 0] = True
for v4 in range(len(v1)):
for v5 in range(len(v2)):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: Tuple[torch.Tensor, Optional[torch.Tensor]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor) -> Tuple[torch.Tensor, Optional[torch.Tensor]]:
(v3, v4, v3) ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
self.sorted_stream.append(v1)
self.sorted_stream.sort(reverse=True)
return self.sorted_stream[self.k - 1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: Tuple[float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> Tuple[float, float]:
assert v1 > 1e-16, f'Incorrect Price = {v1}'
(v2, v3) = self.aligner.liq_to_xy(price=v1, liq=self.liquidity)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Generator[Tuple[str, np.ndarray], None, None], int, int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Generator[Tuple[str, np.ndarray], None, None], v2: int, v3: int, v4: int=1) -> None:
self._init_in... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='dummy') -> tuple:
v2 = {'binance': {'api_url': 'https://api.binance.com', 'api_key': '000000000000000000000000000000000000000000000000000000000000000... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: 'Config'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> 'Config':
if self.state:
v2 = self.config.get(v1)
if isinstance(v2, dict):
self.active_section = v1
sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'User'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'User') -> None:
v1.tf_primary_method = None
v1.tf_totp_secret = None
v1.tf_phone_number = None
self.put(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: [Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor) -> [Dict]:
v2 = dict()
v2['img'] = v1.view(1, v1.shape[0], v1.shape[1], v1.shape[2], v1.shape[3])
v3 = self.extract_one_ba... |
Imports:
```python
import typing
```
Type definitions:
Input Types: nn.Module, torch.Tensor, torch.Tensor, Optional[torch.Tensor], float
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: nn.Module, v2: torch.Tensor, v3: torch.Tensor, v4: Optional[torch.Tensor]=None, v5: fl... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'bittensor.Keypair', bool, bool
Output Type: 'bittensor.Keyfile'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'bittensor.Keypair', v2: bool=True, v3: bool=False) -> 'bittensor.Keyfile':
self._coldkey = v1
self.coldkey_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> List[str]:
v2 = False
v3 = []
for v4 in v1:
if v4 == '{':
v2 = True
v5 = []
elif v4 == '}':
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
v2 = self.summary()
v2.to_csv(v1, index=False)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.corner_to_position([500, 500, 500, 500])
self.send_motor_duty([0, 0, 0, 0, 0, 0])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = super().get_parameters()
v1['c'] = self.c
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: str) -> int:
v3 = []
v4 = set()
if '0000' in v1:
return -1
v3.append('0000')
v4.add('0000')
v5 = 0
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> bool:
if len(v1) > len(v2):
return False
v1 = sorted(v1, reverse=True)
v2 = sorted(v2, reverse=True)
while len(v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[str]=None) -> str:
v3 = int(self.config.md_header_level)
v4 = '\n'
if v2:
v4 += f"<a id='{v2}'/>\n\n"
v... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: str, Path, Path
Output Type: Tuple[Path, Union[None, Path]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Path, v3: Path) -> Tuple[Path, Union[None, Path]]:
v4 = [f.relative_to(v3) for v5 in v3.g... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1: int, v2: int):
self._type = v1
self._size = v2
def v3(self, v4):
if v4 is None:
return -1
if not self.is_defined():
return -1
if not v4.is_d... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray):
v2 = np.zeros_like(v1, dtype=np.complex128)
v3 = v1.size
v4 = -2j * np.pi / v3 * np.arange(v3, dtype=np.complex128)... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = ''
v2: ClassVar[dict[str, type['Mu']]] = {}
v3: ClassVar[frozenset[str]] = frozenset()
v4: ClassVar[frozenset[str]] = frozenset()
v5: ClassVar[frozenset[str]] = frozenset()
v6: ClassVar[Dict[str, str]] = {}
v7 = ... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = set(self.all_indexes) | set(self.indexes)
v2: dict[Hashable, int] = defaultdict(int)
v3: dict[Hashable, ... |
Imports:
```python
import heapq
import typing
```
Type definitions:
```python
v0 = typing.Tuple[str, int]
```
```python
v1 = typing.Iterable[v0]
```
```python
v2 = typing.Callable[[str, str], int]
```
Input Types: str, typing.Iterable[str], v2, int
Output Type: v0
Dependencies:
```python
def v3(v4: str, v5: typing.Iter... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ndarray, ndarray, ndarray, ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ndarray, v2: ndarray, v3: ndarray, v4: ndarray):
v5 = 1.0 / self.DATA_TYPE(self.N)
v6 = 1.0 / self.DATA_TYPE(self.N)
... |
Imports:
```python
import re
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Path, v2: str):
self.file = v1
self.message = v2
def v3(self) -> str:
return f'{os.path.relpath(self.file)}: {self.message}'
def v4(self, v5: 'LintError') -> bool:
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if v1 is None:
return
self._output_topic = v1
self.recreate_publisher()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, str, Any, dict
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: str, v3, v4: dict={}) -> list:
v5 = []
v6 = 1 if len(v3) < 4 else v3[3]
for v7 in v1:
v5.append({**v4, **{'type': v2, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = dict()
v1['data_paths'] = self.data_paths
v1['data_labels'] = self.data_labels
v1['split_name'] = self.split_name
v1['elem_ids'] = s... |
Imports:
```python
from PIL import ImageColor, ImageDraw, Image
import typing
```
Type definitions:
Input Types: list, int, int, bool, int, int, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: int=-1, v3: int=-1, v4: bool=True, v5: int=0, v6: int=0, v7: Any='white'):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tokenize.TokenInfo
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tokenize.TokenInfo) -> None:
v2 = v1 == self.file_tokens[0]
if not v2:
return
v3 = self._get_shebang_token()
self._check... |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = self.clean_input_data(v1)
v3 = []
v4 = {}
for (v5, v6) in enumerate(v2):
v7 = {}
for v8 in self.y_labels:... |
Imports:
```python
import json
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if v1 not in self.__config__['groups']:
return []
v2 = self.__config__['groups'][v1]
self.__check_cache__(v1, v2... |
Imports:
```python
import numpy as np
import tensorflow as tf
import typing
```
Type definitions:
Input Types: Dict
Output Type: NoReturn
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict) -> NoReturn:
v2 = v1.get('summary_dict', {})
v3 = v1.get('sample_data_list', ['s', 'visual_s', 'a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
if self.exists:
v2 = self._con.request(method='DELETE', path=f'rest/api/content/{v1}')
if str(v2.status_code)[0] != '2':
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Type['KIFGrammar.Atom']
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Type['KIFGrammar.Atom']:
if self.text is None:
return
assert len(self.text) == 1
return self.categories[self.get_category(se... |
Imports:
```python
import pandas as pd
import copy
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> list:
v2 = []
v3 = 0
v4 = copy.deepcopy(v1)
for v5 in v4:
self.case_obj.set_name(str(v3))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List, Any
Output Type: List
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List, v2) -> List:
v3 = v1
v3.append(v2)
return list(set(v3))
``` |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types:
Output Type: DefaultDict[str, List[Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> DefaultDict[str, List[Any]]:
v1: DefaultDict[str, List[Any]] = defaultdict(list)
for (v2, v3) in... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v1 = v1.strip()
if len(v1) > 0 and v1[0] == '"' and (v1[len(v1) - 1] == '"'):
v1 = v1[1:-1]
if len(v1) > 0 and v1[0] == "'" and (v1[l... |
Imports:
```python
from pprint import pprint
from sys import exit
import typing
```
Type definitions:
Input Types: Any
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> dict:
v2 = v1.json()
try:
v3 = v2['access_token']
v4 = v2['refresh_token']
except KeyEr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
```python
def v0(v1) -> str:
v2 = v1.schema_generator(v1)
return v2.get_create_schema_sql()
```
Function Name: v3
Function:
```python
async def v3(v4) -> None:
v5 = v4.schema_generator(v4)
await v5.g... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray) -> np.ndarray:
for v3 in self._net[:-1]:
v3.forward(v1)
v1 = v3._output
if v2 is n... |
Imports:
```python
import random
import numpy as np
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: int, gym.Env
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: gym.Env):
v2.seed(v1)
torch.manual_seed(v1)
np.random.seed(v1)
r... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str, v2: AssetAmount, v3: AssetAmount, v4: AssetAmount):
self.id = v1
self.lp = v2
self.x = v3
self.y = v4
def v5(self) -> int:
return EMISSION_LP - self.lp.amount
def... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: (bool, object)
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> (bool, object):
v2 = self.server.get(v1)
if None == v2:
return (False, None)
else:
return (True, v2)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Any
Dependencies:
```python
def v0(v1: pd.Series):
if self.method == 'yeo-johnson':
v2 = np.zeros_like(v1, dtype=np.float64)
v3 = v1 >= 0
if self.power != 0:
v2[v3] =... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
self.is_stream_consumed = True
await self.close()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: discord.Interaction
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: discord.Interaction):
v2 = v1.user
v3 = v1.guild.get_role(int(self.custom_id))
if v3 is None:
return
if v3 not in ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str, v4=List[Dict[str, Any]]) -> None:
for v5 in v4:
v6 = v5['slotTypeName']
v7 = self._slot_type_manager.... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.get_dom_for_path('/osm/street-housenumbers/gazdagret/view-query')
v2 = v1.findall('body/pre')
self.assertEqual(len(v2), 1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: typing.Callable[[int], int]
Dependencies:
```python
def v0(v1: int) -> int:
v2 = 0
while v1:
v2 += count_table[v1 & mask]
v1 >>= mask_size
return v2
```
```python
def v3(v4: int) -> list[int]:
v5 = [0] ... |
Imports:
```python
from argparse import ArgumentParser
import typing
```
Type definitions:
Input Types:
Output Type: ArgumentParser
Dependencies:
Function Name: v0
Function:
```python
def v0() -> ArgumentParser:
v1 = ArgumentParser(prog='text-clf-train')
v1.add_argument('--path_to_config', type=str, required... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float, float, float
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float, v3: float, v4: float=1) -> None:
self._color_r = v1
self._color_g = v2
self._color_b = v3
self._color_... |
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._generate_default_landscape(v1) for v4 in range(int(v2))]
self.bulk_create(v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> None:
v3 = (v1, v2)
self.shapes.append(v3)
``` |
Imports:
```python
from typing import Any, BinaryIO, Dict, List, MutableMapping, Optional, cast
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: List[Any], v2: Dict[str, Any]) -> None:
"""Initializes with the given values."""
self.array = v1
self.mapping = v2
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path, str
Output Type: Path
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: str) -> Path:
v3 = f'{v1.stem}{v2}{v1.suffix}'
return v1.parent / v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.FloatTensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.FloatTensor):
v2 = v1.clone()
while len(v2.size()) > 1:
v2 = v2.max(dim=0)[0]
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = typing.List[Evolike]
```
Input Types: v0
Output Type: int
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> int:
self.df = self.insert(v2, self.get_board())
return self.get_position(v2)
``` |
Imports:
```python
import asyncio
import functools
import typing
```
Type definitions:
```python
v0 = ParamSpec('P')
```
```python
v1 = TypeVar('T')
```
```python
v2 = Optional[asyncio.AbstractEventLoop]
```
Input Types: v2
Output Type: Callable[[Callable[v0, v1]], Callable[v0, Awaitable[v1]]]
Dependencies:
```python
@... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], str, str, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: str, v3: str, v4: int) -> None:
if v4 == len(v2):
v1.append(v3)
return None
v5 = self.d2l_d[v2[v4]]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: object, Dict[str, object]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: object, v2: Dict[str, object]) -> None:
for v3 in v2:
if not hasattr(v1, v3):
setattr(v1, v3, v2[v3])
``` |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: list
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> dict:
v2 = defaultdict(list)
for v3 in v1:
v2[v3.lower()].append(v3)
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str) -> str:
v2 = await self.get_response_for_payload(v1)
if v2 is None:
return ''
return self.serialize(v2.body)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str]) -> List[str]:
v2 = set()
for v3 in v1:
v2.update(str(v3).split(','))
return sorted(set(v2))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.PermMenuCD.set_language(self.language)
self.PermMenuCD.show()
self.PermMenuCD.signal.connect(self.get_perm_para)
``` |
Imports:
```python
import logging as log
from copy import deepcopy
import typing
```
Type definitions:
```python
class v0(nx.MultiDiGraph):
def __init__(self, v1=None, **v2):
self.stage = None
self.strict_mode = True
super().__init__(v1, **v2)
if not hasattr(self, 'node'):
... |
Imports:
```python
import concurrent
from concurrent.futures.thread import ThreadPoolExecutor
import typing
```
Type definitions:
Input Types: ThreadPoolExecutor, BinaryIO, int
Output Type: Optional[bytes]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: ThreadPoolExecutor, v2: BinaryIO, v3: int) -> Opt... |
Imports:
```python
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: int) -> list:
v3 = []
v4 = v1.copy()
if v2 == 3:
v4 = cv2.cvtColor(v1, cv2.COLOR_... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=None, v3=None):
self.val = v1
self.left = v2
self.right = v3
```
Input Types: Optional[v0], int
Output Type: bool
Dependencies:
Function Name: v4
Function:
```python
def v4(self, v5: Opti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.