text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: int=0):
if not v1.endswith('chatroom'):
return self.logger.warning('Can only send announcements to chatrooms')
v4 = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self._is_file:
return ''
if self.novel_chapter_urls:
return self.novel_chapter_urls[-1][1]
return ''
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Union[str, bool]
Dependencies:
```python
def v0(v1: str) -> bool:
return len(v1) > 1 and len(v1.strip('.')) > 0 and (v1[0] != '.') and (v1[-1] == '.')
```
Function Name: v2
Function:
```python
def v2(v3: str, v4: str) -> Unio... |
Imports:
```python
import pandas as pds
import typing
```
Type definitions:
Input Types: namedtuple, dict
Output Type: list
Dependencies:
```python
def v0(v1, v2: str):
if v1 is None:
return None
if v2 != 'str':
return eval(f'{v2}({v1})')
else:
return f'{v1}'
```
```python
def v3(v4... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: BaseCase
v2: str
v3: str
@property
def v4(self):
"""Case path, i.e. the path containing `system`, `constant` and snapshots."""
return self.base.root / self.case
@property
def v5(self):... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str) -> None:
self.progress_bar.setValue(v1)
if v2 == 'submitted':
self.msg_bar.info('Met dataset download request submitted succ... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
v1 = os.listdir(os.path.abspath(self.file_directory))
if v1:
for v2 in v1:
if not os.path.isfile(os.path.join... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, str]):
self._headers.update(v1)
return self
``` |
Imports:
```python
import base64
import io
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2='JPEG') -> str:
v3 = io.BytesIO()
v1.save(v3, format=v2)
return base64.b64encode(v3.getvalue()).decode('utf-8')
``` |
Imports:
```python
from http import HTTPStatus
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.make_request('GET', self.url, access_token=self.admin_user_tok)
self.assertEqual(HTTPStatus.OK, v1.code, msg=v1... |
Imports:
```python
import numpy as np
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: int, float
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=100, v2: float=0.05) -> np.ndarray:
v3 = tqdm(range(v1), unit='game')
v3.set_postfix(score='?... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str, bool
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: str='score', v3: bool=False) -> dict:
v4 = '' if not v3 else 's_'
self.send_server({'command': v4 + 'lb_get_by_user', 'user_id': v1, 'ty... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float):
assert v1 >= 0.0
assert v2 > 0.0
self.consumption = v1
self.budget -= v1 * v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str):
self._update_expiration_key(v1)
return v1 in self._cache
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor, Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor, v2: Tensor) -> Tensor:
for v3 in self.layers:
v1 = v3(v1, v2)
return self.norm(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Generator
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Generator:
for v1 in self.instances_data:
yield v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.random.Generator
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.random.Generator):
self._move_next()
self._update_sample_type(v1)
``` |
Imports:
```python
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:
v2 = v1.clone().float()
for (v3, v4) in self.weights.items():
v2[v1.eq(v3)] = v4
return v2
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = v1
if not v2.startswith('http'):
v2 = 'https://' + v2
return v2.rstrip('/')
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: tuple
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple):
self.input_shape = v1
self.output_shape = (v1[0], np.prod(v1[1:]))
self.initialized = True
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Any, str, str, str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str, v3: str, v4: str='links', v5: int=-1, *v6, **v7):
v8 = []
v9 = 0
v10 = ''
while v10 is not None and (v9 < v5 ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> np.ndarray:
if v1 == 'both':
v3: List[float] = sum((self.ranks.get((_side, v2), []) for v4 in ('head', 'tail')... |
Imports:
```python
from getpass import getpass
import typing
```
Type definitions:
```python
v0 = Union[str, Path]
```
Input Types: v0
Output Type: Optional[str]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> Optional[str]:
if v2:
with open(v2, 'r', encoding='utf-8') as v3:
... |
Imports:
```python
import json
import logging
from datetime import datetime
import typing
```
Type definitions:
Input Types: str, Dict[str, Any]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Dict[str, Any]) -> None:
if self.config.mqtt['timestamp_format']:
... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = random.randrange(self.wlen)
return self.table.get(v1, v1)
``` |
Imports:
```python
import pathlib
import typing
```
Type definitions:
```python
v0 = str
```
Input Types: v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0) -> None:
try:
v3 = v2.replace(' ', '')
v4 = pathlib.Path(f'logs/{v3}.log')
v4.unlink()
except... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
with open(v1, 'w') as v2:
v2.write('Z N M\n')
self.df.to_csv(v1, sep='\t', mode='a')
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: dict, pathlib.Path, bool, int
Output Type: Any
Dependencies:
```python
def v0(v1: pathlib.Path) -> list:
assert v1.is_dir()
v2 = v1.joinpath('latest_checkpoint')
v2.touch(exist_ok=True)
with open(v2) as v3:
v4 = v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], str
Output Type: List[Tuple[int, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2: str) -> List[Tuple[int, int]]:
v3: List[Tuple[int, int]] = []
v4 = None
for (v5, v6) in enumerate(v1):
... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: bool
Output Type: str
Dependencies:
```python
def v0(v1: object) -> None:
if isinstance(v1, dict):
if 'traceback' in v1:
del v1['traceback']
if 'cause' in v1:
v0(v1['cause'])
```
Function Name: v... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Optional[str]:
v2 = [v1]
v3 = ['.git']
while True:
v4 = os.path.join(*v2)
v5 = os.path.join(v4, *v3)
i... |
Imports:
```python
import PIL
import numpy as np
from PIL.Image import Image as TImage
from matplotlib import pyplot as plt
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import u... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False, v2: bool=False) -> str:
if v2:
v3 = self.get_base_json_type_string()
else:
v3 = self.get_base_type_string()
if v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: float):
if v1 in self.balance.keys():
self.balance[v1] += v2
else:
self.balance[v1] = v2
print(self.balance)
``` |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
logging.info(f'set epoch to {v1} in airstore dataset')
self.epoch = v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'RStruct'
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'RStruct') -> str:
assert False
return ''
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
async with self._transaction():
await self._connection.executescript(f'\n CREATE TABLE IF NOT EXISTS {self._table_name} (\n ... |
Imports:
```python
import subprocess
from tempfile import TemporaryDirectory
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Module, Union[str, Path]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Module, v2: Union[str, Path]):
with TemporaryDirector... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence[str]
Output Type: None
Dependencies:
```python
def v0():
return len(peer_set - self.node._peers_by_namespace[self.name]) == 0
```
Function Name: v1
Function:
```python
async def v1(self, v2: Sequence[str]) -> None:
v3 = set(v2)
d... |
Imports:
```python
from collections import Counter
import typing
```
Type definitions:
Input Types: List[int], int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: int) -> int:
v3 = Counter(v1)
v4 = sorted(v3.values(), reverse=True)
v5 = len(v4)
whil... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(BusyObservable, Registrable, Failable, method='entry_changed'):
@property
@abstractmethod
def v1(self) -> bool:
"""A flag indicatining if the entry is initalized.
"""
```
Input Types: v0
Output Type: None
Dependencies... |
Imports:
```python
import collections
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
if v1.startswith('TRA'):
return 'TRA'
elif v1.startswith('TRB'):
return 'TRB'
return 'UNK'
```
Function Name: v2
Function:
```python
de... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
v2 = os.environ.get('SLACK_TOKEN')
if v2 is None:
return True
if v1 == v2:
return True
else:
print('I... |
Imports:
```python
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: Tensor, Any, Any, Any, Any
Output Type: Tensor
Dependencies:
```python
def v0(v1, v2):
(v3, v4) = torch.linalg.eigh(v1, UPLO='L')
v3 = torch.diag(v2(around(v3)))
return torch.matmul(torch.matmul(around... |
Imports:
```python
import typing
```
Type definitions:
Input Types: MutableMapping[str, Any], Mapping[str, Any]
Output Type: Mapping[str, any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: MutableMapping[str, Any], v2: Mapping[str, Any]) -> Mapping[str, any]:
v1 = v1 or {}
v3 = v1.get(s... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[str, Any]
Dependencies:
```python
def v0(v1: str, v2: str) -> str:
if v2.startswith('pods'):
v3 = '/api/v1'
elif v2.startswith('rayclusters'):
v3 = '/apis/ray.io/v1alpha1'
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[list, tuple], Union[list, tuple]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[list, tuple], v2: Union[list, tuple]) -> None:
for v3 in self.row_data:
if v3 == v1:
v4 = self... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: List, Any
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
v3 = defaultdict(lambda : 0)
for v4 in v1:
v3[v4[v2]] += 1
return v3
```
Function Name: v5
Function:
```python
def v5(v6: List, ... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Optional[str]:
v2 = re.match('^file_type:\\s*([\\w\\-_]*)\\s*$', v1)
return v2.group(1) if v2 else None
``` |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: np.array, int, np.array, int
Output Type: (bool, float, np.array or None)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.array, v2: int, v3: np.array, v4: int) -> (bool, float, np.array or None):
v5 = v1 - v3
v6... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: List[str]) -> Dict:
v2 = {'targetUidList': v1}
return await self.request('POST', f'user-profile/{self.uid}/joined', v2)
``` |
Imports:
```python
import typing
from typing import Any, cast
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
assert self._finite
return cast(int, self._integer)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list[str], int, int, int, bool
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list[str], v2: int, v3: int, v4: int=None, v5: bool=None) -> dict:
v6 = '/stats2/aggregate/topTalkers?' + 'startTime={}&endTime=... |
Imports:
```python
import typing
```
Type definitions:
Input Types: xr.Dataset, List[Tuple[float, float]]
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: xr.Dataset, v2: List[Tuple[float, float]]) -> pd.DataFrame:
v3 = v1.sel(locations=v2)
v4 = (v3['ro'] * v3['area']).... |
Imports:
```python
from sklearn.svm import SVR
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from sklearn.neighbors import NearestNeighbors
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=None) ->... |
Imports:
```python
from functools import reduce, partial
import typing
```
Type definitions:
Input Types: Any, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str) -> str:
v3 = partial(v1, state_code=v2, numberplate=9999)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(ContextManager[None]):
def __init__(self, v1: Path, v2: Path=None):
self._iso = pycdlib.PyCdlib()
self._iso.open(str(v1))
self._iso_rr: PyCdlibRockRidge = self._iso.get_rock_ridge_facade()
self._temp_dir: Opti... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1: Any) -> None:
self.alpha.data.fill_(1.0)
self.beta.data.fill_(0.0)
``` |
Imports:
```python
import torch
import torch.nn.functional as TF
from torch import Tensor
from torch.nn import Module, Parameter, ReLU
import typing
```
Type definitions:
Input Types: Tensor, Tensor, Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tensor, v2: Tensor, v3: Tens... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1: FigureCanvasAgg = self._fig.canvas
v1.restore_region(self.bg_cache)
for v2 in self._artists:
v2.axes.draw_artist(v2)
``` |
Imports:
```python
import logging
import sys
from numpy import in1d
import typing
```
Type definitions:
Input Types: str, int, int, Any, bool
Output Type: dict
Dependencies:
```python
def v0(v1: Iterable[str], v2='\t') -> Iterable[Tuple[str, ...]]:
for v3 in v1:
yield v3.strip().split(v2)
```
Function Name... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._generator.close()
self._buffer.clear()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.logger.info(f'software trigger {self.alias!r}')
self.write('INIT;*TRG')
``` |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Union[str, Path], int
Output Type: List[str]
Dependencies:
```python
def v0(v1: Union[Path, str]) -> Path:
if isinstance(v1, str):
return Path(v1)
return v1
```
Function Name: v2
Function:
```python
def v2(v3: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.ssn()
return v1[:3] + '.' + v1[3:6] + '.' + v1[6:9] + '-' + v1[9:]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: torch.nn.Module
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> torch.nn.Module:
assert self._synthetic_reward_network is not None, '_synthetic_reward_network was not initialized'
v1 = self.net_builder.value
... |
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:
if v1 == v2:
return
v3 = self.find(v1)
v4 = self.find(v2)
if v3 == v4:
return
self._ids[v3] = v... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> np.ndarray:
np.random.seed(1)
return np.random.rand(v1, v1) - 0.5
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('E')
```
Input Types: Iterable[v0], Callable[[v0], str], str
Output Type: str
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Iterable[v0], v3: Callable[[v0], str]=str, v4: str=',') -> str:
v5 = map(v3, v2)
return v4.j... |
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 = v1.reshape(v1.shape[0], -1)
return np.dot(v1, self.w.T) + self.b
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, /) -> bytes:
assert self._file
v3 = self._file_limit() // self._config.page_size * self._config.page_size
v4 = v1 + v2
if v... |
Imports:
```python
import json
import os
import typing
```
Type definitions:
Input Types: cdata.CoreData, Any
Output Type: Any
Dependencies:
```python
def v0(v1, v2: Dict[str, cdata.UserOption], v3: str, v4: str='any'):
v5 = list(v2.keys())
v5.sort()
for v6 in v5:
v7 = v2[v6]
v8 = {'name': ... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = pd.value_counts(v1).to_frame()
v3 = pd.DataFrame(v2).reset_index()
v3.columns = ['name', 'counts']
v4 = [(item[0], it... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[str], Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[str], v2=False) -> str:
v3 = '|'.join(v1)
if v2:
return f'({v3})'
else:
return f'(?:{v3})'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: defaultdict, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: defaultdict, v2: int, v3: int):
v1[v2][v3] = 1
v1[v3][v2] = 0
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, int
Output Type: float
Dependencies:
```python
def v0(v1, v2):
if v2 == 0:
return 1
v3 = v0(v1, v2 // 2)
if v2 % 2 == 0:
return v3 * v3
if v2 > 0:
return v3 * v3 * v1
else:
return v3 * v3 / v1... |
Imports:
```python
import numpy as np
import scipy.linalg as la
from scipy.sparse import coo_matrix
from scipy.spatial import ConvexHull
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.nda... |
Imports:
```python
from typing import Any, Dict, List, Optional, Set, Type, TypeVar, final
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = "\nfrom typing import TypeVar\nx = TypeVar('foo')\n "
v2 = {'typing':... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> None:
v2 = list()
for v3 in v1.rows[0].cells:
v2.append(v3.text)
for v4 in v1.rows[1:]:
v5 = dict()
for (v6, v7) ... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, bool, tf.dtypes.DType
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Tensor, v2: bool, v3: tf.dtypes.DType=tf.float32) -> tf.Tensor:
v1 = tf.cast(v1, v3)
if v2:
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> dict:
v2: dict = v1['train']['autocut']['input_source']
v3 = v2['file_list']
return {'output_suffix': v1['output_suffix'], 'dat... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, 'array.Array'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int, v3: 'array.Array'):
if v1 in self._cache:
v4 = self._cache[v1]
if v2 >= len(v4):
v4 += [None] ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = List[Union[str, List[str]]]
```
Input Types: Any, Any
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2=None, v3=None) -> v0:
v4 = [w if g else {} for (v5, v6) in zip(self.is_given, self.game_phrase)]
for v7... |
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.workers:
v1.start()
self.result_thread.start()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], List[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]=None, v2: List[str]=None) -> str:
v3 = self.get_config_errors(include_sections=v1, exclude_sections=v2)
if not v3:
re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: any, Sequence[str], Dict[str, str]
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: any, v2: Sequence[str], v3: Dict[str, str]=None) -> Dict[str, str]:
v4 = {}
if v3:
v4.update(v3)
for v5 ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Sequence[str]
```
Input Types: v0
Output Type: None
Dependencies:
```python
def v1(v2: v0) -> int:
v3 = [Pair.from_text(line) for v4 in v2]
v5 = v3.pop(0)
for v6 in v3:
v5 += v6
v5.reduce()
return abs(v5)
```
Function Name... |
Imports:
```python
import os
import re
import sys
from datetime import datetime, timedelta
from pathlib import Path
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if not isinstance(v1, str) or len(v1) == 0 or (not os.path.... |
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:
v2 = np.exp(v1 / self.temp)
v3 = np.sum(v2)
v4 = v2 / v3
return v4
``` |
Imports:
```python
from collections import Counter
import typing
```
Type definitions:
Input Types: list, int, bool
Output Type: bool
Dependencies:
```python
def v0(v1: list) -> int:
v2 = Counter((i - v1[i] for v3 in range(len(v1))))
return sum((max(count - 1, 0) for v4 in v2.values()))
```
Function Name: v5
F... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2=None) -> str:
(v3, v4) = (v1[0], v1[1])
if '||' in v1[1]:
v5 = v4.split('||')
v6 = f'({v3} != {v5[0]})'
for v7 in v5[1:... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
assert self.hook_global_zero.is_file(), 'before_training_on_global_rank_zero should have been called already'
assert not self.hook_local_zero.is_file... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
v2 = self._process_generic(v1, ['Display_aspect_ratio', 'Writing_library', 'Duration', 'Codec_ID'])
if 'Width' in v1 and 'Height' in v1:
... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
try:
with open('transformer_cache/transformer_meta.json', 'r') as v2:
v3 = json.load(v2)
if v1 not in v3:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: bool) -> None:
if not self.current_trajectory_buffer:
return
self.current_trajectory_buffer[len(self.curr... |
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, v3) in self._parse_script(v1):
v4 = self.shell.execute(v2)
if v3 != v4:
raise AssertionError('\nCommand: {command... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Any, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any, v2: bool) -> str:
try:
v3 = int(v1)
if int(v1) == float(v1):
return str(v3)
else:
r... |
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.mongo.azure_ad_access_token.find_one({'bot_id': v1})
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = '-baseline'
if v1.endswith(v2):
v3 = True
else:
v3 = False
return {'run': v1, 'baseline': v3}
``` |
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:
v2 = v1 + 1
self._set_constants(v2)
v3 = self._get_augmented_label_matrix(v2)
v4 = n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.