text stringlengths 190 325k |
|---|
Imports:
```python
import os
import tempfile
import uuid
import typing
```
Type definitions:
Input Types: str, Optional[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Optional[str]=None) -> str:
v3 = str(uuid.uuid1(clock_seq=os.getpid()))
v2 = v2 if v2 else os.pa... |
Imports:
```python
import csv
import json
import random
import requests
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0() -> str:
return requests.get(api_key_server).text
```
```python
def v1() -> List[Tuple[int, str]]:
v2 = open('./channels.csv', 'r')
v3 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: types.Chat
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: types.Chat):
if not v1:
return
yield ('chat_id', v1.id)
yield ('chat_type', v1.type)
if self.include_content:
yield ('cha... |
Imports:
```python
from datetime import datetime, timezone
import cv2
import typing
```
Type definitions:
Input Types: np.array
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.array) -> np.array:
v2 = cv2.FONT_HERSHEY_COMPLEX_SMALL
(v3, v4, v5) = v1.shape
cv2.... |
Imports:
```python
import numpy as np
import warnings
import typing
```
Type definitions:
Input Types: int, int, Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: Any=None) -> np.ndarray:
if self.poles is None:
warnings.warn('Returning a zer... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: list[str | None]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> list[str | None]:
v2 = [idx.strip() for v3 in v1.split(',')]
return [i if i != ':' else None for v4 in v2]
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1):
self.val = v1
self.next = None
```
Input Types: v0, v0
Output Type: v0
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: v0, v4: v0) -> v0:
(v5, v6) = (0, 0)
v7 = v3
wh... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: int, int
Output Type: List[str]
Dependencies:
```python
def v0() -> Dict[str, str]:
v1 = {}
with open(WORD_LIST) as v2:
v3 = v2.readline()
while v3 != None and v3 != '':
(v4, v5) = v3.split()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if not self.lines:
return False
self._selected_row += self.height
if self._selected_row > len(self.lines) - 1:
self._selected_row... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> str:
v2 = True
v3 = ''
for v4 in range(v1):
if not v2:
v3 += ', '
else:
v2 = False
v3 += '(%s, %s)... |
Imports:
```python
import os
import tempfile
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
```python
def v0(v1=False) -> str:
v2 = tempfile.gettempdir()
v3 = os.path.join(v2, 'lciafmt')
if v1:
os.makedirs(v3, exist_ok=True)
return v3
```
```python
def v4(v... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: master_controller.DeviceServer, argparse.Namespace
Output Type: None
Dependencies:
```python
async def v0(v1: argparse.Namespace, v2: master_controller.DeviceServer) -> aiohttp.web.AppRunner:
v3 = web.make_app(v2, (v1.host, v1.http_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self.fcLabel['text'] = v1
return None
``` |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: str
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> tf.Tensor:
if len(self._input_image_size) == 2:
v2 = tf.image.decode_image(v1, channels=self._num_channels)
... |
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 = ''
for v3 in range(0, len(v1), 5):
v2 += self.crockford_base[int(v1[v3:v3 + 5], base=2)]
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list:
v1 = self.source_data['sub_table']
v2 = [i for v3 in v1]
return v2
``` |
Imports:
```python
import uuid
import datetime
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='', v2=ID_SEPARATOR):
if v1:
v1 = f'-{v1}'
return f'storm-{self.submit_method}-{self.hostname}{v2}{datetime... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: int, v4: int) -> int:
(v5, v6) = (0, v3)
while v6 <= v4:
v7 = (v2 & 1 << v5) >> v5
if v7 == 0:
... |
Imports:
```python
from cvxpy import Minimize, Problem, Parameter, Maximize
from cvxpy.atoms import QuadForm, abs, power, quad_over_lin, sum, sum_squares, norm, huber, matrix_frac
from cvxpy.reductions.solvers.defines import QP_SOLVERS, INSTALLED_SOLVERS
from cvxpy.expressions.variable import Variable
from cvxpy.tests.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: str):
if await self.getConfiguration(v1) != None:
await self.bot.db.execute(f"UPDATE {self.CONFIG_TABLE} SET value = ($1) WHERE ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict[str, Any]
Output Type: BrokerSubscriberBuilder
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict[str, Any]) -> BrokerSubscriberBuilder:
self.impl_builder.with_kwargs(v1)
self.queue_builder.with_kwargs(v1)
retu... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0(Generic[T]):
v1: T
v2: int
```
Input Types: v0, str, int
Output Type: None
Dependencies:
Function Name: v3
Function:
```python
def v3(v4: v0, v5: str, v6: int) -> None:
v7 = v4.num_characters < 0 or v4.num_characters > len... |
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 self.map:
v3 = self.distToAllCoords(v2)
if v3 < 10000:
v1 += 1
return v1
``` |
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 = '<ac:structured-macro ac:macro-id="0" ac:name="anchor" ac:schema-version="1"><ac:parameter ac:name="">{name}</ac:parameter></ac:structured... |
Imports:
```python
from copy import copy
import typing
```
Type definitions:
Input Types: str
Output Type: List[Dict[str, Any]]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str) -> List[Dict[str, Any]]:
v2 = copy(self.var_default)
v2['commit'] = v1
return await self.api.getit... |
Imports:
```python
import numpy as np
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._kernel(self.Xb, np.atleast_2d(v1))
v3 = v2.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
if v1 % 10 not in [1, 3, 7, 9]:
return -1
v2 = 0
v3 = 0
while True:
v3 = v3 * 10 + 1
if v3 % v1 == 0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path):
v2 = list(v1.glob('*/encoder.pt'))
if len(v2) == 0:
raise Exception('No encoder models found in %s' % v1)
self.repopulate_box(self.e... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
```python
def v0(v1, v2, v3, v4, v5):
v6 = dict()
v6['transform'] = 'Random Crop'
v6['Transformed_image_Np_Array_Format'] = v1
v6['x1'] = v2
v6['y1'] = v3
v6['crop_width']... |
Imports:
```python
import argparse
import collections
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
```python
def v0(v1: str) -> None:
v2 = [int(part) for v3 in v1.strip().split(',')]
v4 = collections.defaultdict(int, enumerate(v2))
v5 = 'NOT A T\nOR T J\nNOT B T\nOR T J\... |
Imports:
```python
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
from matplotlib.axes import Axes
from matplotlib.colors import Colormap
import typing
```
Type definitions:
Input Types: Axes, pd.DataFrame, Union[str, int, np.ndarray, Sequence[Union[int, float]]], Colormap
Output Type: Ax... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: int, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int=200, v2: str='', v3: str='') -> None:
for v4 in self.connections:
await v4.websocket.send_json({'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor) -> bool:
if v1.dim() == 2:
if v1.size()[1] == 1:
return True
return False
``` |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = argparse.ArgumentParser(description='Delete files from a list of categorised files')
v2.add_argument('-i', '--input', type=str, d... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
```python
def v0(v1: str, **v2) -> None:
if settings.PRINT_DEBUG_DB:
v3 = ', '.join([f'{k}={v}' for (v4, v5) in v2.items()])
print(f'+ {v1}({v3})')
```
```python
async def v6() -> bool:
... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types:
Output Type: Path
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Path:
v1 = Path().resolve()
v2 = Path(v1.root)
while v1 != v2:
v3 = v1 / 'Cargo.toml'
if v3.is_file():
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: NodeValue, v2: Optional['Node']=None, v3: Optional['Node']=None) -> None:
self.value = self.val = v1
self.left = v2
self.right = v3
def __repr__(self) -> str:
"""Return the string ... |
Imports:
```python
from pymatgen.analysis.adsorption import AdsorbateSiteFinder
from pymatgen.core import Lattice, Site, Structure
from pymatgen.core.sites import PeriodicSite
from pymatgen.core.surface import Slab
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
import typing
```
Type definitions:
Input Type... |
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 v1 or not v1.startswith('key://'):
return v1
v2 = self.resolveKeyPath(v1)
if not v2:
raise KeyError('{} could no... |
Imports:
```python
import datetime as dt
import typing
```
Type definitions:
Input Types: dt.datetime
Output Type: Any
Dependencies:
```python
def v0(v1: dt.datetime):
v2 = timezone_syd.localize(v1)
v3 = v2.astimezone(tz=pytz.utc)
return v3
```
```python
def v4(v5: dt.datetime):
v6 = v5.astimezone(time... |
Imports:
```python
from pandas._libs import internals as libinternals, lib
from pandas._libs.internals import BlockPlacement
from pandas._typing import ArrayLike, Dtype, DtypeObj, Shape
from pandas.errors import PerformanceWarning
from pandas.util._validators import validate_bool_kwarg
from pandas.core.dtypes.cast impo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = self.schemize({'config_type': 'author', '__author__': v1})
self.col.update_one({'config_type': 'author'}, {'$set': v2}, upsert=True)
``` |
Imports:
```python
from astropy import time
from astropy.coordinates import Angle
from astropy.table import Table
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Table
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: Table):
v3 = np.searchsorted(v2['hip_... |
Imports:
```python
from sqlite3.dbapi2 import IntegrityError
import sqlite3 as sql
import typing
```
Type definitions:
Input Types: type, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: type, v2: int):
with sql.connect(getattr(v1, 'db_path')) as v3:
v4: sql.Cursor = v3.... |
Imports:
```python
from sklearn.neural_network import MLPClassifier
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import roc_auc_score, roc_curve
import typing
```
Type definitions:
Input Types: pd.DataFrame, str, [str]
Output Type: Any... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if self._properties is not None:
if v1 in self._data_properties:
return self._data_properties[v1]
return None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Text, Optional[List[Dict[Text, Text]]], int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Text=None, v2: Optional[List[Dict[Text, Text]]]=None, v3: int=10):
if v1 == None and v2 == None:
raise Excep... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types:
Output Type: pd.Series
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> pd.Series:
v1 = self._check_fillna(self._roc)
return pd.Series(v1, name='roc')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'BaseStrategy'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'BaseStrategy', **v2):
self.storage_policy.update(v1, **v2)
v1.adapted_dataset = self.storage_policy.buffer
``` |
Imports:
```python
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types: List[np.ndarray], (int, int)
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[np.ndarray], v2: (int, int)) -> np.ndarray:
v3 = v2[0] * v2[1]
assert len(v1) <= v3, f"len(... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: int, int, bool, bool
Output Type: Callable[[int], float]
Dependencies:
```python
def v0(v1: int) -> float:
if v1 < warmup_steps:
return float(v1) / float(max(1, warmup_steps))
if not (cosine or linear):
return 1.0
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = List[LoadContext]
```
Input Types: v0
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0) -> v0:
if not v2:
return v2
v3 = set((item.name for v4 in v2 if v4.line == 0))
for v5 in set(v3):
fo... |
Imports:
```python
from typing import TYPE_CHECKING, Any, AsyncIterator, Callable, Dict, ForwardRef, Generic, Iterable, Iterator, List, Literal, Mapping, Optional, Protocol, Sequence, Tuple, Type, TypeVar, Union, overload
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
```python
v1 = Union[Iterator[... |
Imports:
```python
import json
from typing import Dict, Any, List, Tuple, Optional, Union, cast
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 = self._call('retrieve')
return cast(... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
for v1 in self.player.hands:
if v1.is_over is False and v1.surrender is False:
return False
return True
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.nn.Module
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.nn.Module) -> str:
if self.submodule_paths:
v2 = self.submodule_paths.get(v1)
if v2 is None:
raise NameError('... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], int
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2: int) -> List[int]:
v3 = len(v1)
for v4 in range(v3):
v5 = v4 + 1
v6 = v3 - 1
while v5 <= v6:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[int, str]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[int, str]) -> int:
v2 = self.to_Z(v1)
if v2 <= 2:
return 1
elif v2 <= 10:
return 2
elif v2 <= 18:
retu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Any) -> None:
if v1 in self._event_handlers:
for v3 in self._event_handlers[v1]:
v3(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='normal_', *v2, **v3) -> None:
for v4 in self.parameters():
exec('torch.nn.init.{}(parameters, *args, **kwargs)'.format(v1))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[str, Dict[str, str]]
Dependencies:
```python
def v0(v1: str) -> Dict[str, str]:
return {x.strip().lower(): y.strip().lower() for (v2, v3) in [z.split(':', 1) for v4 in v1.split(';') if ':' in v4]}
```
Function Name: v5
Functi... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(StrEnum):
v1 = 'database'
v2 = 'schema'
v3 = 'identifier'
```
Input Types: v0, str
Output Type: bool
Dependencies:
Function Name: v4
Function:
```python
def v4(self, v5: v0, v6: str) -> bool:
if self.dbt_created and self.quote_po... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bool:
v2 = '^[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+){0,4}@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+){0,4}$'
if re.match(v2, v1) is None:
return Fa... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.ndarray, v3: np.ndarray) -> np.ndarray:
v4 = v1.shape[0]
v5 = np.ones(shape=(v4, 1... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, np.ndarray, float
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.ndarray, v3: np.ndarray, v4: float) -> np.ndarray:
if v1.shape != v2.shape:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
v2 = len(v1)
v3 = 1 + v2 // 2
v4 = 1
while v4 < v3:
if v1[:v4] * (v2 // v4) == v1:
return True
v4 += ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Delayed], int, List[Delayed], Dict[Tuple[int, int], Delayed], Dict[Tuple[int, int], Delayed], Dict[Tuple[int, int], Delayed], List[Delayed], Optional[List[Delayed]]
Output Type: Tuple[Delayed, Delayed, Delayed]
Dependencies:
Function Name: v0
Fu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1, v2: int):
if self.change_worker:
await self.change_worker.put((v1, v2))
return
async with self.create_client() as v3:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[bool]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[bool]):
if v2 or self._is_sis_course_id:
return 'sis_course_id:{}'.format(v1)
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: tuple[bytes, tuple[str, int]]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> tuple[bytes, tuple[str, int]]:
if self._queue.empty() and self._closed:
raise IOError('Enpoint is closed')
(v1, v2) ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[float]
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[float]) -> float:
if len(v1) != 2:
raise Exception('Length of array must be equal 2 - formula requires 2 params')
return ((v1[1] - v1[0... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple['np.ndarray', 'np.ndarray']
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple['np.ndarray', 'np.ndarray']):
(v2, v3) = (self.NETWORK.forwardPass(v1[0]), v1[1])
(v4, v5) = self.NETWORK.LOSS_FUNCT... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: types.Flow
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> types.Flow:
v3 = self.get_flows_map(agent_id=v2, reverse=True)
if v1 in v3:
v4 = v3[v1]
else:
raise Val... |
Imports:
```python
import copy
import astropy.coordinates as coord
import astropy.units as u
import numpy as np
from astropy.utils.decorators import lazyproperty
import typing
```
Type definitions:
Input Types: T.Dict[str, T.Any], T.Union[type(Ellipsis), T.Sequence, slice]
Output Type: Any
Dependencies:
Function Name... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1: Message
v2: Dict[str, Any]
def __init__(self, v3: Message, v4: Dict[str, Any]):
self.message = v3
self._metadata = {}
for v5 in v4:
self._metadata = {**self._metadata, **v4[v5]}
def v6(se... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
v0 = Dict[Location, str]
```
Input Types: Any, Any
Output Type: v0
Dependencies:
```python
def v1(v2, v3, v4, v5):
v6 = False
v7 = False
if v2 % 2 == 1 and v4 == 2 * v2:
v6 = True
if v3 % 2 == 1 and v5 == 2 * v3:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
v2 = {}
for v3 in range(len(v1)):
v4 = v1[v3]
if v4 in v2:
v2[v4][1] += 1
else:
v2[v4] = [v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
v2 = 0
v3 = len(v1) - 1
if v3 == -1:
return True
while v2 < v3:
if not v1[v2].isalpha() and (not v1[v2].isnumeric... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if any(self._splittable_variables):
return True
else:
return len(self.splittable_variables()) > 0
``` |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[str, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Dict[str, float]:
with open(v1, 'r') as v2:
return json.load(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[float]
Output Type: Optional[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[float]) -> Optional[float]:
if v1 is None:
return None
return -463.37 + 668.72 * v1 - 205.35 * (v1 * v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: typing.Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> typing.Dict[str, str]:
v2 = {}
for (v3, v4) in self.schema.fields.items():
if v4.required and (v3 not in v1 or not v... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float, float
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float=0.05, v2: float=0.9) -> bool:
v3 = self.get_confined_power() < v1
v4 = np.real(self.neff) / np.abs(self.neff) < v2
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
v2 = self.keys[v1]
v3 = self.last_generated_index - v2.child_index()
if self.gap_limit - v3 > 0:
for v4 in range(self.gap_lim... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._set_position()
self.__action._start_action()
``` |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: List['Assignment'], List['Assignment']
Output Type: float
Dependencies:
```python
def v0(v1: int, v2: int, v3: bool=False) -> float:
if v1 == 0:
return math.inf
v4 = v1 / (v1 + v2)
if v3:
v4 += 1e-12
return ... |
Imports:
```python
import ssl
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> None:
v1.cfg.ssl_version = ssl.PROTOCOL_TLS_CLIENT
v1.cfg.cert_reqs = ssl.CERT_OPTIONAL
v1.cfg.certfile = v2
v1.cfg.keyfile = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Any
Dependencies:
```python
def v0(v1):
if v1.__name__ in self._functions:
raise ValueError(f'{v1.__name__} already in registry')
else:
self._functions[v1.__name__] = v1
for v2 in tags:
v2 = v... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.ndarray) -> np.ndarray:
(v3, v4) = v1.shape
if v2.shape != (v3, v3, v4, v4):
raise Val... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
for (v2, v3) in self.macrons_to_vowels.items():
v1 = re.sub(v2, v3, v1)
return v1
``` |
Imports:
```python
import matplotlib
import matplotlib.cm as cmx
import matplotlib.colors as colors
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: list, np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: np.ndarray):
plt.figure()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
```python
def v0(v1: int, v2: int) -> tuple[int, int, int]:
if v1 == 0:
return (v2, 0, 1)
else:
(v3, v4, v5) = v0(v2 % v1, v1)
return (v3, v5 - v2 // v1 * v4, v4)
```
```python
de... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v1 = v1.split(' ')
v2 = []
v3 = []
for v4 in v1:
if len(v4) > 8 or len(v4) < 8:
return print('Not a valid binary address.')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, str, Optional[str], Optional[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int, v3: str, v4: Optional[str], v5: Optional[str]):
assert 0 < v2 <= 5000
assert v3 in ('1m', '5m', '1... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = 0
v2 = None
v3 = None
def __init__(self, v4):
self.val = v4
self.left = None
self.right = None
```
Input Types: v0, list
Output Type: Any
Dependencies:
Function Name: v5
Function:
```python
def v5(s... |
Imports:
```python
import zipfile
import typing
```
Type definitions:
Input Types: Path
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path) -> None:
with zipfile.ZipFile(v1) as v2:
v3 = v2.read('zipfile_sample2.txt').decode('utf-8')
assert v3 == 'eiusmod tempor incid... |
Imports:
```python
import typing
```
Type definitions:
Input Types: event_bus.EventBus
Output Type: Any
Dependencies:
```python
def v0():
return 1
```
Function Name: v1
Function:
```python
def v1(v2: event_bus.EventBus):
def v3():
pass
v2.subscribe('test-channel', v3)
v4 = v2.listeners['test-c... |
Imports:
```python
from ast import unparse
from ast import AnnAssign, Assign, AsyncFunctionDef, FunctionDef, Import, ImportFrom
from ast import parse as ast_parse
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: List) -> bool:
for v2 in v1:
if v2.name =... |
Imports:
```python
import torch
from torch.utils.data import Dataset
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='cpu'):
try:
del self.data
except AttributeError:
pass
self.data = torch.flatt... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> bool:
if isinstance(v1, (list, tuple)):
if any([isinstance(_, (list, tuple)) for v2 in v1]):
return True
else:
re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.