text stringlengths 190 325k |
|---|
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: Tuple[torch.Tensor, torch.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]:
if v1.size(0) == v... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('RecordType')
```
Input Types: v0
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0):
v3 = (self._row_data_provider(v2, key) for v4 in self._key_provider(v2))
self._writer.writerows(v3)
``` |
Imports:
```python
from itertools import combinations, permutations
import math
import numpy as np
import typing
```
Type definitions:
Input Types: int
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> list:
v2 = []
for v3 in range(self.num_cells // 2 + 1):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict) -> bool:
v2 = v1['password'].count(v1['char'])
return v1['min'] <= v2 and v1['max'] >= v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[mlir.astnodes.Module, mlir.astnodes.GenericModule], bool, str
Output Type: Any
Dependencies:
```python
def v0(v1: Union[mlir.astnodes.Function, mlir.astnodes.GenericModule], v2: bool):
if v2:
return v1.attributes.values[0].value.valu... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: 'Device') -> None:
self.device = v1
self.bindings: Dict[int, 'RoleBinding'] = {}
self.score = -1
```
Input Types: v0, Optional[bool]
Output Type: Any
Dependencies:
Function Name: v2
Function:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, Optional[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: Optional[str]=None) -> None:
if str(v1)[0] != 2:
self.cacheable = False
super().set_status(v1, v2)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[Glue, Box, Penalty]
```
Input Types: v0, Any
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0, v3: Any):
self.specs.append(v2)
self.vals.append(v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, bool
Output Type: bytearray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: bool) -> bytearray:
v3 = bytearray()
v3.append(v1 & 255)
v3.append(v1 >> 8 & 255)
if not v2:
v3.append(v1 >> 16 & 255)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='user') -> List[str]:
v2 = self.executor.get_output if v1 == 'user' else self.executor.sudo_get_output
return [item.split('\t')[-1] for v3 in ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bytes
Dependencies:
```python
def v0(v1: str) -> List[int]:
v2 = list()
for v3 in v1:
v2.append(CHARSET.find(v3))
return v2
```
```python
def v4(v5, v6, v7, v8=True):
v9 = 0
v10 = 0
v11 = []
v12 = (... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: float, float
Output Type: Optional[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float) -> Optional[float]:
if (self.point_x == None) | (self.point_y == None):
return None
v3 = [sel... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = [1e-09, 10 * 1e-09, 100 * 1e-09, 1e-06, 10 * 1e-06, 100 * 1e-06, 0.001, 10 * 0.001, 100 * 0.001, 1.0]
v2 = [1e-06, 10 * 1e-06, 100 * 1e-06, 0.001]
def __init__(self, v3, v4, v5, v6, v7=0, v8=False, v9=None, v10=None, v11=None, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'PGconn'
Output Type: str
Dependencies:
```python
def v0(v1: Union[bytes, str]) -> str:
try:
return py_codecs[v1]
except KeyError:
raise NotSupportedError('codec not available in Python: {name!r}')
```
Function Name: v2
Functio... |
Imports:
```python
import io
import typing
```
Type definitions:
Input Types: BinaryIO, Iterable[int]
Output Type: Iterable[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: BinaryIO, v2: Iterable[int]) -> Iterable[int]:
for v3 in v2:
v1.seek(v3, io.SEEK_SET)
v4 = v1.read(1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = ['eu.tiliado.NuvolaApp']
for v3 in v1.split('_'):
v2.append(v3[0].upper())
v2.append(v3[1:].lower())
return ''.join(v2)
... |
Imports:
```python
import csv
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> dict:
with open(v1) as v2:
v3 = csv.DictReader(v2)
v4 = [row for v5 in v3]
return v4
``` |
Imports:
```python
import torch
from torch.utils.data import TensorDataset, DataLoader
from sklearn.model_selection import train_test_split
import numpy as np
import typing
```
Type definitions:
Input Types: np.array, np.array, np.array, np.array, np.array, np.array, Any, Any
Output Type: Any
Dependencies:
Function N... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[int]) -> int:
(v2, v3) = (0, 0)
for v4 in range(0, len(v1) - 1):
v5 = v1[v4 + 1] - v1[v4]
v3 = max(v3 + v5, v5)
v2 = max(v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = len(v1)
return [(float(ts), bool(status)) for (v3, v4) in zip(range(v2), v1)]
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Iterable[str]
Output Type: Iterable[np.ndarray]
Dependencies:
```python
def v0(v1: str, v2: int, v3: Optional[str], v4: Optional[str], v5: Optional[int], v6: Optional[int], v7: bool) -> Iterable[np.ndarray]:
v8 = skimage.io.imre... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: [[]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> [[]]:
v1 = []
for v2 in range(self.n_rows):
v1.append(self.board[v2 * self.n_cols:v2 * self.n_cols + self.n_cols])
return v1
``` |
Imports:
```python
from inspect import isasyncgenfunction, signature, stack
import typing
```
Type definitions:
Input Types: Any
Output Type: Callable[..., AsyncGenerator[Any, None]]
Dependencies:
```python
async def v0(**v1):
yield (await fix(**v1))
```
Function Name: v2
Function:
```python
def v2(v3) -> Callable... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: 'Dataset'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: Hashable) -> 'Dataset':
if v1:
if set(v1) ^ set(self.dims) and ... not in v1:
raise ValueError('arguments to transpose (%s) must be ... |
Imports:
```python
from typing import Any, ClassVar, Dict, List, Mapping, Optional, Sequence, Tuple, Type, Union, cast
import typing
```
Type definitions:
```python
v0 = Literal['now', 'second', 'seconds', 'minute', 'minutes', 'hour', 'hours', 'day', 'days', 'week', 'weeks', 'month', 'months', 'year', 'years', '2-hours... |
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._give_workers_list(v1['shift'])
v3 = {}
print('Введите количество отработанных смен:')
for v4 in v2:
v3['year'] = v1['... |
Imports:
```python
import torch as th
import typing
```
Type definitions:
Input Types: Iterable[th.Tensor], Union[int, float]
Output Type: th.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[th.Tensor], v2: Union[int, float]=2) -> th.Tensor:
if v2 == 0:
raise ValueError('This... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = self.backfill_replication_params()
self.rest.edit_replication(self.master_node, v2, v1)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.array
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.array) -> np.array:
v2 = np.argmax(v1, axis=1)
v3 = np.zeros(shape=v1.shape, dtype=np.int8)
v3[np.arange(v2.size), v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: rbn.Node
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=None) -> rbn.Node:
if v1 == None:
v1 = self.root
while v1 != None and v1.left != None:
v1 = v1.left
return v1
``` |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: Any
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> float:
v2 = math.sqrt(v1 ** 2 - self._rear_axle_longitudinal_offset ** 2)
return v2
``` |
Imports:
```python
import os
from pathlib import Path
import typing
```
Type definitions:
Input Types: zipfile.ZipFile
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: zipfile.ZipFile) -> None:
v2 = self.meta.convert_package_paths()
v3 = self.meta.package_dir
if self.... |
Imports:
```python
from configparser import ConfigParser
import typing
```
Type definitions:
Input Types: Path
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path) -> Dict:
v2 = ConfigParser()
v2.read(v1)
return {section: dict(v2.items(section)) for v3 in v2.sections()}
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2=None) -> str:
(v3, v4) = (v1[0], v1[1])
if 'byte' in v3:
v5 = v3.split('_bytes')
v6 = v5[0]
return f'extract({v4}, {v6}... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int=1) -> None:
async with self._cond:
self.n_token = min(self.n_token + v1, self._bucket_size)
self._cond.notify()
``` |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Dict
Dependencies:
```python
def v0(v1: List, v2: bool=False) -> Dict:
v3 = len(v1)
v4 = plt.cm.rainbow(np.linspace(0, 1, v3))
v5 = dict()
for v6 in range(v3):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
try:
return ['NONE', 'LEO', 'MEO', 'GEO'].index(v1.upper())
except ValueError:
return -1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str='', v2: dict=None) -> str:
v3 = ''
if not v2:
return v1
if v1:
v3 += f'({v1}) AND '
v4 = [f'{query_field}:{v2[query_field]}'... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
```python
class v0(Node):
def __init__(self, v1: str, v2: int, v3: str, v4: str, v5: int, v6: int, v7: bool, v8: str='disabled', v9: str='disabled', v10: typing.SupportsFloat=0, v11: int=2):
super(v0, self).__init__()
self.compat... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str, dict[str, str], dict[str, str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict[str, str]=None, v3: dict[str, str]=None):
v4 = f'{self.url}/{v1}'
return requests.delete(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes):
v2 = self.MESSAGE_HEADER_STRUCT.pack(self.PROTOCOL_VERSION, len(v1))
return v2 + v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
async def v0():
await self.scraper.close()
```
Function Name: v1
Function:
```python
def v1(self) -> None:
async def v2():
await self.scraper.close()
try:
self.loop.run_until_comp... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, Optional[click.Parameter], Optional[click.Context]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[click.Parameter], v3: Optional[click.Context]) -> str:
v4 = re.match(self._r... |
Imports:
```python
import subprocess
import sys
import typing
```
Type definitions:
Input Types: Union[str, Path], str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[str, Path], v2: str=None):
print(f'pypulseq_cest: start installation')
if not v2:
v3 = subprocess... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.args.bots_path.replace('/', '.').replace('.py', '')
self.bots = []
for v2 in range(self.nb_pops):
self.bots.append(getattr(impo... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if not all((v is not None for (v1, v2) in self.__dict__.items())):
return False
if hasattr(self, 'children') and self.children is not None:
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Callable[[str, Iterable[Tuple[str, str]], Optional[ExcInfo]], None]
```
Input Types: dict
Output Type: v0
Dependencies:
```python
def v1(v2: str, v3: Iterable[Tuple[str, str]], v4: Tuple[Type[BaseException], BaseException, Optional[TracebackType]]=No... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if len(v1) < 3:
return v1
elif v1.endswith('ing'):
return v1 + 'ly'
else:
return v1 + 'ing'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple:
v1 = (self.width, self.height)
return v1
``` |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
```python
v0 = Tuple[str, int]
```
Input Types: Dict[v0, Dict], Dict[v0, Dict]
Output Type: pd.DataFrame
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Dict[v0, Dict], v3: Dict[v0, Dict]) -> pd.DataFrame:
v4 = []
for (v5... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: entities.Annotation
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2=None) -> entities.Annotation:
v3 = self.get_item(project=v2, resource_id=v1)
return v3.annotations.get(annotation_id=v1['annotat... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = super()._get_description()
v1 += ', backend='
v1 += 'None' if self._backend is None else type(self._backend).__module__ + '.' + type(self._bac... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, float, int
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: torch.Ten... |
Imports:
```python
import uuid
import typing
```
Type definitions:
Input Types:
Output Type: OrderedDict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> OrderedDict:
self.headers['request_id'] = str(uuid.uuid4())
return self.headers
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, bool, bool
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: bool=True, v3: bool=False, **v4) -> torch.Tensor:
if v2:
v5 = self.get_full_projection_transform(**v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: requests.Response
Output Type: Optional[Mapping[str, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: requests.Response) -> Optional[Mapping[str, Any]]:
try:
v2 = next(self._pages)
return v2
except St... |
Imports:
```python
from torch import nn
from torch import optim
from torch.nn import functional as F
from transformers.trainer_pt_utils import get_parameter_names
import typing
```
Type definitions:
Input Types: nn.Module, float, float, float
Output Type: Any
Dependencies:
```python
def v0(v1: nn.Module):
v2 = get... |
Imports:
```python
import h5py
import typing
```
Type definitions:
Input Types: Any, dict
Output Type: (any, any)
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, *v3, v2: dict=None, **v4) -> (any, any):
v5 = self.primary_keys()
v6 = self.full_conditions(*v3, conditions=v2)
if len(v5) ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int
Output Type: Any
Dependencies:
```python
def v0(v1):
"""
version courte :
"""
return randint(0, v1)
```
Function Name: v2
Function:
```python
def v2(v3, v4: int):
v5 = 0
while v5 < v4:
v6 = v3[v0(len(v3) - 1)]
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> None:
self.initialize_details(v2)
v3 = list()
for (v4, v5, v6) in os.walk(v1):
for v7 in v6:
v3... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Tuple[int, int], Dict[int, int], Any
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple[int, int], v2: Dict[int, int], v3='C') -> np.array:
(v4, v5) = v1
v6 = sum(v2.values())
v7 ... |
Imports:
```python
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:
v2 = self.fc_decoder(v1)
v2 = v2.view(-1, self.hidden_dimensions[7], 1, 1)
v2 = self.transposed_con... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list=None):
v2 = 'XT.'
self._modify_sub(v1, 'unsubscribe', v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> str:
(v2, v3) = divmod(v1() - v1, 60)
(v4, v2) = divmod(v2, 60)
(v5, v4) = divmod(v4, 24)
(v6, v5) = divmod(v5, 365)
return f'{v6} years, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, int
Output Type: (List[Any], int)
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: dict, v2: int=None) -> (List[Any], int):
v3 = []
for v4 in self.__selected_db:
v5 = v4[0]
v6 = v4[1]
if... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Dict[str, Any]:
v2 = {'rules': {}, 'your ticket': [], 'nearby tickets': []}
v3 = 'rules'
for v4 in v1.splitlines():
v4 = v4.str... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, list[discord.Embed], int, bool
Output Type: list[discord.Embed, list[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: list[discord.Embed], v3: int=60, v4: bool=False) -> list[discord.Embed, list[str]]:
self... |
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 v2:
v2 = f'[{v2}]'
if v1:
v1 = f'{{{v1}}}'
return v2 + v1
``` |
Imports:
```python
from pandas._typing import FilePath, ReadBuffer
from pandas.errors import EmptyDataError, OutOfBoundsDatetime
import pandas as pd
from pandas import DataFrame, isna
from pandas.io.common import get_handle
from pandas.io.sas._sas import Parser
import pandas.io.sas.sas_constants as const
from pandas.io... |
Imports:
```python
import numpy
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> dict:
v2 = []
v3 = len(v1['detection_boxes'])
v4 = ['num_detections', 'detection_classes', 'detection_scores', 'detection_boxes']
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self: unittest.TestCase, v1, v2):
for (v3, v4) in v2:
self.assertEqual(v4, v1(v3))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: IO
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> IO:
self.io_base = v0(self.filename, self.mode)
return self.io_base
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: float
Dependencies:
```python
def v0() -> bool:
if PSYCHROLIB_UNITS == IP:
return True
elif PSYCHROLIB_UNITS == SI:
return False
else:
raise ValueError('The system of units has not been defined.')... |
Imports:
```python
import torch
import torch.nn.functional as F
import io
import typing
```
Type definitions:
Input Types: Any, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: int):
v3 = v1[v2, :]
v4 = io.BytesIO(v3.tobytes())
self._network.load_state_dict(tor... |
Imports:
```python
import typing
```
Type definitions:
Input Types: [array], int
Output Type: (set, array)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: [array], v2: int) -> (set, array):
v3 = v1[v2]
return ({tuple(beacon - v3) for v4 in v1}, v3)
``` |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame, pd.DataFrame, bool
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: pd.DataFrame, v3: bool=True) -> pd.DataFrame:
v4 = pd.DataFrame(v1['flow_avg_m^3/s'], ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = '\n class C:\n def f(self):\n return __function_credential__\n def test():\n c = C()\n ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Any
Dependencies:
```python
def v0(v1: Dict[str, Any], v2: str, v3: Dict[str, Any]):
for v4 in v1:
if isinstance(v1[v4], dict):
v0(v1[v4], v4 + '_', v3)
else:
v3[v2 + v4] = v1[v4]... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[np.ndarray, pd.Series, pd.DataFrame]
```
Input Types: v0
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> v0:
if self.truncate and self.full_weight_obs > 0:
return v2[-self.full_weight_obs... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bytes
Dependencies:
```python
def v0(v1: int) -> bytes:
return der_encode_tlv(2, der_encode_integer_value(v1))
```
```python
def v2(v3: int) -> bytes:
if not isinstance(v3, int):
raise TypeError('int')
if v3 == 0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: AnyStr
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: AnyStr):
if not v1:
return []
for v2 in [',', ';', ':']:
v1.replace(v2, ' ')
return list(filter(None, [e.strpip() for v3 in v1.join(' '... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, bool]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[str, bool]) -> bool:
v2 = ['True', 't', 'T']
v3 = ['False', 'f', 'F']
if isinstance(v1, str):
if v1 in v3:
return ... |
Imports:
```python
from json import dump as json_dump
from json import loads as json_loads
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: str) -> dict:
v2 = ['output', '-json']
for v3 in v1:
if v3 not in v2:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Dict:
v2 = self.power_bi_session.make_request(method='get', endpoint=f'myorg/reports/{v1}/datasources')
return v2
``` |
Imports:
```python
from collections import Counter, defaultdict
import numpy as np
import pandas as pd
from sklearn.preprocessing import OneHotEncoder
import typing
```
Type definitions:
Input Types: int, int, str, bool
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
with open(v1, 'w') as v2:
for (v3, v4) in self.mutants_list.items():
v5 = f'\n\n------------{v3}-------------------\n{v4}'
... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
while True:
v2 = input(f'Set a {v1} date in yyyy-mm-dd format (optional): ')
if not v2:
ret... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(ABC):
@classmethod
@abstractmethod
def v1(cls, v2: Tensor, v3: Tensor) -> v0:
""" Abstract a box to abstract elements by its lower/upper bounds. """
raise NotImplementedError()
@classmethod
def v4(cls, v5: Te... |
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 is None:
return self.__keywords_list
else:
return list(self.query(v1))
``` |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: Dict[str, Dict[str, int]], Dict[str, Dict[str, float]], List[int]
Output Type: Tuple[Dict[str, float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Dict[str, int]], v2: Dict[str, Dict[str, float]], v3: List[... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = {}
for v2 in self.analyzer.FullKindToNameDict.keys():
v3 = {}
v3['apiVersion'] = self.analyzer.FullKindToVersionDict[v2]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = len(v1) - 1
v3 = v1[v2]
while v2 > 0:
v1[v2] = v1[v2 - 1]
v2 -= 1
v1[v2] = v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> bool:
for v2 in v1:
if v2 in self._url.path:
return True
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, str, int, str, bool, str, bool, int, int, int, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: int, v3: str, v4: int, v5: str=None, v6: bool=True, v7: str=None, v8: bool=False, v9: i... |
Imports:
```python
import asyncio
import copy
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: 'downloader.DownloadJob'
Output Type: None
Dependencies:
```python
def v0(v1: int, v2: str):
return tqdm(total=v1, desc=v2, unit_scale=True, unit='B')
```
Function Name: v3
Function:
```python
async... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: int
v2: bool = True
v3: str = ''
v4: str = ''
v5: Tuple[int] = None
v6: float = 1.0
v7: int = 0
def v8(self):
if self.range is not None and self.range[1] <= self.range[0]:
raise... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, Any
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: bytes, v2=None, **v3) -> bytes:
if self.context:
v4 = self.context.get('address')
else:
v4 = None
v5 = (False, v2, v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Text
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any, v2: Any, v3: Text):
try:
setattr(v1, v3, getattr(v2, v3))
except (AttributeError, TypeError):
pass
``` |
Imports:
```python
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor) -> dict:
v3 = self.bn(v1).T @ self.bn(v2)
v3.div_(v1.size(0) ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: netCDF4.Dataset, netCDF4.Dataset, tuple
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: netCDF4.Dataset, v2: netCDF4.Dataset, v3: tuple) -> None:
for v4 in v3:
if v4 in v1.variables:
v5 = getat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.