code: def chebyshevcostfactory(target):
      def chebyshevcost(trial, M=61):
          """The costfunction for order-n Chebyshev fitting.
          M evaluation points between [-1, 1], and two end points"""
          from mystic.models._model_helper import chebyshev
  
          return chebyshev(trial, target, M)
  
      return chebyshevcost
  
imports: from .abstract_model import AbstractModel
  from numpy import sum
  from numpy import asarray
  from mystic.math import polyeval, poly1d
  from mystic.models._model_helper import chebyshev2coeffs, chebyshev4coeffs, chebyshev6coeffs, chebyshev8coeffs, chebyshev16coeffs
label_desc: Use image node_id 1 for calling a global function with example usage: chebyshevcostfactory(target) and returns: chebyshevcost, chebyshev