def freq_count(tree, target, count=None, level=0):
    if count is None:
        count = [[0, 0]]
    elif level >= len(count):
        count.append([level, 0])
    for item in tree:
        if isinstance(item, list):
            count = freq_count(item, target, count, level + 1)
        elif item == target:
            count[level][1] += 1
    return count

2833fc3a1a33a5f9b9a7f411f78c51964facca4e
<mask token>

def freq_count(tree, target, count=None, level=0):
    if count is None:
        count = [[0, 0]]
    elif level >= len(count):
        count.append([level, 0])
    for item in tree:
        if isinstance(item, list):
            count = freq_count(item, target, count, level + 1)
        elif item == target:
            count[level][1] += 1
    return count
