# 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
                )
            self.managers = {k.strip('/'): v for k, v in new.items()}

    @property
    def root_manager(self):
        return self.managers.get('')

    def _extra_root_dirs(self):
        return [
            base_directory_model(path)
            for path in self.managers
            if path
        ]

    is_hidden = path_dispatch1('is_hidden', False)
    dir_exists = path_dispatch1('dir_exists', False)
    file_exists = path_dispatch_kwarg('file_exists', '', False)
    exists = path_dispatch1('exists', False)

    save = path_dispatch2('save', 'model', True)
    rename = path_dispatch_old_new('rename', False)

    __get = path_dispatch1('get', True)
    __delete = path_dispatch1('delete', False)

    @outside_root_to_404
    def get(self, path, content=True, type=None, format=None):
        """
        Special case handling for listing root dir.
        """

# 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

                )
            self.managers = {k.strip('/'): v for k, v in new.items()}

    @property
    def root_manager(self):
        return self.managers.get('')

    def _extra_root_dirs(self):
        return [
            base_directory_model(path)
            for path in self.managers
            if path
        ]

    is_hidden = path_dispatch1('is_hidden', False)
    dir_exists = path_dispatch1('dir_exists', False)
    file_exists = path_dispatch_kwarg('file_exists', '', False)
    exists = path_dispatch1('exists', False)

    save = path_dispatch2('save', 'model', True)
    rename = path_dispatch_old_new('rename', False)

    __get = path_dispatch1('get', True)
    __delete = path_dispatch1('delete', False)

    @outside_root_to_404
    def get(self, path, content=True, type=None, format=None):
        """
        Special case handling for listing root dir.
        """

        path = normalize_api_path(path)