text stringlengths 190 325k |
|---|
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.startswith('gs://'):
return False
return True
``` |
Imports:
```python
import torch
from torch import nn
from torch.nn import functional as F
import typing
```
Type definitions:
Input Types: Union[torch.Tensor, torch.LongTensor], Optional[torch.LongTensor], Optional[torch.Tensor]
Output Type: Tuple[torch.Tensor, torch.LongTensor]
Dependencies:
Function Name: v0
Functi... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str], List[dict]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2: List[dict]) -> bool:
v3: List[dict] = []
v4: List[dict] = []
for v5 in v2:
v6 = v5['license']
v7 = v5['p... |
Imports:
```python
import math
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Tuple[Tuple[Tuple[ImmutableObjectDefinition]]]) -> None:
"""Please call the create_dataset function to create a new
DatasetDefinition."""
self._definition_groups = v1
def v2(se... |
Imports:
```python
import shlex
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = shlex.split(v1)
return self.click_command.main(args=v2[1:], prog_name=v2[0], standalone_mode=False)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Optional[int], bool, Optional[dict]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str='rb', v3: Optional[int]=None, v4: bool=True, v5: Optional[dict]=None, **v6):
v1 = self._strip_protoco... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: int
Output Type: None
Dependencies:
```python
def v0():
v1 = datetime.now().strftime('%H:%M')
return f'[{v1} crawling@home]'
```
Function Name: v2
Function:
```python
def v2(self, v3: int) -> None:
print(f'{v0... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int):
if not self.exists(v1):
raise ValueError('Invalid path ({path})'.format(path=v1))
v3 = self.stat(v1)
v4 = v3.st_mode
... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if self.websocket is None:
return
asyncio.create_task(self.notify_ui_that_state_changed(v1))
``` |
Imports:
```python
from decimal import Decimal
import typing
```
Type definitions:
Input Types: list, list, float
Output Type: float
Dependencies:
```python
def v0(v1: float, v2: float) -> float:
v3 = 1 / float(v2)
return float(round(Decimal(v1) ** Decimal(v3), 3))
```
Function Name: v4
Function:
```python
def... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float) -> str:
v2 = self.number_format
if self._update_flags == 'value':
v3 = round(v1, self.decimals)
return v2.replace('%v', str(v3)... |
Imports:
```python
from collections import defaultdict, deque, Counter
import typing
```
Type definitions:
Input Types: List[str], List[str]
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str], v2: List[str]) -> List[str]:
v3 = {}
v4 = {}
for (v5, v6) in e... |
Imports:
```python
import re
import textwrap
import typing
```
Type definitions:
```python
v0 = TypeVar('TFunc')
```
Input Types: v0, str, str, str
Output Type: v0
Dependencies:
```python
def v1(v2) -> str:
tw.initial_indent = tw.subsequent_indent = v2.group(1)
return tw.fill(textwrap.dedent(value))
```
Functio... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, Any, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2=15, v3=time.sleep) -> bool:
try:
v4 = os.stat(v1)
v3(v2)
return v4.st_size != os.stat(v1).st_size
except ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.training = True
self.actor.train()
self.critic1.train()
self.critic2.train()
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: list, list, int
Output Type: Any
Dependencies:
```python
def v0(v1: datetime, v2):
return v1.replace(hour=v1.hour - v1.hour % v2, minute=0, second=0)
```
Function Name: v3
Function:
```python
def v3(v4: list, v5: list, v6: int):... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._ok_clicked = True
self._row = self._row_entry.get()
self._column = self._column_entry.get()
self._first = self._first_entry.get()
s... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
if v1.lower().startswith('y'):
self.zs = 0.1 * self.cache_eccent['Ix_min']
else:
self.zs = 0
self.Df = self... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list[int], int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list[int], v2: int):
v3 = []
for v4 in v1:
v4 + v2
if v4 + v2 >= max(v1):
v3.append(True)
if v4 + v2 < ma... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import typing
```
Type definitions:
```python
class v0(nn.Module):
v1 = 4
def __init__(self, v2: int, v3: int, v4: int, v5: Union[Sequence[int], int]=1, v6: Optional[nn.Sequential]=None) -> None:
super(v0, self).__ini... |
Imports:
```python
import torch
from torch import Tensor, nn, tensor
import typing
```
Type definitions:
Input Types: Tensor, Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor, v2: Tensor) -> Tensor:
v3 = [self._loss_fn(v1[i], torch.clone(v2[i])) for v4 in [0, ... |
Imports:
```python
import random
import datetime
import typing
```
Type definitions:
Input Types: sqlite3.Connection, List[int], List[int], int, int, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: sqlite3.Connection, v2: List[int], v3: List[int], v4: int=0, v5: int=22, v6: in... |
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:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor) -> torch.Tensor:
v1 = v1 - self.whitening_model['mean']
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[Optional[Union[str, int]]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[Optional[Union[str, int]]]:
v1 = []
for (v2, v3) in self.__dataclass_fields__.items():
v4 = getattr(self, v2)
... |
Imports:
```python
import re
import sys
import typing
```
Type definitions:
Input Types: str, list, dict
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: list, v3: dict) -> bool:
v4 = False
for v5 in v2:
if re.match(v5, v1):
v4 = True
if not v4:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: datasets.arrow_dataset.Dataset, str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: datasets.arrow_dataset.Dataset, v2: str='text', v3: int=1000):
for v4 in range(0, len(v1), v3):
yield v1[v4:v4 + v3][... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[int]], List[int], List[int]
Output Type: bool
Dependencies:
```python
def v0(v1, v2):
if v1 == target[0] and v2 == target[1]:
return True
for (v3, v4) in [[-1, 0], [0, 1], [1, 0], [0, -1]]:
(v5, v6) = (v1, v2)
... |
Imports:
```python
import numpy as np
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.first_n is None:
v2 = v1
else:
v2 = v1[:, :self.first_n]
if self... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: List, int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List, v2: int=0) -> bool:
if isinstance(v1[0], np.ndarray):
v3 = set((arr.shape[v2] for v4 in v1))
return len(v3) <= 1 a... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterator
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterator):
for v2 in v1:
self.feed(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: List[int]=None):
self.head = None
self.tail = None
if v1 != None and len(v1) != 0:
for v2 in v1:
self.append(v2)
def __repr__(self) -> str:
v3 = []
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: ConnectionManager, v2: Path, *, v3: Dict[str, str]=os.environ, v4=subprocess.run):
"""A utility for invoking SAM commands using subprocess
Args:
connection_manager: The TemplateHandler's C... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, int, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: int, v3: list):
v4 = ' |'
v5 = '-|'
v6 = '+|'
for v7 in range(0, v2):
v8 = '|'
for v9 in range(0, v2):
... |
Imports:
```python
from decimal import Decimal
import typing
```
Type definitions:
Input Types: Dict[str, Any], str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Any], v2: str) -> None:
v3 = Decimal(self.poll.get('votesvalid', '0.000000')) + Decimal(v2)
v1['v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Callable
Dependencies:
```python
def v0(self, v1: None, v2: Optional[api_call_context.ApiCallContext]=None) -> metadata.ApiGetGrrVersionResult:
v3 = this._original_handler_handle(self, v1, context=v2)
v3.release += 1
return v... |
Imports:
```python
import datetime
import glob
import typing
```
Type definitions:
Input Types: list, int
Output Type: Any
Dependencies:
```python
def v0(v1: list):
v2 = []
for v3 in v1:
v4 = v3.replace('\\', '/')
v2.append(v4)
return v2
```
```python
def v5(v6: int, v7: str='%Y%m%d'):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: any
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> any:
(v1, v2) = self.load_decks()
(v3, v4) = self.play_game(v1, v2)
print('Winner:', v3)
return v4
``` |
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:
v2 = '[\\s\\S]*?'
v3 = {re.compile(f'^TypeError: {v2} is null$'): 'TypeError: {%1%} is null', re.compile(f"^TypeError: Unable to delete... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Action):
def v1(self, v2: 'Player') -> bool:
return v2.valid_standard_action() and self.base_valid(v2)
```
Input Types: 'Player', 'StandardAction'
Output Type: Generator[v0, None, None]
Dependencies:
Function Name: v3
Function:
```p... |
Imports:
```python
from hashlib import sha1
from os import urandom
import typing
```
Type definitions:
Input Types: Sequence[str], int, int
Output Type: Callable[..., str]
Dependencies:
```python
def v0(v1: Sequence[str], v2: bytes) -> Generator[str, None, None]:
v3 = len(v1)
assert 1 < v3 < 256, 'alphabet len... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v1 = v1.strip()
v1 = v1.replace(' ', '-')
v1 = v1.lower()
return v1
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.array, np.array
Output Type: np.ndarray
Dependencies:
```python
def v0(v1: np.array, v2: np.array):
v3 = np.cross(v1[v2[:, 1]] - v1[v2[:, 0]], v1[v2[:, 2]] - v1[v2[:, 0]])
return (v3.T / np.linalg.norm(v3, axis=1)).T
```
... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: Dict[int, Any]
Output Type: Dict[int, Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[int, Any]) -> Dict[int, Any]:
v2 = list(v1.keys())
if len(self._policy) > 1:
assert not self._eval_flag
... |
Imports:
```python
import asyncio
from asyncio.transports import DatagramTransport
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1=None) -> None:
if not v1:
v1 = asyncio.get_event_loop()
await v1.create_da... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Flag):
v1 = auto()
v2 = auto()
v3 = auto()
v4 = auto()
v5 = auto()
v6 = auto()
v7 = auto()
v8 = auto()
v9 = auto()
v10 = auto()
v11 = auto()
v12 = auto()
v13 = auto()
v14 = auto()
v15 = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, np.ndarray]
Output Type: Dict[str, Tuple[List[str], List[np.ndarray], List[float]]]
Dependencies:
```python
def v0(v1: Dict[str, np.ndarray], v2: Optional[str]=None) -> Tuple[List[str], List[np.ndarray], List[float]]:
if v2 is None:
... |
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 = len(v1) - 1
v4 = len(v2) - 1
v5 = 0
v6 = 0
while v3 > -1 or v4 > -1:
if v1[v3] != v2[v4] and v2[v4... |
Imports:
```python
import json
import pandas as pd
import typing
```
Type definitions:
Input Types: t.List[t.Dict], t.Optional[str], t.List[t.Dict], t.Optional[str]
Output Type: t.List[t.Dict]
Dependencies:
```python
def v0(v1: t.List[t.Dict], v2: t.Optional[str]=None) -> pd.DataFrame:
v3 = get_columns(ProductsRep... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str) -> bool:
v3 = v1.find('%lo')
v4 = v1.find('%hi')
v5 = v2.find('%lo')
v6 = v2.find('%hi')
if v3 != -1 and v5 != -1:
v7 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.queue.put(None)
self.writer_thread.join()
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(models.Model):
v1 = 40
v2 = 1000
v3 = 40
v4 = 128
v5 = 3000
v6 = 10000
v7 = ['Google', 'Email', 'GitHub', 'LDAP', 'Dev', 'RemoteUser', 'AzureAD', 'SAML', 'GitLab', 'Apple', 'OpenID Connect']
v8 = ''
v9 = 15
... |
Imports:
```python
import cv2, h5py, math
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3) -> bool:
v4 = v3[0]
v5 = str(v3[1])
v6 = v3[2]
v7 = v3[3]
v8 = v3[4]
v9 = v3[5]
v10 = v8 -... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(dict):
def __init__(self, **v1: Any):
super().__init__(self, **v1)
def v2(self, v3: object) -> bool:
"""Check for content equality of two datadicts."""
if not isinstance(v3, v0):
return NotImplemented... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str) -> list:
if isinstance(v1, str):
v1 = Path(v1)
v4 = []
for v5 in v1.iterdir():
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
(v1, v2) = self.get_coords('matches_played')
assert isinstance(v2, str), 'mypy'
v3 = self.fonts[v2]
self._draw.text(xy=v1, text=str(self.play... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('QIntType', bound='QUInt')
```
Input Types: int
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: int) -> v0:
if v2 < -(1 << self.num_qubits - 1) or v2 >= 1 << self.num_qubits - 1:
raise Excepti... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: int) -> int:
if v1 >= v2:
return v1 - v2
if v2 % 2 == 0:
return 1 + self.brokenCalc(v1, v2 // 2)
if v2 % 2 == 1:
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = IterableStreamInterface
```
Input Types: v0, bool
Output Type: v0
Dependencies:
Function Name: v1
Function:
```python
def v1(self, v2: v0, v3: bool=False) -> v0:
v4 = self.get_count()
v5 = v2.get_count()
if v4 is not None and v5 is not N... |
Imports:
```python
import random, math
import typing
```
Type definitions:
Input Types: Interpreter.Context
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Interpreter.Context) -> Optional[str]:
try:
v2 = v1.verb.payload.split('-')
random.seed(v1.ver... |
Imports:
```python
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: Tensor, Tensor
Output Type: Tensor
Dependencies:
```python
def v0(v1: Tensor, v2: Tensor) -> Tuple[Tensor, Tensor]:
v3 = box_area(v1)
v4 = box_area(v2)
v5 = torch.max(v1[:, None, :2], v2[:, :2])
v6... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Dict[str, Any]]
Output Type: Dict[str, Dict[str, Any]]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Dict[str, Any]]) -> Dict[str, Dict[str, Any]]:
v1['Active'] = {}
v1['Base'] = {'ignore': None}
... |
Imports:
```python
import numpy
import typing
```
Type definitions:
Input Types:
Output Type: 'Nparray'
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> 'Nparray':
v1 = self.norb()
v2 = v1 * (v1 + 1) // 2
v3 = numpy.zeros((v2, self.lena(), self.lenb()), dtype=self._dtype)
for v4 in... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Dict[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> Dict[str, str]:
v2 = dict()
for v3 in v1:
v4 = self._convert_line_to_hash(v3.strip())
v2[v4] = v3.strip()... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Callable):
global registered_callback_entries
v2 = [entry for v3 in v2 if v3.callback != v1]
``` |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributions as D
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:
(v2, v3) = v1.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2=2, v3=3, v4=vocab_size):
v1 = v1 + 3
v1[v1 > v4 - 1] = v2
return v1
``` |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: float, Optional[int]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float=0.5, v2: Optional[int]=None):
v3 = random.Random(v2)
if v2:
for v4 in range(100):
v3.getrandbit... |
Imports:
```python
import typing
```
Type definitions:
Input Types: argparse.ArgumentParser, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: argparse.ArgumentParser, v2: str):
v1.add_argument('-l', '--list', action='store_true', help='list all possible %s types the current F Pr... |
Imports:
```python
from PIL import Image, ImageTk
import typing
```
Type definitions:
Input Types: Image
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Image):
self.clear_canvas()
self.model.current_image = v1
self.model.canvas_image_dimensions = self.calculate_canva... |
Imports:
```python
import ast
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
for v2 in v1.body:
if isinstance(v2, ast.AnnAssign):
self.visit_AnnAssign(v2)
``` |
Imports:
```python
from pathlib import Path
import subprocess
import sys
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
v1 = [sys.executable, '-m', 'cgt_calc.main', '--year', '2020', '--schwab', 'tests/test_data/schwab_tran... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: List[dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]=None) -> List[dict]:
v2 = ['name', 'comment', 'hash', 'save_path']
v3 = self.query(self.build_request_payload('webapi.get_torrent... |
Imports:
```python
import pandas._libs.lib as lib
from pandas._typing import FilePath, ReadCsvBuffer, Scalar
from pandas.errors import EmptyDataError, ParserError
from pandas.util._exceptions import find_stack_level
from pandas.core.dtypes.common import is_integer
from pandas.core.dtypes.inference import is_dict_like
f... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1=[], v2='') -> None:
for v3 in v1:
v3['active'] = True if v3['url'] == v2 else False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
```python
def v0() -> Union[Bucket, DataSet]:
return global_env.SELECTED_BUCKET if global_env.CURRENT_DATASET is None else global_env.CURRENT_DATASET
```
Function Name: v1
Function:
```python
def v1(v2: str):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
assert self._budget is not None, 'Must call init_for_experiment() first'
return self._consumed_energy > self._budget
``` |
Imports:
```python
import numpy as np
from scipy.stats import norm
import typing
```
Type definitions:
Input Types: float, Union[float, np.ndarray], bool, Union[float, np.ndarray], float, float
Output Type: Union[float, np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float, v2: Union[float,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[int]
Output Type: Tuple[int, ...]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[int]) -> Tuple[int, ...]:
with open(v1) as v3:
v4 = v3.readline()
v5 = tuple((int(x) for v6 in ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: List[int]
Dependencies:
```python
def v0(v1: List[int]) -> List[int]:
v2 = len(v1)
for v3 in range(v2):
v4 = v1[v3]
v5 = v3 - 1
while v5 >= 0 and v1[v5] > v4:
v1[v5 + 1] = v1[v5]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int):
v2 = [-1] * (v1 + 2)
v2[0] = 0
v2[1] = 1
for v3 in range(2, v1 + 1):
v2[v3] = v2[v3 - 1] + v2[v3 - 2]
return v2[v1]
``` |
Imports:
```python
import csv
import typing
```
Type definitions:
Input Types: str, Any
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2) -> dict:
with open(v1, 'r', encoding='utf-8') as v3:
v4 = list(map(dict, csv.DictReader(v3, skipinitialspace=True)))
if ... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributed as dist
import typing
```
Type definitions:
Input Types: nn.Module, float
Output Type: Any
Dependencies:
```python
def v0(v1: nn.Module, v2: float=1.71):
if isinstance(v1, nn.Conv2d):
v1.weight.da... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.recarray
Output Type: SharedMemory
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: np.recarray) -> SharedMemory:
v2 = self.smm.SharedMemory(v1.nbytes)
v3 = np.recarray(v1.shape, dtype=v1.dtype, buf=v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, Any
Output Type: List[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2) -> List[float]:
if isinstance(v2, tuple):
return list(v2)
elif isinstance(v2, list):
return v2
else:
r... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, *, v1: str, v2: str, v3: Server, v4: str, v5: Dict[str, str], v6: List[str], v7: Optional[int]=None, v8: Optional[int]=None, v9: bool=False, v10: bool=False) -> None:
self.tags = set(v6)
self.job_key = v2
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: (int, int)
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> (int, int):
v2 = int(v1[0]) - 1
v3 = ord(v1[1]) - ord('a')
return (v2, v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> None:
for v2 in v1:
for v3 in v2:
if v3 != v2[-1]:
print(v3, end=' ')
else:
print(v3, e... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[Dict[str, Any]]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[Dict[str, Any]]) -> int:
v2 = 0
for v3 in v1:
v4 = v3.pop('defaultValue', None)
if v4 is not None:
v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> str:
v2 = v1.split(' ')[::-1]
v3 = ''
for v4 in v2:
if v4 != '':
v3 += v4.strip()
v3 += ' '
return v3[:-... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: list, list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: list) -> list:
v3 = []
for v4 in v2:
v5 = {'name': v4['name']}
v5['no_of_contestants'] = v4['no_of_contestant... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1 = jinja2.PackageLoader('pandas', 'io/formats/templates')
v2 = jinja2.Environment(loader=v1, trim_blocks=True)
v3 = v2.get_template('html.tpl')
def __init__(self, v4: FrameOrSeriesUnion, v5: Optional[int]=None, v6: Optional[CS... |
Imports:
```python
import numpy as jnp
import typing
```
Type definitions:
Input Types: jnp.ndarray, jnp.ndarray, float, float, float, float, float, float, Any
Output Type: Tuple[jnp.ndarray, jnp.ndarray]
Dependencies:
```python
def v0(v1: jnp.ndarray, v2: jnp.ndarray, v3: jnp.ndarray, v4: jnp.ndarray, v5: float=0.0, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[Any]
Output Type: Any
Dependencies:
```python
def v0(v1):
if callable(v1):
return self.mesh.facets_satisfying(v1)
return v1
```
Function Name: v2
Function:
```python
def v2(self, v3: Optional[Any]=None) -> Any:
if v3 is No... |
Imports:
```python
import numpy as np
from numpy.linalg import det, inv
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:
v2 = np.ndarray.argmax(self.likelihood(v1) * self.pi_, axis=1)... |
Imports:
```python
import seaborn as sns
from scipy.stats import spearmanr
import typing
```
Type definitions:
Input Types: str, str, pd.DataFrame, str, plt.Axes
Output Type: plt.Axes
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: pd.DataFrame, v4: str, v5: plt.Axes, **v6) -> plt.Axe... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: mpmath.mpf
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int) -> mpmath.mpf:
v3: mpmath.mpf = globals()[v1].pi(v2)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[Container[str]]
Output Type: Iterable['Maze']
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[Container[str]]=None) -> Iterable['Maze']:
for v2 in self.mazes(symbols=v1):
if v2.is_deadend:
... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: Optional[datetime]
Output Type: Optional[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Optional[datetime]) -> Optional[int]:
if not isinstance(v1, datetime):
return v1
return v1.time... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[str]:
if self.noOp:
return []
v1: List[str] = []
v2: sqlite3.Cursor = self.dbConn.cursor()
try:
v2.execute("SELECT name F... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: model.IsYes
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> model.IsYes:
v1 = 'Double down?'
v2 = 'y'
return self._yesno_prompt(v1, v2)
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.