text
stringlengths
190
325k
Imports: ```python import os import typing ``` Type definitions: Input Types: Dict Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict) -> Dict: v2 = {} for (v3, v4) in v1.items(): assert os.path.exists(os.path.dirname(v3)), '%r is not a valid path' % v3 v2[v3...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> bool: if not v1: self.log.warning('Request failed. Response is None.') return False if v1.errors: self.log.warning('Request ...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, datetime Output Type: Any Dependencies: Function Name: v0 Function: ```python async def v0(self, v1: str, v2: str, v3: datetime): v4 = '\n INSERT INTO statsp (oper, mask, ts)\n VALUES ($1, $2, $3)\n ' as...
Imports: ```python import typing ``` Type definitions: Input Types: Generator[Tuple[str, str], None, None] Output Type: Generator[Tuple[str, str], None, None] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Generator[Tuple[str, str], None, None]) -> Generator[Tuple[str, str], None, None]: if ...
Imports: ```python import typing ``` Type definitions: Input Types: Set[int] Output Type: list[str] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Set[int]) -> list[str]: v2 = {} for v3 in v1: v4 = self.graph.vertex(v3) for v5 in v4.out_edges(): v6 = self.thre...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: v1 = self.descriptor() v2 = v1.records v1.records += 1 v1.save().ok() return v2 ```
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): if 'default=' in v2: if 'number' in v1: return int(re.match('.*default=([^,)]+)', v2).group(1)) if 'stri...
Imports: ```python from urllib.parse import urljoin import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: requests.Response) -> Any: try: logger.debug('Equivalent curl command: %s', curlify.to_curl(v1.request)) except Exception: pass try: ...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[Dict[str, Any]], Optional[requests.PreparedRequest] Output Type: str Dependencies: ```python def v0(v1: str, v2: Any) -> bool: if v1 in ('method', 'url'): return False return v2 not in (None, {}) ``` Function Name: v3 Function...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self) -> Dict[str, Any]: v1 = {} if not all((d == 2 for v2 in self._qid_shape)): v1['qid_shape'] = self._qid_shape return {'num_qubits': len(s...
Imports: ```python import typing ``` Type definitions: ```python v0 = Tuple[str, Sequence[str], int] ``` Input Types: List[v0] Output Type: None Dependencies: Function Name: v1 Function: ```python def v1(self, v2: List[v0]) -> None: for (v3, v4, v5) in v2: self.add_message(msgid=v3, args=v4, line=v5) ```
Imports: ```python import typing ``` Type definitions: Input Types: list, list, str Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1: list, v2: list, v3: str) -> list: v4 = [] v5 = {getattr(item, v3): item for v6 in v2} v7 = set() for v6 in v1: v8 = getattr(v6, v...
Imports: ```python import typing ``` Type definitions: Input Types: Dict Output Type: Dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict) -> Dict: if self.share_encoder: v2 = self.encoder(v1) else: v2 = self.critic_encoder(v1) v2 = self.critic_head(v2) retur...
Imports: ```python import os import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0() -> float: v1 = os.environ.get('ASYNC_TEST_TIMEOUT') if v1 is not None: try: return float(v1) except ValueError: pass return 5 ``` Functio...
Imports: ```python import typing ``` Type definitions: Input Types: Union[int, str, flow.device] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[int, str, flow.device]=None): if v1 is None: v1 = 'cuda' elif isinstance(v1, int): v1 = 'cuda:' + str(v1)...
Imports: ```python import typing ``` Type definitions: Input Types: Any, int Output Type: Union[int, list] Dependencies: Function Name: v0 Function: ```python def v0(self, v1=None, v2: int=-1) -> Union[int, list]: if v2 < 0: v2 = self.speed v3 = self.look(distance=v2) if v1 == None: return...
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 = 0 v3 = v1 v4 = False v5 = 0 while v2 <= v3 and (not v4): v5 = (v2 + v3) // 2 if v5 * v5 == v1: ...
Imports: ```python import seaborn as sns import matplotlib import matplotlib.pyplot as plt import typing ``` Type definitions: Input Types: str, dict, int, Tuple[float, float] Output Type: matplotlib.axes.Axes Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: dict, v3: int=10, v4: Tuple[float, f...
Imports: ```python import typing ``` Type definitions: Input Types: Callable[[], AsyncGenerator[None, None]] Output Type: Callable[[], AsyncGenerator[None, None]] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Callable[[], AsyncGenerator[None, None]]) -> Callable[[], AsyncGenerator[None, None]]:...
Imports: ```python import typing ``` Type definitions: Input Types: aiosqlite.Connection Output Type: Dict[str, str] Dependencies: Function Name: v0 Function: ```python async def v0(v1: aiosqlite.Connection) -> Dict[str, str]: v2 = await v1.execute('SELECT key, value from peer_metadata') v3 = await v2.fetchal...
Imports: ```python import requests import typing ``` Type definitions: Input Types: str, str Output Type: Union[dict, list] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, **v3: dict) -> Union[dict, list]: v4 = requests.request(v1, v2, **v3) v4.raise_for_status() return ...
Imports: ```python import requests import typing ``` Type definitions: Input Types: List[dict] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[dict]): v2 = f'{self._service_url}/registerDataset' v3 = requests.put(v2, headers=self._headers(), json=v1) v3.raise_for...
Imports: ```python from math import ceil from statistics import mean, median import typing ``` Type definitions: Input Types: List[int] Output Type: int Dependencies: ```python def v0(v1: int): return (v1 ** 2 + v1) // 2 ``` Function Name: v2 Function: ```python def v2(v3: List[int]) -> int: v4 = mean(v3) ...
Imports: ```python import typing ``` Type definitions: Input Types: metadata_base.DataMetadata, typing.Sequence[int] Output Type: typing.Sequence[int] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: metadata_base.DataMetadata, v2: typing.Sequence[int]) -> typing.Sequence[int]: if self.hyperpa...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: logging.Logger, str Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(self, v1: logging.Logger, v2: str) -> np.ndarray: v1.info('Loading bags of words ...') with open(v2, 'r', encoding='utf-...
Imports: ```python import typing ``` Type definitions: Input Types: Any, int, Any Output Type: Any Dependencies: ```python def v0(): v1 = 0 for v2 in note_to_dulcimer_string: if len(note_to_dulcimer_string[v2]) > v1: v1 = len(note_to_dulcimer_string[v2]) return v1 ``` ```python def v3(v...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Set[str] Dependencies: ```python def v0(v1: str) -> bool: return v1 == '&' or v1 == '|' or v1 == '->' ``` ```python def v2(v3: str) -> bool: return v3 == 'A' or v3 == 'E' ``` ```python def v4(v5: str) -> bool: return v5[0] >=...
Imports: ```python import typing ``` Type definitions: Input Types: List[Tuple[int, str]], Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Tuple[int, str]], v2=chunk_size): while True: for v3 in range(0, len(v1), v2): yield v1[v3:v3 + v2] ```
Imports: ```python import math import typing ``` Type definitions: Input Types: Optional[int] Output Type: Iterable[int] Dependencies: ```python def v0(v1: int) -> Iterable[int]: if v1 < 0: raise ValueError('Negative numbers are not supported.') v2 = 2 while v2 <= math.floor(math.sqrt(v1)): ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.un_indent() self.println('end else begin') self.do_indent() ```
Imports: ```python import typing ``` Type definitions: Input Types: List[Dict[int, float]] Output Type: Dict[int, float] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[Dict[int, float]]) -> Dict[int, float]: v2 = self.create_accumulator() for v3 in v1: for (v4, v5) in v3.ite...
Imports: ```python import gzip import json from itertools import chain, count from operator import methodcaller import typing ``` Type definitions: Input Types: Any, str Output Type: None Dependencies: ```python def v0(v1: BaseEntity) -> BaseEntity: v2 = v1.copy() v2['id'] = v1.md5 v2['bel'] = v1.as_bel() ...
Imports: ```python import numpy as np import cv2 import typing ``` Type definitions: Input Types: np.array, np.array, np.array, np.array Output Type: Any Dependencies: ```python def v0(v1: list, v2: np.array) -> (np.array, np.array): (v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) = v2 (v15, v16) = ((v1[...
Imports: ```python import typing ``` Type definitions: Input Types: pd.DataFrame, np.ndarray, np.ndarray Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.DataFrame, v2: np.ndarray=None, v3: np.ndarray=None): v4 = v1.index.get_level_values('date').unique() v5 = sorted(v4...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: Optional[models.User] Dependencies: Function Name: v0 Function: ```python async def v0(self) -> Optional[models.User]: v1 = await self.async_get_users() return next((user for v2 in v1 if v2.is_owner), None) ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: ```python def v0(v1: str, v2: str): if v1: v3 = f'{v1}\n{v2}' else: v3 = v2 raise AssertionError(v3) ``` Function Name: v4 Function: ```python def v4(v5: Any, v6: str=''): if v5 i...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: int) -> bool: (v2, v3) = (0, '') for (v4, v5) in enumerate(str(v1)[::-1], 1): if v4 == 1: v3 = v5 else: v2 += int(v4)...
Imports: ```python from collections import Counter import numpy as np from scipy.stats import entropy import torch import typing ``` Type definitions: Input Types: str, int, int, float Output Type: Any Dependencies: ```python def v0(v1, v2, v3, v4, v5=1, v6=128): if v2 is None and v1 is None: return None ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Union[int, slice, str], Any, Any, Any Output Type: Union[Dict, List] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[int, slice, str], v2=None, v3=None, v4=False) -> Union[Dict, List]: if isinstance(v...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self._client is None: raise ValueError('MailgunSender is not open') self._client.close() self._client = None ```
Imports: ```python 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=lambda _: True): v4 = self.search(v1).__dict__[v2] if len(v4) == 0: return None v4 = list(filter(v3, v4)) if ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = 'my-awesome-project / issue #1 Issue title' v2 = 'Tomasz Kolek created [issue #1](https://gitlab.com/tomaszkolek0/my-awesome-project/issues/1) (...
Imports: ```python import pandas as pd import matplotlib.pyplot as plt from pandas.plotting import table import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: str): return pd.read_csv(v1) ``` Function Name: v2 Function: ```python def v2(v3: str): v4 = plt.subp...
Imports: ```python import warnings import numpy as np import scipy from numpy import ndarray as array from numpy.lib.stride_tricks import as_strided from scipy.signal import get_window import typing ``` Type definitions: Input Types: array, int, int, int, str, bool, str, float Output Type: array Dependencies: ```pytho...
Imports: ```python import argparse import dataclasses import itertools import os import typing ``` Type definitions: Input Types: Output Type: None Dependencies: ```python def v0(v1: Dict[str, Any]) -> Dict[str, Any]: for (v2, v3) in v1.items(): if isinstance(v3, tuple): v1[v2] = tuple(v3) ...
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: if not isinstance(v1, str): return v2 = 0 for v3 in ['400', '200', '100', '50', '40', '25', '10', '5', '2.5', '1']: ...
Imports: ```python from pandas._typing import Scalar from pandas.api.extensions import ExtensionArray import pandas as pd from pandas.core.window import ExponentialMovingWindow import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0() -> None: ...
Imports: ```python import typing ``` Type definitions: Input Types: Schema.Column Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Schema.Column) -> str: if not v1.scala_annotation.original_name: return v1.name() return f'`{v1.scala_annotation.original_name}`' ```
Imports: ```python import re import typing ``` Type definitions: Input Types: str, Dict[str, str] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: Dict[str, str]) -> None: if not v2: raise ValueError('Hash dict is empty') v3 = v1.split('.') if len(v3) < 2: ...
Imports: ```python import dask import dask.array as da from dask.array.core import slices_from_chunks from dask.array.optimization import fuse_slice from dask.utils import is_arraylike from dask.optimization import fuse from dask.delayed import Delayed from dask.core import flatten from dask.base import tokenize from d...
Imports: ```python import os import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: if self.options.compiler_path: if os.path.isabs(self.options.compiler_path): return self.options.compiler_path return...
Imports: ```python import traceback import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): (v2, v3) = self.get_diagnostics(v1) if v2 is not None: self.conn.send_notification('textDocument/publishDiagnostics', {'u...
Imports: ```python import typing ``` Type definitions: Input Types: bytes, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: bytes, v2: int): v3 = v2 - len(v1) % v2 v4 = bytes([v3]) * v3 return v1 + v4 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: str): v3 = '\n SELECT e.event_id FROM event_forward_extremities AS f\n INNER JOIN events AS e USING (event_id)\n W...
Imports: ```python import json import os import os.path import typing ``` Type definitions: Input Types: str, bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: bool=False) -> None: if os.path.isfile(v1) and (not v2): raise Exception(f"Wallet file '{v1}' a...
Imports: ```python from typing import Any, Callable, Dict, Generator, List, Mapping, Optional, Tuple, Union, cast import typing ``` Type definitions: Input Types: Any, Session Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: Session): v3 = self.postgres.sql v1.execute(...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> bool: v1 = v1.lower() for v2 in ('simultaneous ip', 'multiple ip'): if v2 in v1: return True return False ```
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> bool: self.unmarked.discard(v1) for v2 in self.axes: v2.discard(v1) if not v2: return True return False ```
Imports: ```python import json import requests import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = requests.Response() v2.status_code = 404 v2._content = json.dumps({'error': {'code': 'NotFound', 'message': f"Resou...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: if v1 == 'fip': return 'FIP' elif v1 == 'fip_rock': return 'Rock' elif v1 == 'fip_jazz': return 'Jazz' elif v1 ==...
Imports: ```python import socket import ssl import datetime import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = '%b %d %H:%M:%S %Y %Z' v3 = ssl.create_default_context() v3.check_hostname = False v4 = v3.wrap_so...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, **v1) -> list: self._update_read_access_time() return self._collect(**v1) ```
Imports: ```python import math import typing ``` Type definitions: ```python class v0: def __init__(self, v1, v2: BotAI): """ :param proto_data: :param bot_object: """ self._proto = v1 self._bot_object = v2 self.cache = {} def __repr__(self) -> str: ...
Imports: ```python import matplotlib.pyplot as plt import numpy as np from scipy.signal import find_peaks from scipy import interpolate from scipy import integrate import typing ``` Type definitions: Input Types: Any, list, list, int, bool Output Type: list Dependencies: ```python def v0(v1): return np.sqrt((v1 **...
Imports: ```python import typing ``` Type definitions: Input Types: GObject.GParamSpec, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: GObject.GParamSpec, v2): if v1.name == 'send-result-url': self.connection_url = v2 ```
Imports: ```python import typing ``` Type definitions: Input Types: bs4.BeautifulSoup Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: bs4.BeautifulSoup) -> dict: v2 = v1.select('h1[class~="main_title"]') if len(v2) != 1: raise ValueError('Unable to find a unique main_t...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: torch.Tensor Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor: assert v1.numel() == v2.numel(), 'Prediction tensor and label tensor...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: if v1 == 'html': return '.html' return '.md' ```
Imports: ```python import typing ``` Type definitions: Input Types: Iterable['Document'] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Iterable['Document']) -> None: v2 = [] for v3 in v1: v2.append({'_op_type': 'index', '_id': v3.id, '_index': self._config.inde...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: typing.NoReturn Dependencies: Function Name: v0 Function: ```python def v0() -> typing.NoReturn: v1 = input() print('Yes' if '7' in v1 else 'No') ```
Imports: ```python import typing ``` Type definitions: Input Types: _np.array, _np.ndarray Output Type: _typing.Tuple[_np.ndarray, _np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: _np.array, v2: _np.ndarray) -> _typing.Tuple[_np.ndarray, _np.ndarray]: self._f = v1.copy() self....
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.base[self.operand] for v2 in set(self.base.keys()).difference(self.to_merge.keys()): self.handle_base_only_key(v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: bool Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: bool=False, **v2) -> None: for v3 in self.learner_list: v3._fit_to_known(bootstrap=v1, **v2) ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = f'{self.DB_SCHEMA}://{self.DB_USERNAME}:{self.DB_PASSWORD}@{self.DB_HOST}' if self.DB_PORT: v1 += f':{self.DB_PORT}' if self.AUTH_DB_N...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: List[np.array] Output Type: np.array Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[np.array]) -> np.array: v2 = len(v1) (v3, v4) = v1[0].shape v5 = v3 * v4 v6 = np.zeros((v2, v5), dtype=c...
Imports: ```python import os import os.path import typing ``` Type definitions: Input Types: str Output Type: Optional[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> Optional[str]: (v2, v3) = os.path.split(v1) if v2: if os.path.isfile(v1): return v1 else: ...
Imports: ```python import typing ``` Type definitions: Input Types: float, float, float Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: float, v3: float) -> float: if v1 >= v3: return v3 elif v1 <= v2: return v2 return v1 ```
Imports: ```python import typing ``` Type definitions: ```python class v0(Generic[T]): def __init__(self, v1: T) -> None: self.data = v1 self.parent = self self.rank = 0 ``` ```python v2 = TypeVar('T') ``` Input Types: v2 Output Type: v0[v2] Dependencies: Function Name: v3 Function: ```pyt...
Imports: ```python import random import numpy as np import torch import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: ```python def v0(v1: str, v2: str) -> float: return sentence_bleu(v2, [v1]).score ``` ```python def v3(v4: str, v5: List[List[str]], v6: Callable[[str, str], float], ...
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray, np.ndarray, np.ndarray, float Output Type: Tuple[np.ndarray, np.ndarray] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: np.ndarray, v2: np.ndarray, v3: np.ndarray, v4: float=4.0) -> Tuple[np.ndarray, np.ndarray]: ...
Imports: ```python import collections 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 = collections.deque() (v4, v5) = ([], len(v1)) for (v6, v7) in zip(range(1 ...
Imports: ```python from nltk.translate.bleu_score import sentence_bleu import typing ``` Type definitions: Input Types: Sequence[str], Sequence[str] Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: Sequence[str], v2: Sequence[str]) -> float: if not v2: if not v1: ...
Imports: ```python import json import typing ``` Type definitions: Input Types: [], str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: [], v2: str): if 'json' in str(v2): with open(v2, 'r') as v3: v4 = json.load(v3) v1['rpc_address'] = v4['rpc_addre...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: xr.DataArray, xr.DataArray Output Type: xr.DataArray Dependencies: Function Name: v0 Function: ```python def v0(v1: xr.DataArray, v2: xr.DataArray) -> xr.DataArray: v3 = v1.copy() if v2.ndim == 3 and v1.ndim == 3: v...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor Output Type: np.ndarray Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: torch.Tensor) -> np.ndarray: v3 = v2.cpu().numpy() v4 = [] for v5 in range(v1.shape[0])...
Imports: ```python from requests import get import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v2 = get(v1) if v2.status_code == 200: v3 = v2.text else: raise v2.raise_for_status() return v3 ...
Imports: ```python from random import shuffle, sample import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: (v1, v2) = sample(range(len(self.letters)), k=2) (self.letters[v1], self.letters[v2]) = (self.letters[v2], self.le...
Imports: ```python import typing ``` Type definitions: Input Types: hgrepo.HgRepository Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: hgrepo.HgRepository) -> None: v1.write_file('contents1', 'c1\n') v1.write_file('contents2', 'c2\n') v1.symlink('symlink', 'contents...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self) -> int: if self.size != 0: return self.circular_q[self.front] else: return -1 ```
Imports: ```python import torch from torch import Tensor, nn import typing ``` Type definitions: Input Types: Dict[str, Any] Output Type: Dict[str, Tensor] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, Any]) -> Dict[str, Tensor]: v2 = self.preprocess_sample(v1) v3 = self.embed...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.assertNotEqual(len(self.streams), 0) v1 = ['Verona2', 'Denmark5'] self.assertNotEqual(len(v1), 0) v2: List[Mapping[str, Any]] = [] w...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[Tuple[int, int]] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[Tuple[int, int]]: v1: List[Tuple[int, int]] = [] for v2 in self.__regras: if not v2.esta_ativa(): continue ...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = v1.split(' ', 1) (v3, v4) = v2 if len(v2) == 2 else [v1, ''] return (v3, v4.lstrip()) ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str) -> int: if not v1: return 0 v2 = 0 v3 = {} v4 = 0 for v5 in range(len(v1)): if v1[v5] in v3 and v3[v1[v5]] >= v4: ...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Any] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Dict[str, Any]) -> None: v1['google_cloud_creds'] = self.session.creds.google_sheets(self.config['gcp_creds_name']) del v1['gcp_creds_name']...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Any) -> None: if not self._head: raise KeyError('Value not found %s', v1) if self._head.val == v1: self._head = self._head.next ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.aea_tool.teardown() self.aea_tool.aea.runtime.agent_loop._teardown() ```
Imports: ```python import math import typing ``` Type definitions: Input Types: Any Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self, v1) -> float: v2 = self.x - v1.x v3 = self.y - v1.y v4 = self.z - v1.z return math.sqrt(v2 * v2 + v3 * v3 + v4 * v4) ```
Imports: ```python import itertools import sys import heapq import typing ``` Type definitions: Input Types: list[list[int]] | np.ndarray Output Type: int Dependencies: ```python def v0(v1, v2=0): if v1 in entry_finder: remove_task(v1) v3 = next(counter) v4 = [v2, v3, v1] entry_finder[v1] = v4 ...
Imports: ```python import numpy as np from scipy.interpolate import griddata, interp1d, interp2d from scipy.spatial import distance import typing ``` Type definitions: Input Types: float, float, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: float, v2: float, v3=True): (...