text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: str, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int=1): if len(self.version[v1]) == 0: assert v2 > 0, 'new previous data found, gap must be greater than 0' return v3 = se...
Imports: ```python import typing ``` Type definitions: Input Types: SparkSession.Builder, str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: SparkSession.Builder, v2: str, v3: str) -> None: if v2 in v1._options: v4 = v1._options[v2] v1.config(v2, f'{v4},{v3}'...
Imports: ```python import typing ``` Type definitions: Input Types: int | None, int | None Output Type: bytes | None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: int | None=None, v2: int | None=None) -> bytes | None: self._update_from_data() if self._image_url is not self._detail...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> None: if v1 % 2 == 0: print(v1, 'is even.') else: print(v1, 'is odd.') ```
Imports: ```python import random import typing ``` Type definitions: Input Types: Any, Any, Any, Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, v3, v4, v5: int=1000): for v6 in range(v5): v7 = (v2 != -1)[..., 0].sum(dim=-1) v8 = random.choice(ran...
Imports: ```python import uuid import typing ``` Type definitions: Input Types: Union[str, None] Output Type: Union[uuid.UUID, None] Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[str, None]) -> Union[uuid.UUID, None]: if not v1: return None else: return uuid.UUID(v1) ```
Imports: ```python from urllib.parse import parse_qs, urlparse import typing ``` Type definitions: ```python class v0(TypedDict): v1: int v2: str v3: str v4: List[Dict[str, Any]] ``` Input Types: v0 Output Type: Any Dependencies: Function Name: v5 Function: ```python def v5(self, v6: v0): if v6['ne...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = 'calib.right' if v1: v2 = v1 + '.right' return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: NoReturn Dependencies: Function Name: v0 Function: ```python def v0(self) -> NoReturn: v1 = self.__dict__ v2 = self.ITEM_CLASS v3 = v1.keys() v4 = [] for v5 in v3: if v5.startswith('numpy_'): v6 =...
Imports: ```python import typing ``` Type definitions: Input Types: List[float] Output Type: List[float] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[float]) -> List[float]: v2 = [] if v1[-1] < -1.96: v3 = True else: v3 = False for (v4, v5) in enumerate(v1): ...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: Network, v2: str, v3: int=0, v4=False, v5=False, v6=None, v7=False, v8=False, v9=None): self.network = v1 self.name = v2 self.cnt = v3 self.predecessors: Set[v0] = set() self.su...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any Output Type: Tuple[int, int] Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4, v5) -> Tuple[int, int]: if v3 < v4: v6 = v3 v7 = v4 - v3 elif v3 > v4: v6 = v4 + len(v5) ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, int Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: int) -> np.ndarray: v1 = np.array(v1, copy=False) v3 = [[v2, v2]] * v1.ndim v4 = tuple((slice(a, v1....
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: assert self._data_receiver is None self._data_receiver = v1 ```
Imports: ```python import os import typing ``` Type definitions: Input Types: List[str] Output Type: Tuple[List[str], str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str]) -> Tuple[List[str], str]: v2 = [] v3 = '' for v4 in v1: v5 = os.path.join(self.folder_path, v4)...
Imports: ```python import typing ``` Type definitions: ```python class v0(NDFrame, OpsMixin): v1 = {'columns', 'index'} | NDFrame._internal_names_set v2 = 'dataframe' v3 = (Series, Index, ExtensionArray, np.ndarray) v4: set[str] = {'sparse'} v5: frozenset[str] = NDFrame._hidden_attrs | frozenset([])...
Imports: ```python import datetime as _dt import typing ``` Type definitions: Input Types: _dt.date, _dt.date Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: _dt.date, v2: _dt.date): for v3 in range(int((v2 - v1).days)): yield (v1 + _dt.timedelta(v3)) ```
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 = {')': '(', ']': '[', '}': '{', '(': ')', '[': ']', '{': '}'} v3: List[str] = [] for v4 in v1: if not v3: v3....
Imports: ```python import json import typing ``` Type definitions: ```python v0 = Union[str, int, float, bool, List, Dict, None] ``` Input Types: Output Type: v0 Dependencies: Function Name: v1 Function: ```python async def v1(self, **v2) -> v0: v3 = await self.recv() return json.loads(v3, **v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: List[List[str]], List[int] Output Type: Tuple[List[List[int]], List[int]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[List[str]], v2: List[int]) -> Tuple[List[List[int]], List[int]]: (v3, v4) = ([], []) for (v5, ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> int: if v1 < 0: raise ValueError('num must not be negative.') if v1 == 0: return 0 if v1 == 1: return 1 v2 = 0 v3 ...
Imports: ```python import logging import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._do_logging_with(self._logger, 'Test case') self._do_logging_with(self._main_logger, 'Main') logging.debug('Root: Debug messa...
Imports: ```python import typing ``` Type definitions: Input Types: Sequence[str] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Sequence[str]): self.parser = self.build_parser() self.args = self.parser.parse_args(v1) self.verbosity: int = self['increase_verbosity'] ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if not v1 in self.aspects_deltas: raise ValueError(f'Aspect {v1} not found in {self.__class__.__name__}') return self.aspects_deltas[v1].s...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float=0.1) -> None: while not self.queue.empty(): self.function['sleep'](v1) ```
Imports: ```python import geopandas as gpd import pandas as pd import typing ``` Type definitions: Input Types: pd.DataFrame, pd.DataFrame, dict, gpd.GeoDataFrame Output Type: pd.DataFrame Dependencies: ```python def v0(v1): v2 = len(v1) v1 = v1.sort_values(by='report_date') v3 = [] for (v4, v5) in v1....
Imports: ```python import random import string import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0() -> str: v1 = [] v2 = 10 for v3 in range(v2): v4 = [] v5 = random.randint(5, 10) for v3 in range(v5): v6 = random.randint(5,...
Imports: ```python import typing ``` Type definitions: Input Types: Any, str Output Type: bool Dependencies: ```python def v0(v1, v2: str, v3: str) -> dict: return v1.describe_vpc_attribute(Attribute=v3, VpcId=v2) ``` Function Name: v4 Function: ```python def v4(v5, v6: str) -> bool: v7 = v0(v5, v6, 'enableDns...
Imports: ```python import typing ``` Type definitions: Input Types: tf.TensorShape Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: tf.TensorShape): self.bias = self.add_weight(shape=(self.vocab_size,), initializer='zeros', trainable=True, name='bias') self.decoder_bias = ...
Imports: ```python import typing ``` Type definitions: Input Types: List[int], int Output Type: List[Tuple[int, int, int]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: int) -> List[Tuple[int, int, int]]: self.identifier = v2 (v3, v4) = v1 v5 = (v3, v4, self.identifie...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: if self._virtual: return self.checi() + '(虚拟)' else: return self.checi() ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._isopen = False if self._loop is not None: if self._loop.is_alive(): self._loop.stop() self._loop.join() sel...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: _metadata_fb.TensorMetadataT Dependencies: Function Name: v0 Function: ```python def v0(self) -> _metadata_fb.TensorMetadataT: v1 = super().create_metadata() if self.score_calibration_md: v1.processUnits = [self.score_ca...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = 1 v3 = v1.split(' ')[0].replace(',', '').replace('.', '') v4 = v3.find('K') if v4 != -1: v3 = v3.replace('K', '') v2 = 1000...
Imports: ```python import functools import tensorflow.compat.v1 as tf from tensorflow.python.client import timeline import typing ``` Type definitions: Input Types: Any, Union[int, Tuple[int, int]], Any, Any, int Output Type: Any Dependencies: ```python def v0(v1, v2, v3, v4): v5 = dataloader.DetectionInputProcess...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str='r', **v3): with open(v1, v2) as v4: return self.load_from_fileobj(v4, **v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Optional[Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Optional[Any]: v2 = self.strong_cache.get(v1) if v2 is not None: self.strong_cache.move_to_end(v1) return v2 try: ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): if not self.has_parameter(v1, 'active_schedule_id'): return self.update_device_state(v1, 'active_schedule', self.get_schedule_name(v1, sel...
Imports: ```python import typing ``` Type definitions: Input Types: float, int, Any Output Type: Any Dependencies: ```python def v0(v1: float, v2: int, **v3): (v4, v5, v6) = run_snake(froude=float(v3.pop('froude')), time_interval=[0.0, v1], snake_type=LiftingKinematicSnake, **v3) return SandboxInterface(v4, v5...
Imports: ```python import sys from .sys import run_in_thread import typing ``` Type definitions: Input Types: Callable, Callable Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Callable, v2: Callable): try: v3 = v1() return v3 except Exception as _e: (v4...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> int: assert v1 >= 0 return 1 if v1 == 0 else 1 << (v1 - 1).bit_length() ```
Imports: ```python import configparser import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = configparser.ConfigParser() v1.read(self.CONFIG_NAME) for v2 in v1.sections(): if v2 not in {'BEHAVIOR', 'CACHE'...
Imports: ```python import asyncio import typing ``` Type definitions: Input Types: Any, Any Output Type: Optional[Dict[str, Any]] Dependencies: ```python def v0(v1): return asyncio.get_event_loop().run_until_complete(v1) ``` Function Name: v2 Function: ```python def v2(self, v3, v4) -> Optional[Dict[str, Any]]: ...
Imports: ```python import torch from torch import Tensor from torch.nn.functional import pad from torch.fft import rfftn, irfftn import typing ``` Type definitions: Input Types: Tensor, Tensor Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor, v2: Tensor) -> Tensor: v...
Imports: ```python import typing ``` Type definitions: ```python v0 = Union[DMChannel, GroupChannel, Member, TextChannel, User] ``` Input Types: v0, List[int] Output Type: None Dependencies: Function Name: v1 Function: ```python def v1(v2: v0, v3: List[int]) -> None: try: v3.remove(v2.id) except ValueE...
Imports: ```python import base64 import binascii import typing ``` Type definitions: Input Types: str Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> bytes: try: return base64.b16decode(v1) except binascii.Error: raise TypeError ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, TensorLikeType, DimsSequenceType, Optional[torch.dtype] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Any, v2: TensorLikeType, v3: DimsSequenceType, *, v4: Optional[torch.dtype]=None): v5 = False return ...
Imports: ```python import typing ``` Type definitions: Input Types: str, int, bool, bool, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int, v3: bool=False, v4: bool=True, v5: bool=True, **v6): v7 = self.all_tree_dict[v1].groupby(v2) if v4: v8 = v7...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = '{num_embeddings}, {embedding_dim}' if self.max_norm is not None: v1 += ', max_norm={max_norm}' if self.norm_type != 2: v1 += ...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('DBDataObj') ``` Input Types: Any Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(self, v2) -> v0: v3 = self._one_or_none(v2) if v3: return self.validation_schema.from_orm(v3) else: retu...
Imports: ```python import typing ``` Type definitions: Input Types: Any, dict, Literal['users', 'guilds'] Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1, v2: dict, *, v3: Literal['users', 'guilds']): v4 = self._database[v3] v1 = str(v1) v5 = await v4.update_one(...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: ```python def v0(v1: list) -> dict: if v1 is None or (isinstance(v1, list) and len(v1) == 0): return {'raw': v1} return {'raw': v1, 'name': v1[1]} ``` Function Name: v2 Function: ```python async def ...
Imports: ```python import socket import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> None: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as v2: v2.bind((v1, 0)) return v2.getsockname()[1] ```
Imports: ```python import subprocess as sp import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): try: if not isinstance(v1, list): v2 = sp.run(v1.split(), stdout=sp.PIPE, stderr=sp.DEVNULL) return ...
Imports: ```python import datetime as dt import typing ``` Type definitions: Input Types: dt.timedelta Output Type: Optional[dt.timedelta] Dependencies: Function Name: v0 Function: ```python def v0(v1: dt.timedelta) -> Optional[dt.timedelta]: if v1 == dt.timedelta.max: return None else: return...
Imports: ```python import typing ``` Type definitions: Input Types: List[float] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[float]): self.__init__(v1) return self ```
Imports: ```python import numpy as np import torch import torch.nn.functional as F import typing ``` Type definitions: Input Types: np.ndarray, int, bool Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray, v2: int=1, v3: bool=False) -> np.ndarray: if v1.ndim ==...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = ord(v1[0]) return self._jisyo_table.get(v2, None) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = [self._def_name] for v2 in self._spreadables: v1.append(str(v2)) return '/'.join(v1) ```
Imports: ```python import logging import typing ``` Type definitions: Input Types: Output Type: Optional[Awaitable[None]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Optional[Awaitable[None]]: logging.info('>>>>>>>>>>>>>>>>request header as:') logging.info(self.request.headers) ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: ```python def v0(v1): v2 = v1.values() return max(v2) - min(v2) ``` Function Name: v3 Function: ```python def v3(self, v4: str) -> int: def v5(v6): v7 = v6.values() return max(v7) - min(v...
Imports: ```python from datetime import date, datetime, timedelta import typing ``` Type definitions: Input Types: date, Any Output Type: int Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: date, v2=None) -> int: v3 = await self.load_height_from_day_cache(v1) if v3 is not None and v...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1) -> str: v2 = '' if v1['type-component']['type'] == 'note': v3 = v1['type-component']['pitch'] if v3 is not None: v2 = v3['step'] ...
Imports: ```python from typing import cast, Union, Any import ast import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = 'myArray[1 + 1]' v2 = self._setup_program(v1) v3 = cast(ast.ExpressionStatement, v2.statement...
Imports: ```python import logging import typing ``` Type definitions: Input Types: sqlite3.Connection, int, int, int, int, int, int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: sqlite3.Connection, v2: int, v3: int, v4: int, v5: int, v6: int, v7: int, v8: int): logging.info(...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._stack.pop() self._min_stack.pop() ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): v2 = {} for v3 in range(v1): v4 = list(bin(v3)[2:]).count('1') if v4 in v2: v2[v4].append(v3) else: ...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: Dict[str, Any], v2: bool) -> None: self.payload = v1 self.include_title = v2 def v3(self, v4: str) -> None: v5 = f"The '{v4}' event isn't currently supported by the GitHub webhook" ...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python class v0(torch.nn.Module): v1 = {'topk', 'uniform', 'gtopk'} v2 = {'linear', 'conv'} def __init__(self, v3: float, v4: float, v5: str='topk', v6: str='none', v7: str='linear', v8: Optional[int]=None): super().__init...
Imports: ```python from datetime import datetime import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = datetime.now().strftime('%Y_%m_%d') v2 = f'data_holder_{self.period_years}y_{self.interval}d_{v1}.pk' return v2 ...
Imports: ```python import os import sys import tempfile import typing ``` Type definitions: Input Types: str, Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str='', v2='') -> str: (v3, v4) = tempfile.mkstemp(text=True, suffix=v2) if v1: os.write(v3, bytes(v1, sys.g...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> List[int]: v2 = list() for v3 in range(2 ** v1): v2.append(v3 ^ v3 // 2) return v2 ```
Imports: ```python import json import collections import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): with open(v1) as v2: v3 = v2.read() return json.JSONDecoder(object_pairs_hook=collections.OrderedDict).decode...
Imports: ```python import os import subprocess from subprocess import PIPE import typing ``` Type definitions: Input Types: Output Type: Dict[str, bool] Dependencies: ```python def v0(v1: bool, v2: str=DEFAULT_LANG, v3: Optional[Set[str]]=None) -> dict: v4 = dict(os.environ) if v2: v4['LANG'] = v2 ...
Imports: ```python import typing ``` Type definitions: Input Types: Dict Output Type: Text Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict) -> Text: v2 = '{\n' for (v3, v4) in v1.items(): v2 += " '{}': {},\n".format(v3, v4) v2 = v2[:-2] v2 += '\n}' return v2 ```
Imports: ```python import calendar import datetime as dt import typing ``` Type definitions: Input Types: dt.datetime, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: dt.datetime, v2: int): v3 = v1.month - 1 + v2 v4 = v1.year + v3 // 12 v5 = v3 % 12 + 1 v6 = min(v1....
Imports: ```python import typing ``` Type definitions: Input Types: str, int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int) -> str: v3 = self.moodle.post('core_backup_get_async_backup_links_restore', backupid=v1, contextid=v2) return dict(v3).get('restoreur...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2) -> str: if v1 not in v2: return v1 for v3 in range(len(v2) + 1): v4 = f'{v1}{v3:d}' if v4 not in v2: return ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: if self._num_of_returns == self._num_of_files: return True else: return False ```
Imports: ```python import ctypes import numpy as np import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: np.ndarray Dependencies: ```python def v0(v1): v2 = {np.float32: ctypes.c_float, np.float64: ctypes.c_double, np.uint32: ctypes.c_uint, np.uint64: ctypes.c_uint64, np.int32: ctypes.c_int3...
Imports: ```python import typing ``` Type definitions: Input Types: List[Dict[str, int]] Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Dict[str, int]]) -> List[str]: v2 = [] for v3 in v1: if v3['0'] > v3['1']: v4 = '0' else: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: List, dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List, v2: dict): if len(v1) == 0: return np.empty([]) v3 = self._molecules_to_descriptors(v1, v2) v4 = self.predic...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str): async for v2 in self.keys_match(v1): self._delete(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: pathlib.Path Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: pathlib.Path) -> bool: if '/CMakeFiles/' in str(v1): return False else: return True ```
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = re.sub('[^a-zA-Z0-9]', '', v1) return str(sum(map(ord, v2))) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray, int, Any, Any, Any Output Type: np.ndarray Dependencies: ```python def v0(v1, v2, v3='trapz', v4=None, v5=0, v6='C', v7=None, v8=None, v9=None, v10=None): import numpy_groupies if 'trapz' not in numpy...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: List[Node], v2: HashFunc, v3: ColorItemTuple=(), v4: HashCache=None): if v4 is None: v4 = {} self._hash_cache = v4 self.color = v3 self.nodes = v1 self.hashfunc = v2...
Imports: ```python import requests import typing ``` Type definitions: Input Types: str, dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: dict): v3 = self.header v3['Content-type'] = 'application/json' v4 = requests.post(self.server + '/DisplayPreferences...
Imports: ```python import ast import typing ``` Type definitions: Input Types: ast.AST, Path Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: ast.AST, v2: Path) -> None: if not isinstance(v1, ast.Module): return for v3 in v1.body: if isinstance(v3, ast.ImportFro...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.db_fields = set(self.fields_db_projection.values()) self.fields = set(self.fields_map.keys()) self.fields_db_projection_reverse = {value: ke...
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: List[int]) -> int: v2 = set(v1) v3 = 0 for v4 in v2: if v4 - 1 in v2: continue v5 = v4 v6 = 1 while v5 +...
Imports: ```python import argparse import subprocess import typing ``` Type definitions: Input Types: Output Type: Tuple[str, str, bool] Dependencies: ```python def v0() -> str: v1 = f'bump2version --list --dry-run --allow-dirty {PART}' v2 = subprocess.check_output(v1.split(' '), text=True) return [line f...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F import typing ``` Type definitions: Input Types: torch.utils.data.DataLoader Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.utils.data.DataLoader): v2 = next(iter(v1)) (v3, v4) = v2['tr...
Imports: ```python import numpy as np import torch import torch.nn.functional as F from torch.utils.data import Dataset import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, Optional[torch.Tensor], int, Optional[int], Optional[int] Output Type: Any Dependencies: Function Name: v0 Function: ```p...
Imports: ```python import hashlib import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = self.as_bufr(use_cached=True) if v1 is not None: return hashlib.md5(v1).hexdigest() else: return None ```
Imports: ```python import os from pathlib import Path import tempfile import typing ``` Type definitions: Input Types: Output Type: Path Dependencies: Function Name: v0 Function: ```python def v0(self) -> Path: v1 = tempfile.gettempdir() + '/' + os.urandom(8).hex() os.mkdir(v1) self.tmpdirs.append(v1) ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = 'near' if self.synthetic else 'at' return f'{v1} {self.filename} line {self.lineno}' ```
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool) -> None: super()._make_placeholders(v1) self.placeholders['root_hole_node_id'] = tf.placeholder(tf.int32, shape=(None,),...
Imports: ```python import typing ``` Type definitions: Input Types: List[str], List[str], bool, Optional[Union[int, str]] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str], v2: List[str], v3: bool=False, v4: Optional[Union[int, str]]=None): v5 = v2.copy() if v3: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._conditional_fail('set_training_data') self._fitted = False super().set_training_data() ```