

def from_json_or_fail(schema):
    try:
        schema = (json.loads(schema) if schema else {
            
        })
    except TypeError 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/original