text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: Tuple[int, Optional[str]], str, bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: Tuple[int, Optional[str]], v2: str, v3: bool=False) -> None: with open(v2, 'w') as v4: for (v5, v6) in v1: i...
Imports: ```python from math import comb, factorial import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> int: v2: int = factorial(v1) v3: int = sum(((-1) ** i / factorial(i) for v4 in range(v1 + 1))) return int(v2 * v3...
Imports: ```python import typing ``` Type definitions: Input Types: str, bool Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: bool=False) -> str: v3 = v1.split('/') v3 = v3[-1].split('-') v4 = v3[-1] return v4 if v2 else v4[:8] ```
Imports: ```python import typing ``` Type definitions: Input Types: aiohttp.ClientWebSocketResponse, str, str Output Type: bool Dependencies: Function Name: v0 Function: ```python async def v0(v1: aiohttp.ClientWebSocketResponse, v2: str, v3: str) -> bool: await v1.send_json({'id': 5, 'type': 'config/device_regis...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: for (v2, v3) in enumerate(self.inputs()): (v4, v5) = self.get_sorted_pubkeys(v3) for (v6, (v7, v8)) in enumerate(zip(v4, v5)): ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1=None) -> None: self.log.debug('Starting recurring background task for all repositories') self.status.background_task = True self.hass.bus.asyn...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=''): v1 = str(v1) return v1 in self.vertexDict ```
Imports: ```python import typing ``` Type definitions: ```python v0 = Dict[str, Any] ``` Input Types: v0, str Output Type: Any Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0, v3: str): self._stream: str = v2['tap_stream_id'] self.properties[self._stream] = set() ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: Any, v2: str) -> None: if v1.node_scheduled or v2 is None: return v1.node_scheduled = v2 v1.save(update_fields=['node_scheduled']) ```
Imports: ```python import torch import typing ``` Type definitions: Input Types: pathlib.Path Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: pathlib.Path): v2 = torch.load(v1) return v2 ```
Imports: ```python import asyncio import json import sys import typing ``` Type definitions: Input Types: asyncio.Lock, Dict, str, Optional[Tuple[str, str]] Output Type: None Dependencies: ```python async def v0(v1: Dict, v2: str, v3: str): if 'commit' in v1['supportedFeatures']: v4 = json.loads(v3) el...
Imports: ```python import typing ``` Type definitions: Input Types: Any, str, Optional[str] Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: str, v3: Optional[str]=None) -> Dict[str, Any]: v4 = {'src': 'url', 'url': v2, 'deferred': True} if v3: v4['e...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: str) -> str: with open(v1, encoding='utf-8') as v2: return v2.read() ``` Function Name: v3 Function: ```python def v3(v4: str='requirements.txt'): v5 = v0(v4) return list(filt...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2) -> bool: if self.__matches_base_types(v1, v2): return True elif self.__matches_type_types(v1, v2): return True elif self._...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4, v5) -> bool: v6 = len(v5) - 1 v7 = len(v5[0]) - 1 if 0 <= v1 + v3 <= v6 and 0 <= v2 + v4 <= v7: return v5[v1][v2]...
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: v2 = self._encode_room_list(v1) raise NotImplementedError ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, *v1: Union[Middleware, Callable]) -> None: for v2 in v1: self.queue.append(v2) ```
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: Iterable[v0], Callable[[v0, v0], v0] Output Type: Iterator[v0] Dependencies: Function Name: v1 Function: ```python def v1(v2: Iterable[v0], v3: Callable[[v0, v0], v0]) -> Iterator[v0]: v4 = iter(v2) v5 = next(v4...
Imports: ```python import numpy as np import pandas as pd from sklearn.utils import check_array from sklearn.metrics import mean_absolute_error, r2_score, mean_squared_error, accuracy_score, f1_score, precision_score, recall_score import typing ``` Type definitions: ```python v0 = pd.core.indexes.multi.MultiIndex ``` I...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Tuple Dependencies: Function Name: v0 Function: ```python def v0() -> Tuple: v1 = dict(pvr_gate_zero=2, sobc=1, obc=1, fbc=1, readiness_closure_exit=3, the_rest=10) for v2 in v1.items(): yield v2 ```
Imports: ```python from json import JSONDecodeError, loads import typing ``` Type definitions: Input Types: Match[str], str Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: Match[str], v2: str) -> None: if not self._received: self._received = True try: ...
Imports: ```python import torch from torch import Tensor import typing ``` Type definitions: Input Types: int, Optional[Tensor] Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: Optional[Tensor]=None) -> Tensor: self.hook_a: Tensor self.hook_g: Tensor self._...
Imports: ```python from torch import Tensor, cat, rand from torch.nn import Module, Sequential, Conv2d, BatchNorm2d, ReLU, AdaptiveAvgPool2d, Linear import typing ``` Type definitions: Input Types: Tensor Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor) -> Tensor: v...
Imports: ```python import typing ``` Type definitions: Input Types: Dict Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict) -> Dict: v2 = {} if v1 is not None: v3 = v1.findtext('original_publication_year') v2['year'] = int(v3) if v3.isdigit() else None ...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from torch.nn import Module from torch.optim import Adam from torch.utils.data import DataLoader, Dataset, Subset import typing ``` Type definitions: ```python class v0(Module, ABC): @property @abstra...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.__verbose__: print(self.__name__, 'moving to center') self.move(0) ```
Imports: ```python import numpy as np from scipy import interpolate as I import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): assert v1 >= self.Tmin and v1 <= self.Tmax, 'Wrong time point' v2 = abs(I.splev(v1, self.Vin...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.is_killed = True self.block_cache.clear() if self.w3.isConnected(): self.w3.eth.uninstallFilter(self.block_filter.filter_id) ```
Imports: ```python import typing ``` Type definitions: Input Types: array.array, bytes, List[Tuple[int, int, int, int]], int, int, int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: array.array, v2: bytes, v3: List[Tuple[int, int, int, int]], v4: int, v5: int, v6: int, v7: int): ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self) -> Any: v1 = '#/$defs/platformQuota' return {'$defs': {'platformQuota': {'additionalProperties': self._disable_strict_response_schema_check, 'properties': {'cp...
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() with open(v1) as v3: for v4 in v3: if v4 == '\n': return v2 v5 = v4.split(' '...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, tuple(), float, int Output Type: Any Dependencies: ```python def v0(v1: Any, v2: int, v3: tuple()) -> Any: try: v4 = False if isinstance(v1, np.ndarray): v4 = True v5 = cupy.asarray(v...
Imports: ```python from datetime import date, datetime import typing ``` Type definitions: Input Types: Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict[str, Any]: v1 = self.an_enum_value.value if isinstance(self.a_camel_date_time, datetime): v2 = s...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Tuple[str, str] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> Tuple[str, str]: v2 = 'registry-1.docker.io' v3 = v1 if v1.count('/') == 0: v3 = 'library/{image}'.format(image=v1) elif v...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: np.ndarray): v3 = dict() v4 = dict() for v5 in np.unique(v2): v3[v5] = np.where(v2 == v5)[0]...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: dap.FunctionBreakpoint, v2: bool=True): self.enabled = v2 self.dap = v1 self.result: dap.BreakpointResult | None = None def v3(self) -> dap.Json: return {'dap': self.dap.into_json(...
Imports: ```python import typing ``` Type definitions: Input Types: object Output Type: Optional[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: object) -> Optional[int]: if self.id_mapper: return self.id_mapper.id(v1) return None ```
Imports: ```python import os from pathlib import Path import typing ``` Type definitions: Input Types: pytiled_parser.Tile, Optional[str] Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pytiled_parser.Tile, v2: Optional[str]) -> Optional[str]: v3 = None if v1.im...
Imports: ```python import numpy as np from pandas._config import get_option from pandas._typing import Axis, FilePathOrBuffer, FrameOrSeries, IndexLabel, Level, Scalar from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import doc import pandas as pd from pandas import Index, Ind...
Imports: ```python import numpy as np from numpy.linalg import inv import typing ``` Type definitions: Input Types: np.ndarray, float Output Type: np.array Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: float=0.03) -> np.array: v3 = np.max(v1) v4 = v1 > v3 * v2 v5 = np.wher...
Imports: ```python from keras.applications.mobilenet_v2 import MobileNetV2 from keras.layers import Flatten from keras.layers import Input from keras.models import Model from keras import optimizers import keras.engine.training import typing ``` Type definitions: Input Types: int, types_of_loco.input_img_size, int, An...
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): try: v2 = re.findall('filename\\*?=([^;]+)', v1, flags=re.IGNORECASE) return v2[0].strip().strip('"') except ValueError: ...
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._window_width = v1 self._window_height = v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): for v2 in self.resources_config['storage']: if v2['type'] == v1: return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, str, str Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: Any, v2: Any, v3: str, v4: str) -> None: assert v3 v5 = self._response_class(v2)(key=v1, value=v2, correlation_id=v4) await se...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.count = next(self._count_case) self.log.info('{}准备执行第{}个用例{}'.format('-' * 25, self.count, '-' * 25)) self.back_fill.fill_case_number(self.c...
Imports: ```python import typing ``` Type definitions: Input Types: Exception Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: Exception) -> None: if v1.args[0].endswith('Cannot find context with specified id'): v2 = 'Execution context was destroyed, most likely because of ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: (v2, v3, v4) = ([0] * 26, [], len(v1)) for v5 in v1: v2[ord(v5) - ord('a')] += 1 while len(v3) != v4: for v6 in range(2...
Imports: ```python import random import typing ``` Type definitions: Input Types: Output Type: int Dependencies: ```python def v0(): return random.randint(1, 7) ``` Function Name: v1 Function: ```python def v1(self) -> int: v2 = 42 while v2 >= 40: v3 = v0() - 1 v4 = v0() - 1 v2 = 7...
Imports: ```python from http import HTTPStatus import typing ``` Type definitions: Input Types: testing.FlaskClient Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: testing.FlaskClient) -> None: v2 = v1.get('/status') assert v2.status_code == HTTPStatus.OK assert v2.data ==...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, Any Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2) -> np.ndarray: if self._size[0] == 0 or self._size[1] == 0: raise RuntimeError('clipping without a size is not po...
Imports: ```python import requests from tqdm import tqdm import typing ``` Type definitions: Input Types: str, int Output Type: Any Dependencies: ```python def v0(v1: str, v2: str) -> str: if 'page=50' in v2: tqdm.write(f'[{v1} too deep') raise KeyError tqdm.write(f'[{v1}] getting {v2}') v3...
Imports: ```python import shelve import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=None) -> Any: v1 = self.model.hash() if v1 is None else v1 if not getattr(self, 'disk_cache_location', False): self.init_disk_...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> bool: v2: Set[str] = set() v3: Set[str] = set(' -') for v4 in v1.lower(): if v4 in v3: continue if v4 in v2: ...
Imports: ```python import typing ``` Type definitions: Input Types: Tensor, Optional[Tensor] Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor, v2: Optional[Tensor]=None) -> Tensor: (v3, v4, v5) = v1.size() v6 = self.positional_encoding(v4).to(self.device) v6 ...
Imports: ```python import pandas as pd from pandas.io.parsers import TextFileReader import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0() -> None: v1 = pd.DataFrame(data={'col1': [1, 2], 'col2': [3, 4]}) v2: pd.DataFrame = v1.drop('col...
Imports: ```python import typing ``` Type definitions: Input Types: list, list, bool Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2: list, v3: bool=False) -> bool: if not isinstance(v2, list): v2 = [v2] if isinstance(v1, str) and (not v3): v1 = v1.low...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Optional[float], Optional[torch.Tensor] Output Type: Tuple[torch.Tensor, torch.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: Optional[float]=None, v3: Optional[torch.Tensor]=None) -> Tuple[torch.Tensor, torch.T...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: sps.csr_matrix, np.ndarray, int Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: sps.csr_matrix, v2: np.ndarray, v3: int) -> np.ndarray: if self.sorted_indices is None: v4 = n...
Imports: ```python import logging import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0() -> None: for v1 in logging.root.handlers[:]: logging.root.removeHandler(v1) ```
Imports: ```python import shlex import subprocess import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = subprocess.run(shlex.split(v1)) v2.check_returncode() ```
Imports: ```python import io from matplotlib import figure import matplotlib.pyplot as plt import numpy as np from PIL import Image from matplotlib.animation import FFMpegFileWriter from matplotlib import collections as mc import matplotlib.patches as patches from matplotlib.patches import Circle, Wedge import typing `...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.main_widget_ is not None: self.main_widget_.close() ```
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.all_sentences() if v1 <= len(v2): return v2[len(v2) - v1] else: raise Exception('Invalid sentence index') ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1=None, v2: bool=True): if v2: v3 = self.hdurl or self.url else: v3 = self.url if not (v3.startswith('http://apod.nasa.gov'...
Imports: ```python from datetime import date, datetime, timedelta import typing ``` Type definitions: Input Types: date, date Output Type: Iterable[date] Dependencies: Function Name: v0 Function: ```python def v0(v1: date, v2: date) -> Iterable[date]: if v1 > v2: raise ValueError('End date {} before start...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> list: v1 = self.format_path(v1) self.allfile(v1) return self.files ```
Imports: ```python import typing ``` Type definitions: Input Types: requests.Session, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: requests.Session, v2): v3 = v1.get(f'{self.api_url}/sync/{v2}/challenge') self.c.check_response(v3, 'Could not get challenge') ret...
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(v1 ** 0.5) return 1 + sum((i + v1 // i for v3 in range(2, v2 + 1) if v1 % v3 == 0)) - (v2 if v2 ** 2 == v1 else 0) ```
Imports: ```python from pathlib import Path from os import environ, listdir as os_listdir from re import match as re_match, finditer as re_finditer import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): global _sfbuild_module_coll...
Imports: ```python import os import subprocess from pathlib import Path import typing ``` Type definitions: Input Types: str, Any, Any Output Type: bool Dependencies: ```python def v0(v1: Path) -> bool: if v1.is_file() and '.git/modules' in v1.read_text(): return True return False ``` Function Name: v2...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Union[np.ndarray, Sequence[int]] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[np.ndarray, Sequence[int]]): if isinstance(v1, np.ndarray): v2 = np.all(np.diff(v1) == 1) else: ...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: int): self.point = {self.keys[0]: v1, self.keys[1]: v2, self.keys[2]: v3} self.arrayOfPoints.append(self.point) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> dict: for v2 in self.reader: if self._is_match(v2, v1): return self.create_row(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: requests.Response Dependencies: Function Name: v0 Function: ```python def v0(self) -> requests.Response: v1 = {'action': 'initiateDatabaseReset'} v2 = f'{self._http_protocol}://{self.host}:{self.port}/system' v3 = self._prep...
Imports: ```python from collections import defaultdict import typing ``` Type definitions: Input Types: list[str] Output Type: int Dependencies: ```python def v0(v1: defaultdict[str, list[str]]) -> dict[str, str]: v2 = dict() for (v3, v4) in v1.items(): for v5 in v4: v2[v5] = v3 return ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: bool=True): assert v2, 'for LocalFolder suffixes can be set inplace only' for v3 in self.get_children().values(): if hasattr(v3, 'set_...
Imports: ```python import json import typing ``` Type definitions: Input Types: Output Type: tuple Dependencies: Function Name: v0 Function: ```python def v0(self) -> tuple: v1 = self.favorite.text.replace('\n', '') v2 = json.dumps(self.favorite.entities_hashtags) v3 = json.dumps(self.favorite.entities_u...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=True) -> None: self.update(email_verified=v1) self._clear_email_hash() ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: try: if hasattr(self, 'file') and self._file is not None and (not self._file.closed): self._file.close() except: pass ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: if not self.options: return self.start v1 = self.options[self.offset] self.offset = (self.offset + 1) % len(self.options) return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: self.stage = min(self.stage * 2, 512) super().loss(v1) ```
Imports: ```python import numpy as np import numpy.ma as ma import typing ``` Type definitions: Input Types: int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int=0): if v2 == 0: v3 = self._data.fast_xs(v1) v4 = isinstance(v3, np.ndarray) and v...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor, float Output Type: torch.Tensor Dependencies: ```python def v0(v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor: v2 = torch.Tensor(v2) v3 = torch.Tensor(v1) - v2 / 2.0 return torch.cat([v3, v2]) ``` ```python ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1, v2: int=None): v3 = 0 while v3 < v2 if v2 else True: try: v4 = self.deque.popleft() except IndexError: ...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> str: v2 = self.key in v1.keys() if self.required and (not v2): raise ValueError(f"NameComponent is required for key {self.key}, but is...
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 not self.St: self.St.append(0) self.minVal = v1 else: self.St.append(v1 - self.minVal) if v1 < self.mi...
Imports: ```python import numpy as np from pandas._typing import Axis, FrameOrSeries, FrameOrSeriesUnion, IndexLabel from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import doc import pandas as pd from pandas.api.types import is_list_like from pandas.core import generic import...
Imports: ```python import pandas as pd from pandas import DataFrame, Series import typing ``` Type definitions: Input Types: DataFrame, int, str Output Type: Series Dependencies: ```python def v0(v1: DataFrame, v2: int=20, v3: str='close') -> Series: return pd.Series(v1[v3].ewm(span=v2, adjust=False, min_periods=v...
Imports: ```python import typing ``` Type definitions: Input Types: str, tuple Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: tuple): v3 = self.pgndata[v2] return v3.data[v1] ```
Imports: ```python import numpy as np import io import typing ``` Type definitions: Input Types: Path Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: Path) -> np.ndarray: with v1.open() as v2: v3 = io.StringIO(v2.read().replace(' -> ', ',')) v4 = np.loadtxt(v3, d...
Imports: ```python from random import choice import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = self._get_all_ip_proxy() if v1 == []: return '' v2 = choice(v1) return 'http://{}:{}'.format(v2.get('ip'...
Imports: ```python import typing ``` Type definitions: Input Types: Any, int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: int) -> None: for v3 in self._tracked_objects: if len(v3) > 0: v4 = v1 - v3[-1].frame if v4 > v2: ...
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 = len(v1) v4 = len(str(v2)) v5 = 1000000007 v6 = [0] * (v3 + 1) v6[0] = 1 v6[1] = 1 for v7 in range(1,...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str): v2 = await self._connection.command('add', self._prepared_params([v1])) self._check_empty(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: Any Dependencies: ```python def v0(v1: str): return [i.strip('+-').lower() for v2 in v1.split('_')] ``` Function Name: v3 Function: ```python def v3(v4: str, v5): if v4 == 'eo:instrument': return v0(v5) else: ...
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: self._num_checkpoints += 1 with open(os.path.join(v1, 'custom.log'), 'w') as v2: v2.write(f'{self._num_checkpoints}') `...
Imports: ```python import typing ``` Type definitions: Input Types: str, dt.datetime, dt.datetime Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: dt.datetime, v3: dt.datetime, **v4) -> int: v5 = v4['subreddits'] if 'subreddits' in v4 else [] v6 = self._cached_sub...
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 = self.inf_by_base_pos.get(v2[:2], None) return None if v3 is None else v3.get_base_form(v1, v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: if v1 not in self.whole_attrs and v1 not in self.parts_attrs: raise ValueError('{0} is not a valid observable attribute.'.format(v1))...