Returns path to the backing file of the object
    with the given ``id`` in the given ``collection``.
    Note that the ``id`` is made filesystem-safe by
    "normalizing" its string representation.

def object_path(collection, id):
    """Returns path to the backing file of the object
    with the given ``id`` in the given ``collection``.
    Note that the ``id`` is made filesystem-safe by
    "normalizing" its string representation."""
    _logger.debug(type(id))
    _logger.debug(id)
    if isinstance(id, dict) and 'id' in id:
        id = id['id']
    normalized_id = normalize_text(str(id), lcase=False)
    return os.path.join(_basepath, collection,
        '%s.%s' % (normalized_id, _ext))