text
stringlengths
190
325k
Imports: ```python import typing ``` Type definitions: Input Types: str, Any, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2=False, v3=None, v4=False): v5 = '•' v6 = [f" {v5} Table a 2v2 room with 5 teams that you're in: `{v1}sw 2v2 5`", f' {v5} Table an FFA...
Imports: ```python import typing ``` Type definitions: ```python class v0(List['FunctionalSegment']): def v1(self, v2: bool=True) -> List[str]: (v3, v4) = self.words_with_tags(add_turn_token=v2) return v3 def v5(self, v6: bool=True) -> List[str]: (v7, v8, v9) = self.words_with_metadata...
Imports: ```python import torch import typing ``` Type definitions: Input Types: torch.Tensor, torch.Tensor, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: torch.Tensor, v2: torch.Tensor, v3: bool): v4 = v1 @ torch.transpose(v2, -2, -1) v5 = v4[:, 0, 0] + v4[:, 1, 1] + v4...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Any Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(v1) -> list: v2 = np.argwhere(v1 == 1).reshape(-1) v3 = v2 v4 = v2[1:].tolist() + [v1.shape[0]] return list(zip(v3, v4)) ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: dict) -> dict: v2 = [] v3 = [] v4 = {} if 'name' in v1.keys(): v5 = v1['name'] if isinstance(v5, str): v2.append(v5) ...
Imports: ```python from scipy.optimize import Bounds, LinearConstraint import typing ``` Type definitions: Input Types: Output Type: Bounds Dependencies: Function Name: v0 Function: ```python def v0(self) -> Bounds: v1 = [len(self.player_actions[i]) for v2 in range(self.num_players)] v3 = sum(v1) v4 = [0...
Imports: ```python import json import typing ``` Type definitions: Input Types: str, str Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str) -> dict: v3 = '1' if v2 == 'File from URL': v3 = '3' return self._make_login_request('POST', 'fileupload.php...
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: List[int]) -> bool: v2 = [] v3 = v1[0] v4 = 1 for v5 in v1[1:]: if v5 == v3: v4 += 1 else: v2.append(v4...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(v1: list) -> dict: v2 = v1[0].keys() v3 = {k: [d[k] for v4 in v1] for v5 in v2} return v3 ```
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str): with open(v1, 'r') as v2: self.script = v2.read() return self.parent_job ```
Imports: ```python from polars import internals as pli from polars.datatypes import DataType, py_type_to_dtype from polars.utils import _in_notebook, _prepare_row_count_args, _process_null_values import typing ``` Type definitions: ```python v0 = TypeVar('LDF', bound='LazyFrame') ``` Input Types: Union[List['pli.Expr']...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, 'State' Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str, v3: 'State') -> None: v4 = self.manager v4.errors.set_import_context([]) v4.errors.set_file(v3.xpath) v4.errors.rep...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[str]: v1 = [] for v2 in self.data: v1.append(''.join(['#' if ch == '1' else '.' for v3 in v2])) return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: dict) -> dict: v2 = {} for (v3, v4) in v1.items(): (v5, v6) = self.get_device_name(v4) if v5 is not None and (not v6): (v7...
Imports: ```python import typing ``` Type definitions: Input Types: dict Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: dict): v2 = str(v1['Program-path']).rstrip('/savehelper.py') v3 = v2.split('_') if 'ver' not in v3[-1]: v1['Game-version'] = 'Unknown' re...
Imports: ```python import typing ``` Type definitions: Input Types: Any Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1) -> bool: if v1 is None: return True if isinstance(v1, str): if v1.strip() == '': return True if isinstance(v1, list) or isins...
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(self, v1: np.ndarray) -> np.ndarray: v2 = self.vector.dot(v1) if v2 <= self.threshold: return v1 return v1 - self.vec...
Imports: ```python import typing ``` Type definitions: ```python v0 = Callable[..., Coroutine[Any, Any, Any]] ``` ```python v1 = TypeVar('B', bound='Bot') ``` ```python v2 = Union[str, list, dict[str, str], None] ``` Input Types: v0 Output Type: v0 Dependencies: ```python @wraps(command) async def v3(self: v1, v4: Mess...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(self) -> float: v1 = self.get_number_of_tokens() return sum(v1) / len(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: ReductionOpInfo, torch.Tensor Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: ReductionOpInfo, v2: torch.Tensor, **v3): for (v4, v5) in v1.generate_args_kwargs(v2, **v3): v5.update(v3) v6 = v1...
Imports: ```python import typing ``` Type definitions: Input Types: List[List[str]] Output Type: int Dependencies: ```python def v0(v1, v2): if v1 < 0 or v2 < 0 or v1 >= m or (v2 >= n): return 0 if grid[v1][v2] == '1': grid[v1][v2] = '0' v0(v1 + 1, v2) v0(v1 - 1, v2) v0(...
Imports: ```python import datetime as dt import pandas as pd import typing ``` Type definitions: Input Types: pd.DataFrame, str Output Type: pd.DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1: pd.DataFrame, v2: str) -> pd.DataFrame: v1 = v1[['timestamp', 'open', 'high', 'low', 'close...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: List[Tuple[str, str, str, int, Optional[Dict[str, str]]]] Dependencies: ```python def v0(v1): v1.execute(sql, (limit,)) return v1.fetchall() ``` Function Name: v2 Function: ```python async def v2(self, v3: int=10) -> List[Tupl...
Imports: ```python import typing ``` Type definitions: Input Types: str, Dict[str, str] Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: Dict[str, str]): v3 = {'doc': v2} self.client.update(index=self.index, doc_type='_doc', id=v1, body=v3, refresh=self.refresh_ty...
Imports: ```python import polars as pl import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0() -> None: v1 = pl.DataFrame({'a': [1.0, 2.8, 3.0], 'b': [4, 5, 6], 'c': [True, False, True], 'd': ['a', 'b', 'c']}) assert v1.describe().shape ...
Imports: ```python import typing ``` Type definitions: Input Types: list, bool Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list, v2: bool): if v1[0] in self.ems_num_dict and len(v1) == 1: v1 = list(getattr(self, 'tc_' + v1[0]).keys()) elif not self.ems_list_up...
Imports: ```python import torch from torch.utils.data import Dataset import typing ``` Type definitions: Input Types: List[Dict], int Output Type: Dict Dependencies: ```python def v0(v1: Dict, v2: Dict) -> Dict: v3 = v1.copy() for v4 in v2.keys(): v3[v4] = v2[v4] return v3 ``` Function Name: v5 Fun...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any, Any, int Output Type: None Dependencies: ```python def v0(v1: str, v2: str, v3: int) -> dict: if v3 < 0: raise ValueError('Count must be a positive non-zero number') v4 = {'jsonrpc': '2.0', 'id': get_random_id(), 'method...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: typing.Generator['PatternTypes', None, None] Dependencies: Function Name: v0 Function: ```python def v0(self) -> typing.Generator['PatternTypes', None, None]: if self.patterns is not None: yield from self.patterns ```
Imports: ```python import os import typing ``` Type definitions: Input Types: str, str Output Type: TensorDataset Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str='klue-dp-v1_test.tsv') -> TensorDataset: v3 = os.path.join(v1, v2) return self._create_dataset(v3) ```
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int]) -> int: v2 = 0 v3 = 1 v4 = [0] while v3 < len(v1): v2 = max(v2 - 1, v1[v3 - 1] - 1) v4.append(v2 + v1[v3]) ...
Imports: ```python import typing ``` Type definitions: Input Types: int, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int, v2=1): if len(self.nums) < v1: self.fill_N_elements(v1) return sum(self.nums[0:v1]) ```
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 = 'SELECT developer_handle FROM registered_table WHERE address=?' v3 = (v1,) v4 = self._execute_single_sql(v2, v3) if len(v4[0])...
Imports: ```python import typing ``` Type definitions: Input Types: List[Tuple[List[str],]] Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(v1: List[Tuple[List[str],]]) -> List[str]: v2 = len(v1) if v2 == 0: raise RuntimeError('Input batch must have at least 1 batch e...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[str] Output Type: dict Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[str]=None) -> dict: v2 = {'type': v1} return self._get(self.base_path, args=v2)['seeds'] ```
Imports: ```python import typing ``` Type definitions: Input Types: argparse.Namespace Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: argparse.Namespace): self._version(v1) self._set_log_level(v1) self._load_config(v1) ```
Imports: ```python import typing ``` Type definitions: Input Types: np.ndarray, tuple Output Type: [np.ndarray, None] Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: tuple) -> [np.ndarray, None]: assert v1.ndim == 2 v3 = v2[0] - self.pad if v2[0] - self.pad >= 0 else 0 v4 = ...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: ```python def v0() -> Tuple[str, str]: v1 = 'shell-command-logger' v2 = __version__ return (v1, v2) ``` Function Name: v3 Function: ```python def v3() -> str: (v4, v5) = v0() return f'{v4} {v5}' ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4, v5='D-SP', v6: int=None): v6 = v2 if v6 is None else v6 if v5 == 'D-SP': v7 = pow(v1, 4) * pow(v4, 2) * pow(v3, 2...
Imports: ```python import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import typing ``` Type definitions: Input Types: str, str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(self, v1: str, v2: str): for v3 in self._addresses: tr...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: List[str] Dependencies: Function Name: v0 Function: ```python def v0(self) -> List[str]: v1 = ['cur_lr_actor', 'cur_lr_critic', 'critic_loss', 'actor_loss', 'total_loss', 'q_value', 'q_value_twin', 'action', 'td_error', 'vae_loss', ...
Imports: ```python import numpy as np import typing ``` Type definitions: ```python @dataclass class v0: v1: List v2: List v3: str v4: int v5: int def v6(self): return len(self.irrep_matrices) ``` Input Types: List[Structure], List[SymmOp], v0, int, List, List Output Type: Any Dependenc...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: Optional[np.ndarray], np.ndarray Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[np.ndarray], v2: np.ndarray) -> None: if v1 is None: self.number_units = len(v2) elif ...
Imports: ```python import typing ``` Type definitions: Input Types: Optional[str], Optional[int] Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Optional[str]=None, v2: Optional[int]=None) -> None: self._draft_number = v2 self._commit_id = v1 ```
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._rotation in (90, 270) v3 = v1 in (90, 270) if v2 != v3: (self._width, self._height) = (self._height, self._width) ...
Imports: ```python import typing ``` Type definitions: Input Types: Namespace Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Namespace) -> None: if v1.load_standard_tissue_means is not None: self.load_standard_tissue_means(v1.load_standard_tissue_means) self...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, Any, Any, Any, Any, Any Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1, v2, v3, v4, v5, v6, v7) -> str: v8 = [ord(v1), ord(v2)] for v9 in range(v3 - 2): v8.append((v4 * v8[-1] + v5 * v8[-2] + ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: Dict[str, Any] Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> Dict[str, Any]: if v1 in self.blocks_cache: return self.blocks_cache[v1] v2 = self.w3.eth.getBlock(v1, full_transactions=True...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(self) -> str: v1 = self.step if v1 == 'A': return 'la' if v1 == 'B': return 'si' if v1 == 'C': return 'do' if v1 == 'D': ...
Imports: ```python import typing ``` Type definitions: Input Types: List[int], int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int], v2: int) -> int: v1.sort() v3 = len(v1) v4 = float('inf') v5 = 0 for v6 in range(v3): v7 = v3 - 1 v8 =...
Imports: ```python import json import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.transactions: self.stripped_transactions = [] for v1 in self.transactions: self.stripped_transactions.append(json...
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: Dict[str, Any] = {} v1.update(self.additional_properties) v1.update({}) return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Any, str Output Type: List Dependencies: ```python def v0(v1, v2: str) -> str: v3 = v2.split('\n') v4 = v1.start_point[0] v5 = v1.end_point[0] v6 = v1.start_point[1] v7 = v1.end_point[1] if v4 != v5: return '\n'.join([v...
Imports: ```python import typing ``` Type definitions: Input Types: Any, Any, List[td.TransitionMapping] Output Type: List[td.TransitionMapping] Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2, v3: List[td.TransitionMapping]) -> List[td.TransitionMapping]: v4 = [] for v5 in v3: ...
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: str, v2: int, v3: int, v4: float, v5: Dict[str, int], v6: Dict[str, int], v7: int=np.inf, v8: Optional[int]=None, v9: Optional[int]=None, v10: Optional[int]=None, v11: bool=False, v12: Optional[float]=None, v13: Optio...
Imports: ```python import pandas as pd from pandas.io.json import json_normalize import typing ``` Type definitions: Input Types: list, list, list, list, list Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: list, v2: list, v3: list, v4: list, v5: list) -> None: self.logger.i...
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, float] Output Type: Dict[str, float] Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, float]) -> Dict[str, float]: v2 = {} for v3 in v1: v2[v3] = v1[v3] return v2 ```
Imports: ```python import os import json from datetime import datetime import typing ``` Type definitions: Input Types: int, int, str Output Type: Any Dependencies: ```python def v0(v1: int): v2 = DIR_PATH + f'{v1}.json' try: with open(v2, newline='\n', encoding='utf-8') as v3: v4 = json.lo...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> str: v1 = v1.upper() v1 = v1.replace('\n', '') v1 = v1.replace('\t', '') v1 = v1.replace(' ', '') v1 = v1.replace(' ', '') v1 =...
Imports: ```python from datetime import date, datetime, timedelta import typing ``` Type definitions: Input Types: int Output Type: v0 Dependencies: Function Name: v0 Function: ```python def v0(self, v1: int) -> v0: if v1 < 0: v1 += self.num_days() + 1 return v0(self.year, self.month, v1) ```
Imports: ```python import argparse import typing ``` Type definitions: Input Types: str Output Type: argparse.ArgumentParser Dependencies: Function Name: v0 Function: ```python def v0(v1: str) -> argparse.ArgumentParser: v2 = argparse.ArgumentParser(description=v1) v2.add_argument('-c', '--config', default='/...
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: print('One-way anova') v1 = np.asarray(v1) v2 = v1.shape[0] v3 = v1.shape[1] v4 = v2 *...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: pathlib.Path Dependencies: Function Name: v0 Function: ```python def v0(self) -> pathlib.Path: self._generate_test_cases_in_cloned_repository(compile_checker=True) return self._get_problem_directory_path() / 'checker' ```
Imports: ```python import typing ``` Type definitions: ```python class v0: def __init__(self, v1: int, v2: str, v3: Dict[str, Union[float, int]], v4: Dict): self.measurement = v2 self.values = v3 self.tags = v4 self.timestamp = v1 def v5(self): v6 = [] for (v7, ...
Imports: ```python import typing ``` Type definitions: ```python class v0(Enum): v1 = 1 v2 = 2 ``` Input Types: float, int, float, v0 Output Type: float Dependencies: Function Name: v3 Function: ```python def v3(self, v4: float, v5: int, v6: float, v7: v0) -> float: v8 = self.get_beam_xy_from_det_dist(v4, ...
Imports: ```python import base64 import json from datetime import datetime import typing ``` Type definitions: Input Types: Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self) -> bool: self.read_refresh_token() if not self.get_access_token(): self.get_authorization_code...
Imports: ```python import typing ``` Type definitions: Input Types: str Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str): v2 = 24 if len(v1) > v2: v1 = v1[:v2 - 4] v1 += ' ...' v1.replace('\n', ' ') return v1 ```
Imports: ```python import typing ``` Type definitions: Input Types: Dict[str, Any], float, int Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: Dict[str, Any], v2: float, v3: int=0) -> bool: v4 = v1['summary'].get('numCreated', 0) v5 = v1['summary'].get('numUpdated', 0) v6 ...
Imports: ```python import typing ``` Type definitions: Input Types: List[int] Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[int]) -> int: if len(v1) == 1: return sum(v1) v2 = v1[0] v3 = 0 for v4 in range(len(v1)): v3 += v1[v4] if v3 ...
Imports: ```python import typing ``` Type definitions: Input Types: falcon.Request, falcon.Response Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1: falcon.Request, v2: falcon.Response) -> None: v3: str = v1.get_param('key') v4: Any = v1.get_param('value') self.log.de...
Imports: ```python import typing ``` Type definitions: Input Types: GraphModule Output Type: Any Dependencies: ```python def v0(v1): if len(v1) > 1 and v1 not in groups: groups.append(v1) return [] ``` ```python def v2(v3, v4): v5 = {} for v6 in v3: if v4[v6.name] in ALL_OP_TYPE: ...
Imports: ```python import typing ``` Type definitions: Input Types: Any, bool, Any, Any, Any Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1, v2: bool, v3='', v4='', v5=None): v6 = '#FFFFFF' if v2 else '#f6989d' v1.setStyleSheet(f'QLineEdit {{ background-color: {v6} }}') if ...
Imports: ```python import argparse import os import typing ``` Type definitions: Input Types: Output Type: argparse.ArgumentParser Dependencies: Function Name: v0 Function: ```python def v0() -> argparse.ArgumentParser: if 'AP_CNFG' in os.environ: v1 = os.environ['AP_CNFG'] else: v1 = os.path...
Imports: ```python import typing ``` Type definitions: Input Types: list Output Type: Any Dependencies: ```python def v0(v1: str, v2: int): v1 = list(v1) del v1[0] del v1[-1] v3 = 1 v4 = v1[0] for v5 in range(1, len(v1)): if v1[v5] > v4: v3 = v3 + 1 v4 = max(v1[:v5 +...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: self.kw_counts = dict() self.kw_associations = dict() for v1 in self.entries: for v2 in v1: if v2 != '': try:...
Imports: ```python import typing ``` Type definitions: Input Types: Any, list, str Output Type: list Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: list=[], v3: str='all_linked') -> list: v4 = [] for v5 in v1.rois_list: if v3 == 'all_linked': if v5.target == type(...
Imports: ```python import typing ``` Type definitions: Input Types: str, str, int Output Type: Any Dependencies: Function Name: v0 Function: ```python def v0(v1: str, v2: str, v3: int): v4 = v1.split(v2) if v3 >= len(v4): return v1 v1 = v2.join(v4[-v3:]) return v1 ```
Imports: ```python from operator import itemgetter, attrgetter import typing ``` Type definitions: ```python class v0(MSONable): def __init__(self, v1: float, v2: Optional[str], v3: int, v4: float, v5: bool, v6: bool): """A container class for a single defect formation energy. Args: de...
Imports: ```python import numpy as np from numpy import pi import typing ``` Type definitions: Input Types: Any, Any Output Type: float Dependencies: ```python def v0(v1: float, v2: int): return (v1 - 1 + 1 / v2) / (1 / v2 - 1) ``` Function Name: v3 Function: ```python def v3(v4, v5) -> float: v6 = (np.sqrt(v4...
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 v1 == 'true': return True if v1 == 'false': return False raise ValueError(f'Not a boolean: {v1}') ```
Imports: ```python import pickle import typing ``` Type definitions: Input Types: object Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: object) -> bool: try: pickle.dumps(v1) return True except (pickle.PickleError, AttributeError, RuntimeError): return...
Imports: ```python import typing ``` Type definitions: Input Types: runner.Runner, Any, Any Output Type: Any Dependencies: ```python def v0(v1: runner.Runner) -> sa.MetaData: v2 = sa.MetaData() v2.reflect(bind=v1.get_connection()) return v2 ``` ```python def v3(v4: sa.MetaData) -> List[sa.Table]: retur...
Imports: ```python import math import numpy as np import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: v1 = self.whr.get_log_likelihood() self.assert_close(6.0 * math.log(0.5), np.asarray(v1), 'log_lik') ```
Imports: ```python import re import typing ``` Type definitions: Input Types: Any, Any, Any, Any Output Type: DataFrame Dependencies: Function Name: v0 Function: ```python def v0(self, v1='', v2='', v3='*', v4='1') -> DataFrame: v5 = '1' if re.match('[\\d]{6}\\.S[ZH]', v1): v5 = f'TS_CODE = "{v1}"' ...
Imports: ```python import numpy as np from numpy.core.multiarray import ndarray import typing ``` Type definitions: Input Types: float, ndarray, ndarray Output Type: float Dependencies: Function Name: v0 Function: ```python def v0(v1: float, v2: ndarray, v3: ndarray) -> float: v4 = v2 ** (-v1) v4 = v4 / v4.su...
Imports: ```python from polars import internals as pli from polars.datatypes import DataType, py_type_to_dtype from polars.utils import _in_notebook, _prepare_row_count_args, _process_null_values import typing ``` Type definitions: ```python v0 = TypeVar('LDF', bound='LazyFrame') ``` Input Types: Union['pli.Expr', str]...
Imports: ```python import os import typing ``` Type definitions: Input Types: Any, str Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self, v1, v2: str) -> None: for v3 in range(v1): self.selection(v2) v4 = self.get_best_child() self.population = self.crossove...
Imports: ```python import numpy as np from ..transformers.tokenizer_utils_base import BatchEncoding, PretrainedTokenizerBase, PaddingStrategy import typing ``` Type definitions: ```python v0 = NewType('InputDataClass', Any) ``` Input Types: List[v0], Any Output Type: Dict[str, Any] Dependencies: ```python def v1(v2: Li...
Imports: ```python import typing ``` Type definitions: ```python v0 = str ``` Input Types: v0, list, bool Output Type: Any Dependencies: Function Name: v1 Function: ```python def v1(self, v2: v0, v3: list, v4: bool=False): if self[v2] not in v3: if v4: self[v2] = v3[-1] else: ...
Imports: ```python from inspect import signature, getmro import typing ``` Type definitions: Input Types: tp.Callable, str Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(v1: tp.Callable, v2: str) -> bool: v3 = signature(v1) if v2.startswith('**'): return v2[2:] in [p.name...
Imports: ```python import pickle import typing ``` Type definitions: Input Types: object, Path Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(v1: object, v2: Path) -> None: if not v2.exists(): v2.touch() print(f'pickle file {v2.name} created successfully!') else: ...
Imports: ```python import typing ``` Type definitions: Input Types: Union[date, datetime] Output Type: bool Dependencies: Function Name: v0 Function: ```python def v0(self, v1: Union[date, datetime]) -> bool: if self.weekdays.is_total(): return True v2 = v1.weekday() v3 = (v2 + 1) % 7 return v...
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0(self) -> None: if self.encoded: self.encoded = False ```
Imports: ```python import typing ``` Type definitions: Input Types: Output Type: docker.models.networks.Network Dependencies: Function Name: v0 Function: ```python def v0(self) -> docker.models.networks.Network: v1 = self.network_name try: v2 = self.docker.networks.get(v1) self.log.debug(f'Ne...
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[:, 0] -= v1[:, 2] / 2 v1[:, 1] -= v1[:, 3] / 2 v1[:, 2] = v1[:, 2] + v1[:, 0] v1[:, 3] = v1[:, 3] + v1[:, 1] return v1 ```
Imports: ```python import polars as pl from polars import testing import typing ``` Type definitions: Input Types: Output Type: None Dependencies: Function Name: v0 Function: ```python def v0() -> None: v1 = pl.DataFrame({'a': [1, 2, 3, 1, 2, 3], 'b': [4, 5, 6, 7, 8, 9]}) v2 = v1.groupby('a', maintain_order=...
Imports: ```python from collections import defaultdict import typing ``` Type definitions: Input Types: List[List[int]], int, int Output Type: int Dependencies: Function Name: v0 Function: ```python def v0(self, v1: List[List[int]], v2: int, v3: int) -> int: v4 = defaultdict(set) for v5 in v1: for v6 ...
Imports: ```python import collections import itertools import typing ``` Type definitions: Input Types: str Output Type: str Dependencies: ```python def v0(v1: str, v2: Set[str]) -> bool: if not v1.strip(): return True if v1.strip() == '//': return True if v1.startswith('# STOCKHOLM'): ...
Imports: ```python import numpy as np import typing ``` Type definitions: Input Types: np.ndarray, np.float64, int, Optional[int] Output Type: Tuple[Number, Number] Dependencies: Function Name: v0 Function: ```python def v0(v1: np.ndarray, v2: np.float64, v3: int, v4: Optional[int]=None) -> Tuple[Number, Number]: ...
Imports: ```python import typing ``` Type definitions: Input Types: int Output Type: None Dependencies: ```python def v0(v1: Any) -> bool: (v2, v1) = self.execute('nc -z localhost {}'.format(port)) return v2 != 0 ``` ```python def v3(v4: Callable) -> None: for v5 in range(900): if v4(False): ...