code: def normalize_scope(scope):
      r"""
      Convert various scope input to list format of [left_bound, right_bound]
  
      :param int|list|tuple|slice scope:
          can be int indicate replace single item like 1 or 3.
          can be list like (0,3) indicate replace items from 0 to 3(not included)
          or their list like [5,6]
          can be slice which would be convert to list or their list.
      :return list: [left_bound, right_bound]
      """
  
      if not isinstance(scope, (list, tuple, int, slice)):
          raise TypeError(
              f"_replace_at_scopes requires list of ``list``, "
              f"``tuple`` , ``int`` or ``slice``, got {type(scope)}"
          )
  
      # convert int to list
      if isinstance(scope, int):
          if scope < 0:
              raise ValueError(f"Can't replace {scope} index")
          scope = [scope, scope + 1]
  
      # convert slice to list, default step of slice is 1
      if isinstance(scope, slice):
          scope = [scope.start, scope.stop]
  
      if not all(isinstance(bound, int) for bound in scope):
          raise TypeError(
              f"normalize_scope requires ``int`` elements, got {scope}"
          )
  
      if len(scope) > 2:
          raise ValueError(
              f"normalize_scope requires range not longer than 2, "
              f"got {len(scope)}"
          )
      elif len(scope) == 2 and scope[0] > scope[1]:
          raise ValueError(
              f"normalize_scope requires left bound not bigger than right bound, "
              f"got {scope}"
          )
  
      return list(scope)
  
imports: import copy
  import random
  from .logger import logger
label_desc: Use image node_id 2 for calling a global function with example usage: normalize_scope(scope) and returns: list