def METHOD_NAME(new_id, input_offsets):
    if new_id not in drop_node:
        new_id = new_id
    else:
        while new_id in drop_node:
            if new_id in pnodes:
                for n in pnodes[new_id]['inputs_offsets']:
                    if n not in input_offsets and n not in drop_node:
                        input_offsets.append(n)
            new_id = new_id - 1
    if new_id not in input_offsets:
        input_offsets.append(new_id)