code: def _not_a_knot(x, k):
      """Given data x, construct the knot vector w/ not-a-knot BC.
      cf de Boor, XIII(12)."""
      x = np.asarray(x)
      if k % 2 != 1:
          raise ValueError("Odd degree for now only. Got %s." % k)
  
      m = (k - 1) // 2
      t = x[m + 1 : -m - 1]
      t = np.r_[(x[0],) * (k + 1), t, (x[-1],) * (k + 1)]
      return t
  
imports: import operator
  from math import prod
  import numpy
  from scipy._lib._util import normalize_axis_index
  from scipy.linalg import get_lapack_funcs, LinAlgError, cholesky_banded, cho_solve_banded, solve, solve_banded
  from scipy.optimize import minimize_scalar
  from .None import _bspl
  from .None import _fitpack_impl
  from scipy.sparse import csr_array
  from scipy.special import poch
  from itertools import combinations
label_desc: Use image node_id 5 for calling a global function with example usage: _not_a_knot(x, k) and returns: t