text stringlengths 190 325k |
|---|
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str, dict, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict, v3=False):
v4 = requests.get(v1, headers=v2)
if v3 == True:
print('Sending request:')
print('U... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> str:
v3 = 'http://api.openweathermap.org/data/2.5/weather?'
v4 = v3 + 'appid=' + v2 + '&q=' + v1
v5 = requests.get(v... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: pyudev.Device
Output Type: str
Dependencies:
```python
def v0(v1: str, v2: str) -> None:
v3 = gActions.get(v2).format(v1)
print('** SENDING NOTIFICATION: {}'.format(v3))
subprocess.Popen('notify-send {}'.format(v3), shell... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, str]:
v1 = input('Please enter the number of members in your party: ')
v2 = input('Please enter the age of the youngest member in your ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'GeoBounds'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'GeoBounds'):
for (v2, v3) in v1.corner_points():
if not self.contains_point(longitude_deg=v2, latitude_deg=v3):
return False
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: ad.AnnData
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3='gene_name') -> ad.AnnData:
v4 = v1.var[v3].isin(v2).values.nonzero()[0]
v5 = np.argsort(v1.var[v3].values[v4])
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool) -> bytes:
if v1 is False:
return b'\x00'
elif v1 is True:
return b'\x01'
else:
raise TypeError(f'Can only serialize... |
Imports:
```python
from pandas import DataFrame, Series
from scipy.stats.stats import hmean
from sklearn.metrics import precision_recall_curve
from sklearn.neural_network import MLPClassifier
import typing
```
Type definitions:
Input Types: Tuple[str, str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
``... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[int]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[int]):
if v2 is not None:
self._warning_stream.write(f'RENDER WARNING:{v2}: {v1}\n')
else:
self._warnin... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> dict:
try:
with open(v1) as v2:
return json.load(v2)
except OSError:
pass
return {}
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
if v1 is not None:
v1.predicted_coref_chain = self.coref_chain
self.mentions.append(v1)
self.cluster_strings.append(v1.tok... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1) -> None:
if v1.remove:
self.username = None
await self.save()
self.send_notice('Username removed.')
return
if v1.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool) -> bool:
v3 = False
if v2:
if v1 in self.template_name_deactivate_map:
self.template_name_map[v1] = self.templ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any, v2=0, v3=9223372036854775807) -> int:
if isinstance(v1, str):
v1 = getattr(self, v1)
return super().index(v1, v2, v3)
``` |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
```python
v0 = List[tf.Tensor]
```
Input Types: tf.Tensor, tf.Tensor, v0, v0, v0, v0, tf.Tensor, Any
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: tf.Tensor, v3: tf.Tensor, v4: v0, v5: v0, v6: v0, v7: v0, v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str, typing.List[discord.Embed], bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int=4, v2: str='', v3: typing.List[discord.Embed]=None, v4: bool=False):
if v3 and len(v3) > 10:
raise
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> np.ndarray:
v1 = np.zeros(self._C_ba.shape[:-2] + (4, 4))
v1[..., :3, :3] = self._C_ba
v1[..., :3, 3:4] = self._r_ab_inb
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Iterable[str], Any
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Iterable[str], v3=None) -> Optional[str]:
v4 = v3
for v5 in v2:
if v1.startswith(v5):
v4 = v5
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: int, v3: int):
if v1[v2] != v1[v3]:
(v1[v2], v1[v3]) = (v1[v3], v1[v2])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, Optional[torch.Tensor]
Output Type: Tuple[torch.Tensor, torch.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor, v3: Optional[torch.Tensor]=None) -> Tuple[torch.Ten... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.init import xavier_normal_, kaiming_normal_, orthogonal_
import typing
```
Type definitions:
Input Types: int, int, nn.Module, str, bool, float
Output Type: nn.Sequential
Dependencies:
```python
def v0(v1: list) -> nn.S... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Generator[ailment.Block, None, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2=None) -> Generator[ailment.Block, None, None]:
if not self._blocks_by_addr:
return
elif v2 is None:
... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Union[List[str], Tuple[str, ...]]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[List[str], Tuple[str, ...]]=('value', 'units', 'nanos', 'currency_code')) -> str:
v2 = {'value': self.value,... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, tf.Tensor, tf.Tensor
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Tensor, v2: tf.Tensor, v3: tf.Tensor) -> tf.Tensor:
if v3.get_shape().ndims > 1:
v3 = tf.sque... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[List, np.ndarray], str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[List, np.ndarray], v2: str='gene_names'):
v3 = self._get_genes_filter_mask_by_attribute(attribute_values_to_keep=v1, attribut... |
Imports:
```python
import typing
```
Type definitions:
Input Types: BufferedIOBase, str
Output Type: int
Dependencies:
```python
def v0(v1: BufferedIOBase, v2: int, v3: int) -> int:
if v3 < 24:
v4 = struct.pack('>B', v2 << 5 | v3)
elif v3 <= 255:
v4 = struct.pack('>BB', v2 << 5 | 24, v3)
el... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame, pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame, v2: pd.DataFrame) -> pd.DataFrame:
v1 = v1.dropna(how='all')
v1 = v1.loc[~v1.index.dup... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list, np.ndarray, np.ndarray, int
Output Type: Tuple[np.ndarray, list]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: np.ndarray, v3: np.ndarray, v4: int) -> Tuple[np.ndarray, list]:
v5 = np.ones(v3.sh... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> Tensor:
v1 = self.sketchStem(v1)
v1 = self.sketchBackbone(v1)
v1 = self.shareBackbone(v1)
v1 = self.avgpool(v1)
v1 = v1.vie... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Any, Any, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: list):
for v4 in os.listdir(v1):
if v4.endswith('.py'):
if v4 in v3:
return
v2.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: str, v3=False, v4=-1):
with open('wm_inventory_file.ini') as v5:
v6 = False
v7 = []
for v8 in v5.readlines():
... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str) -> str:
v4 = self.request_method('POST', f'{self.TRELLO_ENDPOINT}/boards/{v1}/labels', params=self.params, data... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Path
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path) -> None:
v1.parent.mkdir(parents=True, exist_ok=True)
with v1.open('w', encoding='utf-8') as v2:
v3 = {'extensions': self.ex... |
Imports:
```python
import inspect
from datetime import datetime, date
from typing import Union, Any, Dict
import typing
```
Type definitions:
Input Types: Any
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any) -> Dict[str, Any]:
v2: Dict[str, Any] = {}
v3 = i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, List[str]], Optional[Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, List[str]], v2: Optional[Any]=None) -> Any:
v3: Any = self._data.copy()
while True:
if isinstance(v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[str, List[str], List[int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Tuple[str, List[str], List[int]]:
(v2, v3) = ([], [])
with open(v1, 'r') as v4:
v5 = v4.readline().strip()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
v2 = []
for v3 in v1:
if v3 == '(':
v2.append(')')
elif v3 == '{':
v2.append('}')
elif v3... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = os.path.join(self.partial_movie_directory, '{:05}{}'.format(self.scene.num_plays, self.movie_file_extension))
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str='', v2: str='jsonrpc') -> str:
v1 = v1.strip('/')
v3 = v2.strip('/')
v3 = '/' + v3 if len(v3) > 0 else ''
return v1 if not v1.endswith(v3) el... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
v1 = v1.replace('-', '')
v1 = v1.replace(' ', '')
v2 = ''
return self.solver(v2, v1)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Operation):
v1: str = '/iam/v3/admin/namespaces/{namespace}/users/{userId}/logins/histories'
v2: str = 'GET'
v3: List[str] = []
v4: List[str] = ['application/json']
v5: List[List[str]] = [['BEARER_AUTH']]
v6: str = None
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = '\n from a.b.c import d as e\n from a.b.c import f as g\n\n def foo() -> None:\n pass\n\n ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: typing.Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> typing.Dict:
v1 = self.global_data.copy()
v1.update(self._data.copy())
v1['node'] = self._node.id
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Tuple[int, int, int]
Dependencies:
```python
def v0(v1: str, v2: str) -> int:
return sum([v1[i] != v2[i] for v3 in range(min(len(v1), len(v2)))])
```
Function Name: v4
Function:
```python
def v4(v5: List[str]) -> Tuple[int, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
v2 = self.attestation_expiry_blocks()
v3 = self.web3.eth.getBlock().number
return v3 >= v1 + v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str], Optional[str]
Output Type: str
Dependencies:
```python
def v0(v1: Optional[str]=None, v2: Optional[str]=None) -> str:
if v1 is None:
if v2 is None:
raise ValueError('Either `slug` or `org` must be specified.')
... |
Imports:
```python
from decimal import Decimal, Context, setcontext
from fractions import Fraction
from itertools import chain, permutations, repeat, count, islice
from math import sqrt, factorial, gcd
import typing
```
Type definitions:
Input Types: int, int, int, int, int, int, int
Output Type: Any
Dependencies:
```... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str]) -> str:
if v1:
(v2, v3) = self._find_path(v1)
if not v2:
return 'No such path.'
v4 = v1.rstrip(... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.Series, pd.Series, int
Output Type: pd.Series
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.Series, v2: pd.Series, v3: int) -> pd.Series:
v4 = v1.sort_index()
v5 = v2.sort_index()
if v4.empty:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Union[float, np.ndarray]
Output Type: Tuple[np.ndarray, np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: Union[float, np.ndarray]=20) -> Tuple[np.ndarray, np.ndarray... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: Sequence[int], Dict[str, tf.Tensor], Union[point_sampler_lib.PointSampler, point_sampler_lib.PointSampler3D], Dict[str, Any]
Output Type: Dict[str, tf.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1... |
Imports:
```python
import copy
import itertools
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Dict[str, Any]
Dependencies:
```python
def v0(v1: Dict[str, Any]) -> List[List[str]]:
return [ni.get('Groups', []) for v2 in v1.get('NetworkInterfaces', [])]
```
```python
def v3(v4: Dict[st... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.send('GET', '/gateway')
return v1['url']
``` |
Imports:
```python
import numpy as np
import torch
import torch.optim as optim
import torch.nn as nn
from torch import Tensor
from torch.autograd import Variable
from torch.optim.lr_scheduler import MultiStepLR
import typing
```
Type definitions:
Input Types: Structure
Output Type: np.ndarray
Dependencies:
Function N... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, pd.DataFrame, pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame, v2: pd.DataFrame, v3: pd.DataFrame):
self.tensors_scaler.transform(v1)
self.gwfu_scaler.transform(v2)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: discord.Role
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: discord.Role):
v2 = {'role_name': v1.name, 'role_id': v1.id, 'permissions': [perm[0] for v3 in v1.permissions if v3[1]]}
return v2
``` |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
v1 = Path(v1)
for v2 in v1.iterdir():
if v2.suffix == '.service':
v3 = self._get_new_service... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: 'typing.Union[Route, None]'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> 'typing.Union[Route, None]':
for v2 in self.tree_routes:
if v2.get_endpoint_name() == v1:
return v2
... |
Imports:
```python
import torch
import torch.distributions as dist
import typing
```
Type definitions:
Input Types: dist.Normal
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dist.Normal):
(v2, v3) = (v1.mean, v1.variance)
(v4, v5) = torch.meshgrid((v2, v2))
(v6, v7) = tor... |
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 = 0
while v1:
if v1 % 2 == 0:
v1 = int(v1 / 2)
else:
v1 -= 1
v2 += 1
return v2
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, Any, Any, Any
Output Type: list
Dependencies:
```python
def v0(v1):
v2 = v1['type']
v3 = None
if v2 == 'uncontrollable_probabilistic':
v4 = v1['properties']['distribution']['type']
if v4 == 'gaussian':
... |
Imports:
```python
from decimal import Decimal
import typing
```
Type definitions:
Input Types: Series, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Series, v2):
try:
return v1.loc[v2]
except KeyError:
return Decimal('0')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, str
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: str) -> float:
v3: str = v1.get(v2, '')
if not v3:
return 0.0
return float(v3)
``` |
Imports:
```python
import os
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, str, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: torch.Tensor, v3: str, v4: int) -> None:
v1 = v1.cpu().detach().nump... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, np.ndarray, bool
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray) -> np.ndarray:
if v1.shape[0] < v1.shape[1]:
return v1.transpose()
return v1
```
```python
def v2(v3: np... |
Imports:
```python
from dataclasses import fields, dataclass
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Any]):
for v2 in fields(self.__class__):
v3 = v2.name
v4 = v2.type
if... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: pd.Series
Output Type: pd.Series
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.Series) -> pd.Series:
for (v2, v3) in enumerate(v1):
try:
v1[v2] = int(v3)
except ValueError a... |
Imports:
```python
import sys
import importlib
import typing
```
Type definitions:
Input Types: Path, str, t.Any
Output Type: t.Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: str, v3: t.Any=object) -> t.Any:
(v4, v5) = v2.split(':', 1)
v6 = False
v7 = str(v1.absolute())
i... |
Imports:
```python
import sympy as sp
import sympy.core.numbers as nu
import typing
```
Type definitions:
Input Types: sp.MutableDenseMatrix
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: sp.MutableDenseMatrix):
v2 = -v1
v3 = sp.eye(v1.shape[0])
v4 = list(v1.eigenvals().ke... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[Callable[[], float]]
Output Type: Optional[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[Callable[[], float]]=None) -> Optional[float]:
self.clip_and_accumulate()
if self._check_skip_next_step()... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if v1 in {'true', 'false'}:
return True
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, str], str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, str], v2: str='pid') -> bool:
if len(v1[v2]) == 9:
return True
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
```python
def v0(v1: str) -> bytes:
return bytes(hstr2bin(v1))
```
```python
def v2(v3: str) -> bytes:
return v0(v3[1:])
```
```python
def v4(v5: Decimal) -> int:
return int(v5 * 10 ** 9)
```
Functio... |
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 = len(v1)
if v2 == 0:
return 0
if v2 < 2:
return 1
v3 = 0
for v4 in [True, False]:
v5 = ... |
Imports:
```python
import platform
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0() -> str:
if platform.system() == 'Linux':
return 'xdg-open'
else:
return 'explorer'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str, List[Any]
Output Type: List[Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any, v2: str, v3: List[Any]=[]) -> List[Any]:
if v2 not in v1:
return v3
return v1[v2] if isinstance(v1[v2], list) else [v1[v2]]... |
Imports:
```python
import logging as log
import sys
import typing
```
Type definitions:
Input Types: TextIO, Signal, str, int, Set[str]
Output Type: None
Dependencies:
```python
def v0(v1: str) -> str:
v1 = v1.upper()
v2 = ''
for v3 in range(0, len(v1)):
v2 += v1[v3] if v1[v3].isalnum() else '_'
... |
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.destroy_op_weight.keys():
if self.destroy_op_segment_usage[v1] > 0:
self.destroy_op_weight[v1] = max((1 - self.reactio... |
Imports:
```python
import pathlib
import numpy as np
import typing
```
Type definitions:
Input Types: Union[pathlib.Path, str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[pathlib.Path, str]):
v2 = pathlib.Path(v1) / 'replay_buffer.npz'
np.savez(v2, obs=self.obs[... |
Imports:
```python
import copy
import numpy as np
import typing
```
Type definitions:
Input Types: dict, list, list
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: list, v3: list) -> tuple:
v4 = v1['x_train']
v5 = v1['x_test']
v6 = v1['y_train'].ravel()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: List[str]
Dependencies:
```python
def v0(v1, v2, v3, v4):
for v5 in v2:
if v5 not in v4:
if v3[v5] == 1:
v1.append(v5)
```
```python
def v6(v7: List[str]):
v8 = dict()
for (v9, v10)... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: {str: list}, float, float, float, int
Output Type: Any
Dependencies:
```python
def v0(v1: list, v2: float, v3: float):
v4 = np.array(v1)
np.random.shuffle(v4)
v5 = int(v2 * len(v1))
v6 = int((v2 + v3) * len(v1))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.LongTensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.LongTensor):
v2 = v1.numpy()[0]
v3 = v2 + 1
v4 = v1.min().item()
v5 = v1.max().item()
return (v2, v3, v4, v5)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: Task) -> None:
if not all(v1):
return
if not hasattr(self.spec, 'volume_claim_templates'):
setattr(self.spec, 'volume_claim_templates', [... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Iterable, Iterable, int
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable, v2: Iterable, v3: int) -> np.array:
v4 = np.random.uniform(v1[0], v2[0], v3)
v5 = np.random.unifor... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str, v3=False):
if v3:
v2 = bytes(v2)
else:
v2 = str(v2)
v4 = 'bw' if v3 else 'w'
with open(v1, v4) as v5:
v5.wr... |
Imports:
```python
from io import StringIO
from tqdm import tqdm
import pandas as pd
import json
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
v3 = v1
v4 = 0
v5 = []
v6 = []
for (v7, v8) in v2:
v9 = v1.find(v7)
if ... |
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.view_browser
v2.set_toolbar(v1)
v2.config.tool_bar = v1
v2.request_update()
``` |
Imports:
```python
from inspect import getdoc as _getdoc, isawaitable as _isawaitable, signature as _signature
import typing
```
Type definitions:
```python
class v0(TypedDict):
v1: str
v2: None
v3: str
```
```python
class v4(TypedDict):
v5: str
v6: Dict[str, v0]
```
Input Types: Callable
Output Typ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self.config.include_view_lineage:
return
v1 = self.get_metadata_engine(database=None)
self._populate_view_upstream_lineage(v1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ast.Constant
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ast.Constant) -> None:
if isinstance(v1.value, str):
self.visit_str_helper(v1.value, v1)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: RobotFrameworkInterpreter
v2: StringIO
v3: StringIO
```
Input Types: v0
Output Type: Any
Dependencies:
Function Name: v4
Function:
```python
def v4(v5: v0):
v6 = v5.interpreter.evaluate
v7 = ('*** Settings ***... |
Imports:
```python
from typing import cast, List, Optional, Tuple, Type, Union
import typing
```
Type definitions:
Input Types: Optional[int], Optional[Tuple[int, ...]]
Output Type: Tuple[int, ...]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[int], v2: Optional[Tuple[int, ...]]) -> Tuple[in... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, dict, dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: dict, v3: dict) -> dict:
for v4 in v1:
v5 = v1[v4]
if len(v5) >= 2:
v3[f'{v5[0]}'] = {f'{v5[1]}': v2.get(v4)}
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
(v1, v2, v3) = self.vision.get_vision_data()
if v3 is None:
self.state = self.searching
else:
if abs(v2) > self.find_allowable_an... |
Imports:
```python
import numpy as np
import torch
import typing
```
Type definitions:
Input Types: bool
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> tuple:
if v1:
v2 = sorted([e.TD_error.item() for v3 in self.memory], reverse=True)
v4 = [v... |
Imports:
```python
import warnings
import typing
```
Type definitions:
Input Types: Union[Hashable, Sequence[Hashable]], str, Union[Hashable, Sequence[Hashable]]
Output Type: 'DataArray'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[Hashable, Sequence[Hashable]]=None, v2: str=None, *, v3:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[int]
Output Type: str
Dependencies:
```python
def v0(v1: str, v2: MIPSInstruction) -> None:
if v2.is_return_instruction:
result.append(v2)
```
Function Name: v3
Function:
```python
def v3(self, v4: Optional[int]=None) -> str:
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Set[str], box.Box
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Set[str], v2: box.Box) -> bool:
for v3 in [v2.path] + list(v2.get('dependencies', [])):
if v3 == '.':
return True
... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bytes:
v2 = subprocess.run(['wc', '-l', v1], stdout=subprocess.PIPE)
return v2.stdout
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.