text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: nx.MultiGraph
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: nx.MultiGraph):
v2 = []
for (v3, v4, v5) in v1.edges(data=True):
v6 = (frozenset([(v3,), (v4,)]), v5['voltage'], v5['direction'])
v2... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Dict[str, str]
Dependencies:
```python
def v0(v1: str) -> str:
v2 = v1.replace(os.path.sep, '/')
if v2.startswith('./'):
v2 = v2[2:]
return v2
```
```python
def v3(v4: str) -> str:
with open(v4)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2):
self.create_styled_table(v1)
self.prepare_table(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1) -> None:
self.total_records = len(v1)
(self.outer_start, self.outer_end, self.outer_weeks) = outer_week_boundaries(v1)
(self.inner_start, self.inner_end, self.inner_weeks) = inner_week_boundari... |
Imports:
```python
import tensorflow.compat.v2 as tf
import typing
```
Type definitions:
Input Types: Union[float, base.Split]
Output Type: base.PreProcessFn
Dependencies:
```python
def v0(v1: tf.train.Example) -> Dict[str, tf.Tensor]:
v2 = _make_features_spec()
v3 = tf.io.parse_example(v1, v2)
v3 = {k: tf... |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.Optional[BaseException]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: t.Optional[BaseException]) -> None:
if self.request.environ.get('flask._preserve_context') or (v1 is not None and self.app.preserve_c... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[torch.Tensor, torch.Tensor], Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple[torch.Tensor, torch.Tensor], v2, v3):
(v4, v5, v6, v7, v8) = v1
v8 = (v8 - v8.mean()) / v8.std()
self.... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: set, Word2Vec, pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: set, v2: Word2Vec, v3: pd.DataFrame):
v4 = dict()
v5 = v3.shape[1] + v2.vector_size
v6 = 0
v7 = v3.shape[1]... |
Imports:
```python
import numpy as np
from pandas._libs import internals as libinternals, lib
from pandas._libs.internals import BlockPlacement
from pandas._typing import ArrayLike, DtypeObj, Shape, npt, type_t
from pandas.errors import PerformanceWarning
from pandas.util._validators import validate_bool_kwarg
from pan... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, date, datetime], str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[str, date, datetime], v2: str='%F %T') -> str:
if isinstance(v1, str):
return v1
return v1.strftime(v2)
``` |
Imports:
```python
from datetime import datetime
import pandas as pd
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
```python
def v0(v1: trdb2py.trading2_pb2.PNLAssetData) -> pd.DataFrame:
v2 = {'date': [], 'winrate': []}
v3 = datetime.fromtimestamp(v1.values[0].ts)
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tf.keras.Model, tf.keras.layers.Layer
Output Type: typing.Dict[tf.keras.layers.Layer, typing.List]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.keras.Model, v2: tf.keras.layers.Layer) -> typing.Dict[tf.keras.layers.Layer, typing.... |
Imports:
```python
import io
import json
import typing
```
Type definitions:
Input Types: bytes, str
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bytes, v2: str) -> Dict:
v3 = io.TextIOWrapper(io.BytesIO(v1), encoding=v2, newline='')
v4 = json.load(v3)
v3.close()
re... |
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: str = f'events/{v1}/affiliates'
v3 = self._request(method='get', path=v2)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
v1 = list(self['layer']['fields'].keys())
if self.key_field:
v1.append(self.key_field)
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Compare
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Compare) -> Any:
self.visit(v1.left)
for v2 in v1.comparators:
self.visit(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: NoReturn
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> NoReturn:
self.file.writelines(v1 + '\n')
self.file.flush()
``` |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
v2 = ['mkdocs', 'build', '--clean', '--site-dir', v1]
subprocess.check_call(v2, cwd=self.output_directory)
``` |
Imports:
```python
import numpy as np
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, torch.Tensor
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1):
v2 = len(v1.size()) - 1
(v3, v4) = torch... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = bytes
```
Input Types: Iterable[v0]
Output Type: Iterator[Tuple[v0, client_datasets.ClientDataset]]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Iterable[v0]) -> Iterator[Tuple[v0, client_datasets.ClientDataset]]:
for (v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, tuple, bool, str, str, int, bool
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='', v2: tuple=None, v3: bool=False, v4: str='确定选择:', v5: str='', v6: int=3, v7: bool=False) -> int:
if v2 is None:
... |
Imports:
```python
from math import log2, sqrt, ceil
import typing
```
Type definitions:
Input Types: int
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> list:
v2 = []
for v3 in range(2, int(sqrt(v1)) + 1):
if v1 % v3 != 0:
continue
v4 = 0
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, *v2) -> None:
for v3 in v2:
self.fbind(v3, v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = self.get_value(self.ID_ADDITIONAL_DATA_FIELD_TEMPLATE_TXID, self.txid)
return self.get_value(self.ID_ADDITIONAL_DATA_FIELD_TEMPLATE, v1)
``` |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str) -> requests.Session:
if v1 not in cached_sessions.keys():
v2: requests.Session = requests.session()
v2.cookies.update({'.ROBLOSECURITY': v1})
cach... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Transformable):
def __init__(self, v1: PurePath, v2: Union[str, Callable[[], Optional[str]]], v3: Optional[datetime.datetime]):
super().__init__(v1)
if isinstance(v2, str):
v4 = v2
self.url: Callable[[... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.array
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.array) -> np.array:
v2 = v1.sum(axis=1).argmin()
v1 = np.roll(v1, 4 - v2, 0)
v1 = np.array(v1)
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def v1(self) -> TaskContext:
raise NotImplementedError()
def v2(self) -> TaskModel:
raise NotImplementedError()
def v3(self) -> TaskDatasetFactory:
raise NotImplementedError()
def v4(self) -> TaskDataC... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'prefect.engine.state.Cached', Dict[str, Any], Dict[str, Any]
Output Type: bool
Dependencies:
```python
def v0(v1: 'prefect.engine.state.Cached', v2: Dict[str, Any], v3: Dict[str, Any]) -> bool:
if v1.cached_result_expiration is None:
retu... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: str, str
Output Type: Tuple[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> Tuple[str, str]:
v3 = random.randrange(0, self.dna_size, 1)
return (v1[:v3] + v2[v3:], v2[:v3] + v1[v3:]... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, **v2: Any) -> str:
v3 = self.run_command(v1, check=True, stdout=subprocess.PIPE, text=True, **v2)
return v3.stdout
``` |
Imports:
```python
from inspect import signature
import typing
```
Type definitions:
Input Types:
Output Type: dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict[str, Any]:
v1 = signature(self.__init__)
v2 = v1.parameters
return {k: getattr(self, k) for v3 in v2}
``` |
Imports:
```python
from math import sqrt
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
v1 = self.num_games()
v2 = self.mean()
v3 = sum((k * k * v for (v4, v5) in self.histogram.items())) / v1
v6 = v3 - v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
if self.size == 2:
return self[0, 0] * self[1, 1] - self[0, 1] * self[1, 0]
return sum((self.cofactor(0, pos) * el for (v1, v2) in enumerate(se... |
Imports:
```python
import base64
import hashlib
import hmac
import typing
```
Type definitions:
Input Types: str, str, str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str, v4: str) -> str:
v5 = '&'.join([v1, v2, v3, 'data=' + v4])
v6 = hmac.new(key=ba... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
for v1 in self._player_queues.values():
await v1.close()
for v2 in self:
await v2.on_remove()
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: List[List[str]]
Output Type: List[List[bool]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[List[str]]) -> List[List[bool]]:
v2 = ['integ0.dat', 'integ1.dat', 'results.txt', 'wplot.png']
v3 = []
for v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
v2 = {self.x_in: v1}
(v3, v4) = self.sess.run([self.pred_boxes, self.pred... |
Imports:
```python
import torch
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, float, float, float
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1: torch.Tensor, v2: torch.Tensor) -> torch.Tensor:
(v3, v4) = v1.size()
v1 = v1 - v1.mean(d... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=1) -> Optional[str]:
self.__count = v1
return self.__code_detct()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str]):
if v1 is None:
return
if self.task == 'asr':
v2 = ['online' in model_tag for v3 in self.pretrained_models.keys... |
Imports:
```python
from itertools import cycle
import warnings
import typing
```
Type definitions:
```python
v0 = Union[List, Tuple, np.ndarray, AnyStr, Color, ColorArray]
```
Input Types: Union[v0, cycle], str, str
Output Type: cycle
Dependencies:
```python
def v1(v2: int, v3: v0, v4: str, v5: str) -> np.ndarray:
... |
Imports:
```python
import numbers
import typing
```
Type definitions:
Input Types: typing.Iterable[numbers.Rational]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: typing.Iterable[numbers.Rational]):
v2 = tuple(v1)
if not all((isinstance(s, numbers.Rational) and s > 0 fo... |
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 = self.split_args(args_str=v1)
if not v2:
raise Exception(f'snowmobile parsing error: parsing.name_from_marker() called onan emp... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = '\nraise ShouldBeANameError()\n'
with self.assertRaises(NameError):
self.compile_to_strict(v1)
``` |
Imports:
```python
import logging
import signal
import sys
import typing
```
Type definitions:
```python
v0 = Callable[[τ_config, DBConnection], None]
```
```python
class v1(LoggingConnection):
def __init__(self, *v2: Any, **v3: Any) -> None:
super().__init__(*v2, **v3)
self.dry_run = False
de... |
Imports:
```python
import requests
import json
import typing
```
Type definitions:
Input Types: Any
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> dict:
v2 = requests.get(self.url_senses + '/' + v1)
if v2.status_code != 200:
raise Exception('Wordnet backend r... |
Imports:
```python
import uuid
import typing
```
Type definitions:
Input Types: list
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> None:
for v2 in v1:
try:
uuid.UUID(str(v2['id']))
except:
v2['id'] = str(uuid.uuid4())
``` |
Imports:
```python
import pandas as pd
from pandas.api.types import CategoricalDtype
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if isinstance(self.regions, pd.DataFrame):
assert self.regions.columns[0:3].tol... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame, v2: dict):
v3 = v1
v3[['id']] = v3[['id']].astype(str)
v3['value'] = pd.to_numeric(v3['value'], err... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: list
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> dict:
v2 = {}
v3 = re.compile('(\\w+ \\w+) bags contain')
v4 = re.compile(' \\d+ (\\w+ \\w+) bags?')
for v5 in v1:
v6 = r... |
Imports:
```python
import argparse
import re
import typing
```
Type definitions:
Input Types:
Output Type: argparse.ArgumentParser
Dependencies:
```python
def v0(v1: str) -> str:
if v1 and re.match('^[a-zA-Z0-9\\-_]+$', v1):
return v1
else:
raise argparse.ArgumentTypeError('invalid alphaNumeri... |
Imports:
```python
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: int
Dependencies:
```python
def v0(v1):
v2 = {}
for v3 in v1.columns:
v2[v3] = Project(v3)
return v2
```
```python
def v4(v5, v6):
v7 = {}
for (v8, v9) in v5.iter... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(CheckError):
pass
```
Input Types: object, str
Output Type: Callable
Dependencies:
```python
def v1(v2: Any, v3: str) -> v0:
return v0(f'Param "{v3}" is not callable. Got {repr(v2)} with type {type(v2)}.')
```
Function Name: v4
Function:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, torch.nn.Module, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: torch.nn.Module, v3):
for (v4, v5) in v2.named_parameters():
if v5.numel() > 1:
v1.add_histogram(v4, v5, v3)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> Any:
self.assert_contract_is_instantiated()
return self.contract.getEIP712Hash.call(v1, v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> None:
for v2 in v1.keys():
v3 = v1[v2].get('%')
v4 = v1[v2]['span_ids']
if v3 < 1.0:
v5 = self.__coverability... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, t.Optional[t.Callable[[str], int]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3: t.Optional[t.Callable[[str], int]]):
v4 = 0
v5 = []
for (v6, v7) in enumerate(v1):
if v7 != v2[v6... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, int, int, int, str, str, str, str, str, int, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: int=100, v4: int=3, v5: int=3, v6: str='{}', v7: str='{}', v8: str='{}', v9: str='{}', v10: ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: int):
v3 = v1[v2]
v4 = np.sum(v1 == v3)
v5 = np.sum(v1 == v3 + 1)
v6 = np.max(v1)
if v3 != v6 and (... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: List
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List):
v2 = self.to_df(v1)
self.df = pd.concat([v2, self.df])
self.data = self.df_to_data(self.df)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self._get_set_metadata_commands()
self._post_map_details(v1)
``` |
Imports:
```python
import matplotlib
import matplotlib.colors as mcolors
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: Iterable[np.ndarray], Optional[float], Optional[float]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
de... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'List[int]'
Output Type: 'List[int]'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'List[int]') -> 'List[int]':
v2 = len(v1)
if v2 == 0:
return []
v3 = []
(v4, v5) = (v1[0] ** 2, v1[v2 - 1] ** 2)
(v6... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path):
v2 = ''
with open(v1, 'r') as v3:
v2 = v3.read()
return v2.split('\n')
``` |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: Any, Union[Path, TextIO], bool
Output Type: int
Dependencies:
```python
def v0(v1: Any, *, v2: bool=False) -> str:
if v2:
v3 = _rtoml.serialize_pretty
else:
v3 = _rtoml.serialize
return v3(v1)
```
F... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tf.Tensor, tf.Tensor
Output Type: List[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor, v2: tf.Tensor) -> List[float]:
v3 = dict(logits=v2, data=v1)
v4 = []
for (v5, v6) in zip(self.rule_weights, self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: metrics_api.Observer
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: metrics_api.Observer) -> None:
v2 = v1.name.strip().lower()
with self.instruments_lock:
self.instruments.pop(v2)
``` |
Imports:
```python
import decimal
import uuid
from datetime import date, datetime, time, timedelta
import numpy as np
import pandas as pd
import typing
```
Type definitions:
Input Types: Any, bool
Output Type: str
Dependencies:
```python
def v0(v1: Any) -> Any:
if isinstance(v1, memoryview):
v1 = v1.tobyte... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> None:
self.num_cols = v1.get('num_cols', [])
self.float_cols = v1.get('float_cols', [])
self.int_cols = v1.get('int_c... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[list, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Tuple[list, str]:
v2 = self.InitializationSettings['library_sync']
v3 = self.__GetHeaderWithAccessToken()
v4 = self.__GetReauth... |
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 in self.graph.dtype.names:
self.cost_field = v1
if self.graph[v1].dtype == self.__float_type:
self.cost = self.g... |
Imports:
```python
import typing
```
Type definitions:
Input Types: argparse._SubParsersAction
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: argparse._SubParsersAction):
v2 = v1.add_parser('udev', help='print udev rules to stdout')
v2.tool = self
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: datetime.date, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: datetime.date, v2: int):
if v2 < 0:
v2 = abs(v2)
v3 = v1.month - v2
if v3 < 1:
v1 = v1.replace(year=v1.year - i... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal, Poisson, kl_divergence as kl
from torch.autograd import Variable
from torch.distributions import Normal, Categorical, kl_divergence as kl
import typing
```
Type definitions:
Input Types: torch.... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
self.move += 1
if self.move > self.totalMoves:
return False
v1 = self.take_cups(3)
v2 = self.get_target_cup(v1)
self.add_cups_at(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> Optional[str]:
for v2 in v1['attachments']:
if v2['type'] == 'audio_message':
if v2['audio_message']['transcript_state'] =... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if self.roll_count > 0:
self.roll_count -= 1
for v1 in self.dices:
v1.roll()
return True
else:
return Fal... |
Imports:
```python
from decimal import Decimal
import typing
```
Type definitions:
Input Types: Decimal
Output Type: Tuple[bool, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Decimal) -> Tuple[bool, str]:
(v2, v3) = self.low_high_daily_prices()
v4 = Decimal(str(abs(self.args.high_d... |
Imports:
```python
from torch.fx.graph_module import GraphModule
from torch.fx.graph import Graph
from torch.fx.node import Node
from torch.fx._symbolic_trace import symbolic_trace
from torch.fx._compatibility import compatibility
import copy
import torch
import typing
```
Type definitions:
Input Types: GraphModule, t... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
if not self.valid_node(v1):
raise ValueError(f'Invalid argument {v1}')
v2 = self.search(v1)
if v2:
return v2.directory_... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str):
v4 = 'https://schematics.cloud.ibm.com/v1/workspaces/' + v1 + '/actions/' + v2
v5 = {'Authorization': ... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclasses.dataclass
class v0:
v1: str
v2: str
v3: str
@staticmethod
def v4():
""" Return a list of headers to be used when rendering this dataclass
using tabular.tabulate()
"""
return ('Image Referen... |
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 = self.safely_convert_string(v1['contributors'])
v3 = []
for v4 in v2:
if 'is_contact' in v4 and v4['is_contact'].upper(... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = 'tsvs/labeled_%s.tsv' % v1
if not os.path.isfile(v2):
v2 = 'tsvs/aws_%s.tsv' % v1
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: pika.frame.Method
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> pika.frame.Method:
v2 = self.get_conn()
v3 = v2.channel()
return v3.queue_delete(v1)
``` |
Imports:
```python
import torch
from torch import nn, Tensor
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> Tensor:
(v2, v3) = torch.split(v1, int(v1.size()[1] / 2), dim=1)
v2 = v2.long()
if self.u... |
Imports:
```python
import json
import logging as log
import typing
```
Type definitions:
Input Types: ref.CompartmentMap, zipf.ZipFile
Output Type: Any
Dependencies:
```python
def v0(v1: dict, v2: str, v3: zipf.ZipFile):
v4 = v1.get('@id')
if v4 is None or v4 == '':
log.error('No @id for object %s in %... |
Imports:
```python
from requests import get
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None):
v2 = self.base_url.format(action='tokens')
v3 = get(v2)
if v3.status_code == 200:
v4 = v3.json()['data']... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True) -> bool:
v2 = 'The %s is None but must be set before the circuit can be built.'
if self._num_qubits is None:
if v1:
rai... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: bool
Dependencies:
```python
def v0(v1: int, v2: int) -> int:
while v2 != 0:
(v1, v2) = (v2, v1 % v2)
return v1
```
Function Name: v3
Function:
```python
def v3(v4: int, v5: int) -> bool:
v6 = v0(v4, v5)
r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
self.val_freq[v1] += 1
v2 = self.val_freq[v1]
self.max_freq = max(self.max_freq, v2)
self.freq_stacks[v2].append(v1)
``` |
Imports:
```python
import heapq
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: list[list[int]]) -> int:
v2: dict[(int, int), set[int, int]] = {}
v3: dict[(int, int), int] = {}
for (v4, v5) in enumerate(v1):
for (v6, v7) in enumerate(v5):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Generator
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> Generator:
return (self.clean_text(doc, True) for v2 in v1)
return (v2.split(' ') for v2 in v1)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = NamedTuple('PublishEndpoint', [('storage', str), ('prefix', str), ('distribution', str), ('source_kind', str), ('sources', Sequence[Dict[str, str]]), ('architectures', Sequence[str]), ('label', str), ('origin', str)])
```
Input Types:
Output Type: S... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: dict, Union[str, re.Pattern], Union[str, re.Pattern], Union[str, re.Pattern], bool
Output Type: dict
Dependencies:
```python
def v0(v1: Union[str, re.Pattern], v2: str) -> dict:
v3 = [itm.replace(':', '').strip() for v4 in re.findall(v1,... |
Imports:
```python
import re
import pandas as pd
import typing
```
Type definitions:
Input Types: str, str, Union[str, Iterable[str]]
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str='Train epoch_', v3: Union[str, Iterable[str]]='train/|test/') -> pd.DataFrame:
... |
Imports:
```python
import numpy as np
from sklearn import metrics, naive_bayes
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, confusion_matrix, precision_score, recall_score
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncod... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: 'aiohttp.ClientResponse'
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> 'aiohttp.ClientResponse':
v1 = await self._touch(self._name, parent_id=self._parent_id, mime_type=self._mime_type, app_properties=sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: WebDriver
Output Type: Tuple[int, List[WebElement]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: WebDriver) -> Tuple[int, List[WebElement]]:
v2 = 'athlete-table__row athlete-table__row--link link-underline-trigger'
v3 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.