text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: Mol, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Mol, v2: str) -> bool:
v3 = [s.lower() for v4 in v2.lower().split()]
if 'in' in v3:
return self._eval_set_expr(v1, v2)
return self._ev... |
Imports:
```python
import typing
```
Type definitions:
Input Types: grammar.Var
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: grammar.Var) -> None:
if v1.initializer:
v2 = self._evaluate(v1.initializer)
else:
v2 = None
self._environment.define(v1.na... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: list, list
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: list) -> dict:
v3 = {}
for v4 in v1:
if not v4 == '' and (not v4.startswith('#')):
v5 = v4.split(';')[1].strip... |
Imports:
```python
import datetime as dt
import typing
```
Type definitions:
Input Types: dc.Member
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dc.Member) -> bool:
if v1 not in self._suspects:
return False
v2 = self._suspects[v1]
v3 = v2 + self._probation... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Tuple[Text, Text]]
Output Type: List[Text]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[Tuple[Text, Text]]) -> List[Text]:
v2: Set[Text] = set()
v3: List[Text] = []
v4: List[Text] = []
for (v5, (v6, v... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, Any, Any, Any, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3, v4, v5, v6, v7, v8) -> str:
if isinstance(v3, datetime):
v3 = v3.isoformat(... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
v1 = os.path.abspath(v1)
if os.path.exists(v1) and os.path.isdir(v1):
self.shell('cd %s' % v1)
os.environ['PWD'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> int:
v2 = sorted(v1)
v3 = 0
for v4 in range(len(v2) - 1):
v5 = v2[v4 + 1] - v2[v4]
v3 = v5 if v5 > v3 else v3
v6 = 360 + v2[0]
... |
Imports:
```python
import numpy as np
import sys
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray):
v2 = self._prox.value(v1)
if v2 == sys.float_info.max:
return np.inf
else:
return ... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import typing
```
Type definitions:
Input Types: torch.Tensor, Optional[torch.ByteTensor]
Output Type: List[List[int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, MySQLdb.cursors.DictCursor
Output Type: Set[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: MySQLdb.cursors.DictCursor) -> Set[int]:
v2.execute("\n SELECT\n ub.user_id\n FROM\n ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[Any], bool
Output Type: Generator
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[Any], v2: bool=False) -> Generator:
for (v3, v4) in enumerate(v1):
if (not v4, v4)[v2]:
yield v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2, v3):
v2 = self.set_id(v1, v2, v3, 'server-technologies', 'serverTechnologyDisplayName')
v4 = f'asm/policies/{v1}/server-technologies/... |
Imports:
```python
from collections import deque
import torch
import torch.nn as nn
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:
assert v1.shape[-4] == self.n_past_frames,... |
Imports:
```python
from json import dumps, loads
import typing
```
Type definitions:
Input Types: str, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: Any) -> str:
v3 = self.normalize_path(v1)
v4 = f'{v3}.detectors.txt'
v5 = dumps(v2)
return awa... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=0):
if self._vf_xyz is not None:
if self._vf_xyz_axis == v1:
return self._vf_xyz
else:
return... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Protocol):
def __call__(self, *v1: Any) -> Any:
pass
```
Input Types: v0
Output Type: List[Dict[Text, Text]]
Dependencies:
```python
def v2(v3: List[Text]) -> List[Text]:
v4 = []
try:
v5 = [x.strip() for v6 in v3].ind... |
Imports:
```python
import os
from ..datasets.utils import check_integrity, dataset_split, extract_archive
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = []
for v2 in [self.image_root, self.labels_root]:
... |
Imports:
```python
import gzip
from collections import defaultdict
import logging
import typing
```
Type definitions:
Input Types: str
Output Type: tuple
Dependencies:
```python
def v0(v1: list) -> dict:
return dict((i for v2 in zip(log_format, v1)))
```
```python
def v3(v4: list, v5='') -> str:
v5 = ' '.join(... |
Imports:
```python
from datetime import datetime, time, tzinfo, timezone
import typing
```
Type definitions:
Input Types: int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: int=0) -> None:
v3 = datetime.utcnow()
v4 = await self._next_outgoing_seqnum(... |
Imports:
```python
import threading
import typing
```
Type definitions:
Input Types: threading.Event
Output Type: threading.Event
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: threading.Event) -> threading.Event:
assert isinstance(v1, threading.Event), print('Positional argument <is_set> is type ... |
Imports:
```python
import importlib
import json
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str='v1_module') -> str:
with importlib.resources.path('sbfmt', 'formats') as v2:
with open(v2.joinpath(v1)) as v3:
... |
Imports:
```python
import itertools
import operator
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11):
self.langpair = v1
self.model_name = v2
self.corpus = v3
self.decoding_method = v4
self.sampl... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = dict(self.config.items('Inverter')) if 'Inverters' in self.config else {}
v1['charging_power_limit'] = self.config['Inverter'].getfloat('chargin... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Set[tuple]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> Set[tuple]:
v2 = [-1, 0, 1]
(v3, v4) = (set(), set())
for v5 in v2:
for v6 in v2:
for v7 in v2:
if (v5,... |
Imports:
```python
import tarfile
import typing
```
Type definitions:
Input Types: str, str, Optional[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: Optional[str]) -> None:
with tarfile.open(v1, f'r:{v3[1:]}' if v3 else 'r') as v4:
v4.extractall(v2)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
if v1 < 2:
return False
if v1 <= self.search_max:
return v1 in self.values
print(f'{v1} exceeds search max ({self.sea... |
Imports:
```python
import typing
```
Type definitions:
Input Types: object, object, object, object
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: object, v2: object, v3: object, v4: object):
self.communication_manager = v2
self._dataset_manager = v4
v5 = v1.get_confi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None) -> str:
v2 = self._api_url
if not v2.endswith('/'):
v2 += '/'
if v1:
v2 = v2 + v1
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor) -> torch.Tensor:
v2: torch.Tensor = v1.repeat(3, *[1] * (v1.dim() - 1))
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = dict(localization='false', tickers='false', sparkline=True)
return self.client.get_coin_by_id(self.coin_symbol, **v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: [float]
Output Type: [float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: [float]) -> [float]:
v2 = sum(v1)
if v2 == 0:
v2 = 1
return [v / v2 for v3 in v1]
``` |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
try:
v2 = int(v1)
v3 = int(math.sqrt(v2))
for v4 in range(2, v3 + 1):
if v2 % (v4 * v4) == 0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: [pd.DataFrame, pd.Series]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool=None) -> [pd.DataFrame, pd.Series]:
if self.is_event_book(book_name=v1):
return self.__book_catalog.get(v1... |
Imports:
```python
import json
import re
import typing
```
Type definitions:
Input Types: dict
Output Type: Set[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> Set[str]:
v2 = json.dumps(v1)
v3 = set(re.findall('\\$\\(([-._a-zA-Z0-9]+)\\)', v2))
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Dict[str, Any]
```
Input Types: str, str, float, str, Optional[str], Optional[bool], Optional[Mapping[str, BinaryIO]], bool, datetime.timedelta
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, *, v2: str, v3: str, v4:... |
Imports:
```python
from collections import deque
import numpy as np
import typing
```
Type definitions:
```python
v0 = Tuple[Network, StepSizes, RateConverters, InitialTokens]
```
Input Types: v0, Fraction
Output Type: sdf.Results
Dependencies:
```python
def v1(v2, v3, v4):
v5 = v2.denominator * v3.numerator
v6... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(so.InheritingObjectBase, derivable.DerivableObjectBase, s_abc.Type):
v1 = so.SchemaField(ViewType, default=None, compcoef=0.909)
v2 = so.SchemaField(bool, default=False, compcoef=None)
v3 = so.SchemaField(s_expr.Expression, default=No... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict):
v2 = self.conn.subreddit(self.subreddit)
(v3, v4) = self._parse_show_info(v1['competitionGuid'])
v2.submit(v3, selftext=v4)
``` |
Imports:
```python
import polars as pl
from polars import testing
from polars.datatypes import Float64, Int32, Int64, UInt32, UInt64
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: pl.Series, v2: pl.Series, v3: str, *v4: Any, **v5: Any) -> None:
v6 = _getattr_... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray) -> np.ndarray:
assert v1.ndim == 2 and np.all(v1 >= 0.0)
v2 = v1 / v1.sum(axis=1, keepdims=True)
return np.argmax(np.cumsum(v2, axis=1) > np.ra... |
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 hasattr(self, '_current_row_index') or v1 != self._current_row_index:
if v1 > -1 and v1 < self.rowCount():
v2 = se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1='r+') -> str:
if 'r' not in v1:
raise ValueError('you must read (r) from the file')
with open(self.filename, 'r+') as v2:
v3 = v2.read()
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: T.List[str], T.List[str]
Output Type: T.List[str]
Dependencies:
```python
def v0(v1: str) -> T.Tuple[int, int]:
v2: T.List[int] = []
for v3 in refpaths:
try:
v4: str = os.path.commonpath([v1, v3])
except V... |
Imports:
```python
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 = 0
v4 = 0
for v5 in v1:
v3 += v2 + (0 if v4 <= v5 else v5 - v4)
v4 = v5 + v2
return v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: aioxmpp.Presence
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: aioxmpp.Presence) -> None:
if self.approve_all:
self.roster.approve(v1.from_.bare())
else:
self.on_subscribe(str(v1.from_)... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Tuple[str, Optional[List[Any]]]
```
Input Types: v0
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> v0:
(v3, v4) = v2
if v4 is None:
return self.expand_node(v2)
v5 = [c for v6 in v4 if ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
for v2 in range(len(v1), 0, -1):
v3 = 0
while v3 + v2 <= len(v1):
print(v1[v3:v3 + v2])
if v1[v3:v3 + v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: DataFrame, dict
Output Type: DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: DataFrame, v2: dict) -> DataFrame:
v1.loc[(v1['cci_one'] < -100) & (v1['cci_two'] < -100) & (v1['cmf'] < -0.1) & (v1['mfi'] < 25) & (v1['r... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame, pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: pd.DataFrame):
v3 = pd.DataFrame(v1)
v3['delta'] = v1[0] - v2[0]
v3.columns = ['doi', 'delta'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Tuple[int, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> Tuple[int, int]:
for v3 in range(len(v1)):
v4 = v1[v3]
for v5 in v2:
v6 = v5.mark(v4)
if v6:
... |
Imports:
```python
import seaborn as sns
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: Union[List, np.ndarray], Any, Any, Any, float, float, Optional[List[str]], Optional[List[str]], Optional[plt.Axes]
Output Type: plt.Axes
Dependencies:
Function Name: v0
Function:
```python
def v0(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = v1.split('-')
v3 = v2[-1]
v4 = v2[-2]
v5 = '-'.join(v2[:-2])
return (v5, v4, v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2=None) -> bool:
if not self.config.has_section(v1):
return False
if v2:
return self.config.has_option(v1, v2)
return True
``... |
Imports:
```python
from math import pi
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
try:
for v1 in self._rplidar.iter_scans(scan_type='express', max_buf_meas=3500):
v2 = tuple(((angle * pi / 180, d... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Any], List[int]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[Any], v2: List[int]):
for (v3, v4) in zip(v1, v2):
v3.setValue(v4)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
v2: bool = False
if self.config_json['include_custom'].lower() == 'true':
if v1.find(self.config_json['custom_prefix']) >= 0:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Dict, int
Output Type: Tuple[Dict, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict, v2: int=300) -> Tuple[Dict, np.ndarray]:
v3 = len(v1)
v4 = np.random.uniform(-0.25, 0.25, size=(v3, v2))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
@property
def v0(self) -> logging.Logger:
return self._design.logger
```
Function Name: v1
Function:
```python
def v1(self, v2: str=None):
v3 = self._is_name_used(v2)
if self._design.overwrite_e... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> list:
v2 = []
for (v3, v4) in v1.items():
if isinstance(v4, dict):
v2.extend((f'{v3}.{vk}={vv}' for (v5, v6) in v4.items()))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
self.remote_name = v1['remote_name']
self.category_id = v1['category_id']
self.brand_id = v1['brand_id']
self.remote_index = v1['remote_... |
Imports:
```python
from copy import deepcopy
import typing
```
Type definitions:
Input Types: Union[Dict, Any], Dict[str, Any], str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: Union[Dict, Any], v2: Dict[str, Any]=None, v3: str='set', *v4: Any, **v5: Any) -> None:
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: libzfs.ZFSDataset, str
Output Type: typing.Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: libzfs.ZFSDataset, v2: str) -> typing.Optional[str]:
try:
v3 = v1.properties[v2]
return str(v3.value)
... |
Imports:
```python
import os
import os.path as osp
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> List[str]:
v2 = []
for (v3, v4, v5) in os.walk(v1, topdown=True):
v2.extend([osp.join(v3, f) for v6 in v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[str], Optional[Dict]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[str]=None, v3: Optional[Dict]=None):
v4 = 'search/venue'
v5 = self._get_api_auth_token()
v6 = {'q':... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> str:
v2 = round(v1 / 1000)
(v3, v2) = divmod(v2, 60)
(v4, v3) = divmod(v3, 60)
return '%d:%02d:%02d' % (v4, v3, v2) if v4 else '%d:%02d' % (v3... |
Imports:
```python
import re
import math
import collections
import typing
```
Type definitions:
Input Types: Any
Output Type: List[Tuple[str, str, float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> List[Tuple[str, str, float]]:
v2 = set()
v3 = collections.defaultdict(list)
v1 ... |
Imports:
```python
import numpy as np
import re
import torch
from rdkit import Chem
import typing
```
Type definitions:
Input Types: Any, bool
Output Type: Any
Dependencies:
```python
def v0(v1):
v2 = []
v3 = []
v4 = []
v5 = []
for (v6, v7, v8) in v1:
(v9, v10) = get_seq_features_per_miniba... |
Imports:
```python
import inspect
import typing
```
Type definitions:
Input Types: AnnotationInfo
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: AnnotationInfo) -> Dict[str, Any]:
v2 = inspect.signature(v1.arg)
v3 = list(v2.parameters.keys())
if len(v1.metadata)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple):
self.peers_lock.acquire()
self.peers.add(v1)
self.refresh_peer_life(v1)
self.peers_lock.release()
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('_S', bound=HasIRI)
```
Input Types:
Output Type: Iterable[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(self) -> Iterable[v0]:
for (v2, v3) in self._ent_enc.items():
yield v3
``` |
Imports:
```python
from typing import Any, Dict, List, Union, get_type_hints
import typing
```
Type definitions:
Input Types: object
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: object) -> Dict:
try:
v2 = {x: v for (v3, v4) in v1.__dict__.items() if not v3.startswith('_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: int, v4: int, v5: int):
if v2 == v3:
self.sum[v1] += v5
return
v6 = (v2 + v3) // 2
if v4 <= v6... |
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 = self.__session.get(v1)
v3 = None
if v2.ok:
v3 = v2.text
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[str]
Output Type: Union[str, List[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[str]=None) -> Union[str, List[str]]:
assert type(v1) == str
if self.test_mode:
v1 = 'test'
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: argparse.ArgumentParser
Output Type: argparse.ArgumentParser
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: argparse.ArgumentParser) -> argparse.ArgumentParser:
v1.add_argument('--num_threads', action='store', help="\nNumber of th... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> bool:
if not self.ser.is_open:
self.logger.error('Serial connection with Temperature Controller was not opened.')
return False
v1 = a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
v2 = len(v1)
if v2 > 2:
v3 = 0
v4 = 0
v5 = 0
v6 = 0
for v7 in range(1, v2 - 1):
if v1[v7] =... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Generic[InT, OutT]):
v1: int = 0
v2: threading.Lock = threading.Lock()
v3 = context_operators
v4: str
v5: Ops
v6: int
v7: Callable
v8: Callable
v9: ParamServer
v10: Dict[str, Optional[int]]
v11: List['M... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclasses.dataclass
class v0:
v1: str
v2: LintRuleClass
v3: str
v4: str
v5: str
v6: Callable
v7: Optional[Callable] = None
v8: Optional[Callable] = None
v9: Optional[concurrent.futures.Future] = None
def v10(sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any):
if isinstance(v1, tuple):
return ' or '.join([x.__name__ for v2 in v1])
else:
return v1.__name__
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Set[str]
Output Type: Tuple[Dict[str, str], Dict[str, str], Set[str]]
Dependencies:
```python
def v0(v1: str) -> str:
v2 = 'class '
v3 = '('
(v4, v5) = (v1.find(v2) + len(v2), v1.find(v3))
return v1[v4:v5]
```
```python
def v6(v7: str)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Optional[dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> Optional[dict]:
if self.type == 'array':
v2 = dict(v1)
v2.update(v1['items'])
return v2
elif self.schema.ge... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
self._updateQuota()
if self.quota < 1:
return False
self.quota -= 1
return True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path):
v2 = v1 / 'envs' / 'viper_base'
assert v2.exists()
v3 = v2 / 'bin'
assert v3.exists()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if v1 in self._tasks:
del self._tasks[v1]
self.log.debug('Removed registered task: {}'.format(v1))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[docutils.nodes.Node, List[docutils.nodes.Node]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[docutils.nodes.Node, List[docutils.nodes.Node]]):
if not isinstance(v1, list):
v1 = [v1]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
v2 = self.field[v1]
return not self.contains_duplicated_numbers(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.finish_output()
self.emit('formatter_done')
``` |
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(self, v1=None, *v2, **v3) -> np.ndarray:
v4 = 2 * np.pi / (2 * self.number_rays)
if self.visualize:
self.set_ray_positions(v1, s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Iterable[Model]', str, Tuple[Optional[str], 'QuerySet']
Output Type: 'Iterable[Model]'
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: 'Iterable[Model]', v2: str, v3: Tuple[Optional[str], 'QuerySet']) -> 'Iterable[Model]':... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int=0, v3: str=' '):
with open(v1, 'r') as v4:
v5 = v4.readlines()[v2]
v5 = v5.strip().split(v3)
self.text = v5
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None) -> List[str]:
if v1:
v2 = self.loc[:, v1].columns
return sorted(v2)
return sorted(self.columns.get_level_values(1).uniqu... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[int, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Dict[int, int]:
with open(v1) as v2:
v3 = [int(x) for v4 in v2.read().split(',')]
v5 = defaultd... |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: Any, Any, str, list, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: str, v4: list, v5: list):
v6 = np.concatenate(v4, 1)
v7 = np.concatenate(v5, 1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = 0
for v2 in self.tracks:
v3 = v2.get_length()
if v1 < v2.get_length():
v1 = v3
return v1
``` |
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=True):
v3 = self._mysql_query_subcmd.replace('%query%', v1) if v1 else ''
return self._fill_template(self._mysql_restore_cmd, use... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = NestedDict[str, PagingList]
```
Input Types: List[Tuple[str, ...]]
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: List[Tuple[str, ...]]) -> v0:
v3: v0 = {}
for v4 in v2:
v5 = v3
for v6 in... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Optional[str], str
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[str], v2: str) -> Optional[str]:
if v1 is None:
v1 = os.environ.get(v2)
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self.tags or not len(self.tags):
self._l_analysis = []
return
v1 = self.get_candidate_matches()
if not v1 or not len(v1):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.