text stringlengths 190 325k |
|---|
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, *, v2=None) -> None:
v3 = self.get_virtual_point_data()
v4 = v1.ndim - self.grid.num_axes
v5 = [slice(No... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Callable[[str, Any], None]
```
Input Types: v0
Output Type: v0
Dependencies:
```python
def v1(v2: str, v3: Union[float, int]) -> None:
if v3 < min_:
raise ValueError(f'"{v2}" should be higher or equal to {min_}')
if v3 > max_:
... |
Imports:
```python
import collections
import typing
```
Type definitions:
Input Types: Sequence[int], int
Output Type: Sequence[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Sequence[int], v2: int) -> Sequence[int]:
v3: List[int] = []
v4: Deque[int] = collections.deque()
v5 = 0
f... |
Imports:
```python
import matplotlib.pyplot as pp
from matplotlib.colors import TwoSlopeNorm
from matplotlib.tri import Triangulation
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, bool, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3, v4, v5: bool... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
return [[0] * v2 for v3 in range(v1)]
```
Function Name: v4
Function:
```python
def v4(self, v5: int):
v6: List[List[int]] = v0(v5, 5)
v6[0] = [1, 1, 1, 1, 1]
for v7 in range... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: tuple
Dependencies:
```python
def v0(v1: str) -> str:
v2 = open(v1, 'r')
v3 = v2.read()
v2.close()
return v3
```
Function Name: v4
Function:
```python
def v4(v5: str, v6: str=',') -> tuple:
v7 = v0(v5)
v8 ... |
Imports:
```python
from datetime import datetime, timedelta
from calendar import monthrange
import typing
```
Type definitions:
Input Types: datetime, datetime, int
Output Type: Any
Dependencies:
```python
def v0(v1: datetime, v2: int=1) -> datetime:
v3 = v1
for v4 in range(abs(v2)):
if v2 > 0:
... |
Imports:
```python
import csv
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Dict[str, str]:
v1 = 'sequence_descriptors.csv'
v2 = {}
with open(v1, 'r') as v3:
v4 = csv.reader(v3)
v5 = next(v4)
... |
Imports:
```python
from math import isqrt
import typing
```
Type definitions:
Input Types: int
Output Type: Iterator[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> Iterator[int]:
for v2 in range(2, isqrt(v1) + 1):
while v1 % v2 == 0:
v1 //= v2
yield v2
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(_CfgNode):
def v1(self, v2: str, v3: bool=True) -> None:
"""
Adapted from https://github.com/facebookresearch/detectron2
"""
v4 = _CfgNode.load_yaml_with_base(v2, allow_unsafe=v3)
v4 = type(self)(v4)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if v1 in self.cached:
return self.cached[v1]
v2 = self._on_fetch(v1)
self.cached[v1] = v2
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, object
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: object) -> None:
self.emit('terminate')
self._terminate_signal = True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable
Output Type: Callable
Dependencies:
```python
def v0(v1: str, v2: Dict, v3: Callable=None):
from importlib import import_module
from Acquire.Service import MissingFunctionError
if v1 is None:
from admin.root import run as ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, list, list[str]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: list, v3: list[str]) -> bool:
v4 = {'action': v1, 'alarmTypeIds': v2, 'applianceIds': v3}
return self._post('/alarm/suppress'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: timedelta, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: timedelta, v2: str='{h:02}:{m:02}:{s:02}') -> str:
v3 = v1.total_seconds()
v4 = {'u': v1.microseconds, 'ms': int(v1.microseconds / 1000), 's': int(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ArgumentParser
Output Type: None
Dependencies:
```python
def v0(v1: ArgumentParser, v2: logging.Logger) -> None:
plugin.on_connecting_parser(parser=v1, logger=v2)
v1.add_argument('--daemon-host', help='Host the daemon is running on', type=str,... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = typing.List[typing.List[typing.Union[str, int]]]
```
Input Types: commands.Context, v0, v0, int, int
Output Type: bool
Dependencies:
Function Name: v1
Function:
```python
async def v1(self, v2: commands.Context, v3: v0, v4: v0, v5: int, v6: int) -> ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self._unsubscribed_future.done():
self._unsubscribed_future.set_result(True)
``` |
Imports:
```python
import shutil
import typing
```
Type definitions:
Input Types: Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path):
v2 = [each.resolve() for v3 in v1.rglob('__pycache__')]
for v3 in v2:
shutil.rmtree(v3, ignore_errors=True)
``` |
Imports:
```python
import json
import subprocess
import typing
```
Type definitions:
Input Types: str, str
Output Type: typing.Mapping
Dependencies:
```python
@functools.lru_cache(maxsize=8)
def v0(v1: typing.Optional[str]=None, v2: bool=False) -> typing.List[typing.Mapping]:
v3 = list(make_cmd_itr(path=v1, outdat... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Text
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: Text):
v4 = self.all_hypers[v3]
for v5 in v1:
if v5 in v4:
v2.append(v5)
self.get_all_hypers(v4[v5], ... |
Imports:
```python
import logging
import torch
from torch import nn
from torch.optim import AdamW, SGD, Optimizer
import typing
```
Type definitions:
```python
@dataclass
class v0(FromParams):
v1: ParameterSet
v2: str
v3: Dict[str, Any]
v4: bool = False
v5: bool = False
```
Input Types: torch.nn.Mod... |
Imports:
```python
from datetime import date, datetime, time, timedelta, timezone
import typing
```
Type definitions:
Input Types: int, datetime
Output Type: float
Dependencies:
```python
def v0():
return datetime.now(timezone.utc)
```
Function Name: v1
Function:
```python
def v1(v2: int, v3: datetime=None) -> flo... |
Imports:
```python
import json
import os
import typing
```
Type definitions:
```python
v0 = List[CharaDict]
```
Input Types: miniamf.sol.SOL, v0, argparse.ArgumentParser, argparse.Namespace
Output Type: None
Dependencies:
```python
def v1(v2: miniamf.sol.SOL, v3: str, v4: bool):
v5: str = v3
if not v4:
... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, str, Optional[List[str]], Optional[List[str]]
Output Type: List[str]
Dependencies:
```python
def v0(v1: str, v2: str, v3: str) -> List[str]:
v2 = v2.upper()
v4 = '{}/v1{}'.format(v3, v1)
v5 = ['GET', 'POST', 'DELETE', 'PUT... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Type[numpy.ndarray]
```
Input Types: Callable, dict, Tuple[v0], Tuple[v0]
Output Type: float
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Callable, v3: dict, v4: Tuple[v0], v5: Tuple[v0]) -> float:
v2.train(*v4, **self.kw... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = False
for v2 in self._to_list():
if v2 is None:
v1 = True
else:
if v1:
raise RuntimeErro... |
Imports:
```python
import os
import re
import typing
```
Type definitions:
Input Types: Text, 'SkillSelector'
Output Type: Tuple[Set[Text], Set[Text]]
Dependencies:
```python
def v0(v1: Text) -> bool:
v2 = '\\s*##\\s*(intent|regex||synonym|lookup):'
return re.match(v2, v1) is not None
```
```python
def v3(v4: ... |
Imports:
```python
import glob
import os
import typing
```
Type definitions:
Input Types: Any, bool, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: bool=False, v3: bool=False):
if v2:
v4 = ['.pth', '_stats.jgz', '_opt.pth']
else:
v4 = ['.pth']
for ... |
Imports:
```python
import os
import requests
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2: str, v3: str):
self.fullPath = v2
self.relPath = v3
v4 = v1['model']
self.type = v4['type']
self.params = {}
v5 = os.path.basename(v2)
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float, float, float, float, float, int
Output Type: Tuple[np.ndarray, np.ndarray, np.ndarray]
Dependencies:
```python
def v0(v1: float, v2: float, v3: float, v4: float, v5: float, v6: float) -> Tuple[float, float, float]:
v7 = -... |
Imports:
```python
import cv2
import pickle
import typing
```
Type definitions:
Input Types: Any, Any, Any, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3, v4: bool=False):
if isinstance(v1, str):
with open('trained_{}.pkl'.format(v1), 'rb') as v5:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, float, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=None, v2: float=None, v3: int=None) -> int:
v1 = self.get_and_verify_pulse_ms(v1)
v2 = self.get_and_verify_pulse_power(v2)
v4 = self... |
Imports:
```python
import csv
import typing
```
Type definitions:
```python
v0: TypeAlias = dict[str, str]
```
Input Types: Iterable[v0], Path, Sequence[str]
Output Type: NoReturn
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Iterable[v0], v3: Path, v4: Sequence[str]) -> NoReturn:
with v3.op... |
Imports:
```python
import torch
from torch.nn import ParameterDict, Parameter
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor):
v2 = torch.zeros((self.partial_rank, self.partial_rank))
for v3 in ra... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
```python
@functools.lru_cache(maxsize=None)
def v0(v1: int, v2: int, v3: int) -> int:
if v3 == 0:
return 1
v4 = 0
for v5 in range(1, 10):
if v1 & 1 << v5 == 0:
if (v2, v5... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=0, v2: str='subplot_inversion'):
self.open_subplot_figure(number_subplots=6)
self.figures_2d_of_mapper(mapper_index=v1, reconstructed_image=Tru... |
Imports:
```python
import collections
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
v2 = collections.Counter(v1).most_common()
(v3, v4) = v2[0]
if v4 << 1 > len(v1) + 1:
return ''
v5 = [No... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3, v4) -> None:
super().collect_additional_context(v1, v2, v3, v4)
v1.payload = v4
v1.language = v4.language
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, str
Output Type: Tuple[int, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: str) -> Tuple[int, int]:
v3 = v1.get(f'model.backbone.{v2}.max_stride', None)
v4 = v1.get(f'model.backbone.{v2}.output_stride', No... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self):
self.root = MerkleDirectory('root')
def __repr__(self) -> str:
return str(self.root)
def v1(self, v2: v0) -> None:
print('Syncing computers...')
self.root.synchronize(v2.root)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
```python
def v0(v1: float) -> float:
print('lolercode\\n')
v2: int = 4
return v1 * v2
```
Function Name: v3
Function:
```python
def v3() -> int:
print('%f\\n', v0(2.123))
print('Hello, World!\\n')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: typing.List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> typing.List[str]:
v1: typing.List[str] = []
for v2 in range(self._addressCount):
v1.append(self.getUsingIntegerAddress(v2).toString())
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: datetime, Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: datetime, v2='created') -> int:
v3 = 0
for v4 in self.find_after(v1, v2):
with self._lock:
self.db.pop(v4.uuid)
v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ContextVar, Any
Output Type: ContextManager[None]
Dependencies:
```python
@contextmanager
def v0() -> Iterator[None]:
yield
var.reset(token)
```
Function Name: v1
Function:
```python
def v1(v2: ContextVar, v3: Any) -> ContextManager[None]:
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Tuple[int, int, int]
```
Input Types: int
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: int) -> v0:
v3 = self.fix_index(v2)
return self.color_to_tuple(self._color_map[v3])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: str) -> int:
if v1 < len(v2):
return len(v2)
else:
return v1
``` |
Imports:
```python
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Union[Tuple[int, int], np.ndarray], np.ndarray, Optional[float], float, float, int
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray, v2: np.ndarray, v3: np.ndarray) -> np.ndarray:
asse... |
Imports:
```python
import typing
```
Type definitions:
Input Types: typing.Collection[bytes]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: typing.Collection[bytes]):
v2 = self.modules_hashes_local_cache.GetHashIdsToHashes(hashes=v1)
v3 = {hash for (v4, v5) in v2.items()... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2=True):
v3 = v1.split('.', maxsplit=1)[0]
if self._can_implicitly_extern(v3):
if self.verbose:
print(f'implicitly adding... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.replaced_observation
if v1 is not None:
for v2 in v1.observationcomment_set.all():
v2.observation = self
v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: metadata_store_pb2.Value, Union[str, int, float]
Output Type: metadata_store_pb2.Value
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: metadata_store_pb2.Value, v2: Union[str, int, float]) -> metadata_store_pb2.Value:
if isinstance... |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: t.Any) -> str:
if v1 is None:
return 'None'
elif v1 is Ellipsis:
return 'Ellipsis'
v2 = type(v1)
if v2.__module__ == 'builtins':
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Tuple[Any, ...]]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[Tuple[Any, ...]]) -> None:
v2 = self.connection.cursor()
v3 = ', '.join(['?'] * len(self.columns))
v2.executemany(f'INSERT I... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('ItemType')
```
Input Types: Iterator[v0], datetime, Callable[[v0], datetime]
Output Type: Optional[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Iterator[v0], v3: datetime, v4: Callable[[v0], datetime]) -> Optional[v0]:... |
Imports:
```python
import cvxpy as cp
from cvxpy.atoms.affine.add_expr import AddExpression
from cvxpy.expressions.variable import Variable
from cvxpy.expressions.constants import Constant
from cvxpy.expressions.constants import Parameter
from cvxpy import Problem, Minimize
import cvxpy.interface.matrix_utilities as in... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str):
v4 = re.compile(v2, re.IGNORECASE)
return v4.sub(v3, v1)
``` |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1) -> bool:
v2 = re.compile('.+/system/.+/(\\d{10}).algo-\\d+.json')
v3 = re.match(v2, v1)
if v3 is None:
logger.debug(f'Invalid System Profiler File Found: {v1}, not a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> List[str]:
v2 = [v1]
v3 = v1.split('/')
(v4, v5) = v3[-2:]
if v4.split('.')[1].startswith('v'):
v4 = v4.replace('.v', '.', 1)
... |
Imports:
```python
from math import pi
import typing
```
Type definitions:
Input Types: float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float) -> float:
v2 = pi / 180.0
return v1 % 360.0 * v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Iterable[float]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str) -> Iterable[float]:
await self._htcondor_status.update_status()
try:
v2 = self._htcondor_status[v1]
return [float... |
Imports:
```python
import typing
```
Type definitions:
Input Types: re.Match
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: re.Match):
v2 = ''
v3 = v1.group(0)
if v3 == '%p':
v2 = self.period.value
elif v3 == '%P':
v2 = self.period.description
elif ... |
Imports:
```python
import sys
from getpass import getpass
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Optional[str]:
if not sys.stdin.isatty():
return None
return getpass(v1, self.output)
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if all((p.idle for v1 in self._outputs.values())):
self.access_token = None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
if self.helper_indexer:
return self.helper_indexer._num_chunks_in_doc[v1]
else:
self.logger.warning('enable helper_indexer to trac... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(DateCellBase, Label):
def __init__(self, v1: int, v2: str, v3: int, v4: bool=True, **v5):
super(v0, self).__init__(v1, v2, v3, v4, **v5)
self.text = str(v2) if v4 else f'{v3}/{v2}'
def v6(self, v7: KivyRgbaColor):
... |
Imports:
```python
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import Normalize
from statsmodels.tsa.arima_model import ARIMA
from statsmodels.tsa.stattools import acf, pacf
from statsmodels.tsa.stattools import adfuller
import statsmodels.api as sm
import typing
```
Type definitio... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: str):
v3 = {'tags': ['wireless', 'configure', 'ssids', 'trafficShaping', 'rules'], 'operation': 'getNetworkWirelessSsidTrafficShapingRul... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, set
Output Type: Any
Dependencies:
```python
def v0(self, v1, v2):
v3 = func(self, v1, v2)
output.update(v3)
return v3
```
Function Name: v4
Function:
```python
def v4(v5, v6: set):
def v7(self, v8, v9):
v10 = v5(self, v8... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: type
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> type:
if isinstance(v1, type):
return v1
return type(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> int:
v2 = 0
for v3 in v1:
if not v3.isspace():
return v2
v2 += 1
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, List[case.TestCase]
Output Type: List[dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: List[case.TestCase], **v3) -> List[dict]:
v4 = list()
for v5 in v2:
v4.append(self.run_single(v1, v5, **v3)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: any):
self[v1] = str(v2)
return dict(self)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[str]
Output Type: int
Dependencies:
```python
def v0(v1: dict[tuple[int, int], int]) -> tuple[dict[tuple[int, int], int], int]:
v2 = set()
v1 = {pos: value + 1 for (v3, v4) in v1.items()}
for v3 in [v3 for (v3, v4) in v1.items() i... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Path
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path) -> bool:
with open(v1, 'w') as v2:
json.dump(self.get_settings(), v2)
return True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
v2: Search = self
v2.url = v1
``` |
Imports:
```python
import json
import logging
import typing
```
Type definitions:
Input Types: dict, dict, dict, dict, str
Output Type: Optional[str]
Dependencies:
```python
def v0(v1: dict, v2: dict, v3: str='en') -> Optional[str]:
v4 = str(v1['exponent']).replace('-', '')
v5 = v2.get(v4)
if not v5:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: gears.GearHeadCampaign, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: gears.GearHeadCampaign, v2):
if self.eplot:
v3 = self.eplot.get_road_adventure(v1, v2)
if v3:
return v3
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> str:
if len(v1) > len(v2) and v1[-len(v2):] == v2:
v1 = v1[:-len(v2)]
return v1
``` |
Imports:
```python
from collections import deque
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=None, v3=None):
self.val = v1
self.left = v2
self.right = v3
```
Input Types: v0
Output Type: bool
Dependencies:
Function Name: v4
Function:
```python
def v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2: list[str] = []
for v3 in v1.split('_'):
v4 = list(v3)
v4[0] = v4[0].upper()
v2.append(''.join(v4))
return ''.join... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str):
v4 = requests.get('https://api.weixin.qq.com/sns/jscode2session', {'appid': v1, 'secret': v2, 'js_code': v3, 'gr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str, Path
Output Type: Path
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str='', v3: Path='') -> Path:
v1 = int(v1)
v4 = self.story_info(v1)
v5 = v4.thumbnail_url if v4.media_type == 1 else v4.video_u... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: Union[Path, str]
Output Type: str
Dependencies:
```python
def v0(v1: Optional[bytes]) -> str:
if not v1:
return ''
return v1.decode('utf-8')
```
Function Name: v2
Function:
```python
def v2(self, v3: Union[Path, str])... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
v2 = len(self.blocks.index_set())
v3 = self._financial_model.value('dispatch_factors_ts')
v4 = self._financial_model.value('ppa_price_input')[... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = List[Dict[str, Any]]
```
Input Types: v0, Iterable[str], str, str, str
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0, v3: Iterable[str], v4: str, v5: str, v6: str):
v7 = []
for v8 in v2:
v7.append... |
Imports:
```python
import base64
import typing
```
Type definitions:
Input Types: bytes
Output Type: bytes
Dependencies:
```python
def v0(v1: bytes) -> bytes:
v2 = v1.decode('ascii')
v3 = signxml.util.add_pem_header(v2)
v4: bytes = v3.encode('ascii')
return v4
```
Function Name: v5
Function:
```python
... |
Imports:
```python
import ssl
from pathlib import Path
import typing
```
Type definitions:
Input Types: str, str, Optional[str], bool, bool, ssl.Purpose
Output Type: ssl.SSLContext
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: Optional[str], v4: bool, v5: bool, v6: ssl.Purpose) -> s... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list:
v1 = self.parse_classes()
v2 = self.parse_enz_data_file()
v1.update(v2)
self.build_tree(v1)
return list(v1.values())
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: dict
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> np.array:
(v2, v3) = (len(v1), len(v1))
v4 = np.array([[0 for v5 in range(0, v2, 1)] for v6 in range(0, v3, 1)])
v7 = 0
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, bool
Output Type: Any
Dependencies:
```python
def v0(v1: np.ndarray) -> np.ndarray:
v2 = v1[:, 1] - v1[:, 0]
v3 = v2.max()
v4 = v1.mean(1)
v5 = v4 - v3 / 2
v6 = v4 + v3 / 2
return np.concatenate((v5.resh... |
Imports:
```python
import requests
from requests.structures import CaseInsensitiveDict
import typing
```
Type definitions:
Input Types: str, str, str, str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str, v4: str) -> dict:
v5 = f'https://cloud.getdbt.com/api/v... |
Imports:
```python
import pathlib
import typing
```
Type definitions:
Input Types: typing.Union[builtins.str, pathlib.Path]
Output Type: typing.Tuple[pathlib.Path, builtins.str, builtins.str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: typing.Union[builtins.str, pathlib.Path]) -> typing.Tuple[pathl... |
Imports:
```python
from itertools import takewhile, islice, repeat
import typing
```
Type definitions:
```python
v0 = TypeVar('U')
```
Input Types: Iterable[v0], Any
Output Type: Iterator[List[v0]]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Iterable[v0], v3) -> Iterator[List[v0]]:
v4 = iter(v2)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame) -> pd.DataFrame:
v2 = v1.isnull().sum(axis=0).tolist()
v3 = v2.index(max(v2))
v4 = v1.drop(v1.columns[v3], axis=1)
ret... |
Imports:
```python
import zlib
import typing
```
Type definitions:
Input Types: str, str, Any, bool
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2=None, v3: bool=True):
if v2 is None:
v2 = get_client()
v4 = v2.get_object(Bucket=S3_BUCKET, Key=v1)
v5 = v4['Body'].read()
if v3:
... |
Imports:
```python
import os
import pipes
import sys
import typing
```
Type definitions:
Input Types: str, bool, bool
Output Type: None
Dependencies:
```python
def v0(v1: bool, v2: list, v3: dict=None, v4: str='+ ') -> None:
v5 = []
if v3 is not None:
v5.extend(['env'] + [_quote('%s=%s' % (k, v)) for (... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, Dict[str, Type[enum.Enum]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: Dict[str, Type[enum.Enum]]):
for (v3, v4) in v2.items():
if v3 not in v1:
continue
v5 = v1[v3].... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> int:
(v3, v4) = v1.get_pos()
(v5, v6) = v2.get_pos()
return abs(v3 - v5) + abs(v4 - v6)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Any) -> None:
assert v1 in self._settings_supported_values, f'setting {v1} is not supported'
v3 = self._settings_supported_values[v1]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.