text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: ```python class v0(object): def __init__(self): self.metrics = {} def v1(self, v2: Metric): self.metrics[v2.name] = v2 def v3(self, v4: List[Metric]): for v5 in v4: self.insert_metric(v5) def v6(self, v7, v8):...
Imports: ```python import re import os import typing ``` Type definitions: Input Types: T.List[str] Output Type: T.List[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: T.List[str]) -> T.List[str]: if self.trace_format != 'human': return v1 v2 = re.compile('^([A-Za-z]:)?/.*/[^...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: Optional[Mapping[str, int]]=None, v2: Optional[AbstractSet[str]]=None): if v1 is None: v1 = {} if isinstance(v2, str): raise TypeError(f'vars must be a set or None, but is {v2!r...
Imports: ```python from datetime import datetime, timedelta, timezone import typing ``` Type definitions: ```python class v0(TypedDict): v1: str v2: str v3: float v4: float v5: int v6: int v7: int ``` Input Types: Output Type: v0 Dependencies: Function Name: v8 Function: ```python def v8(s...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, **v1: Any) -> Any: v2 = v1.pop('exclude', set()) return super().dict(exclude=v2, **v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: str, Dict[str, object] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Dict[str, object]): self._validate_args(v1, v2) v3 = self.executors[v1] if v1 in self.executors else getattr(self, v1) r...
Imports: ```python import typing ``` Type definitions: Input Types: List[List[int]], str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: List[List[int]], v2: str): with open(v2, 'wt') as v3: v3.write('P2 ' + str(len(v1[0])) + ' ' + str(len(v1)) + ' 255\n') for v4 in...
Imports: ```python from pandas._config import get_option from pandas._libs import NaT, algos as libalgos, index as libindex, lib import pandas._libs.join as libjoin from pandas._libs.lib import is_datetime_array, no_default from pandas._libs.missing import is_float_nan from pandas._libs.tslibs import IncompatibleFreque...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: v2 = os.path.abspath(os.path.expandvars(v1)) if not os.path.exists(v2): raise ValueError(f'Given directory path of {v2}...
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 = [1] * v1 for v3 in range(2, v1 + 1): for v4 in range(1, v3 // 2 + 1): v2[v3 - 1] = max(v2[v3 - 1], max(v2[v4 - 1],...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2) -> bool: if callable(v2): return True if v1.startswith('__'): return True if v1 in {'body_html', 'selftext_html', 'descript...
Imports: ```python from datetime import date, datetime, timedelta import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: v1 = self.time_left_in_listing > timedelta(hours=12) or (self.time_left_in_listing <= timedelta(hours=12) ...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: str Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(self, v2: str) -> v0: v3 = self.db.get(v2, None) return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Text Output Type: Any Dependencies: ```python def v0(v1, v2): return 'loss = {:.3f}, top1 = {:.2f}%'.format(v1, v2) ``` ```python def v3(v4, v5=None, v6=False): v7 = v4.get_dataset_names() v8 = [v4.arch_str, 'datasets : {:}, extra-inf...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Any] Output Type: Tuple[Any, Any, Any, Dict] Dependencies: ```python def v0(v1: Dict[str, Any], v2: List[str]) -> Dict[str, Any]: v3: Dict[str, Any] = {} for v4 in v2: try: v3[v4] = v1.pop(v4) except KeyEr...
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 = self.get_node(v1) if v2 is None: return -1 else: return v2.value ```
Imports: ```python import xarray from xarray import concat, merge from xarray.backends.file_manager import FILE_CACHE from xarray.core.options import OPTIONS, _get_keep_attrs from xarray.tests.test_dataset import create_test_data import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```pyth...
Imports: ```python from PIL import Image import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, tuple Output Type: Image Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: tuple=(0, 255)) -> Image: v1 = np.clip(v1, *v2).astype('uint8') return Image.fromarra...
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: list Output Type: typing.Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list, **v2) -> typing.Any: self._validate_dpool_size() (v3, v4) = v1 v5 = tf.shape(v4) v6 = tf.expand_dims(tf.ex...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = v2 = self._index while v2 < len(self.text): if self.text[v2] == '\n': v2 += 1 break v2 += 1 v3 = self....
Imports: ```python import pathlib import typing ``` Type definitions: Input Types: setuptools.Extension Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: setuptools.Extension): v2 = pathlib.Path().absolute() self.announce('Preparing the build environment', level=3) v3 =...
Imports: ```python import typing ``` Type definitions: Input Types: str, Optional[Any], bool, Optional[str] Output Type: List[Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Optional[Any]=None, v3: bool=False, v4: Optional[str]=None) -> List[Any]: v5 = self._context_manager.get_...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Tuple[Tuple[int]] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Tuple[Tuple[int]]): if v1 is None: return None v2 = [] for v3 in v1: v2.append(tuple((None if np.isnan(v)...
Imports: ```python import typing ``` Type definitions: Input Types: typing.Tuple[float, float, float], typing.Tuple[float, float, float], float Output Type: Any Dependencies: ```python def v0(v1, v2: typing.Tuple[float, float, float], v3: typing.Tuple[float, float, float]): return ((rotate_point(e, v2, v3) for v4 ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: if self.config['ball_capacity'] and self.config['ball_capacity'] == self._last_count: pass elif self.config['ball_capacity'] and self.config['e...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray) -> np.ndarray: v2 = v1.shape[0] v3 = np.zeros(v2) (v4, v5, v6) = (v1[:, 0], v1[:, 1], v1[:, 2]) v7 = np.a...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: Hashable Output Type: pd.Index Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Hashable) -> pd.Index: if v1 not in self.dims: raise KeyError(v1) try: return self.xindexes[v1].to_pandas_...
Imports: ```python import os import os.path as osp import itertools import typing ``` Type definitions: ```python v0 = Union[str, bytes, 'os.PathLike[str]', 'os.PathLike[bytes]'] ``` Input Types: str, str Output Type: bool Dependencies: ```python def v1(v2: v0) -> Optional[os.stat_result]: try: return os.st...
Imports: ```python import typing ``` Type definitions: Input Types: int, float, Any Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: float, v3) -> float: v4 = self.alpha(v1, v2, v3) return v4 * self.a(v1, v2, v3) ```
Imports: ```python import math import typing ``` Type definitions: Input Types: int, int, List[float], List[List[int]], int, int Output Type: Tuple[List[int], List[int]] Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int, v3: List[float], v4: List[List[int]], v5: int, v6: int) -> Tuple[List[i...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: Column, v2: Optional[str]=None, v3: Optional[str]=None, v4: Dict[Column, Callable[[str], Any]]={}): self.column = v1 self.name = v2 if v2 else v1.name.replace('_', ' ').capitalize() self.gcs_ur...
Imports: ```python from requests import Request, Session, Response import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, **v3) -> Any: v4 = Request(v1, self._base_url + v2, **v3) if self._api_key: s...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: Optional[Union[Dict[str, Sequence[Any]], Sequence[Any], np.ndarray, 'pd.DataFrame', 'pl.Series']]=None, v2: Optional[Sequence[str]]=None, v3: Optional[str]=None, v4: bool=True): if isinstance(v2, bool): ...
Imports: ```python import sys import requests import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str): v3 = self._url('login') (v4, v5) = self._parse_auth_token() if not v4 or not v5: raise Except...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float): v2 = self.__original_time() if v1 < v2: raise ValueError('cannot retreat time reference: target {} < now {}'.format(v1, v2)) self....
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): self.seqname = v1 self.features.set_seqname(seqname=v1) ```
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('_FnT', WhenFilterFn, MetaFilterFn) ``` Input Types: Collection[v0] Output Type: v0 Dependencies: ```python def v1(*v2: Any, **v3: Any) -> bool: return not any((fn(*v2, **v3) for v4 in fns)) ``` Function Name: v5 Function: ```python def v...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self): self.time: t.Union[int, float] = 0 def __call__(self) -> t.Union[int, float]: return self.time ``` Input Types: Any, v0 Output Type: Any Dependencies: Function Name: v1 Function: ```python def v1(v2...
Imports: ```python import typing ``` Type definitions: Input Types: (int, int) Output Type: (int, int) Dependencies: Function Name: v0 Function: ```python def v0(self, v1: (int, int)) -> (int, int): v2 = self.x - v1[0] v3 = self.y - v1[1] return (v2, v3) ```
Imports: ```python import pickle import typing ``` Type definitions: Input Types: Path, bool Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: Path, v2: bool) -> dict: if v2: return dict() if v1.exists(): return pickle.load(open(v1, 'rb')) return dict() ```
Imports: ```python from urllib.parse import unquote, quote import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str) -> str: v2 = '&safe=active' if self.argument['url']: v3 = self.argument['url'] else: ...
Imports: ```python import random import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: v1 = random.randint(1, 100) return v1 <= self.crit_chance ```
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2=None): if 'data' not in self.parameters.keys(): self.parameters['data'] = dict() if v2 is not None and isinstance(v1, str) and (v1 ...
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 = 0 v3 = 0 while v3 < 32: v2 = v2 << 1 | v1 >> v3 & 1 v3 += 1 return v2 ```
Imports: ```python import logging import os import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> bool: if not os.path.exists(v1): logging.error(f'File not found: {v1}') return False v2 = os.path.base...
Imports: ```python import tensorflow as tf from collections import namedtuple import typing ``` Type definitions: Input Types: Union[tf.Tensor, tf.Variable], str Output Type: NamedTuple Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[tf.Tensor, tf.Variable], v2: str='reduced') -> NamedTuple: ...
Imports: ```python import scipy.stats from scipy.spatial import distance import typing ``` Type definitions: Input Types: Dict[str, Any], Callable, np.ndarray, bool Output Type: Union[List[Tuple[float, str]], str] Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, Any], v2: Callable, v3: np.ndar...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str Output Type: Any Dependencies: ```python def v0(v1: str, v2: str, v3: str, v4: int=0): if len(v1) == 0 or len(v1) == v4: return v1 if v1[v4] == v2: v1 = v1[:v4] + v3 + v1[v4 + 1:] return v0(v1, v2, v3, v4 + 1)...
Imports: ```python import torch import torch.nn as nn from torch import Tensor import typing ``` Type definitions: Input Types: Tensor, Tensor, Tensor, Tensor, Tensor Output Type: (Tensor, Tensor, Tensor) Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor, v2: Tensor, v3: Tensor, v4: Tensor, ...
Imports: ```python import typing ``` Type definitions: Input Types: datetime.date Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: datetime.date) -> bool: v2 = self.due_date() return v2 <= v1 if v2 else False ```
Imports: ```python import itertools import typing ``` Type definitions: Input Types: Exception Output Type: None Dependencies: ```python def v0(v1: Exception, v2: str) -> None: if not isinstance(v1.args, tuple): raise RuntimeError if v2: v3 = list(v1.args) for (v4, v5) in enumerate(v3):...
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: Tensor Output Type: Tuple[Tensor, Tensor, Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor) -> Tuple[Tensor, Tensor, Tensor...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> List[str]: v2 = [] v3 = [line.strip() for v4 in v1.expandtabs().splitlines()] for v4 in v3: if v4.startswith('#:'): v4 =...
Imports: ```python import json import typing ``` Type definitions: Input Types: str, dict Output Type: (str, str) Dependencies: ```python def v0(v1: dict=None, v2: str='', v3=False, v4=False) -> (str, str): if v1 is None: v1 = {'Global Dictionary': {'file_path': 'gvkeyx_name_dict.json', 'lookup_table': 'gl...
Imports: ```python from dataclasses import dataclass, fields, is_dataclass import typing ``` Type definitions: Input Types: type, Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: type, v2: Any) -> bool: v3 = is_dataclass(v1) v4 = isinstance(v2, dict) return v3 and v4 ``...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict[str, float] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict[str, float]: v1 = dict() for v2 in self._tokens.values(): v1[v2.get_token_name()] = float(v2.get_token_operation()) return v1 ...
Imports: ```python import gzip import typing ``` Type definitions: Input Types: Iterable[Path] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Iterable[Path]): v2 = b'##gff-version 3\n' for v3 in v1: with gzip.open(v3, 'rt') as v4: for v5 in v4: ...
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: Tuple[str, str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Tuple[str, str]: (v2, v3) = ('', '') v4 = re.findall('@[a-zA-z]+', v1) if len(v4): v2 = v4[0][1:] v5 = re....
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[bool] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[bool]: v1 = list(self.is_given) for v2 in self.game_states: for (v3, v4) in zip(v2.guesses, v2.status): for (v5, (v6, v7)) i...
Imports: ```python from subprocess import call, check_output, DEVNULL, CalledProcessError import typing ``` Type definitions: Input Types: iter Output Type: (None, list) Dependencies: ```python def v0(v1: str) -> (str, None): try: return check_output(['/usr/bin/pacman', '-Q', v1], stderr=DEVNULL).decode()....
Imports: ```python import typing ``` Type definitions: ```python v0 = Union[int, float] ``` Input Types: Any Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(self, v2) -> v0: self.flow += v2 self.backward_edge.flow -= v2 assert self.is_valid() assert self.backward_edge.is_vali...
Imports: ```python import re import typing ``` Type definitions: Input Types: float, float Output Type: Optional[str] Dependencies: ```python def v0(v1: str) -> bool: if re.match(OCEAN_TIMEZONE_PREFIX, v1) is None: return False return True ``` Function Name: v2 Function: ```python def v2(self, *, v3: f...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.polyline_regions['snr'] >= self.snr_thresh self.above_thresh = self.polyline_regions[v1] self.below_thresh = self.polyline_regions[~v1]...
Imports: ```python import typing ``` Type definitions: Input Types: List[str], str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str], *, v2: str) -> bool: (v3, v4) = v1 return {'0': 'test', '1': 'train'}[v4] == v2 ```
Imports: ```python from collections import Iterable from collections.abc import Mapping, MutableMapping from urllib.parse import urljoin, quote from json import loads as json_decode import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: ```python def v0(v1: str, v2: str, v3: str) -> s...
Imports: ```python import torch from torch.nn.functional import adaptive_avg_pool2d import typing ``` Type definitions: Input Types: torch.tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.tensor): v2 = torch.mean(v1, 0) v3 = v1 - v2.expand_as(v1) v4 = v3.t().mm(...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: 'DisplayConfig' Dependencies: Function Name: v0 Function: ```python def v0(self) -> 'DisplayConfig': v1 = self.to_dict() (v1['display_columns'], v1['display_rows']) = (v1['display_rows'], v1['display_columns']) return self._...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.array Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: np.array): v2 = v1.shape[0] v3 = np.tile(v1.T, (v2, 1, 1)) v4 = np.sqrt(np.square(v3[:, :3, :].T - v3[:, :3, :]).sum(axis=1)) ...
Imports: ```python import typing ``` Type definitions: Input Types: affichage.Affichage, user.User Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: affichage.Affichage, v2: user.User): print(v1.info('Supprimer ce compte')) v3 = input(v1.input('Voulez vous', 'Oui ou Non', 'suppri...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> str: v2 = self.visit(v1.value) v3 = self.visit(v1.slice) if hasattr(v1, 'is_annotation'): if v2 in self.CONTAINER_TYPE_MAP: v...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: unittest.mock.MagicMock Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any, *v2: Any, **v3: Any) -> unittest.mock.MagicMock: v4 = v1(*v2, **v3) v5 = v4.start() self._patches.append(v4) if hasattr...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Tuple Dependencies: Function Name: v0 Function: ```python def v0(self) -> Tuple: if not self.func_data['return']: self.func_data['return'] = [{'args': {}, 'result': None}] for (v1, v2) in enumerate(self.func_data['s']): ...
Imports: ```python import string import typing ``` Type definitions: Input Types: int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> str: v2: str = '' while v1 > 0: (v1, v3) = divmod(v1 - 1, len(string.ascii_uppercase)) v2 = string.ascii_uppercase[v3] +...
Imports: ```python import typing ``` Type definitions: ```python class v0(disnake.abc.Messageable, VocalGuildChannel): v1 = ('nsfw', 'slowmode_delay', 'last_message_id') def __repr__(self) -> str: v2 = [('id', self.id), ('name', self.name), ('rtc_region', self.rtc_region), ('position', self.position), ...
Imports: ```python import requests import typing ``` Type definitions: Input Types: str Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Dict: v2 = requests.get(f'{self.url}/v1/pipelines?q={v1}') v3 = v2.json()['pipelines'] return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> int: if v1 is None: v1 = 100 return int(v1 / 255 * 100) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Dict[str, str] Dependencies: Function Name: v0 Function: ```python def v0(v1) -> Dict[str, str]: v2 = {'IQ_PERIODDATE_BS': 'Date'} if v1 == 'Y': v2.update(dict(IQ_FISCAL_Y='Fiscal Year')) elif v1 == 'Q': v...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Union[None, bytes, str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: Union[None, bytes, str]) -> str: if v2 is None: return v1 if isinstance(v2, bytes): v2 = v2.decode('utf-8') r...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str, str, int, str Output Type: Any Dependencies: ```python def v0(v1: str): if v1 == 'production': config.load_incluster_config() else: config.load_kube_config() return client.AppsV1Api() ``` ```python def v2(v3:...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.nn.Module, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.nn.Module, v2=0.01): for v3 in v1.state_dict().values(): torch.nn.init.constant_(v3, v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> None: if len(self.lst) == 0 or self.lst[-1] < v1: self.lst.append(v1) return (v2, v3) = (0, len(self.lst) - 1) while v2 <= ...
Imports: ```python from datetime import datetime, timedelta import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any Output Type: List[Dict] Dependencies: Function Name: v0 Function: ```python def v0(self, v1=None, v2=None, v3=None, v4=None, v5=None) -> List[Dict]: v6 = {'status': 'RUNNING'} i...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.url = f'{self.build_webhook_url()}&only_events=["push"]&ignore_pull_requests=false' self.check_webhook('pull_request', content_type='application...
Imports: ```python from copy import copy import typing ``` Type definitions: ```python @dataclass class v0: v1: str v2: OrderType v3: TradeType v4: Decimal v5: Decimal v6: Optional[Decimal] = None v7: Optional[str] = None ``` Input Types: v0 Output Type: v0 Dependencies: Function Name: v8 F...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: if self.categorical_columns and (not self.categorical_feature_encoder): raise ValueError(f'Found {len(self.categorical_columns)} categorical column...
Imports: ```python import numpy as np import cv2 import typing ``` Type definitions: Input Types: Any, Tuple[Union[int, float], Union[int, float]] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: Tuple[Union[int, float], Union[int, float]]): (v3, v4) = v2 (v5, v6) = v1[0]['s...
Imports: ```python import typing ``` Type definitions: ```python class v0(_BlockBase, IClonable): def __init__(self, v1: int, v2: types.UInt256, v3: int, v4: int, v5: types.UInt160, v6: payloads.Witness, v7: List[types.UInt256], v8: payloads.ConsensusData, v9: types.UInt256=None): super(v0, self).__init__(...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(): global _lazy_gc if not _lazy_gc: v1 = gspread.service_account(CREDENTIAL_PATH) return v1 ``` Function Name: v2 Function: ```python def v2(v3: str): v4 = v0() return v4....
Imports: ```python import math import numpy import typing ``` Type definitions: Input Types: numpy.ndarray, numpy.ndarray, Optional[numpy.ndarray], Optional[numpy.ndarray], bool Output Type: numpy.ndarray Dependencies: ```python def v0(v1: numpy.ndarray, v2: Optional[int]=None, v3: Optional[numpy.ndarray]=None) -> num...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> None: if not os.path.exists(v1): os.mkdir(v1) if not os.path.isdir(v1): raise ValueError(f'{v1} is not a directory!') ```
Imports: ```python import typing ``` Type definitions: Input Types: torch.device Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.device) -> torch.Tensor: if self.training: return self.attention_biases[:, self.attention_bias_idxs] else: v2 = ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int, int, bool Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: bool=True) -> list: v4 = self.sas[v1, :, v2] if np.max(v4) > 0: if v3: return [np.a...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Awaitable[None] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Awaitable[None]: v2 = self.wrapper.startReq('accountValues') self.client.reqAccountUpdates(True, v1) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: ```python def v0(v1): if 'seed' in v1.keys(): print('seed_to_checkpoint', v1['seed']) return dict_to_select_from[v1['seed']] else: print('WARNING! seed_to_checkpoint default to checkp...
Imports: ```python import typing ``` Type definitions: ```python class v0(StreamConsumer): def __init__(self, v1: DatasetSchema, v2: Optional[StreamConsumer]): """Initialize the row schema and the optional downstream consumer. Note that the consumer is optional for cases where we want to iterate ov...
Imports: ```python import numpy as np import inspect import typing ``` Type definitions: Input Types: np.ndarray, bool, Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: bool=False, v3=False, v4: str=None): if v4 is None: v4 = "'Not specified'" v5...
Imports: ```python from math import ceil, log import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self) -> float: if self.length == 0: return 0.0 v1 = float(self.length) v2 = 0.0 for v3 in self.c.values(): v4 =...
Imports: ```python import zipfile import typing ``` Type definitions: Input Types: str, bool, Optional[zipfile.ZipFile] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: bool, v3: Optional[zipfile.ZipFile]=None): if not v2: return True if v3: with v3.open...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> int: v2 = int(str(abs(v1))[::-1]) if v1 < 0: v2 *= -1 if v2 <= -2 ** 31 or v2 >= 2 ** 31 - 1: return 0 return v2 ```
Imports: ```python import subprocess import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> int: try: with subprocess.Popen(['pmap', f'{v1}'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) as v2, subprocess.Popen(['...