text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=None, v3=None):
self.val = v1
self.left = v2
self.right = v3
```
Input Types: Optional[v0], int, int
Output Type: Any
Dependencies:
Function Name: v4
Function:
```python
def v4(self, v5: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2='') -> bool:
v3 = f"select rp.name as database_role\n from [{v1}].sys.database_role_members drm\n join [{v1}].sys.database_principals rp\... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Mapping[str, Any]
Output Type: Mapping[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Mapping[str, Any]) -> Mapping[str, Any]:
v2 = {}
if 'ta2' in v1:
v2['ta2'] = v1['ta2']
if 'schemas' in v1:
v2[... |
Imports:
```python
import base64
import typing
```
Type definitions:
Input Types: str
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> bytes:
v2 = len(v1) % 4
if v2 != 0:
v1 += '=' * (4 - v2)
return base64.b64decode(v1, altchars='_+')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.locations = []
v1 = None
while True:
if v1:
v2 = self.get_conn().list_locations(NextToken=v1)
else:
... |
Imports:
```python
import matplotlib.pyplot as plt
import seaborn as sns
import typing
```
Type definitions:
Input Types: pd.DataFrame, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: str, v3: str) -> None:
sns.displot(data=v1, x=v2, color=v3, kde=True, ... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Optional[List[pd.DataFrame]]
Output Type: Optional[pd.DataFrame]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[List[pd.DataFrame]]) -> Optional[pd.DataFrame]:
v2 = None
for v3 in v1:
if v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, bytes, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes, v2: bytes, v3: str) -> None:
v4 = self.squeaks.update().where(self.squeaks.c.hash == v1).values(secret_key=v2, content=v3)
with se... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: int=50):
v3 = []
v3.append(self.initial_index)
v4 = self.initial_index
while v4 not in self.targe... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
del self.active_connections[v1]
self.log.info(f'websocket: 用户[{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 not in self.cache:
return -1
v2 = self.cache[v1]
del self.cache[v1]
self.cache[v1] = v2
return v2
``` |
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 not in self.ordered_dict:
return -1
self.ordered_dict.move_to_end(v1)
return self.ordered_dict[v1]
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = os.path.join('envpool', 'vizdoom', 'policy-d1.pth')
self.assertTrue(os.path.exists(v1))
(v2, v3) = self.eval_c51('D1_basic', v1)
... |
Imports:
```python
import os
import cv2
import numpy as np
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str='png'):
v3 = cv2.imread(f'{v1}.{v2}')
v4 = cv2.imread(f'reference/{v1}.{v2}')
self.assertT... |
Imports:
```python
import typing
```
Type definitions:
Input Types: grpclib.server.Stream
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: grpclib.server.Stream) -> None:
v2 = await v1.recv_message()
v3 = {'repo': v2.repo, 'from_': v2.from_, 'to': v2.to, 'number': v... |
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.device = v1
self.to(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: logging.Logger
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: logging.Logger) -> None:
for v2 in v1.handlers[:]:
v2.close()
v1.removeHandler(v2)
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self.path = v1.strip() if v1 is not None else None
self.name = '.'.join(os.path.basename(self.path).split('.')[0:-1]) if self.path else ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
v2 = v1 // 3600
v3 = v1 % 3600 // 60
v4 = v1 % 3600 % 60
v5 = f'{v2}:{v3}:{v4}'
return v5
``` |
Imports:
```python
import json
import numpy as np
import typing
```
Type definitions:
Input Types: str, Dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Dict) -> None:
for (v3, v4) in v2.items():
if isinstance(v4, np.ndarray) and v4.size > 1:
v2[v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
v1 = False
v2 = self.ask(':REF:PLL?')
if v2 == '1 PLL Locked, 0 errors':
v1 = True
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Queue
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2=None) -> Queue:
v3 = f'output.{v1}'
return await self.get_queue(name=v3, auto_delete=False, durable=True, exchange=v3, exchange_typ... |
Imports:
```python
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics.pairwise import cosine_similarity
import typing
```
Type definitions:
Input Types: Union[np.ndarray, list], Any
Output Type: Tuple[List[str], List[float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Uni... |
Imports:
```python
from .collections import ConnectionSet
from .collections import Connector
from .collections import ConnectorSet
import typing
```
Type definitions:
Input Types: els.ElementSet, ta.Callable[..., Connector]
Output Type: ConnectorSet
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: els.E... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(ABC):
@abstractmethod
def v1(self, v2: Union[ModuleSource, PluginSource, ConnectorSource], v3: RoutingKey, v4: Optional[Dict]) -> None:
"""Publish data to exchange bus"""
```
Input Types: v0
Output Type: None
Dependencies:
Funct... |
Imports:
```python
from getpass import getpass
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
if not self._interactive:
raise AssertionError('Tried to ask for a password but session is not interactive'... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterator[np.ndarray], Callable[[np.ndarray], float], np.ndarray
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterator[np.ndarray], v2: Callable[[np.ndarray], float], v3: np.ndarray) -> float:
v4 = next(v1)
... |
Imports:
```python
import random
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: str, str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3=False):
self.logger.info('loading entrez_p_file.')
v4 = self.read_entrez_p(v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable
Output Type: Any
Dependencies:
```python
def v0(v1):
return f(v1[0, 0, ...])[None, None, ...]
```
Function Name: v2
Function:
```python
def v2(v3: Callable):
def v4(v5):
return v3(v5[0, 0, ...])[None, None, ...]
return v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = ''
for v3 in ['zerg', 'protoss', 'terran']:
for v4 in ['rush', 'timing', 'power', 'air', 'air', 'macro']:
v2 += f'ai.{v3... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, int
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3=None, v4=None, v5: int=None) -> dict:
v6: dict = {'allow': v3, 'deny': v4, 'type': v5}
v6: dict = {k: v for (v7, v8) in v6.i... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: azure.functions.HttpRequest
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: azure.functions.HttpRequest):
v2 = dict(v1.params)
v2.pop('code', None)
return json.dumps({'method': v1.method, 'url':... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: EvalContext, v2: t.Optional['Frame']=None, v3: t.Optional[int]=None) -> None:
self.eval_ctx = v1
self.parent = v2
if v2 is None:
self.symbols = Symbols(level=v3)
self.re... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.fileContents
for v2 in range(1, len(v1)):
v3 = v1[v2]
v4 = v2 - 1
while v4 >= 0 and v3 < v1[v4]:
v1[v4 ... |
Imports:
```python
import hashlib
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = hashlib.sha3_256()
v1.update(self.signing_key.verify_key.encode() + b'\x00')
return v1.hexdigest()
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(list[list[T]]):
@classmethod
def v1(cls, v2: str, v3: Callable[[str], T]=int, v4='') -> v0[T]:
v5: v0[T] = cls()
for v6 in v2.splitlines():
v5.append([v3(e) for v7 in (v6.split(v4) if v4 else v6)])
ret... |
Imports:
```python
import numpy as np
from skimage import io
from scipy.ndimage import median_filter
import typing
```
Type definitions:
Input Types: str
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.ndarray) -> np.ndarray:
v2 = np.zeros((v1.shape[0] * v1.shape[1], 6))
v3 = np.zeros((v1.shape[1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: Delayed
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Any=None) -> Delayed:
if v1 in self._params:
raise KeyError(f'Parameter {v1} already exists')
self._params[v1] = v2
self._... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: List[np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> List[np.ndarray]:
if v2 >= np.sum(v1):
return [np.copy(v1)]
elif v2 <= 0:
return [np.zeros(v... |
Imports:
```python
import numpy.random as rnd
import typing
```
Type definitions:
Input Types: Optional[int]
Output Type: rnd.Generator
Dependencies:
```python
def v0(v1: Optional[int]=None) -> rnd.Generator:
return rnd.default_rng(v1)
```
Function Name: v2
Function:
```python
def v2(v3: Optional[int]=None) -> rnd... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ClientTagSorting.TagSort
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ClientTagSorting.TagSort):
self._tag_sort = v1
self._Sort()
self._DataHasChanged()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> str:
v2 = []
v3 = v1 < 0
v1 = abs(v1)
while v1:
v2.append(v1 % 7)
v1 //= 7
if not v2:
v2 = [0]
return ('... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3: bool) -> str:
self._usings.add('std::cmp')
v4 = 'max' if v3 else 'min'
self._typename_from_annotation(v1.args[0])
if hasattr(... |
Imports:
```python
import pandas as pd
from pandas.io.parsers import TextFileReader
import typing
```
Type definitions:
Input Types: datetime, datetime, Union[List[int], None]
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: datetime, v2: datetime, v3: Union[List[int], None]... |
Imports:
```python
from itertools import product
import numpy as np
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: np.ndarray, v2: np.ndarray, v3: Dict[str, str]) -> None:
"""Construct the ImageSpec object."""
assert v1.ndim == 1
assert v2.ndim == 1
s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: (List[List[Tuple[int, int]]], List[int])
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2) -> (List[List[Tuple[int, int]]], List[int]):
v3 = v2(v1)
v4 = []
v5 = []
for v6 in v3.get('sentence... |
Imports:
```python
import pickle
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
try:
with open(v1, 'rb') as v2:
(self._action_space, self._epsilon, self._state_space) = pickle.load(v2)
exc... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
for (v2, v3) in reversed(self.db_tables.items()):
v4 = f"DELETE FROM {v3.db_table_name} WHERE scenario_name = '{v1}'"
self.engine.exec... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.service:
for v1 in (self.service._readFd, self.service._writeFd):
if v1 >= 0:
os.close(v1)
... |
Imports:
```python
import torch
import torch.nn as nn
from torch.nn import Sequential as Seq, Linear, ReLU, BatchNorm1d
import typing
```
Type definitions:
Input Types: dict, bool, str, int, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: bool=True, v3: str='./rele... |
Imports:
```python
import typing
```
Type definitions:
```python
@attr.s(slots=True, frozen=True)
class v0:
v1: str = attr.ib()
v2: str = attr.ib()
v3: str = attr.ib()
v4: str | None = attr.ib(default=None)
v5: Mapping[str, Any] | None = attr.ib(default=None)
v6: str | None = attr.ib(default=Non... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = ['ilha de ', 'zona de ', 'e etc']
for v3 in v2:
if v3 in v1:
v1 = v1.replace(v3, '')
return v1.strip()
``` |
Imports:
```python
import inspect
import typing
```
Type definitions:
Input Types: Any
Output Type: list
Dependencies:
```python
def v0(v1):
v2 = True
v3 = None
if not inspect.isfunction(v1):
v2 = False
v3 = 'not a function: %s' % v1
else:
v4 = inspect.getargspec(v1)
if ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: scapy.plist.PacketList
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: scapy.plist.PacketList):
v2 = [sess for v3 in list(v1.sessions().items())]
return v2
``` |
Imports:
```python
from io import BytesIO
import typing
```
Type definitions:
Input Types: str, str, Union[bytes, BinaryIO], int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: Union[bytes, BinaryIO], v4: int=None) -> None:
if isinstance(v3, bytes):
... |
Imports:
```python
import sys
import requests
import typing
```
Type definitions:
Input Types: int, str
Output Type: None
Dependencies:
```python
def v0(v1: int) -> Dict[str, Any]:
auth.initialize_session(conf.make_master_url(), try_reauth=True)
v2 = api.get(conf.make_master_url(), 'experiments/{}'.format(v1))... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: int
Dependencies:
```python
def v0(v1: str) -> int:
return move.y_of(v1) * 8 + move.x_of(v1)
```
Function Name: v2
Function:
```python
def v2(v3: List[str]) -> int:
v4 = 0
for v5 in v3:
v4 += 1 << v0(v5)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: List[Tuple[int, int, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> List[Tuple[int, int, int]]:
v3: List[Tuple[int, int]] = []
if v2 > 0:
v3.append((self.rows[v2 - 1][... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self):
self._predicates = {}
self._variables = {}
self._constants = {}
self._literals = {}
self._domains = {'thing': Type('thing'), 'number': Type('number')}
self._id_to_constant ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, Any
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2=None) -> float:
v3 = self.pid(v1, dt=v2)
if v3 is not None:
v3 += self.K0
else:
v3 = 0
self.publish_pid_stats... |
Imports:
```python
import pprint
import typing
```
Type definitions:
Input Types: Union[type, object], Dict[str, Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[type, object], v2: Dict[str, Any]):
v3 = type(v1).__name__
v4 = []
if hasattr(v1, '__name__'):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, str, str
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: str, v3: str) -> np.ndarray:
v4 = self._load_mask(v2, v3)
return self._apply_mask(v1, v4, color=(0, 255, 0))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if v1.lower() not in self.dataset_names:
raise ValueError('there are not dataset name is %s' % v1)
v2 = self.dataset_path[self.dataset_nam... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2) -> bool:
v3 = self.get_slots(v2) > 0
v4 = v1.name in self.at_will
v5 = v1.name in self.daily and self.daily[v1.name] > 0
return v1.nam... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = '\n from __static__ import dataclass\n\n @dataclass(unsafe_hash=True)\n class C:\n x: str\n y: int\n\n ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list):
v2 = 0
for v3 in range(len(v1)):
if len(v1) > 0:
if v2 < v1[v3]:
v2 = v1[v3]
return v2
``` |
Imports:
```python
import shelve
import urllib
from urllib.parse import urlparse, urljoin
from urllib.request import Request, urlopen
from ..logging.predefined import default_logger
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
```python
def v0(v1):
@wraps(v1)
def v2... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(ABC, SortableBase):
def __init__(self, v1: core.experiment.Experiment, v2: Optional[str]=None, v3: Optional[int]=None, v4: Optional[int]=None) -> None:
"""Initialize trial.
Args:
experiment: The experiment this t... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> None:
for v2 in self.users[v1].follower:
self.follow(v1, v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, Any
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3, v4, v5) -> pd.DataFrame:
v1.iat[v2, v3] = v4[v5.index(max(v5))]
return v1
``` |
Imports:
```python
import gc
import math
import numpy as np
import typing
```
Type definitions:
Input Types: Callable[[], Any]
Output Type: None
Dependencies:
```python
def v0(v1: float, v2: int) -> str:
v3 = np.format_float_positional(v1, fractional=False, unique=False, precision=v2)
return v3.rstrip('.')
```... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Tuple[float, float, float, float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> Tuple[float, float, float, float]:
if v1 in self.map_api.non_geometric_polygon_layers:
return se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> int:
if v1.isalpha() and v2.isalpha():
return int(v1.isupper() == v2.isupper())
else:
return -1
``` |
Imports:
```python
import numpy
import typing
```
Type definitions:
Input Types: float, float, float, float
Output Type: 'ProjectionMatrix'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float, v3: float, v4: float) -> 'ProjectionMatrix':
v5 = numpy.array([[2.0 / (v1 - v2), 0.0, 0... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.val_loop._reload_evaluation_dataloaders()
with torch.no_grad():
self.val_loop.run()
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, Any, Any
Output Type: Tuple[np.ndarray, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2=0, v3='both') -> Tuple[np.ndarray, np.ndarray]:
v3 = v3.lower()
if v3 not in {'lower', 'upper',... |
Imports:
```python
import math
import numpy
import typing
```
Type definitions:
Input Types: int
Output Type: numpy.array
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> numpy.array:
if v1 / 90 % 2 != 1:
v1 = math.radians(v1)
v2 = 1
v3 = 1 / math.cos(v1) ** 2
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: str) -> bool:
with v1.cursor() as v3:
v3.execute("SELECT admin FROM usuarios WHERE usuario = '%s'" % v2)
v4 = v3.fetchone()
(v5,) = ... |
Imports:
```python
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from scipy import optimize
import typing
```
Type definitions:
Input Types: Any, Any, bool, str, str, str, list, list, str, Any
Output Type: Any
Dependencies:
```python
def v0(v1, v2, v3: list=[30, -0.3, 0.06]):
(v4, v5) = opti... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str):
v3 = re.sub('(?<!^)(?=[A-Z])', '_', v2).lower()
self._output_handler.PrintOutput('Created the feature branch: {0:s} inside... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Dict[str, str]:
v2 = dict()
with open(v1, 'r') as v3:
for v4 in v3:
v4 = v4.rstrip()
if not v4:
... |
Imports:
```python
from datetime import datetime, timedelta
import os
from os.path import exists
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
v2: str = f'{self.localFolderPath}/{v1}'
v3: datetime = dat... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list[str]:
v1 = []
for (v2, v3) in self.duplicate_values.items():
for (v4, v5) in v3.items():
if len(v5) > 1:
if l... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0):
self.name = ''
self.bname = b''
self.fno = v1
self.position = MVector3D()
self.rotation = MQuaternion()
self.org_rotation = MQuaternion()
self.interpolation =... |
Imports:
```python
from PIL import Image, ImageDraw
import typing
```
Type definitions:
Input Types: Image
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Image):
v2 = Image.new('RGBA', v1.size, color=(255, 255, 255, 0))
v3 = Image.new('RGBA', v1.size, color=(0, 0, 0, 0))
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence[Tuple[int, int]]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Sequence[Tuple[int, int]]) -> int:
v2 = 1
v3 = v1[0][0]
v4 = 0
while v2 < len(v1):
(v5, v6) = v1[v2]
v7 = (v5 - ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.client.get('/health')
self.assert_status_code(v1, 200)
self.assertIn('healthinfo', str(v1.data))
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, bool
Output Type: List[Dict]
Dependencies:
```python
def v0(v1: List[Dict], v2: bool) -> List[Dict]:
v3 = []
v4 = set()
for v5 in v1:
with open(v5['filepath'], 'r', errors='ignore') as v6:
for v7 in v6.re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
assert 1 <= v1 <= 5
v2 = '\n Almighty and most merciful Father,\n You have loved us with an everlasting love,\n But we have gone ou... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
if self.GPIO.input(v1) == self.GPIO.LOW:
self.update_last_input_time()
return True
else:
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> bool:
if isinstance(v1, bool):
return v1
if isinstance(v1, int):
if v1 == 0:
return False
if v1 == 1:
retu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str):
if v1 == 'User' or v1 == 'Machine':
return self.__run(v1, 'DelValue', v2, v3)
else:
raise ValueError(f'role ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> tuple:
if not self.wait_for(v2):
return (False, [], [])
v3 = self.write_to_topic(v1, v2, self.brokers)
(v4, v5) = se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: str, v3: str) -> str:
return 'projects/%s/processors/%s/reservations/%s' % (v1, v2, v3)
```
Function Name: v4
Function:
```python
def v4(self, v5: str, v6: str, v7: str):
... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
v1 = v1.replace('_', '/')
v1 = v1.replace('-', ':')
return v1
```
Function Name: v2
Function:
```python
def v2(v3: str) -> str:
v4 = re.compile('.*/collecti... |
Imports:
```python
from os.path import isfile
from os import mkdir, listdir
from shutil import rmtree
from os.path import isdir
import typing
```
Type definitions:
Input Types: stardust.main.ctf, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: stardust.main.ctf, v2: str) -> None:
... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
if self.state == self.State.LOGIN:
return self.messages.parse_login(json.loads(v1))
elif self.state == self.State.CRE... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list[str]
Output Type: list[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list[str]) -> list[str]:
v2: list[str] = []
for v3 in v1:
if v3 in v2:
v2.remove(v3)
v2.append(v3)
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: List[ValuedPoint]
' The order of triangle "next" is such that, when walking along the isoline in the direction of next,\n you keep positive function values on your right and negative function values on your left.'
v... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Coroutine[Any, Any, None]
Dependencies:
```python
def v0(v1) -> Coroutine[Any, Any, None]:
if not asyncio.iscoroutinefunction(v1):
print('Is not a coroutine')
return v1
@wraps(v1)
async... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.