code: def test_add_column(ray_start_regular_shared):
      ds = ray.data.range(5).add_column("foo", lambda x: 1)
      assert ds.take(1) == [{"id": 0, "foo": 1}]
  
      ds = ray.data.range(5).add_column("foo", lambda x: x["id"] + 1)
      assert ds.take(1) == [{"id": 0, "foo": 1}]
  
      ds = ray.data.range(5).add_column("id", lambda x: x["id"] + 1)
      assert ds.take(2) == [{"id": 1}, {"id": 2}]
  
      with pytest.raises(ValueError):
          ds = ray.data.range(5).add_column("id", 0)
  
imports: import itertools
  import math
  import os
  import signal
  import threading
  import time
  from typing import Iterator
  import numpy
  import pandas
  import pyarrow
  import pyarrow.parquet
  import pytest
  import ray
  from ray._private.test_utils import wait_for_condition
  from ray.data.block import BlockAccessor
  from ray.data.context import DataContext
  from ray.data.tests.conftest import *
  from ray.data.tests.util import column_udf, column_udf_class, extract_values
  from ray.tests.conftest import *
label_desc: Use image node_id 7 for calling a global function with example usage: test_add_column(ray_start_regular_shared) without return types