code: def chebinterpolate(func, deg, args=()):
      """Interpolate a function at the Chebyshev points of the first kind.
  
      Returns the Chebyshev series that interpolates `func` at the Chebyshev
      points of the first kind in the interval [-1, 1]. The interpolating
      series tends to a minmax approximation to `func` with increasing `deg`
      if the function is continuous in the interval.
  
      .. versionadded:: 1.14.0
  
      Parameters
      ----------
      func : function
          The function to be approximated. It must be a function of a single
          variable of the form ``f(x, a, b, c...)``, where ``a, b, c...`` are
          extra arguments passed in the `args` parameter.
      deg : int
          Degree of the interpolating polynomial
      args : tuple, optional
          Extra arguments to be used in the function call. Default is no extra
          arguments.
  
      Returns
      -------
      coef : ndarray, shape (deg + 1,)
          Chebyshev coefficients of the interpolating series ordered from low to
          high.
  
      Examples
      --------
      >>> import numpy.polynomial.chebyshev as C
      >>> C.chebfromfunction(lambda x: np.tanh(x) + 0.5, 8)
      array([  5.00000000e-01,   8.11675684e-01,  -9.86864911e-17,
              -5.42457905e-02,  -2.71387850e-16,   4.51658839e-03,
               2.46716228e-17,  -3.79694221e-04,  -3.26899002e-16])
  
      Notes
      -----
  
      The Chebyshev polynomials used in the interpolation are orthogonal when
      sampled at the Chebyshev points of the first kind. If it is desired to
      constrain some of the coefficients they can simply be set to the desired
      value after the interpolation, no new interpolation or fit is needed. This
      is especially useful if it is known apriori that some of coefficients are
      zero. For instance, if the function is even then the coefficients of the
      terms of odd degree in the result can be set to zero.
  
      """
      deg = np.asarray(deg)
  
      # check arguments.
      if deg.ndim > 0 or deg.dtype.kind not in "iu" or deg.size == 0:
          raise TypeError("deg must be an int")
      if deg < 0:
          raise ValueError("expected deg >= 0")
  
      order = deg + 1
      xcheb = chebpts1(order)
      yfunc = func(xcheb, *args)
      m = chebvander(xcheb, deg)
      c = np.dot(m.T, yfunc)
      c[0] /= order
      c[1:] /= 0.5 * order
  
      return c
  
imports: import numpy
  import numpy.linalg
  from numpy.core.multiarray import normalize_axis_index
  from .None import polyutils
  from ._polybase import ABCPolyBase
label_desc: Use image node_id 30 for calling a global function with example usage: chebinterpolate(func, deg, args) and returns: c