text stringlengths 190 325k |
|---|
Imports:
```python
import gzip
import os
from pathlib import Path
from typing import IO, AnyStr, cast
import typing
```
Type definitions:
Input Types: Path, Path, str
Output Type: Any
Dependencies:
```python
def v0(v1: Path, v2: Path, v3: bool):
v4 = f'msa_view {str(v1)} --in-format MAF --features <(gunzip -c {str... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
self.assert_waited_for_exit()
return self.stderr_lines
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Dict[str, Any]
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: Dict[str, Any]=None) -> Dict[str, Any]:
v4 = f'{self.api_key}'
v5 = {'Content-Type': 'application/json... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame) -> pd.DataFrame:
v1 = v1.drop(columns=set(v1.columns).difference(set(['book_id', 'book_title', 'tags', 'user_id', 'rt_rating... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v2 = self.__tree
v3 = dict()
for v4 in v1:
v3[v4.upper()] = v1[v4].upper()
while True:
if v2['branches'] is None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable[[Any], Any], Callable[[Any], Any]
Output Type: Callable[[List[Any]], Dict[Any, Any]]
Dependencies:
```python
def v0(v1: str, v2: Any) -> NoReturn:
v3 = str(v2)
if len(v3) > 200:
v3 = v3[:200] + '…'
raise ValueError(f"incom... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], int
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: int) -> List[int]:
if len(v1) == 0:
return [-1, -1]
v3 = 0
v4 = len(v1) - 1
while v3 <= v4:
v5 =... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Union[Dict, pd.Series, pd.DataFrame], str, str, str, bool
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[Dict, pd.Series, pd.DataFrame], v2: str, v3: str, v4: str, v5: bool=False) -> b... |
Imports:
```python
import torch
from torch.nn import Module
from torch.nn.parallel.distributed import DistributedDataParallel
import typing
```
Type definitions:
Input Types: Any, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any, v2: int) -> Any:
v3 = [v1 if torch.distribute... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray) -> np.ndarray:
v2: Tuple = v1.shape + (1,)
v3 = v1.reshape(v2)
print(f'Expanding shape from {v1.shape} to {v3.shape}')
retur... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: int) -> bool:
if v2 < 0 or v2 > 5:
raise IndexError('pipe_number must be in range [0, 5]')
if not v1 or len(v1) > 32:
raise Va... |
Imports:
```python
import itertools
import numpy as np
import typing
```
Type definitions:
Input Types: List[Dict]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[Dict]):
v2 = list(itertools.chain.from_iterable([sample['mungos_from'] for v3 in v1]))
v4 = list(itertoo... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Union[str, Path], bool
Output Type: Iterator[str]
Dependencies:
```python
def v0(v1: Union[str, Path], v2: str='rt', v3: Optional[str]='UTF-8', **v4):
if isinstance(v1, Path):
v1 = str(v1)
v5: Callable = open
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Any:
if len(self.fast_roc) < 1 or len(self.slow_roc) < 1:
return None
self.wma.add_input_value(self.slow_roc[-1] + self.fast_roc[-1])
if len(sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], int
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[int], v2: int=32) -> List[int]:
if v2 == 0:
return v1
v3 = len(v1) % v2
if v3 > 0:
v1 = [0] * (v2 - v3) + v1
ret... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict[tuple[str, str], float], dict[tuple[str, str], float]
Output Type: dict[tuple[str, str], float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict[tuple[str, str], float], v2: dict[tuple[str, str], float]) -> dict[tuple[str, str... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self._download_clang_tools_extra_source()
return self._build_run_clang_tidy(v1)
``` |
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.lower() == 'easy':
return 0
if v1.lower() == 'medium':
return 1
return 2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], int, int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: int, v3: int) -> bool:
if v2 == 0:
return False
if v3 == 0 and len(v1) == len(set(v1)):
return False
... |
Imports:
```python
import itertools
from datetime import date, timedelta
import typing
```
Type definitions:
Input Types: str, date, date, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: date=date(year=2009, month=1, day=1), v3: date=date.today(), v4: str='usd'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, List[Dict[str, str]], List[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: List[Dict[str, str]], v3: List[str]) -> None:
for v4 in v2:
v5 = [v4['point'], v4['address']]
v5 += v3
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, Tuple[int, ...], Tuple[int, ...], Tuple[int, ...]
Output Type: Tuple[int, ...]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bool, v2: Tuple[int, ...], v3: Tuple[int, ...], v4: Tuple[int, ...]) -> Tuple[int, ...]:
v5 = []
... |
Imports:
```python
from typing import Any, Dict, List, Optional, Tuple, TypeVar, Union, cast, overload
from .typing import ActivitesTVType, AmbilightCurrentConfiguration, AmbilightLayersType, AmbilightSupportedStyleType, AmbilightSupportedStylesType, ApplicationIntentType, ApplicationsType, ChannelDbTv, ChannelListType... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
for v1 in self.errors:
print(v1.toString(self))
v2 = len(self.errors) > 0
self.errors = []
return v2
``` |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: str, str, int, bool
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None, v2: str=None, v3: int=None, v4: bool=False) -> List[str]:
if not v1:
v1 = self.filename
if not v3:... |
Imports:
```python
import os
from pathlib import Path
import typing
```
Type definitions:
Input Types: Path
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path) -> List[str]:
assert v1.is_dir(), f'{v1} is supposed to be a directory!'
(v2, v3, v4) = next(os.walk(str(v1.re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, list, Any, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='', v2: list=[], v3=False, v4=False) -> bool:
if not v1 and (not v2) and v4 and self.links:
return True
if not v1 and (not ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = ['t1', 't2', 't3']
return {'transactions': v1}
``` |
Imports:
```python
import asyncio
import logging
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, *v1, **v2) -> None:
self._log(logging.DEBUG, {'event': 'wiji.WatchDogTask.run', 'state': 'watchdog_run', 'task_name': self.tas... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list[str]
Output Type: int
Dependencies:
```python
def v0(v1: str) -> int:
(v2, v3) = determine_seat_position(v1)
return v2 * 8 + v3
```
```python
def v4(v5: str) -> tuple[int, int]:
v6 = find_seat_position(v5[:7], 'F', 'B') - 1
v7 = f... |
Imports:
```python
import typing
```
Type definitions:
Input Types: date
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: date):
if v1.month > 3:
(v2, v3) = (v1.year, v1.year + 1)
else:
(v2, v3) = (v1.year - 1, v1.year)
if v2 % 100 != 99:
v3 %= 100
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pathlib.Path, str, List[Union[int, str]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pathlib.Path, v2: str=None, v3: List[Union[int, str]]=None):
v4 = str(v1.relative_to(self.root_path).parent.as_posix())... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
assert self._re_doc is not None
v1 = self._re_doc.sub(self._doc_replace, v1)
return v1
``` |
Imports:
```python
import logging
import re
import requests
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[str, float]
Dependencies:
```python
def v0(v1: str) -> List[str]:
v2 = requests.get(v1)
return v2.text.split('\n')
```
Function Name: v3
Function:
```python
def v3(v4: str) -> Dict... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Iterable[Dict[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Iterable[Dict[str, str]]:
v1 = []
for v2 in self._mapping:
v3 = self._mapping[v2]
v4 = {'label': f'{v2} [{v3.get_type()... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame):
v2 = v1.to_dict(orient='records')
for (v3, v4) in enumerate(v2):
for (v5, v6) in v4.items():
i... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: list
Dependencies:
```python
def v0(v1: list, v2: str='note') -> list:
v3 = []
for v4 in v1:
if isinstance(v4[v2], list):
for v5 in v4[v2]:
if isinstance(v5, str):
... |
Imports:
```python
import numpy as np
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.data.Dataset, tf.data.Dataset
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.data.Dataset, v2: tf.data.Dataset) -> int:
v3 = v2.make_one_shot_iterator().get_next()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
```python
def v0(v1, v2):
nonlocal count
if not v1:
v3 += 1
return
else:
for v4 in v1:
if v4 % v2 == 0 or v2 % v4 == 0:
v0(v1 - {v4}, v2 + 1)
```
Functi... |
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([True, False, True])
v2 = pl.Series([False, True, True])
assert v1 & v2 == [False, Fals... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Optional[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: Any, **v2: Any) -> Optional[float]:
assert self._accum_step == self.num_accumulate_steps
assert self._final_callback_has_ran
self._final_c... |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: dict, str, Any, Any, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
v3 = np.cumsum(np.insert(v1, 0, 0))
return (v3[v2:] - v3[:-v2]) / v2
```
Function Name: v4
Function:
```p... |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: Dict[str, float], int, int, str
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, float], v2: int, v3: int, v4: str='cation') -> pd.DataFrame:
v5 = self... |
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):
self.send_command({'Action': 'Login', 'Username': v1, 'Secret': v2, 'Events': 'OFF'})
v3 = self.receive_response()
if 'Response:... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Path
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2) -> Path:
v3 = self.video_path.name
v4 = f'{v3}.{v2}.{v1}'
return Path(self.video_path.parent, v4)
``` |
Imports:
```python
import textwrap
import typing
```
Type definitions:
Input Types: Any, str, List[Tuple]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: str, v3: List[Tuple]) -> str:
self._usings.add('SuperEnum')
v4 = []
v5 = '=>' if v2 == 'String' else '='
f... |
Imports:
```python
from typing import List, Dict, Union, Optional, Tuple
import typing
```
Type definitions:
Input Types: UUID, Union[int, List[int]]
Output Type: Optional[List[HiveLibrary.Host]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: UUID, v2: Union[int, List[int]]) -> Optional[List[Hiv... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
if self.head == None:
return False
else:
v2 = self.head
while v2 != None:
if v2.index == v1:
... |
Imports:
```python
import sys
import asyncio
import typing
```
Type definitions:
Input Types: Any
Output Type: asyncio.Task
Dependencies:
```python
async def v0():
try:
async with self._subsema:
await f(*args, **kwargs)
except:
if not self._exception:
(v1, v2, v1) = sys.... |
Imports:
```python
import torch
import torch.distributed as dist
import torch.nn as nn
from torch import Tensor
import typing
```
Type definitions:
Input Types: Iterable[Tensor], Iterable[Tensor], Iterable[Tensor], Tensor, Tensor
Output Type: Tuple[Tensor, Tensor, Tensor]
Dependencies:
Function Name: v0
Function:
```... |
Imports:
```python
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.collections import LineCollection
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import matplotlib.patches
import typing
```
Type definitions:
Input T... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: config.LibrarySpec
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: config.LibrarySpec) -> Dict[str, str]:
v2 = self.cfg
v3 = os.path.join
v4 = v1.flags + ' -ffunction-sections -fd... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bytes:
v2 = []
for v3 in range(v1):
if self.i % 624 == 0:
self.twist()
v4 = self.state[self.i % 624]
v4 = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, praw.models.Comment
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: praw.models.Comment) -> None:
self.logger.debug('Handling ping')
self.logger.debug('Updating config')
self.config = s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int) -> int:
v3 = v2 - v1 + 1
v4 = 0
for v5 in [2 ** n for v6 in range(31, -1, -1)]:
v4 <<= 1
if v3 <= v5 <= v1 % (v5 * 2) <... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Union[List[float], np.ndarray]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[List[float], np.ndarray]):
v2 = np.identity(4)
v2[3, 0] = v1[0]
v2[3, 1] = v1[1]
v2[3, 2] = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: List[str]):
if v1 in v2:
return True
elif v1.endswith('.') and v1 in ['{}.'.format(f[0:len(v1) - 1]) for v3 in v2]:
return... |
Imports:
```python
from numpy.core.numeric import array_equal
from numpy.lib import math
import numpy as np
import typing
```
Type definitions:
Input Types: int, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: float):
v3 = range(v1)
v3 = [x - (v1 - 1) / 2 for v4 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: sansio.Event
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: sansio.Event) -> bool:
v2 = v1.data.get('issue', v1.data.get('pull_request'))
if v2 is None:
return False
if 'marvin' in {label['name'] ... |
Imports:
```python
import re
import subprocess
import sys
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1, v2):
v3 = None
for v4 in range(20):
v5 = v1.readline(0.5)
if not v5:
continue
v3 = v2.search(v5.decode())
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float, float
Output Type: type(None)
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float, v3: float=None) -> type(None):
self.x0 -= v1
self.y0 -= v2
if v3 is not None:
self.z0 -= v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: types.Message
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: types.Message) -> None:
v2 = v1.chat.id
if not self.subscribers.is_in_list(v2):
await self.send_message(v2, 'You are not subscr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None) -> None:
self.parser.add_argument('--log-level', choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], help='Specify verbosity of logging')
... |
Imports:
```python
import glob
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1: str = self._config.default_kernel_name
if v1 == 'latest':
v2: Path = self._config.boot_path
v3: list = glob.glob(str(v2... |
Imports:
```python
import pathlib
import typing
```
Type definitions:
Input Types: Union[str, pathlib.Path], int, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, pathlib.Path], v2: int=100, v3: bool=False):
if isinstance(v1, str):
v1 = pathlib.Path(v1)... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.contents
v2 = ''
for v3 in v1:
v4 = v1[v3]
v2 += '{}: {}\n'.format(v3, v4)
return v2
``` |
Imports:
```python
import os
import shutil
import sys
import typing
```
Type definitions:
Input Types: int, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: bool=False):
v1 = int(v1)
if not v2 and (not os.isatty(sys.stderr.fileno())):
return
if se... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.start_time = 0.0
self.timer.stop()
self.labelTime.setText('0')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: str, **v3):
v3.update(locals())
v4 = {'tags': ['Wireless health'], 'operation': 'getNetworkClientConnectionStats'}
v5 = f'/netwo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v2 = 0.0
v2 += 1
return v2 / len(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> None:
if v1 in self.followers:
if v2 not in self.followers[v1]:
self.followers[v1].append(v2)
else:
s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Iterable[int]
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Iterable[int]) -> List[str]:
v3 = v1.split('#')[0]
v4 = v1.split('#')[-1]
v5 = v1.count('#')
return [f'{v3}{index:0{v5}}... |
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:
v2 = "[^-\\]_.~!*'();:@&=+$,/?#[A-z0-9æÆøØåÅ]"
return re.sub(v2, '', v1) if isinstance(v1, str) else ''
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
self.ecs._region_id = v1
self.rds._region_id = v1
self.waf._region_id = v1
self.region_id = v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
return '0' + v1 if len(v1) % 2 else v1
```
Function Name: v2
Function:
```python
def v2(v3: int) -> str:
def v4(v5: str) -> str:
"""Pad hex to ensure 2 digit hexadec... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: List
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict) -> List:
v2 = [v1[id] for v3 in self.affected_samples]
return self.gt_to_int(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: tf.keras.Model
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> tf.keras.Model:
self.model = self.model_spec.create_model()
return self.model
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: list):
v3: Proton = v1.lista_elementos[0]
v4: list = v2[0:v1.n_celulas]
v5: list = v3.concentracoes_aquoso(v4, v1.n_celulas)
v6: list = [v5]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[onnx.TensorProto]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[onnx.TensorProto]):
for v2 in v1:
if not v2:
continue
self.update_single_initializer_map(v2)
``` |
Imports:
```python
import tensorflow.compat.v2 as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, tf.Tensor
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Tensor, v2: tf.Tensor) -> tf.Tensor:
v3 = tf.equal(tf.argmax(v2, 1, output_type=tf.int32), v1)
ret... |
Imports:
```python
import typing
```
Type definitions:
```python
@attr.s
class v0:
v1 = attr.ib()
v2 = attr.ib()
v3 = attr.ib(default=None)
v4 = attr.ib(default=None)
v5 = attr.ib(default=None)
v6 = attr.ib(default=None)
v7 = attr.ib(factory=dict)
v8 = attr.ib(default=None)
v9 = attr... |
Imports:
```python
import numpy as np
import pandas as pd
import datetime
import typing
```
Type definitions:
```python
v0 = Union[pd.Timestamp, str, np.datetime64, datetime.datetime, datetime.date]
```
Input Types: Union[np.datetime64, pd.Series, np.ndarray, str, datetime.datetime, datetime.date], int, str
Output Type... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
v2 = re.compile('--.+\n')
v3 = v2.sub(repl='', string=v1)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
```python
def v0(v1: str, v2: str='1603:?:?') -> dict:
v3 = {}
if not v1 or len(v1.strip()) == 0:
return v3
v4 = map(str.strip, v1.split('|'))
for v5 in v4:
v6 = v5.split('-')
tr... |
Imports:
```python
import torch
import torch.nn as nn
import torch.optim as optim
from torch import tensor
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
import typing
```
Type definitions:
Input Types: torch.tensor
Output Type: torch.tensor
Dependencie... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = NewType('ExternalSymbol', str)
```
```python
v1 = float
```
Input Types: List[List[v0]]
Output Type: List[v1]
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: List[List[v0]]) -> List[v1]:
v4 = []
for v5 in v3:
(v6... |
Imports:
```python
import inspect
import typing
```
Type definitions:
```python
v0 = List[AbstractBaseModule]
```
Input Types: List[str]
Output Type: v0
Dependencies:
```python
def v1(v2: str) -> Optional[AbstractBaseModule]:
v3 = 'Loading module %s : ' % colored(v2, 'yellow')
def v4(v5: str) -> None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
v2 = self._fan_speeds.get(v1)
self._dm.set_fan_speed(fan_speed=v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Path]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[Path]) -> str:
v2 = self.read_batch_template()
v3 = self.transform_options()
v4 = [f"'{scan.nifti.uncompressed},1'" for v5 in v1]
v4... |
Imports:
```python
import torch
from torch.utils.tensorboard import SummaryWriter
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool):
torch.set_grad_enabled(v1)
self.model.train(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
assert 1 or True
return True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int, v3: int) -> int:
if v1 == 'rpc':
return 40000 + v2 * 100 + v3
if v1 == 'rest':
return 50000 + v2 * 100 + v3
if v1 ... |
Imports:
```python
import itertools
import typing
```
Type definitions:
```python
v0 = TypeVar('DictUpperBound', bound='dict')
```
Input Types: List, Callable[[Any], Any]
Output Type: List
Dependencies:
```python
def v1(v2: v0, v3: Any, v4: Any) -> None:
v5 = v2.get(v3, list())
v5.append(v4)
v2[v3] = v5
```... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
if v1[0] == '*' and v1[-1] == '*':
return False
elif v1[0] == '*' or v1[-1] == '*':
return True
else:
return False
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.__best_ant
print('============================================================')
print(f'Best route, score {v1.score}: ')
for (v2, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tuple, v2: str='%s') -> None:
if v1:
raise ValueError(v2 % v1)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.ndarray) -> np.ndarray:
v3 = np.copy(v1)
v3[:, 0] = v1[:, 1]
v3[:, 1] = v2.shape[0] - v1[:... |
Imports:
```python
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import find_peaks
from scipy import interpolate
from scipy import integrate
import typing
```
Type definitions:
Input Types: list, list, float, float, float, bool, bool, bool
Output Type: list
Dependencies:
Function Name: v0
Funct... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> None:
if not self.check_only:
v3 = self.get_output_file(v1)
v3.write(v1 + ' ')
v3.write(v2 + '\n')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
self.state = 'post_round'
v1 = self._check_winner()
if v1 is None:
await self.start_round()
return
await self.channel.s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.