# Path: scapy/compat.py
# def plain_str(x):
#     # type: (AnyStr) -> str
#     """Convert basic byte objects to str"""
#     if isinstance(x, bytes):
#         return x.decode(errors="ignore")
#     return str(x)
# 
# Path: scapy/compat.py
#     FAKE_TYPING = False
#     FAKE_TYPING = True
#     TYPE_CHECKING = False
#     IO = _FakeType("IO")  # type: ignore
#         AF_INET = socket.AF_INET
#         AF_INET6 = socket.AF_INET6
# class _Generic_metaclass(type):
#     class _FT(object):
#     class Sized(object):  # type: ignore
#     class Generic(object):  # type: ignore
#         class _NT(cls):
#     class AddressFamily:
#         def __getitem__(self, typ):
# def _FakeType(name, cls=object):
#         def __init__(self, name):
#         def __getitem__(self, item):  # type: ignore
#         def __call__(self, *args, **kargs):
#         def __repr__(self):
#     def cast(_type, obj):  # type: ignore
#     def _unpickleNamedTuple(name, len_params, *args):
#     def NamedTuple(name, params):
#             def __reduce__(self):
# def lambda_tuple_converter(func):
#     def chb(x):
#     def raw(x):
#     def raw(x):
#     def bytes_encode(x):
#         def plain_str(x):
#         def plain_str(x):
#     def chb(x):
#     def orb(x):
# def bytes_hex(x):
# def hex_bytes(x):
#     def int_bytes(x, size):
#     def bytes_int(x):
#     def int_bytes(x, size):
#     def bytes_int(x):
# def base64_bytes(x):
# def bytes_base64(x):
#     def gzip_decompress(x):
#     def gzip_compress(x):


from scapy.error import Scapy_Exception
from scapy.compat import plain_str
from scapy.compat import (
    Any,
    Dict,
    Generic,
    Iterator,
    List,
    TypeVar,
    Union,
    cast,
)
import scapy.modules.six as six
from __future__ import print_function


###############################
#  Direct Access dictionary   #
###############################


def fixname(x):
    # type: (Union[bytes, str]) -> str
    """
    Modifies a string to make sure it can be used as an attribute name.
    """
    x = plain_str(x)
    if x and str(x[0]) in "0123456789":
        x = "n_" + x
    return x.translate(
        "________________________________________________"
        "0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______"
        "abcdefghijklmnopqrstuvwxyz____________________________"
        "______________________________________________________"
        "___________________________________________________"
    )


class DADict_Exception(Scapy_Exception):
    pass


_K = TypeVar('_K')  # Key type

# Path: scapy/compat.py
# def plain_str(x):
#     # type: (AnyStr) -> str
#     """Convert basic byte objects to str"""
#     if isinstance(x, bytes):
#         return x.decode(errors="ignore")
#     return str(x)
# 
# Path: scapy/compat.py
#     FAKE_TYPING = False
#     FAKE_TYPING = True
#     TYPE_CHECKING = False
#     IO = _FakeType("IO")  # type: ignore
#         AF_INET = socket.AF_INET
#         AF_INET6 = socket.AF_INET6
# class _Generic_metaclass(type):
#     class _FT(object):
#     class Sized(object):  # type: ignore
#     class Generic(object):  # type: ignore
#         class _NT(cls):
#     class AddressFamily:
#         def __getitem__(self, typ):
# def _FakeType(name, cls=object):
#         def __init__(self, name):
#         def __getitem__(self, item):  # type: ignore
#         def __call__(self, *args, **kargs):
#         def __repr__(self):
#     def cast(_type, obj):  # type: ignore
#     def _unpickleNamedTuple(name, len_params, *args):
#     def NamedTuple(name, params):
#             def __reduce__(self):
# def lambda_tuple_converter(func):
#     def chb(x):
#     def raw(x):
#     def raw(x):
#     def bytes_encode(x):
#         def plain_str(x):
#         def plain_str(x):
#     def chb(x):
#     def orb(x):
# def bytes_hex(x):
# def hex_bytes(x):
#     def int_bytes(x, size):
#     def bytes_int(x):
#     def int_bytes(x, size):
#     def bytes_int(x):
# def base64_bytes(x):
# def bytes_base64(x):
#     def gzip_decompress(x):
#     def gzip_compress(x):


# Path: scapy/dadict.py
from scapy.error import Scapy_Exception
from scapy.compat import plain_str
from scapy.compat import (
    Any,
    Dict,
    Generic,
    Iterator,
    List,
    TypeVar,
    Union,
    cast,
)
import scapy.modules.six as six

from __future__ import print_function


###############################
#  Direct Access dictionary   #
###############################


def fixname(x):
    # type: (Union[bytes, str]) -> str
    """
    Modifies a string to make sure it can be used as an attribute name.
    """
    x = plain_str(x)
    if x and str(x[0]) in "0123456789":
        x = "n_" + x
    return x.translate(
        "________________________________________________"
        "0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______"
        "abcdefghijklmnopqrstuvwxyz____________________________"
        "______________________________________________________"
        "___________________________________________________"
    )


class DADict_Exception(Scapy_Exception):
    pass


_K = TypeVar('_K')  # Key type

_V = TypeVar('_V')  # Value type