text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: json Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: json): v2 = [] v3 = v1['dialog_nodes'] for v4 in v3: v5 = v4.get('dialog_node') if v4.get('disabled') == True or v4.get('disabled')...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): v1 = {'embeds': [v1]} self._send_to_webhook(v1) ```
Imports: ```python from pandas._config import config from pandas._libs import Timestamp, iNaT, properties from pandas.compat import set_function_name from pandas.compat._optional import import_optional_dependency from pandas.compat.numpy import function as nv from pandas.errors import AbstractMethodError from pandas.ut...
Imports: ```python import typing ``` Type definitions: Input Types: List[Path] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Path]): for v2 in v1: if not v2.exists(): v2.mkdir(mode=493) ```
Imports: ```python import typing ``` Type definitions: Input Types: object Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: object) -> str: if v1: v2 = str(v1) v2 = v2.replace("'", "''") v2 = f"'{v2}'" return v2 else: return '' ```
Imports: ```python import typing ``` Type definitions: Input Types: bytes Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes) -> int: if isinstance(v1, str): v1 = v1.encode(self.encoding) self._stdin.write(v1) self._stdin.flush() return len(v1) ```
Imports: ```python import matplotlib.pyplot as plt import typing ``` Type definitions: Input Types: Union[ndarray, Tuple[float], List[float]], Union[ndarray, tuple, list], str, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[ndarray, Tuple[float], List[float]], v2: Union...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Optional[Dict[str, str]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Optional[Dict[str, str]]: if not self._credentials: return None return {'token': self._credentials.token, 'url': self._credenti...
Imports: ```python import json import typing ``` Type definitions: Input Types: pathlib.Path Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pathlib.Path) -> dict: v2 = None v2 = json.loads(v1.read_text()) return v2 ```
Imports: ```python import typing ``` Type definitions: ```python class v0(Model): v1: int v2: int v3: int v4: int def v5(self, v6: int) -> v0: self.busy_count = v6 return self def v7(self, v8: int) -> v0: self.creating_count = v8 return self def v9(self, v1...
Imports: ```python import typing ``` Type definitions: Input Types: int, tuple Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: tuple) -> None: if not isinstance(v2, (tuple, list)) or len(v2) != 2: raise ValueError('Arg "pos" must be an iterable of length 2')...
Imports: ```python import torch as th import torch.nn as nn import typing ``` Type definitions: Input Types: th.Tensor, int Output Type: List[th.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: th.Tensor, v2: int) -> List[th.Tensor]: (v3, v4) = self.xfmr(v1, None) v5 = self.mask(v3...
Imports: ```python import numpy as np import tensorflow as tf from tensorflow.keras.datasets import boston_housing from tensorflow.keras.initializers import Constant from tensorflow.keras.initializers import RandomUniform from tensorflow.keras.layers import Activation from tensorflow.keras.layers import Dense from tens...
Imports: ```python from pathlib import Path import typing ``` Type definitions: Input Types: 'argparse.ArgumentParser' Output Type: 'argparse.ArgumentParser' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'argparse.ArgumentParser') -> 'argparse.ArgumentParser': v1.add_argument('-l', '--repo-...
Imports: ```python import typing ``` Type definitions: Input Types: str, List[str] Output Type: List[Dict[str, str]] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: List[str]) -> List[Dict[str, str]]: print(f'Attempting to parse rows: ```\n{v1}\n```') v3: List[Dict[str, str]] = [] ...
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray, v2: np.ndarray=None): for v3 in self.processors: v3.fit(v1, v2) ```
Imports: ```python from functools import cmp_to_key import typing ``` Type definitions: ```python class v0: def __init__(self, v1): self.val = v1 self.left = None self.right = None ``` Input Types: v0 Output Type: List[List[int]] Dependencies: ```python def v2(v3, v4): v5 = v3[1][0] ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=None): if not v1: v1 = self.current_party if v1 not in self.parties: self.build_party(v1) return self.parties[v1] ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self) -> None: self.logger.log_register('ID') self.assertTrue('ID' in self.logger.logTunnels) self.logger.log_close('ID') self.assertTrue('ID' not in ...
Imports: ```python import typing ``` Type definitions: Input Types: dict, dict Output Type: Any Dependencies: ```python def v0(v1: str, v2: list): v3 = getattr(sys.modules[__name__], v1)(*v2) return v3 ``` ```python def v4(): v5: str = input('>>: ') return v5 ``` Function Name: v6 Function: ```python d...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Optional[str]: v2 = self.sydent.db.cursor() v3 = v2.execute('SELECT sender FROM invite_tokens WHERE token = ?', (v1,)) v4: List[Tu...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python async def v0(self) -> bool: if self.skip is not None and self.skip.check(): return True if self.skip_until is not None and (not self.skip_until.check()): r...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.trainer.testing: self.trainer.reset_test_dataloader() elif self.trainer.val_dataloaders is None or self.trainer._data_connector._shou...
Imports: ```python import torch, os, pickle import typing ``` Type definitions: Input Types: List[Tuple], Union[BertTokenizer, AlbertTokenizer], Any, Any Output Type: Any Dependencies: ```python def v0(v1, v2, v3: int): while True: v4 = len(v1) + len(v2) if v4 <= v3: break if le...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): v2 = self.ffi.new('unsigned int*') v2[0] = v1 self.lib.prussdrv_pru_enable(v2[0]) ```
Imports: ```python import typing ``` Type definitions: Input Types: str, List[str] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: List[str]): if self.CC is not None: self.CC.logging.log('Processing Staying Times From Beacon') self.listing_all_staying...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: 'Matrix4' Dependencies: Function Name: v0 Function: ```python def v0(self) -> 'Matrix4': v1 = self.elements v2 = None v2 = v1[1] v1[1] = v1[4] v1[4] = v2 v2 = v1[2] v1[2] = v1[8] v1[8] = v2 v2 = v1[6]...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: if not v1: return self._namespace v2 = '/'.join((i for v3 in v1.split('/') if v3)) if v1.startswith('/'): v4 = '/' + v2...
Imports: ```python import io import torch import typing ``` Type definitions: Input Types: torch.Tensor Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor) -> bytes: v2 = io.BytesIO() torch.save(v1, v2) return v2.getvalue() ```
Imports: ```python import string import typing ``` Type definitions: Input Types: dict, list Output Type: Any Dependencies: ```python def v0(v1: str): v2 = [] v1 = v1.lower() v1 = v1.translate(str.maketrans('', '', string.punctuation)) v1 = v1.translate(str.maketrans('', '', '1234567890')) print(v1...
Imports: ```python import typing ``` Type definitions: ```python @dataclass class v0: v1: str = '' v2: int = 80 v3: int = 100 v4: int = 0 v5: bool = False v6: str = None v7: str = 'http://' v8: str = None v9: list = None v10: list = None v11 = None v12: datetime = None ...
Imports: ```python import numpy as np from pandas._libs import NaT, algos as libalgos, lib from pandas._typing import ArrayLike, DtypeObj, npt from pandas.util._validators import validate_bool_kwarg from pandas.core.dtypes.astype import astype_array_safe from pandas.core.dtypes.cast import ensure_dtype_can_hold_na, inf...
Imports: ```python import typing ``` Type definitions: Input Types: str, bool Output Type: list Dependencies: ```python def v0(v1: str) -> tuple: v1 = v1.replace('\n', '').replace(' ', '').split(',') v1[0] = int(v1[0]) v1[1] = float(v1[1]) return (v1[0], v1[1], v1[2:]) ``` Function Name: v2 Function: `...
Imports: ```python import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import rcParams import typing ``` Type definitions: Input Types: Any, int, list, list, tuple, int, float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: int, v3: list, v4: list=['R', 'PMX', ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, int, int, int, bool Output Type: Any Dependencies: ```python def v0(v1: np.ndarray, v2=None) -> np.ndarray: v1 = np.array(v1) assert v1.ndim == 1 v3 = np.where(~np.isnan(v1), np.arange(v1.shape[0]), 0) np...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: str, v2: str): v3 = 1 while v3 < len(v1): v4 = v1[v3] v3 += 1 if v4 == '\\': v3 += 1 elif v4 == v2: return v3 else: ret...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if isinstance(v1, int): v1 = self.get_clip(v1 + 2) v2 = os.path.abspath(os.path.join(self.__pth, v1)) self.__pth = v2 if os....
Imports: ```python import typing ``` Type definitions: Input Types: Module, Tuple[Tensor] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Module, v2: Tuple[Tensor]) -> None: self._check_output_is_scalar(v1) self._check_loss_has_not_been_modified(v1, v2) ```
Imports: ```python import typing ``` Type definitions: ```python @dataclass class v0: v1: str v2: str v3: str v4: str v5: int v6: int v7: str v8: str v9: str v10: str v11: str v12: int v13: int v14: int v15: Optional[str] v16: List[str] v17: str d...
Imports: ```python import typing ``` Type definitions: ```python class v0(ABC): v1 = None v2 = None v3 = threading.Lock() def __init__(self, v4: str, v5: str): self._address = v4 self._session_id = v5 @property def v6(self): return self._address @property def v...
Imports: ```python import typing ``` Type definitions: Input Types: List[Any] Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Any]) -> List[int]: if len(v1) == 0 or isinstance(v1[0], int): return v1 return [cap[0] for v2 in v1] ```
Imports: ```python import typing ``` Type definitions: ```python v0 = Union[Type[Resource], CodeableConceptRefType] ``` ```python class v1(Enum): v2 = 'concepts' v3 = 'symptom_disease_ind' v4 = 'medication_ind' ``` ```python class v5(NamedTuple): v6: acd.AttributeValueAnnotation v7: AttributeSource ...
Imports: ```python import typing ``` Type definitions: ```python class v0(TreeBase): v1 = ['_raw_definition', '_definition', '_label', '_parent', '_children', '_mongoquery'] def __init__(self, v2: Dict[Any, Any], v3: str='#root', v4: v0=None, v5: OrderedDict[str, v0]=None): self._raw_definition: Dict[A...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: list=None): v4 = {'readByQuery': {'object': self.__dimension, 'fields': ','.join(v3) if v3 else '*', 'query': "{0} = '{1}'".for...
Imports: ```python from os import path import typing ``` Type definitions: Input Types: str, str, int, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: int, v4: str) -> None: with open(path.join(self.outdir, 'output.txt'), 'a', encoding='utf-8') as v5: ...
Imports: ```python import typing ``` Type definitions: Input Types: Optional['DbExperimentDataV1'] Output Type: 'DbExperimentDataV1' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional['DbExperimentDataV1']=None) -> 'DbExperimentDataV1': if v1 is None: v1 = self.__class__() v...
Imports: ```python import typing ``` Type definitions: Input Types: datasets.TextDataset, float, float, float, Optional[str], bool Output Type: models.Model Dependencies: Function Name: v0 Function: ```python def v0(self, v1: datasets.TextDataset, v2: float=0.8, v3: float=0.1, v4: float=0.1, v5: Optional[str]=None, v...
Imports: ```python import typing ``` Type definitions: Input Types: WebElement, WebElement Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: WebElement, v2: WebElement) -> None: self.assertFalse(v2.is_displayed()) v1.click() self.assertTrue(v2.is_displayed()) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, /) -> str: if not self.id: return self.name return f'{self.name}:{self.id}' ```
Imports: ```python import typing ``` Type definitions: Input Types: IO[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: IO[str]) -> None: v2 = self.get_connection(self.gcp_conn_id) v3 = v2.extra_dejson['extra__google_cloud_platform__keyfile_dict'] v1.write(v3) ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any, Any Output Type: str Dependencies: ```python def v0(v1): v2 = [bin(x)[2:].rjust(v1, '0') for v3 in range(2 ** v1)] return [[int(a) for v4 in s] for v5 in v2] ``` ```python def v6(v7, v8): v9 = v0(v7) return [[*...
Imports: ```python from scipy.interpolate import InterpolatedUnivariateSpline from scipy.stats import norm import numpy as np import typing ``` Type definitions: Input Types: pd.DataFrame, float, bool, Callable[[np.ndarray], float] Output Type: Tuple[np.ndarray, np.ndarray] Dependencies: ```python def v0(v1: np.ndarra...
Imports: ```python import typing ``` Type definitions: Input Types: str, int Output Type: v7 Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int) -> v7: v1 = list(v1.replace('-', '').upper()) v3 = len(v1) v4 = [] while v3 > 0: v5 = v3 - v2 v6 = v3 ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._playing = True self.after(0, self._on_play_step) ```
Imports: ```python import typing ``` Type definitions: Input Types: str, Dict[str, Dict[str, str]], str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: Dict[str, Dict[str, str]], v3: str): assert type(v1) == str v4 = [] v5 = v2[v1]['title'].strip() v6 = v2[v1][...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, int Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: int) -> np.ndarray: v3 = np.zeros(int(v2 * (v2 + 1) / 2)) v4 = 0 for v5 in range(v2): v3[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 = self.simulator.state.copy() v1['distance_to_target'] = v1['target_pole_position'] - v1['cart_position'] return v1 ``...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: self.__state = True if not self.is_connected(): self.connect() self.start() return True ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: o3d.geometry.PointCloud, Any, Any, Any, Any Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: o3d.geometry.PointCloud, v2, v3, v4, v5) -> np.ndarray: v6 = np.zeros(shape=(v2 * v3, 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: v2 = 2 for v3 in range(2, len(v1)): if v1[v2 - 2] != v1[v3]: v1[v2] = v1[v3] v2 += 1 return...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset from torch.utils.data import DataLoader from torch.utils.data import TensorDataset from torch.nn.utils.rnn import pack_sequence from torch.nn.utils.rnn import pad_packed_sequence from torch.nn.util...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False): for v2 in self.lockfile(): if self.environment == 'production' and v2['category'] == 'dev': continue if not v1: ...
Imports: ```python from configparser import ConfigParser import typing ``` Type definitions: Input Types: Path, str Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(v1: Path, v2: str) -> Dict[str, Any]: v3 = ConfigParser() with v1.open() as v4: v3.read_file(v4) ...
Imports: ```python import typing ``` Type definitions: ```python class v0(JobBuilder): def __init__(self): super().__init__(ServingJobType.TRTServingJob) def v1(self, v2: int) -> v0: self._options.append(StringField('--http-port', str(v2))) return self def v3(self, v4: int) -> v0:...
Imports: ```python import geopandas as gpd import numpy as np from geopandas.sindex import PyGEOSSTRTreeIndex from shapely import prepared from shapely.affinity import scale from shapely.geometry import LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, box from shapely.geometry.base import BaseGeom...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: if self._needs_update: v2 = self._lookup_data['site'] v3 = self._lookup_data['species'] v4 = self.get_sources(site=v2, ...
Imports: ```python from queue import Queue import collections import typing ``` Type definitions: Input Types: int, List[List[int]] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: List[List[int]]) -> bool: if len(v2) != v1 - 1: return False v3 = collecti...
Imports: ```python import typing ``` Type definitions: Input Types: Sequence[float], Sequence[float] Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: Sequence[float], v2: Sequence[float]) -> float: if len(v1) <= 0: raise ValueError('Length of episode_rewards must be greate...
Imports: ```python import torch import numpy as np import typing ``` Type definitions: Input Types: int, int Output Type: Tuple[torch.Tensor, torch.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int) -> Tuple[torch.Tensor, torch.Tensor]: v3 = torch.rand([v1, 1, v2]) v4 = torch...
Imports: ```python import torch as t import typing ``` Type definitions: Input Types: Union[str, t.device] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[str, t.device]): for v2 in self._major_attr: v3 = getattr(self, v2) for (v4, v5) in v3.items(): ...
Imports: ```python import random import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2: str = '' while len(v1) > 0: v3 = len(v1) v4 = random.randrange(v3) v5 = v1[v4] v2 += v5 ...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: dict) -> None: for (v2, v3) in v1.items(): self.updating[v2] = v3 await self.async_request_refresh() ```
Imports: ```python import typing ``` Type definitions: ```python class v0: v1 = ('action',) v2: _t.Callable v3: _t.Callable v4: _t.Callable v5: _t.Callable v6: _t.Text v7: drf_request.Request v8: _t.Text v9: _t.Text v10: bool v11: _t.Text v12: _t.Union[_t.Text, int] v...
Imports: ```python import typing ``` Type definitions: Input Types: List[List[int]] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: List[List[int]]) -> int: v2 = [] v3 = [] v4 = 0 for (v5, v6) in enumerate(v1): v2.append(set()) v7 = 0 for v8 in v...
Imports: ```python import typing ``` Type definitions: Input Types: int, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: bool=True): v3 = 0.0 if self.ohlc: if v2: self.get_account_balance() v4 = float(self.balance['USDT']) ...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str]) -> None: for v2 in v1: self.add_melting_temperature_path(v2) ```
Imports: ```python import numpy as np from scipy.optimize import fsolve from scipy.stats import norm import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray Output Type: tuple[np.ndarray, float] Dependencies: ```python def v0(v1: float, *v2: tuple[np.ndarray, np.ndarray]) -> np.ndarray: return dual...
Imports: ```python import numpy import numpy.linalg import typing ``` Type definitions: Input Types: float Output Type: numpy.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: float) -> numpy.ndarray: v2 = numpy.cos(v1, dtype=numpy.float64) v3 = numpy.sin(v1, dtype=numpy.float64) retu...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0() -> int: global __my_enum_auto_id v1 = __my_enum_auto_id v2 += 1 return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: typing.NoReturn Dependencies: Function Name: v0 Function: ```python def v0() -> typing.NoReturn: (v1, v2, v3) = map(int, input().split()) v4 = v1 < pow(v3, v2) print('Yes' if v4 else 'No') ```
Imports: ```python import warnings from pandas._libs import 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.tslibs import IncompatibleFrequency, NaTType, OutOfBoundsDatetime, Timestamp, tz_compare from pandas._typ...
Imports: ```python import re import typing ``` Type definitions: Input Types: v1 Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: v1) -> int: try: v1 = re.search('(-?[\\d]+)', v1, re.M | re.I).group(1) except Exception as e: return 0 v2 = int(v1) if...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1: int = 0 v2: Optional = None v3: Optional['Link'] = None v4: Optional['Link'] = None def __init__(self, v5: int, v6, v7: Optional['Link']=None, v8: Optional['Link']=None): self.key = v5 self.value = v6 ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self) -> list: v1 = self._store._database_connection.cursor() v1.execute('SELECT key FROM dimension WHERE metric_id=? GROUP BY key ORDER BY key ASC', [self._metric_...
Imports: ```python import torch import torch.nn.functional as F import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor: v3 = v2.shape v2 = v2.view(v1.sh...
Imports: ```python import typing ``` Type definitions: Input Types: Union[List[Any], Any], int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[List[Any], Any], v2: int) -> None: if isinstance(v1, list): self._extend(v1, v2) self._periodic_thruput_monito...
Imports: ```python import os import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0() -> str: if not os.getenv('SPACK_ROOT', False): print('Please provide a information about SPACK_ROOT') exit(1) v1 = os.path.relpath('var/s...
Imports: ```python import typing ``` Type definitions: ```python class v0(list): def __init__(self): self._children: dict[str, v0] = dict() self._used = False def v1(self, v2: AppID) -> v0: if v2 is None: return self if v2.head not in self._children: sel...
Imports: ```python import typing ``` Type definitions: Input Types: 'SimpleConfig', str, str Output Type: Optional[str] Dependencies: ```python def v0(v1): return v1.get('block_explorer', 'system default') ``` ```python def v2(): from . import constants return mainnet_block_explorers if not constants.net.T...
Imports: ```python import os from pathlib import Path import typing ``` Type definitions: Input Types: configparser.ConfigParser Output Type: None Dependencies: ```python def v0() -> Path: v1 = os.environ.get('XDG_CONFIG_HOME') or os.environ.get('APPDATA') if v1: v2 = Path(v1) else: v2 = Pa...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: float) -> float: if 5 <= v1 <= 10: v2 = 1 else: v2 = 0 return v2 ```
Imports: ```python import torch from torch import nn from torch.nn.utils import prune import typing ``` Type definitions: Input Types: nn.Module Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: nn.Module): (v2, v3) = (0.0, 0.0) for v4 in v1.modules(): if isinstance(v4, (...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: if v1 == 'map': self.expect(self.read_char() == '<', "expected '<'") v2 = self.read_data_type() self.expect(self.read_c...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Any], Dict[str, Any] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, Any], v2: Dict[str, Any]) -> None: if 'limit' in v1: v1['limit'] = int(v1['limit']) if v1['limit'] < 1: ...
Imports: ```python import pandas as pd from sklearn.preprocessing import LabelEncoder from sklearn.utils import check_random_state import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.data.columns.str.contains('user...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Output Type: Optional[float] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Optional[float]: if self._stats: return np.sqrt(self.variance()) else: return None ```
Imports: ```python import cv2 import numpy as np import typing ``` Type definitions: Input Types: Any, list Output Type: dict Dependencies: ```python def v0(v1: np.ndarray) -> np.ndarray: v2 = cv2.cvtColor(v1, cv2.COLOR_RGB2HSV) v3 = v2[:, :, 0] * 2 v4 = v2[:, :, 1] / 2.55 v5 = v2[:, :, 2] / 2.55 r...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, List[List[int]] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: List[List[int]]) -> int: (v4, v5) = (v1, v2) for v6 in v3: v4 = min(v6[0], v4) v5 = min(v6[1], v...
Imports: ```python import torch from torch import optim, nn from torch.utils.data import DataLoader import typing ``` Type definitions: Input Types: torch.Tensor, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor, v2: str): v3 = torch.sum((v1 - self.hypersphere...
Imports: ```python import numpy as np import qiskit import typing ``` Type definitions: Input Types: _circuit.Circuit Output Type: qiskit.QuantumCircuit Dependencies: ```python def v0(v1: _gates.ControlledGate, v2, v3, v4): if not isinstance(v1, _gates.ControlledGate): raise ValueError(f"Can't export gate ...