text
stringlengths
190
325k
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> bool: v2 = re.match('^[\\u30A0-\\u30FF]*$', v1) return v2 is True ```
Imports: ```python import typing ``` Type definitions: Input Types: str, str, sqlalchemy.engine.Engine Output Type: Optional[sqlalchemy.Table] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str='public', v3: sqlalchemy.engine.Engine=None) -> Optional[sqlalchemy.Table]: self.log.info...
Imports: ```python import typing ``` Type definitions: Input Types: bytes Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes): self.bus.write_byte_data(self.sensor, self.ACCESS_CONFIG, v1) self.wait_NVM() return ```
Imports: ```python import torch from torch.testing._internal.jit_utils import JitTestCase, make_global import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor: ...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: Type[v0], Any, Any Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(self, v2: Type[v0], v3=None, v4=None) -> v0: if v3 is not None: v4 = self.element_factory.create(v3) v5: v0 =...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str='', v3: bool=False) -> None: v4 = {'datasetName': v1, 'alias': v2, 'isPublic': v3} self._client.open_api_do('POST', f'searchRes...
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: int Output Type: tf.keras.Model Dependencies: Function Name: v0 Function: ```python def v0(v1: int=7) -> tf.keras.Model: v2 = getattr(tf.keras.applications.efficientnet, f'EfficientNetB{v1}') v3 = v2(include_top=False,...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Tuple[str, Sequence[int]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Tuple[str, Sequence[int]]: assert self._bip32_xpub is not None and self._derivation_path is not None return (self._bip32_xpub, self._d...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: dict) -> None: v2 = 'An unexpected error occurred' v3 = 'You can report this issue together with the traceback below on GitHub. Please restart M...
Imports: ```python import os import webbrowser import typing ``` Type definitions: Input Types: str, str, int, str, list Output Type: None Dependencies: ```python def v0(v1: str='', v2: str='pyproject.toml', v3: list=None, v4: str='site') -> dict: v5: Dict[str, Union[str, list]] = {} if v3: v5['modules...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: 'VideoReader' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float) -> 'VideoReader': self._c.seek(v1) return self ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.set_high_score() self.__init__() ```
Imports: ```python import typing ``` Type definitions: Input Types: pyramid.request.Request, pyramid.response.Response Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: pyramid.request.Request, v2: pyramid.response.Response=None) -> None: if v2 is None: v2 = v1.response ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: v1 = self.tail.prev.key self.tail.prev.prev.next = self.tail self.tail.prev = self.tail.prev.prev return v1 ```
Imports: ```python from nltk.corpus import stopwords import nltk import typing ``` Type definitions: Input Types: pd.Series, str Output Type: pd.Series Dependencies: ```python def v0(v1: str, v2: str): v3 = set(' '.join(v2.split('\n'))) v1 = ' '.join([word for v4 in v1.split() if v4 not in v3]) return v1 `...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3: int=256): v4 = 0 v5 = None v6 = [0] for v7 in v2: if v5 is not None: v4 = v4 + np.linalg.norm...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, Any, Any, Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4=0.5) -> bool: (v5, v6) = (v3[:, 0], v3[:, 1]) v7 = v1.GetConformer(0).GetPositions() v8 = v2.GetConformer(0)...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str]) -> None: v1 = [channel.lstrip('#') for v2 in v1] [self.channels.remove(v2) for v2 in v1] self.send_raw('PART #' + '#'.join(v1)) ``...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): v2 = 0 v3 = 0 v4 = np.array([]) for v5 in range(self.x_max - self.x_min + 1): v3 += self.line_set[self.current_...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Tuple[str, Optional[str], Optional[str]] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> Tuple[str, Optional[str], Optional[str]]: v2 = v1.find('@') if v2 == -1: v3 = v1 v4 = None el...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> np.ndarray: v2 = self.dataset.scenes assert v1 < len(v2), f'scene_idx {v1} is over len {len(v2)}' v3 = self.datase...
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray, bool, float, float Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: bool=False, v3: float=1.0, v4: float=0.0) -> np.ndarray: if not v2: return v1 * 1000.0 else: ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> int: if len(v1) < 2: return len(v1) v2 = 0 v3 = [] v4 = 0 for (v5, v6) in enumerate(v1): if v6 not in v3: ...
Imports: ```python import sqlite3 import typing ``` Type definitions: ```python v0 = Dict[str, int] ``` Input Types: sqlite3.Cursor, str, str, v0 Output Type: Any Dependencies: ```python def v1(v2: v0) -> str: v3 = [] for v4 in v2.items(): v3.append('%s(%s)' % v4) return _format_keywords(v3) ``` ```...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if not self._data_queue.empty(): v1 = self._data_queue.get_nowait() if self._validator.validate(v1): self._notify_primitive_e...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: Tuple[np.ndarray, np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor, v2: torch.Tensor) -> Tuple[np.ndarray, np.ndarray]: v3 = np.zeros(len(v2))...
Imports: ```python import typing ``` Type definitions: Input Types: List[List[int]] Output Type: List[Tuple[int, ...]] Dependencies: ```python def v0(v1: List[int], v2: List[int]) -> List[int]: v1[1] = v2[1] return v1 ``` ```python def v3(v4: List[int], v5: List[int]) -> bool: return v5[0] >= v4[1] ``` Fun...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, *v1: Any) -> None: for v2 in v1: del self._change_callbacks[v2] ```
Imports: ```python import numpy as np import pandas as pd import typing ``` Type definitions: Input Types: pd.DataFrame, int Output Type: pd.Series Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.DataFrame, v2: int) -> pd.Series: if self._is_root(): v3 = pd.Series(np.zeros(v2, dtyp...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: list Dependencies: ```python def v0(v1: dict) -> str: validate_task(v1) return jinja2.Template(TEMPLATE_PATHS['task'].read_text()).render(**v1, namespaced_operator=AIRFLOW_IMPORTS[AIRFLOW_VERSION][v1['operator']]['class']) ``...
Imports: ```python import pandas as pd from pandas import DataFrame import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str='country'): if not self._baseline_built and self._experiment_defined: raise ValueError('Model m...
Imports: ```python import typing ``` Type definitions: ```python v0 = List[Dict[str, Any]] ``` Input Types: Dict[int, v0], bool Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(self, v2: Dict[int, v0], v3: bool=True) -> v0: v4 = [] if len(v2) == 1: for v5 in v2[0]: ...
Imports: ```python import datetime import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0() -> FrozenTrial: return FrozenTrial(number=0, trial_id=0, state=TrialState.COMPLETE, value=0.2, datetime_start=datetime.datetime.now(), datetime_complete=datetime.datetime.now(), p...
Imports: ```python from selenium.common.exceptions import MoveTargetOutOfBoundsException, NoSuchElementException, TimeoutException from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.remote.w...
Imports: ```python from math import cos, radians, sin, exp from warnings import warn import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self) -> float: if self.d == 0: warn('d has not been computed, I do it...') self.comp...
Imports: ```python import typing ``` Type definitions: ```python v0 = Dict[Module, Dependencies] ``` ```python v1 = NewType('Module', str) ``` Input Types: v0 Output Type: Iterator[v1] Dependencies: Function Name: v2 Function: ```python def v2(v3: v0) -> Iterator[v1]: for (v4, v5) in v3.items(): yield v4 ...
Imports: ```python import typing ``` Type definitions: Input Types: str, [str], Any, Any, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: [str], v3=False, v4=1, v5=True, v6='PNG_MASKS'): v7 = {} v7 = self.setEvalLabelMapPath2EvalDict(evalDict=v7, path=v1...
Imports: ```python from urllib.parse import quote_plus import typing ``` Type definitions: Input Types: str, str, bool Output Type: Iterator[bytes] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str=None, v3: bool=None) -> Iterator[bytes]: v4 = {'contentId': v2, 'includeDeleted': v3...
Imports: ```python import re import typing ``` Type definitions: Input Types: io.FileIO Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: io.FileIO): v2 = v1.read().lower() v2 = re.sub('[^a-zA-Z0-9]', ' ', v2) v2 = re.sub('\\t', ' ', v2) v2 = re.sub('\\n', ' ', v2) v2...
Imports: ```python import os import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1, v2=False, v3=False) -> dict: v4 = {} v4['img_path'] = os.path.join('image_2', '{}.png'.format(v1)) v4['img_prev_path'] = None if ...
Imports: ```python from scipy.sparse import csr_matrix from scipy.sparse.csgraph import maximum_flow import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0() -> None: (v1, v2, v3) = map(int, input().split()) (v4, v5, v6) = ([], [], []) ...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: 'DistrictsCollection' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str]) -> 'DistrictsCollection': if v1 is None: return self self.regions = {key: value for (v2, v3) in self.regions....
Imports: ```python from collections import defaultdict import typing ``` Type definitions: Input Types: list[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list[str]) -> None: self.energy_levels: ENERGY_LEVEL_TYPE = defaultdict(int) for (v2, v3) in enumerate(v1): ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3: str, v4: str, v5: str): v6 = [] if v1 == 'SIM': v6.append('Fever') if v2 == 'SIM': v6.append('Cough'...
Imports: ```python import typing ``` Type definitions: Input Types: str, Callable Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Callable): if v1 == 'opcode': if not self.injected_functions['opcode']: self.orig_trace_opcodes = self.frame.f_trace_...
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=-1) -> 'np.ndarray': v3 = np.max(v1, axis=v2, keepdims=True) v4 = np.exp(v1 - v3) v5 = np....
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float): self.time += v1 self.cs['time'] = self.time * 10 ```
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 not in self._server_mods: self._server_mods.append(v1) ```
Imports: ```python import torch import torch.nn as nn from torch.nn import functional as F import typing ``` Type definitions: ```python v0 = TypeVar('State') ``` Input Types: torch.Tensor, Optional[torch.LongTensor], Optional[v0], bool Output Type: Tuple[torch.Tensor, torch.LongTensor] Dependencies: Function Name: v1...
Imports: ```python import typing ``` Type definitions: ```python class v0(namedtuple('_Coach', ['id', 'name', 'bio', 'available', 'birth_year', 'gender', 'languages', 'need', 'rights', 'housing'])): def v1(cls, *, v2: Optional[int]=None, v3: str, v4: str, v5: bool=True, v6: int, v7: str, v8: Dict[str, int], v9: Co...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, ailment.Block, int, ailment.Stmt.Return Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, v3: ailment.Block, v4: int, v5: ailment.Stmt.Return): if v5.ret_exprs: for v6 in v5.ret_exprs: ...
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._output_style == 'panel': self._write_text_to_panel(v1) return elif self._output_style == 'inline': retur...
Imports: ```python import typing ``` Type definitions: ```python class v0(object): def __init__(self, v1): self.val = v1 self.left = None self.right = None def __repr__(self): return f'<{self.val}, {self.left}, {self.right}>' ``` Input Types: v0, v0, v0 Output Type: Any Depende...
Imports: ```python import numpy as onp import typing ``` Type definitions: Input Types: Dict[str, Any], int, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, Any], v2: int, v3: bool=False): if v3: return {dim: onp.array(v2) for (v4, v5) in v1.items()} else...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: list Dependencies: ```python def v0(v1: dict) -> list: if 'ec-code' in v1['miriam'] and len(v1['miriam']['ec-code']): return v1['miriam']['ec-code'] else: return [] ``` Function Name: v2 Function: ```python de...
Imports: ```python import typing ``` Type definitions: Input Types: Callable, float, np.array Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Callable, v2: float, v3: np.array): v4 = v1(v3) * v2 v5 = v1(v3 + 0.5 * v4) * v2 v6 = v1(v3 + 0.5 * v5) * v2 v7 = v1(v3 + v6) * ...
Imports: ```python from collections import deque import typing ``` Type definitions: Input Types: List[int], int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: int) -> None: v2 %= len(v1) if v2 == 0: return v1 v3 = deque([]) v4 = [v3.appen...
Imports: ```python import numpy as np import matplotlib import matplotlib.pyplot as plt import typing ``` Type definitions: ```python class v0(NamedTuple): v1: str v2: datetime.datetime v3: datetime.datetime v4: List[Job] @classmethod def v5(cls, v6: dict) -> 'Metrics': v7 = FieldValida...
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[-1:] == '?': return v1 + 'dl=1' if not v1[-5:] in ['?dl=1', '?dl=0']: return v1 + '?dl=1' if v1[-5:] == '?dl=0': ...
Imports: ```python import argparse import multiprocessing import os import typing ``` Type definitions: ```python class v0: v1 = 0 v2: T.Dict[TestProtocol, T.Type['TestRun']] = {} def v3(cls, v4: TestSerialisation, *v5: T.Any, **v6: T.Any) -> T.Any: return super().__new__(v0.PROTOCOL_TO_CLASS[v4.pr...
Imports: ```python from tensorflow.core.framework import attr_value_pb2 from tensorflow.core.protobuf.tpu import tpu_embedding_configuration_pb2 from tensorflow.python.distribute import device_util from tensorflow.python.distribute import distribute_utils from tensorflow.python.distribute import distribution_strategy_c...
Imports: ```python import typing ``` Type definitions: Input Types: List['Git2Type'] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: List['Git2Type']) -> str: v2 = [p.c_wrapper_param for v3 in v1] return ', '.join([x for v4 in v2 if v4]) ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): v2 = 3 if v1['entry']: v3 = v1['entry']['accession'] if v3 in self.ancestors: v2 = 0 elif v3 == self.entry: ...
Imports: ```python import typing ``` Type definitions: Input Types: int, Any, int, int, Any, Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2, v3: int, v4: int, v5, v6) -> None: for v7 in range(v3): v8 = 0 for v8 in range(v1): v2[v8] +=...
Imports: ```python import typing ``` Type definitions: Input Types: str, 'variable.Variable' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: 'variable.Variable'): if v1 in self.inputs: raise KeyError(f'{v1} is already used as key of input variable f{self.inpu...
Imports: ```python import warnings import numpy as np from scipy.linalg import eigh from scipy.spatial.distance import pdist from scipy.cluster.hierarchy import linkage, cut_tree import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray, np.ndarray, np.ndarray, int, float, float, float, Any Output Type: ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str): if v1 in self.source_list: await self._speaker.set_source(v1) else: raise ValueError(f'Unknown input source: {v1}.') ```
Imports: ```python import logging import typing ``` Type definitions: Input Types: str, Optional[str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Optional[str]=None) -> str: v3 = '' if v2: v3 = f" (CWD='{v2}')" logging.info('Running command%s:\n ...
Imports: ```python import ast import typing ``` Type definitions: ```python v0 = Dict[str, Union[List[str], Dict[str, Union[int, List[str]]]]] ``` Input Types: ast.ClassDef, str Output Type: v0 Dependencies: ```python def v1(v2: ast.FunctionDef, v3: str, v4: bool=False) -> List[str]: v5 = [] if not v4: ...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: int, List[str] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: List[str]=None): with self.format(v2): return pd.DataFrame(self[:v1]) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.g_loss.reset_states() self.d_loss.reset_states() self.w_loss.reset_states() ```
Imports: ```python import inspect import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python async def v0(self) -> bool: try: if isinstance(self.gen, list): self.item_cache.append(self.gen.pop(0)) elif inspect.isasyncgen(self...
Imports: ```python import difflib import itertools import typing ``` Type definitions: Input Types: Iterable[Any], Iterable[Any] Output Type: Iterator[Any] Dependencies: ```python def v0(v1: Iterable[Any], v2: Iterable[Any]) -> Iterator[Any]: v3 = list(v1) v4 = list(v2) v5 = (v3[block.a:block.a + block.siz...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: bool=False, **v2): yield ('Rebuilding Database...', True) with self.minecraft.db() as v3: if v1: await self.minecraft.rebuild...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> dict: v2 = {} for (v3, v4) in v1.items(): if v3 in self.space.real_names: v2[v3] = np.random.choice(se...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[np.ndarray], Optional[np.ndarray], Optional[np.ndarray], Optional[np.ndarray], Optional[np.ndarray] Output Type: Dict[str, float] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[np.ndarray]=None, v2: Optional[np...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1=False) -> int: v2 = next(iter(self.data.rv_dict.values())).shape[-1] if v1: return v2 return v2 - self.num_adaptive_samples ```
Imports: ```python import typing ``` Type definitions: Input Types: Optional[int] Output Type: Awaitable Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[int]=None) -> Awaitable: v2: List[EncodableT] = ['SLOWLOG GET'] if v1 is not None: v2.append(v1) v3 = self.connecti...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._write_centered_text((self.kBoard_size_px, 0), 'Black Pieces to Play', (self.unplayed_area_surface_rect.width, 50)) self._write_centered_text((s...
Imports: ```python import math import typing ``` Type definitions: Input Types: int, int, int Output Type: Tuple[List[List[int]], List[List[int]]] Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int, v3: int) -> Tuple[List[List[int]], List[List[int]]]: v4: int = math.ceil(v1 / v2) v5: ...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('V', bound=Comparable) ``` Input Types: v0 Output Type: None Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0) -> None: if v2 in self._graph: raise KeyError(f'Node already exists: {v2}') self._graph[v2]...
Imports: ```python from typing import Any, Dict, Generic, Iterator, List, Optional, Type, cast import typing ``` Type definitions: Input Types: Dict[str, Any] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, Any]) -> Any: if set(v1.keys()) == {'_type_', '_data_'}: ...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: int) -> None: self.red.set(v1) self.green.set(v2) self.blue.set(v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, v3=2 * days(2)) -> str: v4 = self.getSett(v1) return self.queue_upgrade(v4.address, v2.address) ```
Imports: ```python import io import logging import os import numpy as np import pickle import typing ``` Type definitions: Input Types: str, str, str, int, int, str, str Output Type: Any Dependencies: ```python def v0(v1: str, v2: str): v3 = os.path.join(v2, f'params_{v1}.npz') with open(v3, 'rb') as v4: ...
Imports: ```python import logging from pathlib import Path import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): Path('logs/').mkdir(parents=True, exist_ok=True) v2 = logging.getLogger(v1) v2.setLevel(logging.DEBUG) v...
Imports: ```python import json import typing ``` Type definitions: Input Types: bytes, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes, v2: str, v3: str): self.validate_id(v2) self.validate_owner(v2, v3) v4 = self.make_meta(v1, v2, v3) v5 = json.dum...
Imports: ```python import torch import typing ``` Type definitions: Input Types: np.ndarray Output Type: torch.Tensor Dependencies: ```python def v0(): v1 = torch.cuda.device_count() v2 = 'cuda' if v1 > 0 else 'cpu' return torch.device(v2) ``` Function Name: v3 Function: ```python def v3(v4: np.ndarray) ->...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, DefaultDict, List, DefaultDict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int, v3: DefaultDict, v4: List, v5: DefaultDict): v6 = ['0' for v7 in range(v2)] v8 = v1 + 1 while v4: ...
Imports: ```python import typing ``` Type definitions: Input Types: 'LWPolyline' Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'LWPolyline') -> None: self.add_source_code_lines(self.generic_api_call('LWPOLYLINE', v1.dxfattribs())) self.add_list_source_code(v1.get_point...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict[str, Any]: v1 = super().get_config() v1['seq_length'] = self.seq_length v1['start_of_sequence_id'] = self.start_of_sequence_id v1['e...
Imports: ```python import typing ``` Type definitions: Input Types: typing.List[str], Any Output Type: typing.List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: typing.List[str], v2=0) -> typing.List[str]: v3 = v2 v4 = [] for v5 in v1: if v5.endswith('{'): v4.appe...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0(v1: str) -> Body: if v1 not in BODIES: BODIES[v1] = Body(v1) return BODIES[v1] ``` ```python def v2(v3: List[str]) -> None: for v4 in v3: (v5, v6) = v4.split(')') v5...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame, List[Text] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: List[Text]) -> None: v3 = list(set(v2) - set(v1.columns)) if v3: raise ValueError('Missing required columns: {...
Imports: ```python import typing ``` Type definitions: Input Types: bytes, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes, v2: int) -> int: v3 = self.op2 if v3.table_code == 2: v4 = {b'BOPG1': '', b'OPG1': '', b'OPG2': '', b'OPGV1': '', b'OCRPG': '', b'...
Imports: ```python import math import torch from torch import Tensor import typing ``` Type definitions: Input Types: Tensor, Tensor, int, int, int, float, int, float, Optional[int], bool Output Type: Tensor Dependencies: ```python def v0(v1: Tensor, v2: float=1.0) -> Tensor: return v1.pow(2.0).sum(-1).pow(0.5 * v...
Imports: ```python import typing ``` Type definitions: Input Types: typing.Dict[str, float] Output Type: typing.Union[str, float, int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: typing.Dict[str, float]) -> typing.Union[str, float, int]: if self.transformer is None: return self.va...
Imports: ```python import cv2 import numpy as np import typing ``` Type definitions: ```python class v0(BoundBox): v1: int v2: int v3: int v4: int v5: int v6: int v7: str v8: int v9: int v10 = None v11: [int, int] v12 = 4 v13 = 0 def __init__(self, v14: BoundBox,...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: 'BasePlugin' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> 'BasePlugin': self.config.set_key('use_' + v1, True, True) v2 = self.get(v1) if v2: return v2 return self.load_plugin(v...
Imports: ```python import re import typing ``` Type definitions: Input Types: str, Optional[int] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Optional[int]=None): v3 = ['uninstall', v1] v4 = self.execute(v3, timeout=v2) v5 = re.search('Failure \\[.+?\\]', ...