text stringlengths 190 325k |
|---|
Imports:
```python
import numpy
from matplotlib import pyplot as plt
import typing
```
Type definitions:
Input Types: numpy.ndarray, numpy.ndarray, float, bool
Output Type: int
Dependencies:
```python
def v0(v1: numpy.ndarray) -> int:
v2 = numpy.random.random()
v3 = v1.cumsum()
return numpy.searchsorted(v3... |
Imports:
```python
import tensorflow as tf
from tensorflow.contrib.image import rotate as tf_rotate
import typing
```
Type definitions:
Input Types: tf.Tensor, Tuple[int, int], Tuple[int, int]
Output Type: tf.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: tf.Tensor, v2: Tuple[int, int], v3: Tup... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = ('↑', '↗', '→', '↘', '↓', '↙', '←', '↖')
v2 = int(round(self._rotation / 45, 0))
return v1[v2]
``` |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as checkpoint
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, torch.Tensor, int, int, Optional[torch.Tensor]
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Functi... |
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()
while ' ' in v1:
v1 = v1.replace(' ', ' ')
return v1
``` |
Imports:
```python
from math import log10
import typing
```
Type definitions:
Input Types:
Output Type: List[float]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[float]:
v1 = []
for (v2, v3) in zip(self.get_character_frequency, self.get_emptylines_frequency):
try:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> int:
v2 = 0
if v1 != v1.lower():
v2 = 1
print(f'"{v1}" contain uppercase characters.')
if ' ' in v1:
v2 = 1
print(f'"{v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
v2 = self.db.makeRequest('SELECT * FROM gameRequests WHERE (discordID = ? OR discord2ID = ?) AND guildID = ?', v1, v1, self.guildID)
if len(v2) >... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> float:
self._assert_univariate()
return self._values[-1][0]
``` |
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_file_index(v1)
if v2 is None:
return None
else:
return self.nodes[v2]
``` |
Imports:
```python
import torch
from torch import Tensor, nn
from torch.nn import functional as F
from torch.distributions.one_hot_categorical import OneHotCategoricalStraightThrough
import typing
```
Type definitions:
Input Types: Tensor, Optional[Tuple[Tensor, Tensor]]
Output Type: Tuple[Tensor, Tensor]
Dependencies... |
Imports:
```python
import dataclasses
from dataclasses import is_dataclass
import typing
```
Type definitions:
Input Types: Type[Any]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Type[Any]) -> None:
if not is_dataclass(v1):
raise TypeError(f'{v1!r} is not a datacl... |
Imports:
```python
import numpy as np
from numpy.random import Generator
from numpy.random import PCG64
import typing
```
Type definitions:
Input Types: str, np.ndarray, np.ndarray, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: np.ndarray, v3: np.ndarray, v4):
... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.array, Any
Output Type: None
Dependencies:
```python
def v0(v1: np.ndarray) -> np.ndarray:
v2 = v1.sum(axis=0)
v2[v2 < v1.shape[0]] = 0
return v2.astype(bool)
```
Function Name: v3
Function:
```python
def v3(self, v4:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
assert self._num_versions > v1 >= 0, 'Version must be between 0 and %i' % self._num_versions - 1
if isinstance(self._doc, str):
with open(... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1, *v2):
return v1.lower()
```
```python
def v3(v4, *v5):
return v4.upper()
```
Function Name: v6
Function:
```python
def v6(self) -> None:
def v7(v8, *v9):
return v8.upper()
... |
Imports:
```python
import re
import datetime
import typing
```
Type definitions:
Input Types: str, str, dict
Output Type: Any
Dependencies:
```python
def v0(v1: int, v2: int):
v3 = DomainInteractionPairJson(v1, v2)
v4 = v3.verifyDDIpairExistenceID()
if v4 == -1:
v3 = v3.setDomainInteractionPair()
... |
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 self.path:
if self.mask[v1][v2] == 1:
self.mask[v1][v2] = 0
else:
self.mask[v1][v2] = 1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: DataFrame
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: DataFrame):
print('validating data...')
self.check_old_names(v1)
self.check_categories(v1)
self.check_nulls(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Enum):
v1 = 1
v2 = 2
v3 = 3
v4 = 4
v5 = 5
v6 = 6
v7 = 7
v8 = 8
v9 = 9
```
```python
@dataclass
class v10:
v11: int = 0
v12: List[Leaf] = Factory(list)
v13: Dict[LeafID, List[Leaf]] = Factory(dict)
... |
Imports:
```python
import torch
from torch.nn import Parameter
import torch.nn as nn
import numpy as np
import typing
```
Type definitions:
Input Types: int, float
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=100, v2: float=3) -> torch.Tensor:
v3 = np.linspace... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
with self.assertRaises(FileNotFoundError):
self.root.traverse('does_not_exist')
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, datetime
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: datetime=None):
v3 = self._client.subreddit('all').search(v1, sort='new')
if v2 is None:
return v3
else:
v4 = []
... |
Imports:
```python
import numpy as np
import math
import typing
```
Type definitions:
Input Types: np.ndarray, float, Tuple
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.ndarray, v2: float, v3: Tuple):
v4 = np.empty(v1.shape, dtype=np.float32)
v5 = v1.copy()
v5[:, 0] -... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Tuple[str, int]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list) -> Tuple[str, int]:
v2: str = ''
v3: int = 0
for v4 in v1:
try:
v2 += v4
except TypeError:
v3 +... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[Callable[[str], bool]]
Output Type: Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: Optional[Callable[[str], bool]]=None) -> Optional[str]:
v3 = {'quit', 'exit', 'q'}
v4 = '-' * 80
if 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:
(v2, v3) = (0, v1)
while v2 <= v3:
v4 = v2 + (v3 - v2 >> 1)
v5 = v4 * (v4 + 1) >> 1
if v5 == v1:
return... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: AnyStr
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict) -> AnyStr:
if v1.get('case_name'):
return v1.get('case_name')
elif v1.get('case_name_full'):
return v1['case_name_full']
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = ', '.join([f'{column[0]} {column[1].typename}' for v2 in self.__columns])
self.__database.commit(f'CREATE TABLE IF NOT EXISTS {self.__identifier... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(PointMixin, pd.core.series.Series):
def v1(self, v2: 'Axes', v3: Optional[Dict[str, Any]]=None, v4: Optional[Dict[str, Any]]=None, **v5: Any) -> List['Artist']:
from ..drawing.markers import aircraft as aircraft_marker
from .... |
Imports:
```python
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: Options
Dependencies:
Function Name: v0
Function:
```python
def v0(v1=1472, v2=828, v3=True) -> Options:
v4 = Options()
v4.headles... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Any) -> None:
self._throw_error_if_key_doesnt_exist(v1)
self._db.update_one({'_id': v1}, {'$set': {self._VALUE_KEY: v2}})
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: argparse.ArgumentParser
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: argparse.ArgumentParser):
v1.add_argument('--id', dest='cluster_id', required=True, help='The unique id of your spark cluster')
v1.add_arg... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.birth_century_code: int = int(self.id[0])
self.birth_str: str = self.id[1:7]
self.governrate_code: str = self.id[7:9]
self.serial_number... |
Imports:
```python
from datetime import datetime
import typing
```
Type definitions:
Input Types: List[Dict[str, str]]
Output Type: None
Dependencies:
```python
def v0(v1: str) -> datetime:
v1 = v1.rjust(6, '0')
v2 = datetime.now().strftime('%Y%m%d')
v3 = f'{v2} {v1}'
v4 = datetime.strptime(v3, '%Y%m%d... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> dict:
v2 = self._get_request(f'{self._base_url}/accounts/{v1}/settings/bot')
return v2['data']['attributes']['settings']['bot']
``` |
Imports:
```python
import argparse
import glob
import os
import shutil
import subprocess
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: str, v2: str) -> None:
if not os.path.isdir(v2):
print("ERROR: '%s' is not a directory!" % v2)
exit(1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict, v2: bool):
v3 = dict()
for (v4, v5) in v1.items():
(v6, v7) = v5.split(':')
if v6 not in v3:
v3[v6] = dict()
... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = TypeVar('NodeType', bound='BinaryTreeNode')
```
Input Types:
Output Type: List[v0]
Dependencies:
Function Name: v1
Function:
```python
def v1(self: v0) -> List[v0]:
v2: List[Any] = []
if self.left:
v2.append(self.left)
if self.r... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Iterable[Axes], Callable, Dict[str, Iterable], Any
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[Axes], v2: Callable, v3: Dict[str, Iterable]=None, v4: Any=None) -> np.ndarray... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, float, float, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: float, v3: float, v4: bool):
if len(v1) == 0:
return
self.__pos_cache__[v1] = v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Path, Path, Path
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: Path, v3: Path):
if v1.is_file() or v1.is_dir():
return
if v2.is_file() or v2.is_dir():
return
if v3.is_file() or v... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1) -> None:
self.version = v1
v2 = re.match('([0-9.]+[0-9])(.*)', v1)
assert v2 is not None
v3 = v2.group(1).split('.')
assert 2 <= len(v3) <= 4
self.major = int(v3[0])
... |
Imports:
```python
import cv2
import numpy as np
from PIL import Image
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Any
Dependencies:
```python
def v0(v1: np.ndarray, v2: List[int]):
(v3, v4, v5) = v1.shape
(v6, v7) = v2
if v6 > v3:
raise ValueError('Provided crop height ... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
```python
def v0(v1: OsProject):
if not os.path.exists(Constants.cacheDir):
os.makedirs(Constants.cacheDir)
Utils.printInfo(f'Loading {v1.id}...')
v2 = StopWatch()
v3 = Shell(os.get... |
Imports:
```python
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor as T
import typing
```
Type definitions:
Input Types: T, T
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: T, v2: T):
v3: torch.Tensor = torch.max(v2, 1)[0]
v4 =... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types: str, Any
Output Type: List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2) -> List[str]:
if os.path.isfile(v1):
return [v1]
v3 = []
for (v4, v5, v6) in os.walk(v1):
v3.extend([os.path... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str | bytes | Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any) -> str | bytes | Any:
if hasattr(v1, 'astype'):
return v1.astype(self._obj.dtype.kind)
else:
return self._obj.dtype.t... |
Imports:
```python
import typing
```
Type definitions:
Input Types: typing.Dict[str, str], str, str
Output Type: 'Headers'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: typing.Dict[str, str], v2: str, v3: str) -> 'Headers':
self._headers = v1.copy()
self._headers[v2] = v3
return sel... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Environment', T.List[str], T.List[str], bool
Output Type: T.List[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Environment', v2: T.List[str], v3: T.List[str], v4: bool=False) -> T.List[str]:
v5 = []
for v6 in v2:... |
Imports:
```python
import json
from pathlib import Path
import typing
```
Type definitions:
Input Types: Any, Any
Output Type: dict
Dependencies:
```python
def v0() -> Path:
return Path(__file__).parent / 'fixtures'
```
Function Name: v1
Function:
```python
def v1(v2, v3) -> dict:
with open(v0() / v2 / v3, 'r'... |
Imports:
```python
import tensorflow as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor, v2: int):
if v2 > 0 and tf.equal(tf.math.mod(self._global_step, v2), 0):
self._context.current_batch =... |
Imports:
```python
import multiprocessing
import multiprocessing.pool
import os
import typing
```
Type definitions:
Input Types: Any, Any, Any
Output Type: multiprocessing.pool.Pool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3=False) -> multiprocessing.pool.Pool:
assert v1 in ('thread', '... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1, v2):
v3 = []
(v4, v5) = (0, 0)
while len(v3) < len(v1) + len(v2):
if v4 >= len(v1):
v3 += v2[v5:]
elif v5 >= len(v2):
v3 += v1[v4:]
elif ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Callable[[], Optional[rx.typing.Disposable]], int
Output Type: rx.typing.Disposable
Dependencies:
```python
def v0(v1, v2):
return inner_schedule_action(current_index=current_index + 1, action=action)
```
```python
def v3(v4: Callable[[], Optional... |
Imports:
```python
import math
import typing
```
Type definitions:
Input Types: Iterable[float]
Output Type: np.ndarray
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable[float]) -> np.ndarray:
v2 = 0
v3 = math.inf
v4 = 0
v5 = math.inf
v6 = 0
v7 = math.inf
for (v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: int, v3: int):
while v3 <= v2:
v1[v3] += 1
v3 += v3 & -v3
``` |
Imports:
```python
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=200, **v4):
assert v2.startswith('/')
v5 = v4.pop('timeout', self._timeout)
v6 = self.s.request(method=v1, url=self.backe... |
Imports:
```python
from bisect import bisect_left, bisect_right
import typing
```
Type definitions:
```python
@dataclass
class v0:
v1: int
v2: int
```
Input Types: int
Output Type: v0
Dependencies:
Function Name: v3
Function:
```python
def v3(self, v4: int) -> v0:
v5 = bisect_right(self.keys_local, v4) - 1... |
Imports:
```python
import matplotlib.pyplot as plt
import typing
```
Type definitions:
Input Types: keras.callbacks.History
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: keras.callbacks.History):
v2 = v1.history['accuracy']
v3 = v1.history['val_acc']
v4 = v1.history['loss... |
Imports:
```python
import re
from warnings import warn
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
if v1 != '':
v2 = re.search('>(.*)</a>', v1)
if v2 is not None:
v3 = v2.group(1)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self._builder.add_model()
self._builder.add_tires()
self._builder.add_engine()
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> str:
v2 = ''
for v3 in v1.split('\n'):
if 'return:' in v3:
v4 = v3.split()
if len(v4) > 1:
for v5 in range(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[int], v2: int) -> int:
v3: int = len(v1)
v4: int = 0
v5: int = v3 - 1
while v4 <= v5:
v6: int = (v4 + v5) // 2
if v2 <... |
Imports:
```python
from numbers import Number
import torch
import typing
```
Type definitions:
Input Types: Union[torch.dtype, torch.Tensor, Number], Union[torch.dtype, torch.Tensor, Number]
Output Type: torch.dtype
Dependencies:
```python
def v0(v1: Union[torch.dtype, torch.Tensor, Number]) -> torch.dtype:
if isi... |
Imports:
```python
import os
import re
import subprocess
import typing
```
Type definitions:
Input Types: Any, str, Any
Output Type: None
Dependencies:
```python
def v0(v1=[]):
v2 = executable_path()
if platform() == 'osx':
v3 = v2[:v2.rfind('.app/') + 5]
v2 = v3 + 'Contents/SharedSupport/bin/s... |
Imports:
```python
import torch
from torch import Tensor
import typing
```
Type definitions:
Input Types: Tensor, Tensor, str, Optional[Logger], bool
Output Type: Tuple[Tensor, Tensor]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tensor, v2: Tensor, v3: str='', v4: Optional[Logger]=None, v5: bool=Fa... |
Imports:
```python
from torch import nn as nn
import torch
import typing
```
Type definitions:
Input Types: torch.tensor, torch.tensor, torch.tensor, torch.tensor
Output Type: Any
Dependencies:
```python
def v0(v1: Tuple):
v2 = v1
return v2
```
Function Name: v3
Function:
```python
def v3(self, v4: torch.tenso... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
v1 = 'CREATE TABLE IF NOT EXISTS guilds (\n id numeric PRIMARY KEY,\n total_messages bigint NOT NULL DEFAULT 0\n )'
... |
Imports:
```python
import heapq
import random
import typing
```
Type definitions:
Input Types: int
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> int:
v2 = []
for (v3, v4) in enumerate(self.arrays):
if v4 == v1:
heapq.heappush(v2, (random.rand... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> dict:
v1 = {}
for (v2, v3) in self.__indexes.items():
v1[v2] = self.__abcd[v3]
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list=None):
if v1 is None:
v1 = self.predictors_left
v2 = [True if var in self._PREDICTORS_ALL else False for v3 in v1]
assert all(v2), 'No... |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types: Any
Output Type: argparse.Namespace
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> argparse.Namespace:
v2 = argparse.ArgumentParser(description='Make submission')
v2.add_argument('-i', '--input', help='path ... |
Imports:
```python
import datetime
import os
import pprint
import tensorflow as tf
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not self.has_closed:
self.run_txt_data['stop_time'] = datetime.datetime.now().... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.DataFrame) -> pd.DataFrame:
for v2 in v1.columns:
v1 = v1.explode(v2)
v1 = v1.reset_index(drop=True)
v3 =... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> None:
try:
self.clear_cache()
except TypeError:
pass
await self.session.close()
del self._max_cache_size, self.session, self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, Mapping[str, str]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: Mapping[str, str]) -> str:
if v3:
return f'DELETE FROM {v2}.{v1} {self._partition_where_clause(v3)}'
e... |
Imports:
```python
import torch
import torch.nn as nn
import torch.optim as optim
import typing
```
Type definitions:
Input Types: nn.Module, Any, Any
Output Type: Any
Dependencies:
```python
def v0(v1: nn.Module, v2: torch.Tensor, v3: torch.Tensor):
(*v4, v5, v6) = v3.shape
v1.output_size = (v5, v6)
```
Funct... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1, v2: str):
assert v2 in v1, 'Attempt to access node {} that not in graph'.format(v2)
super(v0, self).__setattr__('graph', v1)
super(v0, self).__setattr__('node', v2)
super(v0, self).__se... |
Imports:
```python
import asyncio
from asyncio import AbstractEventLoop
import typing
```
Type definitions:
Input Types: Optional[float]
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: Optional[float]=None) -> bool:
if not self.started():
return False
elif ... |
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 = [i for v4 in self.graph.neighbors(v1)]
v5 = [v4 for v4 in self.graph.neighbors(v2)]
return not v3[0] == v5[0]
``` |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: int, float
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int, v2: float):
v3 = 0
v4 = 0
self.adjusted_ingredients = copy.deepcopy(self.ingredients)
for v5 in self.adjusted_ingredient... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
```python
def v0(v1: str) -> str:
v2 = ''
for v3 in v1:
if v3 == ';' or v3 == '*':
break
v2 += v3
return v2
```
Function Name: v4
Function:
```python
def v4(v5: str) -> str:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: ParseResult, dict
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: ParseResult, v2: dict) -> list:
if '/comments/' in v1.path:
if not v2['data'].get('media_metadata'):
raise TypeError('Pla... |
Imports:
```python
import sys
import subprocess
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.event(f'- Updating {self.package_input} with {self.VENV_NAME}/bin/pip')
subprocess.check_call([f'{self.VENV_NAME}/b... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Callable
Dependencies:
```python
def v0(v1: np.ndarray, v2: DMatrix):
v3 = v2.get_label()
(v4, v5) = self._distribution.gradient_and_hessian(y=v3, params=v1, natural_gradient=self.natural_gradient)
return (v4.flatten(), v5.fl... |
Imports:
```python
import typing
```
Type definitions:
Input Types: np.float32
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: np.float32):
v2 = {'interictal': 'IC', 'seizure': 'SZ'}
v3 = ''
if v1 >= 3 and v1 <= 10:
v3 = v2['interictal']
elif v1 > 10:
v3... |
Imports:
```python
import math
import torch
from torch.utils.data.dataloader import DataLoader
import typing
```
Type definitions:
Input Types: torch.nn.Module, torch.nn.Module, torch.Tensor, torch.Tensor, torch.Tensor, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.nn.Modul... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
with self.socket.bind(self.address):
print('ZeroMQ Server listening at {}'.format(self.address))
while True:
v1 = self.socket... |
Imports:
```python
import statistics
import typing
```
Type definitions:
Input Types: list, str, Any, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: list, v2: str, v3, v4, v5=1, v6=1):
v7 = {}
for (v8, v9) in v1.items():
v7[v8] = 0
for v10 in v9:
... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str, str
Output Type: Callable[[str], str]
Dependencies:
```python
def v0(v1: str) -> str:
v2 = re.sub(pattern, replacement, v1, flags=re.DOTALL)
assert v1 != v2
return v2
```
Function Name: v3
Function:
```python
def v3(v4: str,... |
Imports:
```python
import os
from importlib import import_module
from importlib.util import module_from_spec, spec_from_file_location
import typing
```
Type definitions:
Input Types: object, str, str
Output Type: object
Dependencies:
```python
def v0(v1: object, v2: Tuple[str, str], v3: bool=False) -> object:
try:... |
Imports:
```python
from .signal import PortDir, Signal, Visibility, Slice, Concat, Sliceable, NoConn
import typing
```
Type definitions:
Input Types: Slice
Output Type: Sliceable
Dependencies:
```python
def v0(v1: Sliceable) -> bool:
return isinstance(v1, Signal) or (isinstance(v1, Slice) and isinstance(v1.signal,... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
v2 = self.data.dockerfile_images
if v2.is_empty:
v2 = self._parse_dockerfile_images(v1)
self.data.dockerfile_images = v2
... |
Imports:
```python
import csv
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> None:
try:
csv.Sniffer().sniff(v1)
except csv.Error:
assert False, 'output csv is incorrectly formatted'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
v1 = self._get_service_account()
return v1 == 'default'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: object, str, Union[str, set, tuple]
Output Type: bool
Dependencies:
```python
def v0(v1: object) -> Tuple[str, str]:
return (v1.__class__.__module__, v1.__class__.__name__)
```
Function Name: v2
Function:
```python
def v2(v3: object, v4: str, v5: ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3, v4, v5: str):
with self.scope(self.ir, f'multi({v1}, {v2}) # {v5})'):
if not v1:
self.apply1(v4, v2, v5)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, list
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: list) -> str:
v3 = '' if len(v2) == 0 else ', '.join(('_ {}: {}'.format(x.name if not x.is_builder else x.builded_variable_name, x.var_type) for v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: datetime
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: datetime):
if v1.day == 1:
return True
else:
return False
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.