text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: list, list, list, list, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2: list, v3: list, v4: list, v5: list):
if self.N - 1 >= 0:
for v6 in range(self.N - 1 + 1):
for v7 in r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str):
v4 = self.bash(f"dig -6 @{v1} '{v2}' {v3}", encoding='raw_unicode_escape')
v5 = None
v6 = {'QUESTION': [], 'ANSWER... |
Imports:
```python
import json
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Sequence[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Sequence[str]:
with open(os.path.expanduser(v1), 'r') as v2:
v3 = json.load(v2)
v4 = [article['text'] for v5 i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = [' ', ',', ';', '{', '}', '(', ')', '\t', '=', '/', '\\']
for v3 in v2:
v1 = v1.replace(v3, '')
return v1
``` |
Imports:
```python
import hashlib
import os
from pathlib import Path
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.cloud == 'local':
return os.path.join(str(Path.home()), '.opta', 'local', 'tfstate')
... |
Imports:
```python
import copy
import numpy as np
import typing
```
Type definitions:
Input Types: np.array
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.array):
v2 = copy.deepcopy(v1)
v2[v2 < 0] = 0
self.cache = v1
if self.gradient is None or self.gradient.s... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Get):
def __init__(self, v1: SimContext, v2: QueueFIFO, v3: Process):
super().__init__(v1, v2, v3)
self.item: Any = None
self._func = lambda event: event.item
```
Input Types: v0
Output Type: bool
Dependencies:
Funct... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: tuple[int, ...]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> tuple[int, ...]:
(v2, v3) = self._private_key
v4 = [(v1 - random_message) ** v3 % v2 for v5 in self.random_messages]
return tupl... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, **v2: typing.Any):
v3 = {k: v for (v4, v5) in v2.items()}
await self.request('PATCH', f'/channels/{v1}', headers={'Content-Type': 'applicatio... |
Imports:
```python
import os
import csv
import subprocess
from collections import Counter, defaultdict
import typing
```
Type definitions:
Input Types: Dict[str, Dict[str, str]], List[str], Any, Any, Any
Output Type: Dict[str, Dict[str, str]]
Dependencies:
```python
def v0(v1, v2, v3) -> str:
if v2 != '':
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
if self._last_unlocked_level == self.last_level:
return (v1 + 1) % (self.last_level + 1)
v2 = self.levels_scores[v1 + 1:self.last_u... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
if self.reversed:
return self.reversed[-1]
return self.top
``` |
Imports:
```python
import collections
import typing
```
Type definitions:
Input Types: list[list[int]], int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list[list[int]], v2: int) -> int:
(v3, v4) = (len(v1), len(v1[0]))
v5 = collections.deque()
v6 = [[-1] * v4 for v7 in ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Optional[str]:
v1 = self.config_dict.get('security')
if not v1:
return None
return v1.get('outbound_firewall')
``` |
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.metadata = self._parse_metadata()
self.chapters = self._parse_chapters(self.metadata['contents'], parse_chapter=v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bytes
Dependencies:
```python
def v0(v1) -> Optional[Account]:
v2 = v1.obj.account_manager
v3 = v2.who()
if v3:
return v3
else:
print('[italic red]No recent user, please adding or selecting one[/]')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: MuParser.Return_exprContext
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: MuParser.Return_exprContext):
v2 = self.visit(v1.expr())
self.result = v2
return v2
``` |
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(self, v1: np.ndarray) -> np.ndarray:
v1 += self.offsets
v2 = np.apply_along_axis(self.func, axis=1, arr=v1)
v3 = np.random.ra... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
```python
def v0(v1: list, v2):
def v3(v4, v5, v6):
"""
This nested function set value of all instance attr
:param instance: instance to set it attrs
:param data:
... |
Imports:
```python
import multiprocessing as mp
import multiprocessing.pool
import os
import os.path
import torch
import torch.multiprocessing
from torch.optim import Optimizer
import typing
```
Type definitions:
Input Types: int, Optional[str], Optional[Callable[[], None]]
Output Type: mp.Pool
Dependencies:
```python... |
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: v0
Output Type: List[List[int]]
Dependencies:
Function Name: v4
Function:
```python
def v4(self, v5: v0) -> L... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Callable[[Any], Any], Any
Output Type: Tuple[Any, bool]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Callable[[Any], Any]=None, v3=None) -> Tuple[Any, bool]:
(v4, v5) = self._cache.get(v1)
if not v5:
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = 0
def __init__(self) -> None:
self.gameVersion = '21'
self.binaryVersion = '35'
self.secret = 'Wmfd2893gb7'
self.level_secret = 'Wmfv2898gc9'
self.login_secret = 'Wmfv3899gc9'
self.mo... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0() -> dict:
v1 = {'block_versions': {'0.1a': 0}, 'hash_versions': {'genesis': 1, '0x2': 1, '0x3': 1}, 'load_cert': False, 'consensus_cert_use': False, 'tx_cert_use': Fal... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Doc
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Doc:
v2 = None
for v3 in self.pipeline['nlp'].pipe([v1]):
v2 = v3
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: bool) -> None:
if v1:
await self._device.mute_on()
self._is_volume_muted = True
else:
await self._device.mute_off()
... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
with self.metrics_file.open('w') as v1:
v2 = {'num_training_examples': self.num_samples, 'max_seq_len': self.seq_len, 'vocab_len': se... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
try:
while True:
print(input())
except KeyboardInterrupt:
exit()
except EOFError:
exit()
``` |
Imports:
```python
import matplotlib.pyplot as plt
from matplotlib.backends.backend_agg import FigureCanvasAgg
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, Tuple or List, Any, Any, Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1:... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Tuple[np.ndarray, np.ndarray]:
(v2, v3) = tuple(map(int, v1.split(':')))
return (np.array([v2]), np... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path, int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: int, v3: int) -> int:
v4 = 0
for (v5, v6) in enumerate(open(v1)):
v6 = v6.strip()
if v5 == 0:
v7 = len(v6)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1=str, v2='', v3='', v4=[]) -> str:
if v1 == 'summary':
v5 = 'https://api.covid19api.com/summary'
elif v1 == 'slugs_codes':
v5 = '... |
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):
for v3 in self.envs:
v3.set_display_size(width=v1, height=v2)
``` |
Imports:
```python
from itertools import chain
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: Any) -> None:
for v2 in chain(*v1):
self.add(v2)
``` |
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 = None
if v1.get('media'):
v3 = v1['media'][0]['url']
elif v1.get('images'):
v3 = v1['images'][0]['url']
... |
Imports:
```python
import matplotlib as mpl
import numpy as npy
import matplotlib.pyplot as plt
from matplotlib import ticker, rcParams
from matplotlib.patches import Circle
from matplotlib.pyplot import quiver
from matplotlib.dates import date2num
import matplotlib.tri as tri
import typing
```
Type definitions:
Input... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: bool
Output Type: Path
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bool=True) -> Path:
v2 = (Path.home() / 'quantify-data').resolve()
if v1:
print(f'Data will be saved in:\n{v2}')
return... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Union[str, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, *v2: str, **v3: Any) -> Union[str, int]:
v1 = self._bin(v1)
v4 = [v1] + list(v2)
return self._run(v4, **v3)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str):
self.addedNodes_: List[str] = []
self.removedNodes_: List[str] = []
self.ancestors_: List['Transformation'] = []
self.scopeName_: str = ''
self.transID_: str = v1
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=20, v2: str='score') -> dict:
self.send_server({'command': 'lb_get_by_place_down', 'place': v1, 'type': v2})
return self._get_data('lb')
``` |
Imports:
```python
from os.path import join
import typing
```
Type definitions:
Input Types: str, int, int, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int, v3: int, v4: str) -> str:
v5 = str(v2) + 'particle' + str(v3) + '.' + v4
return join(v1, v5)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Dict[str, Any]
```
Input Types: str, str, Optional[str], Optional[bool]
Output Type: Generator[Optional[Callable], None, None]
Dependencies:
```python
@conversion
def v1(v2: v0, v3: str) -> None:
v2[v3] = ','.join(map(str, sum(force_dict(v2[v3] o... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
for v2 in self.projects_list():
if v2.path_with_namespace == v1:
return v2
``` |
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:
v3 = self.warmup_steps * v1
v4 = self.lr_annealing_steps * v1
v5 = self.decay_steps * v1
self._calculate_lr_momentu... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.data.Dataset, int
Output Type: tf.keras.Model
Dependencies:
```python
def v0(v1: tf.Tensor, v2: tf.Tensor):
return v1
```
Function Name: v3
Function:
```python
def v3(v4: tf.data.Dataset, v5: int) -> tf.keras.Model:
... |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: int, int, int
Output Type: None
Dependencies:
```python
def v0(v1: float, v2: float, v3: int, v4: int) -> int:
v5 = np.complex(v1, v2)
v6 = v5
for v7 in range(v3):
v6 = v6 ** 2 + v... |
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 = v2.tokenize(v1)
v4 = []
for v5 in v3:
if v5.startswith('##'):
v4[-1] += v5[2:]
else:
v4.append... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: List[Dict[str, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=10485760) -> List[Dict[str, Any]]:
v2 = [{'size': self._sizes[x[0]], 'key': x[0], 'paths': x[1]} for v3 in self._files.items() if self.... |
Imports:
```python
from spacy.language import Language
from spacy.pipeline import Pipe
from spacy.tokens import Doc
from spacy import util
import typing
```
Type definitions:
Input Types: Iterable[Doc], int
Output Type: Iterator[Doc]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[Doc], ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2, v3, v4, v5=None):
self.lefts = []
self.rights = []
self.id = int(v1)
self.parent = int(v3) - 1
self.word = v2
self.deprel = v4
self.postag = v5
```
Input Typ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Dict[str, Dict[str, List[Dict[str, Any]]]]]
Output Type: Tuple[str, str, Dict[str, List[Dict[str, Any]]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Dict[str, Dict[str, List[Dict[str, Any]]]]]) -> Tuple[s... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: np.array, float
Output Type: [int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.array, v2: float) -> [int]:
if v2 == 0.0:
return []
v2 = 0.1
v3 = len(v1)
v4 = []
for v5 in v1:
if v5... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
```python
def v0(v1, *v2, **v3):
with lock:
default_logger.info(v1, *v2, **v3)
```
Function Name: v4
Function:
```python
def v4(v5: dict, *v6, **v7):
v8 = '\n\t{:<80} {:<15} {:<20} {:<15} {:<10}\n'.f... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(BaseModel):
@property
def v1(self) -> str:
"""Pytest ID for console feedback during tests runs."""
return self.__repr__()
def __repr__(self) -> str:
"""Valid __repr__ string to fully reproduce the object unde... |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: Union[pd.DataFrame, pd.Series], Optional[str], Optional[int], Optional[str]
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: np.array) -> np.array:
v2 = v1.shape[0]
_LOG.debug('signal length=%... |
Imports:
```python
from collections import OrderedDict
import numpy as np
from sklearn.metrics import mean_absolute_error, r2_score, mean_squared_error, max_error
from sklearn.metrics import f1_score, recall_score, precision_score, accuracy_score
import typing
```
Type definitions:
Input Types: Union[np.ndarray, pd.Da... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[int, int], Tuple[int, int, int, int]
Output Type: List[Tuple[int, int]]
Dependencies:
```python
def v0(v1: Tuple[int, int], v2: Tuple[int, int, int, int]) -> bool:
(v3, v4) = v1
(v5, v6, v5, v7) = v2
return v3 > v6 or v4 < v7
```
```... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
self.assert_can_edit()
v2 = self.collection.document(v1).get()
if not v2.exists:
return False
v2.reference.delete()
r... |
Imports:
```python
import random
import string
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = f'{self.listener.name}_'
v2 = f"{v1}{''.join(random.choices(string.ascii_letters + string.digits, k=20))}"
while v... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
v2 = '6LcCoP8SAAAAAKzsvbTXymxqNWcC-dAhDYik0V3C'
v3 = f'http://2captcha.com/in.php?key={APIKEY_2CAPTCHA}&method=userrecaptcha&googlekey={v2}&pageurl={v1}'
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple[str, str]:
v1 = self.soup.find('span', ['h3_titel']).contents
(v2, v3) = (v1[0], v1[2])
return (v2, v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: float):
v3: int = self._data_pointer + self.capacity - 1
self.update(v3, v2)
self._data[self._data_pointer] = v1
self._data_pointer +... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int) -> int:
if v1 <= v2:
return v1
v3 = 1
for v4 in range(2, min(int(v1 ** 0.5), v2) + 1):
v5 = v1 // v4
if v5 * v4... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[int, Literal[Any]]
```
```python
v1 = Union[type, Literal[Any], np.dtype]
```
Input Types: Tuple[Tuple[v0, ...], v1]
Output Type: Tuple[Tuple[v0, ...], v1]
Dependencies:
Function Name: v2
Function:
```python
def v2(cls, v3: Tuple[Tuple[v0, ...... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, bool
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: bool) -> int:
if v2:
return 10 * v1
else:
return int(v1 / 10)
``` |
Imports:
```python
import os
import pandas as pd
import typing
```
Type definitions:
Input Types: Tuple
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple) -> pd.DataFrame:
v2 = self._data.copy()
for (v3, v4) in enumerate(self._parameters):
v2 = v2[v2[... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.dtype
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.dtype) -> str:
if v1 == np.int8:
return 'int8'
if v1 == np.uint16:
return 'uint16'
if v1 == np.float32:
... |
Imports:
```python
import numpy as np
import scipy
import sklearn
from scipy.sparse import isspmatrix_csr
from scipy.stats import norm
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, Any, Optional[int]
Output Type: Any
Dependencies:
```python
def v0(v1):
v2 = len(v1)
v3 = np.zeros(v2)
... |
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: v0, int
Output Type: int
Dependencies:
Function Name: v4
Function:
```python
def v4(self, v5: v0, v6: int) ->... |
Imports:
```python
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.__cmap = plt.get_cmap('twilight_shifted')
self.__norm = colors.Normalize(vmin... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Sequence[str]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Sequence[str]:
v1: Dict[str, int] = {'one': 1, 'two': 2, 'three': 3}
v2: Tuple[str] = v1.keys()
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, *v2) -> None:
if v1 in self.events:
for v3 in self.events[v1]:
v3(*v2, self.server)
``` |
Imports:
```python
from typing import Union, Iterable, SupportsInt
import typing
```
Type definitions:
Input Types: Union[Iterable, SupportsInt]
Output Type: Iterable
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[Iterable, SupportsInt]) -> Iterable:
if isinstance(v1, Iterable):
retu... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.entry_point.topic_id = 'valid_topic1'
self.entry_point.story_id = 'valid_story1'
self.entry_point.exploration_id = 123
self._assert_vali... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[Union[int, str]]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[Union[int, str]]) -> str:
if v1 is None:
return ''
v1: str = str(v1)
return ' + '.join(v1) + f' = {sum(map(int, v1)... |
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: v0
Output Type: Any
Dependencies:
Function Name: v4
Function:
```python
def v4(v5: v0):
v6: v0 = v5
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> int:
v2 = v1.bit_length()
if v2 >= 1300:
return 2
if v2 >= 850:
return 3
if v2 >= 650:
return 4
if v2 >= 300:
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Dict[bytes, bytes]
```
Input Types: bytes, v0, int, bool
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
async def v1(self, v2: bytes, v3: v0, v4: int=None, v5: bool=True) -> None:
async with self.batch(timestamp=v4, wal=v5... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str):
v3 = type(self.service)
for v3 in type(self.service).__mro__:
if not hasattr(v3, v1):
continue
v4 = geta... |
Imports:
```python
import itertools
import torch
from torch.utils.data import Dataset
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
v2 = torch.utils.data.DataLoader(self.buffer, batch_size=v1, drop_last=True, shuffl... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tkinter.BooleanVar, object
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tkinter.BooleanVar, v2: object) -> str:
v1.set(not v1.get())
return 'break'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
async for v1 in self.TAGDB.find({}):
if isinstance(v1.get('guild_id'), int):
await self.TAGDB.update_one({'_id': v1.get('_id')}... |
Imports:
```python
import typing
```
Type definitions:
Input Types: v7
Output Type: str
Dependencies:
```python
def v0(v1: int, v2: str) -> str:
return '(net (code {}) (name "{}")'.format(v1, v2)
```
```python
def v3(v4: str, v5: str) -> str:
return '(node (ref {}) (pin {})))'.format(v4, v5)
```
Function Name:... |
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 in self.node_lookup_map:
if len(self.node_lookup_map) == 1 or self.node_lookup_map[v1] == self.head:
return
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any]) -> bool:
if 'deployments' not in v1 or not v1['deployments']:
return False
return True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[service.VersionRange]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[service.VersionRange]) -> str:
v2 = str()
for v3 in v1:
if v2:
v2 += ', '
v4 = v3.introduced if ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Enum('TokenKind', 'IF THEN ELSE IDENT INT OPERATOR PRINT STRING VAR ASSIGN UNKNOWN EOF ENDLN OPEN METHOD BLOCKEND EQ INPUT DIV MUL MINUS PLUS LPAREN RPAREN FUNC RUN COMMA')
```
Input Types: v0
Output Type: Any
Dependencies:
Function Name: v1
Functio... |
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 = v1.rfind('\n', 0, self.pos) + 1
v3 = v1.find('\n', self.pos)
return v1[v2:v3] + '\n' + ' ' * (self.pos - v2) + '^\n'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], int
Output Type: None
Dependencies:
```python
def v0(v1: int, v2: int) -> int:
return v1 // 10 ** v2 % 10
```
Function Name: v3
Function:
```python
def v3(v4: List[int], v5: int) -> None:
v6 = [0 for v7 in range(max(v4) + 1)]
fo... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclasses.dataclass
class v0:
v1: dict
v2: Set[str]
v3: int
v4: Set[str]
v5: bool
```
Input Types: Any
Output Type: List[v0]
Dependencies:
Function Name: v6
Function:
```python
def v6(self, v7) -> List[v0]:
v8 = []
for v9 i... |
Imports:
```python
import tensorflow as tf
import random
from glob import glob
from tqdm import trange, tqdm
import numpy as np
import h5py
from keras import models, layers, regularizers, constraints, backend as K
from tensorflow.python import debug as tf_debug
import os
from tensorflow.python.client import timeline
im... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> int:
v3 = None
for v4 in range(v1, v2):
if v3 is None and v4 == v2 - 1 or self.check_for_poison([v4]):
self.ma... |
Imports:
```python
import numpy as np
from shapely.geometry import Polygon, MultiPolygon
from shapely.geometry.point import Point
from shapely.ops import unary_union
from shapely.affinity import rotate, scale, translate
import typing
```
Type definitions:
Input Types: int, Any, Any, Any, Any, Any, Any
Output Type: Any... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any], v2: Any) -> None:
if v1['result'] == 'error' and hasattr(v2, 'view'):
v2.report_error([v1['msg']])
``` |
Imports:
```python
from itertools import chain
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: str
v2: Optional[str]
v3: Optional[str]
v4: Optional[str]
v5: set[str] = field(default_factory=set)
v6: set[str] = field(default_factory=set)
v7: ClassVar[dict[str, 'ClassDef... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple[int, int], str, int, int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple[int, int], v2: str, v3: int, v4: int) -> bool:
(v5, v6) = v1
v7 = 0
while v7 < self.get_ship_size(v2):
if ... |
Imports:
```python
import logging
import os
import typing
```
Type definitions:
Input Types: Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path):
if os.path.isfile(v1):
v2 = input(f"File '{v1.resolve()}' exists. Delete? (Y/n) ")
if v2 == 'Y':
os.r... |
Imports:
```python
import torch
import torch.nn as nn
from torch.nn import functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor) -> torch.Tensor:
with torch.no_grad():
retur... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: bool=False) -> str:
v3 = subprocess.run(v1.split(), stderr=subprocess.PIPE, stdout=subprocess.PIPE)
v4 = v3.stdout.decode('ut... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2=True):
v3 = {}
if v2:
v3 = self.header
v4 = requests.get(v1, headers=v3)
if v4.status_code == 401:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.