code: def test_namespace_validation(shutdown_only):
      with pytest.raises(TypeError):
          ray.init(namespace=123)
  
      ray.shutdown()
  
      with pytest.raises(ValueError):
          ray.init(namespace="")
  
      ray.shutdown()
  
      ray.init(namespace="abc")
  
      @ray.remote
      class A:
          pass
  
      with pytest.raises(TypeError):
          A.options(namespace=123).remote()
  
      with pytest.raises(ValueError):
          A.options(namespace="").remote()
  
      A.options(
          name="a", namespace="test", lifetime="detached"
      ).remote()
  
      with pytest.raises(TypeError):
          ray.get_actor("a", namespace=123)
  
      with pytest.raises(ValueError):
          ray.get_actor("a", namespace="")
  
      ray.get_actor("a", namespace="test")
  
file_path: ray/python/ray/tests/test_namespace.py
imports: import sys
  import time
  import pytest
  import ray
  from ray._private import ray_constants
  from ray._private.test_utils import get_error_message, init_error_pubsub, run_string_as_driver
  from ray.cluster_utils import Cluster
label_desc: Use image node_id 8 for calling a global function with example usage: test_namespace_validation(shutdown_only) without return types