text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: Union[Dict], Union[Dict] Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(v1: Union[Dict], v2: Union[Dict]) -> Dict: v3 = {**v1, **v2} return v3 ```
Imports: ```python import numpy as np from numpy.lib.stride_tricks import as_strided import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.utils.data as data import torch.multiprocessing as mp from torch.distributions import Categorical from torch.utils.tensorboard ...
Imports: ```python import typing as t from typing import Dict, List, Optional, Sequence, Tuple, Union import numpy as np import typing ``` Type definitions: Input Types: Any, Any Output Type: 'GeoData' Dependencies: Function Name: v0 Function: ```python def v0(self, v1=None, v2='observed') -> 'GeoData': v3 = self...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> float: if v1 > 0.0: self._balance += v1 print('{:.2f} deposited'.format(v1 / 100)) return self._balance / 100 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = input('What would you like to title this section? ' + '(default is ' + v1 + ')\n') if v2: return v2 return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.getGenerators() v2 = 0 for v3 in v1: v4 = v3['BPT'] v5 = v3['amount'] v2 = v2 + v4 * v5 self.bpt = v2 v...
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 = '.'.join(self.full_name_id.split('/')) self.input_filter.restore_state_from_checkpoint(v1, v2) self.pre_network_filter.restore_s...
Imports: ```python import random import numpy as np import typing ``` Type definitions: Input Types: dict Output Type: np.array Dependencies: Function Name: v0 Function: ```python def v0(v1: dict) -> np.array: v2 = v1['dim'] v3 = v1['value']['min'] v4 = v1['value']['max'] v5 = v1['value']['dinfo'] ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray Output Type: typing.Generator[typing.Tuple[np.ndarray, np.ndarray], None, None] Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray) -> typing.Generator[typing.Tuple[np.ndarray, np.ndarray], None, N...
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: tf.Tensor, tf.Tensor, Text, tf.Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: tf.Tensor, v2: tf.Tensor, v3: Text, v4: tf.Tensor): if v1.shape[-1] != v2.shape[-1]: v1 = ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.max_rates = [16, 24, 32] self.min_rates = [0, 4, 8] ```
Imports: ```python import os import glob import typing ``` Type definitions: Input Types: str Output Type: List[Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> List[Any]: v2 = v1.split(self.__split_char) v3 = os.path.join(self.root_folder, '/'.join(v2)) v4 = glob.glob(v3)...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: v1 = self.new_container_command('run') v2 = self.new_autograde_command('version') return (v1 + v2).run().returncode ```
Imports: ```python import typing ``` Type definitions: Input Types: List[List[str]] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[List[str]]) -> int: if not v1 or not v1[0]: return 0 v2 = len(v1) v3 = len(v1[0]) v4 = 0 v5 = [[0] * (v3 + 1) for v...
Imports: ```python import itertools import typing ``` Type definitions: ```python class v0: def __init__(self: v0, v1: Iterable) -> None: """ Initialise a new instance. :param iterable: an iterable from which can be obtained an iterator of available items. """ s...
Imports: ```python from decimal import Decimal import typing ``` Type definitions: Input Types: Output Type: Decimal Dependencies: Function Name: v0 Function: ```python def v0(self) -> Decimal: if self.config.shrink_factor is not None: return Decimal(self.config.shrink_factor) else: return De...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str, bool Output Type: Union[List, Dict] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str=None, v3: str=None, v4: bool=None) -> Union[List, Dict]: v5 = {'name': v1, 'description': v2, 'subtype': v3, 'ful...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: if type(v1) != str: return '' v2 = 'AaEeIiOoUu' v3 = '\n' v4 = '' for v5 in v1: if v5 in v2: v4 += f"{'|'...
Imports: ```python import typing ``` Type definitions: Input Types: str, dict, Any Output Type: Tuple[str, dict, Any] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: dict, v3: Any, *v4) -> Tuple[str, dict, Any]: v3.expect_column_to_exist(v1) if v2['n_missing'] == 0: v3.expect_c...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[int]: (v1, v2) = self.getVisitedStops(repeatStation=True) (v3, v4) = self.computeZones() v5 = [] v6 = set() for v7 in v1: if ...
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: Tuple[List] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[str]) -> Tuple[List]: (v2, v3, v4) = self.format_dataset(v1, self.label_map, self.re_label_map) (v5, v6) = self.transform(v2) v7 ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: int, np.ndarray, List[int] Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: int, v2: np.ndarray, v3: List[int]=None) -> float: if v3: v2 /= np.sum(v2[v3]) return v2[v1] ```
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.get_cell_content(v1) return len(v2) + self.cell_buffer * 2 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, List[str] Output Type: Any Dependencies: ```python def v0(cls): for v1 in cls.__dict__: if callable(getattr(cls, v1)) and v1 not in exclude: setattr(cls, v1, decorator(getattr(cls, v1))) return cls ``` Function Name: v...
Imports: ```python import os from pathlib import Path import typing ``` Type definitions: Input Types: str Output Type: Path Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str=None) -> Path: v2 = self.dir if v1: v2 = os.path.join(self.dir, v1) return Path(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> bool: if self.is_empty(): return False v2: bool = False v3: TreeNode = self.root while v3 is not None and (not v2): if v3.ke...
Imports: ```python import typing ``` Type definitions: Input Types: List[int], List[int] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: List[int]): v3 = [] v4 = 0 v5 = 0 while v4 < len(v1) and v5 < len(v2): v6 = v1[v4] v7 = v2[v5] ...
Imports: ```python import typing ``` Type definitions: Input Types: tuple Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: tuple): await super().connect(v1) self.seq_no = 0 ```
Imports: ```python import typing ``` Type definitions: ```python class v0(Common): v1 = 'solid' def __init__(self, v2: dict=None, v3: list=None): (v2, v3) = self._dic_and_children(v2, v3) self.id = v2.pop('id', self.ids()) self.other = v2 self.export_list = ['id'] self.s...
Imports: ```python import typing ``` Type definitions: Input Types: Tensor Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor) -> Tensor: print('[DEBUG]') print(f'type = {type(v1)}') print(f'fn(x) = {self.fn(v1)}') return v1 ```
Imports: ```python import copy import tensorflow as tf import typing ``` Type definitions: Input Types: Output Type: 'Sequential' Dependencies: Function Name: v0 Function: ```python def v0(self, **v1) -> 'Sequential': if not tf.executing_eagerly(): raise RuntimeError('Not executing eagerly - cannot make ...
Imports: ```python import warnings import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray, np.ndarray, np.ndarray, int Output Type: Tuple[np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: np.ndarray, v3: np.ndarray, v4: np.ndarray, v5: int) ...
Imports: ```python from collections import defaultdict import typing ``` Type definitions: Input Types: Any Output Type: Mapping[str, List[str]] Dependencies: ```python def v0(v1: str) -> Tuple[str, str]: (v2, v3) = v1.strip().split('\t') return (v2, v3) ``` Function Name: v4 Function: ```python def v4(v5) -> ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> dict: v2 = {'instrument': v1} v3 = f'v2/instrument/search' v4 = self._send_request(endpoint=v3, params=v2, requires_authorization=False) ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: if self is self.STREAMING_ENCODER: return 'StreamEncoder' if self is self.MEMORY_ENCODER: return 'MemoryEncoder' if self is self.ST...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(cls: 'ModelMeta', self=False): if self: yield cls.meta for v1 in cls.mro()[1:]: if hasattr(v1, 'meta'): yield v1.meta ```
Imports: ```python import math import typing ``` Type definitions: Input Types: torch.LongTensor Output Type: torch.FloatTensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.LongTensor) -> torch.FloatTensor: v1 = self.embeddings(v1) * math.sqrt(self.ndims_embed) v1 = self.position...
Imports: ```python import typing ``` Type definitions: Input Types: Any, list, Any, Any, Any, Any Output Type: list Dependencies: ```python def v0(v1, v2: float, v3=1.0, v4=0.0, v5=1.0, v6=0.0) -> float: v7 = (v2 - v4) / v3 if v7 < -1: v8 = -0.5 elif v7 > 1: v8 = 0.5 else: v8 = ...
Imports: ```python import json import requests import typing ``` Type definitions: Input Types: Any, Any Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> dict: v3 = json.dumps(v2) v4 = requests.post(v1, json=v3).json() return v4 ```
Imports: ```python import typing ``` Type definitions: Input Types: str, Any, Any, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2=None, v3=None, v4=None, v5=TextStyle.NORMAL): if not v2: v6 = [v5] if v3: v6.append(v3[0]) if v4: ...
Imports: ```python from collections import Counter from heapq import heappush, heapreplace 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]: v3 = Counter(v1) v4 = [] ...
Imports: ```python import numpy as np import rasterio import typing ``` Type definitions: Input Types: str Output Type: 'np.typing.NDArray[np.int_]' Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> 'np.typing.NDArray[np.int_]': with rasterio.open(v1) as v2: v3: 'np.typing.NDArray[np....
Imports: ```python import random import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self) -> float: if self._is_weekend(): v1 = self.mean_arrivals_weekend else: v1 = self.mean_arrivals_weekday v2 = 1 / v1 retu...
Imports: ```python import typing ``` Type definitions: Input Types: k.Kernel, Any, List[gp.GaussianProcess], List[float], kexp.KernelExpansionStrategy, Union[di.AbstractDataInput, List[di.AbstractDataInput]], bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: k.Kernel, v2, v3: ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=8) -> str: v2 = len(self) v3 = '' for v4 in range(v2 // v1): v5 = v4 * v1 v6 = self[v5][0] v7 = v6 + v1 + -1 v8 ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self._video_writer is not None: self._video_writer.release() ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: super().initialize_variables() self.net.initialize_variables() ```
Imports: ```python import torch from torch import nn from torch.nn import functional as F import typing ``` Type definitions: Input Types: torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: torch.Tensor) -> torch.Tensor: v2 = self.conv1(v1) v3 = self.tr...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float): if not self.rocket: return self.rocket.set_wind(self.wind_v) self.rocket.tick(v1) self.move_rocket(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: float, float, int, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: float, v3: int, v4: int): if v1 * v2 >= 1e-05: if v1 * v2 >= 0.0001: v5 = ['MC'] else: v5 = ...
Imports: ```python import typing ``` Type definitions: Input Types: List[Gio.File], int, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[Gio.File], v2: int, v3: str): if v2 and (not self.window): self.do_activate() for v4 in v1: v5 = v4.get_path()...
Imports: ```python import typing ``` Type definitions: Input Types: Sequence[str] Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: Sequence[str]) -> dict: v2 = v1[0] == 'AUTO' (v3, v4, v5) = map(float, v1[1].split(' ')) v6 = float(v1[5]) return dict(auto=v2, fov=v6, yaw...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = '' v2 = [] for v3 in self.parameters: v2.append(v3.string()) return v1 + 'fn' + '(' + ', '.join(v2) + ') {\n' + self.body.string()...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> Optional[str]: v2 = self.remote_path(v1) try: return self.s3.info(v2) except FileNotFoundError: print(f'Could not ...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: list) -> int: global num_hundreds v2 = sum(v1) v3 += v2 // 100 return v2 ```
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: v3 = {} for v4 in v2: v3[v4] = v3.get(v4, 0) + 1 for v4 in v1: v5 = v3.get(v4, 0) if v5 == 0: ...
Imports: ```python import os import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = self.read_yaml_file(os.path.join(v1, 'dbt_project.yml')) return v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Tuple[int, str, str] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> Tuple[int, str, str]: (v2, v3, v4, v5) = v1.split('.') v4 = int(v4) return (v4, v5, v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: List[str] Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[str]=[]) -> List[str]: global INPUTS v2 += v1 return v2 ```
Imports: ```python import sys import typing ``` Type definitions: Input Types: Output Type: Tuple[str, str, str] Dependencies: Function Name: v0 Function: ```python def v0() -> Tuple[str, str, str]: if sys.stdout.isatty(): return ('\x1b[31m', '\x1b[32m', '\x1b[m') return ('', '', '') ```
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self, v1) -> None: if self._parent._latest == id(self): await self._observer.asend(v1) ```
Imports: ```python import os import typing ``` Type definitions: Input Types: str, Any Output Type: Any Dependencies: ```python def v0(v1: str): with os.scandir(v1) as v2: return any((not _is_lightly_output_dir(f.name) for v3 in v2 if v3.is_dir())) ``` ```python def v4(v5: str, v6: tuple): with os.scan...
Imports: ```python import os from subprocess import check_output import typing ``` Type definitions: Input Types: str, str, str, Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3: str, v4='++') -> None: v5 = v1.replace('/', '.') v6 = v2.replace('.py', '') ...
Imports: ```python import typing ``` Type definitions: Input Types: httpx.Request Output Type: Generator[httpx.Request, httpx.Response, None] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: httpx.Request) -> Generator[httpx.Request, httpx.Response, None]: if self.__challenge: v1.heade...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, *v1) -> None: if self.verbose: for v2 in v1: self.bin_print(v2, end=' ') print() ```
Imports: ```python import os import re import typing ``` Type definitions: Input Types: str, Dict[str, Any] Output Type: Dict[str, Any] Dependencies: ```python def v0(v1) -> list: v2 = [] if path_exists(v1): for v3 in os.listdir(v1): v4 = os.path.join(v1, v3) if os.path.isdir(v4...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python class v0(object): def __init__(self, v1: float, v2: float, v3: float): """ Initialise the object and create the circle """ self.x0 = float(v1) self.y0 = float(v2) self.r = float(v...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> int: v2 = list(str(v1)) v3 = len(v2) - 1 while v3 - 1 >= 0 and v2[v3 - 1] >= v2[v3]: v3 -= 1 if v3 == 0: return -1 v...
Imports: ```python from collections import Counter import typing ``` Type definitions: Input Types: Callable, int Output Type: Any Dependencies: ```python def v0(v1): v2 = list() for v3 in range(len(v1[0])): v4 = Counter([pred[v3] for v5 in v1]) v2.append(v4.most_common(1)[0][0]) return v2 ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self) -> float: v1 = 0 for v2 in self.lista_numeros: v1 *= v2 return v1 ```
Imports: ```python import pandas as pd import requests import typing ``` Type definitions: Input Types: Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0() -> pd.DataFrame: v1 = 'https://raw.githubusercontent.com/canghailan/Wuhan-2019-nCoV/master/Wuhan-2019-nCoV.json' v2 = ...
Imports: ```python import typing ``` Type definitions: Input Types: Union[str, int] Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[str, int]) -> Optional[str]: v2 = '' v3 = self.vars_for_report_link.get('TORS_REPORT', 'report.html') v4 = f'{v3}#search...
Imports: ```python import typing ``` Type definitions: ```python v0 = int ``` Input Types: v0, int Output Type: Any Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0, v3: int): v4 = self.get_shared_inputs_group_id(v2) if v4 is not None: raise RuntimeError('QP id {} is already in s...
Imports: ```python import typing ``` Type definitions: Input Types: any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: any): v2 = self.get_session() if isinstance(v1, list): [v2.add(update) for v3 in v1] else: v2.add(v1) v2.commit() v2.close()...
Imports: ```python import math import cmath import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1: Union[float, complex] = self._number_on_screen self._operation_str_var.set('ln(x)') if isinstance(v1, complex): ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2) -> dict: v3 = dict(name=v1, path=v2) return self.rpc_request(api='debug', endpoint='add_debug_contract', body=v3) ```
Imports: ```python from pathlib import Path import typing ``` Type definitions: Input Types: Path Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: Path) -> None: with open(v1 / '__init__.pyi', 'w') as v2: v3 = '\n# Create/Clear .pyi file and add boilerplate import content\n...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Generator[Tuple[int, int, int, int], None, None] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Generator[Tuple[int, int, int, int], None, None]: for (v1, v2, v3, v4) in self.additions: v5 = self.maps.ge...
Imports: ```python import logging import typing ``` Type definitions: Input Types: bool, bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: bool=False, v2: bool=False) -> None: if v2: v3 = logging.DEBUG elif v1: v3 = logging.INFO else: v3 = loggin...
Imports: ```python from copy import deepcopy import typing ``` Type definitions: Input Types: dict, Any Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: dict, v2) -> dict: v3 = deepcopy(v1) v3.pop(v2) return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: Optional['Dataset'] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional['Dataset']=None): self.grouping.pack_by_group() v2 = self.grouping.iGroup v3 = self.grouping.iFirstGroup v4 = self.grou...
Imports: ```python import subprocess import os import typing ``` Type definitions: Input Types: Any, Any, Any, Any Output Type: Iterator[str] Dependencies: ```python def v0(v1, v2): if v1: v2 = os.path.join(v1, v2) return v2 ``` ```python def v3(v4) -> str: return v0(v4, OUTFILE_PATH) ``` Function ...
Imports: ```python import torch from torch import Tensor from torch.nn.modules.conv import _pair from torch.nn.modules.module import Module from torch.nn.modules.conv import Conv2d import typing ``` Type definitions: Input Types: Tensor, Optional[Tensor] Output Type: Tuple[Tensor, Tensor] Dependencies: Function Name:...
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame) -> None: if not isinstance(v1, pd.DataFrame): raise TypeError('Working only with pandas DataFrame') assert...
Imports: ```python import typing ``` Type definitions: Input Types: str, typing.Callable Output Type: Any Dependencies: ```python def v0(v1): v2 = getattr(method, name, []) v2.append(v1) setattr(method, name, v2) return v1 ``` Function Name: v3 Function: ```python def v3(v4: str, v5: typing.Callable): ...
Imports: ```python import logging import os import requests from requests import HTTPError from requests.adapters import HTTPAdapter from requests.models import Response from requests.packages.urllib3.util import Retry import typing ``` Type definitions: Input Types: Dict, Any, Any, Any Output Type: requests.Response ...
Imports: ```python import logging import re import typing ``` Type definitions: Input Types: str, Dict Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: Dict) -> int: v3 = re.match('(\\d*)(\\w+)', v1) assert v3, 'Cannot match freq regex' (v4, v5) = v3.groups() v4...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list): self.first_child = 0 if 0 == len(v1): return v2 = None for v3 in v1: if v2 is not None: v2.next_sibling = v3...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame, List[str], List[str], str, bool Output Type: List[ase.Atoms] Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame, v2: List[str]=(), v3: List[str]=(), v4: str='geometry', v5: bool=True) -> List[ase.Atoms]: v6 ...
Imports: ```python from nltk.corpus import stopwords from nltk.stem import PorterStemmer import typing ``` Type definitions: Input Types: list Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: list) -> list: v2 = [] v3 = PorterStemmer() for v4 in v1: v2.append([v3.st...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: str Dependencies: ```python def v0(v1: str) -> str: if v1 == '': return v1 return f'(_{get_string_without_special_characters(v1)}_)' ``` ```python def v2(v3: str) -> str: v4 = '#*_></`[]{}\\|' for v5 in v4...
Imports: ```python import sys import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> bool: if self._exclude_folder_names: for v2 in self._exclude_folder_names: if v2 in v1.split('\\' if sys.platform ==...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict[str, str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict[str, str]: v1 = {} v2 = self.compute_tag_counts_per_token() for v3 in v2: v4 = '' v5 = 0 for v6 in v2[v3]: ...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any): if self.verbose: print(f'{self} sending: {v1}') return self.pipe.send(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: str, bool, Optional[str], List['types.MessageEntity'], bool, bool, int, Any Output Type: 'Message' Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str, v2: bool=None, v3: Optional[str]=object, v4: List['types.MessageEntity'...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python v0 = List[Dict[str, YamlValue]] ``` ```python v1 = Union[YamlValue, List[YamlValue], Dict[str, YamlValue]] ``` Input Types: v1, str Output Type: Iterable[v0] Dependencies: ```python def v2(v3=None, v4=None, v5=None, v6=None) -> np.ndarr...
Imports: ```python import typing ``` Type definitions: Input Types: requests.Response Output Type: Union[Dict[str, Any], List[Dict[str, Any]]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: requests.Response) -> Union[Dict[str, Any], List[Dict[str, Any]]]: if 'latest-darwin-py' in v1.headers...
Imports: ```python import socket, sys, json, struct import typing ``` Type definitions: Input Types: Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self) -> list: v1 = self._lastRaw_RC try: v2 = json.JSONDecoder().decode(self._remoteInput.decode('utf-8')) v1 = [r...
Imports: ```python from collections import OrderedDict from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Tuple, Union, cast, Sequence import torch from torch import Tensor, nn from torch.distributed.rpc import RRef import torch.autograd import torch.cuda import typing ``` Type definitions: Input Types: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict Dependencies: ```python def v0(v1: Optional[str]=None) -> Toolkit: global _default_toolkit, _toolkit_versions if v1: if v1 in _toolkit_versions: v2 = _toolkit_versions[v1] else: v3 = g...