text stringlengths 190 325k |
|---|
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, v3) = (0, 0)
for v4 in v1:
if v3 == 0:
v2 = v4
v3 += 1
elif v2 == v4:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Iterator['Tree']
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Iterator['Tree']:
if self._iterated_leaves is None:
self._iterated_leaves = [n for v1 in self.traverse() if v1.is_leaf]
return iter(sel... |
Imports:
```python
import tensorflow as tf
import tensorflow.keras.layers as L
import typing
```
Type definitions:
Input Types: tf.TensorShape
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.TensorShape):
v2 = v1[1]
v3 = tf.where(1 - tf.eye(v2, dtype=tf.int8))
self... |
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[v1]
if hasattr(v2, 'memory_address'):
self._refs.pop(v2.memory_address, None)
``` |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types:
Output Type: argparse.Namespace
Dependencies:
Function Name: v0
Function:
```python
def v0() -> argparse.Namespace:
v1 = argparse.ArgumentParser(description='Record Linux system load to Stanley', epilog='Stanley password is read ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2=None) -> Any:
v3 = self.data
if len(v3[v1].values) > 0:
return np.mean(v3[v1].values[-self.window_size:])
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = dict()
with open(v1, 'r', encoding='utf-8') as v3:
v4 = v3.readlines()
for v5 in v4:
v6 = [i.strip() for v7 in v5.split... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Enum):
v1 = (0,)
v2 = (1,)
v3 = (2,)
v4 = (3,)
```
Input Types: float, int, v0
Output Type: Tuple[int, int, int, int]
Dependencies:
Function Name: v5
Function:
```python
def v5(self, v6: float, v7: int, v8: v0) -> Tuple[int, int,... |
Imports:
```python
import cvxpy as cvx
from cvxpy.expressions.variable import Variable
from cvxpy.tests.base_test import BaseTest
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = cvx.Minimize(cvx.sum(cvx.square(self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Dict[str, Any]
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: Dict[str, Any]={}) -> Dict[str, Any]:
v3: List[Dict[str, Any]] = v2 if v2 else await self.getWatches(wuid=v1)
... |
Imports:
```python
from random import choice, random, shuffle
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.connections:
v1: Tuple[int, int] = choice(list(self.connections.keys()))
del self.conn... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: Union[pd.DataFrame, List[pd.DataFrame]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str]=AGG_MEAN) -> Union[pd.DataFrame, List[pd.DataFrame]]:
self._ensure_fitted()
return self.__sp... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.table.clear()
self.table.commit()
``` |
Imports:
```python
import numpy as np
import numpy.typing as npt
import typing
```
Type definitions:
Input Types: Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> np.ndarray:
v2 = self.__cme
v3 = self.__n
v4 = np.sum(v1[1:] ** 2, axis=0)
v5 = np.sqrt(... |
Imports:
```python
import dataclasses
import inspect
import itertools
import sys
import warnings
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypeVar, Union
import typing
```
Type definitions:
Input Types: Any, bool
Output Type: None
Dependencies:
```python
def v0(v1: Any)... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.run_pants(['-q', 'compile'])
self.assert_success(v1)
self.assertEqual('', v1.stdout_data)
``` |
Imports:
```python
from collections import deque
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: Optional[v0]
Output Type: int
Dependencies:
Function Name: v4
Function:
```pyth... |
Imports:
```python
import string
import typing
```
Type definitions:
Input Types: str
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> float:
if v1:
v2 = sum([1 for v3 in v1 if v3 in string.punctuation])
return round(v2 / (len(v1) - v1.count(' ')), 3) * 100... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: Optional['RepoUrl']
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: List[str]) -> Optional['RepoUrl']:
if len(v2) == 1:
self.namespace = self.username
self.repo = v1
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[str, str], str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple[str, str], v2: str):
with self.lock:
v3 = self.caching.pop(v1)
v3.is_hit(True)
v3.content = v2
self.r... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list:
v1 = [{'host': self.host_node}]
for v2 in self.dependency_nodes:
v1.append({'dependency': v2})
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> str:
if v1 == 1:
return '1'
v2 = {1: '1'}
v3 = 2
while v3 <= v1:
v4 = self.cts(v2[v3 - 1])
v2[v3] = v4
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: int) -> bool:
v3 = {0: -1}
v4 = 0
for (v5, v6) in enumerate(v1):
v4 += v6
if v2 != 0:
v4 %= v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: '_io.TextIOWrapper'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: '_io.TextIOWrapper') -> None:
v2 = ['station', 'pos_x', 'pos_y', 'pos_z', 'dpos_vs_ref_x', 'dpos_vs_ref_y', 'dpos_vs_ref_z', 'dpos_vs_ref_e... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: dict, dict
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
v3 = np.zeros(len(v2))
for v4 in v1:
v3[v2[v4]] += 1 / len(v1)
return v3
```
Function Name: v5
Function:
```python
def v5(v6: dict, v7: dict):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, Any, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: Any, v3: Any) -> bool:
self._hitting_boundary = any((not self._eq_funcs[p](v2[p], v3[p]) for v4 in self._keys))
return self._hitting... |
Imports:
```python
from collections import defaultdict
from collections.abc import Mapping
import typing
```
Type definitions:
```python
v0 = T.TypeVar('_T')
```
Input Types: T.Mapping[str, v0], str
Output Type: T.Optional[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: T.Mapping[str, v0], v3: str) ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self: v0, v1: dict[str, Any], cls: type[PObject]) -> None:
self.query = v1
self.cls = cls
def v2(self: v0) -> Any:
v3 = {}
v4 = {}
for (v5, v6) in self.query.items():
if ... |
Imports:
```python
from decimal import Decimal
import typing
```
Type definitions:
Input Types: dict, str
Output Type: Decimal
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: str) -> Decimal:
if not v1:
return Decimal()
v3 = v1.get(v2, '0')
v4 = v3.replace('$', '').replace... |
Imports:
```python
import torch
from torch import nn
import typing
```
Type definitions:
Input Types: Any, torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: torch.Tensor):
v3 = v2
self.nfe += 1
(v2, v4, v5) = v2.split(split_size=(v2.numel() - self.param... |
Imports:
```python
import collections
import typing
```
Type definitions:
Input Types: Collection[Tuple[int, str]], int
Output Type: BoolDict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Collection[Tuple[int, str]], v2: int) -> BoolDict:
v3 = collections.OrderedDict()
for (v4, v5) in v1:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self.message_bvn = v1.replace('"', '“')
self.update_file()
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> None:
v3 = self._dict.pop(v2, None)
if v3:
return self._unlink_node(v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: object
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: object):
v2 = {}
v3 = v1['name']
v2['name'] = v3
v2[f'dylib_{v3}_cmdsize'] = v1['cmd_size']
v2[f'dylib_{v3}_version'] = v1['current_version']
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for v1 in self.output_formats:
v1.close()
``` |
Imports:
```python
import os
import shutil
import typing
```
Type definitions:
Input Types: str, Optional[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[str]=None) -> None:
if v2 is not None:
if not os.path.exists(f'{self.tmp_dir}/{v2}'):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'KademliaPeer'
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: 'KademliaPeer') -> bool:
if v1.node_id == self.node_id:
return False
async with self._split_lock:
return await self._a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: List[dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True) -> List[dict]:
v2 = 'process_payment'
v3 = self.plugins
if v1:
v3 = [plugin for v4 in v3 if self.get_plugin_configuration... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, Any
Output Type: Any
Dependencies:
```python
def v0(v1: int) -> str:
if isExistID(v1):
return thisData[v1]['temp'].copy()
return 0
```
```python
def v2(v3: int) -> bool:
if thisData:
return v3 in thisData
else... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
if v1 not in self.tree:
self.setdefault(v1)
self.weight_index[v1] = 1
while v1 != self.tree[v1]:
v1 = self.tree[v1]... |
Imports:
```python
from pathlib import Path
from datetime import datetime
import pandas as pd
import typing
```
Type definitions:
Input Types:
Output Type: NoReturn
Dependencies:
```python
@pytest.fixture(autouse=True)
def v0() -> pd.DataFrame:
v1 = Path(__file__).parent / 'resources/test_data.csv'
return pd.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: str='TERM') -> List[str]:
v3 = ['scancel', '-s', v2] + v1
return v3
``` |
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:
(v3, v4) = ([0] * 256, [0] * 256)
(v5, v6) = (0, 0)
(v7, v8, v9, v10, v11) = (0, 0, -1, 0, 0)
for v12 in v2:
... |
Imports:
```python
from datetime import datetime
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:
print('writing notification to log file at: ', self.fp)
with open(self.fp, 'a+') as v3:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: bool, Any, int, Any
Output Type: Any
Dependencies:
```python
def v0(v1: dict, v2: int, v3: str, v4: np.array, v5: str=None):
assert v3 not in v1
v6 = np.ndarray(shape=(len(v4),))
for (v7, v8) in enumerate(v4):
v6... |
Imports:
```python
import json
from os import path
import typing
```
Type definitions:
Input Types: dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> None:
with open(path.join(self.outdir, 'output.json'), 'a') as v2:
v2.write(json.dumps(v1))
v2.wr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True):
self.data.clear()
if v1:
if self.time is not None:
self.time.clear()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> List[str]:
v2 = v1 // 60
v3 = v1 % 60
return ['0:00', '{:d}:{:2d}'.format(v2, v3)]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int):
v3 = 'client/servers/{}/schedules/{}'.format(v1, v2)
v4 = self._api_request(endpoint=v3, mode='DELETE')
return 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 isinstance(v1, str) and v1.startswith('refs/heads/'):
return v1[len('refs/heads/'):]
return ''
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
self._accessory.remove_pollable_characteristics(self._aid)
self._accessory.remove_watchable_characteristics(self._aid)
``` |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor):
v2 = F.pad(v1, (0, 1, 0, 0))[..., :, 1:]
v3 = F.pad(v1, (0, 0, 0, 1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: types.primitives.RoomID, types.misc.RoomVisiblityEnum
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: types.primitives.RoomID, v2: types.misc.RoomVisiblityEnum):
v3 = {'data': {'visibility': f'{v2}'}}
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = namedtuple('PathIEToken', ['text', 'text_lower', 'text_before', 'text_after', 'index', 'charStart', 'charEnd', 'pos', 'lemma'])
```
Input Types: [v0], [int]
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: [v0], v3: [i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2, v3):
v4: sqlite3.Cursor = self._c
if v2.isSame(v3):
return True
v4.execute('UPDATE `items` SET `name`=:name, `price`=:pri... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: Union[None, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1='human') -> Union[None, np.ndarray]:
if v1 != self._render_mode:
raise ValueError('The render mode must match the render mode sel... |
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 = self.fields_to_partial_json()
v1[self.type_field_name] = self.typ
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: Iterable[v0], Callable[[v0], Any]
Output Type: Iterator[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Iterable[v0], v3: Callable[[v0], Any]=lambda x: x) -> Iterator[v0]:
v4: Set[v0] = set()
... |
Imports:
```python
import numpy as np
import tensorflow.compat.v1 as tf
from tensorflow.python.client import device_lib
import typing
```
Type definitions:
Input Types: Any
Output Type: Tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1=32) -> Tuple:
((v2, v3), (v4, v5)) = tf.keras.datasets.mnist... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> int:
if isinstance(v1, (list, tuple)):
v2 = len(v1)
else:
v2 = 1
return v2
``` |
Imports:
```python
import random
from pathlib import Path
import typing
```
Type definitions:
Input Types: Path, list, int
Output Type: Tuple[list, list]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: list, v3: int=42) -> Tuple[list, list]:
v4 = Path.cwd()
v5 = []
v6 = []
v7 ... |
Imports:
```python
import gzip
import typing
```
Type definitions:
Input Types: str
Output Type: Iterator
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Iterator:
if not v1.endswith('.gz'):
yield from open(v1)
else:
with gzip.open(v1) as v2:
for v3 in v2:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: None, str, str, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: None, v2: str, v3: str, v4: int, v5: int=0):
v1.sendline('tail -f -n +{:d} {}'.format(v5 + 1, v2))
v1.expect(v3, timeout=v4)
v6 = v1.... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Any, str, str, str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str, v3: str, v4: str) -> List[str]:
v5 = '^{stub}{sep}{suffix}$'.format(stub=re.escape(v2), sep=re.escape(v3), suffix=v4)
... |
Imports:
```python
import json
from pathlib import Path
import typing
```
Type definitions:
Input Types: Union[str, Path]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, Path]):
if not isinstance(v1, (str, Path)):
TypeError('resume_path is not of type str o... |
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.get(v1)
if v3:
v3.value = v2
return True
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str) -> None:
v3 = self.topics_in_stream(v1)
for (v4, v5) in enumerate(v3):
if v5 == v2:
v3.insert(0, v3.pop(v4))
... |
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:
assert v1.shape[1] == 3
return np.dot(v1 + self.translation, self.rotation)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, Optional[Callable], Optional[Callable]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *, v1: bool=True, v2: Optional[Callable]=None, v3: Optional[Callable]=None) -> Any:
if v2 is None and callable(getattr(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
if not self.MUST_MATCH_FIELDS:
return False
v2 = len(self.MUST_MATCH_FIELDS.keys())
v3 = []
for v4 in v1:
v5 = v4.get(... |
Imports:
```python
import numpy as np
import cvxpy as cvx
from cvxpy import Minimize, Problem
from cvxpy.expressions.constants import Constant, Parameter
from cvxpy.expressions.variable import Variable
from cvxpy.tests.base_test import BaseTest
import typing
```
Type definitions:
Input Types:
Output Type: None
Depend... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
if self.builder:
self.builder += ' '
if hasattr(self, 'kid_number'):
self.builder += f'{self.kid_number}. '
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: xr.DataArray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: xr.DataArray):
try:
return type(v1.data._meta).__module__.split('.')[0] == 'cupy'
except AttributeError:
return False
``` |
Imports:
```python
import warnings
import typing
```
Type definitions:
Input Types: str, Any, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2=None, v3=8, v4=20, v5=1):
warnings.warn('use until_scroll_element_to_center_by_css_selector instead', Deprecatio... |
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 = []
v3 = 0
(v4, v5) = (0, 1)
for v6 in v1:
if v6 != ' ':
if v6.isdigit():
v4 = v4 * 10 + in... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: None
Dependencies:
```python
def v0(v1: bytes, v2: int, v3: bytes, v4: bytes) -> bytes:
v5 = get_nonce_bytes(v2)
v6 = ChaCha20_Poly1305.new(key=v1, nonce=v5)
v6.update(v3)
(v7, v8) = v6.encrypt_and_digest(plaintext=v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Optional['Server']
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> Optional['Server']:
for v2 in self.servers:
if v2.service_class == v1:
return v2
return None
``` |
Imports:
```python
import urllib.request as libreq
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
```python
def v0(v1: str):
v2 = f'http://doi.crossref.org/servlet/query?usr=guenevere.p@gmail.com&format=unixref&qdata={v1}'
with libreq.urlopen(v2) as v3:
v4... |
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.get_pages(v1)
if v2:
return self.download_pages_gen(v2)
else:
return None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v1 = v1.replace('surprise', 'suprise')
self.set_tag(v1)
if self.talking:
self.set_talking()
else:
self.set_not_talking()
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.Union['Role', str], t.Union[set, list, str]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: t.Union['Role', str], v2: t.Union[set, list, str]) -> bool:
if (v3 := self._prepare_role_modify_args(v1)):
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
v0 = Union[RandomSeed, np.random.RandomState, np.random.Generator]
```
Input Types: v0, int
Output Type: Union[Sequence[int], np.ndarray]
Dependencies:
```python
def v1(v2):
v3 = []
while len(set(v3)) != chains:
v3 = [in... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Mapping[str, Any], Text, Optional[Dict[str, Any]]
Output Type: Text
Dependencies:
```python
def v0(v1: Mapping[str, Any]) -> Mapping[str, Any]:
return v1['action']['data']
```
```python
def v2(v3: Mapping[str, Any]) -> Text:
return v0(v3)['boa... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: partial
Output Type: object
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1: partial) -> object:
v2 = asyncio.get_event_loop()
return await v2.run_in_executor(None, v1)
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, Any
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: torch.Tensor, v3) -> torch.Tensor:
v4 = torch.empty_like(v2, dtype=torch.float32)
v4 = v1 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> bool:
v2 = True
for v3 in v1[1:-1]:
if '?' in v3:
v2 = False
break
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
print('EMOTION')
pass
'\n while False:\n\n if time.time() - self.timer0 > self.interval:\n ... |
Imports:
```python
import sys
from pathlib import Path
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
try:
return str(Path(sys._MEIPASS).joinpath(Path(v1).name))
except Exception:
return v1
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0(*v1):
v2 = os.path.dirname(os.path.dirname(__file__))
v2 = os.path.normpath(os.path.join(v2, *v1))
return v2
```
Function Name: v3
Function:
```python
def v3(*v4: str) -> str:
... |
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()
v1.add_argument('whl_file', help='The input whl file.')
v1.add_a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> dict:
v1.var_type = v1.var_type.upper()
return v1.dict()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: float
Dependencies:
```python
def v0(v1: int) -> Tuple[bytes, float]:
v2: int = v1
return ('_'.join(['readanalogue', str(v1), str(v2)]).encode('utf-8'), float(v2))
```
Function Name: v3
Function:
```python
def v3(self, v4: int... |
Imports:
```python
import json
from os import mkdir, path
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict):
v2 = path.join(path.expanduser('~'), '.config/diadon')
v3 = path.join(v2, 'keys.json')
if path.isdir(v2):
... |
Imports:
```python
from itertools import groupby, zip_longest
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Data=None, v2: Optional[List[str]]=None):
self._data = []
self._columns = []
if v2 is not None:
self.columns = list(v2)
if not v1:... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: List[str]
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> pd.DataFrame:
(v2, v3, v4) = ([], [], [])
v5 = v1[0][3:]
v6 = v1[1]
v7 = ''
v8 = 2
v9 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
self.pp_result = await self.pp_reader.read(self.reader)
self._reset_streams(self.reader, self.writer)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self._generate_graph()
self._show_graph(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> str:
if v2 in ['Cold Spring Harbor Laboratory', 'Research Square']:
return 'preprint'
if v1 in ['journal-article', 'book-chapter']:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str=HOSTS_FILE_PATH) -> None:
with open(v2, 'a') as v3:
v3.write(f'{v1}\n')
return None
``` |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: str, list, str, Any, str, str
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
v2 = v1.split(',')
v3 = v2[1]
v4 = v2[2]
v5 = v2[3]
v6 = v2[4]
v7 = v2[5]
v8 = v3.split('.')
v9 = v8[0]
v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.