text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: tuple[float, float] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: tuple[float, float]) -> bool: if v1[0] < self.x: return False if v1[1] < self.y: return False if v1[0] > self.x + s...
Imports: ```python from datetime import datetime, date, timedelta, timezone import typing ``` Type definitions: Input Types: str, Any Output Type: Tuple[datetime, datetime] Dependencies: ```python def v0(v1: str, v2=False, **v3) -> Optional[datetime]: v4 = DATEPARSER_SETTINGS.copy() v4.update(v3) if not v2...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> None: for (v2, v3) in v1.items(): if not hasattr(self, v2): raise AttributeError(f'Not a valid config field: {v2}') s...
Imports: ```python import typing ``` Type definitions: Input Types: List[str], List[str], np.array Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str], v2: List[str], v3: np.array) -> None: for (v4, v5) in enumerate(v2): for (v6, v7) in enumerate(v1): v3[...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: ```python def v0(v1: str) -> str: v2 = Colors.ip if ps.privatesuffix(v1): v2 = Colors.host return f'{v2}{v1}{Colors.reset}' ``` ```python def v3(v4: str) -> str: v5 = Colors.info return f...
Imports: ```python import typing ``` Type definitions: Input Types: linear_algebra.x_axis_two_angles, linear_algebra.ParamResolver Output Type: Tuple[float, float, float] Dependencies: Function Name: v0 Function: ```python def v0(v1: linear_algebra.x_axis_two_angles, v2: linear_algebra.ParamResolver) -> Tuple[float, ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> bool: if not v1: return True v2 = 0 v3 = len(v1) - 1 while v2 < v3: while v2 < v3 and v1[v2].isalnum() is False: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.device_system_context.device_model = 123 self._assert_validation_error(self.device_system_context, 'Android device model must be an string') ```
Imports: ```python import typing ``` Type definitions: Input Types: Iterable[str], Optional[str] Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Iterable[str], v2: Optional[str]=None) -> List[str]: v3 = [] v4 = set(map(self.__get_label_key_value, v1)) for (v5, v...
Imports: ```python import json import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: str): assert v2 in ['stdout', 'file'], 'Stream not supported' if v2 == 'stdout' and self.std_active: print(v1) if v2 ==...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python async def v0(self) -> Optional[str]: v1 = await self.current_label() if v1 is None: return None v2 = await self.labels_url(v1) await self._gh.dele...
Imports: ```python import typing ``` Type definitions: Input Types: Type[Any] Output Type: Any Dependencies: ```python def v0(v1: Callable): try: v2 = getattr(resource, v1.__name__) except AttributeError: return v1 for (v3, v4) in v2.__dict__.items(): setattr(v1, v3, v4) return ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> int: v2 = (v1 + 1) // 2 v3 = v1 while v2 < v3: v3 = v2 v2 = (v1 // v2 + v2) // 2 return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: torch.device Output Type: 'ResnetPreProcessorHabitat' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.device) -> 'ResnetPreProcessorHabitat': if not self.parallel: self.resnet = self.resnet.to(v1) self.d...
Imports: ```python import torch import typing ``` Type definitions: Input Types: Any, Any Output Type: torch.FloatTensor Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> torch.FloatTensor: if v2.size()[-1] != 1: raise ValueError('Expecting last index to be 1. Found {}'.format(v2.size(...
Imports: ```python import typing ``` Type definitions: Input Types: Namespace Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Namespace): for (v2, v3) in v1.__dict__.items(): setattr(self, v2, v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: try: v1 = [w for v2 in self.windows_map.values() if v2.urgent][0] v1.group.cmd_toscreen() v1.group.focus(v1) except IndexErro...
Imports: ```python from pathlib import Path import typing ``` Type definitions: Input Types: Any, str, List[str] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: str=None, v3: List[str]=None, **v4): v5 = Path(v1) v6 = [x for v7 in v5.iterdir()] pass ```
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: Optional[v0], str Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(v2: Optional[v0], v3: str=None) -> v0: if v2 is None: raise ValueError('Expected non-None value: {desc}'.format(de...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if isinstance(v1, str) == False: raise TypeError('You must set a str variable as secret!') if self.__is_ascii(v1) == False: raise ...
Imports: ```python import typing ``` Type definitions: Input Types: array, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: array, v2: str): v3 = f'{v2}.array_{v1.typecode}' v1.tofile(open(v3, 'wb')) ```
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1): self.val = v1 self.next = None ``` Input Types: v0 Output Type: bool Dependencies: Function Name: v2 Function: ```python def v2(self, v3: v0) -> bool: if not v3 or not v3.next: return Tru...
Imports: ```python import typing ``` Type definitions: ```python @dataclass_json @dataclass class v0: v1: Optional[HouseData] = None def v2(self, v3: HouseData) -> v0: self.House = v3 return self v4: Optional[JsonCalcSpecification] = None def v5(self, v6: JsonCalcSpecification) -> v0: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = u'my-awesome-project / master' v2 = u'Pipeline changed status to success with build(s):\n* job_name2 - success\n* job_name - success.' self....
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: for v1 in self.paths: v1.aggregate_path_attrs(self.log) ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> List[str]: if v1 in self._str2int and self.str2int(v1) in self.subword_dict: return self.subword_dict[self.str2int(v1)] v2: List[i...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List['Image'] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List['Image']: v1 = {i.image_hash: i for v2 in self.repository.images()} v3 = [self] while v3[-1].parent_id is not None: try: ...
Imports: ```python from scipy import signal import typing ``` Type definitions: Input Types: Union[list, np.ndarray] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[list, np.ndarray]=None): v1 = self.data if v1 is None else v1 return signal.detrend(v1) ```
Imports: ```python from heapq import heappush, heappop import typing ``` Type definitions: Input Types: int, int, List[List[int]] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: List[List[int]]) -> int: (v4, v5, v6, v7) = ([], 0, 0, len(v3)) while v2 < v...
Imports: ```python import os import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = os.listdir(os.path.join(self.this_dir, 'test_resources')) for v2 in v1: if v2.endswith('.pdf'): os.remove(os.path....
Imports: ```python import requests import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: requests.put(self._url, data=self._to_send.encode('utf-8')).raise_for_status() self._reset() ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, int, float, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2=None, v3: int=1000, v4: float=0.95, v5=None): if v3 < 1: raise ValueError('n must be greater than 0') if v4 < 0.0 or v4...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: v2 = [] v3 = {} v4 = 0 while v4 < len(v1): if v1[v4] == '(': v2.append(v3) v4 += 1 v3 =...
Imports: ```python import sympy as sp import typing ``` Type definitions: Input Types: bool, list Output Type: Tuple[List[str], sp.Matrix] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False, v2: list=None) -> Tuple[List[str], sp.Matrix]: v3 = [] for v4 in self.graph.nodes: ...
Imports: ```python from multiprocessing import cpu_count from multiprocessing.pool import ThreadPool from tqdm import tqdm as progress_bar import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: List Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3) -> List: v4 = ThreadPoo...
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray, float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: float): assert v2 >= 0, 'Standard deviations to determine outliers must be >= 0' v3 = [] for v4 in range(v1.shape[2]): ...
Imports: ```python from pathlib import PurePosixPath, Path import typing ``` Type definitions: ```python v0 = Optional[Callable[['Project'], bool]] ``` ```python class v1(Project): def __repr__(self): return f'ManifestProject({self.name}, path={repr(self.path)}, west_commands={self.west_commands}, topdir={...
Imports: ```python from logging import getLogger import typing ``` Type definitions: Input Types: PreparedRequest, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: PreparedRequest, v2): getLogger().fatal("The request '%s' has not been mocked yet.", v1.url) v2.status_co...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: list): if isinstance(v1, list): if len(v1) > 0: v2: str = '' for v3 in v1: v3 = str(v3).lower() i...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[str], Optional[str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: Optional[str], v2: Optional[str]) -> str: if v1 is not None and v2 is not None: return 'You are trying to use pandas function {},...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = self.connection.execute('SELECT * FROM networks WHERE name = ?', [v1]) return v2.fetchone()[0] ```
Imports: ```python import typing ``` Type definitions: Input Types: Tensor, Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Tensor, v2: Tensor): v3 = v1.size(0) v1 = v1.argmax(dim=-1).view(v3, -1) v2 = v2.view(v3, -1) v4 = v1.long() == v2.long() return v4.flo...
Imports: ```python import typing ``` Type definitions: ```python class v0(object): def __init__(self, **v1): self.name = v1.get('name') self.type = v1.get('type', 'A') self.address = v1.get('address') self.distance = v1.get('distance') self.weight = v1.get('weight') ...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: float, **v2) -> float: assert isinstance(v1, (float, int)), 'degrees must be a number' v3 = 180 v1 = abs(v1) % 180 return v1 / v3 * 100.0 ```
Imports: ```python from sklearn.random_projection import johnson_lindenstrauss_min_dim, GaussianRandomProjection import typing ``` Type definitions: ```python class v0(params.Params): v1: int v2: dict ``` Input Types: v0 Output Type: None Dependencies: Function Name: v3 Function: ```python def v3(self, *, v4: ...
Imports: ```python import pathlib import typing ``` Type definitions: Input Types: Union[str, pathlib.Path] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[str, pathlib.Path], **v2: Any) -> None: v1 = pathlib.Path(v1) v1.parent.mkdir(parents=True, exist_ok=True) ...
Imports: ```python import os import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = os.environ.get('DOC_READER_HOST', 'localhost') return v1 ```
Imports: ```python import os import shutil import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0() -> None: if os.path.isdir(cls.package_storage()): shutil.rmtree(cls.package_storage()) ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = v1.replace('_', '--') if v2.startswith('--'): v2 = v2.replace('--', 'underscore-', 1) return v2.lower() ```
Imports: ```python import csv, math, os, re, typing import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> bool: assert isinstance(v1, str) v2 = '^.?[\\w]+.csv$' v3 = re.compile(v2) v4 = re.match(v3, v1) return ...
Imports: ```python import typing ``` Type definitions: Input Types: ncs.maagic.Root Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: ncs.maagic.Root) -> None: v2 = v1.kicker__kickers.data_kicker.create('nano-sla-timeouts-kicker') v2.monitor = '/nano:nano/nano:sla/nano:timeouts'...
Imports: ```python from os import path import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): self.max_rounding_error = 0.14 self.filename_identifier_substring = 'fidelity' self.get_ticker_info = self.get_ticker_info...
Imports: ```python import typing ``` Type definitions: ```python class v0(RecordUpdateListener): v1 = b'' def __init__(self, v2: str, v3: str, v4: Optional[int]=None, v5: int=0, v6: int=0, v7: Union[bytes, Dict]=b'', v8: Optional[str]=None, v9: int=_DNS_HOST_TTL, v10: int=_DNS_OTHER_TTL, *, v11: Optional[List[...
Imports: ```python import typing ``` Type definitions: Input Types: str, v2, Any, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: v2=None, v3=None, v4=None, v5=None, **v6): v7 = v1 if v1[:2] != '--' else v1[2:] if v3 is None: if v5 == 'store_true...
Imports: ```python import typing ``` Type definitions: Input Types: timedelta Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: timedelta) -> str: v2 = int(v1.total_seconds()) v3 = [('day', 60 * 60 * 24), ('hour', 60 * 60), ('minute', 60), ('second', 1)] v4 = [] for (v5, ...
Imports: ```python from pandas._typing import FilePath, ReadBuffer from pandas.errors import EmptyDataError, OutOfBoundsDatetime import pandas as pd from pandas import DataFrame, isna from pandas.io.common import get_handle from pandas.io.sas._sas import Parser import pandas.io.sas.sas_constants as const from pandas.io...
Imports: ```python import logging import typing ``` Type definitions: Input Types: dict Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> str: v2 = '' for (v3, v4) in v1.items(): if v3 == 'days': v2 += ' start:-%dm' % (v4 * 1440) elif v3...
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: int) -> bool: (v3, v4) = (str(v1), str(v2)) (v5, v6) = (int(v3[0]), int(v3[1])) (v7, v8) = (int(v4[0]), int(v4[1])) if v6 == 0 and v8 =...
Imports: ```python import numpy as np from statsmodels.iolib.summary import Summary from statsmodels.iolib.table import SimpleTable from statsmodels.tools.validation import array_like, bool_like, float_like, int_like, string_like from statsmodels.tsa.deterministic import DeterministicTerm from statsmodels.tsa.seasonal ...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1 = itertools.count() def __init__(self, v2: str, v3: bool=False, v4: Optional['Vertex']=None, v5: Optional['Vertex']=None): self.name = v2 self.predicate = v3 self.vprev = v4 self.vnext = v5 sel...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` ```python v1 = Callable[[v0, v0], bool] ``` Input Types: List[v0], Optional[int], Optional[int], Optional[v1] Output Type: None Dependencies: Function Name: v2 Function: ```python def v2(v3: List[v0], v4: Optional[int]=0, v5: Option...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[str] Dependencies: ```python def v0(v1: SpamNode) -> None: if v1.id in visited: return visited.add(v1.id) v2 = getattr(v1, look_for) if not v2: result_nodes.append(v1.id) return for (v3, v...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor) -> torch.Tensor: (v2, v3) = v1.shape v4 = torch.eye(v3, dtype=v1.dtype, device=v1.device) v5 = v4 for v6 ...
Imports: ```python import heapq import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> int: if self.size < self.k: heapq.heappush(self.pool, v1) self.size += 1 elif v1 > self.pool[0]: heapq.heap...
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: for v2 in v1: for v3 in v2: if v3 not in self.vocabulary: self.vocabulary.append(v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0(v1: http.client.HTTPConnection, v2: Dict[str, str], v3: Dict[str, str], v4: str) -> http.client.HTTPResponse: v5 = urllib.parse.urlencode(v3) v1.request('POST', f'/write?{v5}', v4, v2) v6 =...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> int: v2 = self.get_string(v1) return int(v2, base=2) ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> str: v2 = self.find_mapping(v1) if v2 is None: return '0x{:x} (umapped)'.format(v1) else: v3 = v1 - v2.start + v2.page_offse...
Imports: ```python import random import nltk from nltk.tokenize.treebank import TreebankWordDetokenizer import typing ``` Type definitions: Input Types: str, dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: dict=None): if v2 is None: v2 = {} random.se...
Imports: ```python from collections import defaultdict from collections import deque from collections import namedtuple import typing ``` Type definitions: Input Types: List[str] Output Type: int Dependencies: ```python def v0(v1, v2, v3): return v1 in range(m) and v2 in range(n) and (is_room(grid[v1][v2]) or is_s...
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, float Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: torch.Tensor, v3: float) -> bool: (v4, v5, v6, v7) = v1.shape v8 = int(v3 * v6) v9 = int(v3 * v7) ret...
Imports: ```python import typing ``` Type definitions: Input Types: object, dict, object, list Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: object, v2: dict, v3: object, v4: list=None) -> bool: v5 = '/cloud/aws' v6 = {'skipStatusChecks': 1} if 'groupIds' in v2: ...
Imports: ```python import typing ``` Type definitions: Input Types: list | str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list | str): v2 = self._compile_names_prefix + '_' if v2 == '_': v2 = '' if isinstance(v1, str): v1 = [v1] v1 = '_'.join(...
Imports: ```python import matplotlib.pyplot as plt import typing ``` Type definitions: Input Types: bool, bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False, v2: bool=None) -> None: if self._model.estimator_id != 'opls': raise ValueError('This is only ap...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: Optional[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2=None) -> Optional[int]: for (v3, v4) in self._ordered_node_ids.items(): if v1 == v4: return self.get_rank_of(v3, v2) `...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('R', bound='Node') ``` ```python v1 = TypeVar('S') ``` ```python v2 = TypeVar('T') ``` ```python v3 = TypeVar('W') ``` Input Types: Optional[str] Output Type: Callable[[Callable[[v0, v1], v2]], Callable[[v0, v1], v2]] Dependencies: ```python ...
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(self, v1: np.ndarray) -> np.ndarray: v2 = v1.shape[0] if self.include_intercept_: v1 = np.c_[np.ones(v2), v1] return ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = self._csv_importer if not v2: v2 = self._settings.csv_importer self._players = v2(v1).import_players() ```
Imports: ```python import collections import math import typing ``` Type definitions: Input Types: List, List, int, bool Output Type: Any Dependencies: ```python def v0(v1: str, v2: int): v3 = collections.Counter() for v4 in range(1, v2 + 1): for v5 in range(0, len(v1) - v4 + 1): v6 = tuple...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray, bool Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: np.ndarray, v3: bool=True) -> float: v4 = np.sum(np.where(v1 == v2, 0, 1)) return v4 / v1.size i...
Imports: ```python import os from pathlib import Path import typing ``` Type definitions: Input Types: Union[str, Path], Union[str, Path] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[str, Path], v2: Union[str, Path]): if not os.path.isdir(v2): v2 = os.path.dirname(...
Imports: ```python import pandas as pd import requests import typing ``` Type definitions: Input Types: Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0() -> pd.DataFrame: v1 = 'https://finance.yahoo.com/screener/predefined/aggressive_small_caps' v2 = pd.read_html(requests...
Imports: ```python import json, multiprocessing, pytest import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = json.loads(v1) return v2['created'] ```
Imports: ```python import os import subprocess import typing ``` Type definitions: Input Types: List[str], bool Output Type: Any Dependencies: ```python def v0(v1: List[str]) -> None: print("Running '%s'..." % ' '.join(v1)) try: subprocess.run(v1, check=True) except subprocess.CalledProcessError as...
Imports: ```python import base64 import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str): v3 = False v4 = False if len(v1) == 32: try: bytes.fromhex(v1) except: v3 ...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any, bytearray, int, int, int Output Type: str Dependencies: ```python def v0(v1: int, v2: int, v3: str) -> str: return str(' ' * (v2 * v1)) + v3 ``` Function Name: v4 Function: ```python def v4(v5: str, v6: Any, v7: bytearray, v8: int=4, v9:...
Imports: ```python import numpy as np import torch from torch.utils.data import Dataset import typing ``` Type definitions: Input Types: Dataset Output Type: Tuple[torch.Tensor, torch.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dataset, *v2, **v3) -> Tuple[torch.Tensor, torch.Tensor]:...
Imports: ```python import typing ``` Type definitions: Input Types: 'str', Any, Any, 'UpdateTime' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'str', v2, v3=None, v4: 'UpdateTime'=UpdateTime.INVALID): v5 = self.websocket_request_impl.subscribe_diff_depth_event(v1, v4, v2, ...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False) -> list: v2 = 'uppercase' if not v1 else 'lowercase' v3 = self._data['alphabet'].get(v2) return v3 ```
Imports: ```python import typing ``` Type definitions: ```python @dataclass(frozen=True) class v0: v1: 'FunctionSchema' v2: bool v3: bool v4: DeviceCheckType v5: Optional[str] v6: Optional[str] v7: Set[Variant] v8: bool v9: bool v10: 'Location' v11: Dict[UfuncKey, 'UfuncInner...
Imports: ```python import email from email import policy from email.parser import BytesFeedParser import base64 import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): (v2, v3) = email.utils.parseaddr(v1) v4 = base64.b64e...
Imports: ```python import os import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = os.getenv('SHELL') if not v1: raise RuntimeError('Could not read SHELL environment variable. Please specify your shell type by p...
Imports: ```python import asyncio from typing import TYPE_CHECKING, Any, List, Optional, Tuple, cast import typing ``` Type definitions: Input Types: List[bytes] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[bytes]) -> None: v2 = cast(asyncio.WriteTransport, self._ori...
Imports: ```python import hashlib import hmac import typing ``` Type definitions: Input Types: dict, list Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict, v2: list=None) -> dict: v3 = v2 or list(v1.keys()) + ['requestFingerprintOrder', 'secret'] v1['requestFingerpri...
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: List[List[int]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int]) -> List[List[int]]: v1.sort() self.res = set() self.helper(v1, (), 0) return self.res ```
Imports: ```python import os import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str=os.getcwd()) -> str: v3 = os.path.join(v2, 'data', 'cred', f'{v1}_cred.json') return v3 ```
Imports: ```python import torch from torch.utils.data import DataLoader, SubsetRandomSampler import typing ``` Type definitions: Input Types: str, int, int, int, int Output Type: Tuple[DataLoader, int, DataLoader, int] Dependencies: ```python def v0(v1: str, v2: bool, v3: int, v4: int, v5: int) -> Tuple[DataLoader, in...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str='', **v2: t.Any) -> str: v3 = self.datetime(**v2) if not v1: v4 = self.extract(['formats', 'date']) v5 = self.extract(['formats', 't...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, int Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: int) -> bytes: self._check_project(v1) self._check_version(v2) self._check_revision(v3) v4 = f'/v1/projects/{v1}/{...
Imports: ```python import math import typing ``` Type definitions: Input Types: [(float, float)] Output Type: Any Dependencies: ```python def v0(v1, v2): (v3, v4) = v1 (v5, v6) = v2 return math.sqrt(pow(v5 - v3, 2) + pow(v6 - v4, 2)) ``` Function Name: v7 Function: ```python def v7(self, v8: [(float, float...