class_docstr: Base class for `quadratic_assignment` tests.
class_docstr_tok: ["Base","class","for","`","quadratic_assignment","`","tests","."]
code: def test_accuracy_1(self):
      # besides testing accuracy, check that A and B can be lists
      A = [[0, 3, 4, 2], [0, 0, 1, 2], [1, 0, 0, 1], [0, 0, 1, 0]]
  
      B = [[0, 4, 2, 4], [0, 0, 1, 0], [0, 2, 0, 2], [0, 1, 2, 0]]
  
      res = quadratic_assignment(
          A,
          B,
          method=self.method,
          options={"rng": 0, "maximize": False},
      )
      assert_equal(res.fun, 10)
      assert_equal(res.col_ind, np.array([1, 2, 3, 0]))
  
      res = quadratic_assignment(
          A, B, method=self.method, options={"rng": 0, "maximize": True}
      )
  
      if self.method == "faq":
          # Global optimum is 40, but FAQ gets 37
          assert_equal(res.fun, 37)
          assert_equal(res.col_ind, np.array([0, 2, 3, 1]))
      else:
          assert_equal(res.fun, 40)
          assert_equal(res.col_ind, np.array([0, 3, 1, 2]))
  
      res = quadratic_assignment(
          A, B, method=self.method, options={"rng": 0, "maximize": True}
      )
  
imports: import pytest
  import numpy
  from scipy.optimize import quadratic_assignment, OptimizeWarning
  from scipy.optimize._qap import _calc_score
  from numpy.testing import assert_equal, assert_, assert_warns
label_desc: Use image node_id 2 for calling the QAPCommonTests obj's underlying member method code with example usage: obj.test_accuracy_1() without return types