# Path: puresnmp/const.py
# DEFAULT_TIMEOUT = 6
# 
# class Version:
#     """
#     The SNMP Version identifier. This is used in the SNMP :term:`PDU`.
#     """
# 
#     V2C = 0x01
#     V1 = 0x00
# 
# Path: puresnmp/pdu.py
# class Trap(PDU):
#     """
#     Represents an SNMP Trap
#     """
# 
#     TAG = 7
# 
#     def __init__(self, *args, **kwargs):
#         # type: (Any, Any) -> None
#         super().__init__(*args, **kwargs)
#         self.source = None  # type: Optional[SocketInfo]
# 
# Path: puresnmp/snmp.py
# class VarBind:
#     """
#     A "VarBind" is a 2-tuple containing an object-identifier and the
#     corresponding value.
#     """
# 
#     # TODO: This class should be split in two for both the raw and pythonic
#     #       API, that would simplify the typing of both "oid" and "value"a lot
#     #       and keep things explicit
#     oid: ObjectIdentifier = ObjectIdentifier(0)
#     value: Union[PyType, Type, None] = None
# 
#     def __init__(self, oid, value):
#         # type: (Union[ObjectIdentifier, str], PyType) -> None
#         if not isinstance(oid, (ObjectIdentifier, str)):
#             raise TypeError(
#                 "OIDs for VarBinds must be ObjectIdentifier or str"
#                 " instances! Your value: %r" % oid
#             )
#         if isinstance(oid, str):
#             oid = ObjectIdentifier.from_string(oid)
#         self.oid = oid
#         self.value = value
# 
#     def __iter__(self) -> Iterator[Union[ObjectIdentifier, PyType]]:
#         return iter([self.oid, self.value])
# 
#     def __getitem__(self, idx: int) -> Union[PyType, Type, None]:
#         return list(self)[idx]
# 
#     def __lt__(self, other):
#         # type: (Any) -> bool
#         return (self.oid, self.value) < (other.oid, other.value)
# 
#     def __eq__(self, other):
#         # type: (Any) -> bool
#         return (self.oid, self.value) == (other.oid, other.value)
# 
#     def __hash__(self):
#         # type: () -> int
#         return hash((self.oid, self.value))
# 
#     def __repr__(self):
#         # type: () -> str
#         return "VarBind(%r, %r)" % (self.oid, self.value)
# 
# Path: puresnmp/util.py
# class BulkResult:
#     """
#     A representation for results of a "bulk" request.
# 
#     These requests get both "non-repeating values" (scalars) and "repeating
#     values" (lists). This wrapper makes these terms a bit friendlier to use.
#     """
# 
#     scalars: Dict[str, Any]
#     listing: Dict[str, Any]


import logging
from collections import OrderedDict
from datetime import timedelta
from typing import TYPE_CHECKING, Generator, List, TypeVar
from warnings import warn
from x690.types import ObjectIdentifier, Type  # type: ignore
from ..const import DEFAULT_TIMEOUT, Version
from ..pdu import Trap
from ..snmp import VarBind
from ..util import BulkResult
from . import raw
    from typing import Any, Callable, Dict, Tuple, Union
    from puresnmp.typevars import PyType

    See the "raw" equivalent for detailed documentation & examples.
    """

    raw_output = raw.bulkget(
        ip,
        community,
        scalar_oids,
        repeating_oids,
        max_list_size=max_list_size,
        port=port,
        timeout=timeout,
        version=version,
    )
    pythonized_scalars = {
        oid: value.pythonize() for oid, value in raw_output.scalars.items()
    }
    pythonized_list = OrderedDict(
        [(oid, value.pythonize()) for oid, value in raw_output.listing.items()]
    )
    return BulkResult(pythonized_scalars, pythonized_list)


def bulkwalk(
    ip,
    community,
    oids,
    bulk_size=10,
    port=161,
    timeout=DEFAULT_TIMEOUT,

# Path: puresnmp/const.py
# DEFAULT_TIMEOUT = 6
# 
# class Version:
#     """
#     The SNMP Version identifier. This is used in the SNMP :term:`PDU`.
#     """
# 
#     V2C = 0x01
#     V1 = 0x00
# 
# Path: puresnmp/pdu.py
# class Trap(PDU):
#     """
#     Represents an SNMP Trap
#     """
# 
#     TAG = 7
# 
#     def __init__(self, *args, **kwargs):
#         # type: (Any, Any) -> None
#         super().__init__(*args, **kwargs)
#         self.source = None  # type: Optional[SocketInfo]
# 
# Path: puresnmp/snmp.py
# class VarBind:
#     """
#     A "VarBind" is a 2-tuple containing an object-identifier and the
#     corresponding value.
#     """
# 
#     # TODO: This class should be split in two for both the raw and pythonic
#     #       API, that would simplify the typing of both "oid" and "value"a lot
#     #       and keep things explicit
#     oid: ObjectIdentifier = ObjectIdentifier(0)
#     value: Union[PyType, Type, None] = None
# 
#     def __init__(self, oid, value):
#         # type: (Union[ObjectIdentifier, str], PyType) -> None
#         if not isinstance(oid, (ObjectIdentifier, str)):
#             raise TypeError(
#                 "OIDs for VarBinds must be ObjectIdentifier or str"
#                 " instances! Your value: %r" % oid
#             )
#         if isinstance(oid, str):
#             oid = ObjectIdentifier.from_string(oid)
#         self.oid = oid
#         self.value = value
# 
#     def __iter__(self) -> Iterator[Union[ObjectIdentifier, PyType]]:
#         return iter([self.oid, self.value])
# 
#     def __getitem__(self, idx: int) -> Union[PyType, Type, None]:
#         return list(self)[idx]
# 
#     def __lt__(self, other):
#         # type: (Any) -> bool
#         return (self.oid, self.value) < (other.oid, other.value)
# 
#     def __eq__(self, other):
#         # type: (Any) -> bool
#         return (self.oid, self.value) == (other.oid, other.value)
# 
#     def __hash__(self):
#         # type: () -> int
#         return hash((self.oid, self.value))
# 
#     def __repr__(self):
#         # type: () -> str
#         return "VarBind(%r, %r)" % (self.oid, self.value)
# 
# Path: puresnmp/util.py
# class BulkResult:
#     """
#     A representation for results of a "bulk" request.
# 
#     These requests get both "non-repeating values" (scalars) and "repeating
#     values" (lists). This wrapper makes these terms a bit friendlier to use.
#     """
# 
#     scalars: Dict[str, Any]
#     listing: Dict[str, Any]


# Path: puresnmp/api/pythonic.py
import logging
from collections import OrderedDict
from datetime import timedelta
from typing import TYPE_CHECKING, Generator, List, TypeVar
from warnings import warn
from x690.types import ObjectIdentifier, Type  # type: ignore
from ..const import DEFAULT_TIMEOUT, Version
from ..pdu import Trap
from ..snmp import VarBind
from ..util import BulkResult
from . import raw
    from typing import Any, Callable, Dict, Tuple, Union
    from puresnmp.typevars import PyType


    See the "raw" equivalent for detailed documentation & examples.
    """

    raw_output = raw.bulkget(
        ip,
        community,
        scalar_oids,
        repeating_oids,
        max_list_size=max_list_size,
        port=port,
        timeout=timeout,
        version=version,
    )
    pythonized_scalars = {
        oid: value.pythonize() for oid, value in raw_output.scalars.items()
    }
    pythonized_list = OrderedDict(
        [(oid, value.pythonize()) for oid, value in raw_output.listing.items()]
    )
    return BulkResult(pythonized_scalars, pythonized_list)


def bulkwalk(
    ip,
    community,
    oids,
    bulk_size=10,
    port=161,
    timeout=DEFAULT_TIMEOUT,

    version=Version.V2C,