text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
try:
v2 = open(v1, 'r')
v3 = v2.read()
v2.close()
except Exception as e:
v3 = ''
return v3
``` |
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:
assert type(v2) is str and type(v1) is str, 'name variables must be str and a valid parameter map name.'
self.values[v2] = ... |
Imports:
```python
import warnings
from qiskit import circuit
from qiskit.circuit.library import standard_gates as gates
from qiskit.circuit.parameterexpression import ParameterExpression, ParameterValueType
from qiskit.pulse import channels as chans, configuration, exceptions, instructions, macros, library, transforms... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list:
v1 = list(range(10))
random.shuffle(v1)
return v1[:self.N]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = None
for v3 in ['.zip', '.tar.gz', 'tar']:
if v1.endswith(v3):
v2 = v1[:-len(v3)]
return v2
``` |
Imports:
```python
import requests
from requests.auth import HTTPBasicAuth
import typing
```
Type definitions:
Input Types: Optional[Dict[Any, Any]]
Output Type: requests.Session
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[Dict[Any, Any]]=None) -> requests.Session:
v2 = requests.... |
Imports:
```python
from math import sqrt
import torch
import typing
```
Type definitions:
Input Types: int, float, bool
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1: torch.Tensor) -> torch.Tensor:
if torch.abs(v1) < 3.75:
v2 = v1 / 3.75 * (v1 / 3.75)
return 1.0 + v2 * (3.5156229 + v2... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: dict, dict
Output Type: dict
Dependencies:
```python
def v0(v1: dict) -> Dict[str, str]:
v2 = dict()
for v3 in v1['raw_meta'].split(','):
if '=' in v3:
(v4, v5) = v3.split('=', maxsplit=1)
v5 = v5... |
Imports:
```python
from selenium.common.exceptions import TimeoutException
from selenium.webdriver import ActionChains
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.common.by import By
from selenium.webdriver.common.html5.application_cache import ApplicationCache
from selenium.webdriver.comm... |
Imports:
```python
import sympy as sp
import re
import typing
```
Type definitions:
Input Types: str, bool
Output Type: list
Dependencies:
```python
def v0(v1: str, v2: bool=False) -> sp.Function:
try:
if '^' in v1:
raise SyntaxError
else:
return sp.parse_expr(v1)
except... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[np.ndarray]
Dependencies:
```python
def v0() -> Tuple[np.ndarray]:
v1 = np.array([[241.48, 6.41, 0.09], [240.98, 6.15, 0.09], [240.48, 6.2, 0.09], [239.98, 5.81, 0.09], [239.48, 5.64, 0.09], [238.48, 5.38, 0.... |
Imports:
```python
from sympy.utilities.iterables import multiset_permutations
import typing
```
Type definitions:
Input Types: nx.Graph, list, float, float
Output Type: float
Dependencies:
```python
def v0(v1: nx.Graph, v2: float=5, v3: float=0.0) -> BaseGaussianState:
v4 = v1.order()
v5 = nx.to_numpy_array(v... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Any
Dependencies:
```python
def v0(v1: str):
@router.get(f'/{v1.upper()}', include_in_schema=False)
def v2(v3: Request):
v4 = pd.read_csv(f'./assets/{v1}.csv')
v5 = v4.to_html(classes... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame):
v1['close_chg'] = 0.0
v2 = v1.Close.to_numpy()
v3 = (v2[1:] - v2[:-1]) / v2[:-1]
v1.loc[v1.index[1:], 'close_chg'] = v3
v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.names = {}
self.data = []
self.size = 12
``` |
Imports:
```python
from scipy.stats import norm
from scipy.spatial.distance import cdist
from numpy import array as np_array
from numpy import ndarray as np_ndarray
from numpy import empty as np_empty
from numpy import zeros as np_zeros
from numpy import uint32 as np_uint32
from numpy import float64 as np_float64
from ... |
Imports:
```python
import json
import requests
import typing
```
Type definitions:
Input Types: str, Dict
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Dict) -> Dict:
v3 = requests.post(f'{self.base_url}{v1}', json=v2, headers=self.headers)
return json.loads(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: Dict[str, Union[int, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> Dict[str, Union[int, str]]:
if '?notFound=' in v1.url:
v2 = v1.url[v1.url.index('?notFound='):]
self.logger.warnin... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributed as dist
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, 'Environment', T.Optional[T.List[str]], T.Optional[T.List['Dependency']]
Output Type: T.Tuple[bool, bool]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str, v4: 'Environment', *, v5: T.Optional[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> dict:
v2 = {}
if hasattr(self, 'email') and self.email:
v2['email'] = str(self.email)
elif v1:
v2['email'] = str()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, discord.Interaction
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1, v2, v3: discord.Interaction):
for v4 in v1.children:
v4.disabled = True
await v3.response.edit_message(view=v1)
v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bytes:
with self._buffer_lock:
v2 = self._buffer[:v1]
self._buffer = self._buffer[v1:]
if self._max_read_size != -1:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], str
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: Dict[str, Any], v3: Dict[str, Any]) -> None:
v4 = v2['type']
v5 = v2['display_recipient']
v6 = v2.get('subject')
v7 = get_user_profile_by_id(v1)
v8 =... |
Imports:
```python
import sqlite3
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
if self.on:
if self.exp_num is None or self.experiment is None:
raise sqlite3.OperationalError('Experiment not st... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if isinstance(self._DetectTarget, str):
if self._DetectTarget in v1:
return True
return False
elif isinstance(self._De... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: v1.Request
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: v1.Request) -> List[str]:
print('HIGHLIGHT in EventViewSet _parse_order_by')
v2 = v1.GET.get('orderBy')
return ['-timestamp... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.next.start(self.initial_characteristics)
v1 = list()
while self.next.needs_more():
v1.append(self.executor.submit(self.next.accept, ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Model):
v1: str
v2: str
v3: str
v4: str
v5: str
v6: str
v7: str
v8: str
v9: str
def v10(self, v11: str) -> v0:
self.id_ = v11
return self
def v12(self, v13: str) -> v0:
self.at... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: typing.Optional[UserInterface.MenuItemState]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> typing.Optional[UserInterface.MenuItemState]:
v2 = self.focus_widget
if v2:
v3 = v2._get_menu_i... |
Imports:
```python
import typing
```
Type definitions:
Input Types: nx.Graph
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: nx.Graph):
for (v2, v3) in enumerate(v1.adjacency()):
self.node_trace['marker']['color'] += tuple([len(v3[1])])
for (v2, v3) in enumerate(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Knowledge'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: 'Knowledge'):
if self.requirement != None:
await self.requirement.start(v1)
if self.action != None:
await self.action.star... |
Imports:
```python
import warnings
import numpy as np
from pandas._libs.indexing import NDFrameIndexerBase
from pandas._libs.lib import item_from_zerodim
from pandas.errors import AbstractMethodError, InvalidIndexError
from pandas.util._decorators import doc
from pandas.util._exceptions import find_stack_level
from pan... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: bool):
v3 = 0
v4 = 0
v5 = []
if v2 == False:
v3 = 1
v1.pop(0)
for v6 in v1:
v7 = np.re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str], Optional[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str]=None, v2: Optional[str]=None) -> None:
if v1 is not None:
self.fg = v1 or None
if v2 is not None:
... |
Imports:
```python
import logging
import numpy as np
import typing
```
Type definitions:
Input Types: pd.Series, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.Series, v2):
if v1.hasnans and v2 == np.int32:
logging.error('Cannot convert a pandas Series object to an ... |
Imports:
```python
from typing import Any, Callable, DefaultDict, Dict, FrozenSet, Iterable, List, Set, Tuple, TypeVar, Union
import typing
```
Type definitions:
```python
class v0(TypedDict, total=False):
v1: int
v2: int
v3: str
v4: int
v5: int
v6: str
v7: str
v8: List[str]
v9: bool... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str='xml') -> str:
if v1 == 'xml':
return ' <stix:Threat_Actors>\n'
return '"threat_actors": ['
``` |
Imports:
```python
import numpy as np
from numpy.lib.stride_tricks import as_strided
import scipy
import typing
```
Type definitions:
Input Types: jnp.ndarray, utils.FloatArray, jnp.ndarray
Output Type: jnp.ndarray
Dependencies:
```python
def v0(v1, v2):
v2 = v2.reshape(x0_shape)
v3 = np.apply_along_axis(self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterator
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterator) -> list:
v2 = []
v3 = iter(v1)
try:
v4 = next(v3)
except StopIteration:
return v2
v2.append(v4)
for v5 in v3:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
if self.tmp_match is None or self.tmp_match_rank is None:
return True
return self.candidates_rank[v1] < self.tmp_match_rank
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Callable[[str], Any], str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Callable[[str], Any], v3: str) -> None:
self.print_(f'{v1} Type y to confirm.')
self.set_input('')
self.confirm... |
Imports:
```python
import requests
from requests.exceptions import InvalidURL, ReadTimeout, HTTPError, ConnectTimeout
import typing
```
Type definitions:
```python
v0 = list[Tag]
```
Input Types: str
Output Type: v0
Dependencies:
```python
def v1(v2: BeautifulSoup):
if v2.body.div.find('div', {'class': 'shrug space... |
Imports:
```python
import typing
```
Type definitions:
Input Types: falcon.Request, falcon.Response
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: falcon.Request, v2: falcon.Response) -> None:
v3: str = v1.get_param('key')
v4: str = v1.get_param('value')
v2.body = f... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.arr_status_name = pd.Series(['status_idle', 'status_compressor_on', 'status_freecool_on', 'status_heater_on'])
self.dict_ind... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[str]):
self.file.writelines(v1)
self.file.truncate()
self.file.seek(0)
``` |
Imports:
```python
import math
import numpy as np
import typing
```
Type definitions:
Input Types: Iterable[Tuple[float, any]]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[Tuple[float, any]]) -> None:
v1 = sorted(v1, key=lambda evaluation: evaluation[0], reverse=... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2: str) -> int:
for v3 in v1:
if v3['id'] > 0 and self.__contains(v3, v2):
return v3['id']
return 0
``` |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> None:
v2 = {0: logging.WARNING, 1: logging.INFO, 2: logging.DEBUG}
assert v1 >= 0
logging.basicConfig(level=v2.get(v1, logging.DEB... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: Any
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> dict:
v2 = json.loads(v1)
v3 = v2.get('stream', None)
if v3:
v4 = v2['data']['bids']
v5 = v2['data']['asks']
... |
Imports:
```python
import tensorflow.compat.v1 as tf
import typing
```
Type definitions:
```python
v0 = Dict[str, tf.Tensor]
```
Input Types: bytes, protein_features.FeaturesMetadata, Optional[str]
Output Type: Dict[str, tf.train.Feature]
Dependencies:
```python
def v1(v2: tf.Tensor) -> tf.Tensor:
return tf.reshape... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if self.quantity > 0:
self.__quantity -= 1
return True
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
```python
def v0(v1: list, v2: list):
v3 = v2.copy()
for v4 in range(5):
if v1[v4] != v3[v4]:
v3[v4] = '-'
return v1 == v3
```
Function Name: v5
Function:
```python
def v5(v6: list):
... |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: datetime.date
Output Type: datetime.date
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: datetime.date) -> datetime.date:
if isinstance(v1, datetime.datetime):
return v1.replace(day=1).date()
return v1.r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], List[Dict[str, Any]], int, str, Tuple[float, float], Callable
Output Type: Dict[str, Any]
Dependencies:
```python
def v0(v1: int, v2: Tuple[float, float], v3: Tuple[float, float], v4: Tuple[int, int], v5: Tuple[int, int], v6: Tuple[flo... |
Imports:
```python
import sqlite3
import typing
```
Type definitions:
Input Types: str, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2=tuple()) -> bool:
try:
self.cursor.execute(v1, v2)
self.conn.commit()
return True
except sqlite3.Er... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = v1[6:].strip(' ')[:-1]
if v2.isdigit():
return v2
``` |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0() -> None:
print('\nOrderly shutdown of program via exit_program()')
print('Please ignore any messages now generated by main/pyboard/etc detection code....')
input('leaving main(... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.is_static = True
self._freeze_sets()
self.all_states = False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict):
v2: TaskState
return {v2._key: value for (v2, v3) in v1.items()}
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: int, v2: str, v3: str, v4: str, v5: bool=True, v6: str=None, v7: str=None):
self.book_number_: int = int(v1)
self.short_name_: str = v2
self.long_name_: str = v3
self.book_color_: str =... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[Any]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[Any]) -> None:
v2 = self.get_sequence(v1)
for v3 in v2:
self.add_value(v3)
self.__reset_buffer__()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Any, tuple
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='输入:', v2: str='', v3=None, v4: tuple=None) -> str:
v5 = ''
try:
v6 = ''
while not v6 or str.isspace(v6):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str, str, int, bool
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: str='illust', v3: str='for_ios', v4: int=None, v5: bool=True) -> dict:
(v6, v7) = self.api.user_illusts
v8 = self.s... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: PathLike
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: PathLike) -> int:
v2 = 0
with open(v1, encoding='utf-8') as v3:
for v4 in v3:
v2 += len(re.findall('{.*?}', v4))
return... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any, v2: str) -> Any:
v3 = getattr(v1, v2, None)
if callable(v3):
return v3
return None
``` |
Imports:
```python
import os
import logging
import typing
```
Type definitions:
Input Types: str, str, List[str], bool, bool
Output Type: List[Dict[str, str]]
Dependencies:
```python
def v0(v1, v2, v3):
v4 = os.path.join(os.path.dirname(__file__), CORPUS_FILE)
v5 = CypherLetterMap()
v6 = pymongo.MongoClien... |
Imports:
```python
import numpy as np
import numpy.typing as npt
from scipy.optimize import linear_sum_assignment
import typing
```
Type definitions:
Input Types: List[Any], List[Any], Callable[[Any, Any], float], float
Output Type: List[Tuple[Any, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
del self.model
del self.optimizer
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = {'names': list(self.names)}
return v1
``` |
Imports:
```python
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]:
v1 = v1[::-1]
return v1
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if not os.path.exists(v1):
self._logger.warning('Attempted to add {0} which does not exist.'.format(v1))
if v1 not in s... |
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):
(v1, v2) = self.size()
self._lineEdit.setGeometry(1, 0, v1 - 4, v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, bool
Output Type: str
Dependencies:
```python
def v0(v1: torch.device):
if isinstance(v1, str):
return v1
(v2, v3) = (v1.type, v1.index)
if v2 == 'cpu':
return v2
return v2.replace('cuda', 'gpu') + (':' + ... |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = argparse.ArgumentParser(description=v1)
v2.add_argument('-v', '--version', action='store_true', help='TMPlayer version')
return... |
Imports:
```python
import random
import math
import typing
```
Type definitions:
Input Types: float
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float=0.01) -> None:
for v2 in range(self.directions_size):
if random.random() < v1:
self.directions[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:
v2 = 0
for v3 in range(1, v1):
for v4 in range(v3 + 1, v1):
v5 = (v3 ** 2 + v4 ** 2) ** 0.5
if 1 <= v5 <= v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = 0
for v2 in self.c_range_by_age_and_sex:
v3 = [agent for v4 in self.schedule.agents if v2[0][1] < v4.age <= v2[1][0] and v4.gender_is_ma... |
Imports:
```python
import datetime
import os
import os.path as path
from os import PathLike
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str):
with self._get_fs() as v3:
v4 = path.join(self._bucket_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: path.Path
Output Type: 'PrensorValue'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: path.Path) -> 'PrensorValue':
v2 = self.get_descendant(v1)
if v2 is None:
raise ValueError('Missing path: {}'.format(str(v1)))
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: list[list[int]]) -> None:
self.grid = v1
def v2(v3: int, v4: int) -> Generator[tuple[int, int, int], None, None]:
for (v5, v6) in ((-1, 0), (+1, 0), (0, -1), (0, +1)):
(v7,... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: bytes
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1: bytes) -> str:
try:
v2 = jws.verify(v1, SIG_VERIFICATION_KEY, algorithms='RS256')
return v2.decode()
except Exception as err:
return... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Dict]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[Dict]) -> None:
if not self._check_if_table_exists():
self.keys = self.keys or list(set((k for v2 in v1 for v3 in v2.keys())))
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: Any
Dependencies:
```python
def v0(v1: np.ndarray, v2: np.ndarray):
return v1 - v2
```
```python
def v3(v4: np.ndarray, v5: np.ndarray):
return np.mean(np.abs(v0(v4, v5)))
```
```python
de... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
```python
def v0(v1):
nonlocal count
visited[v1[0], v1[1]] = True
for v2 in col_stones[v1[0]]:
if not visited[v2[0], v2[1]]:
v0(v2)
v3 +... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: str
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> tuple:
v2 = v1.split(':')
(v3, v4) = (int(v2[0]), int(v2[1]))
v5 = datetime.now()
v6 = v5.year
v7 = v5.mon... |
Imports:
```python
import platform
import re
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[Optional[int], Optional[int]]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Tuple[Optional[int], Optional[int]]:
v1 = None
v2 = None
if platform.system() == 'Linux':
... |
Imports:
```python
import re
from os import walk
from os.path import splitext
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
(v2, v3) = splitext(v1)
v2 = re.sub('\\s+', ' ', v2)
v2 = re.sub('[<>:"|?*&%=+@#`^... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
with self.gpkg.connect() as v2:
v2.execute(f'\n DELETE FROM {self.name} WHERE {self.node_key} = ?\n ', (v1,... |
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 not v1:
self.current_player = 1
else:
self.current_player = 0
return self.current_player
``` |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: datetime
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: datetime) -> float:
v2 = v1.year
v3 = datetime(v2 + 1, 1, 1) - datetime(v2, 1, 1)
v4 = v1 - datetime(v2, 1, 1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
try:
return self.file.isatty()
except AttributeError:
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[str], str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[str], v2: str):
v3 = False
for (v4, v5) in map(self.__get_label_key_value, v1):
if v4 == v2:
if v3:
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Enum):
v1 = 'A'
v2 = 'B'
v3 = 'C'
v4 = 'D'
v5 = 'E'
v6 = 'F'
v7 = 'H'
v8 = 'L'
v9 = 'BC'
v10 = 'DE'
v11 = 'AF'
v12 = 'HL'
v13 = 'SP'
v14 = 'PC'
v15 = 'MEM_AT_HL'
```
Input Types: v0
Outp... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> str:
for v3 in reversed(v1):
if not v3['name'].startswith(v2):
continue
return re.split('_all.zip|.zip', v... |
Imports:
```python
from collections import deque
import numpy as np
import typing
```
Type definitions:
Input Types: str
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> float:
v2 = self.record[self.record['symbol'] == v1]
v2 = v2[['type', 'quantity', 'price']]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, int
Output Type: float
Dependencies:
```python
def v0(v1):
v2 = 1.0
v3 = x
while v1 > 0:
if v1 % 2 == 1:
v2 *= v3
v3 *= v3
v1 //= 2
return v2
```
Function Name: v4
Function:
```python
def v4(v... |
Imports:
```python
import numpy as np
from numpy.linalg import norm
import typing
```
Type definitions:
Input Types: np.ndarray, float
Output Type: Tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: float=0.0001) -> Tuple:
if v1.shape[0] != v1.shape[1]:
raise ValueError('... |
Imports:
```python
from datetime import date
import typing
```
Type definitions:
Input Types: date
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: date) -> float:
v2 = date.today()
try:
return v2.year - v1.year - ((v2.month, v2.day) < (v1.month, v1.day))
exc... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor, v3: torch.Tensor, v4: torch.Tensor) -> torch.Tensor:
v1 = self.l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.