text stringlengths 190 325k |
|---|
Imports:
```python
import re
import typing
```
Type definitions:
```python
v0 = Tuple[int, str, str, str]
```
Input Types: str, int, Sequence[v0]
Output Type: bool
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: str, v3: int, v4: Sequence[v0]) -> bool:
v5 = True
for (v6, v7, v8, v9) in v4:... |
Imports:
```python
import tensorflow.compat.v1 as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, float, Optional[bool], int
Output Type: tf.Tensor
Dependencies:
```python
def v0():
return tf.keras.backend.dropout(ones, rate)
```
Function Name: v1
Function:
```python
def v1(v2: tf.Tensor, v3: float,... |
Imports:
```python
import collections
import operator
import string
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = (char.lower() for v3 in v1 if v3 in string.ascii_letters)
v4 = collections.Counter(v2)
... |
Imports:
```python
import random
import string
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0() -> str:
global __random_outdir
if not __random_outdir:
v1 = '/' + ''.join([random.choice(string.ascii_letters) for v2 in range(... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[dict]:
v1 = self.pymisp_client.events()
return v1 if 'errors' not in v1 else []
``` |
Imports:
```python
import shlex
import subprocess
from subprocess import DEVNULL, TimeoutExpired
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if self._can_extract is None:
if self._ocr:
self._can_e... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence[MutableMapping]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Sequence[MutableMapping]) -> bool:
v2 = v1[0].keys()
return '_from' in v2 and '_to' in v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, torch.Tensor
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor, v3: torch.Tensor=None, **v4) -> None:
v5 = self.get_model_output(v1, v2, edge_mask=v3)... |
Imports:
```python
import numpy as np
import numpy.typing as npt
import typing
```
Type definitions:
Input Types: npt.NDArray[np.floating], npt.NDArray[np.floating], tuple[float, float]
Output Type: tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[str, int]
```
Input Types: v0
Output Type: int
Dependencies:
```python
def v1(v2: int) -> str:
(v3, v4) = divmod(v2 // 60, 60)
return f'{v3:02d}:{v4:02d}'
```
```python
def v5(v6: int) -> str:
return f'time_of_day={v6!r} ({v1(v6)})'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Any
Output Type: httpx.Response
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: Any=None, **v4: Any) -> httpx.Response:
v5 = self.base_url + v2
v6 = self.method_map[v1]
if v3 is not None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None, v2: str=None):
v3 = self.connector.get_all_instances()
if v1 in v3:
return {v3[v1]: [v1]}
if v2:
v4 = {}
for ... |
Imports:
```python
from queue import Empty, Queue
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
while self._active:
try:
v1: Event = self._queue.get(block=True, timeout=1)
self._process(... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> None:
if v1 in ('(now)', '(in the future)'):
return
assert re.match('^\\([0-9] seconds? ago\\)$', v1) is not None, f'{v1} does not ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Namespace
Output Type: Dict[str, Tuple[bool, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Namespace) -> Dict[str, Tuple[bool, int]]:
v2 = {}
v2['bind'] = (not v1.b, 8000)
v2['nsd'] = (not v1.n, 8100)
v2['knot']... |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
v2 = datetime.datetime.now().strftime('%d-%m-%Y %H:%M')
v3 = datetime.datetime.strptime(v2, '%d-%m-%Y %H:%M')
v4 = se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = 0
v3 = ''
for v4 in v1.split('\n'):
v2 += v4.count('(') - v4.count(')')
if v2 > 0:
v3 += v4
else:
... |
Imports:
```python
import itertools
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: Iterable[v0], int
Output Type: Iterable[List[v0]]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Iterable[v0], v3: int) -> Iterable[List[v0]]:
v2 = iter(v2)
while True:
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool=1, v3: bool=0) -> str:
self.text = self._build_input(v1)
self._translate(v2)
if v3:
self.signature = self._sign(v1... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
if v1 and v1 < logging.WARN:
self.spinner = None
``` |
Imports:
```python
import numpy as np
import numpy.typing as npt
import typing
```
Type definitions:
Input Types: npt.ArrayLike, npt.ArrayLike, bool
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: npt.ArrayLike, v2: npt.ArrayLike, v3: bool=False) -> np.ndarray:
if v3 == Fals... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Union[str, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Union[str, None]:
v1 = {'query': {'tenant': {'id'}}}
v2 = self.client.graphql(v1)
if v2.data.tenant:
return v2.data.tenant[0].id
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: bool):
v3 = 'away' if v2 else 'home'
v4 = []
for v5 in v1:
if not v5.endswith(v3):
v4.append(v1[v5])
return v4
``... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='') -> None:
v2 = sorted(self.log_path.glob(f"ckpt-{v1 or '*'}k.pt"))
if v1 and (not v2):
raise Exception(f'checkpoint {v1} no... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = np.asarray(v1.split(','), 'float')
return v2.reshape([28, 28])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray):
v1 = v1.view(self._data._ndarray.dtype)
return self._data._from_backing_data(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = []
for v3 in v1:
v2 += list(map(int, v3))
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, List[str]], bool
Output Type: Union[List[str], Dict[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, List[str]], v2: bool=False) -> Union[List[str], Dict[str, str]]:
if isinstance(v1, str):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple
Output Type: int
Dependencies:
```python
def v0(v1: set, v2: str, v3: int):
v4 = set()
for (v5, v6) in v1:
if v2 == 'x' and v5 > v3:
v5 = 2 * v3 - v5
elif v2 == 'y' and v6 > v3:
v6 = 2 * v3 - v6
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Dict[str, List[float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> Dict[str, List[float]]:
assert len(v1) == 1
assert v1['a']
self.fsm.step('a', v2)
assert self.fsm.curr_state == '... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, **v2):
v3 = self.newModule(v1, **v2)
if self.view() != None:
self.view().modAdd(v1, module=v3)
return v3
``` |
Imports:
```python
import difflib
import itertools
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: str
v2: str
v3: str
v4: str
v5: str
v6: Optional[str] = None
v7: Optional[int] = None
v8: Optional[int] = None
v9: Optional[int] = None
v10: Optional[str] = N... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(IntEnum):
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
v20 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
if v1 is None:
raise ValueError("Parameter 'volume_no' cannot be None.")
if not isinstance(v1, int):
raise ValueError("Parameter 'volume... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.config.UPLOAD_URL == '':
raise Exception('Optic url could not be found. Please run optic with api exec <command>')
return self.config.U... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str=None, v2: bool=False, v3: bool=False, v4: bool=False, v5: int=1):
self.durable = v3
self.auto_delete = v2
self.purge = v4
self.prefetch = v5
if v1:
self.name = v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: mparser.AndNode
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: mparser.AndNode):
v1.left.accept(self)
self.append_padded('and', v1)
v1.right.accept(self)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
class v0(Enum):
v1 = 'acc'
v2 = 'acc2'
v3 = 'acc_detailed'
v4 = 'acc_detailed_avg'
v5 = 'balanced_acc'
v6 = 'balanced_acc_detailed'
v7 = 'auc'
v8 = 'auc_detailed'
v9 = 'f1_score'
v10 = 'f1_score_d... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray) -> np.ndarray:
v2 = np.exp(v1 - np.max(v1, axis=1, keepdims=True))
return v2 / v2.sum(axis=1, keepdims=True)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v2 = f'/projects/{self.project_num}/variables'
return self._post(v2, v1)
``` |
Imports:
```python
import os
import typing
```
Type definitions:
```python
class v0(Enum):
v1 = 'autoflake'
v2 = 'isort'
v3 = 'autopep8'
```
Input Types: str, v0
Output Type: str
Dependencies:
```python
def v4(*, v5: v0) -> str:
v6: str = os.path.join(_LINT_PACKAGE_ROOT_PATH, f'.{v5.value}/')
os.mak... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, str, str, dict, int
Output Type: bool
Dependencies:
```python
def v0(v1: str, v2: str, v3: str) -> None:
with open(v1, 'r') as v4:
v5 = v4.read()
v6 = v5.split('Data:')[0] + '\n Data: \n'
with open(v2, 'a') a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict):
global headers
v2 = {**v2, **v1}
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2=',', v3=True):
with open(v1, 'w') as v4:
if v3:
v5 = [[str(col) for v6 in row] for v7 in self.data]
v8 = [... |
Imports:
```python
import typing
```
Type definitions:
Input Types: PathLike
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: PathLike):
(v2, v3) = self.get_features(v1)
(v4, v5, v6) = self.kts(v2, v3)
return (v2, v3, v4, v5, v6)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: base.List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> base.List[str]:
v3 = v2 - len(v1)
v4 = v1[:v3] if v3 < 0 else v1 + ['<pad>'] * v3
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: dict) -> str:
v3 = v2['start']
v4 = v2['end']
v1 = v1.replace(v1[v3:v4], ' ' * (v4 - v3))
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool):
v2 = {'Running time': str(self.get_running_time()) if v1 else self.get_running_time(), 'Best found Configuration': self.get_current_solution().__get... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float) -> str:
v2 = int(5 * v1)
return str(v2)
``` |
Imports:
```python
import socket
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
try:
v1 = socket.gethostbyname('google.com')
except socket.gaierror:
v1 = ''
assert v1
``` |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame, pd.DataFrame, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: pd.DataFrame, v3: str):
v2.reset_index(inplace=True)
v2.insert(0, 'level_... |
Imports:
```python
import torch
from torch import Tensor
from torch.nn import Module
from torch.optim import Optimizer
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> Tensor:
if self.dim is None or len(v1.s... |
Imports:
```python
import inspect
import functools
import typing
```
Type definitions:
Input Types: Callable
Output Type: Tuple[inspect.Signature, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Callable) -> Tuple[inspect.Signature, int]:
if isinstance(v1, functools.partial):
v2 = insp... |
Imports:
```python
import json
import os
import typing
```
Type definitions:
Input Types: web.Application
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: web.Application):
v2 = {'application': self.var, 'group': {}, 'private': {}}
for (v3, v4) in self.group_sessions... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: Tuple[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2='.', v3=False) -> Tuple[str, str]:
(v4, v5) = ('', v1.__class__.__name__)
try:
v4 += v1.__class__.__module__
if v4 ==... |
Imports:
```python
import string
import typing
```
Type definitions:
Input Types: Any
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> float:
v2 = 0
v3 = 0
for v4 in v1:
if self.allowed_regex.match(v4['label']) and float(v4['prob']) >= self.min_confidence ... |
Imports:
```python
import numpy as np
from pandas import DataFrame as df, date_range
import matplotlib.pyplot as plt
import scipy.optimize as spo
from datetime import datetime, timedelta
import typing
```
Type definitions:
Input Types: List[str], df, datetime, bool, str
Output Type: Any
Dependencies:
```python
def v0(... |
Imports:
```python
import os
import shutil
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
```python
def v0(v1: str) -> None:
shutil.rmtree(v1, ignore_errors=True)
```
Function Name: v2
Function:
```python
def v2(v3: str) -> None:
if os.path.exists(v3) and os.path.isdir(v3)... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2):
if v2:
v1 = v1 - v1.mean(axis=0) + v1.mean()
v3 = list()
(v4, v5, v6) = v1.shape
v7 = v5 * v6
... |
Imports:
```python
from datetime import date, datetime, timedelta
from polars.utils import _timedelta_to_pl_duration
from polars import internals as pli
from polars.datatypes import DataType, Date, Datetime, Float64, Int32, Object, Time, UInt32, py_type_to_dtype
import typing
```
Type definitions:
```python
class v0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
super().parse(v1)
self.version = tuple((-1 if x == '/' else x for v2 in self.version))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: Tuple[Text, Text]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> Tuple[Text, Text]:
v2 = v1.parents[0]
v3 = v1.parts
v4 = v1.name
v5 = v1.stem
v6 = v5.split('_')[0]
v7 = v5.split('_')[1... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Any, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: str):
v3: dict = {}
v4 = re.compile(f'.*{v2}.*')
if v2:
v4 = re.compile(f'.*{v2.lower()}.*')
v1 = filter(lambda e... |
Imports:
```python
import collections
import typing
```
Type definitions:
Input Types: int, List[List[int]]
Output Type: List[List[int]]
Dependencies:
```python
def v0(v1, v2, v3):
low[v2] = v1
v4 = []
for v5 in edges[v2]:
if v5 == v3:
continue
if not low[v5]:
v4 += ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str, v2: str, v3: str=''):
self.player_id = v1
self.player_tag = f'<@{self.player_id}>'
self.display_name = v2
self.avi_url = v3
v4 = self._get_player_tbl()
self.player_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Layer, int
Output Type: Layer
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Layer, v2: int, **v3: Dict) -> Layer:
v2 = round(v2)
if v2 == 0:
return v1
v4 = Dense(units=v2, **self._build_regularizers(**v3))(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> str:
if v1 == 2:
return 'Strictly increasing'
elif v1 == 1:
return 'Increasing'
elif v1 == 0:
return 'Not monotonic'
e... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=1) -> None:
if v1 <= 0:
raise ValueError('You only can pass a positive number of push-ups')
if self._punishments > v1:
self._punish... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
v2 = self.transfer_inst.stop_flag.get(idx=0, suffix=v1)
return v2
``` |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: Any
Output Type: datetime
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> datetime:
v2 = v1.find(']')
if v2 == -1:
print('Fatal error: End of Timestamp not found in line:', v1)
q... |
Imports:
```python
import typing
```
Type definitions:
Input Types: wd.World
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: wd.World):
v2 = v1.scene('鬼ヶ島', '鬼ヶ島にて鬼退治する')
v2.setCamera(v1.taro)
v2.setStage(v1.stage.island).setDay(v1.day.arrived).setTime(v1.time.morning)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, str
Output Type: Any
Dependencies:
```python
def v0(v1: str):
return [x.replace('- ', '') for v2 in v1.splitlines()]
```
Function Name: v3
Function:
```python
def v3(v4: dict, v5: str):
for v6 in v4['nlu']:
if 'intent' in v6:
... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, str, int, str
Output Type: dict
Dependencies:
```python
def v0(v1: dict) -> dict:
try:
if title:
if v1['name'].lower() == title.lower():
app_dicts.append(v1)
elif v1['appid'] == app_id:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
if float(v1) != v1 or v1 <= 0.0 or v1 > 1.0:
raise ValueError('Probability must be in the (0.0, 1.0] interval.')
self.probability = v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> str:
(v3, v4) = ('', False)
for v5 in v1.split('\n'):
if v5 == ' ' * 8 + v2 + ':':
v4 = True
elif not v5.sta... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int=1):
v3 = tuple(filter(None, v1.split()))
return (v3[:v2], ' '.join(v3[v2:]))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, float
Output Type: Tuple[float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int, v3: float) -> Tuple[float, float]:
v4 = 0 - (v1 - 1) * v3 / 2
v5 = 0 - (v2 - 1) * v3 / 2
return (v4, v5)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: telegram.Update, telegram.ext.CallbackContext
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: telegram.Update, v2: telegram.ext.CallbackContext):
if not '@' in v1.message.text.split(' ')[0]:
self.botH... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if ':' in v1:
v1 = v1[:v1.index(':')]
v1 = v1.replace('/', '_')
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3=None):
self._key = v2
self._value = v3
self._source = self._available_source(v1)
return self
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: int):
self.notes.append([v2, v3, v1])
self.maxTime = max(self.maxTime, v3)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = typing.TypeVar('V')
```
Input Types: typing.Optional[int], typing.Optional[int]
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: typing.Optional[int], v3: typing.Optional[int]) -> v0:
if v2 is None:
if... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor) -> torch.Tensor:
(v2, v3, v4) = (v1.size(0), v1.size(1), v1.size(3))
v1 = v1.transpose(1, 2).contiguous().view(v2, -1, v4 * v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
if v1 == 4294967280:
self.pc = self.stack_pop()
self.emu.emu_stop()
else:
raise RuntimeError('Unknown special PC:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], np.ndarray, float, float, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: np.ndarray, v3: float, v4: float, v5: int):
self.oclhList = v2
self.tradeDayList = v1
self.showD... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
@inject
def v0(v1: t.Union[str, Tag], v2: 'ModelStore'=Provide[BentoMLContainer.model_store]) -> 'paddle.inference.Config':
v3 = v2.get(v1)
v4 = paddle.inference.Config(v3.path_of(f'{SAVE_NAMESPACE}{P... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable
Output Type: str
Dependencies:
```python
def v0(v1: Callable) -> str:
assert callable(v1), f'{repr(v1)} uncallable.'
from beartype._util.func.utilfuncarg import get_func_args_len_flexible
from beartype._util.func.utilfuncfile impo... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.last_row = None
self.top_y = None
self.bottom_y = None
self.min_x = None
self.max_x = None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: QtCore.QEvent
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: QtCore.QEvent) -> None:
self.unhovered.emit()
return super().leaveEvent(v1)
``` |
Imports:
```python
import requests
import json
import typing
```
Type definitions:
Input Types: list, tuple
Output Type: Any
Dependencies:
```python
def v0() -> str:
return 'AIzaSyBw6AIHV6RIhH4b_Z-2iJI_LX5GGJIt7zI'
```
```python
def v1(v2: dict, v3: tuple) -> str:
v4 = v0()
return f"https://maps.googleapis... |
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 = input(f"[Default: {v2}] Enter the {v1.replace('_', ' ')}: ")
if v3.strip() == '':
v3 = v2
return v3 if v3.strip() != ' ' else ... |
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:
self.sums[v1 // self.size] += v2 - self.nums[v1]
self.nums[v1] = v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=0, v2: str='', v3: str='', v4: str='') -> bool:
self.__db_name = v1
self.__user_name = v2
self.__password = v3
self.__extra ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = super().get_state()
v2 = ['current', 'volt', 'power', 'totalconsum', 'overload']
for v3 in v2:
v4 = v1.pop(v3, -1)
if v4 != ... |
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.config_json:
return self.config_json[v1]
else:
print(f"ERROR: Key '{v1}' is not in configuration JSON.")
ret... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2=None) -> str:
v3 = v1.id
v4 = v2 or ''
v5 = f'user_{v3}_parent_id_{v4}_readable_nodes'
return v5
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.memory_xml.last_xml
assert v1 is not None
v2 = os.path.join(self.output_dir, 'index.txt')
v3 = bytes(self.xslt_txt(v1))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'EventDelivery'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'EventDelivery'):
v2 = None
return self.__run_method_on_plugins('event_delivery_retry', v2, v1)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1: Package, v2: str, v3: XmlRecipeValidateCommandAddTool) -> None:
super().__init__()
self.Package = v1
self.ToolName = IOUtil.GetFileNameWithoutExtension(v3.Name)
self.RelativeToo... |
Imports:
```python
import random
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: int
'The Zobrist hash of the position.'
v2: int
'\n The raw binary representation of the move. Use\n :data:`~chess.polyglot.Entry.move` instead.\n '
v3: int
'An integer value that ca... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.