code: def mock_sdk_client():
      class AsyncIterator:
          def __init__(self, seq):
              self._seq = seq
              self.iter = iter(self._seq)
  
          def __aiter__(self):
              return self
  
          async def __anext__(self):
              try:
                  return next(self.iter)
              except StopIteration:
                  self.iter = iter(self._seq)
                  raise StopAsyncIteration
  
      if "RAY_ADDRESS" in os.environ:
          del os.environ["RAY_ADDRESS"]
      with mock.patch(
          "ray.dashboard.modules.job.cli.JobSubmissionClient"
      ) as mock_client:
          # In python 3.6 it will fail with error
          # 'async for' requires an object with __aiter__ method, got MagicMock"
          mock_client().tail_job_logs.return_value = AsyncIterator(
              range(10)
          )
  
          # We need to return a string for the address and not a MagicMock
          mock_client().get_address.return_value = ""
  
          yield mock_client
  
imports: from contextlib import contextmanager
  import json
  import logging
  from pathlib import Path
  import tempfile
  import os
  from unittest import mock
  import yaml
  from typing import Optional
  from click.testing import CliRunner
  import pytest
  from ray.dashboard.modules.job.cli import job_cli_group
label_desc: Use image node_id 1 for calling a global function with example usage: mock_sdk_client() and returns: self, next