code: def _poly_drift(order, frametimes):
      """Create a polynomial drift matrix
  
      Parameters
      ----------
      order, int, number of polynomials in the drift model
      tmax, float maximal time value used in the sequence
            this is used to normalize properly the columns
  
      Returns
      -------
      pol, array of shape(n_scans, order + 1)
           all the polynomial drift plus a constant regressor
      """
      order = int(order)
      pol = np.zeros((np.size(frametimes), order + 1))
      tmax = float(frametimes.max())
      for k in range(order + 1):
          pol[:, k] = (frametimes / tmax) ** k
      pol = _orthogonalize(pol)
      pol = np.hstack((pol[:, 1:], pol[:, :1]))
      return pol
  
file_path: nipy/nipy/modalities/fmri/design_matrix.py
imports: from warnings import warn
  import numpy
  from .hemodynamic_models import _orthogonalize, compute_regressor
label_desc: Use image node_id 1 for calling a global function with example usage: _poly_drift(order, frametimes) and returns: pol