<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def traverse_data(obj, key_target):
    ''' will traverse nested list and dicts until key_target equals the current dict key '''
    if isinstance(obj, str) and '.json' in str(obj):
        obj = json.load(open(obj, 'r'))
    if isinstance(obj, list):
        queue = obj.copy()
    elif isinstance(obj, dict):
        queue = [obj.copy()]
    else:
        sys.exit('obj needs to be a list or dict')
    count = 0
    ''' BFS '''
    while not queue or count != 1000:
        count += 1
        curr_obj = queue.pop()
        if isinstance(curr_obj, dict):
            for key, value in curr_obj.items():
                if key == key_target:
                    return curr_obj
                else:
                    queue.append(curr_obj[key])
        elif isinstance(curr_obj, list):
            for co in curr_obj:
                queue.append(co)
    if count == 1000:
        sys.exit('traverse_data needs to be updated...')
    return False