code: def ensure_int_vector(I, require_order = False):
      
      if is_int_vector(I):
          return I
      elif is_int(I):
          return np.array([I])
      elif is_list_of_int(I):
          return np.array(I)
      elif is_tuple_of_int(I):
          return np.array(I)
      elif isinstance(I, set):
          if require_order:
              raise TypeError('Argument is an unordered set, but I require an ordered array of integers')
          else:
              lI = list(I)
              if is_list_of_int(lI):
                  return np.array(lI)
      else:
          raise TypeError('Argument is not of a type that is convertible to an array of integers.')
docs: Checks if the argument can be converted to an array of ints and does that.
  
      Parameters
      ----------
      I: int or iterable of int
      require_order : bool
          If False (default), an unordered set is accepted. If True, a set is not accepted.
  
      Returns
      -------
      arr : ndarray(n)
          numpy array with the integers contained in the argument