text
stringlengths
190
325k
Imports: ```python import numpy as np from numpy.random import Generator, RandomState import typing ``` Type definitions: Input Types: int, float, float, Union[list, np.ndarray] Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: float=1.4, v3: float=0.3, v4: Union[list, np...
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 v1 in self.freq: self.freq[v1] = 1 else: self.freq[v1] += 1 v2 = self.freq[v1] if v2 > self.maxi: ...
Imports: ```python import glob import os import typing ``` Type definitions: Input Types: Output Type: list Dependencies: ```python def v0(v1: str) -> int: v2 = os.path.join(v1, 'device', 'sriov_numvfs') with open(v2, 'r') as v3: v4 = v3.read() return int(v4.strip()) ``` ```python def v5(v6: str) ...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, **v2: Any) -> bool: self._check_kwargs(v2) return os.path.exists(self._get_path_with_cwd(v1)) ```
Imports: ```python import re import typing ``` Type definitions: Input Types: Output Type: List[Tuple[str, str]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[Tuple[str, str]]: self.args = [] v1 = 1 v2 = '\\%\\d*\\$*[dsf@]' v3 = set() for v4 in re.finditer(v2, self.valu...
Imports: ```python import typing ``` Type definitions: Input Types: str, Dict Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Dict) -> Dict: v3 = {'label': v2.get('title'), 'key': str(self._session_state.run_id) + '-' + v1} if v2.get('description'): v3['...
Imports: ```python import typing ``` Type definitions: Input Types: geometry.Point, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: geometry.Point, v2=True): (v3, v4) = self.get_world_borders() v5 = int(round(v1.x - v3.x)) v6 = int(round(v1.y - v3.y)) if v2: ...
Imports: ```python from urllib.request import Request, urlopen from json import dumps, loads from os.path import isfile import sys import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: ```python def v0(v1: str=None, v2: str=None) -> [Dict]: v3 = get_suburbs() if v2: v...
Imports: ```python import typing ``` Type definitions: Input Types: str, List[Any] Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str, v2: List[Any]=[]) -> Any: assert not self.closed and self._client is not None return await self._client.invoke_method(method=v1, p...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, str, str, int, int, str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int, v3: str='Progress', v4: str='Complete', v5: int=1, v6: int=50, v7: str='█', v8: str='\r') -> None: v9 = 100 * (v...
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 = v1.replace('RRID:', '').strip() return str(self.base_url.with_path('/resources/Any/search').with_query(q='undefined', l=v2)) ```
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self) -> pd.DataFrame: v1 = ['Symbol', 'Type', 'Entry Price', 'Amount', 'Leverage', 'Unrealized PnL'] v2 = [] for v3 in self.deriv_p...
Imports: ```python import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches import pandas as pd import typing ``` Type definitions: Input Types: int, int, int, int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int=150, v3: int=3500, v4: i...
Imports: ```python import pandas import typing ``` Type definitions: Input Types: {}, str, str, str, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: {}, v2: str, v3: str, v4: str='mtd', v5=None, v6=None): v7 = pandas.read_csv(v2) v8 = [] for v9 in range(self....
Imports: ```python from copy import deepcopy import typing ``` Type definitions: Input Types: Dict[str, List] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, List]): v1 = deepcopy(v1) for (v2, v3) in v1.items(): if v2 in self.prior_mask: v3.s...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python @dataclass class v0: v1: McDecoder 'McDecoder used for decoding' v2: np.ndarray 'N-vector of 16-bit codes(1 word of 16-bit)' v3: np.ndarray 'N-vector of 16-bit codes(2 words of 16-bit)' v4: np.ndarray 'N-...
Imports: ```python import numpy as np import numpy.ma as ma from pandas._config import get_option from pandas._libs import algos as libalgos, lib, properties from pandas._libs.lib import no_default from pandas._typing import AggFuncType, ArrayLike, Axes, Axis, CompressionOptions, Dtype, FilePathOrBuffer, FrameOrSeriesU...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if isinstance(v1, str): return max([len(each.split('<')) for v2 in v1.split('|')]) else: return 0 ```
Imports: ```python from datetime import datetime, timedelta import typing ``` Type definitions: Input Types: datetime, datetime Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: datetime, v2: datetime) -> None: v3 = v2 - v1 v4 = 1 if v1 > v2: v3 = v1 - v2 ...
Imports: ```python import cv2 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: v2 = cv2.resize(v1, (self._input_width, self._input_height)) v2 = np.expand_dims(...
Imports: ```python import json import typing ``` Type definitions: Input Types: str, dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: dict): v3 = open(v1, 'w') v3.write(str(json.dumps(v2))) v3.close() ```
Imports: ```python import typing ``` Type definitions: Input Types: Literal['switch', 'stop', 'run'] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Literal['switch', 'stop', 'run']='switch') -> None: if not self.end: if v1 == 'switch': self.running = not...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.array Output Type: np.array Dependencies: Function Name: v0 Function: ```python def v0(v1: np.array) -> np.array: if v1.ndim != 2: raise ValueError(f'Array of shape {v1.shape} must conform to shape: (number_windows, ...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, torch.Tensor, int Output Type: float Dependencies: ```python def v0(v1: torch.Tensor, v2: torch.Tensor, v3: int=1) -> float: v4 = torch.argsort(v1) v5 = torch.argsort(v4) v2 = v2.type(TORCH_BOOL) ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1) -> Any: if hasattr(v1, '__origin__'): return v1.__origin__ return None ```
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float): self.logger.info('Requesting all agents to stop') self._stopping.set() if self._event_timer is not None: self._event_timer.cancel(...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: List Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> List: self.visit_history.append('UNBOUND PREDICATE') return self.visit_history ```
Imports: ```python import typing ``` Type definitions: Input Types: int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2=False): v3 = 1024 if v2 else 1000 v4 = 'B' if v2 else '' for v5 in ['', ' K', ' M', ' G', ' T', ' P']: if v1 < v3: return...
Imports: ```python import typing ``` Type definitions: Input Types: list, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2): if len(v1) == 0: return v1 for v3 in range(0, v2): v4 = v1.pop() v1.insert(0, v4) return v1 ```
Imports: ```python import hashlib import typing ``` Type definitions: Input Types: bytes Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: bytes=None) -> str: v1 = v1 or bytes() try: v1 = v1.encode('utf-8') except (AttributeError, UnicodeDecodeError): pass ...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python class v0(NamedTuple): v1: int v2: int = 0 ``` ```python class v3(IntEnum): v4: int = 0 v5: int = 1 v6: int = 2 v7: int = 9 ``` Input Types: v0, v3, bool Output Type: None Dependencies: Function Name: v8 Function...
Imports: ```python import math import tensorflow as tf import typing ``` Type definitions: Input Types: tf.Tensor, tfp.distributions.Distribution Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: tf.Tensor, v2: tfp.distributions.Distribution) -> None: assert v2.event_shape == () ...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor Output Type: (torch.Tensor, torch.Tensor) Dependencies: ```python def v0(v1: torch.Tensor) -> torch.Tensor: return torch.diagonal(v1, dim1=-2, dim2=-1).log().sum(-1) ``` Function Name: v2 Function: ```python def v2(v3: to...
Imports: ```python import os import zipfile import typing ``` Type definitions: Input Types: str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str) -> None: assert os.path.isdir(v1) v3 = zipfile.ZipFile(v2, 'w', compression=zipfile.ZIP_DEFLATED) for (v4, v5...
Imports: ```python import typing ``` Type definitions: Input Types: Tree Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Tree): v2 = [] v3 = [v1] while len(v3) > 0: v4 = v3.pop(0) v2.append(v4) v4.nodeid = len(v2) - 1 v3 = v4[:] + v3 retu...
Imports: ```python from collections import deque import typing ``` Type definitions: ```python class v0: def __init__(self, v1: list[list[Octopus]]) -> None: self.data = v1 @classmethod def v2(cls, v3: str) -> v0: return v0([[Octopus(i, j, int(energy)) for (v4, v5) in enumerate(line)] for ...
Imports: ```python import typing ``` Type definitions: Input Types: Tensor Output Type: Dict[str, Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor) -> Dict[str, Tensor]: v1 = self.body(v1) v2: Dict[str, Tensor] = self.fpn(v1) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: onnx.NodeProto Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> onnx.NodeProto: if v1 not in self.producer_map: return None return self.producer_map[v1] ```
Imports: ```python from urllib.parse import urlparse, ParseResult import requests import typing ``` Type definitions: Input Types: str Output Type: Optional[str] Dependencies: ```python def v0(v1: ParseResult) -> Optional[str]: (v2, v3, *v4) = v1.path.lstrip('/').split('/') if v3.endswith('.git'): v3 =...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> None: global balance v2 += v1 v2 -= v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: JavaParserLabeled.Expression21Context Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: JavaParserLabeled.Expression21Context): if self.in_class: if v1.expression(0).getText() == self.field_identifier: ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: pywikibot.FilePage Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> pywikibot.FilePage: v2 = None v3 = 0 for (v4, v5) in enumerate(v1): v6 = v5[1] v7 = len(list(v6.usingPages())) ...
Imports: ```python import typing ``` Type definitions: ```python @require_kwargs_on_init @dataclass(frozen=True) class v0(Transaction): v1: Amount = REQUIRED v2: str = REQUIRED v3: Optional[int] = None v4: Optional[int] = None v5: Optional[int] = None v6: Optional[str] = None v7: Transaction...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, v3) -> None: with open('highscores_long.txt', 'a') as v4: v4.write(f'{v1}: {v2} ---- Draws: {v3}\n') self.sort_highscores('highsc...
Imports: ```python import zipfile import typing ``` Type definitions: Input Types: Path Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: Path) -> None: assert v1.is_file() v2 = v1.with_name('unzipped-' + v1.stem) print(f'Extracting {v1} to {v2}') with zipfile.ZipFile(v1...
Imports: ```python import math import typing ``` Type definitions: Input Types: float, float Output Type: Any Dependencies: ```python def v0(v1): return math.log((1 - v1) / (1 + v1)) ``` ```python def v2(v3): return v0(v3) - e * v0(e * v3) ``` ```python def v4(v5): return pol1 * math.exp((v2(math.sin(v5 / ...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, float], str, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, float], v2: str, v3: int): for (v4, v5) in v1.items(): self.run[f'{v2}/{v4}'].log(value=float(v5), step=v3) ```
Imports: ```python from datetime import datetime, timedelta import typing ``` Type definitions: Input Types: datetime Output Type: datetime Dependencies: Function Name: v0 Function: ```python def v0(self, v1: datetime) -> datetime: if self.partition_scheme == 'DAY': return v1 + timedelta(days=1) elif ...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2): if v1 == 'search': self._searchBtn.clicked.connect(v2) self._searchEdit.returnPressed.connect(v2) elif v1 == 'prePage': ...
Imports: ```python import os import typing ``` Type definitions: Input Types: str, str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> bool: if os.path.isdir(v1): return self._copy_dir(v1, v2) else: return self._copy_files(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 == '\n': self.line_offset += 1 self.col_offset = 0 else: self.col_offset += 1 ```
Imports: ```python import inspect import sys import typing from typing import Any, AnyStr, NewType, Tuple, TypeVar, get_type_hints import typing ``` Type definitions: Input Types: Any, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: str) -> str: if v1 is None: retur...
Imports: ```python import pandas as pd import statistics import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame) -> pd.DataFrame: v2 = pd.DataFrame(columns=v1.columns) for (v3, v4) in v1.iterrows(): ...
Imports: ```python import typing ``` Type definitions: Input Types: List[Tuple[int, Text]], Text Output Type: Tuple[List[int], List[Text]] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Tuple[int, Text]], v2: Text) -> Tuple[List[int], List[Text]]: v1 = [(id, string.replace(v2, '')) for (v3, v...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Sequence[Dict] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Sequence[Dict]: if v1.startswith('http'): v2 = v1 else: v2 = 'https://api.github.com/repos/%s/%s' % (self.config.repo...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.elastic_port = 9201 self.kibana_port = 5602 self.wait_time_secs = 120 ```
Imports: ```python import typing ``` Type definitions: Input Types: set, Any, bool Output Type: Any Dependencies: ```python def v0(v1): return set(v1) if isinstance(v1, (set, list, tuple)) else set() if v1 is None else {v1} ``` Function Name: v2 Function: ```python def v2(v3: set, v4, v5: bool=True): if not v5...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2=True) -> bool: v3 = ['snap', 'install', v1] if v2: v3.append('--classic') return self.run_shell(v3) ```
Imports: ```python import getpass import datetime import typing ``` Type definitions: Input Types: plt.Figure, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: plt.Figure, v2=None): if v2 is False: return v1 elif not isinstance(v2, str): v2 = f"Create by SpDM...
Imports: ```python import colorsys from matplotlib.colors import ListedColormap import typing ``` Type definitions: Input Types: float Output Type: None Dependencies: ```python def v0(v1: float) -> ListedColormap: return ListedColormap([colorsys.hsv_to_rgb(v1, saturation / 255, 1) for v2 in range(255)]) ``` Functi...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.normalization import LayerNorm 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.Te...
Imports: ```python import torch from torch.ao.quantization.fx.pattern_utils import get_default_quant_patterns, sorted_patterns_dict from torch.ao.quantization.backend_config import get_native_backend_config_dict from torch.ao.quantization.backend_config.observation_type import ObservationType from torch.ao.quantization...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): if self.loggingEnabled: self.logger.debug(f'starting _dataDescriptor') v2 = {} v2['dimension'] = v1['dimension'] v2['filters'] =...
Imports: ```python import asyncio import typing ``` Type definitions: Input Types: 'Iterable[Model]' Output Type: 'Iterable[Model]' Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: 'Iterable[Model]') -> 'Iterable[Model]': if v1 and (self.prefetch_map or self._prefetch_queries): s...
Imports: ```python import plotly.graph_objects as go from plotly.missing_ipywidgets import FigureWidget import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any, Any, Any, Any, Any Output Type: FigureWidget Dependencies: ```python def v0(v1, v2, v3, v4, v5): if v1 in at_columns.PRICE_AFFINITY: ...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, str] Output Type: Any Dependencies: ```python def v0(v1): v2 = response_by_url_map.get(v1) if not v2: raise RuntimeError('url not configured: {}'.format(v1)) return v2 ``` Function Name: v3 Function: ```python def v3(v4: ...
Imports: ```python import torch as T import typing ``` Type definitions: Input Types: T.Tensor, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: T.Tensor, v2=False): assert len(v1.shape) == 3, 'Input tensor must have 3 dimensions with the last two being matrices, got {}'.format(...
Imports: ```python import asyncio import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self) -> None: if self.ws_connections: v1 = self.ws_connections.copy() self.ws_connections.clear() await asyncio.gather(*[c...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.media.play_mode = self.soco.play_mode self.update_volume() self.set_favorites() ```
Imports: ```python from qiskit import QuantumCircuit, QuantumRegister import numpy as np from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, assemble from qiskit.compiler import transpile from qiskit.circuit import Gate from qiskit.circuit.library.standard_gates import * from qiskit.circuit.library i...
Imports: ```python import typing ``` Type definitions: Input Types: UUID, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: UUID, v2: str): self._final_job_status_set = True self._try_job_query('set_job_completion', v1, v2) ```
Imports: ```python import numpy as np import numpy as pd 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 = np.sum(np.square(v1 - v2)) return v3 ```
Imports: ```python import datetime import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = v1.split(',')[1].split('-')[0].strip() v2 = v2.split('+')[0].strip() v3 = datetime.datetime.strptime(v2, '%d %b %Y %H:%M:%S') ...
Imports: ```python import typing ``` Type definitions: Input Types: List[List[str]] Output Type: List[List[str]] Dependencies: ```python def v0(v1: List[List[str]]) -> List[int]: return [max(map(len, col)) for v2 in zip(*v1)] ``` ```python def v3(v4: List[List[str]]) -> List[List[str]]: return [list(i) for v5 ...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float): if self.long_stoploss.need_close(v1): self.trader._sell(v1, '做多止损') if self.short_stoploss.need_close(v1): self.trader._cover(...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: self.save_class() for v1 in range(self.PATH.count('/') - 1): self.queue.insert(0, 'quit') ```
Imports: ```python import re import subprocess import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = subprocess.run(['git', 'log', '-1', '--format=format:%s', v1], check=True, stdout=subprocess.PIPE).stdout.decode().s...
Imports: ```python import typing ``` Type definitions: Input Types: str, Optional[Dict], Mapping, Mapping Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Optional[Dict]=None, v3: Mapping={}, v4: Mapping={}) -> Any: if v2 is None: v5 = self._prepare_request('G...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2=None): v3 = self.get_job_by_name(v1) if v3: v3.start(v2) return 1 else: return 0 ```
Imports: ```python import torch from torch import nn as nn from torch.nn import functional as F import typing ``` Type definitions: Input Types: List[int], int, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: List[int], v2: int, v3: str=None): v4 = torch.arange(v2).to(v3) v...
Imports: ```python import os import cv2 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 = cv2.VideoCapture(v1) self.args.fps = v3.get(cv2.CAP_PROP_FPS) print(f'Video: {v1} ({self.args.fps} fps...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self) -> None: if self._last_response_id is None: if self._has_responded or self._has_been_deferred: await self._interaction.delete_initial_re...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, str]) -> str: v2 = v1['first_name'] if v1['last_name'] is not None: v2 += f" {v1['last_name']}" return v2 ```
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: types.TensorType Output Type: Tuple[types.TensorType, types.TensorType] Dependencies: Function Name: v0 Function: ```python def v0(v1: types.TensorType) -> Tuple[types.TensorType, types.TensorType]: with tf.compat.v1.varia...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, int Output Type: Union[None, np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(v1: Any, v2: int) -> Union[None, np.ndarray]: if not isinstance(v1, (np.ndarray, list)): return None if not le...
Imports: ```python import typing ``` Type definitions: Input Types: Dataset Output Type: Set[Any] Dependencies: Function Name: v0 Function: ```python def v0(v1: Dataset) -> Set[Any]: v2 = set() for v3 in range(len(v1)): v2.add(v1[v3][1]) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: int, int, MutableSequence[int] Output Type: Sequence[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: MutableSequence[int]) -> Sequence[int]: for v4 in [p for v5 in self._providers.values() if v5.do_filt...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame, list, dict Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: list, v3: dict) -> pd.DataFrame: v4 = v1.copy() for v5 in v2: v4[v5 + '_clean'] = v4[v5].map(v3) r...
Imports: ```python import typing ``` Type definitions: Input Types: np.array Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.array): v2 = None self.jobs_paused[v2.in_flight_future] = v2 self._ensure_stop(v2.trial) raise NotImplementedError ```
Imports: ```python from torch.testing import make_tensor import random import torch import typing ``` Type definitions: Input Types: Any, Any Output Type: float Dependencies: ```python def v0(v1: str) -> Tuple[Any, List[Any]]: v2 = torch._C.parse_ir(v1) v2.makeMultiOutputIntoTuple() v3 = [] for v4 in v...
Imports: ```python from itertools import count import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: v1 = [q.qubit_id for v2 in self._active_qubits] for v3 in count(0): if v3 not in v1: return v3 rais...
Imports: ```python import os import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=None, v2: str=None) -> str: if v1 is not None and v2 is not None: raise ValueError('Only one of key or filename may be specified'...
Imports: ```python import typing ``` Type definitions: Input Types: int, List[List[int]] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: List[List[int]]) -> bool: v3 = set(range(v1)) v4 = set([]) v5 = {} for v6 in v2: (v7, v6) = v6 v4.add...
Imports: ```python import datetime import typing ``` Type definitions: Input Types: etree.ElementTree, Any Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: etree.ElementTree, v2='') -> dict: v3 = {} for v4 in v1: v5 = v4.tag.split('}')[-1] for v6 in v4: ...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: List[v0], int, int Output Type: List[v0] Dependencies: Function Name: v1 Function: ```python def v1(v2: List[v0], v3: int, v4: int) -> List[v0]: v5: List[v0] = [] v6: int for v6 in range(v3, v4): if ...
Imports: ```python import matplotlib.pyplot as plt import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: plt.Axes Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3) -> plt.Axes: (v4, v5) = plt.subplots(figsize=(8, 5)) v5.scatter(v1.time_id, v1.logit_ratio, color='gray...
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 = sorted(v1) if v2 == v1: return [-1, -1] v3 = 0 v4 = len(v1) - 1 while v2[v3] == v1[v3] and...
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor, int, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: int, v3: bool=False): v4 = v1.max(dim=v2, keepdim=True)[0].detach() v5 = v4 + (v1 - v4).exp().sum(dim=v2, keepdim=True)....
Imports: ```python import typing ``` Type definitions: Input Types: str, Iterable[int] Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str, v2: Iterable[int]): v3 = f'calendar:{v1}' v4 = self.security.pipeline() v4.delete(v3) v4.rpush(v3, *v2) await v4.e...
Imports: ```python from random import gauss, uniform import typing ``` Type definitions: Input Types: float Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: float) -> float: v2 = 1.0 return gauss(v1, v1 * v2 / 100.0) ```