def array2vtkIdList(num_array, vtk_idlist=None):
    if vtk_idlist:
        ids = vtk_idlist
    else:
        ids = vtk.vtkIdList()

    arr = numpy.asarray(num_array)
    assert len(arr.shape) == 1, "Array for vtkIdList must be 1D"
    ids.SetNumberOfIds(len(arr))
    for i, j in enumerate(arr):
        ids.SetId(i, j)
    return ids


######################################################################
# Array argument handling functions.
######################################################################
Args:
dataset/ETHPy150Open enthought/mayavi/tvtk/array_handler.py/array2vtkIdList--crossover with--dataset/ETHPy150Open dansanderson/picotool/pico8/util.py/BaseSection.from_bytes