text stringlengths 190 325k |
|---|
Imports:
```python
import requests
from requests.auth import HTTPBasicAuth
import typing
```
Type definitions:
Input Types: list, list, string, string
Output Type: Any
Dependencies:
```python
def v0(v1: list, v2: string, v3: string):
for v4 in v1:
v5 = requests.put('https://api.github.com/user/following/%s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, bool
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool, v2: bool=False) -> bool:
v3 = 0
if v1:
v3 = 1
self.gpib.cmdWrite('Z' + str(v1), self.addr)
if v2:
if self.gpib.deb... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Model):
v1: str
v2: str
v3: int
v4: str
v5: int
v6: ModelsRuleSet
v7: int
v8: bool
v9: bool
v10: bool
def v11(self, v12: str) -> v0:
self.deployment = v12
return self
def v13(self,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool) -> str:
if ord('a') <= ord(v1) <= ord('z'):
if v2:
return self.dicEnc[v1]
else:
return self.dic... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, int, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3: int, v4: int, v5: int):
for v6 in range(v3, v5 + 1):
v2[v6] = v1[v6]
v6 = v3
v7 = v4 + 1
for v8 in range(v3, v5 + ... |
Imports:
```python
from datetime import datetime, timedelta
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self._api.expires_at or self._api.expires_at - datetime.now() < timedelta(seconds=self._api.refresh_deadl... |
Imports:
```python
from itertools import count, accumulate, chain, islice
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: int
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: int) -> v0:
if v2 < len(self.__memo):
return self.__memo[v2]
... |
Imports:
```python
from scipy.stats import gmean, kendalltau
import typing
```
Type definitions:
Input Types: Any
Output Type: Union[float, tuple]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=False) -> Union[float, tuple]:
(v2, v3) = kendalltau(self.true, self.predicted)
if v1:
... |
Imports:
```python
from bisect import bisect_left
import typing
```
Type definitions:
Input Types: int, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: list):
v3 = [v2[0]]
v4 = [1]
for v5 in v2[1:]:
v6 = bisect_left(v3, v5)
if v6 == len(v3):
... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, tf.Tensor, tf.Tensor, tf.Tensor, Any, Optional[tf.Tensor], Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Tensor, v2: tf.Tensor, v3: tf.Tensor, v4: tf.Tensor, *, v5=False, v6:... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: float
v2: Dict[float, float]
v3: Dict[float, float]
v4: Dict[float, float]
v5: Dict[float, float]
v6: Optional[float]
```
Input Types: Dict[str, v0], str
Output Type: Any
Dependencies:
Function Name: v7
F... |
Imports:
```python
import os
import subprocess
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Tuple[str, Union[None, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> Tuple[str, Union[None, str]]:
v2 = {}
for v3 in ['SYSTEMROOT', 'PATH']:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = "\n from typing import TypeVar\n\n _T = TypeVar('_T', bound=str)\n _EitherStr = Union[str, bytes]\n _MaybeStrings = List... |
Imports:
```python
from datetime import datetime, timedelta
import typing
```
Type definitions:
Input Types: datetime
Output Type: datetime
Dependencies:
```python
def v0(v1: datetime) -> bool:
v2 = v1.strftime('%a')
if not (v2 == 'Sun' or v2 == 'Sat'):
if v1 not in holidays.CountryHoliday('CA', prov='... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: Callable
Output Type: Callable
Dependencies:
```python
@functools.wraps(func)
def v0(*v1, **v2):
os.chdir(os.environ['TEMP_DIR'])
return func(*v1, **v2)
```
Function Name: v3
Function:
```python
def v3(v4: Callable) -> Callable:
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = NewType('MAP_T', List[List[Tile]])
```
Input Types: v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0) -> None:
print('===========================')
for v3 in v2:
for v4 in v3:
if v4.t... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: (requests.Response.json, None)
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> (requests.Response.json, None):
v1 = self._get(self._build_url('/shows/stat'))
if v1:
self.log.info('Got shows stats')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: dict) -> dict:
v3 = []
for v4 in v1:
v3.append(abs((v1[v4] - v2[v4]) / v1[v4]))
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: str):
if not self.__model_is_exist(v1):
self.file_util.create_model(v1)
v4 = 'Question,Answer' + '\n'
v5 = '"' + v2 + '"' ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str, str, Any
Output Type: Any
Dependencies:
```python
def v0():
return getTarget() == Common.Target.Arduino
```
```python
def v1(v2):
if isinstance(v2, int):
return ('MYINT', '%d')
elif isinstance(v2, float):
return (... |
Imports:
```python
import tokenize
import typing
```
Type definitions:
Input Types: Tuple[int, str]
Output Type: Tuple[int, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple[int, str]) -> Tuple[int, str]:
(v2, v3) = v1
if v2 == tokenize.OP:
if v3 == '&':
return (tok... |
Imports:
```python
import typing
```
Type definitions:
Input Types: v1
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: v1):
try:
return True if len(v1) > 1200000 else False
except (Exception, ValueError):
return False
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, matplotlib.colors.LinearSegmentedColormap, bool
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray) -> np.ndarray:
v2 = np.min(v1)
v3 = np.max(v1) - v2
if v3 == 0:
v3 = 1
v1 = (... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path, str, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path, v2: str, v3: int) -> int:
v4 = self.new_container_command('run')
v5 = v4.mount(v1, v1.name)
v4.bind(v2, v3, 8000)
v6 = self.new... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=True, v2: str='png'):
for v3 in self.get_pareto_points():
v4 = self.get_a_strategy_for(v3)
self.plot_strategy(v4, v1, v2)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list[float], float
Output Type: list[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list[float], v2: float=3.5) -> list[float]:
v3 = np.array(v1)
if len(v3.shape) == 1:
v3 = v3[:, None]
v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: int) -> int:
v3 = 0
v4 = 0
for v5 in v1[::-1]:
v4 += v5 * v2 ** v3
v3 += 1
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: pathlib.Path
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pathlib.Path) -> str:
if v1.is_file():
return self._HashFile(v1)
elif v1.is_dir():
return self._HashDirectory(v1)
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Mapping[str, Any], Mapping[str, Any]
Output Type: Iterable[Mapping[str, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Mapping[str, Any]=None, v2: Mapping[str, Any]=None, **v3) -> Iterable[Mapping[str, Any]]:
self.curr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Dict, str, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Dict, v3: str='A', v4: bool=False) -> None:
v3 = v3.upper()
if v3 not in ['P', 'A', 'N']:
v3 = 'A'
self.add_conce... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.web_routes(module='acme.appstub.http.routes.web.Web', prefix=self.package.config.web.prefix)
self.api_routes(module='acme.appstub.http.routes.ap... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: str, int | None, int
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int | None=None, v3: int=0) -> pd.DataFrame:
if v2 not in {None, 2, 3, 4}:
raise ValueError('a... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
if self.health < 0:
return 0.0
if self.health > self.max_health:
return self.size[1]
return self.health * (self.size[0] / self.... |
Imports:
```python
import tensorflow as tf
from tensorflow.keras import layers
import typing
```
Type definitions:
Input Types: tf.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor):
if self.initialized:
(v2, v3) = (self.bias, self.logs)
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> None:
v3 = self.calculate_extension_size(v1, v2)
if v3:
v4 = self.calculate_memory_gas(v1, v2)
self.min_gas_used ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bytes:
while len(self._buff) < v1:
v2 = self._sock.recv(self._bufsize)
if not v2:
break
self._buff += v2
(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Dict[int, str]
Output Type: List[Tuple[int, int]]
Dependencies:
```python
def v0(v1: str, v2: str, v3: str):
if v3 == 'START' or v2 == 'END':
return False
if v1 == 'BIOUL':
if v2 == 'START':
return v3 in ('O', ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
v0 = Union[Callable[[], BatchDims], BatchDims]
```
```python
class v1(Trace):
def __init__(self, *v3, v2):
super().__init__(*v3)
self.axis_name = v2
def v4(self, v5):
return BatchTracer(self, v5, not_ma... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, ir.Unit
Output Type: Any
Dependencies:
```python
def v0(v1: ir.Fun) -> List[str]:
v2 = []
for v3 in serialize.FunRenderToAsm(v1):
if v3.startswith('.fun'):
v2.append(f'<span class=fun>{v3}</span>')
elif v3.star... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
print()
print('Draw!')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: float):
v3 = abs(v1 - v2) % 360
return min(v3, 360 - v3)
``` |
Imports:
```python
from datetime import datetime as dt
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> str:
if len(v1) == 12:
v1 = f'00{v1}'
return dt(year=int(v1[10:14], 16), month=int(v1[8:10], 16), day=int(v1[6:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: collections.Collection[tanjun_abc.MetaEventSig]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, /) -> collections.Collection[tanjun_abc.MetaEventSig]:
v1 = v1.lower()
return self._client_callbacks.ge... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list, np.ndarray
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2: np.ndarray) -> float:
assert v1.shape == v2.shape, 'points number does not match when recover scale'
v3 = []... |
Imports:
```python
import numpy as np
from numpy.linalg import det, inv
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray) -> np.ndarray:
if not self.fitted_:
raise ValueError('Estimator must ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Set[str]
Output Type: Set[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Set[str]) -> Set[str]:
(v2, v3, v3) = self.nlp_context.taxonomy_tokens()
v4 = set()
for v5 in v1:
v6 = set(self.nlp.tokenizer(v5))... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
@static_vars(data_folder='')
def v0() -> str:
v1 = os.path.expanduser('~')
v2 = {'luca': os.path.join(v1, 'Downloads/JacksonFischer_Collaborators'), 'thorsten': '/media/throsten/Data/embl/... |
Imports:
```python
import typing
```
Type definitions:
Input Types: configuration_pb2.ColumnSpec, List[Text]
Output Type: List[Text]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: configuration_pb2.ColumnSpec, v2: List[Text]) -> List[Text]:
if not v1.name:
raise ValueError(f'name is ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if len(self.reservations.keys()) == 0:
return True
return False
``` |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: Text, Text
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Text, v2: Text) -> None:
with tf.io.gfile.GFile(v1, mode='w') as v3:
v3.write(v2)
``` |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0() -> bool:
v1 = subprocess.getstatusoutput('numactl')[0]
if v1 == 0:
print('NUMACTL is not installed in your OS.\n', 'Please install numac... |
Imports:
```python
from decimal import Decimal
import typing
```
Type definitions:
Input Types: Decimal
Output Type: Decimal
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Decimal) -> Decimal:
v2: Decimal = 10 ** self.base.decimals
v3: int = round(v1 * v2)
return Decimal(v3) / v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, **v2):
v2.update(locals())
v3 = {'tags': ['wireless', 'configure', 'bluetooth', 'settings'], 'operation': 'updateDeviceWirelessBluetoothSettings'}
... |
Imports:
```python
import json
import logging
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self.books = []
self.__file_name = v1
v2: List[str] = []
try:
with open(v1) as v3:
v4 = v3.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: HomeAssistantType, config_entries.ConfigEntry
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1: HomeAssistantType, v2: config_entries.ConfigEntry) -> None:
if not v2.data.get('cloudhook') or 'cloud' not in v1.... |
Imports:
```python
from collections import OrderedDict
import typing
```
Type definitions:
Input Types: dict, dt.datetime, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: dt.datetime, v3=3600 * 24) -> str:
v4 = OrderedDict()
for (v5, v6) in v1.items():
v7 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> List[str]:
v3 = 'python' if v1[0] == '3' else 'python2'
if v2 == '32':
v3 = v3 + 'x86'
return [v3, '-Version', v1, '-O... |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass(frozen=True)
class v0:
v1: str
'\n The (fully qualified) form field name.\n '
v2: Optional[generic.Reference]
"\n A reference to the field's dictionary in the old revision, if present.\n "
v3: Optional[generic.Re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> list:
v2 = v1.split('\t')
if len(v2) <= 1:
v2 = v1.split(' ')
v3 = [c.strip() for v4 in v2 if len(v4.strip()) > 0]
return v3
``` |
Imports:
```python
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import PathPatch
from matplotlib.path import Path
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, List[str], List[str], str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0... |
Imports:
```python
import requests as r
import typing
```
Type definitions:
Input Types: list
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> Dict[str, str]:
v2 = {}
for v3 in v1:
v4 = f'https://cloud.iexapis.com/stable/stock/{v3}/quote?token={... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> None:
v1.create_test_module('\n import os\n\n from django.test import TestCase\n from django.conf import settings\n\n from .app.mo... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: [], str, str, {}, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: [], v2: str, v3: str, v4: {}, v5: int):
v6 = '{}th Percentile {}'.format(v3, v2)
v7 = round(np.percentile(v1, v3) /... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
with self._open('r') as v1:
return list(v1.meta.keys())
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list=None):
self._instances = []
self.extend(v1 or [])
return self
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: int, int
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> Dict:
if v1 != 1:
raise ValueError('Only one-step dynamics are currently supported.')
v3 = torch.zeros(v2)
... |
Imports:
```python
import datetime, json, re, string, random
import typing
```
Type definitions:
Input Types: str, Dict[str, Any]
Output Type: NoReturn
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Dict[str, Any]) -> NoReturn:
with open(v1, 'w', encoding='utf-8') as v3:
json.dump... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> List[int]:
v2 = []
v3 = 2
while v1 > 1:
(v4, v5) = divmod(v1, v3)
if v5 == 0:
v2.append(v3)
v1 = v4
... |
Imports:
```python
import numpy as np
import re
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
```python
def v0(v1):
v2 = v1
if re.search('Mrs', v2):
return 'Mrs'
elif re.search('Mr', v2):
return 'Mr'
elif re.search('Miss', v2):
... |
Imports:
```python
from tqdm import tqdm
import typing
```
Type definitions:
```python
class v0(DataSource):
def __init__(self):
v1 = DATA_DIR + '/lincs/GSE92742'
v2 = v1 + '/GSE92742_Broad_LINCS_Level5_COMPZ.MODZ_n473647x12328.gctx'
self.cmap_file = File(v2, mode='r')
self.cmap = s... |
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):
if not self.exists(v2):
self.makedirs(v2)
for (v3, v4, v5) in os.walk(v1):
v6 = os.path.join(v2, os.path.r... |
Imports:
```python
import typing
```
Type definitions:
Input Types: types.Artifact, Optional[Dict[str, Any]], Optional[Dict[str, Any]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: types.Artifact, v2: Optional[Dict[str, Any]], v3: Optional[Dict[str, Any]]):
if v2 is not None:
... |
Imports:
```python
import torch
from torch import Tensor
from torch.nn import Module
from torch.nn import functional as F
import typing
```
Type definitions:
Input Types: int
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> Tensor:
assert v1 > 0
v2 = [1.0]
for v3 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False, v2: str=' '):
v3 = len(self.STATE[0])
v4 = ''
for v5 in range(v3):
for v6 in range(4):
v4 = v2.join(v4, hex(se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict) -> None:
v2 = v1.get('utility_allowance', None)
if v2 is None or v2 == '':
v1['utility_allowance'] = None
return None
v3 = (... |
Imports:
```python
import configparser
import os
from configparser import RawConfigParser
import typing
```
Type definitions:
Input Types: str
Output Type: configparser.RawConfigParser
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> configparser.RawConfigParser:
v2 = RawConfigParser()
i... |
Imports:
```python
import traceback
from concurrent.futures import ProcessPoolExecutor
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Exception, v2: str):
self.exception = v1
self.traceback = v2
```
```python
v3 = Tuple[TaskInstanceKey, CommandType, Optional[str], Ta... |
Imports:
```python
import typing
```
Type definitions:
Input Types: argparse.ArgumentParser
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: argparse.ArgumentParser) -> None:
v2 = v1.add_argument_group('Device parameters')
v2.add_argument('--device-ids', default=[-1], help='Lis... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ArgumentParser, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ArgumentParser, v2: bool=True):
super().configure_argparse(v1, with_definition=v2)
v1.add_argument('--version', default='latest', help=... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = ''
v2 = ''
v3 = 'UNKNOWN'
v4 = -1
v5 = 'UNKNOWN'
v6 = -1
v7 = -1
v8 = []
def __init__(self, v9, v10):
self.artist = v9
self.name = v10
self.dances = []
@classmethod
def v... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.jit as jit
import torch.autograd
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, torch.Tensor
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1, v2, v3):
v4 = (v3 - 1) // 2
... |
Imports:
```python
import hashlib
import typing
```
Type definitions:
Input Types: str, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2=0) -> str:
v3 = hashlib.md5(v1.encode()).hexdigest()
if v2:
for v4 in range(v2):
v3 = hashlib.md5(v3.encode())... |
Imports:
```python
import io
import typing
```
Type definitions:
Input Types: list[PilImage]
Output Type: tuple[io.BytesIO, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list[PilImage]) -> tuple[io.BytesIO, str]:
if len(v1) <= 1:
raise ValueError('At least two image are expected')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = self.get_tracking_data()
v2 = self.get_tracked_data()
v3 = {}
for (v4, v5) in v1.items():
v6 = v2.get(v4, {'hash': None, 'conten... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = self.r.get(self.rkey)
if v1 == None:
return 0
else:
return int(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> None:
(v3, v4) = v2
v3['upload_assignment_submissions_file'].assert_called_with(v3['get_db_operations_adapter'], v4['assignment_submissions'])
``... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
print('Your shot? ', end='')
v1 = None
try:
v1 = int(input())
except ValueError:
v1 = None
while v1 not in ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[Dict[str, Dict[str, Optional[Tensor]]]], str, Dict[str, Optional[Tensor]]
Output Type: Optional[Dict[str, Dict[str, Optional[Tensor]]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[Dict[str, Dict[str, Optiona... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List):
v2 = []
for v3 in v1:
if v3 is not None and len(v3) != 0:
v2.append(v3)
if len(v2) == 0:
return None
else:
... |
Imports:
```python
import re
from email import charset, policy
from email.encoders import encode_base64
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email.header import Header
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
from email.u... |
Imports:
```python
from ast import parse, unparse, get_docstring, AST, FunctionDef, AsyncFunctionDef, ClassDef, Assign, AnnAssign, Delete, Import, ImportFrom, Name, Expr, Subscript, BinOp, BitOr, Call, If, Try, Tuple, List, Set, Dict, Constant, Load, Attribute, arg, expr, stmt, arguments, NodeTransformer
import typing
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, dict, datetime.timedelta
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: dict, v3: datetime.timedelta=None) -> float:
v4 = 0
for ((v5, v6), v7) in v2.items():
v8 = float(v1[v5])
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict, Dict
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict, v2: Dict) -> Dict:
v3 = {}
if v2['xview'] > v1['xview']:
print('XView improved from {:.4f} to {:.4f}'.format(v1['xview'], v2['xvie... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: List[Tuple[str, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> List[Tuple[str, int]]:
v2 = dict()
for v3 in self.series:
if v3.frequency == v1:
for v4 in v3.time_period_... |
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 = []
v3 = []
for (v4, v5) in enumerate(v1):
if 0 < len(v2) and v2[-1][0] == '(' and (v5 == ')'):
v6 = v2.pop()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame, v2: str=None) -> None:
v3 = f'dataframe `{v2}`' if v2 else f"the dataframe that has columns {','.join(v1.columns)}"
v4 = v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: DataLoader, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: DataLoader, v2: int):
v3 = 0
for v4 in v1:
yield v4
v3 += 1
if 0 < v2 <= v3:
break
``` |
Imports:
```python
import numpy as np
from matplotlib import pyplot as plt
import typing
```
Type definitions:
Input Types: list, str, int, np.ndarray, Any
Output Type: Any
Dependencies:
```python
def v0(v1: list, v2: str, v3: int):
if v3 not in v1[0].keys():
raise KeyError('The cutoff does not exist, plea... |
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(self, v1: np.ndarray) -> np.ndarray:
v2 = v1.shape[0]
v3 = np.empty((v2, 3), dtype=np.float64)
for v4 in range(v2):
v... |
Imports:
```python
import importlib
import typing
```
Type definitions:
Input Types: int, int, int, List[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int, v3: int, v4: List[str]) -> str:
v5 = getattr(importlib.import_module(f'aoc.{v1}.day{v2}'), f'part{v3}')
re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.