text stringlengths 190 325k |
|---|
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: torch.Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> torch.Tensor:
assert v1 in self._device_data_via_torch
return self._device_data_via_torch[v1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: 'resource_types.Build'
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> 'resource_types.Build':
v1 = getattr(communicator, self.__class__.__name__)(self._PyTravisCI['com']['requester'])
self.__dict__ = v1.from... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: int):
if v1 > v2:
print('{} is bigger than {}'.format(v1, v2))
elif v1 < v2:
print('{} is bigger than {}'.format(v2, v1))
el... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
self.script_files = []
self.add_js_file('documentation_options.js', id='documentation_options', data_url_root='', priority=200)
self.add_js_file(... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
```python
def v0(v1: FastAPI) -> None:
v2 = DatabaseClient(settings=config)
v1.add_event_handler(event_type='startup', func=v2.connection_db)
v1.add_event_handler(event_type='shutdown', func=v2.disconnect_d... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Dict[str, Any]) -> None:
if v1['pydoc']['description']:
self._write_line(v1['pydoc']['description'])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, List[str], str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: int, v2: List[str], v3: str) -> str:
v4 = {}
for v5 in range(v1):
(v6, *v7) = v2[v5].split()
v8 = list(map(float, v7))
... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: str
Output Type: List[Tuple[str, int]]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> List[Tuple[str, int]]:
v2 = '^(#{1,6}[ ]*\\s*[\\S]+)'
v3 = re.findall(v2, v1, flags=re.IGNORECASE | re.MULTILINE | re.DOTA... |
Imports:
```python
import datetime
import uuid
import typing
```
Type definitions:
Input Types: Text, Dict[Text, Any]
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: Text, v2: Dict[Text, Any], **v3: Any) -> None:
v2.update({'id': str(uuid.uuid4()), 'timestamp': datetim... |
Imports:
```python
import json
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
(v1, v2, v3, v4, v5, v6) = self.tracking.get_coords()
v7 = {'X': v1, 'Y': v2, 'Z': v3, 'Rx': v4, 'Ry': v5, 'Rz': v6}
return json.dumps(... |
Imports:
```python
import logging
from logging.handlers import TimedRotatingFileHandler
import typing
```
Type definitions:
Input Types: str, int, bool
Output Type: logging.Logger
Dependencies:
```python
def v0(v1=sys.stdout, v2: logging.Formatter=DEFAULT_FORMATTER) -> logging.StreamHandler:
v3 = logging.StreamHan... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: float
Dependencies:
```python
def v0(v1: torch.nn.Module) -> bool:
if type(v1) in MODULES_MAPPING:
return True
return False
```
Function Name: v2
Function:
```python
def v2(self) -> float:
v3 = self.__batch_counter__
... |
Imports:
```python
import string
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 v2.items():
v1 = v1.replace(v3, v4)
return v1
``` |
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 = self._char_to_num(v1)
v2 = self.a_inverse * (v2 - self.b) % len(self.char_set)
return self._num_to_char(v2)
``` |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Tuple
Output Type: Pattern
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple) -> Pattern:
if '(' in v1:
v2 = '|'.join(['^' + re.escape(piece) for v3 in v1 if v3.strip()])
return re.compile(v2)
else... |
Imports:
```python
import typing
```
Type definitions:
Input Types: torch.nn.Module, Callable
Output Type: torch.utils.hooks.RemovableHandle
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: torch.nn.Module, v2: Callable) -> torch.utils.hooks.RemovableHandle:
v3 = v1.register_forward_hook(v2)
ret... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False):
self._params = None
self._optim = self._minimize(v1)
self._params = self._optim['x']
self.weights = dict(zip(self._portfolio.ticke... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int, int
Output Type: list
Dependencies:
```python
def v0(v1: int, v2: int) -> list:
v3 = []
for v4 in range(v1, v1 + v2 - 1):
v3 += [(v4, v4 + 1)]
v3 += [(v1 + v2 - 1, v1)]
return v3
```
Function Name: v5
Function:
```python
d... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> int:
v1 = int(self.height_screen)
return v1
``` |
Imports:
```python
import numpy as np
from pandas._libs import lib
from pandas._libs.arrays import NDArrayBacked
from pandas._typing import F, PositionalIndexer2D, PositionalIndexerTuple, ScalarIndexer, SequenceIndexer, Shape, TakeIndexer, npt, type_t
from pandas.errors import AbstractMethodError
from pandas.util._deco... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str):
v2 = []
v3 = 'babi_sup_facts'
v4 = 0
with open(v1, encoding='latin-1') as v5:
v6 = v5.readlines()
v7 = ''
v8 = {}
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> str:
v3 = self.lcs(v1, v2)
v4 = ''
(v5, v6) = (0, 0)
for v7 in v3:
while v5 < len(v1) and v1[v5] != v7:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dataset.DataIterable, str
Output Type: dataset.DataIterable
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: dataset.DataIterable, v2: str) -> dataset.DataIterable:
v3 = list()
for (v4, v5) in v1:
v3.extend(v5)
yield... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(NamedTuple):
v1: str
v2: Optional[Tuple[vpk.VPK, Tuple[bytes, int, int, int, int, int]]]
```
Input Types:
Output Type: Iterator[Tuple[PurePosixPath, v0]]
Dependencies:
Function Name: v3
Function:
```python
def v3(self) -> Iterator[Tuple... |
Imports:
```python
from transformers import Trainer, AutoConfig
from transformers.trainer_utils import EvalLoopOutput, PredictionOutput, EvalPrediction, speed_metrics, denumpify_detensorize
import typing
```
Type definitions:
Input Types: Union[np.ndarray, EvalLoopOutput], Dataset, Dataset, Any
Output Type: Union[List... |
Imports:
```python
import math
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import typing
```
Type definitions:
Input Types: np.array, np.array, list, List[int]
Output Type: Any
Dependencies:
```python
def v0(v1):
v2 = v1.ind
print(data[v2[0]]['student_id'])
```
Function Name: v... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: list[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> list[str]:
[v2, v3] = self._get_grid_coordinates(1, v1)
return [value for v4 in self._grid[v3]]
``` |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types: dict, Any
Output Type: list
Dependencies:
```python
def v0(v1: dict) -> list:
v2 = []
for (v3, v4) in v1.items():
v5 = current_app.config.data_handler(v4.graphic_dict[DATA_SOURCES])
v6 = v4.graphic_dict.get(DATA_FIL... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict[str, Any], bool
Output Type: str
Dependencies:
```python
def v0(v1: int, v2: str, v3: int, v4: Optional[str]=None, v5: bool=False) -> str:
if v2 == 'U':
v6 = user_avatar_path_from_ids(v1, v3)
return upload_backend.get_avatar_u... |
Imports:
```python
from urllib.parse import urlsplit, urlunsplit
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v2 = urlsplit(v1)[:2] + ('', '', '')
return urlunsplit(v2)
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> bool:
(v2, v3) = (0, 0)
v4 = 0
v5 = [[0, 1], [-1, 0], [0, -1], [1, 0]]
v1 = v1 * 4
for v6 in v1:
if v6 == 'G':
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: t.Dict[str, t.Any]
Output Type: t.Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: t.Dict[str, t.Any]=None) -> t.Optional[str]:
if v1 is None or 'links' not in v1 or 'pages' not in v1['links'] or ('next' not in v1['lin... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any, []
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: []) -> dict:
v3 = v1['datasource']
v4 = int(v3.split('__')[0])
v5 = v3.split('__')[1]
v6 = []
if v1.get('metric', None) is not None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bytes
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bytes):
v2 = self._create_new_part(v1)
self.futures.append(self.thread_pool.submit(self._upload_part, v2))
``` |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
v2 = pd.DataFrame.from_dict(self.dict_reviews)
v2.to_csv(v1)
``` |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: np.ndarray
Output Type: set
Dependencies:
```python
def v0(v1: np.ndarray) -> int:
return hash(v1.tobytes())
```
```python
def v2(v3, v4, v5):
(v4, v5) = (tuple(v4), tuple(v5))
v6 = np.array(v3)
v6[v4] = v3[v5]
v... |
Imports:
```python
import os, sys, pathlib
import typing
```
Type definitions:
Input Types: str, str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str) -> str:
v3 = pathlib.Path(v1)
if not v3.is_absolute():
v3 = pathlib.Path(v2 + '\\' + v1)
if not v... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(Enum):
v1 = 'task'
v2 = 'opportunity'
v3 = 'lead'
def v4(self):
return self.value
```
Input Types: v0, Any, Any, Any
Output Type: Any
Dependencies:
Function Name: v5
Function:
```python
def v5(self, v6: v0, v7, v8, v9=0)... |
Imports:
```python
from datetime import date, datetime
import logging
import typing
```
Type definitions:
Input Types: Path, T.Dict[str, str], bool
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Path, v2: T.Dict[str, str], v3: bool):
with v1.open('w') as v4:
v4.write('---\... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str, v3: str):
v4 = v1.find(v2) + len(v2)
v3 = v1.find(v3, v1.find(v2) + len(v2))
return v1[v4:v3]
``` |
Imports:
```python
import uuid
from typing import Any, Iterable
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
```python
def v0(v1: Any) -> Iterable[str]:
if v1 is None:
yield ''
elif isinstance(v1, object) and hasattr(v1, '__uuid__'):
yield str(v1.__uuid__())
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Any, Any, List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2, v3: Any, v4: List[str]):
if v2(v3, v4):
return True
self.error_count[v1] += 1
return False
``` |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: Dict[Any, Dict[Any, Any]]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict[Any, Dict[Any, Any]]):
v2 = defaultdict(dict)
for (v3, v4) in v1.items():
for (v5, v6) ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: bool
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: bool=False) -> None:
if v1:
self.user_agent_to_session(self.driver, self.session)
self.set_cookies(self.driver.get_cookies(), set_session=True... |
Imports:
```python
import typing
```
Type definitions:
```python
class v0(ABC):
@abstractmethod
def v1(self, v2: Union[ModuleSource, PluginSource, ConnectorSource], v3: RoutingKey, v4: Optional[Dict[str, Union[str, int, float, bool, None]]]) -> None:
"""Consume data received from exchange bus"""
```
In... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> str:
v1 = [x for v2 in v1 if v2.isnumeric()]
v1 = ''.join(v1)
if len(v1) != 10:
v1 = None
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: tuple
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> tuple:
v1 = '\n\nVeto Voting: The lowest ranked candidate gets 0 points. ' + 'All other candidates get 1 point. '
v1 += '\nP = '
v2 = self.count.copy(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: e2cnn.group.Representation
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: e2cnn.group.Representation):
v2 = []
if 'pointwise' in v1.supported_nonlinearities:
v2.append('pointwise')
if 'concatenated... |
Imports:
```python
import email
import json
import typing
```
Type definitions:
Input Types: typing.List[typing.Dict]
Output Type: typing.NoReturn
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: typing.List[typing.Dict]) -> typing.NoReturn:
v2 = email.message.EmailMessage()
v3 = '!!! Suce... |
Imports:
```python
import typing
```
Type definitions:
```python
v0 = str
```
Input Types: v0, Dict[str, str]
Output Type: str
Dependencies:
```python
def v1(v2: Union[int, str]) -> str:
v2 = str(v2)
if v2 and len(v2) < 8:
return v2.rjust(8, '0')
return v2
```
Function Name: v3
Function:
```python
d... |
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 = v1
v3 = self.file_content.lines
if v1 < 0:
v1 += len(v3)
if not 0 <= v1 < len(v3):
raise IndexError(f'Line/row... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Matrix
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Matrix:
v1: List[Matrix] = self.vertices()
v2: Matrix = v1[1]
v3: Matrix = v1[2]
v4: Matrix = (v2 + v3) / 2
v4.normalize()
v5: float = (v... |
Imports:
```python
import tensorflow.compat.v2 as tf
import typing
```
Type definitions:
Input Types: tf.Tensor, tf.TensorSpec
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: tf.Tensor, v2: tf.TensorSpec):
if not tf.TensorShape(tf.squeeze(v1.get_shape())).is_compatible_with(v... |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: typing.Optional[str]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> typing.Optional[str]:
for v1 in self.template_paths:
v2 = os.path.join(v1, self.get_template_name())
if os.path.exist... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: List[str], np.ndarray, List[str], np.ndarray
Output Type: Tuple[List[str], np.ndarray]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str], v2: np.ndarray, v3: List[str], v4: np.ndarray) -> Tuple[List[str], np.... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Optional[Any]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Optional[Any]:
with self._lock:
if len(self._q) == 0:
return None
v1 = self._q.popleft()
self._save()
retu... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> str:
v1: list[str] = []
if self.causes and (v2 := self.causes[0].format_zh_TW()):
v1.append('因')
if self.companies and (v3 := self.companies... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
v1 = self.example_user('hamlet')
self.login_user(v1)
v2 = self.example_user('iago')
v3 = self.example_user('cordelia')
v4 = self.example_... |
Imports:
```python
import typing
```
Type definitions:
Input Types: List[int], Any
Output Type: (bool, str)
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[int], v2) -> (bool, str):
v3 = v2
for v4 in v1:
(v5, v3) = self._match(v4, v3)
if v5:
v2 = v3
... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: Optional[int]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> Optional[int]:
v1 = self.chats.id_by_index(self.current_chat)
if v1 is None:
return None
return self.msgs.current_msgs[v1]
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1) -> str:
v2 = v1.xpath(self.xpath_name).get()
if v2.startswith('[Deprecated for 4.x]'):
v2 = v2[20:]
elif v2.startswith('[UNUSED]'):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Dict
Output Type: Dict
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Dict) -> Dict:
v2 = {'total_events': 1, 'user_id': v1['user_id'], 'timestamp': v1['timestamp'], 'client_version': v1['client_version'], 'shown': v1['completions... |
Imports:
```python
import typing
```
Type definitions:
Input Types: Tuple[Any, ...]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Tuple[Any, ...]) -> Any:
if len(v1) == 0:
return None
elif len(v1) == 1:
return v1[0]
else:
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> None:
global phVal
v2 = v1.form['phVal']
``` |
Imports:
```python
import torch
from torch import nn, Tensor
from torch.nn import functional as F
import typing
```
Type definitions:
Input Types: Tensor
Output Type: Tensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Tensor) -> Tensor:
(v2, v3) = (v1.shape[-2] // 8, v1.shape[-1] // 8)
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: dict
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: dict) -> dict:
self._data_result_queue.put(v1)
v2 = self._learn_info_queue.get()
return v2
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: Container[str]
Output Type: Callable[[agate.Row], bool]
Dependencies:
```python
def v0(v1: str, v2: agate.Row):
if v1 not in v2.keys():
raise dbt.exceptions.InternalException('Got a row without "{}" column, columns: {}'.format(v1, v2.keys(... |
Imports:
```python
from random import random
import numpy as np
import torch
from torch.autograd import Variable
from torch import optim
import typing
```
Type definitions:
Input Types: float
Output Type: torch.LongTensor
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: float) -> torch.LongTensor:... |
Imports:
```python
import typing
```
Type definitions:
Input Types: int
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: int) -> bool:
v2 = self.sh.worksheet('title', 'password')
v3 = v2.get_as_df()
v4 = v3.index[v3['id'] == v1].tolist()
if v4:
return v4[0... |
Imports:
```python
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.preprocessing import normalize
import typing
```
Type definitions:
Input Types: pd.DataFrame
Output Type: pd.DataFrame
Dependencies:
Function Name: v0
F... |
Imports:
```python
from collections import defaultdict
import typing
```
Type definitions:
Input Types: str
Output Type: int
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> int:
v2 = 0
v3 = ['a', 'e', 'i', 'o', 'u']
for v4 in range(len(v1)):
if v1[v4] not in v3:
... |
Imports:
```python
from contextlib import closing
import sqlite3
import typing
```
Type definitions:
Input Types: Any
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(v1) -> None:
v2 = '--\n CREATE INDEX IF NOT EXISTS\n mesh_pmids_mesh_num_is_concept_idx\n ON\n mesh... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, TextIO, dict, bool, str
Output Type: 'InProgressDataset'
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: TextIO, v3: dict=None, v4: bool=True, v5: str=None) -> 'InProgressDataset':
v6 = self.create_in_progress_d... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, int
Output Type: str
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: int) -> str:
v3 = list(v1)
for v4 in range(v2):
v5 = v3[0]
if len(v3) > 1:
v6 = 1
for v7 in range(... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str) -> dict:
(v1, v2) = self.translate_host_and_port(v1, '8091')
v3 = 'http://{}:{}/nodeStatuses'.format(v1, v2)
v4 = self.get(url=v3).json()
... |
Imports:
```python
import numpy as np
import numpy.ma as ma
from pandas._libs import lib
from pandas._typing import Axis, DtypeObj, Manager, Scalar
from pandas.core.dtypes.cast import construct_1d_arraylike_from_scalar, construct_1d_ndarray_preserving_na, dict_compat, maybe_cast_to_datetime, maybe_convert_platform, may... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any, Optional[bool]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2: Optional[bool]=True):
if not (isinstance(v1, np.ndarray) and len(v1.shape) == 2):
return False
if v2 is None:
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: discord.Interaction
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: discord.Interaction) -> bool:
if v1.user != self.ctx.author:
await v1.response.send_message(f'This instance does not belong t... |
Imports:
```python
import numpy as np
import typing
```
Type definitions:
Input Types: Any
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: Any) -> Any:
if type(v1) == np.int64:
v1 = int(v1)
if type(v1) == np.float64:
v1 = float(v1)
return v1
``` |
Imports:
```python
import typing
```
Type definitions:
```python
class v0:
def __init__(self, v1):
"""
Initializes quantum gate from corresponding unitary complex matrix.
:param matrix: unitary complex matrix in any form that can
be used in the numpy array constructor
"""
... |
Imports:
```python
from concurrent.futures import ThreadPoolExecutor
import asyncio
import typing
```
Type definitions:
Input Types: Iterable[Iterable[float]], Iterable[Any]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
async def v0(self, v1: Iterable[Iterable[float]], v2: Iterable[Any]):
s... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str
Output Type: dict
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: str, v3: str) -> dict:
v4 = f'/users/{v1}/messages/{v2}/move'
v5 = {'destinationId': v3}
return self.ms_client.http_request('POS... |
Imports:
```python
import pandas as pd
import typing
```
Type definitions:
Input Types: pd.Series, str, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: pd.Series, v2: str, v3: int):
v4 = min(v3, len(v1))
while v1[:v4].sum() < 0.6 and v4 < len(v1):
v4 += 1
v5 = p... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, str, str, str
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str=None, v2: str=None, v3: str=None, v4: str=None) -> bool:
if not v4:
raise AttributeError("Can't move emails without target_folde... |
Imports:
```python
from PIL import Image, ImageDraw, ImageFont, ImageColor
import textwrap
import typing
```
Type definitions:
Input Types: str, str, int, tuple, tuple, int, int
Output Type: Image
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str, v2: str=FONT, v3: int=FONT_SIZE, v4: tuple=COLOR, v5:... |
Imports:
```python
import re
import typing
```
Type definitions:
Input Types: Any, Any, List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1, v2, v3: List[str]):
v4 = ['_AND_'.join(pair) for v5 in v1['AllSlotPairs']]
v6 = lambda pair_name: f'{v2}/ILP_anchor_placement_iter0/... |
Imports:
```python
from typing import Dict, Iterable, List, Optional, Tuple, Union
import typing
```
Type definitions:
Input Types: List[numpy.ndarray]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: List[numpy.ndarray]):
if isinstance(v1, str) or not isinstance(v1, List):
... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str, Optional[str], Optional[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str, v2: Optional[str], v3: Optional[str]):
v4 = {'Content-Type': 'application/json', 'Interaction-Id': v1, 'wait-for-response... |
Imports:
```python
import shutil
import json
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
shutil.rmtree(self.output_dir)
with open(self.config_path) as v1:
v2 = json.load(v1)
v3 = v2
with open(self... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: tuple[tuple[str, list], list]
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> tuple[tuple[str, list], list]:
v1 = ''
v2 = []
v3 = []
if not self.parsed_opts_args:
return
if None in self.pa... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: bool
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> bool:
for v1 in self._state_vars.required_input_names:
v2 = self._state_vars.input_anchors[v1]
if not v2:
if not self._raised_missi... |
Imports:
```python
import argparse
import typing
```
Type definitions:
Input Types: List[str]
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: List[str]):
v2 = argparse.ArgumentParser()
v3 = v2.add_subparsers(dest='subparser_name')
v4 = v3.add_parser('server', help='Run web ... |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Tuple[str, str]
Dependencies:
Function Name: v0
Function:
```python
def v0(v1: str) -> Tuple[str, str]:
(v2, v3) = ('', '')
if v1:
v2 = v1.split('\n\n')[0]
if len(v1.split('\n\n')) == 2:
v3 = v1.sp... |
Imports:
```python
import polars as pl
from polars import testing
from polars.datatypes import Float64, Int32, Int64, UInt32, UInt64
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0() -> None:
v1 = pl.Series('a', [1, 2, 3])
testing.... |
Imports:
```python
import torch
import torch.nn as nn
import typing
```
Type definitions:
Input Types: Any, int, int
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: Any, v2: int, v3: int):
(v4, v5) = v1
v6 = self(v5)
(v7, v8) = self.encode(v4, v5)
v9 = self.end_mo... |
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 not isinstance(v1, str):
raise TypeError(f'code must be of type str, got {v1.__class__}')
if self._debug:
print('HullR... |
Imports:
```python
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self, *v1) -> None:
for v2 in v1:
if len(self.scoops) < self.MAX_SCOOPS:
self.scoops.append(v2)
``` |
Imports:
```python
import os
import typing
```
Type definitions:
Input Types:
Output Type: None
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> None:
if not os.path.exists(self.config['DATA_DIR']):
os.makedirs(self.config['DATA_DIR'])
``` |
Imports:
```python
import typing
```
Type definitions:
Input Types: str
Output Type: Any
Dependencies:
Function Name: v0
Function:
```python
def v0(self, v1: str):
for (v2, v3) in self.entities2code.items():
if v2.find(v1) > -1:
return v3
return None
``` |
Imports:
```python
import copy
import typing
```
Type definitions:
Input Types:
Output Type: T.Type['Dependency']
Dependencies:
Function Name: v0
Function:
```python
def v0(self) -> T.Type['Dependency']:
v1 = copy.deepcopy(self)
v1.whole_libraries += v1.libraries
v1.libraries = []
return v1
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.