text stringlengths 190 325k |
|---|
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
self.X = np.array(v1).reshape(self.X.shape)
self.Hs[0] = self.activate(np.dot(self.X, self.Ws[0]) + self.Bs[0])
for v2 in... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = xds_url_map_testcase.DumpedXdsConfig
```
Input Types: v0
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0):
self.assertNumEndpoints(v2, 1)
v3 = v2.rds['virtualHosts'][0]['routes'][0]['route']['retryPol... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Path
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path) -> pd.DataFrame:
v2 = v1 / 'abcd_freesurfer.csv'
v3 = pd.read_csv(v2)
v3['SRC_SUBJECT_ID'] = v3['SRC_SUBJECT_ID'].str.... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Union[np.ndarray, list]
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: Union[np.ndarray, list]) -> np.ndarray:
if not np.allclose(v1, v1.T):
raise Valu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, dict, dict, dict, Dict[str, List[str]], Optional[Union[List[int], Dict[int, Set[int]]]]
Output Type: (dict, dict)
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: dict, v3: dict, v4: dict, v5: Dict[str, List[str]],... |
Imports:
```python
import asyncio
from math import ceil
import typing
```
Type definitions:
Input Types:
Output Type: List[Dict[Any, Any]]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> List[Dict[Any, Any]]:
v1 = []
v2 = await self.client.fetch_campaign()
v3 = v2.data()[0].id()... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1: Node = self._headPoint
v2: str = ''
while v1:
v2 += str(v1.data)
if v1.nextLink:
v2 += ','
v1 = v1.nextLink... |
Imports:
```python
from typing import Optional, Protocol, TypeVar, Union, cast
import typing
```
Type definitions:
Input Types: str
Output Type: tuple[str, Optional[tuple[str, ...]]]
Dependencies:
```python
def v0(v1: str) -> tuple[str, Optional[str]]:
if (v2 := generic_alias_repr_pattern.fullmatch(v1)):
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: str) -> dict:
v3 = v1.keys()
v4 = v1.values()
v5 = {'fieldKeys': v3, 'fieldTypes': v4, 'name': v2}
v6 = self.__client.post(self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[int]]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[List[int]]) -> int:
v2 = [r for v3 in v1 if sum(v3) == 1]
v4 = [c for v5 in zip(*v1) if sum(v5) == 1]
return sum((v1[i][j] == 1 and... |
Imports:
```python
from itertools import zip_longest
import numpy as np
import typing
```
Type definitions:
Input Types: matplotlib.axes.Axes, str
Output Type: None
Dependencies:
```python
def v0(v1: Iterable[Any], v2: int) -> Any:
v3 = [iter(v1)] * v2
return zip_longest(*v3)
```
Function Name: v4
Function:
``... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Generator['SampleBatch', None, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Generator['SampleBatch', None, None]:
v1 = [len(v) for v2 in self._data.values()]
return self.to_minibatches(v1[0])
``` |
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 == 'null':
raise Exception("'job_type' can not be null!")
return self.GetJob(job_type=v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = len(self._config_list.selectedItems()) == 1
self._load_btn.setEnabled(v1)
self._delete_btn.setEnabled(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 self._connected_devices == v1:
return False
self._connected_devices = v1
return True
``` |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Dict[str, Any], Optional[str], bool
Output Type: str
Dependencies:
```python
def v0(v1: Dict[str, Any], v2: List[str], v3: str='') -> Any:
try:
for v4 in v2:
v1 = v1[v4]
except (AttributeError, KeyError, TypeError... |
Imports:
```python
import seaborn as sns
import typing
```
Type definitions:
Input Types: pd.DataFrame, str, float, List[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame, v2: str, v3: float, v4: List[str]) -> None:
v5 = self.colors[v2]
sns.violinplot(ax=... |
Imports:
```python
import logging as log
import re
import typing
```
Type definitions:
Input Types: Dict, str
Output Type: int
Dependencies:
```python
def v0(v1: OrderedDict, v2: str='') -> int:
v3 = 0
if v1['type'] not in IM_TYPES:
log.error('{prefix} Inter_signal {name} type {type} is incorrect.'.for... |
Imports:
```python
from PIL import Image, ImageDraw
from random import randint
import typing
```
Type definitions:
Input Types: Tuple
Output Type: Image
Dependencies:
```python
def v0(v1: ImageDraw.ImageDraw, v2: int=1, v3: int=3) -> None:
for v4 in range(v2, v3):
randPoly(v1, corners=randint(3, randint(3,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, str]) -> str:
v2 = str(self.path)
v3 = []
for (v4, v5) in v1.items():
v6 = '{{+{}}}'.format(v4)
if v6 in v2:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
with open(self.built_xmi_location, 'w') as v1:
v1.write(self.xmi_template.format(name=self.model_name, target=self.interpreter.extract_target(), ur... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Series
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: Series) -> None:
v3 = self._info_axis.get_loc(v1)
v4 = v2._values
self._mgr.iset(v3, v4)
``` |
Imports:
```python
from bisect import bisect_right, bisect_left
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: Optional[Any]
Dependencies:
```python
def v0(v1, v2) -> Optional[int]:
v3 = bisect_left(v1, v2)
if v3 != len(v1):
return v3
return None
```
Function Name: v4
F... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any], v2: bool=False) -> None:
v3 = f"#{v1['id']} {v1['task']} on {v1['queue']} - [{v1['status']}]"
if v2:
v3 += f" (attem... |
Imports:
```python
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._job.output.unwrapped_positions
v2 = v1[:, self._water_hydrogen_indices[:, 0], :] - v1[:,... |
Imports:
```python
import base64
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
if 'UPLOAD' in v1:
v2 = v1.split()[2][1:-1]
v3 = v1.split()[-1][1:-2]
with open(v2, 'rb') as v4:
... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame, dict
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: dict) -> pd.DataFrame:
v3 = pd.DataFrame(v2)
v4 = v1.append(v3, ignore_index=True)
return v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, bool, Spin
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float=0.001, v2: bool=False, v3: Spin=None):
v4 = self.get_densities(v3)
if not v2:
v1 = v1 * v4.sum() / v4.shape[0]
v5 = 0
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Operation):
v1: str = '/social/v1/public/namespaces/{namespace}/users/{userId}/statitems/value/bulk'
v2: str = 'GET'
v3: List[str] = []
v4: List[str] = ['application/json']
v5: List[List[str]] = [['BEARER_AUTH'], ['BEARER_AUTH... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor):
v1 = self.encoder[0](v1)
v2 = self.encoder[1](v1)
v3 = self.encoder[2](v2)
v4 = self.encoder[3](v3)
return (v2, v3, v4)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, 'Config'
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: 'Config') -> bool:
if '-' in v1:
return True
if not v2.no_skip_spaces_pron and (' ' in v1 or '\xa0' in v1):
return True
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: binary_tree.Node
Output Type: binary_tree.Node
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: binary_tree.Node) -> binary_tree.Node:
v2 = v1
while v2.left:
v2 = v2.left
return v2
``` |
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.data.height // -2) + 2
print(self.term.move(v2, 0) + v1 + self.term.clear_eol, end='', flush=True)
``` |
Imports:
```python
from urllib.parse import urlparse
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str):
v3 = urlparse(v1)
v4 = urlparse(v2)
return (v3, v4)
``` |
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 not os.path.isdir(os.getcwd() + '/' + v1):
os.makedirs(os.getcwd() + '/' + v1)
os.chdir(os.getcwd() + '/' + v1)
return o... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> float:
if (len(self.scheduled_sampling_probs) > 1 or self.scheduled_sampling_probs[0] < 1.0) and v1 >= self.start_scheduled_sampling_epoch:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[np.ndarray]:
self.feet_target_hist[1] = self.feet_target_hist[0]
self.feet_target_hist[0] = self.foot_target_pos.reshape(12)
``` |
Imports:
```python
import os
import os.path
from glob import iglob
import typing
```
Type definitions:
Input Types: List[str], bool, List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2: bool, v3: List[str]):
if v2:
for v4 in v1:
yield from ig... |
Imports:
```python
import typing
```
Type definitions:
Input Types: invites.InviteWithMetadata
Output Type: typing.Tuple[typing.Optional[invites.InviteWithMetadata], typing.Optional[invites.InviteWithMetadata]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: invites.InviteWithMetadata, /) -> typi... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Tuple[np.ndarray, np.ndarray]
Output Type: Union[int, np.array]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple[np.ndarray, np.ndarray]) -> Union[int, np.array]:
if len(v1) != 0:
v2 = self.__C... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.array
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.array) -> np.array:
v2 = np.interp(v1, (v1.min(), v1.max()), (-1, 1))
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._create_or_reuse_mlflow_run()
return super().activate()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: DataFrame
Output Type: Series
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: DataFrame=None) -> Series:
if v1 is None:
v1 = self.getX()
if self.model:
return self.model.predict(v1)
else:
raise... |
Imports:
```python
import os
import pickle
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
os.makedirs(v1, exist_ok=True)
v2 = os.path.join(v1, 'loader')
with open(v2 + '.tmp', 'wb') as v3:
pi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> dict:
v2 = super().json_api_serialized(v1)
v2['attributes']['size'] = None
v2['attributes']['sizeInt'] = None
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence[Any], Dict[str, Any]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Sequence[Any], v2: Dict[str, Any]) -> str:
v3 = ''
if v1:
v3 = ', '.join(map(repr, v1))
if v2:
if v3:
... |
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):
v3 = v2[self.CONTEXT_IDENT]
v3.message.reply_text(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = v1.split('_')
for (v3, v4) in enumerate(v2):
v2[v3] = v4[0].upper() + v4[1:]
v5 = v2[0] + ''.join((x.title() for v6 in v2[1:... |
Imports:
```python
from tensorflow.keras.layers import Input, concatenate, Dropout, BatchNormalization
from tensorflow.keras.layers import Convolution3D, MaxPooling3D, UpSampling3D, Cropping3D
from tensorflow.keras.models import Model
import typing
```
Type definitions:
Input Types:
Output Type: Model
Dependencies:
... |
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:
v2 = '../logs'
v1 = v1 + '.log'
return os.path.join(v2, v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: int) -> bool:
if not self._initialized:
raise RuntimeError('modifier must be initialized first')
if not self._enabled or self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, str, Any, Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int=1, v3: str='> ', v4=print, v5=input) -> int:
v6 = None
while v6 is None or v6 < v2 or v6 > v1:
if v6 is not None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str) -> None:
self.ui.plainTextEditIncludes.setPlainText(v1)
self.ui.plainTextEditHeaders.setPlainText(v2)
self.ui.plai... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: bool) -> None:
v2 = self._device.urls.command_set_all_zone_stereo
if v1:
v2 += 'ZST ON'
else:
v2 += 'ZST OFF'
await self... |
Imports:
```python
from os import environ, path
import typing
```
Type definitions:
Input Types: str, bool
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: bool) -> bool:
v3 = environ.get(v1)
return str.lower(v3) == 'true' if v3 is not None else v2
``` |
Imports:
```python
import numpy
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[List[Dict[str, Any]], Dict[str, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple[List[Dict[str, Any]], Dict[str, Any]]:
v1 = []
for v2 in self._nodes:
v3 = self._nodes_se... |
Imports:
```python
import keras
import h5py
import numpy as np
import typing
```
Type definitions:
```python
class v0:
def v1(self, v2):
pass
```
Input Types: str, str, str, v0
Output Type: Any
Dependencies:
Function Name: v3
Function:
```python
def v3(self, v4: str, v5: str, v6: str, v7: v0):
print('... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.name != '':
return self.board.board_type + ' ' + str(self.board.ordinal) + ' ' + self.name
return self.board.board_type
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'BaseModule', str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'BaseModule', v2: str=''):
for v3 in self._state_vars_names:
v4 = getattr(v1, v3, None)
if v4 is None:
continue
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
self.amqp_config = v1
self.amqp_username = self.get_parameter('USERNAME', 'username')
self.amqp_password = self.get_parameter('PASSWORD', 'p... |
Imports:
```python
from keyword import kwlist
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v1 = v1.replace('-', '_')
if v1 in kwlist:
v1 = f'{v1}_'
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
try:
self.buffer[self.offset]
return True
except IndexError:
return False
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(int):
@staticmethod
def v1(v2: str) -> v0:
return v0('ABCD'.find(v2))
def v3(self) -> str:
return 'ABCD'[self]
@property
def v4(self) -> int:
return 10 ** self
@staticmethod
def v5() -> Iter... |
Imports:
```python
import typing
```
Type definitions:
Input Types: T
Output Type: T
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: T) -> T:
v2 = v1.exp()
v3 = v2.sum(dim=1)
return -((v1 * v2).sum(dim=1) / v3 - v3.log()).mean().item()
``` |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> bool:
if v1 < 2:
return False
if v1 in (2, 3, 5, 7):
return True
if v1 % 2 == 0 or v1 % 3 == 0 or v1 % 5 == 0 or (v1 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1) -> None:
v2 = self._policy_arch(**self._policy_arch_params._asdict()).to(self._device)
self.optimiser = self._optimiser_type(v2.parameters(), lr=self._o... |
Imports:
```python
from dask.distributed import Client, Variable, Lock, ActorFuture, TimeoutError
import typing
```
Type definitions:
Input Types: Any, bool, bool
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: bool=False, v3: bool=True) -> bool:
v4 = 'KVCache_{}'.format... |
Imports:
```python
import sys
import textwrap
from pprint import pprint
from textwrap import dedent
import typing
```
Type definitions:
Input Types: bool, int, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v4: Any, v1: bool=False, v2: int=0, v3: bool=True) -> None:
try:
... |
Imports:
```python
import os
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: List[str], v2: List[str], v3: List[str], v4: int, v5: List[str]) -> None:
self.whitelist = v1
self.blacklist = v2
self.arglist = v3
self.verbosity = v4
self.waiter = W... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: int) -> None:
if len(v1) <= 1:
return
if v2 == 0:
return
v3 = 0
v4 = 0
v5 = []
v2 = v2 % len(v1)
v5 = v1[-... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: Tuple[float, float], Tuple[float, float], float
Output Type: Tuple[float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple[float, float], v2: Tuple[float, float], v3: float) -> Tuple[float, float]:
v4 = math... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[int, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple[int, int]:
v1 = max(self.vs, key=self.vs.get)
return (v1, self.vs[v1])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: type
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: type):
assert isinstance(v1, type)
v2 = [v1]
v3 = []
while len(v2):
v4 = v2.pop(0)
v3.insert(0, v4)
for v5 in v4.__subclasses... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor) -> torch.Tensor:
v1 = self.conv1(v1)
if self.bn1 is not None:
v1 = self.bn1(v1)
if self.activation is not No... |
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 and ' ' in v1:
return '"{}"'.format(v1)
return v1
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Callable, float, float, float, float
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Callable, v2: float, v3: float, v4: float, v5: float) -> np.array:
v6 = int(np.ceil((v5 - v3) / v4))
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T', bound='Operation')
```
Input Types: v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> None:
v3 = v2.hash_tree_root
if v3 in self._pool_storage:
del self._pool_storage[v3]
``... |
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.sentence_reordering(text=v1)]
return v2
``` |
Imports:
```python
from torch.utils.data import DataLoader
import torch
import torch.nn as nn
import torch.optim as optim
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: torch.Tensor) -> flo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[dict], Optional[Any]
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[dict], v2: Optional[Any]) -> Dict[str, Any]:
v3: dict = {}
if self.params:
for (v4, v5) in self.pa... |
Imports:
```python
import logging
import os
import matplotlib
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
logging.getLogger('numba').setLevel(logging.WARNING)
logging.getLogger('matplotlib').setLevel(logging.INFO)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.List[str]
Output Type: t.Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: t.List[str]) -> t.Dict[str, str]:
assert len(v1) % 2 == 0
v2 = v1[::2]
v3 = v1[1::2]
return dict(zip(v2, v3))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v1 = v1.lower()
if v1 == 'true' or v1 == 't':
return True
elif v1 == 'false' or v1 == 'f':
return False
else:
return boo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Element'
Output Type: 'list[Element]'
Dependencies:
```python
def v0() -> dict:
return {'api_url': 'https://esignature.ec.europa.eu/efda/tl-browser', 'uri_etsi': '{http://uri.etsi.org/02231/v2#}', 'svc_granted': 'http://uri.etsi.org/TrstSvc/Trust... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False):
if v1:
print(self.current_configuration)
while True:
if self.accepting or self.is_stuck:
return
self.s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
```python
def v0():
import plyara
v1 = plyara.Plyara()
return v1
```
```python
def v2(v3: str) -> List[List[Dict[str, Any]]]:
v4 = v0()
try:
v4.parse_string(v3)
except Exception:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> None:
self._funcao_transicao = v1
return
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list[str]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list[str]) -> bool:
v2 = True
while v2:
if self.queued_address >= len(v1):
return True
(v3, v4) = v1[self.queued_addr... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Tuple[str, str]:
v2 = re.match('^(?P<name>[A-Za-z0-9_-]+)\\s?(?P<version>.*)?$', v1)
if v2:
return (v2.group('name'), v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.gather_imports('\n import a.b.c, d\n import x.y\n a.b(d)\n ')
self.assertEqual(v1, {'x.y'})
``` |
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
Output Type: int
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: v0) -> int:
if not v3:
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: any=None) -> str:
v2 = []
if v1:
print(v1, end='')
while True:
v3 = input()
if v3:
v2.append(v3)
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'IRunner'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'IRunner') -> None:
v2 = f'{v1.valid_loader}_{v1.main_metric}'
if self.valid_loader not in v1.loaders:
v1.epoch_metrics[v2] = float('+inf... |
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, v3) in enumerate(self.alts):
v3.set_rule_name_and_index(v1, v2)
``` |
Imports:
```python
from pandas import DataFrame
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, Any, Any
Output Type: DataFrame()
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=[], v2=[], v3='', v4='', v5='', v6='') -> DataFrame():
if self.columns != ['default']:
... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, Dict, int
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: Dict, v3: int) -> torch.Tensor:
assert len(v1.shape) == 3
(v4, v5, v6) = v1.shape
v7 = v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
if v1 < 0 or v1 >= len(self.elevators_list):
raise ValueError('Wrong elevator number')
'\n В доке написан про попытку\n ... |
Imports:
```python
import numpy as np
from scipy.stats import chi2
from matplotlib import pyplot as plt
from matplotlib import patches
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, np.ndarray, float, int, str, str, float, float, str, int
Output Type: List[patches.Polygon]
Dependencies:
```py... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
if v1 < -self._length or v1 > self._length - 1:
raise IndexError('Index out of range.')
assert self._length > 0, 'List is empty.'
v2 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Tuple[int, int]], List[Tuple[int, int]], bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[Tuple[int, int]], v2: List[Tuple[int, int]], v3: bool):
v4 = []
for (v5, v6) in enumerate(v2):
if ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.