text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: if self._attribute_path: v1 = '.' + '.'.join([str(x[1]) for v2 in self._attribute_path]) else: v1 = '' return str(self.datablock_st...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = 'Demo Project / MR #1 Make a trivial change to the README.' v2 = '\nHemanth V. Alluri created [MR #1](https://gitlab.com/Hypro999/demo-project/-...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Optional[int] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[int]=None): v2 = self.sheet.get_worksheet(2) v1 = v2.col_count - 1 if v1 < 2: return np.array([]) ...
Imports: ```python import torch import gzip import lzma import typing ``` Type definitions: Input Types: Union[str, IO] Output Type: Union[IO, gzip.GzipFile] Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[str, IO]) -> Union[IO, gzip.GzipFile]: if not isinstance(v1, torch._six.string_classes)...
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor, str Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: str='') -> torch.Tensor: v3 = v1.shape if not v2: return 1 v4 = 1 if 'b' in v2: v4 /= v3[0] ...
Imports: ```python from collections import UserDict import torch import typing ``` Type definitions: Input Types: torch.LongTensor, torch.FloatTensor, torch.LongTensor, torch.LongTensor, torch.FloatTensor, Optional[int], Optional[int] Output Type: Tuple[torch.Tensor] Dependencies: Function Name: v0 Function: ```pytho...
Imports: ```python from datetime import date, datetime, timedelta from polars.utils import _timedelta_to_pl_duration from polars import internals as pli from polars.datatypes import DataType, Date, Datetime, Float64, Int32, Object, UInt32, py_type_to_dtype import typing ``` Type definitions: ```python class v0: de...
Imports: ```python import logging import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): v2 = self._get_settings() for (v3, v4) in v1.items(): if len(v3.split('settings.')) > 1: v3 = v3.split('setti...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: for v1 in self.widgets: if getattr(self.widgets[v1], '_terminate', None): self.widgets[v1]._terminate() self.widgets = {} sel...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: str, Sequence[int] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Sequence[int]) -> None: if hasattr(self, v1): raise ValueError(f'invalid parameter name: {v1}') v3 =...
Imports: ```python import h5py import numpy as np import plotly.graph_objects as go import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1=np.linspace(0, 20000000.0, 50), v2: str='initial_source.h5'): v3 = h5py.File(v2, 'r') v4 ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if type(v1) != str: self.fail('invalid_type') return v1 ```
Imports: ```python import subprocess import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0() -> bool: v1 = subprocess.run(['git', 'rev-parse', '--is-inside-work-tree'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) if v1.returncode ...
Imports: ```python import typing ``` Type definitions: Input Types: int, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: str): v3 = self.cpu v4 = v3.x v3.memory[v1] = v4 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0(v1: str | None) -> float: if not v1: return 0 v1 = v1.lstrip('#') v2 = tuple((int(v1[i:i + 2], 16) / 255.0 for v3 in (0, 2, 4))) v4 = 0.2126 * v2[0] + 0.7152 * v2[1] + 0.0722 * ...
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray Output Type: Tuple[np.ndarray, np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray, v2: np.ndarray) -> Tuple[np.ndarray, np.ndarray]: v3 = v1.round().astype(int) v4 = v2.round().a...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: self._rel_path = v1 self._target_adapters.clear() ```
Imports: ```python import numpy as np from netCDF4 import Dataset from ..logging import debug, log import typing ``` Type definitions: Input Types: str, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: bool=True): with Dataset(v1, 'r') as v3: try: v...
Imports: ```python import json import os import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: if not os.path.exists(self.files_path): return {} return json.load(open(self.index_path, 'r')) if self.index_filename i...
Imports: ```python import typing ``` Type definitions: Input Types: Any, list, Any, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1, v2: list, v3, v4, v5=False): v6 = [v2[x:x + 10] for v7 in range(0, len(v2), 10)] if v3 > len(v6): v3 = 0 if v3: ...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: int): if v2 == -1: v3 = v1.iloc[:, :-1]._get_numeric_data() v4 = v1.iloc[:, -1] else: v5 = [x for v6 i...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1 = {'type': self.type, 'expirationMs': self.expiration_ms, 'field': self.field} return v1 ```
Imports: ```python import torch import torch.nn as nn import typing ``` Type definitions: Input Types: Dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict): (v2, v3) = (v1['continuous'], v1['categorical']) v1 = None if len(self.hparams.categorical_cols) > 0: ...
Imports: ```python import pandas as pd from pandas.io.formats.style import Styler import numpy as np import typing ``` Type definitions: Input Types: bool, bool, bool Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False, v2: bool=True, v3: bool=True) -> pd.DataFram...
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 == self._warn_mkv: return self._count.update({'warning': self._count.get('warning') + 1}) self.task.get('status').updat...
Imports: ```python from hashlib import md5, sha256 import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): v2 = sorted(list(v1.items())) v3 = '&'.join([f'{k}={v}' for (v4, v5) in v2]) v6 = v3.replace('&', '||').enco...
Imports: ```python import typing ``` Type definitions: Input Types: Text, Dict[Text, Any] Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: Text, v2: Dict[Text, Any], **v3: Any) -> None: v4 = {**v2, 'metadata': v3.get('metadata', {})} await self._send_message(v1, v4)...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str): if len(v1) > len(v2): if v1[:len(v2)] == v2: return False else: for v3 in range(len(v2)): ...
Imports: ```python 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.schedules[v1][s]['name']: self.schedules[v1][s]['id'] for v4 in self.schedules.get(v1, {})} return v2 in list(v3.values()...
Imports: ```python import torch from torch import nn from torch.ao.sparsity import BaseSparsifier, WeightNormSparsifier, FakeSparsity, NearlyDiagonalSparsifier from torch.nn.utils.parametrize import is_parametrized from torch.testing._internal.common_utils import TestCase import typing ``` Type definitions: Input Type...
Imports: ```python import torch import torch.nn.functional as F from torch.nn.modules.linear import Linear from torch.nn.modules.rnn import LSTMCell, LSTM import typing ``` Type definitions: Input Types: Dict[str, torch.Tensor] Output Type: Dict[str, torch.Tensor] Dependencies: Function Name: v0 Function: ```python d...
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: v2 = [t for v3 in self.widgets if re.search(v1, v3)] assert len(v2) == 1, f'Got {len(v2)} matches for {v1!r}' return v2[0] ``...
Imports: ```python import torch from torch import device, Tensor import torch.jit._shape_functions as upstream_shape_functions import typing ``` Type definitions: Input Types: Union[Tensor, Tuple] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[Tensor, Tuple]): if isinstance(...
Imports: ```python import matplotlib.pyplot as plt import matplotlib.ticker as tkr import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray, Any, str, str, str, str, Union[float, float], Union[float, float], Any, Any, Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(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 = 1 while v1 != 0: if v1 & v3: v1 ^= v3 else: v1 >>= 1 v2 += 1 return v2 ...
Imports: ```python import typing ``` Type definitions: Input Types: typing.Optional[Iterable] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: typing.Optional[Iterable]=None) -> str: if v1 is None: v1 = [] return self._as_shell(self.value, v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor, int Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: int) -> torch.Tensor: if v2 > 0: v1 = v1[:-v2] return v1 ```
Imports: ```python import asyncio import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, **v1: Any) -> None: self.stop_future = asyncio.Future() await self.ipc.start() self.__tasks.create_task(self._broadcast_cluster_info_...
Imports: ```python import typing ``` Type definitions: Input Types: list[str] Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list[str]) -> dict: v2 = {'ids': v1} return self._post('/tunnels2/thirdParty/state', data=v2) ```
Imports: ```python import collections import torch from torch.nn import Module import typing ``` Type definitions: Input Types: Module, List[Dict] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Module, v2: List[Dict]): assert isinstance(v1, Module), 'Only support compressing...
Imports: ```python import math import copy import typing ``` Type definitions: Input Types: list Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list) -> list: v2 = math.floor(self.elitism * len(v1)) v3 = copy.deepcopy(v1) v4 = self._crossover(v3, self.pc, v2) v5...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor) -> torch.Tensor: v2 = torch.ops.image.decode_image(v1) return v2 ```
Imports: ```python from collections import defaultdict import queue import typing ``` Type definitions: Input Types: int, Any, Any, list[str] Output Type: Any Dependencies: ```python def v0(v1: str, v2: dict[str, int]): if v1.isalpha(): return v2[v1] else: return int(v1) ``` Function Name: v3 F...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Union[bool, List[Dict]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Union[bool, List[Dict]]: self.provider.authenticate() v1 = self.config.resolve('lexicon:identifier') v2 = self.config.resolve('lexic...
Imports: ```python import datetime import typing ``` Type definitions: Input Types: str, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str=None, v2: int=None): try: if v1: v3 = datetime.datetime.strptime(v1, '%d/%m/%Y %H:%M') if v3 <= datetime....
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: int=30): if not isinstance(v1, np.ndarray): v1 = np.array(v1) v3 = len(v1) try: v4 = range(2, min(v2, v3 - 1))...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, **v1: Any) -> bool: v2 = self.async_join(**v1) for v3 in self._async_handlers: v2 = v3._async_close(**v1) and v2 self._async_handlers.clear() ...
Imports: ```python import random import numpy as np from pathlib import Path, PurePath from sklearn.model_selection import train_test_split import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any Output Type: tuple Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4, v5) -> tupl...
Imports: ```python import numpy as np import operator import typing ``` Type definitions: Input Types: List[str], List[str], str Output Type: List[Tuple] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str], v2: List[str], v3: str) -> List[Tuple]: v4 = 10 if v3 not in v1: return []...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python async def v0(v1: str) -> bool: for v2 in v1.strip().splitlines(): if 'This page appears when Google automatically detects requests coming from your computer network...
Imports: ```python import argparse import typing ``` Type definitions: Input Types: Output Type: argparse.ArgumentParser Dependencies: Function Name: v0 Function: ```python def v0() -> argparse.ArgumentParser: v1 = argparse.ArgumentParser() v1.add_argument('--delay', action='store', type=float, default=3, he...
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: if v2 >= self.nums[v1]: self.sum += abs(self.nums[v1] - v2) else: self.sum -= abs(self.nums[v1] - v2) s...
Imports: ```python from datetime import datetime import typing ``` Type definitions: Input Types: datetime, t.Hashable, t.Coroutine Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: datetime, v2: t.Hashable, v3: t.Coroutine) -> None: v4 = datetime.now(v1.tzinfo) if v1.tzinfo e...
Imports: ```python import requests import urllib import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> bool: v2 = requests.post(f'http://{self._host}/printer/print/start?filename={urllib.parse.quote(v1)}', headers=self._...
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: super().predict_proba(v1) v2 = v1.shape[0] return np.array([self.mean for v3 in range(v2...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1 = {'revisionID': self.revisionID, 'parentRevisionID': self.parentRevisionID, 'content': self.content.toJSON() if self.content is not None else None, '...
Imports: ```python from transformers import AutoConfig, AutoTokenizer, BartForConditionalGeneration, BatchEncoding, MBartForConditionalGeneration, T5ForConditionalGeneration, MT5ForConditionalGeneration from transformers import logging as transformers_logging import typing ``` Type definitions: Input Types: dict Outpu...
Imports: ```python import os import typing ``` Type definitions: Input Types: str, str, Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3, v4: str=None): v5 = os.path.dirname(v1) if not os.path.isdir(v5): os.makedirs(v5) with open(v1, v2, enc...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: self.run_git('add', '.') self.run_git('commit', '-m', v1) ```
Imports: ```python import typing ``` Type definitions: ```python @dataclass class v0: v1: str v2: str v3: int = 4433 v4: bool = True v5: Optional[int] = 4434 v6: str = '/' v7: Optional[str] = None v8: Result = field(default_factory=lambda : Result(0)) v9: Optional[int] = None v10...
Imports: ```python import torch from torch import nn from torch.nn import functional as F from torch.autograd import Variable import torch.utils.data import typing ``` Type definitions: ```python class v0(object): def __init__(self, v1: nn.Module, v2: list, v3): self.args = v3 self.model = v1 ...
Imports: ```python import typing ``` Type definitions: ```python v0 = Callable[[Doc, int, int], bool] ``` Input Types: Any Output Type: v0 Dependencies: ```python def v1(v2, v3, v4): v5 = v2[v3:v4].text.lower() v6 = phrase.split(v5) for v7 in range(len(v6) - 1): v8 = '' v9 = '' for v...
Imports: ```python import cv2 import torch 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: v1 = cv2.cvtColor(v1, cv2.COLOR_BGR2RGB) / 255 v1 = torch.from_numpy(v1.transpose((2, 0...
Imports: ```python import torch.nn.functional as F from torch import Tensor import typing ``` Type definitions: Input Types: Tensor, Tensor, Tensor Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor, v2: Tensor, v3: Tensor) -> None: v4 = F.mse_loss(v1, v2, reduction='non...
Imports: ```python import typing ``` Type definitions: Input Types: Tuple[float, float] Output Type: Tuple[float, float] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tuple[float, float]) -> Tuple[float, float]: (v2, v3) = self.get_hex_position(v1) v2 -= self.size v3 -= self.size ...
Imports: ```python import json import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: v1 = {'data': {'key': self.token}} v2 = self.request(url='https://europe-west1-fmpdev-1d3ca.cloudfunctions.net/getRemainingCalls', method='...
Imports: ```python import torch from torch import nn from torch.nn import functional as F import typing ``` Type definitions: Input Types: torch.Tensor Output Type: List[torch.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor) -> List[torch.Tensor]: v2 = v1 v3 = [] ...
Imports: ```python import typing ``` Type definitions: Input Types: 'str' Output Type: 'Optional[Cell]' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'str') -> 'Optional[Cell]': for v2 in self._rendered_cells.values(): if v2.id == v1: break else: return None ...
Imports: ```python import typing ``` Type definitions: Input Types: scratch.ScratchTarget, list Output Type: Any Dependencies: ```python def v0(v1: scratch.Block, v2: scratch.Block): v1.nextId = v2.id v2.parentId = v1.id ``` ```python def v3(v4: list): v5 = v4[0] for v6 in range(1, len(v4)): v7...
Imports: ```python import numpy as np import pandas as pd import plotly.graph_objects as go import plotly.express as px import plotly.io as pio import typing ``` Type definitions: Input Types: pd.DataFrame, pd.Series, str Output Type: NoReturn Dependencies: ```python def v0(v1, v2): v3 = np.cov(v1, v2)[0, 1] (...
Imports: ```python import re import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: dict): if not isinstance(v1, dict): raise ValueError('Configuration does not contain a dictionary.') for (v2, v3) in v1.items(): if...
Imports: ```python import numpy as np import torch import typing ``` Type definitions: Input Types: str, dict, float, float, int Output Type: torch.Tensor Dependencies: ```python def v0(v1, v2): v3 = torch.zeros((28, 28), dtype=torch.uint8) v4 = {} for v5 in v1: if v5 in v4: continue ...
Imports: ```python import cv2 import typing ``` Type definitions: Input Types: np.ndarray Output Type: bytes Dependencies: ```python def v0(v1: np.ndarray) -> bytes: v2 = cv2.cvtColor(v1, cv2.COLOR_RGB2BGR) (v3, v4) = cv2.imencode('.jpeg', v2) if not v3: raise ValueError('Image could not be encoded...
Imports: ```python import typing ``` Type definitions: Input Types: str, Dict[str, Union[dd.DataFrame, pd.DataFrame]] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Dict[str, Union[dd.DataFrame, pd.DataFrame]]=None) -> str: if v2 is not None: for (v3, v4) in...
Imports: ```python import typing ``` Type definitions: Input Types: str, spacy.tokenizer.Tokenizer Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: spacy.tokenizer.Tokenizer) -> str: v3 = ''.join([f'{word} O\n' for v4 in v2(v1) if len(str(v4).strip()) > 0]) if len(v3) >...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: int, v2: v0 | None) -> None: self.label = v1 self.parent = v2 self.left: v0 | None = None self.right: v0 | None = None ``` Input Types: v0, v0 | None Output Type: None Dependencies: Fu...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=None) -> dict: v2 = '\n SELECT f_table_name AS tblname, srid\n FROM geometry_columns\n ' if v1: v2 += f"\n ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str='_') -> None: if v1 == '': self.exp.suffix = '' else: self.exp.suffix = v2 + v1 return None ```
Imports: ```python import random import string import numpy as np from matplotlib import rcParams, pyplot import typing ``` Type definitions: Input Types: datetime Output Type: None Dependencies: ```python def v0(v1: datetime) -> str: return f"{v1.strftime('%Y%m%d_%H%M%S')}_{random_str(4)}" ``` ```python def v2(v3...
Imports: ```python import astropy.coordinates as coord from astropy.time import Time import astropy.units as u import typing ``` Type definitions: Input Types: float, float, datetime Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: float, v3: datetime): v4 = coord.EarthLo...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: demes.Graph, bool Output Type: Any Dependencies: ```python def v0(v1: Union[demes.Deme, demes.AsymmetricMigration], v2: Union[demes.Deme, demes.AsymmetricMigration]) -> bool: return not (v1.end_time >= v2.start_time or v2.end_ti...
Imports: ```python import pickle import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): with open(v1 + 'data.pkl', 'rb') as v2: v3 = pickle.load(v2) return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: Optional[int] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[int]) -> None: if v1 is not None: self.fix_precision_ = v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Optional[requests.Response], Optional[str], HTTPStatus, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Optional[requests.Response], v2: Optional[str]=None, v3: HTTPStatus=HTTPStatus.BAD_REQUEST, v4: bool=False): ...
Imports: ```python import torch import torch.nn as nn from torch.distributions import Categorical import typing ``` Type definitions: Input Types: Any Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> torch.Tensor: v1 = torch.tensor(v1, requires_grad=False, dtype=to...
Imports: ```python import typing ``` Type definitions: Input Types: Path Output Type: None Dependencies: ```python def v0(v1: Path) -> str: with open(v1, 'rb') as v2: v3 = PdfFileReader(v2) v4 = v3.getPage(0) return v4.extractText() ``` Function Name: v5 Function: ```python def v5(v6: Path)...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Optional[Match[str]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Optional[Match[str]]: if not self.matcher: return None return self.matcher.search(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: list Dependencies: Function Name: v0 Function: ```python async def v0(self, v1=False) -> list: if v1 or self.matches is None: v2 = await self.connection('GET', 'tournaments/{}/matches'.format(self._id), include_attachment...
Imports: ```python import typing ``` Type definitions: Input Types: types.ForwardRef Output Type: Set[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: types.ForwardRef) -> Set[str]: if v1.resolved: return self._visit(v1.resolved) else: return set() ```
Imports: ```python import typing ``` Type definitions: ```python v0 = Union[str, List[str]] ``` Input Types: List[artifact.Artifact], List[str] Output Type: Callable[[List[str], dataset_options.RecordBatchesOptions, Optional[schema_pb2.Schema]], Iterator[pa.RecordBatch]] Dependencies: ```python def v1(v2: artifact.Arti...
Imports: ```python import typing ``` Type definitions: Input Types: List[dict], str Output Type: bool Dependencies: ```python def v0(v1: Dict[str, int], v2: str) -> dict: if v2 == 'left': return {'x': v1['x'] - 1, 'y': v1['y']} if v2 == 'right': return {'x': v1['x'] + 1, 'y': v1['y']} if v2...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = {'id': 2, 'vote_delegations_$_from_ids': {222: []}} self.t_update_vote_delegations_from_on_empty_array('user.update', v1) ```
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1, v2): self.id = v1 self.data = v2 def __repr__(self): return 'Message with id={}, data={}'.format(self.id, self.data) @classmethod def v3(cls, v4): """Construct message obj...
Imports: ```python import typing ``` Type definitions: Input Types: Tensor, int Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor, v2: int) -> Tensor: v3 = v1.src.permute(1, 0).to(self.device) v4 = v1.trg.permute(1, 0).to(self.device) (v5, v6) = self(src=v3, t...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict: v1 = {'AES128-GCM-SHA256': 'weak', 'ECDHE-ECDSA-AES256-SHA': 'weak', 'ECDHE-ECDSA-AES256-GCM-SHA384': 'recommended', 'AES128-SHA': 'weak', 'ECDHE-RSA-AES...
Imports: ```python import typing ``` Type definitions: ```python class v0(metaclass=SwankType): v1: int = 1000 v2: Optional[JamId] = None v3: Optional[int] = None def __init__(self, *, v4: SwankDatabase, v5: Optional[Union[JamId, str]]=None, v6: Optional[int]=None, **v7): assert (v5, v6).count(...
Imports: ```python import typing ``` Type definitions: Input Types: Mapping[str, Any] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Mapping[str, Any]): if isinstance(v1, (tuple, list)): assert len(v1) == 2 v2 = {} for (v3, v4) in self.input_key.items...
Imports: ```python import typing ``` Type definitions: Input Types: set Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: set) -> None: if self.mac in v1: await self.async_remove() ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1=None) -> None: if self.runtime: self.runtime.join(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: h5py.Group Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: h5py.Group) -> None: super().to_hdf5(v1) v2 = v1.require_group(self.name) v2.attrs['num_modes'] = self.num_modes if self.basis is not No...