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

def smooth_normals(positions, normals):
    '''Assigns an averaged normal to each position based on all of the normals
    originally used for the position.
    '''
    lookup = defaultdict(list)
    for position, normal in zip(positions, normals):
        lookup[position].append(normal)
    result = []
    for position in positions:
        tx = ty = tz = 0
        for x, y, z in lookup[position]:
            tx += x
            ty += y
            tz += z
        d = (tx * tx + ty * ty + tz * tz) ** 0.5
        result.append((tx / d, ty / d, tz / d))
    return result