text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: bytearray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytearray):
v2 = []
for v3 in v1:
if v3 >= 128:
v3 = v3 - 256
v2.append(str(v3))
v4 = ','.join(v2)
return byte... |
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=30) -> Any:
self._web3.eth.waitForTransactionReceipt(v1, timeout=v2)
return self._web3.eth.getTransactionReceipt(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(DStabilityBaseModelStructure):
v1: Optional[str]
v2: Optional[str]
v3: Optional[str]
v4: conlist(PersistablePoint, min_items=3)
@validator('Points', pre=True, allow_reuse=True)
def v5(cls, v6):
"""
Todo:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any) -> None:
v2 = ''
for v3 in self.system_command_lines:
v2 += v3 + '\n'
if self.executive_control_lines:
v2 += '$EXECUTIVE CONTR... |
Imports:
```python
import asyncio
import inspect
import typing
```
Type definitions:
Input Types: Callable
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Callable) -> bool:
if inspect.isfunction(v1) or inspect.ismethod(v1):
return asyncio.iscoroutinefunction(v1)
retur... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if v1 is None or v1.strip() == '':
raise ValueError('arg vas none or empty')
if not os.path.isfile(v1):
raise FileNotFo... |
Imports:
```python
import numpy as np
import pandas as pd
import scipy.stats as stats
import typing
```
Type definitions:
Input Types: pd.DataFrame, Any, float, bool, float, Dict[Text, Any]
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: pd.DataFrame, v2: float, v3: float=0.0):
v4 = np.ceil(1.0 / v2).... |
Imports:
```python
import numpy as np
from numpy import concatenate as concat
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.best_reward = 0
v1 = self.counter
self.save_counter += 1
v2 = sum(self.all_re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple):
self.isActive = True
self.pos = v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False):
try:
if v1:
return self.params[-1]
return self.params[-1][-1]
except IndexError:
return None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: float=1.0):
v3 = self._metadata_xml.find(f'.//Metadata/Scaling/Items/Distance[@Id="{v1}"]/Value')
if v3 is not None:
v4 = float(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> tuple:
v1 = list(v1)
return (v1[0:len(v1):2], v1[1:len(v1):2])
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Union[float, np.ndarray], bool
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: Union[float, np.ndarray], v3: bool=False) -> Tuple[np.ndarra... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, Any]:
v1 = super().to_dict()
v1['chao'] = []
for v2 in range(self.data_count):
v3 = self.get_chao(v2)
if not v3.is_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path, str
Output Type: Iterator[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: str) -> Iterator[int]:
with open(file=v1, encoding=v2) as v3:
for v4 in v3:
v5 = v4.strip()
if v5.isdigi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, jax.core.Jaxpr
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: jax.core.Jaxpr):
v3 = []
for v4 in v2.eqns:
if all([str(v) == '_' for v5 in v4.outvars]):
continue
v6 = v4.pri... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, List[str]
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: List[str]) -> list:
if v1 == 'text':
v4 = []
for v5 in v3:
v4.extend(self._ent_annots[v5].annotate_enti... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
v0 = t.Dict[str, torch.Tensor]
```
Input Types: v0, int
Output Type: t.Dict[str, t.Any]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0, v3: int) -> t.Dict[str, t.Any]:
v4 = self(**self._prepare_batch(v2))
... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types: argparse.Namespace
Output Type: None
Dependencies:
```python
def v0(v1: argparse.Namespace, v2: str) -> None:
v3 = Halo(text='Fetching...', spinner='dots', color='magenta')
v3.start()
(v4, v5) = get_operator_dict(v2)
v3.text... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: int
Dependencies:
```python
def v0(v1: [int], v2: int) -> int:
if v2 in memo:
return memo[v2]
if v2 == len(v1) - 1:
return 1
v3 = 1
for v4 in range(v2 + 1, len(v1)):
if v1[v2] < v1[v4]:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray):
v2 = np.median(np.abs(v1 - np.mean(v1, axis=0))) / 0.6745
return v2
``` |
Imports:
```python
from datetime import datetime, time, timedelta
import typing
```
Type definitions:
Input Types: datetime
Output Type: datetime
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: datetime) -> datetime:
v2 = v1 + timedelta(1)
return datetime(v2.year, v2.month, v2.day)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> bytes:
v2 = bytearray()
v3 = 32
for v4 in range(1, 9):
if v1 < v3:
v2 = bytearray(v4)
v5 = v1
for v6... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: dict) -> str:
v1 = abs(v1)
if v1 < v2['small']:
return 'negligible'
if v2['small'] <= v1 < v2['medium']:
return 'small'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> Tensor:
if self._tbptt > 0 and self._recurrence_idx > 0 and (self._recurrence_idx % self._tbptt == 0):
self._hx: Tensor = self._hx.... |
Imports:
```python
from concurrent.futures.process import ProcessPoolExecutor as Executor
import hashlib
import json
import multiprocessing
import typing
```
Type definitions:
Input Types: dict, float, float, float, int
Output Type: tuple
Dependencies:
```python
def v0(v1: dict, v2: tuple, v3: int=settings.HASH_DIFFIC... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.ping_alarm_id
if v1:
self.node.alarm_queue.unregister_alarm(v1)
if self.can_send_pings:
self.ping_alarm_id = self.node.... |
Imports:
```python
from typing import ValuesView, cast, List, Dict, Tuple, Union, Optional, Set
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.amount_courses = 0
self.weekly_periods = 0
for v1 in self.cover... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.set_models({'mediafile/7': {'token': 'token_1', 'owner_id': 'organization/1'}, 'mediafile/8': {'token': 'token_2', 'owner_id': 'organization/2'}})
... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: discord.Message
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: discord.Message):
if not self.execute_cmd(v1):
return
v2 = self.rm_cmd(v1)
if len(v2) != 0:
v2 = re.sub(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v2: Union[int, tuple[int, int]], v1=True) -> None:
v2 = v2 if len(v2) == 2 else v2[0]
self.resize(size=v2, smooth=v1)
``` |
Imports:
```python
from torch import nn
import torch, re, logging
import typing
```
Type definitions:
Input Types: List[torch.Tensor]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[torch.Tensor]):
if self.agg_scheme == 'avg':
return torch.mean(torch.stack(v1, di... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, typing.List[typing.List[float]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: typing.List[typing.List[float]]):
v3 = (v1[0] >= v2[0][0]) & (v1[0] <= v2[0][1])
v4 = (v1[1] >= v2[1][... |
Imports:
```python
import logging
import os
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if not os.path.exists(v1):
raise FileNotFoundError(f'{v1} does not exist')
logging.info(f'Processing read conten... |
Imports:
```python
import os
import shutil
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
```python
def v0(v1: str) -> str:
return v1.replace('/', '-').replace(' ', '-')
```
Function Name: v2
Function:
```python
def v2(v3: str, v4: str, v5: str):... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *, v1: bool=False) -> None:
for v2 in self.get_all_connections():
v2.disconnect(force=v1)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
@attr.s(slots=True, frozen=False)
class v0:
v1: KgtkReader = attr.ib(validator=attr.validators.instance_of(KgtkReader))
v2: typing.Optional[typing.List[str]] = attr.ib(default=None)
v3: typing.Optional[str] = attr.ib(default=None)
def v4(... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.proc is not None:
self.proc.kill()
self.proc.wait()
self.proc = None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.set_models({'meeting/1': {'name': 'test_foo'}})
(v1, v2) = self.request('export_meeting', {'meeting_id': 1})
self.assertEqual(v1, 200)
a... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.ndarray):
v3 = np.zeros_like(v1)
v3[v2] = v1
return v3.astype(np.int32)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self._option_list.selectedItems()
if len(v1):
self._select_item(v1[0], direct_only=True)
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
v1: int = 0
v2: int = len(self._primitives.keys())
for (v3, v4) in self._primitives.items():
v5: str = os.path.join(self.source... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, (int, int), int
Output Type: [int]
Dependencies:
```python
def v0(v1: int, v2: int=DEFAULT_BLOCK_SIZE) -> [int]:
v3 = v1.encode('ascii')
v4 = []
for v5 in range(0, len(v3), v2):
v6 = 0
for v7 in range(v5, min(v5 + v2, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, *v2):
v3 = self.list().entity
for (v4, v5) in enumerate(v2):
v3['policies_config'].insert(v1 + v4, v5)
v3['service_id'] = self.parent['... |
Imports:
```python
import typing
```
Type definitions:
Input Types: AnyStr, AnyStr, int, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: AnyStr, v2: AnyStr, v3: int=1, v4: Any=fnmatch) -> None:
if v3:
self.assertTrue(v4(v1, v2), 'expected %r to match pattern %r' ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1, **v2) -> bool:
self._mouseover = False
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.array, int, str
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.array, v2: int, v3: str='Y') -> np.array:
if ~isinstance(v2, int):
v2 = int(v2)
return v1[v3][v2]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float, v3: str):
v4 = 'rider_location'
v5 = '#rider'
v6 = {'command': v4, 'data': {'api_key': self.api_key, 'api_username':... |
Imports:
```python
import numpy as np
import librosa
import typing
```
Type definitions:
Input Types: str, int, int, dict
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int, v3: int, v4: dict) -> np.ndarray:
v5 = librosa.load(v1, v2)[0]
if v3 == 2:
v5 =... |
Imports:
```python
import requests
import shutil
import os
from urllib.parse import urlparse
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str):
v3 = urlparse(v2).path.split('/')[-1]
with requests.get(v2, stre... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str]):
with self.__lock:
self.__messages = []
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: anafora.AnaforaData
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: anafora.AnaforaData):
for v2 in v1.annotations:
v3 = []
for (v4, v5) in v2.properties.items():
if isinstance(v5, str) ... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: str, bool
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: bool) -> list:
v3 = list(map(float, v1.split(',')))
if v2:
print('The sum of list {} is {}'.format(v3, sum(v3)))
return v3
```
Function Name: v4
Fu... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, float
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray, v3: np.ndarray, v4: np.ndarray, v5: np.ndarr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, sublime.View
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: sublime.View=None) -> None:
v2 = v2 or self.request_view
v2.set_status('rest', 'REST: {}'.format(v1))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
```python
def v0():
v1 = ColumnDataSource(dict(x=[1, 2], y=[1, 1]))
v2 = Range1d(start=0.4, end=0.6)
v3 = Plot(height=400, width=1100, x_range=Range1d(0, 1), y_range=Range1d(0, 1), min_border=0)
v3.a... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: str, object
Output Type: List[Tuple[str, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: object) -> List[Tuple[str, int]]:
if type(v2) == int or type(v2) == float:
return [(v1, v2)]
elif ty... |
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 = re.compile('[-:]')
v3 = v2.sub('', str(v1))
v2 = re.compile('\\s')
v3 = v2.sub('T', v3)
return v3
``` |
Imports:
```python
import logging
import re
import typing
```
Type definitions:
Input Types: Dict
Output Type: Optional[str]
Dependencies:
```python
def v0(v1: str) -> Optional[List]:
if not re.match('^\\(\\d+,\\s*\\d+\\)$', str(v1)):
return None
return str(v1).replace(' ', '').replace('(', '').replace... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[np.ndarray]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[np.ndarray]) -> None:
v2 = v1[0].shape[0]
for v3 in v1:
if v3.shape[0] != v2:
raise ValueError('Input `matrices` all mu... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, Any]:
v1 = None
if self.swa_scheduler:
v1 = self.swa_scheduler.state_dict()
v1.pop('anneal_func')
v2 = {'swa_model'... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
self._logger.debug('config requested in stdout mode')
self._run_runner()
return 1 if self._runner.status == 'failed' else 0
``` |
Imports:
```python
import re
import pathlib
import shlex
import shutil
import subprocess
import typing
```
Type definitions:
Input Types: pathlib, str
Output Type: bool
Dependencies:
```python
def v0(v1: pathlib, v2: str) -> bool:
v3 = f'git show --oneline --name-status --diff-filter A {v2}'
try:
v4 = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
print('Error in database for current_request:', self.current_request.url)
self.database_errors += 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: Optional[Dict[str, Any]]
Dependencies:
```python
def v0(v1: LoggingTransaction) -> Optional[Dict[str, Any]]:
v2 = 'SELECT response_code, etag, expires_ts, og, media_id, download_ts FROM local_media_repository_url_cache WHERE ... |
Imports:
```python
import torch
from torch.nn import functional as F
import typing
```
Type definitions:
```python
v0 = typing.Optional[torch.dtype]
```
Input Types: torch.Tensor, v0
Output Type: torch.Tensor
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: torch.Tensor, v3: v0) -> torch.Tensor:
if v... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor):
(v2, v3) = tf.split(v1, 2, axis=1)
v4 = tf.sqrt(tf.pow(v2, 2) + tf.pow(v3, 2))
v5 = tf.pow(v4, 3)
v6 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> int:
v3 = v1 * pow(10, v2)
return int(v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False, v2: bool=True):
v3 = len(self.equations) - 1
v4 = 0
while v3 > 0:
v5 = self.get_pivot(v3, 'jordan', v2)
if v5:
... |
Imports:
```python
import os
import pandas as pd
import typing
```
Type definitions:
Input Types: str
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> pd.DataFrame:
assert os.path.isfile(v1)
return pd.read_csv(v1, sep='\t', encoding='utf-8', na_filter=False)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Optional[Dict[Union[str, int], Union[str, int]]]
Output Type: dict
Dependencies:
```python
def v0(v1: Sequence, v2: Dict[str, Union[str, int]]) -> Sequence:
v1 = sorted(v1)
v3 = [int(v2[str(int(idx))]) for v4 in ... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[str, ...]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Tuple[str, ...]:
try:
return ('-u', f'{os.getuid()}:{os.getgid()}')
except AttributeError:
return ()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
```python
def v0(self, v1: dict) -> dict:
v2 = {}
print('OpStatus...')
v2['op_state_code'] = self.state
return v2
```
Function Name: v3
Function:
```python
def v3(self, v4: dict) -> dict:
v5 = {... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: argparse.Namespace
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: argparse.Namespace) -> None:
v2 = logging.getLogger()
v3 = logging.FileHandler(filename=v1.logfile, encoding='utf-8', mode='w')... |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='') -> bool:
if self.error_count > 0:
self.last_error_count = self.error_count
self.error_count = 0
self.last_update = ... |
Imports:
```python
from math import fabs
import typing
```
Type definitions:
Input Types: Callable[[float], any], float, float, int, float
Output Type: (float, bool)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Callable[[float], any], v2: float, v3: float, v4: int=32, v5: float=0.001) -> (float, boo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
```python
def v0(v1: int) -> int:
v2 = 0
while v1:
v2 += (v1 % 10) ** 2
v1 //= 10
return v2
```
Function Name: v3
Function:
```python
def v3(self, v4: int) -> bool:
def v5(v6: int) -... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, float, Optional[int]
Output Type: List[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: float, v3: Optional[int]) -> List[float]:
np.random.seed(v3)
v4 = [float(p) for v5 in np.random.rand... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> str:
if self.obj is None:
if v1:
v2 = f'import {self.path}\n'
v2 += f"globals()['{self.path}'] = {self.path}... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]=None):
if v1 is None:
v1 = []
self.tags = v1
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1):
self.step = v1
self.parents = []
self.children = []
self.ordered = False
def v2(self, v3):
self.children.append(v3)
def v4(self, v5):
self.parents.app... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: bool=False) -> str:
v3 = {'truncate': 'true'} if v2 else {}
async with self.session.delete(self.base_path + f'/graph/{v1}', params=... |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types:
Output Type: object
Dependencies:
Function Name: v0
Function:
```python
def v0() -> object:
v1 = argparse.ArgumentParser(description='Pull perm routes info for a state')
v1.add_argument('state', help='Two-letter state abbrevi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Set[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *, v1: str) -> Set[str]:
v2 = super().get_imports(prefix=v1)
v2.update({f'from {v1}models import {self.reference.class_name}', 'from typing import Dict... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Any:
v2 = self.npz[v1]
assert len(v2.shape) == 0
return v2
``` |
Imports:
```python
import os
from os.path import abspath, dirname, join
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
```python
def v0(v1):
return os.path.expanduser(v1)
```
Function Name: v2
Function:
```python
def v2(v3: str, v4: str) -> None:
v3 = v0(v3)
v4 = ... |
Imports:
```python
import importlib
import os
import re
import typing
```
Type definitions:
Input Types: str, str
Output Type: int
Dependencies:
```python
def v0(v1: str) -> bool:
try:
v2 = importlib.import_module(v1)
v3 = getattr(v2, '__plugin_name__', None)
v4 = getattr(v2, '__plugin_usag... |
Imports:
```python
import cv2
import typing
```
Type definitions:
Input Types: str, int, int, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int, v3: int, v4: float):
self.capture.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*v1))
self.capture.set(cv2.C... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Match
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Match) -> None:
self.emit_segment(v1.start(v1.lastindex + 1))
if self._conditional.is_active:
v2 = v1.group(v1.lastindex + 2)
self._m... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Qt.QMoveEvent
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Qt.QMoveEvent) -> None:
super().moveEvent(v1)
self.full_repaint()
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0() -> dict:
v1 = open('dclean.json')
v2 = json.load(v1)
v1.close()
return v2
``` |
Imports:
```python
import sys
import traceback
import typing
```
Type definitions:
Input Types: BaseException, bool
Output Type: None
Dependencies:
```python
def v0(v1: str) -> None:
sys.stderr.write(f'{v1}\n')
sys.stderr.flush()
```
Function Name: v2
Function:
```python
def v2(v3: BaseException, v4: bool) -> ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bs4.element.Tag
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bs4.element.Tag) -> bool:
v2 = ['預約', '轉掛', '停診']
return all((sub_str not in v1.text for v3 in v2)) and v1.text != ''
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> dict:
with self._lock:
if not self._version_info or v1:
v2 = self._root_url + '/api/version'
self._version_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, dict, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: dict, v3, v4=StratifiedKFold, v5=No... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
self._require_auth()
v2 = self.http_get(self._url_for('/v1/api/list/system/content/' + v1))
return v2.text
``` |
Imports:
```python
import statistics
from Bio.Seq import Seq
import typing
```
Type definitions:
```python
v0 = List[Spacer]
```
```python
v1 = Union[piler_parse.RepeatSpacer, piler_parse.BrokenSpacer]
```
Input Types: List[v0], Seq
Output Type: List[v0]
Dependencies:
```python
def v2(v3: List[v1]) -> Optional[int]:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.msg_transport:
self.msg_transport.close()
if self.pkt_transport:
self.pkt_transport.close()
``` |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> str:
v2 = datetime.fromtimestamp(v1)
return v2.strftime('%Y-%m-%dT%H:%M')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = {'marketId': '000', 'currentPage': '1', 'pageSize': '10000'}
self.add_request(method='POST', path='/ct/tradeGridDetailList.magpie', data=v1, cal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.