text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, str]):
super().setProperties(v1)
self.__dict__['properties'].update(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Protocol):
def __call__(self, v1: Union[Dict[str, Any], None], v2: bool=False, v3: str='material', v4: bool=False, v5: Optional[bool]=None, v6: bool=False, v7: bool=False, v8: bool=True, v9: bool=True, v10: bool=True, v11: bool=False, v12: O... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
v1 = re.sub('[^a-z]', '', v1.lower())
return len(v1) == len(set(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, int
Output Type: Any
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: v0, v4: int):
if not v3.lef... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> List[int]:
v2 = [x + self.num_rows for v3 in v1]
v2 = [v3 - self.block_size if v3 > self.block_size else v3 for v3 in v2]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray) -> np.ndarray:
if self._reuse_arrays:
return v1
else:
return v1.copy()
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray) -> np.ndarray:
(v2, v3) = v1.shape
v4 = np.fft.fft2(v1)
v5 = v2 * v3 * 2
v6 = 1 / v5 * np.abs(v4) ** 2
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[bool]
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[bool]=True) -> dict:
self._token_available()
v3 = None
v4 = {'Content-Type': 'application/json', 'DB-Method': 'DE... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Mapping[str, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Mapping[str, Any]) -> Any:
v2 = self.source._get(v1)
if v2 is None:
return None
return v2[self.index]
``` |
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, int, int
Output Type: v0
Dependencies:
```python
def v2(v3):
if not v3:
return None
if self.l <= v3.val <=... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> None:
self.pos.x += v1
self.pos.y += v2
``` |
Imports:
```python
import polars as pl
from polars import col, lit, map_binary, when
import typing
```
Type definitions:
Input Types: pl.DataFrame
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pl.DataFrame) -> None:
assert v1.lazy().median().collect()['A'][0] == 3
assert v1.... |
Imports:
```python
import shutil
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._client.get(self._file_path, self._temporary_file_path())
shutil.unpack_archive(filename=self._temporary_file_path(), extract_dir=... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclasses.dataclass
class v0(object):
v1: str = None
v2: str = 'amicus'
v3: str = None
v4: str = None
v5: str = None
v6: Sequence[str] = None
v7: Mapping[Any, Any] = None
```
Input Types: v0
Output Type: Mapping[Any, Any]
De... |
Imports:
```python
import curses
import curses.ascii
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> None:
self.stdscr = v1
self.stdscr.addstr(self.selection_screen_str)
self.stdscr.refresh()
curses.curs_set(0)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool):
self.array_size_spinbox.setVisible(v1)
self.array_size_label.setVisible(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray=None, v2: np.ndarray=None):
if v1 is not None:
if v1.shape != (self.input_shape[1], self.n_neurons):
raise... |
Imports:
```python
import random
import numpy as np
import typing
```
Type definitions:
Input Types: np.array, np.array
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.array, v2: np.array):
v3 = random.randint(-100, 900)
return (np.clip(v1 + v3, 0, 65535).astype(np.uint16), ... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if os.path.isdir(v1):
return os.path.join(v1, '')
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float=1) -> bool:
assert v1 >= 0
v2 = self.get_angle()
return v2 <= -90 + v1 or v2 >= 90 - v1
``` |
Imports:
```python
import collections
import tensorflow.compat.v2 as tf
import typing
```
Type definitions:
Input Types: Sequence[Mapping[str, Any]], str
Output Type: Mapping[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Sequence[Mapping[str, Any]], v2: str) -> Mapping[str, Any]:
v3 = c... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Dict[str, Any]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: str, v3: Dict[str, Any]) -> bool:
v4 = self.get_detection_params(v2, {'occurrence': 1})
self.detection_states[v1][v... |
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.convert_ids_to_tokens(v1, skip_special_tokens=v2)
v5 = []
for v6 in v4... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Callable, float, float
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
```python
def v0(v1: Callable, v2: np.ndarray) -> np.ndarray:
v3 = 1e-10
v4 = (v1(v2 + v3) - v1(v2)) / v3
v4 /= np.linalg.norm(v... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(_Pack):
def __init__(self, v1: Path, v2: Optional[Project]=None) -> None:
super().__init__(v1, project=v2)
self._entities: Optional[RpEntities] = None
self._animation_controllers: Optional[RpAnimationControllers] = No... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
print(v1)
v2 = self.match_symbols(v1)
if not v2[0] and v2[1].startswith('Unclosed'):
print(v2[1])
print('============... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Operation):
v1: str = '/platform/public/namespaces/{namespace}/users/{userId}/subscriptions'
v2: str = 'GET'
v3: List[str] = ['application/json']
v4: List[str] = ['application/json']
v5: List[List[str]] = [['BEARER_AUTH'], ['B... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, Optional[float]
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: Optional[float], /) -> float:
if v2 is None:
return True
if v1 > v2:
return True
return False
``` |
Imports:
```python
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: List
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: int) -> bool:
(v3, v4) = v1.split('-')
if v4 == 'inf':
if v2 >= int(v3):
return True
elif v2 >= int(v3) and v2 <= int(v4):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> str:
v2 = ''
for (v3, v4) in enumerate(v1):
v4 = int(v4)
if v3 > 0 and v4 == v1[v3 - 1] or v4 == 0:
cont... |
Imports:
```python
from typing import cast, Union, Any
import ast
import typing
```
Type definitions:
Input Types: ast.Statement, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ast.Statement, v2: str) -> None:
self.assertEqual(v1.token_literal(), 'let')
self.assertI... |
Imports:
```python
from numpy import zeros as np_zeros, ndarray as np_ndarray
from scipy.optimize import linprog
import typing
```
Type definitions:
Input Types: 'np_ndarray', int, Logger
Output Type: 'np_ndarray'
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: 'np_ndarray', v2: int, v3: Logger=getLogg... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, int, int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: int, v3: int, v4: int) -> int:
v5 = 0
for v6 in range(max(v2 - 1, 0), min(v2 + 2, v4)):
for v7 in range(max(v3 - 1, 0), min(... |
Imports:
```python
import sys
import numpy as np
import typing
```
Type definitions:
Input Types: float
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float) -> np.ndarray:
if v1 <= 0:
return None
v2 = sys.getsizeof(np.ones(0))
v3 = np.ceil(v1 * 2 ** 20).ast... |
Imports:
```python
import warnings
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
@warn_if_empty
def v0() -> List[int]:
return []
```
```python
@warn_if_empty
def v1() -> Iterable[str]:
yield 'a'
yield 'aba'
```
Function Name: v2
Function:
```python
def v2() -> ... |
Imports:
```python
from rdkit import Chem
from rdkit.Chem.Descriptors import ExactMolWt
from rdkit import rdBase
from rdkit.Chem.rdchem import Mol
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[Tuple[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Tuple[Tuple[str]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: BinaryIO, int
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: BinaryIO, v2: int) -> bytes:
v3 = v1.read(v2)
if v3 is None:
v3 = b''
return v3
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
```python
def v0(v1: str) -> None:
try:
os.remove(v1)
except:
pass
```
Function Name: v2
Function:
```python
def v2(self, v3: str) -> None:
for v4 in ['json', 'tif', 'jpeg', 'pn... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Tuple[Activation, Quantizer]
```
```python
v1 = tf.keras.layers.Layer
```
Input Types: v1
Output Type: Sequence[v0]
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: v1) -> Sequence[v0]:
self._assert_activation_layer(v3)
r... |
Imports:
```python
from heapq import heappush, heappop
import typing
```
Type definitions:
Input Types: list, Any
Output Type: (int, int)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2) -> (int, int):
if len(v1) == 0:
return (None, None)
(v3, v4) = v1[0]
if v3 < v2:
... |
Imports:
```python
from scipy.spatial import cKDTree
from scipy.spatial.distance import pdist
import typing
```
Type definitions:
Input Types: np.array, float
Output Type: list
Dependencies:
```python
def v0(v1):
v1 = [g for v2 in v1 if len(v2) >= 2]
v3 = []
for v2 in v1:
if len(v2) > 2:
... |
Imports:
```python
from pandas._config.config import get_option, set_option
from pandas._libs import lib
from pandas._libs.missing import NA
from pandas._libs.tslib import format_array_from_datetime
from pandas._libs.tslibs import NaT, Timedelta, Timestamp, iNaT
from pandas._libs.tslibs.nattype import NaTType
from pand... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, ffmpeg.ProbeType | None
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: ffmpeg.ProbeType | None=None) -> str:
with self.__lock:
self.get_t_valdict(v3)[2][v1] = v2
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
self.addToHeap(v1)
self.reBalanceTheHeap(v1)
self.numCount += 1
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: bool, bool
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bool=False, v2: bool=False) -> list:
if v1:
return [f for v3 in os.listdir('alarm') if not v3.startswith('.')] if os.path.isdir('alarm')... |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.Iterable
Output Type: t.Iterable
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: t.Iterable) -> t.Iterable:
for v2 in v1:
for v3 in self.set:
if self.dist_func(v2, v3) <= self.d:
break
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: openpyxl.worksheet, int, int, Any
Output Type: Tuple[int, bool]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: openpyxl.worksheet, v2: int, v3: int, v4) -> Tuple[int, bool]:
v5 = v2
v6 = False
for v7 in self.jira.sor... |
Imports:
```python
import numpy, os, math
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int):
self.np = v1
self.ndimval = v2
self.f = numpy.zeros((v1, v2), dtype=numpy.float64)
self.x = numpy.zer... |
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, v4, v5, v6) = [int(coord) for v7 in v1]
self.drawer.line([(v4, v5), (v4, v3), (v6, v3), (v6, v5), (v4, v5)], width=2, fill=v2)
``` |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.Series, pd.Series
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: pd.Series):
v2 = v1.diff()
v2 = v2[1:].reset_index(drop=True)
return v2
```
```python
def v3(v4, v5):
return np.ex... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Set[Tuple[str, str]], str, str
Output Type: bool
Dependencies:
```python
def v0(v1: Set[Tuple[str, str]], v2: str, v3: str) -> bool:
for v4 in v1:
if v4[0] == v2 and v4[1] == v3 or (v4[1] == v2 and v4[0] == v3):
return True
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: float
Dependencies:
```python
def v0(v1, v2):
return np.trace(v1.T.conjugate() @ v2)
```
Function Name: v3
Function:
```python
def v3(v4: np.ndarray, v5: np.ndarray) -> float:
v6 = v0(v4, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: int) -> Tuple[Tuple[int, ...], int]:
v3 = -1
v4 = None
for v5 in get_n_digit_tuples(v1, v2):
v6 = calculate_product(v5)
if v6 > v3:
v3 = v6
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path, str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: str) -> dict:
v3 = {}
for v4 in ['lh', 'rh']:
for v5 in ['thickness', 'volume', 'sulc', 'white']:
v3[f'{v4}_{v5}'] = v1 /... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[List[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[List[str]]:
v1 = len(self.gold_history) if len(self.gold_history) < 50 else 50
return self.decode(self.gold_history[:v1])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Module, str, Tensor
Output Type: None
Dependencies:
```python
def v0(v1: Module, v2: str) -> None:
if not hasattr(v1, '_params_ori'):
v1._params_ori = dict()
if v2 in v1._params_ori:
return
v3 = v1._parameters[v2]
v1._p... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> None:
v2 = ''
v2 += 'Battle Type: Iterated Battle\n\r'
v2 += 'โโโโโโโโโโโฆโโโโโโโโโโฆ' + ''.join(['โโโโโโโฆ' for v3 in range(v1['rounds'])])... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list, tuple, float, float, float
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: tuple, v3: float, v4: float, v5: float) -> np.ndarray:
(v6, v7) = v2
v8 = np.array(v2) / 2 + ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2):
if v1 in self._callbacks:
for v3 in self._callbacks[v1]:
await v3(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
v2 = [[0, 0] for v3 in range(41)]
v2[0][0] = 1
v2[1][1] = 1
for v4 in range(2, v1 + 1):
v2[v4][0] = v2[v4 - 2][0] + v2[v4 - 1][0]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
with open('log.txt', mode='a') as v2:
v2.write(v1)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: typing.Sequence[str], typing.Sequence[str]
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: typing.Sequence[str], v2: typing.Sequence[str]) -> float:
v3 = len(v1) + 1
v4 = len(v2) + 1
v5... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Dict[str, Any]], Optional[Dict[str, Dict[str, Any]]]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Dict[str, Any]], v2: Optional[Dict[str, Dict[str, Any]]]=None) -> None:
v2 = v2 or sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str, Any, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: str='public', v3=None, v4: bool=True):
(v5, v6) = self.api.illust_bookmark_add
v7 = self.set_params(illust_id=v1, restric... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: List[List[int]]
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[List[int]]) -> np.ndarray:
v2 = np.array(v1).reshape(-1)
return np.eye(self.model.part_d)[v2].reshape((-1, le... |
Imports:
```python
import cv2
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, v3: int) -> np.ndarray:
v4 = max(v1.shape[:2])
if v4 > v3:
v5 = 1 / (v4 / v2)
v1 = cv2... |
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 v1:
self.__setattr__(v2, v1[v2])
``` |
Imports:
```python
from mimetypes import guess_type
import typing
```
Type definitions:
Input Types: str, SpooledTemporaryFile
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: SpooledTemporaryFile) -> str:
v3 = guess_type(v1)[0]
if not v3:
raise RuntimeErr... |
Imports:
```python
import matplotlib as mp
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2):
print('Plotting ' + v1)
plt.scatter(v2['p'], v2['trips_sd'])
plt.scatter(v2['p'], v... |
Imports:
```python
from collections import OrderedDict
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0() -> list:
v1 = OrderedDict()
v1['SubjectID'] = 'subject_id'
v1['EnrollmentDate'] = 'date'
v1['EnrollmentTime'] = 'time'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2):
v3 = v1 % 10
v4 = int(v3 / v2)
v5 = v2 * v4
v6 = v1 - v1 % 10 + v5
return v6
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(*v1) -> list:
v2 = [{'level': 'INFO', 'message': '{"message":{"method":"Network.requestWillBeSent","params":{"request":{"url":"' + 'https://www.google-analytics.com/col... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: pd.DataFrame, int
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame, v2: int) -> pd.DataFrame:
if v1.shape[0] < v2:
raise ValueError('Desired sample length is gr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Union[str, None]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Union[str, None]=None) -> str:
v1 = v1.title()
if v2:
return '{} ({})'.format(v1, '$\\mathit{{{}}}$'.format(v2))
else:
... |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: dict, List[str], bool
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: List[str], v3: bool) -> dict:
v4 = copy.deepcopy(v1)
v4['info']['title'] = v1['info']['title'] + ' ' + v2[1]
v4['... |
Imports:
```python
import itertools
import typing
```
Type definitions:
Input Types: List, List, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List, v2: List, v3: int):
v4 = 0
for v5 in range(0, v3 - 1):
v6 = itertools.combinations(v1, 2)
for (v7, v8) in v... |
Imports:
```python
from pandas._config import get_option
from pandas._typing import Axis, FilePathOrBuffer, FrameOrSeries, FrameOrSeriesUnion, IndexLabel, Scalar
from pandas.compat._optional import import_optional_dependency
from pandas.util._decorators import doc
import pandas as pd
from pandas import IndexSlice, Rang... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, tuple
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str, v4: tuple):
v1 = v1.strip()
if not len(v1) in [7, 3]:
raise Exception(f'Invalid binary space partitioning leng... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Optional[Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False, **v2) -> Optional[Dict]:
if self.exists or not v1:
self.delete_inline_policies()
return super().delete(not_exists_ok=v1,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame):
v2 = v1[['TABELA', 'COD_LINHA', 'COD_PONTO', 'HORARIO', 'VEICULO']].copy()
v2.rename(columns={'TABELA': 'table_id', 'COD_LINHA':... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
if hasattr(self.callback, 'get_at_timestamp'):
return self.callback.get_at_timestamp(self.datasources, v1)
v2 = self.ge... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'TestHarness', 'TestRun'
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: str='\n') -> None:
try:
print(v1, end=v2)
except UnicodeEncodeError:
v1 = v1.encode('ascii', errors='backslashreplace').decode('ascii')
... |
Imports:
```python
from os.path import splitext
import typing
```
Type definitions:
Input Types: str
Output Type: t.List[t.Tuple[str, str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> t.List[t.Tuple[str, str, str]]:
v2 = []
v3 = splitext(v1)
v4 = v3[1] if len(v3) > 1 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: (object, float)
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> (object, float):
print('Lernvorgรคnge:', self.lernvorgange)
self.lernvorgange = 0
self.trainierte_epochen += 1
if self.trainierte_epochen... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
self.datas.drop(v1, axis=0, inplace=True)
return True
``` |
Imports:
```python
import os
import json
import numpy as np
import cv2
from matplotlib import patches
from matplotlib.patches import Polygon
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: pd.DataFrame, str
Output Type: None
Dependencies:
```python
def v0(v1, v2):
(v3, v4, v5, v6) ... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = {'current_time': datetime.now().strftime('%y%m%d-%H:%M:%S'), 'temperature': self.get_cpu_temperature(), 'memory_cpu': ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, int, list
Output Type: Any
Dependencies:
```python
def v0(v1: '1D-List', v2: int, v3: int, v4: 'value') -> int:
while v2 <= v3:
v5 = int(v2 + (v3 - v2) / 2)
v6 = v1[v5]
if v6 == v4:
return v5
elif ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: specs.AppDef, str
Output Type: Optional[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: specs.AppDef, v2: str) -> Optional[int]:
for v3 in v1.roles:
if v2 == v3.name:
return v3.num_replicas
return None
... |
Imports:
```python
import numpy as np
import h5py as h5
import typing
```
Type definitions:
Input Types: str
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> np.ndarray:
with h5.File(v1, mode='r') as v2:
v3 = np.array(v2['data'])
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, dict
Output Type: str
Dependencies:
```python
def v0(v1: Union[list, str, Any], v2: str='\n') -> str:
if isinstance(v1, str):
return v1
if hasattr(v1, '__iter__'):
return v2.join(v1)
return str(v1)
```
Function Name: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, futures.ThreadPoolExecutor
Output Type: Any
Dependencies:
```python
def v0(v1: futures.ThreadPoolExecutor) -> grpc.Server:
v2 = grpc.server(v1)
v3 = impl.Basic()
service_pb2_grpc.add_VolumeServicer_to_server(v3, v2)
return v2
```
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, typing.Callable
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: typing.Callable) -> None:
for v3 in self._heapq:
if v3.message == v1 and v3.callable == v2:
v3.expire()
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: ClanMember, v2: int, v3: str='', v4=0) -> None:
self.member: ClanMember = v1
self.damage = v2
self.status = 0
self.message = v3
self.mark = v4
```
Input Types: List[v0]
Output T... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, Any
Output Type: Any
Dependencies:
```python
def v0(v1):
v1.op = code
v1.size = size
v1.write = size - 1 if write else -1
return v1
```
Function Name: v2
Function:
```python
def v2(v3: int, v4: int, v5=False):
def v6(v7)... |
Imports:
```python
import os
import subprocess
import tempfile
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: List[Rpm]
```
```python
class v2(NamedTuple):
v3: str
v4: str
v5: str
def v6(self):
return textwrap.dedent(' Summary: The "{name}" package.\n ... |
Imports:
```python
from importlib import import_module
import typing
```
Type definitions:
Input Types: str, str
Output Type: type
Dependencies:
```python
def v0(v1: str) -> str:
return ''.join([substring.capitalize() for v2 in v1.rsplit('-')])
```
```python
def v3(v4: str) -> (str, str):
v4 = v4.casefold()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, Any
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2) -> list:
v3 = 0
for v4 in v1:
if v2(v4):
v3 += 1
return v3
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float) -> str:
v1 = float(v1)
v2 = np.round(np.log10(abs(v1)))
if np.isinf(v2):
v2 = 1
if v2 < 3:
if abs(v1) <= 1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=1):
self.frozen -= v1
self.hparams.model.unfrozen += v1
assert self.hparams.model.unfrozen <= self.hparams.model.maximum_unfrozen
self.freez... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.