text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0():
v1 = Config.OPENAPI_CONFIG
v1.api_key = v1.api_key or {}
v1.api_key['ApiKeyAuth'] = v1.api_key.get('ApiKeyAuth', Config.API_KEY)
v1.server_variables = {**{'environment': Config.ENV... |
Imports:
```python
import polars as pl
from polars import testing
from polars.datatypes import Float64, Int32, Int64, UInt32, UInt64
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
v1 = pl.Series('a', [4, 1, 3, 2, 5])
v2... |
Imports:
```python
import os
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple[str, str]:
for (v1, v2, v3) in os.walk(self.save_path):
v3 = [f for v4 in v3 if not v4[0] == '.']
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if self.current_tree.has_next():
return True
elif len(self.matching_apis) > 0:
self.current_tree = self.create_new_tree()
ret... |
Imports:
```python
import os
import re
import pandas as pd
import typing
```
Type definitions:
Input Types: str
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> pd.DataFrame:
v2 = '^(\\d+)\\s*-\\s*([A-Za-z_]+)\\s*-\\s*([A-Za-z_ 1-9()]+)'
v3 = []
with open(os... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
while True:
v1 = input('>>> ')
try:
self.progress_cmd(v1)
except Exception as e:
self.logger.error('Error... |
Imports:
```python
import typing
```
Type definitions:
Input Types: typing.IO, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: typing.IO, v2: int=8192):
while True:
v3 = v1.read(v2)
if not v3:
break
yield v3
``` |
Imports:
```python
import math
import os
import shutil
import typing
```
Type definitions:
Input Types: Sequence[str], str, Sequence[bool]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Sequence[str], v2: str, v3: Sequence[bool]) -> None:
if len(v1) != len(v3):
raise Valu... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
@LazyProperty()
async def v0(v1: int, v2: int) -> int:
return v1 + v2
```
```python
@LazyProperty()
def v3(v4: int, v5: int) -> int:
return v4 + v5
```
Function Name: v6
Function:
```python
async def ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> str:
v2 = ''
for v3 in v1['Models']:
v2 + 'Model-' + str(v3) + ': ' + 'Number of violations-' + str(v1['Number of violations'])
re... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
```python
def v0(v1: str) -> None:
if not os.path.isdir(v1):
os.makedirs(v1)
```
Function Name: v2
Function:
```python
def v2(v3: str) -> None:
v0(output_path=v3)
for (v4, v5, v6) in os... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1: Any
v2: Any
v3: Optional[SqlColumn]
v4: Optional[str]
v5: Optional[List['SqlSpan']]
def __init__(self, v6: Any=None, v7: Any=None, v8: Optional[SqlColumn]=None, v9: Optional[str]=None, v10: Optional[List['SqlSpan']]=... |
Imports:
```python
import math
import numpy
import typing
```
Type definitions:
Input Types: numpy.ndarray, Optional[numpy.ndarray], Optional[numpy.ndarray]
Output Type: numpy.ndarray
Dependencies:
```python
def v0(v1: numpy.ndarray, v2: Optional[int]=None, v3: Optional[numpy.ndarray]=None) -> numpy.ndarray:
if v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: int
Dependencies:
```python
def v0(v1: List[str]) -> int:
for v2 in ['+', '*']:
while v2 in v1:
v3: int = v1.index(v2)
v4 = evaluate(int(v1[v3 - 1]), v2, int(v1[v3 + 1]))
v5 = v1[:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Dict[str, str]:
v2 = self.keys.get(v1, None)
if v2 is None:
raise Exception(f'Missing key for kid {v1}')
return 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:
self._driver.start()
v2 = self.getSubRedditSoup(v1)
v3 = self.findTagline(v2)
if v3 != '':
v4 = f'/r/{v1} - {v3}'
els... |
Imports:
```python
import pytz, datetime, requests, csv, os, threading, time
import typing
```
Type definitions:
Input Types: requests.Session, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: requests.Session, v2, v3):
v4 = {'username': v2, 'password': v3}
v5 = v1.post... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
if v1 > 1000000.0:
return f'{v1 / 1000000.0:.2f}M'
elif v1 > 1000.0:
return f'{v1 / 1000.0:.2f}K'
else:
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
if isinstance(v1, str) and v1 != '':
return [v1]
else:
return []
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: str
Dependencies:
```python
def v0(v1):
try:
return v1.replace('*', '')
except AttributeError:
return v1
```
Function Name: v2
Function:
```python
def v2(v3, v4, v5) -> str:
try:
v6 = v3[v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, Tuple[float, float], Tuple[float, float], Tuple[float, float], Tuple[float, float]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: Tuple[float, float], v3: Tuple[float, float], v4: Tuple[float, flo... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str='resources') -> str:
v2 = ''
if v1 == 'resources':
v2 = os.path.join(os.getcwd(), v1)
else:
v2 = os.getcwd()
print("... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> None:
v1.makepyfile('\n def test_foo():\n if False: pass\n else: assert False\n ')
v2 = v1.runpytest()
v2.stdout.no_fn... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = 0
v2 = 0
v3 = 0
v4 = 0
v5 = 0
v6 = 0
v7 = []
v8 = 0
v9 = {}
v10 = {}
v11 = None
v12 = 0
v13 = b''
v14 = b''
v15 = 0
v16 = b''
v17 = 0
v18 = 0
v19 = 0
v20 = 0
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if self.has_parent_folder():
return self.get_parent().has_relative_path()
else:
return self.is_relative_path()
``` |
Imports:
```python
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: int
Output Type: list[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> list[str]:
v2 = plt.cm.get_cmap('hsv', v1)
return [v2(i) for v3 in range(v1)]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> tuple:
v1 = '\n\nPlurality with Runoff: The highest ranked candidate gets 1 ' + 'point; all other candidates get 0 points.'
v1 += '\nP = '
v2 = self.c... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, ms.ExecFile
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: ms.ExecFile):
assert v2.arch is v1
assert v2.entry == v2.symbols['_start']
v3 = str(v2.mem.disassemble_one(v2.entry))
assert v3 == 'n... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> list:
v2 = 0
v3 = len(v1)
for v4 in range(v3):
v5 = v4
for v6 in range(v4 + 1, v3):
v2 += 1
if v1... |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = datetime.datetime.now().isoformat()
self.text_field.buffer.insert_text(v1)
``` |
Imports:
```python
import os
import os.path as p
import typing
```
Type definitions:
Input Types: Union[str, Path], Union[str, Path], Union[str, Path], bool, bool
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, Path], v2: Union[str, Path], v3: Union[str, Path], v4: boo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[int]) -> int:
v2 = sorted(v1)
return v2[len(v1) // 2]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2: int=1) -> str:
if v2 == 1:
v3 = '9' * 14
else:
v3 = '1' * 14
v3 = list(map(int, v3))
v4 = [4, 5, 15]
v5:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: List[List[int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> List[List[int]]:
v1.sort()
v2 = []
for v3 in range(len(v1) - 2):
if v1[v3] > 0:
break
if... |
Imports:
```python
import typing
```
Type definitions:
Input Types: PIL.Image, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: PIL.Image, v2: int=0, v3: int=0):
self.print_data = self.print_data + self.render_image(v1)
print('Added to self.print_data: add_image')... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, str
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.ndarray, v3: str) -> np.ndarray:
v4 = np.mean(v1, axis=0)
v5 = np.mean(v2, axis=0)
v6... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: typing.Optional[float]=None, v2: typing.Optional[float]=None, v3: typing.Optional[str]=None) -> None:
super(v0, self).__init__()
self.__offset = float(v1) if v1 else None
self.__scale = float(v... |
Imports:
```python
from os.path import expanduser
import os
import typing
```
Type definitions:
Input Types: dict, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2=False):
v3 = 'export %s=%s;' if not v2 else 'set -x %s %s;'
print(v3 % ('AWS_ACCESS_KEY_ID', v1['Acces... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Any, str, str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str, v3: str='img_key', v4: str='sample_id', v5: str='rep_id'):
v6 = v1[v3].str.split(v2, expand=True).iloc[:, :2]
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T', bound='BaseHist')
```
Input Types:
Output Type: Union[v0, float, bh.accumulators.Accumulator]
Dependencies:
Function Name: v1
Function:
```python
def v1(self: v0, *v2: Union[int, str]) -> Union[v0, float, bh.accumulators.Accumulator]:
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(ABC):
@abstractmethod
def v1(self) -> Wetterstation:
"""Returns a new weather_station belonging to this factory."""
```
Input Types: v0
Output Type: None
Dependencies:
Function Name: v2
Function:
```python
def v2(v3: v0) -> None... |
Imports:
```python
import os
import random
import numpy as np
import tensorflow as tf
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
random.seed(v1)
np.random.seed(v1)
os.environ['PYTHONHASHSEED'] = str(v1)
tf.... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: Tensor
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> bool:
v2 = self.mean
v3 = math.sqrt(self.var)
v4 = self.kurtosis
v5 = v3 * (1 + v4)
return not bool(v2 + v5 >= v1... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(BaseClient):
def v1(self):
v2 = self._http_request(method='GET', url_suffix='api/v1/login')
v3 = v2['accessToken']
return v3
```
```python
class v4(BaseClient):
def v5(self, v6, v7, v8, v9, v10: v0):
glob... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int):
if v1 == 'linear':
if v2 == 2:
v1 = 'bilinear'
elif v2 == 3:
v1 = 'trilinear'
return v1
``` |
Imports:
```python
from itertools import accumulate, count
import typing
```
Type definitions:
Input Types: Tuple[int, ...]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tuple[int, ...]) -> None:
v2 = [self.length * x // sum(v1) for v3 in v1[:-1]]
self.size = (*v2, sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: int) -> int:
v3 = [0] * 26
for v4 in v1:
v3[ord(v4) - ord('A')] += 1
v3.sort()
v5 = v3[-1] - 1
v6 = v5 * v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: aioredis.Redis, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1: aioredis.Redis, v2: str, v3: str):
v4 = await v1.xrange(v2, min=v3, max=v3)
assert len(v4) == 1
return v4[0]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Path]
Output Type: Optional[Path]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[Path]) -> Optional[Path]:
for v2 in [dir / 'pyproject.toml' for v3 in v1]:
if v2.exists():
return v2
else:
... |
Imports:
```python
import functools
import itertools as itt
import operator
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: torch.FloatTensor
Dependencies:
```python
@functools.lru_cache(maxsize=32)
def v0(*v1: Tuple[int, ...]) -> Tuple[int, Tuple[int, ...]]:
return min(((estimate... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
global log_disable_stdout
v1 = False
``` |
Imports:
```python
import sqlite3
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
self._connection = sqlite3.connect(v1)
self._cursor = self._connection.cursor()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: Tuple[bytes, Dict[bytes, bytes]]
Dependencies:
```python
def v0(v1: bytes) -> Generator[bytes, None, None]:
while v1[:1] == b';':
v1 = v1[1:]
v2 = v1.find(b';')
while v2 > 0 and (v1.count(b'"', 0, v2) - v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame):
assert len(v1.columns) == 2
assert v1.columns[0] == 'name' and v1.columns[1] == 'id'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'int[:,:]', 'int', 'int[:,:]', 'int[:,:]'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: 'int[:,:]', v2: 'int', v3: 'int[:,:]', v4: 'int[:,:]'):
v5 = 0
for v6 in range(v2):
v3[v5][0] = v1[v6][0]
... |
Imports:
```python
import logging
from logging import Logger
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> bool:
v1: bool = not self.closed and (not self.stale) and (self.current_session is not None) and (not self.curr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2):
assert v1 in self._attrs, 'attr_key is not in attrs'
assert type(self._attrs[v1]) == list, 'attr_key is not list'
if type(v2) == list... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bytes:
if self._image is None:
v1 = self._request_webpage(self.url, self.url, fatal=True)
v2 = v1.read()
self.mime_type = v1.headers.g... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: int
Dependencies:
```python
def v0(v1, v2: int) -> dict:
v3 = v1.copy()
v4 = True
print(f"{' ' * v2}d={v1!r}")
v5 = 0
while v4:
print(v3)
print(v5)
v5 += 1
v4 = False
f... |
Imports:
```python
from random import randint
import typing
```
Type definitions:
Input Types: list[any], int, int, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list[any], v2: int=1000, v3: int=-100, v4: int=100) -> None:
v1.clear()
for v5 in range(0, v2):
v1.ap... |
Imports:
```python
from PIL import Image
import typing
```
Type definitions:
Input Types: list, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2):
v3 = []
for v4 in v1:
v3.append(Image.open(v4))
v5 = []
for v4 in v3:
v5.append(v4.convert('RGB... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor):
v2 = tf.norm(tf.expand_dims(v1, axis=-1) - tf.expand_dims(self.w, axis=0), axis=1)
return -1.0 * v2
``` |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: int, int, int
Output Type: Optional[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int, v3: int) -> Optional[int]:
v4 = math.ceil(math.sqrt(v3 - 1))
v5 = {pow(v1, i, v3): i for v6 in range(v4)}
v7... |
Imports:
```python
from inspect import iscoroutinefunction, signature
import typing
```
Type definitions:
Input Types: callable
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: callable, *v2, **v3):
v4 = v1
if hasattr(v4, 'func'):
v4 = v1.func
if iscorout... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, datetime, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: datetime, v4=None):
if v4 is None:
v4 = {}
v5 = v2.copy()
v6 = v3.strftime('%d/%m/%Y')
v5.update({'date_from... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Text
Output Type: Text
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Text) -> Text:
if '~' in v1:
return v1.split('~')[0]
return v1.strip()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = 15
v2 = 'AT+CIMI'
if self.debug:
print('\n>> getting IMSI')
v3 = self.send_at_cmd(v2, expected_result_prefix='', max_retries=10)
... |
Imports:
```python
import json
from transformers import TFGPT2LMHeadModel, GPT2Tokenizer
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
v2 = '../../dataset/digi24/split/test.json'
v3 = GPT2Tokenizer.from_pretrained('..... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for v1 in self.nodes:
self.nodes[v1].output = 0
self.fitness = 0
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
self.start_auto_benchmark()
self.start_metric_reporters()
await super().start()
``` |
Imports:
```python
import base64
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = base64.urlsafe_b64encode(v1.encode('utf-8') if isinstance(v1, str) else v1)
return str(v2, 'utf-8')
``` |
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 self.quantization and self.quantization.calibration:
self.quantization.calibration.sampling_size = str(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[int]], List[str]
Output Type: int
Dependencies:
```python
def v0(v1: List[List[int]], v2: int=None, v3: int=None) -> List[List[int]]:
if v3 is not None:
for v4 in range(v3, len(v1)):
for v5 in range(len(v1[v4])):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, List[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: List[str]) -> str:
v2.append('\\')
v3 = ''
for v4 in v1:
if v4 in v2:
v3 += '\\'
v3 += v4
return v3
``... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: List[str]
Dependencies:
```python
def v0(v1: str) -> str:
for v2 in INSTRUCTIONS:
if v1[0:2] == v2.immutable_byte_index or v1[0:1] == v2.immutable_byte_index:
return v2.construct(v1)
return ''
```
Fun... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> None:
(v3, v4) = self.__root__
v1.subheader(f'Dataset {v3} done processed total of {v4}')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.colspec:
return self.colspec
elif self.colwidths and 'colwidths-given' in self.classes:
v1 = sum(self.colwidths)
v2 = [... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[int]], int, int
Output Type: List[Tuple[int, int]]
Dependencies:
```python
def v0(v1: List[List[int]], v2: int, v3: int):
v4 = []
if v2 > 0:
v4.append((v2 - 1, v3))
if v2 < len(v1) - 1:
v4.append((v2 + 1, v3))
... |
Imports:
```python
import secrets
import typing
```
Type definitions:
Input Types:
Output Type: Generator[str, None, None]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Generator[str, None, None]:
while True:
v1 = secrets.token_hex()
if not self._store.__contains__(v1):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = "\n start: ','.thing+ NEWLINE\n thing: NUMBER\n "
self.assertEqual(self.calculate_first_sets(v1), {'thing': {'NUMBER'}, 'st... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Envelope'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: 'Envelope') -> None:
v2 = self._schedule_request(v1)
self.receiving_tasks.append(v2)
self.task_to_request[v2] = v1
self.event_new_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1):
v1 = list(v1)
v2 = 0
while v2 < len(v1) - 1:
if v1[v2] == ' ' and v1[v2 + 1] == ' ':
v1.pop(v2 + 1)
continue
v2 += 1
if v1[0] == ' ':
... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> str:
v2 = v1['id'].split('/')[1]
v3 = v1['name']
v3 = re.sub('\\s+', '-', v3)
v3 = re.sub('[^a-zA-Z-]', '', v3)
return f'{v3}-... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tf.Tensor, int, str
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Tensor, v2: int, v3: str) -> tf.Tensor:
v1 = layers.Dense(v2, name=f'{v3}_dense')(v1)
v1 = layers.BatchNormalization(momentum=0.0, na... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> np.ndarray:
v1 = np.zeros(self.BOARD_SHAPE, dtype=np.int32)
for v2 in range(self.BOARD_SHAPE[0]):
for v3 in range(self.BOA... |
Imports:
```python
import numpy as np
from scipy.optimize import brute
from scipy.stats import norm, chi2
import typing
```
Type definitions:
Input Types: float, bool
Output Type: List[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float=0.05, v2: bool=False) -> List[float]:
v3 = None... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: str, v3: str):
v4 = await self.library_ctx.get_current_page().querySelector_with_selenium_locator(v1)
v5 = await v4.boundingBox... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, v2.Operator
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: v2.Operator) -> Tuple[np.ndarray, np.ndarray]:
v3 = v1.shape[0]
v4 = np.empty... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
import typing
```
Type definitions:
Input Types: Tensor, Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor, v2: Tensor):
v3 = self._distance_pairwise(v1)... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = {'class_id': self.class_id, 'class_name': self.class_name, 'gt_count': self.gt_count, 'pred_count': self.pred_count, 'count_error': abs(self.gt_coun... |
Imports:
```python
from urllib.request import Request, urlopen
from urllib.parse import urlencode
import typing
```
Type definitions:
Input Types: str, dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: dict={}) -> str:
if v1[-1] != '?':
v1 += '?'
v3 = Reques... |
Imports:
```python
import logging
import os
import re
import subprocess
from os.path import join, basename, splitext
import pandas as pd
import typing
```
Type definitions:
Input Types: List[str], List[str], List[str], str, str, Optional[str]
Output Type: Tuple[pd.DataFrame, str]
Dependencies:
```python
def v0(v1: pd.... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str):
return f"'{v1}'"
```
```python
def v2(v3: str):
return f'"{v3}"'
```
Function Name: v4
Function:
```python
def v4(v5: str):
if os.name == 'nt':
return v2(v5)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: app.Application, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: app.Application, v2: str):
if v2 not in self.apps:
v3 = self.apps[v1.name]
del self.apps[v1.name]
v1.name = v2
... |
Imports:
```python
import json
from http import HTTPStatus
from typing import Any, Callable, Dict, Iterator, List, TypeVar, Union
import requests
import typing
```
Type definitions:
Input Types: str, int, bool, Union[int, float]
Output Type: Dict
Dependencies:
```python
def v0(v1: str, v2: int=ALL_REMOTES_TIMEOUT, v3:... |
Imports:
```python
import subprocess
import logging
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2=True):
if v2:
v3 = subprocess.run(v1, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame) -> None:
v2 = v1.groupby(['Topic']).count().sort_values('Document', ascending=False).reset_index()
self.topic_sizes = dict(zip(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, Any, torch.Tensor, torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2=None, v3: torch.Tensor=None, v4: torch.Tensor=None):
if self.accepts_position_ids and self.accept... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, bool
Output Type: List[np.ndarray]
Dependencies:
```python
def v0(v1: np.ndarray) -> np.ndarray:
assert v1.ndim == 2
v2 = v1[:, np.newaxis, :] - v1[np.newaxis, :, :]
return v2
```
Function Name: v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: base.Log
Dependencies:
```python
def v0(v1: str) -> type:
for v2 in LOG_SUBCLASSES:
if v2.MESSAGE_PATTERN.match(v1):
return v2
return None
```
Function Name: v3
Function:
```python
def v3(v4: dict) -> base... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.