code: def _unscramble_regressor_columns(parent_data, data):
      
      matches = ['_power[0-9]+', '_derivative[0-9]+']
      var = OrderedDict((c, deque()) for c in parent_data.columns)
      for c in data.columns:
          col = c
          for m in matches:
              col = re.sub(m, '', col)
          if col == c:
              var[col].appendleft(c)
          else:
              var[col].append(c)
      unscrambled = reduce((lambda x, y: x + y), var.values())
      return data[[*unscrambled]]
docs: Reorder the columns of a confound matrix such that the columns are in
      the same order as the input data with any expansion columns inserted
      immediately after the originals.