text stringlengths 190 325k |
|---|
Imports:
```python
import torch
from torch import nn
from torch import Tensor, LongTensor
from torch.nn import functional as F
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tuple[Tensor, Tensor, LongTensor, Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> ... |
Imports:
```python
import tokenize
import typing
```
Type definitions:
Input Types: List[tokenize.TokenInfo], int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[tokenize.TokenInfo], v2: int) -> None:
if self._bracket_stack[-1] == ':' and v1[v2].string == 'for':
... |
Imports:
```python
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import typing
```
Type definitions:
Input Types: pd.DataFrame, list, list, bool, list, dict, Any, Any, pd.DataFrame, list, list, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v... |
Imports:
```python
from math import inf
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = self.get_full_route()
v2 = self.get_many_to_many_dist(v1, v1)
self._create_paths()
v3: float = inf
v4: tuple = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float) -> None:
if v1 != self._magnification:
v2 = v1 / self._magnification
self.resize(v2)
self._magnification = v1
return
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if 'gw2wannier90' in self.inputs:
return True
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> int:
v2 = v1[::-1]
for (v3, v4) in enumerate(v2):
if v3 == 0:
continue
print(v3)
print(v4)
for (v5, v6) i... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
try:
v2: list = v1['captions']['list']
return v2
except KeyError:
print('An error occurred.')
print('This vid... |
Imports:
```python
import inspect
import typing
```
Type definitions:
Input Types: Union[Any, str]
Output Type: Any
Dependencies:
```python
def v0(v1: str) -> str:
return v1.lower().replace('-', '').replace('_', '').replace(' ', '')
```
```python
def v2(v3: List[Any], v4: Union[Any, str], v5: Optional[Any], *v6, *... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=None):
if v1 is None:
v1 = self.cfg.training.batch_size
return math.ceil(len(self.dataset) / v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> str:
if v1 is not None and len(v1) > 0:
if v1[0] != '/':
v1 = f'/{v1}'
return v1
return ''
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
self._ndelay(self._clock_delay)
self.data_gpio.write(bool(v1))
self._ndelay(self._setup_delay)
self.clk_gpio.write(True)
self._ndelay(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, pd.DataFrame
Output Type: Dict[str, pd.DataFrame]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame, v2: pd.DataFrame) -> Dict[str, pd.DataFrame]:
(v3, v4) = self._apply_connector_func(v1, v2)
sel... |
Imports:
```python
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, ColspaceArgType, CompressionOptions, Dty... |
Imports:
```python
import argparse
import getpass
import typing
```
Type definitions:
Input Types: list
Output Type: argparse.Namespace
Dependencies:
```python
def v0() -> argparse.ArgumentParser:
v1 = argparse.ArgumentParser(prog='chpass', description='Gather information from chrome', formatter_class=argparse.Raw... |
Imports:
```python
import pickle as pk
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
with open(v1, 'rb') as v2:
v3 = pk.load(v2)
v2.close()
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: parse.Trip
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: parse.Trip):
v2 = v1.route_id
if v2 != 'M':
return True
v3 = {'N': 'S', 'S': 'N'}
for v4 in v1.stop_times:
v5 = v4.stop_id
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, list
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: list) -> int:
try:
v3 = v2.index(v1)
return v3
except:
raise Exception(f'ID {v1} not found in array {v2}')
``` |
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:
for (v2, v3) in [('account', 'account'), ('mailAddress', 'mail_address'), ('work', 'work'), ('telephone', 'telephone'),... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: List[str]=None) -> List[str]:
if v2 is None:
v2 = []
v3 = [os.path.join(d, v1) for v4 in v2]
return [x for v5 ... |
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.replace('\\', '\\\\')
v1 = v1.replace(';', '\\;')
v1 = v1.replace(',', '\\,')
v1 = v1.replace('\n', '\\n')
v1 = v1.replace('\... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, map
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: map):
v3 = dict(use_bias=False, kernel_size=v2['kernel_size'], strides=v2['strides'], filters=v2['out_chs'], kernel_initializer='glorot_uniform', bi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool):
if self.elite_models is None:
return
if self.num_members > 1 and v1:
for v2 in self.hidden_layers:
v2[0].set_elite(s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> None:
assert (v1.columns == ['country', 'eu', 'usa', 'china']).all()
assert v1.country.dtype == 'O'
for v2 in ['eu', 'usa', 'china']:
assert v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
self.weight += 1
self.centroid = (self.centroid + v1.embedding_vec) / 2
self.dp_ids.append(v1.dp_id)
self.coordinator.dp_id_to_agent_i... |
Imports:
```python
import gzip
import typing
```
Type definitions:
Input Types: Path
Output Type: Any
Dependencies:
```python
def v0(v1: Path):
with gzip.open(v1, mode='rt') as v2:
for (v3, v4) in enumerate(v2):
yield (f'mywiki40b-{v3:10}', {'text': v4.strip()})
```
Function Name: v5
Function:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> int:
assert v1 != self._ffi.NULL
self.openssl_assert(not self._lib.BN_is_negative(v1))
v2 = self._lib.BN_num_bytes(v1)
v3 = self._ffi.new('un... |
Imports:
```python
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.distributed import ProcessGroup
from torch.distributed.distributed_c10d import _get_default_group
from torch.nn.parameter import Parameter
import typing
`... |
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 ['en-de', 'ende', 'ENDE', 'EN-DE']:
v2 = 'en-de'
elif v1 == 'example':
v2 = v1
else:
raise NotImplementedErr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: TextIO, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: TextIO, v2) -> None:
v3 = v2.value
if '__declspec' in v3:
return
if v2.name in ['D3DCOMPILER_DLL_W', 'D3DCOMPILER_DLL_A', 'D3DCOMPILER_DL... |
Imports:
```python
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: float, float, float, float, float, Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: float, v3: float, v4: float, v5: float, v6: Tensor) -> Tensor:
assert v1... |
Imports:
```python
from .mimetypes import get_mapping, get_extractor, get_filename
import typing
```
Type definitions:
Input Types: Path, Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: Path):
v3 = get_extractor(''.join(v2.suffixes))
if v3:
v3(v1, v2)
``` |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: tuple, np.matrix, list[tuple]
Output Type: Union[tuple, bool]
Dependencies:
```python
def v0(v1: tuple, v2: np.matrix, v3: list[tuple]) -> Sequence[tuple]:
(v4, v5) = v2.shape
v6 = [(v1[0], v1[1] + 1), (v1[0], v1[1] - 1), (v1[0] ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, list[list[int]]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: list[list[int]]) -> int:
v3 = []
for v4 in range(1, v1 + 1):
v3.append(v4)
while len(v3) > 1:
for v5 in v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Any], List[Any]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[Any], v2: List[Any]) -> bool:
if set(v1) == set(v2):
return True
else:
return False
``` |
Imports:
```python
import json
import logging
import typing
```
Type definitions:
Input Types: dict, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: str) -> None:
logging.debug(f'writing json {v2} ...')
with open(v2, 'w') as v3:
json.dump(v1, v3, indent=4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
v1 = v1.strip()
if v1 == '':
return False
v2 = self.scan_integer(v1)
if self.p > len(v1) - 1:
return v2
if se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Optional[float]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: Optional[float]=None):
self._last_dt = v2 or self._fixed_timestep_sec or 0.1
self._elapsed_sim_time = self._rounder(self._elapsed_s... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.has_binary_data:
return ''
else:
return '\n'.join(self.acis_data)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Iterable[Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Iterable[Any]:
v1 = 0
v2 = 0
for v3 in self._iter:
v4 = self._cost_of(v3)
if v2 == 0 or v1 + v4 <= self._max_cost:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: [str]
Output Type: [str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: [str]) -> [str]:
v2 = []
for v3 in v1:
v2.append(v3[::-1])
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
v2 = 'HH:mm:ss.SSSZ'
return pendulum.parse(v1).format(v2)
```
Function Name: v3
Function:
```python
def v3(v4: dict) -> str:
v5 = '<qbp:rule fromTime="{fromTime}" toTime... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = []
for v3 in self.hooks:
if v3.unique_identifier == v1:
v3.handler.remove()
else:
v2.append(v3)
s... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = os.environ.get('NM_DISPATCHER_ACTION')
v2 = os.environ.get('CONNECTION_UUID')
v3 = os.environ.get('CONNECTION_ID')
v4 = os.env... |
Imports:
```python
import nltk
import typing
```
Type definitions:
Input Types: ActSlotValue
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ActSlotValue):
if v1 == self.asv_pad:
return self.tensorize_processed_tokens(('<pad>',))
if v1.act == 'inform':
(v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> dict:
v2 = f' SELECT * FROM station WHERE id={str(v1)!r} ORDER BY "time" DESC LIMIT ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'sublime.Region', str, 'Any'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'sublime.Region', v2: str, v3: 'Any') -> None:
if v1.empty():
self.view.insert(v3, v1.a, v2)
elif len(v2) > 0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: pd.DataFrame) -> pd.DataFrame:
for v2 in v1:
v1[v2] = v1[v2].map(lambda x: 1 if int(x.split('-')[1]) > 0 else 0)
return v1
```
Function Name: v3
Function:
```pyt... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> np.array:
v1 = []
for v2 in self.faces:
v3 = []
for v4 in v2:
v5 = self.vertices[v4]
v3.appe... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int, int, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: int=9, v3: int=26, v4: int=52, v5: int=26):
v1['senkou_a'] = ((v1['tenkansen'] + v1['kijunsen']) / 2).shift(v5)
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Union[bool, str, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> Union[bool, str, int]:
v3 = self.get_cast_func[v1]
return v3(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
with open(v1, 'r') as v2:
v3 = v2.readlines()
for v4 in v3:
if len(v4) > 5 and v4[:5] == 'c ind':
return True
r... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
v3 = np.asarray(v2['mean'])
v4 = np.asarray(v2['std'])
v5 = (v1 - v3) / v4
return v5
```
Function Name: v6
Function:
```python
def v6(v7: dict, **v8):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: list):
for v3 in v2:
if v3 in v1:
del v1[v3]
for v4 in v1.values():
if isinstance(v4, dict):
se... |
Imports:
```python
import pickle
import tensorflow as tf
from tensorflow import Tensor
from tensorflow.keras.optimizers.schedules import LearningRateSchedule
from tensorflow.python import keras
from tensorflow.python.data import Dataset
from tensorflow.python.keras.layers import Layer
from tensorflow.python.ops.summary... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
os.chdir(self.orig_dir)
for v1 in self.delete_me:
os.unlink(v1)
for v2 in os.environ.keys():
if v2.startswith('EXEC_') ... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, str, str, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str='.\\', v4: bool=False):
os.makedirs(v3, exist_ok=True)
with open(os.path.join(v3, v1 + v2), 'w') as v5:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict) -> None:
super()._update(v1)
self.bio = v1['bio']
self.locale = v1['locale']
self.mfa_enabled = v1['mfa_enabled']
self.verified = v1... |
Imports:
```python
import os
import sys
import subprocess
import typing
```
Type definitions:
Input Types: [str, bytes]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: [str, bytes]) -> None:
v2 = []
if 'SUDO_UID' in os.environ and 'SUDO_GID' in os.environ:
v2.extend(['... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: bfd_bflw.RunnerBookEX, bflw.RunnerBookEX, int, str, int
Output Type: Any
Dependencies:
```python
def v0(v1: List[bfd_bflw.PriceSize]) -> str:
return ' '.join(list((f'[{ps.price}, {ps.size}]' for v2 in v1)))
```
```python
def v3(v4: Lis... |
Imports:
```python
import inspect
import typing
```
Type definitions:
```python
v0 = Callable[..., Any]
```
Input Types: v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> None:
if self.is_frozen:
raise RuntimeError("Can't connect receiver (%r) to the frozen si... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> str:
self.file_reader.seek(v1)
v2 = self.file_reader.read_short()
v3 = ''.join([self.file_reader.read_char() for v4 in range(v2)])
if self.fi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
while v1.startswith('/'):
v1 = v1[1:]
self.card_market_url = f'https://www.cardmarket.com/{v1}'
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(DataWithCoords, DatasetReductions, DatasetArithmetic, Mapping):
v1: dict[Hashable, Any] | None
v2: dict[str, Any]
v3: set[Hashable]
v4: dict[Hashable, int]
v5: dict[Hashable, Any] | None
v6: Callable[[], None] | None
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool):
v2 = self.properties_with_values(include_defaults=v1)
for (v3, v4) in v2.items():
if isinstance(v4, float) and v4 == float('inf'):
... |
Imports:
```python
from sklearn.linear_model import LinearRegression
from sklearn.metrics import r2_score
from sklearn.model_selection import train_test_split
import typing
```
Type definitions:
Input Types: pd.DataFrame, Dict
Output Type: List
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFra... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
self._tag_display_type = v1
self.ForceTagRecalc()
``` |
Imports:
```python
from datetime import datetime, timedelta, date
import typing
```
Type definitions:
Input Types: v7, list, dict
Output Type: float
Dependencies:
```python
def v0(v1: v1, v2: list) -> float:
v3 = oauth.get(BASE_URL + '/heatmaps/dwell-density/daily/{0}'.format(v1.isoformat()), headers=headers, para... |
Imports:
```python
import collections
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1, v2):
v3 = 33
v4 = (1 << 20) - 1
v5 = collections.defaultdict(list)
v6 = 0
v7 = pow(v3, v2, v4)
for v8 in range(len(v1)):
v6 = (v6 * v3 + ord(v1[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: dict[int, any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int) -> dict[int, any]:
if v1 < v2:
(v1, v2) = (v2, v1)
v3: dict[int, any] = {v1 + v2: [v1, '+', v2, '=', v1 + v2], v1 * v2: ... |
Imports:
```python
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, ColspaceArgType, CompressionOptions, Dty... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> dict:
if v1 is not None and type(v1) == str:
v2 = list(self.mongo_client.service_db.intent_to_services.find({}))
v2 = [intent_to_se... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: List[int]
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> float:
v2 = self.compute_likelihood(v1)
return -np.log(v2).sum()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
if self.val is None or v1 > self.val:
self.val = v1
print('Updating Best')
return True
else:
return False
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Tuple[int, str, int]
```
Input Types: str, str, str, str
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
async def v1(self, v2: str, v3: str, v4: str, v5: str) -> v0:
self.request.app['registration_manager'].register_service(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: 'StatusFileGenerator'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> 'StatusFileGenerator':
self.test_dataset = v1
return self
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0() -> dict:
v1 = {'displayName': 'Quarantine User', 'description': 'Attaches a DENY ALL policy to the user', 'resourceTypes': ['IAM User'], 'params': [], 'permissions': ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: typing.Callable
Dependencies:
```python
def v0(v1: typing.Callable) -> typing.Callable:
self.tests[test_name].executor = v1
return v1
```
Function Name: v2
Function:
```python
def v2(self, v3: str) -> typing.Callable:
def... |
Imports:
```python
import shutil
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
```python
def v0(v1: Optional[str]=None) -> Path:
v2 = get_root_path()
if v1 is None:
assert setting.primary_project_name is not None
v1 = setting.primary_project_name
v3 = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = {'A': 'b'}
v2 = CaseInsensitiveDict[str, str](v1)
assert id(v2._data) != id(v1)
v2.pop('a')
assert v1 == {'A': 'b'}
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.dtype
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.dtype):
if v1 == np.float32:
return 0.0001
elif v1 == np.float64:
return 1e-07
else:
raise ValueError('... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Callable[..., Any]
Dependencies:
```python
def v0(v1: Callable[..., Any]) -> Callable[..., Any]:
@functools.wraps(v1)
async def v2(self: Any, *v3: Any) -> Callable[..., Any]:
if len(formatters) != len(v3):
ra... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types:
Output Type: t.AsyncIterable[models.Entry]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> t.AsyncIterable[models.Entry]:
while True:
await asyncio.sleep(60)
v1 = self._feed.entries.copy()... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: Optional[str]=None) -> None:
v2 = {}
if v1:
v2['TestReqID'] = v1
await self.send_message('HEARTBEAT', v2)
``` |
Imports:
```python
import torch
import torch.utils.data as data
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = len(self._transforms)
v3 = torch.FloatTensor(v2, 3, self._img_size, self._img_size)
v4 = sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
assert v1 in ('sw_l1', 'jq_l1', 'jq_l2', 'zjw')
return self._post(locals(), res_format='csv')
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2=None, v3=None, v4=None):
if v3 is None:
v3 = -1.0
if v4 is None:
v4 = 1.0
if v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
```python
def v0(v1: str) -> str:
v1 = v1.lower()
if v1.startswith('http_'):
v1 = v1[5:]
return v1.replace('_', '-')
```
Function Name: v2
Function:
```python
def v2(self, v3: str, v4: str) ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[ColumnarMixin, RegularStream]
```
Input Types: bool
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, *v3, v2: bool=False) -> v0:
v4 = self.to_stream()
if hasattr(v4, 'sort'):
return v4.sort(*v3, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v1['title'] = self.upgrade_title(v1.get('title'))
return v1
``` |
Imports:
```python
from datetime import datetime
from pathlib import Path, PurePath
import subprocess
import typing
```
Type definitions:
Input Types: str, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
for v3 in range(0, len(v1), v2):
yield v1[v3:v3 + v2]
```
Function Name: v4
Function:... |
Imports:
```python
import cv2
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
```python
def v0(v1: cv2.VideoCapture):
v2 = v1.get(cv2.CAP_PROP_FPS)
v3 = int(v1.get(cv2.CAP_PROP_FRAME_COUNT))
v4 = (int(v1.get(cv2.CAP_PROP_FRAME_WIDTH)), int(v1.get(cv2.CAP_PROP_FRAME_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: str):
await self.redis.set(str(v1), v2)
async with self.acquire() as v3:
await v3.execute('insert into prefixes(guild_id, pr... |
Imports:
```python
from sys import argv
import typing
```
Type definitions:
Input Types: Any, dict
Output Type: None
Dependencies:
```python
def v0() -> bool:
return '-v' in argv or '--verbose' in argv
```
Function Name: v1
Function:
```python
def v1(self, v2, v3: dict) -> None:
for v4 in v3:
if v0():
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool):
v2 = {'listeTAF': [{'N': self.id, 'TAFFait': v1}]}
if self._client.post('SaisieTAFFaitEleve', 88, v2):
self.done = v1
``` |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Path, str
Output Type: Path
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path, v2: str) -> Path:
v3 = v1 / v2
Path(v3).mkdir(exist_ok=True)
with open(v3 / '__init__.py', 'a') as v4:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Optional[bool]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> Optional[bool]:
v3 = self._get_match(v1)
v4 = self._get_match(v2)
if v3 and v4:
(v5, v6, v7, v8) = v3.group... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float, float, float, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: float, v3: float, v4=0.01):
if v3 == 0.0:
v5 = np.inf
else:
v5 = v2 / v3
if v1 < v4:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float, float, float, pyproj.Geod
Output Type: Tuple[float, float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: float, v3: float, v4: pyproj.Geod=pyproj.Geod(ellps='WGS84')) -> Tuple[float, float,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[ndarray, List, Dict[Union[int, str], float]]
Output Type: ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[ndarray, List, Dict[Union[int, str], float]]) -> ndarray:
v1 = self._cast_as_array(v1)
v2 = (se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.