code: def test_generate_2d_dct_basis(art_warning, image_dl_estimator):
      try:
          sub_dim = 5
          res = 224
  
          classifier, _ = image_dl_estimator(from_logits=True)
          attack = GeoDA(
              estimator=classifier,
              sub_dim=5,
              max_iter=4000,
              verbose=False,
          )
  
          dct = attack._generate_2d_dct_basis(sub_dim=sub_dim, res=res)
          assert dct.shape == (res * res, sub_dim * sub_dim)
          dct_50000 = np.array(
              [
                  [
                      0.00446429,
                      -0.0063133,
                      0.00631283,
                      -0.00631206,
                      0.00631097,
                      0.00490833,
                      -0.00694126,
                      0.00694075,
                      -0.00693989,
                      0.0069387,
                      0.00131841,
                      -0.00186447,
                      0.00186434,
                      -0.00186411,
                      0.00186379,
                      -0.00285836,
                      0.00404223,
                      -0.00404193,
                      0.00404143,
                      -0.00404074,
                      -0.00576281,
                      0.00814965,
                      -0.00814905,
                      0.00814805,
                      -0.00814664,
                  ]
              ]
          )
          np.testing.assert_almost_equal(dct[50000], dct_50000)
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/attacks/evasion/test_geometric_decision_based_attack.py
imports: import logging
  import pytest
  import numpy
  from art.attacks.evasion.geometric_decision_based_attack import GeoDA
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassifierMixin
  from tests.attacks.utils import backend_test_classifier_type_check_fail
  from tests.utils import ARTTestException
label_desc: Use image node_id 2 for calling a global function with example usage: test_generate_2d_dct_basis(art_warning, image_dl_estimator) without return types