text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bytes:
self.update()
v1 = []
v2 = self._inner_pack()
self.cmn_hdr.total_len = self.cmn_hdr.hdr_len + len(v2)
v1.append(self.cmn_hdr.pack())
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tuple):
v2 = 1
(v3, v4, v5) = v1
return (v3, v4, v5, v2)
``` |
Imports:
```python
from argparse import ArgumentError
import typing
```
Type definitions:
Input Types: str, int, int, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int, v3: int, v4: str) -> bool:
if not v4:
raise ArgumentError('No content supplied')
with... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.trace_served = True
return super().handle_timeout()
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1, v2=None, v3=False):
if not v1:
raise ValueError('load_image - fp not provided')
v4 = os.path.join(v1)
try:
v5 = pygame.image.load(v4)
except pygame.error a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[Tuple[int, int]], np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[Tuple[int, int]], v2: np.ndarray):
if self.centers is not None:
for (v3, v4) in v1:
assert v4... |
Imports:
```python
import torch
import numpy as np
from scipy.io.wavfile import write
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str='beep beep boop boop'):
v2 = torch.hub.load('nvidia/DeepLearningExamples:torchhub', 'nvidia... |
Imports:
```python
from typing import Dict, Optional, Tuple, Union, cast
import matplotlib.pyplot as plt
import numpy as np
import typing
```
Type definitions:
Input Types: torch.Tensor, float
Output Type: Dict[str, Union[plt.figure, np.array, float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tor... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3=''):
raise NotImplementedError
return self._run_template('reg_loop.ahk', reg=v1, key_name=v2, mode=v3) or None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List):
v2 = 0
while v2 < len(v1) - 1 and v1[v2] < v1[v2 + 1]:
v2 += 1
return v2 + 1
``` |
Imports:
```python
import itertools
import shutil
from pathlib import Path
import typing
```
Type definitions:
Input Types: 'AppConfig', Namespace
Output Type: None
Dependencies:
```python
def v0(v1: 'AppConfig') -> Iterable[Path]:
v2 = Path(v1.get('journal_directory')).iterdir()
v3 = (Path(journal_config['pat... |
Imports:
```python
import json
import requests
import typing
```
Type definitions:
Input Types: str, str, str, int, list
Output Type: Dict
Dependencies:
```python
def v0(v1, v2):
v3 = v1 - datetime.fromtimestamp(v2)
return v3.seconds / 60
```
```python
def v4(v5=False):
v6 = datetime.now()
v7 = demisto... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], Dict[str, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any], v2: Dict[str, Any]):
for (v3, v4) in v2.items():
if v1.get(v3) != v4:
raise Exception(f'{v3} is not... |
Imports:
```python
import torch
import torch.distributed as dist
import torch.nn as nn
import typing
```
Type definitions:
Input Types: List[torch.Tensor]
Output Type: Tuple[torch.Tensor]
Dependencies:
```python
def v0(v1: torch.Tensor) -> torch.Tensor:
return v1.isfinite()
```
```python
def v2(v3: torch.Tensor) -... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> str:
if not v1:
raise ValueError('Error, cancel_order got no order id!')
v2 = self.rest_send(method='orders/cancel', params={'orderId': v1})
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> float:
v1 = await self._adguard._request('stats')
return round(v1['avg_processing_time'] * 100, 2)
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Generator
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=True, v2=None) -> Generator:
if v1:
v3 = [im for v4 in self.dstruct.train_images_list] if v2 is None else [self.dstruct.train_im... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, str, str, str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: str='', v3: str='Date', v4: str='Price', v5=None):
v5 = v1.plot(title=v2, fontsize=12, ax=v5)
v5.set_xlabel(v3)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any) -> None:
self.__count += 1
if self.__value is None:
self.__value = self._func(v1)
else:
self.__value = min(self.__value, self.... |
Imports:
```python
import asyncio
from datetime import timedelta
import typing
```
Type definitions:
Input Types: Any, Union[float, timedelta]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1, v2: Union[float, timedelta]):
if isinstance(v2, timedelta):
v2 = v2.total_sec... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.pkg.domain:
self.write_comment(f'circuit.Package {self.pkg.domain}')
else:
self.write_comment(f'Anonymous circuit.Package')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, types.User
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: types.User):
if v2.bot:
return
self.cursor.execute('INSERT INTO channels_admins (channel_id, user_id) VALUES (?, ?)', (v1, ... |
Imports:
```python
import copy
from collections import defaultdict
import typing
```
Type definitions:
Input Types:
Output Type: List[Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[Dict]:
if self.config.split_dataset:
v1 = []
for v2 in self.config.train_set_scene_i... |
Imports:
```python
from .http import http_delete, http_get, http_post, http_put, logger
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1, v2, v3, v4=30):
v5 = {'Content-Type': 'application/json', 'X-Request-Id': local.request_id}
if settings.BK_IAM_HOST_TY... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
self.module = v1
self.modaliases = {None: v1}
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, dict, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: dict=None, v4: dict=None):
v5 = self.request(method=v1, path=v2, params=v3, data=v4)
return v5.json()
``` |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: Union[List[str], str], str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: Union[List[str], str], v2: str):
if not isinstance(v1, str) and len(v1) > 1:
v3 = await asyncio.gather((... |
Imports:
```python
from typing import Optional, Dict, Iterator, cast
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self._login(self.api_url)
v2 = cast(Dict[str, str], self._headers)
v2['Cookie'] = v1
s... |
Imports:
```python
import re
import string
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
```python
def v0(v1: str) -> bool:
v2 = re.match('.*byr:(?P<value>\\d{4}).*', v1)
if not v2 or int(v2.group('value')) < 1920 or int(v2.group('value')) > 2002:
return False
v2 ... |
Imports:
```python
import os, mimetypes, inspect
import typing
```
Type definitions:
Input Types: Union[Path, str], List[str], List[Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[Path, str], v2: List[str], v3: List[Any]):
if not v1.is_dir():
os.mkdir(v1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> list:
v2 = v1.casefold()
return [i.name for v3 in self.components if v2 == v3.parent.casefold() or v2 == v3.child.casefold()]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[Dict[str, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[Dict[str, Any]]:
v1 = []
for v2 in range(5):
v1.append({'interpretingServiceName': 'Smtp', 'displayName': f'Message Template {... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Literal['text', 'voice']
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: Literal['text', 'voice']):
for v2 in self.t_messages if v1 == 'text' else self.vc_messages:
if v2.is_ready():
... |
Imports:
```python
import webbrowser
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: str
Dependencies:
```python
@functools.lru_cache()
def v0() -> 'InteractiveBrowserCredential':
if not AZURE_CLI_INSTALLED:
raise RuntimeError("In order to use webviz deploy features, you need to... |
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.tuner_callback is None:
return
if self.eval_type == 'classification':
v2 = self.meters['accuracy'].compute_final()
e... |
Imports:
```python
import copy
import numpy as np
from statsmodels.discrete import discrete_model
from statsmodels.imputation.mice import MICEData
from statsmodels.regression import linear_model
import typing
```
Type definitions:
Input Types: int, str, pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Fu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str, v4: str) -> bool:
v5 = False
if v1 == 'E':
v5 = True
if v1 == 'S':
v5 = True
if v1 == 'B' and v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Iterable[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Iterable[str]:
self.process_stdin.write((v1 + '\n\n\n').encode('utf-8'))
self.process_stdin.flush()
yield from self.iter_read_line... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List
Output Type: Union[List, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List=None) -> Union[List, np.ndarray]:
if self.recombination is not None:
v2 = self.recombination.do(self.individuals, v1)
... |
Imports:
```python
import math
import torch
import random
from torch.utils import data as Data
from torch import nn
from torch import optim
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, bool
Output Type: Any
Dependencies:
```python
def v0(v1, v2, v3, v4=None):
v5 = v1.size(-1)
v6 = torch... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
if v1 < 0:
return False
v2 = str(v1)
(v3, v4) = (0, len(v2) - 1)
while v3 < v4 and v2[v3] == v2[v4]:
v3 += 1
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> None:
if self.relations.get(v1):
self.relations[v1] += [v2]
else:
self.relations[v1] = [v2]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.pools_by_delegation = {}
for v1 in self.pool_by_id.values():
v1.validate_pool()
v2 = self.pools_by_delegation.get(v1.get_delegat... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.set_models({'projector/2': {'name': 'Projector 2', 'meeting_id': 2}})
(v1, v2) = self.basic_test({'reference_projector_id': 2}, check_200=False)... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: Dict[str, torch.Tensor], Dict[str, torch.Tensor]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, torch.Tensor], v2: Dict[str, torch.Tensor], **v3):
v4 = ~torch.isnan(v2['y']).any(1).any... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Optional[libgpiod.gpiod_line]=None, v2: chip=chip()) -> None:
"""
@brief Constructor. Creates an empty line object.
Usage:
l = line()
"""
self._m_line = v1
... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: '数独矩阵', '空白格行数', '空白格列数'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: '数独矩阵', v2: '空白格行数', v3: '空白格列数'):
(v4, v5) = (v2 // 3, v3 // 3)
v6 = [v1[v4 * 3 + r][v5 * 3 + c] for v7 in range(3) for v8... |
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 self.pack_exists(v1):
raise self.PackageNotFoundError()
v2 = self.cursor.execute(f"delete from tb_packs where nm_pack = '{v1}';")
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
if v1 <= 0:
return False
try:
os.kill(v1, 0)
except OSError:
return False
else:
return ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self: object) -> None:
self.__location[0] += self.__control_location[0]
self.__location[1] += self.__control_location[1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple[list[Any], torch.Tensor]
Output Type: tuple[torch.Tensor, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple[list[Any], torch.Tensor]) -> tuple[torch.Tensor, float]:
(v2, v3) = v1
v4 = self.model(v2)
v... |
Imports:
```python
import logging
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: List[str]
v2: List[List[str]]
```
Input Types: str, List[any]
Output Type: Any
Dependencies:
```python
def v3(v4, v5):
v4.write(v5 + SEPA)
```
```python
def v6(v7, v8: v0):
writeleft(v7)
for v9 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: AST.FusedBatchNorm, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: AST.FusedBatchNorm, v2):
v3 = list(set(self.visit(v1.expr, v2) + self.visit(v1.multExpr, v2) + self.visit(v1.addExpr, v2)))
v1.optid... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Dict
Output Type: Any
Dependencies:
```python
def v0(v1: str):
return '_'.join(re.split('["#$%&+,/:;=?@\\[\\\\\\]^`{|}~\\\'\\s]+', v1))
```
Function Name: v2
Function:
```python
def v2(v3: Dict):
v4 = 'metlink_' + v3['stop_id']
i... |
Imports:
```python
import re
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: float
v2: str
```
Input Types:
Output Type: None
Dependencies:
```python
def v3(v4: SeqRecord) -> v0:
v5 = 0.0
if (v6 :=... |
Imports:
```python
import logging
import numpy as np
import pandas as pd
from statsmodels.tsa.api import SimpleExpSmoothing
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame) -> pd.DataFrame:
v2... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict):
v3 = json.dumps(v2)
with open('{0}/{1}.json'.format(self._loc, v1), 'w') as v4:
v4.write(v3)
``` |
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:
v3 = 0
v4 = 0
v5 = float('inf')
for v6 in range(len(v2)):
v4 += v2[v6]
while v4 >= v1:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> int:
(v1, v2) = (abs(v1), abs(v2))
if v1 > v2:
(v1, v2) = (v2, v1)
if v1 == 0:
return v2 if v2 else 1
v3 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, int, int, int, int, int
Output Type: any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: int, v4: int, v5: int, v6: int, v7: int) -> any:
print('Creating mosaic')
v8 = self.make_mosaic(v1, v2, (v4, v3), ... |
Imports:
```python
import csv
import os
from itertools import compress
from pathlib import Path
import typing
```
Type definitions:
Input Types: str, int, str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str='train', v2: int=None, v3: str=None) -> dict:
assert isinstance(v1, st... |
Imports:
```python
import typing
```
Type definitions:
Input Types: matplotlib.figure.Figure, str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: matplotlib.figure.Figure, v2: str, v3: str, v4: str):
v5 = v2 + v3
print('Plot ' + v3 + ' is save to file: ' + v5 + '.')
... |
Imports:
```python
from csv import DictReader, DictWriter
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str=read_csv_file):
with open(v1, encoding='utf-8', newline='') as v2:
v3 = DictReader(f=v2)
for v4 in v3:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: http.HTTPFlow
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: http.HTTPFlow):
if v1.live:
return "Can't replay live flow."
if v1.intercepted:
return "Can't replay intercepted flow."
if... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, typing.Type, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: typing.Type, v3=False):
for v4 in v1:
if v3 is True:
yield (v2(**v4), v4)
else:
yield v2(**v4... |
Imports:
```python
import logging as log
import numpy as np
import typing
```
Type definitions:
Input Types: nx.Graph, nx.Graph, Callable
Output Type: bool
Dependencies:
```python
def v0(v1: Dict[str, Any], v2: Dict[str, Any]) -> bool:
if v1.keys() != v2.keys():
return False
return all((np.array_equal(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if v1.startswith('gs://'):
self._bucket = v1[5:]
else:
self._bucket = v1
return self
``` |
Imports:
```python
import math
import operator as op
from collections import ChainMap
from itertools import chain
import typing
```
Type definitions:
```python
v0 = Union[float, int, Symbol]
```
```python
v1 = MutableMapping[Symbol, object]
```
```python
v2 = Union[v0, List]
```
Input Types: str
Output Type: NoReturn
D... |
Imports:
```python
import warnings
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, int, int, Dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray, v3: int=128, v4: int=20, v5: Dict=None, **v6) -> None:
if... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str) -> None:
v2 = self.append_path_to_output_dir(v2)
v3 = self.callgraph.format_function(v1)
with open(v2, 'a') as v4:
v4.wr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, Optional[Dict[str, Any]]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: Optional[Dict[str, Any]]=None) -> bool:
if not v2:
return True
for (v3, v4) in v2.items():
if v3 in v1 a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Dict, Any
Output Type: Dict
Dependencies:
```python
def v0(v1: Dict, v2: str, v3):
if v2 in v1:
return v1[v2]
else:
return v3
```
```python
def v4(v5: Dict, v6: str) -> Dict:
if v6 in v5:
if isinstance(v5[v6], ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, str
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: str=X_RAY_COLUMN_PREFIX) -> pd.DataFrame:
v3 = [column_name for v4 in v1.columns if v4.startswith(v2)]
return v1.drop... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: Tuple[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict) -> Tuple[str, str]:
v2 = self._invert_comparator(v1['threshold_condition'])
v3 = self._invert_comparator(v1['condition_combination'])... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1):
if os.environ.get('TEST_TARGET') == 'AWS_CLOUD':
return boto3.client(v1)
v2 = botocore.config.Config(connect_timeout=1000, read_timeout=1000, retries={'total_max_attemp... |
Imports:
```python
from tensorflow import keras
import typing
```
Type definitions:
Input Types: int, List[int], List[str], Optional[int]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: List[int], v3: List[str], v4: Optional[int]=57) -> None:
if not v1 == len(v2) ==... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(NDFrame, OpsMixin):
v1 = {'columns', 'index'} | NDFrame._internal_names_set
v2 = 'dataframe'
@property
def v3(self) -> Type[v0]:
return v0
v4: Type[Series] = Series
v5: FrozenSet[str] = NDFrame._hidden_attrs | fro... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = NewType('Node', TreeNode)
```
Input Types: v0
Output Type: bool
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> bool:
(v3, v4) = (float('-inf'), [])
while v4 or v2:
while v2:
v4.append(v2)
... |
Imports:
```python
from functools import cmp_to_key
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import colorbar
import typing
```
Type definitions:
Input Types: Dict, List, List, bool, Optional[str], Optional[float]
Output Type: Any
Dependencies:
```python
def v0(v1: st... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Union[Tuple[np.ndarray, np.ndarray], None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Union[Tuple[np.ndarray, np.ndarray], None]:
if not self.matching_graph.all_edges_have_error_probabilities():
retu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str='w', v4: str='utf-8') -> None:
with open(v1, v3, encoding=v4) as v5:
v5.write(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
with self._open_db() as v2:
v3 = v2.cursor()
v3.execute('\n select count(*)\n from ApiKey\n ... |
Imports:
```python
import inspect
from itertools import chain
import typing
```
Type definitions:
Input Types: Callable
Output Type: Callable
Dependencies:
```python
@functools.wraps(f)
def v0(v1: Any, *v2: Any, **v3: Dict[str, Any]) -> None:
v4 = dict(inspect.signature(v1._old_init).parameters)
v4.pop('args',... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tensor, int
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tensor, v2: int) -> Tensor:
v3 = v1.eq(v2)
v3 = v3.unsqueeze(1).expand(-1, v1.size(1), -1)
return v3.bool()
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray):
try:
v1 = v1.transpose(self.new_axes_order)
except ValueError:
v2 = 'Expected {:} dimensions, but... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: object
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> object:
if type(v1) == str:
return self.pipeline[v1].filter
else:
return v1.filter
``` |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self.items or not self.section_name:
return
v1 = datetime.datetime.now().strftime('%d-%m-%Y %H-%M-%S')
with open(f... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Tuple[str, str]:
v2 = ''
while not v1.startswith(self._nameTagClose):
v2 += v1[:1]
v1 = v1[1:]
v2 = self._correc... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, 'Future(FlowResponse)'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: 'Future(FlowResponse)'):
v3 = self._ue_mac_app.add_ue_mac_flow(v1.sid.id, v1.mac_addr)
v2.set_result(v3)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: th.Tensor, bool
Output Type: Tuple[th.Tensor, th.Tensor, th.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: th.Tensor, v2: bool=False) -> Tuple[th.Tensor, th.Tensor, th.Tensor]:
try:
(v3, v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, Any]:
v1 = self.meta_node
v2: Dict[str, Any] = {}
while v1:
v3 = v1.get_signatures()
v2 = {**v2, **v3}
v1 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3) -> bool:
if self._invalid_name(v2):
return True
if not v3.orig:
return True
return self._is_descriptor(v1, v3)
``... |
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) -> str:
if len(v2) == 0:
v3 = v1
elif len(v1) == 0:
v3 = v2
else:
v3 = v1 + ' ' + v2
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('A')
```
```python
v1 = TypeVar('B')
```
```python
v2 = Union[Tuple['just', v0], Tuple['nothing']]
```
Input Types: v2[v0], dict
Output Type: v1
Dependencies:
Function Name: v3
Function:
```python
def v3(v4: v2[v0], v5: dict) -> v1:
v6: ... |
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):
if v1 == 'double':
for v3 in range(v2):
self.put_double(0.0)
elif v1 == 'int':
for v3 in range(v2):
... |
Imports:
```python
from os import environ
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> Optional[str]:
if 'UTA_DB_URL' in environ:
return environ['UTA_DB_URL']
if not v1 and 'UTA_PASSWORD... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor) -> torch.Tensor:
v2 = self.encoder(v1)
v2 = self.prenet(v2)
v3 = self.vector_quantizer(v2)
return v3
``` |
Imports:
```python
import os
import requests
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str):
v2 = 'https://raw.githubusercontent.com/Sefaria/Sefaria-Export/master/txt/Tanakh/Torah/{}/Hebrew/Tanach%20with%20Text%20Only.txt'.format(v1)
return request... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('LDF', bound='LazyFrame')
```
Input Types: Dict[str, str]
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self: v0, v2: Dict[str, str]) -> v0:
v3 = list(v2.keys())
v4 = list(v2.values())
return self._fr... |
Imports:
```python
import secrets
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict):
v3 = secrets.token_hex(4)
v2 = {**v2, **{'id': v3}}
if self.database.get(v1) is None:
self.database[v1]... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.