text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, str]) -> str: v2 = '<?xml version="1.0" encoding="utf-8"?> <manifest> <type>ota</type> <ota> ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0(v1: x, *v4: x, v2: x, v3: x=3, **v5: x): pass ``` Function Name: v6 Function: ```python def v6() -> None: v7 = int def v8(v9: v7, *v12: v7, v10: v7, v11: v7=3, **v13: v7): pass ...
Imports: ```python import typing ``` Type definitions: Input Types: str, Iterable Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: Iterable) -> list: v3 = set() for v4 in v2: if v1 == v4: return [v1] if v4.startswith(v1): v3.add(...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: float): if v1.as_integer_ratio()[1] == 1: self.selectedItem.minTime = int(v1) else: self.selectedItem.minTime = v1 self.canvas.update() ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: while True: self.skip_ws() (v1, v2) = (self.loc(), self.try_name()) if v2 is None: break self.colon() ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: 'np.ndarray', int, int, bool Output Type: Iterator[Any] Dependencies: Function Name: v0 Function: ```python def v0(v1: 'np.ndarray', v2: int=0, v3: int=None, v4: bool=False) -> Iterator[Any]: if v4: v1 = np.take(v1, np....
Imports: ```python import numpy as np import pandas as pd import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str='total_gain'): assert self.gbms_ is not None v2 = self.gbms_[0].feature_names for v3 in self.gbms_: ...
Imports: ```python from PIL import Image, ImageDraw, ImageFont, ImageColor import typing ``` Type definitions: ```python class v0: def __init__(self): self.colors: List[Tuple[float, Tuple[int, int, int]]] = [] def v1(self, v2, v3: Tuple[int, int, int]): self.colors.append((v2, v3)) def v4...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[int] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[int]=None) -> bool: if v1 is None: v1 = self.get_last_epoch() v2 = self[v1] if not self.params.num_epochs: v3 = ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> bool: assert v1 >= 0 while v1 & 1 != 0: v1 >>= 1 return v1 == 0 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=None) -> bool: for v2 in self.components: v2.save() super().save(filename=v1) return True ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: 'AsyncCursor' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> 'AsyncCursor': self.dispatch = self.dispatch.max_await_time_ms(v1) return self ```
Imports: ```python import typing ``` Type definitions: ```python class v0(Model): v1: str v2: str v3: str v4: str v5: str v6: str v7: str def v8(self, v9: str) -> v0: self.auth_type = v9 return self def v10(self, v11: str) -> v0: self.country = v11 r...
Imports: ```python import typing ``` Type definitions: Input Types: Union[None, str, List[str], Dict[str, str]] Output Type: Any Dependencies: ```python def v0(v1): if v1 in datasets: used_dataset_names.add(v1) return datasets[v1] (v2, v3) = _transcode_split(v1) if v2 in datasets: u...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): self._check_step_timestamp(v1) self._available_power = self.calculate_available_power(timestamp=v1) self._current_power = min(self._available_...
Imports: ```python import typing ``` Type definitions: Input Types: Tensor Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: Tensor) -> Tensor: v2 = v1 @ v1.t() v3 = v2.diagonal().view(v1.size(0), 1) return -2 * v2 + v3 + v3.t() ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=0) -> Dict: v2 = ['NextBus', 'NextBus2', 'NextBus3'] return self.payload[v2[v1]] ```
Imports: ```python import sys import typing ``` Type definitions: Input Types: Any, Any Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> list: v3 = len(v1) v4 = len(v2) v5 = len(v1[0]) v6 = len(v2[0]) if v5 != v4: print('Inner matrix size do not match...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self) -> None: self._padding_char = ' ' self._horizontal_outside_border_char = '-' self._horizontal_inside_border_char = '-' self._vertical_outside_border_char = '|' self._vertical_inside...
Imports: ```python import typing ``` Type definitions: Input Types: list[str], int, int, str, str, str, int, str, bool, int Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list[str], v2: int, v3: int, v4: str, v5: str='all_traffic', v6: str='TCP_ACCELERATED', v7: int=None, v8: s...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: np.ndarray Dependencies: ```python def v0(v1: np.ndarray, v2): return np.ma.array(v1, mask=v2.mask).filled(999999) ``` Function Name: v3 Function: ```python def v3(self, v4: np.ndarray) -> np.ndarray: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray) -> Dict[str, Any]: (v2, v3) = self.axes_bounds return {'data': np.vstack((v1[::-1, :], v1)), 'x': self....
Imports: ```python import pandas as pd from pandas import DataFrame, Series import typing ``` Type definitions: Input Types: str Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> list: v2 = pd.read_csv(self.raw_data_dir + v1, encoding='utf-8') print(v2.columns) ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[Tuple[int, int, int, int]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[Tuple[int, int, int, int]]: v1 = [(s.x, s.y, s.width, s.height) for v2 in self.conn.pseudoscreens] if not v1: v1.ap...
Imports: ```python import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F import typing ``` Type definitions: Input Types: Tensor, Tensor, Tensor, Tensor, Tensor, Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor, v2: Tensor, v3: T...
Imports: ```python from qiskit import QuantumCircuit from qiskit.circuit.library.standard_gates import RXGate, RYGate, RZGate import typing ``` Type definitions: Input Types: Any Output Type: QuantumCircuit Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> QuantumCircuit: self._check_feature...
Imports: ```python import typing ``` Type definitions: Input Types: bytes, Callable Output Type: Tuple[str, Optional[str], str] Dependencies: ```python def v0(v1: bytes) -> Tuple[dict, dict, bool]: try: v2 = JweEnvelope.from_json(v1) except ValidationError: raise ValueError('Invalid packed mess...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1 = -1 v2: RType = void_rtype v3 = False @property def v4(self) -> bool: return isinstance(self.type, RVoid) ``` Input Types: Output Type: List[v0] Dependencies: Function Name: v5 Function: ```python def v5(self) ...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: pd.DataFrame, pd.DataFrame Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: pd.DataFrame) -> pd.DataFrame: v3 = pd.merge(v2, v1, on='order_id', how='left') return v...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1 = {} for v2 in self.default_options_list: v1[v2] = getattr(self, v2) return v1 ```
Imports: ```python import torch from torch import Tensor import typing ``` Type definitions: Input Types: Tensor, Tensor Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: Tensor, v2: Tensor) -> Tensor: v3 = len(v2) v2 = v2 / v2.sum() v1 = torch.nn.functional.pad(v1, [v3 //...
Imports: ```python import typing ``` Type definitions: Input Types: object, Callable Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: object, v2: Callable): if not hasattr(v2, self.DECORATORS_ATTR): setattr(v2, self.DECORATORS_ATTR, []) self._get_decorators(v2).app...
Imports: ```python import typing ``` Type definitions: Input Types: model.ValueList, model.ValueList Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: model.ValueList, v2: model.ValueList): for v3 in v2: v4 = self._find_element_by_attribute(v3, v1, 'value', 'value_id', ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: int): v2 = {20: 'success', 30: 'mismatch word', 40: 'expired', 50: 'invalid token'} return v2[v1] ```
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> str: (v3, v4, v5) = (len(v1) - 1, len(v2) - 1, 0) v6 = [] while v3 >= 0 and v4 >= 0: v7 = v5 + int(v1[v3]) + int(v2[v4...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.waiting_deque.popleft() v2 = self.pending_transactions[v1] v3 = v2.get_connection() if v3 is None: self._remove_pending_tx(...
Imports: ```python from pandas.core.construction import extract_array from pandas.core.reshape.merge import _MergeOperation from pandas.api.types import is_datetime64_dtype, is_integer_dtype, is_float_dtype, is_string_dtype, is_extension_array_dtype, is_categorical_dtype import pandas as pd import numpy as np import ty...
Imports: ```python from sqlite3 import Cursor import sqlite3 import typing ``` Type definitions: Input Types: Output Type: Cursor Dependencies: Function Name: v0 Function: ```python def v0(self) -> Cursor: v1 = sqlite3.connect(str(self.db_file), isolation_level=None) return v1.cursor() ```
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame): for (v2, v3) in v1.iteritems(): print('{name}: "{value}"'.format(name=v2, value=v3[0])) print('=+=============================...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: dict): v1['x'].clear() v1['y'].clear() v1['width'].clear() v1['height'].clear() ```
Imports: ```python import typing ``` Type definitions: Input Types: Union[str, Path], Union[str, Path], Union[str, Path], int, int, int, int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[str, Path], v2: Union[str, Path], v3: Union[str, Path], *, v4: int=0, v5: int=0, v6: i...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F import typing ``` Type definitions: Input Types: nn.Module, torch.Tensor, torch.Tensor, torch.Tensor Output Type: Tuple[torch.Tensor, torch.Tensor] Dependencies: ```python def v0(v1: torch.Tensor): (v2, v3, v4, v5) = v1.shape ...
Imports: ```python import functools import gc import warnings import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0() -> None: with warnings.catch_warnings(record=True): gc.collect() v1 = [a for v2 in gc.get_objects() if isin...
Imports: ```python import os from pathlib import Path import typing ``` Type definitions: Input Types: Output Type: set() Dependencies: Function Name: v0 Function: ```python def v0() -> set(): v1 = list(Path('./scowl-2019.10.06/').rglob('*')) v2 = [_ for v3 in v1 if os.path.isfile(v3)] v4 = 0 v5 = se...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: psycopg.Cursor[v0], str, Sequence[Sequence[Any]], int, str, Any, bool Output Type: list[v0] | None Dependencies: Function Name: v1 Function: ```python def v1(v2: psycopg.Cursor[v0], v3: str, v4: Sequence[Sequence[Any]],...
Imports: ```python import typing ``` Type definitions: Input Types: et._Element, str Output Type: Any Dependencies: ```python def v0(v1: et._Element): if not v1.text and v1.getchildren(): if v1.getchildren()[0].text: return v1.getchildren()[0].text elif v1.text and (not v1.getchildren()): ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, **v2: Any) -> Dict[str, Any]: v3 = self.get_url('circuit') v4 = {'name': v1, 'params': v2} return self.session.post(v3, json=v4).jso...
Imports: ```python import os import typing ``` Type definitions: Input Types: pathlib.Path Output Type: None Dependencies: ```python def v0(v1: Path): raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), str(v1)) ``` Function Name: v2 Function: ```python def v2(v3: pathlib.Path) -> None: if not v3....
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self) -> list: v1 = self[:] v2 = len(v1) v3 = [0] * v2 for v4 in range(1, v2): for v5 in range(v4): if v1[v5] > v1[v4]: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: List[Dict[str, np.ndarray]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray) -> List[Dict[str, np.ndarray]]: v2 = self.hp_ranges_for_prediction() v3 = [v2.from_ndarray...
Imports: ```python import itertools import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: for v1 in itertools.product(range(self.n_rows * 2 - 1), range(self.n_columns * 2 - 1)): if not v1[0] % 2 and (not v1[1] % 2): ...
Imports: ```python import os import typing ``` Type definitions: Input Types: Output Type: str Dependencies: ```python def v0() -> str: return os.path.abspath(os.path.join(HOME_PATH, 'stnm.conf')) ``` Function Name: v1 Function: ```python def v1() -> str: with open(v0(), 'r') as v2: v3 = v2.read() ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Iterator[int] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> Iterator[int]: for v2 in v1.split(':'): yield int(v2, 16) ```
Imports: ```python import subprocess import typing ``` Type definitions: Input Types: Optional[str], list, Optional[bytes], Optional[dict] Output Type: Tuple[int, bytes, bytes] Dependencies: ```python def v0(v1: list, v2: bytes=None, v3: Optional[dict]=None) -> Tuple[int, bytes, bytes]: v4 = subprocess.Popen(v1, s...
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 = list(v1) if v3[v2] == '0': v3[v2] = '9' else: v3[v2] = str(int(v3[v2]) - 1) v4 = ''.join(v3) ...
Imports: ```python import json import typing ``` Type definitions: Input Types: Any, str, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Any, v2: str, v3: str, v4: str): with open(f'{v3}/{v4}/{v2}.json', 'w') as v5: json.dump(v1, v5, ensure_ascii=False, indent=' ...
Imports: ```python import sys import typing ``` Type definitions: Input Types: Optional[Tuple[str]] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: Optional[Tuple[str]]=None) -> str: if v1 is None: v1 = sys.version_info return f'{v1[0]}.{v1[1]}' ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.exc: raise self.exc[0].with_traceback(self.exc[1]) ```
Imports: ```python import typing ``` Type definitions: Input Types: bool, float, bool Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool, v2: float, v3: bool) -> bool: if v1 and v3: return True elif v1 != v3: return 0 < v2 < self.config.getfloat('RA.Sub...
Imports: ```python import cv2 import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray, v2: np.ndarray) -> np.ndarray: if np.count_nonzero(v1) != 0: v1 = self._norm_min...
Imports: ```python import math import typing ``` Type definitions: Input Types: float, float, float Output Type: 'Spherical' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float, v3: float) -> 'Spherical': self.radius = math.sqrt(v1 ** 2 + v2 ** 2 + v3 ** 2) if self.radius == ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self._hide_button.label == '+': self._hide_button.label = 'βˆ’' self.widget.children[1] = self._expanded_widget else: self._...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame, float Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: float) -> pd.DataFrame: v3 = v1.corr() v4 = v3[((v3 >= v2) | (v3 <= -v2)) & (v3 != 1.0)] return v4 ```
Imports: ```python from collections import OrderedDict import collections import typing ``` Type definitions: Input Types: NamedTuple, torch.Tensor, torch.Tensor, List[int] Output Type: NamedTuple Dependencies: ```python def v0(v1: torch.Tensor) -> List[float]: return v1.detach().cpu().tolist() ``` Function Name: ...
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v1 = re.sub('<\\s*[/]*\\s*\\s*for[ei][ei]g[nh]\\s*\\w*>', '', v1) v2 = re.findall('<lname>\\([^<]*\\)<\\/lname>', v1) if len(v2) > 0: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[str]: v1 = [] if self.name == 'Vilros': for v2 in self.models: v1.append(self.urls[0].replace('REPLACE_ME', str(v2))) ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: if '&' not in v1 and '<' not in v1: return v1 return v1.replace('&', '&amp;').replace('<', '&lt;') ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: Tuple[str, List[Any]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2) -> Tuple[str, List[Any]]: (v3, v4) = super().as_sql(v1, v2) v5 = v1.quote_name_unless_alias v6 = ' AND '.join(['{}.{} = %...
Imports: ```python import sys from pathlib import Path import json import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: ```python def v0() -> Path: v1 = Path.home() / '.amptoolstools' if v1.exists(): with open(v1, 'r') as v2: v3 = json.load(v2) v4 = v3['...
Imports: ```python import json import os import shutil import typing ``` Type definitions: Input Types: dict, str Output Type: None Dependencies: ```python def v0(v1: dict, v2: str) -> None: with open(v2, 'w') as v3: v4 = {'data': {}, 'major_revisions': []} for v5 in v1: v6 = v1[v5] ...
Imports: ```python import os import csv import typing ``` Type definitions: Input Types: str Output Type: List[Dict] Dependencies: ```python def v0(v1): for v2 in v1: for (v3, v4) in v2.items(): if v4 == 'False': v2[v3] = False if v4 == 'True': v2[v3]...
Imports: ```python from datetime import datetime, timedelta, date, time import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> int: v2 = datetime.strptime(v1, '%M:%S') return v2.second + v2.minute * 60 + v2.hour * 3600...
Imports: ```python import sys 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 = (v1, v2) v4 = hash(v3) + sys.maxsize + 1 self._hash_map[v4] = v3 return v4 ```
Imports: ```python import copy import typing ``` Type definitions: Input Types: List[ast.AST], str, int, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[ast.AST], v2: str, v3: int, v4=True, v5=None): v6 = self.last_state self.last_state = None v7 = self....
Imports: ```python from pandas._config import get_option from pandas._libs import lib, properties, reshape, tslibs from pandas._libs.lib import no_default from pandas._typing import AggFuncType, ArrayLike, Axis, Dtype, DtypeObj, FrameOrSeriesUnion, IndexKeyFunc, NpDtype, SingleManager, StorageOptions, ValueKeyFunc from...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: v2 = os.path.join(self.build_dir.tools, '{}-{}'.format(self.key, self.target)) v3 = os.path.join(v2, v1) if os.path.exists(v3...
Imports: ```python import torch import torch.nn as nn import torch.nn.utils import torch.nn.functional as F from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence import typing ``` Type definitions: Input Types: List[List[str]], List[List[str]] Output Type: torch.Tensor Dependencies: Function Name: ...
Imports: ```python from requests import Response, codes import typing ``` Type definitions: Input Types: list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list): self._require_auth() self.http_patch(self._url_for('/v1/api/namespaces'), json=v1, expected_status_codes=(c...
Imports: ```python from os import path import json import typing ``` Type definitions: Input Types: str Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> dict: v2 = open(v1, encoding='utf-8') return json.load(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: 'Dict[str, float]' Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: 'Dict[str, float]') -> float: if v1: v2 = sum(v1.values()) / len(v1) else: v2 = 1 return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if type(self.parameter_expressions) == list: self.__unpack_parameter_expression_list() else: self.__request_api_and_emit(self.paramet...
Imports: ```python import numpy as np import torch import torch.nn as nn import typing ``` Type definitions: Input Types: Any, Any Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2) -> float: if type(v1) is np.ndarray: v1 = torch.from_numpy(v1).to(self.device) ...
Imports: ```python import typing ``` Type definitions: Input Types: Simplygon.spObject, float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Simplygon.spObject, v2: float): print('Progress: %f' % v2) return True ```
Imports: ```python import re import typing ``` Type definitions: Input Types: str, int Output Type: Tuple[List[Dict], bool, bool] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int) -> Tuple[List[Dict], bool, bool]: v3 = True v4 = self.buildURL(v1, v2) v5 = self.session.get(...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = 0 while not self.inbox.empty() and v1 < self.max_reactions: v1 += 1 v2 = self.inbox.get_nowait() if v2 is not None: ...
Imports: ```python import pandas as pd import numpy as np import typing ``` Type definitions: Input Types: Any, Any Output Type: np.array Dependencies: Function Name: v0 Function: ```python def v0(v1, v2=None) -> np.array: v3 = pd.read_csv(v1, nrows=v2) v4 = np.array(v3, dtype=np.float32) return (v4[:, 0]...
Imports: ```python import csv import typing ``` Type definitions: Input Types: TextIO Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: TextIO): v2 = list(csv.reader(v1)) v3 = next((i for (v4, v5) in enumerate(v2) if v5[0] == '[Data]')) v6 = list(map(str.lower, v2[v3 + 1])) ...
Imports: ```python import sys from pathlib import Path import typing ``` Type definitions: Input Types: pytest.CaptureFixture[str], str Output Type: None Dependencies: ```python def v0(v1: str, v2: ColumnSettings) -> None: v3 = v1.replace('=', '').split('\n\n') v4 = v3[0].strip() v5 = v4.find(HEADER_TITLES...
Imports: ```python import typing ``` Type definitions: Input Types: Iterable Output Type: Tuple[Any, Any] Dependencies: Function Name: v0 Function: ```python def v0(v1: Iterable) -> Tuple[Any, Any]: if not isinstance(v1, (str, list, tuple)): v1 = list(v1) if len(v1) == 0: return (None, None) ...
Imports: ```python import os, json from scipy.io import loadmat import typing ``` Type definitions: Input Types: Union[int, str], str, bool Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[int, str], v2: str='mV', v3: bool=True) -> np.ndarray: v4 = os.path.join(se...
Imports: ```python import asyncio import typing ``` Type definitions: Input Types: bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=True) -> None: self.print_to_console = v1 self.loop.run_until_complete(self._connect(pipeline_start=False)) asyncio.ensure_fut...
Imports: ```python import typing ``` Type definitions: Input Types: List[List[str]] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: List[List[str]]) -> int: v2 = 0 v3 = [[0 for v4 in range(len(v1[0]))] for v4 in range(len(v1))] for (v5, v6) in enumerate(v1): for (v7...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: list, Any Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list, v2=False) -> np.ndarray: if type(v1) is str or type(v1) is np.str_: v1 = [c for v3 in v1] if v2: r...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Tuple[dict, dict] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> Tuple[dict, dict]: v1 = v1 or {} v2 = {} v3 = {} for (v4, v5) in v1.items(): if v5 is None: raise Va...
Imports: ```python import numpy from PIL import Image, ImageChops, ImageDraw, ImageOps import typing ``` Type definitions: Input Types: Any, list, list, int Output Type: Any Dependencies: ```python def v0(v1, v2): v3 = [] for (v4, v5) in zip(v1, v2): v3.append([v5[0], v5[1], 1, 0, 0, 0, -v4[0] * v5[0],...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: if self.video_player.max > self.video_player.value: self.video_player.value += 1 ```
Imports: ```python import typing ``` Type definitions: Input Types: tf.Tensor, int, str Output Type: tf.Tensor Dependencies: ```python def v0(v1: tf.Tensor, v2: int, v3: str) -> tf.Tensor: v4 = conv_block(v1, filters=64, name=f'{v3}_1') v4 = conv_block(v4, filters=128, name=f'{v3}_2') v4 = conv_block(v4, f...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Optional[str]: if not self._generated_csv: return None self._scp_filename('results_summary.csv') return 'results_summary.csv' ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: List[List[int]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> List[List[int]]: v2 = [[1] * (i + 1) for v3 in range(v1)] for v4 in range(v1 - 1): for v5 in range(v4): v2[v4 + ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(self) -> bytes: v1 = f'"NAK"0000L0R0A0[]{self._get_timestamp()}' return self._frame_response(v1, self.is_binary_crc) ```