code: def test_ensure_in_context_manager(shared_ray_instance):
      # No enforcement on creation given __enter__ executes after __init__
      input = InputNode()
      with pytest.raises(
          AssertionError,
          match=(
              "InputNode is a singleton instance that should be only used "
              "in context manager"
          ),
      ):
          input.execute()
  
      @ray.remote
      def f(input):
          return input
  
      # No enforcement on creation given __enter__ executes after __init__
      dag = f.bind(InputNode())
      with pytest.raises(
          AssertionError,
          match=(
              "InputNode is a singleton instance that should be only used "
              "in context manager"
          ),
      ):
          dag.execute()
  
file_path: ray/python/ray/dag/tests/test_input_node.py
imports: import pytest
  from ray.dag.dag_node import DAGNode
  from ray.dag.input_node import InputNode
  from typing import Any, TypeVar
  import ray
label_desc: Use image node_id 10 for calling a global function with example usage: test_ensure_in_context_manager(shared_ray_instance) and returns: input