# Path: pgcontents/api_utils.py
# def base_directory_model(path):
#     m = base_model(path)
#     m.update(
#         type='directory',
#         last_modified=DUMMY_CREATED_DATE,
#         created=DUMMY_CREATED_DATE,
#     )
#     return m
# 
# def normalize_api_path(api_path):
#     """
#     Resolve paths with '..' to normalized paths, raising an error if the final
#     result is outside root.
#     """
#     normalized = posixpath.normpath(api_path.strip('/'))
#     if normalized == '.':
#         normalized = ''
#     elif normalized.startswith('..'):
#         raise PathOutsideRoot(normalized)
#     return normalized
# 
# def outside_root_to_404(fn):
#     """
#     Decorator for converting PathOutsideRoot errors to 404s.
#     """
#     @wraps(fn)
#     def wrapped(*args, **kwargs):
#         try:
#             return fn(*args, **kwargs)
#         except PathOutsideRoot as e:
#             raise HTTPError(404, "Path outside root: [%s]" % e.args[0])
#     return wrapped
# 
# Path: pgcontents/utils/ipycompat.py



from six import iteritems
from tornado.web import HTTPError
from .api_utils import (
    base_directory_model,
    normalize_api_path,
    outside_root_to_404,
)
from .utils.ipycompat import ContentsManager, Dict
        assert new_prefix == old_prefix
        result = getattr(new_mgr, mname)(
            old_mgr_path,
            new_mgr_path,
            *args,
            **kwargs
        )
        if returns_model and new_prefix:
            return _apply_prefix(new_prefix, result)
        else:
            return result
    return _wrapper


class HybridContentsManager(ContentsManager):
    """
    ContentsManager subclass that delegates specific subdirectories to other
    ContentsManager/Checkpoints pairs.
    """

    manager_classes = Dict(
        config=True,
        help=("Dict mapping root dir -> ContentsManager class.")
    )

    manager_kwargs = Dict(
        config=True,
        help=("Dict of dicts mapping root dir -> kwargs for manager.")
    )


# Path: pgcontents/api_utils.py
# def base_directory_model(path):
#     m = base_model(path)
#     m.update(
#         type='directory',
#         last_modified=DUMMY_CREATED_DATE,
#         created=DUMMY_CREATED_DATE,
#     )
#     return m
# 
# def normalize_api_path(api_path):
#     """
#     Resolve paths with '..' to normalized paths, raising an error if the final
#     result is outside root.
#     """
#     normalized = posixpath.normpath(api_path.strip('/'))
#     if normalized == '.':
#         normalized = ''
#     elif normalized.startswith('..'):
#         raise PathOutsideRoot(normalized)
#     return normalized
# 
# def outside_root_to_404(fn):
#     """
#     Decorator for converting PathOutsideRoot errors to 404s.
#     """
#     @wraps(fn)
#     def wrapped(*args, **kwargs):
#         try:
#             return fn(*args, **kwargs)
#         except PathOutsideRoot as e:
#             raise HTTPError(404, "Path outside root: [%s]" % e.args[0])
#     return wrapped
# 
# Path: pgcontents/utils/ipycompat.py



# Path: pgcontents/hybridmanager.py
from six import iteritems
from tornado.web import HTTPError
from .api_utils import (
    base_directory_model,
    normalize_api_path,
    outside_root_to_404,
)
from .utils.ipycompat import ContentsManager, Dict

        assert new_prefix == old_prefix
        result = getattr(new_mgr, mname)(
            old_mgr_path,
            new_mgr_path,
            *args,
            **kwargs
        )
        if returns_model and new_prefix:
            return _apply_prefix(new_prefix, result)
        else:
            return result
    return _wrapper


class HybridContentsManager(ContentsManager):
    """
    ContentsManager subclass that delegates specific subdirectories to other
    ContentsManager/Checkpoints pairs.
    """

    manager_classes = Dict(
        config=True,
        help=("Dict mapping root dir -> ContentsManager class.")
    )

    manager_kwargs = Dict(
        config=True,
        help=("Dict of dicts mapping root dir -> kwargs for manager.")
    )


    managers = Dict(help=("Dict mapping root dir -> ContentsManager."))