text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[dict]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[dict]):
if v1:
self._source_data['tool_shed_repository'] = {'name': v1['name'], 'owner': v1['owner'], 'tool_shed': v1['tool_shed... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame):
v2 = [',', ';', ':', '{', '}', '(', ')', '=', '>', '<', '.', '!', '?']
v3 = {}
for v4 in v1.columns:
v5 = v4.lower()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[Any]
Output Type: Dict[Any, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[Any]) -> Dict[Any, int]:
v2: Dict[Any, int] = {}
for v3 in v1:
if v2.get(v3) is None:
v2[v3] = 0
v2[... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: AsyncIterator[Tuple[str, Dict]]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> AsyncIterator[Tuple[str, Dict]]:
v1 = os.listdir(self.store)
v2 = '.json'
v3 = len(v2)
for v4 in v1:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.array, np.array, np.array, np.array, int
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.array, v2: np.array, v3: np.array=None, v4: np.array=None, v5: int=None) -> tuple:
(v6, v7) = (v1.shape[0], v2.... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str, str, Any
Output Type: subprocess.CompletedProcess
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3) -> subprocess.CompletedProcess:
v4 = subprocess.run(f'ffmpeg -y -fflags +discardcorrupt -i {... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True) -> None:
logging.info('SyncServer is started')
self._server = self._loop.run_until_complete(self._server)
logging.info(f... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, list, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: list, v3='ID'):
v4 = None
for v5 in v2:
if v1 == v5.get(v3, ''):
v4 = v5
return v4
``` |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: str
Output Type: datetime.time
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> datetime.time:
(v2, v3) = [int(num) for v4 in v1.split(':')]
return datetime.time(hour=v2, minute=v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
v2 = {'controller': 'Media', 'action': 'favMedia', 'media_id': str(v1)}
return self.network.post(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if self.fix_hint is not None:
self.fix_hint += '\n' + v1
else:
self.fix_hint = v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict, Any
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict, v2=None) -> Dict:
if v2:
return {'objects': v1, 'coordinates': v2}
else:
return {'objects': [v1], 'coordinates': v1.get('co... |
Imports:
```python
import matplotlib
from matplotlib import pyplot as plt
import typing
```
Type definitions:
Input Types: np.ndarray, Optional[str], Optional[str], Optional[str], str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: Optional[str]=None, v3: Op... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.array
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.array) -> None:
self.D[-1] = self.D_outLayer(self.A[-1], v1.reshape(-1, self.layer_size[-1])) * self.derivative[self.lastLayerAc... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ast.Lambda
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ast.Lambda):
for v2 in v1.args.defaults + v1.args.kw_defaults:
if v2 is None:
continue
self.visit(v2)
v3 = self._get_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: CoolParser.BoolContext
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: CoolParser.BoolContext):
v1.type = 'Bool'
self.types[v1] = 'Bool'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[list, str], int, str
Output Type: List[Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[list, str]=None, v2: int=-1, v3: str='all', **v4) -> List[Dict]:
v5 = False
v6 = []
v7 = 0
v8 = 100
v9 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, int]:
v1: List[Coin] = self.bundle.additions()
v2: List[Coin] = self.bundle.removals()
v3: List[Coin] = list(filter(lambda c: c not... |
Imports:
```python
from argparse import ArgumentParser, RawTextHelpFormatter
import typing
```
Type definitions:
Input Types:
Output Type: ArgumentParser
Dependencies:
Function Name: v0
Function:
```python
def v0() -> ArgumentParser:
v1 = ArgumentParser(description='CloudWatch Metrics Generator', formatter_class... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
if v1 in (0, 1, 2, 3):
self.drive = v1
return True
return False
``` |
Imports:
```python
import shutil
import subprocess
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0() -> bool:
if shutil.which('ldc2'):
return True
elif shutil.which('ldc'):
return True
elif shutil.which('gdc'):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> None:
self.waiting = v2
self.total_cost_path = v2
self.path.append(self.position)
self.prev_position = self.position
... |
Imports:
```python
import torch
from torch import nn
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 = torch.randn_like(v1) * self.sigma
return self.base_classifier((v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> None:
for v2 in range(1, 25):
v1['slot' + str(v2)] = 'empty.jpg'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[str], int, Container[str]
Output Type: Iterator[str]
Dependencies:
```python
def v0(v1: str, v2: Container[str]) -> Iterator[str]:
v3 = []
for v4 in v1:
if v4 in v2:
if v3:
yield ''.join(v3)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int) -> int:
v3 = []
for v4 in v1:
v5 = ord(v4) - 96
if v5 < 10:
v3.append(v5)
else:
v3.ex... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('_ArgT')
```
```python
v1 = TypeVar('_OtherReturnT_co', covariant=True)
```
```python
v2 = TypeVar('_ReturnT')
```
```python
v3 = TypeVar('_ReturnT_co', covariant=True)
```
```python
v4 = TypeVar('_SendT')
```
```python
v5 = TypeVar('_SendT_c... |
Imports:
```python
from math import pi
from qiskit.converters import circuit_to_dag
from qiskit.transpiler.basepasses import TransformationPass
from qiskit.dagcircuit.dagcircuit import DAGCircuit
from qiskit.extensions.quantum_initializer import isometry
from qiskit.quantum_info.synthesis import one_qubit_decompose
fro... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
if v1 == -1:
self.SetFocusedField(self.new_name)
return 1
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self) -> None:
super().__init__()
self.__container: typing.Optional[CanvasItemComposition] = None
self.__canvas_size: typing.Optional[Geometry.IntSize] = None
self.__canvas_origin: typing.Optiona... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = os.environ.get('JSM_NAMESPACE_LOCAL_RANK')
if v1 is None:
raise ValueError('Cannot determine local rank. Environment variable `J... |
Imports:
```python
import cv2
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.cap.get(cv2.CAP_PROP_FPS)
self.audio = self.audio._spawn(self.audio.raw_data, overrides={'frame_rate': int(v1)})
self.audio.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> int:
(v2, v3) = (dict(), [])
for v4 in set(v1):
v5 = v2
for v6 in v4[::-1]:
v5[v6] = v5.get(v6, dict())
... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: Any, Dict[Text, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: Dict[Text, Any]):
v3 = ['Your apartment viewing has been successfuly scheduled.', 'That time is unavailable. Please try another... |
Imports:
```python
import os
import re
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
v2 = os.listdir('input/regi')
for v3 in v2:
try:
v4 = int(re.split(' |-', v3)[0])
except ValueError:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: int
Dependencies:
```python
def v0(v1: str) -> int:
v2 = v1.replace('F', '0').replace('B', '1').replace('L', '0').replace('R', '1')
return int(v2, 2)
```
```python
def v3(v4: List[str]) -> List[int]:
return [v0(x) fo... |
Imports:
```python
import numpy as np
import pandas._libs.window as libwindow
from pandas.compat._optional import import_optional_dependency
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender, Substitution, cache_readonly
from pandas.core.dtypes.common import ensure_float64, is_... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1: datetime.datetime, v2: int, v3: str):
self.time = v1
self.duration = v2
self.url = v3
def v4(self):
return f'{self.time}, {self.duration}, {self.url}'
```
Input Types: str,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: events.Event, Dict[str, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: events.Event, v2: Dict[str, Any]):
for v3 in self.event_handlers[type(v1)]:
v3(v1, self.uow, v2)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str='', v2: str='', v3: str='', v4: str='', v5: str=''):
"""
:param prov:
:param city:
:param area:
:param area_code:
"""
self.prov = v1
self.city = v2
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> int:
v2 = 131
v3 = 1 << 31
v4 = 0
for v5 in v1:
v4 = (v4 * v2 + (ord(v5) - ord('a'))) % v3
return v4
``` |
Imports:
```python
from json import loads, dumps
import binascii
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str):
v2 = binascii.unhexlify(v1[:32])
v3 = binascii.unhexlify(v1[32:])
v4 = AES.new(key[3:] + b'tmp', AES.MODE_ECB).decrypt(v2)
v5 =... |
Imports:
```python
from typing import Generator, List, Union, cast
import torch
import typing
```
Type definitions:
```python
v0 = Union[torch.cuda.Stream, CPUStreamType]
```
Input Types: v0, v0
Output Type: None
Dependencies:
```python
def v1(v2: v0) -> torch.cuda.Stream:
return cast(torch.cuda.Stream, v2)
```
```... |
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:
if '/' in v2:
v3 = v2.split('/')[0]
return f'{v1}.{v3}'
else:
return v1
``` |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: Any, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1, v2: float):
v3 = await asyncio.gather(*v1)
await asyncio.sleep(v2)
return v3
``` |
Imports:
```python
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:
if v2:
self.run(f'{v1} -o {v2}')
else:
self.run(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict):
v3: dict = {}
for v4 in v2:
for (v5, v6) in v2[v4].get(v1, {}).items():
v3[f'{v5}{v4}'] = v6
v7 = '\n'.joi... |
Imports:
```python
import numpy as np
import os
import logging
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if self.poles is None:
logging.error('Nothing to export; Poles have not been fitted.')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
```python
def v0(v1: str) -> bool:
for v2 in range(len(v1) - 1):
if v1[v2] == v1[v2 + 1]:
return True
return False
```
```python
def v3(v4: str) -> bool:
for v5 in invalid:
if... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
if v1 in self.hash_map:
v2 = self.hash_map[v1]
self.delete_node(v2)
self.insert_begin(v2)
return v2.val
ret... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1: Union[None, Connection] = None
v2: str
def __init__(self: v0, v3: str) -> None:
"""Initialize database.
Args:
self (Database): Itself.
database_path (str): Path to database file.
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> str:
if not v1:
return ''
for (v2, v3) in enumerate(min(v1, key=len)):
for v4 in v1:
if v4[v2] != v3:
... |
Imports:
```python
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 = {'0': 'good', '1': 'LITTLE_COVERAGE', '2': 'SMALL_DELTA_CHI2', '3': 'NEGATIVE_MODEL', '4': 'MANY_OUTLIERS', '5': 'Z_F... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, tuple
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: tuple=None):
assert self.conn_pool is not None
async with self.conn_pool.acquire() as v3:
async with v3.cursor() as v4:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str]='') -> dict:
v1 = v1 if v1 != '' else self.rule_name
v2 = self.cloudwatch_events.list_targets_by_rule(Rule=v1)
v3 = [target... |
Imports:
```python
import requests
import json
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2=None) -> str:
try:
v3 = requests.get(self.REST_BASE_URL.format(self._host, self._jsonport, v1), timeout=self.TIM... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, Type[Exception]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int, v3: Type[Exception]):
if v1.startswith('next_'):
if not self._rollout.continuous:
raise v3('Access t... |
Imports:
```python
import argparse
import pathlib
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types:
Output Type: argparse.Namespace
Dependencies:
Function Name: v0
Function:
```python
def v0() -> argparse.Namespace:
v1 = argparse.ArgumentParser()
v1.add_argument('--policy_va... |
Imports:
```python
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: Tensor, int, Tensor, int, int, int, Optional[float], bool
Output Type: Tensor
Dependencies:
```python
def v0(v1: Tensor, v2: float=1.0) -> Tensor:
return v1.pow(2.0).sum(-1).pow(0.5 * v2)
```
Function Name: v3... |
Imports:
```python
import os
import csv
from pathlib import Path
import pickle
import typing
```
Type definitions:
Input Types: pd.DataFrame, str, str, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: str='USERID', v3: str='ITEMID', v4: str='TIMESTAMP', v5: s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'list of Album', 'Function on Albums'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: 'list of Album', v2: 'Function on Albums') -> None:
v1.sort(key=v2)
return
``` |
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 = dict()
for (v3, v4) in self.processors.items():
v2[v3] = v4.read_from_disk(v1)
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> None:
with open('retiredcommenthashes.txt', 'a') as v2:
v2.write(v1 + '\n')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, List[str]
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: List[str]) -> float:
if v1 > 0:
return 1.0
if v2:
return 0.0
return -1.0
``` |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: int, pd.DataFrame, List[float], int
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: pd.DataFrame=None, v3: List[float]=None, v4: int=None) -> pd.DataFrame:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: bool=False) -> str:
v4 = self.siunitx_num_to_plain_latex(v1, in_math=True)
v5 = self.siunitx_si_to_plain_latex(v2, in_math=... |
Imports:
```python
import logging
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Any, Union[str, Callable], float, int, int
Output Type: Any
Dependencies:
```python
def v0(v1: np.ndarray, v2: Union[str, Callable]='euclidean', v3: float=-1, v4: int=30, v5: int=-1) -> TSNEEmbedding:
v6 = v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str) -> int:
while True:
try:
v2 = int(input(v1))
return v2
except Exception as e:
print(e)
```
```python
def v3(v4: List, v5: bool=False, ... |
Imports:
```python
import typing
```
Type definitions:
```python
@pai_dataclass
@dataclass
class v0(AIPTrainerParams[CalamariScenarioParams, CalamariDefaultTrainerPipelineParams]):
v1: int = SavedCalamariModel.VERSION
v2: bool = field(default=True, metadata=pai_meta(help='When training with augmentations usuall... |
Imports:
```python
import typing
```
Type definitions:
Input Types: th.Tensor, th.Tensor, th.Tensor, th.Tensor, th.Tensor
Output Type: th.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: th.Tensor, v2: th.Tensor, v3: th.Tensor, v4: th.Tensor, v5: th.Tensor) -> th.Tensor:
if v5 is None:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int, Union[float, Tuple[float, float, float]]
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: int=10, v3: Union[float, Tuple[float, float, float]]=200) -> np.ndarra... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.datapath = os.path.join(os.getcwd(), 'data')
self.results = os.path.join(os.getcwd(), 'src', 'results')
self.mockimg = [os.path.jo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict=None) -> dict:
if v1 is None:
v1 = {}
if 'headers' not in v1:
v1['headers'] = {}
v2 = {'Content-type': 'application/json', 'Accept'... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self) -> None:
self.__preferred_width: typing.Optional[typing.Union[int, float]] = None
self.__preferred_height: typing.Optional[typing.Union[int, float]] = None
self.__preferred_aspect_ratio: typing.Opt... |
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:
self.enhance_list = v1
self.enhancer_priority = [[] for v2 in v1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.array, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.array, v2: bool) -> None:
v1[:, 1] -= 10.2
v1[:, 1] *= -1
if v2:
v1[:, 1] *= 1 / 1.02
``` |
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.list_nodes(v1)
v3 = []
for (v4, v5) in v2['data'].items():
v6 = self.start_node(v1, v4)
v3.append(v6)
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str='') -> str:
v3 = ', '.join((str(a) for v4 in self.argument_types))
return f'{self.return_type} (*{v2}{v1}) ({v3})'
``` |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
v2 = []
while v1 % 2 == 0:
v2.append(2)
v1 = v1 // 2
for v3 in range(3, int(math.sqrt(v1)) + 1, 2):
while v1 % v... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = re.sub('([a-z])([A-Z])', '\\g<1> \\g<2>', v1)
v2 = v2.lower()
v2 = re.sub('%', '_percent', v2)
v2 = re.sub('[=-\\\\.,]', '... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for v1 in range(len(self.polymer_template) - 1):
v2 = self.polymer_template[v1:v1 + 2]
self.d[v2] = 1
if v1 == len(self.polymer_t... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, fractions.Fraction, fractions.Fraction
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: fractions.Fraction, v3: fractions.Fraction) -> int:
if v2 != v3:
v1 = int(v1 * v2 / v3)
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[str, int, int, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Tuple[str, int, int, str]:
v2 = v1.splitlines()[0]
(v3, v4) = v2.split(';frame=')
v4 = int(v4)
v5 = self.__get_con... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: Any
Output Type: torch.nn.Module
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> torch.nn.Module:
v2 = torch.nn.Sequential(torch.nn.Conv2d(in_channels=3, out_channels=32, kernel_size=(3, 3)), torch.nn.ReLU(), torch.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any]):
if 'optimizer' in v1:
raise ValueError('The DeepSpeed configuration specifies an optimizer, but the Mosaic trainer will overri... |
Imports:
```python
import numpy as np
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: nx.Graph, List[Tuple[str, str]], str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: nx.Grap... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = v1 = v2 = Dict[str, Any]
```
Input Types: str, str
Output Type: Generator[v2, None, None]
Dependencies:
Function Name: v3
Function:
```python
async def v3(self, v4: str, v5: str=None) -> Generator[v2, None, None]:
v6 = dict(instance=v4, project=... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> str:
v2 = v1[:-1]
v3 = ''
for v4 in v2:
if v4.endswith('r'):
v4 = v4[:-1]
v3 = v3 + v4 + ' '
return v3.strip()
``` |
Imports:
```python
from shutil import copy
from pathlib import Path
import typing
```
Type definitions:
Input Types: argparse.Namespace
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: argparse.Namespace) -> None:
v2 = Path(v1.data_dir)
v3: str = v1.package
v4: str = v1.cel... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Text
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Text):
v2 = '[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}'
v3 = re.findall(v2, v1)
if not v3:
v4 = None
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.parser.parse('token_with_multiple_values')
assert v1 in {'value 1', 'value 2', 'value 3'}
``` |
Imports:
```python
from datetime import date, datetime
from urllib import parse
import typing
```
Type definitions:
Input Types: Any, int
Output Type: None
Dependencies:
```python
def v0(v1: Optional[int], v2: Optional[str], v3: FormData) -> Tuple[int, Optional[str]]:
v4 = v3.get('datasource', '')
if '__' in v... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: List[Card]):
if len(v1) < 10 or len(v1) > 10:
raise Exception('Invalid number of cards')
self.cards = v1
def v2(self):
for (v3, v4) in enumerate(self.cards):
v2('Ca... |
Imports:
```python
import typing
```
Type definitions:
Input Types: metadata_store_pb2.Artifact, Set[Text]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: metadata_store_pb2.Artifact, v2: Set[Text]) -> None:
if not v1.id:
raise ValueError('Artifact id missing for %s'... |
Imports:
```python
import hashlib
import typing
```
Type definitions:
Input Types: str, bytes
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bytes) -> str:
v3 = int(hashlib.blake2b(v1.encode(), digest_size=2, salt=v2).hexdigest(), base=16)
return hex(v3).lstrip(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1, v2, v3):
try:
act_out[name] = v2[0].detach()
except (IndexError, AttributeError):
act_out[name] = None
handles[name].remove()
```
```python
def v4(v5... |
Imports:
```python
from urllib.parse import urljoin
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
```python
def v0(v1, v2=None):
v3 = http.requests_retry_session()
v3.auth = (settings.SONARQUBE_TOKEN, '')
v4 = urljoin(settings.SONARQUBE_URL, v1)
v5 = v3.get(v4, param... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
if not self._client:
raise AttributeError('HTTPClient not found!')
await self._client.delete_channel(channel_id=int(self.id))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor, v2: int):
if v1 is None:
raise ValueError('param data cannot be set to None')
if v1.shape != self._params[v2].data.shape:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self._data:
return
v1 = self._check_configuration()
self._data = []
if self.num_qubits == 0:
return
if self._initial_s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.