code: def replace_at_scopes(origin_list, scopes, new_items):
      r"""
      Replace items of given list.
      Notice: just support isometric replace.
  
      :param list origin_list:
      :param list scopes: list of int/list/slice
          can be int indicate replace single item or their list like [1, 2, 3].
          can be list like (0,3) indicate replace items from 0 to 3(not included)
              or their list like [(0, 3), (5,6)]
          can be slice which would be convert to list or their list.
          Watch out! Each range must be the same type!
      :param list new_items: items corresponding scopes.
      :return:
      """
  
      scopes = copy.deepcopy(scopes)
      assert isinstance(
          origin_list, list
      ), f"Origin_list should be `list`, not `{type(origin_list)}`."
      assert isinstance(
          scopes, list
      ), f"Scopes should be `list`, not `{type(scopes)}`."
      assert isinstance(
          new_items, list
      ), f"New_items should be `list`, not `{type(new_items)}`."
      assert len(scopes) == len(new_items), (
          f"The length of scopes `{len(scopes)}` and the length of new_items "
          f"`{len(new_items)}` should be the same."
      )
  
      # check whether scope and items length is compatible
      for i in range(len(scopes)):
          scopes[i] = scope = normalize_scope(scopes[i])
          items = (
              new_items[i]
              if isinstance(new_items[i], (list, tuple))
              else [new_items[i]]
          )
          assert scope[1] - scope[0] == len(
              items
          ), f"scope is not compatible with items length `{len(items)}`."
  
      return _replace_at_scopes(origin_list, scopes, new_items)
  
imports: import copy
  import random
  from .logger import logger
label_desc: Use image node_id 4 for calling a global function with example usage: replace_at_scopes(origin_list, scopes, new_items) and returns: _replace_at_scopes