text stringlengths 190 325k |
|---|
Imports:
```python
import secrets
import typing
```
Type definitions:
Input Types: int, int
Output Type: list
Dependencies:
```python
def v0(v1: int) -> None:
if v1 <= 0:
raise ValueError('check_deg_positive: deg <= 0')
```
```python
def v2(v3: int, v4: int) -> list:
v5 = [(i, secrets.randbelow(v4 + 1)... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = self._adc.get_last_result()
v2 = self._conversation_to_12bit(v1)
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self._admin_password = v1
self._initialize_write_access()
``` |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0(v1):
return v1.replace('_', '\\_').replace('#', '\\#').replace('%', '\\%').replace('$', '\\$').replace('&', '\\&')
```
Function Name: v2
Function:
```python
def v2(self) -> str:
def v... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = defaultdict(list)
for (v2, v3) in enumerate(self.communities):
for v4 in v3:
v1[v4].appe... |
Imports:
```python
from shutil import rmtree
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._prepare()
self._create_merge()
rmtree(self.td)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self._top:
return 'TOP ({}) '.format(self._top)
else:
return ''
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], bool, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: bool=False, v3: bool=True) -> str:
v4 = self.map_id_to_token(v1, skip_special_tokens=v2)
v5 = self.map_token_to_text(v4... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> str:
if isinstance(v1, datetime):
return v1.strftime('%Y-%m-%d %H:%M')
return str(v1)
``` |
Imports:
```python
from random import randrange
import torch
import torch.nn as nn
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: dict, torch.Tensor, bool, Optional[torch.Tensor], bool
Output Type: Tuple[torch.Tensor, torch.Tensor]
Dependencies:
Function Name: v0
Function:
```python
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor=None):
self.sequences_network.set_state(v1)
if self.__stateful_image_model:
self.images_ne... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
try:
v1 = self.spec.description.index(self.spec.title) == 0
except ValueError:
v1 = False
v2 = self.spec.description.replace(self.s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: openvas_gmp.Gmp, str, str, str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: openvas_gmp.Gmp, v2: str, v3: str, v4: str, v5: str) -> str:
v6 = f'Scan Host {v2}'
v7 = v1.create_task(name=v6, config_... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list
Output Type: dict
Dependencies:
```python
def v0(v1: tuple, v2: list) -> dict:
v3 = {}
for (v4, v5) in enumerate(v1):
v3[v5] = np.array([x[v4] for v6 in v2])
return v3
```
Function Name: v7
Function:
```pyth... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: int) -> np.ndarray:
v3 = np.sort(v1)
v4 = list()
v5 = len(v1) / v2
for v6 in range(0, v2):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ast_pb2.FuncDecl
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: ast_pb2.FuncDecl) -> str:
v2 = []
for v3 in v1.params:
if v3.name.native == 'self' or v3.name.native == 'cls':
continue
... |
Imports:
```python
import random
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: Dict[int, SRSBin] = field(default_factory=dict)
v2: List[str] = field(default_factory=list)
def v3(self, v4: str, v5: int) -> None:
"""Move the ngram to the next lower bin. If it is already in th... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str=None) -> None:
self.api_key = v1
def v2(self) -> list:
return self.__api_fetch_all() if self.api_key else self.__bs4_fetch_all()
def v3(self) -> list:
global AllKeysPage
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, bool
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True, v2: bool=True) -> bool:
if v2:
self.reset_completion()
if self.is_cursor_at_end():
return True
self.pos += 1
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> str:
for v2 in v1:
self.stop_lab(v2.id)
return 'All labs stop successfully'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: bool
Dependencies:
```python
def v0(v1: str) -> int:
if v1.strip()[-1] != 't':
v1 += ' t'
return max(0, int(dice.roll(f'{v1}')))
```
Function Name: v2
Function:
```python
def v2(v3: int, v4: int) -> bool:
v5: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], str, bool, bool
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2: str, v3: bool, v4: bool) -> List[str]:
if not v3 or v4:
v1 = [x for v5 in v1 if v5 != v2]
if v4:
... |
Imports:
```python
from base64 import b64encode
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=ValidImgFormats.PNG.value) -> str:
v2 = b64encode(self.stream(v1)).decode('utf-8')
return f'data:image/{v1};base64,{v2}... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.fx.Node
Output Type: TensorMetadata
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.fx.Node) -> TensorMetadata:
v2 = v1.meta.get('tensor_meta')
if not v2:
raise RuntimeError(f'Node has no tensor metadata ass... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: Any, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str='TRAIN'):
assert v2 in ['TRAIN', 'VALIDATION', 'TEST'], 'Not a valid dataset'
v3 = v1[v1['SET'] == v2]
logging.debug('Datafram... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: v0, Callable[[v0], v0], Callable[[v0], v0]
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0, v3: Callable[[v0], v0], v4: Callable[[v0], v0]) -> v0:
v2 = v3(v2)
v2 = v4(v2)
wh... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.validate_gh_command()
self.validate_github_authentication()
``` |
Imports:
```python
import asyncio
import logging
import typing
```
Type definitions:
Input Types: ConcurrentFuture
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ConcurrentFuture):
if self.discord_socket_future.cancelled():
logging.info(f'Socket was canceled')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> tuple:
v1 = self.board_list
v2 = False
if len(self.generate_legal_moves()) <= 0:
v2 = True
for v3 in v1:
if all([item == 'X' for v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Callable
Dependencies:
```python
def v0(v1, v2=None) -> Tuple[str, str]:
return (Error, v1 + ' at {}'.format(ctime()) + (' on {}'.format(v2) if v2 else ''))
```
```python
def v3(v4, v5=None) -> Tuple[str, str]:
return (In... |
Imports:
```python
import pandas as pd
from pandas.core.common import flatten
import typing
```
Type definitions:
Input Types: Collection[int]
Output Type: pd.Index
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Collection[int]) -> pd.Index:
v2 = self._dfs.prs.index.get_level_values(0).inter... |
Imports:
```python
import curses
from curses import ascii
import typing
```
Type definitions:
Input Types: curses.window, [int], int, [str], [str], int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: curses.window, v2: [int], v3: int, v4: [str], v5: [str], v6: int, v7: int):
v... |
Imports:
```python
import os
import configparser
import typing
```
Type definitions:
Input Types: Text
Output Type: (Text, Text)
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Text) -> (Text, Text):
if not os.path.exists(v1):
raise ValueError
if not os.path.isfile(v1):
ra... |
Imports:
```python
import re
import json
import typing
```
Type definitions:
Input Types: Dict[str, any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, any]):
v2 = json.dumps(v1)
v3 = re.compile('{\\"\\$ref\\": \\"#\\/components\\/(\\w+)\\/(\\w+)\\"}')
for (v4, v... |
Imports:
```python
import numpy as np
from scipy import sparse
import typing
```
Type definitions:
Input Types: Union[sparse.csr_matrix, np.ndarray], Optional[int]
Output Type: sparse.csr_matrix
Dependencies:
```python
def v0(v1: Union[sparse.csr_matrix, np.ndarray]) -> sparse.csr_matrix:
if type(v1) not in {spars... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
for v2 in self._rows:
for v3 in v2:
if not v3:
continue
v3.parse(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1):
self.val = v1
self.left = None
self.right = None
```
Input Types: v0
Output Type: int
Dependencies:
```python
def v2(v3: v0):
if v3 is None:
return 0
v4 = v2(v3.left)
v5 = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable
Output Type: Callable
Dependencies:
```python
def v0(v1: torch.Tensor) -> Union[torch.Tensor, List[torch.Tensor]]:
(v2, v3) = v1.shape[:2]
v1 = v1.reshape(v2 * v3, *v1.shape[2:])
v1 = forward_fn(v1)
if isinstance(v1, list):
... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types: bool
Output Type: bytearray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> bytearray:
v2 = self._header.flag_byte
v3 = bytearray(self._header.decompressed_size)
v4 = self._data_start
v5 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: List[str]):
self.log.debug(f'Inviting users: {v2} to channel {v1}')
v3 = self.bot.channels_invite(channel=v1, user=','.join(v2))
... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass(frozen=True)
class v0:
v1: Tuple[VertexPartitionPlan, ...]
```
Input Types: v0
Output Type: int
Dependencies:
Function Name: v2
Function:
```python
def v2(v3: v0) -> int:
v4 = 0
for v5 in v3.vertex_partitions:
v4 *= v5.numb... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
self._update_merchants_data()
return self._busy_on_marketplace_merchants
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list[str, int]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> list[str, int]:
v1 = []
with open('input.txt') as v2:
for v3 in v2:
(v4, *v5) = v3.rstrip()
v1.append((v4, int(''.joi... |
Imports:
```python
from collections.abc import Mapping
import typing
```
Type definitions:
```python
v0 = typing.Union[ma.Schema, typing.Mapping[str, ma.fields.Field], typing.Callable[[Request], ma.Schema]]
```
```python
v1 = typing.TypeVar('Request')
```
```python
v2 = typing.Union[None, typing.Callable, typing.Iterab... |
Imports:
```python
import numpy as np
import pandas as pd
import torch
from torch import nn
import typing
```
Type definitions:
Input Types: str, str, bool, bool, Optional[torch.LongTensor]
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: pd.DataFrame, *, v2: int, v3: bool, v4: bool, v5: Optional[torch.Lon... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, ty.List[ty.Tuple[str, int]]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, /, *, v3: ty.List[ty.Tuple[str, int]]=None) -> str:
v1: int = ord(v1)
v2: int = ord(v2)
v4: ty.List[str] =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable, Dict[str, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Callable, v2: Dict[str, Any]):
super().customize_call(v1, v2)
self.add_register_conversion()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> pd.DataFrame:
v2 = self._df.loc[v1].reset_index().set_index(v1.index)
v3 = v2.apply(self._to_allocation_symbols_and_value, axis=1)
v3.co... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(IntEnum):
v1 = 1
v2 = 2
```
Input Types: Union[discord.Role, discord.abc.User, discord.Object], bool, Optional[int], v0
Output Type: Any
Dependencies:
```python
def v3(v4):
v5 = Group(v4, **kwargs)
self.slash.add(v5)
return v5... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: int, v3):
with open(v1, 'r+b') as v4:
v4.seek(v2)
v4.write(v3)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Document):
@classmethod
def v1(cls) -> MutableMapping[str, object]:
return {'number_of_shards': 1, 'number_of_replicas': 0, 'codec': 'best_compression'}
@classmethod
def v2(cls: Type[_T_BaseDocument], v3: Mapping[str, ob... |
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 = self.imem_size - v1
if v2 <= 0:
return 0
for (v3, v4) in self._sections.items():
v5 = v3 + 4 * len(v4)
if ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: interactions.Client, interactions.Message
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1: interactions.Client, v2: interactions.Message):
v3 = ('!',)
return await molter.when_mentioned_or(*v3)(v1, v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self._get_action_context()
self._apply_menu_state('window.minimize', v1)
self._apply_menu_state('window.zoom', v1)
self._apply_menu_stat... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Wordnet', str
Output Type: int
Dependencies:
```python
def v0(v1: 'Wordnet', v2: Optional[str]) -> List['Synset']:
v3 = v1.synsets(pos=v2)
if v2 == ADJ:
v3.extend(v1.synsets(pos=ADJ_SAT))
elif v2 == ADJ_SAT:
v3.extend(v1.s... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, Any, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2=True, v3='') -> str:
v4 = os.path.relpath(v1, v3)
if v2:
v5 = os.path.splitext(v4)
return v5[0]
return v4
``` |
Imports:
```python
import numpy as np
import scipy
import typing
```
Type definitions:
Input Types: nx.Graph, Union[Tuple, List[Tuple]], Union[Tuple, List[Tuple]], float, bool, str
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: nx.Graph, v2: float, v3: List[Tuple], v4: List[Tuple], v5: str, **v6) -> np.nda... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[Tuple[Dict[str, Any], Dict[str, Any], str], Tuple[None, None, None]]
```
Input Types: str, bool
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: str, v3: bool=True) -> v0:
(v4, v5, v6) = self._get_channe... |
Imports:
```python
import os
from pathlib import Path
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str) -> List[str]:
v2: List[str] = []
while 1:
v3 = os.path.split(v1)
if v3[0] == v1:
v2.insert(0, v3[0])
break
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self._finalized:
return
self.finalize(self._vsk)
if self.vsk.centered and self.vsk.document.page_size is not None:
v1 = self.v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = 'test_get_not_existing'
with self.assertRaises(KeyError):
self.caching_backend.get(v1)
``` |
Imports:
```python
import cv2
import typing
```
Type definitions:
Input Types: np.ndarray, List
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: List):
for v3 in v2:
v4 = v3.box
v1 = cv2.rectangle(v1, (int(v4[0]), int(v4[1])), (int(v4[2]), int(v4[3]))... |
Imports:
```python
from functools import partial
import typing
```
Type definitions:
Input Types: int, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=0, v2: bool=True) -> str:
v3 = partial(self.parse_block, new_line=1, indent=v1)
v4 = ''
if self._docs:
... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: list, int
Output Type: Any
Dependencies:
```python
def v0(v1: str):
v2 = yf.Ticker(v1)
v3 = v2.quarterly_financials
v4 = ['Income Before Tax', '']
v5 = [0.55, 0.15, 0.05, 0.05, 0.1, 0.1]
v6 = []
v7 = v3.loc['Income ... |
Imports:
```python
from pandas._config import get_option
from pandas._libs import algos as libalgos, lib, properties
from pandas._libs.hashtable import duplicated
from pandas._libs.lib import no_default
from pandas._typing import AggFuncType, AnyArrayLike, ArrayLike, Axes, Axis, ColspaceArgType, CompressionOptions, Dty... |
Imports:
```python
import base64
from dataclasses import dataclass as _dataclass, Field as _Field, is_dataclass as _is_dataclass, field as _field, MISSING
import typing
```
Type definitions:
Input Types: 'Document', Type['T']
Output Type: 'T'
Dependencies:
```python
def v0(cls: Type['T'], v1: 'Document') -> 'T':
i... |
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 = []
v1 = list(v1)
for v3 in range(len(v1)):
v4 = v1[v3]
if v4 == '(':
v2.append(v3)
elif v4 == ... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
v2 = self._checkpoint.restore(tf.train.latest_checkpoint(v1))
v2.assert_consumed().run_restore_ops()
``` |
Imports:
```python
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int, int
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: int=3, v3: int=10) -> np.ndarray:
v4 = 2 * v2 + 1
v5 = len(v1) + 2 * v2
v6 = len(v1)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
if not self.dict_info_mods_:
return v1
v2 = self.dict_info_mods_[v1.upper()]
if v2 is not None:
return v2.version
e... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(HandParti):
def v1(self, v2):
v3 = deepcopy(self.revealed)
for v4 in self.h34:
v3[v4] += 1
v5 = self.current_shantin
v6 = []
for v7 in set(self.h34):
v8 = deepcopy(self.h34)
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: typing.Mapping[float, typing.Union[tf.Transform, None]]
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: typing.Mapping[float, typing.Union[tf.Transform, None]]) -> float:
if len(v1) <= 1:
... |
Imports:
```python
import asyncio
import socket
import typing
```
Type definitions:
Input Types: str
Output Type: tuple[str, bool]
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1: str) -> tuple[str, bool]:
v2 = asyncio.get_running_loop()
try:
await v2.getaddrinfo(v1, None)
exce... |
Imports:
```python
from matplotlib import transforms
from matplotlib.artist import Artist
import typing
```
Type definitions:
Input Types: 'Chart'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Chart') -> None:
v2 = self.x.get_transformation(v1)
v3 = self.y.get_transfo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if not self._is_fresh:
v1 = self._strategy.pick_read_db(v1)
return self.get_queryset().using(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> bool:
self.results()
return self._submission.done()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> int:
v2: int = round(v1 / 10) * 10
return round(v2 / 50 * 100)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: AsyncIterator[Tuple[Any, ...]]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> AsyncIterator[Tuple[Any, ...]]:
while True:
v1 = await self.read_row()
if v1 is None:
break
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: typing.Callable
Dependencies:
```python
def v0(v1: typing.Callable) -> typing.Callable:
self.add_websocket_route(path, v1, name=name)
return v1
```
```python
@property
def v2(self) -> str:
return self.components.path
```
F... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v2 = self._database_connection.cursor()
v2.execute('INSERT INTO metric (id, title, description) VALUES (?, ?, ?)', (v1.get('id'), v1.get('title'... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Union[Dict[str, np.ndarray], pd.DataFrame], Optional[int]
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[Dict[str, np.ndarray], pd.DataFrame], *, v2: Optional[int]=None) -> pd.DataFr... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, int, int, tuple, float, int
Output Type: (np.ndarray, np.ndarray)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int=500, v2: int=2, v3: int=3, v4: tuple=(-10, 10), v5: float=1, v6: int=42) -> (np.ndarray, np.n... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float) -> int:
if v1 < self._attributes.min_pulse or v1 > self._attributes.max_pulse:
self._logger.warning(f'Pulse {v1} out of range. Must be betw... |
Imports:
```python
import re
import sys
import typing
```
Type definitions:
Input Types: str, typing.Dict
Output Type: typing.Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: typing.Dict=None) -> typing.Dict:
if v2 is None:
v2 = {}
if type(v1) == list:
v1 = ' '.join... |
Imports:
```python
import ast
import typing
```
Type definitions:
Input Types: List[ast.keyword]
Output Type: bool
Dependencies:
```python
def v0(v1: ast.keyword, v2: str, v3: Optional[bool]) -> bool:
return v1.arg == v2 and isinstance(v1.value, ast.NameConstant) and (v1.value.value is v3)
```
Function Name: v4
Fu... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, Tuple[int, int], Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.ndarray, v3: Tuple[int, int], v4=None) -> np.ndarray:
assert len(v1.shape) =... |
Imports:
```python
from datetime import date, datetime, timedelta
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str, v2: str) -> bool:
try:
if v1 != datetime.strptime(v1, v2).strftime(v2):
raise ValueError
return True
except... |
Imports:
```python
from hashlib import sha1
from base64 import b32encode
import typing
```
Type definitions:
Input Types: int, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int, *v3: List[Union[int, str]]) -> str:
v4 = f'{v1:4x},{v2:4x},' + ','.join(str(v3))
retu... |
Imports:
```python
import pandas as pd
from pandas import DataFrame
import typing
```
Type definitions:
Input Types: DataFrame
Output Type: DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: DataFrame) -> DataFrame:
v2 = self.config['cleaning']['date_column']
v1[v2] = pd.to_datetim... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Namespace
Output Type: list
Dependencies:
```python
def v0(v1: Namespace) -> dict:
if v1.date is not None:
v2 = {'date': v1.date}
else:
v2 = {'dateFrom': v1.start, 'dateTo': v1.stop}
v2['site'] = v1.site
return v2
```
`... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: int, v3: int):
v1 = list(v1)
np.random.seed(v3)
v4 = np.random.choice(v1, len(v1), replace=False)
v5 = np.array_split... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> dict:
v2: dict = {}
if hasattr(self, 'status'):
v2['status'] = str(self.status)
elif v1:
v2['status'] = ''
if h... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int):
if not v1:
return os.path.join(self._download_parent_folder, f'motivedge_map_{v2}')
return v1
``` |
Imports:
```python
from datetime import datetime
import json
import os
import typing
```
Type definitions:
Input Types: Any, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str) -> None:
v3 = {}
for v4 in vars(v1):
v3[v4] = getattr(v1, v4)
os.makedirs(v2, e... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: date, date, str
Output Type: [dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: date=utils.get_past_date(0), v2: date=utils.get_past_date(0), v3: str=DAY_INTERVAL) -> [dict]:
if not self.logged_in:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> list:
(v1, v2) = await self.fetch_services()
v3 = []
if v1:
for v4 in dict(v2):
for v5 in v2[v4]:
if v5 not i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes):
v2 = self.received_offers.delete().where(self.received_offers.c.payment_hash == v1)
with self.get_connection() as v3:
v3.execute(v2)
`... |
Imports:
```python
import torch
from torch import nn
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
v2 = self.path / 'checkpoints'
v2.mkdir(exist_ok=True, parents=True)
if self.save_one_checkpoint:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Union[np.ndarray, Iterable, int, float]
Output Type: Union[int, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[np.ndarray, Iterable, int, float]) -> Union[int, np.ndarray]:
with np.errstate(div... |
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.conn.cursor()
v3 = 'with bomeeting as (select booking.b_id, booking.st_dt, booking.et_dt, booking.invited_id, booking.host_id, booking.r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.