text
stringlengths
190
325k
Imports: ```python import torch from torch import Tensor, device from torch.nn import Module import typing ``` Type definitions: Input Types: Tuple[Tensor, ...], List[bool] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: Tuple[Tensor, ...], v2: List[bool]) -> None: assert isinstan...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: models.StocksEquitiesDailyOpenCloseApiResponse Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, **v3) -> models.StocksEquitiesDailyOpenCloseApiResponse: v4 = f'{self.url}/v1/open-close/{v1}/{v2}' ...
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: v1 = self._check_field_byte('WA0AA', 'WA0BBR', 2) v2 = self._check_field_byte('WA0AA', '#WA0TTY', 1, input_len=0, input_base_reg='R0') self._chec...
Imports: ```python from inspect import signature import typing ``` Type definitions: ```python v0 = Tuple[State, Optional[Union[bool, int, float, str]]] ``` Input Types: Callable[[str, Union[bool, int, float, str]], None], Callable[[str], v0] Output Type: Any Dependencies: Function Name: v1 Function: ```python def v1(...
Imports: ```python import cv2 import numpy as np import typing ``` Type definitions: Input Types: list, tuple Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2: tuple=(640, 360)) -> np.ndarray: v3 = [] for v4 in v1: v3.append(np.hstack((cv2.cvtColor(cv2.re...
Imports: ```python import typing ``` Type definitions: ```python class v0(ABC): @abstractmethod def v1(self) -> str: pass @abstractmethod def v2(self) -> str: pass @abstractmethod def v3(self) -> str: pass @abstractmethod def v4(self) -> str: pass ``` ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v1 = v1.replace('/', '\\/') if v1.endswith('+'): v1 = v1.rstrip('+') v1 = v1 + '[^\\/]*' v1 = v1.replace('+', '.*') v1 = v1.repl...
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 = np.tile(v1, (5, 5)) (v3, v4) = v1.shape for v5 in range(5): for v6 in range(5): ...
Imports: ```python import os import tensorflow.compat.v1 as tf import typing ``` Type definitions: Input Types: Optional[tf.Graph] Output Type: bool Dependencies: ```python def v0(v1: tf.Graph) -> Optional[object]: v2 = v1._get_control_flow_context() while v2: if v2.IsXLAContext(): return v...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> int: v2 = 0 v3 = '0' for v4 in v1: if v4 == v3: continue else: v3 = v4 v2 += 1 retur...
Imports: ```python import typing ``` Type definitions: Input Types: Iterable[str] Output Type: int Dependencies: ```python def v0(v1: str) -> int: v2 = [] for v3 in v1.strip(): match v3: case '(' | '[' | '{' | '<': v2.append(v3) case ')': if v2.po...
Imports: ```python import typing ``` Type definitions: Input Types: types.Message, dict Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: types.Message, v2: dict): v3 = await self._patcher.check_async(v1.text, self.pattern) if v3 is None: return v4 = {} ...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: Any Dependencies: ```python def v0(v1: list, v2: str, v3: list): if v3 is None: v3 = list() for v4 in v1: if v2 in v4 and set(v3).issubset(v4[v2]): return v4 return None ``` ```python def v5(v6...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.acquire() try: for v1 in [self.err, self.out]: if v1 and hasattr(v1, 'flush'): v1.flush() finally: ...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=True): for v2 in self.get_children_nodes(): v2.mark_invalid(v1) v2.mark_children_invalid(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: int, str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: int=1, v2: str='ABC') -> bool: str(v1) + v2 return ```
Imports: ```python import typing ``` Type definitions: ```python class v0(abc.MutableMapping): v1: 'Dict[Any, ColumnBase]' v2: bool v3: Tuple[Any, ...] def __init__(self, v4: Union[abc.MutableMapping, v0]=None, v5: bool=False, v6=None): if v4 is None: v4 = {} if isinstance(v...
Imports: ```python import typing ``` Type definitions: ```python class v0(_Pack): def __init__(self, v1: Path, v2: Optional[Project]=None) -> None: super().__init__(v1, project=v2) self._entities: Optional[BpEntities] = None self._animation_controllers: Optional[BpAnimationControllers] = No...
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: float Output Type: Any Dependencies: ```python def v0(v1): v1 = torch.fmod(v1, 2 * phase_range) v1[v1 > phase_range] = 2 * phase_range - v1[v1 > phase_range] return v1 ``` Function Name: v2 Function: ```python def v...
Imports: ```python from typing import List, Optional, Tuple import typing ``` Type definitions: Input Types: Tuple Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tuple) -> str: (v2, v3) = v1 if isinstance(v3, List): v4 = 'Any' in v3 if not v4: ...
Imports: ```python import numpy as np from numpy import ndarray import typing ``` Type definitions: Input Types: ndarray Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: ndarray) -> bool: if v1.ndim == 0 and np.all(np.isnan(v1)): return True else: return False `...
Imports: ```python from datetime import datetime from pathlib import Path import numpy as np import h5py import typing ``` Type definitions: Input Types: Path, Any Output Type: Any Dependencies: ```python def v0(v1: Path) -> Path: v2 = datetime.now().strftime('_%Y_%m_%d_%H_%M_%S') v3 = v1.parent / 'backup' ...
Imports: ```python import typing ``` Type definitions: Input Types: float, float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float): assert 0 < v1 < 1 assert 0 < v2 < 1 self._position = (v1, v2) return self ```
Imports: ```python from sklearn.preprocessing import LabelEncoder import pandas as pd from sklearn.utils import compute_class_weight import typing ``` Type definitions: Input Types: pd.Series, pd.Series Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.Series, v2: pd.Series): ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: List[int] Dependencies: ```python def v0(v1: int, v2: int) -> List[int]: if v2: return [0] * v1 + [0] + [0] + [1] * v2 + [1] else: return [0] * v1 + [0] + [0] ``` ```python def v3(v4: int, v5: int) -> List[int]...
Imports: ```python from math import acos, asin, atan2, cos, degrees, floor, radians, sin, sqrt import typing ``` Type definitions: Input Types: Tuple[float, float], Tuple[float, float], float Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: Tuple[float, float], v2: Tuple[float, float]...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1 = 'NIFTY 50' v2 = 'NIFTY NEXT 50' ``` ```python class v3: v4 = 'historical_pepb' v5 = 'historicalindices' ``` Input Types: v3, v0, date, date Output Type: Any Dependencies: Function Name: v6 Function: ```python def v6(self, v...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: dict): if not v1: return [] return ','.join(['{}={}'.format(k, v) for (v2, v3) in v1.items()]) ```
Imports: ```python import typing ``` Type definitions: Input Types: requests.Response Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: requests.Response) -> Any: if v1.status_code == 204: return None else: v2 = v1.headers['Content-Type'].split(';')[0] ass...
Imports: ```python import os, sys import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: ```python def v0(v1): return os.path.join(get_files_dir(), v1) ``` ```python def v2(): v3 = os.getcwd() return os.path.join(v3, 'assets\\files') ``` Function Name: v4 Function: ```python de...
Imports: ```python import typing ``` Type definitions: Input Types: sqlite3.Cursor, bool, bool, bool, str, int, bool Output Type: Any Dependencies: ```python def v0(v1: str): if v1[0] == '+': return "date('now', '" + v1 + "')" if v1 == 'today': return "date('now')" if v1 == 'tomorrow': ...
Imports: ```python import typing ``` Type definitions: Input Types: object Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: object): if not self._initialized: raise RuntimeError('Must call initialize before checking gates/configs/experiments or logging events') v1....
Imports: ```python import requests from requests import ConnectTimeout, PreparedRequest, RequestException, Response from requests.auth import HTTPBasicAuth import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: try: sel...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = self.get_node(v1) if v2 is None: raise KeyError('No object named {key} in the file'.format(key=v1)) return self._read_group(v2) `...
Imports: ```python import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np from matplotlib.axes import Axes from matplotlib.figure import Figure from matplotlib.patches import Rectangle, Arrow import typing ``` Type definitions: Input Types: Tuple[float, float, float, float], List[str...
Imports: ```python import datetime import logging import typing ``` Type definitions: Input Types: int Output Type: Tuple[Optional[datetime.datetime], Optional[datetime.datetime]] Dependencies: ```python def v0(v1: int, v2: Text) -> Optional[datetime.datetime]: v3 = None try: v4 = registry.get_value(v2...
Imports: ```python import numpy as np from numpy import ndarray from scipy import sparse from scipy.sparse.csc import csc_matrix from scipy.sparse.dia import dia_matrix import typing ``` Type definitions: Input Types: Output Type: csc_matrix Dependencies: Function Name: v0 Function: ```python def v0(self) -> csc_mat...
Imports: ```python import typing ``` Type definitions: Input Types: dict, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict, v2: bool=True): v3 = {} if self.ohots is not None: v3['ohots'] = {f: c.exemplify(v1['tokens']) for (v4, v5) in self.ohots.items()} ...
Imports: ```python import math import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: if self.__number < 0: raise ValueError('Number cannot be less than zero') return math.factorial(self.__number) ```
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.Triggered: return self.Triggered[v1] = set() ```
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: list): v2 = {k: v for (v3, v4) in v1} return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: for v1 in self.inputs(): v1.finalize() ```
Imports: ```python import numpy as np import cv2 import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: np.ndarray, v3='b'): if v3 == 'b': v2 = np.concatenate([np.zeros((v2.shape[0], v2.sh...
Imports: ```python import typing ``` Type definitions: ```python class v0(BaseModel): v1: int = Field(description='Page index, must not be negative.', ge=0) v2: int = Field(description='The size of the page to be returned, must be greater than 0.', gt=0) @staticmethod def v3(v4: int) -> 'PageRequest': ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1) -> int: v2 = v1.cursor() v3 = 'SELECT COUNT(*) AS count from dbo.classified_widgets where is_good = 1' v4 = v2.execute(v3).fetchone() return v4.count ...
Imports: ```python import numpy as np from scipy.stats import multivariate_normal, lognorm, norm, chi import typing ``` Type definitions: Input Types: np.ndarray, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2='univar_gaussian'): v3 = {'distr': v2} v4 = 1e-0...
Imports: ```python import csv import typing ``` Type definitions: Input Types: str, List[dict] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: List[dict]): with open(v1, mode='w') as v3: v4 = v2[0].keys() v5 = csv.DictWriter(v3, v4) v5.writeheader()...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Iterable[Tuple[float, float]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Iterable[Tuple[float, float]]: for v1 in self: yield (v1[0], v1[1]) ```
Imports: ```python import typing ``` Type definitions: ```python class v0: v1: ArgumentParser @classmethod def v2(cls): pass ``` Input Types: Output Type: Any Dependencies: Function Name: v3 Function: ```python def v3(cls: v0): cls.parser.set_defaults(target=cls.run) return cls ```
Imports: ```python import typing ``` Type definitions: Input Types: argparse.ArgumentParser Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: argparse.ArgumentParser): v2 = v1.add_subparsers(dest='doc', help='DO NOT USE DOC SLUG AS IDENTIFIER WHICH MAY CAUSE ERROR') v2.required =...
Imports: ```python import typing ``` Type definitions: Input Types: List[int], List[int] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: List[int]) -> int: v3: List[int] = sorted([-(s // -d) for (v4, v5) in zip(v1, v2)]) for v6 in range(len(v3)): if...
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(self, v1: np.ndarray) -> np.ndarray: if self.norm_obs: if self.dim_off is None: v1 = np.clip((v1 - self.obs_rms.m...
Imports: ```python from collections import OrderedDict import typing ``` Type definitions: Input Types: Dict, str, Union[List, None], Any Output Type: Union[Union[Dict, OrderedDict], List[Union[Dict, OrderedDict]]] Dependencies: ```python def v0(v1): if len(v1) == 1: return v1[0] return v1 ``` Function...
Imports: ```python import traceback import sys import typing ``` Type definitions: Input Types: Output Type: Callable Dependencies: ```python async def v0(v1: Request) -> Response: v2 = v1.url._url v3 = v1.cookies print(f'Received request: url={v2!r} cookies={v3!r}') try: v4 = await original_r...
Imports: ```python from io import StringIO import typing ``` Type definitions: Input Types: str, Optional[str], Optional[str], bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, *v5: object, v2: Optional[str]=..., v3: Optional[str]=..., v4: bool=...): v6 = self.console...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): self.distance[v1] = 0 for v2 in range(len(self.vertices)): for v3 in self.edges: v4: str = v3[0] v5: str = v3[1] ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, float Output Type: List[float] Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: float=None) -> List[float]: v3 = v1.shape[2] v4 = v1.shape[1] v5 = [] for v6 in range(len(v1)...
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int) -> int: if v1 == -2 ** 31: if v2 == -1: return 2 ** 31 - 1 if v2 == 1: return v1 if v1 == 2 *...
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int) -> bool: if self.middle: return False self.middle = True self.x = v1 self.y = v2 return False ```
Imports: ```python from tensorflow import keras import typing ``` Type definitions: Input Types: tuple, int, Any Output Type: keras.Model Dependencies: Function Name: v0 Function: ```python def v0(v1: tuple, v2: int, v3=1024) -> keras.Model: v4 = keras.layers.Input(shape=v1) v5 = v4 v5 = keras.layers.Flat...
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int]) -> List[int]: v2 = range(1, len(v1) + 1) v3 = [0] * (len(v1) + 1) for v4 in v1: v3[v4] += 1 for v5 in v2: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.lists = self.list = self.list_media self.protect = self.protect_media self.unprotect = self.unprotect_media ```
Imports: ```python import typing ``` Type definitions: Input Types: Optional[list], Optional[list], Optional[list], str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[list]=None, v2: Optional[list]=None, v3: Optional[list]=None, v4: str='In') -> None: v5 = bool(not...
Imports: ```python import typing ``` Type definitions: Input Types: str, Optional[str] Output Type: Iterable[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Optional[str]=None) -> Iterable[str]: v3 = v2 or self.bucket for v4 in self.ch.s3_resource.Bucket(v3).objects.filter(P...
Imports: ```python import os import gzip from binascii import unhexlify import typing ``` Type definitions: Input Types: str, Union[str, bytes] Output Type: bytes Dependencies: ```python def v0(v1: Union[str, bytes], v2: bytes) -> bytes: if not isinstance(v1, bytes): v1 = int(v1.replace(' ', ''), 0).to_byt...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: (int, list[int]) Dependencies: Function Name: v0 Function: ```python def v0() -> (int, list[int]): with open('input.txt') as v1: v2 = int(v1.readline().rstrip()) v3 = v1.readline().rstrip().split(',') return (v2,...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[Iterable[int]] Output Type: Optional[Set[int]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[Iterable[int]]=None) -> Optional[Set[int]]: if v1 is not None: self._proc.cpu_setaffinity(v1) re...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int Output Type: Generator[float, None, None] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=10) -> Generator[float, None, None]: (v2, v3) = self.u_domain return np.linspace(v2, v3, v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: Any Dependencies: ```python def v0(v1: Iterable, v2: Tuple[str], v3, v4: int): from towhee.utils.milvus_utils import Collection, MutationResult if isinstance(v3, str): v3 = Collection(v3) v5 = [] v6 = 0 ...
Imports: ```python import matplotlib.pyplot as plt import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame): v2 = {} v3 = list(v1.columns) v3.remove('NODECODE') v3.remove('PICKINGLIST') v3.remove('IN...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> int: v2 = 0 v3 = 1 for v4 in range(1, len(v1)): if v1[v4 - 1] == v1[v4]: v3 += 1 else: v2 = max(v2, ...
Imports: ```python import logging from datetime import datetime, timezone import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=14): for v2 in self.certificate_client.list_properties_of_certificates(): if not v2.enabl...
Imports: ```python from operator import itemgetter import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.ident: self.attr_sheet.colnames = self.title_list for v1 in filter(itemgetter(self.ident), self.a...
Imports: ```python import os import requests import zipfile import io from pathlib import Path import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str='https://ndownloader.figshare.com/files/25791104', v2: str='grid'): v3 = Path...
Imports: ```python import itertools import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, list[tuple[int, int]], Any Output Type: Any Dependencies: ```python def v0(v1: np.ndarray, v2, v3, v4: int, v5: int): v6 = np.full(shape=(v2, v3), dtype=bool, fill_value=False) if v4 == 0: ...
Imports: ```python from PIL import Image, ImageFile import typing ``` Type definitions: Input Types: Any, Any Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> List[str]: v3 = [] for v4 in v2: with Image.open(v4) as v5: if v5.size == v1: ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> int: v2 = {int(c) for v3 in v1 if v3.isdigit()} if len(v2) < 2: return -1 (*v4, v5, v4) = sorted(list(v2)) return v5 ```
Imports: ```python import typing ``` Type definitions: ```python v0 = Union[TASK_TRACKER_COLUMN, ACTIVITY_TRACKER_COLUMN] ``` Input Types: pd.DataFrame, v0, Any, Any Output Type: pd.DataFrame Dependencies: Function Name: v1 Function: ```python def v1(v2: pd.DataFrame, v3: v0, v4: Any, v5: Any=None) -> pd.DataFrame: ...
Imports: ```python from typing import Any, Dict, List, Optional, cast import tensorflow as tf from tensorflow.python.training.tracking.tracking import AutoTrackable import typing ``` Type definitions: Input Types: pathlib.Path, Dict[str, Any], Optional[List[str]] Output Type: AutoTrackable Dependencies: ```python def ...
Imports: ```python import numpy as np from numpy import ndarray import typing ``` Type definitions: Input Types: ndarray Output Type: ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: ndarray) -> ndarray: v2 = v1.shape[0] return np.kron(v1, np.identity(v2)) - np.kron(np.identity(v2), v1.T...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: str Dependencies: ```python def v0(v1: int, v2: int=1) -> str: assert isinstance(v1, int) v3 = pow(256, v2) if v1 < -v3 / 2 or v1 >= v3: raise OverflowError('cannot convert int {} to hex ({} bytes)'.format(v1, v2))...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python async def v0(self) -> str: v1 = await self._state.create_team_invite(self.id) return v1.get('invite', v1).get('id') ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.has_bag_server: self._eval_skill('close_all_cellviews()') ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> float: if 1 < v1: v2 = self.__get_previous_horizon_index(v1) if v2 is not None: v3 = self.points[v1][self.VERTICAL_ANG...
Imports: ```python import typing ``` Type definitions: Input Types: Any, int, Dict, Dict[str, float], Dict[str, float], float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: int, v3: Dict, v4: Dict[str, float], v5: Dict[str, float], v6: float=500): for v7 in v3.values(): ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._simulation.panda_robot.reset() self._simulation.y = 0.015 if self._object_id is not None: self._simulation.remove_object(self._obje...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Output Type: typing.NoReturn Dependencies: Function Name: v0 Function: ```python def v0() -> typing.NoReturn: (v1, v2) = map(int, input().split()) v3 = np.array(input().split(), dtype=np.int64) v4 = np.array(input().sp...
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: for v2 in v1: v3 = self.root.insertValue(v2) if v3 is not None: self.root = v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: tuple Output Type: str Dependencies: ```python def v0(v1: dict) -> dict: v2 = dict() while v1: v3 = str() v4 = str() for (v5, v6) in v1.items(): if len(v6) == 1: v3 = v6.pop() ...
Imports: ```python import torch import torch.utils.data import typing ``` Type definitions: Input Types: torch.Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor): v2 = torch.cat((self.model.get_s_embedder()._embeddings.weight.data[:len(v1)].cpu(), self.model...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: int): if 1 <= v1 <= self.ctx.cog.latest_number: await self.show_page(v1) ```
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = re.split('/([0-9]{5,7})', v1) v3 = None for v4 in v2: try: v3 = int(v4) except ValueError: pa...
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 = [] for v3 in range(v1): v4 = [0 for v5 in range(v1)] v2.append(v4) (v5, v6) = (0, 0) v7 = 0 (v8, v...
Imports: ```python import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: str): for (v3, v4) in enumerate(v1): if v4 != '' and v2.startswith(v4): return v3 raise Exception(f'Did not find {v2} in {v1}') `...
Imports: ```python import torch import torch.nn.functional as F import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, builtins.float, builtins.bool Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: torch.Tensor, *, v3: builtins.float=0.00...
Imports: ```python from sklearn.model_selection import GridSearchCV, RepeatedStratifiedKFold, cross_val_score, cross_validate from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC from sklearn.neighbors import KNeighborsClassifier import typing ``` Type definitions: Input Types: dict, Any, An...
Imports: ```python import typing ``` Type definitions: Input Types: List[docspec.Module] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: List[docspec.Module]): assert v1[0].name == 'docspec_python' assert any((x.name == 'docspec_python.parser' for v2 in v1)) ```
Imports: ```python import typing ``` Type definitions: Input Types: Tuple[int, int] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tuple[int, int]) -> bool: (v2, v3) = v1 return not 0 <= v2 < self.size or not 0 <= v3 < self.size ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> int: v1 = v1.strip() if len(v1) == 0: return 0 if v1[0] == '-': v2 = -1 v1 = v1[1:] elif v1[0] == '+': v...