text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: object
Output Type: List['PolicyShard']
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: object) -> List['PolicyShard']:
if not isinstance(v1, self.__class__):
raise ValueError(f'Cannot union {self.__class__.__name__} ... |
Imports:
```python
from matplotlib import pyplot as plt, cm as cm, colors as ml_colors
import typing
```
Type definitions:
Input Types: gms.GMSResult, pd.Series, gms.CausalParamBounds, Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: gms.GMSResult, v2: pd.Series, v3: gms.CausalPara... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
v2 = re.match('(.*)__(.*)__(.*)', v1)
if v2:
return v2.group(1) + '<strong>' + v2.group(2) + '</strong>' + v2.group(3)
return v1
```
```python
def v3(v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if '://' not in v1:
v1 = 'https://' + v1
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[str, List[str]]
Dependencies:
```python
def v0(v1: str) -> str:
v1 = v1.replace('\t', '`,`')
v1 = f'`{v1}`'
return v1
```
Function Name: v2
Function:
```python
def v2(v3: str) -> Tuple[str, List[str]]:
v4 = v3[0]... |
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=None) -> str:
if v1 == 'string':
if v2 == 'date-time':
return 'datetime.datetime'
elif v2 == 'date':
ret... |
Imports:
```python
import numpy as np
from numpy.linalg import det, inv
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:
self.classes_ = np.unique(v2)
(v3,... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: str, str, FrozenSet[str]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: FrozenSet[str]) -> bool:
v4 = frozenset(v2.split())
v5 = v4 - v3
if v5:
for v6 in v5:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Tree.Task
Output Type: str
Dependencies:
```python
def v0(v1: Tree.Task) -> Dict[str, str]:
v2 = {}
v3: List[Any] = list(v1.children)
while v3:
v4 = v3.pop()
if isinstance(v4, Tree.Decl):
v3.append(v4.type)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str) -> Dict[str, Any]:
v4 = self._send_graphql_request(query='\n mutation($mcon_id: String!, $key: St... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None):
self.train_ds = self.dataset(self.data_root, self.use_feat, 'train', False, self.captions_per_image, self.min_word_freq, self.train_transform)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> List[int]:
v1 = self._check_int(v1)
return self._local_corr.setdefault(v1, self._non0ind(v1))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, bool
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *, v1: bool=False, v2: bool=False) -> np.ndarray:
if not self._validate_csv and self._draws is None:
self.validate_csv_files()
if self... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: APIInfo
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> APIInfo:
v1: APIInfo = super().get_info()
if self.contact:
v1['contact'] = self.contact
if self.license:
v1['license'] = self.licens... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
self.newsController.delete(v1)
self.currentMenu[1].stop()
self.__supportCUIFunc()
``` |
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:
assert v1 in self.columns
assert v2 in self.categorical_space[v1]
return f'{v1}:{v2}'
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: dict, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2=None):
if np.random.rand() < self.blank_percentage:
return None
return self.fake.last_name()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> int:
if v1 == 'fit':
return self.train_len
elif v1 == 'val':
return self.val_len
elif v1 == 'test':
return self.test_len
... |
Imports:
```python
import numpy as np
from pandas._libs import Timestamp, algos as libalgos, internals as libinternals, lib, writers
from pandas._libs.internals import BlockPlacement
from pandas._typing import ArrayLike, DtypeObj, F, Shape, npt
from pandas.util._decorators import cache_readonly
from pandas.util._except... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool=False) -> None:
v3 = self.load(v1)
self.token_to_index = self._check_specials(v3.token_to_index)
self.index_to_token = {v: k fo... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any]) -> pd.DataFrame:
v2 = None
for (v3, v4) in v1.items():
if v2 is None:
v2 = v4['pre... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: bool
Dependencies:
```python
def v0(v1):
v2 = v1.get(pid_key)
if v2 and int(v2) == user_id:
v1.multi()
v3 = v1.delete(pid_key)
if v3:
v1.zrem(user_key, pid)
```
Function Name: v4
Functi... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1):
self.val = v1
self.left = None
self.right = None
```
Input Types: v0
Output Type: int
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: v0) -> int:
v4 = self.levelOrder... |
Imports:
```python
import subprocess
import os
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = os.environ.copy()
v2['LANG'] = 'C'
(v3, v4) = subprocess.Popen(v1, stdout=subprocess.PIPE, stderr=subprocess... |
Imports:
```python
import logging
import pathlib
import typing
```
Type definitions:
Input Types: pathlib.Path, Optional[set]
Output Type: List[pathlib.Path]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pathlib.Path, v2: Optional[set]=None) -> List[pathlib.Path]:
if not v2:
v2 = se... |
Imports:
```python
import numpy as np
from numpy.linalg import det, inv
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray) -> np.ndarray:
if not self.fitted_:
raise ValueError('Estimator must ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: Optional[str]=None) -> dict:
if v1 is None:
return await self.query('user_info()', scope='@t')
return await self.query('user_in... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
v1 = abs((self.toPythonDate() - self.date_0).days)
v2 = self.hh * 0.041666667 + self.mm * 0.000694444 + self.ss * 1.1574e-05 + self.ms * 1.2e-08
... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> str:
try:
v2 = v1['Link'].split(',')
for v3 in v2:
if 'rel="next"' in v3:
return v3.spl... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float) -> None:
if v1 != self.last_pitch_played:
return
self.op1.note_off(v1 * self.rate1, v2)
self.op2.note_off(v1 * s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
for v2 in range(v1):
print((self.espacios_arriba(v1) + '/' + '\\') * (v2 + 1))
print((self.espacios_abajo(v1) + '/' + '__' + '\\') * (... |
Imports:
```python
import itertools
import os
from pathlib import Path
from shutil import copy
import typing
```
Type definitions:
Input Types: bytes, bytes, str, int, bytes
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: int, v3: str):
if not os.path.isdir(v1):
print('dest_dir:', v1, 'is not... |
Imports:
```python
import torch
from torch.utils.data import DataLoader
import typing
```
Type definitions:
Input Types:
Output Type: torch.jit.ScriptModule
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> torch.jit.ScriptModule:
v1 = next(iter(self.dataloader))
self.torchscript_model = to... |
Imports:
```python
import typing
```
Type definitions:
Input Types: object, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: object, v2: list):
v3 = v1[:, v2]
return v3
``` |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[Tuple[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Optional[Tuple[str, str]]:
v2 = '([^aeiou]*?)([aeoiu].*)'
return re.findall(v2, v1.lower())[0]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> List[int]:
(v2, v3) = (min(v1), max(v1))
v4 = [0] * (v3 - v2 + 1)
for v5 in v1:
v4[v5 - v2] += 1
return [i + v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
v2 = 6
v3 = 0
v4 = v1 >> 16 & 1
v5 = v1 >> 8 & 255
v6 = v1 & 255
v7 = 254
v8 = v2 << 26
v9 = v3 << 25
v10 = v4 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None) -> Any:
if v1 in self.data:
return self.data[v1]
for v2 in self.backup_list:
v3 = self._load(dump_name=str(v2))
if v1 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, Namespace, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray, v3: Namespace, v4: int) -> None:
(v5, v6) = v2
for (v7, v8) in self.loggers.items():
... |
Imports:
```python
from dataclasses import asdict, dataclass
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, Any]:
v1 = asdict(self)
if self.last_inspection:
v1['last_inspection'] = self.last_in... |
Imports:
```python
import typing
```
Type definitions:
Input Types: msg.TakeItem
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: msg.TakeItem):
if not self.is_mine(v1):
return
v2 = v1.item_id
self.take_items.append(v2)
``` |
Imports:
```python
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:
if v1['closest-tag']:
v2 = v1['closest-tag']
if v1['distance'] or v1['dirty']:
v2 += '.post%d' % v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor):
for v2 in self.modules[::-1]:
v1 = v2.backward(v1)
return 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 = len(v1)
assert v1.shape == (v2, 3)
v3: np.ndarray = v1[:, 0]
v4: np.ndarray = v1[:, 1... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: Union[torch.Tensor, List[List[List[int]]]], Optional[torch.Tensor]
Output Type: List[Dict[Tuple[int, ...], Set[int]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[torch.Tensor, List[List[Lis... |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: List[int], int
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: int) -> list:
v3 = self._sum_tree.reduce()
v4 = self._min_tree.reduce() / v3
v5 = (self._valid_count * v4) **... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.Series, Any, Any, Any
Output Type: Tuple[pd.Series, pd.Series]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.Series, v2=12, v3=26, v4=9) -> Tuple[pd.Series, pd.Series]:
v5 = self.__ema1(v1, v2)
v6 = self.__ema1(v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = {}
if hasattr(self, 'store_id'):
v1['storeId'] = self.store_id
if hasattr(self, 'language'):
v1['language'] = self.language
... |
Imports:
```python
import torch
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._mean_x is None:
self._mean_x = torch.zeros(v1.shape[1]).to(self._device)
self._mean_y = torch.zero... |
Imports:
```python
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True):
(v2, v3) = plt.subplots(ncols=2)
v4 = ('whole', 'wobble')
v5 = ('Analyzed Image', 'Wobble Circle')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3) -> None:
(v4, v5, v6, v7, v8) = self.step(v1)
self.log(f'final_{self.data_module.testing_names[v3]}_loss', v8.item())
self.log_me... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Dict[Fields, Fields]
```
```python
v1 = Tuple[Tuple[str, ...], ...]
```
Input Types: v1, v0
Output Type: Any
Dependencies:
```python
def v2(v3: v1, v4: int, v5: int):
v6 = [(v5 - 1, v4 - 1), (v5 - 1, v4), (v5 - 1, v4 + 1), (v5, v4 - 1), (v5, v4 +... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, float
Output Type: (np.ndarray, list)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: float=-1.0) -> (np.ndarray, list):
v3 = [[0, 2], [1, -1], [-1, -1]]
v3 = np.asarray(v3)
v3... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Node, v2=None, v3=None, v4=None, v5=None, v6: int=0):
self.node = v1
self.parent: v0 = v2
self.children: list[v0] = v3
self.first_child: v0 = v3[0] if v3 else None
self.left_sib... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = v1.replace('"', '').split(' ')
v3 = ''
for v4 in v2:
v3 += v4[0].capitalize()
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[transport.PTransportSettings]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[transport.PTransportSettings]=None) -> str:
v1 = self.encode_path_param(v1)
v3 = self.post(f'/... |
Imports:
```python
import torch
from torch.nn import functional as F
from torch.utils.data import Dataset
import typing
```
Type definitions:
Input Types: List[str], Optional[int]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: Optional[int]=None):
v3 = []
... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = []
for v2 in self.policies:
for v3 in json.loads(v2['PolicyDocument'])['Statement']:
v3['Sid'] = f"{self.id}/{v2['... |
Imports:
```python
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
import numpy as np
import typing
```
Type definitions:
Input Types: Sequential, Any, dict
Output Type: Any
Dependencies:
```python
def v0(v1: Sequential, v2: int, v3: st... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.image = self._get_image_name()
self.log.debug('Starting with image: %s' % self.image)
return super().start()
``` |
Imports:
```python
import torch
import os
import os.path as osp
import typing
```
Type definitions:
Input Types: str
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1: str) -> torch.Tensor:
if not os.path.isfile(v1):
raise ValueError('Expected a valid file path.')
v2 = os.path.getsize(v1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Text
Output Type: List[Text]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Text) -> List[Text]:
if not v1:
return []
return [email.strip() for v2 in v1.split(',')]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: v1.Client, typing.Sequence[models.Address]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: v1.Client, v2: typing.Sequence[models.Address], **v3):
v4 = '/account/properties'
v5 = {'addresses': [i.address for v6 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if v1.startswith('/'):
return f'file://{v1}'
else:
return v1
``` |
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.DEFAULT_NUMBER_VARIABLES.items():
self._number_variables.add_variable(v1, v2)
``` |
Imports:
```python
from urllib.parse import urljoin
from urllib.parse import urlparse
from urllib.request import pathname2url
from urllib.request import url2pathname
import os
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> None:
if self._profile_name not in self._credentials:
self._credentials[self._profile_name] = {}
if v2 is None:
s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
if v1:
for v2 in v1:
self.add(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dt.datetime, dt.datetime, int
Output Type: List[Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dt.datetime, v3: dt.datetime, v4: int=20, **v5) -> List[Dict]:
v6 = self._fetch_google_results(v1, v2, v3, v4... |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
from numpy import ndarray
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, Any, float, Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.ndarray=None, v3=False, v4: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> bool:
if self.type == 1:
self.setGeometry(self.x(), self.y() + self.height(), self.width(), self.height())
elif self.type == 2:
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Operation):
v1: str = '/platform/admin/namespaces/{namespace}/payment/orders/{paymentOrderNo}/refund'
v2: str = 'PUT'
v3: List[str] = ['application/json']
v4: List[str] = ['application/json']
v5: Optional[str] = 'bearer'
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not isinstance(self.tensor_board, (bool, str)):
raise ValueError('The argument `tensor_board` has to be either of type bool or str.')
``` |
Imports:
```python
import warnings
import numpy as np
import typing
```
Type definitions:
Input Types: float, str, np.random.Generator, bool
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *, v1: float=0, v2: str='cartesian', v3: np.random.Generator=None, v4: bool=None) -> np.... |
Imports:
```python
from nltk import download
from nltk.corpus import wordnet
from nltk.data import find
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
v3 = v2(v1)
v4 = False
v5 = []
for v6 in v3:
v5.append(v6)
v7 =... |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types:
Output Type: argparse.ArgumentParser
Dependencies:
Function Name: v0
Function:
```python
def v0() -> argparse.ArgumentParser:
v1 = argparse.ArgumentParser(usage='%(prog)s [-h] [-v] --input_file INPUT_FILE --operation {get_current... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types:
Output Type: requests.Response
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> requests.Response:
v1 = requests.get(self._target_url)
if v1.status_code != 200:
raise ValueError(f'request error: {se... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.live:
if self.blood > 0:
self.blood -= 1
else:
self.live = False
self.blood = 60
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list[int], int
Output Type: tuple[int, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list[int], v2: int) -> tuple[int, int]:
v3 = sorted(v1)
(v4, v5) = (0, len(v3) - 1)
while v4 < v5:
if v3[v4] + v3[v5] < v2:... |
Imports:
```python
import os
import os.path
import typing
```
Type definitions:
Input Types: str, bytes
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bytes):
v3: dulwich.objects.Blob
try:
v3 = self._repo.get_object(v2)
except KeyError:
retur... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, bytes, str, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bytes, v2: bytes, v3: str, v4) -> str:
if v2 == b'NX20 19.2':
v5 = 'nx'
else:
raise RuntimeError('unknown version=%r' % ... |
Imports:
```python
import torch as th
from torch import Tensor
from torch.nn import Conv2d, LeakyReLU, ModuleList, Sequential
from torch.nn.functional import avg_pool2d, interpolate
import typing
```
Type definitions:
Input Types: Tensor, int, float, Optional[Tensor]
Output Type: Tensor
Dependencies:
Function Name: v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pyraknet.messages.Address
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pyraknet.messages.Address):
print('Disconnected with %s' % str(v1))
v2 = self.lookup_session_by_ip(v1[0])
if v2 is not None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> int:
self.max_n = v1
for v3 in range(1, 10):
if v3 <= self.max_n:
self.res.append(v3)
self.dfs(10 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
if len(v1) == 0:
self.help([])
return 0
v2 = v1[0]
v3 = getattr(self, v2, None)
if not callable(v3):
self.error(... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('_K', bound=Hashable)
```
```python
v1 = TypeVar('_V')
```
Input Types: MutableMapping[v0, v1], v0
Output Type: None
Dependencies:
Function Name: v2
Function:
```python
def v2(v3: MutableMapping[v0, v1], v4: v0) -> None:
try:
del... |
Imports:
```python
import math
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 = math.sqrt((v1[-1, 0] - v2[-1, 0]) ** 2 + (v1[-1, 1] - v2[-1, 1]) ** 2)
return v3
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Any):
if isinstance(v2, bool):
return v1 if v2 else ''
return f'{v1}="{v2}"'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: DataFrame, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: DataFrame, v2):
print('data ' + v2)
print(v1[~v1[v2].isna()][v2].min())
print(v1[~v1[v2].isna()][v2].max())
print(v1[~v1[v2].isna()][v2].co... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.array
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.array) -> np.array:
for v2 in range(1, len(v1) - 1):
if v1[v2 - 1] == v1[v2 + 1]:
v1[v2] = v1[v2 - 1]
return v1 == 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, ImageFont, int, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: ImageFont, v3: int, v4: int) -> str:
if v2.getsize_multiline(v1, stroke_width=v3)[0] <= v4:
return v1
else:
v5 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int, v3=None):
if v1 not in self.services:
self.services[v1] = {'process': v2, 'active': True, 'session': v3}
``` |
Imports:
```python
import warnings
import rasterio
from rasterio import transform, warp
from rasterio.io import DatasetReader, DatasetWriter, MemoryFile
from rasterio.vrt import WarpedVRT
import typing
```
Type definitions:
Input Types: Union[DatasetReader, DatasetWriter, WarpedVRT, MemoryFile]
Output Type: Dict
Depen... |
Imports:
```python
import shutil
import sys
import typing
```
Type definitions:
Input Types: int, int, str, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int, v3: str='█', v4: float=0.55):
v5 = shutil.get_terminal_size().columns
v6 = int(v5 * v4)
v7 = int(r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: typing.Sequence, typing.Sequence
Output Type: typing.Sequence
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: typing.Sequence, v2: typing.Sequence) -> typing.Sequence:
(v3, v4) = v1
(v5, v6) = v2
return (v5 + v4 / 2, v6 + v... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str):
if v1 is None:
print(v2)
else:
v3 = os.path.dirname(v1)
if v3:
os.makedirs(v3, exist_ok=True... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, str]) -> None:
if 'HTTP_X_FORWARDED_SERVER' in v1:
v1['HTTP_ORIGINAL_X_FORWARDED_SERVER'] = v1['HTTP_X_FORWARDED_SERVER']
v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: [Dict, OrderedDict], List[str]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: [Dict, OrderedDict], v2: List[str]) -> bool:
for v3 in v2:
(v4, v5) = v3.split('#')
if str(v1[v4]) != v5:
... |
Imports:
```python
import inspect
import logging
import typing
```
Type definitions:
Input Types: Callable
Output Type: Callable
Dependencies:
```python
@functools.wraps(func)
def v0(*v1, **v2):
v3 = inspect.signature(func).bind(*v1, **v2).arguments
v4 = func(*v1, **v2)
logger.debug(f'Function {func.__name... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int) -> str:
v3 = []
for v4 in v1:
while v2 and v3 and (v4 < v3[-1]):
v3.pop()
v2 -= 1
v3.append(v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.