text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: int
v2: int
```
Input Types: Union[v0, None]
Output Type: bytes
Dependencies:
Function Name: v3
Function:
```python
def v3(self, v4: Union[v0, None]=None) -> bytes:
if v4 is None:
return self.__get_first_buffe... |
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) -> Any:
self._verifyHaHeader(v1)
self._events.append((v2, v1.json()))
return ''
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: typing.List[typing.Dict[str, str]]
Output Type: typing.List[tests.Digest]
Dependencies:
```python
def v0(v1: typing.Dict[str, str]) -> tests.Digest:
digest_type_test(v1)
return {alg: string_strip0x(val) for (v2, v3) in v1.items()}
```
```pytho... |
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 = {}
if hasattr(self, 'message') and self.message:
v2['message'] = str(self.message)
elif v1:
v2['message'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: st.Offset, str, str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: st.Offset, v2: str, v3: str, v4: str) -> str:
if v1.base is None:
v5 = v2
else:
v5 = f'{v3}{v1.base}{v4}tail'
return ... |
Imports:
```python
from sympy.core import Add, Float, Mod, Mul, Number, S, Symbol, Expr
from sympy.core.alphabets import greeks
from sympy.core.containers import Tuple
from sympy.core.function import Function, AppliedUndef, Derivative
from sympy.core.operations import AssocOp
from sympy.core.power import Pow
from sympy... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
if v1:
v2 = v1.split(':')[0]
return v2
else:
return None
```
Function Name: v3
Function:
```python
def v3(v4: str, v5: str, v6: str) -> str:... |
Imports:
```python
import tensorflow as tf
from tensorflow.keras.callbacks import TensorBoard
from tensorflow.keras.initializers import Initializer
from tensorflow.keras.layers import ELU
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import Dense
... |
Imports:
```python
import os
import tensorflow as tf
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import typing
```
Type definitions:
Input Types: tf.keras.Model, tf.Tensor, Optional[int], Optional[str]
Output Type: Any
Dependencies:
```python
def v0(v1: plt.Axes, v... |
Imports:
```python
import os
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib import gridspec
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, Any, Any, bool, bool, Optional[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(*, v1, v2, v3, v4, v5... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Optional[float]
Dependencies:
```python
def v0(v1: str, v2: Any) -> float:
v3 = '%s must be an integer or float' % (v1,)
try:
v2 = float(v2)
except ValueError:
raise ValueError(v3)
except TypeError... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if not hasattr(self, 'platform_id') or self.platform_id is None:
return False
if not hasattr(self, 'request_id') or self.request_id is None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float) -> float:
v2: int = self.computeIndexForLargestTimeBefore(v1)
return self.getValue(v2)
``` |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str, typing.List[str], bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: typing.List[str], v3: bool=False):
v4 = 'Expert Usage' if v3 else 'Usage'
v5: int = self.find_section... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: int or str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> int or str:
if v2 == 'seconds':
try:
v3 = int(v1[:-1])
v4 = v1[-1].lower()
if v4 == 's':
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
os.system(f'aws s3 cp {v1[0]} .')
v2 = os.path.basename(v1[0])
return v2
``` |
Imports:
```python
import json
import binascii
from collections import OrderedDict
import typing
```
Type definitions:
Input Types:
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bytes:
v1 = []
for v2 in self.blobs:
v1.append(OrderedDict([('length', v2.length),... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=None):
self.val = v1
self.next = v2
```
Input Types: v0, int
Output Type: v0
Dependencies:
Function Name: v3
Function:
```python
def v3(self, v4: v0, v5: int) -> v0:
if not v4.next:
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict[str, Any]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict[str, Any]) -> bool:
v2 = {'filters', 'formatters', 'handlers'}
if any((key in v1 for v3 in v2)):
return False
if any((v3 in v1.ge... |
Imports:
```python
import torch
import torch.distributions as dist
from torch import Tensor, tensor
from torch.autograd import grad
import typing
```
Type definitions:
Input Types: Tensor, Tensor, bool, Optional[bool]
Output Type: Tuple[bool, Tensor]
Dependencies:
```python
def v0(v1: Tensor) -> bool:
return not (... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[int, List[int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[int, List[int]]:
v1 = []
for v2 in self.sched:
for v3 in self.sched[v2]:
v1.append({'event': v3['event'].to_dict()... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._scores = []
for v1 in self._population:
v2 = self._evaluate(v1)
self._scores.append(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
if self.f1 is None:
self.f1 = (self.T_i_d - self.T_adj) / (self.T_i_d - self.T_e_d)
v1 = (self.T_sm - self.T_i_d) / (self.T_i_d - self.T_e_... |
Imports:
```python
from torch.autograd.profiler import record_function
import torch
import torch.distributed as dist
import torch.fx
from torch import nn
from torch.distributed._shard.sharded_tensor import Shard, ShardedTensor, ShardedTensorMetadata, TensorProperties
from torch.distributed._shard.sharding_spec import S... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = 'pkill flambe-site'
v2 = self._run_cmd(v1)
if self.existing_tmux_session('flambe-site'):
self.kill_tmux_session('flambe-site')
r... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float, np.ndarray, np.ndarray
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
```python
def v0(v1: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
if v1 is None:
return (None, None)
v2 = v1.shape[0]
v3 = n... |
Imports:
```python
import logging
import pickle
import sys
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1, v2) -> None:
if isinstance(v2, list):
v3: int = 0
for v4 in v2:
v5 = pickle.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[int], v2=1) -> int:
v3 = 0
for v4 in range(v2, len(v1)):
if v1[v4] > v1[v4 - v2]:
v3 += 1
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> Any:
if not self._sync_hook:
self._sync_hook = await sync_to_async(self.sync_hook_class)(**self._hook_kwargs)
return self._sync_hook
``` |
Imports:
```python
import math
from math import factorial
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> int:
v2 = []
v3 = 0
for v3 in range(v1):
if math.gcd(v3, v1) == 1:
v2.append(v3)
re... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: Callable
Output Type: Any
Dependencies:
```python
def v0(v1):
f(v1)
return v1
```
Function Name: v2
Function:
```python
def v2(v3: Callable):
if asyncio.iscoroutinefunction(v3):
async def v4(v5):
await v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2=False):
v3 = self._host.check_output(v1)
if v2:
print(v3)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> dict:
assert v1 in {'DEBUG', 'INFO', 'WARNING', 'ERROR'}, f'wrong log level {v1}'
return {'version': 1, 'disable_existing_loggers': True, 'formatters... |
Imports:
```python
import logging
from typing import Any, List, Optional, Tuple, Union, Dict, cast
import typing
```
Type definitions:
Input Types: sqlite3.Connection, str, str
Output Type: List[List[List[Any]]]
Dependencies:
```python
def v0(v1: sqlite3.Connection, v2: str, *v3: Any) -> sqlite3.Cursor:
try:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: IO, Path, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: IO, v2: Path, v3: bool):
if not v1.readable():
return
with open(str(v2), 'ab') as v4:
while v1.readable():
v5 = v... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: str, Union[teradatasql.TeradataConnection, hive.Connection], str, int
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: Union[teradatasql.TeradataConnection, hive.Connection], v2: str, v3: int=10000) -> pd.DataFrame:
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('_T')
```
Input Types: Optional[Tuple[v0, ...]]
Output Type: Sequence[Tuple[str, v0]]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Optional[Tuple[v0, ...]]) -> Sequence[Tuple[str, v0]]:
self.__add_last()
retur... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable
Output Type: Callable
Dependencies:
```python
def v0(v1: Node, **v2: Any) -> Node:
if 'name' in v2:
v1.friendly_name = v2['name']
return v1
```
```python
@wraps(node_factory_function)
def v3(v4: NodeInput, v5: NodeInput, *v6: ... |
Imports:
```python
from itertools import islice, starmap, zip_longest
from operator import eq
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 v2 == '':
return 0
for v3 in range(0, l... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = ''
for v3 in v1:
if v3 == '[':
v2 += '[['
elif v3 == '{':
v2 += '{{'
elif v3 == '"':
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
v2 = self.__normalize(v1.strip().lower())
v3 = 0
if v2 == 'hoje' or v2 == 'este dia':
v3 = 0
elif v2 == 'amanha' or v2 == '... |
Imports:
```python
import json
import os
import typing
```
Type definitions:
Input Types: list, list, list, str, float, float, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: list, v3: list, v4: str, v5: float, v6: float, v7: str):
v8 = {'model_description': v4, 'lear... |
Imports:
```python
import json
import subprocess
import typing
import typing
```
Type definitions:
Input Types:
Output Type: typing.List[str]
Dependencies:
```python
def v0() -> str:
return typing.cast(str, sub('pip', 'list', '--format', 'json').stdout)
```
```python
def v1(*v2: str) -> subprocess.CompletedProces... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[int, int], int
Output Type: Tuple[int, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple[int, int], v2: int=64) -> Tuple[int, int]:
(v3, v4) = v1
return (round((v3 - v4) * v2), round((v3 + v4) * v2 * 0.5))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path, List[int]
Output Type: Any
Dependencies:
```python
def v0(v1: str) -> str:
return update_header(1, v1)
```
```python
def v2(v3: int, v4: str) -> str:
v5 = v4.strip().split()
v6 = int(v5[3]) + v3
return ' '.join(v5[:3] + [str(v6)]... |
Imports:
```python
import re
import typing
```
Type definitions:
```python
v0 = Dict[str, int]
```
Input Types: sqlite3.Cursor, str
Output Type: List[Tuple[str, int, v0]]
Dependencies:
```python
def v1(v2: List[str]):
return '[%s(' % '(%['.join(sorted(v2))
```
```python
def v3(v4: str) -> str:
v4 = v4.strip()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple, tuple, Any
Output Type: dict
Dependencies:
```python
def v0(v1: int, v2: tuple) -> float:
if not isinstance(v1, int) and (not isinstance(v1, float)) or isinstance(v1, bool) or (not isinstance(v2, tuple)) or (None in v2):
return -1
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3) -> float:
v4 = (v1 + v2 + v3) / 3
(v5, v6, v7) = (v1 - v4, v2 - v4, v3 - v4)
(v8, v9, v10) = (v1 - v2, v2 - v3, v3 - v1)
return v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Callable]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, Callable]:
v1: Dict[str, Callable] = {'val': self.executor.forward}
if self.use_ema:
v1['val_ema'] = self.ema_executor.for... |
Imports:
```python
from typing import Any, List, Optional, Sequence, Tuple, Union
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
v2 = list(self.loc)
if not isinstance(v2[0], Sequence):
v2 = [v2]
f... |
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: Any=None) -> Any:
v1 = self._prefix + v1
return await self._checkpointer.get(v1, default=v2)
``` |
Imports:
```python
from PIL import Image, ImageDraw, ImageFont
import typing
```
Type definitions:
Input Types: str, str, int
Output Type: Tuple[str, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str='', v3: int=14) -> Tuple[str, int]:
if not isinstance(v1, str) or len(v1) != 1:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: typing.Sequence[mitmproxy.flow.Flow]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: typing.Sequence[mitmproxy.flow.Flow]) -> None:
for v2 in v1:
if v2.id in self._store:
if self.filter(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
for v2 in self.active_connections:
v2.publish(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
v1 = ['percent_10x_goi', 'percent_20x_goi', 'percent_20x_kit', 'percent_100x_goi', 'percent_100x_kit', 'percent_250x_goi', 'percent_250x_kit', ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, List[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: List[str]) -> str:
v3: List[str] = []
for v4 in v2:
v3.append(await self.get_attachment_from_link(group_id=v1, link=v4... |
Imports:
```python
import collections
import typing
```
Type definitions:
```python
v0 = event_tracker.GameState
```
Input Types: v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> None:
v3 = collections.Counter(self._env.perceived_stones())
v4 = collections.Counte... |
Imports:
```python
import numpy as np
from keras.preprocessing.sequence import pad_sequences
import typing
```
Type definitions:
Input Types: List[Tuple[str, str]], Dict[str, int], Dict[str, int], int, int, str
Output Type: Tuple[np.array, np.array]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
if self._base is None:
raise ValueError(f'{self.scope} has not {self._category}')
return self._base + v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, **v2):
v2.update(locals())
v3 = {'tags': ['Networks'], 'operation': 'getNetworkTraffic'}
v4 = f'/networks/{v1}/traffic'
v5 = ['t0', '... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
if v1 == 0:
return 1
v2 = [10, 9 * 9, 9 * 9 * 8, 9 * 9 * 8 * 7, 9 * 9 * 8 * 7 * 6, 9 * 9 * 8 * 7 * 6 * 5, 9 * 9 * 8 * 7 * 6 * 5 * 4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if v1[0] != '"' or v1[-1:] != '"':
raise Exception(v1)
return v1[1:-1]
``` |
Imports:
```python
import os
import h5py
import typing
```
Type definitions:
Input Types: list, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2: str) -> None:
for v3 in v1:
v4 = h5py.File(os.path.join(self.input_folder, v3), 'r')
v5 = [key for v6... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str], Optional[bool], Optional[bool]
Output Type: List[dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str]=None, v2: Optional[bool]=None, v3: Optional[bool]=None) -> List[dict]:
if v1 and v1 not in ['... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.products.shares
if (v1 <= 0).any() or (v1 >= 1).any():
raise ValueError('Product shares must be between zero and one, exclusive.')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, str
Output Type: str
Dependencies:
```python
def v0(v1: int, v2: str) -> str:
v3 = ''
if v1 > 17:
v3 = '+3'
elif v1 > 15:
v3 = '+2'
elif v1 > 12:
v3 = '+1'
elif v1 > 8:
v3 = ''
elif v1 ... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float):
v3 = self.rho_0 - v2
v4 = math.sqrt(v1 ** 2 + v3 ** 2)
if abs(v4) > self.EPSILON:
if self.n < 0.0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Search'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Search') -> None:
v2: Gui = self
v3: str = v2.__class__.__name__
assert False, f'{v3}.search_panel_update() has not been implmented yet.'
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = int | float | bool | str | None | list['Json'] | dict[str, 'Json']
```
Input Types: v0, str
Output Type: list[str]
Dependencies:
```python
def v1(v2: v0) -> TypeGuard[list[v0]]:
return isinstance(v2, list)
```
```python
def v3(v4: v0, v5: str) ->... |
Imports:
```python
import email
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import typing
```
Type definitions:
Input Types: dict
Output Type: MIMEText
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> MIMEText:
v... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
```python
def v0(v1: str) -> int:
return int(datetime.fromisoformat(v1).timestamp())
```
Function Name: v2
Function:
```python
def v2(v3: list) -> list:
v4 = []
for v5 in v... |
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:
self.loss_iter = 0
self.val_loss_iter = 0
self.acc_iter = 0
if self.train_loader is not None:
self.loss_history = ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Any
Output Type: np.ndarray
Dependencies:
```python
def v0(v1) -> np.ndarray:
v1 = v1 - np.min(v1, axis=1).reshape(v1.shape[0], 1)
return v1 / (3 * np.std(v1, axis=1).reshape(v1.shape[0], 1))
```
Function Name: v... |
Imports:
```python
import os
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, v4) = os.path.split(v1)
with self.chdir(v3):
self.command.call(file=v4)
el... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
assert 'from pyfileconf import Selector' in v1
assert 's = Selector()' in v1
``` |
Imports:
```python
import h5py
import typing
```
Type definitions:
Input Types: str, list, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: list, v3: bool=False) -> None:
with h5py.File(v1, 'w') as v4:
for (v5, v6) in enumerate(v2):
v7 = {'data': v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: nextcord.TextChannel
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: nextcord.TextChannel) -> None:
self._check_database()
v2 = {'guild': v1.guild.id, 'channel': v1.id}
await self.database.upda... |
Imports:
```python
from collections import Counter
import typing
```
Type definitions:
Input Types: int
Output Type: Callable[..., int]
Dependencies:
```python
def v0(v1, v2=None):
assert v2, 'counter must be non-empty and not `None`.'
return max(filter(lambda r: v2[r] >= v1, v2.keys()), default=min(v2.keys())... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, dict, dict
Output Type: dict
Dependencies:
```python
def v0() -> str:
if d_classname:
return d_classname['ClassName']
return d_path_segmentation['FileName'].split('.')[0].strip()
```
Function Name: v1
Function:
```python
def v1(s... |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import ticker, cm
import typing
```
Type definitions:
```python
class v0:
v1 = None
v2 = None
v3 = None
v4 = None
v5 = None
v6 = None
v7 = None
v8 = None
def __init__(self, v9, v10):
"""
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str, dict
Output Type: bool
Dependencies:
```python
def v0(v1) -> bool:
if not v1:
return False
return v1.is_active()
```
Function Name: v2
Function:
```python
def v2(self, v3, v4: str, v5: dict) -> bool:
if not v0(v3):
... |
Imports:
```python
import pandas as pd
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:
v1['state'] = pd.to_numeric(v1['state'], errors='coerce')
v1['last_changed'] = pd.to_date... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v1['id'] = self.id
self.redis.publish(self.listen_channel, json.dumps(v1))
``` |
Imports:
```python
import torch
from torch import Tensor
from torch.utils.data import BatchSampler, Dataset
import typing
```
Type definitions:
Input Types: List[int], int, int, int
Output Type: Dict[int, Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: int, v3: int, v4: int... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Mapping[str, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=None, v2: Mapping[str, Any]=None, **v3):
v1 = v1 or {}
v4 = super().request_params(v1, v2, **v3)
v5 = self._start_date
v6 = v1... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = None
v2 = None
v3 = None
v4 = None
v5 = None
def __init__(self, v6, v7, v8, v9, v10):
self.table_name = v6
self.columns = v7
self.filters = v9
self.from_sql_string = v8
self.h... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, bool, bool, str, bool, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: bool, v4: bool, v5: str, v6: bool, v7: bool):
v8 = ['[ Info ]\n', '# Go To https://electric.sh/docs/configurat... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Optional[Dict]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: Optional[Dict]=None) -> Any:
v4 = self.get_all_items(v1, v2, v3)
return v4[0]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: dict):
v3 = v1.split('.')
v4 = v2
for v5 in v3:
v4 = v4[v5]
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None, v2: str=None):
v3 = self.find_transactions(v1, v2)
if 'hashes' not in v3 or len(v3['hashes']) == 0:
return False
return True
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Model):
v1: str
v2: str
v3: List[ModelsRule]
v4: str
v5: int
v6: str
v7: str
v8: str
def v9(self, v10: str) -> v0:
self.configuration_code = v10
return self
def v11(self, v12: str) -> v0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> int:
if v1 is None or len(v1) == 0:
return 0
v2 = 0
while not v1[v2].isnumeric():
v2 += 1
if v1[v2] == '1':
v2 += 2
... |
Imports:
```python
import os
import pandas as pd
import typing
```
Type definitions:
Input Types:
Output Type: Dict[Tuple[str, int], float]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Dict[Tuple[str, int], float]:
v1 = os.getcwd()
v1 = os.path.join(v1, 'output', 'abundance.tsv')
v2 = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pytest.Parser
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pytest.Parser):
v2: pytest.OptionGroup = v1.getgroup('holdmypics')
v2.addoption('--formats', nargs='+', choices=['webp', 'png', 'jpeg', 'gif'], defa... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = f'{self.cred_data_dir}/data'
v2 = ['src', 'test', 'other']
v3 = 0
v4 = os.listdir(v1)
for v5 in v4:
v6 = os.listdir(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
if not v1 in self.__expected_testcase_list:
self.__expected_testcase_list.append(v1)
else:
for v2 in self.__actual_testcase_li... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1: dict = self.get_setting()
if v1:
self.algo_engine.start_algo(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Any:
if (v2 := (getattr(self, v1) if v1 in self.actions else None)):
return v2
else:
raise NotImplementedError(f'Action "{v1}" i... |
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 = v2 // 2
return sorted(v1)[v3]
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if '.' not in v1:
v1 += '.json'
with open(v1, 'w') as v2:
v2.write(json.dumps(self.data, indent=4))
retur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.