text stringlengths 190 325k |
|---|
Imports:
```python
import torch
import torch.distributions as dist
import numpy as np
from scipy.special import gamma, digamma
from scipy.optimize import minimize_scalar
import typing
```
Type definitions:
Input Types: float, int, float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(sel... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: float
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: float) -> None:
self._waiting_for_ack = asyncio.Future(loop=self.loop)
try:
await asyncio.wait_for(self._waiting_for_ack... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: 'AEABuilder'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> 'AEABuilder':
self._ledger_apis_configs.pop(v1, None)
return self
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Dict], Dict[str, Dict]
Output Type: Dict[str, Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Dict], v2: Dict[str, Dict]) -> Dict[str, Dict]:
v3 = {}
v3.update(v1)
for v4 in v2:
if v4 in v3... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Solution):
def __init__(self, v1: Problem, v2: Dict[int, int], v3: Dict[int, Dict[str, int]], v4: Dict[int, Dict[int, Set[str]]]):
self.problem: MS_RCPSPModel = v1
self.modes = v2
self.schedule = v3
self.emplo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False):
if v1:
self.from_arg()
self.from_environ()
else:
self.from_environ()
self.from_arg()
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: float, v2: float, v3: torch.Tensor) -> torch.Tensor:
return 1 / (1 + (v2 * (1 - v3) / v3) ** v1)
```
```python
def v4(v5: torch.Tensor, v6: torch.Tensor) -> torch.Tensor:
v7 = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: list) -> list:
v3 = []
for v4 in v2:
v5 = int(v4[0].index('(')) + 1
if not v4[0][v5:v5 + 4].isdigit():
continue
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: bool=True):
if v2:
v3 = self.hdurl or self.url
else:
v3 = self.url
if not (v3.startswith('http://apod.nasa.gov'... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = '; '.join((f'{type(f).__name__}(first: {f.first}, last: {f.last})' for v2 in self._funnels))
v1 += f', offset: {self.offset}'
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=None):
self.val = v1
self.next = v2
def v3(self):
v3('Node(' + str(self.val) + ')', end='')
if self.next is not None:
v3(' -> ', end='')
self.next.prin... |
Imports:
```python
import csv as csvlib
from pandas._libs import writers as libwriters
from pandas._typing import CompressionOptions, FilePathOrBuffer, FloatFormatType, IndexLabel, Label, StorageOptions
from pandas.core.dtypes.generic import ABCDatetimeIndex, ABCIndexClass, ABCMultiIndex, ABCPeriodIndex
from pandas.cor... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
```python
def v0(v1: str) -> Any:
try:
v2: Any = getattr(obj, v1)
except AttributeError:
v2 = obj
return v2
```
Function Name: v3
Function:
```python
def v3(self, v4: Any, *v5, **v6) -> b... |
Imports:
```python
from os import mkdir, makedirs, replace, listdir, rmdir, environ, symlink, remove, environ, walk
from os.path import basename, join, isfile, isdir, islink, relpath, abspath
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Config, v2: Optional[str]=None):
ass... |
Imports:
```python
import inspect
import typing
```
Type definitions:
Input Types: Optional[pd.DataFrame], bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[pd.DataFrame]=None, v2: bool=False):
if v1 is not None:
v3 = v1
elif v2:
if self.ds.tes... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: tuple[str, str, dict[str, str], dict[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> tuple[str, str, dict[str, str], dict[str, str]]:
v2 = v2.replace(' ', '').upper()
v1 = v1.re... |
Imports:
```python
from operator import le
from functools import partial
import sympy
import typing
```
Type definitions:
Input Types: int, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int, v3: int=5):
assert v2 <= v1
for v4 in range(v2, min(v2 + v3, v1)):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Optional[Tuple]
Dependencies:
```python
def v0(v1):
for (v2, v3) in v1.all_utxos:
yield {'address': v1.address, 'seqNo': v2, 'amount': v3}
```
Function Name: v4
Function:
```python
def v4(self, v5, v6=None) -> Optiona... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple, str, str, list, str, str or None, str or None, str or None
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple, v2: str, v3: str, v4: list, v5: str, v6: str or None, v7: str or None=None, v8: str or Non... |
Imports:
```python
from requests.cookies import RequestsCookieJar
import json
import typing
```
Type definitions:
Input Types: str
Output Type: RequestsCookieJar
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> RequestsCookieJar:
v2 = RequestsCookieJar()
with open(v1, mode='rt') as v3:
... |
Imports:
```python
import threading
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1):
print('%-25s:\t %s, %s,' % (v1, threading.current_thread().name, threading.current_thread().ident))
```
Function Name: v2
Function:
```python
def v2(self) -> None:
v0('mai... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[Optional[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[Optional[str]]:
if not self._job_status:
raise ValueError('No job status available. Run `refresh_status` before checking for result... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: int, v2: int, v3: 'EventQueue', v4: Optional[Sequence[str]], v5: str, v6: bool=True, v7: bool=True, v8: bool=False, v9: int=0, v10: Iterable[Sequence[str]]=[]) -> None:
self.user_profile_id = v1
self.r... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
v1 = Path(v1) / 'annotations'
super().copy(destination_folder=v1)
``` |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: ql.BlackVarianceSurface, int
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: ql.BlackVarianceSurface, v2: int) -> pd.DataFrame:
v3 = []
v4 = v1.minStrike()
v3.append(v4)
whi... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: bool, np.array, float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False, v2: np.array=np.ones(3, dtype='intc'), v3: float=0.0, v4: float=0.0):
if isinstance(v2, list):
... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclasses.dataclass(frozen=True)
class v0:
v1: str
v2: FrozenSet[str]
v3: Union[FrozenSet[str], None]
v4: bool
```
```python
class v5(jax_core.Trace):
def v6(self, v7: Value) -> 'HarvestTracer':
return HarvestTracer(self, v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
with self.block('.ob_base =', ','):
self.write(f'.ob_refcnt = 999999999,')
self.write(f'.ob_type = &{v1},')
``` |
Imports:
```python
import json
import pathlib
from functools import reduce
from glob import has_magic
import pandas as pd
from dask import delayed
from dask.dataframe import from_delayed, from_pandas
from dask.dataframe import read_parquet as dd_read_parquet
from dask.dataframe import to_parquet as dd_to_parquet
from d... |
Imports:
```python
import tensorflow as tf
from tensorflow.contrib.layers import xavier_initializer
from tensorflow.losses import mean_squared_error
from tensorflow.train import AdamOptimizer
import typing
```
Type definitions:
Input Types: tf.Tensor, tf.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Functio... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Tuple[str, str]
```
Input Types: str
Output Type: Tuple[str, List[v0]]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: str) -> Tuple[str, List[v0]]:
(v3, v4) = v2.strip().split('\n\n')
return (v3, [tuple(x.split(' -> ')) for v... |
Imports:
```python
from itertools import chain, groupby
from operator import attrgetter
import requests
import typing
```
Type definitions:
```python
v0 = Dict[str, object]
```
```python
v1 = NamedTuple('Task', [('type', TaskType), ('name', TaskName)])
```
```python
v2 = str
```
```python
v3 = str
```
```python
v4 = st... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: typing.Dict[typing.Any, typing.Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> typing.Dict[typing.Any, typing.Any]:
if self.values is not None:
return {k.get(): v.get() for (v1, v2) in self.values.it... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v1 = self.remove_non_greek(v1)
return self.remove_multiple_space(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], Optional[int]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Any], v2: Optional[int]) -> None:
if v2 is None:
return
if v1.get('data-provider', None) != 'QuantConnect.L... |
Imports:
```python
from shapely.geometry import Point
import typing
```
Type definitions:
Input Types: pnd.DataFrame, bool
Output Type: tuple[Point, Point]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pnd.DataFrame, v2: bool=False) -> tuple[Point, Point]:
v3 = Point(v1[:1]['x'], v1[:1]['y'], v1[... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
self._check_params()
v1 = self._build_params()
v2 = self._build_url(v1)
return self._send_request(v2)
``` |
Imports:
```python
import cv2 as cv
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray) -> None:
if v1 is None or len(v1) == 0 or v1.size == 0:
raise ValueError('Image is empty')
```
```python
def v2(v3: np.ndarray) -> None:
... |
Imports:
```python
import torch
from torch import nn
from torch import Tensor
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: nn.Conv2d, nn.Conv2d, nn.Conv2d, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: nn.Conv2d, v2: nn.Conv2d, v3: nn.Co... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: Tuple, **v2: Dict[str, Any]) -> None:
if v1:
if hasattr(v1[0], 'keys'):
for (v3, v4) in v1[0].items():
self.__setitem__(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: float):
if v1 >= v2:
raise ValueError('The lower bound of melting temperature must be less than the upper bound')
``` |
Imports:
```python
import numpy as np
from collections import namedtuple
from itertools import accumulate
import typing
```
Type definitions:
Input Types: np.ndarray, Optional[float], Optional[str]
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: tuple=DEFAULT_TRANSITIONS) -> np.ndarray:
v2 = sum(v1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
self._resolved = {}
del self._dict[v1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.is_loaded = False
self._cache_metadata = None
self._cache_store = None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: 'AbstractObject'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: str) -> 'AbstractObject':
if self.tags is None:
self.tags = set()
for v2 in v1:
self.tags.add(v2)
return self
``` |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int=5) -> None:
v2 = v1 * 4
v3 = False
for v4 in range(v2):
v5 = self._loop.time()
await self.set_lights(butto... |
Imports:
```python
import pickle
import typing
```
Type definitions:
Input Types: Path, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path, v2='all'):
v3 = v1 / (v2 + '.pkl')
return pickle.loads(open(v3, 'rb').read())
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: List[str], *v3, **v4):
if 'PY_VERSION' not in v4:
v4['PY_VERSION'] = self.project.python.version
if 'PY_SHORT_VERSION' not i... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: int, v2: int):
self.weights: np.ndarray = np.random.rand(v1, v2)
self.biases: np.ndarray = np.random.random(size=v2) - 0.5
def v3(self, v4: np.ndarray) -> np.ndarray:
re... |
Imports:
```python
import numpy as np
from pandas._libs import algos as libalgos, index as libindex, lib
import pandas._libs.join as libjoin
from pandas._libs.lib import is_datetime_array, no_default
from pandas._libs.tslibs import IncompatibleFrequency, OutOfBoundsDatetime, Timestamp
from pandas._libs.tslibs.timezones... |
Imports:
```python
from collections import deque
import typing
```
Type definitions:
Input Types: str, str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> int:
v3 = deque()
v3.append((v1, 0))
v4 = 0
v5 = float('inf')
while v3:
(v6, v4)... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Iterator[bytes]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Iterator[bytes]:
try:
while True:
yield bytes(self.read())
finally:
self.stop()
``` |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: Any, np.array, Any
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
v2 = fgm_perturb(v2, **fgm_params)
v3 = v2 - x
v3 = clip_eta(v3, ord, eps)
v2 = x + v3
if clip_min is not None or clip_max is not N... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True, v2: str=''):
self.get_el(self.LOC_BUTTON_FINISH_EDITING).click()
self.wait_for_modal()
self.wait_for(self.LOC_BUTTON_FINISH_EDITING... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: v0
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> v0:
if v2 not in self.data_to_index:
raise KeyError(f'Disjoint set does not contain element: {v2}')
v3 = sel... |
Imports:
```python
import os
import typing
```
Type definitions:
```python
class v0:
def __init__(self):
self.sbt_runPreStep = None
self.r_runPreStep = None
self.python_runPipenvPreStep = None
self.python_runPoetryPreStep = None
self.php_runPreStep = None
self.paket_... |
Imports:
```python
from scipy.cluster import hierarchy
from scipy.spatial import distance
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame) -> pd.DataFrame:
v2 = hierarchy.linkage(distance.pdis... |
Imports:
```python
import hmac
import json
import hashlib
import typing
```
Type definitions:
Input Types: int, Dict[str, Any], str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=None, v2: Dict[str, Any]=None, v3: str=None):
if v3 == 'SIGNED':
v2 = json.dumps(v2)... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: models.QuerySet
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> models.QuerySet:
v1 = super().get_queryset()
v2 = self.kwargs.get('site_pk')
if v2 is not None:
v1 = v1.filter(site_id=v2)
retur... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
while not self._interrupt_requested:
if self._start_streaming_event.wait(0.2):
self._start_streaming()
self._process_stre... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[str, int, bool]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Tuple[str, int, bool]:
v2 = v1.split(':')
if len(v2) == 1:
v3 = v2[0]
if v3[0] == 'L':
v4 = int(v3[1:])
... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: commands.Context, discord.Member
Output Type: Union[int, None]
Dependencies:
```python
def v0(v1) -> bool:
if v1.author.id == member.id and msg.channel.id == ctx.channel.id:
if len(v1.content.strip()) <= 2:
if v1... |
Imports:
```python
from numpy import arange, concatenate, ndarray
from numpy.random import choice, permutation
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=128, v2=None) -> tensor:
if self._train_data is None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict, Any
Output Type: Tuple[str, dict, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: dict, v3: Any, *v4) -> Tuple[str, dict, Any]:
if any((k in v2 for v5 in ['min', 'max'])):
v3.expect_column_values_to... |
Imports:
```python
import typing
```
Type definitions:
Input Types: commands.Command
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: commands.Command) -> None:
v1.cooldown_after_parsing = True
super().add_command(v1)
``` |
Imports:
```python
import torch
from torch import nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
de... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str, str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str=None) -> dict:
v3 = {}
if v2:
v3['firewall_id'] = v2
v4 = requests.put(self.url + '/{}/firewall'.format(v... |
Imports:
```python
import ssl
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0() -> bool:
v1 = ['SSLContext', 'OP_NO_SSLv2', 'OP_NO_SSLv3', 'OP_NO_TLSv1']
return not all((hasattr(ssl, attr) for v2 in v1))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
```python
def v0(v1: list):
v2 = []
for v3 in range(2):
v4 = None
for v5 in range(0, len(v1)):
if v3 == 1 and v5 in v2[0]:
break
if not v4:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='*') -> Any:
with self.metastore as v2:
return v2.get_databases(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if not isinstance(v1, str):
raise Exception('ToolSet.addTool - Invalid name argument: ' + str(v1))
if v1 in self.tools:
return se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2: dict) -> dict:
v3 = ['_wards_placed', '_wards_destroyed', '_air_dragons', '_fire_dragons', '_earth_dragons', '_water_dragons', '_turrets_d... |
Imports:
```python
import typing
import typing
```
Type definitions:
```python
v0 = typing.TypeVar('T', bound=typing.Callable)
```
Input Types: v0, typing.Dict[str, typing.Any]
Output Type: v0
Dependencies:
```python
def v1(v2: typing.Dict[str, typing.Any], v3: typing.Dict[str, typing.Any]) -> typing.Dict[str, typing.A... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
with open(v1, 'r') as v2:
self.__cookies = json.load(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: model.IpAddress
Output Type: model.AutonomousSystem
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: model.IpAddress) -> model.AutonomousSystem:
try:
v2 = self._ip_to_asn.asn(v1.compressed).autonomous_system_number
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Either a string, or an object', 'string for <details>', 'initially show details', Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: 'Either a string, or an object', v2: 'string for <details>'=None, v3: 'initially sh... |
Imports:
```python
import importlib
import os
from tensorflow.io import gfile
import typing
```
Type definitions:
Input Types: str
Output Type: Dict
Dependencies:
```python
def v0(v1):
for v2 in v1.keys():
v3 = v1[v2]
if isinstance(v3, dict):
v0(v3)
elif isinstance(v3, str):
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = str
```
Input Types: v0, Tuple[str, Iterable[Tuple[v0, str]]]
Output Type: Optional[Tuple[str, v0, str]]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0, v3: Tuple[str, Iterable[Tuple[v0, str]]]) -> Optional[Tuple[str, v0, st... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'tg_models.Message'
Output Type: Optional['tg_models.Post']
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *, v1: 'tg_models.Message') -> Optional['tg_models.Post']:
if v1 is None:
return None
v2 = self.get_queryset(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[float], float, float, float
Output Type: List[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[float], v2: float, v3: float, v4: float) -> List[float]:
(v5, v6, v7, v8) = v1
v9 = 2 * v2 * (v2 ** 2 / (12 * v3) + ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, common.Part, str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: common.Part, v3: str) -> List[str]:
v4: List[str] = []
if v2.prose:
if v2.prose.find(v3) >= 0:
v4.a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> np.ndarray:
(v3, v4) = self._getSquareStart(v1, v2)
return self.a[v3:v3 + 3, v4:v4 + 3]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Union[str, bool]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='') -> Union[str, bool]:
if not v1:
return self._get_redis_value('state')
self._set_redis_value('state', v1)
return True
``... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[int, str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[int, str]) -> str:
if isinstance(v1, int):
assert v1 in range(1, self.nb_records + 1), f'rec should be in range(1,{self.nb_records... |
Imports:
```python
import typing
```
Type definitions:
Input Types: io.TextIOWrapper
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: io.TextIOWrapper) -> None:
while True:
self._state.offset = v1.tell()
v2 = v1.readline()
if v2:
v2 = v2.st... |
Imports:
```python
import tensorflow as tf
from tensorflow.python.ops.distributions.util import fill_triangular
import typing
```
Type definitions:
Input Types: tf.Tensor, tf.Tensor
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor, v2: tf.Tensor) -> tf.Tensor:
... |
Imports:
```python
import numpy as np
import statsmodels.api as sm
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray) -> np.ndarray:
v2 = sm.nonparametric.lowess(endog=v1, exog=np.linspace(0, 1, len(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Set[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Set[int]:
v2: Set[int] = set()
for v3 in str(v1).split(','):
if '-' in v3:
(v4, v5) = v3.split('-')
v2.upda... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> bool:
if 200 <= v1 <= 299:
return True
return False
``` |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: int
Output Type: datetime.datetime
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> datetime.datetime:
v2 = str(self.data['Date'][v1])
v3 = str(self.data['Time'][v1])
v4 = f'{v2[:11]} {v3}'
... |
Imports:
```python
import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.model_zoo import load_url as load_state_dict_from_url
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(s... |
Imports:
```python
from spacy.compat import copy_reg
from spacy.language import Language
from spacy.tokens import Doc, Token
import typing
```
Type definitions:
```python
v0 = namedtuple('ShortUnitWord', ['surface', 'lemma', 'pos', 'fstring', 'space'])
```
Input Types: List[v0]
Output Type: Doc
Dependencies:
Function ... |
Imports:
```python
import xarray as xr
import typing
```
Type definitions:
Input Types: xr.Dataset, datetime, str
Output Type: xr.Dataset
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: xr.Dataset, v2: datetime, v3: str) -> xr.Dataset:
v4 = v1.sel(time=slice(None, v2))
v5 = v1.sel(time=slice(v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> str:
v3 = int(v1)
v4 = int(v2)
return str(v3 * 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, v3) = (None, 0)
for v4 in v1:
if v3 == 0:
v2 = v4
v3 = v3 + 1 if v2 == v4 else v3 - 1
retu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> int:
if v1 == ')':
return 3
if v1 == ']':
return 57
if v1 == '}':
return 1197
if v1 == '>':
return 25137
``` |
Imports:
```python
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]):
v2 = ['channels', '1', 'stat', '-freq']
(v3, v3, v4) = self.build(v1, '-n', extra_args=v2, return_output=True)
v5 = ... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.cancel()
logging.info('Key/value store plugin: closing database')
self._db.close()
``` |
Imports:
```python
import datetime
import re
import typing
```
Type definitions:
Input Types: Any
Output Type: Optional[datetime.date]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> Optional[datetime.date]:
if v1 is None:
return None
if v1 == '明治5年4月16日':
return datetim... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Hashable, Optional[str]
Output Type: Tuple[Hashable, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Hashable, *v3: Any, v2: Optional[str]=None) -> Tuple[Hashable, Any]:
(v1, v4) = self._data.popitem(v1)
self._reason... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.