text stringlengths 190 325k |
|---|
Imports:
```python
import itertools as it
import numpy as np
import scipy.stats as ss
from pandas import DataFrame
import typing
```
Type definitions:
Input Types: Union[list, np.ndarray, DataFrame], str, str, bool, bool
Output Type: DataFrame
Dependencies:
```python
def v0(v1: Union[list, np.ndarray, DataFrame], v2: ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.lfa.lf_empirical_probs(self.Y, 3)
v2 = np.array([[[1 / 2, 1, 0], [0, 0, 0], [1 / 2, 0, 1 / 2], [0, 0, 1 / 2]], [[1, 1, 1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, threading.Event
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes, v2: threading.Event):
for v3 in self.new_received_offer_listener.yield_items(v2):
if v3.squeak_hash == v1:
yie... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types:
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> pd.DataFrame:
v1 = []
if self.vh:
v1.append(self.vh.to_score_dataframe())
if self.vl:
v1.append(self.vl.to_... |
Imports:
```python
import pathlib
import platform
import subprocess
import sys
import typing
```
Type definitions:
Input Types: pathlib.Path
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pathlib.Path) -> None:
v2 = [pathlib.Path(sys.executable), v1] if v1.suffix == '.py' e... |
Imports:
```python
import shutil
from pathlib import Path
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = Path(self.output_dir).resolve()
v2 = v1 / self.path_factory(self.dmodule.refname, self.dmodule.is_package... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(BaseModel):
v1: int = 0
```
Input Types: str, v0
Output Type: str
Dependencies:
Function Name: v2
Function:
```python
def v2(v3: str, v4: v0) -> str:
v3 = v3.capitalize()
return ''.join([chr((ord(char) - 65 + v4.offset) % 26 + 65) fo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[int, Union[str, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Dict[int, Union[str, int]]:
v2: Dict[int, Union[str, int]] = dict()
v3: int = 1
for v4 in range(len(v1) - 1, -1, -1):
... |
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 == 'json':
self.save_json()
elif v1 == 'brat':
self.save_brat()
``` |
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=False):
if v2:
v3 = 'a'
else:
v3 = 'w+'
with open(v1, v3) as v4:
v4.write('\nrecord(' + self.record + ',... |
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:
v2 = '\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b'
return True if re.fullmatch(v2, v1) else False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.file_name = 'file_name_token'
self.content = 'content_token'
self.upload_url = 'upload_url_token'
self.path = 'path_token'
self.bk_b... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence[Hashable]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Sequence[Hashable]) -> None:
v2 = ' OR '.join([self.d_uid_field + ':%s' % str(_uid) for v3 in v1])
self.solr.delete('%s:%s AND (%s)' % (self.s... |
Imports:
```python
import string
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> str:
v2 = string.ascii_uppercase
v3: List[str] = []
if v1 == 0:
v3 = [v2[0]]
while v1 > 0:
v3.append(v2[v1 % 26]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> int:
v2 = []
for v3 in range(1, len(v1)):
if v1[v3 - 1] > 0:
v1[v3] += v1[v3 - 1]
v2.append(v1[v3])
return (max(v1), v2... |
Imports:
```python
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: list, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2=4):
v3 = [text.split() for v4 in v1]
v5 = [' '.join([word for v6 in word_list if len(v6) > v2]) for v7 in tqdm(v3)]
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> list:
v3 = []
v4 = self._getFromDict(v2, v1['many_details']['itterate_on'])
for v5 in v4:
v6 = self._getFromDict(v2, v1['many_d... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: str
'The name of the group'
v2: int
'The numerical group id'
v3: list[str]
"All the group member's user names"
```
Input Types: str
Output Type: v0
Dependencies:
Function Name: v4
Function:
```python
def v... |
Imports:
```python
import sys
from functools import reduce
import typing
```
Type definitions:
```python
class v0:
v1: str
v2: int
v3: int
v4: int
v5: int
def __init__(self, v6: str, v7: int, v8: int, v9: int, v10: int) -> None:
self.claim_id = v6
self.x_offset = v7
self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float, float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: float, v3: float=1e-10) -> float:
v4 = v3
if v1 != 0 and v2 != 0:
v4 = 2.0 / (1.0 / v1 + 1 / v2)
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame) -> pd.DataFrame:
v2 = ['tconst', 'primaryTitle', 'startYear', 'runtimeMinutes', 'genres']
v1 = v1[v1.runtimeMinutes.str.isnume... |
Imports:
```python
import math
import numpy as np
import typing
```
Type definitions:
Input Types: List[float], float
Output Type: Union[np.ndarray, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[float], v2: float) -> Union[np.ndarray, float]:
v3 = max(self.last_step) - min(self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable):
v2 = 0
for (v3, v4) in v1:
v2 += v3.nll + v4.nll
return v2
``` |
Imports:
```python
import configparser, os, argparse, getpass, ImageSearch, urllib, TheMaker, sys
from PIL import Image
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if isinstance(v1, str):
v2 = urllib.request.url... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True):
super()._make_model(v1)
self.ops['target_var_pos'] = self.placeholders['target_var_positions']
v2 = tf.gather(p... |
Imports:
```python
import typing
```
Type definitions:
Input Types: asyncpg.connection.Connection
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1: asyncpg.connection.Connection) -> dict:
v2 = {}
v3 = await v1.fetch('SELECT timezone, count(id) FROM slack_users GROUP BY tim... |
Imports:
```python
import math
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str=None, v2: float=1, v3: float=0, v4: float=0, v5: float=0, v6: float=0, v7: float=0, v8: float=0, v9: int=1, v10: int=1):
"""
Create a new sprite.
Args:
filename (st... |
Imports:
```python
import numpy as np
from numpy import ndarray
import typing
```
Type definitions:
Input Types: ndarray
Output Type: ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: ndarray) -> ndarray:
if v1.ndim != 2 or v1.shape[0] != v1.shape[1]:
raise RuntimeError('Invalid confu... |
Imports:
```python
import math
import numpy as np
import typing
```
Type definitions:
Input Types: List[str], int, Optional[float], int, type, bool
Output Type: Iterator[np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2: int, v3: Optional[float]=None, v4: int=0, v5: type=np.int3... |
Imports:
```python
import asyncio
import threading
import typing
```
Type definitions:
Input Types: tp.Callable[[], tp.Any], tp.Optional[asyncio.AbstractEventLoop]
Output Type: asyncio.Handle
Dependencies:
```python
def v0() -> asyncio.AbstractEventLoop:
try:
v1 = asyncio.get_event_loop()
except Runtim... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Tuple[np.float, np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray) -> Tuple[np.float, np.ndarray, np.ndarray]:
v2 = self.model.integrate()[1]
v3 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], List[int]
Output Type: int
Dependencies:
```python
@lru_cache(None)
def v0(v1: int, v2: int) -> int:
nonlocal maxlen
if v1 == m:
return 0
if v2 == n:
return 0
v0(v1 + 1, v2)
v0(v1, v2 + 1)
if nums1[v1... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Exception):
pass
```
```python
class v1(v0):
pass
```
```python
v2 = Union[type, Tuple[type, ...]]
```
Input Types: Any, str, v2, v2
Output Type: Dict
Dependencies:
```python
def v3(v4: Any, v5: v2=None, v6: v2=None, v7: Callable=isinstan... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str], Optional[int], bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[str]=None, v2: Optional[int]=None, v3: bool=False) -> str:
v4 = f"{v1}_L{v2}{('_idf' if v3 else '_no-idf')}"
return v4... |
Imports:
```python
import hashlib
import typing
```
Type definitions:
```python
class v0(Protocol):
def v1(self, v2: bytes) -> None:
...
def v3(self) -> str:
...
```
Input Types: Union[str, Path], Optional[v0]
Output Type: str
Dependencies:
Function Name: v4
Function:
```python
def v4(v5: Uni... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> list:
v2 = []
for (v3, v4) in enumerate(self.s_space.values_l):
v5 = np.abs(v1[v3] - np.array(v4)).argmin()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = len(v1)
v3 = [0] * (2 * v2 - 1)
v4 = [0] * (2 * v2 - 1)
for v5 in range(v2):
v3[v5 + v1[v5]] += 1
v4[v2 - 1 - v5 + v1[v5]... |
Imports:
```python
import matplotlib.pyplot as plt
from matplotlib import rcParams
from matplotlib.gridspec import GridSpec
import typing
```
Type definitions:
Input Types: Any, int, float, float, pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: int, v3: float, v4: floa... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = self.model.config
v2 = {'scrape_interval': '1m', 'scrape_timeout': '10s'}
if v1.get('evaluation-interval') and self._is_valid_timespec(v1['e... |
Imports:
```python
import os
import shutil
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> str:
v3 = 'mlflow_model'
if not os.path.exists(v2):
os.makedirs(v2)
else:
shutil.rmtree(v2)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple, bool, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple, v2: bool, v3: str=''):
v4 = []
v5 = ['X_', 'Y_', 'Z_']
if v2:
v5 = ['x_', 'y_']
for v6 in v5:
v4 += [f'{v3}{... |
Imports:
```python
from scipy.spatial.transform import Rotation
import typing
```
Type definitions:
Input Types: str, float, bool, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: float, v3: bool=True, v4: bool=False):
if v1 not in ('x', 'y', 'z', 'pitch', 'yaw',... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str):
assert v1 not in self.forwarding_table
self.forwarding_table[v1] = v2
``` |
Imports:
```python
import string
import typing
```
Type definitions:
Input Types: Any
Output Type: set
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> set:
v2 = []
v3 = string.punctuation.replace('&', '')
with open(v1, 'r') as v4:
for v5 in v4.readlines():
v5 = v5.str... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.Timestamp, pd.Timestamp, pd.Timedelta
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.Timestamp, v2: pd.Timestamp, v3: pd.Timedelta=pd.Timedelta(days=20)):
assert v1 <= v2
if v1 == v2:... |
Imports:
```python
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: Any, Any, str, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
return (v1[pos:pos + v2] for v3 in range(0, len(v1), v2))
```
Function Name: v4
Function:
```python
def v4(v5, v6, v7: str, v8=None, v9=True):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list=None):
if v1 is None:
v1 = self.test_point_names_list
for v2 in v1:
self.__process_test_point(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int
Output Type: List[List[int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: int) -> List[List[int]]:
if v1 < 1 or v2 < v3 or v3 > 9:
return []
if v1 == 1 and v3 <= v2 <= 9:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0() -> dict:
v1 = {'displayName': 'Terminate Workspace', 'description': 'Terminates a Running Workspace', 'resourceTypes': ['Workspace'], 'params': [], 'permissions': ['w... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray):
(v2, v3, v4, v5) = self._dyn(None, self.state, v1)
v6 = np.zeros(shape=(4, 4))
v6[0, :] = np.array([v2, v3, v... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
```python
v0 = Union[str, Path]
```
Input Types: str
Output Type: int
Dependencies:
```python
def v1(v2: v0) -> Sequence[str]:
if isinstance(v2, Path):
v2 = v2.stem
return v2.split(FORM_NAME_DELIMITER)
```
Function Name: v3
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2) -> None:
if self._has_feature(v1):
self.features[v1] = v2
``` |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: int, str
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: str) -> pd.DataFrame:
v3 = ['scores', 'ids', 'iat', 'ratings']
if v2 in v3:
v4 = pd.read_csv(f'data/birdnes... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = v1.read(1)
v2 = v2 if v2.strip() else '_'
v3 = v1.read(1)
v3 = v3 if v3.strip() else '_'
v4 = v1.read(1)
v4 = v4 if v4.strip() else... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
```python
def v0(v1: np.ndarray, v2: list or tuple) -> np.ndarray:
v3 = np.pad(v1, 1, mode='edge')
(v4, v5, v6) = v2
v7 = v3[1 + v4:-1 + v4 if v4 != 1 e... |
Imports:
```python
from pathlib import Path
import pickle
import typing
```
Type definitions:
Input Types: MutableMapping[str, Any]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: MutableMapping[str, Any]) -> int:
v2 = 'words_list_file_name' if v1['data']['output_field_name'].start... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.run()
if v1.exit_code == 0:
v2 = '2'
else:
v2 = '1'
return v2
``` |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types: jsonschema.exceptions.ValidationError
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: jsonschema.exceptions.ValidationError):
print(v1)
print('Error: config file format is not valid!')
sys.exit(1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, int, bool
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str=None, v3: int=1, v4: bool=False) -> Dict:
v5 = {'key': v1, 'report_json': v3, 'get_text': v4}
if v2:
v5['agent'] =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str]) -> List[str]:
v2 = []
v3 = False
for v4 in v1:
if v4[:3] == '```':
v3 = not v3
elif not v3:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Optional[List]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> Optional[List]:
(v2, v3) = self.get_entry(tid=v1)
v4: int = self.get_entry_index(tid=v1)
v5 = self.__elements[v3]
if not 0 <=... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types:
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> np.ndarray:
v1 = torch.distributions.Dirichlet(torch.from_numpy(self.trans_count)).sample().numpy()
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, int, Optional[str]
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, *, v2: int=100, v3: int=0, v4: Optional[str]=None) -> Dict[str, Any]:
v5 = {'limit': v2, 'offset': v3}
if... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
for (v2, v3, v4) in os.walk(v1):
for v5 in v4:
if v5.endswith('.lzma'):
yield os.path.abspath(os.path.join(v2,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> dict:
global __template_values
if __template_values is None:
v2 = {}
for (v3, v4) in v1.items():
if v3 == 'intent':
... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass(unsafe_hash=True)
class v0:
v1: float
v2: float
```
Input Types: Iterable[v0]
Output Type: Any
Dependencies:
Function Name: v3
Function:
```python
def v3(self, v4: Iterable[v0]):
for v5 in v4:
self.erase(v5)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2=None) -> list:
v3 = [-1, 1]
v4 = [-1, 1]
if v2 is not None:
if v2[0] == v1[0]:
v5 = v2[1] - v1[1]
v4.remove... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(*v1: list) -> str:
v2 = []
for v3 in v1:
if v3 is None:
continue
v2.append(str(v3).lower().strip())
return '/'.join(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
if not self.running:
return 0
return self._last_done_ts
``` |
Imports:
```python
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray):
super().transform(v1)
v2 = []
for v3 in v1:
if len(v3.shape) == 3 and v3.shape[-1] == 3:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Node'
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Node') -> list:
v2 = []
def v3(v4):
if v4:
for v5 in v4.children:
v3(v5)
v2.append(v4.val)
v3(... |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
if v1 not in self.__id_to_node_mapping:
raise ValueError('Cannot remove node with id {0}: not in graph!'.format(v1))
v2 = self... |
Imports:
```python
import sys
from io import StringIO
import cvxpy as cp
import cvxpy.interface as intf
import cvxpy.settings as s
from cvxpy.constraints import PSD, ExpCone, NonPos, Zero
from cvxpy.error import DCPError, ParameterError, SolverError
from cvxpy.expressions.constants import Constant, Parameter
from cvxpy... |
Imports:
```python
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tensor, *v2, **v3) -> Tensor:
v4 = v3.get('mask')
if v4 is None:
v5 = v1.new_ones(v1.shape, dtype=torch.bo... |
Imports:
```python
from io import StringIO
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = StringIO()
v2 = False
for v3 in self._variables_set.variables:
v4 = round(v3.coefficient, 3)
if v3.coe... |
Imports:
```python
from importlib import import_module
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0() -> dict:
try:
v1 = import_module('src.infrastructure.clients.provider')
except ImportError:
raise ImportError(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v2 = v1.get('types')
if v2 is None:
v2 = dict()
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: _t.List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> _t.List[str]:
(v1, self._list) = (self._list, [])
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: relay.expr.Expr
Output Type: bool
Dependencies:
```python
def v0(v1: Any, v2: List[relay.expr.Expr], v3: str) -> bool:
return all([c(v1, v2, v3) for v4 in checkers])
```
```python
def v5(v6: relay.expr.Expr) -> List[relay.expr.Expr]:
if isinst... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, int, int, int, str
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: pd.DataFrame, v2: int=50, v3: str='close') -> pd.DataFrame:
v4 = v1.copy()
v4['signal'] = v4[v3].ewm(span=v2, adjust=False).mean()
return v4
```
... |
Imports:
```python
from math import sqrt, floor
import typing
```
Type definitions:
Input Types: ImageDraw, Tuple[float, float], Tuple[float, float], int, Tuple[int, int, int], int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: ImageDraw, v2: Tuple[float, float], v3: Tuple[float, flo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: OrderedDict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: OrderedDict):
v2 = {}
for (v3, (v4, v5)) in enumerate(v1.items()):
v6 = v5[-1]
if 'labels' in v6:
v7 = v6['labels']
... |
Imports:
```python
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: Tensor, float, float
Output Type: Tensor
Dependencies:
```python
def v0(v1: Tensor, v2: Tuple[float, float]=(-1.0, 1.0)) -> Tensor:
v3 = v1
if v2 is not None:
v3 = torch.clamp(v3, v2[0], v2[1], out... |
Imports:
```python
import typing
```
Type definitions:
Input Types: xr.DataArray
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: xr.DataArray) -> bool:
v2 = v1.dims[len(v1.dims) - 1].lower() in ['c', 'ch', 'channel']
return v2
``` |
Imports:
```python
import subprocess
import tensorflow as tf
import typing
```
Type definitions:
Input Types: Text, Text
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Text, v2: Text):
v3 = ['argo', 'submit', '--name', v2, '--watch', '--namespace', 'kubeflow', '--serviceacco... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path):
v2 = 'v'
if not v1.exists():
v3 = 0
else:
v4 = []
for v5 in v1.iterdir():
if v5.is_dir() and v5.name.startswit... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = {'start': set(), 'end': set()}
for v3 in v1:
(v4, v5) = v3.split('-')
if v4 not in v2:
v2[v4] = set()
if v5 n... |
Imports:
```python
import sqlite3
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2=False) -> None:
if v1[6:11] != 'TFTS2':
raise ValueError('expect an FTS L1B product')
if v1[29:32] == '1BS':
v3 ... |
Imports:
```python
import string
import typing
```
Type definitions:
Input Types: list, string, bool, int
Output Type: list
Dependencies:
```python
def v0(v1: str) -> str:
return v1.lower().translate(str.maketrans(string.punctuation, len(string.punctuation) * ' '))
```
```python
def v2(v3: str=None, v4: bool=True)... |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: Optional[dict], Optional[Set[str]], Optional[Set[str]], bool, bool, bool, bool
Output Type: Optional[dict]
Dependencies:
```python
def v0(v1: Any) -> bool:
try:
v2: float = float(v1)
except (TypeError, ValueError):
... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types:
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> tf.Tensor:
v1 = 'classification_loss'
if self._use_distance:
return tf.losses.mean_squared_error(self.y_dist, self.y_p... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, int, bool, float
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Functio... |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.Sequence[str], bool
Output Type: t.Tuple[t.Optional[str], t.List[str], t.List[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: t.Sequence[str], v2: bool) -> t.Tuple[t.Optional[str], t.List[str], t.List[str]]:
if not v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
if v1 <= 0 or v1 >= self.N:
return False
self.a = v1
v2 = 1
for v3 in range(self.shor_n):
self.shor_bits_a[v3] = ... |
Imports:
```python
import collections
import typing
```
Type definitions:
```python
@dataclass(frozen=True)
class v0(pod.PlainOldData):
v1: typing.ChainMap[str, str]
v2: Optional[str]
v3: Optional[ast_node.Astn]
v4: str
v5: str
v6: List[str]
v7: int
v8 = ['bindings', 'class_fqn', 'class_... |
Imports:
```python
from string import Template
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = Template('\n {\n "taskRoleArn": "${task_role_arn}",\n "containerDefinitions": [\n... |
Imports:
```python
import random
import typing
```
Type definitions:
```python
v0 = List[Tuple[str, str]]
```
```python
v1 = TypeVar('T')
```
Input Types: int, v0
Output Type: List[v1]
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: int, v4: v0) -> List[v1]:
if v4 is None or callable(v4):
... |
Imports:
```python
import requests, json
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int=4):
with open(v1, 'w') as v3:
v3.write(json.dumps(self.recipe, indent=v2))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
try:
int(v1)
return 'Int'
except ValueError:
try:
float(v1)
return 'Float'
except ValueError:
... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
self.active = False
try:
(await self._get_player()).stop()
except Exception as e:
logging.warning('Failed to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.