text stringlengths 190 325k |
|---|
Imports:
```python
from dataclasses import dataclass, replace, field, asdict, is_dataclass
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Optional[Callable]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, *, v2) -> Optional[Callable]:
if isinstance(v1, dict):
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.Timestamp
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame) -> pd.Timestamp:
v2 = v1.loc[v1[self._symbol_field_name].first_valid_index()][self._symbol_field_name].upper()
try:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> list:
v2 = len(v1) - 1
v3 = 0
v4 = False
while not v4 and v2 - v3 > 1:
v4 = True
for v5 in range(v3, v2):
if v1... |
Imports:
```python
import numpy as np
import numpy.ma as ma
from pandas._config import get_option
from pandas._libs import algos as libalgos, lib, properties
from pandas._libs.hashtable import duplicated
from pandas._libs.lib import no_default
from pandas._typing import AggFuncType, AnyArrayLike, ArrayLike, Axes, Axis,... |
Imports:
```python
import numpy as np
import os
from netCDF4 import Dataset
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
assert os.path.exists(v1)
v2 = Dataset(v1, 'r')
assert all([a in v2.variables for v3 in ('x... |
Imports:
```python
import numpy
import typing
```
Type definitions:
Input Types: List[tuple], Any
Output Type: List
Dependencies:
```python
def v0(v1, v2, v3, v4, v5=20):
(v1, v2, v3, v4) = map(numpy.array, [v1, v2, v3, v4])
v6 = 0.5
def v7(v8, v9, v10):
(v11, v12) = v9
(v13, v14) = v10
... |
Imports:
```python
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: Any, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str='accuracy'):
(v3, (v4, v5)) = plt.subplots(ncols=2, figsize=(10, 4))
v4.plot(v1.history['loss'], label='train')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str, str
Output Type: None
Dependencies:
```python
def v0(v1: Any, v2: str) -> bool:
return callable(getattr(v1, v2, None))
```
Function Name: v3
Function:
```python
def v3(v4: Any, v5: str='info', v6: str='warning') -> None:
def v7(v8: ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2, v3):
self.name = v1
self.sig = v3
self.func = v2
def v4(self):
return self.name + str(self.sig)
def v5(self):
return hash(str(self))
def v6(self, v7: datasets... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.total_put_processed_count += 1
self.cur_queue_len += 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
try:
self.dbLock.acquire(True)
self.db.execute('DELETE FROM ' + self.table + ' WHERE ' + self.primary + '=?', (v1,))
self.db.f... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
while not self._exiting:
with self._event_thread_cond:
while not self._exiting and self._sched.empty():
self._event_t... |
Imports:
```python
from sklearn.decomposition import TruncatedSVD
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.decomposer_ = TruncatedSVD(n_components=self.n_components, random_state=self.random_seed)
self.z_... |
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 = v1.find('Where was')
v3 = v2 + len('Where was') if v2 >= 0 else -1
v4 = v1.find('before')
if v3 == -1 or v4 == -1:
rai... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
super().reset()
self.controller_arm.reset()
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
self._generate_subspaces(features=v1)
v2 = np.arange(self.n_models)
if self.training_method == self._TRAIN_RANDOM_PATCHES... |
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 is not None:
if self.allowed_ids and v1 not in self.allowed_ids:
return True
if self.denied_ids and v1 in s... |
Imports:
```python
import os
import sys
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
```python
def v0(v1: str) -> bool:
v2 = os.path.dirname(v1)
return os.path.isdir(v2)
```
Function Name: v3
Function:
```python
def v3(v4: str) -> None:
if not v0(v4):
sys.exi... |
Imports:
```python
import nltk
from nltk.corpus import stopwords
import typing
```
Type definitions:
Input Types: int, int, int, bool
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int=1, v3: int=250, v4: bool=True) -> pd.DataFrame:
v5 = []
for v6 in ra... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, None]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(*v2: List[str], v1: Union[str, None]=None) -> str:
v1 = f'?<{v1}>' if v1 is not None else ''
return f"({v1}{''.join(v2)})"
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[pokemon.Pokemon]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[pokemon.Pokemon]):
for v2 in v1:
self.pokemon[v2.name] = v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: any, str, bool
Output Type: any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: any, v2: str='', v3: bool=True) -> any:
v4 = self.__get_index(v2)
if isinstance(v1, str):
v5 = self.es_engine.get(index=v4, id=v1, ig... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
v2 = 10 ** 9 + 7
v3 = [1] * 5
for v4 in range(v1 - 1):
v5 = [0] * 5
v5[1] = (v5[1] + v3[0]) % v2
v5[0] = (v5[0]... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Tensor) -> tf.Tensor:
v2 = tf.sort(v1)
v3 = v2[1:] - v2[:-1]
if tf.reduce_all(v3 == 0.0):
return tf.random.... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types:
Output Type: sp.csr.csr_matrix
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> sp.csr.csr_matrix:
if self.is_trimmed:
v1 = self.data['matrix'][self.empty_barcode_inds, :].tocsc()
v2 = v1[:, self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterator[str], Optional[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterator[str], v2: Optional[str]='#'):
v1 = (l.strip() for v3 in v1)
v1 = (v3 for v3 in v1 if v3)
if v2:
v1 = (v3 for v3 ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Sequence[float]
```
Input Types: int, int
Output Type: List[List[v0]]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: int, v3: int) -> List[List[v0]]:
v4 = 1.0 / float(v2)
v5 = 1.0 / float(v3)
v6 = [[None] * self.nco... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.width = self.frame.shape[1]
self.height = self.frame.shape[0]
self.coordinate_matrix = np.zeros((self.width, self.height,... |
Imports:
```python
import os
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Dict[str, str]) -> None:
self.otbn_as = self.get_tool(v1, 'OTBN_AS')
self.otbn_ld = self.get_tool(v1, 'OTBN_LD')
self.rv32_tool_as = self.get_tool(v1, 'RV32_TOOL_AS')
self.rv3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: (int, bool)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> (int, bool):
v2 = {}
v3 = v4 = 0
while v3 < len(v1):
v5 = v2.get(v3, False)
if v5:
return (0, False)
v2[v3]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> None:
self._last_lines_by_row = {}
self._last_rendered_width = v2
self._last_rendered_height = v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=24) -> str:
if len(self.value) <= v1:
return self.value
return f'{self.value[:v1 - 3]}...'
``` |
Imports:
```python
import torch
import torch.nn as nn
from torch.nn import Parameter
import torch.optim as optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.nn import PairwiseDistance
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function N... |
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:
self.swa_completed = v1['swa_completed']
self.step_counter = v1['step_counter']
self.swa_started = v1['swa_star... |
Imports:
```python
import sys
from Bio import Entrez, SeqIO
from Bio.Data import IUPACData
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
v2 = False
with Entrez.esummary(db='nucleotide', id=v1) as v3:
... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Dict[str, int], str, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, int], v2: str, v3: bool=True):
with open(v2, 'w') as v4:
json.dump(v1, v4, sort_keys=v3, indent=4)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Optional[List[str]]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any, v2: Optional[List[str]]) -> str:
if v2:
v3 = [f'{col}={repr(getattr(v1, col, None))}' for v4 in v2]
v5 = f"({', '.join(v... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.fsd.close()
if os.path.exists(self.file_path):
os.remove(self.file_path)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bullet_client.BulletClient, np.ndarray, float, int, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bullet_client.BulletClient, v2: np.ndarray, v3: float, v4: int=0, v5: int=0, v6: int=1):
v7 = v1.createVi... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.form.check_box_select_all.setChecked(True)
v1 = self.form.get_platforms(True)
self.assertEqual(v1, self.PLATFORMS)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self.grass_executor.remote_create_killed_job_ticket(job_name=v1)
self.grass_executor.remote_delete_pending_job_ticket(job_name=v1)
``` |
Imports:
```python
import gc
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: int=None) -> None:
gc.collect()
if v1 is None:
v1 = web3.eth.blockNumber
for v2 in _revert_refs.copy():
v3 = v2()
if v3 is None:
_revert_re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: int=2):
v3 = v1.split('\n')
if len(v3) == 1:
return v1
else:
v3 = [v3[0]] + [' ' * v2 + line for v4 in v3[1:]]
return '\n'.join(v3)
```
Function Name... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor, v2: Tensor, v3: Tensor, v4: Tensor, v5: Tensor, v6: Tensor, v7: Tensor):
v8 = self.positional_enc... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Tuple[float, float]
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: Tuple[float, float]) -> np.ndarray:
v3 = v2[1] - v2[0]
if v3 > 0:
return (... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as func
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor) -> torch.Tensor:
v1 = self.fc(v1)
return func.soft... |
Imports:
```python
from cvxpy import log
from cvxpy import Constant, Variable
from cvxpy.settings import UNKNOWN, QUASILINEAR
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.assertEqual((self.const + self.cvx).curva... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'np.ndarray', 'np.ndarray'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'np.ndarray', v2: 'np.ndarray', *v3, **v4) -> None:
self._validate_key_vector_shapes(v1, v2)
if 'default' in self.write_handler.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: int
Dependencies:
```python
def v0(v1, v2):
v3 = v1 >= GRID_MIN
v4 = v1 < GRID_MAX
v5 = v2 >= GRID_MIN
v6 = v2 < GRID_MAX
return v3 and v4 and v5 and v6
```
```python
def v7(v8: list, v9, v10) -> list:
v11 = [... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> None:
print('La practica se debe compilar de la siguiente manera: ')
print(f'$ python3 {v1} <ip:http_service> <comunidad:nombre>')
pri... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
v1 = await self._arlo.server_get(f'/hmsweb/users/device/ratls/token/{self._device}')
self._token = v1['ratlsToken']
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
```python
def v0(v1: str) -> str:
(v2, v3) = pgpy.PGPKey.from_file(Config.OUR_EXPORT_FILE_DECRYPTION_KEY)
with v2.unlock(Config.OUR_EXPORT_FILE_DECRYPTION_KEY_PASSPHRASE):
v4 = pgpy.PGPMessage.f... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2=True) -> int:
if not v1:
raise ValueError('The `permission_slug` argument is empty.')
v3 = self.cache.get_permission_uid(v1)
... |
Imports:
```python
import shutil
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
v2 = ' ' * (shutil.get_terminal_size()[0] - 1)
print(f'\r{v2}\r{v1}', end='')
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: List[np.ndarray]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[np.ndarray]) -> None:
v2 = len(v1)
v3 = np.sum([v1[i].dot(self.coefficients[i].T) for v4 in range(v2)], axis=0)
... |
Imports:
```python
import collections
import operator
import itertools
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
```python
def v0(v1: list, v2: str) -> str:
if v2 == 'n':
return v1[0]
if v2 == 's':
return v1[-1]
if v2 == 'e':
return ''.joi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: str):
if self.cam_matrix_exist(v1, v2):
v3 = v1.get_stream(v2)
v4 = v3['stream_properties']['intrinsics_pinhole']['camera_matrix_3x... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = re.compile('\\-\\-.*(\\n|\\b)')
v3 = re.compile('\\/\\*(\\s|.)*?\\*\\/')
v1 = re.sub(v3, '', v1)
v1 = re.sub(v2, '', v1)
... |
Imports:
```python
import numpy
import typing
```
Type definitions:
Input Types: List
Output Type: List
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List) -> List:
v2 = []
v3 = numpy.random.permutation(9)
v4 = [numpy.random.permutation(range(3 * i, 3 * (i + 1))) for v5 in range(3)]
v... |
Imports:
```python
import os
import sys
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = ['INSTALL.bat', 'requirements.txt', 'RUN.bat']
v2 = ['.replit', 'pyproject.toml']
if self.mode == 'pc':
for v3 ... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor:
v3 = torch.mean(v2)
return v2 * v3 / v1 + (1 - v2) * (1 - v3) / (1 - v1)
```
Function Name: v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> list:
v2 = sorted([(v, k) for (v3, v4) in v1.items()])
v5 = []
while len(v2) > 1:
v6 = v2[0]
for v7 in v2[1:]:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2, v3, v4=1e-05):
v5 = (v1 - v2) / (v3 - v2)
v5 = v5 * (1 - 2 * v4) + v4
return v5
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.line_string_list[self.chosen_LineIndex][self.chosen_LetterIndex:]
self.line_string_list[self.chosen_LineIndex] = self.line_string_list[self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[int]
Output Type: Tuple[str, float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[int]=None) -> Tuple[str, float, float]:
assert v1 is not None or self.avg_divisor is not None
if v1 is None:
... |
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 = {'tag': self.tag, 'frequency': self.frequency, 'first_date': self.dates[0].strftime('%Y-%m-%d'), 'last_date': self.dates[-1].str... |
Imports:
```python
import numpy as np
import torch
from numpy import ndarray
from torch import Tensor
import typing
```
Type definitions:
```python
v0 = TypeVar('TensArr', Tensor, ndarray)
```
Input Types: str, Sequence[v0], Any, type
Output Type: v0
Dependencies:
```python
def v1(v2: v0, v3: type, v4: Union[int, torch... |
Imports:
```python
import pandas as pd
from pandas.api.types import is_string_dtype
from pathlib import Path
import zipfile
import typing
```
Type definitions:
Input Types: Union[str, Path], List[int]
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[str, Path], v2: List[i... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: Optional[int]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Optional[int]:
with os.popen('free -t -m') as v1:
v2 = v1.readlines()
if not v2:
return None
v3 = int(v2[1].split()[6])
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Dict[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Dict[str, Dict[str, str]]:
v1 = {}
v1['name'] = '律師'
v1['id'] = 'lawyer'
v2 = {}
v2['lawyers'] = '律師'
v1['sub'] = v2
r... |
Imports:
```python
from skimage.measure import regionprops
import typing
```
Type definitions:
Input Types: 'Image'
Output Type: List['Proposal']
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Image') -> List['Proposal']:
v2 = regionprops(v1.to_numpy())
return [self._prop_to_proposal(pr... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(InstrumentModule):
pass
```
Input Types: v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> None:
if self._locked:
raise AttributeError('Cannot append to a locked channel list')
i... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.num_gts = 0
self.num_preds = 0
self.tot_iou = 0.0
self.num_matches = 0
``` |
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 = 0
v3 = [0] * len(v1)
for v4 in range(1, len(v1)):
if v1[v4] == ')':
if v1[v4 - 1] == '(':
if v... |
Imports:
```python
import torch
import copy
import typing
```
Type definitions:
Input Types:
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0() -> np.ndarray:
v1 = copy.deepcopy(torch.random.get_rng_state())
return v1.numpy()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[torch.Tensor]
Output Type: Iterator[torch.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[torch.Tensor]=None) -> Iterator[torch.Tensor]:
"""
assert self.data.numel() <= sum(
self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if v1 in ['none', 'noop', 'text', 'plain']:
return ''
return v1
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: str
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> float:
v2 = float(v1)
if v2 >= 9.9e+37:
v2 = np.float('INF')
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(pd.DataFrame):
v1 = [_TABLE_INFO_FIELD_NAME]
@property
def v2(self):
return v0
def v3(self, v4, v5=None, **v6):
"""
Overrides pandas.core.generic.NDFrame.__finalize__()
This method is responsible... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._encoders.token_to_index.eval()
self._encoders.index_to_token.eval()
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = {}
for (v2, v3) in enumerate(self._variables.iloc[:, 0].to_list()):
v1[v3] = {}
v4 = self._dyn_str.where(self... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Union[str, Path], str
Output Type: Generator[Path, None, None]
Dependencies:
```python
def v0(v1: Union[str, Path]) -> bool:
from PIL import Image
try:
v2 = Image.open(str(v1))
except IOError:
retur... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self.good_audit.pop(v1, None)
self.bad_audit.pop(v1, None)
self.missing_audit.pop(v1, None)
self.no_audit.pop(v1, None)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if v1 == '0':
return '検索対象'
if v1 == '1':
return '検索対象除外'
raise ValueError
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.button_back.move(x=20, y=20)
self.text_finish.move(y=20, centerx=self.centerx)
self.player_grid.move(x=20, centery=self.centery)
self.op... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple, torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple, v2: torch.Tensor) -> torch.Tensor:
(v3, *v4) = v1
v5 = self.cls_loss(v3, v2)
v6 = 0
for v7 in v4:
v6 = s... |
Imports:
```python
from pandas._config import get_option
from pandas._libs import lib
from pandas._libs.interval import Interval, IntervalMixin, IntervalTree
from pandas._libs.tslibs import BaseOffset, Timedelta, Timestamp, to_offset
from pandas._typing import Dtype, DtypeObj
from pandas.errors import InvalidIndexError... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict):
for v3 in v2['data']:
(v4, v5) = self.gateway.parse_position_data(v3)
self.gateway.on_position(v4)
if v5:
... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tuple[Tensor, Tensor, Tensor]
Dependencies:
```python
def v0(v1: Tensor, v2: Tensor) -> Tensor:
assert v2 > 0.0 and v2 <= 1.0
v3 = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, set
Output Type: Tuple[Dict[str, Tuple[int, int]], int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: set) -> Tuple[Dict[str, Tuple[int, int]], int]:
v1['found'] = v1['tran_id'].isin(v2)
v3 = l... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[list]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[list]):
v2 = [[value * weight for (v3, v4) in zip(row, self.criteria_weights)] for v5 in v1]
return v2
``` |
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 < self._index:
raise IndexError(v1)
return self._text[self._index:v1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
(v2, v3) = divmod(self.posting_count, v1)
if v3 > 0:
return v2 + 1
else:
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: int
Dependencies:
```python
def v0(v1):
if v1 > 4294967295:
raise OverflowError
if v1 > 2147483647:
v1 = int(4294967296 - v1)
if v1 < 2147483648:
return -v1
else:
... |
Imports:
```python
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.dataset.NumberOfFrames
print(type(v1))
self.dataset.add_frame(np.zeros((1, 1), dtype=np.uint8), 1)
assert self.d... |
Imports:
```python
from decimal import Decimal
import typing
```
Type definitions:
Input Types: Dict, List[Dict]
Output Type: Decimal
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict, v2: List[Dict]=None) -> Decimal:
if not v2:
v2 = []
return Decimal(v1['amount'] + sum([c['amount'] ... |
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:
v1.sort(reverse=True)
v2 = -1 * int(len(v1) / 3)
return sum(v1[1:v2:2])
``` |
Imports:
```python
import shutil
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = 0
while True:
v2 = self.task_path / f'sample_folder_{v1}'
if v2.exists():
v1 = v1 + 1
contin... |
Imports:
```python
import textwrap
import typing
```
Type definitions:
Input Types: List[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> str:
if self.strategy == 'log1p':
v2 = 'ln({column} + 1) as {column}'
elif self.strategy == 'minmax':
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
v0 = Callable[[SymbolMapArg], SymbolMapValue]
```
Input Types:
Output Type: Dict[sp.Symbol, v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(self) -> Dict[sp.Symbol, v0]:
v2 = {}
v3 = self._diff_eq.x_dimension
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.