text stringlengths 190 325k |
|---|
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 = (item.partition('=') for v3 in v1.split())
return {key: value for (v4, v5, v6) in v2}
``` |
Imports:
```python
from array import array
from mmap import mmap
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any) -> int:
v2 = v1 if isinstance(v1, (bytes, mmap, array)) else v1.encode('utf-8')
v3 = 0
v4 = len(v... |
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:
v1 = '_' + v1.replace('_', '-') if v1 else ''
return self.filename_pattern.format(file_id=v1, suffix=v2, n=self)
``` |
Imports:
```python
import torch
from torch.cuda import amp
from torch.nn.utils import clip_grad_norm_
import torch.distributed as dist
from torch.cuda.amp.grad_scaler import OptState
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self,... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> None:
if v2 not in self._forward:
assert v2 not in self._reverse
self._forward[v2] = set()
sel... |
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:
v2 = ''
for v3 in v1:
v2 += f'* {v3}\n'
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: carla.Vehicle
Output Type: Mapping[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: carla.Vehicle) -> Mapping[str, Any]:
v2 = v1.get_control()
v3 = v1.get_transform()
v4 = v3.location
v5 = v3.rotation
v6 = ... |
Imports:
```python
import re
import sys
import typing
```
Type definitions:
```python
class v0:
v1 = 0
def __init__(self, v2: str, v3: Optional[float]=None, v4: str='') -> None:
self.index = v0._next_index
self.size = v3
self.tooltip_html = v4
v0._next_index += 1
self.to... |
Imports:
```python
import pandas
import pandas as pd
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = pandas.read_csv(v1)
v2.dropna()
v2.drop(['long', 'lat', 'id', 'date'], axis=1, inplace=True)
v2 = v2[(v2[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if ';' in str(v1):
v1 = '{%s}' % v1.replace('}', '}}')
return v1
``` |
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 = list(map(str, v1.split()))
v3 = v2[::-1]
v4 = ' '.join((v1 for v1 in v3))
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: object
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: object) -> None:
v2 = self.documents_by_entity.get(v1)
if v2 is not None:
self.documents_by_entity.evict(v1)
self.documents_by_id.po... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.clear_line()
v1 = self.progress_substituter()
sys.stdout.write('\r%s' % v1)
sys.stdout.flush()
``` |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Union[str, Path]
Output Type: Path
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, Path]) -> Path:
v2 = self.base_path
v3 = Path(v1)
v4 = (v2 / v3).resolve()
if v3.is_absolute()... |
Imports:
```python
import math
import random
from typing import Counter, Dict, List, Optional, Set, TypedDict
import typing
```
Type definitions:
```python
class v0(TypedDict, total=False):
v1: str
v2: str
v3: str
v4: str
v5: str
v6: str
v7: str
v8: str
v9: str
v10: str
v11: ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, int
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int=1) -> np.ndarray:
if v1 < 1:
raise ValueError('Cannot generate less than 1D samples')
if v2 < 1:
r... |
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 = {}
for v3 in 'abcdefghi':
v2[str(ord(v3) - ord('a') + 1)] = v3
for v3 in 'jklmnopqrstuvwxyz':
v2[str(ord(v3) - ord... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: dict=None):
v4 = v2
v3 = v3 or dict()
v5 = dict(reply_tag=v2)
return self._send_request(v1, v4, kw_request=v3, kw_prop=v5)
``... |
Imports:
```python
import numpy as np
import random
import os
from PIL import Image
import h5py
import logging
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
```python
def v0(v1):
if not os.path.exists(v1):
os.mkdir(v1)
```
```python
def v2(v3):
v4 = v3.get('path')... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
if v1 in self.names:
v2 = self.names[v1] + 1
self.names[v1] = v2
return f'{v1}__{str(v2)}'
else:
self.names... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: int, Callable[[v0], int], Iterable[v0]
Output Type: List[List[v0]]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: int, v3: Callable[[v0], int], v4: Iterable[v0]) -> List[List[v0]]:
v5: List[List[v0]]... |
Imports:
```python
import requests
import typing
```
Type definitions:
```python
v0 = namedtuple('Config', 'url token ca_cert client_cert')
```
Input Types: v0
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0):
v3 = requests.Session()
v3.verify = v2.ca_cert
if v2.token is ... |
Imports:
```python
from random import random
import typing
```
Type definitions:
```python
class v0(object):
v1: List[BaseAttribute]
def __init__(self, v2: Union[int, Tuple[int, int]]) -> None:
self.key: Final[Union[int, Tuple[int, int]]] = v2
self.bias: float = 0
self.weight: float = 0... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str) -> str:
if self.is_multiline:
return v2 + str(self)
elif len(self) + len(v2) <= v1:
return v2 + str(self)
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self.limpar_saida_criterios()
self.tokens_criterios = self.processar_criterios(v1)
self.erros = self.analisar_erros_tokens_criterios(self.toke... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
if self.__type is not self.JSON:
raise RuntimeError('Attempt to get JSON options for non-JSON config')
return self.json_options
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[torch.nn.Module]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[torch.nn.Module]) -> int:
assert isinstance(v1, list)
return sum([sum([p.nelement() for v2 in model_module.parameters()]) for v3 in v1]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable, Callable, np.ndarray
Output Type: Callable
Dependencies:
```python
def v0(v1, v2, v3=None, v4=None):
v5 = check_minp(v3, len(v2))
return cfunc(v1, v2, v5, **kwargs)
```
Function Name: v6
Function:
```python
def v6(self, v7: Callable,... |
Imports:
```python
from scipy import stats as _st
import numpy as _np
import typing
```
Type definitions:
Input Types: _np.ndarray
Output Type: _np.ndarray
Dependencies:
```python
def v0(v1: _np.ndarray) -> _np.ndarray:
return _st.contingency.expected_freq(v1)
```
Function Name: v2
Function:
```python
def v2(v3: _... |
Imports:
```python
import json
from pathlib import Path
import typing
```
Type definitions:
Input Types:
Output Type: Dict[int, Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Dict[int, Dict]:
v1 = {}
for v2 in Path('target/criterion/part1').iterdir():
with open(v2 / 'new' / 'es... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> str:
if v1 is not None and len(v1) >= 3:
if 'X-Influxdb-Version' in v1[2]:
return v1[2]['X-Influxdb-Version']
return 'unknown'
``... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if not v1:
return
v2 = self.data
for v3 in v1:
v2[v3] = v3 in v2 and v2[v3] or {}
v2 = v2[v3]
v2[''] = 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._items = []
self._list.set('')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3=5):
v4 = []
for v5 in range(0, v1, v2 - v3):
v6 = v5
v7 = v5 + v2
if v7 > v1:
v7 = v1
... |
Imports:
```python
import os
import re
from re import Pattern
from io import BytesIO, StringIO
from tarfile import open as tar_open
from tarfile import TarInfo
import typing
```
Type definitions:
Input Types: str, Any, Any
Output Type: bytes
Dependencies:
```python
def v0(v1: TarInfo) -> Optional[TarInfo]:
v2 = os... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: dict) -> dict:
for v3 in v2:
v1[v3].append(v2[v3])
return v1
``` |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3) -> tf.Tensor:
v4 = v1
for v5 in self.gnns:
v4 = v5((tf.concat([v4, v1], axis=-1), v3))
retur... |
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 v1 not in self._menu_items:
return False
del self._menu_items[v1]
return True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Record', Any, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Record', v2: Any, v3: str) -> None:
if v1 not in self._children:
self._children[v1] = [v2]
else:
self._children[v1].app... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: List[tf.data.Dataset], int
Output Type: Callable[[int], List[tf.data.Dataset]]
Dependencies:
```python
def v0(v1):
v2 = np.random.choice(list(range(len(tf_datasets))), size=clients_per_round, replace=False).tolist()
return [... |
Imports:
```python
import os
import os.path
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str):
v3 = os.sep
v1 = v1.replace(v3 + v3, v3)
v2 = v2.replace(v3 + v3, v3)
for v4 in range(len(v1)):
v... |
Imports:
```python
import os
import requests
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> bool:
if os.getenv('CI'):
return True
v2 = 'https://www.google.com/recaptcha/api/siteverify'
v3 = os.getenv('RECAPTC... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(cmd.Cmd):
v1 = '\n\nWelcome to the sidechain shell. Type help or ? to list commands.\n'
v2 = 'SSX> '
def v3(self: v0) -> None:
"""Clear the screen before the REPL starts up."""
_clear_screen()
def __init__(self... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types:
Output Type: Dict
Dependencies:
```python
def v0() -> Path:
return (current_dir / '..' / 'data').resolve()
```
Function Name: v1
Function:
```python
def v1() -> Dict:
with (v0() / 'fake-project.json').open() as v2:
return ... |
Imports:
```python
import select
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
while self.should_receive:
v1 = select.select([self.sock], [], [], 0.1)
if v1[0]:
self.received_data.append(sel... |
Imports:
```python
import logging as log
import typing
```
Type definitions:
Input Types: [str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: [str]) -> None:
if v1 and len(v1) > 0:
if len(v1) < 50:
log.info('Failed Paths (%d) to parse:', len(v1))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Iterable[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: Iterable[str]):
self.assertResponseHasErrors(v1)
v4 = zip(v2['errors'], v3)
self.assertTrue(all((error['message'] == mes... |
Imports:
```python
from crypt import crypt
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2: str = '.............................................../0123456789ABCDEFGABCDEFGHIJKLMNOPQRSTUVWXYZabcdefabcdefghijklmnopq... |
Imports:
```python
import inspect
import typing
```
Type definitions:
```python
v0 = Union[T, Awaitable[T]]
```
```python
v1 = TypeVar('T')
```
Input Types: Callable[..., v0[v1]]
Output Type: v1
Dependencies:
Function Name: v2
Function:
```python
async def v2(v3: Callable[..., v0[v1]], *v4, **v5) -> v1:
v6 = v3(*v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str], Optional[Dict[str, List[str]]], int, bool
Output Type: Generator[dict, None, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str], v2: Optional[Dict[str, List[str]]]=None, v3: int=10000, v4: bool=Fal... |
Imports:
```python
import requests
import pandas as pd
import typing
```
Type definitions:
Input Types:
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0() -> pd.DataFrame:
v1 = 'http://72.push2.eastmoney.com/api/qt/clist/get'
v2 = {'pn': '1', 'pz': '5000', 'po': '1', 'np':... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: List[str]) -> None:
v2 = '.idea/dictionaries/ericf.xml'
with open(v2) as v3:
v4 = v3.read().splitlines()
if v4[2] != ' <words>':
raise RuntimeError(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: int):
v3 = []
for v4 in v1:
if v2 in v4:
v3.append((v4[0], v4[-1]))
print(f'Selected {len(v3)} movies/shows filmed in ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
v1 -= 1
if v1 < 0 or len(self._data) <= v1:
return None
return self._data[v1]
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = typing.Tuple[tox.config.IndexServerConfig, typing.List[tox.config.IndexServerConfig]]
```
Input Types: tox.config.TestenvConfig, v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: tox.config.TestenvConfig, v3: v0) ->... |
Imports:
```python
import typing
```
Type definitions:
Input Types: typing.Union[int, str], bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: typing.Union[int, str], v2: bool=False) -> None:
v3 = [self.IPFW_COMMAND, '-q', 'delete', self._offset_rule_number(v1, insecure=v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int):
if v1 == '+':
print('Let us sum up some numbers!')
print('ㅇㅅㅇ ㅇㅅㅇ ㅇㅅㅇ')
return self.recursive_sum(v2)
if v1 ... |
Imports:
```python
from functools import partial
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1, v2: bool=True, v3: bool=False, **v4):
return self._api_get(v1, as_df=v2, pivot=v3, **v4)
```
Function Name: v5
Function:
```python
def v5(self) -> None:
for v6... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, **v1: Any) -> None:
try:
await self.async_turn_off_callback()
except PermissionError:
self._show_permission_error('turn off')
await ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
v2 = bin(v1)[2:]
return '00' not in v2 and '11' not in v2
``` |
Imports:
```python
import collections
import typing
```
Type definitions:
```python
@dataclasses.dataclass(eq=True, frozen=True)
class v0:
v1: str
v2: typing.Optional[str]
v3: int
@classmethod
def v4(cls, v5: str, v6):
return cls(ticket_id=v5, comment=v6.get('comment') or None, timeSpentSec... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypedDict('ArrayDict', parameters=ArrayND, mean=ArrayShape, variance=ArrayShape)
```
Input Types:
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self) -> v0:
v2 = dict()
if hasattr(self, 'parameters'):
v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[list, tuple, np.ndarray]
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[list, tuple, np.ndarray]) -> np.ndarray:
self.check_params(bert_hub_module_handle=self.bert_hub_module_handle, batch... |
Imports:
```python
import numpy as np
import torch
import typing
```
Type definitions:
Input Types: Any, int, dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: int, v3: dict) -> dict:
for (v4, v5) in enumerate(self.psnr_description()):
v6 = v1[:, v4]
v... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int):
logging.debug(f'Buying food {self.shop.food[v1]} {self.pets[v2]}')
if self.gold < self.shop.food[v1].food.cost:
... |
Imports:
```python
import torch
from torch import Tensor, nn
import typing
```
Type definitions:
Input Types: Dict[str, Tensor], List[Tensor], List[List[int]], Sequence[int], bool
Output Type: List[Dict[str, Tensor]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Tensor], v2: List[Tens... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> dict:
v1 = self.join_dict(v1, 'name')
v1 = self.join_dict(v1, 'phone_number')
v1 = self.join_dict(v1, 'category', insert='전문점')
v1 = ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = str
```
```python
v1 = list[tuple[Timestamp, Distance]]
```
Input Types: dict[v0, v1], str, int, int
Output Type: list[v1]
Dependencies:
```python
def v2(v3: v1, v4: int, v5: int) -> tuple[v1, int]:
v6 = []
while len(v6) < v4:
for v7 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> str:
if v1 not in self._usernames:
return self.get_user_by_id(v1)['username']
return self._usernames[v1]
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types:
Output Type: Optional[Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Optional[Dict]:
try:
with open(self._complete_api_key_path, 'r', encoding='utf-8') as v1:
return json.loads(v1.read()... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, Any
Output Type: float
Dependencies:
```python
def v0(v1):
return v1 ** self.phi_3
```
Function Name: v2
Function:
```python
def v2(self, v3, v4, v5, v6, v7) -> float:
def v8(v9):
return v9 ** self.phi_3
if v3 ... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: commands.Bot, discord.TextChannel, Optional[discord.Message]
Output Type: Any
Dependencies:
```python
async def v0(v1: commands.Bot, v2: discord.TextChannel) -> Dict[str, int]:
v3 = {'Hog': 0, 'Beaux': 0, 'Durm': 0}
v4 = True
asy... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
self._state['term_index'] = self.TermIndex()
self._state['index_term'] = self.IndexTerm()
v2 = set(v1)
for (v3, v4) in enumerate(v2):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: list()):
for v2 in v1:
v2.replace('[[', '')
v2.replace(']]', '')
return v2
```
Function Name: v3
Function:
```python
def v3(v4: str):
v5 = list()
v5.append(v4)
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = common_classes.FormatOptions
```
Input Types: pd.DataFrame, List[v0]
Output Type: style.Styler
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: pd.DataFrame, v3: List[v0]) -> style.Styler:
for v4 in range(len(v3)):
v5 = v3[... |
Imports:
```python
import asyncio
import shlex
import typing
```
Type definitions:
Input Types: js.Item, str
Output Type: Tuple[bool, str, str, str]
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1: js.Item, v2: str) -> Tuple[bool, str, str, str]:
v3 = 'grep "{}" {}'.format(v2, v1.stdout_path)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
try:
return {'velocity': round(self._velocity(), 3), 'velocity_unit': 'm/s'}
except Exception as e:
return {'velocity': 0.0, 'velocit... |
Imports:
```python
import csv
from pathlib import Path
import typing
```
Type definitions:
Input Types: str, dict, str, list, list, list, list, list, list
Output Type: 'dict,dict'
Dependencies:
```python
def v0(v1: list, v2: list, v3: list):
v4 = 0
for v5 in v2:
v6 = v3[v4][0]
if v6 == 'a':
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
```python
def v0() -> str:
from datetime import datetime
v1 = datetime.now()
return v1.strftime('%d/%m/%Y, %H:%M:%S')
```
Function Name: v2
Function:
```python
def v2(v3: str, v4: str, v5: str):... |
Imports:
```python
from datetime import datetime
import pandas as pd
import typing
```
Type definitions:
Input Types: list
Output Type: tuple
Dependencies:
```python
def v0(v1: trdb2py.trading2_pb2.PNLAssetData, v2: int=-1) -> dict:
v3 = 0
v4 = 0
v5 = 0
if v2 == -1:
for v6 in v1.lstCtrl:
... |
Imports:
```python
import torch
from torch import nn
import typing
```
Type definitions:
Input Types: nn.Module, torch.Tensor
Output Type: Any
Dependencies:
```python
def v0(v1, v2, v3='cpu'):
if isinstance(v2, tuple):
v2 = tuple((i.to(v3) for v4 in v2))
(v5, v6) = v1(*v2)
else:
v5 = v1... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Tuple[np.ndarray, np.ndarray]
```
Input Types: np.ndarray, np.ndarray, float
Output Type: Tuple[v0, v0]
Dependencies:
```python
def v1(v2: float) -> int:
if not v2.is_integer():
raise Exception('Cast would drop decimals')
return int(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
if v1 in self._cache_status_code:
return self._cache_status_code[v1]
v2 = self._url.get_status_code(v1)
self._cache_status_code... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[Union[int, float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[Union[int, float]]:
if self.trainer.testing:
v1 = self.trainer.num_test_batches
elif self.trainer.sanity_checking:
... |
Imports:
```python
import logging
from sys import exit
import typing
```
Type definitions:
Input Types: int, typing.types.FrameType
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: typing.types.FrameType) -> None:
logging.warning('Received SIGTERM. Shutting down, Adjø!')
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: pd.Series, pd.Series, Optional[int]
Output Type: pd.Series
Dependencies:
```python
def v0(v1: pd.Series, v2: pd.Series, v3: Optional[int]=None) -> Tuple[Any, Union[float, Any]]:
if v3 is None:
v3 = len(v1)
v4 = np.ar... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None, v2: str=None):
v3 = v1.split(':')[1]
v4 = v3 + ': ' + v2
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: bool
Dependencies:
```python
def v0(v1):
if v1[0] == 1:
return [v1[1], v1[2]]
if v1[0] == 2:
return [v1[1], v1[2] - 0.1]
if v1[0] == 3:
return [v1[1] + 0.1, v1[2]]
return [v1[1] + 0.1, v1[2... |
Imports:
```python
import gzip
import typing
```
Type definitions:
Input Types: Union[str, Path], Union[str, Path]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[str, Path], v2: Union[str, Path]) -> None:
with gzip.open(v1, 'rb') as v3:
v4 = v3.read()
with open(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: dict):
v3 = v1.shape[0]
for v4 in v2.keys():
v1.loc[v3 + 1, v4] = v2[v4]
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor):
(v2, v3) = self.do_conv_input(v1)
v2 = self.conv_input(v2)
(v4, v5) = ([], [])
for (v6, v7, v8, v9) in zip(... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Callable[..., Any]
```
Input Types: v0
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0) -> v0:
setattr(v2, '__isfinalmethod__', True)
return v2
``` |
Imports:
```python
import hashlib
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = hashlib.sha1()
v1.update(self.password.encode(self.HASH_ENCODING))
return v1.hexdigest().upper()
``` |
Imports:
```python
import numpy as np
import torch
import typing
```
Type definitions:
Input Types: int, int, int, float
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1: int, v2: int, v3: int, v4: int, v5: Optional[Tuple[int, ...]]=None) -> torch.Tensor:
if v3 < 0:
v3 = v1 - 1
if v4 < 0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, str, list, str
Output Type: list
Dependencies:
```python
def v0(v1: str, v2: list, v3: str='') -> list:
return [f'{v1}{v3}{post}' for v4 in v2]
```
```python
def v5(v6: str, v7: str, v8: str='') -> str:
return f'{v7}{v8}{v6}'
```
Functio... |
Imports:
```python
import sys
from configparser import ConfigParser
import typing
```
Type definitions:
Input Types: Path
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path) -> List[str]:
v2 = ['--show-traceback', '--no-error-summary', '--no-pretty', '--hide-error-con... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> np.ndarray:
v1 = v1.upper()
v2 = self._img
v3 = 0 if 'N' not in v1 else slice(None)
v4 = 0 if 'H' not in v1 else sl... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: bool=False):
v3 = []
v4 = v1.split()[::-1] if v2 is True else v1[::-1]
for v5 in v4:
if v5.isdigit() is True:
v3.append... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v2 = [{'name': 'access', 'value': self.access}, {'name': 'ratelimit', 'value': self.rate_limit}]
for (v3, v4) in v1.items():
v2.append({... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if v1.find('?') == -1:
v2 = ''
else:
[v1, v2] = v1.split('?', 1)
v3 = v1.rsplit('/', 1)[-1]
return v3
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.