text
stringlengths
190
325k
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: str, Any, Any Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2=True, v3=True) -> np.ndarray: v4 = [] v5 = [] v6 = [] v7 = [] with open(v1, 'r') as v8: v9 = v...
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.scope_stack.pop() if v2 != v1: raise NameError('Exiting scope "{}" but current scope is "{}".'.format(v1, v2)) ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> str: v2 = [] while v1: (v1, v3) = divmod(v1, -2) if v3 < 0: v1 += 1 v3 -= -2 v2.append(str(v3)) ...
Imports: ```python import os import typing ``` Type definitions: Input Types: str, dict, str Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: dict=None, v3: str=None) -> dict: v4 = {'name': v1, 'show': False} if v2: v4['graph_attr'] = v2 if v3: v4['...
Imports: ```python import random import typing ``` Type definitions: Input Types: random.Random | None Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: random.Random | None=None) -> str: if v1 is None: v1 = random.Random() v2: list[str] = list() if v1.randint(1, 100)...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: ```python def v0(v1): return 'mixed' in v1 or 'string' in v1 or 'unicode' in v1 ``` Function Name: v2 Function: ```python def v2(self) -> bool: def v3(v4): return 'mixed' in v4 or 'string' in v4 or 'un...
Imports: ```python import typing ``` Type definitions: Input Types: pandas.Series Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pandas.Series) -> str: for v2 in v1.index: (v3, v4) = v2 if v4.lower() == 'name': return v1[v2] raise ValueError('...
Imports: ```python import numpy as np from pandas._libs import algos, hashtable as htable, iNaT, lib from pandas._typing import AnyArrayLike, ArrayLike, DtypeObj, IndexLabel, TakeIndexer, npt from pandas.util._decorators import doc from pandas.util._exceptions import find_stack_level from pandas.core.dtypes.cast import...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python @contextmanager def v0(v1: bool=True) -> Generator[None, None, None]: v2 = set_freeze_enabled(v1) try: yield finally: set_freeze_enabled(v2) ``` Function Name: v3 Function: ```pyth...
Imports: ```python from math import floor, sqrt import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int): v2 = floor(sqrt(v1)) v3 = (v1 - v2 ** 2) // 2 if v1 % 2 == 0: return [v3, v2] else: return [v2, v3]...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: typing.NoReturn Dependencies: Function Name: v0 Function: ```python def v0() -> typing.NoReturn: v1 = int(input()) v2 = list(map(int, input().split())) v3 = v4 = 0 v5 = 0 v6 = 0 for v7 in range(v1): while...
Imports: ```python import argparse import typing ``` Type definitions: Input Types: Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0() -> Any: v1 = argparse.ArgumentParser(description='Cli tool to upload signature to Pyxis') v1.add_argument('--pyxis-url', default='https://pyxis.eng...
Imports: ```python import typing ``` Type definitions: Input Types: GLSLParser.Basic_type_expContext Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: GLSLParser.Basic_type_expContext): if v1.basic_type() is not None: if v1.basic_type().getText() == self.name: ...
Imports: ```python import typing ``` Type definitions: Input Types: int, list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: list): if v1 == 1: return v2[1] v3 = [0 for v4 in range(v1 + 1)] v3[0] = 0 v3[1] = v2[1] v3[2] = v2[1] + v2[2] for v5 i...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: dict) -> dict: v2 = v1['profileCollectibles']['data']['collectibles'] v3 = [character_triumphs['collectibles'] for (v4, v5) in v1['characterCollectibles']['...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2=None) -> List[int]: v3 = list() with self.db.transaction(description='get_files_that_should_be_removed_from_sync_folder', progress_callbac...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray) -> np.ndarray: v2 = np.maximum(np.matmul(self.w_0.T, v1.T) + self.b_0, 0.0) v3 = np.matmul(self.w_1.T, v2) + self...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: pd.DataFrame, str, str Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: str='Longitude', v3: str='Latitude') -> pd.DataFrame: v4 = v1.copy() v5 = 6378137 v4['x']...
Imports: ```python import itertools 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) -> None: if v2 and v2 == 's': if v1 >= 0: self.indent = v1 * ' ' else: ...
Imports: ```python import importlib from os.path import basename from importlib.machinery import SourceFileLoader import typing ``` Type definitions: Input Types: str, str Output Type: nn.Module Dependencies: ```python def v0(v1: str) -> Any: (v2, v3) = v1.split(':') v4 = basename(v2).split('.')[0] v5 = So...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Optional['Elf.Section'] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> Optional['Elf.Section']: for v2 in sorted(self.sections, reverse=True): if v1 in v2.range(): return v2 r...
Imports: ```python import typing ``` Type definitions: Input Types: bytearray Output Type: bytearray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytearray) -> bytearray: v2: bytearray = bytearray([0] * 16) v3: int = 0 v4: int = len(v1) for v5 in range(int(v4 // 16)): f...
Imports: ```python import numpy import typing ``` Type definitions: Input Types: Optional['FqeData'] Output Type: Tuple['Nparray', 'Nparray', 'Nparray', 'Nparray'] Dependencies: ```python def v0(v1: 'Nparray') -> 'Nparray': v2 = numpy.zeros((norb, norb, norb, norb, self.lena(), self.lenb()), dtype=self._dtype) ...
Imports: ```python import typing ``` Type definitions: Input Types: events.Key Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: events.Key) -> None: if v1.key == 'left': if self._cursor_position == 0: self._cursor_position = 0 else: ...
Imports: ```python import os import logging import typing ``` Type definitions: Input Types: Optional[str], Optional[str] Output Type: Dict[str, str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[str]=None, v2: Optional[str]=None) -> Dict[str, str]: v3 = {} for v4 in self: ...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str]): self.media_list: MediaList = self.instance.media_list_new(v1) for v2 in range(self.media_list.count()): self.media_list.item_a...
Imports: ```python import asyncio import typing ``` Type definitions: Input Types: Optional[float] Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: Optional[float]=None) -> None: await self._connection.close(code=1000) try: await asyncio.wait_for(asyncio.shi...
Imports: ```python import typing ``` Type definitions: Input Types: str, int Output Type: str Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str, v2: int) -> str: v3 = await self.get_pull_request(repo=v1, number=v2) return str(v3['head']['sha']) ```
Imports: ```python import os from os.path import isdir, splitext import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = '%s/jobs/%s' % (self.config.folder, v1) if not isdir(v2): os.makedirs(v2) return v2...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float=1) -> None: self.size -= self.shrink_amount * v1 self.update_rect() ```
Imports: ```python import typing ``` Type definitions: Input Types: habitat_sim.Simulator Output Type: Dict[int, str] Dependencies: Function Name: v0 Function: ```python def v0(v1: habitat_sim.Simulator) -> Dict[int, str]: v2 = v1.get_rigid_object_manager() v3 = v1.get_articulated_object_manager() v4 = {}...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Any], Sequence[str] Output Type: Tuple[Any, bool] Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, Any], v2: Sequence[str]) -> Tuple[Any, bool]: assert len(v2) > 0 for v3 in v2[:-1]: if v3 not in v1: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = '\n def fun(\n a1, # type: str\n *,\n kwonly1, # type: int\n **kwargs # type: Any\n ):\...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: str Output Type: (float, float) Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> (float, float): v2 = [] for v3 in range(len(self.results)): if len(self.results[v3]) > 0: v2.a...
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor): if self.hparams.task == 'regression' and self.hparams.target_range is not None: for v2 in range(self.hparams.output_dim): ...
Imports: ```python import typing ``` Type definitions: Input Types: Dict, Dict Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict, v2: Dict) -> Dict: v3 = v1['name'].replace('-', '_') if v3 in v2: v1['sub_path'] = v2[v3] return v1 ```
Imports: ```python import sqlite3 import pandas as pd import typing ``` Type definitions: Input Types: int, Optional[str] Output Type: pd.Series Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: Optional[str]=config.DATABASE_PATH) -> pd.Series: v3 = f'SELECT timestamp_ms, value FROM data WHE...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame, pd.Series, np.array Output Type: pd.Series Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.DataFrame, v2: pd.Series, v3: np.array) -> pd.Series: v4 = 0.68 * (self.F_sd_f[v3] / v1['E_m'][v3] * ((1 - self.mater...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: for v1 in self._v_lines.values(): v1.setPos(self._x) v1.show() for (v2, v3) in self._h_lines.items(): if v2 == self._plot_nam...
Imports: ```python import typing ``` Type definitions: Input Types: str, cms.CMSAttributes, Any, Any, Any, Any Output Type: cms.ContentInfo Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str, v2: cms.CMSAttributes, v3='v1', v4=False, v5=None, v6=None) -> cms.ContentInfo: v1 = v1.lower(...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Tuple[Tuple[int, int], Tuple[int, int], Tuple[int, int]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Tuple[Tuple[int, int], Tuple[int, int], Tuple[int, int]]: v1 = (0, 8) v2 = (9, 13) v3 = (14, 14 + l...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: List[float], Callable Output Type: Tuple[float, np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[float], v2: Callable) -> Tuple[float, np.ndarray]: v3 = len(v1) v4 = v1 + np.concatenate(...
Imports: ```python import datetime from math import floor import typing ``` Type definitions: Input Types: list, list Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2: list) -> int: v3 = datetime.datetime(year=v2[0], month=v2[1], day=v2[2]) v4 = datetime.datetime(year=v...
Imports: ```python 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: if len(v1.size()) < 3: raise TypeError('input should be at least 3D tensor. Got {}'.format(v1.size())) ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, Any Output Type: None Dependencies: ```python def v0(v1: list, v2='Po') -> list: v3 = v1.copy() v3[6] = 'direct\n' v4 = v1[0].split(' str #:')[0] v5 = f'{v2} ' + ''.join([i for v6 in v4 if not v6.isnumeric()]) v3[5] = v5 ...
Imports: ```python import datetime import typing ``` Type definitions: ```python @dataclasses.dataclass(frozen=True) class v0: v1: bool v2: Optional[float] = None v3: Optional[registries.HandlerResult] = None v4: Optional[Exception] = None ``` Input Types: v0 Output Type: 'HandlerState' Dependencies: F...
Imports: ```python import sys import textwrap import typing ``` Type definitions: Input Types: str, str, bool Output Type: Any Dependencies: ```python def v0(v1: str, v2: bool=False): v3 = sys.stdout v4 = f'doctor: {v1}' if supports_color(v3): v5 = '\x1b[0;34m' if v2 else '\x1b[0;91m' v4 = ...
Imports: ```python import glob import multiprocessing from functools import partial from pathlib import Path import numpy import tqdm import typing ``` Type definitions: Input Types: Any, int, Optional[float], int, int, int, int, float, float, bool Output Type: Any Dependencies: ```python def v0(v1: Path, v2: int, v3:...
Imports: ```python import typing ``` Type definitions: Input Types: ast.ClassDef Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: ast.ClassDef): v2 = super().generic_visit(v1) v3 = self.random_name(v2.name) self.function_names[v2.name] = v3 self.mapped_idents.add(v...
Imports: ```python from sklearn.metrics import roc_curve, roc_auc_score from matplotlib import pyplot from numpy import savez_compressed from numpy import asarray from numpy import load from numpy import expand_dims from sklearn.metrics import accuracy_score from sklearn.preprocessing import LabelEncoder from sklearn.p...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: str, **v2): v3 = v1.split() self.name = v3[0] self.surname = v3[1] for (v4, v5) in v2.items(): setattr(self, v4, v5) ``` Input Types: v0, str, Any Output Type: Any Dependenc...
Imports: ```python import typing ``` Type definitions: Input Types: str, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: bool=False): (v3, v4) = self._connection.select(v1, v2) if v3 != 'OK': raise Exception(f'IMAPAgent select_mailbox {v1} failed: {v...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Iterable[str] Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Iterable[str]) -> np.ndarray: v2 = [self.model[word] for v3 in v1 if v3 in self.model] if v2: return np.aver...
Imports: ```python import numpy as np from numpy import pi from numpy.fft import fft, ifft, fftfreq, fftshift, ifftshift import typing ``` Type definitions: Input Types: Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: int=1): v3 = np.ndim(v1) v4 = [1] * v3 ...
Imports: ```python import typing ``` Type definitions: ```python v0 = Union[str, float, int, None, Callable[['Cell'], Union[str, float, int]]] ``` Input Types: v0 Output Type: str Dependencies: ```python def v1(v2: int, v3: str='minutes') -> str: (v4, v5) = divmod(v2, 60) (v6, v4) = divmod(v4, 60) if v3 == ...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: Iterable[v0] Output Type: Iterable[v0] Dependencies: Function Name: v1 Function: ```python def v1(self, v2: Iterable[v0]) -> Iterable[v0]: v3 = set(v2) return (n for v4 in self._nodes if v4 in v3) ```
Imports: ```python from collections import defaultdict import heapq import typing ``` Type definitions: Input Types: int, List[List[int]], int, int, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: List[List[int]], v3: int, v4: int, v5: int) -> int: (v6, v7) = (de...
Imports: ```python import typing ``` Type definitions: Input Types: str, list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: list): if v1 == 'optional': self.optional = True elif v1 == 'lim': (self.min, self.max) = v2 ```
Imports: ```python import math import typing ``` Type definitions: Input Types: int, list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: list): v3 = math.sqrt(v1) for v4 in v2: if v1 % v4 == 0: return False if v4 > v3: return Tr...
Imports: ```python import cv2 import os import typing ``` Type definitions: Input Types: Any, int, int, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: int, v3: int, v4, v5): if not os.path.isdir(v4): os.makedirs(v4) print(f'Resizing {v5} to {v3}x{v2}...') ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> List[int]: v2 = v1 v3 = {} for (v4, v5) in enumerate(v2): v3[v5] = v4 v6 = 0 v7 = 0 v8: List[int] = [] for (v4...
Imports: ```python import json import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: with open(self._model_dir / v1, mode='r') as v2: v3 = json.loads(v2.read()) self.update(v3) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: bool=False): v1 = np.array(v1).reshape(1, -1) v3 = (self.s.reshape(-1, 1) - v1 == 0).any(axis=1) v4 = (self.t.reshape(-...
Imports: ```python import os import math import cv2 as cv import numpy as np import typing ``` Type definitions: ```python v0 = Tuple[int, int, int] ``` Input Types: np.ndarray, np.ndarray, np.ndarray, np.ndarray Output Type: bool Dependencies: ```python def v1(v2, *, v3: bool=True, v4: v0=(0, 0, 0)) -> np.ndarray: ...
Imports: ```python import typing ``` Type definitions: Input Types: ArgumentParser Output Type: ArgumentParser Dependencies: Function Name: v0 Function: ```python def v0(v1: ArgumentParser) -> ArgumentParser: v2 = v1.add_argument_group('System') v2.add_argument('--seed', default=2022, help='seed for reproduci...
Imports: ```python import smtplib from email.message import EmailMessage from datetime import datetime import typing ``` Type definitions: Input Types: Any, Any, str, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3: str, v4: str, v5: str): v6 = smtplib.SMTP('smtp.of...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: try: while True: v1 = input() print(self.convert_para(v1)) except EOFError: return ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.pre_setup_to_save() self.to('cpu') ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1=[], v2=[], v3=True) -> list: if v2 and v3: v2 = [col for v4 in v2 if v4 not in self.primarykeys] if not v1: v5 = [v4 for v4 in...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Union[int, float], Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[int, float], v2=True): if isinstance(v1, float): v1 = int(len(self) * v1) v3 = np.random.choice(len(...
Imports: ```python import typing ``` Type definitions: Input Types: Path Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Path): if v1.exists(): print(f'file {v1.name} already exists') return with open(v1, 'w') as v2: pass ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int, int Output Type: np.matrix Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int) -> np.matrix: v3 = [] for v4 in range(v1): v3 += [[float(input('give an integer or float to create matrix ...
Imports: ```python import json import os import re import subprocess import sys import threading import typing ``` Type definitions: Input Types: str, str, str, Dict[str, Any] Output Type: bool Dependencies: ```python def v0(v1, v2, v3=None, v4=None): v5 = open(v1, 'r') if isinstance(v1, str) else v1 v6 = open...
Imports: ```python import typing ``` Type definitions: ```python v0 = Union[bytearray, memoryview] ``` Input Types: v0, Optional[int], int Output Type: Union[None, int, bytes] Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0, v3: Optional[int]=None, v4: int=0) -> Union[None, int, bytes]: if ...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F from torch.optim import AdamW from torch.utils.data import BatchSampler, DataLoader, RandomSampler from torch.utils.data.distributed import DistributedSampler import typing ``` Type definitions: Input Types: torch.tensor, torch.tenso...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> Dict: v3 = 'iserver/account/{}/order/{}'.format(v1, v2) v4 = 'DELETE' v5 = self._make_request(endpoint=v3, req_type=v4) r...
Imports: ```python import typing ``` Type definitions: Input Types: Any, ast.Call, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: ast.Call, v3): v4 = [] v5 = v2.args if len(v2.args) <= 2 else v2.args[:2] for v6 in v5: v4.append(v1.visit(v6)) v7 = set(['...
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.zeros(self.n_units) if self.connections: for (v2, v3) in self.connections: if v2.activatio...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> int: v2 = None v3 = 0 while v1: if v2 == v1[v3]: v1.pop(v3 - 1) else: v2 = v1[v3] v3 += 1 ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.x + self.y v2 = v1.copy() self.assertTrue(type(v2) is type(v1)) self.assertEqual(v2.args, v1.args) self.assertFalse(v2.args is ...
Imports: ```python import pandas as pd import os import numpy as np import matplotlib.pyplot as plt from scipy import stats import seaborn from pathlib import Path import typing ``` Type definitions: Input Types: pd.DataFrame, Any, str, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def...
Imports: ```python import textwrap from io import BytesIO from PIL import Image, ImageDraw, ImageFont import typing ``` Type definitions: Input Types: str, discord.Color Output Type: discord.File Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: discord.Color) -> discord.File: v3 = 40 ...
Imports: ```python import torch import typing ``` Type definitions: Input Types: int, bool Output Type: Iterable[Mapping[str, Any]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=1, v2: bool=True) -> Iterable[Mapping[str, Any]]: v3 = dict() for v4 in range(self.epoch, self.epoch + v1...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: ```python def v0(v1): return f'* {pad(v1.datetime.hour)}:{pad(v1.datetime.minute)}{v1.temperature: .1f}' ``` ```python def v2(v3: int): return f'0{v3}'[-2:] ``` Function Name: v4 Function: ```python def v4(self)...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self): self.desired_state = None self.cbsd_id = None self.user_id = None self.fcc_id = None self.serial_number = None self.state = None self.grants = None self.cha...
Imports: ```python import typing ``` Type definitions: Input Types: v1 Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: v1) -> int: if v1 == '-': return 0 v2 = [] v1 = v1.strip(' ') if v1 == '': return 0 v3 = 0 v4 = 0 v5 = 0 for v6 i...
Imports: ```python import os import subprocess import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: ```python def v0() -> List[Tuple[str, str]]: v1 = os.path.join(os.path.dirname(__file__), 'simple') v2 = [] for (v3, v4, v5) in os.walk(v1): v6 = {} v7 = {} ...
Imports: ```python import typing ``` Type definitions: Input Types: List[float] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: List[float]): if len(v1) < 2: return v1[0] try: (v2, v3) = v1[0] for (v4, v5) in v1[1:]: if v4 <= v2 or v5 <= v3: ...
Imports: ```python import typing ``` Type definitions: Input Types: List[List[str]], Tuple[int, int], Tuple[int, int] Output Type: List[Tuple[int, int]] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[List[str]], v2: Tuple[int, int], v3: Tuple[int, int]) -> List[Tuple[int, int]]: v4: List[List...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, dict, str, int Output Type: tuple Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: dict, v4: str, v5: int) -> tuple: self.refresh_secret_info() v6: str = self.generate_canonical_content(v1, v2, ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: dm_env.TimeStep Output Type: base.Action Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dm_env.TimeStep) -> base.Action: v2 = np.array([self._posterior[i].sample(self._rng) for v3 in range(self._num_action...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if len(v1) > 1 and v1.startswith('/'): return self.normalize_key(v1[1:]) return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> bool: try: self.__datesCollection.document(v1).delete() print('Date was declined successfully') return True except: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Union[np.ma.masked_array, np.ndarray], bool, int Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[np.ma.masked_array, np.ndarray], v2: bool, v3: int=0) -> np.ndarray: if not v2 or not...
Imports: ```python import typing ``` Type definitions: Input Types: tf.Tensor Output Type: tf.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: tf.Tensor) -> tf.Tensor: v2 = v1 for v3 in self.conv_layers: v2 = v3(v2) v2 = self.conv_final(v2) return v2 ```
Imports: ```python import torch import torch.nn as nn import typing ``` Type definitions: Input Types: torch.tensor, torch.tensor, torch.tensor, torch.tensor Output Type: torch.tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.tensor, v2: torch.tensor, v3: torch.tensor, v4: torch.tensor) -> ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: str='Are you sure?') -> bool: while 1: v2 = input('%s (y/n) ' % v1) if v2.lower() in ['y', 'yes']: return True elif v2.lower(...
Imports: ```python import scipy from scipy import sparse import numpy as np import pandas as pd import typing ``` Type definitions: Input Types: np.ndarray, bool Output Type: sparse.csr_matrix Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray, v2: bool=True) -> sparse.csr_matrix: if ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = iter(v1.split('_')) return next(v2) + ''.join((word.capitalize() for v3 in v2)) ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: if v1 == 'backgroundColor': return 'background-color' return '' ```