text stringlengths 190 325k |
|---|
Imports:
```python
import numpy as np
from shapely.geometry import Point, MultiPoint, LineString, MultiLineString
from scipy.spatial import cKDTree
import typing
```
Type definitions:
```python
v0 = Union[Iterable[PointCoordinatesLike], MultiPoint]
```
Input Types: Any, Any, Any, float
Output Type: Any
Dependencies:
``... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bytearray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bytearray):
if self.desired:
self.log.error(f'Already set delay to {self.desired} ms')
else:
self.desired = int(v1)
... |
Imports:
```python
import numpy as np
import numpy.ma as ma
import typing
```
Type definitions:
```python
class v0(pfGeometry):
def __init__(self, v1: ExptParams):
self.expt_params = v1
super().__init__(detector=Detector(v1), wavelength=_convert_units(v1.wavelength, 'A', 'm'))
self.beam_m =... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Callable[[T, Sequence[Binding], Renderer], T]
```
```python
v1 = Callable[[T, Sequence[Binding]], T]
```
```python
v2 = v1[Any]
```
```python
v3 = TypeVar('T')
```
Input Types: v1[v3]
Output Type: v0[v3]
Dependencies:
```python
def v4(v5: v3, v6: Seq... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Operation):
v1: str = '/iam/v3/oauth/platforms/{platformId}/authorize'
v2: str = 'GET'
v3: List[str] = ['application/x-www-form-urlencoded']
v4: List[str] = ['application/json']
v5: Optional[str] = 'bearer'
v6: str = 'code... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> None:
print('Você ' + v1 + '!!!!!')
print('A palavra era: ', v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1: List[str]) -> None:
if any((self.ward_map_inv.get(ward, None) is None for v2 in v1)):
return
for (v2, v3) in v1.items():
v4 = self.ward_... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Enum):
v1 = 0
v2 = 1
v3 = 2
v4 = 3
v5 = 4
v6 = 5
v7 = 6
v8 = 7
v9 = 8
v10 = 9
v11 = 10
v12 = 11
v13 = 12
v14 = 13
v15 = 14
v16 = 15
v17 = 16
v18 = 17
v19 = 18
```
Input T... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Set[int]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Set[int]) -> None:
for v2 in v1:
if v2 in self._keypath:
del self._keypath[v2]
super()._unload_keys(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[pydot.Edge], Text, Text
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[pydot.Edge], v2: Text, v3: Text, **v4):
v5 = False
v6 = False
for v7 in v1:
if v7.get_source() == v2 a... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: tuple[int, int]
Dependencies:
```python
def v0(v1: str, v2: str) -> str:
return process('[' + v1 + ',' + v2 + ']')
```
```python
def v3(v4: str) -> tuple[str, bool]:
v5 = 0
v6 = -1
for (v7, v8) in enumerate(v4):
i... |
Imports:
```python
from datetime import timedelta, datetime
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str, v2: str=None, v3: int=None, v4: str=None, v5: str=None, v6: str=None) -> None:
self.class_type = v1
self.physical_type = v2
self.quantity = v3
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Optional[int]=None):
self._data = v1
self._forwards = []
```
Input Types: int
Output Type: Optional[v0]
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: int) -> Optional[v0]:
v... |
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(self, v1: np.ndarray):
if self.log:
v1 = np.exp(v1)
return np.maximum(np.dot(v1, self.ifbanks), 0.0)
``` |
Imports:
```python
import torch
from torch import Tensor
from torch.quasirandom import SobolEngine
import typing
```
Type definitions:
Input Types: Tensor, int, int, Optional[int]
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tensor, v2: int, v3: int, v4: Optional[int]=None) -> Te... |
Imports:
```python
import numpy as np
from shapely import geometry
from scipy.spatial.distance import cdist
import typing
```
Type definitions:
Input Types: str, str
Output Type: int
Dependencies:
```python
def v0(v1: str) -> geometry.LineString:
v2 = [[0, 0]]
for v3 in v1.split(','):
v4 = v3[0]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict, Set[Tuple]
Output Type: Tuple[Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict, v2: Set[Tuple]) -> Tuple[Dict]:
for v3 in range(len(v1.keys()) + 1):
v4 = set()
for v5 in v2:
(v6, v7... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float):
self.start_time = v1
self.traveled_nodes = [(v1, self.base_route[0])]
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, bool
Output Type: str
Dependencies:
```python
def v0(v1, v2=True):
from homeassistant.components.config.group import CONFIG_PATH as GROUP_CONFIG_PATH
v3 = os.path.join(v1, YAML_CONFIG_FILE)
v4 = os.path.join(v1, VERSION_FILE... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self):
self._id: str = ''
self._start_node: Node = Node()
self._end_node: Node = Node()
self._pipe: Pipe = Pipe()
self._fittings: Dict[str, Fitting] = {}
self._balancing_valve: Op... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='Birth') -> dict:
v2 = f'placeOf{v1}'
v3 = self.ent_dict.get(v2, False)
return v3[0] if isinstance(v3, list) else {}
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Union[List[str], Dict[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str]) -> Union[List[str], Dict[str, str]]:
v2 = list()
v3 = dict()
for v4 in v1:
if '=' in v4:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int
Output Type: List[np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> List[np.ndarray]:
v2 = 0 if v1 == 1 else 1
v3 = np.where(self.board == -1, 1, 0)
v4 = np.where(self.board ==... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'str'
Output Type: 'int'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'str') -> 'int':
v2 = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}
v3 = v2[v1[-1]]
for v4 in range(len(v1) - 2, -1, -1):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3) -> int:
v4 = v2
v5 = v1[v3]
for v6 in range(v2, v3):
if v1[v6] < v5:
(v1[v4], v1[v6]) = (v1[v6], v1[v4])
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Tuple], Optional[List[str]], bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[Tuple], v2: Optional[List[str]]=None, v3: bool=False):
v4 = [{'data': {'id': f'{s}->{t}', 'source': s, 'target': t}} for (... |
Imports:
```python
import heapq
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: int, v2: int, v3: int, v4: int):
self.player_armor = 0
self.player_hp = v1
self.player_mana = v2
self.boss_hp = v3
self.boss_dmg = v4
self.spells: Dict[str,... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
if not self._lock.exists():
raise RuntimeError('No lockfile found. Unable to read locked packages')
return self._lock.read(True)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str, v2: str, v3: int, v4: str, v5: str, v6: bool=False, v7: bool=False) -> None:
"""Initialize GatewayDescriptor class."""
self.name = v1
self.ip_addr = v2
self.port = v3
self.... |
Imports:
```python
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):
if Path(f'/etc/fpm/packages/{v1}.repo').exists():
self.init_parser(f'/etc/fpm/packages/{v1}.repo')
``` |
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 = []
for v3 in v1.split():
if v3.isnumeric():
v2.append(int(v3))
v4 = 0
while v4 < len(v2) - 1:
if... |
Imports:
```python
from collections import deque
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]:
if len(v1) == 0:
return []
if v2 == 0:
return v1
v3... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1: str, v2: str):
self.method = v1
v3 = [p.strip() for v4 in v2.split(';')]
self.name = v3[0]
self.ref_unit = v3[1]
self.factors = []
@property
def v5(self):
... |
Imports:
```python
from datetime import date, datetime, time, timedelta
import polars as pl
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
v1 = pl.DataFrame({'time': [datetime(2021, 2, 1), datetime(2021, 4, 1), datetime(202... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: str, [], int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: [], v3: int):
self.connector.connect()
return pd.read_sql(v1, con=self.connector.get_connection(), columns=v2, chu... |
Imports:
```python
from collections import deque
import typing
```
Type definitions:
Input Types: str, int
Output Type: str
Dependencies:
```python
def v0(v1: str, v2: int) -> str:
v3 = deque(v1)
v4 = 0
while len(v3) != v2 and len(v3) < v2 + 1:
if v4 == 0:
v3.extend(' ')
v4 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], int
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2: int) -> dict:
v3 = [alphabet[v2:] + alphabet[:v2] for v4 in v1]
return str.maketrans(''.join(v1), ''.join(v3))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str, v2: bool=False) -> Path:
v3 = WEB_MODULES_DIR.joinpath(*(v1 + '.js').split('/'))
if v2 and (not v3.exists()):
raise ValueError(f'Web module {v1!r} does not exist at path {str... |
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):
v3 = v2 // self.env.quark_chain_config.shards[self.full_shard_id].EPOCH_INTERVAL
v4 = self.env.quark_chain_config.block_reward_decay... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1: Any) -> None:
super().post_delete(**v1)
if os.getenv('METADATA_TEST_HOOK_OP', 'skipped') == 'delete':
raise FileNotFoundError
self... |
Imports:
```python
import torch
from torch.utils.data import Dataset, DataLoader
import typing
```
Type definitions:
Input Types: dgl.DGLGraph, torch.Tensor
Output Type: Tuple[dgl.DGLGraph, torch.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dgl.DGLGraph, v2: torch.Tensor) -> Tuple[dgl.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, t.Any, t.Iterable[str]
Output Type: t.Union[t.Any, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: t.Any, v3: t.Iterable[str]=SHRED_DATA_FIELD_NAMES) -> t.Union[t.Any, str]:
v1 = v1.lower()
v4 = False
for... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, *v2) -> str:
v3 = self._common_error_details
for (v4, v5) in self._raw_error_pattern_to_message.items():
if v4.search(v1):
v3 =... |
Imports:
```python
import numpy as np
from scipy import sparse as sp
import typing
```
Type definitions:
```python
class v0:
v1 = ['level_1', 'level_2', 'level_3', 'level_4']
def __init__(self, v2):
v3 = pd.read_parquet(v2).fillna('NA')
self.product_idx = {}
self.product_pid = {}
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable | str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Callable | str, *v2, **v3):
if isinstance(v1, str):
return self.__class__({k: getattr(data, v1)(*v2, **v3) for (v4, v5) in self.items()})... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int
Output Type: Tuple[float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> Tuple[float, float]:
v2 = np.random.normal(self.means[v1], self.deviations[v1])
v3 = self.regrets[v1]
ret... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: str, dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: dict=None, **v3: Any) -> None:
v2 = v2 or dict()
v2.update(v3)
v4 = v2.get('delay', 0)
await self._keyboard... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Options) -> None:
self.options = v1
self.python_version = v1.python_version
def v2(self, v3: str) -> Optional[Callable[[AnalyzeTypeContext], Type]]:
return None
def v4(self, v5: str) ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Tuple[int]
```
Input Types: v0, v0
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0, v3: v0):
v4 = self.getPiece(v2)
if v4 != self.player:
self.display()
print(v2, v3)
raise Run... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for (v1, v2) in self.grid.items():
if v2 > 9:
self.grid[v1] = 0
``` |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types: pathlib.Path, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pathlib.Path, v2: str) -> bool:
if v2 in self.local_config:
for (v3, v4) in self._LOCAL_CONFIG_KEYS[v2].items():
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = False
if v1.startswith('shub://'):
v1 = v1[7:]
elif v1.startswith('docker://'):
v2 = True
v1 = v1[9:]
v1... |
Imports:
```python
from string import ascii_lowercase, ascii_uppercase
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> str:
v3 = {kl: jl for (v4, v5) in zip(ascii_lowercase, ascii_uppercase)}
for v... |
Imports:
```python
import copy
import typing
```
Type definitions:
```python
class v0(Protocol):
@property
def v1(self) -> 'BackendEntity':
...
@property
def v2(self) -> bool:
...
```
Input Types: List[str]
Output Type: List[Any]
Dependencies:
Function Name: v3
Function:
```python
def... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> Tensor:
v1 = v1.squeeze(1)
v2 = self.codebook.embedding(v1.to(self.device))
return v2.permute(0, 3, 1, 2)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
self.dp_structure = np.zeros(v1 + 1)
self.dp_structure[0] = 1
self.dp_structure[1] = 1
return int(self.numTreesH... |
Imports:
```python
from urllib import request
import typing
```
Type definitions:
Input Types: str, Path
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Path) -> None:
print(f'Downloading {v1} to {v2}...')
request.urlretrieve(v1, v2)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=None):
self.val = v1
self.next = v2
```
Input Types: v0
Output Type: v0
Dependencies:
Function Name: v3
Function:
```python
def v3(self, v4: v0) -> v0:
v5 = None
v6 = v4
while v6:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[int], v2: int, v3: int) -> None:
if v3 < 0 or v3 > 255:
raise Exception('Invalid value')
v1[v2] = v3 & 255
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self):
self.epoch = 0
self.caller = ''
self.amount = 0
```
Input Types: v0
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0):
for (v3, v4) in self.loc... |
Imports:
```python
import numpy as np
from numpy.fft import fft2, ifft2
import typing
```
Type definitions:
Input Types: list or np.ndarray, list or np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list or np.ndarray, v2: list or np.ndarray) -> np.ndarray:
v1 = np.... |
Imports:
```python
from os import listdir, path
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
v2 = v1.split('*')[0]
if path.isdir(v2):
return v2
else:
return path.split(v2)[0]
``` |
Imports:
```python
import operator
import typing
```
Type definitions:
Input Types: Any
Output Type: Union[int, Tuple[int, ...]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> Union[int, Tuple[int, ...]]:
try:
return operator.index(v1)
except TypeError:
return tuple(map... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
v2 = v1 + 1
if v2 < self.hop_count:
self.hop_count = v2
return True
return False
``` |
Imports:
```python
import urllib
import urllib.parse
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = urllib.parse.urlparse(v1).path
return v2.rsplit('/', maxsplit=1)[-1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._exit_result = (0, None)
super().exit()
``` |
Imports:
```python
import os
import os.path
import re
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> int:
v1 = os.path.basename(v1)
v2 = re.search('^debian-([0-9]+)\\.[0-9]+\\.[0-9]+-', v1)
if not v2:
rai... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'SortedKeyList[TransactionIndexElement]', int, bytes, int
Output Type: Tuple[List[bytes], bool]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: 'SortedKeyList[TransactionIndexElement]', v2: int, v3: bytes, v4: int) -> Tuple[List[bytes]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> None:
if v1 in self.adj_list and v2 in self.adj_list:
if v1 in self.adj_list[v2]:
self.adj_list[v1].remove(v2)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
self.validate_http_timeout(v1)
self.settings.pageLoad['timeout'] = v1
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: List[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str]) -> None:
v2 = 'repos'
try:
os.remove(f'{v2}_bk')
except FileNotFoundError:
pass
try:
os.rename(v2,... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(ABC):
v1: bool
v2: bool
v3: ClassVar[Tuple[str, ...]]
@property
def v4(self) -> str:
"""Return string representation of self for use as a key in a ContextRegister."""
return self.short_string
@property
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = super().as_dict()
return {**v1, 'gain1': self.gain1, 'gain2': self.gain2, 'mute1': self.mute1, 'mute2': self.mute2, 'canActivate': True}
``` |
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 = v1.split('\n')
v3.append('')
v3.append(v2.conversation.sender_name)
v3.append('CEO, %s' % v2.conversation.domain.company_name)
... |
Imports:
```python
from sklearn.model_selection import train_test_split
import typing
```
Type definitions:
Input Types: pd.DataFrame, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: float=0.2):
(v3, v4) = train_test_split(v1.iloc[:, :], test_size=v2, random... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
print('[', end='')
if self.left_literal is not None:
print(self.left_literal, end='')
elif self.left_pair is not None:
self.left_... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Iterable[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Iterable[str]:
yield '|'.join((self.titles[i].ljust(self.col_width[i]) for v1 in range(len(self.titles))))
yield '+'.join((''.ljust(self.col_width... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.hit + self.blow
for v2 in self.list_possible_ans_combination[:]:
self._check_hit_blow(self.num, v2)
if self.hit + self.blow... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types: str, str, dict
Output Type: Any
Dependencies:
```python
def v0(v1: str):
if v1:
for v2 in v1.split(','):
(v3, v4) = v2.split('=')
yield (v3, v4)
```
Function Name: v5
Function:
```python
def v5(v6: str, v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
self.script_error_dialog.label.setText(v1)
self.script_error_dialog.open()
``` |
Imports:
```python
from itertools import product
import typing
```
Type definitions:
```python
v0 = Tuple[int, int]
```
```python
v1 = Tuple[int, int, int, int]
```
Input Types: v1, Sequence[v0], int
Output Type: int
Dependencies:
```python
def v2(v3: v0, v4: v0) -> int:
return abs(v3[0] - v4[0]) + abs(v3[1] - v4[1... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
v1 = self._solver_cls(self.p.get_available_values(), self.p.get_available_costs(), self.p.get_capacity())
v1.solve()
self.optimum_value = v1.op... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool) -> None:
for v2 in self.boxes:
if v1:
v2.enable_key_joy()
v2.enable_mouse()
else:
v2.disable_key... |
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 in self.ignore_end:
return
try:
v2 = getattr(self, '_handle_end_%s' % v1)
except AttributeError:
raise KeyError(... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for v1 in self.From:
v1.To.remove(self)
for v1 in self.To:
v1.From.remove(self)
self.From.clear()
self.To.clear()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
if v1.logger is not None:
v1.logger.finalize('success')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if self.current_page == None:
return True
return self.config.jump_behaviour()
``` |
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(v1: np.ndarray, v2: float) -> np.ndarray:
v3 = 0.005 * np.random.uniform() * np.amax(v1)
v1 = v1 + v3 * np.random.normal(s... |
Imports:
```python
import numpy as np
import torch
import torch.distributions.constraints as constraints
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray) -> torch.Tensor:
if len(v1.shape) == 1:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=20, v2: dict=None):
v3 = v1
for (v4, v5) in v2.items():
self.set_one_row(v3, v5)
v3 += 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> str:
self._git_fetch_branch(v1)
return self.local_repo.merge_base(v1, self.local_repo.head.commit)
``` |
Imports:
```python
import random
from random import shuffle
from nltk.corpus import wordnet
import typing
```
Type definitions:
Input Types: Any, Any, Optional[Sequence[int]]
Output Type: Any
Dependencies:
```python
def v0(v1, v2, v3):
if sum(v3) == len(v1):
return
v4 = []
v5 = 0
while len(v4) ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> tuple:
v1 = 0
v2 = 0
if self.num_routes_original != 0:
v1 = self.num_routes_original - self.num_routes_current
v2 = v1 / self.num_rout... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v2 = self._syntax.replace('%s', '')
v3 = '\n'
with open(self._file, 'w') as v4:
for (v5, v6) in v1.items():
v4.write('%s... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.setFixedSize(640, 480)
self.setLayout(self.main_layout)
self.set_param()
self.set_action()
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: bool, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bool=False, v2: bool=False) -> None:
if v1:
if os.path.exists('data') == False:
os.mkdir('data')
if os.path.exists('... |
Imports:
```python
import typing
```
Type definitions:
Input Types: DataFrame
Output Type: DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: DataFrame) -> DataFrame:
v2 = v1.sort_values('priority').iloc[0]
return v2
``` |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple[np.ndarray, np.ndarray]:
v1 = self.data['age']
(v2, v3) = np.histogram(v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
if self._loop_task is not None:
self._loop_task.cancel()
self._loop_task = None
async with self._wait_task_lock:
if sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List, v2: Any) -> None:
v3 = self.storage_object
v4 = self.transform_hashable(v1)
for v5 in range(len(v4)):
v6 = v4[v5]
if v5... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.