text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterator[str]
Output Type: Iterator[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterator[str]) -> Iterator[str]:
v2 = 0
v3 = [v1[0]]
for v4 in range(1, len(v1)):
v5 = v1[v4]
v6 = f'{v3[v2]} {v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = '' if not self.overload_name else f'.{self.overload_name}'
if self.is_vararg:
v2 = '...'
else:
v2 = ', '.join((arg['type'] for... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Sequence, Sequence[Dict]
Output Type: Any
Dependencies:
```python
def v0(**v1):
v2 = dmc2gym_make(**v1)
for (v3, v4) in enumerate(wrapper_classes):
v5 = wrapper_kwargs[v3]
if v5 is None:
v5 = dict()
v2 ... |
Imports:
```python
import sqlite3 as sql
from pathlib import Path
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2=None):
v3 = Path(v1)
if not v3.is_file():
return (None, 'no such database file: {}'.format... |
Imports:
```python
import itertools
import typing
```
Type definitions:
Input Types: bool, Any, Any, Any
Output Type: typing.List[tuple]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool, v2, v3, v4) -> typing.List[tuple]:
assert self.is_instantiated
v5 = [c._gen_code(v1, v2, v3, v4) f... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
if not self._thresh:
raise ValueError('No threshold found')
else:
return self._thresh
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Any, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: dict):
try:
v3 = json.dumps(v2).encode('ascii')
with open(v1, 'w') as v4:
v4.write(v3)
return True
e... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Dict[str, Any]
Dependencies:
```python
def v0(v1: List[Dict[str, Any]], v2: Callable[[str, Dict[str, Any]], None]) -> List[Dict[str, Any]]:
v3 = []
for v4 in v1:
v5 = []
for v6 in v4['taint']:
... |
Imports:
```python
import torch
from torch import nn, optim
import typing
```
Type definitions:
Input Types: torch.utils.data.Dataset
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.utils.data.Dataset):
v2 = torch.utils.data.DataLoader(v1, batch_size=1, shuffle=True, num_work... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: int, v3: int):
v4 = v1[v2, :]
v2 += 1
v1[v2:self.rows, :] -= v1[v2:self.rows, v3].reshape((-1, 1)) * v4
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1: Any
v2: Any
v3: int = 1
v4: Optional[int] = 1
def __init__(self, v5=1, v6: Optional[int]=1):
self.min_occurs = v5
self.max_occurs = v6
@property
def v7(self):
return [self.min_occurs, sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._initialize_scene()
self.environment.set_reset_checkpoint()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: RSQLParser.ComparisonContext
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: RSQLParser.ComparisonContext):
v2 = self.visit(v1.cmp)
v3 = self.visit(v1.left)
v4 = self.visit(v1.right)
return v2(v3,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> dict:
v2 = dict(self.df.std())
v3 = dict(self.df.mean())
v4 = {col: [round(v3[col] - v1 * v2[col], 2), round(v3[col] + v1 * v2[col], 2)] fo... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float) -> float:
if np.ndim(v1) == 0 or (np.ndim(v1) == 1 and len(v1) == 1):
if v1 < self._log_lower_bound:
retur... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.register_user('user1', 'pass')
v2 = self.login(v1, 'pass')
v3 = self.register_user('user2', 'pass')
v4 = self.login(v3, 'pass')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self._text = v1
self._procchrs = len(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: type
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> type:
v2 = self.columns.index(v1)
return self.types[v2]
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = ('_namespaced_name', '_namespace', '_base_name', '_properties', '_extra_blocks', '_blockstate')
v2 = re.compile('(?:(?P<namespace>[a-z0-9_.-]+):)?(?P<base_name>[a-z0-9/._-]+)(?:\\[(?P<property_name>[a-z0-9_]+)=(?P<property_value>[a-... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Doc
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Doc) -> None:
for v2 in v1.ents:
v2._.cui = self.cdb.addl_info['cui2group'].get(v2._.cui, v2._.cui)
``` |
Imports:
```python
import re
from random import choice
from random import randint
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0() -> str:
v1 = []
with open(female_path, 'r') as v2:
for v3 in v2:
v4 = ''.join(re.findall('[a-zA-Z]+', v3))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Mapping[str, Number]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Mapping[str, Number]) -> None:
v3 = [str(v2[k]) for v4 in self._header]
try:
self._open_fid.write(v1 + ',' + ','... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: int) -> int:
v4 = v1 * v2
v5 = 1
while v5 <= v4:
v6 = (v4 - v5) // 2 + v5
if self.count(v1, v2, v6) >= v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = v1.encode()
try:
self._data_store.pop(v2)
except KeyError:
pass
``` |
Imports:
```python
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: pd.DataFrame, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: str, v3: str):
plt.figure(figsize=(10, 8))
v1.boxplot(notch=True)
plt.xlabel('Functio... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, Set[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: Set[int]) -> int:
v3 = [v1]
v4 = 0
while v3:
v5 = v3.pop()
if v5 not in v2:
v2.add(v5)
v4... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Union[str, Path]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, Path]):
if type(v1) == str:
v1 = Path(v1)
v1 = v1 / 'RTE.tsv'
with open(v1, mode='w') as v2... |
Imports:
```python
import pandas as pd
import plotly.express as px
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int=7):
v3 = self.reformat_data(self.load_data(), v1)
v4 = pd.DataFrame(v3)
v5 = v4['s... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
v0 = Tuple[Tensor, Tensor]
```
Input Types: Callable[[], Tuple[v0, v0]]
Output Type: Callable[[], Dict[str, float]]
Dependencies:
```python
def v1() -> Dict[str, float]:
(v2, v3) = error_logdensity_cb()
v2 = [np.array(e) for v4 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: str, v3: int):
v4 = v1[v2].value_counts()
v5 = v4[v4 >= v3].index.tolist()
return v1[v1[v2].isin(v5)]
``` |
Imports:
```python
import hashlib
import os
import typing
```
Type definitions:
Input Types: str, int, int, Optional[bytes]
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int=128, v3: int=1024 * 64, v4: Optional[bytes]=None) -> bytes:
if v2 not in (128, 192, 256, 384, 5... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: list) -> list:
for v3 in range(len(v1)):
for v4 in range(len(v2)):
if v1[v3] == v2[v4]:
v5 = v1[v3]
... |
Imports:
```python
import numpy as np
from numpy.typing import NDArray
import typing
```
Type definitions:
```python
class v0:
v1 = ['ψ_0', 'ψ_1_n', 'norm_squared', 'ψ_coups', 't_steps', 'nonlinear']
def __init__(self, v2: np.ndarray, v3: np.ndarray, v4: SystemParams):
"""Class initializer. Computes th... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: int, v3: int, v4: int):
if v1.shape[0] > v3:
raise ValueError('More objects in image than queries... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> str:
if type(v1) == float:
raise TypeError("'float' object cannot be interpreted as an integer")
if type(v1) == str:
raise TypeError("... |
Imports:
```python
import scipy
from scipy import sparse
import typing
```
Type definitions:
```python
v0 = scipy.sparse.csr_matrix
```
Input Types: v0, v0, str
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0, v3: v0, v4: str='diff') -> v0:
if v4 == 'diff':
v5 = v3 - v2
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = 'Exception: program has entered an invalid state.'
v2 = '\nIssue **Exception: program has entered an invalid state.** was marked as resolved by ... |
Imports:
```python
from torch import nn, Tensor, zeros
from torch.distributions import Bernoulli
from torch.optim import Adam
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
... |
Imports:
```python
import scipy.linalg as spla
import scipy.sparse as spsr
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 = spla.cholesky_banded(v1)
v3 = spsr.diags([v2[0, 1:], v2[... |
Imports:
```python
import io
import re
import typing
```
Type definitions:
```python
v0 = requests.models.Response
```
Input Types: v0
Output Type: Any
Dependencies:
```python
def v1(v2: v0, v3: str):
with io.open(v3, mode='w', encoding='utf-8') as v4:
v4.write(_page_text(v2))
```
```python
def v5(v6: v0) -... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: str
Dependencies:
```python
def v0(v1, v2):
for v3 in v1:
yield v3
yield '.'
for v4 in range(digits):
try:
yield v2[v4]
except IndexError:
yield '00'
```
Function Name: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, int
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bytes, v2: int) -> bytes:
assert v2 <= 255
v3 = len(v1)
if v3 > 0 and v3 % v2 == 0:
return v1
return v1 + b'\x00' * (v2 - v3 % v2)
``... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int=20, v3: int=1):
v4 = self.prefix + f'/{v1}/synonyms'
v5 = {'page': {'size': v2, 'current': v3}}
return self.session.get(v4, j... |
Imports:
```python
import numpy as np
from scipy.special import binom
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> np.array:
v3 = np.tile([1.0, -1.0], -(-v2 // 2))[:v2]
return v3 * binom(v1, np.arange(v2))... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, asyncio.StreamReader | None, asyncio.StreamWriter | None
Output Type: int | None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: asyncio.StreamReader | None=None, v3: asyncio.StreamWriter | None=None) -> int |... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Exception
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Exception) -> None:
if v1 is not None:
self.logger.warning('Raised %s while fetching from peer %s', v1, self.remote.uri)
raise v1
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, 'hamil or overlap'
Output Type: Any
Dependencies:
```python
def v0(v1, v2, v3):
for v4 in v1:
if v4.atomA == v2 and v4.atomB == v3:
return v4
return None
```
Function Name: v5
Function:
```python
def... |
Imports:
```python
import sys, os, subprocess, shutil
import shlex
import typing
```
Type definitions:
```python
class v0:
def __init__(self) -> None:
self.compilers: T.Dict[str, T.List[str]] = {}
self.binaries: T.Dict[str, T.List[str]] = {}
self.properties: T.Dict[str, T.Union[str, T.List[... |
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(v1)
v1[0] = {}
if '.' not in v2:
v1[0]['schema'] = None
v1[0]['type_name'] = v2[2]
else:
v1[0... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict, int, int
Output Type: Tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict, v2: int, v3: int) -> Tuple:
v4 = 5
v5 = round(v1['x'] / v2, v4)
v6 = round((v1['x'] + v1['width']) / v2, v4)
v7 = round(v1['y'] / v... |
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 = np.atleast_1d(v1)
assert v1.shape[-1] == self.dim, f'Point must have {self.dim} coordin... |
Imports:
```python
import os
from glob import glob
import typing
```
Type definitions:
```python
v0 = t.TypeVar('_BotT', bound='OttBot')
```
Input Types:
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self: v0) -> None:
v2 = glob(os.path.join(self._dynamic, '*'))
for v3 in v2:
... |
Imports:
```python
from transformers import T5Tokenizer, T5ForConditionalGeneration
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0():
global _model
if _model is not None:
return _model
print('Loading the model')
v1 = T5ForConditionalGenerati... |
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.count('A') >= 2:
return False
if 'LLL' in v1:
return False
return True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, str]:
v1 = self._auth.get_token()
return {'Authorization': 'Bearer ' + v1.access_token}
``` |
Imports:
```python
import torch
import torch.nn as nn
from torch.autograd import Variable
import typing
```
Type definitions:
Input Types: Dict[str, torch.Tensor], Dict[str, torch.Tensor], torch.Tensor, torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[st... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, **v3: _PossibleArgumentTypes) -> None:
v3['xattr.name'] = v2
v4 = self._put(v1, 'REMOVEXATTR', **v3)
assert not v4.content
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float, Optional[Iterable[int]]
Output Type: Any
Dependencies:
```python
def v0(v1: float, v2: float, v3: Optional[Iterable[int]], v4: int, v5: str, v6: int) -> Tensor:
assert v1 < v2, 'Uniform is not defined when low >= high'
if v3 is N... |
Imports:
```python
import argparse
from pathlib import Path
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = Path(v1)
if v2 is None or (v2.exists() and (not v2.is_dir())):
raise argparse.ArgumentTypeError('i... |
Imports:
```python
import numpy as np
from pandas import DataFrame
import typing
```
Type definitions:
Input Types: float, np.ndarray, Optional[np.ndarray], str
Output Type: DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: np.ndarray, v3: Optional[np.ndarray]=None, v4: str='re... |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: str
Output Type: datetime.date
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> datetime.date:
if v1 is None:
raise ValueError('The input string should not be none.')
if v1 == '':
raise Va... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = ['Speaker 1', 'speaker 1', False]
self._queue.insert(len(self._queue), v1)
self.assertTrue('Speaker 1' in self._queue)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Node):
def __init__(self, v1: str, v2: int, v3: str, v4: str, v5: int, v6: int, v7: bool, v8: str='disabled', v9: str='disabled', v10: typing.SupportsFloat=0, v11: int=2):
super(v0, self).__init__()
self.compatibility: int = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, list, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list=None, v2: list=None, v3: list=None):
if v1 is None:
v1 = []
if v2 is None:
v2 = []
if v3 is None:
v3 = []
re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence[Any], Dict[str, Any], Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Sequence[Any], v2: Dict[str, Any], v3: Any=None) -> Any:
if self.arg_pos is not None and len(v1) > self.arg_pos:
retu... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=1, v2: bool=False):
v3 = self.DAC_current_values()
if v1 == 1:
v4 = np.zeros((len(self._used_buses), 8), dtype=floa... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[Tuple[int, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[Tuple[int, int]]:
v1 = self.chunk_count
v2 = [(chunk, chunk * self._chunk_size) for v3 in range(v1)]
return v2
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: int, v3: int):
if v1.shape[0] < v2:
v4 = [v2 - v1.shape[0]]
for v5 in range(1, len(v1.shape)):... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if os.path.dirname(v1):
os.makedirs(os.path.dirname(v1), 448, exist_ok=True)
self.save(open(v1, 'wb'))
``` |
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 = [i for v4 in range(v2, v2 + 2 * v1, 2)]
v5 = v3[0]
for v4 in v3[1:]:
v5 ^= v4
return v5
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.archived_input:
self.user_input = self.archived_input
self.archived_input = ''
self.position = len(self.completer_history... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
```python
def v0(v1, v2=1):
if not isinstance(v1, int):
raise TypeError('{} instead of int'.format(v1))
if v1 < 0:
v1 = pow(256, v2) + v1
v3 = hex(v1)[2:].rstrip('L')
v3 = '0' * (2 * v... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: os.PathLike
Output Type: str
Dependencies:
```python
def v0(v1: os.PathLike):
return [file for v2 in os.listdir(v1) if is_plugin(v2)]
```
```python
def v3(v4: os.PathLike) -> bool:
v5 = ['.esl', '.esp', '.esm']
return os.path.spl... |
Imports:
```python
import logging
from collections import OrderedDict
import typing
```
Type definitions:
Input Types: Dict[str, str], int, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, str], v2: int=_default_node, v3: str=_default_type) -> None:
logging.debu... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, Any]:
v1 = self.getFiles()
v2: Dict[str, Any] = {}
if len(v1) == 0:
return v2
self.commonFilePath = os.path.c... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> List[int]:
v2 = []
(v3, v4) = (0, len(v1))
for v5 in v1:
if v5 == 'I':
v2.append(v3)
v3 += 1
e... |
Imports:
```python
import importlib
from pandas._config import get_option
from pandas._typing import Label
from pandas.util._decorators import Appender, Substitution
from pandas.core.dtypes.common import is_integer, is_list_like
from pandas.core.dtypes.generic import ABCDataFrame, ABCSeries
from pandas.core.base import... |
Imports:
```python
import ast
import typing
```
Type definitions:
Input Types: ast.Str
Output Type: ast.Str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ast.Str) -> ast.Str:
if '.' not in v1.s:
return v1
v2 = v1.s.split('.')
v3 = []
while v2 and (not isinstance(self.nam... |
Imports:
```python
import json
import requests
import typing
```
Type definitions:
Input Types: int
Output Type: Optional[Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int=10) -> Optional[Any]:
v2 = f'https://api.p2pquake.net/v1/human-readable?limit={v1}'
v3 = requests.get(v2)
if v3.... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> List[str]:
if not re.fullmatch('\\$\\([-._a-zA-Z0-9]+\\)', v1):
return []
return v1.lstrip('$(').rstrip(')').split('.')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: tp.Union[str, tp.Iterable[str]]) -> None:
v1 = list(v1)
self._check_order(v1)
self._order = v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, bytes
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: bytes) -> None:
for (v3, v4) in enumerate(v2):
self.write_ram(v1 + v3, v2[v3])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Any]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[Any]) -> None:
self.contents.append(v1)
return self
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, Any
Output Type: Any
Dependencies:
```python
def v0(v1: dict, v2):
v3 = get_task_id(v1['shortname'], v2)
v2.execute('DELETE FROM `rounds` WHERE tid=%s AND url=%s', (v3, MODEL_URL))
```
```python
def v4(v5: str, v6):
v7 = v6.execute('... |
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 not self.is_drop_item:
return True
return self.CanDefeatEnemies(v1)
``` |
Imports:
```python
import torch
import torch.nn as nn
from torch.distributions.relaxed_categorical import RelaxedOneHotCategorical
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: tuple[torch.Tensor, ...]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torc... |
Imports:
```python
import plotly.graph_objs as gob
import typing
```
Type definitions:
Input Types: str
Output Type: gob.Layout
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> gob.Layout:
v2 = dict(showline=False, zeroline=False, showgrid=False, showticklabels=False, title='')
v3 = 900
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: set
Dependencies:
```python
def v0(v1):
v2 = set()
for v3 in v1:
if isinstance(v3, set):
for v4 in v3:
if v4 in v2:
raise ValueError(f'Candidate {v4} appears multiple tim... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> list:
v2 = []
for v3 in v1:
v2.append((v3[0], [[int(x * self.width), int(y * self.height), z] for (v4, v5, v6) in v3[-1]]))
retur... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1):
v2: RefResolver = RefResolver.from_schema(v1)
v3 = jsonschema_gentypes.APIv7(v2)
return v3.get_type(v1)
```
Function Name: v4
Function:
```python
def v4() -> None:
v5 = v0({'title'... |
Imports:
```python
import numpy as np
from skimage.draw import circle as draw_circle
import typing
```
Type definitions:
Input Types: int, int, str
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int, v3: str='uint8') -> np.ndarray:
v4 = 2 * v2 + 1
v5 = np.zeros... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, dict, bool
Output Type: Any
Dependencies:
```python
def v0(v1: list, v2, v3, v4: bool):
if v1:
v5 = []
for v6 in v1:
v7 = v6[v2]
v8 = v3
if v4:
v7 = str(v7).lower()
... |
Imports:
```python
from keyword import iskeyword
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if v1.startswith('_') and iskeyword(v1[1:]):
v1 = v1[1:]
v1 = v1.replace('_', '-')
return v1
``` |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types:
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> pd.DataFrame:
(v1, v2) = self._section_attributions()
v3 = pd.DataFrame(index=v1.index, columns=self._sctn_cols)
for v4 in ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[float, torch.Tensor, np.ndarray], Optional[float], Optional[float], Optional[float]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[float, torch.Tensor, np.ndarray], v2: Optional[float]=0.5, v3: Optional[fl... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = np.asarray(v1)
return v2[v2 != {}]
``` |
Imports:
```python
import numpy as np
from numpy.typing import ArrayLike
from numpy.typing import DTypeLike
import typing
```
Type definitions:
Input Types: ArrayLike
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
v3 = np.zeros(v2, v1.dtype)
v3[:v1.size] = v1
return v3
```
Function Name: v4
Funct... |
Imports:
```python
import os
import os.path as path
import shutil
from datetime import datetime, timedelta
import typing
```
Type definitions:
Input Types: str, str, str, Any
Output Type: Any
Dependencies:
```python
def v0(v1: datetime):
v2 = datetime.strftime(v1, timestamp_format)
return '{0}:{1}'.format(v2[:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: beam.metrics.MetricsFilter, beam.runners.runner.PipelineResult, str
Output Type: Optional[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: beam.metrics.MetricsFilter, v2: beam.runners.runner.PipelineResult, v3: str='counters') -> O... |
Imports:
```python
import json
import logging
import os
import re
import subprocess
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1, v2: dict) -> list:
v3 = []
for v4 in range(len(v1['actions'])):
v5 = replace_placeholder_in_string(v1['actions'][v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.