text stringlengths 190 325k |
|---|
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: list, **v3):
v4 = list()
for v5 in range(len(v2) - 1):
v6 = v2[v5]
v7 = v2[v5 + 1]
v8 = v1.filter(v6, v7,... |
Imports:
```python
from glob import glob
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list:
v1 = glob('data/others/*.m4a')
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
if v1 > self.max_n_searched:
for v2 in range(self.max_n_searched + 1, v1):
self.poisoned_group_size_statistics[v2] = self.get_pois... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int, int, str, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any=None, v2: int=None, v3: int=None, v4: str=None, v5: str=None, v6: str=None) -> None:
v1 = v1 if v1 else self.active_worksheet
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str | None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str | None:
assert self.fp is not None
v1 = self._next()
if v1 == '\n':
self.line += 1
self.column = 0
elif v1:
self.... |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: list, dict, object
Output Type: Any
Dependencies:
```python
def v0(v1, v2: list) -> Diesel:
for v3 in v2:
if v1 == v3.descr.desc['Id']:
return v3
return None
```
Function Name: v4
Function:
```python
def v4(v5: ... |
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 = ''
v3 = v1.split(' ')
for v4 in v3[:-1]:
v2 += v4[::-1] + ' '
return v2 + v3[-1][::-1]
``` |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str, str, str, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str, v4: bool=True):
v5 = 'true' if v4 else 'false'
subprocess.check_output(['kubectl', '-n', f'{v3}', 'de... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tokenize.TokenInfo
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tokenize.TokenInfo) -> None:
(v2, v3) = v1.start
if v2 not in self._offsets:
self._offsets[v2] = v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0() -> float:
return psutil.cpu_percent(interval=1)
```
```python
def v1() -> dict[str, psutil._common.sdiskusage]:
v2 = psutil.disk_partitions()
v3 = {d.mountpoint: psutil.disk_usage(d.mountp... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict):
for (v2, v3) in v1.items():
if v2 in self.variables:
if v3.size != self.variables[v2]:
raise ValueError('Prior m... |
Imports:
```python
import asyncio
import asyncio.subprocess as subprocess
import json
import logging
from asyncio import Queue, StreamReader, StreamWriter
from asyncio.subprocess import PIPE
import typing
```
Type definitions:
Input Types: StreamWriter
Output Type: None
Dependencies:
Function Name: v0
Function:
```py... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> bool:
v2 = v1.keys()
v3: dict = {}
if 'BookEntitlement' in v2:
v3 = v1['BookEntitlement']
if 'AudiobookEntitlement' in v2:
... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if '~' in v1:
return Path(v1).expanduser()
return Path(v1).resolve()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
(v2, v3) = (v1[:len(v1) // 2], v1[len(v1) // 2:])
v2 = [c.lower() for v4 in v2]
v3 = [v4.lower() for v4 in v3]
return v2.count('a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str='20') -> list:
v4 = f'/users/{v1}/mailFolders/{v2}/childFolders?$top={v3}'
return self.ms_client.http_request('GET', v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for v1 in range(int(self.epoch.numpy()), self.config.num_epochs + 1):
self.train_epoch()
if self.valid_dataset:
self.validate... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray):
if self.multiple:
self.multiple_objective(v1)
else:
self.single_objective(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> None:
self.is_safe = self._mine_resources(is_safe=self.is_safe)
self.is_safe = self._mine_interarrival(is_safe=self.is_safe)
self.is_sa... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.active():
try:
self.task.cancel()
except asyncio.CancelledError:
pass
object.__setattr... |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0() -> str:
v1 = datetime.datetime.utcnow()
v2 = str(v1.year)
v3 = str(v1.month)
v4 = str(v1.day)
return v2 + '_' + v3 + '_' + v4
```
Function Name: v5
Function:
```... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, list
Output Type: typing.Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: list=[]) -> typing.Any:
if v1 == '':
raise ValueError('service argument must not be empty')
if v2 == '':
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
v1['hostname'] = ''
v1['SID'] = ''
v1['instanceNr'] = ''
``` |
Imports:
```python
import subprocess, re, sys, base64, tempfile
import typing
```
Type definitions:
Input Types: str, int
Output Type: set[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int) -> set[int]:
v3: list[str] = v1.split()
if not v3:
return set()
if len(v3) ==... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Marble'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Marble'):
v2 = self.child
if not v2:
raise ValueError('Marble has no child.')
v3 = v2.child
if not v3:
raise ValueError('M... |
Imports:
```python
import numpy
import typing
```
Type definitions:
Input Types: Dict[str, float]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, float]) -> bool:
v2 = v1['Component S (Franzen)']
v3 = v1['Component Sp (Franzen)']
v4 = v1['Component S_ERR (Franzen... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor:
v3: torch.Tensor = v2.sum((0, 1))
v4: int = int(v3.bool().any(0).long()... |
Imports:
```python
import socket
from urllib.error import URLError
from urllib.request import urlopen
import typing
```
Type definitions:
```python
v0 = namedtuple('Srv', ('port', 'root'))
```
Input Types: v0
Output Type: Any
Dependencies:
```python
def v1(v2: t.Union[int, str], v3: str='', v4: str='') -> str:
v5 =... |
Imports:
```python
from sympy import exp, Integer, Matrix, nsimplify
from sympy.core.expr import Expr
import typing
```
Type definitions:
Input Types: float, str
Output Type: Dict[str, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: str='s') -> Dict[str, float]:
if self.sig_... |
Imports:
```python
import math
from decimal import Decimal
import typing
```
Type definitions:
```python
v0 = TypeVar('_Num', float, Decimal)
```
Input Types: Optional[v0], bool, Union[int, float, Decimal, None]
Output Type: Optional[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Optional[v0], v3: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, list, np.ndarray, int
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: list, v3: np.ndarray, v4: int) -> list:
v5 = []
for v6 in range(v4):
v5.append(v2[v6] * (v1 - v3[v6][0]) + v3[v6][1])... |
Imports:
```python
from math import copysign, cos, sin, sqrt
import typing
```
Type definitions:
Input Types: int
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> float:
if v1 == 0:
return -1.0
if v1 >= self.max_value:
return self.range_min
v2... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: float, bool
Output Type: int
Dependencies:
```python
def v0(v1: float) -> float:
if v1 > 0.0:
v2 = math.log10(v1)
elif v1 < 0.0:
v2 = math.log10(-v1)
else:
return _MIN_EXP
if v2 < _MIN_EXP:
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: int) -> None:
v4 = self._get_offset(v1, v2)
v5 = v3.to_bytes(2, 'little')
self._buf[v4] = int(v5[0])
self._buf[v4 +... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Generic[_T]):
def v1(self, v2: Random, v3: Dict[int, Any]) -> _T:
"""the core generation method, which should generate a value
given a random.Random instance, and respect the by-object-id cache
the default implementa... |
Imports:
```python
import typing
```
Type definitions:
Input Types: xsd.Schema
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: xsd.Schema):
if not self.location:
return
v1.location = self.location
for v2 in v1.overrides:
v2.location = self.resolve_path... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
v2 = self.borderLength
(v3, v4) = self.size
(v5, v6) = (self.size[0] / 2, self.size[1] / 2)
(v7, v8) = (-v5, -v6)
(v9, v10) = self.sca... |
Imports:
```python
import sys
import logging
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str='error'):
v3 = logging.getLogger(v1)
try:
v3.setLevel(getattr(logging, v2.upper()))
except ValueError:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=None) -> None:
if self.verbose:
print(v1)
``` |
Imports:
```python
import numpy as np
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 = np.diag(v1)
v3 = v1.sum(axis=0) - v2
v4 = v1.sum(axis=1) - v2
return {'true_positives... |
Imports:
```python
import itertools
import typing
```
Type definitions:
Input Types: list[int]
Output Type: str
Dependencies:
```python
def v0(v1):
return v1[:2] < (2, 4) and v1[2] < 6
```
Function Name: v2
Function:
```python
def v2(v3: list[int]) -> str:
def v4(v5):
return v5[:2] < (2, 4) and v5[2] ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1) -> None:
self.service = v1['service']
self.entity_id = v1.get('entity_id')
self.data = v1.get('data', {})
``` |
Imports:
```python
from functools import partial
from sklearn.base import BaseEstimator
from sklearn.metrics.pairwise import kernel_metrics
from sklearn.svm import SVC
import typing
```
Type definitions:
Input Types: str, int, Union[str, float, None], float
Output Type: Any
Dependencies:
Function Name: v0
Function:
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[database.models.Isoform]
Output Type: List[database.models.Isoform]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[database.models.Isoform]) -> List[database.models.Isoform]:
v2: Dict[uuid.UUID, database.models.Isoform] ... |
Imports:
```python
import json
import os
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
```python
def v0():
v1 = {'repo_id': '', 'repo_sha': '', 'repo_branch': '', 'hostname': ''}
return v1
```
```python
def v2(v3, v4, v5=4, **v6):
with open(v4, 'w') as v7:
jso... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ppl_caffe_pb2.NetParameter
Output Type: Dict[str, list]
Dependencies:
```python
def v0(v1):
return v1 in [item.type for v2 in net_def.layer]
```
Function Name: v3
Function:
```python
def v3(v4: ppl_caffe_pb2.NetParameter) -> Dict[str, list]:
... |
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 = type(self)
return v2(self, v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.video_recorder is not None:
self.video_recorder.close()
self.video_recorder = None
super().close()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[str], Union[List[str], Set[str], int, str], str, Optional[List[str]], bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='', v2: Optional[str]=None, v3: Union[List[str], Set[str], int, str]=''... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes, v2: int) -> int:
v3 = self.op2
v2 = v3.reader_geom2._read_dual_card(v1, v2, self._read_rrod_nx, self._read_rrod_msc, 'RROD', self.op2.read... |
Imports:
```python
import os
from pathlib import Path
from pathlib import PosixPath
import numpy as np
from PIL import Image
import typing
```
Type definitions:
Input Types: Any, Optional[np.ndarray]
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: Union[PosixPath, str], v2: Tuple[int, int]=None, v3: bool=Fa... |
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._instance_registry.items():
self.save_resource(v2)
``` |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
v2 = '/usr/sbin/dmidecode'
v3 = subprocess.check_output([v2], shell=False).decode('utf-8')
v4 = 'Protectli' in str(v3)
... |
Imports:
```python
import shutil
import warnings
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: int=1) -> None:
print(f'{_RED}ERROR{_RESET} {v1}')
exit(v2)
```
Function Name: v3
Function:
```python
def v3(self) -> None:
v4 = self._target.tool... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor
Output Type: tf.Operation
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor) -> tf.Operation:
with tf.name_scope('post-processing'):
v2 = tf.argmax(v1, axis=1)
v3 = tf... |
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 = len(v2)
v1[:v3] = v2
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.ndarray) -> float:
v3 = 0
assert np.size(v1, 0) == np.size(v1, 1) + 1
assert v1.shape == v2.sha... |
Imports:
```python
import os
import torch
import typing
```
Type definitions:
Input Types: Any, Optional[Dict[str, Any]], Any, Any, Any, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1):
from fairseq import models, registry, tasks
if 'optimizer_history' not in v1:
v1['optimizer_history'] = ... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: bfd_bflw.RunnerBook, bflw.RunnerBook, str, int
Output Type: Any
Dependencies:
```python
def v0(v1: List[bfd_bflw.PriceSize]) -> str:
return ' '.join(list((f'[{ps.price}, {ps.size}]' for v2 in v1)))
```
```python
def v3(v4: List[bfd_bfl... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
v1 = f'{self._controller} isrunning {self._this}'
return self._run_cmd(v1) == 'running'
``` |
Imports:
```python
from copy import copy
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1: Euclid = copy(self)
self.x = v1.y
self.y = v1.r
self.q = self.x // self.y
self.r = self.x - self.q * self.y
... |
Imports:
```python
import csv
import logging
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
logging.info('Trying to parse ATM location data file %s' % self.atmDataInput)
v1 = open(self.atmDataInput, 'r')
v2 = 0
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Mapping[str, str], Mapping[str, str]
Output Type: Dict[str, str]
Dependencies:
```python
def v0(v1: Mapping[str, str]) -> str:
return ','.join([f'{k}={v}' for (v2, v3) in v1.items()])
```
Function Name: v4
Function:
```python
def v4(v5: Mapping[st... |
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:
if v2 == 'NA':
if v1 == 'char':
return '""'
elif v1 == 'float':
return 0.0
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'coredata.KeyedOptionDictType'
Output Type: T.Dict[str, T.Dict[str, 'UserOption']]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'coredata.KeyedOptionDictType') -> T.Dict[str, T.Dict[str, 'UserOption']]:
v2: T.Dict[str, T.D... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[str], Optional[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Optional[str], v3: Optional[str]=None) -> str:
if isinstance(v2, str):
return '%s %s' % (v1, v2)
if isinstance(... |
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.cache_storage.upload_json_str(v1, v2)
self.backend_storage.upload_json_str(v1, v2)
self._backend_json_set_add(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Callable) -> int:
if not callable(v1):
raise ValueError('Cannot add a callback that is not callable.')
self.callbacks.append(v1)
return... |
Imports:
```python
import os
import shelve
import logging
import typing
```
Type definitions:
Input Types: str
Output Type: shelve.DbfilenameShelf
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> shelve.DbfilenameShelf:
try:
os.mkdir('/'.join(v1.split('/')[:-1]))
except Fil... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Data=None, v2: Optional[List[str]]=None):
self._data = []
self._columns = []
if v2 is not None:
self.columns = list(v2)
if not v1:
self._init_empty()
eli... |
Imports:
```python
import io
import pickle
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> bool:
try:
with io.BytesIO() as v2:
pickle.dump(v1, v2)
return True
except:
return False
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Axes, Any, Optional[int], Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: Axes, v3, *, v4: Optional[int]=100, v5=5, v6=1, v7=0.6):
v8 = self.scalar(v1)
v8 = self.summarize_scalars(v... |
Imports:
```python
import tensorflow as tf
from tensorflow.python import to_dlpack
import typing
```
Type definitions:
Input Types: tf.Tensor, Optional[tf.Tensor]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor, v2: Optional[tf.Tensor]=None):
if len(tf.shape(v1)) !=... |
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.is_empty():
return False
elif self._root == v1:
self._delete_root()
elif v1 > self._root:
return self._rig... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable, int
Output Type: Dict[str, tuple]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Callable, v2: int) -> Dict[str, tuple]:
v3 = {m: [] for v4 in v1}
for v4 in v1:
for v5 in range(v2):
v3[v4].append(... |
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 v1 < 1:
raise ValueError('size must > 0')
if self.size == v1:
return
if self.size < v1:
self.buf.extend(b'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str='') -> str:
if not v1.startswith('http'):
if v2 and v2.startswith('http'):
return v2 + v1
else:
print('w... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], int
Output Type: Any
Dependencies:
```python
def v0(v1: int, v2: List[str]):
return v1 >= 0 and v1 < len(v2)
```
Function Name: v3
Function:
```python
def v3(v4: List[str], v5: int):
if v5 == len(v4) - 1:
return
if not v... |
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 self.__should_parse(v1):
v2 = self._parse(v1)
return v2
else:
if self.next_parser is not None:
retur... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = self._model.encode([v1])[0]
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(RedBlackTreeNode):
def __init__(self, v1, v2: tuple):
"""
区间树结点
`key` : 键值
`interval` : 区间值 a tuple like (`min`, `max`), and `min` <= `max`
"""
try:
assert type(v2) is tuple
... |
Imports:
```python
import socket
import typing
```
Type definitions:
Input Types: str, int
Output Type: str
Dependencies:
```python
def v0(v1: socket):
v1.shutdown(1)
v1.close()
```
```python
def v2(v3: str, v4: int):
v5 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
v5.connect((v3, v4))
retur... |
Imports:
```python
import re, sys, os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = v1 + '/fast_align -i data/c2e -d -o -v > data/forward.align'
v3 = v1 + '/fast_align -i data/c2e -d -o -v -r > data/reverse.align... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.__app_id = '970CA35de60c44645bbae8a215061b33'
self.__app_cert = '5CFd2fd1755d40ecb72977518be15d3b'
self.__channel_name = '7d72365eb983485397... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
input(v1)
return 0
``` |
Imports:
```python
from scipy.signal import savgol_filter
import logging
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:
logging.info('Preprocessing data')
v2 = savgol_filter(v1, windo... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[Dict[str, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[Dict[str, Any]]:
v1 = []
for v2 in self.children():
v1.append(v2.text_to_dict())
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
super().write(v1)
if '\n' in v1:
self.flush()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: Tuple[float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray) -> Tuple[float, float]:
(v3, v4) = self.predict(v1)
v5 = self.xeloss(v4, self.onehot_enco... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1: pd.DataFrame, v2, v3) -> pd.DataFrame:
v4 = (v1['distance'] > v2) & (v1['distance'] < v1['distance'].quantile(0.99))
v5 = v1.loc[v4].copy()
v4 = (v5['trip_time'] > v3) ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
```python
def v0(cls: 'PageClassGallery', v1: 'PageTestConfig') -> None:
Globals.init(root=v1.site)
v2 = 3
v3 = v1.page_yaml.copy()
v3[Key.OPTIONS] = {Key.COLUMN_COUNT: v2}
v4 = cls(path=v1.path,... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: Any) -> Callable:
v2 = v1.__new__
@wraps(v2)
def v3(*v4: Any, **v5: Any) -> Callable:
self._counter[v1] += 1
if v2 is object.__new__:
return v2(v4[0])
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(*v1: str) -> str:
v2 = list()
for v3 in v1:
with open(v3, 'r') as v4:
v2.append(v4.read().replace('\n', ' '))
if len(v2) > 1:
return ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = f'Hello {self.name}'
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional['Domain'], bool
Output Type: 'Domain'
Dependencies:
```python
def v0(v1: Dict[Text, Any], v2: Dict[Text, Any], v3: bool=False) -> Dict[Text, Any]:
if v3:
(v4, v5) = (v1.copy(), v2.copy())
else:
(v4, v5) = (v2.copy(), v... |
Imports:
```python
import sys
import logging
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = logging.getLogger(v1)
v3 = logging.Formatter('%(asctime)s %(levelname)-8s: %(message)s')
v4 = logging.FileHandler(v1)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = {192: 'A', 193: 'A', 194: 'A', 195: 'A', 196: 'A', 197: 'A', 198: 'Ae', 199: 'C', 200: 'E', 201: 'E', 202: 'E', 203: 'E', 204: 'I', 205: 'I', 20... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: int):
if v1 == 1:
v4 = [v2, v3]
v5 = [v2 + 1, v3]
self.movement(v4, v5, 1, 0)
elif v1 == 2:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
v2 = []
while True:
v2.append(v1)
if v1 == 1:
return v2
elif v1 % 2 == 0:
v1 = v1 // 2
else:
... |
Imports:
```python
import collections
import itertools
import typing
```
Type definitions:
Input Types: Mapping[str, Sequence[Union[int, float, str]]]
Output Type: Iterator[Dict[str, Union[int, float, str]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Mapping[str, Sequence[Union[int, float, str]]])... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.