text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
```python
@frozen_after_init
@dataclass(unsafe_hash=True)
class v0(Generic[_FS], EngineAwareParameter, metaclass=ABCMeta):
v1: ClassVar[type[_FS]]
v2: ClassVar[str]
v3: Collection[_FS]
def __init__(self, v4: Iterable[_FS]) -> None:
self.fie... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: str) -> dict:
v3 = getattr(self, self._id_parsing_function['object'])('identity', v1)
v4 = self._datetime_from_timestamp(v1['timestamp'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None):
v2 = self.get_mode_config(v1)
if v2 is not None:
return v2.get('previous', None)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[int], int, Optional[int], Optional[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[int], v2: int, v3: Optional[int]=None, v4: Optional[int]=None) -> int:
if v1 is None:
return v2
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, dict
Output Type: Tuple[str, str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: dict) -> Tuple[str, str, str]:
v3 = v1.get('name')
v4 = v1.get('abbreviation')
v5 = v1.get('schema')
try:
v3... |
Imports:
```python
import base64
import hashlib
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: bool
Dependencies:
```python
def v0(v1: str, v2: bytes) -> bool:
v3 = base64.b64decode(v1)
v4 = len(v3) ^ len(v2)
for v5 in range(len(v3)):
v4 |= v3[v5] ^ v2[v5]
return v4... |
Imports:
```python
import random
import numpy as np
import typing
```
Type definitions:
Input Types: np.array, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.array, v2):
v3 = []
for v4 in v1:
if v4 not in v3:
v3.append(v4)
else:
v... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types:
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> np.ndarray:
v1 = self._get_parsed_tfrecord_dataset()
for v2 in v1.take(1):
v3 = tf.squeeze(tf.where(v2['feature_min']... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
v2 = self.db.execute('SELECT group_id, _id FROM groups WHERE group_id LIKE ?', (f'{v1}',))
v3 = v2.fetchone()
if v3:
return str... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2: str, v3: str):
for (v4, v5) in enumerate(v1):
if v5 == 'false':
v6 = ' oc get InstallPlan -n namespace -ojsonpath={... |
Imports:
```python
import math
import typing
```
Type definitions:
```python
v0 = Tuple[int, int, int]
```
```python
v1 = TypeVar('Num', int, float)
```
```python
v2 = Tuple[float, float]
```
Input Types: v2
Output Type: v0
Dependencies:
```python
def v3(v4: List[int], v5: List[float]) -> float:
return sum(mul_arra... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple['CollidableObject', ...]
Output Type: Tuple['CollidableObject', ...]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple['CollidableObject', ...]) -> Tuple['CollidableObject', ...]:
v2 = []
for v3 in v1:
i... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if self.lower_bound is None or self.upper_bound is None:
return False
return self.lower_bound > self.upper_bound
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.rotate:
self.highlight((self.highlighted + 1) % len(self.options))
else:
self.highlight(min(self.highlighted + 1, len(self.op... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
await self.initialise_core_and_hardware()
self._initialize_credit_string()
self._register_config_players()
self._register_system_events... |
Imports:
```python
from scipy.special import softmax
import numpy as np
import typing
```
Type definitions:
Input Types: Union[Sequence[Union[torch.Tensor, np.ndarray, Any]], torch.Tensor, Any], Union[Sequence[Union[torch.Tensor, np.ndarray, Any]], torch.Tensor, Any, None], bool
Output Type: Any
Dependencies:
```pytho... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2: CameraConfig, v3, v4):
self.obj_data = v4
self.camera = v1
self.camera_config = v2
self.frame_cache = v3
self.current_zones = []
self.entered_zones = set()
s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: str) -> int:
if v2 == 'way':
return int(v1) + 2400000000
if v2 == 'relation':
return int(v1) + 3600000000
return None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.read_header()
self.read_questions()
if not self.num_questions:
self.read_others()
self.valid = True
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: bool = False
v2: bool = False
v3: bool = False
```
Input Types: List[List[bool]], np.ndarray, int, List[int], v0
Output Type: Tuple[int, List[np.ndarray]]
Dependencies:
Function Name: v4
Function:
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
if len(v1) not in self.vocab:
return False
if '.' in v1:
for v2 in self.vocab[len(v1)]:
v3 = True
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1: Gtk.HPaned = super().do_make_layout_lr()
self._pnlGoalMethods.fmt = self.fmt
self._pnlGoalMethods.do_load_comboboxes()
super().do_embed_t... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
try:
del self.bee_instance.global_store[v1]
except KeyError:
print(f'could not remove {v1} from global_store')
return None... |
Imports:
```python
import shutil
import subprocess
from pathlib import Path
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, str, Any
Output Type: Any
Dependencies:
```python
def v0(v1):
subprocess.check_call(['git', 'config', 'user.email', 'test@example.com'], cwd=v1)
subprocess.check_call... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1: object = None
v2: str = None
v3: str = None
v4: bool = False
v5: bool = False
v6: dict = None
v7: dict = None
v8: int = None
def v9(self):
if self.workspace_dir is not None:
self.works... |
Imports:
```python
import datetime
from collections import defaultdict
import typing
```
Type definitions:
Input Types: datetime.date, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: datetime.date, v2: int):
v3 = defaultdict(list)
for v4 in range(v2):
v5 = sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
v2 = self.head
if v1 == 0:
self.head = v2.next
else:
for v3 in range(v1 + 1):
if v3 == v1 - 1 and v2.next... |
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.numbers_to_tiles.get(v1)
if not v2:
return False
v2.is_hit = True
(v3, v4) = v2.position
v5 = all((self.til... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True):
if self.freeze:
v1 = False
self.training = v1
for v2 in self.children():
v2.train(v1)
return self
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
print(f'Info: {self} ({type(self)})')
super().info()
``` |
Imports:
```python
import os
from datetime import datetime, timedelta
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: datetime
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3='.') -> datetime:
try:
return datetime.strptime(v1.split('_', 1)[0], v2)
exce... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
self.log.debug('Determining players remaining to pick')
v1 = []
for v2 in self.players.player_list:
if v2.hand.pick.is_empty() ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int=app_vars.max_message_length) -> List[str]:
if len(v1) <= v2:
v3 = [v1]
else:
v3 = ['']
for v4 in v1.split('\n'... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[bool, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple[bool, int]:
v1 = sum([purchase.quantity for v2 in self.purchases.all()])
v3 = self.stock_quantity - v1
return (v3 == self.available_q... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: int):
if v2 == 0:
return 1
elif v2 % 2 == 1:
return pow(v1, v2 - 1) * v1
else:
return pow(v1 ** 2, v2 // 2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Tuple[Union[pd.core.frame.DataFrame, None], Union[pd.core.frame.DataFrame, None], Union[pd.core.frame.DataFrame, None]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> Tuple[Union[pd.core.frame.DataFrame,... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
self._initProgress(self.skt.profiles.count)
self._stopSketchProperty()
self._getConvertPolygons()
if len(self.sktCurvesGroup) < 1:
self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, datetime
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: datetime):
v3 = self.parse_basic_regex_match(v1, v2)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str, str, str, str, str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=None, v2: str=None, v3: str=None, v4: str=None, v5: str=None, v6: str=None, v7: str=None, v8: str=None):
if v2:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: base.BaseDataset, Any, Union[str, float, base.Split], bool, base.BaseDataset
Output Type: tf.data.Dataset
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: base.BaseDataset, v2, v3: Union[str, float, base.Split], v4: bool=False, v5: base... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
v1 = 0
for v2 in self.checked_modules.values():
v1 += v2
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1: Visitor
@property
def v2(self) -> 'NodeType':
return NodeType(self.__class__.__name__)
def v3(self, v4: VisitorFactory) -> None:
self.visitor = v4.get_for_node(self)
def v5(self) -> 'Node':
rais... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Any]) -> None:
v2 = v1.setdefault('metadata', {})
v3 = v1.get('body', {}).get('footer', {}).get('items', [])
v4 = v1.get('subj... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float) -> None:
self.current_state = self.SLEWING
v2 = self.motor.getSelectedSensorPosition()
v3 = v2 + int(v1 * self.COUNTS_PER_TURRET_RADIAN)
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> str:
v2 = os.path.join(v1, 'python.json')
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, type
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bool, *v3, v2: type=RequirementError):
if v1:
raise v2(*v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[None, str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[None, str]=None) -> str:
v2 = v1 if v1 is not None else ''
v2 += self.url
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Iterator['ParsedHeader']
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Iterator['ParsedHeader']:
for v1 in self.depends:
try:
yield self.all_headers[v1]
except KeyError:
... |
Imports:
```python
import os
import zipfile
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> None:
v3 = os.path.abspath(v1)
v4 = zipfile.ZipFile(v2, 'w', zipfile.ZIP_DEFLATED)
for (v5, v6, v7) in os.... |
Imports:
```python
import tensorflow as tf
from tensorflow.python.util.nest import flatten, flatten_with_joined_string_paths
import typing
```
Type definitions:
Input Types: dict, str
Output Type: List[tf.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: str) -> List[tf.Tensor]:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: object
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> object:
v2 = self._module_dict.get(v1)
if v2 is None:
raise KeyError('{} is not in the {} registry!'.format(v1, self._module_name))
... |
Imports:
```python
import numpy as np
from pandas._config import get_option
from pandas._libs import lib, properties, reshape, tslibs
from pandas._typing import ArrayLike, Axis, DtypeObj, Label
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender, Substitution, doc
from pandas.uti... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = subprocess.run('git branch -r --contains HEAD'.split(), capture_output=True, cwd=v1)
v3 = v2.stdout.decode('utf-8').splitlines()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = {}
for v2 in range(10):
v3 = str(v2)
v4 = [v2] * v2
self.store.add(v3, v4)
v1[v3] = v4
self.store.timestamp ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[int, models.BaseAnswer]
```
```python
v1 = Union[int, models.BaseQuestion]
```
Input Types: v1, v0, str
Output Type: None
Dependencies:
```python
def v2(v3: v0) -> int:
if isinstance(v3, models.BaseAnswer):
return v3.id
return v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> tuple:
v2 = ('Adam', 'Momentum', 'NesterovMomentum', 'Adagrad', 'RMSprop', 'Adadelta', 'Adamax', 'SGD')
if isinstance(v1, str):
if v1 not in... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=5, v2=1) -> list:
v3 = []
while len(v3) < v1:
v4 = self.random_sentence(minimum_tokens=v2)
if v4 not in v3:
v3.append(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: np.matrix
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list=[]) -> np.matrix:
for v2 in v1:
if v2[0] == 'trainsubset':
self.set_trainsubset(int(v2[3]))
``` |
Imports:
```python
import os
import sys
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if hasattr(sys, '_MEIPASS'):
if v1[:2] == '..':
return os.path.join(sys._MEIPASS, v1[3:])
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Any) -> None:
if not hasattr(self, v1):
return
v3 = getattr(self, v1)
if v3 == 0:
return
setattr(self, v1, v3 + v2)
... |
Imports:
```python
import json
import os
import requests
import typing
```
Type definitions:
Input Types: str, bool
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: dict):
print('[INFO] getDataIds({endpoint}, {config})'.format(endpoint=v1, config=v2))
v3 = {'Authorization': 'Bearer ' + v2['bearer_t... |
Imports:
```python
import re
from collections import Counter
from tqdm import tqdm
import pandas as pd
import typing
```
Type definitions:
Input Types: List[str], str, bool, int, bool, bool
Output Type: Any
Dependencies:
```python
def v0(v1: str) -> List[str]:
return list(iter_tokens_from_xml_file(v1))
```
```pyth... |
Imports:
```python
import pickle
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
with open(v1, 'wb') as v2:
pickle.dump(self, v2)
print('Results were saved successfully')
``` |
Imports:
```python
import matplotlib.pyplot as plt
import numpy as np
from pymatgen.analysis.phase_diagram import GrandPotentialPhaseDiagram, PhaseDiagram
from pymatgen.analysis.reaction_calculator import Reaction
from pymatgen.core.composition import Composition
from pymatgen.util.plotting import pretty_plot
from pyma... |
Imports:
```python
import numpy as np
from numpy import ndarray
from numpy.lib.function_base import cov
from scipy.linalg import eigvalsh, inv, eigh, pinv
import typing
```
Type definitions:
Input Types: ndarray
Output Type: Any
Dependencies:
```python
def v0(v1: ndarray, v2: ndarray, v3: Optional[int]=None):
def... |
Imports:
```python
import typing
```
Type definitions:
Input Types: MutableMapping[str, Any]
Output Type: MutableMapping[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: MutableMapping[str, Any]) -> MutableMapping[str, Any]:
v1 = super()._pre_instantiation_hook(kwargs=v1)
v1['neg... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2):
assert v1 not in self._registeredProps, f'Property with name {v1} already registered'
self._registeredProps[v1] = v2
v3 = self.regist... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2):
if v2 not in v1:
return list()
if not isinstance(v1[v2], list):
return [v1[v2]]
return v1[v2]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bytes:
v1 = self._source.read()
if v1:
self.count_20ms += 1
return v1
``` |
Imports:
```python
import pathlib
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> None:
v2 = pathlib.Path('./service/_name.py').absolute()
v2.write_text(f'SERVICE_NAME: str = "{v1}"\n')
``` |
Imports:
```python
from keras.optimizers import SGD
from keras.callbacks import ModelCheckpoint, LearningRateScheduler, TerminateOnNaN, History
from keras import backend as K
from keras.models import Model
from keras.utils.data_utils import get_file
import os
from glob import glob
import re
import typing
```
Type defin... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Tuple[Point, Point]
```
```python
v1 = Tuple[int, int]
```
Input Types: str
Output Type: v0
Dependencies:
```python
def v2(v3: str) -> v1:
(v4, v5) = tuple((int(v4) for v4 in v3.split(',')))
return (v4, v5)
```
Function Name: v6
Function:
```... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = typing.Union[BotMessage, UserMessage]
```
Input Types: v0
Output Type: bool
Dependencies:
Function Name: v1
Function:
```python
async def v1(self, v2: v0) -> bool:
if v2.from_id < 0:
return True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='', v2=None, v3: float=0, v4: float=0):
v1 = str(v1)
v3 = float(v3)
v4 = float(v4)
if v1 != '' and (not self.has_vertex(v... |
Imports:
```python
import torch
from torch import nn
from torch.autograd import Function
import typing
```
Type definitions:
Input Types: torch.tensor, torch.tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.tensor, v2: torch.tensor):
v3 = 2 * ((v1 - v1.mean(dim=0)) * (v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: typing.List[typing.Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: typing.List[typing.Any]):
v2 = self.get_indexes()
v3 = self.get_row_to_write()
v4 = list(v2.keys())
v5 = {}
for (v6, v7)... |
Imports:
```python
from sklearn.ensemble import RandomForestClassifier, VotingClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix, roc_auc_score
import typing
```
Type definitions:
Input Types: Any, Any, list
O... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> bool:
if all([v2, v1]):
v3 = (v1.split('.'), v2.split('.'))
if any([version[0] == '' for v4 in v3]):
return Fal... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: str, v2: int) -> int:
if v1 == 'left':
v3 = 180 if 0 <= v2 < 180 else -180
return v2 + v3
return v2
```
```python
def v4(v5):
return v0(v5.playDirect... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
```python
def v0(v1: List, v2: int, v3: Any=None) -> Any:
if isinstance(v1, list):
try:
return v1[v2]
except IndexError:
return v3
return None
```
Function Name: v4
Funct... |
Imports:
```python
import numpy as np
import numpy.typing as npt
import typing
```
Type definitions:
Input Types: Union[List[int], npt.NDArray[int]], Union[List[float], npt.NDArray[float]], float
Output Type: float
Dependencies:
```python
def v0(v1: np.ndarray):
if np.any(v1 < 0):
raise ValueError('Input c... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> torch.Tensor:
v3 = torch.square(v1 - v2)
return torch.mean(v3)
``` |
Imports:
```python
from collections import OrderedDict
import typing
```
Type definitions:
Input Types: mysql.connector.connect
Output Type: Dict
Dependencies:
```python
def v0() -> Dict:
v1 = OrderedDict(Jan=0, Feb=0, Mar=0, Apr=0, May=0, Jun=0, Jul=0, Aug=0, Sep=0, Oct=0, Nov=0, Dec=0)
return v1
```
Function... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'your name', ('your last name', 'option'), ('uppercase your name', 'flag'), Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: 'your name', v2: ('your last name', 'option')='', v3: ('uppercase your name', 'flag')=Fals... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Callable, tuple
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: Callable, v3: tuple, **v4):
(v5, v6) = v2(**v4)
(v7, v8) = v5(v1, input_shape=v3)
return (v6, v8)
``` |
Imports:
```python
import cv2
import numpy as np
import torch
import typing
```
Type definitions:
Input Types: Union[np.ndarray, torch.Tensor], Any
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[np.ndarray, torch.Tensor], v2='cpu') -> torch.Tensor:
(v3, v4) = v1.sha... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Optional[str]:
v2 = list()
if len(v1.strip()) == 0:
return 'Invalid market(s). The given entry is empty.'
v3 = list(v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self._flashed_this_step:
return
self._flashed_this_step = True
self._flash_count += 1
for v1 in self._neighbors:
v1.get_sh... |
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._iterate_corrupt_states():
v3 = v1.tostring()
v4 = self.rllb.get(v3, None)
for (v5, v6) in self._iterate_saf... |
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):
v3 = self.conn.cursor()
v3.execute('\n SELECT *\n FROM light_client_protocol_message WHERE light_client_pa... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, list, list, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: list, v3: list, v4: str='.', v5: str='.'):
v6 = v1.getOrigin()
for v7 in range(v2[0], v2[0] + v3[0]):
for v8 in range(v2[1],... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: int
Dependencies:
```python
def v0(v1: list):
v2 = 0
v3 = 0
for v4 in range(len(v1)):
if v4 % 2 == 0:
v3 += v1[v4]
else:
v2 += v1[v4]
return (v2, v3)
```
Function Name: v5
Funct... |
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 not self.has_mpsse:
return False
if self.device_version == 2048 and v1 > 2:
return False
return True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
if self._metric_max:
return float('-Inf')
else:
return float('Inf')
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
for v2 in v1:
v3 = os.path.dirname(v2)
if not os.path.exists(v3):
os.makedirs(v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: object
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: object) -> int:
v2 = self.find_one(v1)
v2.remove()
return v2
``` |
Imports:
```python
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor):
if len(v2.shape) == 1:
v2 = v2.view(-1, 1)
v3 = torch... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, Optional[bool], Callable[[str], None]
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: Callable[[str], None]=print):
if 'BUILDKITE' in os.environ:
v2(v1)
```
Function Name: v3
Function:
```python
def v3(v4: str, ... |
Imports:
```python
import hashlib
import typing
```
Type definitions:
Input Types: List[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str]) -> str:
if len(v1) == 1:
return v1[0]
v2 = hashlib.sha1()
v2.update(','.join(v1).encode())
return v2.hexdigest... |
Imports:
```python
from keras.callbacks import CallbackList, ProgbarLogger, BaseLogger, History
from keras.utils.data_utils import OrderedEnqueuer
from keras.utils.generic_utils import to_list
import typing
```
Type definitions:
Input Types: Any, int, Any, Optional[int], Optional[int], str, bool, Any
Output Type: Any
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.