text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, bool
Output Type: str
Dependencies:
```python
def v0(v1: str, v2: bool) -> str:
if settings.ENABLE_GRAVATAR:
v3 = f'&s={MEDIUM_AVATAR_SIZE}' if v2 else ''
v4 = gravatar_hash(v1)
return f'https://secure.gravatar.co... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: int=1) -> str:
return ' ' * 4 * v2 + v1
```
```python
def v3(v4: List[str], v5: int=1) -> List[str]:
return [v0(line, v5) for v6 in v4]
```
Function Name: v7
Function:
```python
de... |
Imports:
```python
from collections import OrderedDict
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin, clone
from sklearn.exceptions import NotFittedError
from sklearn.utils.validation import check_is_fitted
import typing
```
Type definitions:
Input Types: pd.DataFrame, Any
Output Type: A... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[str, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Tuple[str, int]:
v2: str = 'bad broker; use host:port'
(v3, *v4) = v1.split(':')
if not v3:
raise Exception(v2)
if not v4:... |
Imports:
```python
import numpy as np
import torch
from torch import nn, optim, jit
from torch.distributions import Normal
from torch.distributions.kl import kl_divergence
from torch.nn import functional as F
from torch.optim.optimizer import Optimizer
from torch.utils.tensorboard import SummaryWriter
import typing
```... |
Imports:
```python
import typing
```
Type definitions:
Input Types: mod.Rule.Edge
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: mod.Rule.Edge):
if v1.left:
self.record_left_edge(v1.left)
if v1.right:
self.record_right_edge(v1.right)
``` |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
```python
class v0(BaseModel):
v1: str
v2: Optional[str]
v3: Optional[int]
class v4:
"""pydantic configuration class for DistributionMetadata"""
v5 = orjson_loads
v6 = orjson_dumps
v7 = False... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[str]], Callable[[List[List[str]]], List[str]]
Output Type: Tuple[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[List[str]], v2: Callable[[List[List[str]]], List[str]]) -> Tuple[int]:
v3 = 'BCH'
v4 = []
... |
Imports:
```python
import requests
from typing import Dict, List, Any, cast, Union
import typing
```
Type definitions:
Input Types:
Output Type: Dict
Dependencies:
```python
def v0() -> str:
v1: Dict = demisto.getIntegrationContext()
v2: str = v1.get('token', '')
if v2:
return v2
v3: str = '/a... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: list
v2: set
v3: int = ROWS
v4: float = SQUARE_SIZE
v5: bool = False
v6: Optional[bytes] = None
v7: int = 240
v8: int = 1
```
Input Types: v0, Any
Output Type: None
Dependencies:
Function Name: v9
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
v1 = self._paragraphs
v2 = 0.0
if v1:
v2 = sum((p.total_height + p.distance_to_next_paragraph for v3 in v1[:-1]))
v2 += v1[-1].... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> str:
if os.path.isabs(v1['import']):
return v1['import']
else:
return os.path.join(os.path.dirname(v1['rule_file']),... |
Imports:
```python
from random import randint, shuffle
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0() -> str:
v1 = ['juane', 'juank', 'matias', 'mauro', 'cristian']
shuffle(v1)
v1 = ['{0}. {1}'.format(i + 1, v1[i]) for v2 in ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: str='') -> bool:
if self.check_funds(v1):
self.ledger.append({'amount': -v1, 'description': v2})
return True
return F... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
v2 = self._mappings.aggregatable_field_name(v1)
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = []
for v3 in v1:
v4 = {}
v4['probability'] = v3[2]
v4['class'] = f'{v3[0]} {v3[1]}'
v2.append(v4)
return v2
`... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T_co', covariant=True)
```
Input Types: Callable[[v0], bool], list[v0]
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Callable[[v0], bool], v3: list[v0]) -> v0:
v4 = [x for v5 in v3 if v2(v5)]
assert ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ignite.engine.Engine
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ignite.engine.Engine):
v2 = {}
if not hasattr(v1.state, 'metrics') or len(v1.state.metrics) == 0:
return
v3 = dict(current_... |
Imports:
```python
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types: Optional[int], Optional[int], Optional[np.ndarray], Union[int, Tuple[int, int, int]], int
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[int]=None, v2: Optional[int]... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[dict, List[dict], Tuple[dict, ...]]
```
Input Types: v0
Output Type: 'QueryBuilder'
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> 'QueryBuilder':
self._order_by = []
v3 = ('cast', 'order')
v4 = ('asc',... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple[np.ndarray, np.ndarray]:
v1 = self.X.shape[0]
v2 = self.H_0.shape[-1]
v3 = self.X.shape[1]
v4 = n... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[cst.Annotation], Optional[cst.Annotation]
Output Type: bool
Dependencies:
```python
def v0(v1: Union[None, cst.CSTNode, cst.MaybeSentinel]) -> bool:
return v1 is not None and v1 != cst.MaybeSentinel.DEFAULT
```
Function Name: v2
Function:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor, Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor, v2: Tensor):
self.accumulate_step += 1
v3 = self.is_torch_ddp and self.accumulate_step < self.accumulate_size
if v3:
with... |
Imports:
```python
import socket
import typing
```
Type definitions:
```python
class v0(pg_api.Connector):
@property
def v1(self):
return pg_iri.serialize({k: v for (v2, v3) in self.__dict__.items() if v3 is not None and (not v2.startswith('_')) and (v2 not in ('driver', 'category'))}, obscure_password... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> dict:
v2 = {}
v2['data'] = []
v3 = 0
with open(v1, 'r', encoding='utf-8') as v4:
v5 = v4.readlines()
v6 = {}
v6['slide'] = v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Vec3'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Vec3'):
v2 = v1 - self
return v2.length_squared()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: discord.Message, typing.Optional[discord.User]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: discord.Message, v2: typing.Optional[discord.User]) -> bool:
if v1.embeds:
if v2 is not None:
... |
Imports:
```python
import os
import json
import pandas as pd
import typing
```
Type definitions:
```python
v0 = 'pathlib.Path'
```
Input Types: list, v0, str, str, str, str, dict, bool
Output Type: dict
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: list, v3: v0, v4: str, v5: str, v6: str='', v7: str='... |
Imports:
```python
from polars import internals as pli
from polars.internals.construction import arrow_to_pydf, dict_to_pydf, numpy_to_pydf, pandas_to_pydf, sequence_to_pydf, series_to_pydf
from polars._html import NotebookFormatter
from polars.datatypes import Boolean, DataType, UInt32, Utf8, py_type_to_dtype
from pol... |
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.getenv('HTTPS_ONLY', False):
return v1.replace('http://', 'https://', 1)
return v1
``` |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types:
Output Type: Optional[List[Match[str]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Optional[List[Match[str]]]:
v1 = []
v2 = ['dumpsys', 'activity', 'activities']
v3 = self.shell(v2)
v4 = re.compile(... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: typing.List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> typing.List[str]:
v2 = re.split('(\\b[A-Z]{1,2}[0-9][A-Z0-9]? +[0-9][ABD-HJLNP-UW-Z]{2}\\b)', v1, flags=re.IGNORECASE)
return v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
for v2 in v1:
self.diagnose(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2, v3=True):
v4 = v1
v5 = v4[[v2]].copy()
if v3:
v4 = v1.drop(v5, axis=1)
return (v4, v5)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: nn.Module, v2: int, v3: int, v4: List[float], v5: float, v6: Union[float, List[float]], v7: bool=False, v8: int=2, v9: bool=True, v10: float=1e-06, v11: str='mean', **v12):
"""
Parameters
-----... |
Imports:
```python
import torch
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, Optional[torch.Tensor], Optional[torch.Tensor], Optional[torch.Tensor], Optional[torch.Tensor]
Output Type: Tuple[torch.Tensor, Dict[str, torch.Tensor... |
Imports:
```python
import argparse
import asyncio
import datetime
import itertools
import pprint
import typing
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
async def v0(v1: github_types.GitHubPullRequestNumber) -> typing.Tuple[github_types.GitHubPullRequestNumber, int]:
... |
Imports:
```python
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import typing
```
Type definitions:
Input Types: List[Any], int, List[str], str, str, Tuple[int, int], int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[Any], v2: int... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, pd.PlotData
Output Type: Any
Dependencies:
```python
def v0(v1, v2, v3, v4, v5, v6, v7, v8, v9=None, v10=False, v11=True):
v12 = np.concatenate(v2.copy())
v13 = np.concatenate(v3.copy())
v14 = v13.copy()
v15 = n... |
Imports:
```python
import cv2
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3, v4, v5) -> None:
v6 = self.img.copy()
if v1 == cv2.EVENT_LBUTTONDOWN:
self.point1 = (v2, v3)
cv2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, Any
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2) -> float:
v1 = sorted(v1)
if v2 % 2 != 0:
return v1[v2 // 2] / 2
else:
return (v1[v2 // 2] + v1[v2 // 2 - 1]) / 2
... |
Imports:
```python
import torch
import torch.nn.functional as F
from torch import nn
import numpy as np
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from torch.utils.data import DataLoader
import typing
```
Type definitions:
Input Typ... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: 'Unit'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Unit') -> None:
v2 = f'unit_res_{v1.db_id}'
v3 = os.path.join(self.get_run_dir(), 'reservations')
if os.path.exists(os.path.join(v3, ... |
Imports:
```python
import json
from io import BytesIO
import typing
```
Type definitions:
Input Types: Response
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Response) -> Any:
v2 = dict()
for v3 in self.__response_keys:
v2[v3] = getattr(v1, v3)
for v3 in sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.apps_registry.get_model('chains', 'Chain')
v2 = v1.objects.get(id=1)
v3 = v1.objects.get(id=4)
v4 = v1.objects.get(id=137)
self... |
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 = self.dest.joinpath(v1 + '/' + v2 + '/' + v3)
return 'file:///' + str(v4.resolve()).replace('\\', '/')
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3) -> np.ndarray:
v4 = v1['data']
v5 = v4[v2, 0, :, v3, 0]
v6 = v4[v2, 2, :, v3, 0]
v7 = -np.log10(v5 / v6)
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, bool, Any
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: bool=False, v3=None) -> Tuple[np.ndarray, np.ndarray]:
assert v1.ndim == 2
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: patches.Patch, Union[Tuple[int], str]
Output Type: patches.Patch
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: patches.Patch, v2: Union[Tuple[int], str]=(0, 0)) -> patches.Patch:
v3 = self[v2]
return v3.add_patch(v1)
``... |
Imports:
```python
import asyncio
import weakref
from functools import partial
import typing
```
Type definitions:
```python
v0 = Callable[[_T], Any]
```
```python
v1 = TypeVar('_T')
```
Input Types:
Output Type: v1
Dependencies:
```python
def v2(v3: v0[v1], v4: weakref.ref[v1]) -> None:
if (v5 := v4()) is not Non... |
Imports:
```python
import tqdm
import typing
```
Type definitions:
Input Types: List[dict], Union[Callable, dict]
Output Type: Any
Dependencies:
```python
def v0(v1: Union[Callable, dict]=None, v2: Callable=None):
def v3(v4):
if v2 is not None and (not v2(v4)):
return None
if v1 is Non... |
Imports:
```python
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: nn.Module, nn.Module
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: nn.Module, v2: nn.Module, *v3, **v4) -> None:
(v5, v6) = self.get_slices(v1.weight, v2.weight)
if v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2, v3=None):
if v3 is None:
self.config[v1] = v2
else:
self.config[v3][v1] = v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1, v2: int, v3: int):
v4 = v1.guild.get_channel(v2)
return await v4.fetch_message(v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: ctypes.c_void_p, int, int, int, int, int, bytes, int, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ctypes.c_void_p, v2: int, v3: int, v4: int, v5: int, v6: int, v7: bytes, v8: int, v9: int, v10: int):... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], str, str
Output Type: bool
Dependencies:
```python
def v0(v1: List[str], v2: str):
for (v3, v4) in enumerate(v1):
if v2 + ' ' in v4:
return (v3, v4)
return (None, None)
```
Function Name: v5
Function:
```python
d... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for v1 in range(self.size):
for v2 in range(self.size):
if self.board[v1][v2] == 'X':
self.win_v.append(1)
... |
Imports:
```python
from pandas._config import get_option
from pandas._libs import lib, properties, reshape, tslibs
from pandas._libs.lib import no_default
from pandas._typing import AggFuncType, AnyArrayLike, ArrayLike, Axis, Dtype, DtypeObj, FillnaOptions, IgnoreRaise, IndexKeyFunc, Level, NaPosition, QuantileInterpol... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: int=0) -> int:
for v4 in range(v3, len(v1)):
if v1[v4] != v2:
return v4
return -1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
for v1 in self.doc.sents:
if 'L-E-A-' in v1.text:
if '27' in v1.text:
return True
return False
``` |
Imports:
```python
import uuid
import typing
```
Type definitions:
Input Types: Any, Any, dict, list, bool, bool, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: dict=None, v4: list=None, v5: bool=False, v6: bool=False, v7: bool=False):
if v4 and isinstance(v4, l... |
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:
print('The number is smaller or equal to one.')
print('=^_^= =^_^==^_^= =^_^=')
return 1
print('Let us ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = sum(self.__neg_pos([ord(x) for v2 in self.__passcode]))
return v1 if v1 > 0 else len(self.__passcode)
``` |
Imports:
```python
from functools import partial
import requests
import requests.utils
import typing
```
Type definitions:
Input Types:
Output Type: requests.Session
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> requests.Session:
v1 = requests.Session()
v1.cookies.update({'sessionid': '... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.datamodel.get_pk_name()
if self.list_columns is None and (not self.list_model_schema):
self.list_columns = [v1]
if self.show_co... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v1 = v1.split('\n')
v2 = ['from', 'import', '#', '"', "'", '@']
v3 = ['Gino', 'declarative_base']
v4 = []
v5 = True
for v6 in v1:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1: Tuple[str, int] = next(reversed(self.strings.items()))
v2 = v1[1] + len(v1[0].encode('utf-8'))
assert v2 == sum((len(s.encode('utf-8')) for v3 ... |
Imports:
```python
from PIL import ImageTk, Image, ImageGrab
import typing
```
Type definitions:
Input Types: str, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: float):
v3 = Image.open(f'pictures/{v1}.png')
return v3.resize((int(v3.width * v2), int(v3.hei... |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: Dict[str, str]
Output Type: List
Dependencies:
```python
def v0(v1: List[Tuple[str, List[str]]], v2: List[str]):
if len(v1) == 0:
return v2
(v3, v4) = v1.pop()
v5 = copy.deepcopy(v2)
v6 = [copy.deepcopy(v5) for v7 i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: Union[str, int, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> Union[str, int, float]:
if isinstance(v1, (int, float, str)):
return v1
return str(v1)
``` |
Imports:
```python
from .enum.catalog import Catalog
from .enum.contributor import Contributor
from .enum.magnitude import Magnitude
from .enum.origin import Origin
from .enum.alertlevel import Alertlevel
from .enum.delete import Delete
from .enum.supersede import Supersede
import typing
```
Type definitions:
Input Ty... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: str, AbstractSet[str], AbstractSet[str], AbstractSet[str], int
Output Type: Tuple[FrozenSet[str], FrozenSet[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(*, v1: str, v2: AbstractSet[str], v3: AbstractSet[str], v4: Abs... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Model):
v1: int
v2: int
v3: str
def v4(self, v5: int) -> v0:
self.max_slot_size = v5
return self
def v6(self, v7: int) -> v0:
self.max_slots = v7
return self
def v8(self, v9: str) -> v0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[hash]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[hash]:
v1 = []
v2 = 0
for v3 in self._states:
if v2 != self._first_state_id:
v1.append({'T': v3, 'id': v2, 'str': 0})
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = self.__get_swap(text=v1)
return v2
``` |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
v2 = 1150
v3 = 980
return '+{:06.1f}\r'.format(random.uniform(v3, v2))
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int=2):
assert v1 >= 0
v3 = [' ', 'K', 'M', 'B', 'T']
v4 = int(np.floor(np.log10(v1)) + 1 if v1 > 0 else 1)
v5 = int(... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Dict[str, List]
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, List]) -> np.ndarray:
v2 = np.array(v1['real'], dtype=complex)
v2.imag = np.array(v1['imag'], dtype=float)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: 'TimeResSpec'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> 'TimeResSpec':
v3 = self.copy()
if callable(v1):
v4 = v1(v3.data, *v2)
elif v1 == 'svd':
v4 = filter.svd_filte... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Iterable[Tuple[Type, Callable]], int
Output Type: Any
Dependencies:
```python
def v0(v1: Any, v2: Iterable[Tuple[Type, Callable]]) -> Callable:
for (v3, v4) in v2:
if isinstance(v3, type):
v5 = v3
def v6(v7):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, dict, int, bytes, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: dict, v3: int, v4: bytes, v5: float, **v6):
self.status_code = v1
self.environ = v2
self.content_length = v3
s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, int, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: int, v4: dict):
if self.__writer__ is not None:
self.__writer__.write_indicator(v1, v2, v3, v4)
``` |
Imports:
```python
import plotly.express as px
import plotly.graph_objects as go
import typing
```
Type definitions:
Input Types: List[Tuple[str, str]], np.ndarray, dict, str, str, str
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: Dict[str, int], v3: np.ndarray) -> np.ndarray:
return v3[v2[v1]]
```... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Iterable[Tuple[float, any]]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[Tuple[float, any]]) -> None:
v1 = list(v1)
v2 = np.fromiter((evaluation[0] for v3 in v1), dtype=np.... |
Imports:
```python
from collections import defaultdict, deque
import typing
```
Type definitions:
Input Types: str, str, List[str]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: List[str]) -> int:
if v2 not in v3:
return 0
(v4, v5, v6, v7) = (0,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict):
for v2 in self.tables:
v3 = v2['name']
if v3 in v1:
v2['fqn'] = v1[v3]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = 'Shape: {}'.format(self.round_shape)
if self.joker_called:
v1 += '\tJoker Called!'
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bytearray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bytearray:
v2 = bytearray(v1)
self.__i2c.recv(v2, self.__addr)
return v2
``` |
Imports:
```python
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, TypeVar, Union, cast
import typing
```
Type definitions:
```python
v0 = Callable[..., Any]
```
Input Types: Union[v0, classmethod]
Output Type: Tuple[v0, classmethod]
Dependencies:
Function Name: v1
Function:
```pyth... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = {'A': 'U', 'T': 'A', 'C': 'G', 'G': 'C'}
v3 = list(v1)
for (v4, v5) in enumerate(v3):
v3[v4] = v2[v5]
v6 = ''.join(v3)
r... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, float, str
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: float=0.0, v3: str='') -> torch.Tensor:
if v2 > 0.0:
v4 = v2
v1 = v1.float()
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=None, v3=None):
self.val = v1
self.left = v2
self.right = v3
```
Input Types: v0, v0
Output Type: v0
Dependencies:
```python
def v4(v5, v6):
if v6 == None:
return 0
if v5 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> None:
for v3 in v2:
v4 = f'{v1}/{v3}'
if self.__should_skip_list_add(v4):
v2.remove(v3)
``` |
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:
v1 = v1.astype(float)
v1 = np.max(v1) - v1
if np.max(v1):
v1 /= np.max(v1)
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: int, v3: int):
v4: Node = v1[v2]
v5: Node = v1[v3]
v6: Node = v1[v2]
v6.node_x = v4.node_x
v6.node_y = v4.node_y
v4.node_... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1, v2) -> torch.Tensor:
v3 = v2.device if isinstance(v2, torch.Tensor) else None
v1 = torch.as_tensor(v1, dtype=torch.float, device=v3)
if v1.ndim == 0 or ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Model', 'Model'
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Model', v2: 'Model') -> bool:
v3 = False
for v4 in list(self.walk(order='dfs_post')):
if v4 is v1:
v3 = True
... |
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 = set()
(v3, v4) = (0, 0)
'tmmzuxt'
for (v5, v6) in enumerate(v1):
if v6 in v2:
v4 = max(v4, v5 - v3)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if self.op.profile:
if not self.op.combinator:
for v1 in range(1, self.op.arity.value):
if not isinstance(self.args[v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: xr.Dataset
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> xr.Dataset:
assert self.collation is not None
return self.collation.to_xarray(self.daq_values)
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.