text stringlengths 190 325k |
|---|
Imports:
```python
import itertools
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: Any, **v2: Any) -> np.ndarray:
(v3, v4) = self._make_argument_names_and_list(*v1, **v2)
assert v3 == self.names... |
Imports:
```python
import requests
from requests.auth import HTTPBasicAuth
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='btc') -> str:
v2 = self.url + f'/api_v1/get_destination_crypto_address/{v1}'
v3 = requests.... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: int
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: int) -> v0:
v3 = self.get(v2)
v4 = self.list[v2]
v4.val = None
v4.next = self.head
self.head = v2
return v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> np.ndarray:
self.send(None)
return self.recv()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: list):
self.settings.setValue(v1, v2)
self.property_keys_and_values = self.load_property_keys_and_values()
self.property_keys = self.... |
Imports:
```python
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: str, None
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: None):
v3 = dict()
v3['model'] = self.to_dict()
if v2 is not None:
v3['scale'] = v2.get... |
Imports:
```python
import numpy
import typing
```
Type definitions:
Input Types: 'Miner.Name', 'Miner.Name'
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Miner.Name', v2: 'Miner.Name') -> float:
if self._network_graph.has_edge(v1, v2):
return self._network_graph[... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclasses.dataclass
class v0:
v1: str
v2: str
v3: str
v4: str
v5: ClassVar[Pattern] = '(?P<first_num>\\d+)-(?P<second_num>\\d+) (?P<restricted_char>[a-z]): (?P<value>[a-z]*)'
@classmethod
def v6(cls, v7: str) -> 'Password':... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: str
Dependencies:
```python
def v0(v1) -> str:
v2 = '['
for v3 in range(0, len(v1), 2):
v2 += f'Cell("{v1[v3] + v1[v3 + 1]}"),'
v2 += ']'
return v2
```
Function Name: v4
Function:
```python
def v4(v5:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: str, v3: dict):
for (v4, v3) in v3.items():
if v3 is dict:
self._handle_sub_dictionary(v1, v4, v3)
else:
... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, torch.Tensor, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor=None, v3: torch.Ten... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> int:
if v1.startswith('0x'):
return int(v1, 16)
elif v1.startswith('0'):
return int(v1, 8)
return int(v1, 10)
``` |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, Any, Any, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1):
return pal.black.bg_white.bold(' ' + v1 + ' ')
```
```python
def v2(v3):
print(pal.red.bold.bg_default('[X] ' + v3))
```
Function Name: v4
Function:
```pyth... |
Imports:
```python
import sklearn.utils.multiclass as multiclass
from sklearn.base import BaseEstimator
from sklearn.metrics import roc_auc_score, mean_squared_error, log_loss
from sklearn.model_selection import BaseCrossValidator
import typing
```
Type definitions:
Input Types: str, Optional[Callable]
Output Type: An... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('ManagedCluster')
```
Input Types: v0
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> v0:
self._ensure_mc(v2)
v3 = self.context.get_assign_kubelet_identity()
if v3:
v4 = {'kubel... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: dict):
with open(v1, 'w') as v3:
json.dump(v2, v3)
```
```python
def v4(v5: str):
with open(v5, 'r') as v6:
v7 = json.load(v6)
return v7
```... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, int
Output Type: Optional[np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: int) -> Optional[np.ndarray]:
v3 = self.labels
v4 = self.video_idx
v5 = v3.find(v3.videos[v4], v2)
... |
Imports:
```python
import inspect
import typing
```
Type definitions:
Input Types: str, Callable[..., None]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Callable[..., None]) -> None:
if v1 in self.subscriptions:
raise ValueError('Topic {} already has a ha... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Any
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3) -> List[str]:
v4 = ['git', 'clone']
if v2:
v4 += ['-b', v2]
return v4 + [v1, str(v3)]
``` |
Imports:
```python
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor) -> float:
v2 = v1.mean(dim=0, keepdim=True)
v3 = torch.sum((v1 - v2) ** 2, dim=1)
return torch... |
Imports:
```python
import configparser
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str='~/.pypirc'):
v1 = os.path.expanduser(v1)
v2 = configparser.RawConfigParser()
if os.path.isfile(v1):
v2.read(v1)... |
Imports:
```python
from ast import literal_eval
from ast import parse
from itertools import chain
from itertools import islice
import typing
```
Type definitions:
Input Types:
Output Type: t.Any
Dependencies:
```python
def v0(v1: t.Iterable[t.Any]) -> t.Optional[t.Any]:
v2 = list(islice(v1, 2))
if not v2:
... |
Imports:
```python
import itertools
import typing
```
Type definitions:
Input Types:
Output Type: Generator[bool, None, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: JSONTypes) -> Generator[bool, None, None]:
with self._watch() as v2:
v2.multi()
for v3 in self._bit_o... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.volume = self.soco.volume
self.muted = self.soco.mute
self.night_mode = self.soco.night_mode
self.dialog_mode = self.soco.dialog_mode
... |
Imports:
```python
import json
import requests
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2):
if self.auth_header is None:
raise ValueError('need to login first')
v3 = '{}/v1/data/{}/fetch-confid... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
```python
def v0(v1: list):
if len(v1) == 0:
return None
v2 = {'name': '|'.join([target['name'] for v3 in v1]), 'squashed': True, 'type': v1[0]['type'], 'tree_root_dir': v1[0]['tree_ro... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: bool=True) -> None:
if not self.write_mode:
raise ValueError('Variable is in the read mode!')
if len(v1.shape) != ... |
Imports:
```python
import torch
from torch import nn
from torch.nn.utils.rnn import pad_sequence
import typing
```
Type definitions:
Input Types: nn.Module, Any, nn.Module, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: nn.Module, v2, v3: nn.Module=None, v4=None):
if v4 is Non... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = getattr(logging, str(self.logging.value).upper())
logging.getLogger('supervisor').setLevel(v1)
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> None:
with open(v1, 'r') as v2:
for v3 in v2:
v3: str = v3.strip()
v4: int = v3.find('=')
if v4 != ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Generic[T]):
def __init__(self, v1: Callable[[], T], v2: Sequence[str]=('__call__',)):
"""Initializes the :class:`Deferred` module.
Args:
factory: A no argument callable which constructs the module to defer
to. The... |
Imports:
```python
import plotly.express as px
import plotly.io as pio
import plotly.graph_objects as graph_objects
import typing
```
Type definitions:
Input Types: pandas.DataFrame, str, str, Optional[str], str, Optional[int], Any, bool
Output Type: Any
Dependencies:
```python
def v0(v1: pandas.DataFrame, v2: List[Op... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[str], Any
Output Type: Any
Dependencies:
```python
def v0(v1):
return (v1[0].replace('.', '_').lower(),) + v1[1:]
```
Function Name: v2
Function:
```python
def v2(self, v3: Tuple[str], v4):
v5 = self.get_containing_ns(v4).get_path()
... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor) -> torch.Tensor:
if v1.dtype == torch.float32:
pass
elif v1.dtype == torch.int32:
v1 = v1.to(torc... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[Optional[str], Optional[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Tuple[Optional[str], Optional[str]]:
v2 = self.get_camera(v1)
return (v2.get('vpn_url', None), v2.get('local_url... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, int, int, str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: int, v3: int, v4: str) -> int:
while v3 >= v2:
v5 = (v2 + v3) // 2
if v1[v5] == v4:
return v5
elif v... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.array, int, int
Output Type: List[Tuple[int, int, str]]
Dependencies:
```python
def v0(v1: np.array, v2: np.array, v3: int=15, v4: int=4095) -> Tuple[int, int]:
v5 = v1[-v4:]
if v2[0] not in v5:
for v6 in range(10... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1):
return v1.group(1) + '\\"'
```
Function Name: v2
Function:
```python
def v2(v3: str) -> str:
def v4(v5):
""" Return adjacent character + extra escaped double quote. ""... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'SwitcherV2Device'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: 'SwitcherV2Device') -> None:
if v1:
if self._self_initiated:
self._self_initiated = False
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[bytes, str], int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[bytes, str], v2: int=0) -> None:
v3 = len(v1)
self.write_positive_vint(v3)
while v3 >= 7:
v4 = v1[v2]
v2 +... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: 'StreamingFileSink.DefaultRowFormatBuilder'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> 'StreamingFileSink.DefaultRowFormatBuilder':
self.j_default_row_format_builder.withBucketCheckInterval(v1)
... |
Imports:
```python
from numpy import pi
import torch
import typing
```
Type definitions:
Input Types: torch.tensor, torch.tensor, float, torch.tensor, float, torch.tensor
Output Type: torch.tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.tensor, v2: torch.tensor, v3: float, v4: torch.tenso... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
for v2 in self.edges.values():
if v2.target_id == v1:
yield self.nodes[v2.target_id]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
```python
def v0(v1, v2: str) -> float:
v3 = {'Memory': v1.memory_usage(), 'Duration': v1.duration, 'Bytes Processed': v1.bytes_processed, 'Bytes Billed': v1.bytes_billed}
return v3[v2]
```
Function Name: v4... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: pd.Series
Output Type: pd.Series
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.Series) -> pd.Series:
v2 = ['h-?1b', '[^\\w]visas?[^\\w]', '[^\\w]opt[^\\w]', '[^\\w]cpt[^\\w]']
v3 = v1.str.contains('|'.join(v2), f... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Dict[str, int]]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Dict[str, int]]) -> None:
for v2 in v1:
for v3 in v1[v2]:
self.add_edge(str(v2), str(v3), weight=v1[v2]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> None:
nonlocal pager_content
v2 = v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = {'schemas': ['urn:ietf:params:scim:schemas:core:2.0:User'], 'userName': 'newuser@zulip.com', 'name': {'formatted': 'New User', 'givenName': 'New', '... |
Imports:
```python
import os
from io import BytesIO
from pathlib import Path
from urllib.request import urlopen
from zipfile import ZipFile
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str, v2: str) -> str:
print(f'Reading {v1}')
with urlopen(v1) as v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: preferences.PreferencesData
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: preferences.PreferencesData) -> None:
if 'base_series_preferences' in v1:
self.update_base_series_preferences(v1['base_seri... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: v0
Output Type: Tuple[Type[v0]]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0, *v3) -> Tuple[Type[v0]]:
v4 = self.readInt32()
return tuple((v2(*v3) for v5 in range(v4)))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
v2 = f'from days.day{v1} import get_count\nfrom days.day{v1} import get_count_2\n\nprint("Puzzle for day{v1}:")\ninput{v1} = get_string_input_array(path="da... |
Imports:
```python
import logging
import requests
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
logging.info('[ * ] Extracting Azure subscription ID')
v1 = 'https://management.azure.com/subscriptions?api-version=2016... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[float, float]
Dependencies:
```python
def v0(v1: str) -> Tuple[str, str]:
(v2, v3) = v1.split('->')
return (v2, v3)
```
Function Name: v4
Function:
```python
def v4(self, v5: str) -> Tuple[float, float]:
assert self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False):
if not v1 and (not self._clear_without_force):
return
if self.map_run_keys is None:
self.map_run_keys = []
v2 = {*self... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, str, dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: dict) -> dict:
v4 = {'$type': '{99FE3C6F-5B55-4D8B-8013-2708010EC715} PrefabGroup', 'name': v1, 'id': v2, 'prefabD... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
for v2 in self.words:
if self.compareWords(v2, v1):
return True
return False
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, Optional[torch.Tensor], Optional[torch.Tensor], Optional[torch.Tensor]
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: Optional[torch.Tensor]=None, v3: Option... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self._make_inst()
self.assertRaisesRegex(KeyError, '0', v1.remove_from_index, [0])
self.assertRaisesRegex(KeyError, '0', v1.remove_from_inde... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: Path, Path
Output Type: None
Dependencies:
```python
def v0(v1: List[str], v2: Path, v3: Path, v4: List[str]) -> None:
v5 = ['rsync']
v5.extend(v4)
v5.extend(['--filter=' + filter_string for v6 in v1])
v5.append(str(v... |
Imports:
```python
import collections
import typing
```
Type definitions:
Input Types: list[int], int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list[int], v2: int) -> None:
v3 = collections.deque(v1)
for v4 in range(v2):
v3.appendleft(v3.pop())
for v4 in rang... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = list(set(self._nexthop_mac_sources.values()))
if len(v1) != 1:
return ''
return v1[0]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: ast.ImportFrom
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ast.ImportFrom) -> None:
self._validate_any_import(v1)
self._check_from_import(v1)
self._check_protected_import_from_module(v1)
self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[Dict[str, List[tuple]], List[List[int]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Tuple[Dict[str, List[tuple]], List[List[int]]]:
with open(v1, 'r') as v2:
v3 = v2.readlines()
v... |
Imports:
```python
import numpy as np
import pandas as pd
from scipy.stats import chi2_contingency
import typing
```
Type definitions:
Input Types: pd.Series, pd.Series
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.Series, v2: pd.Series) -> float:
v3 = pd.crosstab(v1, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if not str.isidentifier(v1):
raise ValueError(f'stat name is not a valid identifier: {repr(v1)}')
return v1
``` |
Imports:
```python
import io
import typing
```
Type definitions:
Input Types: Optional[io.TextIOBase]
Output Type: io.TextIOBase
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[io.TextIOBase]=None) -> io.TextIOBase:
v2 = self.data_stack()
v1 = v1 or io.StringIO()
for v3 in v2... |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict=None) -> str:
if not hasattr(self, 'dialect'):
raise KeyError('base_sql_adapter unable to build connection string; required param ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: watcher_models.WatchResult
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: watcher_models.WatchResult):
if v1.current_release:
v2 = v1.current_release.name
v3 = v1.current_release.release_date... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any) -> bool:
if self == self.BOOL:
return type(v1) is bool
elif self == self.DICT:
return type(v1) is dict
elif self == self.FLOAT... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: None
Dependencies:
```python
def v0():
v1 = pika.PlainCredentials(username=settings['rabbitmq']['username'], password=settings['rabbitmq']['password'])
v2 = pika.BlockingConnection(pika.ConnectionParameters(host=sett... |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: Iterable[Dict], str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[Dict], v2: str, v3: str) -> None:
for v4 in v1:
v4[v2] = datetime.datetime.strptime(v4[v2], v3)
``` |
Imports:
```python
from datetime import datetime, timedelta
import typing
```
Type definitions:
Input Types: int, list, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=365, v2: list=None, v3: str=None, v4: str=None):
v5 = self.api_url + '/operations'
v6 = (da... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.stateManager.initializeState()
self.updateFPSTimer.start(100)
``` |
Imports:
```python
import subprocess
from pathlib import Path
import typing
```
Type definitions:
Input Types: Path, Path, Path
Output Type: Path
Dependencies:
```python
def v0(v1: str) -> str:
v2 = subprocess.run(v1, shell=True, capture_output=True)
return v2.stdout.decode().strip()
```
```python
def 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:
if v2 == 'val':
v3 = 'train'
elif v2 == 'test':
v3 = 'test'
else:
raise ValueError(f"The phase... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = 0
for v2 in range(self.width * self.height):
v3 = self.lines[v2 // self.width][v2 % self.width]
if v3 == '#':
v1 += po... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if 'index' not in self.player_data.keys():
return 'Could not start the playlist, missing index'
v1 = self.player_data['index']
v1 = v1 - 1 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[Union[float, int], ...]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple[Union[float, int], ...]) -> None:
if not 0 <= v1[0] < 256:
raise ValueError('Red is not in range between 0-255.')
if ... |
Imports:
```python
import pickle
from pathlib import Path
import typing
```
Type definitions:
```python
v0 = namedtuple('Settings', ['html_output_dirs', 'doctrees_output_dirs', 'include_intersphinx_data', 'always_use_scoped_targets', 'default_role', 'nvim'])
```
Input Types: Path, v0
Output Type: Any
Dependencies:
```p... |
Imports:
```python
import torch
import torch.distributed as dist
from torch.utils.data import RandomSampler, SequentialSampler, Sampler, Dataset
from torch.utils.data.distributed import DistributedSampler
from torch.nn.parallel import DistributedDataParallel as DDP
import typing
```
Type definitions:
Input Types: Data... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
v2 = self.coins_list
v3 = [r * v2[i] for (v4, v5) in enumerate(v1)]
v6 = f'{float(sum(v3)):.2f}'.replace('.', ',')
v7 = f'Troco: R$ {v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self.plot_finished():
self._event_count += 1
``` |
Imports:
```python
import torch
import torch.distributed.rpc as rpc
from torch import Tensor, device, dtype, nn
from torch.distributed.nn.jit import instantiator
from torch.distributed import _remote_device
from torch.distributed.rpc.internal import _internal_rpc_pickler
from torch.nn import Module
from torch.nn.parame... |
Imports:
```python
from dataclasses import dataclass, field
import typing
```
Type definitions:
Input Types: str, Any, Any
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Any, v3: Any) -> List[str]:
if v2 is None or v2 == v3:
return [v1]
return []
``` |
Imports:
```python
import itertools
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: Iterable[v0], int
Output Type: Generator[Tuple[v0, ...], None, None]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Iterable[v0], v3: int) -> Generator[Tuple[v0, ...], None, None]:
a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Rectangle'
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Rectangle') -> float:
v2 = self.intersection(v1).area
return v2 / float(self.area + v1.area - v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = f'{v1}\n'
if self._file:
self._file.write(v2)
else:
with open(self._filepath, 'a') as v3:
v3.write(v2)
``` |
Imports:
```python
import logging
import re
import warnings
import typing
```
Type definitions:
Input Types: str, Pattern, str
Output Type: Dict[str, Any]
Dependencies:
```python
def v0() -> None:
logging.getLogger('asyncio').setLevel('CRITICAL')
warnings.simplefilter('ignore')
```
Function Name: v1
Function:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> str:
v2 = 'CREATE TABLE IF NOT EXISTS polynomials (id text primary key, '
v3 = ['root{} int, iroot{} int'.format(root, root) for v4 in range(v1)]
... |
Imports:
```python
from datetime import timedelta
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> int:
v2 = {'s': 'seconds', 'm': 'minutes', 'h': 'hours', 'd': 'days', 'w': 'weeks'}
v3 = int(v1[:-1])
v4 = v2[v1[-1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str):
v3 = self.obj['colors'][v1]
v3 = v2
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple, Tuple
Output Type: List
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple, v2: Tuple) -> List:
if abs(v1[0] - v2[0]) > abs(v1[1] - v2[1]):
if v1[0] > v2[0]:
v3 = -1
else:
v3 ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: 'Document'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Document'):
if v1.embedding is None:
v1.embedding = np.zeros(self._pqlite.dim, dtype=np.float32)
elif isinstance(v1.e... |
Imports:
```python
from typing import TYPE_CHECKING, Dict, Iterator, List, Mapping, MutableMapping, MutableSequence, Optional, Sequence, Tuple, Union, cast
from typing import _eval_type as eval_type
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, List[dict], bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Any, v3: List[dict]=None, v4: bool=True, **v5) -> None:
self._assert_key_name(v1)
self._data.add(v1, v2, info=v3, lazy=... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Iterator[Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1: Any, **v2: Any) -> Iterator[Any]:
for v3 in self._get_multipack_content(*v1, **v2):
yield v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Interaction'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: 'Interaction') -> None:
v2 = v1.data.name
if v2 in self.app_commands:
v3 = self.app_commands[v2]
v4 = v3['callback']
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: PlatformApiEndpoints, v2: aiohttp.ClientSession, v3: _User) -> None:
self._platform_api = v1
self._client = v2
self._user = v3
@property
def v4(self) -> _User:
return self._use... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, rules.Ipv4Range
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: rules.Ipv4Range) -> bool:
if v2.mask > 32 or v2.mask < 0:
raise ValueError('The mask of ipRange is invalid: %d. Should be in [0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.