text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
if v1['status']:
self.gateway.query_all()
self.gateway.write_log('服务器登录成功')
else:
self.gateway.write_log('服务器登录失败')
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0() -> dict:
v1 = os.getenv('HOME')
v2 = '{}/.local/share/juju/stacks.yaml'.format(v1)
if not os.path.isfile(v2):
open(v2, 'w').close()
with open(v2, 'r') as v3:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> List[str]:
v1 = ['tools/setup/build_pygments_data', 'tools/setup/lang.json']
return v1
``` |
Imports:
```python
import pandas as pd
import numpy as np
import seaborn as sns
import h5py
import matplotlib.pyplot as plt
import matplotlib as mpl
from pandas.api.types import CategoricalDtype
import typing
```
Type definitions:
Input Types: Path, Path, int
Output Type: None
Dependencies:
Function Name: v0
Function... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> ndarray:
[v2] = self.embed_batch([v1])
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 > 10 or v1 == 0:
return 1
v2 = [9, 9, 8, 7, 6, 5, 4, 3, 2, 1]
v3 = 1
v4 = 1
for v5 in range(v1):
v4 *= v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = 0
for v2 in self.back_end_ips:
for v3 in range(0, self.DOMAINS):
self.domains_to_pod[v1] = v2
v1 += 1
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int
Output Type: Tuple[int, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int) -> Tuple[int, int]:
v2 = np.random.randint(low=0, high=10000 - v1)
v3 = v2 + v1 - 1
return (v2, v3)
``` |
Imports:
```python
import numpy
import numpy.typing
import typing
```
Type definitions:
```python
v0 = typing.Sequence[int]
```
Input Types: typing.Optional[v0], numpy.typing.DTypeLike
Output Type: bool
Dependencies:
```python
def v1(v2: typing.Optional[v0], v3: numpy.typing.DTypeLike) -> bool:
if v2 is None or v3 ... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = List[Word]
```
Input Types: v0
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0) -> v0:
v3 = [[] for v4 in range(len(v2[0]))]
for v5 in v2:
for (v6, v7) in enumerate(v5):
v3[v6].append(v7)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: str, v2: str):
v3 = {'username': v1, 'password': v2}
await self.http.login(v3)
return True
``` |
Imports:
```python
import numpy as np
from numpy import all, array, arctan2, cos, sin, exp, dot, log, logical_and, roll, sqrt, stack, trace, deg2rad, rad2deg, where, zeros, floor, round, float32, copy
from numpy.linalg import det, lstsq, norm
import typing
```
Type definitions:
Input Types: array, array, array, float
... |
Imports:
```python
import json
from base64 import b64decode
import typing
```
Type definitions:
Input Types: Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> Any:
if v1.get('isBase64Encoded'):
return json.loads(b64decode(v1['body']))
else:
return json... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, Tuple[int, int]
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: torch.Tensor, v3: Tuple[int, int]) -> torch.Tensor:
(v4, v5) = (v2[0], v2[-1])
v6 = v1.size... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v2 = self.annotation_classes_id_name_map
if 'instances' not in v1:
return
v3 = self.get_templates_mapping()
for v4 in (i for v5 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = set()
for v2 in self.all_atoms:
v1.add(v2.chain_id)
return len(v1)
``` |
Imports:
```python
import torch
from torch._C import import_ir_module_from_buffer
from shapely.affinity import rotate, translate
from shapely.geometry import Polygon
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: torch.Tensor, float, float, bool, Any
Output Type: Any
Dependencies:
```python
def... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int | float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int | float) -> float:
v2 = (v1 - 32) * 5 / 9
return round(v2, 1)
``` |
Imports:
```python
from urllib import request
import requests
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
```python
def v0() -> float:
return 1.55
```
Function Name: v1
Function:
```python
def v1() -> bool:
v2 = request.getproxies()
try:
return v0() >= float(re... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: Any, str
Output Type: bool
Dependencies:
```python
def v0(v1, v2: str) -> dict:
try:
v3 = v1.describe_transit_gateways(TransitGatewayIds=[v2])
except Exception as e:
logging.debug(e)
return None
if le... |
Imports:
```python
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: fss.Dataset, nn.Module, torch.optim.Optimizer, fss.Transform, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1: torch.Tensor, v2):
v3 = v1.size(dim=-1)
v4 = v1.view(-1, v3)
return v4[:, v2].vie... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: io.StringIO, hou.NodeType
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: bool=False) -> jinja2.Template:
v3 = _TEMPLATES[v1]
if v2:
v3 = re.sub('([ ]+#id:.+\\n)', '', v3)
v4 = jinja2.Template(v3)
return ... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=0):
self.x = v1
self.y = v2
self.init_x = v1
self.init_y = v2
def v3(self):
self.x = self.init_x
self.y = self.init_y
def v4(self, v5, v6):
self.x... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dt.date, Dict[dt.date, Any], Any, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dt.date, v2: Dict[dt.date, Any], v3: Any, v4: bool=False):
v5 = [d for v6 in list(v2.keys()) if v6 <= v1]
if not v5:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> bool:
v3 = self.stack(v1)
v4 = self.stack(v2)
if len(v3) != len(v4):
return False
for (v5, v6) in enumerate(v3):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[Dict[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, **v1) -> List[Dict[str, str]]:
v2 = []
for v3 in self.columns:
if v1.get(v3) is None:
break
v2.append(str(v1[v3]))... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
self._sequence_num += 1
return self._sequence_num
``` |
Imports:
```python
from pathlib import Path
from torch.utils.data import DataLoader
import torch
import torch.nn as nn
import torch.optim as optim
import typing
```
Type definitions:
Input Types: Union[str, Path], nn.Module, nn.Module, optim.Optimizer, int, float
Output Type: None
Dependencies:
Function Name: v0
Func... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Tuple[int], Tuple[int], Optional[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple[int], v2: Tuple[int], v3: Optional[int]) -> int:
if np.prod(v1) != np.prod(v2):
raise ValueErro... |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
if self.mode:
return int(input().strip())
else:
return ord(sys.stdin.read(1))
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Callable[[np.ndarray], np.ndarray]
Dependencies:
```python
def v0(v1: np.ndarray) -> np.ndarray:
return v1
```
Function Name: v2
Function:
```python
def v2() -> Callable[[np.ndarray], np.ndarray]:
def v3(v4: np.ndarray) -> np.nd... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[dict], Optional[list], Optional[dict], Optional[bool], 'microstrategy_api.task_proc.task_prod.TaskProc'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[dict]=None, v2: Optional[list]=None, v3: O... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
(v2, v3) = (os.path.dirname(v1), os.path.basename(v1))
return os.path.join(v2, f'{os.path.splitext(v3)[0]}.pt')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self.list.append(v1)
if self.enable_archive:
self.archive_file.write('%s\n' % v1)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types:
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
async def v1(self) -> v0:
v2 = await self.get_reading()
return v2['value']
``` |
Imports:
```python
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: Any, Any, Any, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3, v4: str, v5: str):
(v6, v7) = plt.subplots()
v7.errorbar(v1, v2, v3, linestyle='None', fmt='o')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self.hasSiblings():
self.before = (None, 0)
self.after = (None, pow(2, 32) - 1)
else:
v1 = list(self.siblings.keys())
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, bool
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.Tensor, v2: bool=False) -> torch.Tensor:
if v2:
v1 /= 255
v1 -= 0.5
return v1.float()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, List
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str=None, v3: str=None, v4: List=None) -> bool:
v5 = True
if v2:
v6 = f'runscript -CloudFile="{v2}"'
elif v3:
... |
Imports:
```python
import json
import subprocess
import sys
from pathlib import Path
import typing
```
Type definitions:
```python
v0 = test_target.Arch
```
```python
class v1(NamedTuple):
v2: str
v3: Path
```
```python
class v4(NamedTuple):
v5: Path
v6: str
v7: str
v8: str
v9: bool
v10:... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str):
if not self.created:
raise Exception('dataset has not been created')
if v1 == v2:
raise ValueError('traini... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: Any):
if v2:
return {'path': v1, 'siblings': v2, 'value': v3}
return {'path': v1, 'value': v3}
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]):
v2 = self.src_tokenizer(v1)
v3 = self.tgt_tokenizer(v1)
return {'src': v2, 'tgt': v3, 'reviews': v1}
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], Optional[Dict[str, str]]
Output Type: Tuple[List[Dict], Dict[str, str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any], v2: Optional[Dict[str, str]]=None) -> Tuple[List[Dict], Dict[str, str]]:
v3 = {... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float, float, float
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: float, v3: float, v4: float) -> None:
print(f'Необходимая мощность нагревателя равна: {v1} кВт.')
print(f'Мощность с запасо... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(BasePreprocessor):
def __init__(self, **v1):
super().__init__(**v1)
def v2(self, v3: int, v4: int, v5: float):
self.max_sequence_length = v3
self.vocab_size = v4
self.validation_split = v5
self.to... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self._msg_init(0, v1)
self.notification.bind('<Button-1>', lambda _: self.notification.destroy())
self.notification.after(self.display_time[0]... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
with open(v1, 'a'):
pass
``` |
Imports:
```python
import sys
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0():
return map(int, sys.stdin.readline().split())
```
```python
def v1() -> None:
(v2,) = v0()
v3 = UnionFind()
for v4 in range(v2):
(v5, v6) = input().split()
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[torch.LongTensor], Optional[torch.FloatTensor], Any
Output Type: Dict[str, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[torch.LongTensor]=None, v2: Optional[torch.FloatTensor]=None, v3=None) -> Dict[str,... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('Event', bound=LeftEvent)
```
Input Types: v0
Output Type: Optional[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0) -> Optional[v0]:
try:
return self._set.next(v2)
except ValueError:
retur... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int=FALSE_PRIME_TOLERANCE_POWER) -> bool:
if v2 >= 0:
raise ValueError('Tolerance power should be negative.', v2)
if v1 < 0:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2=None) -> bytes:
with self._mem.read_transaction:
v3 = self._search_in_tree(v1, self._root_node)
try:
v4 = v3.get_entry... |
Imports:
```python
import os
from urllib.parse import urlencode
from urllib.request import urlretrieve
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='./', v2: str='') -> str:
if not v2:
v2 = self._get_def... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1: Union[str, Dna], v2: Union[str, Dna], v3: Optional[Union[str, Dna]]=None, v4: Optional[Dict]=None) -> None:
self.ref = v1
self.alt = v2
self.context = v3
self.data = v4
def... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray, float
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.ndarray, v2: float) -> np.ndarray:
v1 = 0.5 * (v1.T + v1)
(v3, v4) = np.linalg.eigh(v1)
v3[v3 < v2 * np.m... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int):
v2 = self.mass.players.get_player_queue(self.player_id)
if v2:
v3 = v2.get_item(v1)
if v3:
return await self.cmd... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, Dict[str, str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: Dict[str, str]):
if v1 not in self.__queue:
self.__queue[v1] = [v2]
else:
v3 = self.__queue[v1]
v3.exte... |
Imports:
```python
import os
import sys
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0() -> bool:
return sys.platform.startswith('win')
```
Function Name: v1
Function:
```python
def v1() -> str:
v2 = 'USERPROFILE' if v0() else 'HOME'
return os.path.join(os... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[tuple]
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[tuple]) -> dict:
v2 = v3 = 0
for (v4, v5) in v1:
v2 += self.single_forward(v4, v5)
v3 += 1
return {self.__class__.__na... |
Imports:
```python
import logging
import uuid
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
```python
def v0(v1: HttpRequest):
logging.debug('Request: {}'.format(v1.to_json()))
v2 = v1.execute()
logging.debug('Response: {}'.format(v2))
return v2
```
Function Name:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: sqlite3.Connection, str
Output Type: tuple[str, ...]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: sqlite3.Connection, v2: str) -> tuple[str, ...]:
v3 = v1.execute(v2)
return tuple((text[0] for v4 in v3))
``` |
Imports:
```python
from collections import Counter
import typing
```
Type definitions:
Input Types: List[str]
Output Type: (str, int)
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> (str, int):
v2: Counter = Counter(v1)
(v3, v4) = v2.most_common(1)[0]
v5 = len([count for... |
Imports:
```python
import os
import json
import torch
import typing
```
Type definitions:
Input Types: str, str, torch.optim.Optimizer, torch.nn.Module, torch.nn.Module, torch.nn.Module
Output Type: Tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: torch.optim.Optimizer=None, v4: ... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: str, Callable[[List[float]], float]
Output Type: Union[float, List[float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Callable[[List[float]], float]=None) -> Union[float, List[float]]:
if v1.l... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, str], str, int, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, str], v2: str, v3: int, v4: str) -> None:
v4 = v4.split('#', 1)[0].strip()
if not v4:
return
v5 = v4.split('=... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.is_attack:
return 'attack'
else:
return 'real'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int, int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int, v3: int, v4: int) -> int:
if len(self.dp) == 0:
return 0
v5 = self.dp[v3 + 1][v4 + 1] - self.dp[v3 + 1][v2] - self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[float]
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[float]=None) -> float:
v2 = self.tt(v1)
return self.accu / v2 if v2 else 0
``` |
Imports:
```python
import datetime
from datetime import date
import typing
```
Type definitions:
Input Types: datetime.date, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: datetime.date, v2=0):
(v3, v4) = (v1.year, v1.month)
v5 = self.quarter(v1)
if v5 > v2:
... |
Imports:
```python
import os
import json
import typing
```
Type definitions:
Input Types: dict, str, bool, bool, bool, bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: str, v3: bool=False, v4: bool=False, v5: bool=False, v6: bool=False) -> None:
if v3 and os.path.isf... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False):
while self._get_fracdone() < 1.0:
self._prepare_gettables()
for v2 in self._setpoints:
self._iterative_set_and_get... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: float):
if abs(v1) < 0.001 and abs(v2) < 0.001:
self.__x_pos = v1
self.__y_pos = v2
else:
self.sendmessage(2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if len(v1) < 4:
raise ValueError(f'Invalid hash to partition: {repr(v1)}')
return f'{v1[0:2]}/{v1[2:4]}/{v1}'
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, MiniBatchKMeans, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: MiniBatchKMeans, v3=True):
v4 = v2.n_clusters
v5 = v1.shape
v1 = v1.reshape(v5[0] * v5[1], v5[2])
v6 = v2... |
Imports:
```python
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import re
from selenium.webdriver.chrome.options import Options
import typing
```
Type definitions:
Inpu... |
Imports:
```python
import curses
import typing
```
Type definitions:
Input Types: str
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str='') -> Optional[str]:
curses.curs_set(1)
v2 = ''
try:
while True:
self.win.erase()
v3 = ... |
Imports:
```python
import os
import stat
import typing
```
Type definitions:
Input Types: Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path):
v2 = stat.S_IMODE(os.lstat(v1).st_mode)
os.chmod(v1, v2 | stat.S_IXUSR)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[Tuple[Type, Type]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[Tuple[Type, Type]]:
v1 = list()
for v2 in self._map_uuid_to_type.values():
v1.append((v2[2], v2[1]))
if len(v1) == 0:
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = namedtuple('FTPPathParts', ['scheme', 'netloc', 'path', 'dirname', 'basename', 'url'])
```
Input Types: str
Output Type: str
Dependencies:
```python
@staticmethod
def v1(v2, v3: tuple=None) -> v0:
return v1(host_or_url=v2, source_address=v3)
```
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[str]
Output Type: 'Localization'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[str]) -> 'Localization':
v2 = [line for v3 in self if v3.filename not in v1]
return self.restrict_to_lines(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> List[str]:
v2 = []
if hasattr(v1.graphql.shortcode_media, 'edge_sidecar_to_children'):
for v3 in v1.graphql.shortcode_media.edge_sidecar_to_c... |
Imports:
```python
from pprint import pformat
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> dict:
self.logger.debug('retrieved instance data: ' + pformat(v1))
v2 = self.systemObject.logon_info()
if 'msh... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list:
try:
return str(self.get_definition()['environment']['VIRTUAL_HOST']).split(',')
except KeyError:
return []
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[gt.Fields], Iterable[gt.Fields]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[gt.Fields], v2: Iterable[gt.Fields]):
v1 = list(v1)
v2 = list(v2)
self.assertEqual(len(v1), len(v2))
... |
Imports:
```python
import json
from random import randint
import requests
import typing
```
Type definitions:
Input Types: str
Output Type: list
Dependencies:
```python
def v0(v1: list) -> dict:
v2 = randint(0, len(v1) - 1)
v3 = v1[v2]
return v3
```
```python
def v4(v5: str) -> 'BeautifulSoup':
v6 = re... |
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(self, v1: str) -> pd.DataFrame:
self.assert_valid_id(v1)
v2 = self.storage.get_text([self.relic_type, self.name, 'pandasdf', v1])
... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Dict[str, str]
Dependencies:
```python
def v0(v1: str) -> Dict[str, str]:
v2: Dict[str, str] = {}
v3 = v1.splitlines()
v4 = []
v5 = []
for v6 in v3:
if v6.startswith('status:') or v6.startswith('b... |
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 v1:
v2 += bin(int(v3, base=16))[2:].zfill(4)
return v2
``` |
Imports:
```python
from difflib import ndiff
from pprint import pformat
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0(v1, v2, v3) -> List[str]:
v4 = [f'>>> {v1}:']
v5 = 1 if any((len(str(obj)) for v6 in (v2, v3))) else 120
v7 = 2
v8 = pformat(v2, widt... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
v2 = 0
v3 = True
while v2 < len(v1):
if v1[v2] != ' ':
if v1[v2] in '+-':
v3 = False if v1[v2] == '... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
self.current_car = (self.current_car + 1) % len(self.cars)
return self.cars[self.current_car]
``` |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
for v2 in range(1):
v3 = self.chat_tokenizer.encode(v1 + self.chat_tokenizer.eos_token, return_tensors='pt')
v4 = torch.c... |
Imports:
```python
import os
import numpy as np
import pandas as pd
from pandas import Timestamp
import typing
```
Type definitions:
Input Types:
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> pd.DataFrame:
if os.path.exists(self.file_path()):
self.dataframe... |
Imports:
```python
import os
import typing
```
Type definitions:
```python
class v0:
v1 = False
def __init__(self, v2: ProcResult, v3: bool=False) -> None:
self._impl = v2
if v3:
print(self.stdout)
if self.stderr:
print('======= stderr ========')
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(cls: Any) -> Any:
v1 = cls.__name__
self._cls_table[v1] = cls
return cls
``` |
Imports:
```python
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: str
v2: str
v3: v1
v4: OpportunityType
v5: datetime
v6: str
@classmethod
def v7(cls, **v8):
v9 = datetime.strptime(v8['updated_at'], '%Y-%m-%dT%H:%M:%S%z')
v10 = OpportunityType[v8[... |
Imports:
```python
from typing import cast, Union, Any
import ast
import typing
```
Type definitions:
Input Types: ast.Expression, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ast.Expression, v2: str) -> None:
self.assertIsInstance(v1, ast.Identifier)
v3 = cast(as... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int) -> None:
if not isinstance(v1, str):
raise ValueError('Given address is not a string')
if not isinstance(v2, int) or v2 <= 0... |
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 zip(self.net.params(), self.net.param_grads()):
self._update_rule(param=v1, grad=v2)
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.