code: def backend_check_membership_accuracy(
      attack, dataset, attack_train_ratio, approx
  ):
      (x_train, y_train), (x_test, y_test) = dataset
      attack_train_size = int(len(x_train) * attack_train_ratio)
      attack_test_size = int(len(x_test) * attack_train_ratio)
  
      # infer attacked feature on remainder of data
      kwargs = {
          "norm": 2,
          "max_iter": 2,
          "max_eval": 4,
          "init_eval": 1,
          "init_size": 1,
          "verbose": False,
      }
      inferred_train = attack.infer(
          x_train[attack_train_size:],
          y_train[attack_train_size:],
          **kwargs,
      )
      inferred_test = attack.infer(
          x_test[attack_test_size:], y_test[attack_test_size:], **kwargs
      )
  
      # check accuracy
      backend_check_accuracy(inferred_train, inferred_test, approx)
  
file_path: adversarial-robustness-toolbox/tests/attacks/inference/membership_inference/test_label_only_boundary_distance.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import pytest
  import numpy
  from art.attacks.inference.membership_inference.label_only_boundary_distance import LabelOnlyDecisionBoundary
  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 6 for calling a global function with example usage: backend_check_membership_accuracy(attack, dataset, attack_train_ratio, approx) without return types