text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: maze.Maze, vector.Vector Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: maze.Maze, v2: vector.Vector) -> None: self.maze = v1 self.position = v2 self.reset() ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: list, str Output Type: Any Dependencies: ```python def v0(v1: list, v2: int): v1 = np.sort(v1) v2 = v2 / 100 v3 = v2 * len(v1) v4 = int(v3 // 1) if v4 == len(v1): return v1[-1] return v1[v4] ``` ```py...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str]) -> None: v2 = self.tvwFieldMap.get_column(1).get_cells()[0] v3 = v2.get_property('model') v3.clear() v3.append(['']) for (...
Imports: ```python import typing ``` Type definitions: Input Types: Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: int): v3 = self._compute_loss(v1) self.log('train_loss', v3, on_epoch=True, on_step=False, prog_bar=True) return v3 ```
Imports: ```python import torch import torch.nn.functional as F import typing ``` Type definitions: Input Types: torch.Tensor, str Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: str='mean') -> torch.Tensor: v3 = F.relu(1 - v1) if v2 == 'none': ...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: Union[None, bool] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool) -> Union[None, bool]: if self.string is None: return self.string v2 = f'{self.string[0]}{self.string[-1]}' if v1: ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: str, v2: int): if not v1: if v2 < 6: return (None, *v0(v1, v2 + 1)) elif v2 < 5: (v3, v4, v1) = v1.partition('/') return (v3.strip(':/'), *v0(v1, v2 + ...
Imports: ```python import typing ``` Type definitions: Input Types: List[str], float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str], v2: float): v3 = len(v1) assert v3 % 2 == 1 v4 = v3 // 2 v5 = self._get_random_walk(v4, v3 // 2 + 1, 1 - v2) v6 = se...
Imports: ```python import typing ``` Type definitions: ```python class v0(abc.ABC): @abc.abstractmethod def v1(self, v2: str, v3: ExtensionContext) -> None: ... ``` ```python @dataclasses.dataclass(eq=False) class v4(Type): v5: t.Optional[str] = dataclasses.field(default=None, init=False) v6: t...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> bool: for v2 in v1: try: int(v2.text()) except ValueError: return True return False ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: for (v1, v2) in self.boards.items(): if not (v2 and v2.valid_board): return False self.turn = 1 return True ```
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int]) -> List[str]: v2 = self._tokenizer.convert_ids_to_tokens(v1) return v2 ```
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 in self._adjacency_sets: v2 = f'Vertex with the name {v1} not found.' raise ValueError(v2) ```
Imports: ```python import argparse import typing ``` Type definitions: Input Types: argparse.Action Output Type: Tuple[List[str], str] Dependencies: Function Name: v0 Function: ```python def v0(v1: argparse.Action) -> Tuple[List[str], str]: v2 = (v1.help or '') % {'default': v1.default} if not isinstance(v1, ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: callable Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> callable: v2 = [_ for v3 in range(0, self.rowCount)] for v4 in range(0, self.rowCount): v2[v4] = self.getElement(v4, v1) return...
Imports: ```python import torch from torch.utils.data import Dataset from torch import Tensor import typing ``` Type definitions: ```python v0 = TypeVar('T_idx') ``` Input Types: Sequence[v0], Sequence[v0], bool Output Type: Tensor Dependencies: ```python def v1(v2): if isinstance(v2, Tensor): return v2.tol...
Imports: ```python import typing ``` Type definitions: Input Types: typing.Optional[DatagramTransport] Output Type: typing.Optional[socket.socket] Dependencies: Function Name: v0 Function: ```python def v0(v1: typing.Optional[DatagramTransport]) -> typing.Optional[socket.socket]: if v1 is None or not hasattr(v1, ...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = os.path.dirname(os.path.abspath(v1)) if not os.path.exists(v2): raise NotADirectoryError(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: bool, bool, bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=True, v2: bool=False, v3: bool=False) -> None: self.mission_watcher_thread.start() self.robot_status_watcher_thread.start() super...
Imports: ```python import numpy as np import cv2 import typing ``` Type definitions: Input Types: np.ndarray, Any Output Type: np.ndarray Dependencies: ```python def v0(v1: np.ndarray, v2: Tuple[int, int, int]) -> np.ndarray: if v2 == (0, 0, 0): v1 = np.where(v1 == 0, 1, v1) v2 = (1, 1, 1) v3 =...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: typing.NoReturn Dependencies: ```python def v0(v1: int) -> int: v1 -= v1 >> 1 & 6148914691236517205 v1 = (v1 & 3689348814741910323) + (v1 >> 2 & 3689348814741910323) v1 = v1 + (v1 >> 4) & 1085102592571150095 v1 = v1 + (v1...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1=None, v2=None, v3: int=None, v4=False): if v1 is None: v1 = self.x_test v2 = self.y_test print('\n*** Evaluation') ret...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.create_model('meeting/222', {'name': 'name_xQyvfmsS'}) self.create_model('motion_comment_section/111', {'name': 'name_srtgb123', 'meeting_id': 2...
Imports: ```python from sklearn.utils.class_weight import compute_class_weight from sklearn import metrics as skmetrics 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 = np.unique(v1) ...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=True): self._set_attrs(v1) if self._args: self._set_attrs_from_args() self._set_override_attrs() ```
Imports: ```python from datetime import datetime import typing ``` Type definitions: Input Types: str Output Type: datetime Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> datetime: v2 = len('2020-10-09T12:28:14.7710') if len(v1) > v2: v1 = v1[:v2] return datetime.strptime(v...
Imports: ```python import typing ``` Type definitions: ```python class v0(params.Params): v1: str v2: pd.Series v3: pd.DataFrame v4: pd.DataFrame ``` Input Types: v0 Output Type: None Dependencies: Function Name: v5 Function: ```python def v5(self, *, v6: v0) -> None: self.base_dir = v6['base_dir']...
Imports: ```python import copy import typing ``` Type definitions: Input Types: Dict[Text, Any] Output Type: Dict[Text, float] Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[Text, Any]) -> Dict[Text, float]: v2 = {} v1 = copy.deepcopy(v1) v1.pop('file_name', None) v3 = v1.pop('tas...
Imports: ```python import re import collections.abc from collections import defaultdict import typing ``` Type definitions: Input Types: List[str] Output Type: Mapping[str, List[int]] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str]) -> Mapping[str, List[int]]: if v1 is None: retur...
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=True) -> None: if v1 != self._classification: self._classification = v1 self._update_activation() ```
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> bool: for v2 in self.filepath_stack: if os.path.samefile(v1, v2): return True return False ```
Imports: ```python import sys import typing ``` Type definitions: Input Types: List[List[int]] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[List[int]]) -> None: v2 = len(v1) v3 = len(v1[0]) v4 = sys.maxsize for v5 in range(v2): for v6 in range(v3)...
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.layer[v1].append(v2) self.index[self.layer[v1]] = v1 self.node_to_layer[v2] = v1 ```
Imports: ```python import matplotlib.pyplot as plt import numpy as np import typing ``` Type definitions: Input Types: pd.DataFrame, str, Tuple[float, float], int Output Type: plt.Axes Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: str, v3: Tuple[float, float]=None, v4: int=0) -> plt...
Imports: ```python import typing ``` Type definitions: Input Types: 'Parser' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'Parser'): self.skill = self.raw['skill'] self.id = self.raw['Id'] self.char = self.raw['charclass'] ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): self.__maxes.append(max(v1, self.__maxes[len(self.__maxes) - 1]) if self.__maxes else v1) self.__stack.append(v1) ```
Imports: ```python import typing ``` Type definitions: ```python v0 = typing.TypeVar('_ValueT') ``` Input Types: collections.Callable[[str], v0] Output Type: collections.Callable[[str], v0] Dependencies: ```python def v1(v2: str, /) -> v0: if v2.startswith('<') and v2.endswith('>'): v2 = v2[1:-1] return...
Imports: ```python import typing ``` Type definitions: Input Types: str, int, int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: int, v3: int) -> None: v4 = {'name': v1, 'stars': v2, 'contributors': v3} self.stars_contributors_table.insert(v4) ```
Imports: ```python import hashlib import os import typing ``` Type definitions: Input Types: str, str Output Type: typing.Tuple[str, str] Dependencies: ```python def v0(v1: str) -> str: v2 = 64 * 1024 v3 = hashlib.md5() with open(v1, 'rb') as v4: while True: v5 = v4.read(v2) ...
Imports: ```python import typing ``` Type definitions: Input Types: str, Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2=False) -> bool: if v1 == '_' or v1.isalpha(): return True return v1 in [':', '.'] or v1.isnumeric() if not v2 else False ```
Imports: ```python import numpy as np from sklearn.model_selection import train_test_split from sklearn.preprocessing import scale from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC from sklearn.neighbors import KNeighborsClassifier from sklearn.tree import DecisionTreeClassifier from sklea...
Imports: ```python import typing ``` Type definitions: Input Types: dict, Namespace Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict, v2: Namespace): self.assertEquals(v1['url'], v2.url) self.assertEquals(v1['interval'], v2.interval) self.assertEquals(v1['delimite...
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int]) -> None: self.resMap.clear() v2 = v1[0] v3 = v1[1] v4 = self.set_pos_name(v2, v3) if not self.cMap.get(v4): self.c...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: try: self.grid = self.initial_grid.copy() except: self.__create_initial_grid() self.grid = self.initial_grid.copy() self....
Imports: ```python import typing ``` Type definitions: Input Types: bytes Output Type: Tuple[Optional[bytes], bool] Dependencies: Function Name: v0 Function: ```python def v0(v1: bytes) -> Tuple[Optional[bytes], bool]: if v1[0:1] == b'$': (v2, v3) = v1[1:].rsplit(b'#', 1) if len(v3) != 2: ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Iterator[Dict[str, str]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Iterator[Dict[str, str]]: v1 = self._process_string(v1) for (v2, v3) in self._phenos.items(): if v1 in v3['--spaced...
Imports: ```python import typing ``` Type definitions: Input Types: 'RequestContext' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'RequestContext'=None): v2 = self.obj_get_changes() v3 = self.dbapi.update_availability_window(self.uuid, v2) self._from_db_object(self...
Imports: ```python import typing ``` Type definitions: Input Types: str, list, str Output Type: Union[None, Tuple[str]] Dependencies: ```python def v0(v1: list) -> VARIANT: return VARIANT(pythoncom.VT_VARIANT | pythoncom.VT_ARRAY, v1) ``` Function Name: v2 Function: ```python def v2(self, v3: str, v4: list, v5: st...
Imports: ```python import typing ``` Type definitions: Input Types: 'Command' Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'Command'=None): if v1 is None: if self.parent is not None and self.name in self.parent.sub_cmds: del self.parent.sub_cmds[self.na...
Imports: ```python import hmac import json from hashlib import sha256 import typing ``` Type definitions: Input Types: str, dict, int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str=None, v2: dict=None, v3: int=0) -> str: v4 = v1.encode() v5 = ''.join([json.dumps(v2), '1.0....
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, v3, v4) = (v1[0], v1[0], 0) for v5 in v1: if v5 < v3: v4 += v3 - v2 v2 = v5 v3...
Imports: ```python import os import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): v1 = max(0, min(v1, 10)) self.current_volume = v1 os.system(f'amixer sset "Master" {v1}0%') ```
Imports: ```python import typing ``` Type definitions: ```python class v0(object): def __init__(self, v1=False, v2: int=0, v3: int=0, v4: int=0, v5: int=0) -> None: self.invalidate = v1 self.num_in_vocab_tokens = v2 self.total_num_tokens = v3 self.sum_in_vocab_token_lengths = v4 ...
Imports: ```python import os from os import listdir from os.path import join import typing ``` Type definitions: Input Types: str, str Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> list: v3 = join(self.path, v1, v2) if not os.path.exists(v3): r...
Imports: ```python import os import hashlib import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: for (v1, v2, v2) in os.walk(self.config_dict['general']['image_temp_dir']): if v1.lower().endswith(eval(self.config_dict...
Imports: ```python import re from sys import stderr import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: for [v1, v2] in self.api.items(): v1 = re.sub('Chromium(.*)', '\\1', v1) v1 = re.sub('WebKit(.*)', '\\1'...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: Tuple[np.ndarray, List[int]] Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray) -> Tuple[np.ndarray, List[int]]: v2 = v1.shape[0] v3 = np.eye(v2) v4 = [] for (v5, v6) ...
Imports: ```python import typing ``` Type definitions: ```python class v0(SQL): def __init__(self: v0, v1: str, v2: str) -> None: try: super(SQL, self).__init__(database=v1, mode=v2) except DatabaseDoesNotExistException as e: raise e def v3(self: v0, v4: str, **v5): ...
Imports: ```python import typing ``` Type definitions: Input Types: float, Tuple[Union[float, int]], Tuple[Union[float, int]] Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: Tuple[Union[float, int]], v3: Tuple[Union[float, int]]) -> float: if v3[1] == v3[0]: re...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): v1 = str(v1) if v1 not in self._configs['roles']: return None self._configs['roles'][v1]['enabled'] = not self._configs['roles'][v1]['...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0() -> None: v1 = 'This is a string' v2 = 'This Is A String' v3 = v2.title() assert v3 == v2 ```
Imports: ```python import json as json_import from os import getenv, environ, getcwd from os.path import isfile, join, expanduser import typing ``` Type definitions: Input Types: str Output Type: dict Dependencies: ```python def v0(v1: str, v2: str='=') -> dict: v3 = 'ibm-credentials.env' v4 = getenv('IBM_CRED...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = len(self.inputs_register.values()) v3 = 'x' if not v1 in self.inputs_register: self.inputs_register[v1] = ''.join([v3, str(v2 - 1...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: tuple Dependencies: ```python def v0(v1: str, v2: tuple, v3: list) -> tuple: v4 = [] while v3[v2[0]][v2[1]] != 0: v4.append(v1[v2[0] - 1]) v2 = (v2[0] - 1, v2[1] - 1) v4.reverse() return (v4, v2) `...
Imports: ```python import typing ``` Type definitions: Input Types: 'str', Any, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'str', v2, v3=True, v4=None): v5 = v1.split(',') v6 = self.websocket_request_impl.request_24h_trade_statistics_event(v5, v2, v3, v4) ...
Imports: ```python import glob import os import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): if not os.path.exists(v1): os.makedirs(v1) else: v2 = v1 + '/*' v3 = glob.glob(v2) for v4 in v3: ...
Imports: ```python from os import makedirs, path import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): makedirs(v1, exist_ok=True) self.bus_lines.to_csv(path.join(v1, 'bus_lines.csv.xz'), index=False) self.bus_line_...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> np.ndarray: (v2, v2, v3) = v1.shape v4 = self._classification_point_dictionary.get(v3, -1) if v4 == -1: raise ValueError(f'Input s...
Imports: ```python import typing ``` Type definitions: ```python v0 = Tuple[str, str, int] ``` Input Types: Sequence[v0], str Output Type: str Dependencies: Function Name: v1 Function: ```python def v1(v2: Sequence[v0], v3: str) -> str: for v4 in v2: v5 = v4[0] if v3 == v5: return v4[1]...
Imports: ```python import os import re import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: for v2 in open(v1): v2 = v2.strip() v2 = re.sub('(\\A|\\s+)#.*', '', v2) if not v2: c...
Imports: ```python import typing ``` Type definitions: Input Types: requests.Response, str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: requests.Response, v2: str) -> bool: self._validate_response(v1) v3 = [header.lower() for v4 in v1.headers.keys()] return v2.low...
Imports: ```python import logging import typing ``` Type definitions: Input Types: subprocess.CompletedProcess, dashboard_api.DashboardAPI, str, str Output Type: None Dependencies: ```python def v0(v1: str, v2: subprocess.CompletedProcess) -> str: v3 = v2.args if isinstance(v3, list): v3 = utils.list_t...
Imports: ```python import typing ``` Type definitions: ```python class v0(events.ParseEvent): pass ``` Input Types: v0 Output Type: Iterator[dict] Dependencies: ```python def v1(v2): if v2 is None: v2 = [] if not isinstance(v2, list): v2 = [v2] return v2 ``` ```python def v3(v4, v5, v6=N...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: typing.NoReturn Dependencies: Function Name: v0 Function: ```python def v0(self) -> typing.NoReturn: v1 = self.__a (v2, v3) = (self.__n, self.__h) v4 = [-1] * v2 for v5 in range(v2): v6 = 0 for v7 in rang...
Imports: ```python import hmac import hashlib import typing ``` Type definitions: Input Types: List[bytes], str Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(v1: List[bytes], v2: str) -> bytes: v3 = hmac.new(v2.encode('ascii'), digestmod=hashlib.sha256) v4 = v3.copy() for v...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: list) -> str: v2 = '' for v3 in v1: v4 = '' for v5 in v3['tasks']: v4 += '🟢' if v5['ball']['is_new_bigger'] else '🔴' ...
Imports: ```python import typing ``` Type definitions: Input Types: int, int, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int, v3=None, v4=False): try: v5 = v1.to_bytes(1, 'big') + v2.to_bytes(1, 'big') if v3: v5 += v3 ...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: ```python def v0(v1, v2: list): v3 = ['source', 'resolution'] return v2 if v1 in v3 else v2.pop() ``` Function Name: v4 Function: ```python def v4(v5: dict): v6 = v5.to_dict(flat=False) return {k: v0...
Imports: ```python import typing ``` Type definitions: Input Types: Union[List[str], str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[List[str], str]) -> None: if isinstance(v1, str): self.remove_word(v1) elif isinstance(v1, list): for v2 in v1:...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self) -> None: await self.create_connection(with_db=False) await self.execute_script('CREATE DATABASE "{}" OWNER "{}"'.format(self.database, self.user)) a...
Imports: ```python import typing ``` Type definitions: Input Types: List[Tuple[str, int]] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[Tuple[str, int]]): for v2 in v1: self._generate_dummy_text_files_in_container_dir(v2[0], v2[1]) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: list[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> list[str]: v1 = [] while self._at_flag(): v2 = self._unconsumed_args.pop() v1.append(v2) return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: Any) -> bool: v2 = v1 try: v3 = iter(v1) except TypeError: return False else: return v2 is v3 ```
Imports: ```python from functools import reduce from sklearn.svm import SVC, SVR from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.tree import DecisionTreeClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn.ensemble import BaggingClassifier, ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): if self._percent == 100: return self.data.model_scores[v1][self._metric] else: v2 = 0 v3 = self.data.scored_predictions[v1...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Optional[str]: if self.conn_id: v1 = self.get_connection(self.conn_id) v2 = v1.extra_dejson v3 = v2.get('extra__kubernetes__na...
Imports: ```python import logging as log import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = self._dict.get('donations_fiat_currency', 'usd').strip().casefold() if v1 not in self.supported_fiats(): log.error(f...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Output Type: Tuple[np.ndarray, np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Tuple[np.ndarray, np.ndarray]: import numpy as np v1 = np.arange(self.num_examples()) np.random.shuffle(v1)...
Imports: ```python import typing ``` Type definitions: Input Types: int, tp.Optional[tp.Iterable[tp.Hashable]], bool, dict Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, *v5, v1: int=None, v2: tp.Optional[tp.Iterable[tp.Hashable]]=None, v3: bool=False, v4: dict=None, **v6) -> None:...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: str, *v2, **v3): super(v0, self).__init__(*v2, **v3) self._name = v1 @property def v4(self): """Node name - must not be changed once node is in graph""" return self._name ...
Imports: ```python from itertools import chain import pandas as pd import typing ``` Type definitions: Input Types: str, bool Output Type: pd.DataFrame Dependencies: ```python def v0(v1: Union[pd.Series, pd.DataFrame]) -> pd.DataFrame: if isinstance(v1, pd.Series): return v1.to_frame() else: re...
Imports: ```python import pickle import typing ``` Type definitions: Input Types: pd.DataFrame, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: str): with open(v2, 'rb') as v3: v4 = pickle.load(v3) v1 = v1.values v1 = v1[:, 6:] v5 = v4.pred...
Imports: ```python import tempfile import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: with tempfile.NamedTemporaryFile(suffix='.dot', delete=False) as v2: v2.write(v1.encode()) v3 = v2.name retur...
Imports: ```python import typing ``` Type definitions: Input Types: torch.cuda.FloatTensor, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.cuda.FloatTensor, v2=None): if not v2: v2 = {} (v3, v4) = self._break_up_pc(v1) (v5, v6, v7) = self.sa1(v3, v4...
Imports: ```python from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten from keras.layers import Conv2D, MaxPooling2D import numpy as np import typing ``` Type definitions: Input Types: Any, dict Output Type: Any Dependencies: ```python def v0(v1: Sequential, v2: int, v3: str, v4: float...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: if self._buildplate != v1: self._buildplate = v1 self._active_printer_configuration.buildplateConfiguration = self._buildplat...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): v2 = self.choice_task() print('Agent#{} next task:{}'.format(v1, v2['s'])) for v3 in range(len(v2['s'])): v4 = self.agent_last_point[v...
Imports: ```python import re import typing ``` Type definitions: Input Types: pd.DataFrame, dict, Any Output Type: Any Dependencies: ```python def v0(v1, v2=None): if v2: if not isinstance(v2, dict): v2 = v2._asdict() if isinstance(v1, str): if v1.isnumeric(): return int...
Imports: ```python import re import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str): v3 = '[АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя-]+' v4 = '(\\.|^|<|"|\\\'|\\(|\\[|\\{)\\s*' + v3 w...
Imports: ```python import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor, v2: torch.Tensor): for v3 in range(len(self.metrics)): if self._device != v1.device: self.__to(v1.d...