code: def _poly_drift(order, frame_times):
      """Create a polynomial drift matrix.
  
      Parameters
      ----------
      order : int,
          Number of polynomials in the drift model.
  
      frame_times : array of shape(n_scans),
          Time stamps used to sample polynomials.
  
      Returns
      -------
      pol : ndarray, shape(n_scans, order + 1)
           Estimated polynomial drifts plus a constant regressor.
  
      """
      order = int(order)
      pol = np.zeros((np.size(frame_times), order + 1))
      tmax = float(frame_times.max())
      for k in range(order + 1):
          pol[:, k] = (frame_times / tmax) ** k
      pol = orthogonalize(pol)
      pol = np.hstack((pol[:, 1:], pol[:, :1]))
      return pol
  
file_path: nilearn/nilearn/glm/first_level/design_matrix.py
imports: import sys
  from warnings import warn
  import numpy
  import pandas
  from nilearn._utils import fill_doc
  from nilearn.glm._utils import full_rank
  from nilearn.glm.first_level.experimental_paradigm import check_events, handle_modulation_of_duplicate_events
  from nilearn.glm.first_level.hemodynamic_models import compute_regressor, orthogonalize
label_desc: Use image node_id 1 for calling a global function with example usage: _poly_drift(order, frame_times) and returns: pol