text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: List[List[str]], Callable[[List[List[str]]], List[str]], Callable[[List[List[str]]], List[str]] Output Type: Tuple[int] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[List[str]], v2: Callable[[List[List[str]]], List[str]], v3: Ca...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.DataFrame): if v1.empty: return v1 v2 = [feat.short_name for v3 in self._categorical_features] v4 = v1[v2] ...
Imports: ```python import numpy as np from sklearn.base import BaseEstimator from sklearn.preprocessing import StandardScaler from sklearn.utils.validation import check_is_fitted, check_X_y import typing ``` Type definitions: Input Types: Union[pd.DataFrame, np.ndarray] Output Type: np.ndarray Dependencies: Function ...
Imports: ```python import typing ``` Type definitions: Input Types: bytes, bytes Output Type: Any Dependencies: ```python def v0(v1, v2): for v3 in range(0, len(v1), v2): yield v1[v3:v3 + v2] ``` Function Name: v4 Function: ```python def v4(self, v5: bytes, v6: bytes=None): print('[DEBUG] flash_firmwar...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: np.ndarray): v3 = np.concatenate((v1, np.ones((v1.shape[0], 1))), axis=1) return v3.dot(v2.T)[:, :3] ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0() -> bytes: with open('test/ITEE_Upcoming_Seminars_empty.html', 'rb') as v1: return v1.read() ```
Imports: ```python import os from os.path import join import pickle import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): for v2 in range(self._timesteps - 1): with open(join(self._save_dir, '%d.replay' % (self._r...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0() -> Iterable[Tuple[str, int]]: for v1 in open(FILE_IN).readlines(): yield (v1[0], int(v1[1:])) ``` Function Name: v2 Function: ```python def v2() -> None: v3 = 0 v4 = 0 v5 = 90...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame, pd.DataFrame, Any Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.DataFrame, v2: pd.DataFrame=None, v3=False) -> pd.DataFrame: if v3: if self._featureGenerator is not None: ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> bytes: v2 = self._compose_the_first_line_of_the_message(v1.custom_language) if self._message_multiline is not None: v2 += self._compose_nex...
Imports: ```python import typing ``` Type definitions: Input Types: List[int], int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: int, v3: int): if v2 == v3: return [] elif v3 == v2 + 1: return [v1[v2]] else: v4 = int((v2 +...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self) -> dict: v1 = self.__typo3Helper.getLocalSettings() v2 = v1['DB']['Connections']['Default'] assert v2['driver'] == 'mysqli' return (v2['host'], v2['po...
Imports: ```python from zipfile import ZipFile import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): with ZipFile(v1, 'r') as v2: v2.extractall() ```
Imports: ```python import logging import sys import typing ``` Type definitions: Input Types: config_pb2.Directive, str, dict Output Type: dict Dependencies: ```python def v0(v1: config_pb2.Directive, v2: dict) -> dict: v3 = dict() v4 = ['format', 'format_firstline', '@type', 'multiline_flush_interval', 'expre...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict[str, Dict[str, str]] Dependencies: Function Name: v0 Function: ```python def v0() -> Dict[str, Dict[str, str]]: v1 = {} v1['name'] = '木工機械' v1['id'] = 'woodworking-machinery' v2 = {} v2['woodworking-machinery'] ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2=None, v3=0, v4=0, v5=True) -> dict: v6 = {} for v7 in self.nodes: if v7.is_robot and (not v5): ...
Imports: ```python from string import punctuation import typing ``` Type definitions: Input Types: str, str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> bool: v3 = True v4 = ['почему', 'когда будет', 'что будет', 'что если', 'для чего ', 'как ', 'что ...
Imports: ```python import numpy as np import PIL import typing ``` Type definitions: Input Types: int Output Type: Tuple[PIL.Image.Image, np.array] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=32) -> Tuple[PIL.Image.Image, np.array]: (v2, v3, v4, v5) = self._resampled_dimensions(v1) ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = 'LOAD_FAST' if self.is_functionScope() else 'LOAD_GLOBAL' self.emit(v1, self.class_list_name) ```
Imports: ```python import typing ``` Type definitions: Input Types: bytes Output Type: tuple[str, Any] | tuple[None, None] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes) -> tuple[str, Any] | tuple[None, None]: (v2, v3) = v1.split(b':', 1) return (v2.decode('utf-8'), self.serialize...
Imports: ```python import numpy as np import torch import torch.nn.functional as F import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any, Any, Any, Any Output Type: Tuple[torch.Tensor, torch.LongTensor] Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4, v5, v6, v7, v8=1) -> ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: List[Tuple[str, int]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> List[Tuple[str, int]]: v2 = self.library.get_elements('//a[@href]') v3: Set[str] = set() v4 = v1 + 1 for v5 in v2: ...
Imports: ```python from nltk.corpus import wordnet as wn import typing ``` Type definitions: Input Types: str, Any, Any Output Type: Set[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2, v3=False) -> Set[str]: v4 = wn.synsets(v1) v5 = set([lem for v6 in v4 for v7 in v6.lemma_names()...
Imports: ```python from math import pi, log import torch as th from torch import nn import torch.nn.functional as F import typing ``` Type definitions: Input Types: th.Tensor, th.Tensor, th.Tensor Output Type: th.Tensor Dependencies: ```python @th.jit.script def v0(v1: th.Tensor): return 0.5 * (th.log(1 + v1 + 1e-...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1 = ['txn', 'name', 'database_engine', 'after_callbacks', 'exception_callbacks'] def __init__(self, v2: Cursor, v3: str, v4: BaseDatabaseEngine, v5: Optional[List[_CallbackListEntry]]=None, v6: Optional[List[_CallbackListEntry]]=None):...
Imports: ```python import matplotlib import matplotlib.pyplot as plt import numpy as np from matplotlib.artist import Artist from matplotlib.axes import Axes from matplotlib.colors import Colormap from matplotlib.figure import Figure import typing ``` Type definitions: Input Types: Figure, Axes Output Type: None Depen...
Imports: ```python import itertools import numpy as np import typing ``` Type definitions: Input Types: str Output Type: np.array Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> np.array: with open(v1) as v2: v3 = v2.readlines() v3 = [l.strip() for v4 in v3] (v5, v6) = (len(...
Imports: ```python import ast import typing ``` Type definitions: Input Types: ast.UnaryOp Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: ast.UnaryOp) -> Any: if isinstance(v1.op, ast.Not): return not self.visit(v1.operand) raise RuntimeError(f'Unknown operator {...
Imports: ```python import pandas as pd import typing ``` Type definitions: ```python class v0(memdf.util.sqlite.Database): v1 = ['PRAGMA foreign_keys = ON', "PRAGMA encoding = 'UTF-8'"] v2 = ['\n -- A ‘thing’ identifies the kind of built object.\n -- Builds of the same thing are comparable.\n ...
Imports: ```python import typing ``` Type definitions: ```python @dataclass class v0: v1: int v2: float v3: str v4: List[Transaction] v5: str = field(default='') v6: int = field(default=0) def v7(self) -> str: """Uses SHA-256 to hash the header of the block (the core attributes of t...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: if self.run_time: v1 = int(self.run_time) if v1 > 3600: v2 = v1 // 3600 return '{}:{}'.format(v2, (v1 - v2 * 3600) ...
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('T') ``` Input Types: int Output Type: Optional[v0] Dependencies: Function Name: v1 Function: ```python def v1(self, v2: int) -> Optional[v0]: v3 = self.get_node(v2) if v3: return v3.data return None ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Dict[str, Optional[OrderedDict]], Any Output Type: List[Tuple[str, Number]] Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, Optional[OrderedDict]], v2=10) -> List[Tuple[str, Number]]: v3 = ['oof', 'hold...
Imports: ```python from subprocess import Popen, PIPE, TimeoutExpired import typing ``` Type definitions: Input Types: Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1) -> int: v2 = Popen([v1], shell=True, stdin=-1, stderr=PIPE, stdout=PIPE) try: (v3, v4) = v2.communi...
Imports: ```python import hashlib import numpy as np import typing ``` Type definitions: Input Types: str Output Type: np.int64 Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> np.int64: v2 = hashlib.md5() v2.update(v1.encode('utf-8')) return np.int64(int(v2.hexdigest(), 16) % (2 ** ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, *v1, **v2) -> Any: v3 = super().reset(*v1, **v2) v4 = self._get_obs(v3) return v4 ```
Imports: ```python import json import requests import typing ``` Type definitions: ```python class v0(BaseModel): v1: str v2: int v3: str ``` Input Types: Output Type: None Dependencies: ```python def v4(v5: list[v0]) -> str: return '\n'.join((f'- [{issue.number}]({issue.url}) - {issue.title}' for v6 i...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python v0 = Optional['np.ndarray[np.bool_]'] ``` Input Types: Output Type: Tuple[int, v0] Dependencies: Function Name: v1 Function: ```python def v1(self) -> Tuple[int, v0]: v2 = None for v3 in self._config.preselections: v4 ...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2=None) -> int: v2 = v2 if v2 else {} return self._db[v1].count(v2) ```
Imports: ```python import numpy as np from math import fmod, pi, floor, sqrt import typing ``` Type definitions: Input Types: np.array, float, float, float Output Type: Any Dependencies: ```python def v0(v1: float, v2: float, v3: float=0.0, v4: str='iau-76'): if v4 == 'iau-76': v5 = np.dot(rot_1(v2), rot_2...
Imports: ```python from functools import reduce import typing ``` Type definitions: Input Types: Any, Iterable[str], Any Output Type: Any Dependencies: ```python def v0(v1: Any, *v2: Iterable[str]): return reduce(getattr, v2, v1) ``` Function Name: v3 Function: ```python def v3(v4: Any, v5: Iterable[str], v6: Any)...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: int=1314151677777) -> list: v2 = [] if 'some condition here': v2 = [-1] elif 'some condition here': v2 = [0] else: if 'some c...
Imports: ```python import numpy as np from scipy.special import logsumexp import typing ``` Type definitions: Input Types: List[Dict[str, Any]], List[str] Output Type: Dict[str, float] Dependencies: ```python def v0(v1: List[List[float]], v2: List[List[str]]) -> Dict[str, float]: v3 = len([1 for v4 in v2 if len(v4...
Imports: ```python import torch import torch.nn.functional as F import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, Optional[torch.Tensor], str Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: torch.Tensor, v3: Optional[torch.Tensor]=N...
Imports: ```python import math import os import typing ``` Type definitions: Input Types: dict, int Output Type: Any Dependencies: ```python def v0(v1: dict, v2: typing.Optional[str], v3: dict, v4: typing.Optional[str], v5: bool=False, v6: int=None, v7: bool=False): if v6 is None: v6 = BaseConfig.sample_ra...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1={}) -> str: v1['recvWindow'] = self.recvWindow v1['timestamp'] = self.getTimestamp() v2 = self._add_parameter(parameter_dic=v1) v1['signature'] =...
Imports: ```python import typing ``` Type definitions: Input Types: Any, str, Any Output Type: Any Dependencies: ```python def v0(v1, v2): if not isinstance(v1, str): return False if not isinstance(v2, str): return False return v1.lower() == v2.lower() ``` Function Name: v3 Function: ```pyt...
Imports: ```python import hashlib import typing ``` Type definitions: Input Types: str, Dict[str, Any], List[Any] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Dict[str, Any], v3: List[Any]) -> str: v4 = '' for v5 in v3: if not v2.get(v5): s...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, list[int] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: list[int]) -> int: if v1 == 0 and v2 == 0: return self.jobsMatrix[0][v3[v1]] if v1 == 0: return self.g...
Imports: ```python from copy import deepcopy import typing ``` Type definitions: Input Types: Dict[str, Any], str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, Any], v2: str, v3: str='.'): assert isinstance(v1, dict) if v2: return {v2 + v3 + n: v for (v...
Imports: ```python import typing ``` Type definitions: Input Types: int, str Output Type: Tuple[str, int, int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: str) -> Tuple[str, int, int]: if self.offset_answer_start == 0 and self.offset_answer_end == 0: return ('', 0, 0) ...
Imports: ```python import typing ``` Type definitions: Input Types: Binding.Binding Output Type: None Dependencies: ```python def v0(v1: typing.Optional[str]) -> None: self.__in_update = True if self.__binding: self.__binding.update_source(v1) self.__in_update = False ``` ```python def v2(v3: int) ...
Imports: ```python import math import torch from torch import Tensor import typing ``` Type definitions: Input Types: Tensor, int Output Type: Tensor Dependencies: ```python def v0(v1: Tensor, v2: float, v3: float, v4: float, v5: float, v6: float, v7: float) -> Tensor: v8 = v1.device v9 = v1.dtype v2 = tor...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1=0, v2=None, v3=None): self.val = v1 self.left = v2 self.right = v3 ``` Input Types: v0, int Output Type: int Dependencies: Function Name: v4 Function: ```python def v4(self, v5: v0, v6: int) ->...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self._datafetcher is not None and self._datafetcher.randomable and self._datafetcher.ready and (not self._datafetcher.looping) self.setEnabled(v...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any Output Type: List[datetime] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, v3=True) -> List[datetime]: if not self.unit.endswith('s') and (not all((v1 == 1, v2 == 1))): raise ValueError('Requested r...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, str, int, int, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any, v2: str, v3: int=None, v4: int=None, v5: str=None): v1 = self._get_canonical(v1, header=v2) if not isinstanc...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor): if v1.dim() == 0: v2 = str(v1.tolist()) v3 = self.vocab[v2] if v2 in self.vocab else self.vocab[self.un...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: tuple Dependencies: Function Name: v0 Function: ```python def v0(v1: list) -> tuple: v2 = v3 = v4 = v5 = v6 = v7 = None for v8 in v1: if v8.ccdnumber == '4': v2 = v8 elif v8.ccdnumber == '5': ...
Imports: ```python import typing ``` Type definitions: Input Types: str, bool Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: bool) -> str: if v2 and v1 in self.emojis: return self.emojis[v1] return self.default[v1] ```
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 v1 == 0: return self v3 = self.expand_up(v1, v2).expand_down(v1, v2) v3 = v3.expand_left(v1, v2).expand_right(v1,...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, **v1) -> str: v2 = {} v3 = len(v1) if v3 > 0: for (v4, v5) in v1.items(): v4 = v4.replace('_', '.') v4 = v4.replace('sortBy...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: int=0, v2: Optional[int]=None, v3: Optional[int]=None, v4: Optional[int]=None, v5: Optional['Node']=None, v6: bool=False, v7: bool=False, v8: bool=False) -> None: self.left: Optional['Node'] = None sel...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Iterable[str], Iterable[str] Output Type: Dict[str, Optional[Any]] Dependencies: ```python def v0(v1) -> Optional[Any]: try: return None if v1.isEmpty() else v1.get() except: logger.exception('Error getting Optional value'...
Imports: ```python import random import collections import typing ``` Type definitions: Input Types: str Output Type: list Dependencies: ```python def v0(v1: dict, v2: str='_') -> dict: v3 = collections.OrderedDict() def v4(v5, v6=''): if isinstance(v5, list): for v7 in range(len(v5)): ...
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): if (v1, v2) in self.pieces and self.pieces[v1, v2].is_red == self._current_play: self._selected_piece = self.pieces[v1, v2] ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = u'build update' v2 = 'Solano webhook set up correctly' self.send_and_test_stream_message('test', v1, v2, content_type='application/x-www-for...
Imports: ```python import typing ``` Type definitions: Input Types: int, float, float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: float, v3: float): if self._graph: self._graph.add_data(ask_spread=v2, bid_spread=v3, signal=v1, reference_bid=self._referenc...
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: if v1.shape[0] != v2.shape[0]: raise Exception('predict...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[float] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[float]: v1 = self.dash_len v2 = self._get_distance(self.start, self.end) v3 = v2 // v1 v3 = 19 if v3 < 20 else v3 - 1 v1 = (v2 - v1...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any, Any Output Type: adsk.fusion.Occurrence Dependencies: ```python def v0(): return adsk.core.Application.get() ``` ```python def v1() -> adsk.fusion.Design: return adsk.fusion.Design.cast(v0().activeProduct) ``` ```python def v2()...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, Optional[transport.TransportOptions] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: Optional[transport.TransportOptions]=None) -> str: v1 = self.encode_path_param(v1) v2 = sel...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0() -> str: global LABEL_COUNT v1 = f'LABEL{LABEL_COUNT}' v2 += 1 return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Iterable[Tuple[str, nn.Module]] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Iterable[Tuple[str, nn.Module]]) -> None: for (v2, v3) in v1: self.add_module(v2, v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any) -> Optional[str]: v2 = self.value_from_object(v1) return self.get_prep_value(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: dict) -> None: v1[1] = 2 return ```
Imports: ```python import typing ``` Type definitions: Input Types: List[Callable[[tcod.event.Event], None]], List[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[Callable[[tcod.event.Event], None]], v2: List[str]) -> None: for v3 in v2: v4 = getattr(self, ...
Imports: ```python import typing ``` Type definitions: Input Types: object, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: object, v2: str): try: v3 = v1.find_element_by_id(v2) except: v3 = None return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: if not self.has_acessible_edges(): return False for v1 in self.get_vertices(): if self.degree(v1) % 2 == 1: return False ...
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(v1: np.ndarray) -> np.ndarray: v2 = v1.shape[0] return np.hstack([v1, np.ones((v2, 1))]) ```
Imports: ```python from bisect import bisect_left import typing ``` Type definitions: Input Types: List[int], int Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: int) -> List[int]: for (v3, v4) in enumerate(v1): v5 = v2 - v4 v6 = bisect_le...
Imports: ```python import typing ``` Type definitions: Input Types: float, Optional[int] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: Optional[int]=None): if v2 is not None: v3 = '{:.%se}' % v2 return v3.format(v1) return '{}'.format(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: abc.Iterable['Container'], 'Graph', 'DepSrc' Output Type: abc.Iterable['Container'] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: abc.Iterable['Container'], v2: 'Graph', v3: 'DepSrc') -> abc.Iterable['Container']: v4 = self...
Imports: ```python from bisect import insort import typing ``` Type definitions: Input Types: dict, set, deque Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: dict, v2: set, v3: deque): v4 = '' v5 = set() while len(v5) < len(v2): if v3: v6 = v3.popleft()...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, set Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3: set): v3.add(frozenset.union(v1, v2)) v3.remove(v1) v3.remove(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(self) -> bytes: self.reader.reset() return self.reader.read_bytes(self.byte_size) ```
Imports: ```python import typing ``` Type definitions: Input Types: List[Tuple[int]], str, int Output Type: List[Tuple[int]] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Tuple[int]], v2: str, v3: int) -> List[Tuple[int]]: if v2 == 'x': return [(x, y) if x < v3 else (v3 - abs(x - v3)...
Imports: ```python import os import shutil import sys from subprocess import SubprocessError, check_call import typing ``` Type definitions: Input Types: str, bool Output Type: str Dependencies: ```python def v0() -> str: v1 = os.path.dirname(sys.executable) v2 = [v1, os.environ.get('PATH', '')] if os.name...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2=False, v3=None): if v2: v3 = self.best_est(v1) if v3 is None: v3 = self.pipes[v1] v3.fit(self.x_train, self.y_trai...
Imports: ```python import traceback from datetime import datetime, timedelta import requests import typing ``` Type definitions: Input Types: Output Type: Dict[str, List[str]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict[str, List[str]]: self.logger.info(self._msg('Downloading categor...
Imports: ```python import math import typing ``` Type definitions: Input Types: Any Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> float: if self.radius is not None: (v2, v3, v4) = v1.projectOptions.pixelSizes v5 = math.sqrt(v2 * v3) v6 = self.ra...
Imports: ```python import numpy as np from PIL.ImageFont import FreeTypeFont from PIL import ImageFont, ImageDraw, Image import typing ``` Type definitions: Input Types: str, FreeTypeFont, Any Output Type: Any Dependencies: ```python def v0(self, v1): v2 = self.font.getsize(v1) (v3, v4) = v2 v5 = self.widt...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> dict: if v1 not in self.ALLOWED_FORMATS: raise ValueError('Allowed formats are %s' % self.ALLOWED_FORMATS) if v1 == 'delete': return...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, int Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3: int) -> dict: v4 = self.convert(v1, v2, v3, return_type='dict') v5 = v4['era'] v6 = v4['year'] v7 = self.data_dic[v...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, *v1, **v2) -> float: assert self._timestep_deaths is not None, 'Total deaths has not been set.' return self._timestep_deaths ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1) -> list: with open(v1, 'r') as v2: v3 = [] for v4 in v2.read().split('\n'): v3.append(v4) return v3 ```
Imports: ```python import numpy import typing ``` Type definitions: Input Types: list, float Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2: float) -> list: v3 = [] v4 = numpy.zeros_like(v1[0]) for v5 in v1[::-1]: v4 = v5 + v2 * v4 v3.insert(0, v4...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, **v2): for (v3, v4) in self.models.items(): self.get_bare_model(v4).perform_cb(v1, **v2) ```
Imports: ```python import numpy as np 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.DataFrame, v2: pd.Series, v3...
Imports: ```python import functools import typing ``` Type definitions: Input Types: callable Output Type: callable Dependencies: Function Name: v0 Function: ```python def v0(v1: callable, *v2, **v3) -> callable: v4 = functools.partial(v1, *v2, **v3) functools.update_wrapper(v4, v1) return v4 ```