# 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

Care is taken to make this as pythonic as possible and hide as many of the gory
implementations as possible.

This module provides "syntactic sugar" around the lower-level, but almost
identical, module :py:mod:`puresnmp.api.raw`.

The "raw" module returns the variable types unmodified which are all subclasses
of :py:class:`x690.types.Type`.
"""

# TODO (advanced): This module should not make use of it's own functions. The
#     is beginning to be too "thick", containing too much business logic for a
#     mere abstraction layer.
#     module exists as an abstraction layer only. If one function uses a
#     "siblng" function, valuable information is lost. In general, this module





if TYPE_CHECKING:  # pragma: no cover
    # pylint: disable=unused-import, invalid-name, ungrouped-imports


    T = TypeVar("T", bound=PyType)

_set = set
LOG = logging.getLogger(__name__)
OID = ObjectIdentifier.from_string

# 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


Care is taken to make this as pythonic as possible and hide as many of the gory
implementations as possible.

This module provides "syntactic sugar" around the lower-level, but almost
identical, module :py:mod:`puresnmp.api.raw`.

The "raw" module returns the variable types unmodified which are all subclasses
of :py:class:`x690.types.Type`.
"""

# TODO (advanced): This module should not make use of it's own functions. The
#     is beginning to be too "thick", containing too much business logic for a
#     mere abstraction layer.
#     module exists as an abstraction layer only. If one function uses a
#     "siblng" function, valuable information is lost. In general, this module





if TYPE_CHECKING:  # pragma: no cover
    # pylint: disable=unused-import, invalid-name, ungrouped-imports


    T = TypeVar("T", bound=PyType)

_set = set
LOG = logging.getLogger(__name__)
OID = ObjectIdentifier.from_string

TWalkResponse = Generator[VarBind, None, None]