text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: 'DataSet' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> 'DataSet': v2 = self.get_data_set(v1, include_deleted=True) if v2 is None: v2 = self.add_data_set(v1) if v2.deleted: r...
Imports: ```python import torch import torch.nn as nn import typing ``` Type definitions: Input Types: torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor) -> torch.Tensor: v2 = self.encode1(v1) v3 = self.encode2(self.max_pool(v2)) v4 = ...
Imports: ```python import warnings import torch from torch import nn import typing ``` Type definitions: Input Types: Union[numpy.ndarray, torch.Tensor], int Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[numpy.ndarray, torch.Tensor], v2: int=None) -> torch.Tensor...
Imports: ```python import numpy import typing ``` Type definitions: Input Types: numpy.ndarray, numpy.ndarray Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: numpy.ndarray, v2: numpy.ndarray) -> float: v3 = v1 - v2 v4 = numpy.dot(v3, v3) return numpy.sqrt(v4) ```
Imports: ```python import typing ``` Type definitions: Input Types: 'TreeNode', 'TreeNode' Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'TreeNode', v2: 'TreeNode') -> None: if v1 is None: raise TypeError('old_subtree is not allowed to be None.') if v2 == v1: ...
Imports: ```python import typing ``` Type definitions: Input Types: Optimizer, Dict[str, Any] Output Type: Dict[str, Dict[str, Any]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optimizer, v2: Dict[str, Any]) -> Dict[str, Dict[str, Any]]: v3 = v2['lr'] v4 = {'step_size': 10 * self.stat...
Imports: ```python import geopandas as gpd from geopandas.sindex import PyGEOSSTRTreeIndex from shapely import prepared from shapely.affinity import scale from shapely.geometry import LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, box from shapely.geometry.base import BaseGeometry, BaseMultipart...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Tensor], Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, Tensor], v2: Tensor): v3 = v1['encoder_out'] v3 = v3.index_select(1, v2) v4 = {'encoder_out': v3} v4['src_tokens...
Imports: ```python import typing ``` Type definitions: Input Types: object, str, str, str, Optional[bytes], datetime, datetime Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: object, v2: str='', v3: str='', v4: str='', v5: Optional[bytes]=b'', v6: datetime=datetime.fromtimestamp...
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 = v1.split(' ') for v4 in v3: v5 = v4.strip() if v5: v2.append(v5) return ' '.join(v2[::-1])...
Imports: ```python import typing ``` Type definitions: Input Types: ast.Attribute Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: ast.Attribute) -> None: v2 = self._position_from_node(v1) self.visit(v1.value) v3 = self._names_from(v1.value) with self.collector.na...
Imports: ```python import typing ``` Type definitions: Input Types: pathlib.Path Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: pathlib.Path) -> str: v2 = None v3 = v1.name.split('_') if v3[0].startswith('transformation'): v2 = '_'.join(v3[3:6]) if v3[0:2] == [...
Imports: ```python import random import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: ```python def v0(v1=6, v2=None) -> GuitarShape: if v2 is None: v2 = random.randrange(0, 12) v3 = [FretPosition(string=v1, fret=v2), FretPosition(string=v1 - 1, fret=v2 + 2)] return G...
Imports: ```python import asyncio import inspect import threading import typing ``` Type definitions: Input Types: Callable, bool Output Type: Callable Dependencies: ```python @functools.wraps(function) def v0(*v1: Any, **v2: Any) -> Any: try: v3 = asyncio.get_event_loop() except RuntimeError: ...
Imports: ```python import os import uuid import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str='mp4'): os.makedirs('sandbox', exist_ok=True) return f'sandbox/{uuid.uuid4()}.{v1}' ```
Imports: ```python import typing ``` Type definitions: ```python class v0(Model): v1: List[str] v2: Dict[str, str] v3: str v4: List[str] v5: str v6: str v7: List[str] v8: List[str] def v9(self, v10: List[str]) -> v0: self.achievements = v10 return self def v11(s...
Imports: ```python from uuid import UUID import numpy as np from scipy.interpolate import LinearNDInterpolator from scipy.spatial import cKDTree import typing ``` Type definitions: Input Types: np.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray): if v1 is N...
Imports: ```python import numpy as np from skimage.feature import peak_local_max from skimage.filters import gaussian, threshold_otsu from skimage.measure import label, regionprops from skimage.segmentation import watershed from skimage.transform import hough_line, hough_line_peaks, resize from sklearn.neighbors import...
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.conn.cursor() v3 = '\n SELECT inventory.id, inventory.name, \n inventory.desc, inventory.warehouse_id,\n wa...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: int, v4={}): v5 = 1 << v2 v6 = self.bus.read_byte_data(self.addr, v1) if v3 == 1: self.bus.write_byte_data(...
Imports: ```python from requests.models import CaseInsensitiveDict from requests.models import Response as RequestsResponse import typing ``` Type definitions: Input Types: str, Optional[int], Optional[str], Optional[str], Optional[str] Output Type: Any Dependencies: ```python def v0(v1: str, v2: Optional[int]=400, v3...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> Any: if v1['error'] and v1['error']['code'] == 'ECONNREFUSED': return Exception('The server refused the connection') if v1['total_retr...
Imports: ```python from qiskit.chemistry.algorithms.pes_samplers.potentials.potential_base import PotentialBase from qiskit.chemistry.drivers import Molecule import qiskit.chemistry.constants as const import typing ``` Type definitions: Input Types: int Output Type: float Dependencies: Function Name: v0 Function: ```...
Imports: ```python import typing ``` Type definitions: Input Types: nx.DiGraph Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: nx.DiGraph): (v2, v3) = self._get_ns_id(graph=v1, node_name=self.query.source) (v4, v5) = self._get_ns_id(graph=v1, node_name=self.query.target) ...
Imports: ```python from pathlib import Path import typing ``` Type definitions: Input Types: Output Type: Path Dependencies: Function Name: v0 Function: ```python def v0(self, *v1) -> Path: v2 = Path(self._tempdir.name).absolute() return self._makedirs_join(*v1, root_dir=v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: 'List[int]' Output Type: 'int' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'List[int]') -> 'int': v2 = len(v1) if v2 == 0: return 0 (v3, v4, v5) = (0, 0, v1[0]) for v6 in range(1, v2): if v6 > ...
Imports: ```python import typing ``` Type definitions: Input Types: Mapping[str, str] Output Type: Optional[float] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Mapping[str, str]) -> Optional[float]: v2 = v1.get('font-size') if v2 is None: return v2 return self._pt_to_float(...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: for (v2, v3) in self.patterns_.items(): if v2.match(v1): return v3 return 'O' ```
Imports: ```python import torch import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): self.checkpoint_path.mkdir(exist_ok=True, parents=True) if len(self.get_checkpoint_files()) > self.max_checkpoints: self.remo...
Imports: ```python from qiskit.transpiler import CouplingMap, InstructionDurations, TranspilerError from qiskit.providers.fake_provider import FakeMontrealV2 import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0(v1, v2, v3='dt'): for v4 in range(self.num_qubits): ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> bool: v2 = len(self.d[v1]) == 0 self.d[v1].add(len(self.l)) self.l.append(v1) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: np.array Output Type: List[float] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.array) -> List[float]: v2 = self._ptm_matrix_values(v1) v3 = [] v4 = len(self.Gs) v5 = 2 ** self.qubits v6 = v5 ** 2 v7 ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str='') -> None: v2 = self.get_button_text('disable_auto_rollbacks', is_active=False) super().start_auto_rollback_countdown(extra_text=f'Click "{v2}" t...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, bool Output Type: Dict[str, str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: bool) -> Dict[str, str]: v4 = {'dash': '-', 'underscore': '_'} v5 = {} v5.update({f'{sep_name}_{v1}': f'{sep...
Imports: ```python import cvxpy as cp import cvxpy.settings as s from cvxpy.transforms.partial_optimize import partial_optimize from cvxpy.expressions.variable import Variable from cvxpy.expressions.constants import Parameter, Constant from cvxpy.reductions.solvers.defines import INSTALLED_MI_SOLVERS import numpy as np...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1, v2, v3: str=None, **v4): async with self.session.request(v1, v2, **v4) as v5: if not v3: return v5 v6 = getattr(...
Imports: ```python from datetime import datetime, timezone import typing ``` Type definitions: Input Types: dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: dict) -> dict: v1['create_date'] = datetime.now(timezone.utc) return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): if 'USD' in v1 and 'JPY' in v1: return 1 / 100 else: return 1 / 10000 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: v1 = [self.get_transaction(h) for v2 in self.get_best_block_tips()] v3 = 0 for v4 in v1: v5 = v4.get_metadata().height if v5 > v3: ...
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 '#' in v1: return v1.split('#')[0].rstrip() return v1.rstrip() ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: np.ndarray Dependencies: ```python def v0(v1: int, v2: [tuple], v3=-1, v4=False) -> np.ndarray: v5 = np.identity(v1, dtype=np.float) for v6 in v2: (v7, v8, v9) = v6 v10 = np.cos(v9) ...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: bool) -> str: if v1: return '&check;' return '' ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self._unzip() v1 = self.temp / 'ffmpeg' self._cleanup(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: JavaParserLabeled.ClassDeclarationContext Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: JavaParserLabeled.ClassDeclarationContext): print('Refactoring started, please wait...') if self.objective_class =...
Imports: ```python import typing ``` Type definitions: ```python v0 = Union[int, float, str] ``` Input Types: str, Dict[str, v0], bool Output Type: Any Dependencies: Function Name: v1 Function: ```python def v1(self, v2: str, v3: Dict[str, v0], v4: bool=False): if v4: if self.admin_loop is None: ...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.conv import Conv2d import typing ``` Type definitions: Input Types: nn.Module, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: nn.Module, v2): if torch.cuda.is_available(...
Imports: ```python import typing ``` Type definitions: ```python class v0(BaseClient): def __init__(self, v1: str, v2: str, v3: bool, v4: bool): v5 = {'X-Auth-Token': v2, 'Accept': 'application/json', 'Content-Type': 'application/json'} super().__init__(v1, headers=v5, verify=v3, proxy=v4) def...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> int: v2 = int(v1[:-1]) v3 = v1[-1] v4 = {'m': 60, 'h': 60 * 60, 'd': 60 * 60 * 24, 'w': 60 * 60 * 24 * 7} return v2 * v4[v3] * 1000 ```
Imports: ```python import numpy import numpy as np from numpy import linalg as LA import cvxpy as cp import cvxpy.interface as intf import cvxpy.settings as s from cvxpy.constraints import PSD, ExpCone, NonPos, Zero from cvxpy.error import DCPError, ParameterError, SolverError from cvxpy.expressions.constants import Co...
Imports: ```python import typing ``` Type definitions: Input Types: object Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: object=None) -> None: assert self._validate() if self._nick_entry is None: v2 = self._initial_config['nick'] else: v2 = self._ni...
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor) -> torch.Tensor: v2 = v1.shape[0] v3 = v1.view(-1, *self.in_shape.tolist()) v4 = [0] v4.extend([self.in_num - i ...
Imports: ```python import torch import copy import random import tqdm import json from pathlib import Path import multiprocessing import numpy as np from functools import partial from collections import defaultdict import typing ``` Type definitions: Input Types: str, str, str, int, int, int, bool, bool Output Type: N...
Imports: ```python import urllib import requests import typing ``` Type definitions: Input Types: str Output Type: List[Mapping[str, Any]] Dependencies: ```python def v0(v1: Mapping[str, Any]) -> bool: v2 = source_str in v1['label'][0] v2 = v2 or any((source_str in alias for v3 in v1['alias'])) v4 = v1['de...
Imports: ```python import math import typing ``` Type definitions: Input Types: float, Optional[float], Optional[float] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: Optional[float], v3: Optional[float]=None) -> str: if v2 is None: return str(v1) if v3 is N...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: str Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> pd.DataFrame: v2 = self.get_nav(isin=v1) return pd.DataFrame(data=v2['navPerUnit'], index=pd.DatetimeIndex(v2['date...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: (np.ndarray, np.ndarray, np.ndarray, np.ndarray) Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str=None) -> (np.ndarray, np.ndarray, np.ndarray, np.ndarray): if v2 is None: v3 = self._...
Imports: ```python import numpy import typing ``` Type definitions: Input Types: numpy.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: numpy.ndarray): v2 = numpy.reshape(v1, (1, -1)) v3 = self.pca.transform(X=v2) v4 = self.regressor.predict(X=v3)[0] return...
Imports: ```python import gzip from pathlib import Path import typing ``` Type definitions: Input Types: typing.Union[Path, str], str, bool Output Type: typing.IO[typing.Any] Dependencies: Function Name: v0 Function: ```python def v0(v1: typing.Union[Path, str], v2: str='r', v3: bool=True) -> typing.IO[typing.Any]: ...
Imports: ```python import typing ``` Type definitions: Input Types: tuple, np.matrix, list[tuple] Output Type: Sequence[tuple] Dependencies: Function Name: v0 Function: ```python def v0(v1: tuple, v2: np.matrix, v3: list[tuple]) -> Sequence[tuple]: (v4, v5) = v2.shape v6 = [(v1[0], v1[1] + 1), (v1[0], v1[1] -...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: bool): self.title += '.' ``` Function Name: v2 Function: ```python def v2(self, v3: str): def v4(v5: bool): self.title += '.' return v4 ```
Imports: ```python import typing ``` Type definitions: Input Types: Tensor, Tensor, Optional[Tensor] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor, v2: Tensor, v3: Optional[Tensor]=None): self.train_X = v1 self.train_Y = v2 self.train_Yvar = v3 ```
Imports: ```python import os import numpy as np import typing ``` Type definitions: Input Types: Union[PosixPath, str], Sequence[float], Any Output Type: Tuple[List[Union[PosixPath, str]], List[Union[PosixPath, str]], List[Union[PosixPath, str]]] Dependencies: ```python def v0(v1: List[str]): return [os.path.join(...
Imports: ```python import typing ``` Type definitions: Input Types: Callable, Any Output Type: Any Dependencies: ```python def v0(v1, v2): return v2[v1:] ``` Function Name: v3 Function: ```python def v3(v4: Callable, v5): v6 = None for (v7, v8) in enumerate(v5): if not v4(v8): v6 = v7 ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any) -> bool: if isinstance(v1, list) and isinstance(self.op, list): return all((x in self.op for v2 in v1)) else: return v1 in self.op...
Imports: ```python import subprocess import typing ``` Type definitions: Input Types: Any, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: str) -> None: v3 = v1['summary'][:len("'s birthday") + 1] v4 = v1['start'].get('dateTime', v1['start'].get('date')) print(f'Se...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('IntervalArrayT', bound='IntervalArray') ``` Input Types: Any, Any, Any Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(self: v0, v2=None, v3=None, v4=None) -> v0: if v3 is not None: raise TypeError('Fi...
Imports: ```python import typing ``` Type definitions: Input Types: payload.Payload Output Type: 'Tracker' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: payload.Payload) -> 'Tracker': for v2 in self.emitters: v2.input(v1.nv_pairs) return self ```
Imports: ```python import typing ``` Type definitions: Input Types: int, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: str=''): self._score += v1 v3 = '' if v1 < 0 else '+' self._log.append(f'{v3}{v1} :: {v2}') ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: v2 = np.sum([o['pre'] for v3 in v1], axis=0) v4 = np.sum([v3['cor'] for v3 in v1], axis=0) v5 = np.sum([v3['true'] for ...
Imports: ```python import json import os import tarfile import tensorflow.compat.v2 as tf import typing ``` Type definitions: Input Types: tfds.download.DownloadManager Output Type: Any Dependencies: ```python def v0(v1: tfds.download.DownloadManager): with tf.io.gfile.GFile(v1.download(_MULTI_LABELS_URL), 'r') as...
Imports: ```python import torch from torch import multiprocessing as mp from torch import nn from torch.nn import functional as F import typing ``` Type definitions: ```python v0 = typing.Dict[str, typing.List[torch.Tensor]] ``` Input Types: Any, mp.SimpleQueue, mp.SimpleQueue, v0, Any, Any Output Type: Any Dependencie...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: v1 = self.current_file.get('script', {}).get('script', '') not in ['-', ''] if v1: return True v2 = [self.check_separators_in_folder(), s...
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 = {'ip-src': 'ip', 'ip-dst': 'ip', 'pattern-in-file': 'filepath', 'target-email': 'email', 'email-src': 'email', 'email-dst': 'email', 'vuln...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1, **v2: Any) -> None: v3 = self.get_monitor_value() if v3 is None: return if self.operator(v3 - self.min_delta, self.best): (self.bes...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: 'DataArray' Dependencies: Function Name: v0 Function: ```python def v0(self, **v1) -> 'DataArray': v2 = self.copy(deep=False) return v2.load(**v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = 'example.docx' v2 = self._send_request(v1, data={'structure_type': 'linear'}) v3 = v2['content']['structure']['subparagraphs'] self.asse...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2=None): if '.' in v1: return self.contents[v1] v3 = [] for (v4, v5) in self.contents.items(): if v4.startswith(v1): ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: typing.NoReturn Dependencies: Function Name: v0 Function: ```python def v0(self) -> typing.NoReturn: self.__solve_max() self.__solve_min() ```
Imports: ```python from copy import deepcopy from functools import partial, reduce import typing ``` Type definitions: Input Types: List[Any], List[Any] Output Type: List[Any] Dependencies: ```python def v0(v1: dict, v2: dict) -> dict: return cut_(d1=v1, d2=v2, list_strategy=_cut_list_strategy) ``` Function Name: ...
Imports: ```python import cv2 import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray) -> np.ndarray: v1 = -1 * np.log(v1) v1 = (v1 / np.max(v1) * 255).astype(np.uint8) v2 = cv2.applyCo...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: Any Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> pd.DataFrame: for v2 in v1.columns.values.tolist(): self.column = str(v2) self.frame = pd.DataFrame(v1[self....
Imports: ```python import torch from torch import nn import typing ``` Type definitions: Input Types: experience.EpochTrajectories Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: experience.EpochTrajectories): v2 = torch.optim.Adam(self.policy.net.parameters(), lr=0.01) v...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1 = jinja2.PackageLoader('pandas', 'io/formats/templates') v2 = jinja2.Environment(loader=v1, trim_blocks=True) v3 = v2.get_template('html.tpl') def __init__(self, v4: FrameOrSeriesUnion, v5: Optional[int]=None, v6: Optional[CS...
Imports: ```python import typing ``` Type definitions: Input Types: Union[Iterable[str], str] Output Type: List[str] Dependencies: ```python def v0(v1: str) -> str: if not v1.startswith(('http://', 'https://')): return 'http://' + v1 return v1 ``` Function Name: v2 Function: ```python def v2(v3: Union[...
Imports: ```python import re import typing ``` Type definitions: Input Types: str, str, str Output Type: str Dependencies: ```python def v0(v1: str) -> str: v2 = SpecifierSet(v1) (v3, v4) = sorted(v2, key=str) v5 = list() v5.append(f'{v3} *, *{v4}') v5.append(f'{v4} *, *{v3}') return '|'.join(v...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: if not self._copy_paste_enabled: return False self._copy() if self._selection_surface: self._remove_selection() return Tr...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: (int, int) Dependencies: Function Name: v0 Function: ```python def v0(self) -> (int, int): for v1 in range(len(self.alphabet)): for v2 in range(len(self.alphabet)): yield (v1, v2) ```
Imports: ```python import typing ``` Type definitions: ```python class v0(disnake.ui.View): async def v1(self, v2: disnake.MessageInteraction) -> bool: return v2.author == self.ctx.author and v2.channel == self.ctx.channel def __init__(self, v3, v4: 'File', v5=None, v6=None, v7: list[str]=None): ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: str, v4: str) -> None: if self.__mp: self.__mp.people_set(v1, {'$first_name': v2, '$last_name': v3, '$email': v4})...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = self.get_batch_template_path() with open(v1, 'r') as v2: return v2.read() ```
Imports: ```python import os import subprocess import typing ``` Type definitions: Input Types: os.path, os.path Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: os.path, v2: os.path): os.mkdir(v2) v3 = [pcd_file for v4 in os.listdir(v1) if os.path.isfile(os.path.join(v1, v4))] ...
Imports: ```python import calendar import datetime import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: ```python def v0(v1: str): try: v2 = COURSES[v1] except KeyError as e: v2 = [] return v2 ``` ```python def v3(v4: str=None) -> list: v5 = [] if not...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): (v2, v3) = self.full_name.split('/') return self.get_release_by_tag(v2, v3, v1) ```
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.widget: if self.widget.winfo_class() in ('Button', 'TButton', 'Label', 'TLabel', 'Radiobutton'): if self.widget['text'...
Imports: ```python import typing ``` Type definitions: Input Types: int, float, float Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: float, v3: float) -> None: v4 = v1 * v2 v5 = v4 * v3 v6 = v4 - v5 print('Regular price:', '%.2f' % v4) print('Discount:', ...
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: tf.Tensor, tf.Tensor Output Type: List[tf.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: tf.Tensor, v2: tf.Tensor) -> List[tf.Tensor]: with tf.GradientTape() as v3: v3.watch(self.netwo...
Imports: ```python import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: str): v3 = v1.objects.filter(connection_id=v2).order_by('-created').first() if not v3: raise RuntimeError(f'Not found: {v1} with connection_i...
Imports: ```python import weakref import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0(v1: weakref.WeakMethod) -> typing.Callable[[event_manager_.EventT], typing.Coroutine[typing.Any, typing.Any, None]]: async def v2(v3: event_manager_.EventT) -> None: v4 = v1...
Imports: ```python from pandas._config import get_option from pandas._libs import algos as libalgos, lib, properties from pandas._libs.hashtable import duplicated from pandas._libs.lib import no_default from pandas._typing import AggFuncType, AnyArrayLike, ArrayLike, Axes, Axis, ColspaceArgType, CompressionOptions, Dty...
Imports: ```python import typing ``` Type definitions: Input Types: any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: any) -> None: if v1.x < 0 or v1.x >= 288 or v1.y < 0 or (v1.y >= 416): return v2 = v1.x >> 5 v3 = v1.y >> 5 v4 = v2 + v3 * 9 if v4 ...