text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: sqlite3.Cursor, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: sqlite3.Cursor, v2, v3='default'):
if v3 != 'default':
raise ValueError('Cannot load arbitrary sections from canned data')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict) -> bool:
assert 'master_url' in v1
assert 'master_private_url' in v1
assert 'node_name' in v1
``` |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: int, str, Union[int, float], bool, float, Optional[Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=1024, v2: str=None, v3: Union[int, float]=2, v4: bool... |
Imports:
```python
import json
import re
from pathlib import Path
import requests
import typing
```
Type definitions:
Input Types: Union[str, Path]
Output Type: dict
Dependencies:
```python
def v0(v1: Union[Path, str]) -> dict:
with Path(v1).open('r', encoding='utf-8') as v2:
return json.load(v2)
```
Funct... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: str, str
Output Type: int
Dependencies:
```python
def v0(v1: str, v2: str=DATE_FMT) -> int:
return iso_to_datetime(v1, v2).hour
```
```python
def v3(v4: str, v5: str=DATE_FMT) -> datetime:
return datetime.strptime... |
Imports:
```python
import numpy
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
if self.phi != None:
return self.phi
return 2
return numpy.max([0, v1 - int(numpy.ceil(numpy.log2(v1))) - self.c])... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: List[str]
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str]) -> List[str]:
v2 = []
v3 = 'http://api.geneontology.org/api/'
v4 = v3 + 'bioentity/gene/'
for v5 in v1:
... |
Imports:
```python
import os
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._split_path_var(v1)
v3.append(v2)
self.env[v1] = os.pathsep.join(v3)
``` |
Imports:
```python
import re
import pandas as pd
from datetime import datetime as dt
from io import StringIO
import typing
```
Type definitions:
Input Types: Any
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1):
v2 = v1.find('\n\n')
v3 = v1[v2 + 2:]
v3 = re.sub('\\s+\n', ' \n ', v3)
v3 = re... |
Imports:
```python
import numpy as np
from netCDF4 import Dataset
import typing
```
Type definitions:
Input Types: str, Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2=None) -> np.ndarray:
if v2 is not None and self.ncfile != v2:
self.ncfile = v2
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: list, v2: list, v3: int=0):
"""Creates the bottom layer of the defect.
Args:
x (list): List of x coordinates that make up the base polygon.
y (list): List of y coordinates that... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.lines and (not self.line_has_content):
return
if self.lines and any((not text.isspace() for v1 in self.lines[-1])):
self.line... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> str:
if not self.__account_key:
return False
return self.__account_key.json_dumps()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.load_config('custom_runtimes.yml')
v2 = v1.runtimes()
v3 = {'rust': 0, 'example': 2, 'other_example': 42}
self.assertEqual(v2, v3)
... |
Imports:
```python
import os
from operator import itemgetter
from pathlib import Path
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: List[Dict[str, Any]]
Dependencies:
```python
def v0() -> List[Dict[str, Any]]:
v1: List[str] = ['.DS_Store', '.wh..wh..opq']
v2: Generator[Path, Non... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Tuple[bytes, bytes]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> Tuple[bytes, bytes]:
v2 = self._unpack_response(v1)
(v3, v4) = v2.split(maxsplit=1)
return (v3, v4)
``` |
Imports:
```python
import os
from os import listdir, makedirs
from os.path import join, isfile
import shutil
import numpy as np
import torch
from torch.tensor import Tensor
from torch.utils.data.dataset import Dataset
from torch.utils.data import DataLoader
import typing
```
Type definitions:
Input Types: str, str
Out... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = {}
v3 = self.spotify.search(q=f'artist:{v1}', type='artist')
v4 = v3['artists']['items']
if len(v4) == 0:
raise ValueError
... |
Imports:
```python
from subprocess import run
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = run(v1)
v2.check_returncode()
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray) -> np.ndarray:
(v2, v3) = v1.shape
v4 = v1.sum(0).repeat(v2).reshape(v3, v2).T / v2
v5 = v1.sum(1).repeat(v3)... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Union[bool, None]
Output Type: Union[bool, None]
Dependencies:
```python
def v0() -> Union[bool, None]:
v1 = (_envvar_to_bool('NO_COLOR'), _envvar_to_bool('NBPREVIEW_NO_COLOR'), os.environ.get('TERM', 'smart').lower() == 'dumb')
v2 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, bytes], bytes
Output Type: bytes
Dependencies:
```python
def v0(v1: int, v2: bool=True, v3: bytes=BITCOIN_ALPHABET) -> bytes:
if not v1 and v2:
return v3[0:1]
v4 = b''
while v1:
(v1, v5) = divmod(v1, 58)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: bool) -> List[str]:
if v2:
return list(v1)
return list(v1.strip().replace(' ', ''))
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(BaseRegistry):
def __init__(self) -> None:
super().__init__()
def v1(self, v2: Job, v3: JobRuntimeEnv) -> JobHandle:
v4 = self.get_job_controller(v2)
return v4.submit_job(v2, v3)
def v5(self, v6: Job) -> Job... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('K')
```
```python
v1 = TypeVar('T')
```
Input Types: v0
Output Type: v1
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: v0) -> v1:
v4 = self.lteq_index(v3)
if v4 is None:
return None
return self.item... |
Imports:
```python
from shapely.geometry import Point, MultiPoint, LineString, MultiLineString
from collections import defaultdict
import typing
```
Type definitions:
Input Types: Iterable[LineString], Any
Output Type: Any
Dependencies:
```python
def v0(v1: LineString, v2) -> list:
if v2 <= 0.0:
raise Valu... |
Imports:
```python
from itertools import combinations
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self.is_deterministic():
raise RuntimeError('Automata is non-deterministic')
v1 = set()
for v2 ... |
Imports:
```python
from urllib.parse import urljoin
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[str]=None) -> str:
v2 = 'http://testlocation/'
if v1:
v2 = urljoin(v2, v1)
return v2
``` |
Imports:
```python
import json
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: Dict[str, Path]
```
Input Types: v0
Output Type: Any
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: v0):
self.cfg = v3
for (v4, v5) in self.cfg.project_name_to_discord_username_to_url... |
Imports:
```python
import hashlib
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
v2 = f'{self.seed}{v1}'.encode()
v3 = hashlib.sha1(v2)
v4 = int(v3.hexdigest(), 16) % self.num_buckets
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'StepsPerTime'
Output Type: 'StepsPerTime'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'StepsPerTime') -> 'StepsPerTime':
assert type(self) is type(v1)
return type(self)(steps=self.steps + v1.steps)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.album_name = None
self.artist = None
self.channel = None
self.duration = None
self.image_url = None
self.playlist_name = None
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Union[np.ndarray, List[int]], int, np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[np.ndarray, List[int]], v2: int, v3: np.ndarray) -> np.ndarray:
v4 = v2 - v3
v5 = np... |
Imports:
```python
import getpass
import typing
```
Type definitions:
Input Types: Text, Callable[[Text], Any], Optional[Any], Optional[bool]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Text, v2: Callable[[Text], Any], v3: Optional[Any]=None, v4: Optional[bool]=False) -> Any:
i... |
Imports:
```python
import os
import sys
from tqdm.auto import tqdm
import typing
```
Type definitions:
Input Types: str, Any, int
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: int=60):
if 'google.colab' in sys.modules and os.path.splitext(v1)[-1] == '.mp4' and (os.environ.get('IMAGEIO_FFMPEG_EXE') =... |
Imports:
```python
import os
import os.path
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: List[Tuple[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str) -> List[Tuple[str, str]]:
assert v1 in ['train', 'val', 'test']
if not os.path.isf... |
Imports:
```python
import os
from collections import OrderedDict
from typing import Any, Callable, Dict, Iterable, List, Tuple, Union
import numpy
import typing
```
Type definitions:
Input Types: Union[numpy.ndarray, Dict[str, numpy.ndarray], Iterable[numpy.ndarray]], str, str, int, List[str]
Output Type: Any
Dependen... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any, v2: Any) -> None:
self._idx += 1
with open(self._file_path, 'w') as v3:
v3.write(f'{self._idx}')
``` |
Imports:
```python
import json
import pathlib
import typing
```
Type definitions:
Input Types: Union[str, os.PathLike]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, os.PathLike]) -> None:
v1 = pathlib.Path(v1)
with v1.open('r') as v2:
v3 = json.load(... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Model):
v1: List[str]
v2: List[str]
v3: str
v4: str
v5: str
v6: List[str]
v7: str
def v8(self, v9: List[str]) -> v0:
self.affected_client_ids = v9
return self
def v10(self, v11: List[str]) -> ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v2 = {}
for (v3, v4) in v1.items():
if self.index_based:
v5 = self._index_based_extract(v4)
else:
v5 = s... |
Imports:
```python
import argparse
from argparse import ZERO_OR_MORE, ONE_OR_MORE, ArgumentError, _, _get_action_name, SUPPRESS
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Tuple[argparse.Namespace, List[str]]
Dependencies:
```python
def v0(v1):
v2 = option_string_indices[v1]
(v3, v4,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]):
v2 = f'UPDATE {self.name} SET _deleted = 1 WHERE _doc_id = ?'
self._conn.executemany(v2, v1)
self._conn.commit()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *, v1: str) -> None:
if not self._snapshot_exists(snapshot_name=v1):
return
self._initialize_x_if_not_initialized()
self._x._value = self._x_sn... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for v1 in range(self.rows):
for v2 in range(self.columns):
v3 = self.cells_list[v1][v2].value > 0 and self.cells_list[v1][v2].state =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tx.data.Batch
Output Type: Dict[str, torch.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tx.data.Batch) -> Dict[str, torch.Tensor]:
v2 = self.model(encoder_input=v1.source, decoder_input=v1.target_input, labels=v1.t... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'BaseElement', etree.Element, t.Optional[Path]
Output Type: 'BuilderState'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'BaseElement', v2: etree.Element, v3: t.Optional[Path]=None) -> 'BuilderState':
v4 = str(v1.id) if v1.... |
Imports:
```python
from tensorflow.keras import layers, models, optimizers
from tensorflow.keras.wrappers import scikit_learn
import typing
```
Type definitions:
Input Types: str, float, float, int, float, float, float
Output Type: optimizers.Optimizer
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: st... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str, sphinx.addnodes.desc_signature
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any, v2: str, v3: sphinx.addnodes.desc_signature) -> None:
del name
if self._noindex:
return
v3['ids']... |
Imports:
```python
import logging
import os
import sys
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: str
v2: str
v3: str
```
Input Types: v0
Output Type: Union[str, Tuple[str, str]]
Dependencies:
```python
def v4(v5: str, v6: str, v7: str, v8: str) -> str:
v9 = '/'.join(v6.split... |
Imports:
```python
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types: str
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: types.PathType) -> np.ndarray:
v1 = gpath.GPath(v1)
with v1.open('rb') as v2:
v3 = np.asarray(bytearray(v2.read()), dtype=np.uint8)
v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> str:
v2 = ' '.join(v1).replace('@@ ', '').strip()
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: []
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: []):
if len(v1) == 0:
return False
v2 = len(v1)
for v3 in v1:
if v3 is None or v3 == '':
v2 -= 1
return v2 != 0
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, list, Any
Output Type: list
Dependencies:
```python
def v0(v1: str, v2: list, v3: list, v4):
v5 = False
for (v6, v7) in enumerate(v2):
if v1 not in v7:
v8 = True
for v9 in v3:
if v1 not in ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: Optional[str], Any
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Optional[str], v3: Any) -> v0:
v4 = self._collection.find_one({'_id': v3})
if v4 is None:
self._log... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[Tuple[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[Tuple[str, str]]:
v1 = self.product_info['datastrips']
return [(self.get_datastrip_name(datastrip['id']), f"{self.base_url}/{datastri... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = super().write(v1)
self._stream.write(v1)
return v2
``` |
Imports:
```python
import datetime
import typing
```
Type definitions:
```python
class v0(QStandardItemModel):
v1 = ('일시', '구분', '원천', '상세/이동처', '금액', '설명')
v2 = ('수입', '지출', '이동', '초기')
v3 = [('date', 'uint16'), ('type', 'uint8'), ('src', 'uint8'), ('det', 'uint8'), ('val', 'uint32'), ('desc', '<U64')]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: object, type
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: object, v2: type):
if not isinstance(v1, v2):
raise ValueError("'{}.{}' is not a subclass of {}".format(v1.__class__.__module__, v1.__class... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list:
v1 = [game.to_json() for v2 in self._games.values()]
return v1
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: dict):
v3 = json.dumps(v2)
v4 = open(v1, 'w')
v3 = v4.write(v3)
v4.close()
``` |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: 'list[0] = sentence, list[1]= outcome', 'total unique words in train data'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: 'list[0] = sentence, list[1]= outcome', v2: 'total unique w... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ClientParsing.StringProcessor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ClientParsing.StringProcessor):
v2 = v1.GetProcessingSteps()
self._processing_steps.AddDatas(v2)
self._UpdateControls()
``... |
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 self.tokenizer is not None:
v1 = self.tokenizer.encode(v1)
if self.bpe is not None:
v1 = self.bpe.encode(v1)
return ... |
Imports:
```python
import hashlib
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = f'{self.length}_{self.depth}_{self.p_op}_{self.max_args}_{self.set}_{self.eq_depth}_{self.n_samples}'
if self.custom_vocab:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[Dict[str, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[Dict[str, int]]:
v1 = self.client.get(f'/containers/{self.id}/changes')
v1.raise_for_status()
return v1.json()
``` |
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._definitions.query('name == @name')
if len(v2) > 0:
return v2['retro_reaction'].iloc[0]
else:
raise IOError(f... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, bytes, bytes
Output Type: Any
Dependencies:
```python
def v0(self, v1: bytes, v2: bytes=None, v3: bytes=None):
v4 = self.__Base_AESCCM(v1, v2, Key=v3)
v5 = self.__Keyencryption(v4[0])
v6 = self.__Keyencryption(v4[1])
v7 = self._... |
Imports:
```python
import os
import logging
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
```python
def v0(v1: os.PathLike=None):
if v1 is None:
v1 = os.path.dirname(__VsWherePath())
v2 = os.path.join(v1, 'vswhere.exe')
logging.info('Attempting to download vsw... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, Any
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray, v3=50) -> tuple:
(v4, v5, v6) = v1.shape
v7 = v4 // 10
v8 = v5 // 10
v9... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[int], np.ndarray
Output Type: List[slice]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple[int], v2: np.ndarray) -> List[slice]:
v3 = [min(limit, size) for (v4, v5) in zip(v1, v2.shape)]
return [slice(0, stop) for v6... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: int) -> None:
self.iteration = v1
self.execution = v2
self.__iters_per_epoch = v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
if v1 == 2:
return ':small_blue_diamond:'
elif v1 == 3:
return ':small_orange_diamond:'
return ''
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if not self.lockfile_file.exists():
return False
v1 = str(self.lockfile.get('metadata', {}).get('content_hash', ''))
if not v1:
r... |
Imports:
```python
from math import sqrt, sin, cos, atan2
from math import pi as PI
import typing
```
Type definitions:
Input Types: float
Output Type: Tuple[float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float) -> Tuple[float, float]:
v1 = v1 % 1 * PI * 2
v2 = abs(cos(v1))
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3) -> float:
v4 = -1 if v1 < 0 else 1
return v4 * (int(v1) + float(v2) / 60 + float(v3) / 3600)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> int:
v1 = list(set(v1))
print(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: gpd.GeoDataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: gpd.GeoDataFrame):
v2 = v1.sjoin(self.gdf_region, predicate='within', how='inner')
v3 = v2[list(v1.columns)]
v3 = v3.reset_index(drop=T... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: List[QuantumCircuit]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[QuantumCircuit]:
(v1, v2) = self._template_circuit()
v3 = []
for v4 in self.experiment_options.amplitudes:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self: object) -> int:
v1: int = 0
v2: Node = self.head
while v2:
v1 += 1
v2 = v2.next
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str) -> str:
v3 = v1.find(v2)
if v3 is None:
raise LookupError(f'Tag {v2} not found in element.')
if not hasattr(v3, 'text'):
rai... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
```python
def v0(v1: Any) -> bool:
return hasattr(v1, 'is_internal')
```
Function Name: v2
Function:
```python
def v2(v3: Any) -> bool:
if v0(v3):
return v3.is_internal
return False
``` |
Imports:
```python
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: Tensor, Tensor, Tensor, Tensor, int, float
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tensor, v2: Tensor, v3: Tensor, v4: Tensor, v5: int, v6: float) -> Tensor:
assert ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Namespace
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> Namespace:
v3 = v2.split(' ') if len(v2) > 0 else []
return self._arg_parsers[v1].parse_args(v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: discord.Embed
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> discord.Embed:
v1.add_field(name='Consent Message', value="We're asking for permission to quote you in our research.\n • Yes, you may quote my pos... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Union[List[np.ndarray], np.ndarray], int, int, Optional[int], bool
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: Union[Sequence[np.ndarray], np.ndarray]) -> None:
if any((len(x.shape) != 2 for v2 in v1)):
ra... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Any
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1='config.json') -> dict:
global jsonConfig
with open(v1) as v2:
v3 = json.load(v2)
v4 = v3
return v4
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Union[int, np.ndarray], int
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[int, np.ndarray], v2: int) -> np.ndarray:
if isinstance(v1, int):
v1 = np.array(v1).reshape(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> str:
v2 = v1.__module__.split('.')[-1]
return f'{v2}.{v1.__name__}'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Iterator[Dict[str, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any]) -> Iterator[Dict[str, Any]]:
for v2 in ['samples', 'devices', 'coords', 'angles']:
if v2 not in v1.keys():... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bytes) -> float:
v2 = int.from_bytes(v1, 'little')
return round(1.0 - float(v2 / 255), 2)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[List[T], Set[T]]
```
```python
v1 = TypeVar('T')
```
Input Types: v0, v1
Output Type: v0
Dependencies:
Function Name: v2
Function:
```python
def v2(v3: v0, v4: v1) -> v0:
if isinstance(v3, list):
v3.append(v4)
elif isinstance(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any], v2) -> str:
v3 = 'Fixed'
for v4 in v1['fixed'].items():
v3 += f'_{v4[0].upper()}{v4[1]}'
v3 += '_'
v3 += 'Vari... |
Imports:
```python
from scipy import sparse
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[List, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple[List, int]:
(v1, v2, v3) = self.milp.solve()
v4 = sparse.csr_matrix([v1[i] for v5 in self.idx_z])
return (v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: mitmproxy.flow.Flow
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: mitmproxy.flow.Flow) -> int:
v2 = self._view.bisect_right(v1)
return self._rev(v2 - 1) + 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, bool
Output Type: Any
Dependencies:
```python
def v0(v1: Union[str, list], v2: str=None, v3: Client=None, v4: bool=False, v5: bool=True, v6: bool=True):
v7 = None
v8 = return_files_from_path(v1, in_chunks=True)
for v9 in v8:
... |
Imports:
```python
import matplotlib.pyplot as plt
from matplotlib import colors
from matplotlib.image import AxesImage
from matplotlib.widgets import Slider, Button, TextBox
from matplotlib.lines import Line2D
import matplotlib.patches as patches
import typing
```
Type definitions:
Input Types:
Output Type: None
Dep... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: list[int], v2: int=80) -> int:
v3 = [0 for v4 in range(9)]
for v5 in v1:
v3[v5] += 1
for v6 in range(v2):
v7 = v3[0]
for v8 in range(len(v3) - 1):
v3... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Tuple[str, object], np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple[str, object], v2: np.ndarray) -> np.ndarray:
if type(v2) != np.ndarray:
raise Exception('... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray, v3: int=32):
if v2.shape[0] > v3:
v4 = np.random.choice(range(v2.shape[0]), v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.