text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
self.heap.push(v1)
if self.heap.count > self.k:
self.heap.pop()
return self.heap.heap[1]
``` |
Imports:
```python
import math
import typing
```
Type definitions:
```python
@dataclass(init=False)
class v0(TypeChoice, SizeChoice, MaterialChoice):
v1: List[TypeChoice] = None
def __init__(self, v2: List[str]=None, v3: Vector3d=None, v4: Vector3d=None, v5: List[str]=None, v6: str=None, v7: Vector3d=None, v8:... |
Imports:
```python
import requests
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2):
print('Baixando {}...'.format(v2['name']))
v3 = '{}/{}.{}'.format(v1, v2['name'], v2['format'].lower())
with open(v3,... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> DataFrame:
v1 = self._get_snowflake_hook()
self.log.info('Running SQL query: %s', self.sql)
v2 = v1.get_pandas_df(self.sql, parameters=self.parame... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if not os.path.exists('/etc/tor/torrc.orig'):
with open('/etc/tor/torrc.orig', 'w+') as v1:
v1.write(self.__open_user_torrc_c... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, np.ndarray]:
(v1, v2) = self.task.reset()
del descriptions
return self._extract_obs(v2)
``` |
Imports:
```python
import pandas as pd
import numpy as np
import typing
```
Type definitions:
Input Types: pd.DataFrame, List[str]
Output Type: None
Dependencies:
```python
def v0(v1: pd.DataFrame) -> None:
if sum(v1.has_score.values) > 0:
st.header('**β** Distribution of Scores **β**')
st.write('H... |
Imports:
```python
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types: Union[str, List[str]], Any
Output Type: Any
Dependencies:
```python
def v0(v1, v2=None, v3=False):
v1 = transform_img(v1, v2, v3)
v1 *= 2
v1 -= 1
return v1
```
```python
def v4(v5):
v6 = cv2.imread(v5,... |
Imports:
```python
import heapq
import numpy as np
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: TimedNode) -> bool:
return v1.t >= required_timestep and v1 == trm.V[v1.t][-1]
```
```python
def v2(v3: TimedNode) -> float:
return v3.t + np.linalg.norm(goa... |
Imports:
```python
import numpy as np
from pandas._config import get_option
from pandas._libs import lib, properties, reshape, tslibs
from pandas._typing import ArrayLike, Axis, DtypeObj, IndexKeyFunc, Label, ValueKeyFunc
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender, Subst... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=None) -> None:
if v1 is None:
v1 = []
for v2 in self.keys():
v3 = self.get_raw_value(v2)
if isins... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
```python
def v0(v1, v2, **v3):
v4 = [log for v5 in v2 if v5[0] == 'cobib.commands.list']
for v6 in messages:
assert ('cobib.commands.list', 10, v6) in v4
```
Function Name: v7
Function:
```python
de... |
Imports:
```python
import asyncio
import concurrent.futures
import glob
import os
import shutil
from concurrent.futures import ThreadPoolExecutor
from contextlib import suppress
import typing
```
Type definitions:
Input Types: Any, int
Output Type: Any
Dependencies:
```python
def v0(v1: BaseScheduler, v2: bool=True) -... |
Imports:
```python
import torch
from torch.library import Library
from torch.cuda.jiterator import _create_jit_fn
from torch.testing._internal.common_utils import TestCase, run_tests, TEST_WITH_ROCM, IS_WINDOWS
from torch.utils._mode_utils import no_dispatch, find_outermost_mode, all_same_mode, all_same_mode_scope
from... |
Imports:
```python
import numpy as np
from scipy.linalg import expm, inv, eig
import typing
```
Type definitions:
Input Types: int, np.ndarray
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: np.ndarray) -> np.ndarray:
(v3, v4) = eig(v2)
v5 = np.dot(v4, np.diag(n... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Optional['ManagedCompin']
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Optional['ManagedCompin']:
if v1 in self._dependencies:
return self._dependencies[v1]
else:
return None
``... |
Imports:
```python
import logging
import pandas as pd
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3='_base', v4='_comp') -> pd.DataFrame:
v5 = self._load_prediction_df(v1)
v6 = self._loa... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Optional[str]=None) -> None:
self.name = v1
self.indexes = OrderedDict()
self.symtable = OrderedDict()
self.temp_index = 0
self.names = {}
self.vars_needing_init = set()... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.array, np.array
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.array, v2: np.array) -> np.array:
if v1 is None:
return v2
else:
v3 = 0
if v1.ndim > 1:
... |
Imports:
```python
import datetime
import typing
```
Type definitions:
```python
v0 = Union[str, int, float, bool, None, Mapping[str, 'JSONDict'], List['JSONDict']]
```
Input Types: str
Output Type: Union[v0, None]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: str) -> Union[v0, None]:
if not... |
Imports:
```python
from argparse import ArgumentParser, Namespace
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Any
Dependencies:
```python
def v0(v1):
actions.activate()
```
```python
def v2(v3):
actions.deactivate()
```
```python
def v4(v5, v6, v7, v8, v9: bool):
(v10, v11, v12,... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> pd.DataFrame:
(v1, v2, v3, v4) = (self.cr(), self.cc(), self.gc(), self.pmo())
v5 = v1.copy()
v5.drop(v5.columns[[2, 4, 5, 6, 7]], axis=1, inpl... |
Imports:
```python
import typing
```
Type definitions:
Input Types: datamodel_code_generator.model.DataModel
Output Type: Any
Dependencies:
```python
def v0(v1):
v2 = _underscorer1.sub('\\1_\\2', v1)
return _underscorer2.sub('\\1_\\2', v2).lower()
```
```python
def v3(v4: BaseModel):
v4.base_class = 'pdk8s... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Platform):
def __init__(self, v1: schema.Platform) -> None:
super().__init__(runbook=v1)
self.test_data = MockPlatformTestData()
for (v2, v3) in plugin_manager.list_name_plugin():
plugin_manager.unregister... |
Imports:
```python
from requests import get, post, Response
import typing
```
Type definitions:
Input Types: str, dict
Output Type: Response
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict) -> Response:
v3 = 'https://' + self.backend_hostname + ':' + str(self.backend_port) + v1
... |
Imports:
```python
import collections
import concurrent.futures as cf
import typing
```
Type definitions:
Input Types: List[str], List[str], bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: List[str], v3: bool) -> None:
if v3:
with cf.ProcessPoolEx... |
Imports:
```python
from collections import namedtuple
import json
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
```python
def v0() -> list[IntelliMouse]:
return ProIntelliMouse.enumerate() + ClassicIntelliMouse.enumerate()
```
Function Name: v1
Function:
```python
def v1(v2: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
self.inventory_scheduler.cancel_all()
await self.item_fetcher.clear()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2=True, v3=None) -> str:
v4 = '0123456789.'
v5 = False
v6 = False
v7 = False
v8 = False
v9 = []
if v3 is None:
v10... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: str):
self.count_pages = v1
self.current_page = v2
self.callback_pattern = v3
return self.inline_keyboard.append(sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[dict], Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[dict], v2='readable'):
v3 = [(key, val.aggregate_lazy_diff(v1, mode=v2)) for (v4, v5) in self.items]
return type(self)(v3)
``` |
Imports:
```python
from sklearn.datasets import make_circles, make_classification, make_moons
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import typing
```
Type definitions:
Input Types:
Output Type: None
Dep... |
Imports:
```python
import typing
```
Type definitions:
Input Types: resources_.Resource, bodies.Body
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: resources_.Resource, v2: bodies.Body) -> bool:
v3 = self._cause_handlers.get(v1, None)
if v3 is None:
return False... |
Imports:
```python
import queue
import numpy as np
from collections import defaultdict
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=5):
if not hasattr(self, '_graph'):
raise Exception('Please construct a stra... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str, str
Output Type: Tuple[Dict[str, int], str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=None, v2: str=None, v3: str='Well') -> Tuple[Dict[str, int], str]:
v2 = v2 or self.domain
v3 = v3 or self.data_type... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[int, int]
Output Type: bool
Dependencies:
```python
def v0(v1: Tuple[int, int]) -> str:
(v2, v3) = v1
if v2 < 0 or v2 >= width or v3 < 0 or (v3 >= height):
return '.'
return s[v3 * (width + 1) + v2]
```
Function Name: v4
Func... |
Imports:
```python
import numpy as np
from scipy.spatial.transform import Rotation
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray) -> np.ndarray:
(v2, v3, v4, v5) = v1
v6 = np.array([v3, v4, v5, v2])
return v6
```
Function N... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Callable
Dependencies:
```python
def v0(v1: Callable) -> Callable:
for (v2, v3) in attrs.items():
setattr(v1, v2, v3)
return v1
```
Function Name: v4
Function:
```python
def v4(**v5: Any) -> Callable:
def v6(v7: Call... |
Imports:
```python
import pickle
import typing
```
Type definitions:
Input Types: [str], [str]
Output Type: Any
Dependencies:
```python
def v0(v1: [str], v2: str, v3):
v4 = match(v1, v2, v3)
v5 = 0
while -1 in v4:
v4.remove(-1)
v5 += 1
v6 = 0
v7 = False
for v8 in range(len(v4)):... |
Imports:
```python
from os import path, makedirs, walk
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = ''
for (v2, v3, v4) in walk(self.path):
v1 = str(max([int(x) for v5 in v3]) + 1) if v3 else '0'
... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: Any
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> list:
v2 = v1
v3 = self.accountsdir
v4 = random.SystemRandom()
v5 = ['HUAWEIMate10', 'Xiaomi6', 'SamSungGALAXYNote8', 'vivox20... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.period = 5
self.periods_per_hour = 60 / self.period
self.periods_per_day = self.periods_per_hour * 24
self.voltage = 208
self.max_ba... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import LongTensor, Tensor
import typing
```
Type definitions:
Input Types: Tensor, Tensor, LongTensor, LongTensor, LongTensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[str, Union[None, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Tuple[str, Union[None, int]]:
for v2 in v1.split():
if v2.isdigit():
return (v1[:v1.rfind(v2)], int(v2))
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Tuple[bool, str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> Tuple[bool, str, str]:
print('Connecting to file system')
v2 = v1['email']
v3 = v1['password']
(v4, self.user_id, v5... |
Imports:
```python
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor) -> torch.Tensor:
if not torch.is_tensor(v1):
raise TypeError('Input type is not a torch... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: List[float], str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[float], v2: str='linear', v3=1):
v4 = pd.Series(v1)
v5 = v4.interpolate(method=v2, limit=v3, limit_area='inside')
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, str, str, bool
Output Type: Sequence[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str, v4: bool=False) -> Sequence[str]:
v5 = []
for (v6, v7, v8) in os.walk(v1):
v9 = os.path.bas... |
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.get('fake_bdr'):
self._faked_bdr = self._gwy._get_device(self.id, class_='BDR', faked=True)
if v1.get('fake_ext'):
self.... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Union[int, float]
```
Input Types: Mapping[str, Mapping[str, v0]]
Output Type: Any
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: Mapping[str, Mapping[str, v0]]):
self._last_sync_time = 0.0
self._counts = v2['counts']
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Dict[str, Any]
```
Input Types: str, Optional[int], Optional[int], Optional[Mapping[str, BinaryIO]], bool, datetime.timedelta
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, *, v2: str, v3: Optional[int]=None, v4: Op... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: list=None):
v3 = (x.row for v4 in self._enterlist.findall(v1))
if v2 is None:
v2 = self._checked_rows
v3 = set(v3) - set(v2)
... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = {}
for v2 in self.paths.keys():
if os.path.exists(v2):
for v3 in os.listdir(v2):
v1[v3] = f'{self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> List[str]:
v2 = self.tokenizer.ids_to_tokens(v1)
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[Text, Any]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[Text, Any]) -> int:
v2 = len(v1.get('destinationRanges', [])) or len(v1.get('sourceRanges', []))
v3 = 0
for v4 in v1.get('allowed', []):
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1: int, v2: str):
"""
:param num: checkpoint number
:param name: checkpoint name (i.e. the prefix for all checkpoint files)
"""
self._num = v1
self._name = v2
... |
Imports:
```python
from collections import deque, defaultdict
import math
import typing
```
Type definitions:
Input Types: str
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> float:
v2 = 0
v3 = deque(self.mt.tokenize(v1))
if self.n == 1:
v3.appendlef... |
Imports:
```python
import re
import subprocess
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = subprocess.run(f'systemctl --user status {v1}.timer', shell=True, capture_output=True)
v3 = v2.stdout.decode('ut... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(CustomizableSerializer):
v1 = ('packer_options', 'unpacker_options', 'custom_type_codec', '_marshallers', '_unmarshallers')
def __init__(self, v2: dict[str, Any] | None=None, v3: dict[str, Any] | None=None, v4: MsgpackTypeCodec | str | N... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: int) -> None:
self.data = v1
self.left: Optional[v0] = None
self.right: Optional[v0] = None
```
Input Types: Optional[v0]
Output Type: Optional[v0]
Dependencies:
```python
def v2(v3: Optional[v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = '1234abcd' * 8
v2 = self.get_account_data_dict(email=self.email, name='Full Name')
v3 = self.social_auth_test(v2, subdomain='zulip', desktop... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame):
print('# Do `make_team_features_dataset`.')
v1.sort_values(by='date', inplace=True)
print('# Computing last... |
Imports:
```python
import re
from nltk import pos_tag, sent_tokenize, word_tokenize, WordNetLemmatizer
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = WordNetLemmatizer()
v3 = re.compile('http[s]?://(?:[a-zA-Z]|[0-... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
self.flush()
v2 = self.filename
self.filename = v1
if not self.__test_db_open():
self.filename = v2
self.log.erro... |
Imports:
```python
from itertools import zip_longest
import numpy as np
import typing
```
Type definitions:
Input Types: List[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[int]) -> int:
v2 = ''
for v3 in v1:
v4 = np.base_repr(v3, base=3)[::-1]
v2 = [... |
Imports:
```python
import typing
```
Type definitions:
Input Types: fortnitepy.FriendMessage
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: fortnitepy.FriendMessage) -> None:
print(f'{v1.author.display_name}: {v1.content}')
await v1.reply(self.welcome_message.repl... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: typing.Iterable[str]
Dependencies:
```python
def v0(v1, v2):
for v3 in v1:
if v3.tag == '{http://schemas.microsoft.com/developer/msbuild/2003}' + v2:
yield v3
```
Function Name: v4
Function:
```python
def v4(v5... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: torch.Tensor
Dependencies:
```python
def v0(v1: torch.Tensor, v2: str='sobel', v3: int=1, v4: bool=True) -> torch.Tensor:
return SpatialGradient(v2, v3, v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], Dict[str, Any], Dict[str, Any]
Output Type: Dict[str, Dict[str, str]]
Dependencies:
```python
def v0(v1: str, v2: Any) -> str:
if not isinstance(v2, (int, float)):
return str(v2)
if 'Memory' in v1:
v3 = 0
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
for v1 in range(self.extra_button_hlayout.count()):
self.extra_button_hlayout.itemAt(v1).widget().deleteLater()
for v1 in range(self.main_win... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
assert self._max_depth <= 8
return self._max_depth == 8
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int=2) -> str:
v3 = ' ' * v2
v4 = []
for v5 in v1.split('\n'):
if v5.lstrip().rstrip() == '':
v4.append('')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, bool
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool=True) -> Dict:
v3 = 'fyi/settings/{}'
v4 = 'POST'
v5 = {'enable': v2}
v6 = self._make_request(endpoint=v3, req_type=v4, jso... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0() -> str:
v1 = os.path.abspath(os.curdir)
os.chdir('../../..')
v2 = '/Data/Features/Segment_size_10/'
v1 = os.path.abspath(os.curdir)
v3 = ''.j... |
Imports:
```python
import torch
from torch.utils.tensorboard import SummaryWriter
import torch.nn as nn
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2: torch.Tensor) -> torch.Te... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = []
for v2 in self.routes:
if len(v2.points) > 0:
v1.append(v2)
self.routes = v1
for v3 in self.tracks:
v3.re... |
Imports:
```python
import operator
from operator import attrgetter
import typing
```
Type definitions:
```python
class v0(Primitive):
v1 = True
v2 = True
def v3(self, v4, *v5, **v6):
return call_bind(self, v4, *v5, **v6)
def v7(self, v8):
v9 = dict(v8)
v10 = lu.wrap_init(partia... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Sequence, int, Optional[Tuple[int, ...]]
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: int, v2: List[int]) -> None:
if any((index < 0 for v3 in v2)):
raise IndexError('Negative index in indices: {}'.format(v... |
Imports:
```python
from itertools import product
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, int, int, int, bool
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
```python
def v0(v1: np.ndarray, v2: int) -> np.ndarray:
v3 = np.zeros((v2, v1.shape[WIDTH], v1.s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> bool:
if len(v1) > len(v2):
return False
for v3 in range(len(v1)):
if v1[v3] not in v2[v3]:
return False
return T... |
Imports:
```python
from collections import Counter
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> int:
v2 = []
v3 = Counter(v1)
for v4 in v3.keys():
v2.append(v4)
v2.append(str(v3.get(v4)))
i... |
Imports:
```python
from datetime import datetime, timezone
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v1 = v1.strip()
if v1.endswith('UTC'):
v1 = v1[:-3]
v1 = v1.strip()
return datetime.strptime(v1,... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: dict, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: str) -> None:
v3 = open(v2, 'w')
v1 = json.dump(v1, v3, indent=4)
v3.close()
``` |
Imports:
```python
import numpy as np
from numpy.fft import fft
import logging as log
import typing
```
Type definitions:
Input Types: str
Output Type: np.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> np.array:
log.info(f'Start loading')
v2 = np.load(v1, allow_pickle=True)
v... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, np.ndarray, int
Output Type: Tuple[float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: np.ndarray, v3: int) -> Tuple[float, float]:
(v4, v5) = (v1[np.argsort(v1)], v2[n... |
Imports:
```python
from configparser import ConfigParser
from pathlib import Path
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> str:
v2 = ConfigParser()
v2.read(v1)
v3 = 'host={path} port={port} user=pgbouncer dbname... |
Imports:
```python
import torch
from torch.utils.data import DataLoader
import typing
```
Type definitions:
Input Types: pl.LightningModule, rlt.BehavioralCloningModelInput, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pl.LightningModule, v2: rlt.BehavioralCloningModelInput, v3:... |
Imports:
```python
import matplotlib
from matplotlib import pyplot
from matplotlib.axes import Axes
from matplotlib.figure import Figure
import typing
```
Type definitions:
Input Types:
Output Type: Figure
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Figure:
v1: pandas.DataFrame = self.tim... |
Imports:
```python
from functools import partial
import typing
```
Type definitions:
Input Types: str
Output Type: List[str]
Dependencies:
```python
def v0(v1: Callable, v2: bool=False):
return maybe_then(v1, [partial, types.FunctionType], [lambda x: ('partial ' if v2 else '') + v1.func.__name__, lambda x: v1.__na... |
Imports:
```python
import inspect
import typing
```
Type definitions:
```python
v0 = TypeVar('T', bound=Type[Any])
```
Input Types: v0, types.ModuleType
Output Type: Iterator[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0, v3: types.ModuleType) -> Iterator[v0]:
for (v4, v5) in inspect.getmem... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[td.Categorical, td.OneHotCategorical, td.OneHotCategoricalStraightThrough]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[td.Categorical, td.OneHotCategorical, td.OneHotCategoricalStraightThrough]):
v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.BoolTensor, Any, Any
Output Type: Tuple[torch.Tensor, torch.BoolTensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: torch.BoolTensor, v3: Any, v4: Any) -> Tuple[torch.Tensor, torch.BoolTensor]:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, list
Output Type: int
Dependencies:
```python
def v0(v1: namedtuple, v2: list) -> list:
if v1.x1 == v1.x2:
for v3 in range(v1.y1, v1.y2 + 1 if v1.y2 > v1.y1 else v1.y2 - 1, 1 if v1.y2 > v1.y1 else -1):
v2[v3][v1.x1] += 1
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int, v2: str, v3: str) -> None:
await self.conn.execute('INSERT INTO users (id, first_name, last_name) VALUES ($1, $2, $3) ON CONFLICT (id)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence
Output Type: Generator
Dependencies:
```python
def v0(v1: Any):
return (subtask for v2 in NESTED_TASK_KEYS if v2 in v1 for v3 in v1[v2])
```
Function Name: v4
Function:
```python
def v4(v5: Sequence) -> Generator:
v6 = ['block', 'alwa... |
Imports:
```python
import itertools
import typing
```
Type definitions:
Input Types: int
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> dict:
v2 = {}
v3 = list(itertools.accumulate([x[1] + 1 for (v4, v5) in enumerate(v1)]))
for (v4, (v6, v1)) in enumerate(zip([v5[... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, tk.Listbox
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2: tk.Listbox):
v3 = v2.curselection()[0]
v2.delete(v3)
self.save_conf()
``` |
Imports:
```python
import asyncio
import contextvars
import functools
import typing
```
Type definitions:
```python
v0 = TypeVar('_T')
```
Input Types: Callable[..., v0]
Output Type: Awaitable[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: Callable[..., v0], *v3, **v4) -> Awaitable[v0]:
v5 = as... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = self.r_long()
v2 = abs(v1)
v3 = 0
for v4 in range(v2):
v3 |= self.r_short() << v4 * 15
if v1 < 0:
v3 = -v3
return ... |
Imports:
```python
import uuid
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2=None) -> str:
if not v2:
v2 = uuid.uuid4().hex
self._items[v2] = v1
return v2
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.