text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> None:
for v3 in range(v1, v2):
self.codestr[v3 * self.CODEUNIT_SIZE] = self.NOP
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> dict:
v2: dict = {}
if hasattr(self, 'rule_attribute'):
v2['ruleAttribute'] = str(self.rule_attribute)
elif v1:
v2[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str | None
Output Type: str | None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str | None) -> str | None:
v2 = self._width_to_float(v1)
if v2 < 1e-05:
return None
elif v2 < 1.3:
return 'thin'
e... |
Imports:
```python
import os
import torch
import torch.distributed as dist
import typing
```
Type definitions:
Input Types: Any, str, Any
Output Type: Any
Dependencies:
```python
def v0() -> int:
return int(os.environ.get('RANK', 0))
```
Function Name: v1
Function:
```python
def v1(v2, v3: str, v4=False):
if v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> dict:
v2 = dict()
return v2
``` |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: Any, Union[List[float], Tuple[float, float]]
Output Type: Tuple[List[Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: Union[List[float], Tuple[float, float]]) -> Tuple[List[Any]]:
if isinstance(v2, float):
... |
Imports:
```python
from pandas._libs.algos import unique_deltas
from pandas._libs.tslibs import Timestamp, get_unit_from_dtype, periods_per_day, tz_convert_from_utc
from pandas._libs.tslibs.ccalendar import DAYS, MONTH_ALIASES, MONTH_NUMBERS, MONTHS, int_to_weekday
from pandas._libs.tslibs.fields import build_field_sar... |
Imports:
```python
import gzip
import io
from urllib.request import Request, urlopen
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = Request(v1)
v2.add_header('Accept-encoding', 'gzip')
v3 = urlopen(v2)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable[[Mapping[str, Any]], Mapping[str, Any]], Mapping[str, Any]
Output Type: Mapping[str, Any]
Dependencies:
```python
def v0(v1: Mapping[str, Any]) -> Dict[str, Any]:
return frozen_dict.unfreeze(v1)
```
Function Name: v2
Function:
```python
d... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.Series, Optional[pd.Series]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.Series, v2: Optional[pd.Series]=None) -> bool:
try:
v3 = pd.to_numeric(v1)
if v2 is not None:
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Tuple[List[Tuple[T, int, List[List[Session]]]], Mapping[T, str]]
```
Input Types:
Output Type: v0[str]
Dependencies:
```python
def v1(v2: 'SessionInfo') -> Iterator[Tuple[str, Set['LogId']]]:
return ((name, ids) for (v3, v4) in v2.get_product_ty... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1: list = []
def v2():
pass
```
Input Types: str
Output Type: v0
Dependencies:
Function Name: v3
Function:
```python
def v3(self, v4: str) -> v0:
if v4 in self.FactoryTable:
return self.FactoryTable[v4]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> int:
v2 = len(v1)
v3 = -float('inf')
for v4 in range(v2):
if v1[v4] != v1[-1]:
v3 = max(v3, v2 - 1 - v4)
... |
Imports:
```python
from Bio import Align, SeqIO
from Bio.Align import PairwiseAlignment
import typing
```
Type definitions:
Input Types: str, str
Output Type: PairwiseAlignment
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> PairwiseAlignment:
v3 = Align.PairwiseAligner()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: list[dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3) -> list[dict]:
v4 = []
if v3:
for v5 in v1:
if v2.items() <= v5.items():
v4.append(v5)
else:
... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: str, pd.DataFrame, Callable[[pd.DataFrame], pd.DataFrame]
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: pd.DataFrame, v3: Callable[[pd.DataFrame], pd.DataFrame]) -> pd.DataFrame:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Dict[str, str]]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[Dict[str, str]]) -> str:
v2 = [t['name'] for v3 in v1 if v3['name'].startswith('experiment_name')][0]
return v2[len('experiment_name') +... |
Imports:
```python
import importlib
import os
import typing
```
Type definitions:
Input Types:
Output Type: set
Dependencies:
Function Name: v0
Function:
```python
def v0() -> set:
v1 = set()
v2 = os.getcwd()
for (v3, v4, v5) in os.walk('{}/modules'.format(v2)):
v6 = os.path.realpath('{}/modules'... |
Imports:
```python
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: torch.Tensor, Union[torch.Tensor, float], Union[torch.Tensor, float]
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: Union[torch.Tensor, float], v3: Union[t... |
Imports:
```python
import typing
```
Type definitions:
Input Types: AST.ArgMax, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: AST.ArgMax, v2):
v3 = self.visit(v1.expr, v2) | self.visit(v1.dim, v2)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> float:
v2 = sum((3 * (i - 1) for v3 in range(2, v1)))
return (v2 + 2 * v1) * 2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Dict]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[Dict]):
for v2 in v1:
self.add_migrant(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, utils.Verify
Output Type: Any
Dependencies:
```python
def v0(v1: int=None, v2: int=1, v3: int=100, v4: utils.Verify=None):
if v4 is None:
v4 = utils.Verify()
v5 = API['audio']['list_info']['song_list']
v6 = {'sid': v1, 'pn': v... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if os.path.exists(self.installDir):
v1 = os.listdir(self.installDir)
v2 = self.latestRelease()
v3 = v2['version']
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str):
if v1.startswith('*'):
v1 = v1[1:]
v2 = '[*c]' + v2
return (v1, 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:
v2 = self._get_node(v1)
v3 = v2.get_next()
if not v3:
raise StopIteration(self._name)
return v3
``` |
Imports:
```python
from glob import glob
import os
import typing
```
Type definitions:
Input Types: str, bool, Union[Dict, None]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='*', v2: bool=True, v3: Union[Dict, None]=None):
v4 = os.path.join(self.root_dir, self.mgf_subd... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
if v1['name'] not in self.variables:
self.throw(f"Variable does not exist: {v1['name']}")
else:
self.variables[v1['name']]['valu... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: Collection[v0], str, int
Output Type: Iterator[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Collection[v0], v3: str='', v4: int=0) -> Iterator[v0]:
self.total = v4
self.description = ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(BaseClient):
def __init__(self, v1: str, v2: bool, v3: bool, v4: str, v5: str, v6: str=None, v7: str='7 days', v8: list=None, v9: int=50, v10: str=''):
if v8 is None:
v8 = []
self.client_id = v4
self.clien... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1, **v2) -> dict[str, str]:
v3 = self.config_with_metadata(*v1, **v2)
v4 = {}
for (v5, v6) in v3.items():
v7 = v6['value']
if ... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: dict, int
Output Type: int
Dependencies:
```python
def v0(v1: dict, v2: int) -> Tuple[dict, int]:
(v3, v4) = (0, defaultdict(int))
for v5 in v1[v2].values():
if v5:
for (v6, v7) in v5:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: Any
Dependencies:
```python
def v0(v1: np.ndarray, v2: np.ndarray) -> np.ndarray:
v3 = np.eye(4, dtype='float32')
v3[:3, :3] = v2
v3[:3, 3] = v1
return v3
```
Function Name: v4
Fun... |
Imports:
```python
import inspect
import typing
```
Type definitions:
Input Types: Callable, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Callable, v2: int) -> None:
v3 = inspect.signature(v1)
v4 = len(v3.parameters)
if v4 != v2:
raise TypeError('{} has {} p... |
Imports:
```python
import numpy as np
import torch
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, np.ndarray, np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray, v3: np.ndarray, v4: np.ndarray):
v1 = torch.from_nump... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: List[str], v2: List[str], v3: List[str], v4: int, v5: List[str]) -> None:
self.whitelist = v1
self.blacklist = v2
self.arglist = v3
self.verbosity = v4
self.waiter = Waiter(verb... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Union[Mapping, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> Union[Mapping, None]:
v3 = self.database[v1]
v4 = v3.find({'Exp_unique_ID': v2})
if v4.count() > 0:
f... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> dict:
v2 = {'organisation': {'name': v1['organisation']['name'], 'description': v1['organisation']['description'], 'url': v1['organisation']['url... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self._blockchain_liveliness_alarm
if v1:
self.alarm_queue.unregister_alarm(v1)
self._blockchain_liveliness_alarm = None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, **v2):
v2.update(locals())
v3 = {'tags': ['Organizations'], 'operation': 'getOrganizationInventory'}
v4 = f'/organizations/{v1}/inventory... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray) -> np.ndarray:
v3 = v1[1]
v4 = self._l * np.array([np.sin(v3), -np.cos(v3), 0])... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclasses.dataclass
class v0:
v1: str
v2: int
v3: int
```
Input Types: str, v0
Output Type: str
Dependencies:
Function Name: v4
Function:
```python
def v4(v5: str, v6: v0) -> str:
v7 = f'{{{{<figure src="{v6.image}" >}}}}'
return v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, dict]
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, dict]) -> Dict[str, Any]:
v2 = {}
for (v3, v4) in v1.items():
v5 = None
if v4['DataType'] in ['String',... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, bool, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str='', v3: bool=False, v4: str=''):
if v3:
if v2 == '':
self.importLibrary = self.importLibrary + 'from ' + v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, bool, int
Output Type: DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2=None, v3: bool=True, v4: int=-1) -> DataFrame:
v5 = self._cython_agg_blocks(v1, alt=v2, numeric_only=v3, min_count=v4)
ret... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Dict[str, Any]:
v1 = 0
try:
import cupy as cp
import cucim
v1 = cp.cuda.runtime.getDeviceCount()
except Exception:
... |
Imports:
```python
import numpy as np
import torch
from torch import Tensor
from torch.nn import functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: torch.Tensor
Dependencies:
```python
def v0(*v1):
v2 = [tensor.size(0) * tensor.size(1) for v3 in v1]
v4 = np... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str):
v2 = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3]
v3 = 10 - sum((weight * int(digit) for (v4, v5) in zip(v2, v1))) % 10
return v3
```
Function Name: v6
Function:
```python
def v6(v7: str):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
v1 = []
for v2 in self.parameters():
v1 += [v2.upper(), v2.upper() + ' ERR']
return v1
``` |
Imports:
```python
import os
import requests
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: str, str, os.PathLike
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: os.PathLike) -> None:
with requests.get(v1, stream=True, verify=False) as v4:... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
assert self.selector is not None
v1 = set()
for v2 in self.unfinished:
v1.add(v2._work_id)
for v3 in self.works:
if v3 ... |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import animation
import typing
```
Type definitions:
Input Types: str, str, np.ndarray, np.ndarray, np.ndarray, int
Output Type: Any
Dependencies:
```python
def v0(v1):
ax.view_init(elev=15 * (v1 // 15) ... |
Imports:
```python
import re
from argparse import ArgumentParser, ArgumentTypeError
import typing
```
Type definitions:
Input Types: str
Output Type: Pattern
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Pattern:
try:
return re.compile(v1)
except re.error:
raise Argume... |
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 = 0
v3 = ''
for v4 in v1:
if v4 == '(':
if v2 != 0:
v3 += '('
v2 += 1
else:
... |
Imports:
```python
from functools import partial, wraps
import typing
```
Type definitions:
Input Types: Optional[str], Optional[Callable]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str], v2: Optional[Callable]=None):
if v2 is None:
return partial(self.r... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Any
Output Type: v0
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> v0:
v2 = []
v3 = self._cache
v1 = Path(v1)
for v4 in v1.parts:
if v4 in v3.keys():
v3 = v3[v4]
... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
if self.futures:
await asyncio.wait(self.futures)
if self.change_worker:
await self.change_worker.stop()
if ... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, tf.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor, v2: tf.Tensor):
v1 = tf.ensure_shape(v1, shape=(2,))
return self._GlobalState(tf.cast(v1, dtype=tf.i... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Iterator
Dependencies:
```python
def v0(v1, v2: int):
return v1.get(Range=f'bytes={v2}-')['Body']
```
Function Name: v3
Function:
```python
def v3(self) -> Iterator:
v4 = 1024 * 1024 * 10
v5 = v0(self.csv_file, self.total_off... |
Imports:
```python
import typing
```
Type definitions:
Input Types: argparse.ArgumentParser
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: argparse.ArgumentParser) -> None:
v1.add_argument('--no-sdist', dest='sdist', default=True, action='store_false', help="Don't build sou... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, Any]:
if len(self._error) == 0:
return None
if len(self._error) == 1:
return self._error[0].dict()
return [e.dict()... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.ServerThread.isRunning():
self.ServerThread.requestInterruption()
self.ServerThread.wait()
self.ui.disconnectButton.hide()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.es_proxy.fetch_table_search_results_with_filter(search_request=None, query_term='test')
self.assertEquals(v1.total_results, 0)
self.ass... |
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 self.in_var_ref:
self._parse_var()
if self.level == 0:
v2 = ''.join(self.buffer).strip()
if v2:
ra... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Tuple[float, float], bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: Tuple[float, float]=None, v3: bool=False):
v1 = v1.astype(np.float32)
if v2 is None:
v2 = (v1.min(),... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('VT')
```
Input Types: Iterable[AbstractSet[v0]]
Output Type: Set[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Iterable[AbstractSet[v0]]) -> Set[v0]:
v3: Set[v0] = set()
for v4 in v2:
v3 |= v4
return... |
Imports:
```python
import numpy as np
import torch
import typing
```
Type definitions:
Input Types: Structure
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Structure):
v2 = np.vstack([self._atom_feature(s.name) for v3 in v1.species])
return torch.Tensor(v2)
``` |
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 self.count < self.msize:
self.stack.append(v1)
self.count += 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict=None):
v2 = v2 or {}
v3 = {'type': 'Yandex', 'id': v1}
if v2:
v3['params'] = '%s' % v2
self.analytics.append(v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, str
Output Type: List[any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: str) -> List[any]:
v4 = {'fromBlock': v1, 'toBlock': v2, 'topics': [v3]}
return self.web3_slow.eth.getLogs(v4)
``` |
Imports:
```python
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: np.ndarray, list, int, int, str, str, int, int, tuple
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: list=[], v3: int=4, v4: int=4, v5: str='', v6: str='gray', v7: int=0... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: Iterable[Tuple[int, int, int]]
Output Type: Mapping[int, Mapping[int, Set[int]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[Tuple[int, int, int]]) -> Mapping[int, Mapping[int, Set[int]]... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: 'Job'
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Job') -> str:
v2 = f'{v1.job_id:>06d}'
return os.path.abspath(os.path.join(self.config.joboutputdir, v2[:2], v2[2:4], v2))
``` |
Imports:
```python
from binascii import hexlify, unhexlify
import typing
```
Type definitions:
Input Types: bytes, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bytes, v2: int=0) -> str:
v1 = hexlify(v1)
return '0x' + v1.rjust(v2 * 2, b'0').decode()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool):
if v2:
self.status |= self.flags[v1]
else:
self.status &= ~self.flags[v1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: [str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> [str]:
v3 = []
if v1 > 0 and int(self.data[v2][v1 - 1]) != 9:
v3.append(';'.join([str(v1 - 1), str(v2)]))
if v1 < se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> dict:
v2 = 0
v3 = len(str(len(v1)))
v4 = {'count': len(v1)}
for v5 in v1:
v4.update({'line' + str(v2).rjust(v3, '0'): v5})
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
```python
def v0(v1, v2: Optional[List[str]]=None) -> List[str]:
if v2 is None:
v2 = []
for v3 in v1:
if isinstance(v3, node_classes.Tuple):
v0(v3.elts, v2)
else:
... |
Imports:
```python
import os
from glob import glob
import typing
```
Type definitions:
Input Types: pathlib.Path, pathlib.Path, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pathlib.Path, v2: pathlib.Path, v3) -> None:
v4 = set((os.path.basename(case).split('_0000.nii.... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
v1 = pd.DataFrame(data={'col1': [1, 2], 'col2': [3, 4]})
v1.nlargest(1, 'col1')
v1.nsmallest(1, 'col2')
``` |
Imports:
```python
import os, shutil, subprocess
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if not os.path.exists(v1):
raise FileNotFoundError('The provided path was not found!')
``` |
Imports:
```python
import torch
from torch import Tensor
import torch.nn as nn
import typing
```
Type definitions:
Input Types: Tensor, int
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor, v2: int) -> Tensor:
v1 = self.conv1(v1, v2)
if self.SFG:
v1 = sel... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = 'WCA_export'
v3 = [x for v4 in os.listdir() if v4[:len(v2)] == v2][0]
return open('{}/{}_{}.tsv'.format(v3, v2, v1))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: datetime.date, datetime.date, Any
Output Type: Iterable[datetime.date]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: datetime.date, v2: datetime.date, v3=datetime.timedelta(1)) -> Iterable[datetime.date]:
v4 = v1
while v4 < v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, Union[str, List[str], Dict[str, str]], str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: Union[str, List[str], Dict[str, str]], v3: str='') -> None:
if isinstance(v2, str):
v2 = v2.sp... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: int):
try:
v3 = v1.index(v2)
except:
return [-1, -1]
v4 = 0
v5 = v3
v6 = len(v1)
while v1[v5] == v2:
v5... |
Imports:
```python
import ctypes
import ctypes.wintypes
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> bool:
try:
v2 = ctypes.windll.ntdll.ZwWow64ReadVirtualMemory64
except Exception as ex:
return Fa... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self._mementos:
return
self._originator.restore(self._mementos.pop())
``` |
Imports:
```python
import torch
from torch import Tensor, nn
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:
(v3, v4, v5) = (torch.mm(v1, v1.t()), torch.mm(v2, v2.t()), torch.mm(... |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if v1 == 'N' or v1 == 'A' or v1 == 'M':
return v1
raise argparse.ArgumentTypeError("Invalid seasonal selected. Choose bet... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: Path, Path
Output Type: Any
Dependencies:
```python
def v0(v1: Path) -> Mapping[str, str]:
with v1.open('r', encoding='utf8', errors='ignore') as v2:
v3 = [line.rstrip('\n').split('\t') for v4 in v2]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[str, str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple[str, str]) -> str:
(v2, v3) = v1
return '\n'.join((f'arch={v2}', f'framework={v3}'))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[Set[Text]]
Output Type: 'StateDict'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[Set[Text]]=None) -> 'StateDict':
if self.transaction is not None:
self.transaction.delete(self, keys=v1)
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence[int], int
Output Type: tuple[int, ...]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Sequence[int], v2: int) -> tuple[int, ...]:
v3 = []
for v4 in v1:
if v4 > v2:
v4 = v2
v3.append(v4)
... |
Imports:
```python
import torch
import torch.nn.functional as F
from torch import Tensor as T
from torch import nn
import typing
```
Type definitions:
Input Types: T, T
Output Type: T
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: T, v2: T) -> T:
v3 = torch.matmul(v1, torch.transpose(v2, 0, 1))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, List[Tuple[str, str, int]]]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Dict[str, List[Tuple[str, str, int]]]:
v1 = {'test': 'data/test_flight_data.csv', '11-19': 'data/Nov2019_flight_data.csv', '12-19'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
try:
v2 = self.__find_text(v1)
return v2.text
except:
if self.__is_cell_empty(v1):
return ''
v2 = self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple, bool
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple, v2: bool=True) -> float:
if v1 in self.cache:
self.cache_hits += 1
return self.cache[v1]
self.fitness_hits += 1
v3 ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
v1: Any
v2: str
v3: bool
v4: bool
v5: Any
v6: Any
def __init__(self, v7=None, v8=None, v9=None, v10=None, v11=None, v12=None):
self.__dict__['health'] = v7
self.__dict__['mesos_task_state'] = ... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: int, str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str, v3):
v4 = os.path.getsize(v2)
v5 = int(v4 / os.cpu_count()) * v1
v6 = 0
if v1 + 1 == os.cpu_count():
v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.