text stringlengths 190 325k |
|---|
Imports:
```python
from pymatgen.analysis.local_env import NearNeighbors
from pymatgen.core import Element, Molecule
from pymatgen.io.babel import BabelMolAdaptor
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> Dic... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union['DependencyMixin', Sequence['DependencyMixin']], Optional['EdgeModifier']
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union['DependencyMixin', Sequence['DependencyMixin']], v2: Optional['EdgeModifier']=... |
Imports:
```python
from datetime import date, datetime, timedelta
from polars.utils import _timedelta_to_pl_duration
from polars import internals as pli
from polars.datatypes import DataType, Date, Datetime, Float64, Int32, Object, UInt32, py_type_to_dtype
import typing
```
Type definitions:
```python
class v0:
de... |
Imports:
```python
from typing import Collection, Iterator, Optional
import typing
```
Type definitions:
Input Types: type
Output Type: bool
Dependencies:
```python
def v0(v1: type) -> Optional[Collection[str]]:
try:
v2 = v1.__dict__['__slots__']
except KeyError:
return None
if isinstance(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
for v2 in self.len_to_letters[len(v1)]:
if not self.find_difference(v2, v1):
return str(self.letters_to_digit[v2])
``` |
Imports:
```python
import shutil
import typing
```
Type definitions:
Input Types: str, pathlib.Path, pathlib.Path
Output Type: typing.List[pathlib.Path]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: pathlib.Path, v3: pathlib.Path=WORKING_DIR) -> typing.List[pathlib.Path]:
v4 = f'tzdata{v... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: str, v2: dict={}):
self.email: str = v1
self.full_name = v2.get('full_name', None)
self.house = v2.get('house', None)
self.contributions = v2.get('contributions', [])
self.year ... |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1):
v2 = np.sum(v1.price * v1.foreignNotional)
v3 = np.sum(v1.foreignNotional)
return v2 / v3
```
Function Name: v4
Function:
```... |
Imports:
```python
import ssl
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
v1.load_cert_chain(self.config.SSL_CERT_PATH, self.config.SSL_KEY_PATH)
v1.op... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: dict):
self.id: str = v1.get('id')
self.type: int = v1.get('type')
self.allow: str = v1.get('allow')
self.deny: str = v1.get('deny')
```
Input Types: v0
Output Type: None
Dependencies:
... |
Imports:
```python
import warnings
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1):
return NotImplementedError(f"The backend {v1} doesn't support this function.")
```
Function Name: v2
Function:
```python
def v2(self, v3: str='cna'):
if self.backend == '... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: Union[List[Image.Image], Image.Image], Any, Any
Output Type: List
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[List[Image.Image], Image.Image], v2=None, v3='content') -> List:
if v3 == 'content':
... |
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='html'):
if v2.lower() == 'html':
v3 = '\n ods listing close;\n ods {} (id=saspy_internal) options(b... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float, float, float
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: float, v3: float=2.0) -> int:
v4 = int(v3 * np.sqrt(1 + v2 ** 2 / (np.pi * v1) ** 2))
return v4
``` |
Imports:
```python
import tensorflow as tf
from tensorflow.keras.callbacks import Callback
from tensorflow.keras.callbacks import ModelCheckpoint
from tensorflow.keras.callbacks import TerminateOnNaN
from tensorflow.keras.callbacks import TensorBoard
import typing
```
Type definitions:
```python
v0 = tf.Tensor
```
Inpu... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, int or float, int
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: int or float, v3: int=0) -> torch.Tensor:
v4 = v2 - v1.size(v3) % v2
v5 = [*v1.shape... |
Imports:
```python
import torch
from torch.distributions import constraints
from torch.distributions.exp_family import ExponentialFamily
from torch.distributions.utils import lazy_property
from torch.distributions.multivariate_normal import _precision_to_scale_tril
import typing
```
Type definitions:
Input Types: torc... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
self.add_lanes()
self.set_width_in_intersect()
return True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.heap_size
for v2 in range(v1 - 1, 0, -1):
(self.h[0], self.h[v2]) = (self.h[v2], self.h[0])
self.heap_size -= 1
sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> int:
if v2 == 0:
return 1
v3 = 0
for v4 in range(len(v1)):
for v5 in range(v4 + 1, len(v1)):
if v1[v4] + v1[v5] ==... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if v1 in self.processes:
self.stop_process(v1, restart=True)
else:
self.output(v1, 'PyROS ERROR: process ' + v1 + ' does ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.write_user_config('[test_section]\nother_option = "test value"\n')
self.assertEqual(self.get_config().get_config_value('test_section.missing_opt... |
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: List[int]
Dependencies:
Function Name: v4
Function:
```python
def v4(self, v5: v0) -> List[in... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: str) -> List[str]:
v2 = 3
return [v1[i:i + v2] for v3 in range(0, len(v1), v2)]
```
```python
def v4(v5: str) -> str:
v6 = {'AAA': 'K', 'AAC': 'N', 'AAG': 'K', 'AAU': 'N', 'ACA': 'T', '... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bool) -> str:
v2 = 'c[urrent]|' if v1 else ''
return v2 + 'd[own]|f[irst]|l[ast]|n[ext]|p[rev]|r[oot]|u[p]'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: tf.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Tensor):
try:
v1.op
return False
except:
return True
``` |
Imports:
```python
import os
import typing
```
Type definitions:
```python
@attr.s(frozen=True)
class v0:
v1: float = attr.ib()
v2: float = attr.ib()
```
Input Types: typing.TextIO, int
Output Type: Optional[v0]
Dependencies:
```python
def v3(v4: str) -> v0:
v5 = v4.split('\t')
if len(v5) == 5 and v5[1]... |
Imports:
```python
import requests
from json import dumps
import typing
```
Type definitions:
Input Types: str, str, dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: dict={}) -> dict:
if v1 not in ('GET', 'POST', 'PATCH', 'DELETE'):
raise ValueE... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = dict()
for (v2, v3) in self._edges_to_labels.items():
v1.setdefault(v3, []).append(v2)
return v1
``` |
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(self, v1: np.ndarray, v2: np.ndarray) -> float:
(v3, v4) = self.minus_predict(v1)
Shapes(v1, 'X,Z')(v2, 'X')(v3, 'X')
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(GiteaApiObject):
v1 = '/users/{name}'
v2 = '/user/emails?sudo=%s'
v3 = '/admin/users/%s'
v4 = '/admin/users/%s'
v5 = '/admin/users/{username}'
v6 = '/users/%s/heatmap'
def __init__(self, v7):
super(v0, self)._... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: core.CharacterModifier
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> core.CharacterModifier:
if self.cooltimeLeft <= 0:
self.cooltimeLeft = self.calculate_cooltime(self.skill_modifier)
return se... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0() -> str:
v1 = os.environ.get('QSUBPY_CONFIG')
if v1 is None:
v2 = os.environ['HOME']
v1 = os.path.join(v2, '.config', 'qsubpy_config.toml'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], Tuple[str, ...], Dict[str, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any], v2: Tuple[str, ...], v3: Dict[str, Any]):
if not any((i is not None for v4 in v3.values())):
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: type[hikari.Event]
Output Type: collections.Callable[[tanjun_abc.ListenerCallbackSigT], tanjun_abc.ListenerCallbackSigT]
Dependencies:
```python
def v0(v1: tanjun_abc.ListenerCallbackSigT, /) -> tanjun_abc.ListenerCallbackSigT:
self.add_listener(e... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, str, str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int, v3: str, v4: str, v5: str) -> str:
v6 = f'postgresql://{v4}:{v5}@'
if not v1.startswith('/'):
v6 += f'{v1}:{v2}'
... |
Imports:
```python
import os
import numpy as np
import torch
import torch.nn as nn
import torch.distributions as distributions
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SequentialSampler, SubsetRandomSampler, RandomSampler
import typing
```
Type definitions:
Input Types: str
Output T... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str) -> None:
await self.client_admin.delete(f'{self.url_origin}/branches/{v1}/protection', headers={'Accept': 'application/vnd.github.luke-cage-prev... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool=False) -> bool:
if self.isDirectory(v1):
v1 = self.relativePath(v1, is_directory=True)
v3 = self.resource.meta.client.l... |
Imports:
```python
import re
import typing
```
Type definitions:
```python
v0 = MutableMapping[str, Any]
```
Input Types: v0, Any
Output Type: v0
Dependencies:
```python
def v1(v2, v3):
v4 = re.findall('([A-Z]+):\\S', v2)
for v5 in v4:
if v5 in v3['namespaces']:
v2 = v2.replace(v5, v3['names... |
Imports:
```python
import typing
```
Type definitions:
Input Types: element.Tag, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: element.Tag, v2: str) -> bool:
v3: str
v4: str
if v2 == '_report':
if (v5 := v1.find('div')) and (v6 := v1.find('span', class_='dead... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: dict):
v3 = np.diff(np.asarray(v2), axis=0)
v4 = np.linalg.norm(v3, axis=1)
v5 = np.sum(v4)
v6 = np.cumsum(v4)
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[int, int], Tuple[int, int]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple[int, int], v2: Tuple[int, int]):
self.rect.x = v2[0] + v1[0]
self.rect.y = v2[1] + v1[1]
``` |
Imports:
```python
import json
import requests
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=0) -> bool:
v2 = ' https://{0}:{1}/api/internal/import-wallet'.format(self._host, self._port)
v3 = dict(filePath='state... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> pd.DataFrame:
v1 = super().gen_df()
if not v1.empty:
v1 = v1.set_index('date').sort_index()
return v1
``` |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, List, float, Text
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor, v2: List, v3: float, v4: Text) -> tf.Tensor:
v5 = tf.contrib.layers.l2_regularizer(self.C2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: Dict):
v3 = self.gh.perform_queries(query_text=v1, variables=v2)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int | None
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int | None=None):
if v1 is None:
v1 = self.sentence.deduction if self.sentence else 0
return ['EEEEEE', 'DDDD22', 'DD8833', 'DD3333'][min... |
Imports:
```python
import typing
```
Type definitions:
Input Types: collections.Counter, Union[int, float], int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: collections.Counter, v2: Union[int, float], v3: int):
if v2 == 0:
v1[0] += 1
else:
v1[int(v2 / v3) + 1... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame):
v2 = np.mean(v1['dist_to_cc'])
return v2
``` |
Imports:
```python
import torch
from torch import nn
import typing
```
Type definitions:
Input Types: nn.Module, float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: nn.Module, v2: float, v3: float=0.0001):
v4 = []
for (v5, v6) in v1.named_parameters():
if 'pred... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: [[0]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int) -> [[0]]:
v3 = []
v4 = self.chars2cids(v1)
for v5 in range(0, len(v4) - v2 + 1):
v3.append(v4[v5:v5 + v2])
return v... |
Imports:
```python
import os
import numpy as np
import glob
import typing
```
Type definitions:
Input Types: str, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: bool=False):
if v2:
v3 = [v1]
else:
v3 = os.listdir(v1)
v3 = [os.path.join(v1,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[int]
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[int]=None) -> List[int]:
if v1 is None:
v2 = self.execute('SELECT gpa_id FROM GeneralizedProcrustesAnalysis')
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.session.msg('kernel_info_request')
self.shell_channel.send(v1)
return v1['header']['msg_id']
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> dict:
if v1 == '':
print("\nError: github_token isn't defined, use the --token argument or edit github_config.py to set it")
exit(1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: list
Dependencies:
```python
def v0(v1):
v2 = [None] * 4
for (v3, v4) in enumerate(v1.split(':')):
if v4:
v2[v3] = v4 if v3 == 3 else int(v4)
return v2
```
Function Name: v5
Function:
```python
def v5(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list=['int64', 'float64', 'uint8', 'uint16', 'float32']):
try:
v2 = self.df.select_dtypes(include=v1).columns.tolist()
return v2
except... |
Imports:
```python
import typing
```
Type definitions:
Input Types: AnyStr, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: AnyStr, v2='ignore', v3='utf8'):
if isinstance(v1, str):
return v1.encode(v3, v2)
return v1
``` |
Imports:
```python
import getpass
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0(v1: str) -> bool:
v2 = PasswordPolicy.from_names(strength=0.2, entropybits=10, length=6)
if not v1:
return False
v3 = v2.password(v1)
v4 = v3.test()
if len(v4)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: things.ShapeColor
Output Type: Tuple[int, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: things.ShapeColor) -> Tuple[int, int]:
for v2 in range(self.size):
for v3 in range(self.size):
if self.grid[v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Optional[str]:
if v1 not in ['One-way', 'Hedge']:
return 'Position mode can either be One-way or Hedge mode'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
```python
def v0(v1: List[str], v2: str) -> bool:
assert isinstance(v2, str)
if v2 not in v1:
raise ValueError(f"Invalid option value '{v2}' received. Expected one of {repr(v1)}.")
return True
``... |
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.do_request('GET', 'https://discordapp.com/api/v6/guilds/{}/channels'.format(v1), headers={**self.headers, 'Authorization': self.token})
... |
Imports:
```python
from pandas._config import get_option
from pandas._libs import lib, properties, reshape, tslibs
from pandas._libs.lib import no_default
from pandas._typing import AggFuncType, ArrayLike, Axis, Dtype, DtypeObj, FillnaOptions, FrameOrSeriesUnion, IndexKeyFunc, NpDtype, SingleManager, StorageOptions, Va... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: list[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> list[str]:
v2 = []
v3 = super()._Scraper__create_bs(v1)
v4 = v3.find_all('div', attrs={'class': 'gdtm'})
for v5 in v4:
v6 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, Any]:
v1 = {'bootstrap': self.bootstrap, 'static_resources': self.static_resources}
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: SharedDim, v2: Optional[Union[int, float]]=None, v3: Optional[Union[tiledb.FilterList]]=None):
self._base = v1
self.tile = v2
self.filters = v3
def __repr__(self):
v4 = ''
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2, v3: bool):
if v3:
return f'\n DELETE FROM {v1}\n {self._partition_where_clause(v2.partition_bounds)}\n ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2: List[str] = v1.split()
return ' '.join(sorted(set(v2), key=v2.index))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
v2: Dict[str, int] = {'o2-rest-consumer': 3 * self.FONTSIZE, 'a1-rest-consumer': 3 * self.FONTSIZE, 'oam-netconf-consumer': 3 * self.FONTSIZE, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray):
v1 -= v1.min()
return v1 / v1.sum()
``` |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = f'ParamRunner_{self.timestamp}.log'
logging.basicConfig(filename=v1, filemode='a', format='%(asctime)s,%(msecs)d %(levelname)s %(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, 50
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: 50):
v3 = self.__get_client_with_scope('user-read-recently-played')
return v3.current_user_recently_played(limit=v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[str, ...]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple[str, ...]):
if len(v1) == 1:
return f' with {v1[0]}'
if len(v1) > 1:
v2 = ', '.join(v1[:-1])
return f' with {v2}, an... |
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 v1 not in self.nums:
self.dic[v1] = len(self.nums)
self.nums.append(v1)
return True
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[Union[List[str], str]], Optional[Union[List[str], str]], Optional[Union[List[str], str]]
Output Type: Iterator[str]
Dependencies:
```python
def v0(v1: Optional[Union[List[str], str]], v2: Set[str]):
v3 = v1 or []
if isinstance(v3, str... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
v1: symbolic_alchemy_trackers.BeliefStateTracker = self.trackers['belief_state']
return len(v1.belief_state.possible_rotations) == 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: QtGui.QPaintEvent
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: QtGui.QPaintEvent) -> None:
if self.maximum() - self.minimum():
if self.min is not None:
self.drawRect(0, self.min, 'gray... |
Imports:
```python
import socket
import typing
```
Type definitions:
Input Types:
Output Type: socket.socket
Dependencies:
```python
def v0(v1: str='', v2: int=14443, v3: str='', v4: int=0) -> socket.socket:
v5 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
v5.setsockopt(socket.SOL_SOCKET, socket.SO_REUSE... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int, int, List[List[List[List[str]]]]
Output Type: int
Dependencies:
```python
def v0(v1: List[List[List[List[str]]]], v2: int, v3: int, v4: int, v5: int) -> str:
if 0 <= v5 < len(v1) and 0 <= v2 < len(v1[v5]) and (0 <= v3 < len(v1[v5][v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'PartialTransaction'
Output Type: Dict[str, Union[Sequence[int], str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'PartialTransaction') -> Dict[str, Union[Sequence[int], str]]:
v2 = {}
for v3 in v1.inputs():
... |
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.MinLap()
self.bosscount[v1] += 1
self.RemoveReserveExpire()
self.damagecontrol[v1].SetBossHp(self.BossMaxHp(self.bosscount[v1], ... |
Imports:
```python
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem.rdchem import Mol, RWMol, Conformer
from rdkit.Geometry.rdGeometry import Point3D
import typing
```
Type definitions:
Input Types: Union['RDKitMol', 'RWMol', 'Mol'], int, int, bool, list, int, list
Output Type: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]):
with self._env.begin(write=True) as v2:
for v3 in v1:
v2.delete(v3.encode())
``` |
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:
while len(v1) > self.actual_max_size:
for v3 in self.wrap_on:
v4 = v1.rfind(v3, 0, self.ac... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
```python
def v0(v1: str):
return ' Invalid ' + v1
```
Function Name: v2
Function:
```python
def v2(self, v3) -> str:
for v4 in self._attributes:
if not v4['vf'](v3[v4['name']]):
v5 = self... |
Imports:
```python
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import typing
```
Type definitions:
Input Types: Dict[str, torch.Tensor]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, torch.Tensor]):
v2 = {}
with torch.no_grad():
... |
Imports:
```python
from typing import Any, Dict, List, Optional, Tuple, Union, Iterable
import typing
```
Type definitions:
Input Types: Any
Output Type: Iterable
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> Iterable:
if v1 is None:
v1 = []
elif not isinstance(v1, Iterable):
... |
Imports:
```python
import csv
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: None
Dependencies:
```python
def v0(v1: List[dict], v2: List[str]) -> None:
if not isinstance(v1, list):
raise Exception('Case data should be a list of cases')
if len(v1) < 1:
raise Except... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
if f'AiOnnx{v1}' in globals():
self._onnxOpsets = {}
for (v2, v3) in globals().items():
v4 = re.match('... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, int
Output Type: Tuple[List[str], List[Sequence[Any]]]
Dependencies:
```python
def v0(v1: Sequence[Any], v2: int) -> List[Sequence[Any]]:
v3 = [v1[i * v2:(i + 1) * v2] for v4 in range((len(v1) + v2 - 1) // v2)]
return v3
```
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.doc_id and self.sent_id is not None and self.tokens_number:
v1 = [str(self.doc_id), str(self.sent_id)]
v1.extend([str(token_id) for... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='interactive', v2: bool=False) -> Any:
if self.authenticated:
print('We are already authenticated with NASA EDL')
return self
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
v1 = self.raw_param.get('disable_local_accounts')
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = ''
for v2 in self.crawlers:
v1 += v2.license_report()
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str=None, v3: str=None):
v4 = v5 = self.get_url('COPY').format(cid=v1)
v6 = self.HEADERS.copy()
v6['Content-Type'] = 'application... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int, v3: str) -> str:
if v2 > 0:
v4 = f'You have been awarded {v2} {v1}.'
else:
v4 = f'You have been deducted {abs(v2... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: str, int, int
Output Type: Iterator[Tuple[List[np.array], List[np.array]]]
Dependencies:
```python
def v0(v1: np.array, v2: int, v3: int) -> Tuple[List[np.array], List[np.array]]:
v4 = []
v5 = []
for v6 in range(0, len(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: str) -> None:
with self._project_lock:
self._project_uid_to_slug[v1] = v3
self._project_uid_to_group_uid[v1] = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.