text
stringlengths
190
325k
Imports: ```python import numpy as np import os from scipy.sparse import csr_matrix, diags, load_npz import torch import typing ``` Type definitions: Input Types: str Output Type: Tuple[torch.sparse.FloatTensor, torch.FloatTensor, torch.LongTensor] Dependencies: ```python def v0(v1: csr_matrix) -> csr_matrix: v2 =...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: int): if self._model_cache and len(self._model_cache) >= v1: return self._model_cache[v1] v2 = self.copy(offset=v1, limit=1) v3 = awai...
Imports: ```python from collections.abc import Sequence, Mapping from numbers import Integral import typing ``` Type definitions: Input Types: Any, str, str, Any Output Type: Any Dependencies: ```python def v0(v1: Any, v2: SequenceType[Any], v3: Any=None) -> Any: v4 = v1 for v5 in v2: if isinstance(v4,...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: if 12 == v1.state and v1.keysym == 'c': return else: return 'break' ```
Imports: ```python from collections import OrderedDict import torch import torch.nn as nn import torch.nn.functional as F import typing ``` Type definitions: Input Types: Any, Any, Any, Any Output Type: nn.Sequential Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, v3, v4=2) -> nn.Sequential: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self) -> list: v1 = {} v2 = self.s.request('GET', url=f'{self.endpoint}/card-accounts', data=v1) return [i.get('resourceId') for v3 in v2.json().get('cardAccoun...
Imports: ```python import itertools import typing ``` Type definitions: Input Types: tf.compat.v1.data.Dataset, int Output Type: Any Dependencies: ```python def v0(v1: tf.compat.v1.data.Dataset) -> Iterator[tf.Tensor]: if v1 in _tf_dataset_iterables: v2 = _tf_dataset_iterables[v1] for v3 in v2: ...
Imports: ```python import typing ``` Type definitions: Input Types: typing.List[float] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: typing.List[float]) -> None: v2 = sum(v1) for v3 in range(len(v1)): v1[v3] /= v2 ```
Imports: ```python from warnings import warn import typing ``` Type definitions: Input Types: str, sc.Variable, str, Dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: sc.Variable, v3: str, v4: Dict): v3 = v3.split('/') v5 = -2 v6 = False v7 = False while...
Imports: ```python import pandas as pd import typing ``` Type definitions: ```python v0 = Union[np.ndarray, pd.DataFrame] ``` Input Types: v0 Output Type: Dict[str, pd.Series] Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0) -> Dict[str, pd.Series]: if not isinstance(v2, pd.DataFrame): ...
Imports: ```python import pprint import typing ``` Type definitions: Input Types: Any, Any, list, Any Output Type: None Dependencies: ```python def v0(v1: dict, v2, v3: str='') -> None: for (v4, v5) in v1.items(): v6 = v3 + ('/' if v3 else '') + v4 if 'expected' in v5 and 'actual' in v5: ...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: list): v2 = [] v3 = [] v4 = [] for v5 in v1: v2.extend(v5[0]) v3.extend(v5[1]) v4.extend(v5[2]) return (v2, v3, v4) ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): while v1 * 2 <= self.size: v2: int = self.getMinIndex(v1) if self.heap[v1].weight > self.heap[v2].weight: (self.heap[v1], ...
Imports: ```python import statistics import typing ``` Type definitions: Input Types: int, str Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: str) -> float: v3 = self[v1] if v2 not in v3.prefs: return 1 v4 = v3.prefs[v2] if not v4: retu...
Imports: ```python import matplotlib.figure from matplotlib import pyplot as plt import typing ``` Type definitions: Input Types: mne.time_frequency.AverageTFR, Optional[str], Optional[Union[str, Path]], bool Output Type: matplotlib.figure.Figure Dependencies: Function Name: v0 Function: ```python def v0(v1: mne.time...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str): v2 = f'{self._address}/api/session/{self._session_id}/task/{v1}' await self._request_url(path=v2, method='DELETE') ```
Imports: ```python from numpy import floor, maximum, mean, minimum, nan, ndarray, round from numpy import sum as np_sum from numpy import where import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> None: if not isinstanc...
Imports: ```python import logging import typing ``` Type definitions: Input Types: str, str, bool, str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: bool=True, v4: str=None, v5: str=None, **v6) -> None: self.firestore.delete_document(self.report_type...
Imports: ```python import typing ``` Type definitions: Input Types: Lambda Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Lambda) -> Any: for v2 in v1.args.defaults: self.visit(v2) for v2 in v1.args.kw_defaults: if v2: self.visit(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list) -> int: v2 = [0 for v3 in range(len(v1))] v4 = [0 for v3 in range(len(v1))] v5 = 0 for v6 in range(len(v1)): v5 = max((v5, v1[v6]...
Imports: ```python import pathlib import torch from torch import nn as nn from torch.nn import functional as F import typing ``` Type definitions: Input Types: Union[str, pathlib.Path] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[str, pathlib.Path]): v2 = {'state_dic...
Imports: ```python import re import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: v1 = self.readByte() v2 = 0 if v1 == 253: v3 = re.findall('.{1,2}', self.read(2)) for v4 in reversed(v3): v2 ...
Imports: ```python from itertools import tee, _tee, islice, chain, combinations import typing ``` Type definitions: Input Types: Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any): v2 = [v1] self._inert = chain(self._inert, v2) return self ```
Imports: ```python import typing ``` Type definitions: ```python class v0: v1: str v2: Any def __init__(self, v3: str, v4: Any): """ Construct an NbtTag instance. :param name: The name of the NbtTag. :param value: The value of the NbtTag. """ self.name = v3 ...
Imports: ```python import cv2 import typing ``` Type definitions: Input Types: Path, int, zivid.Frame, np.array Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Path, v2: int, v3: zivid.Frame, v4: np.array): v3.save(v1 / f'img{v2:02d}.zdf') v5 = cv2.FileStorage(str(v1 / f'pos{v2...
Imports: ```python import asyncio import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self) -> None: self._logger.debug('Server close started') v1 = [connection.close() for v2 in self._connections] await asyncio.gather(*v1) ...
Imports: ```python from tensorflow.keras import Model, layers import typing ``` Type definitions: Input Types: int, Union[str, Callable], bool, str, str Output Type: List[layers.Layer] Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: Union[str, Callable]=None, v3: bool=False, v4: str='same', v5...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: bool) -> str: if v1: return '\n <p>If you need help or have questions about EasyCLA, you can\n <a href="https://docs.linuxfoundatio...
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> bool: v2 = v1.split(':') try: return len(v2) == 8 and all([re.match('^[0-9a-fA-F]{1,4}$', part) and 0 <= int(part, 16) <= 655...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, pymap.Observation], Dict[str, pymap.Observation] Output Type: List[Tuple[str, str]] Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, pymap.Observation], v2: Dict[str, pymap.Observation]) -> List[Tuple[str, str]]: ...
Imports: ```python import cgi import typing ``` Type definitions: Input Types: cgi.FieldStorage, str Output Type: Optional[bytes] Dependencies: ```python def v0(v1: cgi.FieldStorage, v2: str) -> Tuple[Optional[str], Optional[bytes]]: if not v2 in v1: log.warning('get_cgi_parameter_file: form has no key {}'...
Imports: ```python import random import numpy as np import torch import torch.distributed as dist import torch.nn.functional as F from torch.cuda.amp import GradScaler from torch.optim import Adam from torch.optim.lr_scheduler import ExponentialLR from torch.utils.data import DistributedSampler, DataLoader from torch.u...
Imports: ```python import numpy as np import torch from torch import nn, optim from torch.autograd import Variable from torch.utils.data import SequentialSampler, DataLoader, Dataset from tqdm import tqdm, trange import typing ``` Type definitions: ```python @dataclass class v0: v1: int v2: float v3: int ...
Imports: ```python import typing ``` Type definitions: Input Types: webdriver.Chrome, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: webdriver.Chrome, v2: str) -> str: v1.get(v2) v3 = f'web_page.png' v1.get_screenshot_as_file(v3) return str(v3) ```
Imports: ```python from tensorflow.keras.models import Model from tensorflow.keras.layers import Dense, LSTM, RepeatVector, TimeDistributed, Input from tensorflow.keras.callbacks import EarlyStopping import typing ``` Type definitions: Input Types: Any, Any Output Type: Model Dependencies: Function Name: v0 Function:...
Imports: ```python import typing ``` Type definitions: Input Types: bool, bool Output Type: Union[int, str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False, v2: bool=False) -> Union[int, str]: v3 = self._start return self._human_precise(v2, v1, v3) ```
Imports: ```python from datetime import datetime import random import typing ``` Type definitions: Input Types: str, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int) -> int: v3 = random.randint(100000, 999999) if self.db.find_one({'verif_code': v3}): ...
Imports: ```python import logging import os import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> None: logging.debug('Removing temporary file:\t%s', v1) os.remove(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: 'IO_TYPE' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str='r') -> 'IO_TYPE': v1 = self.join(self.root, v1) with open(v1, v2) as v3: return v3.read() ```
Imports: ```python import sympy as sp import sympy.printing.cxxcode as cxxcode from sympy.matrices.immutable import ImmutableDenseMatrix from sympy.matrices.dense import MutableDenseMatrix import typing ``` Type definitions: Input Types: sp.Basic Output Type: None Dependencies: Function Name: v0 Function: ```python d...
Imports: ```python import typing ``` Type definitions: Input Types: Union[str, List[str]], str, int, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[str, List[str]], v2: str, v3: int, v4: str) -> None: if type(v1) is list: for v5 in v1: v6: str ...
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray Output Type: None Dependencies: ```python def v0(v1: Tuple) -> None: assert v1[2] == 3, f'Received image array with shape: {v1}, expected image array shape is (x, y, 3)' ``` ```python def v2(v3: Tuple) -> None: raise ValueError(f'Re...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: List[np.array], int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: List[np.array], v2: int, v3: int): v4 = [] for v5 in v1: for v6 in range(1, int(np.unique(v5)[-1]) + 1): ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Iterator[Tuple[str, str, List[str], str]] Dependencies: ```python def v0(v1): v2 = [] print('loading examples from {0}'.format(v1)) with jsonlines.open(v1) as v3: for v4 in v3: v2.append(v4) return ...
Imports: ```python import os import sys import typing ``` Type definitions: Input Types: str Output Type: List Dependencies: Function Name: v0 Function: ```python def v0(v1: str='/proc') -> List: if sys.platform != 'linux': return [] v2 = [] for v3 in os.listdir(v1): try: if os...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int): if not 0 <= v1 < 256: raise ValueError(f'color {v1} not between 0 and 255') ```
Imports: ```python import typing ``` Type definitions: Input Types: 'ScheduleCache' Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'ScheduleCache') -> None: for (v2, v3, v4) in v1: self.put(v2, v3, v4) ```
Imports: ```python import pickle import numpy as np import pandas as pd import typing ``` Type definitions: Input Types: str Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> pd.DataFrame: v2 = '/glade/scratch/jframe/neuralhydrology/data/' with open(v2 + 'full_pe...
Imports: ```python import queue import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str='default') -> str: try: return self.outputQueues[v1] except KeyError: self.outputQueues[v1] = queue.Queue(self.qsize) ...
Imports: ```python import typing ``` Type definitions: Input Types: KolibriDaemonDBus.MainSkeleton, Gio.DBusMethodInvocation Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: KolibriDaemonDBus.MainSkeleton, v2: Gio.DBusMethodInvocation) -> bool: self.__application.reset_inacti...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: str): v2 = {} for v3 in v1.split('\n'): if '=' not in v3 or len(v3) == 0: continue v4 = v3.split('=') v2[v4[0]] = v4[1] return v2 ``` Function Name...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: int): self.__script.action(v1, v2, v3) return self.__data ```
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor, Any Output Type: Any Dependencies: ```python def v0(v1: torch.Tensor, v2): v3 = list(v2) for v4 in range(len(v3)): if v3[v4] != v4: v1 = v1.transpose(v4, v3[v4]) v5 = v3.index(v4) (v3[v...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> bool: v2 = [0, 0] v3 = 0 while True: for v4 in v1: if v4 == 'G': if v3 in [0, 2]: v...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1=None) -> None: if v1 is not None: v2 = self.table[v1] v2.scaling() print('Column {} was scaled'.format(v1)) else: if sel...
Imports: ```python import logging import sys import typing ``` Type definitions: Input Types: Optional[logging.LogRecord] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[logging.LogRecord]): if not v1 or v1.levelno < logging.INFO: return print(v1.message,...
Imports: ```python import ctypes import typing ``` Type definitions: ```python class v0(ctypes.Structure): v1 = [('p_forw', ctypes.c_uint64), ('p_back', ctypes.c_uint64), ('p_paddr', ctypes.c_uint64), ('p_addr', ctypes.c_uint64), ('p_fd', ctypes.c_uint64), ('p_cwdi', ctypes.c_uint64), ('p_stats', ctypes.c_uint64), ...
Imports: ```python import typing ``` Type definitions: Input Types: int, ParameterId Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: int, v2: ParameterId): v3 = await self.get_parameter_raw(v1, v2) self.add_parameter_extensions(v3) return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> None: self.controller.handle_cmdline_input(v1) self.hide_cmdline() ```
Imports: ```python import requests import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = requests.get(url=v1) return v2.content.decode(encoding='utf-8') ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: 'Widget' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str='widget') -> 'Widget': assert isinstance(v1, str) if v1 in self._kwargs.keys(): raise KeyError('duplicated key') self._kwargs[v1] =...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self) -> list: v1 = ['Midrange Long Strafes Invincible', 'air far long strafes', 'Vertical Long Strafes', 'Bounce 180 Tracking Large', '1wall6targets TE', 'Tile Frenzy ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, int Output Type: str Dependencies: ```python def v0(v1, v2): if v1 > n: if n % v2 == 0: for v3 in range(1, v2 + 1): yield alphabet[a[v3]] else: a[v1] = a[v1 - v2] for v4 in v0(v1 + 1, v2...
Imports: ```python import os import base64 from base64 import b64encode, b64decode import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(v1: str, v2: str): v3 = v1 v4 = v3.encode('ascii') v5 = base64.b64decode(v4, valida...
Imports: ```python import typing ``` Type definitions: ```python @dataclass(frozen=True) class v0: def v1(self, v2: v0) -> v0: return v2 ``` Input Types: Output Type: None Dependencies: ```python def v3(v4) -> Union[ta.BaseColumn, v0, None]: if v4 is None: return None assert isinstance(v4,...
Imports: ```python from math import factorial import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> int: v2 = 0 "\n math.factorial returns an integer which isn't iterable so convert to a string which is.\n " for v...
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: ```python def v0(v1, v2, v3: str, v4=identity): assert len(v2) == 2 v5 = tf.get_variable(v3, initializer=tf.glorot_normal_initializer(), shape=v2) v6 = tf.Variable(tf.zeros(v2[1]))...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: Output Type: pd.Series Dependencies: Function Name: v0 Function: ```python def v0(self) -> pd.Series: v1 = self._check_fillna(self._lband, value=-1) if self._offset != 0: v1 = v1.shift(self._offset) return pd....
Imports: ```python from datetime import datetime, time from math import floor import typing ``` Type definitions: Input Types: Output Type: str Dependencies: ```python def v0(v1, v2): return v2 * round(floor(v1 / v2)) ``` Function Name: v3 Function: ```python def v3(self) -> str: v4 = datetime.now() v5 = ...
Imports: ```python import os import numpy as np from numpy.compat.py3k import npy_load_module import typing ``` Type definitions: Input Types: str Output Type: List[np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> List[np.ndarray]: v1 = os.path.splitext(os.path.basename(v1)...
Imports: ```python import collections import ctypes as ct import typing ``` Type definitions: Input Types: Output Type: Optional[Dict[str, Any]] Dependencies: ```python def v0(v1: Optional[ct._Pointer]) -> bool: if v1: return False return ct.cast(v1, ct.c_void_p).value is None ``` Function Name: v2 Fu...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: Optional[bool] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Any=DEFAULT) -> Optional[bool]: v3 = self.pop(v1, v2) if v3 is None: return None elif isinstance(v3, bool): ...
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor, int Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: int) -> torch.Tensor: v3 = v1.new_ones(v1.size(0), v2) v4 = v3.cumsum(dim=1) return (v1.unsqueeze(1) >= v4).long(...
Imports: ```python import typing ``` Type definitions: Input Types: dict, str, Any, dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(*, v1: dict, v2: str, v3, v4: dict=None) -> dict: v5 = {'attrs': v1, 'time_format': v2, 'dimensions': {'*': v3.copy()}} if v4: v5['addit...
Imports: ```python import re import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1) -> bool: for v2 in v1.split(' '): if not re.match('(^[a-z][a-z0-9-]*$)|(^[0-9]+$)', v2) and (not re.match('-[AFGMPagpunr]+$', v2)): ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Dict[int, int] Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> Dict[int, int]: v2 = {} for v3 in range(-9, 10): v2[v3] = 20 - v3 - v1 return v2 ```
Imports: ```python import random import string import typing ``` Type definitions: ```python @value.value_equality class v0: def __init__(self, v1: Optional[str]=None, v2: Optional[str]=None, v3: Optional[str]=None) -> None: """Configuration for a job that is run on Quantum Engine. Args: ...
Imports: ```python import torch from torch import Tensor import torch.distributed as dist from torch.distributed.distributed_c10d import _get_global_rank, group from torch.nn import Module from torch.nn import Parameter import typing ``` Type definitions: Input Types: Tensor, Tensor, Any Output Type: Any Dependencies:...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.cell.seconds_since_birth v2 = self.cell.migrate(delta=self.default_delta) self.assertEqual(v2.seconds_since_birth, v1 + self.default_de...
Imports: ```python import typing ``` Type definitions: Input Types: int, List[int] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: List[int]) -> int: v3 = {0: 1} for v4 in range(1, v1 + 1): v3[v4] = 0 v2.sort() for v5 in v2: for v6 in range(0, v...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): v2 = v1['id'] for v3 in self.connections: if v3.user_id == v2: v3.groups = v1['groups'] v3.permissions = v1['per...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: list) -> int: v2: List[List[int]] = [1 for v3 in range(len(v1))] for v4 in range(1, len(v2)): for v5 in range(v4): if v1[v5] <= v1[v4] an...
Imports: ```python import math import torch from torch import nn from torch.nn import functional as F from torch.nn import init import torch.distributions import typing ``` Type definitions: ```python @dataclass class v0: v1: str = 'constant' v2: float = 0.0 ``` Input Types: v0 Output Type: Any Dependencies: F...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, dict Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: dict={}) -> None: for v4 in self.__tags['device_serial_number']: for v5 in self.__measurements: if v5 == '...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, Any Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> List[str]: v3 = [] for v4 in v1: v5 = [] for v6 in range(len(v4)): v5.append(''.join(map(chr,...
Imports: ```python import numbers from typing import Any, Callable, Dict, Iterable, Mapping, Optional, Sequence, Tuple, Union, cast import torch import torch.nn as nn from torch.optim.lr_scheduler import _LRScheduler from torch.optim.optimizer import Optimizer from torch.utils.data.distributed import DistributedSampler...
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 self._scene: self._scene.shutdown() self._scene = self._scene_factory(v1) self._scene.startup() ```
Imports: ```python import typing ``` Type definitions: Input Types: BaseEstimator, List, List, List, List, Optional[Dict], Optional[Dict] Output Type: Any Dependencies: ```python def v0(**v1): return lime_tabular.LimeTabularExplainer(discretize_continuous=False, **v1) ``` ```python def v2(v3: Explanation): ret...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: int, **v2) -> None: await self.fetch_user_badges(v1) v3 = [] v4 = [] for (v5, v6) in enumerate(v2.items()): (v7, v8) = v6 ...
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.zeros((v1.shape[0], v1.shape[1], 3), dtype=np.uint8) v2[np.where(v1 == 0)] = (255, 0, 0) ...
Imports: ```python import pandas as pd from pandas._typing import DataFrame import typing ``` Type definitions: Input Types: DataFrame, Optional[List[str]] Output Type: DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: DataFrame, v2: Optional[List[str]]=None) -> DataFrame: if v2 is not None...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, Any Output Type: np.ndarray Dependencies: ```python def v0(v1: np.ndarray) -> np.ndarray: return v1 / v1.sum(axis=1, keepdims=True) ``` ```python def v2(v3: np.ndarray, v4=1.0) -> np.ndarray: return v3 + v4 ``` F...
Imports: ```python import typing ``` Type definitions: Input Types: Enum Output Type: Optional[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Enum) -> Optional[int]: v2 = self.RAM_INPUT_MAP.get(v1) if v2: return self.ram[v2] return None ```
Imports: ```python from re import UNICODE, compile import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> bool: if len(v1) < 3 or len(v1) > 20: return False v2 = compile('\\A[\\w-]+\\Z', UNICODE) if not v2.match...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: self.forms[v1] += 1 self.count += 1 ```
Imports: ```python import typing ``` Type definitions: Input Types: 'Node' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'Node'): v1.nexts.add(self) self.prevs.add(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: list[list[int]] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: list[list[int]]) -> bool: if len(v1) % 2 != 0 or len(v1) != 20: return False for v2 in v1: if len(v2) != len(v1): ret...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any) -> dict: if not isinstance(v1, str): v2 = False else: try: (v1, v3) = v1.split('|') except ValueError: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.forward_only() v2 = self._criterion(v1, self._labels) v2.backward() self._module.zero_grad() ```
Imports: ```python import matplotlib.pyplot as plt import typing ``` Type definitions: Input Types: List Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: List=None): if v1 is None: v1 = plt.gcf().get_axes() for v2 in v1: v2.set_axis_off() ```