code: def insert(x, tck, m=1, per=0):
      # see the docstring of `_fitpack_py/insert`
      t, c, k = tck
      try:
          c[0][0]
          parametric = True
      except Exception:
          parametric = False
      if parametric:
          cc = []
          for c_vals in c:
              tt, cc_val, kk = insert(x, [t, c_vals, k], m)
              cc.append(cc_val)
          return (tt, cc, kk)
      else:
          tt, cc, ier = _fitpack._insert(per, t, c, k, x, m)
          if ier == 10:
              raise ValueError("Invalid input data")
          if ier:
              raise TypeError("An error occurred")
          return (tt, cc, k)
  
file_path: scipy/scipy/interpolate/_fitpack_impl.py
imports: import warnings
  import numpy
  from .None import _fitpack
  from numpy import atleast_1d, array, ones, zeros, sqrt, ravel, transpose, empty, iinfo, asarray
  from .None import dfitpack
label_desc: Use image node_id 11 for calling a global function with example usage: insert(x, tck, m, per) and returns: tt,  cc,  kk, tt,  cc,  k