text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: ```python def v0(v1): return {fmt % v1 for v2 in ['u%d', 'utf%d', 'utf-%d', 'utf_%d']} ``` Function Name: v3 Function: ```python def v3(v4: str) -> str: def v5(v6): return {fmt % v6 for v7 in ['u%d',...
Imports: ```python import typing ``` Type definitions: Input Types: 'pl.Trainer', 'pl.LightningModule', Optional[str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'pl.Trainer', v2: 'pl.LightningModule', v3: Optional[str]=None) -> None: self.__resolve_ckpt_dir(v1) if v...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any, Any, Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4: int=0): assert v2 >= v1 v5 = np.abs(v2 - v1 - v3) if v2 - v1 <= v3: if v4 > 0: v6 = max(...
Imports: ```python import typing ``` Type definitions: Input Types: sqlalchemy.Column Output Type: str Dependencies: ```python def v0(v1: sqlalchemy.Column): if isinstance(v1.type, sqlalchemy.Enum): return v1.type.enums ``` ```python def v2(v3): if isinstance(v3, sqlalchemy.Integer): return 1 ...
Imports: ```python from typing import Any, Tuple, TypeVar, Union, Hashable, Sized, _SpecialForm, Generic import typing ``` Type definitions: Input Types: Any, Any Output Type: bool Dependencies: ```python def v0(v1: Any, v2: Any) -> bool: return issubclass(v1.__origin__, v2.__origin__) and (len(v1.__args__) == len...
Imports: ```python import typing ``` Type definitions: Input Types: bytes, str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: bytes, v2: str, v3: str): v4 = open(f'{v2}/{v3}', 'wb') try: v4.write(v1) finally: v4.close() ```
Imports: ```python import torch from torch.utils.data import DataLoader import typing ``` Type definitions: Input Types: Output Type: Optional[dict] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Optional[dict]: v1 = 0 v2 = None for v3 in range(self.hf_args.num_train_epochs): ...
Imports: ```python import sys import warnings import numpy as np import pandas as pd from astropy import wcs from astropy import units from astropy.coordinates import SkyCoord from astropy.utils.exceptions import AstropyWarning import typing ``` Type definitions: Input Types: np.ndarray, Tuple[float, float], str, Any,...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = 'A fake check_string output to use for test1' self.check_string(v1, v1) v2 = '\n act =\n exp = r"""\n A fake check_stri...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.playerList.curselection() if v1: v1 = self.playerList.get(v1) for v2 in self.players.keys(): if self.players[v2...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> None: self.story_contents.get_node_index(v1) self.story_contents.initial_node_id = v1 ```
Imports: ```python import inspect as _inspect from os import getcwd as _getcwd from os.path import relpath as _rel_path from sys import stderr as _stderr from traceback import format_exc, format_exception as _format_exception import typing ``` Type definitions: Input Types: int, str, Any, str, Any, Any, Any, Tuple[Any...
Imports: ```python import requests from requests.auth import HTTPBasicAuth import re import typing ``` Type definitions: ```python class v0: v1 = 'http://localhost:5984' v2 = 'wag' v3 = 'wag_new' v4 = '' v5 = '' v6 = '' v7 = False ``` Input Types: v0 Output Type: Any Dependencies: ```python ...
Imports: ```python import scipy.io as sio import numpy as np import typing ``` Type definitions: Input Types: list, np.ndarray Output Type: (np.ndarray, dict) Dependencies: ```python def v0(v1: np.ndarray) -> dict: v2 = {'Lateral resolution': np.double(v1['lateral_resolution']), 'Axial resolution': np.double(v1['a...
Imports: ```python from sympy import symbols, nsimplify, integrate from sympy.core.mul import Mul import typing ``` Type definitions: Input Types: float, float, float Output Type: Mul Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float, v3: float=ecu) -> Mul: v3 = self.isvalid_ec...
Imports: ```python import tensorflow as tf from tensorflow.python.platform import gfile import typing ``` Type definitions: Input Types: tf.Graph, List[str] Output Type: Dict[str, tf.Tensor] Dependencies: Function Name: v0 Function: ```python def v0(v1: tf.Graph, v2: List[str]) -> Dict[str, tf.Tensor]: v3 = {} ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.loaded: self.merge_candidate = '' if self.loaded and self.replace: self._delete_file(self.candidate_cfg) self.loaded = Fa...
Imports: ```python from json import dumps import typing ``` Type definitions: Input Types: Union[dict, str] Output Type: 'DialogBuilder' Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[dict, str]) -> 'DialogBuilder': if isinstance(v1, dict): self._state = dumps(v1) else: ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: float Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float) -> np.ndarray: v2 = np.diag(np.ones(self.ordint + 1), 0) for v3 in range(self.ordint): v4 = v1 ** (v3 + 1) / ...
Imports: ```python import typing ``` Type definitions: ```python class v0(NamedTuple): v1: str v2: int @classmethod def v3(cls, v4: str) -> 'Fold': [v5, v6] = v4.strip()[11:].split('=') return v0(dimension=v5, coordinate=int(v6)) ``` ```python class v7(NamedTuple): v8: int v9: i...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> bytes: nonlocal extdata_off v2 += 36 v3 = self.b9_extdata_keygen[v2:v2 + 16] v2 += 16 v4 = self.create_cbc_cipher(63, v3).encrypt(self.b...
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(self, v1: np.ndarray) -> np.ndarray: v2 = v1.shape[1] v3 = np.zeros([v2, v1.shape[0]]) for v4 in range(v2): v5 = self...
Imports: ```python from decimal import Decimal import typing ``` Type definitions: ```python v0 = namedtuple('AscendExBalance', 'asset availableBalance totalBalance') ``` Input Types: List[v0], bool Output Type: Any Dependencies: Function Name: v1 Function: ```python def v1(self, v2: List[v0], v3: bool=True): v4 =...
Imports: ```python import os import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0() -> str: v1 = 'TEAMCITY_VERSION' in os.environ v2 = 'JENKINS_HOME' in os.environ v3 = 'PYCHARM_HOSTED' in os.environ if v3: return 'termin...
Imports: ```python import typing ``` Type definitions: Input Types: web.Application Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: web.Application) -> None: self.app = v1 v1.middlewares.append(self.error_middleware) v1.on_startup.append(self._process_routes) if ...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: pd.DataFrame, int, str Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: int, v3: str) -> pd.DataFrame: v4 = v1[v1['rank'] < v2].groupby(['cohort', v3]).count()['sample_...
Imports: ```python import typing ``` Type definitions: Input Types: Any, tuple Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: tuple): v3 = 'INSERT INTO user_input VALUES (%s, %s, %s)' v1.execute(v3, v2) ```
Imports: ```python import torch.nn as nn import torch import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, Any, Any Output Type: Any Dependencies: ```python def v0(v1, v2, v3=1.0): v4 = torch.sum(v1 * v2) v5 = v1.sum() + v2.sum() + v3 return (2 * v4 + v3) / v5 ``` Function Name: v6 ...
Imports: ```python import typing ``` Type definitions: ```python class v0(object): v1 = ['metric_variables', 'inputs'] def __init__(self): self.metric_variables = None self.inputs = [] def v2(self, v3: '_AggState') -> None: if v3.metric_variables: self.metric_variables ...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> bool: for (v2, v3) in self.storage.items(): if v2 not in v1: return False if v3 == '*': continue ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: if self.is_tlv: return f'{self.type_id_bytes()},0x00,0x00' else: return f'{self.type_id_bytes()}' ```
Imports: ```python import json import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): v2 = 'create-intel/' v3 = self.base_url + v2 return self.http_request(full_url=v3, data=json.dumps(v1), request_type='post') ```
Imports: ```python import ast import typing ``` Type definitions: ```python v0 = Union[ast.BoolOp, ast.BinOp, ast.UnaryOp, ast.Lambda, ast.IfExp, ast.Dict, ast.Set, ast.List, ast.ListComp, ast.SetComp, ast.DictComp, ast.GeneratorExp, ast.Compare, ast.Call, ast.Constant, ast.Attribute, ast.Subscript, ast.Starred, ast.Na...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self._config['dictionary_path'] if v1 is not None: with self._model_storage.write_to(self._resource) as v2: self._copy_files...
Imports: ```python import typing ``` Type definitions: ```python @RegisterContainer class v0(ViewBase): v1 = () v2: list[Document] = Serialized(default_factory=list) v3: Optional[Document] = Serialized(default=None) v4: CatBoundSignal[Callable[[], None]] = CatSignal('onDocumentsChanged') v5: CatBoun...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> str: v3 = self._get_args() if 'container_name' not in self.config_options: v3 += f' --name {v1}' v4 = self.config_opti...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: dict): v2 = {} v3 = {'head': 'First rows', 'tail': 'Last rows'} for v4 in v1: v2[v4] = {'name': v3[v4], 'value': '<div id="sample-container" clas...
Imports: ```python import typing ``` Type definitions: Input Types: 'HW_PluginBase', Any, 'HardwareHandlerBase', Sequence['Device'] Output Type: Optional['HardwareClientBase'] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: 'HW_PluginBase', v2, v3: 'HardwareHandlerBase', v4: Sequence['Device']) -...
Imports: ```python import typing ``` Type definitions: Input Types: ndarray, ndarray Output Type: Tuple[ndarray, ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: ndarray, v2: ndarray) -> Tuple[ndarray, ndarray]: v3 = self.F @ v1 v4 = self.F @ v2 @ self.F.T + self.Q return (v3,...
Imports: ```python import typing ``` Type definitions: ```python class v0(Value, _collections_abc.Sequence, SupportsInt, SupportsFloat): def __init__(self, v1: SupportsStringFull | v0=''): """ Initializes the StringValue object. NOTE: if the initial value is not a valid string or another ...
Imports: ```python import typing ``` Type definitions: Input Types: object Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: object) -> None: if self.logicalSize == self.physicalSize: v2 = self.DEFAULT_CAPACITY if self.physicalSize >= self.DEFAULT_CAPACITY: ...
Imports: ```python import json import os import typing ``` Type definitions: Input Types: str, str, str, dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3: str, v4: dict={}): v5 = json.loads(v1) v6 = {} v6['artifacts'] = {} for (v7, v8) in v5.get('ou...
Imports: ```python import typing ``` Type definitions: Input Types: str, dict Output Type: Union[str, None] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: dict) -> Union[str, None]: for v3 in v2['data']: if v3['name'] == v1: return v3['id'] return None ```
Imports: ```python import typing ``` Type definitions: Input Types: bytes, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bytes, v2: str=None): with self.handler as v3: return v3.save_trained_model(v1, v2) ```
Imports: ```python import re import typing ``` Type definitions: Input Types: dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> dict: v2 = v1['text'] if self.clean_header_footer: v2 = self._find_and_remove_header_footer(v2, n_chars=300, n_first_pages_...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v1 = v1.replace('<b>', '**') v1 = v1.replace('</b>', '**') v1 = v1.replace('<i>', '__') v1 = v1.replace('</i>', '__') v1 = v1.replace('&nbsp...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Any] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, Any]): self.current_db_result = v1.get('db_result', None) self._update_db_result() ```
Imports: ```python import typing ``` Type definitions: Input Types: t.Iterable[t.Tuple[str, t.Any]] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: t.Iterable[t.Tuple[str, t.Any]]) -> None: for (v2, v3) in v1: v4 = self.state.get(v2) if not v4: v4...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Optional[str]: v1: Iterable[Tuple[Type[BioThingsAuthenticationProviderInterface], dict], ...] = getattr(self, 'AUTHN_PROVIDERS', self.biothings.config...
Imports: ```python import hashlib import typing ``` Type definitions: Input Types: str, int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str='md5', v2: int=2 * 16) -> str: v3 = {'sha1': hashlib.sha1(), 'sha224': hashlib.sha224(), 'sha256': hashlib.sha256(), 'sha384': hashl...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = ['.tar', '.tgz', 'tar.gz'] for v3 in v2: if v1.endswith(v3): v1 = v1[:len(v1) - len(v3)] break return v1...
Imports: ```python import typing ``` Type definitions: Input Types: str, Dict[str, dict] Output Type: Tuple[Callable, List] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: Dict[str, dict]) -> Tuple[Callable, List]: v3 = v2['execute']['func'] return (v3, [v1]) ```
Imports: ```python import os import stat import typing ``` Type definitions: Input Types: str, str, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3=True, v4=True): v5 = os.stat(v1) if hasattr(os, 'utime'): os.utime(v2, (v5.st_atime, v5.st_mtime...
Imports: ```python from urllib.parse import urlparse, unquote from urllib.parse import urlunsplit, urlsplit import typing ``` Type definitions: Input Types: Optional[str] Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: Optional[str]) -> Optional[str]: if v1 is None: ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): print('') print(f'Usage: {v1} [OPTIONS]') print(' OPTIONS:') print(' -d --debug Enable debug mode') print(' -h --help ...
Imports: ```python import logging import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): self.cursor.execute(self.INIT_SQL[v1]) logging.info('%s table initialized' % v1) ```
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.m = 4 self.n = 3 self.X = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) self.Y = np.array([[13, 14, 15], ...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: dict) -> str: v2 = v1['attributes']['GlobalID'] v3 = 'c50a1a352e944a66aed98e61952051ef' v4 = 0 return f'{v3}_{v4}_{v2}' ```
Imports: ```python import typing ``` Type definitions: ```python class v0(Exception): def __init__(self, v1, v2): super().__init__(v2) self.code = v1 self.reason = v2 def v3(self, v4): v4.write(get_status_line(self.code, self.reason)) write_header(v4, ('Connection', 'cl...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v1 += '\n' v1 = bytes(v1, 'utf-8') self._RadioSerialBuffer.write(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: int, int Output Type: Tuple[int, int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: int) -> Tuple[int, int]: v3 = self.header_offset(v1, v2) v4 = int.from_bytes(self.data[v3:v3 + 3], byteorder='big') v5 = s...
Imports: ```python from urllib.request import urlopen from urllib.error import HTTPError import json from typing import List, Optional, Dict, Any, Tuple, cast, Set, IO import typing ``` Type definitions: ```python class v0(object): def __init__(self, v1: Dict[str, Any]) -> None: """ Parameters: ...
Imports: ```python import torch from sklearn.metrics import accuracy_score, f1_score import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: torch.Tensor) -> float: v3 = torch.flatten(v1).cpu() ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> None: self._exception = v1 self.clock.loop.call_soon_threadsafe(self._stop_loop, 'Exception') ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python @pytest.fixture def v0(v1: servo.pubsub.Exchange, v2: servo.pubsub.Subscription) -> servo.pubsub.Subscriber: return servo.pubsub.Subscriber(exchange=v1, subscription=v2) ``` Function Name: v3 Function: ``...
Imports: ```python from sympy import Symbol import typing ``` Type definitions: Input Types: List[Union[str, Symbol]] Output Type: Symbol Dependencies: ```python def v0(v1: str, v2, v3): if v1 == '*': return v2 * v3 elif v1 == '+': return v2 + v3 ``` Function Name: v4 Function: ```python def v4...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=None) -> None: v2 = 'record' if v1: v2 = f'record: name: {v1}' self._send(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: List Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> List: v2 = [] v3 = self.leaves[v1] v2.append((v3.val, 'SELF')) while v3.parent: v2.append((v3.bro.val, v3.bro.side)) v3 = v3...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str='', v3: str='utf-8') -> None: with open(v1, 'wb+') as v4: v4.write(v2.encode(v3)) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Tuple[float] Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> Tuple[float]: v2 = list(self._point_sources.values())[v1] return (v2.position.get_ra(), v2.position.get_dec()) ```
Imports: ```python import copy import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: for v1 in reversed(copy.copy(self.__canvas_items)): self._remove_canvas_item(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: int, str, List[int], List[str], Dict[str, str], bool, bool, Tuple[str, str], str, bool, str, dict, str, Callable Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2: str=None, v3: List[int]=None, v4: List[st...
Imports: ```python import torch import torch.nn.functional as F import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor: v1 = self.cnn(v1) v2 = sel...
Imports: ```python import typing ``` Type definitions: Input Types: list, dict, str Output Type: list Dependencies: ```python def v0(v1: str, v2: dict, v3: str='!!') -> bool: v4 = False if 'ignoreColumns' in v2: for v5 in v2['ignoreColumns']: if v3 in v5 and v5.lower() == v1.lower(): ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self) -> Any: v1 = {'losses': self.loss} v2 = 0 if 'normal' in self.tasks and (not self.is_training): v1.update({'normal_angles': np.c...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: typing.List Dependencies: Function Name: v0 Function: ```python def v0(self) -> typing.List: v1 = self.by_css_selector(self.BREADCRUMBS) v2 = v1.driver.find_elements("//nav[aria-label='Breadcrumbs']//li//a") v3 = [] for ...
Imports: ```python import typing ``` Type definitions: ```python v0 = Generator[Tuple[str, str, bool], None, None] ``` Input Types: Output Type: v0 Dependencies: Function Name: v1 Function: ```python def v1(self) -> v0: v2 = self.lenum[self.data].name if self.data is not None else None for (v3, v4) in self.ch...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict): v2 = '' for v3 in v1: v2 += f'<b>{v3}</b>: {v1[v3]}{self._return_line}' return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0() -> dict: v1 = {} for v2 in patterns.load_method_classes(): v3 = v2() v1[v3.name] = v3 return v1 ``` Function Name: v4 Function: ```python def v4() -> None: for v5 in v...
Imports: ```python import os, sys, re import typing ``` Type definitions: Input Types: Any, Any, dict, dict, dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3: dict, v4: dict, v5: dict): v6 = {} for v7 in range(v2): v6[str(v7 + 1)] = {} for v8 in v3.ke...
Imports: ```python 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 v1.items(): v1[v2] = [lang_to for v4 in v3 if '_' not in v4 and v4 in v1] return v1 ```
Imports: ```python import os import pprint import torch from torch import optim as module_optim from torch.optim import lr_scheduler as module_lr_scheduler import typing ``` Type definitions: Input Types: str, Any, Any, Any Output Type: Any Dependencies: ```python def v0(v1): v2 = os.path.join(path, v1 + '.{ext}'....
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if 'synth' in self.active_datasets: self._print_statistics(self.synth_tr, 'synth_tr') self._print_statistics(self.synth_tr, 'synth_tr') ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: [float, Any], float, int Output Type: [float, Any] Dependencies: Function Name: v0 Function: ```python def v0(v1: [float, Any], v2: float=0.0, v3: int=1) -> [float, Any]: assert v3 > 0, 'dim must be greater than 0.' if isin...
Imports: ```python import typing ``` Type definitions: Input Types: Union[str, List] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[str, List]) -> None: if isinstance(v1, list): v2 = v1 else: v2 = [v1] for v3 in v2: self.writeln(' {0}'....
Imports: ```python import random import typing ``` Type definitions: Input Types: int, int, int Output Type: int Dependencies: ```python def v0(v1: int, v2: int) -> Dict[str, Any]: cur.execute('\n SELECT *\n FROM classes c\n JOIN class_level cl\n ON c.class_id = cl.class_id\n ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str): self.strName = v1 self.strCode = v2 pass ```
Imports: ```python import typing ``` Type definitions: ```python class v0(Element): def __init__(self, v1: str): super().__init__('') self.data: str = v1 def __repr__(self) -> str: v2 = self.data if len(v2) > 20: v2 = v2[:17] + '...' return f'{self.__class__...
Imports: ```python import torch import torch.nn as nn import typing ``` Type definitions: Input Types: Sequence[int], int, torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: Sequence[int], v2: int, v3: torch.Tensor) -> torch.Tensor: (v4, v5) = v1[:2] v6 = (to...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: dict) -> list: v2 = [] for v3 in v1['IpPermissions']: if v3['IpProtocol'] == 'tcp' and v3['FromPort'] == 7001 and (v3['ToPort'] == 7001): ...
Imports: ```python import ast import typing ``` Type definitions: Input Types: Union[str, ast.AST] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[str, ast.AST]) -> int: if isinstance(v1, int): return 1 return sum((1 for v2 in ast.walk(v1))) ```
Imports: ```python import argparse, base64, sys import typing ``` Type definitions: Input Types: bytearray, bytearray, int, bool, str, str Output Type: None Dependencies: ```python def v0(v1: int, v2: bytearray, v3: int) -> int: v4 = v2[0] v5 = v2[1] return (v4 * v1 + v5) % v3 ``` ```python def v6(v7: byte...
Imports: ```python 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: if v1 not in self._config.sections(): return False if v2 not in self._config[v1].keys(): return False r...
Imports: ```python import sys import collections import datetime import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: ```python def v0(v1: str, v2: GameMaster, v3: Union[Fact, FileObject]) -> str: v4: Tuple = collections.namedtuple('factMetadata', ['id', 'type', 'creator', 'created'...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1: Vector v2: Vector v3: float v4: Optional['Cuerpo'] def __init__(self, v5, v6): self.origen = v5 self.direccion = v6 self.disInter = MAX_DIST self.objInter = None ``` Input Types: v0 Output...
Imports: ```python import csv import typing ``` Type definitions: Input Types: str, str, str, str Output Type: Any Dependencies: ```python def v0(v1: csv.reader, v2: csv.reader) -> dict: v3 = {} for (v4, v5) in zip(v1, v2): v3.update(dict(zip(v4, v5))) return v3 ``` Function Name: v6 Function: ```p...
Imports: ```python import typing ``` Type definitions: ```python v0 = pytypes.JTensor ``` Input Types: Output Type: Tuple[v0, v0] Dependencies: Function Name: v1 Function: ```python def v1(self) -> Tuple[v0, v0]: v2 = self.params v3 = self.local_theta() if v2.use_moving_avg_in_training: v4 = 0.0 ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=10) -> dict: v2 = {} for v3 in self.predictions: v4 = self.user_rating_history[v3] v5 = [i[0] for v6 in self.predictions[v3]] ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1, *v2) -> str: v3 = v1 for v1 in v2: if v1: v3 = f"{v3.rstrip('/')}/{v1.lstrip('/')}" return v3 ```
Imports: ```python import json from io import BytesIO, StringIO import matplotlib.pyplot as plt from matplotlib.axes import Axes import typing ``` Type definitions: Input Types: Axes, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Axes, v2=None, v3=None): if isinsta...