text stringlengths 190 325k |
|---|
Imports:
```python
from tensorflow.compiler.xla import xla_data_pb2
import typing
```
Type definitions:
Input Types: Any
Output Type: jax.lax.DotDimensionNumbers
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> jax.lax.DotDimensionNumbers:
v2 = xla_data_pb2.DotDimensionNumbers().FromString(v1)
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[discord.VoiceChannel, discord.StageChannel]
```
Input Types: discord.Guild, Optional[v0]
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
async def v1(self, v2: discord.Guild, v3: Optional[v0]):
if v3 is None:
s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[int, int], int, Callable[[int], int], Callable[[int], bool], Set[int]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[int, int], v2: int, v3: Callable[[int], int], v4: Callable[[int], bool], v5: Set[int]) ->... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Set[str]
Output Type: List[Tuple[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Set[str]) -> List[Tuple[str, str]]:
v2 = self.node_mapping.keys() - v1
v3 = []
for v4 in filter(lambda node_id: v4 in v2, sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self.isExtracting:
self.startLoading()
else:
self.stopLoading()
``` |
Imports:
```python
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 = 0
for v4 in self.subscriptions:
v3 += self.delete_replace_subscriber(v1, v4, change_all=True, new_subscriber_id=... |
Imports:
```python
import torch
from torch.nn.functional import cross_entropy, mse_loss, binary_cross_entropy
from torch.nn.modules.activation import ReLU
from torch.nn.modules.linear import Linear
from torch.optim.optimizer import Optimizer
from torch.utils.data.dataloader import DataLoader
import typing
```
Type defi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame, v2: pd.DataFrame) -> pd.DataFrame:
v3 = v2.iloc[:, 1:] * v1.iloc[:, 1:]
v4 = v3.sum(axis=1)
v5 = v3.di... |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = argparse.ArgumentParser()
v1.add_argument('-i', '--input', help='Path to vulnerability scan JSON report', action='store', dest='... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Pattern[str], int, bool, Any, type, Optional[Iterable[type]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Pattern[str], *, v3: int=1, v4: bool=False, v5=None, v6: type=str, v7: Optional[Iterable[type]]... |
Imports:
```python
import pandas as pd
from matplotlib import cm
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
v2 = self.df.filter(regex='year|country|population|consumption|gdp|total... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int):
(v3, v4) = os.path.split(v1)
(v5, v6) = os.path.splitext(v4)
return os.path.join(v3, '%s_%03d%s' % (v5, v2 + 1, v6))
`... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str, v2: ClientSession):
"""
YouTube API класс
:param key: API ключ
:param session: aiohttp session object
"""
self._session = v2
self._key = v1
async def v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
self.receivers.discard(v1)
self.__discard(self.mid_table, v1)
self.__discard(self.ssrc_table, v1)
self.__discard(self.payload_type_tab... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: list):
if v1 in v2:
print(f'value was found')
return 1
else:
print(f'value not found')
return 0
``` |
Imports:
```python
import asyncio, json
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2):
self.base_url = v1
self.verify = v2
def v3(self, v4, v5) -> Tuple[str, dict]:
v6 = requests.get(v4)
if v6.status_code == 200:
try:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> str:
v2 = 2 ** 10
v3 = 0
v4 = {0: '', 1: 'k', 2: 'm', 3: 'g', 4: 't'}
while v1 > v2:
v1 //= v2
v3 += 1
return f'{int(v1 * ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[dict, list]
Output Type: Union[dict, list]
Dependencies:
```python
def v0(v1: dict):
if '_id' in v1:
v1['_id'] = ObjectId(v1['_id'])
return v1
```
```python
def v2(v3: Union[List[dict], dict]) -> Union[List[dict], dict]:
def... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str or bytes
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str or bytes, **v2):
(v3, v4, v5) = self.seal(message=v1, **v2)
v6 = {'desc': 'Seal', 'method': {'message': self.envelope.message_cipher.method... |
Imports:
```python
import sys
import os
from os.path import join
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0(v1: str='collector') -> str:
v2 = join(get_root_path(), 'data', v1)
v3 = os.environ.get('DATA_PATH', v2)
return v3 if v3 else v2
```
```python
d... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> None:
self._expert_paths = v1
return
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.stop()
for v1 in self._conf_files.values():
try:
os.remove(v1)
except FileNotFoundError:
pass
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = self.s3_client.get_paginator('list_objects_v2')
v2 = sum((page['KeyCount'] for v3 in v1.paginate(Bucket=self.bucket, Prefix=self.database)))
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, str, str
Output Type: None
Dependencies:
```python
def v0(v1: str) -> str:
v2 = None
v3 = False
for (v4, v5) in enumerate(v1):
if v3:
v3 = False
else:
v3 = v5 == '\\'
if v5 != ' ':... |
Imports:
```python
import torch
import torch.nn.functional as F
from torch import Tensor
import typing
```
Type definitions:
Input Types: Union[List[Tensor], Tensor], Union[List[Dict[str, Tensor]], None], int, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[List[Tensor]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, List[str]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: Union[str, List[str]]) -> Any:
if not isinstance(v1, list):
v1 = [v1]
return await self._query_aggr_function(func_name='... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> List[str]:
v2 = []
for v3 in v1.split(','):
if v3.startswith('files('):
v2.append(v3[6:])
elif v3.endswith(')'... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
v1: str
v2: tuple
def __init__(self, v3='', v4=EMPTY):
self.name = v3
self.params = v4
self.options = EMPTY
def v5(self):
return f'undefined({self.__class__.__name__})'
def __repr__(... |
Imports:
```python
import json
from pathlib import Path
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 = self.get_compile_order()
v3 = []
for v4 in v2:
v3.append(dict(file... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = []
with open(v1, 'r') as v3:
v4 = v3.readlines()
for v5 in range(len(v4)):
v6 = v4[v5]
for v7 in ra... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, int]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, int]):
for v2 in v1:
if v2 == 'RDM':
v3 = ['CHR', 'INT', 'STR', 'MNY', 'SPR'][id(v2) % 5]
setattr(self,... |
Imports:
```python
import numpy as np
import subprocess
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str):
v3 = subprocess.check_output("vibrate %s -k %s CR | grep -oP '[-+]*[0-9]*\\.[0-9]{2,9}'" % (v1, v2), sh... |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3) -> list:
v3 = copy.deepcopy(v3)
(v3[1], v3[2]) = (v1, v2)
v4 = 0
while v3[v4] != 99:
if v3[v4] == 1:
... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> None:
v1.add_argument('--json', type=Path, required=True, help='json with training options')
v1.add_argument('--gpu_ids', nargs='... |
Imports:
```python
import requests
from requests.exceptions import ReadTimeout, ConnectionError, ConnectTimeout
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0() -> dict:
v1 = 'https://www.impfterminservice.de/assets/static/impfzentren... |
Imports:
```python
import json, os
from typing import cast, Mapping, Optional, Tuple, Union
import warnings
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
```python
def v0(v1: str, v2: memoryview, v3: bool=False, v4: str=None) -> Union[str, memoryview]:
v5 = RequestMessage(user=us... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self.is_enabled:
return
self.sender_thread.start()
self.shutdown_timer.start()
if self.sysmetrics_is_enabled:
self.sys... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
if self.accept(v1):
return True
raise ValueError(f'Expecting {v1} got {self.current.tid}.', self.current.lineno, self.current.col... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0(v1: str, v2: str=None, v3: Dict=None, v4: List=None) -> str:
if v2 is None:
LOGGER.info(f'Uploading env to {v1}')
packaging.upload_env_to_hdfs(archive_on_hdfs=v1, additional_packages... |
Imports:
```python
import glob
import os
import datetime
import shutil
import zipfile
import pandas
import numpy
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
```python
def v0(v1):
v2 = numpy.radians(v1['lat'])
v3 = numpy.radians(v1['lon'])
v4 = numpy.radians(v1['... |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types:
Output Type: 'BaseExperiment'
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> 'BaseExperiment':
v1 = v0.copy(self)
v1._experiment_options = v0.copy(self._experiment_options)
v1._run_options = v0.copy(self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, pathlib.Path, bool
Output Type: t.List[pathlib.Path]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: pathlib.Path, v3: bool) -> t.List[pathlib.Path]:
v4 = []
if v3:
for v5 in v2.rglob(v1):
v4.a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple, str
Output Type: Any
Dependencies:
```python
def v0(v1: tuple, v2: str):
v3 = moves[v2]
return (v1[0] + v3[0], v1[1] + v3[1])
```
Function Name: v4
Function:
```python
def v4(v5: tuple, v6: str):
v7 = [v5]
for v8 in v6:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[Sequence[str]]
Output Type: Optional[Union[str, Sequence[str]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[Sequence[str]]) -> Optional[Union[str, Sequence[str]]]:
if not v1:
return None
elif len(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[str, Optional[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Tuple[str, Optional[str]]:
for v2 in self.c_context.extension_tags:
if v1.endswith(v2):
return (v1[:-len(v... |
Imports:
```python
from typing import List
from typing import NamedTuple
from typing import Optional
from typing import Tuple
from typing import cast
import typing
```
Type definitions:
Input Types:
Output Type: 'Transition'
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> 'Transition':
v1 = c... |
Imports:
```python
import torch
import math
from torch.optim import Optimizer
from torch.optim.lr_scheduler import LambdaLR
import typing
```
Type definitions:
Input Types: Optimizer, int, float, float, int
Output Type: Any
Dependencies:
```python
def v0(v1: int):
if v1 > num_training_steps:
return lr_end ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.tracker.reset()
for v1 in self.tracker:
if self.tracker[v1].icon:
self.buttons[v1].check_state(self.tracker[v1])
``` |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data.sampler import SubsetRandomSampler
from torch.utils.tensorboard import SummaryWriter
import typing
```
Type definitions:
Input Types: str, str, float, float, float, int, int, float
Output Type: None
Dependencies... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.dataset is not None:
self.name = self.dataset.name.split('/')[-2:-1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
global val, newval, oldval
v1 = v1 + 1
v2 = -50
v3 = -50
``` |
Imports:
```python
from functools import reduce
import typing
```
Type definitions:
Input Types: int, List[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: List[int]) -> int:
v3 = []
while v2:
if len(v2) == 1:
v3.append(v1 ** v2.pop() % 13... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = os.environ.get('EDGE_CONFIG_PATH')
if v2 is None:
v2 = os.path.join(os.path.dirname(v1), '../../', 'edge.yaml')
return v2
``` |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: Union[Text, int]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[Text, int]) -> None:
v2 = ['aio_pika', 'aiormq']
for v3 in v2:
logging.getLogger(v3).setLevel(v1)
``` |
Imports:
```python
from collections import ChainMap, deque
import typing
```
Type definitions:
Input Types:
Output Type: Optional[ChainMapType]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Optional[ChainMapType]:
v1: Optional[ChainMapType] = None
v2: Dict[str, str] = {}
for v3 in s... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass()
class v0:
v1: set
v2: nx.DiGraph
```
Input Types: v0, Set[tuple]
Output Type: v0
Dependencies:
```python
def v3(v4: Set[tuple]) -> v0:
v5 = nx.DiGraph()
v5.add_edges_from(v4)
return v0(edges=v4, directed_graph=v5)
```
Func... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass(frozen=True, order=True)
class v0:
v1: INDEX
v2: INDEX
@property
def v3(self) -> Tuple[INDEX, INDEX]:
return (self.at, self.to)
def v4(self, v5: v0) -> bool:
return self.to < v5.at
def v6(self, v7: v0)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str
Output Type: List[Dict[str, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str) -> List[Dict[str, Any]]:
try:
v3 = v1[v2]
except KeyError:
return []
if isinstance(v3, list):
retur... |
Imports:
```python
import cv2
import requests
import tempfile
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: tuple
Dependencies:
```python
def v0(v1):
v2 = requests.get(v1)
v3 = tempfile.NamedTemporaryFile(mode='wb')
v3.write(v2.content)
v4 = cv2.imread(v3.name)
v3.close()
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(list):
def __call__(self, *v1: Any, **v2: Any) -> None:
v3 = threading.Thread(target=self._callThread, args=v1, kwargs=v2)
v3.setDaemon(True)
v3.start()
def v4(self, *v5: Any, **v6: Any) -> None:
for v7 i... |
Imports:
```python
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Conv2D, MaxPool2D, GlobalAveragePooling2D, Dense
from tensorflow.keras.layers import Dropout
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import SGD
import tensorflow as tf
from tensorflow.keras.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ast.FunctionDef
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ast.FunctionDef) -> None:
if v1.name != self.component_function_name:
return
self.visited_function = True
for v2 in self.valida... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2=None, v3=None):
if v2 is not None:
assert v2 % 32 == 0
if v3 is not None:
assert v3 % 32 ==... |
Imports:
```python
import binascii
import os
from hashlib import pbkdf2_hmac
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str=None):
if isinstance(v1, str):
v1 = v1.encode('utf8')
if not v2:
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = list(set([x.order for v2 in self.key_fields if v2.type == 'str']))
if v1:
return 'forward' if 'forward' in v1 else 'reverse'
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str, Any, Optional[List[Any]], str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any, v2: str, v3: Any, v4: Optional[List[Any]]=None, v5: str=None) -> Any:
v6 = getattr(v1, v2)
if v4:
v6.argtypes... |
Imports:
```python
import pandas as pd
from pandas import HDFStore
from pandas import IndexSlice as idx
from pandas.api.types import is_numeric_dtype
from pandas.core.generic import NDFrame
import typing
```
Type definitions:
Input Types: Union[str, HDFStore], callable
Output Type: Any
Dependencies:
```python
def v0(v... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Union[int, float]
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray, v2: Union[int, float]) -> int:
if type(v2) is float:
if 0.0 < v2 < 1.0:
v2 = round(v1.size * v2)
... |
Imports:
```python
from pandas._typing import Label
from pandas.errors import AbstractMethodError
from pandas.util._decorators import cache_readonly
from pandas.core.dtypes.common import is_float, is_hashable, is_integer, is_iterator, is_list_like, is_number, is_numeric_dtype
from pandas.core.dtypes.generic import ABCD... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Tuple[str, str, bool]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> Tuple[str, str, bool]:
v2 = '"' if v2 == '``' else v2
if not len(v1):
return (v2, v2, True)
v3 = '' if v2 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Image.Image, str
Output Type: Image
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Image.Image, v2: str) -> Image:
v3 = (700, 700)
v1.thumbnail(v3)
v1.save(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
(v2, v3) = self.expand_deps_(v1)
return '[' + '-'.join(v2 + ['HEAD'] + v3) + ']'
``` |
Imports:
```python
import pathlib
import typing
```
Type definitions:
Input Types: core.Config
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: core.Config) -> str:
v2 = pathlib.Path(v1.processor.working_dir).joinpath('config.yaml')
v1.to_yaml(str(v2))
return str(v2)
``` |
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) -> Any:
(v3, v4) = self.get_entry(v1)
return v3[v2]
``` |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int=settings.PASSWORD_MIN_LENGTH) -> bool:
if len(v1) < v2:
return False
elif not re.search('[a-z]', v1):
return Fals... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0():
v1 = None
v2 = 0
for v3 in M:
if M[v3] > v2 and v3 != last_key:
v1 = v3
v2 = M[v3]
M[v1] -= 1
return v1
```
Function Name: v4
Function:
```pytho... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> None:
print(f'Running stubgen: stubgen -p {v1}')
subprocess.run(['stubgen', '-p', v1], check=True)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.price == 13:
self.sell = []
``` |
Imports:
```python
import torch
from torch import nn
from torch.autograd import Variable
from torch.nn import functional as F
from torch import Tensor
import typing
```
Type definitions:
Input Types: Tensor, Tensor, Tensor, nn.Module
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: int) -> str:
v4 = v1.find(v2)
if v4 == -1:
return v1
v5 = max(0, v4 - v3)
v6 = min(len(v1), v4 + len(v2) + v3)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[int]]
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[List[int]]) -> List[int]:
v2 = [0] * len(v1[0])
for v3 in range(len(v1)):
for v4 in range(len(v1[0])):
v2[v4] += v1... |
Imports:
```python
import numpy as np
from sklearn.utils.validation import check_is_fitted, check_array
import typing
```
Type definitions:
Input Types: np.ndarray, bool
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: bool=False) -> np.ndarray:
v1 = che... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[float], List[float]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[float]=None, v2: List[float]=None):
if v1 is None:
v1 = self.rest_pose
if v2 is None:
v2 = [0 for v3 in v1]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str):
v4 = self._model_api.get_models(v1, self.model_registry_id, shared_registry_project_name=self.shared_registry_project_name... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[Any, Sequence[Any]]
Output Type: List[Dict[Any, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[Any, Sequence[Any]]) -> List[Dict[Any, Any]]:
v2: List[Dict[Any, Any]] = [{} for v3 in range(max(map(len, v1.values()))... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: Iterable[v0], int
Output Type: Iterator[List[v0]]
Dependencies:
```python
def v1(v2: Iterator[v0], v3: int) -> List[v0]:
v4 = []
for v5 in range(v3):
try:
v4.append(next(v2))
except St... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str=''):
if self._closed:
raise AssertionError('Tar file is closed')
self.tar.add(v1, v2)
``` |
Imports:
```python
import json
import numpy as np
import typing
```
Type definitions:
Input Types: str
Output Type: List[Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> List[Dict]:
with open(v1) as v2:
v3 = json.load(v2)
v4 = None
for (v5, v6) in enumerate(v3):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Iterable['Node']
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Iterable['Node']:
for v1 in self.graphs.values():
for v2 in v1.nodes:
yield v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2=True, v3=None, v4='text', v5=False, **v6):
v7 = self.__history_content_id(v1, wait=v2, **v6)
v8 = {}
if v3:
v8['... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str) -> None:
self._step += v1
self._next_summary_step = self._get_next_interval_step(self.summary_freq)
self._next_save_step = self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1, **v2) -> Tensor:
v3: Any
v4: int
(v3, v4) = v1
(v5, v6) = self(v3)
(v7, v8, v9) = self.rate_distortion_loss(v5, v3, v6)
v10 = {'val_rat... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int) -> None:
if v1 == 'x0':
return
self.values[v1] = v2
``` |
Imports:
```python
import torch
import torch.nn as nn
import torch.jit as jit
from torch import Tensor
from torch.nn import functional as F
import typing
```
Type definitions:
Input Types: Any, Any, Any, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3, v4: int):
v1... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: Sequence[Dict], str
Output Type: defaultdict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Sequence[Dict], v2: str) -> defaultdict:
v3 = defaultdict(int)
for v4 in v1:
v5 = v4[v2]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='id', v2: str='side', v3: int=0):
v3 = abs(v3) or self.timeout
return self.toSelect(by=v1, register=v2, timeout=v3)[0]
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Optional[Dict[str, Any]]
Output Type: Optional[Dict[str, pb.ParamType]]
Dependencies:
```python
def v0(v1):
return v1.__class__.__module__.split('.')[0] == 'tensorflow' and 'Tensor' in v1.__class__.__name__
```
```python
def v2(v3):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: list
Dependencies:
```python
def v0(v1: int) -> bool:
for v2 in primes_1000:
v3 = set()
for v4 in primes_1000:
v3.add(v1 - v4)
if v2 in v3:
return True
return False
```
Function ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: NoReturn
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray) -> NoReturn:
self.D_ = np.ones(v1.shape[0]) / v1.shape[0]
self.models_ = []
s... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: Tuple[List[np.ndarray], List[np.ndarray], List[int], List[np.ndarray], List[np.ndarray], List[bool], List[np.ndarray]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2=True, v3=Fals... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.