text stringlengths 190 325k |
|---|
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Path, str, int
Output Type: Path
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: str='test', v3: int=None) -> Path:
if v3 is not None:
v4 = list(Path(v1).glob(f'{v2}/model_epoch{str(v3).zf... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1: torch.Tensor, v2: Optional[List[int]]=None) -> torch.Tensor:
if v2 is None:
v2 = [0] * v1.dim()
for v3 in range(1, v1.dim()):
v2[v3]... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = List[Company]
```
Input Types: v0
Output Type: int
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0) -> int:
v3 = sum([x.production for v4 in v2])
return int(round(sum([(100 * v4.production / v3) ** 2 for v4 in v2])))
``` |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Any
Dependencies:
```python
def v0(v1: pd.DataFrame, v2: pd.DataFrame):
v1 = v1.loc[v1['who_code'].isin(v2['who_code'])].copy()
return v1
```
Function Name: v3
Function:
```python
def v3(v4: pd.Dat... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor, Tensor, Tensor, Tensor, Tensor
Output Type: Tuple[Tensor, Tensor, Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor, v2: Tensor, v3: Tensor, v4: Tensor, v5: Tensor) -> Tuple[Tensor, Tensor, Tensor]:
v6 = ... |
Imports:
```python
import threading
import typing
```
Type definitions:
Input Types: list
Output Type: (list, list, list)
Dependencies:
```python
def v0(v1, v2):
v3 = len(v1) / float(v2)
v4 = []
v5 = 0.0
while v5 < len(v1):
v4.append(v1[int(v5):int(v5 + v3)])
v5 += v3
return v4
```
... |
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['molecule_chembl_id']
v3 = self.compound_families_dir.find_node(v2).get_all_branch_ids()
return {'_metadata': {'all_molecule_chembl_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: dict
Dependencies:
```python
def v0(v1: list) -> list:
v2 = [v1[0], v1[1], v1[2] + 1]
v3 = [1, 3, 5, 7, 8, 10]
v4 = [4, 6, 9, 11]
if v2[-1] == 31 and v2[-2] in v4:
v5 = [v2[0], v2[1] + 1, 1]
elif v2[-1] ==... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self.debug_log("Removing delay: '%s'", v1)
try:
v2 = self.delays.pop(v1)
except KeyError:
pass
else:
self.machine.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: None
Dependencies:
```python
def v0(v1: Flask, v2: utils.staticdict) -> None:
v3 = v2.blueprint + '.' + self._domain
if v3 in getattr(v1, target):
getattr(v1, target).pop(v3)
```
```python
def v4(v5: Flask, v... |
Imports:
```python
import logging
import numpy as np
import typing
```
Type definitions:
Input Types: List[float]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[float]):
v2 = np.roll(self.piece.get_duration_cache() == 0, 1)
v2[0] = True
v3 = 0
v4 = 0
v5 ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame) -> Tuple[np.ndarray, np.ndarray]:
v2 = v1.groupby('groups').var()['GR'].values
v3 = v1.gro... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, List[List[str]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: List[List[str]]):
v3 = v1['input_ids']
v4 = v1['label_attention_mask']
v5 = v1['valid_ids']
v6 = []
v7 = []
... |
Imports:
```python
import os
import socket
import numpy as np
from torch.utils.data import DataLoader
from torch.utils.data import SequentialSampler
import random
import copy
import typing
```
Type definitions:
Input Types: np.ndarray, Any, Any, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1=128, v2=8, v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: typing.Type['Resolved.Section']
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: typing.Type['Resolved.Section']):
assert v1.resolve('bar')[0].params == {'foo': 'baz'}
assert [r.params for v2 in v1.resolve... |
Imports:
```python
import numpy as np
from skimage.measure import shannon_entropy
import typing
```
Type definitions:
Input Types: np.ndarray, Any, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1: np.ndarray):
v2 = sum((shannon_entropy(v1[:, :, 2]), shannon_entropy(v1[:, :, 3]), shannon_entropy(v1[:, :... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple, list
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tuple, v2: list) -> None:
print(f'z-statistic: {v1[0]:.3f}')
print(f'p-value: {v1[1]:.3f}')
(v3, v4) = v2[0]
(v5, v6) = v2[1]
print(f'ci ... |
Imports:
```python
import pandas as pd
from itertools import chain
import typing
```
Type definitions:
Input Types:
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> pd.DataFrame:
v1 = [dict(chain(inst.as_dict().items(), (('instrument', inst),))) for v2 in self.instrum... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Optional[int], Optional[int]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=None, v2=None, v3: Optional[int]=None, v4: Optional[int]=None):
v5 = super().read(where=v1, columns=v2, start=v3, stop=v4)... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Optional[List[tbase.TagData]]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> Optional[List[tbase.TagData]]:
if self._current_page is None:
return None
v1 = self._current_skip + len(self._curren... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[Tuple[int, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[Tuple[int, int]]:
self.__extend_matrix()
self.__create_mask()
self.__create_covers()
v1 = {1: self.step_one, 2: self.step_two... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: dd.DataFrame, int
Output Type: dd.Series
Dependencies:
```python
def v0(v1: pd.Series) -> Dict[str, Union[float, np.array]]:
v2: Dict[str, Any] = {}
v2.update(zip(('q1', 'q2', 'q3'), v1.quantile([0.25, 0.5, 0.75])))
v3 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
if isinstance(v1, str):
v2 = v1.strip()
if v2.isidentifier():
return True
return False
``` |
Imports:
```python
import numpy as np
from numpy import ndarray
import typing
```
Type definitions:
Input Types: ndarray, ndarray, ndarray
Output Type: Tuple[ndarray, ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ndarray, v2: ndarray, v3: ndarray) -> Tuple[ndarray, ndarray]:
(v4, v... |
Imports:
```python
import subprocess
import re
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
```python
def v0(v1: str) -> str:
v2 = str(subprocess.check_output(['ifconfig', v1]))
v3 = re.search('\\w\\w:\\w\\w:\\w\\w:\\w\\w:\\w\\w:\\w\\w', v2)
if v3:
retur... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
if v1.startswith('<extra_id_'):
v2 = re.match('<extra_id_(\\d+)>', v1)
v3 = int(v2.group(1))
return self.voca... |
Imports:
```python
import tensorflow as tf
import math
import typing
```
Type definitions:
Input Types: tf.Tensor
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor) -> tf.Tensor:
v2 = v1.dtype
(v3, v4, v5) = tf.unstack(tf.shape(v1))
v6 = tf.range(v5) // ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> None:
v2 = 'closed' if v1 else 'opened'
self.logger.debug(f"transport connection to '{self._base_transport_args.host}' on port '{self._... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
(v2, v3) = self.__get_dataset_items(v1)
if self.augmen... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.test_driver.start_hh_server()
self.test_driver.check_cmd_and_json_cmd(['File "{root}foo_3.php", line 11, characters 13-13: h', '1 total results'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float, float
Output Type: bool
Dependencies:
```python
def v0(v1: float, v2: float, v3: float) -> tuple[float, float, float] | None:
v4 = [v1, v2, v3]
v4.sort()
if v4[0] + v4[1] > v4[2]:
return (v4[0], v4[1], v4[2])
retu... |
Imports:
```python
import rasterio
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str):
with rasterio.open(v1) as v3:
v4 = v3.profile.copy()
v4.update(compress='deflate', predictor=3, zlevel=6, tile... |
Imports:
```python
import typing
```
Type definitions:
Input Types: io.TextIOWrapper
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: io.TextIOWrapper):
v1.writelines([f'lang {self.lang}\n', f'type {self.node_type}\n', f'root {self.root}\n'])
for v2 in self.priorities():
... |
Imports:
```python
from PIL import Image, ImageChops, ImageColor, ImageEnhance
import typing
```
Type definitions:
Input Types: Path
Output Type: (object, int, int, object)
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path) -> (object, int, int, object):
v2 = Image.open(v1, 'r')
(v3, v... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v1 = re.sub('(.)([A-Z][a-z]+)', '\\1_\\2', v1)
v1 = re.sub('([a-z0-9])([A-Z])', '\\1_\\2', v1).lower()
if v1[0] == '_':
ret... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3=None, v4=None) -> None:
for (v5, v6) in v2.items():
if v5.startswith('_'):
continue
v2[v5] = self.render_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'site_models.SiteUser', 'types.User', 'ClientProxy'
Output Type: Optional['tg_models.TelegramAccount']
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'site_models.SiteUser', v2: 'types.User', v3: 'ClientProxy') -> Optional['tg_m... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = t.Callable[[], None]
```
Input Types: int, v0
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: int, v3: v0):
v4 = self._callbacks[v2]
if v3 not in v4:
v4.append(v3)
else:
raise ValueEr... |
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_api_url(f'groups/{v1}/conversations')
v3 = {'$select': 'id'}
v4 = self._get_response_value_unsafe(self._make_request(v2, params... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str]=None):
if v1 is None:
v2 = f'{self.config}/domain/{self.domain}/job/taskstatuses'
else:
v2 = f'{self.config}/domain/{s... |
Imports:
```python
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import os
import typing
```
Type definitions:
Input Types: dict, Any, str, Any
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
v2 = client.upload_from_path(v1)['link']
return v2
```
Function Name: v3
Func... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], int, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: int, v3: str) -> str:
v4 = v2 + 1
while v4 < len(v1):
if not self.is_subword_prefix(v1[v4]) or self.is_punctuatio... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2=None, v3: str=None, v4=True):
if v3 is None:
v3 = 'default'
v1 = str(v1)
v1 = self.format(v1, v3)
if v4:
v1 = ... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
if not os.path.isdir(self._music_dir):
raise FileNotFoundError(f'Music Directory {self._music_dir} does not exist')
if self._... |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.List[t.ITemplate], str, str, str
Output Type: t.Optional[t.ITemplate]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: t.List[t.ITemplate], v2: str=None, v3: str=None, v4: str=None) -> t.Optional[t.ITemplate]:
for v5 in v1:
... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
```python
v0 = Union[Path, str]
```
Input Types: v0
Output Type: List[str]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0) -> List[str]:
with Path(v2).open() as v3:
return list((line.strip() for v4 in v3.read... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: PlatformApiEndpoints, v2: aiohttp.ClientSession, v3: _User) -> None:
self._platform_api = v1
self._client = v2
self._user = v3
@property
def v4(self) -> _User:
return self._use... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: str
v2: str
```
Input Types: str
Output Type: Sequence[str]
Dependencies:
```python
def v3(v4: str) -> Iterable[v0]:
v5 = Repo(v4)
for v6 in v5.head.commit.diff():
yield v0(change_type=v6.change_type, file... |
Imports:
```python
import logging
import os
import torch
import torch.nn as nn
import torch.optim as optim
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
(v2, v3) = os.path.split(v1)
if not os.path.exist... |
Imports:
```python
from collections import Counter
from collections import deque
import typing
```
Type definitions:
Input Types: list
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> tuple:
v2 = []
if len(v1) != len(set(v1)):
v3 = Counter(v1)
v2 = [x ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = NewType('GitHubNumber', int)
```
Input Types: 'Repository', v0
Output Type: 'PullRequest'
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: 'Repository', v3: v0) -> 'PullRequest':
for v4 in self.pull_requests.values():
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
for v2 in self._childs(v1):
self._remove(v2.id)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
v1 = vars(self.parsed_arguments)
v2: List[str] = self.__remove_non_plugin_arguments(v1)
return [argument for v3 in v2 if self.__is_plug... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, Any, Any
Output Type: Tuple[bool, Optional[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor, *, v3=1e-05, v4=1e-05) -> Tuple[bool, Optional[str]]:
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ddata.Multiple_sessions_data, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: ddata.Multiple_sessions_data, v2: str) -> bool:
if v2 == 'nanoG':
if input('Print out raw conscious memory?') in ('Y', 'y',... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int=1000, v3: bool=False) -> str:
if self.db_engine_spec.allow_limit_clause:
return self.db_engine_spec.apply_limit_to_sql(v1, v... |
Imports:
```python
from h5py import File, Group
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._file = File(self.path, 'r')
v1 = 2
v2 = []
while f'Log_{v1}' in self._file:
v2.append(self._file[f... |
Imports:
```python
import subprocess
import re
import typing
```
Type definitions:
Input Types: str
Output Type: T.Optional[str]
Dependencies:
```python
def v0(v1: str, v2: str) -> T.Optional[str]:
if is_cygwin() or is_osx():
raise unittest.SkipTest('Test only applicable to ELF platforms')
try:
... |
Imports:
```python
import json
import typing
```
Type definitions:
```python
v0 = Union[Literal['workflow'], Literal['bidsapp']]
```
Input Types: Path, v0
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Path, v3: v0):
if v2.exists():
with v2.open('r') as v4:
v5 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, 'FullStacker.Builder', pipeline.Segment, node.Worker, node.Worker
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: 'FullStacker.Builder', v3: pipeline.Segment, v4: node.Worker, v5: node.Worker) -> N... |
Imports:
```python
import torch
from torch import nn
from torch import Tensor
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> Tensor:
v2 = self.combine_output(self.source_mod... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self._cache:
v1: Dict['ProviderT', Mapping[str, object]] = {}
for v2 in self._providers:
v3 = v2.gen_cache
... |
Imports:
```python
from datetime import datetime, timezone
import typing
```
Type definitions:
Input Types: str, datetime
Output Type: bool
Dependencies:
```python
def v0(v1: str, v2: int) -> bool:
if v1 == '*':
return True
if '/' in v1:
(v3, v4) = v1.split('/')
return v2 % int(v4) == 0... |
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=''):
v3 = self.core().connection
v4 = next(self._results)
v3.send_vip(v2, 'query', args=[v1], msg_id=v4.ident)
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str | None
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str | None=None) -> None:
if v3 is None:
self._put_to_send_queue(f'KICK {v1} {v2}')
else:
self._put_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str=None, v3: str=None, v4: str=None, v5: int=None):
v1 = self._prepare(v1, v3, v4, v5)
return self._pubsub.publish(v1, v2)... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
with self.assertRaises(KeyError):
self.test_holder.non_existent = 1
with self.assertRaises(AttributeError):
self.test_holder._SCHEMA ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(XformSequence):
def v1(cls, v2: Hashable, v3: int):
"""«pre» constructor
:raises: TypeError
"""
if not isinstance(v3, int):
raise TypeError("not integer type: '{}'".format(type(v3).__name__))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> List[str]:
v2 = '\n SELECT id FROM matrices\n WHERE type=?;\n '
return [item['id'] for v3 in self._connection.execute... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> int:
if v1 > 100000 or v1 < 1 or v2 > 1000000000 or (v2 < 1):
raise ValueError
v3 = 0
while v2 >= v1:
v2 -= v1... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: str) -> None:
v1 = v1 & ~np.isnan(self.x)
self.flags[v1] = v2
self.flagged.append(v2)
self.x[v1]... |
Imports:
```python
from numbers import Real
import typing
```
Type definitions:
Input Types: Real, Real
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Real, v2: Real) -> None:
if not isinstance(v1, Real):
raise ValueError('start should be a single number')
if not isin... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, TextIO, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: TextIO, v3: int=0):
v4 = ' '
print(f'{v3 * v4}{v1}', file=v2)
``` |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, int, Optional[int]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Tensor, v2: int=0, v3: Optional[int]=None):
v4 = tf.shape(v1)
if v3 is None:
v3 = len(v4)
v5 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: arm.props_renderpath.ArmRPListItem, str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: arm.props_renderpath.ArmRPListItem, v2: str) -> int:
if v2 == 'point':
return 6
elif v2 == 'spot':
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
try:
v2 = v1['k']
except KeyError:
raise ValueError('Tag without name/key.')
self._curr['tags'][v2] = v1.get('v')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: int=2):
v3 = f'{v1:.{v2}f}'
if '.' in v3:
v3 = v3.rstrip('0').rstrip('.')
return v3
``` |
Imports:
```python
import numpy as np
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.data.Dataset, np.ndarray, np.ndarray, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.data.Dataset, v2: np.ndarray, v3: np.ndarray, v4: bool=False):
v5 = v3.max... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> Dict:
if v2 in v1:
return v1[v2]
return dict()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> bool:
v1 = self.__class__
v2: 'NamedTuple' = v1._sessions_limit_details
v3 = True
if self.in_dms:
v4 = v1.get_all_dm_sessions()
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if not os.path.exists(v1):
os.makedirs(v1)
for v2 in self._converters:
v2.save_csv(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1: list[Contract] = []
for v2 in self.contracts:
if not v2.is_eligible(self._current_state, self.tail.get_stored_value()):
conti... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: int, str, str
Output Type: (str, str)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: str, v3: str) -> (str, str):
v2 = v2.split('/')
v4 = v2[-1].split('.')[0]
v3 = os.path.join(v3, *v2[v1:-1], v4)
os... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
```python
def v0(v1: int) -> str:
if v1 == 0:
return '0'
if v1 < 0:
return f'-{v0(-v1)}'
v2 = []
while v1:
v2.append(v1 % 12)
v1 //= 12
return ''.join(map(lambda x... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Tuple[int]
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple[int]) -> np.ndarray:
v2 = np.full(v1, True)
for v3 in range(v2.shape[0]):
v2[v3, :v2.shape[0] - v3] = False
... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: str
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str) -> bytes:
v2 = asyncio.open_connection(self.ip, self.port)
(v3, v4) = await asyncio.wait_for(v2, timeout=10)
v4.write(v1... |
Imports:
```python
import math
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: 'TSDataset', Optional['TSDataset'], Optional['TSDataset'], Optional[List[str]], Optional[int], int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python... |
Imports:
```python
import typing
```
Type definitions:
Input Types: rng.Range, list, int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: rng.Range, v2: list, v3: int) -> bool:
v4 = v1.get_time()[1] - v1.get_time()[0] + 1
for v5 in v2:
v6 = self._overlapped_len(v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Generator[Optional[float], float, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Generator[Optional[float], float, None]:
v1 = 0
v2 = (yield)
while True:
v2 = (yield self.amplitude_envelope... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if self.byr == '':
return False
if not 1920 <= int(self.byr) <= 2002:
return False
if self.iyr == '':
return Fa... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Any], v2: str) -> None:
v3 = {}
v4 = self.empty_counter[v2]
v5 = self.format_error_counter[v2]
if v4 > 0:
v3[... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.INTERFACE = os.environ.get('SINO_SCOM_TEST_INTERFACE', self.INTERFACE)
self.BAUDRATE = os.environ.get('SINO_SCOM_TEST_BAUDRATE', self.... |
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:
v2 = {'viewers': [viewer.to_json() for v3 in self.store.values()], 'response_cache': self.response_cache.to_json()}
with open... |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types: List
Output Type: NamedTuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List) -> NamedTuple:
v2 = argparse.ArgumentParser()
v2.add_argument('--files_path', dest='files_path', type=str, help='Path to files c... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Dict[str, Union[str, sp.Basic]]
```
Input Types: List[v0]
Output Type: Set[sp.Symbol]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: List[v0]) -> Set[sp.Symbol]:
v3 = set()
for v4 in v2:
v3 |= v4['state_expr'].free_sy... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool, dict, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool=False, v3: dict=None, v4: list=None):
v5 = {'name': v1[:59], 'private': v2, 'custom_data': v3 or {}, 'user_ids': v4 or []}
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: torch.Tensor=None):
v3 = self.compute_previous_state_column_all_groups(v1)
v4 = None
v4 = self.compute_result_and_split_into_pairs... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.unixtime < 100000:
return f'Timestamp({self.unixtime})'
return self._localized_time().strftime('%Y-%m-%d %H:%M:%S %Z%z')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, dict, Optional[list]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any, v2: dict, v3: Optional[list]=None) -> None:
assert len(v1) == len(v2), '{}/{}'.format(len(v1), len(v2))
for (v4, v5) in enum... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if not self.armor:
raise AttributeError('"self.armor" was not instantiated')
if isinstance(v1, str):
self.armor = v1
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.