text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Place):
def __init__(self, v1, v2, v3, *v4, **v5):
super().__init__(v1, v2, v3, *v4, **v5)
self._has_waiting_resources = v5.get('haswaitingresources', False)
self._next_available = v5.get('nextavailable', 0)
@pro... |
Imports:
```python
import calendar
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int=cur_mo, v2: int=cur_yr):
v3 = calendar.TextCalendar()
v3.prmonth(v2, 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 v1 < 10:
return v1
while v1 >= 10:
v2 = 0
v3 = v1
while v3 >= 1:
v2 += v3 % 10
v... |
Imports:
```python
import re
import numpy as np
import typing
```
Type definitions:
Input Types: Union[str, bytes, Pattern, Any], int, bool
Output Type: Union[Pattern, Any]
Dependencies:
```python
def v0(*, v1: Callable, v2: Any, v3: Union[str, np.dtype, Type]=None, v4: Union[list, tuple]=((),), v5: Mapping[Any, int]=... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> int:
v2 = next(iter(self.samples.values())).shape[1]
if v1:
return v2 + self.num_adaptive_samples
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> float:
v2 = 0.0
v3 = False
v4 = 'Overview of Software Power Consumers'
with open(v1, 'r') as v5:
for v6 in v5:
if ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Any:
if self._iter is None:
self._iter = iter(self._loader)
if self._progress_bar is not None:
if self._should_update_progress_bar:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str], Optional[bool], Optional[str]
Output Type: 'DataStreamWriter'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *, v1: Optional[str]=None, v2: Optional[bool]=None, v3: Optional[str]=None) -> 'DataStreamWriter':
v4 = ... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.TensorShape
Output Type: tf.keras.Model
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.TensorShape) -> tf.keras.Model:
v2 = tf.keras.layers.Input(shape=v1[1:], batch_size=v1[0])
v3 = sc.ck(64, nor... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: typing.Tuple[int, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> typing.Tuple[int, int]:
v2 = (v1 - 1) * self.part_size
v3 = v1 * self.part_size
if v3 >= self.size:
v3 = self.size
... |
Imports:
```python
from collections import defaultdict, Counter
import typing
```
Type definitions:
Input Types: list[str]
Output Type: Any
Dependencies:
```python
def v0(v1, v2):
for v3 in range(len(v1) - v2 + 1):
yield v1[v3:v3 + v2]
```
Function Name: v4
Function:
```python
def v4(v5: list[str]):
v6... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str):
del self._db[v2][v1]
self.flush()
self._publish(self.Event('remove', v2, v1))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> int:
if (v1, v2) in self.memo:
return self.memo[v1, v2]
if v2 == len(self.costs) - 1:
self.memo[v1, v2] = self.cos... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Model):
v1: int
v2: str
v3: str
v4: int
v5: int
v6: List[str]
def v7(self, v8: int) -> v0:
self.buffer_count = v8
return self
def v9(self, v10: str) -> v0:
self.configuration = v10
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
v0 = Optional['np.ndarray[np.bool_]']
```
Input Types: v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0=None) -> None:
for (v3, v4) in self._config.categories_wrapped_as_triggers():
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: str):
assert len(v1) == 2
v3 = np.ndarray(v1, dtype=v2)
v4 = np.ndarray(v1, dtype=v2)
v5 = v3.dtype
if v5.kind ... |
Imports:
```python
import shutil
from pathlib import Path
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0(v1: str) -> Path:
return Path(__file__).parent / 'data' / v1
```
Function Name: v2
Function:
```python
def v2(v3: str):
v4 = v0(v3)
v5 = v0(v3[:-4])... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable[..., Any]
Output Type: Callable
Dependencies:
```python
def v0(v1: str) -> str:
return ''.join(map(lambda t: t[1].capitalize() if t[0] > 0 else t[1], enumerate(v1.split('_'))))
```
```python
def v2(v3: Callable[..., Any]) -> list:
ret... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = re.findall('\\d{4}', v1)
return v2 or ' '
``` |
Imports:
```python
import difflib, itertools, sqlite3, threading, re, os, logging, random, time, functools, collections as pyCollections
import typing
```
Type definitions:
Input Types: str
Output Type: [int, str, bool]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> [int, str, bool]:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
try:
v1 = self.conf.getint('cc_convert', 'mode')
return v1 if v1 in (0, 1, 2) else 2 if v1 > 2 else 0
except:
return 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, str, list, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2: str='compact', v3: list=None, v4: bool=False):
if v1 is None:
return
if type(v1) != list:
return
if len(... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: np_arr, dict, dict
Output Type: dict
Dependencies:
```python
def v0(v1: dict, v2: dict) -> dict:
if v2['strat'] == 'simple ma crossover':
return strat_lib.ma_crossover.check_params(v1, v2)
elif v2['strat'] == 'simple boll... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, str]:
v1 = {}
for (v2, v3) in self._shared_waveforms_iter():
v1[v2] = v3.wave_name
for (v2, v4) in self._concatenated_wavef... |
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:
self.environment = v1
self.__config_cache_dirty = True
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: torch.Tensor, Union[torch.Tensor, None]
Output Type: Tuple[torch.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: Union[torch.Tensor, None]=None) -> Tuple[torch.Tensor]:
if self._instanti... |
Imports:
```python
import typing
```
Type definitions:
Input Types: logging.LogRecord
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: logging.LogRecord) -> bool:
if not super().filter(v1):
return False
if self.contains and self.contains not in v1.msg:
ret... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Dict, int
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict, v2: int=2) -> np.ndarray:
v3 = np.zeros((v2, 1))
v4 = np.linspace(0, 1, v3.shape[0])
for v5 in v1.keys():
v6... |
Imports:
```python
from collections import defaultdict, OrderedDict
import typing
```
Type definitions:
```python
class v0:
def v1(self) -> Iterable['Constraint']:
"""Yields concrete constraints that are active when this constraint is applied."""
raise NotImplementedError
def v2(self) -> 'Abst... |
Imports:
```python
import ssl
import threading
import typing
```
Type definitions:
Input Types: dict, float, bool
Output Type: NoReturn
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict=None, v2: float=3, v3: bool=True) -> NoReturn:
v4 = {'sslopt': {'cert_reqs': ssl.CERT_NONE}, 'origin': v... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, Any, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Any, *, v3: bool=False) -> Any:
if v3:
self.schema[v1] = str(v2)
return self.schema[v1]
v4 = v1[-1:]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self._soundViewer.length()
v2 = self._soundViewer.view()
v3 = v2[1] - v2[0]
v4 = v1 - v3
self.setMaximum(int(1000 * v4))
self.se... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, ndarray]:
super().reset()
for v1 in range(len(self.agents)):
self.reset_agent(v1)
return self.get_sensor_observations()... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: List[str], List[str]
Output Type: Optional[List[Tuple[str, str]]]
Dependencies:
```python
def v0(v1: str, v2: List[str]) -> bool:
v3 = '(\\d{1,5})(\\.\\d{1,5})'
for v4 in v2:
if v4.startswith(v1) and re.search(v3, v1) or v1.s... |
Imports:
```python
import configparser
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
```python
def v0():
v1 = configparser.ConfigParser()
v1.read(ini)
return v1
```
Function Name: v2
Function:
```python
def v2(v3: str, v4: str) -> str:
v5 = v0()
if v3 not ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> tuple:
if not self.wallet:
return (False, False)
v1 = self.wallet.multiple_change
v2 = self.wallet.use_change
return (v1, v2)
``` |
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 = np.copy(v1) * -1.0
v4 = np.copy(v2)
v5 = np.linspace(0.1, np.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
v2 = self.rjc_api_client.check_status(v1)
return v2['status']
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.render:
self.renderer.render_arena()
for (v1, v2) in enumerate(self.agents):
self.renderer.render_agent(v1)
s... |
Imports:
```python
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:
with open(v1) as v2:
v3 = v2.read().splitlines()
v4 = [eval(line) for v5 in v3]
return pd.DataF... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: range
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> range:
v3 = min((v2 or self.tile_count) + v1 + 1, self.tile_count)
return range(v1, v3)
``` |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = re.compile(u'[𐀀-\U0010ffff\\uD800-\\uDBFF\\uDC00-\\uDFFF]')
return v2.sub('', re.sub('[/:*?"<>|]', '-', v1))
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2=False) -> np.ndarray:
v3 = np.exp(v1 - np.max(v1))
v4 = v3 / np.sum(v3)
if v2:
v5 = len(v1)
v4 = np.arra... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
if np.count_nonzero(self.sudoku) == 0:
return 0
if not self.check_occurences():
return -1
return 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, int]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, int]) -> None:
if not isinstance(v1, str):
v1 = str(v1)
super().setText(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, typing.Generator
Output Type: typing.NoReturn
Dependencies:
```python
@lru_cache(maxsize=None)
def v0(v1: int) -> int:
v2 = 0
for v3 in edges[v1]:
v2 = max(v2, v0(v3) + 1)
dist[v1] = v2
return v2
```
Function Name: v4
Func... |
Imports:
```python
import typing
```
Type definitions:
Input Types: aiohttp.ClientSession, str, bool
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: aiohttp.ClientSession, v2: str, v3: bool) -> list:
async with v1.get(v2) as v4:
if v4.status == 200:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0(v1: str):
v2 = load_aws_region_name()
v3 = f'{v2}-{v1}'
if CLIENT_CACHE.get(v3):
return CLIENT_CACHE[v3]
v4 = Config(region_name=v2, signature_version='v4', retries={'max_attempt... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list) -> list:
if v1 is None:
return None
return [{'name': option['name'], 'variants': [{'c': variant['channel'], 'v': option['tag'] if any([o... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Tuple[str, int]], str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[Tuple[str, int]], v2: str, v3: int):
v4 = -1
for (v5, (v6, v7)) in enumerate(v1):
if v6 == v2:
v4 = v5
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> int:
v2 = self.operation_cache_service.get_target_connection(data_integration_id=v1)
v3 = self.queue_provider.get_context(connection=v2.Connection)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._borough_data.to_csv(self._cached_data_path, index=True)
self._aggregated_data.to_csv(self._cached_yearly_data_path, index=True)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
try:
(v2, v3) = v1.split(' ')
except ValueError:
return False
if not (v2.isdigit() and v3.isdigit()):
return ... |
Imports:
```python
import math
from math import gcd
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = dict()
v3 = []
for v4 in v1:
v2[v4] = v1.copy()
for v5 in v1:
if v4 == v5:
... |
Imports:
```python
from datetime import date, datetime, time, timedelta
import typing
```
Type definitions:
Input Types:
Output Type: v0
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> v0:
v1 = datetime(2000, 1, 1)
v2 = timedelta(microseconds=self.integral())
return (v1 + v2).time()
`... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('_KT')
```
```python
v1 = TypeVar('_VT')
```
Input Types: v0
Output Type: v1
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: v0) -> v1:
if isinstance(v3, str):
v4 = v3.lower()
if v4 in self._lc_keys:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Quantity', str
Output Type: 'Quantity'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Quantity', v2: str) -> 'Quantity':
if v1.is_locked:
if v1.path_id not in self._locked:
self._locked[v1.path_id] = v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
if self.have_token:
if self.status().get('meta'):
return True
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> bool:
if not isinstance(v1, dict):
return False
for v2 in ('type', 'required', 'properties'):
if v2 not in v1.keys():
r... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T', bound='Workplane')
```
Input Types:
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self: v0) -> v0:
v2 = self._consolidateWires()
if not v2:
return self
v3 = self.newObject(v2)
v3.ctx... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
del self.deferred_messages
self.deferred_messages = []
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame, pd.Series
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: pd.Series) -> pd.DataFrame:
v1['newly_vaccinated'] = v2
v1.loc[v2, 'ever_vaccinated'] = True
v1.loc[v2, 'cd... |
Imports:
```python
import dataclasses
from dataclasses import dataclass
from datetime import datetime, date, timedelta
import typing
```
Type definitions:
Input Types: object
Output Type: object
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: object) -> object:
if dataclasses.is_dataclass(v1)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, Any, Any
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2=sent_tokenize, v3=word_tokenize, v4=300) -> List[str]:
v5 = v2(v1)
v6 = [len(v3(sent)) for v7 in v5]
v8 = []
v9 = 0
v... |
Imports:
```python
import numpy as np
from pandas._config.config import get_option, set_option
from pandas._libs import lib
from pandas._libs.missing import NA
from pandas._libs.tslibs import NaT, Timedelta, Timestamp, iNaT
from pandas._libs.tslibs.nattype import NaTType
from pandas._typing import ArrayLike, ColspaceAr... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.is_empty():
return 'QUEUE EMPTY'
return str(self._tail.data if self._tail else None)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
self.decoder.set_current_frames_per_step(v1)
self.n_frames_per_step_current = v1
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict):
if 'instance_name' in v1:
return
v2 = os.getenv('INSTANCE_NAME')
if v2 is None:
return
v1['instance_name'] = v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: bool, **v3) -> None:
super().on_batch_end(iteration=v1, train=v2, **v3)
if v1 == 0 and (not v2):
return
if v1 % self.visual_... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: int) -> Tuple[np.ndarray, np.ndarray]:
if v2 > v1.shape[1]:
raise ValueError('`q`... |
Imports:
```python
import inspect
from inspect import CO_VARARGS
from typing import List, Optional, Type, get_type_hints, Dict, Union, Mapping, Iterable
import typing
```
Type definitions:
Input Types: Any
Output Type: Dict[str, type]
Dependencies:
```python
def v0(v1: inspect.Parameter) -> bool:
if v1.kind == ins... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> int:
v1.sort()
while len(v1) > 1:
v2 = v1.pop()
v3 = v1.pop()
if v3 == v2:
continue
else... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
v1 = subprocess.run(['ping', '-c1', self.address], shell=False, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1):
self.data: int = v1
self.next: v0 | None = None
```
Input Types:
Output Type: v0 | None
Dependencies:
Function Name: v2
Function:
```python
def v2(self) -> v0 | None:
v3: v0 = self.head
if v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, BinaryIO
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: BinaryIO) -> str:
v1 = self.sanitize_filename(v1)
v3 = self.get_item(v1, data=v2)
for v4 in self.filters:
v3 = v4.call(v3... |
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
while v1 >= 10:
v1 = v1 // 10
v2 += 1
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[bool], str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[bool], v2: str=None) -> None:
assert len(v1) == len(self.rgb_files), f'Mask is the wrong size! Expected {len(self.rgb_files)}, got {len(v1... |
Imports:
```python
from typing import Dict, List, Tuple, Union, Hashable, Any
import typing
```
Type definitions:
```python
v0 = List[float]
```
Input Types: v0
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0):
v3 = self.get_strategies()
if not isinstance(v2, Tuple):
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: str
v2: str
v3: Callable
v4: Iterable[Arg]
```
```python
class v5:
def __init__(self, v6=None, v7=None, v8=None, v9=None, v10=None, v11=None, v12=None, v13=None, v14=None):
self.flags = v6
sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List) -> Any:
if len(v1) == 1:
return [v1[0]]
return [v1[0]] + v1[1]
``` |
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 not v1:
return True
if len(v1) % 2 == 1:
return False
if v1[0] == ')' or v1[0] == ']' or v1[0] == '}':
ret... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1) -> None:
self._interval_count = v1['IntervalCount']
self._post_equidistant = v1['PostEquidistant']
``` |
Imports:
```python
from sklearn.model_selection import train_test_split
import typing
```
Type definitions:
```python
class v0(te.Protocol):
def __call__(self) -> pd.DataFrame:
...
```
```python
v1 = te.Literal['train', 'test']
```
Input Types: v0, t.Iterable[v1]
Output Type: Any
Dependencies:
```python
de... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Callable[..., Any]
Output Type: None
Dependencies:
```python
def v0(v1: Tuple[Callable[..., Any], bool]) -> bool:
return v1[0] != pointer
```
Function Name: v2
Function:
```python
def v2(self, v3: str, v4: Callable[..., Any]) -> None:
if ... |
Imports:
```python
from itertools import chain, cycle, repeat, islice
from functools import cache, reduce
from operator import add
from math import ceil
import typing
```
Type definitions:
Input Types: list[int]
Output Type: list[int]
Dependencies:
```python
def v0(v1: int, v2: int=0) -> list[int]:
v3 = islice(cyc... |
Imports:
```python
import os
from pathlib import Path
import typing
```
Type definitions:
Input Types: str, Union[Path, str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Union[Path, str]):
v3 = os.path.realpath(os.path.normpath(v1))
return Path(os.path.realpath(os.p... |
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.p is None:
self.p = self.prepare_p()
if self.r is None:
self.r = self.p.add_run()
for v2 in self.attrs:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict):
v3: dict = self.process_data(v2, self.encrypt)
with self._get_mongo_client() as v4:
v4[self.db_name][v1].insert_one(v3)
``... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1: str = str()
for v2 in self._admins:
v1 += v2.build_import()
for v3 in self.properties:
v4 = v3()
v1 += v4.build_import(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> int:
for (v3, v4) in enumerate(v1):
if v4 == v2[0]:
if v2 == v1[v3:v3 + len(v2)]:
return v3
re... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.tracks.pop(self.currentTrack)
random.shuffle(self.tracks)
self.tracks.insert(self.currentTrack, v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path, Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path, v2: Path=None):
if v2 is None:
v2 = v1
for v3 in v1.iterdir():
if v3.name.startswith('.'):
continue
if ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('_FilterT', bound='BaseFilterRequestBuilder')
```
Input Types:
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self: v0) -> v0:
self.session.headers['Accept'] = 'application/vnd.pgrst.object+json'
return s... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Generic[DimsT], metaclass=abc.ABCMeta):
def v1(self, v2: 'ConcreteType') -> bool:
"""Type equality, but ignores tuple member naming discrepancies."""
if self == v2:
return True
if isinstance(self, TupleTyp... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Callable[[], Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> Callable[[], Any]:
if self._use_keyring and self._keyring_client.get_secret(v1):
return self._create_secret_func... |
Imports:
```python
from datetime import datetime, time, timezone
import typing
```
Type definitions:
Input Types: str, bool
Output Type: datetime
Dependencies:
```python
def v0(v1: str, v2: bool) -> datetime:
if len(v1) == 10:
v1 = '%sT00:00:00' % v1[0:10]
elif v1[10] == ' ':
v1 = '%sT%s' % (v1... |
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._init_infobar_label_(v1)
self._init_infobar_button_ok('START')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> dict:
if 'regularization' not in v1:
return v1
if isinstance(v1['regularization'], list):
return v1
if 'energy_type' not in v1[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Path) -> str:
v2 = str(v1)
if v2 not in self._file_cache:
with open(v1, 'r', encoding='utf-8') as v3:
v4 = v3.read()
self._... |
Imports:
```python
import json
from pathlib import Path
import typing
```
Type definitions:
Input Types: Any, bool
Output Type: dict
Dependencies:
```python
def v0(v1, v2, v3: bool=False, v4: bool=True) -> dict:
v5 = v1.dict(exclude_none=True)
v6 = [v5['required']] + [definition[0] for v7 in v2]
v8 = [v5['... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.