name
stringclasses
844 values
input_types
listlengths
0
100
output_type
stringlengths
1
419
code
stringlengths
34
233k
dependencies
listlengths
0
6
lib_used
listlengths
0
11
imports
listlengths
0
66
line_count
int64
3
199
full_code
stringlengths
39
1.01M
input_type_defs
listlengths
1
12
v4
[ "Any", "v0" ]
Any
def v4(self, v5, v6: v0): v6['name'] = v5.name v6['target_value'] = v5.target_average_value if getattr(v5, 'target_average_value') else v5.target_average_utilization
[]
[]
[]
3
from mypy_extensions import TypedDict class HPAMetricsDict(TypedDict, total=False): name: str target_value: str current_value: str class HPAMetricsParser: def __init__(self, hpa): self.NAME = "name" self.TARGET = "target_value" self.CURRENT = "current_value" def parse_ta...
[ "class v0(TypedDict, total=False):\n v1: str\n v2: str\n v3: str" ]
v4
[ "Any", "v0" ]
Any
def v4(self, v5, v6: v0): v6['name'] = v5.metric_name v6['current_value'] = v5.current_average_value
[]
[]
[]
3
from mypy_extensions import TypedDict class HPAMetricsDict(TypedDict, total=False): name: str target_value: str current_value: str class HPAMetricsParser: def __init__(self, hpa): self.NAME = "name" self.TARGET = "target_value" self.CURRENT = "current_value" def parse_ta...
[ "class v0(TypedDict, total=False):\n v1: str\n v2: str\n v3: str" ]
v4
[ "Any", "v0" ]
Any
def v4(self, v5, v6: v0): v6['name'] = v5.name v6['current_value'] = v5.current_average_value if getattr(v5, 'current_average_value') else v5.current_average_utilization
[]
[]
[]
3
from mypy_extensions import TypedDict class HPAMetricsDict(TypedDict, total=False): name: str target_value: str current_value: str class HPAMetricsParser: def __init__(self, hpa): self.NAME = "name" self.TARGET = "target_value" self.CURRENT = "current_value" def parse_ta...
[ "class v0(TypedDict, total=False):\n v1: str\n v2: str\n v3: str" ]
v0
[]
None
def v0(self) -> None: super().setUp() self.permission_test_model = {'meeting/1': {'name': 'meeting_1', 'motion_category_ids': [111], 'motion_ids': [69], 'is_active_in_organization_id': 1}, 'motion_category/111': {'name': 'name_MKKAcYQu', 'prefix': 'prefix_A', 'motion_ids': [69], 'meeting_id': 1}, 'motion/69': {...
[]
[]
[]
3
import time from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class MotionCategoryNumberMotionsTest(BaseActionTestCase): def setUp(self) -> None: super().setUp() self.permission_test_model = { "meeting/1": { ...
null
v0
[]
None
def v0(self) -> None: self.set_models({'meeting/35': {'name': 'name_meeting35', 'motions_number_with_blank': True, 'motions_number_min_digits': 3, 'motion_ids': [78, 85], 'motion_category_ids': [111, 78, 114], 'is_active_in_organization_id': 1}, 'motion/78': {'title': 'title_NAZOknoM', 'category_id': 78, 'meeting_i...
[]
[]
[]
8
import time from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class MotionCategoryNumberMotionsTest(BaseActionTestCase): def setUp(self) -> None: super().setUp() self.permission_test_model = { "meeting/1": { ...
null
v0
[]
None
def v0(self) -> None: self.set_models({'meeting/1': {'name': 'meeting_1', 'motion_ids': [78, 85, 666], 'motion_category_ids': [111, 78, 114], 'is_active_in_organization_id': 1}, 'motion/78': {'title': 'title_NAZOknoM', 'meeting_id': 1}, 'motion/85': {'title': 'title_MyMayxxr', 'lead_motion_id': 666, 'meeting_id': 1...
[]
[]
[]
5
import time from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class MotionCategoryNumberMotionsTest(BaseActionTestCase): def setUp(self) -> None: super().setUp() self.permission_test_model = { "meeting/1": { ...
null
v0
[]
None
def v0(self) -> None: self.set_models({'meeting/1': {'name': 'name_meeting_1', 'motions_number_with_blank': True, 'motions_number_min_digits': 3, 'motions_amendments_prefix': 'X', 'motion_category_ids': [1, 2, 3], 'motion_ids': [1, 2, 3, 4, 5], 'is_active_in_organization_id': 1}, 'motion_category/1': {'name': 'name...
[]
[]
[]
9
import time from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class MotionCategoryNumberMotionsTest(BaseActionTestCase): def setUp(self) -> None: super().setUp() self.permission_test_model = { "meeting/1": { ...
null
v0
[]
None
def v0(self) -> None: self.set_models({'meeting/1': {'name': 'meeting_1', 'motion_category_ids': [111], 'motion_ids': [69, 70], 'is_active_in_organization_id': 1}, 'motion_category/111': {'name': 'name_MKKAcYQu', 'prefix': 'prefix_A', 'motion_ids': [69], 'meeting_id': 1}, 'motion/69': {'title': 'title_NAZOknoM', 'c...
[]
[]
[]
5
import time from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class MotionCategoryNumberMotionsTest(BaseActionTestCase): def setUp(self) -> None: super().setUp() self.permission_test_model = { "meeting/1": { ...
null
v0
[]
None
def v0(self) -> None: self.set_models({'meeting/1': {'name': 'name_meeting_1', 'motion_category_ids': [1, 2, 3, 4], 'motion_ids': [1, 2, 3], 'is_active_in_organization_id': 1}, 'motion_category/1': {'name': 'category_1', 'meeting_id': 1, 'parent_id': None, 'child_ids': [2, 3, 4]}, 'motion_category/2': {'name': 'cat...
[]
[]
[]
7
import time from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class MotionCategoryNumberMotionsTest(BaseActionTestCase): def setUp(self) -> None: super().setUp() self.permission_test_model = { "meeting/1": { ...
null
v0
[ "str", "str" ]
None
def v0(self, v1: str, v2: str) -> None: v3 = self.get_model(v1) assert v3.get('number') == v2
[]
[]
[]
3
import time from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class MotionCategoryNumberMotionsTest(BaseActionTestCase): def setUp(self) -> None: super().setUp() self.permission_test_model = { "meeting/1": { ...
null
v0
[]
None
def v0(self) -> None: self.set_models({'meeting/1': {'name': 'name_meeting_1', 'motion_category_ids': [1], 'motion_ids': [1, 2, 3], 'is_active_in_organization_id': 1}, 'motion_category/1': {'name': 'category_1', 'meeting_id': 1, 'parent_id': None, 'child_ids': [], 'motion_ids': [1, 2, 3]}, 'motion/1': {'title': 'm1...
[]
[]
[]
7
import time from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class MotionCategoryNumberMotionsTest(BaseActionTestCase): def setUp(self) -> None: super().setUp() self.permission_test_model = { "meeting/1": { ...
null
v0
[]
None
def v0(self) -> None: self.set_models({'meeting/1': {'name': 'name_meeting_1', 'motion_category_ids': [1, 2], 'motion_ids': [1], 'is_active_in_organization_id': 1}, 'motion_category/1': {'name': 'category_1', 'meeting_id': 1, 'parent_id': None, 'child_ids': [2], 'motion_ids': [], 'prefix': 'A'}, 'motion_category/2'...
[]
[]
[]
5
import time from openslides_backend.permissions.permissions import Permissions from tests.system.action.base import BaseActionTestCase class MotionCategoryNumberMotionsTest(BaseActionTestCase): def setUp(self) -> None: super().setUp() self.permission_test_model = { "meeting/1": { ...
null
v6
[ "Callable" ]
Callable
def v6(v7: Callable) -> Callable: def v8(*v9: Any, **v10: Any) -> None: v11 = asyncio.get_event_loop() v12 = v7(*v9, **v10) v13 = asyncio.ensure_future(v12, loop=v11) v11.run_until_complete(v13) return v8
[ { "name": "v0", "input_types": [], "output_type": "None", "code": "def v0(*v1: Any, **v2: Any) -> None:\n v3 = asyncio.get_event_loop()\n v4 = test(*v1, **v2)\n v5 = asyncio.ensure_future(v4, loop=v3)\n v3.run_until_complete(v5)", "dependencies": [] } ]
[ "asyncio" ]
[ "import asyncio" ]
8
"""Provide strategies for given endpoint(s) definition.""" import asyncio import inspect import re from base64 import b64encode from functools import partial from typing import Any, Callable, Dict, List, Optional, Tuple, Union from urllib.parse import quote_plus import hypothesis import hypothesis.strategies as st fro...
null
v2
[ "Dict[str, Any]" ]
bool
def v2(v3: Dict[str, Any]) -> bool: for (v4, v5) in v3.items(): if v0(v4) or v0(v5): return False return True
[ { "name": "v0", "input_types": [ "Any" ], "output_type": "bool", "code": "def v0(v1: Any) -> bool:\n return isinstance(v1, str) and bool(re.search('[\\\\ud800-\\\\udfff]', v1))", "dependencies": [] } ]
[ "re" ]
[ "import re" ]
5
"""Provide strategies for given endpoint(s) definition.""" import asyncio import inspect import re from base64 import b64encode from functools import partial from typing import Any, Callable, Dict, List, Optional, Tuple, Union from urllib.parse import quote_plus import hypothesis import hypothesis.strategies as st fro...
null
v14
[ "Sequence[str]" ]
Callable[..., Callable]
def v14(v15: Sequence[str]) -> Callable[..., Callable]: def v16(v17: Callable[..., Any]) -> Callable[..., Any]: """Returns function unchanged.""" return v17 def v18(v19: Callable[..., Any]) -> Callable[..., Any]: """Raises error.""" def v20(*v21, **v22) -> OSError: ...
[ { "name": "v0", "input_types": [], "output_type": "ImportError", "code": "def v0(*v1, **v2) -> ImportError:\n v3 = 'Install extra requirements to use this function:'\n for v4 in import_errors:\n v3 += f' {v4.name}'\n raise ImportError(v3)", "dependencies": [] }, { "name":...
[ "shutil" ]
[ "import shutil" ]
20
"""Helper functions.""" from dataclasses import dataclass from importlib import import_module from numbers import Integral import shutil from typing import ( Any, Callable, cast, Iterable, List, Literal, Optional, overload, Sequence, Union, ) import numpy as np from scipy.spars...
null
v0
[ "ArrayLike", "int" ]
ArrayLike
def v0(v1: ArrayLike, v2: int=1) -> ArrayLike: if v1.ndim < v2: v3 = v1.shape if not is_extension_array_dtype(v1.dtype): v1 = v1.reshape(tuple((1,) + v3)) return v1
[]
[ "pandas" ]
[ "from pandas._libs import NaT, algos as libalgos, lib, writers", "import pandas._libs.internals as libinternals", "from pandas._libs.tslibs import conversion", "from pandas._libs.tslibs.timezones import tz_compare", "from pandas._typing import ArrayLike", "from pandas.util._validators import validate_bool...
6
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v3
[ "np.ndarray", "np.ndarray", "Any" ]
np.ndarray
def v3(v4: np.ndarray, v5: np.ndarray, v6) -> np.ndarray: if not is_list_like(v6): v6 = np.repeat(v6, len(v5)) try: v7 = v6[v5] except TypeError: pass else: if not _isna_compat(v4, v7[0]): pass elif not (is_float_dtype(v7.dtype) or is_integer_dtype(v7....
[ { "name": "v0", "input_types": [ "Any", "Any" ], "output_type": "Any", "code": "def v0(v1, v2):\n try:\n v1[mask] = v2[mask]\n except (IndexError, ValueError):\n v1[mask] = v2\n return v1", "dependencies": [] } ]
[ "numpy", "pandas", "warnings" ]
[ "import warnings", "import numpy as np", "from pandas._libs import NaT, algos as libalgos, lib, writers", "import pandas._libs.internals as libinternals", "from pandas._libs.tslibs import conversion", "from pandas._libs.tslibs.timezones import tz_compare", "from pandas._typing import ArrayLike", "from...
36
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v0
[ "ArrayLike" ]
np.ndarray
def v0(v1: ArrayLike) -> np.ndarray: if isinstance(v1, ExtensionArray): v1 = np.asarray(v1, dtype=np.bool_) assert isinstance(v1, np.ndarray), type(v1) assert v1.dtype == bool, v1.dtype return v1
[]
[ "numpy", "pandas" ]
[ "import numpy as np", "from pandas._libs import NaT, algos as libalgos, lib, writers", "import pandas._libs.internals as libinternals", "from pandas._libs.tslibs import conversion", "from pandas._libs.tslibs.timezones import tz_compare", "from pandas._typing import ArrayLike", "from pandas.util._validat...
6
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v0
[ "Any" ]
None
def v0(self, v1) -> None: self.values = np.delete(self.values, v1, 0) self.mgr_locs = self.mgr_locs.delete(v1)
[]
[ "numpy" ]
[ "import numpy as np" ]
3
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v0
[ "Any" ]
List['Block']
def v0(self, v1, **v2) -> List['Block']: with np.errstate(all='ignore'): v3 = v1(self.values, **v2) return self._split_op_result(v3)
[]
[ "numpy" ]
[ "import numpy as np" ]
4
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v4
[ "List['Block']", "Any" ]
List['Block']
def v4(self, v5: List['Block'], v6=None) -> List['Block']: if v6 is not None: return v5 return v0([b.convert(datetime=True, numeric=False) for v7 in v5])
[ { "name": "v0", "input_types": [ "Any", "Any" ], "output_type": "Any", "code": "def v0(v1, v2=None):\n if v2 is None:\n v2 = []\n if isinstance(v1, list):\n for v3 in v1:\n if isinstance(v3, list):\n v2.extend(v3)\n else:\n ...
[]
[]
4
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v0
[ "Any", "bool", "str" ]
Any
def v0(self, v1, v2: bool=False, v3: str='raise'): v1 = pandas_dtype(v1) if is_datetime64tz_dtype(v1): v4 = self.values if v2: v4 = v4.copy() if getattr(v4, 'tz', None) is None: v4 = DatetimeArray(v4).tz_localize('UTC') v4 = v4.tz_convert(v1.tz) re...
[]
[ "pandas" ]
[ "from pandas._libs import NaT, algos as libalgos, lib, writers", "import pandas._libs.internals as libinternals", "from pandas._libs.tslibs import conversion", "from pandas._libs.tslibs.timezones import tz_compare", "from pandas._typing import ArrayLike", "from pandas.util._validators import validate_bool...
11
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v31
[ "bool", "bool", "bool", "bool", "bool" ]
Any
def v31(self, v32: bool=True, v33: bool=True, v34: bool=True, v35: bool=True, v36: bool=False): def v37(v38, v39, v40): v41 = v39.shape v42 = soft_convert_objects(v39.ravel(), datetime=v33, numeric=v34, timedelta=v35, coerce=v36, copy=v32) if isinstance(v42, np.ndarray): v42 = v...
[ { "name": "v0", "input_types": [ "Any", "Any", "Any" ], "output_type": "Any", "code": "def v0(v1, v2=1, v3=None):\n if v1.ndim < v2:\n if v3 is None:\n v3 = v1.shape\n if not is_extension_array_dtype(v1):\n v1 = v1.reshape(tuple((1,) + v3)...
[ "datetime", "numpy", "pandas", "warnings" ]
[ "from datetime import datetime, timedelta", "import warnings", "import numpy as np", "from pandas._libs import NaT, Timestamp, algos as libalgos, lib, tslib, writers", "from pandas._libs.index import convert_scalar", "import pandas._libs.internals as libinternals", "from pandas._libs.tslibs import Timed...
15
from datetime import datetime, timedelta import functools import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, Timestamp, algos as libalgos, lib, tslib, writers from pandas._libs.index import convert_scalar import pandas._libs.internals as libinternals...
null
v0
[ "bool" ]
Any
def v0(self, v1: bool=True): v2 = self.values if v1: v2 = v2.copy() return self.make_block_same_class(v2, ndim=self.ndim)
[]
[]
[]
5
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v0
[ "Any", "Any", "bool", "bool", "bool" ]
List['Block']
def v0(self, v1, v2, v3: bool=False, v4: bool=False, v5: bool=True) -> List['Block']: v3 = validate_bool_kwarg(v3, 'inplace') v6 = self if v3 else self.copy() v6.values.replace(v1, v2, inplace=True) return [v6]
[]
[ "pandas" ]
[ "from pandas._libs import NaT, algos as libalgos, internals as libinternals, lib, writers", "from pandas._libs.internals import BlockPlacement", "from pandas._libs.tslibs import conversion", "from pandas._libs.tslibs.timezones import tz_compare", "from pandas._typing import ArrayLike, Scalar, Shape", "fro...
5
from datetime import datetime, timedelta import inspect import re from typing import TYPE_CHECKING, Any, List, Optional, Type, Union, cast import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, internals as libinternals, lib, writers from pandas._libs.internals import BlockPlacement from ...
null
v5
[ "Any", "Any", "bool", "int", "bool" ]
List['Block']
def v5(self, v6, v7, v8: bool=False, v9: int=0, v10: bool=False) -> List['Block']: v8 = validate_bool_kwarg(v8, 'inplace') v6 = v0(v6) v11 = self.values if v8 else self.values.copy() if isinstance(v7, (np.ndarray, ExtensionArray)) and len(v7) == len(v6): v7 = v7[v6] v6 = v2(v6, v11.shape) ...
[ { "name": "v0", "input_types": [ "ArrayLike" ], "output_type": "np.ndarray", "code": "def v0(v1: ArrayLike) -> np.ndarray:\n if isinstance(v1, ExtensionArray):\n v1 = np.asarray(v1, dtype=np.bool_)\n assert isinstance(v1, np.ndarray), type(v1)\n assert v1.dtype == bool, v1....
[ "numpy", "pandas" ]
[ "import numpy as np", "from pandas._libs import NaT, algos as libalgos, lib, writers", "import pandas._libs.internals as libinternals", "from pandas._libs.tslibs import conversion", "from pandas._libs.tslibs.timezones import tz_compare", "from pandas._typing import ArrayLike", "from pandas.util._validat...
9
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v0
[ "str", "int", "bool", "Optional[int]", "Optional[Any]", "bool", "Optional[str]" ]
List['Block']
def v0(self, v1: str='pad', v2: int=0, v3: bool=False, v4: Optional[int]=None, v5: Optional[Any]=None, v6: bool=False, v7: Optional[str]=None) -> List['Block']: v3 = validate_bool_kwarg(v3, 'inplace') if v6: if not self._can_hold_na: if v3: return [self] else: ...
[]
[ "pandas" ]
[ "from pandas._libs import NaT, algos as libalgos, lib, writers", "import pandas._libs.internals as libinternals", "from pandas._libs.internals import BlockPlacement", "from pandas._libs.tslibs import conversion", "from pandas._libs.tslibs.timezones import tz_compare", "from pandas._typing import ArrayLike...
13
from datetime import datetime, timedelta import inspect import re from typing import TYPE_CHECKING, Any, List, Optional import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.internals import BlockPlacement from ...
null
v3
[ "Any", "Any", "Any", "Any", "Any", "Any", "Any", "Any", "Any" ]
List['Block']
def v3(self, v4=None, v5=None, v6=None, v7=0, v8=None, v9='forward', v10=None, v11=False, v12=None, **v13) -> List['Block']: v11 = validate_bool_kwarg(v11, 'inplace') v14 = self.values if v11 else self.values.copy() if not self.is_float: if not self.is_integer: return [self] v14 ...
[ { "name": "v0", "input_types": [], "output_type": "Any", "code": "@property\ndef v0(self):\n return np.datetime64('NaT', 'ns')", "dependencies": [] }, { "name": "v1", "input_types": [ "Any" ], "output_type": "Any", "code": "def v1(v2):\n return missing.interpo...
[ "numpy", "pandas" ]
[ "import numpy as np", "from pandas._libs import NaT, algos as libalgos, lib, writers", "import pandas._libs.internals as libinternals", "from pandas._libs.tslibs import conversion", "from pandas._libs.tslibs.timezones import tz_compare", "from pandas._typing import ArrayLike", "from pandas.util._validat...
18
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v280
[ "npt.NDArray[np.intp]", "int", "BlockPlacement | None", "Any" ]
v0
def v280(self, v281: npt.NDArray[np.intp], v282: int=0, v283: BlockPlacement | None=None, v284=lib.no_default) -> v0: if v284 is lib.no_default: v284 = None v285 = self.values.take(v281, fill_value=v284, allow_fill=True) assert not (self.ndim == 1 and v283 is None) if v283 is None: v283 ...
[]
[ "pandas" ]
[ "from pandas._libs import Timestamp, internals as libinternals, lib, writers", "from pandas._libs.internals import BlockPlacement", "from pandas._libs.tslibs import IncompatibleFrequency", "from pandas._typing import ArrayLike, DtypeObj, F, Shape, npt", "from pandas.errors import AbstractMethodError", "fr...
8
from __future__ import annotations from functools import wraps import re from typing import ( TYPE_CHECKING, Any, Callable, Iterable, Sequence, cast, final, ) import warnings import numpy as np from pandas._libs import ( Timestamp, internals as libinternals, lib, writers, ...
[ "class v0(PandasObject):\n v1: np.ndarray | ExtensionArray\n v2: int\n v3: Callable\n v4 = ()\n v5 = False\n v6 = False\n v7 = False\n v8 = True\n v9 = True\n\n @final\n @cache_readonly\n def v10(self):\n return (self._can_consolidate, self.dtype.name)\n\n @final\n @...
v2
[ "Any", "Any", "Any", "bool", "int" ]
List['Block']
def v2(self, v3, v4, v5='raise', v6: bool=False, v7: int=0) -> List['Block']: v4 = v0(v4) assert not isinstance(v3, (ABCIndexClass, ABCSeries, ABCDataFrame)) if isinstance(v3, np.ndarray) and v3.ndim == 2: assert v3.shape[1] == 1 v3 = v3[:, 0] if isinstance(v4, np.ndarray) and v4.ndim ==...
[ { "name": "v0", "input_types": [ "ArrayLike" ], "output_type": "np.ndarray", "code": "def v0(v1: ArrayLike) -> np.ndarray:\n if isinstance(v1, ExtensionArray):\n v1 = np.asarray(v1, dtype=np.bool_)\n assert isinstance(v1, np.ndarray), type(v1)\n assert v1.dtype == bool, v1....
[ "numpy", "pandas" ]
[ "import numpy as np", "from pandas._libs import NaT, algos as libalgos, lib, writers", "import pandas._libs.internals as libinternals", "from pandas._libs.tslibs import conversion", "from pandas._libs.tslibs.timezones import tz_compare", "from pandas._typing import ArrayLike", "from pandas.util._validat...
26
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v0
[ "Any" ]
bool
def v0(self, v1) -> bool: if self.dtype != v1.dtype or self.shape != v1.shape: return False return (self.values.view('i8') == v1.values.view('i8')).all()
[]
[]
[]
4
from datetime import datetime, timedelta import inspect import re from typing import Any, List import warnings import numpy as np from pandas._libs import NaT, algos as libalgos, lib, writers import pandas._libs.internals as libinternals from pandas._libs.tslibs import conversion from pandas._libs.tslibs.timezones im...
null
v10
[ "Any" ]
v0
def v10(v11: Any) -> v0: v12 = v6(v11) v13 = list(v11)[0] return v12(v11[v13])
[ { "name": "v6", "input_types": [ "Any" ], "output_type": "type[v0]", "code": "def v6(v7: Any) -> type[v0]:\n if not isinstance(v7, dict):\n raise vol.Invalid('Expected a dictionary')\n if len(v7) != 1:\n raise vol.Invalid(f\"Only one type can be specified. Found {', '.j...
[]
[]
4
"""Selectors for Home Assistant.""" from __future__ import annotations from collections.abc import Callable, Sequence from typing import Any, TypedDict, cast import voluptuous as vol from homeassistant.backports.enum import StrEnum from homeassistant.const import CONF_MODE, CONF_UNIT_OF_MEASUREMENT from homeassistan...
[ "class v0:\n v1: Callable\n v2: Any\n v3: str\n\n def __init__(self, v4: Any=None) -> None:\n \"\"\"Instantiate a selector.\"\"\"\n if v4 is None:\n v4 = {}\n self.config = self.CONFIG_SCHEMA(v4)\n\n def v5(self) -> Any:\n \"\"\"Serialize Selector for voluptuous...
v10
[ "Any" ]
dict
def v10(v11: Any) -> dict: v12 = v6(v11) v13 = list(v11)[0] if v11[v13] is None: return {v13: {}} return {v13: cast(dict, v12.CONFIG_SCHEMA(v11[v13]))}
[ { "name": "v6", "input_types": [ "Any" ], "output_type": "type[v0]", "code": "def v6(v7: Any) -> type[v0]:\n if not isinstance(v7, dict):\n raise vol.Invalid('Expected a dictionary')\n if len(v7) != 1:\n raise vol.Invalid(f\"Only one type can be specified. Found {', '.j...
[ "typing" ]
[ "from typing import Any, TypedDict, cast" ]
6
"""Selectors for Home Assistant.""" from __future__ import annotations from collections.abc import Callable, Sequence from typing import Any, TypedDict, cast import voluptuous as vol from homeassistant.backports.enum import StrEnum from homeassistant.const import CONF_MODE, CONF_UNIT_OF_MEASUREMENT from homeassistan...
[ "class v0:\n v1: Callable\n v2: Any\n v3: str\n\n def __init__(self, v4: Any=None) -> None:\n \"\"\"Instantiate a selector.\"\"\"\n if v4 is None:\n v4 = {}\n self.config = self.CONFIG_SCHEMA(v4)\n\n def v5(self) -> Any:\n \"\"\"Serialize Selector for voluptuous...
v13
[ "List[v2]", "List[v2]" ]
List[v0]
def v13(v14: List[v2], v15: List[v2]) -> List[v0]: v16: List[v0] = [] for (v17, v18) in enumerate(v15): v19 = v14[v17] v20 = v14[v17 + 1] v21 = v3(v19, v18) v22 = v3(v20, v18) v16.append((v21, v22)) return v16
[ { "name": "v3", "input_types": [ "v2", "v2", "int", "bool" ], "output_type": "v1", "code": "def v3(v4: v2, v5: v2, v6: int=0, v7: bool=True) -> v1:\n if v7:\n v8 = [_LEMMATIZER(token.text.lower(), 'NOUN')[0] for v9 in v4]\n else:\n v8 = [_LEMMATIZER(v9...
[]
[]
9
from allennlp.common import tqdm tqdm._tqdm.monitor_interval = 0 from typing import Dict, List, Tuple, Iterator import collections import csv import enum import itertools from overrides import overrides from allennlp.common import Params from allennlp.data.dataset_readers.dataset_reader import DatasetReader from all...
[ "v0 = Tuple[Span, Span]", "v1 = Tuple[int, int]", "v2 = List[Token]" ]
v0
[ "str" ]
float
def v0(v1: str) -> float: if v1 in {'nan', '-'}: return np.nan return float(v1)
[]
[ "numpy" ]
[ "import numpy as np" ]
4
"""Machinery to parse columns in accordance with their unit indicator. Parsers to convert column values of uncontrolled data types into values with a data type consistent with the intended representation given the column's unit indicator. A data-type-specific parser is implemented for each of the allowable StarTable ...
null
v13
[ "v0[v1[v3]]" ]
AsyncIterator[v3]
async def v13(v14: v0[v1[v3]]) -> AsyncIterator[v3]: async for v15 in v4(v14): yield (await v11(v15))
[ { "name": "v4", "input_types": [ "v0[v3]" ], "output_type": "AsyncIterator[v3]", "code": "def v4(v5: v0[v3]) -> AsyncIterator[v3]:\n if isinstance(v5, AsyncIterable):\n return iter_async_iter(v5)\n elif isinstance(v5, Iterable):\n return iter_to_async_iter(v5)\n else...
[ "inspect", "typing" ]
[ "from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
3
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = Union[T, Awaitable[T]]", "v2 = TypeVar('R')", "v3 = TypeVar('T')" ]
v13
[ "v0[v1[v3]]" ]
AsyncIterator[v3]
async def v13(v14: v0[v1[v3]]) -> AsyncIterator[v3]: v15 = [v11(element) async for v16 in v4(v14)] v17 = await asyncio.gather(*v15) for v18 in v17: yield v18
[ { "name": "v4", "input_types": [ "v0[v3]" ], "output_type": "AsyncIterator[v3]", "code": "def v4(v5: v0[v3]) -> AsyncIterator[v3]:\n if isinstance(v5, AsyncIterable):\n return iter_async_iter(v5)\n elif isinstance(v5, Iterable):\n return iter_to_async_iter(v5)\n else...
[ "asyncio", "inspect", "typing" ]
[ "import asyncio", "from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_che...
5
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = Union[T, Awaitable[T]]", "v2 = TypeVar('R')", "v3 = TypeVar('T')" ]
v7
[ "v0[v1]" ]
AsyncIterator[v1]
def v7(v8: v0[v1]) -> AsyncIterator[v1]: if isinstance(v8, AsyncIterable): return v2(v8) elif isinstance(v8, Iterable): return v4(v8) else: raise TypeError(f'Expected iterable or async iterable, got {type(v8).__name__!r}.')
[ { "name": "v2", "input_types": [ "AsyncIterable[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: AsyncIterable[v1]) -> AsyncIterator[v1]:\n return v3.__aiter__()", "dependencies": [] }, { "name": "v4", "input_types": [ "Iterable[v1]" ], "outp...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
7
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v1
[]
AsyncIterator[v0]
async def v1(*v2: AsyncIterable[v0]) -> AsyncIterator[v0]: for v3 in v2: async for v4 in v3: yield v4
[]
[]
[]
4
from typing import TypeVar, AsyncIterator, Union, AsyncIterable, Awaitable import asyncio import uvloop T = TypeVar('T') def switch_to_uvloop() -> asyncio.AbstractEventLoop: """ stop any running event loops; install uvloop; then create, set and return a new event loop """ try: asyncio.get_event_loop()...
[ "v0 = TypeVar('T')" ]
v1
[ "Callable[[], Awaitable[v0]]", "v0" ]
AsyncIterator[v0]
async def v1(v2: Callable[[], Awaitable[v0]], v3: v0) -> AsyncIterator[v0]: while True: v4 = await v2() if v4 == v3: break yield v4
[]
[]
[]
6
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = TypeVar('T')" ]
v9
[ "v0[v1]" ]
bool
async def v9(v10: v0[v1]) -> bool: async for v11 in v2(v10): if not v11: return False return True
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
5
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v1
[ "v0", "v0" ]
AsyncIterator[v0]
async def v1(v2: v0=0, v3: v0=1) -> AsyncIterator[v0]: v4 = v2 while True: yield v4 v4 += v3
[]
[]
[]
5
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = TypeVar('N', int, float)" ]
v9
[ "ContextManager[v0[v1]]" ]
AsyncIterator[v1]
def v9(v10: ContextManager[v0[v1]]) -> AsyncIterator[v1]: with v10 as v11: return v2(v11)
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
3
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v14
[ "v0[v1]" ]
AsyncIterator[v1]
async def v14(v15: v0[v1]) -> AsyncIterator[v1]: v16 = await v4(v2(v15)) async for v17 in v12(v16): yield v17
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
4
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v9
[ "v0[v1]" ]
int
async def v9(v10: v0[v1]) -> int: v11 = 0 async for v12 in v2(v10): v11 += 1 return v11
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
5
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v9
[ "v0[v1]", "int" ]
AsyncIterator[Tuple[int, v1]]
async def v9(v10: v0[v1], v11: int=0) -> AsyncIterator[Tuple[int, v1]]: if not isinstance(v11, int): raise TypeError(f'Expected start to be integer, got {type(v11).__name__!r}.') v12 = v11 async for v13 in v2(v10): yield (v12, v13) v12 += 1
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
7
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v13
[ "Callable[[v3], v1[Any]]", "v0[v3]" ]
AsyncIterator[v3]
async def v13(v14: Callable[[v3], v1[Any]], v15: v0[v3]) -> AsyncIterator[v3]: async for v16 in v4(v15): if await v11(v14(v16)): yield v16 else: break
[ { "name": "v4", "input_types": [ "v0[v3]" ], "output_type": "AsyncIterator[v3]", "code": "def v4(v5: v0[v3]) -> AsyncIterator[v3]:\n if isinstance(v5, AsyncIterable):\n return iter_async_iter(v5)\n elif isinstance(v5, Iterable):\n return iter_to_async_iter(v5)\n else...
[ "inspect", "typing" ]
[ "from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
6
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = Union[T, Awaitable[T]]", "v2 = TypeVar('R')", "v3 = TypeVar('T')" ]
v9
[ "Callable[[v1], Any]", "v0[v1]" ]
AsyncIterator[v1]
async def v9(v10: Callable[[v1], Any], v11: v0[v1]) -> AsyncIterator[v1]: async for v12 in v2(v11): if not v10(v12): yield v12
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
4
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v14
[ "Callable[[v3], v1[v4]]", "v0[v3]" ]
AsyncIterator[v4]
async def v14(v15: Callable[[v3], v1[v4]], v16: v0[v3]) -> AsyncIterator[v4]: async for v17 in v5(v16): yield (await v12(v15(v17)))
[ { "name": "v5", "input_types": [ "v0[v3]" ], "output_type": "AsyncIterator[v3]", "code": "def v5(v6: v0[v3]) -> AsyncIterator[v3]:\n if isinstance(v6, AsyncIterable):\n return iter_async_iter(v6)\n elif isinstance(v6, Iterable):\n return iter_to_async_iter(v6)\n else...
[ "inspect", "typing" ]
[ "from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
3
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = Union[T, Awaitable[T]]", "v2 = TypeVar('R')", "v3 = TypeVar('T')", "v4 = TypeVar('U')" ]
v10
[ "Callable[[v1], v2]", "v0[v1]" ]
AsyncIterator[v2]
async def v10(v11: Callable[[v1], v2], v12: v0[v1]) -> AsyncIterator[v2]: async for v13 in v3(v12): yield v11(v13)
[ { "name": "v3", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v3(v4: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v4, AsyncIterable):\n return iter_async_iter(v4)\n elif isinstance(v4, Iterable):\n return iter_to_async_iter(v4)\n else...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
3
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')", "v2 = TypeVar('U')" ]
v14
[ "Callable[[v3], v1[v4]]", "v0[v3]" ]
AsyncIterator[v4]
async def v14(v15: Callable[[v3], v1[v4]], v16: v0[v3]) -> AsyncIterator[v4]: v17 = [v12(v15(element)) async for v18 in v5(v16)] v19 = await asyncio.gather(*v17) for v20 in v19: yield v20
[ { "name": "v5", "input_types": [ "v0[v3]" ], "output_type": "AsyncIterator[v3]", "code": "def v5(v6: v0[v3]) -> AsyncIterator[v3]:\n if isinstance(v6, AsyncIterable):\n return iter_async_iter(v6)\n elif isinstance(v6, Iterable):\n return iter_to_async_iter(v6)\n else...
[ "asyncio", "inspect", "typing" ]
[ "import asyncio", "from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_che...
5
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = Union[T, Awaitable[T]]", "v2 = TypeVar('R')", "v3 = TypeVar('T')", "v4 = TypeVar('U')" ]
v16
[ "Callable[..., v1[v3]]", "v0[v0[Any]]" ]
AsyncIterator[v3]
async def v16(v17: Callable[..., v1[v3]], v18: v0[v0[Any]]) -> AsyncIterator[v3]: async for v19 in v4(v18): v20 = await v6(v4(v19)) yield (await v14(v17(*v20)))
[ { "name": "v4", "input_types": [ "v0[v3]" ], "output_type": "AsyncIterator[v3]", "code": "def v4(v5: v0[v3]) -> AsyncIterator[v3]:\n if isinstance(v5, AsyncIterable):\n return iter_async_iter(v5)\n elif isinstance(v5, Iterable):\n return iter_to_async_iter(v5)\n else...
[ "inspect", "typing" ]
[ "from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
4
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = Union[T, Awaitable[T]]", "v2 = TypeVar('R')", "v3 = TypeVar('T')" ]
v12
[ "Callable[..., v1]", "v0[v0[Any]]" ]
AsyncIterator[v1]
async def v12(v13: Callable[..., v1], v14: v0[v0[Any]]) -> AsyncIterator[v1]: async for v15 in v2(v14): v16 = await v4(v2(v15)) yield v13(*v16)
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
4
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v16
[ "Callable[..., v1[v3]]", "v0[v0[Any]]" ]
AsyncIterator[v3]
async def v16(v17: Callable[..., v1[v3]], v18: v0[v0[Any]]) -> AsyncIterator[v3]: v19 = [await v6(v4(args_iterable)) async for v20 in v4(v18)] v21 = (v14(v17(*args)) for v22 in v19) v23 = await asyncio.gather(*v21) for v24 in v23: yield v24
[ { "name": "v4", "input_types": [ "v0[v3]" ], "output_type": "AsyncIterator[v3]", "code": "def v4(v5: v0[v3]) -> AsyncIterator[v3]:\n if isinstance(v5, AsyncIterable):\n return iter_async_iter(v5)\n elif isinstance(v5, Iterable):\n return iter_to_async_iter(v5)\n else...
[ "asyncio", "inspect", "typing" ]
[ "import asyncio", "from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_che...
6
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = Union[T, Awaitable[T]]", "v2 = TypeVar('R')", "v3 = TypeVar('T')" ]
v9
[ "v0[v1]" ]
AsyncIterator[v1]
async def v9(v10: v0[v1]) -> AsyncIterator[v1]: v11 = [] async for v12 in v2(v10): yield v12 v11.append(v12) if not v11: return while True: for v12 in v11: yield v12
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
10
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v1
[ "v0", "Optional[int]" ]
AsyncIterator[v0]
async def v1(v2: v0, v3: Optional[int]=None) -> AsyncIterator[v0]: if v3 is None: while True: yield v2 else: for v4 in range(v3): yield v2
[]
[]
[]
7
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = TypeVar('T')" ]
v9
[ "v0[v0[v1]]" ]
AsyncIterator[v1]
async def v9(v10: v0[v0[v1]]) -> AsyncIterator[v1]: async for v11 in v2(v10): async for v12 in v2(v11): yield v12
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
4
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v18
[ "v0[v1]", "v0[v2]" ]
AsyncIterator[v1]
async def v18(v19: v0[v1], v20: v0[v2]) -> AsyncIterator[v1]: async for (v21, v22) in v8(v19, v20): if v22: yield v21
[ { "name": "v3", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v3(v4: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v4, AsyncIterable):\n return iter_async_iter(v4)\n elif isinstance(v4, Iterable):\n return iter_to_async_iter(v4)\n else...
[ "asyncio", "typing" ]
[ "import asyncio", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
4
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')", "v2 = TypeVar('U')" ]
v13
[ "Callable[[v3], v1[Any]]", "v0[v3]" ]
AsyncIterator[v3]
async def v13(v14: Callable[[v3], v1[Any]], v15: v0[v3]) -> AsyncIterator[v3]: v16 = v4(v15) async for v17 in v16: if not await v11(v14(v17)): yield v17 break async for v17 in v16: yield v17
[ { "name": "v4", "input_types": [ "v0[v3]" ], "output_type": "AsyncIterator[v3]", "code": "def v4(v5: v0[v3]) -> AsyncIterator[v3]:\n if isinstance(v5, AsyncIterable):\n return iter_async_iter(v5)\n elif isinstance(v5, Iterable):\n return iter_to_async_iter(v5)\n else...
[ "inspect", "typing" ]
[ "from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
8
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = Union[T, Awaitable[T]]", "v2 = TypeVar('R')", "v3 = TypeVar('T')" ]
v17
[ "v0[v1]", "int" ]
Tuple[AsyncIterator[v1], ...]
def v17(v18: v0[v1], v19: int=2) -> Tuple[AsyncIterator[v1], ...]: v20: Optional[Tuple[v1, ...]] = None async def v21() -> AsyncIterator[v1]: nonlocal state if v20 is None: v22 = await v7(v18) async for v23 in v2(v22): yield v23 return tuple((v21() for v24 in...
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "typing" ]
[ "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
10
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v12
[]
AsyncIterator[Tuple[Any, ...]]
async def v12(*v13: v0[Any]) -> AsyncIterator[Tuple[Any, ...]]: v14: List[AsyncIterator[Any]] = [v2(iterable) for v15 in v13] if not v14: return while True: try: v16: Tuple[Any, ...] = tuple(await asyncio.gather(*map(v4, v14))) yield v16 except StopAsyncIterat...
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "asyncio", "typing" ]
[ "import asyncio", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
10
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v14
[ "v0[v1]" ]
AsyncIterator[v1]
async def v14(v15: v0[v1], *v16: Optional[int]) -> AsyncIterator[v1]: v17 = slice(*v16) (v18, v19, v20) = (v17.start or 0, v17.stop or max_size, v17.step or 1) if v18 < 0: raise ValueError('Slice start can not be lower than 0.') if v19 < 0: raise ValueError('Slice stop can not be lower t...
[ { "name": "v2", "input_types": [ "v0[v1]", "int" ], "output_type": "AsyncIterator[Tuple[int, v1]]", "code": "async def v2(v3: v0[v1], v4: int=0) -> AsyncIterator[Tuple[int, v1]]:\n if not isinstance(v4, int):\n raise TypeError(f'Expected start to be integer, got {type(v4)._...
[ "sys", "typing" ]
[ "from sys import maxsize as max_size", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
14
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v17
[ "v0[v1]", "int" ]
AsyncIterator[Tuple[v1, ...]]
def v17(v18: v0[v1], v19: int) -> AsyncIterator[Tuple[v1, ...]]: v20 = (v2(v18),) * v19 return v7(*v20)
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "asyncio", "typing" ]
[ "import asyncio", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
3
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v12
[ "v0[v0[v1]]" ]
AsyncIterator[v1]
async def v12(v13: v0[v0[v1]]) -> AsyncIterator[v1]: v14 = [v4(v2(element_iterable)) async for v15 in v2(v13)] v16 = await asyncio.gather(*v14) for v17 in v16: yield v17
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "asyncio", "typing" ]
[ "import asyncio", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
5
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v12
[ "v0[v0[v1]]", "bool" ]
AsyncIterator[v1]
async def v12(v13: v0[v0[v1]], *v15: Type[BaseException], v14: bool=True) -> AsyncIterator[v1]: if v14: v16 = [v4(v2(iterator)) async for v17 in v2(v13)] v18: List[Union[List[v1], BaseException]] = await asyncio.gather(*v16, return_exceptions=True) v19 = (result for v20 in v18 if not isinsta...
[ { "name": "v2", "input_types": [ "v0[v1]" ], "output_type": "AsyncIterator[v1]", "code": "def v2(v3: v0[v1]) -> AsyncIterator[v1]:\n if isinstance(v3, AsyncIterable):\n return iter_async_iter(v3)\n elif isinstance(v3, Iterable):\n return iter_to_async_iter(v3)\n else...
[ "asyncio", "typing" ]
[ "import asyncio", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
17
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = TypeVar('T')" ]
v5
[ "Callable[[v2], v0[v2]]", "v2" ]
AsyncIterator[v2]
async def v5(v6: Callable[[v2], v0[v2]], v7: v2) -> AsyncIterator[v2]: while True: yield v7 v7 = await v3(v6(v7))
[ { "name": "v3", "input_types": [ "v0[v1]" ], "output_type": "v1", "code": "async def v3(v4: v0[v1]) -> v1:\n if is_awaitable(v4):\n return await cast(Awaitable[v1], v4)\n return cast(v1, v4)", "dependencies": [] } ]
[ "inspect", "typing" ]
[ "from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
4
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[T, Awaitable[T]]", "v1 = TypeVar('R')", "v2 = TypeVar('T')" ]
v13
[ "v0[v3]", "Callable[[v3], v1[None]]", "Optional[Callable[[], v1[None]]]", "Optional[Callable[[], v1[None]]]" ]
AsyncIterator[v3]
async def v13(v14: v0[v3], v15: Callable[[v3], v1[None]], v16: Optional[Callable[[], v1[None]]]=None, v17: Optional[Callable[[], v1[None]]]=None) -> AsyncIterator[v3]: try: if v16 is not None: await v11(v16()) async for v18 in v4(v14): await v11(v15(v18)) yield v1...
[ { "name": "v4", "input_types": [ "v0[v3]" ], "output_type": "AsyncIterator[v3]", "code": "def v4(v5: v0[v3]) -> AsyncIterator[v3]:\n if isinstance(v5, AsyncIterable):\n return iter_async_iter(v5)\n elif isinstance(v5, Iterable):\n return iter_to_async_iter(v5)\n else...
[ "inspect", "typing" ]
[ "from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
10
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = Union[T, Awaitable[T]]", "v2 = TypeVar('R')", "v3 = TypeVar('T')" ]
v14
[ "v0[v3]", "Optional[Callable[[v3], v4]]" ]
AsyncIterator[v3]
async def v14(v15: v0[v3], v16: Optional[Callable[[v3], v4]]=None) -> AsyncIterator[v3]: if v16 is None: v17: Set[v3] = set() v18 = v17.add v19: List[v3] = [] v20 = v19.append async for v21 in v5(v15): try: if v21 not in v17: v1...
[ { "name": "v5", "input_types": [ "v0[v3]" ], "output_type": "AsyncIterator[v3]", "code": "def v5(v6: v0[v3]) -> AsyncIterator[v3]:\n if isinstance(v6, AsyncIterable):\n return iter_async_iter(v6)\n elif isinstance(v6, Iterable):\n return iter_to_async_iter(v6)\n else...
[ "inspect", "typing" ]
[ "from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function", "from typing import Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextManager, Dict, Iterable, Iterator, List, Optional, Reversible, Set, Tuple, Type, TypeVar, Union, cast, no_type_check, overload" ]
30
import asyncio from inspect import isawaitable as is_awaitable, iscoroutinefunction as is_coroutine_function from operator import add, attrgetter as get_attr_factory, mul from sys import maxsize as max_size from typing import ( Any, AsyncIterable, AsyncIterator, Awaitable, Callable, ContextMana...
[ "v0 = Union[AsyncIterable[T], Iterable[T]]", "v1 = Union[T, Awaitable[T]]", "v2 = TypeVar('R')", "v3 = TypeVar('T')", "v4 = TypeVar('U')" ]
v0
[ "pl.LightningModule", "int", "Optimizer", "int" ]
Any
def v0(self, v1: pl.LightningModule, v2: int, v3: Optimizer, v4: int): if v2 == self.milestones[0]: self.unfreeze_and_add_param_group(modules=v1.feature_extractor[-5:], optimizer=v3, train_bn=self.train_bn) elif v2 == self.milestones[1]: self.unfreeze_and_add_param_group(modules=v1.feature_extra...
[]
[]
[]
5
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
null
v0
[ "bool" ]
Any
def v0(self, v1: bool): if v1: v2 = self.create_dataset(self.data_path.joinpath('train'), self.train_transform) else: v2 = self.create_dataset(self.data_path.joinpath('validation'), self.valid_transform) return DataLoader(dataset=v2, batch_size=self._batch_size, num_workers=self._num_workers...
[]
[ "torch" ]
[ "import torch", "import torch.nn.functional as F", "from torch import nn, optim", "from torch.optim.lr_scheduler import MultiStepLR", "from torch.optim.optimizer import Optimizer", "from torch.utils.data import DataLoader" ]
6
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
null
v0
[]
None
def v0(self) -> None: super().setUp() torch.manual_seed(42) np.random.seed(42)
[]
[ "numpy", "torch" ]
[ "import numpy as np", "import torch" ]
4
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import json import unittest import numpy as np import torch from common_testing import TestCaseMixi...
null
v9
[]
None
def v9() -> None: v10 = ['/Users/oniani/Documents/csv_from_pdf/data/year-2015/2015-Quarter-2/', '/Users/oniani/Documents/csv_from_pdf/data/year-2015/2015-Quarter-3/', '/Users/oniani/Documents/csv_from_pdf/data/year-2015/2015-Quarter-4/'] v11 = ['/Users/oniani/Documents/csv_from_pdf/data/year-2016/2016-Quarter-1...
[ { "name": "v0", "input_types": [ "str" ], "output_type": "Any", "code": "def v0(v1: str):\n v2 = []\n for v3 in os.listdir(v1):\n with open(f'{v1}/{v3}', 'rb') as v4:\n v5 = pdftotext.PDF(v4)[0]\n v2.append(v5)\n v6 = []\n for v7 in v2:\n v8 = v7...
[ "os", "pandas" ]
[ "import os", "import pandas as pd" ]
5
""" Filename: scrape.py Modified: 2019-06-17 Author: David Oniani E-mail: onianidavid@gmail.com License: The code is licensed under MIT License. Please read the LICENSE file in this distribution for details regarding the licensing of this code. Description: Checking CSV files for validity. This is a v...
null
v0
[ "str", "Any" ]
Any
def v0(self, v1: str, v2=False): if not self.audit_mode: raise Exception('Explaining is available only in audit mode') self._check_empty_buffer() self.vw_process.stdin.write(bytes(v1.replace('\n', '').strip() + '\n', 'utf-8')) self.vw_process.stdin.flush() (v3, v4) = (self.vw_process.stdout....
[]
[]
[]
10
import logging import time import subprocess from typing import Dict, Iterable, Any, List, Optional, Union from .base import VowpalWabbitError, VowpalWabbitBaseModel, VowpalWabbitBaseFormatter logger = logging.getLogger(__name__) class VowpalWabbitProcess(VowpalWabbitBaseModel): """ Class representing Vowpa...
null
v0
[ "int" ]
int
def v0(self, v1: int) -> int: v2 = [int(i) for v3 in str(v1)] v4 = 0 v5 = 1 for v6 in v2: v4 += v6 v5 *= v6 return v5 - v4
[]
[]
[]
8
class Solution: def subtractProductAndSum(self, n: int) -> int: nums = [int(i) for i in str(n)] sum_ = 0 product = 1 for num in nums: sum_ += num product *= num return product - sum_
null
v0
[ "Any", "Any", "Any", "Any", "Any" ]
str
def v0(v1, v2, v3, v4=None, v5=None) -> str: v1 = list(v1[v2 - 1:v4]) v1[-1] = v1[-1][:v5] v1[0] = v1[0][v3:] return '\n'.join(v1).strip()
[]
[]
[]
5
import re from inspect import Parameter, Signature from io import BytesIO from tokenize import tokenize, tok_name from .visitor import Visitor from .exceptions import DeprecationError from .wrappers import * PARTIAL = re.compile(r'^#\s*(lazy|partial)\s*$') def throw(message, position): raise SyntaxError(message...
null
v6
[ "ast.AST" ]
Any
def v6(self, v7: ast.AST): if self.stop is None: v8 = (None, None) else: v8 = (self.stop.lineno, self.stop.col_offset) return v0(self.lines, v7.lineno, v7.col_offset, *v8)
[ { "name": "v0", "input_types": [ "Any", "Any", "Any", "Any", "Any" ], "output_type": "str", "code": "def v0(v1, v2, v3, v4=None, v5=None) -> str:\n v1 = list(v1[v2 - 1:v4])\n v1[-1] = v1[-1][:v5]\n v1[0] = v1[0][v3:]\n return '\\n'.join(v1).strip()", ...
[]
[]
6
import re from inspect import Parameter, Signature from io import BytesIO from tokenize import tokenize, tok_name from .visitor import Visitor from .exceptions import DeprecationError from .wrappers import * PARTIAL = re.compile(r'^#\s*(lazy|partial)\s*$') def throw(message, position): raise SyntaxError(message...
null
v7
[ "pd.DataFrame", "pd.DataFrame" ]
pd.DataFrame()
def v7(v8: pd.DataFrame, v9: pd.DataFrame) -> pd.DataFrame(): v10 = v0(v8, v9, 'uniprot_1', 'uniprot_2') v10.fillna({'iuphar': False}, inplace=True) return v10
[ { "name": "v0", "input_types": [ "Any", "Any", "Any", "Any" ], "output_type": "Any", "code": "def v0(v1, v2, v3='protein_1', v4='protein_2'):\n v5 = v2[v2.apply(lambda row: interaction_exist(row, v1, v3, v4), axis=1) == False]\n v6 = v1.append(v5, sort=True)\n re...
[]
[]
4
import pandas as pd from tools.tools_helper import interaction_exist, normalize_interactions def merge_interactions(interactions_1, interactions_2, interaction_1_key='protein_1', interaction_2_key='protein_2'): """ Merges two interactions dataframens prioritizing keeping first on duplicates """ inte...
null
v0
[ "types.Tensor" ]
Any
def v0(self, v1: types.Tensor): if self.summaries_enabled: with tf.name_scope('Losses/'): tf.compat.v2.summary.scalar(name='loss', data=v1, step=self.train_step_counter) if self._summarize_grads_and_vars: with tf.name_scope('Variables/'): for v2 in self.policy...
[]
[ "tensorflow" ]
[ "import tensorflow as tf" ]
16
# coding=utf-8 # Copyright 2020 The TF-Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
null
v0
[ "str" ]
Any
def v0(self, v1: str): self.merge(self.load_data(v1)) self.filename = v1
[]
[]
[]
3
import os import yaml from typing import Optional import sys import site import logging from collections.abc import Mapping logger = logging.getLogger(__name__) class Settings: def __init__(self, filename: Optional[str] = None) -> None: super().__init__() self.filename = self.get_defaults_filena...
null
v0
[ "np.ndarray", "int" ]
np.ndarray
def v0(v1: np.ndarray, v2: int) -> np.ndarray: (v3, v4) = v1.shape[:2] v5 = (v4 / 2, v3 / 2) v6 = cv2.getRotationMatrix2D(v5, v2, 1.0) v7 = abs(v6[0, 0]) v8 = abs(v6[0, 1]) v9 = int(v3 * v8 + v4 * v7) v10 = int(v3 * v7 + v4 * v8) v6[0, 2] += v9 / 2 - v5[0] v6[1, 2] += v10 / 2 - v5[1]...
[]
[ "cv2" ]
[ "import cv2" ]
12
import cv2 import numpy as np def to_grayscale(image: np.ndarray) -> np.ndarray: return cv2.cvtColor(image, cv2.COLOR_RGB2GRAY) def scale_image(image: np.ndarray, size: int) -> np.ndarray: return cv2.resize(image, (size, size)) def rotate_image(image: np.ndarray, angle_degrees: int) -> np.ndarray: hei...
null
v0
[ "str" ]
Tuple[Optional[Any], Optional[Any]]
def v0(self, v1: str) -> Tuple[Optional[Any], Optional[Any]]: v2 = None v3 = None for v4 in self._coin_list: if v1.lower() in list(v4.values()): v2 = v4.get('id') v3 = v4.get('symbol') print(f'Coin found : {v2} with symbol {v3}\n') break if not v2:...
[]
[]
[]
12
"""CoinGecko model""" __docformat__ = "numpy" from typing import Tuple, Union, Any, Dict, List, Optional import regex as re import pandas as pd from pycoingecko import CoinGeckoAPI from gamestonk_terminal.cryptocurrency.pycoingecko_helpers import ( remove_keys, filter_list, find_discord, rename_columns...
null
v0
[]
dict
def v0(self) -> dict: v1 = dict(localization='false', tickers='false', sparkline=True) return self.client.get_coin_by_id(self.coin_symbol, **v1)
[]
[]
[]
3
"""CoinGecko model""" __docformat__ = "numpy" from typing import Tuple, Union, Any, Dict, List, Optional import regex as re import pandas as pd from pycoingecko import CoinGeckoAPI from gamestonk_terminal.cryptocurrency.pycoingecko_helpers import ( remove_keys, filter_list, find_discord, rename_columns...
null
v0
[ "str", "int" ]
pd.DataFrame
def v0(self, v1: str='usd', v2: int=30, **v3: Any) -> pd.DataFrame: v4 = self.client.get_coin_market_chart_by_id(self.coin_symbol, v1, v2, **v3) v4 = v4['prices'] v5 = pd.DataFrame(data=v4, columns=['time', 'price']) v5['time'] = pd.to_datetime(v5.time, unit='ms') v5 = v5.set_index('time') v5['c...
[]
[ "pandas" ]
[ "import pandas as pd" ]
8
"""CoinGecko model""" __docformat__ = "numpy" from typing import Tuple, Union, Any, Dict, List, Optional import regex as re import pandas as pd from pycoingecko import CoinGeckoAPI from gamestonk_terminal.cryptocurrency.pycoingecko_helpers import ( remove_keys, filter_list, find_discord, rename_columns...
null
v0
[ "str", "int" ]
pd.DataFrame
def v0(self, v1: str='usd', v2: int=90) -> pd.DataFrame: v3 = self.client.get_coin_ohlc_by_id(self.coin_symbol, v1, v2) v4 = pd.DataFrame(data=v3, columns=['time', 'open', 'high', 'low', 'close']) v4['time'] = pd.to_datetime(v4.time, unit='ms') v4 = v4.set_index('time') v4['currency'] = v1 retur...
[]
[ "pandas" ]
[ "import pandas as pd" ]
7
"""CoinGecko model""" __docformat__ = "numpy" from typing import Tuple, Union, Any, Dict, List, Optional import regex as re import pandas as pd from pycoingecko import CoinGeckoAPI from gamestonk_terminal.cryptocurrency.pycoingecko_helpers import ( remove_keys, filter_list, find_discord, rename_columns...
null
v0
[]
bool
def v0(self) -> bool: if self._menu is None: return self._keyboard_ignore_nonphysical return self._keyboard_ignore_nonphysical and self._menu._keyboard_ignore_nonphysical
[]
[]
[]
4
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[ "bool" ]
bool
def v0(self, v1: bool=True) -> bool: if not v1: return self._visible if not self._visible: return False v2 = self._frame if v2 is not None: while True: if v2 is None: break if not v2._visible: return False v2 = v...
[]
[]
[]
14
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[]
'ScrollArea'
def v0(self) -> 'ScrollArea': if self._menu is not None: self._menu._widgets_surface_need_update = True return self
[]
[]
[]
4
""" pygame-menu https://github.com/ppizarror/pygame-menu SCROLLAREA ScrollArea class to manage scrolling in Menu. """ __all__ = [ # Main class 'ScrollArea', # Utils 'get_scrollbars_from_position' ] import pygame import pygame_menu from pygame_menu._base import Base from pygame_menu._decorator imp...
null
v0
[]
'ScrollArea'
def v0(self) -> 'ScrollArea': if self._menu is not None: self._menu._widget_surface_cache_need_update = True self._decorator.force_cache_update() return self
[]
[]
[]
5
""" pygame-menu https://github.com/ppizarror/pygame-menu SCROLLAREA ScrollArea class to manage scrolling in Menu. """ __all__ = [ # Main class 'ScrollArea', # Utils 'get_scrollbars_from_position' ] import pygame import pygame_menu from pygame_menu._base import Base from pygame_menu._decorator imp...
null
v0
[]
bool
def v0(self, *v1) -> bool: v2 = self._hash_variables(*v1) if v2 != self._last_render_hash or self._last_render_hash == 0: self._last_render_hash = v2 return True return False
[]
[]
[]
6
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[ "str" ]
'Widget'
def v0(self, v1: str) -> 'Widget': self._title = str(v1) self._apply_font() self._force_render() return self
[]
[]
[]
5
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[]
'Widget'
def v0(self) -> 'Widget': self._background_inflate = self._selection_effect.get_xy_margin() self._background_surface = None return self
[]
[]
[]
4
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[]
bool
def v0(self) -> bool: try: return self.get_value() != self._default_value except ValueError: return False
[]
[]
[]
5
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[ "'pygame.Surface'" ]
'Widget'
def v0(self, v1: 'pygame.Surface') -> 'Widget': if not self.is_visible(): return self if self.active and (not self._selected): self.active = False self._render() if self.is_selected() and (not self._selection_effect_draw_post): self._selection_effect.draw(v1, self) self._draw...
[]
[]
[]
16
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[ "str" ]
'Widget'
def v0(self, v1: str='widget') -> 'Widget': assert isinstance(v1, str) if v1 in self._kwargs.keys(): raise KeyError('duplicated key') self._kwargs[v1] = self return self
[]
[]
[]
6
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[]
None
def v0(self) -> None: if self._menu is not None: self._menu._sort_update_frames()
[]
[]
[]
3
""" pygame-menu https://github.com/ppizarror/pygame-menu FRAME Widget container. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining a copy ...
null
v0
[ "int" ]
'Widget'
def v0(self, v1: int=-1) -> 'Widget': if self._frame is not None: (v2, v3) = self._frame.get_position() self.set_position(v2 + self._padding[3], v3 + self._padding[0]) (v4, v5, v6) = self._frame.get_col_row_index() self.set_col_row_index(v4, v5, v1) self._frame.update_indices...
[]
[]
[]
10
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[ "bool", "bool" ]
'Widget'
def v0(self, v1: bool, v2: bool) -> 'Widget': assert isinstance(v1, bool) assert isinstance(v2, bool) self._flip = (v1, v2) self._force_render() return self
[]
[]
[]
6
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[]
None
def v0(self) -> None: self._scale[0] = False self._scale[1] = 1 self._scale[2] = 1 self._max_width[0] = None self._max_height[0] = None self.render()
[]
[]
[]
7
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[ "bool", "bool" ]
int
def v0(self, v1: bool=True, v2: bool=False) -> int: assert isinstance(v1, bool) assert isinstance(v2, bool) v3 = self.get_rect(apply_padding=v1, render=True) v4 = v3.height if v2: v4 += self._selection_effect.get_height() return int(v4)
[]
[]
[]
8
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null
v0
[ "'Sound'" ]
'Widget'
def v0(self, v1: 'Sound') -> 'Widget': self._sound = v1 return self
[]
[]
[]
3
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET Base class for widgets. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining ...
null