def validate_location(value):
    if value is None:
        return  # Allow for None locations but not broken dicts
    from website.addons.osfstorage import settings
    for key in ('service', settings.WATERBUTLER_RESOURCE, 'object'):
        if key not in value:
            raise ValidationValueError('Location {} missing key "{}"'.format(value, key))
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/files/utils.py/validate_location/original