code: def test_find_labels(self):
      if is_torch_available():
          from transformers import (
              BertForPreTraining,
              BertForQuestionAnswering,
              BertForSequenceClassification,
          )
  
          self.assertEqual(
              find_labels(BertForSequenceClassification), ["labels"]
          )
          self.assertEqual(
              find_labels(BertForPreTraining),
              ["labels", "next_sentence_label"],
          )
          self.assertEqual(
              find_labels(BertForQuestionAnswering),
              ["start_positions", "end_positions"],
          )
  
      if is_tf_available():
          from transformers import (
              TFBertForPreTraining,
              TFBertForQuestionAnswering,
              TFBertForSequenceClassification,
          )
  
          self.assertEqual(
              find_labels(TFBertForSequenceClassification), ["labels"]
          )
          self.assertEqual(
              find_labels(TFBertForPreTraining),
              ["labels", "next_sentence_label"],
          )
          self.assertEqual(
              find_labels(TFBertForQuestionAnswering),
              ["start_positions", "end_positions"],
          )
  
      if is_flax_available():
          # Flax models don't have labels
          from transformers import (
              FlaxBertForPreTraining,
              FlaxBertForQuestionAnswering,
              FlaxBertForSequenceClassification,
          )
  
          self.assertEqual(
              find_labels(FlaxBertForSequenceClassification), []
          )
          self.assertEqual(find_labels(FlaxBertForPreTraining), [])
          self.assertEqual(
              find_labels(FlaxBertForQuestionAnswering), []
          )
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/tests/utils/test_file_utils.py
imports: import contextlib
  import importlib
  import io
  import unittest
  import transformers
  from transformers import *
  from transformers.testing_utils import DUMMY_UNKNOWN_IDENTIFIER
  from transformers.utils import ContextManagers, find_labels, is_flax_available, is_tf_available, is_torch_available
label_desc: Use image node_id 4 for calling the GenericUtilTests obj's underlying member method code with example usage: obj.test_find_labels() without return types