code: def update_complex(Ck, ak, c, a, pos):
      """
      - ak is sorted (descending)
      - Ck[pos] and ak[pos] will be removed, and then
        c and a spliced in at the proper place
      - pos is 0, or -1
      """
      if pos == 0:
          at = ak[1:]
      else:
          at = ak[:-1]
  
      p = myinsert(at, a)
  
      # not done yet.
      if pos == 0:
          Ck[0:p], ak[p] = Ck[1 : p + 1], ak[1 : p + 1]
          Ck[p], ak[p] = c, a
      else:
          Ck[0:p], ak[p] = Ck[1 : p + 1], ak[1 : p + 1]
          Ck[p], ak[p] = c, a
  
      return
  
file_path: mystic/mystic/scemtools.py
imports: import numpy
label_desc: Use image node_id 9 for calling a global function with example usage: update_complex(Ck, ak, c, a, pos) without return types