text
stringlengths
190
325k
Imports: ```python import torch from torch.autograd import Variable import torch.distributed as dist from torch.distributed import ProcessGroup import torch.nn as nn from torch.nn import Parameter import torch.nn.functional as F import typing ``` Type definitions: Input Types: torch.Tensor Output Type: Tuple[torch.Ten...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str='id', v2: str=''): v3 = f' ORDER BY {v1} {v2} ' self.statement_helper(v3) return self ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1) -> str: v2 = v1.rstrip('0123456789') v3 = v1[len(v2):].zfill(3) v4 = v2 + v3 return str(v4) ```
Imports: ```python from itertools import chain import typing ``` Type definitions: Input Types: Any, dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: dict): for v3 in chain(self.dtc_dops, self.data_object_props): v3._resolve_references(v2) for v4 in chain(...
Imports: ```python import logging import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: bool=False): logging.addLevelName(logging.DEBUG, 'DBG') logging.addLevelName(logging.INFO, 'INF') logging.addLevelName(logging.WARNING, 'W...
Imports: ```python from pathlib import Path import typing ``` Type definitions: Input Types: nox.sessions.Session Output Type: Path Dependencies: ```python def v0(v1: str, v2: bool=False) -> Path: v3 = Path() / 'requirements' / 'nox.lock' v4 = '{py_string}-{platform}.lock' if v2: v5 = '{platform}' ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray Output Type: float Dependencies: ```python def v0(v1: np.ndarray, v2: np.ndarray) -> float: assert v1.shape == v2.shape, "Shape of 'a' must match shape of 'b'" return np.linalg.norm(v1 - v2, axis=-1) `...
Imports: ```python import argparse import json import sys import textwrap import typing ``` Type definitions: Input Types: Output Type: int Dependencies: ```python def v0(v1: argparse.ArgumentParser, v2: str) -> None: v1.add_argument('--sas', help='SAS Token for the storage account.', required=True) v1.add_ar...
Imports: ```python import tempfile import typing ``` Type definitions: Input Types: Path Output Type: tempfile.TemporaryFile Dependencies: Function Name: v0 Function: ```python def v0(v1: Path) -> tempfile.TemporaryFile: v2 = tempfile.TemporaryFile() with open(v1, encoding='utf-8') as v3: for v4 in v3...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: list Dependencies: ```python def v0(v1: dict, v2: int): if v1['channel'].isdigit(): v3 = str(int(v1['channel']) + 100 * v2) else: v3 = str(float(v1['channel']) + 100 * v2) return (v3, v1['callSign'].replace(v1...
Imports: ```python import math import numpy as np import statsmodels.stats.power as pwr import typing ``` Type definitions: Input Types: float, float, float, float, float, float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: float, v3: float, v4: float=0.5, v5: float=0.9, v...
Imports: ```python import typing ``` Type definitions: Input Types: Any, int, 'wrapper.MjData' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: int, v3: 'wrapper.MjData'): v1._physics.free() v1._physics._reload_from_data(v3.deepcopy()) v1._hooks._episode_step_count = 0 ...
Imports: ```python import typing ``` Type definitions: Input Types: list, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2=None, v3=None): if v1: if len(v1) > 0: if type(v2) is int: if len(v1) > v2: return v1....
Imports: ```python import typing ``` Type definitions: Input Types: int, int, int, int, int, int, int, int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: int, v4: int, v5: int=0, v6: int=0, v7: int=100, v8: int=0, v9: int=1): v10 = self.moodle.post('co...
Imports: ```python from copy import deepcopy import tensorflow as tf from tensorflow.python.keras import backend from tensorflow.python.tpu.tpu_embedding_v2_utils import FeatureConfig, TableConfig import typing ``` Type definitions: Input Types: FeatureConfig Output Type: Dict[str, Any] Dependencies: ```python def v0(...
Imports: ```python import torch import torch.nn as nn from torch import optim from torch.utils.data import DataLoader, RandomSampler import typing ``` Type definitions: Input Types: list Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list) -> dict: v2 = 0 v3 = 0 v4 ...
Imports: ```python import typing ``` Type definitions: Input Types: np.array, int, int Output Type: np.array Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.array, v2: int, v3: int) -> np.array: (v4, v5) = v1.shape return v1.reshape(v4 // v2, v2, -1, v3).swapaxes(1, 2).reshape(-1, v2, ...
Imports: ```python import typing ``` Type definitions: Input Types: List[int], List[int] Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: List[int]) -> List[int]: v3 = (sum(v1) - sum(v2)) // 2 v4 = set(v2) for v5 in v1: if v5 - v3 in v4: ...
Imports: ```python from typing import List, Tuple, Union import torch.nn import torch import typing ``` Type definitions: Input Types: torch.nn.Module, Union[Tuple, List[Tuple]], Any, Any Output Type: Any Dependencies: ```python def v0(v1: Union[Tuple, List[Tuple]]) -> List[torch.Tensor]: if isinstance(v1, List): ...
Imports: ```python import typing ``` Type definitions: Input Types: Tensor, Tensor, Tensor, Optional[Tensor] Output Type: Tuple[Tensor, Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor, v2: Tensor, v3: Tensor, v4: Optional[Tensor]=None) -> Tuple[Tensor, Tensor]: v5 = v1.size(0) ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: self.determine_cooldown() if self._tokens == 0: return False return True ```
Imports: ```python import math import typing ``` Type definitions: Input Types: int, int, int, int, int Output Type: float Dependencies: ```python def v0(v1: int, v2: int) -> float: (v3, v4) = divmod(v1, v2) v5 = math.gcd(v4, v2) return float(v3) + v4 // v5 / (v2 // v5) ``` Function Name: v6 Function: ```p...
Imports: ```python import json import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: self.msg = json.loads(v1) self.handle_message() self.handle_presence_change() self.handle_dnd_change() ```
Imports: ```python from tqdm import tqdm import typing ``` Type definitions: Input Types: str Output Type: Tuple[Dict[str, int], Dict[int, str], Dict[str, int], Dict[int, str]] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> Tuple[Dict[str, int], Dict[int, str], Dict[str, int], Dict[int, str]]:...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> bool: v2 = 0 for v3 in v1: if v3.isalpha(): v2 += 1 if v2 > 2: return True return False ```
Imports: ```python import numpy as np import typing ``` Type definitions: ```python v0 = Tuple[str, str, int] ``` Input Types: np.ndarray Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(self, v2: np.ndarray) -> v0: (v3, v4) = ([], []) for (v5, v6) in self.graph.items(): for (...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = f'<title> {self.title} </title>\n <link rel="icon" href="{self.icon}" type="image/x-icon">\n <meta charset="{self.meta_c...
Imports: ```python import typing ``` Type definitions: Input Types: 'Directory' Output Type: Optional['Entry'] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'Directory') -> Optional['Entry']: if self.get_parent(): self.get_parent().remove_entry(self) v2 = v1 v3 = sel...
Imports: ```python from collections import namedtuple, defaultdict import typing ``` Type definitions: ```python class v0: def __init__(self, v1: List[Point]) -> None: assert len(v1) == 2 self._endpoints = v1 def v2(self) -> Iterable[Point]: (v3, v4) = sorted(self._endpoints, key=lambd...
Imports: ```python import typing ``` Type definitions: Input Types: list, list Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list, v2: list) -> None: self._add_table_header_or_row([(column[0], column[1]) for v3 in v1]) self._add_table_header_separator([(v3[2], v3[1]) f...
Imports: ```python import os import subprocess import typing ``` Type definitions: Input Types: Output Type: Tuple[int, str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Tuple[int, str]: for (v1, v2) in self.env_vars.items(): os.environ[v1] = str(v2) v3 = subprocess.run(self.ge...
Imports: ```python import torch import torch.nn as nn import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor: v1.names = ('B', 'N', 'E') v3 = v1.f...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: super().leave_chat(v1) self.__WebSocketClient.update_channelid_sub_pair() ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[Dict] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[Dict]: v1 = self.session.portfolio_account_positions(account_id=self.account, page_id=0) for v2 in v1: if 'ticker' not in v2: ...
Imports: ```python import difflib import typing ``` Type definitions: Input Types: list, list Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2: list) -> list: v3 = list() for v4 in v1: v5 = difflib.get_close_matches(v4, v2, n=1) if v5: v3.ap...
Imports: ```python import re import typing ``` Type definitions: Input Types: str, str, int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3: int=0) -> str: v4 = re.search(v2, v1) if v4: return v4.group(v3) return '' ```
Imports: ```python import rasterio from rasterio.transform import rowcol from rasterio.warp import transform_bounds import typing ``` Type definitions: Input Types: Any, Any Output Type: (float, float, float, float) Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> (float, float, float, float): ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Union[pd.Series, xr.DataArray], Union[float, xr.DataArray] Output Type: Union[pd.Series, xr.DataArray] Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[pd.Series, xr.DataArray], v2: Union[float, xr.DataArray]) -...
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 = self._get_icd_10_article_chapter(v1) if v2 == 'not found': return 'not found' v3: str = 'Chapter {} of ICD-10 deals with'....
Imports: ```python import typing ``` Type definitions: Input Types: 'Param' Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'Param') -> None: self.id = ', '.join([str(self), str(v1)]) self.args = self.args + v1.args self.arg_names = self.arg_names + v1.arg_names ```
Imports: ```python import queue import threading import typing ``` Type definitions: Input Types: ray.data.Dataset Output Type: Any Dependencies: ```python def v0(): v1 = threading.Thread(target=producer) v1.start() while True: v2 = q.get(block=True) if v2 is None: break ...
Imports: ```python from datetime import date, datetime, time, timezone import typing ``` Type definitions: Input Types: datetime | date | None, str | None, Callable Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: datetime | date | None, v2: str | None=None, v3: Callable=iso_format) ->...
Imports: ```python import typing ``` Type definitions: Input Types: 'DataSymbol' Output Type: Generator['DataSymbol', None, None] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'DataSymbol') -> Generator['DataSymbol', None, None]: if self.updated_sym is v1: yield from v1.children ...
Imports: ```python import requests import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str): self._parameters['action'] = 'download' self._parameters['language'] = v1 v3 = requests.get(self._URL, params=se...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict[int, Dict[str, Any]] Dependencies: ```python def v0(v1: Dict[str, Any], v2: str) -> Any: v3 = v1.get(v2) assert v3 is not None, 'KeyError: ' + v2 + ' not found in ' + str(v1) return v3 ``` Function Name: v4 Function: ```...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> DataFrame: if not isinstance(v1, int): raise TypeError('Period parameter is not perioderic.') if v1 < 7 or v1 > 21: raise Value...
Imports: ```python import os import glob import pandas as pd import numpy as np from os.path import basename, isdir, isfile, splitext import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4, v5) -> pd....
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> float: v2 = filter(lambda sale: sale.salesman_cpf == v1, self._storage.values()) v3 = float(0) for v4 in v2: v3 += v4.cashback.tot...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[Union[str, StringIO]], Optional[str], int, bool, bool, Optional[bool], bool, bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[Union[str, StringIO]]=None, v2: Optional[str]=None, v3: int=8, ...
Imports: ```python from multiprocessing.pool import Pool from functools import partial from itertools import chain from tqdm import tqdm import numpy as np import librosa import typing ``` Type definitions: Input Types: Path, Path, int, bool, Any Output Type: Any Dependencies: ```python def v0(v1, v2: Path, v3: bool, ...
Imports: ```python import torch import torch.nn.functional as F from torch import Tensor, nn import typing ``` Type definitions: Input Types: Union[int, List[int]], Optional[Tensor] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[int, List[int]], v2: Optional[Tensor]=None)...
Imports: ```python from datetime import datetime as dt import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1: str = dt.now().strftime('%A %d %B %H:%M:%S %Y') self.__clock_label.setText(v1) ```
Imports: ```python from sklearn.model_selection import GridSearchCV import typing ``` Type definitions: ```python v0 = pd.DataFrame ``` ```python v1 = np.ndarray ``` Input Types: v0, v1, dict, int, Any, str Output Type: tuple Dependencies: Function Name: v2 Function: ```python def v2(self, v3: v0, v4: v1, v5: dict, v6...
Imports: ```python from tqdm import tqdm import typing ``` Type definitions: Input Types: list, int Output Type: Any Dependencies: ```python def v0(v1, v2, v3): if v2 == v3: return v1 + 1 else: return 0 ``` Function Name: v4 Function: ```python def v4(self, v5: list, v6: int=5): v7 = float(...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Tuple[int, int] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Tuple[int, int]: (v1, v2) = self.last_moves return (self._get_repetition(v1), self._get_repetition(v2)) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, float Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: float=293.15) -> np.ndarray: v1 = np.array(v1, dtype=float) v1[v1 < 0] = np.nan v2 -= 273.15 v...
Imports: ```python from timeit import default_timer as time import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=True): if v1 or self._start_time is None: self._start_time = time() self.elapsed_time = None ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, float, int, int, int, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: float=0.0, v3: int=4, v4: int=60, v5: int=600, v6: bool=True): if v2: return self.summmarizer(v1, ratio=v2, min_leng...
Imports: ```python from datetime import datetime, timedelta import typing ``` Type definitions: Input Types: str Output Type: tuple Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=DEFAULT_MARKET) -> tuple: if not self._isMarketValid(v1): raise TypeError('Binance market required.')...
Imports: ```python import gzip import bz2 import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): if v1.endswith('.gz'): return gzip.open if v1.endswith('.bz2'): return bz2.BZ2File return open ```
Imports: ```python import typing ``` Type definitions: Input Types: list[str] Output Type: set[str] Dependencies: ```python def v0(v1: str) -> str: if v1 in TOPIC_KEYWORDS: for v2 in MAP_TOPICS: if v1 in MAP_TOPICS[v2]: return v2 return '_' ``` Function Name: v3 Function: ``...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): with self.get_cursor() as v2: v2.execute('SELECT cur_datatype, cur_blackbox from cur_blackbox WHERE cur_paper = %s', (v1,)) v3 = v2.fe...
Imports: ```python import os import torch.cuda as cuda import torch import torch.nn as nn import torch.optim as optim import typing ``` Type definitions: Input Types: str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str='checkpoints') -> None: self.model.loa...
Imports: ```python from random import randint import typing ``` Type definitions: Input Types: list[int], int, int Output Type: int Dependencies: ```python def v0(v1: int, v2: int): return randint(v1, v2) ``` Function Name: v3 Function: ```python def v3(v4: list[int], v5: int, v6: int) -> int: v7 = v0(v5, v6) ...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[float], Optional[float] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[float]=None, v2: Optional[float]=None): (v3, v4, v5, v6) = self.bb v1 = v5 - v3 if v1 is None else v1 v2 = v6 ...
Imports: ```python import typing ``` Type definitions: ```python class v0(ProperType): v1 = ('arg_types', 'arg_kinds', 'arg_names', 'min_args', 'is_ellipsis_args', 'variables') def __init__(self, v2: Sequence[Type], v3: List[ArgKind], v4: Sequence[Optional[str]], *, v5: Optional[Sequence[TypeVarLikeType]]=None...
Imports: ```python from torch.utils.data import DataLoader from torch.optim.lr_scheduler import _LRScheduler import torch from torch import Tensor from torch.nn import Module import typing ``` Type definitions: Input Types: Module, DataLoader, Union[str, torch.device], Any Output Type: float Dependencies: Function Na...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str) -> str: if v1 == 'yes': return 'Yes.' elif v1 == 'no': return 'NOPE' elif v1 == 'maybe': return 'maaaaaaybe?' ...
Imports: ```python import json from json import load import typing ``` Type definitions: Input Types: object, object Output Type: object Dependencies: Function Name: v0 Function: ```python def v0(v1: object, v2: object) -> object: with open(v2, 'w', encoding='utf-8') as v3: json.dump(v1, v3, indent=4) ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Iterator[bool] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> Iterator[bool]: while len(self.buf) < self.pos + v1: yield False ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.registry.set(20, 'twenty') self.registry.set(20, '20') self.assertEqual(self.registry.current_keys, [20]) self.assertEqual(self.registry...
Imports: ```python import typing ``` Type definitions: Input Types: str, list, list Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: list, v3: list) -> bool: if v1 not in self.data: if len(v2) != len(v3): print('長さが違う') return False ...
Imports: ```python import typing ``` Type definitions: Input Types: Union[int, float], Dict, List Output Type: Tuple[Dict, List] Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[int, float], v2: Dict, v3: List) -> Tuple[Dict, List]: v2.update({'level': v1}) return (v2, v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: [str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> [str]: v1 = self.GetCurrentIndex() if v1 == -1: return [] return [self.model().index(v1, col_index).data() for v2 in range(self.columnCount())...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> bool: if self.id != v1.id: return False if self.type != v1.type: return False v2 = sorted([str(prop) for v3 in self.properties])...
Imports: ```python import gc import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._lock.lock() try: del self._current_runnable self._current_runnable = None gc.collect() finally: s...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> bool: v1.writeto(self.dev_address, bytes([6, 255])) v1.writeto(self.dev_address, bytes([7, 255])) return True ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self._network.add_person('Bill') v2 = v1.make_post('Greetings.') self.assertEqual(1, v1.post_count) self.assertEqual(1, self._network.po...
Imports: ```python from contextlib import suppress import typing ``` Type definitions: Input Types: List[str] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str], *v2: str) -> int: for v3 in v2: with suppress(ValueError): return v1.index(v3) return -1 ...
Imports: ```python import torch import torch.nn as nn from torch import Tensor from torch.nn.modules import Conv2d, Linear from torch.optim.lr_scheduler import ReduceLROnPlateau import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None...
Imports: ```python import typing ``` Type definitions: Input Types: bytes, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes, v2=True): self._ser.write(v1) if v2: self.monitor.write(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: str=None): self.optimizing_target_func = v1 if v2 is None: v2 = '适应值' self.set_optimizing_target(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: typing.Dict[str, typing.Any] Dependencies: Function Name: v0 Function: ```python def v0(self) -> typing.Dict[str, typing.Any]: v1: typing.Dict[str, typing.Any] = dict() for v2 in self.items: v3 = v1.get(v2.product.name, ...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str]): if len(v1) == 0: raise ValueError(f'Video names list is empty, no video to analyze') if not all((isinstance(n, str) for v2 in v1)): ...
Imports: ```python import typing ``` Type definitions: Input Types: int, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: str=' ') -> str: v3 = self.m_rows[v1] v4 = f'{v2}{v3:<{self.m_maxlen}}' return v4 ```
Imports: ```python import typing ``` Type definitions: Input Types: Union[np.ndarray, Any], Union[np.ndarray, Any] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[np.ndarray, Any], v2: Union[np.ndarray, Any]) -> None: self.train_data = v1 self.d_train_data = v2 ...
Imports: ```python import smtplib import typing ``` Type definitions: Input Types: MIMEMultipart Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: MIMEMultipart) -> None: v2 = smtplib.SMTP_SSL('smtp.gmail.com', 465) v2.ehlo() v2.login(self.email, self.password) v2....
Imports: ```python import cv2 import numpy as np import matplotlib import matplotlib.pyplot as plt import torch import torch.nn as nn import os import torch.nn.functional as F from torch import optim from torch.utils.data import Dataset, DataLoader from torch.utils.tensorboard import SummaryWriter import typing ``` Typ...
Imports: ```python import typing ``` Type definitions: ```python class v0(Operation): v1: str = '/platform/admin/namespaces/{namespace}/currencies/{currencyCode}' v2: str = 'DELETE' v3: List[str] = [] v4: List[str] = ['application/json'] v5: List[List[str]] = [['BEARER_AUTH'], ['BEARER_AUTH']] v...
Imports: ```python import typing ``` Type definitions: Input Types: (float, float, float) Output Type: (float, float) Dependencies: Function Name: v0 Function: ```python def v0(self, v1: (float, float, float)) -> (float, float): v2 = self.camera_relative_coordinates(v1) return self.camera.perspective_pixel(v2...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[Dict[str, str]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[Dict[str, str]]: v1: List[Dict[str, str]] = [] for v2 in self.__file_list: v3 = {'label': v2, 'value': self.__load_location + ...
Imports: ```python import typing ``` Type definitions: ```python class v0(ProperType): v1 = ('type', 'args', 'erased', 'invalid', 'type_ref', 'last_known_value') def __init__(self, v2: mypy.nodes.TypeInfo, v3: Sequence[Type], v4: int=-1, v5: int=-1, v6: bool=False, v7: Optional['LiteralType']=None) -> None: ...
Imports: ```python import typing ``` Type definitions: Input Types: [str] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: [str]): v2 = [] if self.parent != None: v2.extend(self.parent.get_parents_properties(v1)) v2.extend(self.get_properties(v1)) else:...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.name == '<lambda>': self.consts[self.get_const_key(None)] = 0 elif not self.name.startswith('<') and (not self.klass): if sel...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1 = ('dst', 'jumpkind') v2: Optional[int] v3: str def __init__(self, v4: Optional[int], v5: str): self.dst = v4 self.jumpkind = v5 ``` Input Types: Iterable, Optional[int], Any, Optional[str], Optional[bool], Op...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Sequence[int] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Sequence[int]: v1 = self.lp_model._lp_model['var_type_index_type_beg'] v2 = self.lp_model._lp_model['var_type_index_type_cnt'] v3 = self.lp_mo...
Imports: ```python from collections import Counter import typing ``` Type definitions: Input Types: list[int], int Output Type: int Dependencies: ```python def v0(v1: list[int], v2: int) -> dict[int, int]: v3: dict[int, int] = {} for v4 in range(v2, -9, -1): v5 = puzzle_1.get_days_when_fish_spawned(sta...
Imports: ```python import numpy as np from scipy.linalg import block_diag import scipy.optimize as sciopt import typing ``` Type definitions: Input Types: np.ndarray, Dict Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray=None, v2: Dict=None) -> pd.DataFrame: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = '\n def f(\n x, # not-a-type-comment\n # also-not-a-type-comment\n y = 42, # type: int\n *args,...
Imports: ```python import re import typing ``` Type definitions: Input Types: str, Dict[str, str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: Dict[str, str]) -> str: for (v3, v4) in v2.items(): v1 = re.sub(f'"{v3}"', f'"{v4}"', v1, flags=re.MULTILINE) retur...