text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: Optional[Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> Optional[Any]:
for v2 in v1.get('body', dict()).get('devices', list()):
for v3 in v2.get('reports', list()):
if v3.get('associate... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Dict[str, Any], Dict[str, Any]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Dict[str, Any], v3: Dict[str, Any]) -> str:
try:
v4 = self.widget_variant_modifiers[v1](v2)
except KeyE... |
Imports:
```python
import warnings
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.current_idx
if v1 > 0:
warnings.warn('The last trajectory in the replay buffer will be truncated... |
Imports:
```python
import re
from pprint import pprint
import nltk
import pandas as pd
from gensim import corpora
from gensim import models
from gensim import similarities
import typing
```
Type definitions:
Input Types: List[str], int, int, List[str]
Output Type: dict
Dependencies:
```python
def v0(v1: str, v2: List[... |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: str, dict, bool
Output Type: dict
Dependencies:
```python
def v0(v1: dict={}, v2: str=EC2_DEFAULT_REGION):
if v1:
v3 = boto3.client('ec2', region_name=v2, aws_access_key_id=v1['AccessKeyId'], aws_secret_access_key=v1['Secre... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict):
v2 = {}
for (v3, v4) in v1.items():
for v5 in v4.item_list:
if v5.id not in v2:
v2[v5.id] = v5
return v2
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path):
for v2 in os.listdir(v1):
if not v2.startswith('.'):
yield v2
``` |
Imports:
```python
import argparse
import copy
import textwrap
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: tp.Dict[str, tp.Any]) -> None:
if 'config_values' in v1.keys():
v2 = {e[0].replace('-', '_'): e[1] for v3 in [arg.split('=') for v4 in v1['co... |
Imports:
```python
import typing
```
Type definitions:
Input Types: config_pb2.MetricsSpec
Output Type: Optional[Dict[int, float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: config_pb2.MetricsSpec) -> Optional[Dict[int, float]]:
if v1.aggregate.HasField('top_k_list'):
if v1.aggregate.c... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
while self.environment.array[self.environment.current_ptr] != 0:
for v2 in v1:
self.environment.parse_command(v2)
sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
try:
v2 = self.today_times
except:
return False
v3 = [x for v4 in v2 if v4.hour >= v1 and v4.hour < v1 + 1]
if no... |
Imports:
```python
import numpy as np
import numpy.typing as npt
import typing
```
Type definitions:
Input Types: npt.ArrayLike, float or int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: npt.ArrayLike, v2: float or int, v3: int) -> int:
if v2 <= 1:
v2 = int(np.floor... |
Imports:
```python
import os
from random import shuffle
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2):
v3: Dict[str, List[str]] = dict()
for v4 in os.listdir(v1):
v5 = os.path.join(v1, v4)
... |
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=3) -> int:
v3: int = 0
v1 = [int(x) for v4 in v1]
for (v5, v6) in enumerate(v1[v2:], start=v2):
v7 = v1[v5 - v... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types:
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: Optional[List[int]]=None, v2: Optional[List[float]]=None, v3: int=450) -> Tuple[Dict[str, Any], Dict[str, List[int]]]:
if v1 is None:
v1 = [100, 200, 350]
... |
Imports:
```python
from subprocess import STDOUT, check_output, CalledProcessError, TimeoutExpired
import typing
```
Type definitions:
```python
v0 = List[str]
```
Input Types: str, List[v0]
Output Type: Any
Dependencies:
```python
def v1(v2: str) -> str:
try:
v3 = str(check_output([TOOL, Z3STR3_OPT, v2], s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str) -> str:
assert v1 >= 2
v3 = []
v3.append(self.get_ptr_suffix_id(v1))
if self.paramQual:
v3.append(self.get_modifiers_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[str, str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Tuple[str, str, str]:
v2 = v1.split('/')
return (v2[-4], v2[-3], v2[-2])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: socket.socket, int
Output Type: typing.Generator[bytes, None, bytes]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: socket.socket, v2: int=16384) -> typing.Generator[bytes, None, bytes]:
v3 = b''
while True:
v4 = v1.re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
v1 = v1.strip()
if 'e' in v1:
v2 = v1.split('e')
if len(v2) != 2:
return False
else:
retu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: bool
Dependencies:
```python
def v0(v1, v2):
if v1 == len(nums):
if v2 == sum(nums) / 2:
return True
else:
return False
v3 = v0(v1 + 1, v2 + nums[v1])
v4 = v0(v1 + 1, v2)
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Iterator[Tuple[str, str, List[str], str]]
Dependencies:
```python
def v0(v1):
v2 = []
print('loading examples from {0}'.format(v1))
with jsonlines.open(v1) as v3:
for v4 in v3:
v2.append(v4)
re... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
v0 = np.ndarray
```
```python
v1 = float
```
Input Types: float
Output Type: Tuple[v0, v1]
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: float) -> Tuple[v0, v1]:
v4 = np.array([a_node.n for v5 in self.root.ch... |
Imports:
```python
import math
import numpy as np
import scipy.signal
from scipy import interpolate
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame) -> np.ndarray:
v2 = math.floor((v1[v1.columns... |
Imports:
```python
from multiprocessing import Queue, Process, cpu_count
import typing
```
Type definitions:
Input Types: np.matrix, np.matrix, np.matrix
Output Type: float
Dependencies:
```python
def v0(v1: np.matrix, v2: np.matrix, v3: int, v4: int) -> np.matrix:
v5 = v1.shape[0]
v6 = v5 // v3
v7 = v5 % ... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Dict[str, tf.Tensor], List[str], str
Output Type: Dict[str, tf.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, tf.Tensor], v2: List[str]=None, v3: str=None) -> Dict[str, tf.Tensor]:
v4 = dict()
if v2... |
Imports:
```python
import functools
import tensorflow as tf
from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint
import typing
```
Type definitions:
Input Types: Mapping[str, tf.data.Dataset], Any, int
Output Type: Dict[str, tf.data.Dataset]
Dependencies:
```python
def v0(v1: Mapping[str, tf.Tenso... |
Imports:
```python
import copy
import typing
```
Type definitions:
```python
v0 = str
```
Input Types: List[v0], List[v0]
Output Type: List[v0]
Dependencies:
```python
def v1(v2: v0, v3: v0) -> bool:
for (v4, v5) in v3.items():
if v5 > v2.get(v4, 0.0):
return False
return True
```
```python
... |
Imports:
```python
import numpy as np
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, int
Output Type: tf.float32
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Tensor, v2: int) -> tf.float32:
tf.debugging.assert_integer(v2)
tf.debugging.assert_less_equal... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
```python
def v0(v1):
for v2 in v1:
if isinstance(v2, list):
yield from v0(v2)
else:
yield v2
```
Function Name: v3
Function:
```python
def v3(v4) -> int:
v5 = []
f... |
Imports:
```python
from datetime import datetime
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: DataFrame, str, str, float, float, int, int, int, Tuple, Path, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: DataFrame, v2: str, v3: str, v4: float=... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v2 = v1['model'].export_model()
v2.save(f'{self.model_name}', save_format='tf')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Auth.contextmgr
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Auth.contextmgr:
if self.conn.login and self.conn.password:
return self._auth_via_password()
if 'token_name' in self.conn.extra_dejson a... |
Imports:
```python
from datetime import date, datetime, time
import typing
```
Type definitions:
Input Types: time
Output Type: float
Dependencies:
```python
def v0(v1: Optional[datetime]) -> float:
if v1:
return int(v1.timestamp() * 1000.0)
else:
return 0
```
Function Name: v2
Function:
```pyt... |
Imports:
```python
import logging
import os
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 self.llvm_dir is None:
raise ValueError('path to llvm folder must be set in ChooseProject.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple) -> bool:
self.PageVersionsDict.append([v1[0], v1[1]])
self.contributors[v1[0]] = v1[2]
return True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> None:
(v2, v3) = ([0] * len(v1), 0)
for v4 in v1:
if v4 != 0:
v2[v3] = v4
v3 += 1
v1[:] = v2[:]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Distribution
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> Distribution:
v2 = self.encoder(v1)
v3 = v2[:, -self.flow_context_features:]
(v4, v5) = v2[:, :-self.flow_context_features].c... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Literal['human', 'computer']
```
Input Types: v0
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0) -> v0:
if v2 == 'human':
return 'computer'
else:
return 'human'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int):
v3 = []
for (v4, v5) in enumerate(self.target):
if v5 == v1:
v3.append(v4)
if len(v3) < v2:
... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0(AbstractModelFeature):
v1: FeatureDataType
def v2(self) -> None:
"""Sanitize attributes of the dataclass."""
v3 = self.num_dimensions
v4 = self.data.shape[-1]
if v3 != 2 and v3 != 3:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: WDL.Error.SourceNode
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: WDL.Error.SourceNode) -> Any:
if not self.auto_descend:
for v2 in v1.children:
self(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
(v2, v3) = self.service.api.get_project(v1)
return v2['configuration']['number_of_inspections']
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for v1 in self._nodes:
v1.delete()
self._nodes = []
self._update_timer = None
self._dead = True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, Any, bool
Output Type: 'dict'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True, v2=False, v3: bool=True) -> 'dict':
v4 = self.frame.copy()
v5 = {}
for v6 in self.system.fields:
v7 = [*self.to_li... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, **v1: Any) -> None:
(v2, *v3) = ('set_led_state', 'off')
await getattr(self._channel, v2)(*v3)
``` |
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.get_dependent_architectures()
v3 = [str(arch) for v4 in v2]
for v4 in v2:
v4.update_var_and_func(v1)
for v5 in v3:
... |
Imports:
```python
import itertools
import typing
```
Type definitions:
Input Types: Tuple[int, int], int
Output Type: List[Tuple[int, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple[int, int], v2: int=1) -> List[Tuple[int, int]]:
v3 = range(max(v1[0] - v2, 0), min(v1[0] + v2, sel... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: git.Repo, Optional[str], Optional[str], str, str
Output Type: git.Repo
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: git.Repo, v2: Optional[str]=None, v3: Optional[str]=None, v4: str='ODIN_GIT_NAME', v5: str='ODIN_GIT_EMAIL... |
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.READER.get(v1)
return self.try_to_add_location(v2, 'country') + self.try_to_add_location(v2, 'subdivisions') + self.try_to_add_lo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> dict:
v3 = v1['_source']['name']
v4 = {'title': v3, 'type': 'cluster', 'folder': True, 'children': []}
for v5 in v1['_source']['nodes']... |
Imports:
```python
import numpy as np
from scipy import ndimage, signal
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, int, int, int, int, str
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray, v2: int, v3: str) -> np.ndarray:
(v4, v5, v6) = v1.shape
if v3 == 'unif... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Optional[str]:
v1 = v1.lower()
if 'zulip' in v1:
return 'Zulip'
elif 'edge' in v1:
return 'Edge'
elif 'opera' in v1 ... |
Imports:
```python
from qiskit.pulse import channels, instructions, library
from qiskit.pulse.configuration import Kernel, Discriminator
from qiskit.pulse.exceptions import QiskitError
from qiskit.pulse.parser import parse_string_expr
from qiskit.pulse.schedule import Schedule
from qiskit.qobj import QobjMeasurementOpt... |
Imports:
```python
import sys
from datetime import datetime
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0() -> int:
try:
return int(datetime.max.timestamp())
except (OverflowError, ValueError, OSError):
v1 = sys.ma... |
Imports:
```python
import typing
```
Type definitions:
Input Types: object
Output Type: Optional[object]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: object) -> Optional[object]:
(v2, v3) = self._instances.get(v1, (None, None))
return v2
``` |
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:
if not v1:
return 0
(v2, v3) = (0, len(v1) - 1)
(v4, v5) = (v1[v2], v1[v3])
v6 = 0
while v2 < v3:
i... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = GroupRuntime
def __init__(self, v2: str, *, v3: int=1, v4=None, v5: Optional[List[Callable]]=None, **v6):
self.name = v2
self.hooks = v5
self.replicas = v3
self.options = v6
self._state_type ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = 'Task **A new task for this story** ([Add cool feature!](https://app.clubhouse.io/zulip/story/11)) was completed. :tada:'
self.check_webhook('st... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
if len(self._textures) > 1:
assert 0 <= v1 <= len(self._textures) - 1
self._current_tex_index = v1
``` |
Imports:
```python
import queue
import typing
```
Type definitions:
Input Types: queue.Queue[int], threading.Event
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: queue.Queue[int], v2: threading.Event) -> None:
v3 = False
while True:
try:
v4 = v1.get(timeou... |
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._current_node._children:
self._current_node = self._current_node._children[v1]
else:
raise ValueError('Unkn... |
Imports:
```python
from random import randint
import typing
```
Type definitions:
```python
class v0:
def __init__(self):
self.radar_positions = deque([(5, 4), (5, 10), (10, 8), (15, 4), (15, 10), (25, 4), (25, 10), (20, 8)])
self.grid = Grid()
self.my_score = 0
self.enemy_score = 0... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str]) -> str:
v2 = 1
v3 = ''
while True:
v4 = v1[0][:v2]
if all((name[:v2] == v4 for v5 in v1)):
v2 += 1
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[Optional[str], Optional[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Tuple[Optional[str], Optional[str]]:
v2 = None
v3 = None
for v1 in v1.split():
if v1 in ('UA', 'UUA'):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: c_void_p
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: c_void_p) -> bool:
if self.api.apiErrorFlag(v1) == 1:
return True
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.comparer.message
v2 = self.comparer.task_name
return f'[{v1}] {v2}'
``` |
Imports:
```python
import subprocess
import typing
```
Type definitions:
```python
v0 = collections.namedtuple('TreeInfo', ['mode', 'object_type', 'sha'])
```
Input Types: Dict[str, v0]
Output Type: str
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Dict[str, v0]) -> str:
v3 = ''
for (v4,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = sum([ord(x) for v3 in v1])
return (self.a * v2 + self.b) % self.p % self.m
``` |
Imports:
```python
import torch
from torch import nn
from torch import Tensor, FloatTensor, LongTensor
import typing
```
Type definitions:
Input Types: Tensor, Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor, v2: Tensor):
v3 = self.upsample_top_to_bottom(v1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if len((v2 := v1.split())) != 2:
raise ValueError(f'input takes 2 arguments but {len(v2)} were given')
try:
v3 = int(v2[0])
v4 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: [int]
Output Type: [int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: [int]) -> [int]:
v2 = v1[:]
for v3 in range(1, len(v2)):
v2[v3] = v2[v3] * v2[v3 - 1]
v4 = v1[:]
for v3 in list(range(0, len(v4) - 1... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str) -> Any:
try:
with open(v1, 'r') as v2:
v3 = yaml.safe_load(v2)
return v3
except (OSError, yaml.YAMLError) as e:
raise LoadConfigErro... |
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):
v2 = self._get_base_pq(v1)
v3 = self.y[v1]
for v4 in self._Uz(v1):
v5 = self.SVMs.coef_[v4] - self.SVMs.coef_[v3]
... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool):
v2 = self._get_device_bands(v1)
return random.choice(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union['_Subject', '_ObjSubject', '_IterableSubject', '_StringSubject', '_ListOrTupleSubject', '_SetSubject', '_DictSubject']
```
Input Types: Iterable
Output Type: v0
Dependencies:
```python
def v1(v2: Any) -> str:
return f'{type(v2).__name__} <{... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> None:
v3 = 'depart_' + v2.__class__.__name__
v4 = getattr(self, v3, self.unknown_departure)
v4(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, str, dict, bool, bool, int, float
Output Type: Tuple[bool, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str=None, v3: str=None, v4: str='rename', v5: dict=None, v6: bool=False, v7: bool=False, v8: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: Any) -> str:
if not len(v1):
raise TypeError('missing handler name as the first argument')
return self.handler_for(v1[0]).command_for(*v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
if len(self.pred_prob) == 0:
raise Exception('No logits provided.')
if self.strategy == 'uncertainty':
self.uncertainty_sampling()
... |
Imports:
```python
from random import random, choice, randint
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: Callable = None
v2: Callable = None
v3: Any = None
v4: Any = None
```
Input Types: Any, v0
Output Type: Any
Dependencies:
```python
def v5(v6, v7):
v8 = 0.7
if v6 ... |
Imports:
```python
import json
from urllib import parse
import typing
```
Type definitions:
Input Types: str, Optional[Dict[str, Any]]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='/superset/explore', v2: Optional[Dict[str, Any]]=None) -> str:
v2 = v2 or {}
v3 = {'... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict):
assert isinstance(v1, dict)
assert all([isinstance(m, pd.DataFrame) for v2 in v1.values()])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.plugin.get_client(self)
return v1.get_password_for_storage_encryption()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: NoReturn
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> NoReturn:
if v1 == 'reset':
self._rows_number = 0
self.pagination.ids.button_back.disabled = True
self.pagination.ids.b... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for (v1, v2) in enumerate(self.gens):
v2.gen_condition()
if v1 < len(self.gens) - 1:
self.builder.activate_block(self.cond_bl... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str]) -> Any:
v2 = self._connection_resolver.resolve(v1)
self.__validate_connection(v1, v2)
v3 = self._credential_resolver.lookup... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: pd.DataFrame, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: int):
v3 = v1['timestamp']
(v4,) = np.where(v3 >= v2)
if len(v4) > 0:
v5 = int(v4[0])
else:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float):
v3 = self.gradient.pop(v1)
self.gradient[v2] = v3
self.gradientChanged.emit()
self.update()
``` |
Imports:
```python
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.features is not None and len(self.features) > 0:
self.features = np.delete(self.features, -1, 0)
se... |
Imports:
```python
from tqdm import tqdm
import numpy as np
import typing
```
Type definitions:
Input Types: np.ma.masked_array, np.ma.masked_array, float
Output Type: Any
Dependencies:
```python
def v0(v1: np.ma.masked_array, v2: float) -> bool:
v3 = np.array([np.count_nonzero(img.mask) / (img.shape[1] * img.shap... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
v1 = 'brew services stop v2ray-core'
subprocess.check_output(v1, shell=True).decode('utf-8')
return not self.running()
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Union[list, List[list]], Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1):
return [item for v2 in v1 for v3 in v2]
```
Function Name: v4
Function:
```python
def v4(v5: Union[list, List[list]], v6=False, v7=False):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, dict, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict=None, v2: dict=None, v3: str=''):
if v2 is None:
v2: dict = {'dimensions': [], 'dimensionsItems': [], 'metrics': [], 'filters': [],... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> str:
v3 = [ord(char) for v4 in v1]
v5 = [ord(v4) for v4 in v2]
for v4 in v1:
v3.append(ord(v4))
for v4 in v2:
v5... |
Imports:
```python
import numpy as np
from scipy.signal import savgol_filter, butter, filtfilt
from scipy.integrate import simps
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=901) -> np.ndarra... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, int, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: int, v3=0.08):
v4 = v1[:, 2]
v5 = np.linalg.norm(v4[:2])
v6 = 1
for v7 in sorted([a for v8 in range(-v2, v2 + 1) if v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: x509.Name
Output Type: List[Tuple[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: x509.Name) -> List[Tuple[str, str]]:
v2 = []
for v3 in v1:
if hasattr(v1, 'rfc4514_attribute_name'):
v4 = v3.rfc45... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.get_url('private')
self.session.put(v1)
``` |
Imports:
```python
import torch
import torch._C
from torch.fx.node import map_aggregate
from torch.fx.operator_schemas import normalize_function, create_type_hint
from torch.utils._pytree import tree_map
import typing
```
Type definitions:
Input Types: torch._C.FunctionSchema, List[torch._C.Argument], Dict[str, Any]
O... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.