code: def _is_iterator(obj, obj_name):
      """Checks whether obj is a generator."""
      if obj is not None and not isinstance(obj, Iterator):
          raise ValueError("%s should be a generator." % obj_name)
  
imports: import dataclasses
  from typing import Iterator, List, Optional, Tuple
  import numpy
  from scipy import stats
  import tensorflow
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack import membership_inference_attack
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import AttackInputData
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import AttackResults
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import AttackType
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import PrivacyReportMetadata
label_desc: Use image node_id 1 for calling a global function with example usage: _is_iterator(obj, obj_name) without return types