text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: int) -> int:
assert isinstance(v2, int) and v2 >= 1
assert isinstance(v1, list) and len(v1) >= v2
return self._findKthLarg... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Union[TextIO, str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[TextIO, str], **v2):
if hasattr(v1, 'read'):
v1 = v1.read()
return json.loads(v1, **v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.zeroLengthSearch:
return str(self.offsetStart)
else:
return str(self.offsetStart) + '-' + str(self.offsetEnd)
``` |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame) -> pd.DataFrame:
v2 = v1['matched_term'].str.lower() == v1['preferred_form'].str.lower()
v3 = v1['object_i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: (bool, bool)
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=1) -> (bool, bool):
self.try_starting()
(v2, v3) = self.try_authenticating(request_retries=v1)
return (v2, v3)
``` |
Imports:
```python
import shutil
import typing
```
Type definitions:
Input Types: Path
Output Type: None
Dependencies:
```python
def v0(v1: str) -> str:
return hex(abs(hash(v1)))[2:]
```
Function Name: v2
Function:
```python
def v2(v3: Path) -> None:
v4: str = v0(v3.name) + '.mp4'
v5: Path = v3.parent / v4... |
Imports:
```python
from numpy import float32, float64, isnan
import typing
```
Type definitions:
Input Types: Union[int, float, str, None]
Output Type: str
Dependencies:
```python
def v0(v1: float) -> str:
if isnan(v1):
return ' '
elif v1 == 0.0:
return '%8s' % '0.'
elif v1 > 0.0:
... |
Imports:
```python
from datetime import datetime
import warnings
import typing
```
Type definitions:
Input Types: List[str], Optional[int], Optional[int]
Output Type: List[str]
Dependencies:
```python
def v0(v1: List[str], v2: Optional[int]=None, v3: Optional[int]=None) -> dict:
if v2 is None:
v2 = 1985
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int):
(v3, v4) = (v1[:v2], v1[v2:])
return f'{v4}{v3}'
``` |
Imports:
```python
import math
import re
import typing
```
Type definitions:
Input Types: str
Output Type: t.Optional[gws.Extent]
Dependencies:
```python
def v0(v1):
return (min(v1[0], v1[2]), min(v1[1], v1[3]), max(v1[0], v1[2]), max(v1[1], v1[3]))
```
```python
def v2(v3: t.List[t.Any]) -> t.Optional[gws.Extent]... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = 'BUG-15: New bug with hook'
v2 = '\nLeo Franchi commented on [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/BUG-15) (assigned to **... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if not v1:
return v1
v2 = 0
v3 = 0
v4 = 0
v5 = []
v6 = []
for (v7, v8) in enumerate(v1):
if v4:
... |
Imports:
```python
import torch
import torch.nn.functional as F
import torch.nn as nn
import typing
```
Type definitions:
Input Types: Any, tuple
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: tuple):
v3 = torch.Tensor(v1)
v4 = torch.max(v3) - torch.min(v3)
v5 = (v3 - ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: protocol.Backup, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: protocol.Backup, v2: bool):
v3 = self._path_for_backup_date(v1.backup_date)
v3.parent.mkdir(exist_ok=True, parents=True)
with v3.o... |
Imports:
```python
import os
from pathlib import Path
from glob import glob
import typing
```
Type definitions:
```python
v0 = Union[str, Path]
```
Input Types: v0
Output Type: Path
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0, *v3: str) -> Path:
import os.path
v4 = os.path.join(str(v2), *... |
Imports:
```python
import os
import os.path
import typing
```
Type definitions:
```python
v0 = Sequence[str]
```
Input Types: v0
Output Type: bool
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> bool:
v3 = self._get_path(v2)
for v4 in os.listdir(v3):
if v4 not in ('new', 'cu... |
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:
v2 = v1.upper()
return os.getenv(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
self._task = None
await self.change_datetime(REPEAT_TYPES[self.repeat_type.value](self._datetime))
await self.set_notified(False)
self.... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Any
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> pd.DataFrame:
v2 = ['station', 'drought_index', 'cum_prcp_pred', 'cum_fillrate']
v3 = pd.DataFrame(v1.execute('select * from d... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[list], List[list]
Output Type: List[list]
Dependencies:
```python
def v0(v1: List[list]) -> bool:
if not isinstance(v1, int) and (not isinstance(v1[0], int)):
return True
raise TypeError('Expected a matrix, got int/list instead')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = {'key': self._task_process.key.key_path(), 'keyLiteral': self._task_process.key.key_literal(), 'relativeURI': self._task_process.relative_uri, 'meth... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, bool
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool) -> list:
v3 = []
v4 = []
for v5 in os.listdir(v1):
if not os.path.isdir(os.path.join(v1, v5)):
i... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1):
return torch.stack([a[..., v1, 0] * b[..., 0, 0] + a[..., v1, 1] * b[..., 1, 0] + a[..., v1, 2] * b[..., 2, 0], a[..., v1, 0] * b[..., 0, 1] + a[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict):
v2: Tree = v1.get('constituency', None)
if v2:
for v3 in v2.subtrees():
v4 = v3.label()
v3.set_label(v4.split('-')[0])... |
Imports:
```python
import typing
```
Type definitions:
Input Types: wx.TreeEvent
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: wx.TreeEvent):
(v2, v3) = self.ft_filetree.GetItemData(v1.GetItem())
if v2.endswith('/'):
self.GetGrandParent().open_filesystem_page(se... |
Imports:
```python
import numpy as np
from scipy.stats import rankdata
import typing
```
Type definitions:
Input Types: Dict, Optional[Dict]
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict, v2: Optional[Dict]=None) -> Tuple[np.ndarray, np.ndarray]:
v3... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
```python
def v0() -> Mapping[str, str]:
global _cfg
if not _cfg:
v1 = {}
for (v2, v3) in os.environ.items():
if v2.startswith('LSSLM_'):
v1[v2[len('LSSLM_'... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self):
self._addr: PostalAddress = PostalAddress()
def v1(self, v2: str) -> v0:
self._addr.country = v2
return self
def v3(self, v4: str) -> v0:
self._addr.locality = v4
return ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Union[List, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> Union[List, None]:
v2 = []
for v3 in v1:
v2.append({'field': v3, 'msg': v1.get(v3, '')})
return v2 if v2 else None
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: NodeEvent, v2: 'Entry', v3, v4=NotGiven, v5=None):
self.event = v1
self.entry = v2
self.new_value = v3
if v4 is not NotGiven:
self.old_value = v4
if v3 is NotGiven:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: argparse.PARSER, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: argparse.PARSER, v2: str, v3: str):
if v1.output:
v4 = '/dev/stdout' if '-' == v1.output else v1.output
return open(v4, 'w',... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
v0 = Tuple[np.array]
```
Input Types: v0, np.array
Output Type: int
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0, v3: np.array) -> int:
v4 = 5
v5 = v3[:2] / v3[2]
(v6, v7, v8) = v2
v9 = v6 - v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, List[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: List[int]) -> int:
(v3, v4) = (0, 0)
while v3 < v1:
if v3 == v1 - 1:
break
if v3 == v1 - 2:
if v2[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: specs.Array, specs.Array
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: specs.Array, v2: specs.Array):
if v1.shape != v2.shape:
raise ValueError(f'invalid shape for spec {v1.name}: {v1.shape}, actual shape... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int, str, str, str, str, int, str, tuple, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=None, v2: int=None, v3: int=None, v4: str=None, v5: str=None, v6: str=None, v7: str=None, v8: int=None, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Optional[str]:
if len(self.proxy_list) == 0:
return None
v1 = self.current
v2 = self.proxy_list[v1]
if v1 + 1 >= len(self.proxy_li... |
Imports:
```python
import base64
import mimetypes
import os
import requests
import typing
```
Type definitions:
Input Types: io.IOBase, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: io.IOBase, v2: str=None) -> str:
v1.seek(0)
if v2 is not None:
v3 = getattr(v1, 'n... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[int], str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[int]=None, v2: str='', v3: str='') -> Any:
if v1 is None:
v1 = self._licence_ids.get_new_id()
elif self._licence_id... |
Imports:
```python
import numpy as np
from matplotlib import pyplot as plt
import typing
```
Type definitions:
Input Types: pd.DataFrame, Dict
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: Dict=None) -> Dict:
if v2 is None:
v2 = {'n_bins': 200, 'log_sca... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str
Output Type: list
Dependencies:
```python
def v0(v1: str) -> str:
v2 = []
for v3 in v1.split('/'):
(v4, v5) = v3.split(':')
v2.append('{{{}}}{}'.format(NAMESPACES[v4], v5))
return '/'.join(v2)
```
Function Name: v6... |
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 self.dependencies:
return
self.db.save(v1, self.dependencies)
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, List[List[int]], List[List[int]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: List[List[int]], v3: List[List[int]]):
v4 = v1.clone()
for v5 in range(len(v2) - 1, ... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, Optional[torch.Tensor], Optional[int], str
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1: torch.Tensor, v2: torch.Tensor, v3: Optional[torch.Tensor]=None, v4: Optional[int]=None) -> Tuple[torch.Te... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = {}
v2 = {'TLV': DefaultEncoder, int.__name__: IntEncoder, str.__name__: StrEncoder, bytes.__name__: BytesEncoder}
def __init__(self):
super().__init__()
self.indent = 4
self.tag_size = 1
self.len... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=None, v3=None):
self.val = v1
self.left = v2
self.right = v3
```
Input Types: v0
Output Type: str
Dependencies:
```python
def v4(v5, v6):
if v5:
v6.append(chr(v5.val + ord('a')... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, bool, bool, bool, Any, Any, Any, Any, int
Output Type: Any
Dependencies:
```python
def v0(v1):
v2 = list('ACDEFGHIKLMNPQRSTVWY')
return ''.join([v2[el - 1] if el != 0 else '' for v3 in v1[0].argmax(axis=1)])
```
Functio... |
Imports:
```python
import os
from glob import glob
import typing
```
Type definitions:
Input Types: Union[AnyStr, os.PathLike]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[AnyStr, os.PathLike]):
try:
for v2 in glob(v1):
os.remove(v2)
except TypeErro... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: str
Output Type: pd.Series
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None) -> pd.Series:
v2 = self.df_filtered.corr()
v3 = v2.where(np.triu(np.ones(v2.shape), 1).astype(bool))
if v1 is not... |
Imports:
```python
import numpy as np
import torch
from torch.distributions import Categorical
import torch.nn as nn
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list:
v1 = 0
v2 = []
... |
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=None):
v3 = f'/get_plans/{v1}'
if v2:
v3 += f'&{v2}'
v4 = self.send_get(v3)
return v4
``` |
Imports:
```python
import datetime as dt
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.Series, int, int
Output Type: Tuple[Dict, Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.Series, *v4: List[pd.DataFrame], v2: int=OBSERVATION_WINDOW, v3: int=PREDICTION_WINDOW) -> ... |
Imports:
```python
import heapq
import typing
```
Type definitions:
```python
v0 = TypeVar('DictKey', str, int, float)
```
Input Types:
Output Type: Dict[v0, List[Any]]
Dependencies:
Function Name: v1
Function:
```python
def v1(self) -> Dict[v0, List[Any]]:
v2 = {}
for (v3, v4) in self._result.items():
... |
Imports:
```python
import uuid
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str) -> Dict[str, Any]:
if self._is_stopping:
return {}
v2 = str(uuid.uuid4())
v3 = await self.keys(v1)
if ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str):
v3 = ''
for (v4, v5) in enumerate(v1):
if not v5 in v2:
v3 += 'b'
elif v5 == v2[v4]:
v3 += 'g'
... |
Imports:
```python
import gzip
import shutil
import typing
```
Type definitions:
Input Types: io.BytesIO, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: io.BytesIO, v2: str, v3: str) -> None:
with gzip.open(v1, mode='rt', encoding=v2) as v4:
with open(v3, 'w') as... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float):
v2 = 0
self.ens.Init()
while v2 < v1:
self.ens.Iterate()
v2 += self.deltat
self.ens.t = v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
try:
return self.speed_hack / self.delta
except ZeroDivisionError:
return self.fps
``` |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any]) -> str:
v2 = v1.get('namespace', '')
if len(v2) == 0:
v2 = v1.get('author', '')
if re.match('^\\w+ \\w+', v2)... |
Imports:
```python
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 np.hstack((v1, np.ones((v1.shape[0], 1))))
```
```python
def v2(v3: np.ndarray) -> np.ndarray:
return v3[:, :-1]
```
Fun... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v1 = f'{self.dev_number}{v1}'
self._device.write(v1)
``` |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, *v2, **v3) -> None:
if not self.router.is_active:
logging.debug('Router is not actived, emit remote will not do anything, event_name... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
```python
def v0(v1: dict, v2: Tuple[str, ...]) -> dict:
v3 = v1[v2[0]]
if len(v2) == 1:
return v3
else:
for v4 in v2[1:]:
v3 = v3[v4]
return v3
```
Function Name: v5
... |
Imports:
```python
from torch.utils import data
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3, v4, v5: str):
v6 = torch.load(v5, map_location=v4)
v1.load_state_d... |
Imports:
```python
import difflib
import typing
```
Type definitions:
Input Types: pathlib.Path, pathlib.Path
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pathlib.Path, v2: pathlib.Path) -> List[str]:
if v1 == v2:
return []
if v1.drive or v2.drive:
... |
Imports:
```python
import qiskit
import numpy as np
import typing
```
Type definitions:
Input Types: qiskit.QuantumCircuit, np.ndarray, int
Output Type: Any
Dependencies:
```python
def v0(v1: qiskit.QuantumCircuit, v2, v3: int=1):
v4 = v1.num_qubits
if isinstance(v3, int) != True:
v3 = v3['num_layers']... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any) -> bool:
return True
for v2 in v1['tags']:
if 'プリンセスコネクト!Re:Dive' in v2['name']:
return True
if 'プリコネ' in v2['name']:
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1=None):
if v1:
self.allow_extensions = v1.allow_extensions
self.skipped_binary_extensions = v1.skipped_binary_extensions
else:
self.allow_extensions = True
... |
Imports:
```python
from collections import OrderedDict
import requests
from requests.exceptions import HTTPError
import csv
import typing
```
Type definitions:
Input Types: List[str], List[str]
Output Type: Dict[str, Dict]
Dependencies:
```python
def v0(v1: str, v2='\t', v3=';') -> str:
v1 = [row for v4 in csv.Dic... |
Imports:
```python
import json
import tensorflow as tf
import typing
```
Type definitions:
Input Types: config_dict.ConfigDict, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: config_dict.ConfigDict, v2: str):
with tf.io.gfile.GFile(v2, 'w') as v3:
json.dump(v1.to_dict(... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('ResourceType', bound='Resource')
```
Input Types: Optional[int], Optional[int]
Output Type: Iterable[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Optional[int]=None, v3: Optional[int]=None) -> Iterable[v0]:
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: Dict[str, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int) -> Dict[str, int]:
v3: Dict[str, int] = dict()
v4: int = 0
with open(v1, 'r') as v5:
v6 = next(v5)
try:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
self._collection.update_one({'username': v1}, {'$set': {'active': False}}, upsert=False)
return True
``` |
Imports:
```python
import subprocess
import sys
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='') -> None:
v2 = [sys.executable, '-m', 'stacksearch']
v2.extend(v1.split(' '))
subprocess.run(v2, check=True)
``... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any) -> None:
self.pack_32bit_uint(v1.get_size())
self.fmt.append(v1.fmt[1:])
self.size += v1.size
self.args.append(*v1.args)
``` |
Imports:
```python
from bisect import bisect_left
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
v2 = bisect_left(self, v1)
self.insert(v2, v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'AttrsTypedDict', str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'AttrsTypedDict', v2: str='') -> bool:
v3 = v1['requirements'].get('host', set()) or v1['requirements'].get('build', set()) or set()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[bool], Optional[str]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[bool], v2: Optional[str]) -> bool:
if v1 is not None:
return v1
return v2 is not None
``` |
Imports:
```python
import sqlite3
import typing
```
Type definitions:
```python
class v0(enum.Enum):
v1 = ('Submitted', False)
v2 = ('Judging', False)
v3 = ('Accepted', True)
v4 = ('Time Limit Exceeded', True)
v5 = ('Wrong Answer', True)
v6 = ('Compile Error', True)
def __init__(self, v7: s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, float, torch.Tensor, torch.Tensor, float, float, float, float, float, float, float, dict, bool, bool, bool, str
Output Type: dict
Dependencies:
Function Name: v0
Func... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if '/' in v1:
return v1.split('/', 1)[-1]
else:
return ''
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, int, int
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1: int, v2: int) -> torch.Tensor:
return torch.randint(low=0, high=v2, size=[v1])
```
Function Name: v3
Function:
```python
def v3(v4: torch.Tensor, v5: ... |
Imports:
```python
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):
if v2:
self._errors += v1
else:
self._complete += v1
if self._files_listener:
self._files_listen... |
Imports:
```python
import datetime as dt
import pandas as pd
import typing
```
Type definitions:
Input Types: str
Output Type: dt.timedelta
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> dt.timedelta:
v2 = dt.timedelta(microseconds=40000)
if not pd.isna(v1):
if v1.lower() == 's... |
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.__requirements.items():
if not v2.is_done():
raise Exception('Benchmarking not completed. Please use report_benc... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: None
Dependencies:
```python
def v0(v1: Union[List[float], complex]) -> complex:
if isinstance(v1, list) and len(v1) == 2:
return complex(v1[0], v1[1])
elif isinstance(v1, complex):
return v1
raise TypeErr... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
with self.order_count_lock:
self.order_count += 1
v1 = f'{self.connect_time}{self.order_count}'
return v1
``` |
Imports:
```python
import warnings
import torch
import typing
```
Type definitions:
Input Types: int, Optional[str]
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=1, v2: Optional[str]=None) -> List[int]:
v3 = self.synset_start_idxs[v2] if v2 is not None else 0
... |
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 not v1.startswith('$'):
return v1
v1 = v1.strip()[1:]
if not v1.endswith(')'):
return v2 + v1 + '{}'
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, torch.Tensor], int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, torch.Tensor], v2: int):
v3 = self.model.training_step(v1)
v4 = self.calc_loss(v3, v1, rt_config={'current_step': sel... |
Imports:
```python
import requests
from requests.exceptions import HTTPError
import typing
```
Type definitions:
Input Types: str, str, bool, dict
Output Type: Union[str, dict, list]
Dependencies:
```python
def v0(v1: requests.models.Response, v2: str='') -> Union[str, dict, list]:
(v3, v4, v5) = _raise_for_status... |
Imports:
```python
from plotly import __version__
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import plotly
import plotly.plotly as py
import plotly.graph_objs as go
import plotly.tools as tls
import typing
```
Type definitions:
Input Types: pd.DataFrame, pd.DataFrame, str, str, str, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: bytes
Dependencies:
```python
def v0(v1: int, v2: int) -> int:
v1 = v1 & 65535
v3 = v1 % v2
if v1 > 32767:
return -v2 + (v3 - 65536) % v2
return v3
```
Function Name: v4
Function:
```python
def v4(v5: bytes) ... |
Imports:
```python
from tensorflow.python.keras import backend as K, Input, Model
from tensorflow.python.keras.callbacks import Callback, History
from tensorflow.python.keras.layers import Layer, Dense, Lambda
from tensorflow.python.keras.losses import binary_crossentropy
import tensorflow as tf
import typing
```
Type ... |
Imports:
```python
import datetime as dt
import typing
```
Type definitions:
Input Types: dt.datetime
Output Type: dt.datetime
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dt.datetime) -> dt.datetime:
if isinstance(v1, dt.date):
return dt.datetime(v1.year, v1.month, v1.day)
elif isin... |
Imports:
```python
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import typing
```
Type definitions:
Input Types: nn.Module, Any
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
return torch.sqrt(torch.mean((v1 - v2) ** 2))
```
Function Name: v3
Func... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
v1: List[str] = []
for (v2, v3) in self.member_infos.items():
v1.append(self.member_infos[v2].id)
return v1
``` |
Imports:
```python
import logging
import logging.handlers
import typing
```
Type definitions:
Input Types: Union[str, os.PathLike[str]], int, Union[None, int], Union[None, int], Union[None, bool], Union[None, str]
Output Type: logging.Handler
Dependencies:
```python
def v0(v1: Union[str, os.PathLike[str]], v2: int, v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
(v1, v2) = self.make_request('GET', 'devices', access_token=self.user_tok)
self.assertEqual(v1.code, 200)
return [d['device_id'] for v3... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=None, v3=None):
self.val = v1
self.left = v2
self.right = v3
```
Input Types: v0
Output Type: int
Dependencies:
Function Name: v4
Function:
```python
def v4(self, v5: v0) -> int:
v6 =... |
Imports:
```python
import os
import os.path as path
import typing
```
Type definitions:
Input Types: str, str, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3) -> None:
if not os.path.exists(v1):
os.mkdir(v1)
v4 = path.join(v1, v2)
with open(v4... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.