def from_json_or_fail(schema):
    # Unstringify stored metadata
    try:
        schema = json.loads(schema) if schema else {}
    except __HOLE__ as e:
        if isinstance(schema, dict):
            pass
        else:
            raise e
    return schema
dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/migration/migrate_registered_meta.py/from_json_or_fail