def metadata_from_package(variant):
    """Return metadata relative `variant`

    Blocking call, during change of profile.

    IMPORTANT: this function must return at least the
        members part of the original function, else the program
        will not function. Very few safeguards are put in place
        in favour of performance.

    Arguments:
        variant (rez.packages_.Variant): Package from which to retrieve data

    Returns:
        dict: See function for values and types

    """
    data = getattr(variant, '_data', {})
    return dict(data, **{'label': data.get('label', variant.name),
        'background': data.get('background'), 'icon': data.get('icon', ''),
        'hidden': data.get('hidden', False)})
