text stringlengths 190 325k |
|---|
Imports:
```python
import matplotlib.pyplot as plt
import os
from os.path import dirname, join
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
plt.savefig(join(self.tempdir, 'img (' + str(self.i) + ').png'))
self.i +... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Optional[Path], Path
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: Optional[Path]) -> str:
v1 = os.path.expandvars(v1)
if v2 is None or os.path.isabs(v1):
return v1
return str(v2 / v1)
```
Function Name: v... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types: str, bool, bool
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: str) -> str:
v3 = '\x1b['
v4 = '\x1b[0m'
assert v2 in _COLOR_MAP
v5 = _COLOR_MAP[v2]
v6 = f'{v3}{v5}m{v1}{v4}'
return v6
```
Function Name... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if v1[0] == '#':
v1 = v1[1:]
if len(v1) == 3:
v2 = int(v1[0], 16) / 15.0
v3 = int(v1[1], 16) / 15.0
v4 = int(v1[2], 16) ... |
Imports:
```python
from base64 import b64encode
from hashlib import sha256
import typing
```
Type definitions:
Input Types: str, bytes
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: bytes):
v3 = sha256()
v3.update(v2)
v3.update(v1.encode('utf-8'))
return sha256(v3.digest()).digest()
```
F... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: List[Dict[str, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int) -> List[Dict[str, Any]]:
v3 = self.internal_provider.get_transactions_to_address(v1, v2)
return [{'input': transacti... |
Imports:
```python
import math
import os
from sklearn.externals import joblib
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split, KFold
from sklearn import ensemble
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Any
Dependencies:
```python
de... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict):
v2 = v1['split']
v3 = v2['name']
return sms.__getattribute__(v3)(**v2['params'])
``` |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: str, int
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int) -> list:
v3 = [i for v4 in range(v2)]
if v1 == 'random_array':
return [random.randint(1, 10000) for v5 in range(v2)]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, bool
Output Type: NoReturn
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: bool) -> NoReturn:
if v2 is False:
self.update_bg_color(self, self.md_bg_color)
return
if self.md_bg_color_disabled:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: discord.Member, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: discord.Member, v2=False, v3=None):
if v3 and v1.guild_permissions >= v3:
return True
if v2 and await self.bot.is_mod... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[sqlite3.Connection, ConnectionPlus]
```
Input Types: v0, str
Output Type: sqlite3.Cursor
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0, v3: str, *v4: Any) -> sqlite3.Cursor:
v5 = v2.cursor()
if len(v4) > 0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float):
if v1 == 0:
return (0, 0)
v2 = format(v1, '.2e')
if abs(v1) < 1:
v2 = v2.split('e')
else:
v2 = v2.split('e+')
tr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List, List, str
Output Type: List
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List, v2: List, v3: str='iwslt') -> List:
v4: List = []
for (v5, (v6, v7)) in enumerate(zip(v1, v2)):
v8: Dict = {'input': [], 'output': ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
self.strl = v1
self.answer = 0
self.dfs(0)
return self.answer - 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> tuple:
if v1 in self.__banco:
if v2 == self.__banco[v1]['senha']:
return (True, 'Logado!')
return (False, 'Senha E... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(tornado.websocket.WebSocketHandler, SessionObserver):
v1 = 0
v2: instance_manager.MusicBox
v3 = None
def v4(self, v5):
return True
def v6(self, v7):
self._instance = None
self._sc = v7
def v8(sel... |
Imports:
```python
import re
import subprocess
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 = subprocess.Popen([v1, '--help=warnings'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.bucket:
self.bucket.objects.all().delete()
self.bucket.delete()
``` |
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.time_left()
if v2 > 0:
v3 = 'Q' if self.alarms else 'S'
v1 = f'{v1[:13]} {v3}:{v2:.0f}s'
v1 = f'{v1:<20}'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> str:
v1.sort()
v2 = ''
if len(v1) == 0:
return v2
v3 = len(v1[0]) if len(v1[0]) < len(v1[-1]) else len(v1[-1])
f... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> Dict[str, Any]:
v2 = self._import_tool_response(v1)
assert v2.status_code == 200, v2
return v2.json()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self._editor_notebook and (not self._editor_notebook.check_allow_closing()):
return
self._closing = True
try:
self._save_layou... |
Imports:
```python
import os
import shutil
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if os.path.isdir(v1):
shutil.rmtree(v1)
shutil.move(self.data_dir, v1)
self.data_dir = v1
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
print()
print(f'### initrd image: sysd: deactivate')
v1 = self.host_sysd.command_terminate()
os.system(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, List[dict]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: List[dict]=None):
v3 = self.collection(v1)
return v3.insert_many(v2)
``` |
Imports:
```python
import asyncio
from functools import partial
import typing
```
Type definitions:
Input Types: Callable
Output Type: Awaitable
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Callable, *v2: Any, **v3: Any) -> Awaitable:
v4 = asyncio.get_event_loop()
v5 = partial(v1, *v2, **v3)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[int]
Output Type: AnyStr
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[int]=None) -> AnyStr:
with self._ensure_offset():
return self._file_object.readline(v1)
``` |
Imports:
```python
import requests
import pandas as pd
import typing
```
Type definitions:
Input Types: str, str
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str='11000257131', v2: str='最新跟踪成分股') -> pd.DataFrame:
v3 = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64;... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = ''
for (v2, v3) in self.actions:
v1 += f'Player{v2 + 1} played {v3}, '
return v1
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
```python
def v0(v1: dict) -> dict:
v2 = []
v3 = {'@id': 'measurement/1/', '@type': 'cao:CAO_000152', 'techniqueType': 'obo:CHMO_0000228', 'technique': 'obo:CHMO_0000656', 'instrumentType'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence, Sequence, bool, int
Output Type: Tuple[int, List]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Sequence, v2: Sequence, v3: bool=False, v4: int=0) -> Tuple[int, List]:
v5 = []
(v6, v7) = (0, 0)
v8 = 0
while ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Model):
v1: str
v2: List[AccountUserActiveBanResponseV4]
v3: str
v4: str
v5: str
v6: bool
v7: str
v8: str
v9: bool
v10: bool
v11: str
v12: str
v13: str
v14: str
v15: List[AccountUserPerm... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
v2 = self.resolution[0] / self.resolution[1]
v3 = v1 * v2
v4 = v1
self.setMinimumSize(v3, v4)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.doc.blocks
v2 = 0
while '*Paper_Space%d' % v2 in v1:
v2 += 1
return '*Paper_Space%d' % v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int=0) -> bool:
if v2 in self._overrides:
if v1 in self._overrides[v2]:
return True
if v1 in self._default_commands:
... |
Imports:
```python
import contextlib
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str):
return path_from_root(os.path.join(RESOURCES_LOCATION, v1))
```
```python
def v2(v3):
return os.path.normpath(os.path.join(os.path.dirname(__file__), ROO... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, list
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: list) -> None:
v3 = self.output_dir + '/' + v1 + '.json'
v4 = [comment.to_json_string() for v5 in v2]
with open(v3, 'w') as v6:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[Dict[str, int]], Optional[Sequence[Tuple[str, str]]], Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[Dict[str, int]]=None, v3: Optional[Sequence[Tuple[str, str]]]=(), v4=True... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], List[int]
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: List[int]) -> List[int]:
v3 = []
for (v4, v5) in zip(v2, v1):
v3.insert(v4, v5)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._registered_programs = dict()
self.__armed_program = None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: vs.VideoNode
Output Type: vs.FrameProps
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: vs.VideoNode) -> vs.FrameProps:
with v1.get_frame(0) as v2:
v3 = v2.props
return v3
``` |
Imports:
```python
import torch
from torch.utils.data import DataLoader, DistributedSampler
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
with torch.set_grad_enabled(self.is_train_loader):
for self.batch in sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for (v1, v2) in self.neighbors.items():
self.received_messages[v1] = v2.message(self.uid)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, any]
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, any]) -> list:
v2 = []
if 'ss' in v1:
v2.extend(['-ss', v1.pop('ss'), '-accurate_seek'])
if 't' in v1:
v2.extend(['-... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = 'sandbox / PR #6 sample_file: Add sample_file.txt.'
v2 = '[zura](http://139.59.64.214:7990/users/zura) marked [PR #6](http://139.59.64.214:7990/... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'jina_pb2.Document'
Output Type: Any
Dependencies:
```python
def v0(v1: 'jina_pb2.Document'):
v2 = GenericNdArray(v1.embedding).value
if v2 is not None:
return v2
elif v1.text or v1.buffer:
return v1.text or v1.buffer
e... |
Imports:
```python
import operator
from functools import reduce
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
```python
def v0(v1: str) -> int:
return reduce(operator.__or__, (f(v1) for v2 in RECOGNIZERS))
```
```python
def v3(v4: str) -> int:
v5 = [s.strip() for v6 in v4.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pl.Trainer, pl.LightningModule
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pl.Trainer, v2: pl.LightningModule):
v3 = v1.lr_schedulers[0]['scheduler']
v4 = {f'lr_group_{i}': lr for (v5, v6) in enumerat... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str, bot_longpoll.VkBotEvent
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str, v3: bot_longpoll.VkBotEvent) -> None:
v4 = 1
if self.bot.get_vk_client() == '':
self.bot.send_messa... |
Imports:
```python
import logging as log
import re
import typing
```
Type definitions:
Input Types: str, Set[str]
Output Type: str
Dependencies:
```python
def v0(v1: Match[str]) -> str:
v2 = v1.group(1).partition('.')[0].lower()
if v2 in rnames:
if v1.group(1)[-1] == '.':
return '<a href="#... |
Imports:
```python
import os
from datetime import datetime as dt
import typing
```
Type definitions:
Input Types: str, str, int, int
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2, v3: str='127.0.0.1', v4: int=7, v5: int=14):
while True:
if dt(dt.now().year, dt.now().month, dt.now().day, 7) < ... |
Imports:
```python
import collections
import csv
import typing
```
Type definitions:
Input Types: Dict[str, str], Path
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, str], v2: Path) -> None:
try:
v3 = collections.OrderedDict(sorted(v1.items()))
with open... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List, List
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List, v2: List):
v3 = {'``', "''", ':', ',', '.', 'PU', 'PU#b', 'PU#i', 'PU#m', 'PU#e', 'PU#s'}
v4 = 1 if v1[0][0].id == 0 else 0
(v5, v6) = (0, 0)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: Union[List[int], None]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: str) -> Union[List[int], None]:
v3 = 'SELECT message_id FROM boards WHERE guild_id = $1 AND type = $2 AND toggle = Tr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Config'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Config') -> None:
v2 = v1.flatten()
for (v3, v4) in v2.items():
self.__setitem__(v3, v4)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
self.listeners.append(v1)
self._add_new_entities([v1])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2: str, v3=-1):
v4 = []
for v5 in v1:
v6 = self._get_address_item_from_xmss(v5)
if v2:
v6 = self.encrypt_a... |
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 self._storage_reader is not None:
self._storage_reader.sync_from_storage(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: argparse.ArgumentParser
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: argparse.ArgumentParser):
v1.add_argument('-d', '--device', required=True, help='Serial device path')
v1.add_argument('-b', '--baudrate', ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int, str
Output Type: Any
Dependencies:
```python
def v0(v1, v2, v3, v4):
if v1 < v3:
v5 = str(v1) + '_' + str(v2)
v6 = str(v3) + '_' + str(v4)
elif v1 > v3:
v5 = str(v3) + '_' + str(v4)
v6 = str(v1) +... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, t.Optional[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: t.Optional[str]) -> None:
v3 = self.bot._connection._get_websocket(v1)
await v3.voice_state(str(v1), v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor, v3: torch.Tensor, **v4) -> torch.Tensor:
v5 = self.loss.disc_loss(v2, v1) + se... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Any, int, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: int, v3: bool):
v4 = self.cache_dataset_fold_get_full_path(dataset_id=v1, fold_number=v2, test_part=v3)
if v3:
v5 = sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
v2 = len(v1)
v3 = [signal.parameters['phonems'] for v4 in v1]
v5 = self.SilenceSampler.process(silences_number=v2 - 1)
(v6, v5, v7) = se... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor) -> torch.Tensor:
v2 = torch.arange(v1.shape[-1], device=v1.device).expand_as(v1)
return torch.empty_like(v1).scat... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> list:
v2 = []
for v3 in range(len(v1)):
v2.append(float(v1[v3]))
return v2
``` |
Imports:
```python
from operator import attrgetter
import typing
```
Type definitions:
Input Types:
Output Type: Iterable[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Iterable[str]:
yield f'format-version: {self.format_version}'
yield f'date: {self.date_formatted}'
if self.aut... |
Imports:
```python
from pathlib import Path
import shutil
import typing
```
Type definitions:
Input Types: str, Path
Output Type: None
Dependencies:
```python
def v0(v1: str) -> jinja2.Environment:
v2 = jinja2.FileSystemLoader(v1)
return jinja2.Environment(loader=v2, autoescape=jinja2.select_autoescape())
```
... |
Imports:
```python
import copy as cp
import typing
```
Type definitions:
Input Types:
Output Type: 'LabelNode'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1: Any) -> 'LabelNode':
v2 = cp.deepcopy(self)
v2.children = list()
v2.extras.update(v1)
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('_Data')
```
Input Types: Optional[v0]
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Optional[v0]) -> None:
if v2 is None:
return
if self.maxlen is not None and len(self._buffer) >= se... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.market_ids is None:
return 'All'
if len(self.market_ids) == 1:
return self.market_ids[0]
return ', '.join((str(t) for v1 in... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
v1 = self.rate / (100 * self.freq)
v2 = self.min_p_perc / 100
v3 = self.min_p
v4 = self.fix_p
v5 = self.cc_debt
v6 = 0
while v5... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(TypedDict):
v1: str
v2: str
v3: str
```
Input Types: str
Output Type: List[v0]
Dependencies:
```python
def v4():
v5 = s.get(url)
v5.raise_for_status()
v6 = v5.json()
return v6.get('responsePayloadData', {}).get('data')... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0() -> int:
v1 = np.loadtxt('./data/d01/p1/input')
v2 = np.count_nonzero(np.diff(v1) > 0)
return int(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self._config['target_device'] = v1
self._options['device'] = v1
return self
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, 'VisitCallback', 'VisitCallback'
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: 'VisitCallback', v3: 'VisitCallback') -> bool:
v4 = ''
if not self.ctx.corpus._block_declared_path_changes:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> str:
for v3 in range(len(v1), 0, -1):
v4 = v1[:v3]
if v1.replace(v4, '') == '' and v2.replace(v4, '') == '':
... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0() -> None:
print('starting loop closer')
v1 = asyncio.Task.all_tasks()
v2: bool = True
while v2:
await asyncio.sleep(1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
if 'async ' in v1 or 'def ' in v1:
return True
if v1.strip().startswith('assert'):
return True
return False
``` |
Imports:
```python
import os
import typing
```
Type definitions:
```python
class v0:
v1 = ('st_mode', 'st_ino', 'st_dev', 'st_nlink', 'st_uid', 'st_gid', 'st_size', 'st_atime', 'st_mtime', 'st_ctime', 'st_atime_ns', 'st_mtime_ns', 'st_ctime_ns')
def __init__(self, v2: AnyStr, v3: int=S_IFREG | PERM_DEF_FILE, v... |
Imports:
```python
import os
import tempfile
import typing
```
Type definitions:
Input Types: bytes, str
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: bytes, v2: str) -> bytes:
(v3, v4) = tempfile.mkstemp()
(v3, v5) = tempfile.mkstemp()
(v6, v1) = (v1[:self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Matrix4x4
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Matrix4x4):
for v2 in v1.M:
self.write_float(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: list
Dependencies:
```python
def v0(v1: dict, v2, v3: list, v4: list) -> list:
if len(v2) == 0:
return v4 + [v3 + [v1]]
elif len(v2) == 1:
v5 = v2[0]
return v0(v1[v5], find_keys(v1[v5]), v3 + [v5], v4)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Union[requests.Response, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> Union[requests.Response, None]:
v2 = self.http.run(self.endpoint, self.query if v1 else {}, self.header, self.opt... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, int
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2: int) -> list:
if v2 < len(self._tokenized):
v3 = self._tokenized[v2]
v4 = 0
v5 = 0
v6 = []
while v4... |
Imports:
```python
import polars as pl
from polars import testing
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
v1 = pl.Series([' hello ', 'world\t '])
assert v1.str.rstrip().to_list() == [' hello', 'world']
``` |
Imports:
```python
import tensorflow as tf
import numpy as np
import logging
import typing
```
Type definitions:
Input Types: Any, Any, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: int):
v4 = -tf.reduce_sum(tf.cast(self.Y, tf.float32) * tf.nn.log_softmax(self.l... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[Text, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[Text, Any]:
v1: Dict[Text, Any] = {}
v2: int = 0
for v3 in reversed(self.events):
if v3['event'] == 'slot':
v2 += 1... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
self.iterator += 1
return self.data[self.iterator - 1]
``` |
Imports:
```python
import math
import typing
```
Type definitions:
```python
class v0(ParamsBase):
v1: float = 50
v2: float = 36
v3: float = 3
v4: float = 2.5
v5: float = 4.5
v6: float = 90
v7: float = 5
v8: float = 2
@property
def v9(self) -> float:
v10 = self.screws_pe... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: UE4Grid):
self.grid = v1
self.observations = []
def v2(self, v3: AgentObservation):
self.observations.append(v3)
def v4(self, v5=[]):
"""Returns the most recent observation in... |
Imports:
```python
import cv2
import numpy as np
from PIL import Image
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray, v2: int, v3=True) -> np.ndarray:
(v4, v5) = v1.shape[:2]
v6 = v2
if v3:
v7 = (v5 - v6) //... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2: str) -> str:
v3 = v1.index(v2)
v4 = v1.pop(v3 + 1)
del v1[v3]
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> str:
v3 = self.STYLE.get(v1)
return v3(v2) if v3 and self.use_color else v2
``` |
Imports:
```python
import re
from io import BytesIO
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame, str
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: str='csv') -> bytes:
v3: int = int(re.sub('[^0-9]', '', pd.__version__))
... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: Dict[str, tf.Tensor]
Output Type: Dict[str, tf.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, tf.Tensor]) -> Dict[str, tf.Tensor]:
v2 = v1['image']
v2 = tf.image.convert_image_dtype(v2... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str):
self.name: str = v1
self.direct_sups: List[v0] = []
self.direct_subs: List[v0] = []
def v2(self) -> Iterator[v0]:
if self.direct_subs:
for v3 in self.direct_subs:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, str
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None, v2=None, v3: str=None) -> list:
assert v1 is not None or v2 is not None
if v1 is not None:
v2 = self.get_query('SELECT * fr... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = List[SegmentTag]
```
Input Types: Union[List[v0], List[str], str]
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Union[List[v0], List[str], str]) -> None:
if v2:
if v2 == 'auto':
v2 = s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.