text stringlengths 190 325k |
|---|
Imports:
```python
import os
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = os.path.join(v1, 'discriminator.pt')
if os.path.exists(v2) and self.discriminator:
self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int, v3: int) -> str:
v1 = list(v1)
for v4 in range(v2, v3 + 1):
if v1[v4] == '#':
v1[v4] = '&'
elif v1[v4] == ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: TextIO, str
Output Type: None
Dependencies:
```python
def v0(v1: Iterable[float], v2='{:.6g}') -> Iterable[str]:
yield from map(v2.format, v1)
```
Function Name: v3
Function:
```python
def v3(self, v4: TextIO, v5: str) -> None:
print(v5, 'geom... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Operation):
v1: str = '/agreement/admin/localized-policy-versions/versions/{policyVersionId}'
v2: str = 'POST'
v3: List[str] = ['application/json']
v4: List[str] = ['application/json']
v5: List[List[str]] = [['BEARER_AUTH'], [... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
```python
def v0(v1: Any) -> bool:
assert isinstance(v1, bool)
return v1
```
```python
def v2(v3: Any) -> int:
assert isinstance(v3, int) and (not isinstance(v3, bool))
return v3
```
```python
def v4(v5... |
Imports:
```python
import textwrap
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 textwrap.wrap(v1, self.width - 2, break_long_words=False, break_on_hyphens=False):
self.output.write('# ' +... |
Imports:
```python
import re
from functools import partial
import typing
```
Type definitions:
Input Types: Path, str, Mapping[int, str]
Output Type: Sequence[Tuple[str, Union[str, Callable[[Match[str]], str]]]]
Dependencies:
```python
def v0(v1: Match[str], v2: Mapping[int, str]) -> str:
return str(v2[int(v1.grou... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.backend.erase()
self.reset()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> str:
v2 = [self.to_string(v1)]
for v3 in self._children:
v2.append(v3.dump(v1 + 1))
return ''.join(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1) -> None:
(*v2, v3) = v1
self._net.train_on_batch(v2, v3)
``` |
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: str = v1.replace('派籌時間:', '<br/><b>派籌時間:</b><br/>')
v1: str = v1.replace('產品資料:', '<br/><b>產品資料:</b><br/>')
v1: str = v1.replac... |
Imports:
```python
import numpy as np
from scipy import sparse as sp
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1):
self.product_idx = {}
self.product_pid = {}
for (v2, v3) in enumerate(pd.read_csv(v1).product_id.values):
self.product_idx[v3] = v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: str):
self._payment['amount'] = v1
self._payment['currency'] = v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.ticket_obj.ticket_name = None
self._assert_validation_error(self.ticket_obj, 'No ticket name supplied.')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> float:
try:
return 42 / v1
except ZeroDivisionError:
print('Error: Invalid argument.')
``` |
Imports:
```python
from PIL import Image, ImageDraw, ImageFont
import os
import typing
```
Type definitions:
Input Types: [str, int], str, str
Output Type: Image
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: [str, int], v2: str='./file/SuperMario256.ttf', v3: str='./file/cup_icon') -> Image:
if o... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: bytes
Dependencies:
```python
def v0(v1: bytes) -> bool:
return isinstance(v1, bytes) and len(v1) == 32
```
```python
def v2(v3: bytes) -> bytes:
if not v0(v3):
raise ValueError('private_key_bin format mismatch. mayb... |
Imports:
```python
from typing import Any, Callable, Dict, Iterator, List, Mapping, Optional, Sequence
import typing
```
Type definitions:
Input Types: List
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List) -> Any:
v2 = v1[0]
if isinstance(v2, Mapping):
v3 = v2.keys... |
Imports:
```python
import torch
from torch import nn
import typing
```
Type definitions:
Input Types: List[torch.Tensor], np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[torch.Tensor], v2: np.ndarray):
v3 = 0
v4 = torch.from_numpy(v2).to(torch.get_default_dtype(... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Any
Output Type: (int, str)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> (int, str):
v2 = v1['price']
v3 = re.search('([0-9]+\\.*[0-9]*)', v2)
v4 = None
if v3:
v4 = float(v3.group(1))
return ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for v1 in self._metrics_dict:
self._metrics_dict[v1].reset()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: tfds.download.DownloadManager
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tfds.download.DownloadManager):
v2 = v1.download_and_extract('https://storage.googleapis.com/ai4b-anuvaad-nmt/baselines/mT5/baseli... |
Imports:
```python
from datetime import datetime, timedelta
import typing
```
Type definitions:
Input Types: v1
Output Type: List[Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: v1) -> List[Dict]:
self.logger.info('Getting transactions...')
return list(self.cryptopunks_transactions.... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: chess.Move
Dependencies:
```python
def v0(v1: ChessEnv) -> str:
v2 = v1.board.fen().rsplit(' ', 1)
return v2[0]
```
Function Name: v3
Function:
```python
def v3(self, v4, v5) -> chess.Move:
v6 = v0(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: Path
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> Path:
v2 = v1.parent.parent.parent.resolve()
assert v2.exists(), 'Is this test within osparc-deployment-agent repo?'
assert any(v2.glob('osparc-deploy... |
Imports:
```python
import typing
```
Type definitions:
```python
v0: TypeAlias = subprocess.CompletedProcess
```
Input Types: Any, int
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2, v3: int) -> v0:
if v3:
self.message_job('Started', v2.input, v3)
v4: list[str] = []... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1) -> np.ndarray:
if not self.allow_early_resets and (not self.needs_reset):
raise RuntimeError('Tried to reset an environment before done. If yo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Set[Hashable]
Output Type: Set[Hashable]
Dependencies:
```python
def v0(v1: psycopg2.extensions.cursor) -> None:
v1.execute(q)
```
```python
def v2() -> Iterator:
for v3 in keys:
yield self._py_to_bin(v3)
```
```python
def v4(self) -> ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict):
v2: bool = False
for v3 in v1['spec']['tags']:
if v3['name'] != 'latest':
continue
if v3['from']['name'] == self.ver... |
Imports:
```python
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity, euclidean_distances
from sklearn.metrics.cluster import silhouette_score, calinski_harabasz_score
import typing
```
Type definitions:
Input Types: np.array
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python... |
Imports:
```python
from collections import deque
from collections import namedtuple
from itertools import islice
import typing
```
Type definitions:
Input Types: Iterable[Any], int, int, Optional[Any]
Output Type: Iterator[Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[Any], v2: int=1000... |
Imports:
```python
import os
import re
import typing
```
Type definitions:
Input Types:
Output Type: (int, int, int)
Dependencies:
```python
def v0(v1, v2) -> int:
with open(os.path.join(sys_devices_system_cpu_path, v1, v2)) as v3:
return int(v3.read())
```
Function Name: v4
Function:
```python
def v4() -... |
Imports:
```python
import sympy
import numpy as np
import typing
```
Type definitions:
Input Types: str, Any
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2=False) -> float:
if v1 != '':
if v2:
assert '<' not in v1 and '>' not in v1, 'Cannot bring into... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, *, v1: Optional[s_schema.Schema]=None, v2: Optional[Mapping[Optional[str], str]]=None, v3: AbstractSet[str]=frozenset(), v4: bool=False, v5: bool=False, v6: bool=False, v7: bool=False, v8: bool=False, v9: bool=False, v10:... |
Imports:
```python
from multiprocessing import Pool
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
```python
v1 = TypeVar('U')
```
Input Types: Callable[[v0], v1], Sequence[v0], int
Output Type: Sequence[v1]
Dependencies:
Function Name: v2
Function:
```python
def v2(v3: Callable[[v0], v1], v4: Seq... |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: str, str, np.dtype
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
from ..coding.cftimeindex import CFTimeIndex
v3 = CFTimeIndex(v1.ravel())
if v2 == 'season':
v4 = v3.month
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=0):
v2 = ''
if v1 == 0:
v3 = self.planilha.keys()
for v4 in v3:
v2 += v4 + ' '
elif v1 > 0:
for v5 in self... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.re.search('/vol(\\d+)/ch(\\d+)', self.chapter).groups()
return '{}-{}'.format(v1[0], v1[1])
``` |
Imports:
```python
import uuid
import typing
```
Type definitions:
```python
class v0(asyncio.Transport):
v1: Union[str, int]
v2: bool
```
Input Types: v0
Output Type: Any
Dependencies:
Function Name: v3
Function:
```python
def v3(self, v4: v0):
if v4.is_closing():
if hasattr(v4, 'user_id'):
... |
Imports:
```python
import pandas
from pandas.testing import assert_frame_equal
from pandas.io.json import json_normalize
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any
Output Type: pandas.DataFrame
Dependencies:
```python
def v0(v1):
return v1.sum()
```
```python
def v2(v3):
return v3.sum(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, list
Output Type: bool
Dependencies:
```python
def v0(v1: list):
v2 = {}
for v3 in v1:
if v3 not in v2:
v2[v3] = 1
else:
v2[v3] += 1
return v2
```
Function Name: v4
Function:
```python
def v4(v... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float, float, int, float
Output Type: np.ndarray
Dependencies:
```python
def v0(v1, v2=np.exp(1)):
return np.log(v1) / np.log(v2)
```
Function Name: v3
Function:
```python
def v3(v4: float, v5: float, v6: int=1, v7: float=np.exp... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Dict[str, str]:
v2 = v1.split('?')
if len(v2) < 2:
return {}
if len(v2) > 2:
raise ValueError("Malformed topic: too man... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[Text, Any], Text, Optional[Text], 'DialogueStateTracker'
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[Text, Any], v2: Text, v3: Optional[Text], v4: 'DialogueStateTracker') -> bool:
v5 = v2 == v1... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: torch.tensor
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.tensor) -> tuple:
v2 = v1.reshape((-1, 4, self._units))
(v3, v4, v5,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str='') -> None:
v2 = 'https://webapi-os.account.mihoyo.com/Api/cookie_accountinfo_by_loginticket'
async with self.session.get(v2, params=dict(lo... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
assert self.current_drill
v1 = self.get_next_prompt()
assert v1
return self.current_drill.prompts[-1].slug == v1.slug
``` |
Imports:
```python
import textwrap
import typing
```
Type definitions:
Input Types: tfds.core.DatasetBuilder
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tfds.core.DatasetBuilder) -> str:
v2 = self.get_url(v1)
v3 = 'displaydataframe'
v4 = 'dataframecontent'
v5 ... |
Imports:
```python
import numpy as np
from scipy.interpolate import interp1d
import typing
```
Type definitions:
Input Types: np.ndarray, bool, xarray.Dataset
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray, v2: bool) -> np.ndarray:
v3 = 1.64e-06 if v2 else 2.16e-06
return v3 * (v1 / 1000... |
Imports:
```python
import os
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str, v2: SearchPaths, v3: str, v4: BuildSourceSet, v5: 'Optional[Reports]', v6: Options, v7: str, v8: Plugin, v9: Dict[str, str], v10: Errors, v11: Callable[[List[str], bool], None], v12: FileSystemCache, v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: typing.NoReturn
Dependencies:
Function Name: v0
Function:
```python
def v0() -> typing.NoReturn:
v1 = int(input())
v2 = 1
v3 = 0
while v2 <= v1:
v4 = v1 // v2
v5 = v1 // v4 + 1
v3 += v4 * (v5 - v2... |
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 == 'PENDING':
return 0
if v1 == 'RUNNING':
return 1
if v1 == 'TERMINATING':
return 2
if v1 == 'TERMINATED':... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> dict:
v2 = {}
for v3 in v1.split(';'):
v4 = re.search('(.*?)=["\']?(.*?)["\']?$', v3)
v5 = v4.group(1).strip()
v6 =... |
Imports:
```python
import torch
import typing
```
Type definitions:
```python
class v0:
v1 = Union[List[int], Tuple[int, int]]
def __init__(self, v2: torch.Tensor):
"""
Args:
tensor (Tensor[float]): a Nx4 matrix. Each row is (x1, y1, x2, y2).
"""
v3 = v2.device if i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict=None):
v3 = self.get(v1, v2)
return v3.content.decode()
``` |
Imports:
```python
from warnings import catch_warnings, simplefilter, warn
import numpy as np
from pandas._libs import Timestamp, algos, hashtable as htable, iNaT, lib
from pandas._typing import AnyArrayLike, ArrayLike, DtypeObj
from pandas.util._decorators import doc
from pandas.core.dtypes.cast import construct_1d_ob... |
Imports:
```python
import numpy as np
from PIL import Image, ImageFilter
import typing
```
Type definitions:
Input Types: Image.Image, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Image.Image, v2: int):
v3 = min(v1.size) * v2
print('Running with window size ' + str... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Response
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Response) -> Dict:
try:
return v1.json()
except ValueError:
return {}
``` |
Imports:
```python
import glob
import typing
```
Type definitions:
Input Types: str, str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> dict:
v3 = {'success': 0, 'fail': 0, 'skip': 0}
if v2 == 'xml':
v4 = self.reader.read_xml_file(v1)
v5... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
v1 = v1.strip().lower()
if v1 is None or v1 == '':
raise ValueError('API Endpoint cannot be null')
if not isinstance(v1, str)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: dict, v3: bool):
v4 = await self.get_operation_object(v1, v2)
v5 = await v4.event_logs(file_svc=self._file_svc, data_svc=self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[int]]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[List[int]]) -> bool:
v2 = len(v1)
v3 = list(range(1, v2 + 1))
for v4 in range(v2):
if sorted(v1[v4]) != v3:
re... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[Capture, NumpyArrayLike]
```
```python
@dataclass
class v1(Filtering):
v2: FilterConfig
v3: FilterPlugin
def __call__(self, *v4, **v5) -> bool:
return self.plugin(*v4, **v5)
def v6(self, *v7, **v8) -> bool:
ret... |
Imports:
```python
from random import randrange
import typing
```
Type definitions:
```python
class v0:
def __init__(self):
self.hand = []
def v1(self):
pass
def v2(self):
pass
def v3(self):
self.turn()
self.turn()
def v4(self) -> bool:
for v5 in ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path, str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path, v2: str, v3: str, v4: str=None):
v2 = '_' + v2.replace('_', '-') if v2 else ''
return v1 / f'{self._dataset_label(sub_name=v4)}{v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=None) -> str:
v2 = ''
for (v3, v4) in self.__dict__.items():
if 'password' in 'key':
if v4 is not None:
v4 = 'passwor... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, requests.Response
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool, v2: requests.Response) -> None:
if v1:
if v2.headers.get('Access-Control-Allow-Credentials', 'false') == 'true':
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list[int]
Output Type: list[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list[int]) -> list[int]:
v2 = 0
v3 = set()
while v2 < len(v1):
v4 = v1[v2] - 1
if v1[v2] == v1[v4]:
if v1[v2] != v... |
Imports:
```python
import hashlib
from random import randint
from datetime import datetime
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
```python
def v0() -> str:
return hashlib.md5(str(randint(1, 1000)).encode()).hexdigest()
```
```python
def v1():
return DELIMITER.join(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int, v3: int) -> None:
assert v1 in self._known_mem
self._known_mem[v1].touch_range(v2, v3)
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: sqlite3.Connection, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: sqlite3.Connection, v2: str):
with v1:
v3 = "SELECT pt3, scope FROM iso639 WHERE pt3 != '' ORDER BY pt3"
v4 = {row... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray, **v3) -> np.ndarray:
(v4, v5) = self._apply_preprocessing(v1, y=None, fit=False)
if not hasattr(se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
self.instanceData = v1
return self
``` |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: nx.Graph, pd.Series
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: nx.Graph, v2: pd.Series):
v3 = np.array(v1.edges)
v4 = pd.DataFrame({'source': v3[:, 0], 'source_label'... |
Imports:
```python
import itertools
import typing
```
Type definitions:
Input Types: str, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2) -> str:
for v3 in itertools.chain(v2['sprite']['lists'], v2['stage']['lists']):
if v3['name'] == v1:
return v3[... |
Imports:
```python
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: Union[plt.Axes, None]
Output Type: Tuple[Union[plt.Figure, None], plt.Axes, bool]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[plt.Axes, None]) -> Tuple[Union[plt.Figure, None], plt.Axes, bool]:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
return v1.replace('\n', ' ').strip()
```
Function Name: v2
Function:
```python
def v2(v3: List[str]) -> str:
v4 = [v0(text) for v5 in v3]
return '\n'.join(v4)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.backend_handler.get_help_data()
print(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Union[dict, list]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, *v2, v1: str=None) -> Union[dict, list]:
assert v1 is not None
v3 = await self.call(payload={'method': v1, 'params': v2, 'jsonrpc': '2.0... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
```python
def v0(v1, v2, v3, v4, v5) -> int:
if len(v2) == len(v1):
return v4 + v1[v2[-1]][v5]
v6 = 99999999999999
for v7 in v1:
if v3.get(v7, False):
continue
v8 = v2[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> dict:
v2 = {}
for (v3, v4) in enumerate(v1):
v2.setdefault(v4, [])
v2[v4].append(v3)
return v2
``` |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
v1 = argparse.ArgumentParser()
v1.add_argument('yaml_file')
v1.add_argument('--video', required=True, type=int)
v2 = v1.parse_arg... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, dict
Output Type: Any
Dependencies:
```python
def v0(v1, v2, v3: dict):
v4 = v3['Option']
v5 = v4.objects.create(body=v1['body'], question=v2)
v5.save()
if v1['continuation_questionnaire'] is not None:
v6 = v1['contin... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = super().generate_header()
if self.function.name == 'exit':
v1 += '\n__print_instruction_count();'
return v1
``` |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset
from torch.optim.optimizer import Optimizer
import typing
```
Type definitions:
Input Types: Dataset
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, ... |
Imports:
```python
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any
Output Type: None
Dependencies:
Function Name: v... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> str:
if not v1:
logging.debug('No latlng to reverse geocode')
return 'Unknown'
v2 = self.client.reverse_geocode(v1, re... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = f'https://u.icq.net/files/api/v1.1/info/%s?aimsid={self.token}'
v3 = requests.get(v2 % v1)
v4 = v3.json()
v5 = v4['re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> str:
if v1 < 1024:
return f'{v1:.0f} B/s'
elif v1 < 1048576:
return f'{v1 / 1024:.1f} KB/s'
else:
return f'{v1 / 1048576:.... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> None:
v2 = tf.keras.datasets.cifar10 if v1 == 10 else tf.keras.datasets.cifar100
((v3, v3), (v3, v3)) = v2.load_data()
``` |
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 v1 not in self._stored.enabled_plugins:
self._stored.enabled_plugins.append(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: int) -> int:
v3 = 0
v4 = len(v1)
v5 = (v4 + v3) // 2
while v3 < v4:
v5 = (v4 + v3) // 2
if v1[v5] == v2:
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> bool:
(v3, v4) = (len(v1), len(v2))
(v5, v6) = (0, 0)
while v5 >= 0 or v6 >= 0:
while v5 >= 0:
if v1[v3] ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.disconnect_all_signals()
del self.queue
del self.elapsed_store
del self.current_entry
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: BatchResults) -> None:
assert [TweetId('1115690002233556993'), TweetId('1115690615612825601'), TweetId('1115691710657499137')] == list(v1.tweet_ids(v1[0]))
```
```python
def v2(v3: BatchResults... |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: dd.DataFrame, int, int
Output Type: Tuple[pd.DataFrame, Dict[str, int]]
Dependencies:
```python
def v0(v1: dd.DataFrame, v2: str, v3: int, v4: bool=True) -> Tuple[dd.DataFrame, Dict[str, int], List[str]]:
v5:... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Model):
v1: str
v2: str
v3: str
v4: str
v5: str
v6: bool
v7: int
v8: int
v9: int
v10: str
v11: str
v12: int
v13: int
v14: int
v15: int
v16: int
v17: CurrencySummary
v18: str
... |
Imports:
```python
import io
import json
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any]) -> Dict[str, Any]:
v2 = {}
for (v3, v4) in v1.items():
if isinstance(v4, list):
... |
Imports:
```python
import math
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, float
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: float=0.01) -> np.ndarray:
v3 = []
v4 = 0
v5 = v1[-1, 0] - v1[0, 0]
v3.append(v4)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any
Output Type: Tuple[float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3, v4) -> Tuple[float, float]:
v1.update_now_len_before_sample()
v5 = v6 = None
for v7 in range(int(v2 * v4)):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.