code: def test_return_yield_mix(shutdown_only):
      """
      Test the case where yield and return is mixed within a
      generator task.
      """
  
      @ray.remote
      def g():
          for i in range(3):
              yield i
              return
  
      generator = g.remote()
      result = []
      for ref in generator:
          result.append(ray.get(ref))
  
      assert len(result) == 1
      assert result[0] == 0
  
file_path: ray/python/ray/tests/test_streaming_generator_2.py
imports: import asyncio
  import pytest
  import numpy
  import sys
  import time
  import gc
  import ray
  from ray.experimental.state.api import list_actors
label_desc: Use image node_id 5 for calling a global function with example usage: test_return_yield_mix(shutdown_only) without return types