text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Callable
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> Callable:
v3 = self._determine_metavar(v1, v2)
def v4(v5):
if isinstance(v3, tuple):
return v3
else:
... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: Any
v2: Optional[str] = None
def v3(self, v4: str) -> Any:
"""Delegates to the underlying model."""
if isinstance((v5 := getattr(self.model, v4)), Column):
return Column(self, v5.field, v5.... |
Imports:
```python
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support import expected_conditions as EC
import typing
```
Type definitions:
Input Types:
Output Type: None
Depende... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = [word for v3 in v1.split() if not v3.startswith('#')]
v4 = ' '.join(v2)
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: Optional[str], v0
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Optional[str], v3: v0) -> v0:
with self._lock:
v3 = self.__convert_to_obj(v3)
self._items.append... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> int:
if len(v2) == 0:
return 0
else:
try:
return v1.index(v2)
except ValueError:
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pgn.ChildNode
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pgn.ChildNode):
v2 = self.curr_line.add_move(v1)
self.set_active(v2)
v2.clicked.connect(self.on_move_selected)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bblfsh.Node, Set[int]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bblfsh.Node, v2: Set[int]) -> bool:
if v1.start_position.line in v2:
return True
if v1.end_position.line in v2:
return True... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Any, dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: dict) -> None:
v3 = ['submissions', 'accepted_submissions', 'submission_ratio', 'authors', 'accepted_authors', 'author_ratio']
v4 = v1.fi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2, v3, v4):
if self.previousBlockState() == v3:
v5 = 0
v6 = 0
else:
v5 = v2.match(v1, 0).capturedStart()
... |
Imports:
```python
import pandas as pd
from pandas.io.json import json_normalize
import typing
```
Type definitions:
Input Types: pd.Series
Output Type: pd.Series
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.Series) -> pd.Series:
v2 = {'Number of activities': v1['type'].count(), 'Total distan... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> bool:
if isinstance(v1, bool):
return v1
v2 = str(v1).lower()
if v2 in ['true', 'yes', 'y', '1']:
return True
elif v2 in ['fa... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> int:
v2 = 0
v3 = 2 ** len(v1) - 1
for v4 in v1:
v5 = (v2 + v3) // 2
if v4 in ['F', 'L']:
v3 = v5
else:
... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: asyncio.events.AbstractEventLoop
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1: asyncio.events.AbstractEventLoop) -> None:
await asyncio.sleep(0.1)
v1.close()
``` |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: object
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> object:
with open(v1, 'r') as v3:
v4 = pd.read_csv(v3, sep=v2, header=None, engine='python')
return v4
``... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str):
v1 = v1 + ' '
v4 = 0
v5 = False
for v6 in range(len(v1)):
for v7 in range(len(v2) + 1):
if v7 ==... |
Imports:
```python
from http import HTTPStatus
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._create_users(2)
v1 = self.make_request('GET', self.url + '?deactivated=true', {}, access_token=self.admin_user_tok)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any]):
assert 'slide_interval_in_days' in v1
assert v1['slide_interval_in_days'] > 0
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: argparse.Namespace, intnormt.ImageLike, intnormt.ImageLike | None
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: argparse.Namespace, /, v2: intnormt.ImageLike, v3: intnormt.ImageLike | None=None) -> None:
i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
v2 = self.root
for v3 in v1:
if v3 not in v2.next:
return False
else:
v2 = v2.next[v3]
return... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, Any, Any, list, int, int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int, v3, v4, v5: list, v6: int, v7: int) -> bool:
if v7 == v2 or v5[v7 - 1] == 'COME_FROM_LOOP':
v8 = v7 - ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, List[List[int]]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: List[List[int]]) -> int:
v3 = [set() for v4 in range(v1)]
for v5 in v2:
v3[v5[0]].add(v5[1])
v3[v5[1]].add(v5[... |
Imports:
```python
from collections import Counter
import numpy as np
from ..logging import print_info
import typing
```
Type definitions:
Input Types: list, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2, v3=True):
v4 = Counter()
v5 = 0
v6 = 0
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str) -> str:
v4 = {'parents': [v2]}
v5 = self.service.files().copy(supportsAllDrives=True, fileId=v1, body=v4).execute()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[int]
Output Type: Optional[bool]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[int]) -> Optional[bool]:
if v1 is None:
return None
return bool(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool) -> None:
self.set_design()
self.app.manager.stopped_session()
``` |
Imports:
```python
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor) -> torch.Tensor:
if v1.ndimension() == 0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
for v2 in self._symbol_evaluators:
if not v2.evaluate(v1):
return False
return True
``` |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str
Output Type: requests.Response
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> requests.Response:
v2 = {'email': self.email, 'otp': v1}
v3 = requests.post(self.host + '/login', data=v2, headers... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dc.Message
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: dc.Message):
if v1.author == self.user:
return
if self.user in v1.mentions:
await v1.channel.send('*woof woof*')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self: Axes, v1=-2, v2=5):
self.axhline()
self.axvline()
self.set_aspect('equal')
v3 = [i for v4 in range(v1, v2) if v4 != 0]
self.xaxis.set_ticks... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[ndarray, int, None]
Output Type: Union[ndarray, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[ndarray, int, None]=None) -> Union[ndarray, float]:
v2 = self.pool.block_assignments if v1 is None else self.p... |
Imports:
```python
import typing
```
Type definitions:
Input Types: logging.LogRecord
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: logging.LogRecord):
for v2 in self._remove:
if hasattr(v1, v2):
v1.__delattr__(v2)
return True
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: str
v2: str
v3: Optional[int]
v4: Optional[Union[Timeout, float, int]]
v5: Optional[Union[Retry, int]]
v6: Optional[bool]
v7: Optional[Tuple[str, int]]
v8: Optional[str]
v9: Optional[str]
v... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, str
Output Type: bool
Dependencies:
```python
def v0(v1: str, v2: str='sha256') -> str:
import hashlib
if v2 not in hashlib.algorithms_available:
raise ValueError("Algorithm '{}' not available in hashlib".format(v2))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Callable[[int], None], Callable[[int, int], None]
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2=' ') -> List[int]:
return list(map(int, map(str.strip, v1.split(v2))))
```
Function Name: v3
Function:
```python
def v3(v4, v5: Call... |
Imports:
```python
import torch
import torch.nn.functional as F
from collections import OrderedDict
from torch import nn, Tensor
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Dict[str, Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> Dict[str, Tensor]:
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: str
Dependencies:
```python
def v0() -> str:
global loaded_data_dir
if loaded_data_dir is None:
v1 = os.path.join(get_root_dir(), 'data')
v2 = get_config_arg(CORE_SECTION, DATA_STORAGE_KEY)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1) -> str:
v2 = []
for (v3, v4) in self._meta.items():
v5 = getattr(self, v3)
if not v4.has_value(v5):
continue
v2.appen... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, int, int
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Tensor, v2: int, v3: int) -> tf.Tensor:
v4 = tf.convert_to_tensor([[-v2 + 1, -v3 + 1, v2 - 1, v3 - 1]], tf.float3... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Optional[List[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Optional[List[str]]:
if self.delimiter is not None:
v1 = self.text.rstrip(self.delimiter)
return v1.split(self.delimiter)
re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, list
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any, v2: list) -> int:
for (v3, v4) in enumerate(v2):
if v1 in v4:
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, **v2) -> None:
with open(v1, 'w') as v3:
v3.write(self.dumps(compact=False, **v2))
return
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.archiving_enabled:
self.archiving_enabled = False
if self.logfile:
self.logfile.close()
self.logfile = No... |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import UnivariateSpline
import typing
```
Type definitions:
Input Types: int, int, bool, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=10, v2: int=1, v3: bool=False, v4: bool=T... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str, str, List[str]
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: bool, v3: Optional[str]=None, v4=True):
v5 = None if v2 else subprocess.DEVNULL
v6 = subprocess.run(v1, cwd=v3, shell=True, stdout=v5, stderr=v5... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Union[None, Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Union[None, Dict]:
v1 = None
if self.transmission_attributes:
v1 = {k: v for (v2, v3) in self.transmission_attributes.items() if 'auth... |
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=None):
v3 = self.parsedConfig.getboolean(v1, v2)
self.parsedConfig[v1] = str(v3)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
super().add()
self.s3.head_bucket(Bucket=self._bucket)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[int]) -> List[int]:
v2 = [v1[0]]
for v3 in v1[1:]:
for (v4, v5) in enumerate(v2):
if v5 > v3:
v2.insert(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool):
if type(v1) != bool:
raise Exception('vote() requires a bool')
if self.current_value == v1:
return
if self.vote_changed == T... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
v2 = self._sm.find_path(v1)
v3 = self._sm.get_events(v2)
self._ctrl.write_tms(v3)
self._sm.handle_events(v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: ZipFile, Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: ZipFile, v2: Path):
with open(v2, 'r') as v3:
for v4 in v3.readlines():
try:
v1.extractall(pwd=v4.strip().encode())
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: bool
Dependencies:
```python
def v0(v1: Union[bytes, str]) -> bytes:
v2 = base_decode(v1, base=58)
v3 = v2[0:-4]
v4 = v2[-4:]
v5 = sha256d(v3)[0:4]
if v5 != v4:
raise InvalidChecksum(f'calculated {bh2u... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2, v3):
self._name = v1
self._cpu = v2
self.ram_gb = v3
self.prices = []
self.avg_price = 0.0
self.max_price = 0.0
self.calc_cost = sys.maxsize
self.met... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bytes, v2: int) -> str:
if len(v1.split(b':')) != 5:
raise ValueError('not a message tag: %s, length %i' % (v1, len(v1.split(b':'))))
elif v2 <... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.validations()
self.log_errors()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
with self.__api.post('shutdown') as v1:
if v1.status_code != 202:
raise Exception('failed to shutdown server')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if v1 in self.fields:
return self.fields[v1]
if v1 in self.methods:
return self.methods[v1]
return None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: 'ApplyResult[CompanyCompensationResponse]'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, **v2) -> 'ApplyResult[CompanyCompensationResponse]':
self.apply_kwargs_defaults(kwargs=v2, return_http_data_only=True... |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types: argparse.ArgumentParser
Output Type: argparse.ArgumentParser
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: argparse.ArgumentParser) -> argparse.ArgumentParser:
v2 = argparse.ArgumentParser(description='Embed a set... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, str, str, bool, str, int, str, bytes, str, bytes, bytes
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str=None, v3: str=None, v4: str=None, v5: str=None, v6: bool=False, v7: str=None, v8... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, str
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: torch.Tensor, v3: str='mean') -> torch.Tensor:
if v1.shape != v2.shape:
raise ValueErr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, Tuple[str, str]]
Output Type: Tuple[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[str, Tuple[str, str]]) -> Tuple[str, str]:
if isinstance(v1, str):
return (v1, v1)
return (v1[0], v1[1])
``` |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
while True:
v1 = self._is_idle()
if not self.__shutting_down and self.__shutdown_when_idle and v1:
v2 = ... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor) -> torch.Tensor:
v2 = 1.0 + self._eps
v3 = self._xi / self._ln2 * (v2 + v1) ** self._alpha
v4 = v3 / (1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
v2 = self.codeobj_cache
v3 = v2.get(v1)
if v3 is None:
v3 = self.wants_codeobj(v1)
v2[v1] = v3
return v3
``` |
Imports:
```python
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: Tensor, Tensor
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor, v2: Tensor) -> Dict:
v3 = self.aggregation_layer(query_feat=v1.unsqueeze(-1).unsqueeze(-1), suppor... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
v2 = self.__markov.ngram_prob(v1)
if v2 <= 0 or np.isnan(v2):
v2 = self.__min_prob
v3 = np.log2(v2)
v4 =... |
Imports:
```python
import math
import collections
import torch
import torch.optim
import typing
```
Type definitions:
Input Types: Optional[Callable[[], float]]
Output Type: Optional[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[Callable[[], float]]=None) -> Optional[float]:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, List[str], int, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool, v2: List[str], v3: int, v4: str, v5: str):
self.my_turn = v1
self.cards = v2
self.opponent_cards_no = v3
self.a... |
Imports:
```python
import numpy as np
from scipy.special import erf
import typing
```
Type definitions:
Input Types: Any, int, Optional[int]
Output Type: Any
Dependencies:
```python
def v0(v1, v2: int=1000, v3: Optional[int]=None):
v4 = len(v1.qubit_lists[0])
if not v3:
v3 = len(v1.heavy_output_counts)... |
Imports:
```python
from scipy import ndimage
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Any, int, int
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray, v2: int) -> np.ndarray:
v3 = np.uint8(v1 >= v2)
v4 = np.zeros(v1.shape)
(v5, v6) = ndi... |
Imports:
```python
import copy
import typing
```
Type definitions:
```python
v0 = str
```
```python
v1 = str
```
```python
v2 = Dict[str, Number]
```
Input Types: List[v2], Dict[v0, int], Dict[v0, v1]
Output Type: (List[v2], Dict[v0, int], Dict[v0, int])
Dependencies:
Function Name: v3
Function:
```python
def v3(v4: L... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: typing.Type[v0], Any
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: typing.Type[v0], v3) -> v0:
v3 = v3 or {}
v4 = v2(data=v3, store=self)
return self.add(v4)
``` |
Imports:
```python
import itertools
import typing
```
Type definitions:
```python
v0 = TypeVar('_T')
```
Input Types: 'Rectangle'
Output Type: Generator['Rectangle', None, None]
Dependencies:
```python
def v1(v2: Iterable[v0]) -> Iterable[tuple[v0, v0]]:
(v3, v4) = itertools.tee(v2)
next(v4, None)
return zi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
with open(v1, 'w') as v2:
v2.write('{} {}\n'.format(self.rows, self.columns))
v2.write(str(self))
``` |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pypsa.Network
Output Type: Any
Dependencies:
```python
def v0(v1: pypsa.Network, v2: List[str]=None, v3: List[str]=None):
v4 = v1.generators
if v2 is not None:
v4 = v4[v4.bus.isin(v2)]
if v3 is not None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: object
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: object) -> dict:
v2 = v1.find_all('div', 'bibContent')[0]
v3 = v1.find_all('table', 'bibItems')[0]
v4 = v1.find_all('div', 'bibContent')[1]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> int:
v2 = 0
v3 = 0
v4 = len(v1) - 1
while v3 != v4:
v2 = max(v2, min(v1[v3], v1[v4]) * (v4 - v3))
if v1[v3] > v1[v4]:
... |
Imports:
```python
import matplotlib.pyplot as plt
import numpy as np
import typing
```
Type definitions:
Input Types: dict, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2=None, v3=None):
v4 = np.arange(len(v1.keys()))
plt.bar(v4, v1.values(), align='center',... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
if v1['ZWAKE'] == '0':
v1['ZWAKE'] = self.control['ZWAKE']
if v1['TRWAKE'] == '0':
v1['TRWAKE'] = self.control['TRWAK... |
Imports:
```python
from collections import Counter, defaultdict
import numpy as np
import typing
```
Type definitions:
Input Types: Any, int
Output Type: Any
Dependencies:
```python
def v0(v1, v2: int=None):
v3 = ExpressionWrapper(F('end_date') - F('start_date'), output_field=fields.DurationField())
v4 = v1.an... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = '\n def f():\n while True:\n return 1\n x = 3\n '
with self.in_module(v1)... |
Imports:
```python
import logging
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:
v2 = self.default_dimensions
v2 = v1.get('dimensions', v2)
v3 = v1.get('gridlines', True)
se... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: bytes) -> dict:
return json.loads(v1)
```
```python
def v2(v3):
assert isinstance(subject, str)
def v4(v5):
v6 = v3(topic=v5.subject, message=v0(v5.data))
... |
Imports:
```python
import re
from os import getenv
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1):
v2 = self.get_options(v1.group('options'))
v3 = {flag.lower() for v4 in re.split(self._flag_delimiters, v2.get('flags', '')) if v4} | {f'target:{target.lo... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: pd.Timedelta
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> pd.Timedelta:
if v2 <= 0:
return pd.Timedelta.max
return pd.Timedelta(int((self.limit - v1) / v2 * 60),... |
Imports:
```python
import hashlib
import typing
```
Type definitions:
Input Types: asyncpg.Connection, str
Output Type: bytes
Dependencies:
```python
def v0(v1: Union[str, bytes]) -> bytes:
if isinstance(v1, str):
v1 = v1.encode('utf-8')
return hashlib.sha256(v1).digest()
```
Function Name: v2
Function... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> list:
v2 = []
for (v3, v4) in enumerate(v1):
v5 = True
for (v6, v7) in enumerate(v1[v3 + 1:]):
if len(v4) == len(v7) an... |
Imports:
```python
import re
import subprocess
import sys
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str, v2: bool=True):
v3 = f'==== YACPM ERROR: {v1}' if v2 else v1
print(v3, file=sys.stderr)
exit(1)
```
```python
def v4(v5: str) -> str:
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
if self.head != -1:
return self.queue[self.head]
return -1
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, typing.List[str], dict, float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: typing.List[str], v3: dict, v4: float, v5: float):
if v3['total projects']['value'] == 0:
print('... |
Imports:
```python
from inspect import ismethod, isfunction, signature, Parameter
import typing
```
Type definitions:
```python
v0 = Callable[..., Any]
```
Input Types: v0
Output Type: Tuple[Callable]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0) -> Tuple[Callable]:
v3 = 0
if isfunction(v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path
Output Type: n.Node
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path) -> n.Node:
with self._lock:
return self._project.get_page_ast(v1)
``` |
Imports:
```python
import hmac
import typing
```
Type definitions:
Input Types: bytes, bytes, str
Output Type: bytes
Dependencies:
```python
def v0(v1: str) -> Callable:
if v1 not in algorithms:
raise ValueError('Invalid algorithm: {:s}'.format(v1))
return algorithms[v1]
```
Function Name: v2
Function:... |
Imports:
```python
import torch
from torch import nn, Tensor
import typing
```
Type definitions:
Input Types: Tensor, float
Output Type: Any
Dependencies:
```python
def v0(v1: Tensor, v2: float):
v1 = (v1 + v1.t()) / 2
(v3, v4) = torch.eig(v1, True)
v4[:, v3[:, 0] < 0] *= -1
v3 = (v3[:, 0].pow(2) + v3[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[ndarray]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str) -> List[ndarray]:
v2 = await self._downloader.download(v1)
v3 = await self._face_detector.detect_faces(v2)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
(v2, v3) = self._get_fs_pair(v1)
if not v3:
return v2.exists(v1)
if v3.repo.dvcignore.is_ignored(v2, v1):
return False
... |
Imports:
```python
import scipy
from scipy.ndimage.filters import maximum_filter
from scipy.ndimage.morphology import binary_erosion, generate_binary_structure
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.