text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self._tmp_uri
if v1 is None:
raise ValueError('tmp_uri is None')
self._perform_upload_action('clear', {'uri': v1}, fobj=None)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2: List[DatasetData] = self._datasets_api.get_datasets()
try:
v3 = next((dataset for v4 in v2 if v4.name == v1))
self._dataset_id... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[int]], int, int
Output Type: int
Dependencies:
```python
def v0():
(v1, v2) = ([startA, 0], 0)
v3 = 0
(v4, v5, v6) = (0, 1, 2)
v7 = [v4] * (n + 1)
while v2 < len(v1):
v8 = v1[v2]
v2 += 1
if not v8:... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, list[str], list[str], list[str]
Output Type: tuple[np.ndarray, list[str]]
Dependencies:
```python
def v0(v1: list[str], v2: list[str]) -> set[int]:
v3 = set()
v4 = set(v2)
for (v5, v6) in enumerat... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> List[str]:
v2 = []
for v3 in v1:
if v3.startswith('start_'):
v2.append(v3.split('_', 1)[1])
elif v3.startswith('en... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float):
assert 0 < v1 <= 1
v2 = random.random
return self.keep_if(lambda i, x: v2() < v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Dict[str, Dict[str, Dict[int, Tuple[int, str]]]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, Dict[str, Dict[str, Dict[int, Tuple[int, str]]]]]:
v1 = {}
v2: Dict[str, Dict[str, Dict[in... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, torch.Tensor], int
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, torch.Tensor], v2: int) -> Dict[str, Any]:
(v3, v4) = self._model_step(v1, mixup=self.cfg.training.mixup > 0, ... |
Imports:
```python
import re
import keyword
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Dict[str, Any]
Dependencies:
```python
def v0(v1: Dict[str, Any], v2: Optional[dict]=None) -> None:
v2 = v2 or {}
for v3 in list(v1.keys()):
if v3 in v2:
v4 = v2[v3]
... |
Imports:
```python
import json
from io import BytesIO, StringIO
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict):
v3 = json.dumps(v2).encode('utf-8')
v4 = BytesIO(v3)
self.put(v1, v4, content_typ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=12, v2: int=222) -> None:
v3 = v1 + 100
v4 = str(v3)
self.create_model('motion_workflow/' + str(v1), {'name': 'name_workflow1', 'first_sta... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
```python
def v0(v1: subprocess.Popen) -> Iterator[str]:
assert v1.stdout is not None
for v2 in iter(v1.stdout.readline, b''):
v3 = v2.decode('utf-8').strip()
yield v3
... |
Imports:
```python
import os
import shutil
from pathlib import Path
import typing
```
Type definitions:
Input Types: Path
Output Type: typing.Optional[Path]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path) -> typing.Optional[Path]:
v2 = shutil.which(v1.name, mode=os.F_OK, path=str(v1.parent))
... |
Imports:
```python
import json
from zipfile import ZIP_DEFLATED, ZipFile
import typing
```
Type definitions:
Input Types: Dict[str, Any], Path
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any], v2: Path) -> None:
v2.parent.mkdir(parents=True, exist_ok=True)
with Z... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: float
Dependencies:
```python
def v0(v1: np.ndarray, v2: np.ndarray):
if len(v1) != len(v2):
raise ValueError(f'u and v must be of the same size')
```
```python
def v3(v4: np.ndarray) ... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: List[dict], Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[dict], v2):
v3 = []
for v4 in v1:
v5 = {self.text_key: v4['tokens'].raw_text}
v6 = {ck: k for (v7, v8) in e... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any]) -> str:
v2 = v1['source']['data']['first_name']
v3 = v1['source']['data']['last_name']
return f'{v2} {v3}'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self._own_state:
self._registry = self._registry.copy()
self._own_state = True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
if v1 not in self._meta.fields:
raise ValueError(f'Field `{v1}` does not exist in model `{{self.__class__.__name__}}`.')
return v... |
Imports:
```python
import nltk
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = 0
v3 = nltk.tokenize.word_tokenize(v1)
v4 = [word for v5 in v3 if not v5 in self.stopwords]
v2 = len(v3) - len(v4)
v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: etree.Element, list
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: etree.Element, v2: list) -> dict:
v3 = dict()
for v4 in v1:
if callable(v4.tag):
continue
elif v4.tag in v2:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str='special') -> int:
if v2 == 'normal':
v3 = self._allocate_normal(v1)
if v3 == 0:
return self._allocate_special... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self._shader_program or not self._shader_program.isLinked():
return
if self._bound:
return
self._shader_program.bind()
... |
Imports:
```python
import tensorflow as tf
from tensorflow.python.keras.losses import LossFunctionWrapper, binary_crossentropy
from tensorflow.python.keras.utils import losses_utils
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, int, float
Output Type: Any
Dependencies:
```python
def v0(v1, v2: i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: []
Output Type: []
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: []) -> []:
v2 = len(v1)
v3 = 0
for v4 in range(v2 - 1, 5976683 - 10, -1):
v3 += v1[v4]
v5 = int(str(v3)[-1:])
v1[v4] = v5
return... |
Imports:
```python
from pathlib import Path
import numpy as np
import typing
```
Type definitions:
Input Types: torch.Tensor, TypePath
Output Type: Any
Dependencies:
```python
def v0(v1, v2=3):
v1 = _to_itk_convention(v1)
v3 = v1[:v2, :v2].ravel().tolist()
v4 = v1[:v2, 3].tolist()
v5 = sitk.AffineTrans... |
Imports:
```python
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit.circuit import Gate
from qiskit.quantum_info import PTM
import typing
```
Type definitions:
Input Types: Union[Callable, Gate], Optional[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Schedule'
Output Type: Optional[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Schedule') -> Optional[float]:
if v1.hastask(self.task):
return max((max((chk.completion_time(node) for v2 in chk.proctimes)) fo... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor:
v3 = v1.get_device()
v3 = 'cpu' if v3 == -1 else v3
v4 = tor... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> DataFrame:
v1 = self._load_file()
v2 = self._skill_count_report(df_input=v1)
v3 = self._tag_analysis_report(df_input=v2)
return v3
``` |
Imports:
```python
from typing import Callable, Dict, Iterable, List, Union, NamedTuple
import typing
```
Type definitions:
```python
v0 = Dict[str, Value]
```
```python
v1 = Union[str, List[str]]
```
Input Types: v0, Callable[[List[str]], str], Callable[[str], str]
Output Type: Any
Dependencies:
```python
def v2(v3: s... |
Imports:
```python
from typing import List, Tuple, Union, Dict
import torch.nn
import torch
from torch.utils.data import DataLoader, Dataset
import typing
```
Type definitions:
Input Types: torch.nn.Module, Tuple
Output Type: List[Tuple[str, torch.nn.Module]]
Dependencies:
```python
def v0(v1: Union[Tuple, List[Tuple]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
(v2, v3, v4, v5, v6, v7, v8) = v1.split(':')[:-2]
if '$' in v3:
(v9, v10, v11) = v3.split('$')[1:]
return v10
else:
return '... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = 0
while self._head.nextval is not None:
v1 += v1
return v1
``` |
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=True, *v2, **v3):
self.verbose = self._type_or_env(v1, 'VERBOSE', bool)
'Whether to print to the console or not'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Vector', Tuple['Vector', 'Vector']
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: 'Vector', v2: Tuple['Vector', 'Vector']) -> float:
(v3, v4) = v2
return abs((v4.y - v3.y) * v1.x - (v4.x - v3.x) * v1.y + v4... |
Imports:
```python
import sys
from argparse import ArgumentParser
import typing
```
Type definitions:
Input Types:
Output Type: ArgumentParser
Dependencies:
```python
def v0() -> ArgumentParser:
v1 = ArgumentParser(argument_default=None)
v1.add_argument('--model-creator', type=str)
v1.add_argument('--agen... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> dict:
v2 = {}
try:
v3 = open(v1, 'r')
except:
raise Exception('File not found in working directory')
for v4 in v3:
... |
Imports:
```python
import asyncio
import os
import typing
```
Type definitions:
Input Types: Tuple[str, ...], int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: Tuple[str, ...], v2: int=10) -> None:
v3 = await asyncio.create_subprocess_exec(*v1, stdout=asyncio.subproc... |
Imports:
```python
import torch
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor, Any, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2=1, v3=False, v4=1e-10, v5=-1):
v6 = torch.empty_like(v1).uniform_(0.0, ... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types:
Output Type: typing.Union[str, int, float, bool, dict, list, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> typing.Union[str, int, float, bool, dict, list, None]:
if not self.__bContentRequested:
se... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, int, str
Output Type: None
Dependencies:
```python
def v0(v1: str) -> None:
if os.name == 'nt':
os.system(f'{PATH}adb.exe {str(v1)}')
else:
os.system('adb ' + str(v1))
```
```python
def v2(v3: str) -> None:
v... |
Imports:
```python
from collections import defaultdict
import numpy as np
import typing
```
Type definitions:
Input Types: Any, int, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: int, v3: str):
v4 = defaultdict(lambda : [])
for (v5, v6) in v1:
v4[v5].app... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], str, List[Path]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: str, v3: List[Path]) -> None:
v4 = '='
for v5 in v3:
v6 = str(v5.resolve())
if ' ' in v6:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = input('Insert the name of the lesson to book for:')
if self.__handler.book_lesson(v1):
print(f'Successfully booked for lesson "{v1}"!\n'... |
Imports:
```python
import torch.utils.data as torch_data
import torch
import typing
```
Type definitions:
Input Types: List[TrajectoryDataset], int, int, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[TrajectoryDataset], v2: int, v3: int, v4=False):
for v5 in v1:
... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, Union[tuple, list]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Union[tuple, list]):
v3 = None
for v4 in v2:
v3 = re.search(v4, v1)
if v3:
v3 = v3.groups()... |
Imports:
```python
import os
import shutil
import requests
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str):
v3 = os.path.dirname(v2) or '.'
os.makedirs(v3, exist_ok=True)
v4 = requests.get(v1, stream=Tr... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[List[int], ...]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple[List[int], ...]:
v1 = super()._get_observations()
for v2 in range(self.num_players):
v1[v2].extend(self._player_bids)
... |
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 = None
for v3 in range(len(self.squares)):
if v1 == self.squares[v3].name:
v2 = v3
break
return v2
`... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> str:
v2 = self._get_headers()
v2['Content-Type'] = 'application/x-www-form-urlencoded'
v3 = f'https://{self.console}/api/ariel/se... |
Imports:
```python
from collections import defaultdict
import warnings
import typing
```
Type definitions:
Input Types: Optional[Tuple[float, float]], Optional[int], int, Optional[List[str]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[Tuple[float, float]]=None, v2: O... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[str]) -> Optional[str]:
if v1:
v2 = v1.strip() or None
else:
v2 = None
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
(v1, v2) = map(int, input().split())
v3 = list(map(int, input().split()))
for v4 in range(v2):
v3[v4::v2] = sorted(v3[v4::v2])
for v4 in ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bytearray
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bytearray:
if self.key == None:
self.key = bytearray(self.__network.get(self.uri).content)
return self.key
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: EVT
'Resources required for this event, with corresponding value'
v2: Dict[RESOURCE, VALUE]
v3: int
```
```python
class v4(NamedTuple):
v5: RESOURCE
v6: Dict[SLOT, VALUE]
```
```python
v7 = int
```
Input T... |
Imports:
```python
import logging
import json
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Any:
try:
with open(v1) as v2:
return json.load(v2)
except:
logging.error('Failed reading JSON ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str) -> None:
"""
Construct a command builder.
Args:
terminator: The command terminator.
"""
self._terminator = v1
self._elements: List[str] = []
def v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, *, v2: dict, v3=1):
if type(v2) != dict:
raise TypeError('Only dict payloads supported')
if any([x not in v2 for v4 in ['joincha... |
Imports:
```python
from itertools import chain
import typing
```
Type definitions:
```python
class v0(Protocol):
@abstractmethod
def v1(self, v2: Iterable[Union[str, int, float]]) -> None:
...
```
```python
v3 = TypeVar('S', bound=StatsHolder)
```
Input Types: v0, float
Output Type: None
Dependencies:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: logging.LogRecord
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: logging.LogRecord) -> None:
try:
v2 = f'{self.prefix} {self.format(v1)}'
self.stream.write(v2 + self.terminator)
self... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: jnp.array
v2: jnp.array
v3: jnp.array
v4: jnp.array
v5: jnp.array
def __repr__(self) -> str:
v6 = 'RDPParams:'
v6 = f'{v6}\n sigmas:{self.sigmas}'
v6 = f'{v6}\n l... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
for v1 in self.services:
self.manager.run_daemon_child_service(v1)
await self.manager.wait_finished()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.Callable, t.Callable, str
Output Type: t.Callable
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: t.Callable, v2: t.Callable, v3: str='shell') -> t.Callable:
v1 = v1(v2, v3)
if not v2.__doc__:
return v1
(v4, v5) =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: dict):
v3 = v2['id']
self.logger.info(f'Filling in parameter {v3}')
v4 = v2['type']
(v5, v6) = self.param_fake_map[v4]
... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, int, int, str, Callable
Output Type: Any
Dependencies:
```python
def v0(v1: int, v2: int, v3: str, v4: Callable=empty_callback):
v5 = App()
v6 = []
v7 = globals()[v3.upper()]
for v8 in v7:
v6.append({'input': re.... |
Imports:
```python
from subprocess import PIPE, Popen, check_call
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._client_dir.mkdir(exist_ok=True)
v1 = ['--clientdir', str(self._client_dir)]
check_call([self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Set[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any]) -> Set[str]:
v2: Set[str] = set()
for v3 in v1.get('native_filter_configuration', []):
v4 = v3.get('targets', [])
... |
Imports:
```python
import base64
import typing
```
Type definitions:
Input Types: bytes, int, int, Optional[str], Union[bool, str], bool, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bytes, v2: int, v3: int, *, v4: Optional[str]=None, v5: Union[bool, str]=False, v6: bool=True, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: vy_ast.Attribute
Output Type: None
Dependencies:
```python
def v0(v1: vy_ast.Attribute) -> None:
v2 = get_exact_type_from_node(v1.value)
if isinstance(v2, AddressDefinition) and v1.attr == 'code':
v3 = v1.get_ancestor()
if isin... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: list[torch.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor) -> list[torch.Tensor]:
v2 = [v1]
for v3 in self:
v2.append(v3(v2))
return v2
``` |
Imports:
```python
from urllib.parse import urlencode
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str]=None) -> str:
v2 = self._get_base_login_url()
v3 = {}
if v1 is not None:
v3.updat... |
Imports:
```python
import os
import subprocess
import typing
```
Type definitions:
Input Types: List[str]
Output Type: List[str]
Dependencies:
```python
def v0() -> List[str]:
v1 = ['git', 'diff', '--name-only', 'origin/master', 'HEAD']
v2 = subprocess.run(v1, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
... |
Imports:
```python
import random as r
import typing
```
Type definitions:
Input Types: Any
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> list:
v2 = []
for v3 in range(1, len(v1.tower) - 2):
for v4 in range(1, 4):
if self.stat_brain.is_valid(v3, v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: float):
v3 = v1.copy()
v3[:, 0]
for v4 in range(1, v1.shape[1] - 1):
v3[:, v4] = (v1[:, v4 + 1] - v1[:, v4 - 1]) / (... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: int=5):
v3 = []
v4 = 0
for (v5, v6) in zip(v1, range(len(v1))):
if v6 % v2 == 0:
v3.append([x for v7 in v1[v4:v4 + v2]... |
Imports:
```python
from string import Template as _Template
import typing
```
Type definitions:
Input Types: TextIO, str, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: TextIO, v2: str, *v4: Any, v3=False, **v5: Any) -> None:
v6 = _Template(v2).substitute(**v5)
print(v6.f... |
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):
self._point += v1
self._num_points += 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = self.send_post(f'close_run/{v1}', data={})
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, int
Output Type: Dict[str, str]
Dependencies:
```python
def v0(v1):
v2 = v1.find(':')
if v2 != -1:
v3 = v1[:v2]
if v3 == 'HETERO' or v3 == 'MULTI':
v4 = v1[v2 + 1:]
v5 = v4.split(',')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: str
Dependencies:
```python
def v0(v1: str, v2, v3: list):
v4 = False
for v5 in v3:
if isinstance(v2, v5):
v4 = True
break
if not v4:
raise TypeError('{varname} should be one of... |
Imports:
```python
from random import randint
import typing
```
Type definitions:
Input Types: List[int], int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: int, v3: int) -> int:
v4 = randint(v2, v3)
self.swap(v1, v4, v2)
v5 = v1[v2]
v6 = v2
... |
Imports:
```python
import secrets
import string
from urllib.parse import urlparse
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: Any) -> Any:
if not isinstance(v1, str):
return v1
if v1 in ('0.0.0.0', '127.0.0.1', '255.255.255.255'):
ret... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='none') -> str:
v2 = self._direction
if v1 != 'none':
v2 += '-' + v1
v3 = self._images.get_image(type(self).__name__, v2)
self._disp... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: Dict[str, tf.Tensor]
Output Type: Tuple[Dict[str, tf.Tensor], List[tf.Tensor]]
Dependencies:
```python
def v0(v1: Tuple[tf.Tensor, tf.Tensor]) -> Tuple[tf.Tensor, tf.Tensor]:
(v2, v3) = v1
v4 = self._sample_nodes(v3)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if v1 in self.defaults:
self.verbose_log(f'resetting {v1} config to default value')
v2 = self.defaults[v1]
self.confi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tf.data.Dataset
Output Type: 'TopK'
Dependencies:
```python
def v0(v1: tf.data.Dataset) -> None:
v2 = v1.element_spec
if isinstance(v2, tuple):
if len(v2) != 2:
raise ValueError(f'The dataset must yield candidate embeddings... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: (str, str)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> (str, str):
if v1.endswith('.db'):
v2 = '(/?([+._:\\w\\d\\[\\]=~-]*/)*)((\\S+))\\.db'
else:
v2 = '(/?([+._:\\w\\d\\[\... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Tuple[float, float, float], float
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: Tuple[float, float, float], v2: float) -> np.array:
v3 = int(np.floor(v1[0] - v2))
v4 = int(np.ceil(v1[0] + v2))
v5... |
Imports:
```python
import hashlib
import json
import typing
```
Type definitions:
Input Types: dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> str:
v2 = v1
if 'timestamp' in v1:
del v2['timestamp']
return hashlib.sha256(json.dumps(v2, sort_keys=True).e... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor, v3: int, v4: int):
v2 = v2.view(-1)
v5 = v2 > 0
v2 = v2 - 1 + v3
v... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1):
self.value = v1
self.edges = []
def v2(self, v3, v4):
self.edges.append(Edge(v3, v4))
def v5(self, v6):
if v6 in self.edges:
self.edges.remove(v6)
de... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0() -> str:
v1 = os.environ.get('PYPI_RELEASE_VERSION', '0.2.1.beta8')
v1 = v1.lstrip('v').replace('-', '.')
v2 = v1.split('.', 3)
if len(v2) == 4:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = open(v1, 'r')
v2 = v2.read()
v2 = v2.split('\n')
while v2[-1] == '':
v2.pop()
v3 = []
v4 = None
for v5 in range(0, len(... |
Imports:
```python
from ..datasets.dataset_builder import DatasetBuilder
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str]=None) -> None:
self.trainset = DatasetBuilder.set_train_dataset(fname=self.db... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Text, Text
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: Text, v3: Text):
v4 = []
for (v5, v6) in v1.items():
v7 = list(self.__extract_response_value(v6, v5, v2, v3))
v4.extend(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
if v1 <= 0:
return False
while v1 and (not v1 % 2):
v1 //= 2
if v1 == 1:
return True
else:
while ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> np.ndarray:
v1 = self.target_concentrations.shape[0]
v2 = np.zeros((v1 + 1, 2))
for v3 in range(v1):
v4 = self.target_... |
Imports:
```python
import sys
import textwrap
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = [subproc.join_and_check() for v2 in self]
v3 = 0
for v2 in self:
if v2.is_alive():
v2.termina... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.