text
stringlengths
190
325k
Imports: ```python import inspect import torch import torch.fx from torch.fx.node import _get_qualified_name import typing ``` Type definitions: Input Types: Tuple[str, Union[str, Callable]], Optional[List[Union[Tuple[Union[str, Tuple[str, ...]], str], Tuple[Union[str, Tuple[str, ...]], str, bool]]]], Optional[List[Un...
Imports: ```python from datetime import timedelta import numpy as np from pandas._libs import Timedelta, Timestamp, lib, ops as libops from pandas._typing import ArrayLike from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike, find_common_type, maybe_upcast_putmask from pandas.core.dtypes.common i...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Tuple[List[botbowl.Action], float] Dependencies: ```python def v0(v1): return botbowl.ai.make_bot('random').act(v1) ``` Function Name: v2 Function: ```python def v2(v3) -> Tuple[List[botbowl.Action], float]: v4 = v0(v3) re...
Imports: ```python import sys import typing ``` Type definitions: Input Types: Path Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: Path) -> bool: v2 = v1.joinpath('Scripts' if sys.platform.startswith('win') else 'bin') try: if not v2.is_dir(): return False...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Iterator[dict] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Iterator[dict]: v1 = self.dynamodb_table.meta.client.get_paginator('scan') yield from (item for v2 in v1.paginate(TableName=self.dynamodb_table.n...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if not v1: raise ValueError('file_name must be provided') if not isinstance(v1, str): raise ValueError('file_name must be a str, i...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, List[str] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3: List[str]=None): if v3 is None: v3 = [] v3.append(v2) return {'type': v1, 'holder': v2, 'account_holders': v3} `...
Imports: ```python import os import signal import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: os.kill(self.apiServerPid, signal.SIGTERM) self.logger.info(f'botApiServer terminated (pid {self.apiServerPid})') ```
Imports: ```python import datetime import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0() -> str: v1 = datetime.datetime.now() v2 = ''.join(str(v1).replace(' ', '').replace('-', '').split(':')[0:2]) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: sqlite3.Connection Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: sqlite3.Connection): with v1: v1.execute('DROP TABLE IF EXISTS iso639') v1.execute('\n CREATE TABLE iso639 (\n ...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python class v0: def __init__(self, v1: np.ndarray, v2: Union[List, str], v3: Optional[np.array]=None, v4: Optional[np.array]=None, v5: int=385): if v5 not in [384, 1536]: raise ValueError('invalid size. options: [384,...
Imports: ```python from hashlib import md5 import typing ``` Type definitions: Input Types: int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> str: v2 = md5(self.email.lower().encode()).hexdigest() return f'https://gravatar.com/avatar/{v2}?d=identicon&s={v1}' ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.model.grid.remove_agent(self) self.model.schedule.remove(self) self.dead = True ```
Imports: ```python import logging import inspect import typing ``` Type definitions: ```python class v0(Enum): v1 = 0 v2 = 1 v3 = 2 ``` Input Types: dict, dict, tuple[type] Output Type: str Dependencies: ```python def v4(v5, v6: list[str]=[], v7: list[str]=['pass'], v8: dict={}): v9 = '\n ' + '\n ...
Imports: ```python import threading from threading import Thread import typing ``` Type definitions: Input Types: int, str, List[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: str, v3: List[str]=None) -> None: self.node_id = v1 self.attach_to = v3 = v3 or ...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Tuple[str, str, str, str] Dependencies: ```python def v0(v1: dict) -> str: if v1.get('inn') is None: return v1['chosen_employer_name'] else: return f"{v1['chosen_employer_name']} (ИНН {v1['inn']})" ``` Functio...
Imports: ```python import re import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = re.compile('"event":"FSDJump", "StarSystem":"(.*?)"') v3 = v2.findall(v1) return v3 ```
Imports: ```python import re import typing ``` Type definitions: ```python v0 = typing.Union[disnake.Interaction, commands.Context] ``` Input Types: v0, Any Output Type: Any Dependencies: Function Name: v1 Function: ```python async def v1(self, v2: v0, v3): v4 = {} if self.embed: v4['embed'] = self.emb...
Imports: ```python import random from itertools import count import torch from torch import nn from torch import optim import typing ``` Type definitions: Input Types: Any Output Type: (float, int) Dependencies: Function Name: v0 Function: ```python def v0(self, v1=False) -> (float, int): v2 = self._reset_env() ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: List[Tuple[int, str]] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> List[Tuple[int, str]]: v2 = '# mypy: ' if v2 not in v1: return [] v3 = v1.split('\n') v4 = [] for (v5, v6) in en...
Imports: ```python import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: str): v3 = self.data.generic.get_file_by_name(v2) v3.write(v1) ```
Imports: ```python import typing ``` Type definitions: ```python v0 = Union[bytes, str] ``` Input Types: v0 Output Type: bytes Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0) -> bytes: if type(v2) is bytes: return v2 if type(v2) is int: return bytes([v2]) if type(v2...
Imports: ```python import cv2 import numpy as np import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: Optional[float] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, v3) -> Optional[float]: v4 = v1.shape[0] - v2 v5 = [] cv2.imshow('data', v1) v6 = cv2.in...
Imports: ```python import math import typing ``` Type definitions: Input Types: float Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: float) -> float: if v1 < 0 or v1 > 1: raise ValueError('expected to have value in [0, 1]') return 6 * math.pow(v1, 5) - 15 * math.pow(...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[str]: v1 = self.list_images() v2 = self._get_annotated_images() return [image for v3 in v1 if v3 in v2] ```
Imports: ```python import requests import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> bool: v2 = requests.get('https://api.spotify.com/v1/me', headers={'Authorization': f'Bearer {v1}'}) if v2.status_code == 200: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: dict, dict Output Type: Tuple[np.array, np.array] Dependencies: ```python def v0(v1: Union[List[Tuple[any, any]], List[List[any]]]) -> Dict[any, List[any]]: v2 = {} for v3 in v1: v2[v3[0]] = v2.get(v3[0], []) ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> bool: v1 = v1.strip() return not v1 or v1 == '-DOCSTART- -X- -X- O' ```
Imports: ```python import typing ``` Type definitions: Input Types: float, float Output Type: Generator[Tuple, None, None] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float) -> Generator[Tuple, None, None]: v3 = 'SELECT DISTINCT T.vehicle_id\n FROM Trajectory ...
Imports: ```python import warnings import typing ``` Type definitions: Input Types: Optional[str], Container[str] Output Type: str Dependencies: ```python def v0(v1: str, v2: Container[str]) -> str: if v1 is not None and v1 not in v2: warnings.warn(f'{v1!r} is not one of {v2!r}', LMFWarning) return v1 ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> int: self.kill_list.append(v1) v2 = -1 if len(self.kill_list) >= 3: if self.active == self.kill_list: self.kill_list = [] ...
Imports: ```python import numpy as np import torch from torch import Tensor import typing ``` Type definitions: Input Types: Tensor, Tensor, Tensor, Tensor, float, bool Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: Tensor, v2: Tensor, v3: Tensor, v4: Tensor, v5: float=1e-08, v6: b...
Imports: ```python import asyncio import typing ``` Type definitions: ```python v0 = TypeVar('A') ``` Input Types: Iterable[Awaitable[v0]] Output Type: Iterable[Awaitable[v0]] Dependencies: Function Name: v1 Function: ```python def v1(v2: Iterable[Awaitable[v0]]) -> Iterable[Awaitable[v0]]: v3 = v2 v3 = [async...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, int Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray, v2: int) -> Dict[str, Any]: v3 = {} v4 = self.rt_posterior assert v4 is not None for (v5, ...
Imports: ```python import itertools import typing ``` Type definitions: Input Types: typing.Mapping[str, str] Output Type: typing.Mapping Dependencies: Function Name: v0 Function: ```python def v0(self, v1: typing.Mapping[str, str]) -> typing.Mapping: v2 = {} v3 = [x.split(self.delimiter) for v4 in v1.keys()]...
Imports: ```python import numpy as np from cvxpy import Minimize, Problem, Parameter, Maximize from cvxpy.atoms import QuadForm, abs, power, quad_over_lin, sum, sum_squares, norm, huber, matrix_frac from cvxpy.reductions.solvers.defines import QP_SOLVERS, INSTALLED_SOLVERS from cvxpy.expressions.variable import Variabl...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> int: v2 = [[token.text for v3 in sent] for v4 in self.nlp_doc.sents] return len(v2) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int, int, int, bool, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: int, v4: bool, v5: int): (self._check_valid_state(v1), self._check_valid_state(v5)) self._chec...
Imports: ```python import typing ``` Type definitions: ```python v0 = etree._Element ``` ```python v1 = Dict[str, str] ``` ```python v2 = Tuple[GeomDict, str] ``` Input Types: v0, v1 Output Type: v2 Dependencies: ```python def v3(*v4: List[Optional[str]]) -> Optional[str]: v4 = set(v4) if None in v4: v4...
Imports: ```python import typing ``` Type definitions: Input Types: Set[int] Output Type: Set[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Set[int]) -> Set[int]: v2 = set() v2.update(v1) return v2 ```
Imports: ```python import itertools import numpy as np import scipy.stats as st import typing ``` Type definitions: Input Types: np.ndarray, int, np.random.RandomState, int, float, int Output Type: Any Dependencies: ```python def v0(v1: np.ndarray, v2: np.ndarray, v3: np.ndarray): v4 = np.empty(shape=(v1.shape[0],...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1: bool v2: bool v3: Dict[Move, 'GameTreeNode'] v4: List[Move] v5: Dict[Move, 'GameTreeNode'] v6: Move v7: Move v8: ValueProxy def __init__(self, v9: Position, v10: Move, v11: ValueProxyBatch, v12: int): ...
Imports: ```python import typing ``` Type definitions: Input Types: ast.ImportFrom Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: ast.ImportFrom) -> None: for v2 in v1.names: if v1.module is not None and (not v2.asname): self._from_imports[v2.name] = v1....
Imports: ```python import os import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: assert self.filename return os.path.join(os.path.dirname(self.filename), self.changelog.directory) ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> int: if type(v1) == int and v1 > 0: return v1 v2 = str(v1) if len(v2) == 0: return None if '#' == v2[0:1]: v2 = v2[1:]...
Imports: ```python from tqdm import tqdm import typing ``` Type definitions: Input Types: dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: dict) -> dict: for (v2, v3) in tqdm(v1.items(), desc='get_offset'): v4 = min(v3['seq']) v1[v2]['seq'] = {i - v4 for v5 in ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any) -> None: v2 = v1(self, self.event_engine) self.engines[v2.engine_name] = v2 ```
Imports: ```python import traceback import typing ``` Type definitions: Input Types: List[Tuple[str, tuple]], str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[Tuple[str, tuple]], v2: str=None): v3 = self._get_connection() v4 = self._get_cursor(v3, cursor_type=v2) ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: tp.List[tp.Any] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: tp.List[tp.Any]) -> None: v2 = [v1] if self._repetitions is None else v1 self._check_frozen() v3: np.ndarray = -1 * ...
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 = 'terminate "%s" "%s"' % (self.udid, v1) self._run_command(v2) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, int, bool Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: int, v3: bool) -> int: v4 = self.calc_camera_fps(v1, v2) if v3: v5 = np.array(self.PRESETS['STANDARD_FPS_VALUE...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> str: v3 = bin(v1)[2:] v4 = len(v3) v5 = v2 // v4 return v3 * v5 + v3[:v2 - v4 * v5] ```
Imports: ```python import random import typing ``` Type definitions: Input Types: Dict, int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict, v2: int=1, v3: Any=''): v4 = list(v1.keys()) v5 = [v1[v2] for v2 in v4] v6 = 1 - sum(v5) v4.append(v3) v5.append(v6...
Imports: ```python import typing ``` Type definitions: Input Types: List[Any], int Output Type: List[Any] Dependencies: ```python def v0(v1, v2): assert len(v1) >= v2, f'{(len(v1), v2)}' v3 = len(v1) // v2 v4 = [v1[i] for v5 in range(0, len(v1), v3)] return v4[:v2] ``` Function Name: v6 Function: ```py...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Axes Dependencies: Function Name: v0 Function: ```python def v0(self) -> Axes: v1 = self.axes[self._it] self._it += 1 if self._it >= len(self.axes): self.flag_end_of_page = True return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool): v2 = self._get_proposal_text(v1) self.image.blit(v2, self._get_text_position(v2.get_width(), v2.get_height())) ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: bool Dependencies: ```python def v0(v1: hou.Parm) -> bool: v2 = v1.parmTemplate() if isinstance(v2, hou.StringParmTemplate): if v2.stringType() == hou.stringParmType.NodeReference: v3 = v1.eval() ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self) -> np.ndarray: v1 = self.data_y[:, self._y_idx] self._y_idx += 1 return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: bool Dependencies: ```python def v0(v1: str) -> Optional[str]: v2 = DBpediaTaxonomyExtractor(is_debug=IS_DEBUG, input_text=v1).process() if v2: return v2 return 'NULL' ``` Function Name: v3 Function: ```python...
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): if 'clientes' not in self.dados: self.dados['clientes'] = {v1: v2} else: self.dados['clientes'].update({v1: v2}) ```
Imports: ```python import scipy from scipy import sparse from scipy.sparse import csr_matrix, csgraph from scipy.sparse.csgraph import minimum_spanning_tree, connected_components import typing ``` Type definitions: Input Types: igraph.Graph, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor, float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: float): v3 = v1 v4 = 2 v5 = torch.index_select(v1, v4, torch.linspace(start=0, end=v1.shape[v4] - 1, steps=...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict[str, Dict[str, paddle.to_tensor]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict[str, Dict[str, paddle.to_tensor]]: v1 = {} for (v2, v3) in self.model_dict.items(): v1[v2] = v3.state_dict()...
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[0] for v3 in range(len(v1) - 1): if v1[v3].isdigit() and v1[v3 + 1] == 'x': v2 += '*' v2 += v1[v3 + 1] ...
Imports: ```python import typing ``` Type definitions: Input Types: List[int], int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: int) -> int: v3 = len(v1) (v4, v5) = (0, v3 - v2 - 1) v6 = v7 = sum(v1[:v3 - v2]) while v5 < v3 - 1: v6 += v1[...
Imports: ```python import requests from requests.models import HTTPError import typing ``` Type definitions: Input Types: str, str, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3: str) -> str: v4 = {'Authorization': f'Bearer {v1}'} v5 = {'long_url': v3} ...
Imports: ```python import typing ``` Type definitions: Input Types: list, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2: str='beta'): v3 = {'0': 'x', '1': 'y', '2': 'z'} v4 = '' for v5 in v1: v6 = v5.split('_') if v6[0] == 'grad': ...
Imports: ```python import logging import os import typing ``` Type definitions: Input Types: str Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> List[str]: if not os.path.isdir(v1): raise NotADirectoryError v2 = logging.getLogger(__name__) v3 = os.path...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.topic_summary.total_published_node_count = -1 self._assert_validation_error("Expected total_published_node_count to be non-negative, received '-...
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch import Tensor import typing ``` Type definitions: Input Types: Tensor Output Type: Tensor Dependencies: ```python def v0(v1: Tensor) -> Tensor: return torch.cat([torch.cos(v1), torch.sin(v1)...
Imports: ```python import torch from torch import nn from torch.nn import Dropout, Parameter, Linear, LeakyReLU, ModuleList from torch.nn import ELU, LogSoftmax import torch.nn.functional as F import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: torch.Tensor Dependencies: Function ...
Imports: ```python from tqdm import tqdm import sys import typing ``` Type definitions: Input Types: bool, Iterable Output Type: Union[tqdm, Iterable] Dependencies: Function Name: v0 Function: ```python def v0(v1: bool, v2: Iterable) -> Union[tqdm, Iterable]: if v1: return tqdm(v2, file=sys.stdout) el...
Imports: ```python from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.remote.webelement import WebElement import typing ``` Type definitions: Input Types: WebElement Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: WebElement): for (v2, v3) i...
Imports: ```python import random import typing ``` Type definitions: Input Types: ba.Player Output Type: ba.Actor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: ba.Player) -> ba.Actor: v1.gamedata['has_been_hurt'] = False v2 = (self._spawn_center[0] + random.uniform(-1.5, 1.5), self._spa...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): if v1 not in range(self.num_states): raise ValueError('State id is wrong! Input:{}; Valid inputs: {}'.format(v1, range(self.num_states))) ```
Imports: ```python import signal from keras.models import load_model from keras.applications import imagenet_utils from keras.preprocessing.image import img_to_array import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> None: ...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python class v0: def __init__(self, v1: np.ndarray, v2: np.ndarray, v3: Iterable[int], v4: np.random.RandomState, v5: Dict[str, Any]): """ Args: target_tensor: The state vector to act on, stored as a numpy arra...
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 not in self._token2index: self._token2index[v1] = len(self._token2index) self._index2token.append(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: int, bool, int Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=5, v2: bool=True, v3: int=None) -> pd.DataFrame: v4 = self._df.sample(n=v1, replace=False, random_state=v3) v5 = '{} Randomly Se...
Imports: ```python import cv2 from cv2 import dnn from .resource import predictor_5_point_model_location, predictor_68_point_model_location, cnn_face_detector_model_location, face_recognition_model_location, dnn_prototxt_location, dnn_caffemodel_location, haarcascade_frontalface_location import typing ``` Type definiti...
Imports: ```python import typing ``` Type definitions: Input Types: ast.Assign Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: ast.Assign): v2: List[Tuple[str, Optional[ast.AST]]] = [] for v3 in v1.targets: v4 = None v5 = self.visit(v3) if isinstan...
Imports: ```python 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(v1: np.ndarray, v2: np.ndarray) -> np.ndarray: v3 = v1 / v2[:, None] v4 = np.dot(v3.T, v3) return v4 ```
Imports: ```python import torch import torch.nn as nn import torch.nn.functional as F import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any, Any, Any Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, v3, v4, v5, v6, v7, **v8) -> dict: v9 = F.log_softmax(...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, bool Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=0, v2: int=0, v3: bool=True) -> bool: (v4, v5) = self.coords.real_coords() v6 = v4 + v1 v7 = v5 + v2 v8 = self.parent.map.allow_...
Imports: ```python import typing ``` Type definitions: Input Types: domain.Category, Dict[domain.Category, Dict], bool Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: domain.Category, v2: Dict[domain.Category, Dict], v3: bool) -> bool: v4 = v2.get(v1) if v4 is None or 'endorse...
Imports: ```python import typing ``` Type definitions: Input Types: str, List[int], str, bool, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: List[int], v3: str='', v4: bool=False, v5: bool=True): if self.df_new is None: self._form_agg() v6 = self.d...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Union['Conformer', 'RDKitConf'], Union[tuple, list, np.ndarray] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Union['Conformer', 'RDKitConf'], v2: Union[tuple, list, np.ndarray]): try: ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): if v1 > len(self.images): raise ValueError('Requested image number is not present in series') return self.images[v1 - 1] ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str | None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str | None: v2 = self.db.collection(u'linebot').document(u'user').get().to_dict() return v2[v1] if v1 in v2 else None ```
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]: assert isinstance(v1, str) assert v1[-1] == '/' v2 = f'{self.root}/{v1}' try: v3 = self.fs.find(v2, withdirs=Fa...
Imports: ```python import typing ``` Type definitions: Input Types: Iterable[str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: Iterable[str]) -> str: v2 = ', '.join([f'[{index}, {group!r}]' for (v3, v4) in enumerate(v1)]) return f"\n function(params){{\n const conv...
Imports: ```python import typing ``` Type definitions: Input Types: tp.Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: tp.Any) -> None: v2 = registry['CMA'](2, budget=300, num_workers=4) [v2.ask() for v3 in range(4)] v4 = v1.readouterr() assert v4.out == '' ass...
Imports: ```python import typing ``` Type definitions: Input Types: Dict, Dict Output Type: List[Tuple] Dependencies: ```python def v0(v1: List[Tuple]) -> List[Tuple]: return list(set([tuple(sorted(i)) for v2 in v1])) ``` Function Name: v3 Function: ```python def v3(v4: Dict, v5: Dict) -> List[Tuple]: v6 = [] ...
Imports: ```python import typing ``` Type definitions: Input Types: p.TableReferenceList Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: p.TableReferenceList) -> None: self.visit(v1.left_paren) self.write_comma_list(v1.references, with_space=False) self.visit(v1.righ...
Imports: ```python import shutil import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.db.shutdown() shutil.rmtree(self.data_dir) shutil.rmtree(self.build_dir) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: float, float, float Output Type: Tuple[bool, float] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float, v3: float) -> Tuple[bool, float]: v4 = v1 - v2 if v4 < v3: return (True, v4)...
Imports: ```python import typing ``` Type definitions: Input Types: Tensor, Tensor, Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor, v2: Tensor, v3: Tensor): if not self.by_epoch: self.lr_scheduler.step() self.trainer.states['metrics']['train']['...
Imports: ```python import typing ``` Type definitions: Input Types: Tensor, Tensor Output Type: Tuple[Tensor, Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor, v2: Tensor) -> Tuple[Tensor, Tensor]: v3 = self.word_embedding(v1) v4 = self.context_embedding(v2) return (v3, ...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.DataFrame) -> pd.DataFrame: v2 = v1[v1[self._target_name].isnull()].index.tolist() v3 = v1[v1.index.isin(v2)][self._feature_names] ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1 = self.push_dataset.copy() del v1['datasources'] for v2 in v1['tables']: del v2['rows'] return v1 ```