text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, str], str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, str], v2: str, v3: str) -> str:
if v2[0] == 'a' or v2[0] == 'b' or v2[0] == '(':
return v2
if ' | ' in v2:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=True, v2=False, v3=True, v4=None) -> List[str]:
v4 = v4 or self.arglist(scalars_only=not v3)
return [v.as_arg(name=k, with_types=v1,... |
Imports:
```python
import pandas as pd
from scipy import stats
import typing
```
Type definitions:
Input Types: str, pd.DataFrame, str, str
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: pd.DataFrame, v3: str, v4: str) -> pd.DataFrame:
v5 = pd.unique(v2[v3]).toli... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, float
Output Type: Any
Dependencies:
```python
def v0(v1):
v2 = len(v1)
return v1[v2 // 2] if v2 % 2 == 1 else (v1[(v2 - 1) // 2] + v1[v2 // 2]) / 2
```
Function Name: v3
Function:
```python
def v3(v4, v5: float):
v6 = len(v4)
ass... |
Imports:
```python
import numpy as np
from pandas._libs import lib, reduction as libreduction
from pandas._typing import ArrayLike, FrameOrSeries, FrameOrSeriesUnion, Manager2D
from pandas.util._decorators import Appender, Substitution, doc
from pandas.core.dtypes.cast import find_common_type, maybe_cast_result_dtype, ... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor) -> tf.Tensor:
v2 = tf.gather(v1, self._adj, axis=1)
return tf.squeeze(self._conv_module(v2), axis=2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: List[List[int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[int]) -> List[List[int]]:
v2 = set()
for v3 in range(len(v1) - 2):
for v4 in range(v3 + 1, len(v1) - 1):
for v5 in ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: dict) -> None:
v3 = ', '.join((f'{name} = {result:.6f}' for (v4, v5) in v2.items()))
print(f'step = {v1}: {v3}')
``` |
Imports:
```python
import base64
import binascii
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = ((b'%3d==', b'\xdd'), (b'$3d==', b'\xdd'), (b'[==', b''), (b'YW]3=', b'am'), (b'3{d==', b'\xdd'), (b'3d}==', b'\xdd'),... |
Imports:
```python
import zlib
import typing
```
Type definitions:
Input Types: bytes
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bytes):
v2 = int.from_bytes(v1[:8], 'little', signed=True)
v3 = int.from_bytes(v1[8:12], 'little', signed=True)
try:
v4 = zlib.decom... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
print(f'{len(self._options)} known options (add_option called)')
for (v1, v2) in self._options.items():
print(f' {v1} = {v2.value!r} (typ... |
Imports:
```python
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 self.beta is None:
raise ValueError("Call 'fit' before this function.")
v1 = self.scaler.transform(v... |
Imports:
```python
import multiprocessing
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
v2 = multiprocessing.Pool(multiprocessing.cpu_count())
v2.map(self.download_track, v1)
v2.close()
v2.join()
``` |
Imports:
```python
import base64
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = base64.b64encode(v1.encode('ascii'))
return 'data:text/csv;base64,' + str(v2)[2:-1]
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: np.ndarray) -> float:
v3 = v2 * np.exp(1j * v1)
return np.abs(np.mean(v3))
``` |
Imports:
```python
import pandas as pd
from pandas import DataFrame
import typing
```
Type definitions:
Input Types: object, int, int, str, str, str
Output Type: DataFrame
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: object, v2: int, v3: int, v4: str, v5: str, v6: str) -> DataFrame:
... |
Imports:
```python
import functools
import typing
```
Type definitions:
Input Types: typing.Callable
Output Type: typing.Callable[[typing.Any], typing.Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: typing.Callable, *v2, **v3) -> typing.Callable[[typing.Any], typing.Any]:
v4 = functools.partia... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Expr'
Output Type: 'LazyFrame'
Dependencies:
```python
def v0(v1: str) -> 'Expr':
return wrap_expr(pycol(v1))
```
```python
def v2(v3: 'PyExpr') -> 'Expr':
return Expr.from_pyexpr(v3)
```
```python
def v4(v5: 'PyLazyFrame') -> 'LazyFrame':
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool):
if self.is_toggle_button:
if v1 and (not self.key_pressed):
self.button_toggled_down = True
v2 = not self.current_va... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1):
self.val = v1
self.next = None
```
Input Types: v0
Output Type: v0
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: v0) -> v0:
if v3 is None or v3.next is None:
return... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v1 = v1.replace('p', 'x').replace('i', '')
if bool(re.search('_\\d$', v1)):
v1 += '_0'
else:
v1 += '_0_0'
retur... |
Imports:
```python
from gc.core import config
from gc.core.AddressState import AddressState
from gc.daemon.helper import logger
from gc.daemon.helper.DaemonHelper import WalletDecryptionError, Wallet, UNRESERVED_OTS_INDEX_START
from gc.services.WalletAPIService import WalletAPIService
from gc.generated import gc_pb2, g... |
Imports:
```python
import torch
from torch import nn, Tensor
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None) -> None:
if v1:
self.load_state_dict(torch.load(v1, map_location='cpu')['model'])
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._model.train(gradient_steps=self.gradient_steps, batch_size=self.batch_size)
self._model_ready = True
``` |
Imports:
```python
import inspect
import typing
```
Type definitions:
Input Types: str, bool
Output Type: Union[str, bytes]
Dependencies:
```python
def v0(v1: bytes) -> str:
return html.unescape(v1.decode('utf8', 'xmlcharrefreplace'))
```
Function Name: v2
Function:
```python
def v2(v3: str, v4: bool=True) -> Unio... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[int]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[int]=None) -> None:
if self._thread is not None:
try:
self._thread.join(v1)
except (ReferenceError, RuntimeE... |
Imports:
```python
from pandas._libs import reduction as libreduction
from pandas.util._decorators import cache_readonly
from pandas.core.dtypes.common import is_dict_like, is_extension_array_dtype, is_list_like, is_sequence
from pandas.core.dtypes.generic import ABCMultiIndex, ABCSeries
import typing
```
Type definiti... |
Imports:
```python
import re
import typing
```
Type definitions:
```python
v0 = TypeVar('_T')
```
Input Types: str, Iterable[v0], Callable[[v0], str]
Output Type: v0 | None
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: str, v3: Iterable[v0], v4: Callable[[v0], str]) -> v0 | None:
v5 = []
v6 = ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(abc.ABC):
@abc.abstractmethod
async def v1(self) -> int:
pass
@abc.abstractmethod
async def v2(self, v3: str) -> Any:
pass
```
Input Types: str
Output Type: v0
Dependencies:
Function Name: v4
Function:
```python... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = str
```
Input Types: List[v0]
Output Type: Optional[Tuple[v0, List[v0]]]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: List[v0]) -> Optional[Tuple[v0, List[v0]]]:
if 'Sensor_Event_0028' in v2 and 'Sensor_Event_0002' in v2 and ('... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict
Dependencies:
```python
def v0(**v1):
return {k: v for (v2, v3) in v1.items() if v3 is not None}
```
Function Name: v4
Function:
```python
def v4(self) -> Dict:
if self.box is None:
raise ValueError('WideSeriesStatCa... |
Imports:
```python
import requests
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(**v1: str) -> dict:
v2 = locals()['kwargs']
v3 = list(v2.keys())
v4 = ['number', 'enumeration_type', 'taxonomy_description', ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: pd.DataFrame) -> dict:
assert all([column in v1.columns.values for v2 in self._columns])
return {}
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, torch.LongTensor], torch.LongTensor
Output Type: torch.FloatTensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, torch.LongTensor], v2: torch.LongTensor) -> torch.FloatTensor:
v3 = self.compatible_head_m... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool) -> None:
if v2 is False and self._before_write_handler:
self._before_write_handler(self, v1)
``` |
Imports:
```python
import asyncio
import functools
import signal
import threading
import warnings
from typing import Optional, Collection, Tuple, Set, Any, Coroutine, Sequence, MutableSequence, cast, TYPE_CHECKING
import typing
```
Type definitions:
```python
v0 = Collection[asyncio_Task]
```
Input Types: asyncio.Abstr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list[str]) -> None:
self.api_scopes = list(set(self.api_scopes + v1))
self.save(update_fields=['api_scopes'])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, np.array
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: np.array):
v3 = self.alpha
v4 = tuple([v1, len(v2), v3])
v5 = self.qmle_cache.get(v4)
if v5 is not None:
self.cac... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor
Output Type: tf.Tensor
Dependencies:
```python
def v0(v1: tf.Tensor, v2: tf.Tensor) -> tf.Tensor:
v1 = tf.image.convert_image_dtype(v1, dtype=tf.float32)
v3 = tf.cast(v2, tf.float32) * _IMAGE_SCALE
v3 = tf... |
Imports:
```python
import stat
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self._new_instance({'sock_access': {'group': True, 'others': True}})
v1.start()
v1.stop()
self.assertFileMode(v1.user_dir, 4... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
assert self.pyctuator_router is not None
assert self.dumps is not None
v2 = self.request.body.decode('utf-8')
v3 = js... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Range'
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Range') -> bool:
(v2, v3) = (self, v1)
if v2.start > v3.start:
(v2, v3) = (v3, v2)
return v2.end > v3.start
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1, v2: ClassLabel=None, v3: BoundingBox=None, v4: list=[], v5: MaskRle=None):
self.obj_id = v1
self.obj_class = v2
self.bbox = v3
self.polygons = v4
self.mask = v5
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> str:
v2 = 'start '
for v3 in [0, 1, 2]:
v2 += str(v3) + ' '
try:
v2 += 'try '
if v3 == 0:
cont... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any]):
v2 = v1.get('db')
v3 = v1.get('user')
v4 = v1.get('pwd')
if not v2 or not v3.__eq__('root') or (not v4.__eq__('root')):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str, v2: str) -> str:
if v2 and v1.endswith(v2):
return v1[:-len(v2)]
return v1[:]
```
Function Name: v3
Function:
```python
def v3(v4: str) -> str:
v4 = v4.lower()
v4 = v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Optional[int]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> Optional[int]:
v1 = self.change_id_data
if v1:
return min(v1.keys())
return None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: list[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1='measurements') -> list[str]:
with open(v1) as v2:
return v2.read().rstrip().split('\n\n')
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Generic[T]):
def __init__(self, v1: 'RTreeBase[T]', v2: bool, v3: 'RTreeNode[T]'=None, v4: List[RTreeEntry[T]]=None):
self._tree = v1
self._is_leaf = v2
self.parent = v3
self.entries = v4 or []
self.co... |
Imports:
```python
import collections
import typing
```
Type definitions:
```python
class v0(Protocol):
def v1(self, v2: Optional[float]) -> Union[str, curtsies.events.Event, None]:
...
def v3(self) -> 'SupportsEventGeneration':
...
def v4(self) -> Union[str, curtsies.events.Event, None]:... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types: List[int], int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[int], v2: int) -> int:
v3 = [sys.maxsize] * (v2 + 1)
v3[0] = 0
for v4 in range(1, v2 + 1):
v5 = sys.maxsize
for... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool):
self._controls['value'].Enable(v1)
if self._view is not None:
self._view.set_visible(v1)
self.structure_changed()
``` |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: pd.Series, pd.DataFrame
Output Type: pd.Series
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.Series, v2: pd.DataFrame) -> pd.Series:
v3 = v1.reset_index().location_id.unique().tolist()
v... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, torch.Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, torch.Tensor]:
v1 = self.data['train.data']
v2 = v1.size(0)
v3 = v1.size(1)
v4 = []
v5 = []
for v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Optional[str]:
for (v2, v3) in self.config.items():
if v1 in v3:
return v2
return None
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
if v1 == 'on_error':
return
v2 = [[] for v3 in range(64)]
for v4 in self._extensions:
if not hasattr(v4, v1):
... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: Any, int
Output Type: Any
Dependencies:
```python
def v0(v1):
v2 = tf.where(v1 != void_class)
v3 = tf.where(v1 == void_class)
v4 = v2[:, None, :] - v3[None, ...]
v5 = tf.reduce_sum(v4 ** 2, axis=-1)
v6 = tf.... |
Imports:
```python
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: torch.Tensor, int
Output Type: Set[Tuple[str, Tuple[int, int]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: int) -> Set[Tuple[str, Tuple[int, int]]]:
v3 = set()
(v4... |
Imports:
```python
import string
import typing
```
Type definitions:
Input Types: list
Output Type: dict
Dependencies:
```python
def v0(v1: string) -> list:
v2 = ['', 'is', 'a', 'the', 'can', 'i', 'to', 'in', 'by', 'from', 'be', 'of', 'what', 'where', 'when', 'why', 'how', 'which']
v3 = v1.translate(str.maketr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: mparser.ArrayNode
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: mparser.ArrayNode):
self.append('[', v1)
v1.args.accept(self)
self.append(']', v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
assert self._log_listener_process
self._log_listener_process.resume()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int
Output Type: Tuple[float, float, float]
Dependencies:
```python
def v0(*v1):
for v2 in v1:
if not isinstance(v2, int):
raise ValueError(f"Only integers {int} are allowed for conversion between RGB255 and others. Y... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str):
self.infile = v1
self.outfile = v2
self.bitrate = v3
self.matcher = re.compile('\\(([0-9]?[0-9 ][0-9... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence[List], Sequence[List], datetime
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Sequence[List], v2: Sequence[List], v3: datetime) -> None:
for v4 in range(len(v1)):
v5 = v1[v4]['price']
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[str, 'Link_Type']
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[str, 'Link_Type'], *v2: Any, **v3: Any) -> str:
v4: Optional[str]
if isinstance(v1, str):
v4 = v1
else:
v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[Any]):
self.submission = self.submission.sort_values(by='image')
self.submission.to_csv(f'sampleas123df.csv', index=False)
pass
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, *v2, **v3) -> Dict[str, Any]:
v4 = super().forward(v1, *v2, **v3)
v5 = self.head(v4['feats'])
return {**v4, 'z': v... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, Optional[str]
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: Optional[str]=None) -> np.ndarray:
v3 = v1.shape[-1]
if v3 != 2:
raise ValueError
... |
Imports:
```python
import sqlite3
import typing
```
Type definitions:
Input Types: str, str, str, str, datetime.datetime
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str, v4: str, v5: datetime.datetime) -> bool:
v6 = 'DELETE\nFROM experiments\nWHERE expi... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = ' ' * self._indent_cnt
v2 = self._bullets[self._indent_cnt]
return datetime.now().strftime('%Y-%m-%d %H:%M:%S')... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: asyncpg.Record
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int) -> asyncpg.Record:
v2 = await self.db.fetchrow('SELECT * FROM users WHERE user_id = $1', v1)
if v2 is None:
await self.db.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: str) -> None:
self._select_channel(v1)
self.write(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list):
v2 = self.conn.cursor()
v2.executemany('\n INSERT OR IGNORE INTO library\n (id, title, year, format, summary, runtime, rating, lin... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> list:
v2 = []
v3 = []
v4 = 0
for v5 in range(len(v1)):
if v5 % 2 == 1:
v3.append(v1[v5])
else:
v4 +... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Sequence):
self._privacy_models += v1
return self
``` |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, int
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: torch.Tensor, v3: int=2) -> torch.Tensor:
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: int=4, v3='mean'):
(v4, v5) = v1.shape
v6 = int(np.ceil(v4 / v2))
v7 = np.zeros((v6, v5))
for v8 i... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, Dict[str, float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, Dict[str, float]]:
v1: Dict[str, Any] = {}
for v2 in self.markets:
v3 = self.markets[v2].get_all_balances()
... |
Imports:
```python
import math
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: Dict[str, Tensor]
Output Type: Tuple[float, Dict[str, float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Tensor]) -> Tuple[float, Dict[str, float]]:
v2 = []
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> List[str]:
v1 = ['http://www.gatherproxy.com/ru/sockslist']
v2 = []
for v3 in v1:
v4 = await self.request(self.session, v3)
... |
Imports:
```python
import numpy as np
import h5py
import typing
```
Type definitions:
Input Types: str
Output Type: (float, np.array)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> (float, np.array):
with h5py.File(v1, 'r') as v2:
v3 = v2.get('time')
v4 = v2.get('vals')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> str:
v2 = self.texts
if v1:
return ''.join([l for v3 in v2 if v3 != '\n']).strip()
else:
return ''.join(v2).strip()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for (v1, v2) in self._difference_series.items():
self._plot_single_city(v1, color_=self._get_color_code_of_city(v2))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
if v1 not in self._stoi:
self._itos.append(v1)
self._stoi[v1] = len(self._itos) - 1
return self._stoi[v1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.name = None
self.script_path = None
self.version = None
self.category = None
self.keywords = None
self.homepage = None
self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: [str]
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: [str]) -> dict:
if len(v1) < 4:
print('wrong number of arguments')
print('usage: ... <client_id> <client_secret> <playlist_id>')
exit(1... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1: pd.DataFrame, v2: pd.DataFrame):
for v3 in v1.columns:
v4 = v1[v3] * 0.0283168
v5 = 86400
v6 = v4 * v5
v7 = v2.loc[v3, '... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[int, slice, Iterable[int]], int
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[int, slice, Iterable[int]], v2: int) -> List[int]:
v3: List[int]
if isinstance(v1, slice):
v3 = list(ran... |
Imports:
```python
import random
import string
from datetime import datetime
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
```python
def v0(v1: int=64) -> str:
return ''.join((random.choice(string.ascii_uppercase + string.digits + string.ascii_lowercase) for v2 in range(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: datetime.datetime
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: datetime.datetime):
if self.__current_memos is None or self.__current_memos.empty:
self.create_new_memo(v1)
return
v2 = se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[datetime], Optional[datetime]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[datetime], v2: Optional[datetime]):
v3 = []
v4: Organization = self._gh.get_organization(self._organization)... |
Imports:
```python
import numpy as np
import polars as pl
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
np.random.seed(1)
v1 = pl.DataFrame({'foo': np.random.rand(10), 'bar': np.arange(10), 'ham': ['h'] * 10})
v1['... |
Imports:
```python
import typing
```
Type definitions:
Input Types: aioredis.Redis
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: aioredis.Redis):
await v1.rpush('a', '2', '3', '1')
assert await v1.sort('a', desc=True) == [b'3', b'2', b'1']
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = '{:>5d}{:>5d}'.format(self.atomscount, self.bondscount)
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2=30):
self.head_probs = v1
self.max_episode_steps = v2
self.toss_count = 0
def v3(self):
return len(self.head_probs)
def v4(self):
self.toss_count = 0
def v5(se... |
Imports:
```python
import urllib
from urllib.parse import quote
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[str]) -> str:
v2 = urllib.parse.urlparse(v1)
v3 = v2.path if v2.path[0] != '/' else v2.path[1:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: None | str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: None | str=None) -> None:
assert v1 is None
self._process.active = False
self.multiplier = 0
if self._scale_event:
self._scale_e... |
Imports:
```python
import typing
```
Type definitions:
Input Types: discord.voice_client.ProcessPlayer
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: discord.voice_client.ProcessPlayer):
for v2 in self.players.items():
if self.players[v2] is v1:
self.play... |
Imports:
```python
import glob
import os
import typing
```
Type definitions:
Input Types: Path, Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: Path):
v3 = '*.ipynb'
v4 = [s[s.find('notebooks'):][10:] for v5 in glob.glob(str(v1 / v3))]
for v6 in v4:
v... |
Imports:
```python
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.model_selection import StratifiedShuffleSplit
import typing
```
Type definitions:
Input Types: pd.DataFrame, str, float, int
Output Type: Tuple[pd.DataFrame, pd.DataFrame]
Dependencies:
Function Name: v0
Function:
```python
def v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.