from warnings import warn


def _format_1(raw):
    """
    Format data with protocol 1.

    :param raw: returned by _load_raw
    :return: formatted data
    """
    data, metadata = raw[0]['data'], raw[0]['metadata']

    # Check for more content
    if len(raw) > 1:
        base_key = 'extra'
        key = base_key
        count = 0
        while key in metadata:
            key = base_key + f'_{count}'
            count += 1
        metadata[key] = raw[1:]
        warn('File contains extra information which will be returned in '
             f'metadata[{key}].')

    return data, metadata