code: def compact_carry_field(full_field):
      
  
      # Keep in mind that the field may already be compact or None
  
      if full_field is None:
          return None
  
      # List of same length. Place None where element
      # does not need to be written
      compact_field = [None]*len(full_field)
  
      prev_field = 0
  
      for i in range(len(full_field)):
          current_field = full_field[i]
          if current_field != prev_field:
              compact_field[i] = current_field
              prev_field = current_field
  
      # May further simplify
      if np.array_equal(compact_field, [None]*len(full_field)):
          compact_field = None
  
      return compact_field
docs: Return the compact list version of a list/array of an
      annotation field that has previous values carried over
      (chan or num)
      - The first sample is 0 by default. Only set otherwise
        if necessary.
      - Only set fields if they are different from their prev
        field