text
stringlengths
190
325k
Imports: ```python import subprocess import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = ['src/pyslang.py', 'run', f'tests/{v1}.slang'] v3 = subprocess.Popen(v2, stdout=subprocess.PIPE) (v4, v5) = (v3.stdout.read()...
Imports: ```python import re import datetime import typing ``` Type definitions: Input Types: Any Output Type: datetime.datetime Dependencies: Function Name: v0 Function: ```python def v0(v1) -> datetime.datetime: v2 = re.search('(\\d+-\\d+-\\d+ \\d+:\\d+:\\d+)', v1) if v2.endpos >= 1: try: ...
Imports: ```python import datetime import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python async def v0(self) -> bool: if self.plugin_data != {}: return await self.__save_data_to_json_file(self.plugin_data, f"{self.plugin_dataj_filename}.bak....
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, float Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: float=0.5) -> List[int]: v3 = v1[:, 0] v4 = v1[:, 1] v5 = v1[:, 2] v6 = v1[:, 3] v7 = v1[:,...
Imports: ```python import typing ``` Type definitions: ```python class v0(object): v1 = 'http://dart.fss.or.kr/api/' def __init__(self, v2: str, v3: bool=True, **v4): """ ์ข…๋ชฉ ์ •๋ณด ์ดˆ๊ธฐํ™” Parameters ---------- crp_cd: str ์ข…๋ชฉ ์ฝ”๋“œ lazy_loading: bool True ์ผ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): self.gui.set_region(v1) self.region_menu.setTitle(v1) ```
Imports: ```python import torch import torch.nn.functional as F import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: v2 = dict() v2['loss_history'] = self.loss_history v2['loss_iter'] = self.loss_iter ...
Imports: ```python import typing ``` Type definitions: ```python @dataclass class v0: v1: 'accera.Plan' v2: Union[Array, Any] v3: LoopIndex = None v4: LoopIndex = None v5: int = None v6: int = None v7: Union[Array.Layout, Tuple[int]] = None v8: int = None v9: bool = False v10: bo...
Imports: ```python import torch.nn as nn import torch 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 = torch.tensor(v1.astype('float32')) return ((self.pgan_model.test(v2).cl...
Imports: ```python import typing ``` Type definitions: Input Types: th.Tensor Output Type: th.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: th.Tensor) -> th.Tensor: self.check_args(v1) v2 = self.conv(v1[:, None] if v1.dim() == 3 else v1) v2 = v2.transpose(1, 2) (v3, v4, v...
Imports: ```python import torch from torch import Tensor import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, Optional[torch.Tensor] Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: torch.Tensor, *, v3: Optional[torch.Tensor]=None) -> t...
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 = f'{v1}/scanset-{v2}' self.create_directory(v3) return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: bytes, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes, v2): v1 = v1.decode('utf-8') if 'ready' in v1: try: v3 = v1.split('&') v4 = v3[1] v5 = v3[2] ...
Imports: ```python import typing ``` Type definitions: Input Types: torch.FloatTensor, torch.FloatTensor, Any, Any Output Type: torch.FloatTensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.FloatTensor, v2: torch.FloatTensor, v3=None, v4=None) -> torch.FloatTensor: if self.negative_...
Imports: ```python from urllib.parse import urlparse, urlunparse import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str) -> str: (v3, v4) = (urlparse(v1), urlparse(v2)) v5 = {**v4._asdict(), 'path': v3.path} v6...
Imports: ```python import random from functools import partial import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: random.seed(v1) v2 = partial(random.randint, 180, 255) return '#{:0>6X}'.format(v2() * v2() * v2(...
Imports: ```python import math import typing ``` Type definitions: Input Types: int, float Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: float) -> float: v3 = -self.value / self.visits if self.visits else 0 v4 = self.policy_prior * math.sqrt(v1) / (1 + self.v...
Imports: ```python import typing ``` Type definitions: Input Types: List[int], List[int] Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: List[int]) -> List[int]: if not v1 or not v2: return [] v3 = {} v4 = [] v5 = [] for v6 in rang...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: float, int Output Type: np.array Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float=0.0, v2: int=0) -> np.array: if v2 < 0 or v2 >= self.number_of_frames: return np.zeros(3) if v1 < 0: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray): v1 = np.atleast_2d(v1) v2 = np.roll(v1, 1, axis=1) return np.sum(-10 * np.exp(-0.2 * np.sqrt(v1[:, :-1] ** 2 + v2[:...
Imports: ```python import typing ``` Type definitions: ```python class v0(IsmnComponent): def __init__(self, v1, v2=None): """ Initialise Network object. Parameters ---------- name : str Network name. stations : list[Station], optional (default: None) ...
Imports: ```python import warnings import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(**v1) -> None: v2 = list(v1.keys()) v3 = list(v1.values()) if any(v3): v4 = ', '.join(v2) warnings.warn(f'Specifying any of: {v4...
Imports: ```python import typing ``` Type definitions: Input Types: float, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: str): v2 = v2.upper() v3 = ['NS', 'US', 'MS', 'S'] if v2 in v3: self.instr.write('TRIG_DELAY %.1f%s' % (v1, v2)) else:...
Imports: ```python import typing ``` Type definitions: Input Types: list, dict, bool Output Type: Any Dependencies: ```python def v0(v1: list, v2: dict, v3: str, v4: str, v5: bool): for v6 in v2: AddSignature(v1, v6, v3, v4, v5) ``` ```python def v7(v8, v9, v10: str, v11: str, v12: bool): v13 = core_fu...
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int=None): v3 = self.moodle.post('mod_data_get_entry', entryid=v1, returncontents=v2 or '') return v3 ```
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: Dict[v0, int], v0 Output Type: None Dependencies: Function Name: v1 Function: ```python def v1(v2: Dict[v0, int], v3: v0) -> None: v4 = v2.get(v3) if v4 is None: v2[v3] = 1 else: v2[v3] = v4 ...
Imports: ```python import json import requests from requests import Response import typing ``` Type definitions: Input Types: str, Any, Any, Optional[Dict[str, str]] Output Type: Optional[Response] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Any=None, v3: Any=None, v4: Optional[Dict[...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python class v0(NamedTuple): v1: List[float] v2: int v3: int ``` Input Types: Sequence[v0], Sequence[str], Dict[str, float] Output Type: float Dependencies: ```python def v4(v5: np.ndarray, v6: np.ndarray, v7: Sequence[float]) -> D...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list=None): v2 = {'tw_bias': self.tw_bias} v2.update(self.opt_args) if self.target_tw: v2['target_tw'] = self.target_tw v3 = self.optim...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=-1) -> bytes: if self._nbr == self._size: return b'' v2 = self._size - self._nbr if v1 > -1: v1 = min(v2, v1) else: ...
Imports: ```python from urllib.parse import quote_plus import typing ``` Type definitions: Input Types: str, Any, str, str Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Any, v3: str=None, v4: str=None) -> dict: v5 = self._endpoint + '/' + quote_plus(v1) + '/conten...
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): if self.bmap_steamid is None and self.bmap_map is None: return if self.bmap_map == v1: return self.bmap_steamid ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = v1.find('่Œƒ็•ดๅท') + len('่Œƒ็•ดๅท') v3 = v1[v2:v2 + 100] v4 = v3.find('["') v5 = v3.find('"]') v6 = v3[v4 + 2:v5] v1 = v1[v1.find('ๅ็งฐ') + l...
Imports: ```python import typing ``` Type definitions: Input Types: List[Any] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[Any]) -> None: super().training_epoch_end(v1) self.log('train_metrics', self.train_metrics.compute()) self.train_metrics.reset() ```
Imports: ```python from copy import copy import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.query = copy(self.model._meta.basequery) for (v1, v2) in self.fields_for_select.items(): self.add_field_to_select_...
Imports: ```python import typing ``` Type definitions: Input Types: int, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: str, v3: str=None): (v4, v5) = self.consul.catalog.service(v2, tag=v3) v6 = [] for v7 in v5: v8 = self.ctx.socket(v1) ...
Imports: ```python import typing ``` Type definitions: Input Types: Path Output Type: None Dependencies: ```python def v0(*, v1: dict[str, str] | None=None, v2: str | None='grpc://fake.url:10', v3: str | None=None, v4: str | None=None) -> DynamicRemoteOptions: if v1 is None: v1 = {} v5 = ['--remote-cac...
Imports: ```python import typing ``` Type definitions: ```python class v0(PageVisitor, NodeVisitor, TimeoutBehaviour): v1: str v2: UserConfiguration def __init__(self, v3: str, v4: EdgeNode, v5: UserConfiguration): self.current_timeout = 0 self.current_node = v4 self.current_page = ...
Imports: ```python import numpy as np import pandas as pd import plotly.graph_objects as go import plotly.express as px import plotly.io as pio import typing ``` Type definitions: Input Types: pd.DataFrame, pd.Series, str Output Type: NoReturn Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFram...
Imports: ```python import json import typing ``` Type definitions: Input Types: requests.exceptions.HTTPError Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: requests.exceptions.HTTPError) -> bool: v2 = json.loads(v1.response.text) if v2.get('error').get('details') and v2['err...
Imports: ```python import torch 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: assert len(v2.shape) == 2 v3 = torch.isfinite(v2).all(-1) * (v2[...
Imports: ```python import os import cv2 import typing ``` Type definitions: Input Types: str, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2): v3 = os.path.join(v1, 'Images') v4 = os.path.join(v3, '%s.png' % v2) return cv2.imread(v4, cv2.IMREAD_COLOR) ```
Imports: ```python import tensorflow as tf from tensorflow.python.ops import numpy_ops as np import typing ``` Type definitions: Input Types: Tuple[int, ...] Output Type: 'Kernel' Dependencies: ```python def v0(v1: Optional[np.ndarray], v2: int) -> Optional[np.ndarray]: if v1 is not None: v3 = tuple((v2 + ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: ```python def v0(v1, v2, v3): if not v3: return True (v4, board[v1][v2]) = (board[v1][v2], None) for (v5, v6) in yield_valid_directions(v1, v2, v3[0]): if v0(v5, v6, v3[1:]): b...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str='authentication required') -> None: dict.clear(self) dict.update(self, {'__auth_type__': 'basic', 'realm': v1}) if self.on_update: self...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: list): v2 = len(v1) v3 = 0 v4 = 0 for v5 in range(v2 - 1): v6 = v5 v7 = v1[v5] for v8 in range(v5 + 1, v2): if v1...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str Output Type: Tuple[str, str] Dependencies: ```python def v0(v1: str, v2: int=-1) -> str: if v2 == -1: return v1 return f'{v1}#{v2}' ``` ```python def v3(v4: str, v5: str='') -> Dict[str, str]: v6 = {MLFLOW_RUN_NAME: v...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: [()] Dependencies: Function Name: v0 Function: ```python def v0(self) -> [()]: v1 = [('HKLM\\SAM', 'HKEY_LOCAL_MACHINE\\SAM'), ('HKLM\\SECURITY', 'HKEY_LOCAL_MACHINE\\SECURITY'), ('HKLM\\SOFTWARE', 'HKEY_LOCAL_MACHINE\\SOFTWARE'), (...
Imports: ```python import typing ``` Type definitions: ```python class v0(NamedTuple): v1: Path v2: Path v3: bool v4: Optional[bool] = False def v5(self): v6 = f'\n{str(self.input.absolute())}\n{str(self.output.absolute())}\n{str(self.create_dimer)}\n{str(self.retain_water)}' return...
Imports: ```python import webbrowser import random import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: str) -> str: if any((x in v1 for v2 in ['google', 'bing', 'aol'])): return 'search?q=' elif 'duckduckgo' in v1: return '?q=' elif 'yaho...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> int: v2 = 0 for v3 in v1.rstrip().splitlines(): v4 = self.level_cb(v3) v5 = v3.strip() self.logger.log(v4, v5) v...
Imports: ```python import logging import typing ``` Type definitions: Input Types: bytes Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes) -> None: logging.debug(f'sending command: {v1!r}') self.serial_.write(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: Any Dependencies: ```python def v0(v1: Callable): @functools.wraps(v1) def v2(*v3: tuple or Any): v4 = v3[0] for v5 in cases: v6 = v3 + (v5 if isinstance(v5, tuple) else (v5,)) with v4...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if v1 == 'spherical': return f'REGular xpinp={self.grid.min_x} ypinp={self.grid.min_y} & \n alpinp=0. mxinp={self.grid.x_cells...
Imports: ```python import copy import torch from torch import optim as optim import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, float Output Type: Optional[Dict] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor, v2: torch.Tensor, v3: float=0.01) -> Optional[D...
Imports: ```python import torch import torch.utils.data import typing ``` Type definitions: Input Types: str, List[torch.FloatTensor] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: List[torch.FloatTensor]): assert self.n_bins is not None, 'Set n_bins manually' v...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python v0 = NamedTuple('Limitation', [('primitive_name', str), ('error_type', str), ('error_string', str), ('devices', Tuple[str, ...])]) ``` ```python v1 = Any ``` Input Types: core.Primitive, Callable Output Type: Callable Dependencies: ```p...
Imports: ```python import typing ``` Type definitions: Input Types: int, List[int] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: List[int]) -> int: v3 = [1] * v1 for (v4, (v5, v6)) in enumerate(zip(v2, v2[1:])): if v6 > v5: v3[v4 + 1] = v3[v4] + 1...
Imports: ```python import typing ``` Type definitions: Input Types: Union[str, int] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[str, int]) -> None: if not self._at == None: raise ValueError(f'Node already has an @ {self._at} !') else: self._at =...
Imports: ```python import math import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: np.ndarray Dependencies: ```python def v0(v1: np.ndarray) -> None: if v1.shape != (3, 3): raise ValueError(f'Matrix must have shape (3, 3) but has {v1.shape}.') if abs(np.linalg.de...
Imports: ```python import typing ``` Type definitions: Input Types: bool, int, int, bool, bool, str, str, str Output Type: Response Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=None, v2: int=None, v3: int=None, v4: bool=None, v5: bool=None, v6: str=None, v7: str=None, v8: str=None) -> Res...
Imports: ```python import typing ``` Type definitions: Input Types: adsk.core.Command, adsk.core.CommandInputs Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: adsk.core.Command, v2: adsk.core.CommandInputs): v3 = v2.addSelectionInput('selection_input_id', 'Component', 'Select...
Imports: ```python import os import platform import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0() -> str: v1 = {'Windows': 'notepad'} v2 = platform.system() v3 = v1.get(v2, 'nvim') return os.environ.get('EDITOR', v3) ```
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('DictUpperBound', bound='dict') ``` Input Types: v0, v0, bool Output Type: Dict Dependencies: Function Name: v1 Function: ```python def v1(v2: v0, v3: v0, v4: bool=True) -> Dict: v5 = dict() for v6 in v2: if v6 in v3: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: float, float, int, int Output Type: Tuple[List, List] Dependencies: ```python def v0(v1): return self.mass_to_light_ratio * self.intensity * np.exp(-self.sersic_constant * ((v1 / scaled_effective_radius) ** (1.0 / self.sersic_in...
Imports: ```python import datetime import pandas as pd import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: tuple Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame) -> tuple: v2 = v1.columns.get_level_values('gvkey').drop_duplicates().to_list() v3 = v1.index.sor...
Imports: ```python import typing ``` Type definitions: Input Types: str, Optional[Callable] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: Optional[Callable]=None) -> str: v2 = v2 or open with v2(v1, mode='r', encoding='utf-8') as v3: v4 = v3.read() return...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from torch.nn import Mish import typing ``` Type definitions: Input Types: Tensor, int Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: Tensor, v2: int=1) -> Tensor: v3 ...
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 len(self.bounds) > 0: if len(self.bounds) == 1: v1 = f', bound={self.bounds[0]}' else: v...
Imports: ```python import typing ``` Type definitions: Input Types: list, str Output Type: list Dependencies: ```python def v0(v1: str, v2: str=None) -> str: v3 = textblob.translate.Translator() if v2: return v3.translate(v1, from_lang=v2, to_lang='en') return v3.translate(v1, to_lang='en') ``` Fun...
Imports: ```python import typing ``` Type definitions: Input Types: bytes Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes): self._signature = self._cose_key.sign(v1) return ```
Imports: ```python import typing ``` Type definitions: Input Types: int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2=None): for v3 in self.task_list: v3.perform(v1, seed=v2) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, Union[int, Sequence[int]], bool Output Type: Any Dependencies: ```python def v0(*v1): v2 = all((isinstance(x, _NP_LIKES) or _is_poly_dim(x) for v3 in v1)) return np if v2 else jnp ``` ```python def v4(v5): return ja...
Imports: ```python import itertools import random import matplotlib.pyplot as plt import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, Any, Any Output Type: np.ndarray Dependencies: ```python def v0(v1: float, v2: float, v3: float) -> bool: return random.random() < np.exp((v1 - v2) / v3)...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.app.add_url_rule('/delete', 'delete', self.example_route, methods=['DELETE']) v1 = self._get_status_code_for_method('/delete', 'DELETE') sel...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Set[int] Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> Set[int]: v2 = set() v3 = 1 while v1: if v1 & 1: v2.add(v3) v1 >>= 1 v3 += 1 return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: str, int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: int, v3=','): v4 = [] v5 = v1.split(v3) while len(v5) > 0: v4 += [v3.join(v5[:v2])] v5 = v5[v2:] return (v3 + '<br>...
Imports: ```python from textwrap import dedent, indent import typing ``` Type definitions: Input Types: re.Match[str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: re.Match[str]) -> str: v2 = v1['type'] v3 = v1['body'] if v1['name']: v4 = f"**{v1['name'].strip()}*...
Imports: ```python import logging import os from pathlib import Path import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: Path, Callable[[Path], bool] Output Type: List[Path] Dependencies: ```python def v1(v2: Path) -> Iterator[Path]: for (v3, v4, v5) in os.walk(v2): for v6 in v5...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> int: v2 = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000} v3 = 0 for v4 in range(0, len(v1)): v5 = v1[v4:v4 + 2] ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: if self.index == -1: raise ValueError('No current match.') return self.matches[self.index] ```
Imports: ```python import sys import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1, v2, v3=sys.stdout): if not v1: return if not v3.isatty(): v3.write(v1 + '\n') else: v3.write(termcolor.colored(v1, v2) + '\n') v3.flush() ``` Fu...
Imports: ```python import typing ``` Type definitions: Input Types: str, bool Output Type: Any Dependencies: ```python def v0(v1: Tag) -> str: v2 = VERBALIZERS[v1.kind] v3 = [f(v1.data) for v4 in v2] v3 = [x for v5 in v3 if v5] if not v3: return v1.text else: return v3[0] ``` ```pyt...
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): v2['StagerName'] = v1 v3 = requests.post(url=f'{self.host}:{self.port}/api/stagers', json=v2, verify=False, params...
Imports: ```python import typing ``` Type definitions: Input Types: T.FloatingPoint Output Type: bool Dependencies: ```python def v0(v1: T.TorchTensor) -> T.Tuple[int]: return tuple(v1.size()) ``` Function Name: v2 Function: ```python def v2(v3: T.FloatingPoint) -> bool: try: v0(v3) return True...
Imports: ```python import base64 import cv2 import typing ``` Type definitions: Input Types: int Output Type: Dict Dependencies: ```python def v0(v1: NDArray[(Any, Any, 3), int]) -> str: (v2, v1) = cv2.imencode('.jpg', v1) if not v2: return None v1 = v1.tostring() v1 = base64.encodebytes(v1) ...
Imports: ```python import typing ``` Type definitions: ```python v0 = List[Task] ``` Input Types: v0 Output Type: Any Dependencies: ```python def v1(v2: List[Task]): v3: List[Task] = list() while len(v2) != 0: v4 = v2.pop(0) v5 = set(v3) if v4 in v5: continue if len(v...
Imports: ```python import os, sys import traceback from datetime import datetime import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: ```python def v0(v1, v2, v3, v4, v5=False): v6 = '/%s/%s/%s' % (v2, v3.replace(os.path.sep, '/'), v4) while '//' in v6: v6 = v6.replace('...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: {object, None} Dependencies: Function Name: v0 Function: ```python def v0(v1, **v2: Dict[str, any]) -> {object, None}: try: v3 = v1.objects.get(**v2) except v1.DoesNotExist: v3 = None return v3 ```
Imports: ```python import os import re import random from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service from selenium.webdriver.remote.webelement import WebElement import typing ``` Type definitions: Input Types: str, str Output Type: Any De...
Imports: ```python import base64 import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str='') -> str: v3 = 'smart/filters:no_upscale()%s/%s/source_type/local_file' v4 = '' if v2: v3 = '/%s/%s' % (v2, v3) ...
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 = [] for (v4, v5) in enumerate(reversed(v1)): for (v6, v7) in enumerate(reversed(v2)): v8 = (ord(v5) -...
Imports: ```python import typing ``` Type definitions: Input Types: pg.TextItem Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pg.TextItem): self._text_items.append(v1) self.plot_item.addItem(v1) ```
Imports: ```python from datetime import datetime, timedelta import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): if not self.loop or not self.loop_length: return with self.midiout: for v2 in range(v1): ...
Imports: ```python import warnings import torch from torch.ao.quantization.quant_type import QuantType, quant_type_to_str import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: torch.Tensor) -> bool...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: bool Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False) -> pd.DataFrame: v2 = pd.DataFrame({'text': [sample.text for v3 in self._dataset], 'label': [v3.label for v3 in se...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray): v2 = len(v1) v3 = np.zeros((v2, v2)) v4 = np.linalg.norm(v1) for v5 in range(v2): v3[v5] = -v1[v5] * v1...
Imports: ```python import typing ``` Type definitions: Input Types: Mapping[str, str], Mapping[str, Any] Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Mapping[str, str], v2: Mapping[str, Any]) -> Dict[str, Any]: v3 = {} for v4 in v2: v5 = self._lookup...
Imports: ```python import typing ``` Type definitions: Input Types: Image Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Image): v2 = self.__preprocess_img(v1) v3 = self.__clusterize(v2) v4 = self.__group_clusters(v3) v5 = self.__estimate_centroids(v4) v6 = s...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> bytes: assert isinstance(v1, str), str(type(v1)) return v1.encode() ```