code: def _calc_score(A, B, perm):
      # equivalent to objective function but avoids matmul
      return np.sum(A * B[perm][:, perm])
  
file_path: catboost/contrib/python/scipy/py3/scipy/optimize/_qap.py
imports: import numpy
  import operator
  from .None import linear_sum_assignment, OptimizeResult
  from .optimize import _check_unknown_options
  from scipy._lib._util import check_random_state
  import itertools
label_desc: Use image node_id 2 for calling a global function with example usage: _calc_score(A, B, perm) and returns: np