text stringlengths 190 325k |
|---|
Imports:
```python
import torch
from tqdm import tqdm
import numpy as np
import torch.nn.functional as F
from torch.utils.data import DataLoader
import typing
```
Type definitions:
```python
v0 = Dict[str, List[float]]
```
Input Types: DataLoader, v0
Output Type: None
Dependencies:
Function Name: v1
Function:
```pytho... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: int, int, int, int
Output Type: float
Dependencies:
```python
def v0(v1: int, v2: int) -> Tuple[float, float]:
v3 = v2 / v1
v4 = math.sqrt(v3 * (1 - v3) / v1)
return (v3, v4)
```
Function Name: v5
Function:
```python
def v5(v6:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any
Output Type: Iterable[any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any, v2=False, v3=None, v4=False) -> Iterable[any]:
v5 = self.neighbor_arrays(v1, v2, v3, use_ilocs=v4)
return self._to_neighbo... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame, v2: str):
v3 = pd.Series(data=[int(v1[v2].mean()), int(v1[v2].std()), v1[v2].median(), int(v1[v2].min()), int(v1[v... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: str, Callable
Output Type: Any
Dependencies:
```python
def v0(v1: Callable, *v2, **v3) -> List[List[BufferedData]]:
if not v3.get('groupby'):
raise Exception('Group sample must be used when the `groupby` parameter is specifie... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Chem.Mol, Chem.Mol, int, int
Output Type: np.float
Dependencies:
```python
def v0(v1, v2):
v3 = v1.GetConformer()
return np.array(v3.GetAtomPosition(v2))
```
Function Name: v4
Function:
```python
def v4(self, v5: Chem.Mol, v... |
Imports:
```python
import torch
import torch.nn as nn
import torch.optim as optim
import typing
```
Type definitions:
Input Types: float
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float=0) -> torch.Tensor:
if isinstance(v1, (int, float)):
v2 = v1 * torch... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = []
for v2 in self._valid_vertex_labels():
v1.append(v2.to_dict())
v3 = []
for v2 in self._valid_edge_labels():
v3.append... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[Any]], Optional[List[Any]], bool
Output Type: str
Dependencies:
```python
def v0(v1: List[List[Any]], v2: List[int], v3: bool=False) -> str:
v4 = []
for v5 in v1:
v6 = '│'
for (v7, v8) in enumerate(v5):
v6... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = '"success" : "([01])"'
v3 = re.compile(v2)
return v3.search(v1).group(1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes, int
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes, v2: int=0) -> None:
super().feed_data(v1, v2)
if self._size > self._limit and (not self._protocol._reading_paused):
self._protoco... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[int, int, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> Tuple[int, int, int]:
try:
v2 = int(v1, 16)
except ValueError:
raise
else:
v3 = v2 >> 16 & 255
... |
Imports:
```python
from torch import cat, Tensor
from torch.nn import Module, Linear, GRU, ModuleList, ReLU, BatchNorm1d, Conv1d, Sequential, BatchNorm2d, Conv2d
import torch
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Fun... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = v1.split(',')
v2 = [ll.strip() for v3 in v2]
return ','.join(sorted(list(filter(None, v2))))
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Solution):
def __init__(self, v1: Problem, v2: Union[List[int], np.array]=None, v3: int=None, v4: int=None):
self.problem = v1
self.colors = v2
self.nb_color = v3
self.nb_violations = v4
def v5(self):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.verbose:
print(f'Uploading time: {self.uploading_time:.2f}', f'Server processing time: {self.uploading_process_time - self.uploading_time... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types: str, str, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: int=0, v4: int=0):
v5 = self._create_session()
v6 = {'retentionTimeInMinutes': v3, 'retentionSizeInMB': v4}... |
Imports:
```python
import ftplib
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
```python
def v0(v1: str) -> bool:
v2 = v1.split('.')
return len(v2) == 2 and v2[0].isnumeric() and v2[1].isnumeric()
```
Function Name: v3
Function:
```python
def v3(v4: str, v5: str) -> s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = v1
v3 = self.template_finder.get_target(v2)
if v3:
return ((), {'template': v2, 'target': v3})
return None
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if self.__config and self.KEY_OUTPUT_FOLDER_PATH in self.__config:
v2 = self.__config[self.KEY_OUTPUT_FOLDER_PATH]
... |
Imports:
```python
import asyncio
from contextlib import suppress
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
if self._watcher_task is None:
return
self._watcher_task.cancel()
with suppress(asyn... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Sequence[str], Callable[..., None]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Sequence[str], v2: Callable[..., None]) -> Any:
(v3, v4) = ('([{<', ')]}>')
v5 = []
for v6 in v1:
v7 = []
... |
Imports:
```python
import inspect
import re
import typing
```
Type definitions:
Input Types:
Output Type: Set[Text]
Dependencies:
```python
def v0(v1: Callable) -> Set[Text]:
v2 = set()
v3 = inspect.getsource(v1)
v4 = '.match_attributes\\[\\"(\\w+)\\"\\]'
v5 = re.findall(v4, v3)
for v6 in v5:
... |
Imports:
```python
import torch
import typing
```
Type definitions:
Input Types: float, Optional[torch.Tensor]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float, v2: Optional[torch.Tensor]=None):
if v2 is not None:
v3 = torch.full((self.nnz(),), v1, dtype=v2.dtype... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = self._get_cache_full_path(v1)
try:
v3 = self._load_file(v2)
except:
return None
if self._is_expired(v3):
retu... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Generic[T]):
v1: T
v2: list[v0[T]]
v3: Number
v4: RNGType
v5: Callable[[v0[T]], Any]
v6: Callable[[v0[T]], Any]
def __init__(self, v7: T, v8: float, *, v9: RNGType=random.random, v10: Optional[Callable[[v0[T]], Any]]=... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.obs = self.env.reset()
self.done = False
self.info = {}
self.step_counter = 0
self.episode_counter = 0
self.episode_reward = 0.0... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, List[str], pyexiv2.metadata.ImageMetadata
Output Type: Union[List[float], None]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: List[str], v3: pyexiv2.metadata.ImageMetadata) -> Union[List[float], None]:
v4 = None
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2=None, v3=None):
self.value = v1
self.prev = v2
self.nxt = v3
```
Input Types: v0
Output Type: int
Dependencies:
Function Name: v4
Function:
```python
def v4(self, v5: v0) -> int:
v6 = s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
v2 = self.x()
v3 = self.x() + self.width()
v4 = v2 <= v1.x() <= v3 or v2 <= v1.x() + v1.width() <= v3
v5 = self.y()
v6 = self.y() ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable[pathlib.Path], bool
Output Type: Iterable[pathlib.Path]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Iterable[pathlib.Path], v2: bool=False) -> Iterable[pathlib.Path]:
v3: List[pathlib.Path] = []
for v4 in v1:
... |
Imports:
```python
import asyncio
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
await asyncio.sleep(10)
self.get_logger().info('Sorting complete.')
self._nav_client.destroy()
self._picker_client.destr... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict, str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict=None, v3: str=None) -> dict:
if not v2:
v2 = {}
if not v3:
v3 = {'$exists': True}
v2.update({'name': v3} i... |
Imports:
```python
import torch as tc
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: tc.Tensor, tc.Tensor, str, str
Output Type: Any
Dependencies:
```python
def v0(v1: tc.Tensor, v2='cpu'):
v3 = tc.eye(len(v1) - 1, device=v2)[:-1, :].unsqueeze(0)
v3 = tc.repeat_interleave(v3, ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray):
v2 = v1.shape[1] - 1
v3 = v1.shape[0] - 1
v4 = (int(v1[0, 0]) + int(v1[0, v2]) + int(v1[v3, 0]) + int(v1[v3, v2])) / 4
v5 = 0
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=None, v2: int=None) -> Dict:
v3 = self.get_url('jobs')
v4 = {}
if v1:
v4['limit'] = v1
if v2:
v4['offset'] = v2
re... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> dict:
for v2 in self.attributeThresholds:
self.requestedAttributes[v2] = {}
v3 = {'comment': {'text': v1}, 'languages': self.lang, 'req... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Model):
v1: str
v2: str
v3: str
v4: str
v5: bool
v6: List[str]
v7: List[str]
v8: str
v9: str
v10: str
v11: str
v12: str
def v13(self, v14: str) -> v0:
self.store_id = v14
return... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('T')
```
Input Types: FrozenSet[v0], FrozenSet[v0], bool
Output Type: bool
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: FrozenSet[v0], v3: FrozenSet[v0], v4: bool=False) -> bool:
v5: bool = bool(v2 & v3 == v2)
if v4... |
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):
for v2 in v1.sessions().keys():
v3 = v1.sessions()[v2]
print(v3)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
print('child { node{' + self.name + '}')
for v1 in self.data.values():
v1.to_latex()
print('}')
``` |
Imports:
```python
import io
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.keras as K
import typing
```
Type definitions:
Input Types: plt.Figure
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: plt.Figure) -> tf.Tensor:
v2 = io.BytesIO()
plt.sa... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.path = Path('dummy')
self.roles = ['role1', 'role2']
self.invalid_name = 'invalid/name'
self.json_file = {'appl... |
Imports:
```python
from statistics import mean
import typing
```
Type definitions:
Input Types: float
Output Type: Any
Dependencies:
```python
def v0(self, v1: float, v2: bool=False):
if v2:
v3 = iter(reversed(self.wordlist))
else:
v3 = iter(self.wordlist)
v4 = set()
v5 = 0
v6 = 0
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: float
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: float) -> float:
if v1 < 1.0:
return 1 + 1 / np.log10(1 - v1)
else:
return 1
``` |
Imports:
```python
import pandas as pd
from typing import Iterable
import typing
```
Type definitions:
Input Types: Iterable[str], Any, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[str], v2, v3: int=1000000):
v4 = []
if isinstance(v1, Iterable):
v5... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, bool
Output Type: treelib.Node
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: bool=False) -> treelib.Node:
v4 = self.get_path_node(v1)
for v5 in self.children(v1):
if v5.tag == v2:
... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: str
v2: str
v3: int
```
```python
class v4(NamedTuple):
v5: Optional[Traceback]
v6: NameStack
def v7(self, *, v8: Optional[Traceback]=None, v9: Optional[NameStack]=None) -> 'SourceInfo':
v8 = v8 o... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Edge'
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Edge') -> bool:
if v1 in self.out_bound_edges:
self.out_bound_edges.remove(v1)
return True
return False
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: sa.MetaData, runner.Runner
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: sa.MetaData, v2: runner.Runner):
v3 = v1.info.setdefault('edges', {})
if len(v3) != 0:
v3 = v3['public']
v4 = {}
for v5... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
v1: int = 0
v2: str = ''
v3: Decimal = Decimal(0)
v4: Decimal = Decimal(0)
v5: int = 0
```
Input Types: str, str, str, int, int, int, int, str, int, bool, bool, str, bool, bool, bool, Optional[pathlib.PurePath]
Output Type: v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: float
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float) -> None:
for v2 in self.components:
v2.discretize(v1)
for v2 in self.components:
v2.initialize()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
if v1 < self.k_paths * self.j:
(v2, v3) = self._get_path_block_id(v1)
(v4, v5) = self.get_available_blocks(v2)
if v3 < len(v4)... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bool=True) -> str:
v2 = '0'
v3 = 7
if v1:
v3 = 8
v2 += str(random.randint(1, 9))
for v4 in range(0, v3):
v2 += str(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Array
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Array, *v2: int) -> None:
v3 = tuple(v2)
assert v1.chunksize == v3, f'Expecting chunk shape {v3}, found {v1.chunksize}'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: list) -> list:
v2 = []
for v3 in v1:
if (v4 := self.image_cache.get(v3)):
v2.append(v4)
else:
v4 = self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: Union[int, str], v2: int) -> str:
v3 = ''
if type(v1) == type(0.0):
v3 = hex(int(v1))
elif type(v1) == type(0):
v3 = hex(v1)
elif type(v1) == type(''):
v3 = ... |
Imports:
```python
from tqdm import tqdm
import typing
```
Type definitions:
Input Types: Any, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1=5.0, v2: bool=True):
self.model.train()
v3 = []
if v2:
v4 = tqdm(self.train_dataloader)
v4.set_descriptio... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[int]]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[List[int]]) -> int:
self.res = []
v2 = len(v1)
v3 = len(v1[0])
for v4 in range(v2):
for v5 in range(v3):
se... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
class v0(BaseBox):
def __init__(self, v1, v2=0, cls=0):
super().__init__()
if isinstance(v1, list):
v1 = np.array(v1, dtype=np.float32)
v1 = np.reshape(v1, [2, -1])
self.min = np.array(v1... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, Any, Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2, v3=None, v4='location') -> bool:
if v1 == '@id':
self._kg['@id'] = v2
return True
if v1 == '@type' and self.ori... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[str]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Optional[str]=None) -> None:
if v1 is None:
self.println('endmodule')
else:
self.println('endmodule // %s' % v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: bool) -> None:
global NSLOG_SUPPRESS
v2 = v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1, v2: str):
v3 = await self.config.guild(v1.guild).mysql_prefix()
v4 = f'SELECT ckey FROM {v3}discord_links WHERE one_time_token = %s AND times... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[list, str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[list, str]=None):
if isinstance(v1, (list, tuple)):
self._messages.extend(v1)
elif v1:
self._messages.append(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict) -> str:
v2: str = v1['Letterboxd URI']
return v2.split('/')[-1]
``` |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types:
Output Type: argparse.Namespace
Dependencies:
Function Name: v0
Function:
```python
def v0() -> argparse.Namespace:
v1 = argparse.ArgumentParser(description=__doc__)
v1.add_argument('--gn-scope', action='store_true', help='Fo... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
if v1 in self._observers:
return None
self._observers[v1] = []
``` |
Imports:
```python
import pipes
import typing
```
Type definitions:
Input Types: List[Text], argparse.Namespace, Optional[Iterable[Text]]
Output Type: Text
Dependencies:
```python
def v0(v1: List[Text], v2: argparse.Namespace, v3: Optional[Iterable[Text]]=None) -> Sequence[Text]:
v4 = v1 + ['fix']
v4.extend(v2... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: Tuple[int, ...]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2) -> Tuple[int, ...]:
if not (v2 or v1):
return tuple(sorted(v1))
v2 = sorted(set(v2))
v1 = sorted(set(v1))
v3 = v4 = v5 = ... |
Imports:
```python
import os
import json
import logging
import typing
```
Type definitions:
Input Types: str, str, dict
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: str) -> str:
if v1:
v3 = f'{v1}-{v2}.json'
else:
v3 = f'{v2}.json'
return os.path.join(CONFIG.get('DIFFY_LOCA... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None) -> int:
if self.resource.Bucket(v1) in self.resource.buckets.all():
self.BUCKET = v1
return 1
else:
log... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> bool:
if not hasattr(self, '_cache'):
return False
v2 = self._cache
if v2 is None:
return True
v3 = v2.time
if v3 is Non... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2, v3, v4):
v5 = []
for v6 in v1.keys():
v5.extend([v6] * len(v1[v6]))
for v6 in v5:
assert v6 in v2
v2.remov... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
self.notset_caches.add(v1)
v2 = set()
for v3 in self.fully_cached_keys:
if not v3.startswith(v1 + '.') and v3 != v1:
v2.ad... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict=None, v2: bool=True):
if v1 is None:
v1 = {}
if not v2:
v1['filter[terminated]'] = False
v3 = f'{self.endpoint}/v1/contr... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = subprocess.Popen(v1, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
(v3, v4) = v2.communicate()
v3 = v3.decode('... |
Imports:
```python
import urllib.parse as parse
import urllib.request as request
import json
import typing
```
Type definitions:
Input Types: [str]
Output Type: [str]
Dependencies:
```python
def v0(v1: object) -> bool:
v2 = v1['info']['statuscode']
if v2 == 0:
return True
if v2 >= 400 and v2 <= 403... |
Imports:
```python
import torch
import torch.nn as nn
from sklearn.metrics import mean_absolute_error, mean_squared_error
import typing
```
Type definitions:
Input Types: list, int, bool, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list, v2: int, v3: bool, v4=None, v... |
Imports:
```python
from collections import OrderedDict
import typing
```
Type definitions:
Input Types: str, bool
Output Type: OrderedDict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: bool=True) -> OrderedDict:
if self.has(v1):
raise ValueError('MMS ID already exists in DB... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
self.x = v1
self.updateViewRect()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: ArgumentParser
Output Type: Tuple[ArgumentParser, List[str]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: ArgumentParser) -> Tuple[ArgumentParser, List[str]]:
v1.add_argument('--mapi-broadcast', action='store_true', help='turn o... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Set[str], Set[str]
Output Type: List[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Set[str], v2: Set[str]) -> List[float]:
self.init_training(pos_uri=v1, neg_uri=v2)
v3 = self.operator.get_node(self.start_class, ... |
Imports:
```python
import numpy as np
from scipy.optimize import curve_fit, fsolve
from scipy.stats import linregress
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, **v3) -> None:
v4 = linregress(v1, v2, **v3)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[List[int], List[int]]
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Tuple[List[int], List[int]]:
v1 = int(input())
v2 = list(map(int, input().strip().split()))
v3 = list(map(int, input().strip().split... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str, **v2: object) -> str:
v3 = v1 % v2
if indent:
v3 = re.sub('^(?!(#|$))', str(indent), v3, flags=re.MULTILINE)
return re.sub(re.escape(EATSPACE) + ' *', '', v3)
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types: tp.Union[tp.Tuple[type, ...], type]
Output Type: Predicate[object]
Dependencies:
```python
@wraps(fun)
def v0(v1):
for v2 in v1:
yield fun(v2)
```
Function Name: v3
Function:
```python
def v3(v4: tp.Union[tp.Tuple[type, ...], type]) -> Pre... |
Imports:
```python
import pprint
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.series.keys()
v2 = []
for v3 in v1:
v2.append(self._series_to_FHIR(v3))
print(pprint.pformat(v2))
self.se... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2, v3, v4):
"""
psv_ix = index of the PSV across all PSVs,
variant_ix = tuple (index of the variant across all variants, index of PSV in the variant).
"""
se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[List[str]]
Output Type: None
Dependencies:
```python
def v0() -> bool:
for v1 in range(9):
for v2 in range(9):
if board[v1][v2] == '.':
for v3 in map(str, range(1, 10)):
if not valid(v1,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable, Dict
Output Type: Iterator
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Callable, v2: Dict=None) -> Iterator:
v2 = v2 or {}
v2['maxResults'] = self.results_per_page
while True:
v3 = v1(params={**v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1: dict, v2='='):
v3 = ['{var}{sep}{value}'.format(var=var, value=v1[var], sep=v2) for v4 in sorted(v1.keys())]
return v3
```
Function Name: v5
Function:
```python
def v5(self, v6... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.logger.debug('Returning to path "{}"'.format(self.original_path))
os.chdir(self.original_path)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: tuple
Output Type: tuple
Dependencies:
```python
@njit()
def v0(v1, v2, v3, v4, v5):
v6 = v3 - v2
v7 = v5 - v4
return (v1 - v2) * v7 / v6 + v4
```
Function Name: v8
Function:
```python
def v8(self, v9: tuple) -> tuple:
v10 = v0(v9[0], ... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: int, dt.datetime, dt.datetime, dt.timedelta, str, str
Output Type: pd.Series
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: dt.datetime, v3: dt.datetime, v4: dt.timedelta, v5: str, v6: str) -> pd.Ser... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list:
v1 = self.to_partition()
v2 = [c for v3 in v1.addable_cells() if v3[1] in self.antisymmetric_part()]
return [v1, v2]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, List, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: List, v3: str) -> bool:
v4 = v3.find(v1)
assert v4 >= 0
return 'xmm' in v2[v4]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: str):
v3 = dict()
for (v4, v5) in v1.items():
v6 = {'': 'INFO_DEV_HINT_NONE', 'gsmmodem': 'INFO_DEV_HINT_GSM_MODEM'}
v7 ... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: Any
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> pd.DataFrame:
v1['ID_Recurso'] = v1['Description'].str.extract("with course module id\\s'(\\d*)'\\.", expand=True)
v1['ID_Recu... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool):
self.configure(command=self._cmd)
return self
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.