code: def swap(alist, index=None):
      """swap the selected list element with the last element in alist
  
      Args:
        alist (list): a list of objects
        index (int, default=None): the selected element
  
      Returns:
        list with the elements swapped as indicated
      """
      if index not in range(len(alist)):  # don't swap an element
          return alist
      return (
          alist[:index] + alist[index + 1 :] + alist[index : index + 1]
      )
  
file_path: mystic/mystic/support.py
label_desc: Use image node_id 10 for calling a global function with example usage: swap(alist, index) and returns: unknown, alist