code: def create_quadratic_function(n, m, rng):
      a = rng.rand(m)
      A = rng.rand(m, n)
      H = rng.rand(m, n, n)
      HT = np.transpose(H, (1, 2, 0))
  
      def fun(x):
          return a + A.dot(x) + 0.5 * H.dot(x).dot(x)
  
      def jac(x):
          return A + H.dot(x)
  
      def hess(x, v):
          return HT.dot(v)
  
      return fun, jac, hess
  
file_path: catboost/contrib/python/scipy/py3/scipy/optimize/_trustregion_constr/tests/test_canonical_constraint.py
imports: import numpy
  from numpy.testing import assert_array_equal, assert_equal
  from scipy.optimize._constraints import NonlinearConstraint, Bounds, PreparedConstraint
  from scipy.optimize._trustregion_constr.canonical_constraint import CanonicalConstraint, initial_constraints_as_canonical
label_desc: Use image node_id 1 for calling a global function with example usage: create_quadratic_function(n, m, rng) and returns: fun,  jac,  hess, unknown, unknown, HT