text stringlengths 190 325k |
|---|
Imports:
```python
from datetime import datetime
import numpy as np
import typing
```
Type definitions:
Input Types: datetime, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: datetime, v2=True):
if v1 > datetime(2020, 5, 27, 9, 24, 43):
v3 = ['only_non_happy', 'meh', 'o... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1: Class) -> None:
"""name: the name of the value, for instances this is used solely for
debug/reporting purposes. In Class subclasses this will be the
qualified name (e.g. module.Foo).
k... |
Imports:
```python
import torch.optim as optim
from torch import Tensor
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, object]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Dict[str, object]:
if not isinstance(self.model_args['lr'], float):
raise ValueError(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[Tuple[Union[str, Tuple[str, str]], ...]], Optional[Dict[str, Any]], bool
Output Type: bytes
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[Tuple[Union[str, Tuple[str, str]], ...]]=None, v3: Option... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[int]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None, v2: Optional[int]=None) -> str:
if v1:
v3 = ['connect', v1]
else:
v3 = ['start-server']
v4 = self.execute(v... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(ObjectList):
def __init__(self, v1: 'list[BaseField]'=None):
super().__init__(list_type=BaseField)
if v1 is not None:
for v2 in v1:
self.add(v2)
def v3(self, v4: object) -> bool:
if no... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1=0, v2=None, v3=None):
self.val = v1
self.left = v2
self.right = v3
```
Input Types: v0
Output Type: v0
Dependencies:
```python
def v4(v5):
if not v5:
return (0, None)
(v6, v7) = ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: callable
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: callable):
for v2 in self.devices.items():
v1(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Iterable, bool
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Iterable, v2: bool=False) -> str:
if not len(v1) == self.cols_count:
v3 = 'row {} should be of length {}.'
raise Exception(v3.for... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Callable[[Doc, int, int], bool]
```
Input Types: str
Output Type: v0
Dependencies:
```python
def v1(v2: Doc, v3: int, v4: int):
print(f"DEBUG: {match_name} matched '{v2[v3:v4].text}' token indices {v3}:{v4}")
return True
```
Function Na... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'entry_mod.Entry', 'Schema'
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: 'entry_mod.Entry', v2: 'Schema'=None) -> None:
v3 = v1.validate(schema=v2)
if len(v3) == 0:
print('No problems found during v... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1):
self.val = v1
self.left = None
self.right = None
```
Input Types: v0
Output Type: int
Dependencies:
Function Name: v2
Function:
```python
def v2(self, v3: v0) -> int:
if v3 is None:
... |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
if self._optims is not None and len(v1) != 0:
logging.warning('Change of optims is not yet supported')
pass
elif ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict):
for v2 in v1:
if v2 in self.motor_keys:
for v3 in self.motor_ind:
self.motor_targets_change[v2][v3] = v1[v2]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int=1):
self.town_distance += v1
if self.town_distance < 0:
self.town_distance = 0
``` |
Imports:
```python
import logging
import typing
```
Type definitions:
Input Types: str, str, str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str='docker', v4: str='docker', v5: str=''):
logging.info('Adding container to mapper ')
v6 = '\n ... |
Imports:
```python
import logging
import collections
import typing
```
Type definitions:
Input Types: str
Output Type: collections.OrderedDict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> collections.OrderedDict:
v2 = collections.OrderedDict()
if self.has_configurations:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: int=1000, v2: bool=True):
await self.ws.close(code=v1)
await self.keep_alive_task
if v2:
await self.client._gateway_reconnect.se... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dict, v2: list=SQLITETABLECOLUMNS):
v3 = []
for v4 in v2:
if v1.get(v4):
if v4 in ['bathrooms', 'price', 'security_deposit', 'clean... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
self._direction = v1
self.schedule_update_ha_state()
``` |
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:
if v2 == '':
return False
v3 = 'DELETE FROM ' + v1 + ' WHERE ' + v2
return self.QuickExecuteDML(v3, True)
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
def __init__(self, v1: str) -> None:
self.original = v1
self.parsed = self.parse_elements()
def v2(self) -> list:
v3 = self.original.split('.')
v4 = '.'.join(v3[:-1])
v5 = v3[-1]
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'DrawerBase', 'MakerBase'
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'DrawerBase', v2: 'MakerBase'):
v3 = self.draw(v1)
v4 = self.make_solid.run(self.name, self.material, v3, v2)
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=None):
self.gen_mode = not self.gen_mode if v1 is None else v1
self.opt.opt = self.opt_gen.opt if self.gen_mode else self.opt_critic.opt
self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[str]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[str]) -> int:
v2 = []
for v3 in v1:
if v3 not in '*/+-':
v2.append(int(v3))
else:
(v4, v5) = (v2.pop(... |
Imports:
```python
import json
import os
import os.path
import typing
```
Type definitions:
Input Types: List
Output Type: Any
Dependencies:
```python
def v0(v1, v2='w'):
v1 = os.path.join(html_root, v1)
os.makedirs(os.path.dirname(v1), exist_ok=True)
return open(v1, v2, encoding='utf-8')
```
Function Name... |
Imports:
```python
import typing
```
Type definitions:
Input Types: list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: list=None):
v2 = self.basev1 + self.endpoints['exchangeInfo']
v3 = self.reqs._get(v2)
if v3.__contains__('code'):
raise Exception('Failed t... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int]) -> int:
v2 = {}
for v3 in v1:
v2.setdefault(v3, 0)
v2[v3] += 1
v4 = list(v2.keys())
v4.sort()
v5 = 0
fo... |
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 in self.__label_tags.keys():
del self.__label_tags[v1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, dict
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: dict) -> None:
v3 = self._create_args(v2)
v4 = f'sam {v1}'
if v3.strip() != '':
v4 += f' {v3}'
return self._invoke_sam_c... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[int, float, Tuple[int, int], Tuple[float, float]]
Output Type: Union[Tuple[int, int], Tuple[float, float]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Union[int, float, Tuple[int, int], Tuple[float, float]]) -> Union[Tuple[in... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.__trace_ids.pop()
for v2 in self.__traces.pop(v1, set()):
v3 = self.__spans.pop(v2, None)
if v3:
self.__span_id... |
Imports:
```python
import typing
```
Type definitions:
Input Types: TensorShape
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: TensorShape) -> int:
v2 = 1
for v3 in v1.as_list():
v2 *= v3
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Dict[str, List[Dict[str, Any]]]
Dependencies:
Function Name: v0
Function:
```python
async def v0(self) -> Dict[str, List[Dict[str, Any]]]:
v1 = await self.cache_provider.get_all_data()
return await self.format_all_data(v1)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> None:
for (v2, v3) in zip(v1._accumulated_runtime, v1._nr_of_iterations):
self._accumulated_runtime.append(v2)
self._nr_of_iterations.ap... |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
Function Name: v0
Function:
```python
def v0() -> float:
v1 = subprocess.run(['vcgencmd', 'measure_temp'], capture_output=True, text=True, encoding='UTF-8')
v2 = v1.stdout
return float(v... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: ModelParameters
v2: Longitude
v3: EarthLocation
v4: Optional[float]
v5: Angle = Angle(0 * u.deg)
```
Input Types: v0, Angle
Output Type: v0
Dependencies:
Function Name: v6
Function:
```pyth... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: tuple
Dependencies:
```python
def v0(v1) -> list[int]:
v2 = []
v3 = -1
for v4 in v1:
if v4 in '[':
v2.append(v4)
elif v4 in ',]':
if v3 != -1:
v2.append(v3)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.get_toc()
self.build_mimetype()
self.build_container()
self.build_content()
self.build_navigation_doc()
self.build_toc()
sel... |
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 = 0
v4 = ''
for v5 in v2:
if v5.isalpha() and (not v3):
v4 += v5
elif v5.isalpha() and v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> None:
assert self._is_user_module(v1)
if self._main_module is None:
self._main_module = v1
self._add_module(v1, v2)
`... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1: int = 0
for v2 in self.redis.scan_iter(''.join([self._keys_prefix, '*'])):
self.redis.delete(v2)
v1 += 1
self.logger.info(f'c... |
Imports:
```python
import re
import subprocess
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: str) -> str:
v1 = v1.strip()
v1 = re.sub(':.+?:`(.+?)`', '\\1', v1)
v1 = re.sub('``([^`]+)``', '`\\1`', v1)
v1 = v1.replace('\n', ' ')
v1 = v1.replac... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: List[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> List[int]:
v1: List[int] = []
for v2 in self._score_grouped_embedding_configs_per_node:
for v3 in v2:
v1.extend(v3.feature_hash_si... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(object):
@property
def v1(self):
return self._angle
def __init__(self, v2):
self._angle = float(v2)
```
```python
class v3(object):
@property
def v4(self):
return self._time
def __init__(self, v... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1 = 'Rational Cherednik Algebra of type {} with '.format(self._cartan_type)
if self._cartan_type.is_simply_laced():
v1 += 'c={}'.format(self._... |
Imports:
```python
import random
import typing
```
Type definitions:
Input Types: list[str], list, list[str]
Output Type: Any
Dependencies:
```python
def v0(v1: str, v2: str) -> list:
v2 = list(v2)
v1 = list(v1)
v3 = list(v1)
v4 = [0, 0, 0, 0, 0]
for (v5, v6) in enumerate(v2):
if v6 == v1[v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'AttrsTypedDict', str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: 'AttrsTypedDict', v2: str) -> bool:
v3 = v1.get('bad', False)
if isinstance(v3, str):
return not v3.startswith(v2)
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str):
v1 = v1.lower()
if not self.db_interface.exist_table(v1):
raise ValueError(f'数据库中无名为 {v1} 的表')
if v2:
v3 = self.... |
Imports:
```python
import typing
```
Type definitions:
Input Types: cst.Param, cst.Param
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: cst.Param, v2: cst.Param):
if self.lambda_d == 0:
v3 = self.__get_fn_param_type(v1.name.value)
if v3 is not None:
... |
Imports:
```python
import torch
from torch import optim
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.nn.modules.module import _addindent
import typing
```
Type definitions:
Input Types: str, dict, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: st... |
Imports:
```python
from sys import stdout
import typing
```
Type definitions:
Input Types: str, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2='', v3=20):
v4 = '=' * v3 + v2 + '=' * v3
v5 = '=' * len(v4)
stdout.write('\n' + v4 + '\n' + '| %s ' % v1 + '\n' ... |
Imports:
```python
import logging
import numpy as np
import pandas as pd
import requests
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str) -> None:
with open('test_data/56980685061237.npz', 'rb') a... |
Imports:
```python
import csv
import datetime
import numpy as np
import typing
```
Type definitions:
Input Types: str
Output Type: tuple[np.ndarray, np.ndarray]
Dependencies:
```python
def v0(v1: str) -> float:
return datetime.datetime.fromisoformat(v1).timestamp()
```
Function Name: v2
Function:
```python
def v2(... |
Imports:
```python
from keras import models as keras_models
from keras.preprocessing.text import Tokenizer
import keras.backend
import typing
```
Type definitions:
Input Types: parser.ReutersStreamer, Any
Output Type: Tokenizer
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: parser.ReutersStreamer, v2)... |
Imports:
```python
import typing
```
Type definitions:
Input Types: v1
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: v1) -> int:
v2 = False
v3 = False
v4 = 0
for v5 in v1:
if not v3:
if v5 == ' ':
continue
if v5 ==... |
Imports:
```python
import torch as th
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: th.Tensor, th.Tensor, th.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: th.Tensor, v2: th.Tensor, v3: th.Tensor):
assert v1.shape[0] == v2.shape[0] =... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = Tuple[int, bool]
```
```python
v1 = Tuple[str, int]
```
Input Types: Sequence[v1]
Output Type: v0
Dependencies:
Function Name: v2
Function:
```python
def v2(v3: Sequence[v1]) -> v0:
v4 = 0
v5 = 0
v6 = set()
while v5 not in v6 and v5 ... |
Imports:
```python
from pathlib import Path
import typing
```
Type definitions:
```python
v0 = Union[Path, str]
```
Input Types: v0
Output Type: str
Dependencies:
Function Name: v1
Function:
```python
def v1(v2: v0) -> str:
v2 = Path(v2)
return f'{v2.stem}.pdf'
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor, v2=None, v3=False):
v4 = self.head_net(v1)
v4 = self._policy_fn(v4, v2, v3)
return v4
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(AccordionItem):
v1 = ObjectProperty(None)
v2 = PathProperty()
v3 = StringProperty('#EEEEEE')
def __init__(self, v4, v5, v6, v7):
super(v0, self).__init__(title_args={'background_color': self.title_background_hex_color})
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: disnake.Message, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: disnake.Message, v2: str):
await v1.delete()
await v1.channel.send(f'{v1.author.mention} {v2}', delete_after=10)
``` |
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, v4) in enumerate(v1):
if v3 % 2 == 0:
v2.append(v4)
return ''.join(v2)
``` |
Imports:
```python
import torch
from tqdm import tqdm
import typing
```
Type definitions:
Input Types:
Output Type: Tuple[torch.Tensor, float, bool, Dict]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Tuple[torch.Tensor, float, bool, Dict]:
if self.render_interval is not None and self.step_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: []
Output Type: {}
Dependencies:
```python
def v0(v1: []) -> int:
return len(v1) - 1
```
Function Name: v2
Function:
```python
def v2(v3: []) -> {}:
v4 = {}
v5 = v0(v3[0])
for v6 in v3:
v4.setdefault(v6[v5], 0)
v4[v6[v5... |
Imports:
```python
import torch
from torch import nn
import torch.nn.functional as F
import typing
```
Type definitions:
Input Types: tuple, Any, Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tuple, v2=1, v3=None):
v4 = self.mt(v1, v3)[:, v2]
v5 = torch.autograd.gra... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> None:
assert '@' not in v1, 'use login_by_email for email logins'
v2 = self.example_user(v1)
self.login_user(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1='open') -> list:
v2 = 1
v3 = []
while True:
v4 = self.getIssuesPerPage(v2, v1)
if not v4:
break
v3.extend(v4)
... |
Imports:
```python
import sys
import json
from pathlib import Path
import subprocess
import typing
```
Type definitions:
Input Types: Union[str, Path], Dict, type, Sequence[Union[str, Dict[str, Any]]], Union[str, Path]
Output Type: None
Dependencies:
```python
def v0(v1: List[str]) -> str:
v2 = subprocess.check_ou... |
Imports:
```python
import torch
from torch import nn
import typing
```
Type definitions:
Input Types: torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.T... |
Imports:
```python
import os
import shutil
import tempfile
from pathlib import Path
import typing
```
Type definitions:
Input Types:
Output Type: Path
Dependencies:
Function Name: v0
Function:
```python
def v0() -> Path:
v1 = Path(tempfile.gettempdir()).joinpath(f'solcx-tmp-{os.getpid()}')
if v1.exists():
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, web.Application
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(v1: Any, v2: web.Application) -> None:
v3 = await v1(v2)
v4 = await v3.head('/', headers={'If-None-Match': '*'})
v5 = await v4.read()
... |
Imports:
```python
from datetime import datetime, date, time, timedelta
import typing
```
Type definitions:
Input Types: str, Any, list
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2, v3: list) -> str:
if v2 is None:
v2 = next((value for v4 in (row.get(v1) for v5 i... |
Imports:
```python
import tensorflow as tf
from tensorflow import Tensor
import typing
```
Type definitions:
Input Types: Any, Any, Any, Any, bool, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1, v2, v3, v4, v5: bool, v6: bool=False):
v7 = 'question' if v5 else 'context'... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0() -> tuple:
v1 = 25.669287203700236
v2 = -100.30994076079043
return (v1, v2)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: int, str, bool, bool
Output Type: typing.Callable
Dependencies:
```python
def v0(v1: typing.Callable) -> typing.Callable:
@functools.wraps(v1)
def v2(*v3, **v4):
v5 = v3[0].shape[0]
if use_last:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int]
Output Type: int
Dependencies:
```python
def v0(v1: int) -> int:
if not tree[v1]:
return 1
v2 = 1
for v3 in tree[v1]:
v2 += v0(v3)
costs[v1] = v2
return v2
```
Function Name: v4
Function:
```python
def v4(... |
Imports:
```python
import socket
import random
import typing
```
Type definitions:
Input Types: str, int
Output Type: Any
Dependencies:
```python
def v0() -> answer.Answer:
return random.choice(all_answers)
```
Function Name: v1
Function:
```python
def v1(v2: str, v3: int):
with socket.socket(socket.AF_INET, s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: 'Node'
Output Type: 'Node'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: 'Node') -> 'Node':
if not v1:
return v1
if not v1.right:
return v1
if not v1.right.left:
v1.left.next = v1.right
e... |
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(v1: str) -> pd.DataFrame:
with open(v1, 'r', encoding='utf-8') as v2:
v3 = pd.read_csv(v2)
return v3
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> list:
v1 = ['']
if 'loop' in self.metadata:
v2 = self.metadata['loop']
if v2 not in self.context:
return v1
v3 = self.c... |
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 not v1:
return 0
if v1:
v2 = []
v3 = []
for v4 in v1:
for v5 in range(len(v4... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict):
v2 = []
for v3 in v1['Neighbors']:
if v3['x'] - v1['userX'] == 0 or v3['y'] - v1['userY'] == 0:
v2.append(v3)
return v2
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if self.__clog or self.__onfile:
self.__logger.debug(self.__START_UPDATE_LOG)
self.add_rules()
if self.__clog or self.__onfile:
s... |
Imports:
```python
import os
import sys
import typing
```
Type definitions:
Input Types: str, str, bool, bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: bool, v4: bool):
v5 = 1024 * 1024
v6 = {}
v7 = []
v8 = []
v9 = []
if v3:
v6.up... |
Imports:
```python
from datetime import date, datetime, timedelta
import typing
```
Type definitions:
Input Types: datetime, datetime, timedelta, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: datetime, v2: datetime, v3: timedelta, v4: int):
v5 = v1 + v3 * v4
v6 = min(v5 +... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int, list
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: int, v3: list):
if v1 == 'N':
v3[1] += v2
elif v1 == 'S':
v3[1] -= v2
elif v1 == 'E':
v3[0] += v2
elif v1 ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Union[list, int]
Output Type: list
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[list, int]) -> list:
v2 = self.getRequirementSkeletons()
v3 = []
if not isinstance(v1, list):
v4 = [v1]
else:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Optional[Union[int, float]], Optional[Union[int, float]], Union[int, float]
Output Type: bool
Dependencies:
```python
def v0(v1: Optional[Any], v2: Optional[Any]) -> bool:
return v1 is None and v2 is not None or (v1 is not None and v2 is None)
```... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
super().tearDown()
for v1 in self.processes:
v1.terminate()
self.processes = []
``` |
Imports:
```python
import subprocess
import typing
```
Type definitions:
Input Types: List[str], str, str, str
Output Type: subprocess.CompletedProcess
Dependencies:
```python
def v0(v1: List[str], **v2) -> subprocess.CompletedProcess:
return subprocess.run(v1, capture_output=True, text=True, **v2)
```
Function Na... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, bool
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: bool=False) -> bool:
assert isinstance(v1, str)
assert v1
assert isinstance(v2, str)
assert v2
assert self.__b... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes):
self._buffer.write(v1)
self._try_flush_buffer()
``` |
Imports:
```python
import datetime
import typing
```
Type definitions:
Input Types: int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int):
v2 = datetime.datetime.fromtimestamp(self.unix_timestamp)
v3 = v2 + datetime.timedelta(days=v1)
v3 = v3.replace(minute=59, hou... |
Imports:
```python
import tensorflow as tf
from tensorflow.python.saved_model import loader_impl
import typing
```
Type definitions:
Input Types: model_spec_pb2.InferenceSpecType
Output Type: Sequence[Text]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: model_spec_pb2.InferenceSpecType) -> Sequence[Te... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Union[np.ndarray, torch.Tensor], Union[np.ndarray, torch.Tensor], Any
Output Type: DefaultDict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Union[np.ndarray, torch.Tensor], v2: Union[np.ndarray, torch.Tensor... |
Imports:
```python
import argparse
import logging
import math
import os
import random
import shutil
from datetime import datetime
import requests
import typing
```
Type definitions:
Input Types:
Output Type: argparse.Namespace
Dependencies:
```python
def v0(v1):
v2 = build_oai_params(set=v1.set, date_from=v1.date... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.Tensor
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: torch.Tensor):
self.log.debug('Observing Noise')
self.observation_memory.append(v1.detach())
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[str, Any]) -> str:
v2 = 'Deployed code:\n'
for (v3, v4) in v1['deployment_data'].items():
v2 += f'- {v3}: {v4}\n'
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
if self.b.is_game_over():
return f'Game over: {self.b.result()}'
else:
return None
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.