def pop_from_form_data(relative_data, absolute_data, path):
    path = path.split('/')
    if path and path[0] == '':
        data = absolute_data
        # path[:2] will be ['', 'data'] so remove
        path = path[2:]
    else:
        data = relative_data

    while path and data:
        key, path = path[0], path[1:]
        try:
            if path:
                data = data[key]
            elif isinstance(data, dict):
                return data.pop(key)
            else:
                return None
        except __HOLE__:
            return None
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/reports/formdetails/readable.py/pop_from_form_data