def _format_path(path):
    """Format path to data for which an error was found.

    :param path: Path as a list of keys/indexes used to get to a piece of data
    :type path: collections.deque[str|int]
    :returns: String representation of a given path
    :rtype: str

    """
    path_with_brackets = (
        ''.join('[{!r}]'.format(fragment) for fragment in path)
    )
    return '{}'.format(path_with_brackets)