def process_media_attribute(attribute, resp, val):
    if val:
        if val.startswith('jr://'):
            pass
        elif val.startswith('/file/'):
            val = 'jr:/' + val
        elif val.startswith('file/'):
            val = 'jr://' + val
        elif val.startswith('/'):
            val = 'jr://file' + val
        else:
            val = 'jr://file/' + val
        resp['corrections'][attribute] = val
    else:
        val = None
    return val
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/app_manager/views/media_utils.py/process_media_attribute/original