text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
```python
v0 = None
```
Input Types: 'mypy.nodes.ForStmt'
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: 'mypy.nodes.ForStmt') -> v0:
self.log('ForStmt')
self.log(' index_type %s', v2.index_type)
self.log(' infer... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
for v2 in self.get_playlist_list():
if v2.title == v1:
return v2.id
raise ValueError(f'Playlist "{v1}" was not found')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: et.ElementTree
Output Type: Any
Dependencies:
```python
def v0(v1) -> ParsedClass:
v2 = ParsedClass()
v2.name = v1.find('name').text
v3 = v1.find('metaclass')
if v3 is not None:
v2.meta_class = v3.text
v4 = v1.findall('prop... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Path, Any
Output Type: Dict[str, Any]
Dependencies:
```python
def v0(v1: pd.DataFrame, v2=dtype_to_field_type) -> Dict[str, Any]:
v3: Dict[str, Any] = {}
v3['number_rows'] = v1.shape[0]
v3['field'] = []
for v4 in v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tuple, v2: bool=True):
v3 = []
for v4 in v1[1:]:
(v5, v6) = v4
if (v6 is None) | (v6 == ''):
v3.append(f'{v4[0]:}')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Expr.Base
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> Expr.Base:
if v2 and isinstance(v2[0], str) and (v2[0] != 'object'):
self._check_keyword(self._sp(v1), v2[0])
return super().o... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: 'Define'
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> 'Define':
self.inverted_ = not self.inverted_
return self
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, bytes, bytearray]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[str, bytes, bytearray]) -> str:
if isinstance(v1, (bytes, bytearray)):
return v1.decode()
return v1
``` |
Imports:
```python
from enum import Enum, IntEnum
import typing
```
Type definitions:
Input Types: Iterable
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable) -> str:
v2 = []
for (v3, v4) in v1:
if v4 is None:
pass
elif isinstance(v4, (Enum, I... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> None:
for v3 in self.tiles:
for v4 in v3:
v4.selected = False
v5 = self.get_tile(v1, v2)
v5.selected = Tr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
v2 = getattr(v1, '__array_interface__', None)
if v2 is None:
return False
v3 = len(v2['shape'])
return v3 == 1 and v2['strides... |
Imports:
```python
from urllib.parse import quote, urlencode, urlparse, urlsplit
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self._project_url_base()
if not all([v1, self.sweep_id]):
return ''
v2 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
v1 = self.obj.index.name
return [''] if v1 is None else [v1]
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = ('_bytes_value',)
def __init__(self, v2: bytes):
if len(v2) != 32:
raise ValueError('bytes_value must be 256bit number.')
self._bytes_value = v2
def v3(self):
return self._bytes_value
d... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict=None):
if v1 is None:
v1 = {}
self.meta = v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: list):
v3 = []
for v4 in v2:
v5 = v4.split()
if not v5:
continue
if v5[0] == v1['name']:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
self.__combates = v1
return super().mostra_tela()
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str='sql') -> Any:
with open(v1, 'r') as v3:
v4 = v3.read()
if v2 == 'json':
try:
return jso... |
Imports:
```python
import subprocess
import multiprocessing as mp
import typing
```
Type definitions:
Input Types: str, str, Optional[int], Optional[str]
Output Type: mp.Process
Dependencies:
```python
def v0(v1):
subprocess.check_call(v1, shell=True)
```
Function Name: v2
Function:
```python
def v2(v3: str, v4: s... |
Imports:
```python
import os as _os
import sys as _sys
import typing
```
Type definitions:
Input Types: _Popen
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: _Popen, **v2: _Union[bool, str]) -> None:
if v1.stdout is not None:
for v3 in iter(v1.stdout.readline, b''):... |
Imports:
```python
import inspect
import typing
```
Type definitions:
```python
v0 = Callable[[Union[DataArray, Dataset], str], List[str]]
```
Input Types: Callable, Any, Any, MutableMapping[str, Tuple[v0, ...]]
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Callable, v3, v4, v5:... |
Imports:
```python
import json
import os
import subprocess
import typing
```
Type definitions:
Input Types: int, Optional[str], Optional[str]
Output Type: str
Dependencies:
```python
def v0(v1, v2=None, v3=None, v4=False, v5=None, v6=1):
v3 = get_adb_path(v3)
if v2 is None:
v7 = [v3]
else:
... |
Imports:
```python
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: int, Callable[[np.ndarray, int], float], Callable[[np.ndarray, int], np.ndarray]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: Callable[[np.ndarray, int], float], v3: Callable[[np... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[int]):
v2 = True
while v2:
v2 = False
for v3 in range(len(v1) - 1):
if v1[v3] > v1[v3 + 1]:
(v1[v3], v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1) -> Dict:
v2 = v1.copy()
v3 = type(v1.get('agent', None))
v4 = self._kwargs_converter[v3](*self._agent_callers[v3](**v1), v1)
for (v5, v6) in v4.... |
Imports:
```python
import scipy.integrate as integrate
import typing
```
Type definitions:
Input Types: 'Optional[Incubator]', Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Optional[Incubator]'=None, v2=((D_0, X_0, sigh_0, spark_0, spas_0), 0.0)):
if v1 is None:
... |
Imports:
```python
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch.utils.data import random_split
import typing
```
Type definitions:
Input Types: Any, int
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types: types.MethodType
Output Type: Any
Dependencies:
```python
def v0(*v1, **v2):
return method(*v1, **v2)
```
Function Name: v3
Function:
```python
def v3(v4: types.MethodType):
async def v5(*v6, **v7):
return await v4(*v6, **v7)
retu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: datetime, int, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: datetime, v2: int, v3: bool):
print(f'get_events({v1}, {v2}, {v3})')
v4 = self.db.cursor()
if v3:
v4.execute('select timesta... |
Imports:
```python
from collections import deque, defaultdict
import typing
```
Type definitions:
Input Types: int, list[list[int]]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: list[list[int]]) -> int:
(v3, v4) = ([0] * (v1 + 1), defaultdict(list))
for (v5, v6... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.device
Output Type: 'Memory'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.device) -> 'Memory':
for v2 in self:
v3 = self.tensor(v2)
if v3.device != v1:
self.set_tensor(v2, v3.to(v1))... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dataset
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dataset) -> list:
v2 = v1.targets
if type(v2) is not list:
v2 = v2.tolist()
v3 = list(set(v2))
v3.sort()
return v3
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> dict:
(v2, v3) = v1['mean'].shape
v4 = torch.unique(input=v1['y'], return_counts=False)
v5 = v4.shape[0]
v6 = {'mean': torch.e... |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: Dict, str, str, str
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict, v2: str, v3: str, v4: str) -> Dict:
v5: Dict = copy.deepcopy(v1)
v5['title'] = f'BYO Test {v2}'
v5['name'] = f'byo-test... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str, str
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> list:
v3 = f'https://api.github.com/users/{v1}/repos'
v4 = {'Authorization': f'token {v2}'}
v5 = requests.get(v3, h... |
Imports:
```python
from random import choices, random, sample
import typing
```
Type definitions:
Input Types: Callable[..., Any], float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Callable[..., Any], v2: float=1.0, **v3):
if v2 == 1.0 or random() < v2:
self.chrom... |
Imports:
```python
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types: Sequence[np.ndarray]
Output Type: Tuple[np.ndarray, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Sequence[np.ndarray]) -> Tuple[np.ndarray, float]:
if len(self._camera_matrices) != len(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, Any, Any
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2, v3) -> List[str]:
v4 = v1[:]
(v4[v2], v4[v3]) = (v4[v3], v4[v2])
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1: t.Type['HelpFormatter'] = HelpFormatter
v2 = None
def __init__(self, v3: 'Command', v4: t.Optional['Context']=None, v5: t.Optional[str]=None, v6: t.Optional[t.Any]=None, v7: t.Optional[str]=None, v8: t.Optional[t.Dict[str, t.Any... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: board_position.BoardPosition
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=-1) -> board_position.BoardPosition:
if v1 < 0:
v1 = self.speed
v2 = self.look(distance=v1)
self.position = sel... |
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):
v3 = self._io.submit('%put ' + v1 + 'BEGIN=&' + v1 + ' ' + v1 + 'END=;\n', results='text')
v4 = v3['LOG'].rpartition(v1 + 'BEGIN=')[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, discord.User
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1, v2: discord.User=None):
if v1.invoked_subcommand is not None:
return (False, None)
if v2 is None:
v2 = v1.author
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: List[str]=None):
v3 = ['prepare', 'multisig', 'transaction', 'on', v1, 'withdrawing', 'delegate']
if v2 is None:
v2 = []
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = []
v3 = None
for v4 in v1.split('\n'):
if v4.startswith('|'):
if v3 is None:
v3 = len(v4[1:]) - len(... |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: datetime.date
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: datetime.date=None) -> str:
if not v1:
v1 = datetime.date.today()
v2 = v1.strftime('%Y%m%d')
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[int]
Output Type: Iterator[Tuple[int, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[int]) -> Iterator[Tuple[int, int]]:
(v2, v3) = (0, 1)
(v4, v5) = (1, 0)
for v6 in v1:
v7 = v6 * v4 + v2
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: 'Box', np.ndarray, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: 'Box', v2: np.ndarray, v3: float=1.0):
v4 = v1.corners(wlh_factor=v3)
v5 = v4[:, 0]
v6 = v4[:, 4]
v7 = v4[:, 1... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
self.configuration = await self._http_post_json('/api/configuration', data=json.dumps({}))
self.logger.debug('HttpClient::get_confi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> List[int]:
v2 = list()
for v3 in range(8):
v2.append(v1 >> v3 & 1)
v2.reverse()
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: Type[VisionSetProtocol]
v2: str or pathlib.Path
v3: int
v4: List
v5: Optional[List] = None
v6: Optional[List] = None
v7: Optional[Callable] = None
def v8(self):
v9 = {'root', 'train', 'tran... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: float) -> float:
v3 = self.threshold_update_rule(v1)
return max(v3, v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: list
Dependencies:
```python
def v0(v1: str, v2: list, v3: list) -> list:
for v4 in range(len(v1)):
v5 = v1[0:v4] + v1[v4 + 1:]
v2.append(v1[v4])
if v5:
v0(v5, v2, v3)
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.rest.get_certificate(self.master_node)
with open(self.ROOT_CERTIFICATE, 'w') as v2:
v2.write(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> bool:
if not v1:
return False
v2 = v1.ioc_query_defs
return v2.get('ipv4') is not None and (v2.get('ipv6') is None or v2.get('ipv4') == v2.get... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes):
assert len(v1) == 16
for (v2, v3) in enumerate(v1):
self._block[v2] ^= v3
``` |
Imports:
```python
import numpy as np
from pandas._config import get_option
from pandas._libs import lib, properties, reshape, tslibs
from pandas._libs.lib import no_default
from pandas._typing import AggFuncType, ArrayLike, Axis, Dtype, DtypeObj, FillnaOptions, IndexKeyFunc, SingleManager, StorageOptions, TimedeltaCon... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pg.Surface
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pg.Surface):
if self.toShow is not None:
v1.blit(self.toShow, self.txtdest)
if not self.internal_data:
self.showTime -= 1... |
Imports:
```python
import pandas as pd
import requests
import typing
```
Type definitions:
Input Types:
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0() -> pd.DataFrame:
v1 = 'http://ets.cnemission.com/carbon/portalIndex/markethistory'
v2 = {'Top': '1', 'beginTime': '201... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable[[List[Dict[str, Any]], str], None], IO[Any], List[Dict[str, Any]], str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Callable[[List[Dict[str, Any]], str], None], v2: IO[Any], v3: List[Dict[str, Any]], v4: s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2):
v3 = list(v2.columns)
if v1 not in v3:
return v2
v3.pop(v3.index(v1))
return v2.reindex(columns=[v1] + v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict:
if self.type == 'no_promotion':
v1 = {}
else:
v1 = {'type': self.type, 'value': self.value, 'value_type': self.value_type}
if... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, bool
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: bool=True) -> int:
self._baudrate = self._set_baudrate(v1, v2)
return self._baudrate
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None):
if v1 is None:
v1 = self.path
self._log.info('Clean/remove files in folder: {}'.format(v1))
for v2 in os.listdir(v1):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self._db.commit()
v2 = self._db.cursor(dictionary=True, buffered=False, prepared=False)
v2.execute(f'SELECT * FROM `{v1}` ORDER BY `time` DESC... |
Imports:
```python
import shutil
from glob import glob
import typing
```
Type definitions:
Input Types: str, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2=False, v3=['/__init__.py', '/__pycache__']):
for v4 in glob(v1):
if any((exclude_condition in v4 for... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, float, Any
Output Type: float
Dependencies:
```python
def v0(v1: float, v2: float, v3: float, v4: float):
v5 = 0.25989 + v4 * (-0.0217 + 0.00375 * v4)
v6 = solve_cubic(6.0 * v4 + 1.0, 3.0, 3.0, -1.0, x0=v5)
v5 = np.... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Any, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: int):
if v3 % 2 == 0 or v2[0] == 0:
v4 = np.zeros((v1.shape[0] + 2, v1.shape[1] + 2))
else:
v4 = np... |
Imports:
```python
from copy import copy
import typing
```
Type definitions:
Input Types:
Output Type: 'HereditaryStratumOrderedStoreList'
Dependencies:
Function Name: v0
Function:
```python
def v0(self: 'HereditaryStratumOrderedStoreList') -> 'HereditaryStratumOrderedStoreList':
v1 = copy(self)
v1._data = [... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
```python
async def v0():
time.sleep(5)
print('time_sleep')
```
Function Name: v1
Function:
```python
async def v1() -> int:
print('task_two: before sleep')
await v0()
print('task_two: after sleep')
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str, v2: str, v3: bool=True):
"""Initializes this Waveform instance and automatically computes all values
Parameters
----------
filename : str
The name of the CSV file to i... |
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.count('_') > 1:
return v1.replace('_', '\\_')
else:
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
v2 = self.alphabetPosition[v1[0]]
for v3 in range(1, len(v1)):
if self.alphabetPosition[v1[v3]] != v2:
return False
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: typing.NoReturn
Dependencies:
```python
def v0(v1: typing.List[typing.List[int]], v2: int) -> typing.List[typing.Optional[int]]:
import heapq
v3 = len(v1)
v4 = [None] * v3
v4[v2] = 0
v5 = [(0, v2)]
while v5:
... |
Imports:
```python
import re, string, uuid
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v1 = v1.strip()
v1 = v1.lower()
v1 = re.sub('\\s+', ' ', v1)
v1 = re.sub('[^\\w\\s]', '', v1)
v1 = re.sub('\\... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor):
(v2, v3, v4) = v1.shape
assert len(v1.shape) == 3
``` |
Imports:
```python
import os
import tempfile
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray) -> str:
self._make_internals_directory()
if not isinstance(v1, np.ndarray):
rais... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3=[]) -> list:
v4 = self.convert_id(v1).int
v5 = self.convert_id(v2).int
v6 = self.__graph_dict
v3 = v3 + [v4]
if v4 == v5:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pytest.Pytester
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pytest.Pytester) -> None:
v2 = v1.makepyfile('\n import os\n os._exit(1)\n ')
v3 = v1.runpytest(v2, '-n4', '--... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = self.portfolio.positions.keys()
v2 = self.session.get_quotes(instruments=list(v1))
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Model):
v1: str
v2: str
v3: str
v4: List[Slide]
v5: str
v6: str
v7: List[Union[str, GenresEnum]]
v8: str
v9: Dict[str, List[Requirement]]
v10: List[Union[str, PlatformsEnum]]
v11: List[Union[str, Player... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> Tensor:
v2: int = v1.dim()
v3 = (self.dim0 + v2) % v2
v4 = (self.dim1 + v2) % v2
if v3 != v4:
v1 = v1.transpose(v3, v4)... |
Imports:
```python
import sympy
import typing
```
Type definitions:
Input Types: list, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: list):
v3 = v1[:]
v3.append(v2)
v4 = sympy.Matrix(v3)
(v4, v5) = v4.rref()
v6 = list(v4[-1, :])
v7 = [0] * len(v... |
Imports:
```python
from subprocess import call
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
call('pyright custom_components/hubitat', shell=True)
call('poetry run pytest', shell=True)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> bool:
try:
iter(v1)
len(v1)
return not isinstance(v1, (str, bytes))
except (TypeError, AttributeError):
return False
``` |
Imports:
```python
import numpy as np
import torch
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, int, float, int, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor, v3: int=10000, v4:... |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: List[float], Any, float, Union[List, str]
Output Type: Any
Dependencies:
```python
def v0(v1, v2: float, v3: float, v4: float=0, v5: bool=False):
v6 = set_stim(v1.soma[0], v2, v3, frequency=v4)
v7 = recor... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int):
self.__groups_collection.update_one({'_id': v1}, {'$unset': {'scheduled_messages.' + str(v2): 1}})
self.__groups_collection.update_o... |
Imports:
```python
import json
import math
from shapely import geometry
from shapely.geometry import Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
```python
def v0(v1: LineString, v2: int):
v3 = set()
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Sequence[np.ndarray], Tuple[int, int], Union[Any]
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Sequence[np.ndarray], v2: Tuple[int, int], v3: Union[Any]=np.bool) -> np.ndarray:
v4 = np.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> list:
v2 = f'{self.api_url_v2}policy/urllist/'
v3 = self._call_api_v2('POST', v2, json_data=v1)
self.apply_pending_url_list_changes()
... |
Imports:
```python
import operator
import typing
```
Type definitions:
```python
@attr.s(frozen=True, kw_only=True)
class v0(object):
v1 = attr.ib(type=str)
v2 = attr.ib(type=str)
v3 = attr.ib(type=datetime.datetime)
v4 = attr.ib(type=datetime.timedelta)
v5 = attr.ib(type=datetime.timedelta)
v6 ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: sparse.csr_matrix
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: sparse.csr_matrix) -> np.ndarray:
v2 = v1.indptr[1:] - v1.indptr[:-1]
(v3,) = np.where(v2)
(v4,) = np.where(v2 == ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, mdl.Model, np.ndarray, [float, int, None]
Output Type: Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]
Dependencies:
```python
def v0(v1: np.ndarray, v2: ... |
Imports:
```python
import torch
from torch.nn import functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor, v3: torch.Tensor, v4: torch... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = DefaultDict[int, DefaultDict[int, bool]]
```
Input Types: v0
Output Type: int
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0) -> int:
v3 = max(v2.keys()) + 1
v4 = max([max(col.keys()) for v5 in v2.values()]) + 1
v6 = 0... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: Sequence[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str) -> Sequence[int]:
v3 = self.city_lane_centerlines_dict[v2][v1].predecessors
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.List[docstring_parser.common.DocstringParam]
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: t.List[docstring_parser.common.DocstringParam]) -> list:
v2 = []
for v3 in v1:
if v3.type_name is No... |
Imports:
```python
from pathlib import Path
import re
import typing
```
Type definitions:
Input Types: Iterable[str], Iterable[str]
Output Type: Iterable[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[str], v2: Iterable[str]) -> Iterable[str]:
v3 = [f.rstrip('/') for v4 in v2]
fo... |
Imports:
```python
import sys
import typing
```
Type definitions:
```python
class v0:
class v1(ValueError):
"""
An invalid ELF file header was found.
"""
v2 = 2135247942
v3 = 1
v4 = 2
v5 = 1
v6 = 2
v7 = 3
v8 = 22
v9 = 40
v10 = 62
v11 = 4278190080
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False):
self.steps += 1
if not v1:
self.clipper.clip_and_accumulate()
(v2, v3) = self.clipper.pre_step()
else:
v2 = se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.