# Path: pulp_auto/namespace.py
# def load_ns(d, leaf_processor=lambda x: x):
#     '''a recursive dict-to-Namespace loader'''
#     if not isinstance(d, dict):
#         if isinstance(d, list):
#             return [load_ns(item) for item in d]
#         if isinstance(d, tuple):
#             return tuple([load_ns(item) for item in d])
#         return leaf_processor(d)
#     ns = Namespace()
#     for k, v in d.items():
#         ns[k] = load_ns(v, leaf_processor)
#     return ns


import rpm_unit, profile, logging
from pulp_auto.namespace import load_ns 
from handler import (Handler, logged, unit_method)

log = logging.getLogger(__name__)

class Content(Handler):
    '''content Task handler'''

    unit_type_map = {
        'rpm': rpm_unit.Rpm
    }

    @classmethod
    def augment_profile(cls, units, PROFILE):
        # augment profile with requested unit types
        cls.assert_units(units)
        for unit_type in cls.unit_types(units):
            if unit_type not in PROFILE.details:
                # different structure for content details

# Path: pulp_auto/namespace.py
# def load_ns(d, leaf_processor=lambda x: x):
#     '''a recursive dict-to-Namespace loader'''
#     if not isinstance(d, dict):
#         if isinstance(d, list):
#             return [load_ns(item) for item in d]
#         if isinstance(d, tuple):
#             return tuple([load_ns(item) for item in d])
#         return leaf_processor(d)
#     ns = Namespace()
#     for k, v in d.items():
#         ns[k] = load_ns(v, leaf_processor)
#     return ns


# Path: pulp_auto/handler/content_handler.py
import rpm_unit, profile, logging
from pulp_auto.namespace import load_ns 
from handler import (Handler, logged, unit_method)


log = logging.getLogger(__name__)

class Content(Handler):
    '''content Task handler'''

    unit_type_map = {
        'rpm': rpm_unit.Rpm
    }

    @classmethod
    def augment_profile(cls, units, PROFILE):
        # augment profile with requested unit types
        cls.assert_units(units)
        for unit_type in cls.unit_types(units):
            if unit_type not in PROFILE.details:
                # different structure for content details

                PROFILE.details[unit_type] = load_ns({