text
stringlengths
190
325k
Imports: ```python import os import typing ``` Type definitions: Input Types: Any, Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> str: if v2 == 0: return '' if os.path.getsize(v1) == 0: return '' with open(v1, 'rb') as v3: v3.seek(-1, os....
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: [] Dependencies: ```python def v0(v1, v2, v3, v4, v5) -> []: try: v6 = v3[0] v7 = int(''.join(v3[1:])) except: exit(v3) v8 = [1, 0] if v6 == 'U': v8 = [0, 1] elif v6 == 'D': v8 ...
Imports: ```python import requests import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str='https://www.ncbi.nlm.nih.gov/Sequin/acc.html') -> str: v2 = requests.get(v1) if v2.status_code != requests.codes['ok']: raise req...
Imports: ```python import typing ``` Type definitions: Input Types: Any, str, list, list Output Type: (pd.DataFrame, pd.DataFrame) Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: str, v3: list, v4: list) -> (pd.DataFrame, pd.DataFrame): v5 = v1.load_population_df(population=v2, transform=None) ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: tuple Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> tuple: v2 = [s for v3 in v1] v4 = [] v5 = 0 while v5 < len(v2): try: v6 = int(v2[v5]) v5 += 1 except...
Imports: ```python import typing ``` Type definitions: Input Types: str, float Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: float) -> str: v1 = v1.lstrip('#') v3 = int(v1[0:2], 16) v4 = int(v1[2:4], 16) v5 = int(v1[4:6], 16) return f'rgba({v3}, {v4}, {v5...
Imports: ```python import typing ``` Type definitions: Input Types: np.array Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.array): (v2, v3) = self.__p2.propagateBackward(v1) self.__p1.propagateHiddenBackward(v2, v3) return v2 ```
Imports: ```python import numpy as np from numpy.linalg import inv, det, slogdet import typing ``` Type definitions: Input Types: np.ndarray Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray) -> float: v2 = v1.shape[0] v3 = 1 / v2 * np.sum(np.power(v1 - self.mu...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self._camera_feed_task: self._camera_feed_task.cancel() v1 = self.conn.run_coroutine(self._camera_feed_task) v1.result() ```
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float) -> float: (v2, v3) = (self.d, self.v) return v2 * v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: datetime.date, int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: datetime.date, v2: int=1) -> None: v3 = self.used_gb(v1) self._db[self._gb_used_key(v1)] = v3 + v2 ```
Imports: ```python import datetime import re import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): if v1 is None: return None try: return datetime.datetime.strptime(v1, '%Y-%m-%dT%H:%M:%S.%fZ') except: ...
Imports: ```python import os import numpy as np import pandas as pd import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1) -> bool: v2 = [] v3 = [data[0] for v4 in v1] v5 = [v4[1] for v4 in v1] v6 = 0 for v7 in v5: ...
Imports: ```python import tensorflow as tf import typing ``` Type definitions: ```python v0 = Any ``` Input Types: bool Output Type: List[v0] Dependencies: ```python def v1(v2: schema_pb2.Schema, v3: str) -> int: for v4 in v2.feature: if v4.name == v3: return v4.shape.dim[0].size raise Value...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): self._target_reading = v1 * 3 while self._current_reading != self._target_reading: self._move_towards_target() ```
Imports: ```python import re from typing import Any from typing import Pattern import typing ``` Type definitions: Input Types: Pattern[str] | str Output Type: Pattern[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: Pattern[str] | str) -> Pattern[str]: if not isinstance(v1, Pattern): r...
Imports: ```python from pathlib import Path import re import typing ``` Type definitions: ```python class v0(t.NamedTuple): v1: int v2: str ``` Input Types: Connection Output Type: None Dependencies: ```python def v3() -> t.List[v0]: v4 = Path(__file__).with_name('migrations') v5 = re.compile('^(\\d+)\\...
Imports: ```python import itertools, collections import typing ``` Type definitions: ```python class v0(collections.namedtuple('card', ('color', 'symbol', 'shade', 'number'))): def __repr__(self): (v1,) = self.symbol.value & self.shade.value return "sets.Card.from_raw('{} {}')".format(self.color.na...
Imports: ```python import pandas as pd import requests from tqdm import tqdm import typing ``` Type definitions: Input Types: str, str Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: str='财务报告', v2: str='10') -> pd.DataFrame: v3 = 'http://np-anotice-stock.eastmoney.com/api...
Imports: ```python import typing ``` Type definitions: Input Types: _torch.device Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: _torch.device): if isinstance(v1, str): return v1 (v2, v3) = (v1.type, v1.index) if v2 == 'cpu': return v2 return v2.replace...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: list[list[tuple[str, str, Any]]] Dependencies: ```python def v0(v1: list[list[tuple[str, str, Any]]]) -> list[list[tuple[str, str, Any]]]: v2: list[list[tuple[str, str, Any]]] = [] for v3 in v1: if '0001D3C98DD4B6:3' not ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.check_browser_is_up_to_date: self._check_if_chrome_browser_is_up_to_date() ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: typing.Tuple[list, list] Dependencies: Function Name: v0 Function: ```python def v0(self) -> typing.Tuple[list, list]: v1 = [] v2 = [] for v3 in self.__records: v1.append(v3.groupName + ':x:' + str(v3.groupID) + ':' ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, str, str, str, str, str, str Output Type: Dict[str, Dict[str, str]] Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3: str, v4: str, v5: str, v6: str, v7: str, v8: str) -> Dict[str, Dict[str, str]]: if v2 =...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: bytes Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int=-1) -> bytes: if v1 == -1: v2 = self.file.read(v1) v3 = self.buffer self.buffer = b'' if v2: v4 = self.zli...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: int=int(4 * 10 ** 6)) -> list: v2: list = [] v3 = 1 v4 = 1 v5 = v3 + v4 while v5 < v1: if v5 % 2 == 0: v2.append(v5) ...
Imports: ```python import ast import typing ``` Type definitions: Input Types: ast.AST, Optional[ast.AST] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: ast.AST, v2: Optional[ast.AST]=None) -> None: v1.parent = v2 for v3 in ast.walk(v1): for v4 in ast.iter_child_nodes...
Imports: ```python import os 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.driver.get(f"{os.getenv('SITE')}/products/{v1}") self.by_css_selector('body') assert v2 in self.driver.title ```
Imports: ```python import matplotlib.pyplot as plt import typing ``` Type definitions: Input Types: str, str, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3=(10, 7)): plt.figure(figsize=v3) plt.scatter(self.rfm_table[v1], self.rfm_table[v2]) plt....
Imports: ```python import typing ``` Type definitions: Input Types: str, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: bool): if self.contents['new']['shows']['episodes'] is None: self.contents['new']['shows']['episodes'] = {v1: {'sent': v2}} elif ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str) -> int: (v3, v4) = (len(v1), len(v2)) v5 = abs(v3 - v4) for v6 in range(min(v3, v4)): if v1[v6] != v2[v6]: v5 += 1 ...
Imports: ```python import typing ``` Type definitions: Input Types: str, List[str] Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: List[str]) -> str: v3 = [] for v4 in v1: if v4 == '#': v3[-1] = v3[-1].lower() else: v3.append(v4)...
Imports: ```python import typing ``` Type definitions: Input Types: Iterable[Dict[str, Any]], str Output Type: Optional[Dict[str, Any]] Dependencies: Function Name: v0 Function: ```python def v0(v1: Iterable[Dict[str, Any]], v2: str) -> Optional[Dict[str, Any]]: for v3 in v1: if v3.get('id') == v2: ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: for v1 in list(self.agents.values()): v1.takeStep(self) self.kpis.takeStep(self) ```
Imports: ```python import typing ``` Type definitions: Input Types: IO, Union[str, Path] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: IO, v2: Union[str, Path]): if self._default_store is None: raise NotImplementedError() self._stores[self._default_store].persis...
Imports: ```python import torch.nn as nn import torch from torch.optim import Optimizer import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): v2 = [self.dictionary.get_idx_for_item(char) for v3 in v1] v4 = torch.LongTen...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str) -> str: v2 = self.conn.get(f'{self.url}?select=value&key_=eq.{v1}&namespace=eq.{self.namespace}', headers={'Accept': 'application/octet-stream', ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: if self._queue: return next(iter(self._queue)) return -1 ```
Imports: ```python import typing ``` Type definitions: Input Types: float, float, float, float, float, float Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float, v3: float, v4: float, v5: float, v6: float) -> None: self.setToIdentity() self._data[0, 0] = 2 /...
Imports: ```python import copy import typing ``` Type definitions: Input Types: Dict[str, str], List[Text] Output Type: List[sample.Sample] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, str], v2: List[Text]) -> List[sample.Sample]: v3 = [] for (v4, v5) in self.suite_performanc...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: self._raise_error_if_needed() return self._result_hostname ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: dict) -> dict: v2 = {} v3 = ['comment', 'description', 'name', 'platform', 'id', 'pattern_severity', 'rulegroup_id', 'ruletype_id'] for v4 in v3: ...
Imports: ```python from threading import Thread, Lock import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.started == True: return self.started = True self.thread = Thread(target=self.__update, args=()...
Imports: ```python import json import logging import pathlib from pathlib import Path import torch from torch.optim.optimizer import Optimizer from ..datasets import get_dataset from ..datasets.base import Dataset import typing ``` Type definitions: ```python @fix_dataclass_init_docs @dataclass class v0(Result): v1...
Imports: ```python import typing ``` Type definitions: ```python @attr.s(slots=True, frozen=False) class v0: v1 = attr.ib(type=str, default=None) v2 = attr.ib(type=str, default=None) v3 = attr.ib(type=str, default=None) v4 = attr.ib(type=str, default=None) v5 = attr.ib(type=str, default=None) v6...
Imports: ```python import warnings from polars import internals as pli from polars.internals.construction import ColumnsType, arrow_to_pydf, dict_to_pydf, numpy_to_pydf, pandas_to_pydf, sequence_to_pydf, series_to_pydf from polars._html import NotebookFormatter from polars.datatypes import Boolean, DataType, UInt32, Ut...
Imports: ```python import pandas as pd import numpy as np import os import typing ``` Type definitions: Input Types: BaseEstimator, BaseEstimator, pd.DataFrame, pd.DataFrame, str, str, str Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: BaseEstimator, v2: BaseEstimator, v3: pd...
Imports: ```python import argparse import logging import typing ``` Type definitions: Input Types: Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0() -> dict: v1 = argparse.ArgumentParser(description='Extract molecular fragments. See file header for more details.') v1.add_argument...
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): v3 = self.mirrored_channels().get(v1, {}) return v3.get('messages', {}).get(v2, []) ```
Imports: ```python import socket import typing ``` Type definitions: Input Types: str, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: int): if v1[0] == '[' and v1[-1] == ']': v1 = v1[1:-1] return socket.create_connection((v1, v2)) ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int): global end v2 = v1 self.remainder += 1 self.insideNode = None while self.remainder > 0: if self.actLength == 0: se...
Imports: ```python import tensorflow as tf import typing ``` Type definitions: Input Types: tf.Session, Optional[Callable[[str], bool]] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: tf.Session, v2: Optional[Callable[[str], bool]]=None) -> None: self.__saved_variables = {} ...
Imports: ```python import typing ``` Type definitions: Input Types: callable, Optional[int], Optional[List[str]] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: callable, v2: Optional[int]=None, v3: Optional[List[str]]=None) -> None: v2 = v2 or len(self._on_message_callbacks...
Imports: ```python import asyncio import typing ``` Type definitions: Input Types: bool Output Type: bool Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: bool=True) -> bool: await asyncio.sleep(0) if self._channel.is_close: return False else: return v1 ```
Imports: ```python from copy import deepcopy import typing ``` Type definitions: Input Types: nn.Module Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: nn.Module=None): for (v2, v3) in v1._modules.items(): self.add_module(v2, deepcopy(v3)) ```
Imports: ```python import typing ``` Type definitions: ```python v0 = TypeVar('V', bound=Comparable) ``` Input Types: Output Type: bool Dependencies: ```python def v1(v2: v0, v3: bool) -> None: visited.add(v2) color[v2] = v3 for v4 in self._graph[v2]: if v4 not in visited: v1(v4, not v3...
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray, Any, np.ndarray Output Type: Tuple[np.ndarray, np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray, v2: np.ndarray, v3, v4: np.ndarray) -> Tuple[np.ndarray, np.ndarray]: (v5, v6) = s...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> None: if v1 <= 0: del self[:] elif len(self) > v1: v2 = len(self) - v1 del self[0:v2] ```
Imports: ```python import torch import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Optional[torch.Tensor] Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4, v5: Optional[torch.Tensor]) -> torch.Tensor: if v1.dim() == 3: if v5 is None: ...
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._unauthorized_events: if not isinstance(self._unauthorized_events, (str, bytes)): return self._unauthorized_events ...
Imports: ```python import typing ``` Type definitions: Input Types: torch.nn.Module Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.nn.Module) -> Dict: v2 = dict() for (v3, v4) in v1.named_modules(): v2[v3] = v4 return v2 ```
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: if self.direction == 'put': if not v1: v1 = self._file_cmd_prefix() + 'file dir {}/{}'.format(self.file_syst...
Imports: ```python import typing ``` Type definitions: ```python class v0(Chain): def __init__(self: v0, v1: str, *, v2: ConfigFile, v3: Optional[str]=None, v4: bool=False, v5: str=os.devnull) -> None: v6 = Node(config=v2, command_log=v3, exe=v1, name='mainchain') self.server_running = False ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Tuple[float, float] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Tuple[float, float]: v1 = 0.0 v2 = 0.0 try: v3 = int(self.quadrant_5min) except TypeError: return (v2, v1) if v3...
Imports: ```python from hashlib import md5 import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: if not isinstance(v1, bytes): v1 = v1.encode() return md5(v1).hexdigest() ```
Imports: ```python import typing ``` Type definitions: Input Types: List[List[Tuple[Tuple, Tuple]]], Dict[str, Any], Dict[str, Any], Dict[str, Any], Dict[str, Any] Output Type: (List[List[Tuple]], List[List[int]], List[List[int]]) Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[List[Tuple[Tu...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: None Dependencies: ```python def v0(v1, v2): self._invalidate_cache_and_stream(v1, self.get_if_user_has_pusher, (user_id,)) self.db_pool.simple_delete_txn(v1, table='pushers', keyvalues={'user_name': user_id}) self.db_pool...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self, **v1) -> List[str]: if not self.export_as_parquet: return [f'ARRAY(SELECT {self.feature} FROM {self.feature}_cat_subq) AS {self.feature}_cat'] el...
Imports: ```python import math import typing ``` Type definitions: ```python @dataclass class v0: v1: int v2: List[int] ``` Input Types: IO Output Type: int Dependencies: ```python def v3(v4: IO) -> v0: v5 = int(v4.readline().strip()) v6 = v4.readline().strip() v7 = list(map(lambda id: 0 if id == 'x...
Imports: ```python from pandas._config import get_option from pandas._libs import lib, properties, reshape, tslibs from pandas._libs.lib import no_default from pandas._typing import AggFuncType, ArrayLike, Axis, Dtype, DtypeObj, FrameOrSeriesUnion, IndexKeyFunc, NpDtype, SingleManager, StorageOptions, ValueKeyFunc from...
Imports: ```python import typing ``` Type definitions: ```python class v0: v1: ClassVar[bool] = True v2: ClassVar[List[ItemCallbackType]] = [] def v3(cls) -> None: v4: List[ItemCallbackType] = [] for v5 in reversed(cls.__mro__): for v6 in v5.__dict__.values(): if...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = 'targets/' if not v1.startswith(v2): v1 = v2 + v1 return v1 ```
Imports: ```python import typing ``` Type definitions: ```python class v0: v1: int = EventLevel.none v2: Target = None v3: str = None def __init__(self, v4: int, v5: str, v6: Target=None): self._level = v4 self._message = v5 self._target = v6 def v7(self): if self._...
Imports: ```python from .io import X12SegmentReader, X12ModelReader import typing ``` Type definitions: Input Types: str Output Type: List Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> List: with X12SegmentReader(v1) as v2: v3 = [] for (v4, v5) in v2.segments(): ...
Imports: ```python from textwrap import dedent import typing ``` Type definitions: Input Types: Path, str Output Type: None Dependencies: ```python def v0(v1: Path) -> Repository: while v1.name and (not v1.exists()): v1 = v1.parent v2 = Repository.discover(v1) assert v2 is not None return v2 ``...
Imports: ```python from sklearn.model_selection import train_test_split from torch.utils.data import DataLoader, SubsetRandomSampler, Sampler import typing ``` Type definitions: Input Types: pd.DataFrame, List[float] Output Type: List[Sampler] Dependencies: ```python def v0(v1: pd.DataFrame, v2: List[float]=(0.6, 0.2,...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> int: v2 = len(v1) v3 = set() v4 = 0 v5 = 0 v6 = 0 for v7 in range(v2): if v1[v7] in v3: while v1[v7] in v3: ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> None: v3 = self._get_dataset(v1)['id'] v4: Dict[str, str] = {'name': v2} self._client.open_api_do('PATCH', '', v3, json=v4) `...
Imports: ```python import sys import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python async def v0(self) -> None: self.stream_writer.close() if sys.version_info >= (3, 7): await self.stream_writer.wait_closed() ```
Imports: ```python import typing ``` Type definitions: Input Types: List['AxisType'], List['AxisType'] Output Type: List[int] Dependencies: Function Name: v0 Function: ```python def v0(v1: List['AxisType'], v2: List['AxisType']) -> List[int]: v3 = [] for v4 in v2: for v5 in range(len(v1)): ...
Imports: ```python import torch from torch import Tensor, device, nn from torch.nn import CrossEntropyLoss import typing ``` Type definitions: Input Types: Tensor Output Type: Tensor Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Tensor) -> Tensor: if v1.dim() == 3: v2 = v1[:, None, ...
Imports: ```python import typing ``` Type definitions: ```python class v0(Entity): v1: Entity.Signal class v2(IntEnum): """Bit-flags para verificação do modo de parada no processamento da árvore.""" v3: int = 1 v4: int = 2 v5: int = 4 v6: int = 8 class v7(Exception)...
Imports: ```python from torch import cuda import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0() -> int: if not cuda.is_available(): return 0 v1 = cuda.memory_reserved(0) v2 = cuda.memory_allocated(0) v3 = v1 - v2 ret...
Imports: ```python from random import randint import typing ``` Type definitions: Input Types: Any, int Output Type: Any Dependencies: ```python def v0(v1, v2): v3 = randint(v1, v2) v4 = freq[unique[v3]] (unique[v3], unique[v2]) = (unique[v2], unique[v3]) v3 = v2 v5 = v1 for v6 in range(v1, v2)...
Imports: ```python import typing ``` Type definitions: Input Types: float Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float): if self.mass is not None and self.density is not None: v2 = self.weight v3 = self.sys.sref v4 = self.density self....
Imports: ```python import copy from datetime import datetime as dt import typing ``` Type definitions: Input Types: dict, str, list, dict, Any, Any Output Type: Any Dependencies: ```python def v0(v1: dict, v2: dict, v3=False): v4 = v1['case'] v5 = v1['workflow'] v6 = v1['case_analysis_type'] v7 = v1['w...
Imports: ```python import typing ``` Type definitions: ```python class v0(np.ndarray): def v1(cls, v2, *, v3=None, **v4): v5 = np.asarray(v2).view(cls) v5.name = v3 or v2.name v5._opts = v4 return v5 def v6(self, v7): if v7 is not None: self.name = getattr(v...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(v1: pd.DataFrame) -> pd.DataFrame: v2 = v1.unstack(level='bias').droplevel(level=0, axis=1).rename_axis(columns='') return v2.div(v2.sum(axis=1)...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Tuple[Any, Any, str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Tuple[Any, Any, str]: if self.exception is not None: self.abort() raise self.exception if self.task_result is None: ...
Imports: ```python from pathlib import Path import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): assert Path(v1) == Path('/home') return True ```
Imports: ```python import pandas as pd import typing ``` Type definitions: Input Types: Output Type: pd.Series Dependencies: Function Name: v0 Function: ```python def v0(self) -> pd.Series: v1 = self.get_parameters().keys() v2 = self.get_parameters().values() (v3, v4) = list(zip(*self.get_soil_params()))...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = self.compile_frontmatter() v1 += self.body for v2 in self.children: v1 += v2.compile_string() v1 += self.compile_backmatter() ...
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: if not v1: return 0 v2 = 0 v3 = 1 while v3 < len(v1): if v1[v2] != v1[v3]: v1[v2 + 1] = v1[...
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): v3 = self.player_repository.find(v1) v4 = self.card_repository.find(v2) v3.card_repository.add(v4) return f'Successfully add...
Imports: ```python from pandas import DataFrame, concat import typing ``` Type definitions: Input Types: dict, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: dict, v2: str): v3 = DataFrame.from_records([v1]) v3.insert(loc=0, column='Species', value=[v2]) try: v...
Imports: ```python from datetime import date import typing ``` Type definitions: Input Types: ET.Element, dict Output Type: Optional[date] Dependencies: Function Name: v0 Function: ```python def v0(v1: ET.Element, v2: dict) -> Optional[date]: v3 = v1.findall('mets:metsHdr/mets:altRecordID', namespaces=v2) for...
Imports: ```python import subprocess import typing ``` Type definitions: ```python v0 = xcli.Annotated[tp.Optional[str], xcli.Arg(metavar='ENV', nargs='?', completer=venv_names_completer)] ``` Input Types: v0 Output Type: Any Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0=None): v3 = self....
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: np.uint8 Dependencies: Function Name: v0 Function: ```python def v0(self) -> np.uint8: if self.getFlag('C') == 0: self.cycles += 1 self.addr_abs = self.pc + self.addr_rel & 65535 if self.addr_abs & 65280 != s...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> str: v2 = [0] * 256 for v3 in v1: v2[ord(v3)] += 1 (v4, v5) = ([(v2[i], chr(i)) for v6 in range(256)], '') v4.sort(reverse=True)...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1, v2) -> float: if v2.end > v1.end and v2.start >= v1.start: return (v1.end - v2.start + 1) / (v2.end - v1.start + 1) elif v1.end > v2.end and v1...