text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: ```python v0 = tuple[int, int] ``` Input Types: v0 Output Type: Any Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0): (v3, v4) = v2 if v3 == self.max_r: return (0, v4) return (v3 + 1, v4) ```
Imports: ```python import typing ``` Type definitions: Input Types: int, int, Any Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3=1) -> List[int]: v4 = [0] * v2 while v1: for v5 in range(v2): v6 = min(v3, v1) v4[v5] +...
Imports: ```python import typing ``` Type definitions: Input Types: 'pd.DataFrame', str Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'pd.DataFrame', v2: str) -> list: self.X_columns = [col for v3 in v1.columns if v3 != v2] v4 = [] v5 = list(v1.columns).index(v2) ...
Imports: ```python import typing ``` Type definitions: Input Types: Vector4 Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Vector4): self.write_float(v1.X) self.write_float(v1.Y) self.write_float(v1.Z) self.write_float(v1.W) ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Dict[str, Any]: v2 = [{'$eq': [chan, '$$d.channel']} for v3 in self.channel] v2.insert(0, {'$not': ['$$d.channel']}) return {'$fi...
Imports: ```python import glob import logging import os import re import typing ``` Type definitions: Input Types: Path, int, int Output Type: Any Dependencies: ```python def v0(v1: Path) -> List[str]: v2 = list(glob.glob(f'{v1}/checkpoint-[0-9]*.pt')) v3 = re.compile('checkpoint-([0-9]+).pt') v4 = [(int(v...
Imports: ```python import json import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0() -> str: if (KeyError, json.JSONDecodeError, AssertionError, ValueError): return (json.dumps({'error': 'Check input'}), 400) else: retur...
Imports: ```python import numpy as np from pandas._typing import Axis, FrameOrSeries, FrameOrSeriesUnion, IndexLabel, Scalar from pandas.compat._optional import import_optional_dependency from pandas.util._decorators import doc import pandas as pd from pandas.api.types import is_list_like from pandas.core import generi...
Imports: ```python import torch import torch.nn as nn import typing ``` Type definitions: Input Types: torch.nn.Module, torch.Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.nn.Module, v2: torch.Tensor): v1.eval() if isinstance(v2, torch.Tensor): v2 = [v2] ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: list[str | None] Dependencies: ```python def v0(v1: str) -> None: result.append(v1.strip().lstrip('*')) ``` Function Name: v2 Function: ```python def v2(v3: str) -> list[str | None]: def v4(v5: str) -> None: result.ap...
Imports: ```python import tensorflow as tf import tensorflow.keras.backend as K from tensorflow.keras import Input import typing ``` Type definitions: Input Types: bool Output Type: tf.keras.Model Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False) -> tf.keras.Model: v2 = [] v3 = ...
Imports: ```python import requests import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str): v3 = requests.get('https://coreos.com/dist/aws/aws-{}.json'.format(v1), timeout=5) v3.raise_for_status() v4 = v3.json(...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: 'Field' Dependencies: Function Name: v0 Function: ```python def v0(self) -> 'Field': self.value = None self.subfields = [] return self ```
Imports: ```python import typing ``` Type definitions: Input Types: dict, int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict, v2: int=DEFAULT_TIMEOUT) -> None: v3 = self._add_many_sql.format(', '.join([f'(:key{n}, :value{n}, :exp{n})' for v4 in range(len(v1))])) v5...
Imports: ```python import torch from torch import Tensor import typing ``` Type definitions: ```python class v0(SlateSlotObjects[SlateItem]): def v1(self, v2: SlateItems, v3=None) -> Tensor: v4 = torch.zeros((len(self), len(v2)), dtype=torch.double, device=v3) for (v5, v6) in zip(v4, self._values):...
Imports: ```python import typing ``` Type definitions: Input Types: list, str, Any, Any Output Type: Any Dependencies: ```python def v0(v1: list, v2: APIinfoCenter): if len(v1) <= 1: return None v3 = [(api, v2.get_api_community_score(api)) for v4 in v1] v5 = sorted(v3, reverse=True, key=lambda s: s...
Imports: ```python import typing ``` Type definitions: ```python class v0(Enum): v1 = 'DIRECT' v2 = 'FAN_IN' v3 = 'DYNAMIC_COLLECT' ``` ```python class v4(namedtuple('_SolidInputHandle', 'solid input_def')): def v5(cls, v6: Solid, v7: InputDefinition): return super(v4, cls).__new__(cls, check.i...
Imports: ```python import os import numpy as np import pandas as pd import typing ``` Type definitions: Input Types: str, dict, list Output Type: Any Dependencies: ```python def v0(v1: str): v2 = v1[10:18] v3 = v1[-12:-4] v4 = v1[19:27] v5 = v1[28:31] return (v2, v3, v4, v5) ``` ```python def v6(v7...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, int, int, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3: int=0, v4: int=None, v5: int=0) -> int: v4 = v4 if v4 is not None else len(v1) if not v5: return v1.find(v2, v3,...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> dict: v2 = {'zero': 'ноль', 'one': 'один', 'two': 'два', 'three': 'три', 'four': 'четыре', 'five': 'пять', 'six': 'шесть', 'seven': 'семь', 'eight': 'вос...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3) -> dict: v4 = len(v1) for (v5, v6) in enumerate(v2): (v7, v8) = v6 v9 = v5 + v4 v1[v9] = {'hash': v8, 'fpath': v7, ...
Imports: ```python import asyncio import logging import typing ``` Type definitions: Input Types: Dict[str, Any] Output Type: None Dependencies: ```python async def v0(v1: asyncio.Queue) -> NoReturn: while True: v2 = await v1.get() logging.info(f"Starting the '{v2.name}' job") v3 = getattr(...
Imports: ```python import typing ``` Type definitions: Input Types: 'Node' Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'Node') -> List[int]: v2: List[int] = [] self.preorderImpl(v1, v2) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: ```python def v0(self, v1) -> dict: v2 = {} for v3 in v1: v2[v3] = v2.get(v3, 0) + 1 return v2 ``` Function Name: v4 Function: ```python def v4(self, v5) -> None: v6 = v0(v5) for v7 in so...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: v2 = self.train_lst_path if v1 == 'train' else self.valid_lst_path with v2.open('r') as v3: self.images = [] for v4 in v3...
Imports: ```python import typing ``` Type definitions: ```python v0 = typ.Dict[Key, Entry] ``` ```python class v1(typ.NamedTuple): v2: str v3: str v4: str v5: str v6: str v7: str v8: str v9: MaybeSourceText ``` ```python class v10(typ.NamedTuple): v11: str v12: str v13: str ...
Imports: ```python import os import typing ``` Type definitions: Input Types: pathlib.Path, pathlib.Path Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: pathlib.Path, v2: pathlib.Path) -> None: for v3 in os.listdir(v1): os.rename(v1 / v3, v2 / v3) ```
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: list, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2: str) -> None: v3 = pd.concat(v1) v3.to_csv(v2, index=False, sep='\t') ```
Imports: ```python import re import typing ``` Type definitions: Input Types: paramiko.SSHClient Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: paramiko.SSHClient): v2: dict = {} (v3, v4, v5) = v1.exec_command('top -H -b -d 1 -n 10') (v6, v7) = (v4.read(), v5.read()) v...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Tuple[str, ...] Dependencies: ```python def v0(): v1 = {' ': 'space'} if len(self._accept_keys) == 1: v2 = '<' + self._accept_keys[0] + '>' else: v2 = '(' + ', '.join(('<' + accept_key + '>' for v3 in self._ac...
Imports: ```python from concurrent.futures import FIRST_COMPLETED, Future, ThreadPoolExecutor, wait import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: (v1, v2) = wait(self._futures[:], return_when=FIRST_COMPLETED) for v...
Imports: ```python from math import sqrt import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: ```python def v0(v1: int) -> bool: if 1 < v1 < 4: return True elif v1 < 2 or not v1 % 2: return False v2: Iterable = range(3, int(sqrt(v1) + 1), 2) return not any...
Imports: ```python import typing ``` Type definitions: Input Types: int, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: str) -> None: self.new_paragraph() self.new_line('#' * v1 + ' ' + v2) self.new_paragraph() ```
Imports: ```python import torch import typing ``` Type definitions: Input Types: Any Output Type: np.array Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> np.array: if not v1.strip(): raise ValueError('No input text') v2 = self.tokenizer(v1, padding=True, truncation=True, add_s...
Imports: ```python import typing ``` Type definitions: Input Types: Any, jnp.ndarray, int Output Type: jnp.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: jnp.ndarray, v3: int=0) -> jnp.ndarray: try: return v1.apply_transport_from_potentials(self.f, self.g, v2, axis=v3) ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1 = dict(allowedflowdir='positive', crestwidth='3.45', uselimitflowpos='true', limitflowpos='6.78', uselimitflowneg='true', limitflowneg='7.89') v1....
Imports: ```python import typing ``` Type definitions: ```python class v0(Schedule): def __init__(self, v1: str, v2: Optional[datetime], v3: str, v4: str, v5: str='', v6: datetime=None): self.title = v1 self.date = v2 self.type = v3 self.description = v4 self.url = v5 ...
Imports: ```python import os import subprocess import tempfile from urllib.request import urlopen import typing ``` Type definitions: Input Types: List[str] Output Type: int Dependencies: ```python def v0(v1: str) -> Optional[bytes]: try: v2 = urlopen(v1) if v2.getcode() != 200: return ...
Imports: ```python import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import typing ``` Type definitions: Input Types: LRScheduler, int, Optional[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: LRScheduler, v2: int, v3: Optional[str]=None) -> None: v4: ...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: int) -> None: self.val = v1 self.next: Optional[v0] = None ``` Input Types: v0 Output Type: None Dependencies: Function Name: v2 Function: ```python def v2(self, v3: v0) -> None: assert v3.next is...
Imports: ```python import typing ``` Type definitions: Input Types: Sequence[Union[str, Sequence[str]]] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Sequence[Union[str, Sequence[str]]]) -> None: for v2 in reversed(v1): if isinstance(v2, str): self.writ...
Imports: ```python import typing ``` Type definitions: Input Types: list, Any Output Type: Any Dependencies: ```python def v0(v1: str): return v1 == '*' or v1 == '/' ``` ```python def v2(v3: str): return not str.isnumeric(v3) ``` ```python def v4(v5: str): v6 = v5.split() v7 = v6[0] v8 = v6[1] ...
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor) -> torch.Tensor: assert self._imitator is not None assert self._policy is not None assert self._perturbation is not ...
Imports: ```python import numpy from nltk import FreqDist import typing ``` Type definitions: Input Types: int Output Type: Iterable[numpy.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> Iterable[numpy.ndarray]: self._prepare() v2 = numpy.array([w for (v3, v4) in self._av...
Imports: ```python import typing ``` Type definitions: Input Types: List[str], str, Any Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str], v2: str, v3=False) -> List[str]: while True: v4 = next((i for (v5, v6) in enumerate(v1) if v6.startswith(v2)), None) ...
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 == 'InstanceID': self._current_instance = None ```
Imports: ```python import resource import typing ``` Type definitions: Input Types: Any, Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> str: (v3, v4) = resource.getrlimit(resource.RLIMIT_NOFILE) if v3 > v1: return 'FD soft limit: {} is above desired limt: {}...
Imports: ```python import datetime import os import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap import sklearn.ensemble as sk_ensemble from sklearn.datasets import make_moons from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score impo...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._score = 0 self._grid = np.zeros_like(self._grid, dtype='bool') self._colour_grid = np.zeros_like(self._colour_grid, dtyp...
Imports: ```python import typing ``` Type definitions: Input Types: List[str], str Output Type: Dict Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: List[str], v2: str) -> Dict: v3 = {'uids': v1} return await self.request('POST', f'chat/thread/{v2}/member/invite', v3) ```
Imports: ```python import torch from torch import Tensor from torch.nn import functional as F import typing ``` Type definitions: Input Types: Tensor Output Type: Tuple[Tensor, ...] Dependencies: Function Name: v0 Function: ```python def v0(v1: Tensor) -> Tuple[Tensor, ...]: assert v1.shape[-1] in [4, 5, 8, 12] ...
Imports: ```python from datetime import datetime import typing ``` Type definitions: Input Types: Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self) -> list: try: v1 = str(self.dataset.year) v2 = str(self.dataset.month).zfill(2) v3 = str(self.dataset.day).z...
Imports: ```python from pandas._config import get_option from pandas._libs import algos as libalgos, lib from pandas.compat import PY36, raise_with_traceback from pandas.compat.numpy import function as nv from pandas.util._decorators import Appender, Substitution, deprecate_kwarg, rewrite_axis_style_signature from pand...
Imports: ```python import typing ``` Type definitions: Input Types: Dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict): if v1['parent_sampled'] is not None: return v1['parent_sampled'] if v1.get('wsgi_environ', {}).get('PATH_INFO') == '/martor/markdownify/': ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, **v1) -> int: v2 = self._rest.GET(url='/api/v1/Dimensions/$count', **v1) return int(v2.text) ```
Imports: ```python import typing ``` Type definitions: Input Types: Mapping[bytes, bytes] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Mapping[bytes, bytes]) -> None: v2 = list(sorted(v1.items())) v3 = [i[0] for v4 in v2] v5 = [v4[1] for v4 in v2] self.add_kno...
Imports: ```python import platform import signal import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0(v1: int, v2) -> None: log.critical('Ignoring CTRL+BREAK (signal {}); use the GUI to quit', v1) ``` ```python def v3(v4: int, v5) -> None: log.critical('Ignoring CT...
Imports: ```python import ast from ast import AST import typing ``` Type definitions: Input Types: Any Output Type: List[Tuple[str, Any]] Dependencies: Function Name: v0 Function: ```python def v0(v1: Any) -> List[Tuple[str, Any]]: if isinstance(v1, list): return [(str(i), a) for (v2, v3) in enumerate(v1)...
Imports: ```python import typing ``` Type definitions: Input Types: Any, int, str, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: int, v3: str, v4: str, v5: str): v6 = {'job_id': v2, 'last_job_id': v3, 'method': v4, 'resource_url': v5} v1.emit('update', v6, namesp...
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: str) -> str: return v1.replace('\n', '%0A') ``` ```python def v2(v3: str) -> str: return re.sub('\x1b\\[(K|.*?m)', '', v3) ``` Function Name: v4 Function: ```python def v4(v5: s...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as functional import typing ``` Type definitions: Input Types: torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor) -> torch.Tensor: v1 = functional.relu(self.FC1(v...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: for v2 in range(10): v3 = v1[0][v2] self.bars[v2]['value'] = v3 * 1000 self.gui.update() ```
Imports: ```python import secrets import typing ``` Type definitions: Input Types: dict, Any Output Type: Any Dependencies: ```python def v0(v1: str, v2): v3 = v2.execute('SELECT * FROM tasks WHERE shortname=%s', (v1,)) assert v3 == 1 v4 = v2.fetchall() assert len(v4) == 1 v5 = v4[0][0] return ...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float): self.amount_bid *= v1 self.amount_ask *= v1 self.amount_low *= v1 self.amount_high *= v1 self.amount_prev_close *= v1 self.del...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if v1: self.trace.append(v1) return v1 ```
Imports: ```python import typing ``` Type definitions: ```python @unique class v0(Enum): v1 = 'to_class' v2 = 'to_instance' ``` ```python class v3: def __init__(self, v4: Optional[dict]=None): self.binds = {} if v4 is None else v4 def v5(self, v6: str, v7: v0, v8: Any) -> v3: self.bind...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> int: if v1 is None: return None elif v1.endswith('M'): return int(v1[:-1]) * 1000000 elif v1.endswith('k'): return int(v1[...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Any] Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, Any]) -> Dict[str, Any]: v1.update(lr_scheduler=self.scheduler, step_interval=self.step_interval) return v1 ```
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: v0, str Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(v2: v0, v3: str) -> v0: if not v2: raise ValueError(f'{v3} cannot be a value that evaluates to false') return v2 ```
Imports: ```python import os import sys import logging import shutil from glob import glob import typing ``` Type definitions: Input Types: bool, bool, [str], bool, bool Output Type: Any Dependencies: ```python def v0(v1: bool=False, v2: bool=True, v3: bool=False): if v3: logger.setLevel(logging.DEBUG) ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self) -> np.ndarray: v1 = np.sum(self.__q_prof * self.__colden) v2 = self.__q_prof * self.__colden * self.__OD / v1 return (v2 * self._...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Tuple[Optional[str], Optional[str]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Tuple[Optional[str], Optional[str]]: v2 = self.get_valorant_api(f'/v1/seasons/{v1}') if v2 is None: retu...
Imports: ```python import operator import typing ``` Type definitions: Input Types: Any, Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1, v2=False) -> bool: v3 = operator.le if v2: v3 = operator.ge return all((v3(v1[i], v1[i + 1]) for v4 in range(len(v1) - 1))) ...
Imports: ```python from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier from sklearn.linear_model import LogisticRegressionCV from sklearn.metrics import roc_auc_score, average_precision_score, accuracy_score, f1_score from sklearn.model_selection import GridSearchCV from sklearn.pipeline imp...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> np.ndarray: v2 = self.camera.calib_mat[0, 0] v3 = self.get_idepth_image() v4 = v3 * v1 * v2 return v4 ```
Imports: ```python import urllib.parse as urlparse import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: ```python def v0(v1): v2 = urlparse.urlparse(v1) v3 = [] for v4 in v2.query.split('&'): (v5, v6) = v4.split('=') if v5 not in ['_nc_rid', 'ccb']: ...
Imports: ```python import hashlib import os import sys import typing ``` Type definitions: Input Types: Output Type: str Dependencies: ```python def v0() -> str: try: v1 = __file__ except NameError: v1 = sys.argv[0] v1 = os.path.abspath(v1) return v1 ``` ```python def v2(v3: str) -> st...
Imports: ```python import asyncio from asyncio import Event as _asyncio_Event, Lock as _asyncio_Lock from contextvars import copy_context, Context import typing ``` Type definitions: ```python v0 = TypeVar('RetT') ``` Input Types: Awaitable[v0] Output Type: v0 Dependencies: Function Name: v1 Function: ```python async ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1) -> pd.DataFrame: v2 = v1[['SHOT_DISTANCE', 'SHOT_MADE_FLAG']] v2 = v2.groupby('SHOT_DISTANCE').agg(['mean', 'count']).reset_index() return v2 ```
Imports: ```python import datetime import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: ```python def v0(v1: str) -> None: f.write(v1.encode('utf-8')) ``` Function Name: v2 Function: ```python def v2(self, v3: str) -> None: with open(self.filename, 'ab') as v4: def v5(v...
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor, Optional[torch.Tensor] Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: Optional[torch.Tensor]=None) -> torch.Tensor: (v3, v4) = v1.split([3, 1], dim=-1) if v2 is None: ...
Imports: ```python import pandas as pd from pandas import DataFrame import typing ``` Type definitions: Input Types: datetime, datetime, List[dict], bool Output Type: DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: datetime, v2: datetime, v3: List[dict], v4: bool=True) -> DataFrame: v5 = ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: v1 = 2 if self.feat_map_size: v1 += 2 if self.feat_abstime: v1 += 2 if self.feat_rule_msdm: v1 += 1 if self.feat_ru...
Imports: ```python import typing ``` Type definitions: Input Types: set Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: set) -> None: v2 = set(v1) - self._known_peers if self._p2pfactory is not None: for v3 in v2: self._p2pfactory.connect_peer(v3) ...
Imports: ```python import os import typing ``` Type definitions: Input Types: Optional[int] Output Type: Tuple[str, str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[int]=None) -> Tuple[str, str]: if v1 is None: v1 = self.input_file_index v2 = self.input_files[v1] ...
Imports: ```python import typing ``` Type definitions: Input Types: int, bool Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: bool=False) -> str: v3 = 2 if not v2 else 1 v4 = self._position self._position += v1 * v3 if self._position > len(self._data): ...
Imports: ```python import numpy as np from numpy.random import multivariate_normal import typing ``` Type definitions: Input Types: int, float, str Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: int, *v4: int, v2: float=0, v3: str='float') -> np.ndarray: if v3 == 'float': ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.MESSAGE = 'New comment:\n> It is better\n* here' self.do_test(expected_message='New comment:\n> It is better\n* here') ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1 = {} for (v2, v3) in self._settings.items(): v1[v2] = {'json_schema': v3.schema_json(), 'model': v3} return v1 ```
Imports: ```python import pandas as pd import os import typing ``` Type definitions: Input Types: xr.Dataset, str Output Type: str Dependencies: ```python def v0(v1: xr.Dataset) -> List[str]: return list(v1.data_vars.keys())[0] ``` Function Name: v2 Function: ```python def v2(v3: xr.Dataset, v4: str) -> str: v...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: print('\nSTOCK\t\t\t\t\tINITIALS\tPRICE/SHARE($)') for (v1, v2) in self.data.items(): if v1 != 'LBJ': print('{}\t\t\t{}\t\t{}'.fo...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, torch.Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor, v2: torch.Tensor, v3: torch.Tensor): self._sort_state(v3) self._scores = v2 self._hy...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: object Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> object: v2 = self._redis.get(self._encode_key(v1)) if v2: return self._serializer.loads(v2) ```
Imports: ```python import pandas as pd from pandas.api.types import is_numeric_dtype import typing ``` Type definitions: Input Types: pd.Series, bool Output Type: pd.Series Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.Series, v2: bool) -> pd.Series: if v2: v1 = v1.astype(pd.StringDtyp...
Imports: ```python import typing ``` Type definitions: Input Types: PySide2.QtGui.QMouseEvent Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: PySide2.QtGui.QMouseEvent) -> None: self.start_editing() return super().mouseDoubleClickEvent(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Iterator[Any] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Iterator[Any]: for (v1, v2) in self.items(): yield v2 ```
Imports: ```python from random import randint import typing ``` Type definitions: Input Types: Output Type: 15 Dependencies: Function Name: v0 Function: ```python def v0(self) -> 15: self._move_head() v1 = self.intify(self._get()) self._move_head() v2 = self.intify(self._get()) if v2 >= 0: ...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: int, v2: int, v3: int, v4: int): v5 = {'eastE6': v1, 'westE6': v2, 'southE6': v3, 'northE6': v4} return await self.request(method='...
Imports: ```python import base64 import math import secrets import zlib import typing ``` Type definitions: Input Types: bytes, str Output Type: Any Dependencies: ```python def v0(v1, v2): return bytes([_a ^ _b for (v3, v4) in zip(v1, v2)]) ``` Function Name: v5 Function: ```python def v5(v6: bytes, v7: str): ...
Imports: ```python from math import ceil, gcd, lcm import typing ``` Type definitions: Input Types: int, int Output Type: tuple[int, int, int] Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int) -> tuple[int, int, int]: (v3, v4) = (v1, v2) (v5, v6) = (1, 0) (v7, v8) = (0, 1) w...