text stringlengths 190 325k |
|---|
Imports:
```python
import numpy
import typing
```
Type definitions:
Input Types: Any, Any, bool, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3: bool=False, v4: bool=False):
v5 = 1.0 / v2
v6 = numpy.square(v5)
v7 = v1 * 180.0 / numpy.pi
v8 = 2.0 / numpy.pi
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1, v2, v3):
self.example_id = v1
self.choices_features = [{'input_ids': input_ids, 'input_mask': input_mask, 'segment_ids': segment_ids} for (v4, v5, v6, v7) in v2]
self.label = v3
```
```... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(DataPoint):
def __init__(self, v1: List[Token]):
super().__init__()
self.tokens = v1
self.start_pos = None
self.end_pos = None
if v1:
self.start_pos = v1[0].start_position
self.... |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, Any]:
v1 = self.an_enum_value.value
v2 = self.some_dict
if isinstance(self.a_camel_date_time, datetime.datetime):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> int:
self.stack = []
self.res = float('inf')
self.prev = -float('inf')
v2 = v1
while len(self.stack) != 0 or v2 != None:
while v2... |
Imports:
```python
import os
import shutil
from datetime import datetime
from logging import warning
import pandas as pd
import typing
```
Type definitions:
Input Types: Any, Any, Any, str, str, Any
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
v3 = '_TRAIN.tsv'
v4 = {}
for v5 in os.listdir(v1):... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, list
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: list) -> float:
v3 = 0.0
for (v4, v5) in zip(self.measurables, v2):
v3 += v4.eval(v1, v5)
return v3
``` |
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:
try:
v2 = [i for (v3, v4) in enumerate(v1) if (v3 + 1) % 1 == -1][0]
except:
return False
return v1[v2 + 2]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = 0
if self.is_well_formed():
for v2 in self.faces.values():
if self.is_valid_face(v2):
v1 += self.get_num_match... |
Imports:
```python
from collections import Counter
import typing
```
Type definitions:
Input Types: List[str], int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: int, v3: int) -> int:
v4 = [[0] * (v3 + 1) for v5 in range(v2 + 1)]
for (v6, v7) in [(c['... |
Imports:
```python
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit.quantum_info.random import random_unitary
import typing
```
Type definitions:
Input Types: Any
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> dict:
v2 = {'u1': [], 'u2': [], 'u... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: bytes
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes) -> bool:
v2 = self.last_chunk + v1
v3 = len(self.data) - len(self.last_chunk)
self.data += v1
self.last_chunk = v1
for v... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types:
Output Type: logging.Logger
Dependencies:
Function Name: v0
Function:
```python
def v0() -> logging.Logger:
v1 = logging.getLogger()
v1.setLevel(logging.INFO)
v2 = logging.Formatter('%(asctime)s %(levelname)s [%(name)s]: %... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Union[str, List[str], Dict[str, Any], int, None]], Optional[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: Dict[str, Union[str, List[str], Dict[str, Any], int, None]], v2: Optional[str]=None... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: {}
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> {}:
for v2 in self.my_allplane_infos:
if v2['ID'] == v1:
return v2
return None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bytes:
v2 = (v1 - self.first_frame_idx) * self.bytes_per_frame
return self.data[v2:v2 + self.bytes_per_frame]
``` |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
logging.debug('close grpc')
self.client.close()
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Visitable, Generic[_T]):
v1 = True
v2 = False
v3 = False
v4 = False
v5 = False
v6 = False
v7 = False
'Render bind casts for :attr:`.BindTyping.RENDER_CASTS` mode.\n\n If True, this type (usually a dialect level ... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: dict) -> Response:
if v1['tag'] == 'ExecCaptureResponse':
if v1['success']:
return Response.from_value(v1['content'])
else:
return Response... |
Imports:
```python
import copy
import numpy as np
import torch
import typing
```
Type definitions:
Input Types: List[np.ndarray], np.ndarray, int
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1: List[np.ndarray], v2: int, v3: int) -> np.ndarray:
assert len(v1) > 0, 'COCOAPI does not support empty polyg... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.array, float
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.array, v2: float) -> np.array:
v1[v1 > v2] = v2
return v1
``` |
Imports:
```python
from math import ceil
import typing
```
Type definitions:
Input Types: int, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int) -> str:
v3 = v1
if v1 < 0:
v3 += 1 << v2
v4 = (1 << v2) - 1
v3 &= v4
v5 = '{{:0{}x}}'.format(ceil... |
Imports:
```python
import typing
```
Type definitions:
Input Types: QtWidgets.QLayout
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: QtWidgets.QLayout) -> None:
v1.addWidget(self.getCanvas().native)
super().setLayout(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, date, str
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: str, v3: str, v4: date, v5: str='paypal') -> tuple:
self._check_org_uid_plan_id(v1, v3, v2)
return await self._cre... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: [int, int, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2='rowwise') -> [int, int, float]:
if self.opt.data.internal_data_type == 'matrix':
assert v2 in ['rowwise', 'colwise'], 'Unexpe... |
Imports:
```python
from io import StringIO
import typing
```
Type definitions:
Input Types: object
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: object) -> str:
v2 = StringIO()
self.write(v2, v1)
return v2.getvalue()
``` |
Imports:
```python
import functools
import operator
import typing
import numpy
import numpy.fft
import numpy.typing
import typing
```
Type definitions:
```python
v0 = DataAndMetadata._DataAndMetadataLike
```
```python
v1 = Image._ImageDataType
```
Input Types: DataAndMetadata.DataAndMetadata, typing.Optional[str]
Outpu... |
Imports:
```python
from typing import Any, AnyStr, Dict, List, Optional, cast
import typing
```
Type definitions:
Input Types: str, AnyStr, Optional[int]
Output Type: List[Dict[AnyStr, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: AnyStr, v3: Optional[int]=1) -> List[Dict[AnyStr,... |
Imports:
```python
import sys
import argparse
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: argparse.Namespace
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: List[str]) -> argparse.Namespace:
v3 = argparse.ArgumentParser(prog=v1, description=' .\n ')
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: int
Output Type: Optional[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: int) -> Optional[v0]:
if v2 in self.reverse_mapper:
return self.reverse_mapper[v2]
else:
return ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
v1 = self.health - self.max_health
self.health = self.max_health
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Mapping[str, int]
```
Input Types: v0, jnp.ndarray
Output Type: Mapping[str, jnp.ndarray]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0, v3: jnp.ndarray) -> Mapping[str, jnp.ndarray]:
v4 = {}
v5 = 0
for v6 in sorted(v... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Union[pyredner.EnvironmentMap, tf.Tensor, None], Union[pyrednertorch.EnvironmentMap, torch.Tensor, None], Callable, Any
Output Type: bool
Dependencies:
```python
def v0(v1, v2):
v3 = v1 is None and v2 is not None
v4 = v1 is ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float, float, int
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: float, v3: int) -> tuple:
if v3 % 2 == 0:
v4 = list(np.logspace(np.log10(v1), np.log10(v2), v3 // 2))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, **v1: Any) -> None:
await self._smartbridge.lower_cover(self.device_id)
self.async_update()
self.async_write_ha_state()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Generator[bytes, None, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Generator[bytes, None, None]:
self.stream.seek(0)
v1 = self.stream.read(self.chunk_size)
while v1:
yield v1
v1 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.reset_gamedata()
object.__setattr__(self, 'players', [])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[dask.distributed.client.Future], Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[dask.distributed.client.Future], v2=True) -> None:
if v2:
for v3 in v1:
if v3.status == 'p... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
import typing
```
Type definitions:
Input Types: Any, Optional[Tuple[Tensor, Tensor, Tensor, Tensor]], Optional[Dict[str, Dict[str, Optional[Tensor]]]], Optional[Tensor], Any
Output Type: Any
Dependencies:
F... |
Imports:
```python
from urllib.parse import urlparse
import requests
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str) -> Optional[str]:
v2 = format_ipfs_cid(v1)
if v2 is None:
return None
try:
with ipfshttpclient.connect(util.IPFS... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = datetime.now()
v3 = datetime.strptime(v1, '%Y-%m-%d')
return v2.year - v3.year - ((v2.month, v2.day) < (v3.month,... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = requests.get(url='https://friendbot.stellar.org', params={'addr': v1})
v2.raise_for_status()
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(JsonObject):
def __init__(self, v1: str, v2: 'CloudFoundryClient', **v3):
super(v0, self).__init__(**v3)
v4 = self._default_manager(v1, v2)
self._create_navigable_links(v2.v3, v4)
self._create_navigable_includ... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: float
Output Type: Tuple[int, int, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float) -> Tuple[int, int, float]:
v2 = math.modf(v1)
v3 = int(v2[1])
v4 = abs(int(math.modf(v2[0] * 60)[1]))
v5 = abs... |
Imports:
```python
from random import randint
import typing
```
Type definitions:
Input Types:
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0() -> tuple:
v1 = set()
while len(v1) < 6:
v1.add(randint(1, 33))
v2 = sorted(v1)
v2.append(randint(1, 16))
return tu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, bytes
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bytes, v2: bytes):
if len(v2) != 256:
raise ValueError('Input table must be 256 bytes long.')
v3 = []
for v4 in v1:
v3.append(v2[... |
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) -> np.ndarray:
v2 = self.size
v3 = np.ones(v2).astype(bool)
for v4 in v1:
v5 = self.find_covered_by_literal_mask(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int, v3: int, v4: int) -> int:
v5 = 0
v6 = {}
for v7 in range(0, len(v1) - v3 + 1):
v8 = v1[v7:v7 + v3]
if l... |
Imports:
```python
import difflib, itertools, sqlite3, threading, re, os, logging, random, time, functools, collections as pyCollections
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
self.logger.debug('Chec... |
Imports:
```python
import json
import datetime
import urllib
import urllib.request
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
```python
def v0(v1):
try:
v2 = urllib.request.Request(v1)
v2.add_header('User-Agent', 'robots-bypass-2342')
with urlli... |
Imports:
```python
import typing
```
Type definitions:
Input Types: typing.Dict
Output Type: typing.Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: typing.Dict) -> typing.Dict:
if self.strategy == 'obv':
pass
elif self.strategy == 'sup_res':
pass
elif self.strateg... |
Imports:
```python
import numpy
import typing
```
Type definitions:
Input Types: Any, Any, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3: bool=False):
v4 = 0.5 * (v2 + 1.0) - numpy.cos(v1) * (v2 - 1.0) * 0.5
v5 = {}
if v3:
v5['p_phi'] = 0.5 - 0.5 * num... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
```python
def v0(v1: list) -> bool:
v2 = ''
for v3 in v1:
v2 += v3
v4 = []
v5 = len(v1)
for v6 in range(v5):
v4.append(v2[v6::v5])
return check_horizontal_visibility(v4)
```
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, list, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: list=None, v4=False):
v5 = self.session.get(v1, auth=self.base_auth, verify=False, timeout=self.requests_timeout, allow_re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
for v2 in self.modules():
if id(self) == id(v2):
continue
if hasattr(v2, 'freeze_block'):
v2.freeze_block(v1)
... |
Imports:
```python
import os
from tensorflow.keras.callbacks import EarlyStopping, ReduceLROnPlateau, ModelCheckpoint
from tensorflow.keras.models import Model
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.metrics import categorical_crossentropy, categorical_accuracy, top_k_c... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.Transpose()
self._data = v1._data
``` |
Imports:
```python
from scipy.special import softmax
from sklearn.metrics import log_loss
from sklearn.preprocessing import MinMaxScaler
import typing
```
Type definitions:
Input Types: List[float], NDArray[np.float_], NDArray[np.int_]
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: ElectronicT
Output Type: ArrayLike
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ElectronicT=None) -> ArrayLike:
if v1 is None:
v1 = self.electronics
return np.dot(np.real(np.diag(self.rho)), ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = ['role', 'rank', 'local_world_size']
def __init__(self, v2: str, v3: int, v4: int):
"""
Arguments:
role (str): user-defined role for the workers with this spec
rank (int): the rank of the ag... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Callable[[io.StringIO], io.StringIO]
```
Input Types: io.StringIO, List[v0]
Output Type: io.StringIO
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: io.StringIO, v3: List[v0]) -> io.StringIO:
v2.seek(0)
if not v3:
retu... |
Imports:
```python
import torch
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
import typing
```
Type definitions:
Input Types: Dataset
Output Type: DataLoader
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dataset, **v2) -> DataLoader:
if not isinstance(v1, Dataset):... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str):
v2 = v1.split('.')
if len(v2) != 4:
raise ValueError(f'{v1} not in correct IPv4 format')
return _struct.pack('BBBB', *[int(bt) for v3 in v2])
```
Function Name: v4
Funct... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list:
v1 = self.meta_run_tree.view('traces')
v2 = []
for v3 in v1.keys():
v4 = self.idx_to_ctx(v3).to_dict()
for (v5, v6) in v1[v3].ite... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int | str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int | str):
if v1 not in self.sprites.keys():
raise ValueError(f'The sprite corresponding to {v1} does not exist in this scene')
del self.... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
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.forward(v1)
v3 = v2['categ... |
Imports:
```python
from torch import Tensor, nn
from torch.nn.functional import interpolate
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> Tensor:
v2 = v1.size(2)
v3 = v1.size(3)
v4 = (v2, v3)
... |
Imports:
```python
import pathlib
import re
import typing
```
Type definitions:
Input Types: typing.Union[str, re.Pattern]
Output Type: typing.List[pathlib.Path]
Dependencies:
```python
def v0(v1: str='solutions') -> pathlib.Path:
return pathlib.Path(__file__).parent / v1
```
Function Name: v2
Function:
```python
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: classfile.MemberInfo
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: classfile.MemberInfo):
v2 = v1.CodeAttribute
if v2 != None:
self.maxStack = v2.MaxStack
self.maxLocals = v2.MaxLocals
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.__class__.__name__
if not isinstance(self.data, bool):
raise TypeError(f'Data in {v1} must be a bool')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[float, int]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[float, int]) -> str:
if v1 != v1:
return ''
if isinstance(v1, int):
return str(v1)
if v1 >= 1000:
v2 = f'{v1:.... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
assert not self.trainer.model.training
assert not self.training
``` |
Imports:
```python
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self.actor.load_state_dict(torch.load(v1))
self.actor_target = copy... |
Imports:
```python
import io
import os
import typing
```
Type definitions:
```python
v0 = Union[None, io.BytesIO, io.StringIO]
```
```python
v1 = Union[str, bytes, None, Sequence[Union[str, bytes]]]
```
Input Types: v1, v0
Output Type: Union[io.BytesIO, io.StringIO]
Dependencies:
Function Name: v2
Function:
```python
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: int) -> np.ndarray:
assert v2 % 2 == 1, 'Only odd sizes supported'
v3 = (v2 - 1) // 2
v4 = np.empty(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Token, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Token, v2=200) -> bool:
if len(v1) < 2:
return False
elif v1.lemma_.istitle() and len(v1.lemma_) > 2:
return True
elif v1.lemma_.i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2):
v3 = len(v1)
if v3 == 0:
return
if (v3 == self.nodeCount - 1 or self.nodeCount > v2) and v3 >= v2:
for v4 in range(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], List[Tuple]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2: List[Tuple]) -> None:
for v3 in range(len(v1)):
for v4 in range(len(v1[0])):
if (v3, v4) in v2 and v1[v3][v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
super().setUp()
self.inner_mock.tasks.find_by_project.return_value = [t.to_dict() for v1 in self.tasks]
self.inner_mock.tasks.find_by_section.ret... |
Imports:
```python
import re
from datetime import datetime
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.googleDB == True:
v1 = datetime.now().strftime('%m/%d/%Y %H:%M:%S')
v2 = self.sheet.add_w... |
Imports:
```python
import typing
```
Type definitions:
Input Types: stix2.Bundle
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: stix2.Bundle) -> None:
v2 = v1.serialize()
self.helper.send_stix2_bundle(v2, work_id=self.work_id)
``` |
Imports:
```python
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.ticker import MaxNLocator
import typing
```
Type definitions:
Input Types: pd.DataFrame, Dict
Output Type: (str, Figure)
Dependencies:
```python
def v0(v1: pd.Series, v2: int, v3: s... |
Imports:
```python
import asyncio
import signal
from sys import stderr
import typing
```
Type definitions:
Input Types: str
Output Type: asyncio.Event
Dependencies:
```python
def v0(v1: signal.Signals) -> None:
print(f'\nStopping {name}', file=stderr)
stop.set()
```
Function Name: v2
Function:
```python
def v2... |
Imports:
```python
import os, sys
import typing
```
Type definitions:
Input Types: Callable
Output Type: Any
Dependencies:
```python
def v0(v1: List[str], v2=''):
v3 = parse_cue_sheet(v1)
v4 = next((x for v5 in v3.tracks if v5.mode.lower() != 'audio'), None)
if v4:
v6 = os.path.join(v2, v3.bin_file... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> str:
v2 = os.path.abspath(os.path.join(self._dbdir, '%s%d' % (self._dbname, self._last_flag)))
while os.path.exists(v2):
self.... |
Imports:
```python
from textwrap import dedent
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> str:
if isinstance(v1, str):
v2 = dedent(v1)
elif not isinstance(v1, (list, tuple)):
v2 = '\n'.join(v1)
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(ctypes.Structure):
pass
```
Input Types: ctypes.POINTER(v0)
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: ctypes.POINTER(v0)):
assert self._handle >= 0
self._lib.khaiii_free_results(self._handl... |
Imports:
```python
import math
import numpy as np
import typing
```
Type definitions:
Input Types: np.array
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.array=None):
v2 = sum([math.pow(abs(v1[i]), 2) for v3 in range(len(v1))])
v2 = v2 / len(v1)
v4 = v2 / math.po... |
Imports:
```python
import math
import numpy as np
import typing
```
Type definitions:
Input Types: int, int
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int=None, v2: int=None) -> list:
v3 = 1.0 / math.factorial(v2)
v4 = [list() for v5 in range(v1)]
v6 = 1.0
for v7 ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Iterable[Accent]
```
Input Types: discord.Member, v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: discord.Member, v3: v0) -> None:
if v2.guild.id not in self._accents:
self._accents[v2.guild.id] ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = [f'{key}: {value}' for (v2, v3) in self.headers.items()]
return '\n'.join(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: logging.LogRecord
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: logging.LogRecord) -> None:
try:
self.acquire()
try:
if self.console.file.closed:
return
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ndarray, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ndarray, v2=0.5):
v3 = self.predict_proba(v1)
return (v3 >= v2).astype(int)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Any]) -> Dict[str, Any]:
v1 = super()._modify_params(v1)
v1[self._query_type('datasets').param] = self._datasets
ret... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v0(f"======= Executable '{self.name}' =======\n")
for v1 in self.coreclrs_run.values():
v1.print()
``` |
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 = {x: format(i, '02d') for (v3, v4) in enumerate(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 1)}
... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[str]
Dependencies:
```python
def v0(v1: int, v2: int) -> str:
v3 = v1 % v2
v4 = chr(97 + v3)
return v4
```
Function Name: v5
Function:
```python
def v5(v6: str) -> Optional[str]:
v7 = 'b'
v8 = 3
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[int, int], int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple[int, int], v2: int):
(v3, v4) = v1
return (0, abs(v2 - v4))
``` |
Imports:
```python
import math
import numpy as np
import typing
```
Type definitions:
Input Types: Iterable[Tuple[float, any]]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[Tuple[float, any]]) -> None:
v1 = sorted(v1, key=lambda evaluation: evaluation[0], reverse=... |
Imports:
```python
import typing
```
Type definitions:
Input Types: T.List[str]
Output Type: T.Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: T.List[str]) -> T.Dict[str, str]:
v2 = {}
v3 = iter(v1)
try:
for v4 in v3:
v2[v4] = next(v3)
except StopItera... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.