text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
```python
@cache
def v0(v1: int, v2: int) -> int:
if self.is_palindromic(self.input[v1:v2]):
return len(self.input[v1:v2])
v3 = v0(v1 + 1, v2)
v4 = v0(v1, v2 - 1)
return max(v3, v4)
```
Function ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: NoReturn
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray) -> NoReturn:
v3 = 2
for v4 in range(v1.shape[1]):
(v5, v6) = self._find_threshold(v1[:, v4],... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int) -> None:
v3 = self.gh.get_repo(v1).get_pull(v2)
if v3.mergeable_state == 'clean':
print(f'merging pr:{v2}')
v3.merge... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Loan'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Loan'):
v2 = self.years * 12
v3 = min(self.months[1], v1.months[1]).loan
for v4 in range(2, v2 + 1):
v5 = min(self.months[v4], v1.months... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: int):
"""
Initializes the key to the value passed to the constructor and initializes
all other values to None.
Parameters
----------
key : int
The key of the node.
Returns
-... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
self._buffer = []
for v2 in v1:
self._buffer.append(v2.decode())
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Property'
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Property') -> str:
for v2 in self.getCategories():
v3 = self.getCategoryProperties(v2)
if v1 in v3:
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[ListNode], Optional[ListNode]
Output Type: Optional[ListNode]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[ListNode], v2: Optional[ListNode]) -> Optional[ListNode]:
if v1 == None and v2 == None:
r... |
Imports:
```python
from tensorflow.keras.wrappers.scikit_learn import KerasRegressor
from tensorflow.python.keras.models import Sequential
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Union[np.array, Tuple[np.array, np.array, np.array]]
Dependencies:
Function Name: v0
Function:
```python
def... |
Imports:
```python
import datetime
import numpy as np
from sklearn.model_selection import train_test_split
import tensorflow as tf
import typing
```
Type definitions:
Input Types: str, float, Optional[float], bool, str, float, float, int, Optional[dict], int, int, int
Output Type: Any
Dependencies:
```python
def v0(v1... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: []
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: []):
v2 = []
v3 = []
v4 = dict()
for v5 in v1:
v6 = v5['metric']
v7 = v5['value']
v8 = v5['component']
... |
Imports:
```python
import csv
import datetime
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: LogEntry
v2: Optional[float]
v3: Optional[navigation.Angle]
v4: Optional[datetime.timedelta]
```
Input Types: TextIO, Iterator[v0], list[str]
Output Type: None
Dependencies:
```python
de... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('tkToplevel', bound=tkinter.Toplevel)
```
Input Types: v0, Any, Any
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0, v3=True, v4=True):
v2.attributes('-topmost', v3)
if v4:
v2.lift()
``` |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
try:
subprocess.run(self._cmd)
except FileNotFoundError:
pass
``` |
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 v1 == 'Gene':
return f' NCBIGene{v2} '
elif v1 == 'SNP':
return f' SNP{v2.lower()} '
elif v1 == 'Species':
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: float) -> float:
if abs(v1) < v2:
return 0
return v1
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
```python
def v0() -> 'returns a dict of elements: {element: description}':
v1 = 'PeriodicTableJSON.json'
v2 = open(v1, 'r')
v3 = json.load(v2)['elements']
v4 = {}
for v5 in v3:
... |
Imports:
```python
import collections
import typing
```
Type definitions:
Input Types:
Output Type: '_SpellingCorrector'
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> '_SpellingCorrector':
self.occurrences = collections.Counter()
return self
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: int) -> float:
async with self.bot.connect_pool.acquire() as v3:
v4 = await v3.fetchrow('SELECT seconds FROM timetable WHERE m... |
Imports:
```python
from gc.core import config
from gc.core.AddressState import AddressState
from gc.core.OptimizedAddressState import OptimizedAddressState
from gc.core.MultiSigAddressState import MultiSigAddressState
from gc.core.Block import Block
from gc.core.ChainManager import ChainManager
from gc.core.ESyncState ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: typing.Type[io.IOBase], Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: typing.Type[io.IOBase], v2=0):
from sys import getsizeof
v3 = v2
v1.seek(v3)
for v4 in v1.readlines():
v3 += len(v4)
... |
Imports:
```python
from os import stat
from os.path import dirname, exists
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
self.rootpath = self._get_rootpath()
self.env = self._get_env()
self.configloc = self._ge... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1) -> None:
v2 = len(self)
for v3 in v1:
self[v2] = v3
v2 += 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: (float, float)
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> (float, float):
v1 = (self.maximum_soc - self.minimum_soc) * self.capacity / 100.0
v2 = v1 / (1 / (self.discharge_efficiency / 100.0) * self.maxi... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1: Message, v2: int=None, v3: str='', v4: str='') -> None:
self._message = v1
self.uid = v2
self.reply_to_pattern = v3
self.references_pattern = v4
def v5(self, v6: str) -> ty... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True) -> Dict[str, Any]:
v2 = {'type': 'Node', 'module': self.module, 'name': self.name, 'autotrigger': self.autotrigger, 'inputs': {key: v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: Tuple[float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float=0.1) -> Tuple[float, float]:
(v2, v3) = (-1.0, 1.0)
if v1:
v2 += v1 / 2.0
v3 -= v1 / 2.0
return (v2, v3)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> dict:
v2 = v1.shape[0]
v1 = v1.astype(np.float64)
if v2 % 2 == 0:
v3 = (v1[int(v2 / 2)] + v1[int(v2 / 2) - 1]) / 2.0
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> None:
for v2 in v1:
self.log.info('Executing delete of %s', v2)
self.sftp_hook.delete_file(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> tuple:
v2 = v1.split(' ')
v3 = v2[0]
v4 = int(v2[1])
return (v3, v4)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
```python
def v0(v1: any) -> any:
if isinstance(v1, bool):
return 'true' if v1 else 'false'
return v1
```
Function Name: v2
Function:
```python
def v2(v3: dict) -> dict:
if isinstance(v3, dict):... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(enum.Enum):
v1 = '/accounts/login/'
v2 = '/cards/addcard'
```
Input Types: str, v0
Output Type: Any
Dependencies:
Function Name: v3
Function:
```python
def v3(self, v4: str, v5: v0, *v6, **v7):
v8 = self.url(v5)
return self.sessi... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.array, np.array, int
Output Type: typing.Tuple[float, float, float, int, np.array]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.array, v2: np.array, v3: int=None) -> typing.Tuple[float, float, float, i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: Iterator[str]
Dependencies:
```python
def v0(v1: Match[str]) -> str:
v2 = v1.group()
if v2 in _xmlBuiltinEntities:
return _xmlBuiltinEntities[v2]
elif v2 >= ' ':
return '&#x%04X;' % ord(v2)
el... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if not v1:
print('')
return None
if not self.ticker and v1 in self.CHOICES_TICKER_DEPENDENT:
print("No ticker se... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str, v2: int) -> None:
self.title = v1
self.start_hour = v2
def v3(self) -> str:
v4 = 'AM' if self.start_hour < 12 else 'PM'
return f'{self.start_hour % 12} {v4} - {self.title}'
``... |
Imports:
```python
import pathlib, os
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(*v1: Optional[List[str]]) -> List[str]:
if not v1:
v1 = ['commands']
v2 = pathlib.Path(os.path.join(os.getcwd(), 'src', *v1))
v3... |
Imports:
```python
import binascii
import hashlib
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
v2 = hashlib.sha256()
v2.update(bytes(v1, encoding='utf8'))
v3 = v2.hexdigest()
v4 = binascii.unhexlify... |
Imports:
```python
import os
import shutil
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: str
Dependencies:
```python
def v0(v1: str) -> bool:
return os.path.isfile(v1)
```
Function Name: v2
Function:
```python
def v2(v3: str, v4: List[str]) -> str:
if v0(v3):
return v3
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, datetime, int, str, int, str, int
Output Type: Dict[str, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: datetime, v3: int, v4: str, v5: int, v6: str, v7: int) -> Dict[str, int]:
self.human_resources[v1].us... |
Imports:
```python
from math import gcd, lcm
import typing
```
Type definitions:
Input Types: int, typing.Iterator[typing.Tuple[int, int],]
Output Type: typing.NoReturn
Dependencies:
```python
@lru_cache(maxsize=None)
def v0(v1: int, v2: int, v3: int) -> int:
if v1 == n:
return lcm(v2, v3)
v4 = v0(v1 +... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
if self.size == self.MAX_SIZE:
return False
else:
if self.rear == -1:
self.front = self.rear = 0
else... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
self.run_command()
self.order_result()
self.ans()
return self.__command_result_dict
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Union[str, int, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> Union[str, int, float]:
if v1.startswith('Number') or v1 == 'Rank':
return int(v2.replace(',', ''))
if v1.sta... |
Imports:
```python
from skimage import io
from skimage import color
from skimage import measure
from skimage import feature
from skimage import transform
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, int, int
Output Type: None
Dependencies:
Function Name: v0
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path, v2=False):
self.__sqlite_db_path = v1.as_posix()
if v2:
v1.unlink()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> int:
if len(v1) < 3:
return 0
v2 = 0
v3 = 1
v4 = 1
v5 = v1[v3] - v1[v2]
v6 = 0
while v3 != len(v1) and v2 != len(v1):
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Union[str, set, re.Pattern]) -> None:
self.domain: Union[str, set, re.Pattern] = v1
self.endpoints: set = set()
self.before_serve: set = set()
self.after_serve: set = set()
def v2(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes) -> bytes:
v2 = self._prvkey.ecdsa_sign(v1)
return self._prvkey.ecdsa_serialize(v2)
``` |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, list, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: list, v3: str='_') -> str:
v4 = []
v5 = re.split('(\\b)', v1)
for v6 in v5:
v7 = v3 if v6 in v2 else v6
v4.a... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: pd.DataFrame, bool
Output Type: Any
Dependencies:
```python
def v0(v1: list):
v2 = [element for v3 in v1 if v3 != 0]
v4 = np.sum(v2)
return v4
```
```python
def v5(v6: list, v7: bool):
v8 = 0
v9 = 0
v10 = []
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str) -> str:
v4 = len(v2)
try:
v5 = v1.index(v2)
except:
return ''
if v5 == -1:
return ''
if v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pathlib.Path, pathlib.Path, int
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pathlib.Path, v2: pathlib.Path, v3: int) -> List[str]:
v4 = open(v2, encoding='utf-8')
v5 = list(v4)
v6 = v5[:v3 -... |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.Series, pd.Series
Output Type: np.array
Dependencies:
```python
def v0(v1: pd.Series):
if isinstance(v1, pd.Series) or isinstance(v1, pd.DataFrame):
return v1.values.ravel()
return v1
```
Funct... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int):
with self.lock:
v3 = self.activeRooms.get(v1)
if v3 is None:
return False
v3.setMessageID(v2)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._pending_spawn = True
self.lifesequence = self.lifesequence + 1 & 127
self._quadexpiry = None
self.position = b''
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1: bytes = bytes()
v2: bytes = bytes(self.read_byte())
while v2 != b'\x00':
v1 += v2
return v1.decode('utf-8')
``` |
Imports:
```python
import os
import socket
import typing
```
Type definitions:
Input Types: socket.socket, Any
Output Type: Any
Dependencies:
```python
def v0(v1: socket.socket):
print('Closing connection with server. Ending session. Goodbye.')
v1.shutdown(socket.SHUT_WR)
v1.close()
os._exit(0)
```
Fun... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, **v2: _PossibleArgumentTypes) -> List[str]:
v3 = self.list_status(v1, **v2)
if len(v3) == 1 and v3[0].pathSuffix == '' and (v3[0].type == 'FI... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('ParamsT', bound='Params')
```
Input Types:
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self: v0, **v2: Any) -> v0:
if self._immutable:
raise TypeError('This Params instance is immutable: %s' % sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3) -> int:
v4 = int(v1[v3]['timestampMs']) - int(v1[v2]['timestampMs'])
return v4 / (6 * 10 ** 4)
``` |
Imports:
```python
from typing import Any, List, Mapping
import typing
```
Type definitions:
Input Types: object, object, str
Output Type: None
Dependencies:
```python
def v0(v1: Mapping, v2: Mapping, v3: str) -> None:
v4 = True
for v5 in v2.keys():
v6 = f'{v3}[{v5}]'
if v5 not in v1:
... |
Imports:
```python
import ast
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0(*v2, v1=False):
v3 = os.path.join(*v2)
if not os.path.isfile(v3):
raise FileNotFoundError(v3)
with codecs.open(v3, 'r') as v4:
return v4.readlines() if v1 else v4.... |
Imports:
```python
import logging
import os
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
```python
def v0(v1: str) -> str:
return Fore.RED + v1 + Fore.RESET
```
```python
def v2(v3: str, v4: list, v5: list) -> None:
import yagmail
v6 = ''
for (v7, v8) in zip(v5, v4)... |
Imports:
```python
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import typing
```
Type definitions:
Input Types: Tuple[torch.Tensor, torch.Tensor]
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple[torch.Te... |
Imports:
```python
import torch
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1=None, v2='cpu'):
self.device = v2
if v1 is None:
v1 = retrieve_pretrained_model('tacotron2')
if isinstance(v1, str):
v1 = Path(v1)
if (v1 / '... |
Imports:
```python
import os
import pandas as pd
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: str
v2: str
v3: str
v4: str
v5: int
v6: int
v7: int
v8: int
v9: int
```
Input Types: v0, Any
Output Type: np.ndarray
Dependencies:
```python
def v10(v11: v0, v12=Tr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, List[str]]
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, List[str]]) -> List[str]:
v2 = []
for (v3, (v4, v5)) in enumerate(v1.items()):
for (v6, v7) in enumerate(v5):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
v2 = self.__incr('all', v1)
if v2:
return self.__incr('dislike', v1)
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional['TreePath'], Optional['TreePath']
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional['TreePath']=None, v2: Optional['TreePath']=None):
try:
return self._augmentedtree.get_pathmap(v1, v2... |
Imports:
```python
import sys
import logging
import json
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: None
Dependencies:
```python
def v0(v1, v2):
v3 = '$.' + v2
logging.info("Using jsonpath search text '{}'".format(v3))
v4 = parse(v3)
v5 = v4.find(v1)
v6 = []
if ... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = re.findall('([0-9]+)\\s*(?:\\(([\\w\\s+,]+)?\\)?)?\\s*([\\w\\s]+)?', v1)
if len(v2) == 0:
self.logger.warning('Failed to pa... |
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.extensions:
try:
if v2.extension.finalize:
v2.extension.finalize()
except AttributeError... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> Any:
if '__type__' in v1:
if v1['__type__'] == 'tuple':
return (v1['class_tree'], v1['count'])
assert v1['__type__'] == 'dict'... |
Imports:
```python
import matplotlib.pyplot as plt
import numpy as np
import typing
```
Type definitions:
Input Types: GridSearchCV, pd.DataFrame, Union[str, 'PathLike[str]']
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: GridSearchCV, v2: pd.DataFrame, v3: Union[str, 'PathLike[str]']... |
Imports:
```python
import numpy as np
from scipy.spatial.distance import cdist
from scipy.sparse.csgraph import minimum_spanning_tree, laplacian
from sklearn.neighbors import NearestNeighbors
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: None
Dependencies:
Function Name: v0
Function:
```pyt... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Union[str, Path]
Output Type: Union[Dict[str, Any], List[Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[str, Path]) -> Union[Dict[str, Any], List[Any]]:
with open(v1, 'r') as v2:
return json.load(v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bytes
Dependencies:
```python
def v0(v1: str, v2: str='r', v3: str=None):
if v3:
return open(v1, v2, encoding=v3)
else:
return open(v1, v2)
```
```python
def v4(v5: str):
return v0(v5, 'rb')
```
Function Na... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if v1 in ['e-mail', 'mail']:
return 'email'
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
super().setUp()
self.tempDir = self._createTempDir(purpose='tempDir')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = v1.split('.')
v3 = v2.pop()
v4 = ''
for v5 in v2:
v4 += v5
if not v5 == v2[-1]:
v4 += '.'
return (v4,... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, bool
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: bool=True) -> float:
v3 = {'': 0, 'k': 1, 'm': 2, 'g': 3, 't': 4, 'p': 5}
v4 = re.match('(\\d+(?:[.,\\s]\\d+)*)(?:\\s*)((?:[ptgmk]i... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = len(self.liste_voitures)
v1 += sum([len(file) for v2 in self.dict_listes_attente.values()])
return v1
``` |
Imports:
```python
import torch
import numpy as np
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, Any, Any
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: torch.Tensor, v2: torch.Tensor, *, v3=None, v4=None) -> torch.Tensor:
assert v1.dim() == 1
as... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bytes:
v1 = next(self.get_consumer())
return v1.value if v1 else b''
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: list):
v3 = locals()
v4 = {'tags': ['organizations', 'configure', 'brandingPolicies', 'priorities'], 'operation': 'updateOrganizationBran... |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.Dict[str, t.Any]
Output Type: t.Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: t.Dict[str, t.Any]) -> t.Dict[str, str]:
v2 = len(v1)
v3 = max([len(_) for v4 in v1.keys()])
v5 = {v4: f'{i + 1:0{len(str(v2))... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.fire_hook:
self.kracken_hook_latch.set(True)
self.winch_motor.set(self.winch_desired_output)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> int:
v2 = 0
for (v3, v4) in enumerate(v1):
v5 = v1[v3 + len(v1) // 2] if v3 < len(v1) / 2 else v1[v3 - len(v1) // 2]
if v4 == v5:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
if self.size != 0:
return self.progress / self.size * 100
return 0
``` |
Imports:
```python
from copy import copy
import typing
```
Type definitions:
Input Types: Any
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> Dict:
v2 = copy(v1)
if 'value' not in v2:
v3 = {}
for v4 in ('table', 'index', 'column'):
if v4 in v2:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor):
v2 = v1.shape
v1 = v1.reshape(-1, self.d_model)
v3 = super().forward(v1)
return v3.reshape(v2)
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Any
Output Type: Dict
Dependencies:
```python
async def v0(v1: str) -> Dict:
v2 = f'https://codefun.vn/api/users/{v1}'
try:
v3 = await network.get_net(v2, json.loads, json.JSONDecodeError)
except Exception as ex_type:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
```python
def v0(v1: str, v2: int, v3: int) -> bool:
return int(v1) >= v2 and int(v1) <= v3
```
Function Name: v4
Function:
```python
def v4(v5: str) -> bool:
if v5[-2:] == 'cm':
return v0(v5[:-2], 1... |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as mcol
import matplotlib.ticker as mticker
import matplotlib.gridspec as gridspec
from matplotlib.patches import Patch, PathPatch
from matplotlib.lines import Line2D
import typing
```
Type definitions:
Input Types: dict, An... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
async def v0(v1: ProfileInfo) -> bool:
return False
```
```python
async def v2(v3: ProfileInfo) -> bool:
return True
```
Function Name: v4
Function:
```python
def v4(self) -> None:
v5 = self.regis... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Text
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Text):
for (v2, v3) in self.job_configs.items():
v3.project_path = v1
``` |
Imports:
```python
from datetime import datetime
import copy
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> list:
v2 = int(len(v1))
v3 = int(11)
v4 = int(v2 / v3)
v5 = [{}] * v4
v6 = {'Block': None, 'S... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: List[dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=20000, v2: int=None) -> List[dict]:
v3 = ['variant', 'totals', 'sum_values', 'avg_values', 'prob_being_best']
v4 = [round(i[0] / i[1], 5... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
v1 = -1
v2 = -1
v3 = self.getSumMasterCapacities() / self.getMasterNodeCount()
for v4 in self.__nodeList:
if v4.master == True:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.