text stringlengths 190 325k |
|---|
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: int, Any
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: Any=None) -> bytes:
v3 = random.Random()
if v2 is not None:
v3.seed(v2)
v4 = []
for v5 in range(v1):
v4.... |
Imports:
```python
from datetime import datetime, timedelta
import typing
```
Type definitions:
Input Types: Callable, Union[float, int]
Output Type: Callable
Dependencies:
```python
def v0(v1: Sequence=None, v2: Mapping=None, v3=object()) -> int:
v4 = tuple(v1) if v1 else ()
v5 = tuple(v2.items()) if v2 else ... |
Imports:
```python
import socket
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: str, v3=lambda x: x.decode('utf8'), v4=lambda x: x + b'\r\n'):
if isinstance(v2, str):
v2 = v2.encode('utf8')
with socket.socket() as v5:
... |
Imports:
```python
import os
from pathlib import PosixPath
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1) -> bool:
if 'model' in v1:
v2 = v1['model']
if isinstance(v2, PosixPath) or isinstance(v2, str):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> str:
if len(v1) != len(v2):
raise ValueError('Different length strings not available.')
v3 = []
for (v4, v5) in zip(v1, v2):
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: int):
v3 = 'UPDATE event_users SET points=points+$2 WHERE uid=$1'
await self.execute(v3, [v1, v2])
``` |
Imports:
```python
import hashlib
import typing
```
Type definitions:
Input Types: bytes
Output Type: Any
Dependencies:
```python
def v0(v1: int) -> str:
v2 = ''
v1 = int(v1)
if v1 < 0:
return v2
while v1 > 0:
v2 += alphabet[v1 % len58]
v1 //= len58
return v2[::-1]
```
Funct... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple) -> None:
if not isinstance(v1, tuple):
raise ValueError('insert expects a tuple as an argument')
elif len(v1) != 2:
raise Valu... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, float, float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: float=0.0, v3: float=0.0, v4: float=2.0):
v5 = self._random_sequence(length=v1, low=0.0, high=2.0 * np.pi)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = 'likes' if self.likes_only else 'full'
return self.category.lower() + '_' + v1 if self.category else v1
``` |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
from matplotlib.patches import Polygon
import typing
```
Type definitions:
Input Types: np.ndarray, Any, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2, v... |
Imports:
```python
import copy
import typing
```
Type definitions:
```python
@dataclasses.dataclass(frozen=True, order=True)
class v0:
v1: float
v2: int
v3: int
v4: bool
v5: Optional[pyreach.PyReachStatus]
```
Input Types:
Output Type: Dict[int, v0]
Dependencies:
Function Name: v6
Function:
```pyt... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Tuple[str]], List[Tuple[str, str, str]]
Output Type: List
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[Tuple[str]], v2: List[Tuple[str, str, str]]) -> List:
v3 = []
if len(v1) <= 1:
return v3
v4 = {}
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Any, float
Output Type: List[List[List[float]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: float=0.0) -> List[List[List[float]]]:
v4 = self._rng.normal(0, self._iq_cluster_width, size=v2)
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Dict[int, Type[Message]], v2: Dict[int, Type[Response]], v3: Optional[str]=None, v4: bool=True, v5: bool=True, v6: bool=False) -> None:
"""Create a protocol with a given configuration.
Note that commo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> str:
v2 = v1.body.div.section.main.div.header.div.div.span.img.get('src')
return v2
``` |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
```python
def v0() -> str:
return random.choice(FORTUNES)
```
```python
def v1(v2: int) -> list:
v3 = []
for v4 in range(v2):
v3.append(random.randint(0, 99))
return v3
```
Funct... |
Imports:
```python
import typing
```
Type definitions:
Input Types: datetime
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: datetime) -> str:
v2 = v1.isoformat()
v3 = v2.replace(':', '')
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, str
Output Type: Any
Dependencies:
```python
def v0(v1: dict):
v2 = 'Yes'
print('========================')
print('name : {}'.format(v1['name']))
print('coef : {}'.format(v1['coefficient']))
print('type ... |
Imports:
```python
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: List[Tensor], List[Tensor]
Output Type: Dict[str, Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[Tensor], v2: List[Tensor]) -> Dict[str, Tensor]:
v3 = {'input_ids': torch.cat(v1),... |
Imports:
```python
from resource import setrlimit, RLIMIT_AS, RLIMIT_NPROC
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int=None, v2: int=None):
if v1:
setrlimit(RLIMIT_AS, (v1, v1))
if v2:
setrlimit(R... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: 'SiteEvent'
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> 'SiteEvent':
(self.start, self.end, self.is_inverse) = (self.end, self.start, not self.is_inverse)
return self
``` |
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 = v1['type'].lower()
v3 = {'CORTEX_LOG_LEVEL': v1['log_level'].upper(), 'CORTEX_SERVING_PORT': v1['serve_port'], 'CORTEX_PROCESS... |
Imports:
```python
import collections
import typing
```
Type definitions:
Input Types: Any
Output Type: Tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> Tuple:
if v1 is None:
raise ValueError('The argument must not be None')
if isinstance(v1, collections.abc.Iterable):
r... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
v1 = 'git clone https://github.com/brendangregg/FlameGraph'
os.system(v1)
os.makedirs('./plots', exist_ok=True)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(*v1: Metadata) -> Dict[str, Any]:
v2: Dict[str, Any] = {}
for v3 in v1:
v2 = v3.meta(v2)
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[dict]:
v1 = '\n SELECT * FROM require_translate_t\n ORDER BY iid\n '
v2 = self.db.select_and_fetchall(v1, query... |
Imports:
```python
from threading import Thread
import typing
```
Type definitions:
Input Types: IO, TextIOWrapper
Output Type: Any
Dependencies:
```python
def v0(v1: IO, v2: TextIOWrapper):
for v3 in iter(v1.readline, ''):
v2.writelines(v3)
v2.flush()
if self.verbose:
print(v3.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: str, v3):
v4 = f'INSERT INTO user_info (member_id, {v2}) VALUES ($1, $2)\n ON CONFLICT (member_id) DO UPDATE S... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True) -> bool:
v2 = True
if not super()._check_configuration(v1):
return False
if self.cost_operator is None:
v2 = False
... |
Imports:
```python
from pandas._libs import lib
from pandas._libs.tslibs import NaT, OutOfBoundsDatetime, OutOfBoundsTimedelta, Timedelta, Timestamp, conversion, ints_to_pydatetime
from pandas._libs.tslibs.timedeltas import array_to_timedelta64
from pandas._typing import ArrayLike, Dtype, DtypeObj, Scalar
from pandas.u... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = 'Right -> Left:\n'
v1 += '\n'.join([f'{i}: {regex.pattern}' for (v2, v3) in enumerate(self.right_to_left_regexes)])
return v1.strip()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, float, float
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: float=None, v3: float=None) -> dict:
v4 = {}
v4['name'] = v1
v4['coords'] = (v2, v3)
v4['reflectance'] = self._reflectan... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, str], Dict[str, str]
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, str], v2: Dict[str, str]=None) -> Dict[str, str]:
v3: Dict[str, str] = {}
for (v4, v5, v6) in self.conve... |
Imports:
```python
import base64
import hashlib
import hmac
import typing
```
Type definitions:
Input Types: bytes, bytes
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bytes, v2: bytes) -> bytes:
v3 = hmac.new(key=v1, msg=None, digestmod=hashlib.sha1)
v3.update(msg=v2)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = [l.lstrip() for v3 in v1.split('\n')]
if v2[0] == '':
del v2[0]
if v2[-1] == '' and v2[-2] == '':
del v2[-1]
return ... |
Imports:
```python
import ast
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str]):
v2 = '\n'.join(v1)
v3 = ast.parse(v2)
assert v3 is not None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool=True, v3: int=1) -> str:
v4 = self.ksize
v5 = self.random_lmer
v6 = self.graph
v7 = self.get
v8 = self.add
v9 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: list=None):
if v2 is None:
v2 = []
try:
v3 = self.get_conf(v1)
return list(v3) if v3 is not None else v2
except:
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Tuple[int, str, int]
```
Input Types: str, str, Any
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: str, v3: str, v4: Any) -> v0:
v5 = self.request.app['param_manager'].update(v3, v4)
return (1 if v5 else... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
v1 = v1 % self.config.animation_modes
self.current_mode = v1
``` |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: te.Literal['tty', 'notty'] | None
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: te.Literal['tty', 'notty'] | None=None) -> None:
if v1 is None:
v1 = 'notty' if self.styles is None el... |
Imports:
```python
from dask.base import tokenize
import numpy
import dask
import dask.delayed
import dask.optimization
import xarray
import dask.array
import dask.dataframe
import itertools
from itertools import zip_longest
import typing
```
Type definitions:
```python
v0 = T.TypeVar('ArrayVar', xarray.DataArray, dask... |
Imports:
```python
import pathlib as pl
import os
import typing
```
Type definitions:
Input Types: any, str, list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: any, v2: str, v3: list=['.html', '.ipynb', '.csv', '.tif', '.vrt']) -> list:
v4 = list(v1.rglob('*'))
v5 = [f for v... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(ABC):
v1: Path
v2: InputPathValidation = InputPathValidation()
v3: t.Union[list[str], dict[str, str]] = []
v4 = FileHandles()
@abstractmethod
def __call__(self, v5: Path | None, v6: Path | None) -> t.Type[v0]:
pas... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: int=4) -> str:
v3 = '%.' + str(v2) + 'f'
v4 = v3 % v1
v5 = v4.index('.')
v6 = len(v4)
for v7 in range(v6 - 1, v5 + 1, -1):
... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributed as dist
import typing
```
Type definitions:
Input Types: nn.Module, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: nn.Module, v2: float=1.71):
if isinstance(v1, nn.... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as nf
from torch.distributions import Distribution
import typing
```
Type definitions:
Input Types: torch.Tensor, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2):
v3 = v1.sh... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, torch.Tensor]
Output Type: Dict[str, torch.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, torch.Tensor]) -> Dict[str, torch.Tensor]:
if len(v1) <= 0:
return v1
v2 = v1['logits']
v3... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: Dict, bool, bool, bool, bool
Output Type: List[str]
Dependencies:
```python
def v0(v1: str) -> str:
v2 = datetime.strptime(v1[:v1.rfind('.')], '%Y-%m-%dT%H:%M:%S')
return v2.strftime('%Y%m%dT%H%M%SZ')
```
Function... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'ConnectivityNode'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'ConnectivityNode'):
if not hasattr(self, 'ConnectivityNodes'):
self.__ConnectivityNodes = []
if v1 not in self.__ConnectivityNod... |
Imports:
```python
import shutil
import typing
```
Type definitions:
Input Types: Path
Output Type: Path
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path) -> Path:
v2 = v1.parent
shutil.make_archive(str(v2 / 'payload'), 'zip', v1)
v3 = v2 / 'payload.zip'
return v3
``` |
Imports:
```python
from glob import glob
import os
import typing
```
Type definitions:
Input Types: typing.Union[str, bytes], str, bool
Output Type: typing.List
Dependencies:
```python
def v0(v1: typing.Union[str, bytes]) -> str:
if v1:
v1 = os.path.realpath(os.path.expanduser(v1))
if type(v1) == b... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Tuple[int, List[np.ndarray]]
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple[int, List[np.ndarray]]) -> float:
v2 = self._get_discrete(v1)
v3 = v1[1 + v2]
v4 = np.sum(v3)
... |
Imports:
```python
from collections import deque
from hashlib import sha1
import typing
```
Type definitions:
Input Types: Dict, str, str, Dict, Tuple
Output Type: Dict
Dependencies:
```python
def v0(v1: str) -> Tuple[int, int]:
if v1 is None:
return (-1, -1)
v2 = [int(i) for v3 in v1.split(':')[:2]]
... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, str
Output Type: List[Tuple[str, Any]]
Dependencies:
```python
def v0(v1: str) -> Any:
return json.loads(v1)
```
Function Name: v2
Function:
```python
def v2(self, v3: str, v4: str) -> List[Tuple[str, Any]]:
v5: List[str, Any]... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, list, tuple
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray, v2: tuple=(0, 255)) -> np.ndarray:
(v3, v4) = (v1.max(), v1.min())
v5 = (v1 - v4) / (v3 - v4)
v6 = v5 * (v2[1] - ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
self.enqueued_jobs.task_done()
self.process_comm_manager.send_message(v1.result())
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: model.Property, model.Property
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: model.Property, v2: model.Property):
self._check_abstract_attributes_submodel_element_equal(v1, v2)
self.check_attribute_equa... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=None):
self.val = v1
self.next = v2
```
Input Types: v0, int, int
Output Type: v0
Dependencies:
Function Name: v3
Function:
```python
def v3(self, v4: v0, v5: int, v6: int) -> v0:
v7 = v4
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = None
v2 = None
v3 = None
@classmethod
def v4(cls, v5, v6, v7):
cls.gui_size = v5
cls.gui_pad = v6
cls.gui_font = v7
def __init__(self, v8, v9: send_mng, v10: int) -> None:
self._send... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if self._backup_info.pop(v1, None) is not None:
self._save_backup_info()
``` |
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, v3, v4) = (self._seed, self._prime, self._mask)
self._clear()
self.text = str(v1)
v5 = self.hash_list
for v6 in self.text:... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('R', bound=Resource)
```
```python
v1 = TypeVar('U')
```
Input Types: v1, Callable[[], Awaitable[v0]], Any
Output Type: None
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: v1, v4: Callable[[], Awaitable[v0]], v5: Any=No... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tf.keras.layers.Layer, Optional[tf.keras.layers.Wrapper]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.keras.layers.Layer, v2: Optional[tf.keras.layers.Wrapper]=None) -> bool:
v3 = -1 - v1.rank if v1.data_for... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> List[str]:
(v2, v3) = self.get_branch(v1)
return [self.stem] + v2[0:v2.index(v1) + 1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self._active_screen = self.screens[v1.lower()]
self._active_screen.show(self.device, self._configuration_file_path.readFolderPath())
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, int, int, int
Output Type: Iterator[Tuple[List[int], List[int]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int, v3: int, v4: int) -> Iterator[Tuple[List[int], List[int]]]:
assert v3 % v2 == v4... |
Imports:
```python
import torch
import numpy as np
from torch.utils.tensorboard import SummaryWriter
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> list:
v3 = v1.device
v4 = list()
v5 = list()
v6 = v1.re... |
Imports:
```python
import pandas as pd
import numpy as np
import typing
```
Type definitions:
Input Types: int, int, int, bool
Output Type: Tuple[pd.DataFrame, pd.Series]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int, v3: int, v4: bool) -> Tuple[pd.DataFrame, pd.Series]:
v5 = np.rand... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[int, float]
```
Input Types: Union[pygame.Vector2, Tuple[v0, v0]]
Output Type: Tuple[float, float]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Union[pygame.Vector2, Tuple[v0, v0]]) -> Tuple[float, float]:
(v3, v4) ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str='') -> List[str]:
v3 = ' \u3000 \t\n\r\x0c\x0b' + v2
return [x.strip(v3) for v4 in v1 if bool(v4.strip(v3))]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> bool:
v2 = v3 = 0
for v4 in range(len(v1) - 1):
if v1[v4] > v1[v4 + 1]:
v3 += 1
v2 = v4
if ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=128, v2: int=63, v3: float=0):
self.target.image.setVisible(True)
self.target.image.setSize(v1)
self.target.image.setBrightness(v2)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bytes) -> str:
v2 = []
while True:
v3 = v1[0]
v1 = v1[1:]
if v3 == 0:
break
v2.append(v1[:v3])
v1 = v1[v... |
Imports:
```python
import base64
import typing
```
Type definitions:
Input Types:
Output Type: Union[bytes, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Union[bytes, None]:
v1 = self.get_contents()
return v1 and base64.b64decode(v1.encode())
``` |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: pd.DataFrame, pd.Series, str
Output Type: NoReturn
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: pd.Series, v3: str='.') -> NoReturn:
for v4 in v1.columns:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
v0 = Union[int, float]
```
Input Types: List[int], List[List[v0]], List[str], str, str, str, Optional[Tuple[int, int]]
Output Type: Tuple[List[Dict], Dict]
Dependencies:
```python
def v1(v2):
v3 = v2
if isinstance(v2, list) or i... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor):
v2 = self.cse_block(v1)
v3 = self.sse_block(v1)
v1 = torc... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[List[int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Optional[List[int]]:
try:
v2 = int(v1, base=36)
except:
return None
v3 = str(v2).zfill(14)
return [int(v3[0:1]... |
Imports:
```python
import torch
import torch.nn as nn
import numpy as np
from torch.autograd import Variable
import typing
```
Type definitions:
```python
v0 = torch.Tensor
```
Input Types: v0, v0
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0, v3: v0) -> v0:
v4 = Variable(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: types.Message
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: types.Message):
v2 = v1.text.strip().lower()
v3 = self.chats_repo.load_chat(v1.chat)
v4 = v3.quiz
if not (v4 and v4.expected(v2)... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = np.int8
```
Input Types: np.ndarray, v0, int
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: np.ndarray, v3: v0, v4: int):
v5 = v2.shape[0]
if v3 + v4 < v5:
return (v3 + v4, 0)
else:
return... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3) -> tuple:
v4 = []
v5 = 0
v6 = 0
v7 = 0
if v3:
print(v2)
for (v8, v9) in zip(v2[0], v2[1]):
v10 = None
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, dict, int, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: dict, v3: int, v4: bool):
if not v2 or not v2['ErrorID']:
return
self.gateway.write_error(' subscribe to market fail... |
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]:
if not v1 or v2 == 0:
return []
v3 = collections.deque()
for v4 in ran... |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self._setup_date_form()
with self.assertRaisesRegex(Exception, "Could not find the component with label 'Dt' of type 'DateTimePi... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = ('status', 'team', 'mods', 'token', 'skipped', 'loaded', 'failed', 'passed', 'score')
def __init__(self, v2: SlotStatus=SlotStatus.Open, v3: SlotTeams=SlotTeams.Neutral, v4: Mods=Mods.NoMod, v5: 'Player'=None, v6: bool=False, v7: b... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if len(v1) >= 4 and v1[:4] == 'int:':
return int(v1[4:])
elif len(v1) >= 6 and v1[:6] == 'float:':
return float(v1[6:])
elif len(v1)... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Pattern, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Pattern, v2: str) -> bool:
try:
return bool(re.match(v1, v2))
except TypeError:
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = 0
for v2 in range(0, len(self.board)):
for v3 in range(0, len(self.board[0])):
if not self.marked[v2][v3]:
v1 ... |
Imports:
```python
from sklearn.model_selection import train_test_split
import typing
```
Type definitions:
Input Types: Any, Any, int, float, float, list, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3: int=3, v4: float=0.15, v5: float=0.3, v6: list=['labels'], v7: int=1):... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pm.path
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pm.path) -> bool:
(v2, v3, v4) = self.execute_command(commands=[['git', 'status']], show_output_on_screen=False, capture_stdout=True, cwd=v1)
retur... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Path, int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path, v2: int) -> bool:
v3 = str(v1)
if v3 and v3[-1] == '/':
v3 = v3[:-1]
v4 = self.get_candidate_pos(Path(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=0, v2: int=None):
v3 = []
for v4 in self.lines_to_list(v1, v2):
v3 += self._to_edges(v4)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, str, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: str, v3: str, v4: str) -> None:
if v3 in v1[v2]:
if v4 not in v1[v2][v3]:
v1[v2][v3].append(v4)
else:
v... |
Imports:
```python
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import ticker, rcParams
from matplotlib.patches import Circle
from matplotlib.pyplot import quiver
from matplotlib.dates import date2num
import matplotlib.tri as tri
import typing
```
Type definitions:
Input Types: Union[plt.Ax... |
Imports:
```python
from datetime import date
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
v2 = v1.split('.')
if len(v2[0]) != 2 or len(v2[1]) != 2 or len(v2[2]) != 4:
return False
try:
v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = len(self.words)
self.words[v1] = v2
self.inv_words[v2] = v1
``` |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> float:
v2 = requests.get('http://www.cbr.ru/scripts/XML_daily.asp')
v3 = v2.text
v4 = v3.find(v1.upper())
if v4 == -1:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.