code: def create_and_check_xlnet_lm_head(
      self,
      config,
      input_ids_1,
      input_ids_2,
      input_ids_q,
      perm_mask,
      input_mask,
      target_mapping,
      segment_ids,
      lm_labels,
      sequence_labels,
      is_impossible_labels,
  ):
      model = TFXLNetLMHeadModel(config)
  
      inputs_1 = {
          "input_ids": input_ids_1,
          "token_type_ids": segment_ids,
      }
      all_logits_1, mems_1 = model(inputs_1).to_tuple()
  
      inputs_2 = {
          "input_ids": input_ids_2,
          "mems": mems_1,
          "token_type_ids": segment_ids,
      }
      all_logits_2, mems_2 = model(inputs_2).to_tuple()
  
      inputs_3 = {
          "input_ids": input_ids_q,
          "perm_mask": perm_mask,
          "target_mapping": target_mapping,
      }
      logits, _ = model(inputs_3).to_tuple()
  
      self.parent.assertEqual(
          all_logits_1.shape,
          (self.batch_size, self.seq_length, self.vocab_size),
      )
      self.parent.assertListEqual(
          [mem.shape for mem in mems_1],
          [(self.seq_length, self.batch_size, self.hidden_size)]
          * self.num_hidden_layers,
      )
      self.parent.assertEqual(
          all_logits_2.shape,
          (self.batch_size, self.seq_length, self.vocab_size),
      )
      self.parent.assertListEqual(
          [mem.shape for mem in mems_2],
          [(self.mem_len, self.batch_size, self.hidden_size)]
          * self.num_hidden_layers,
      )
  
imports: from __future__ import annotations
  import inspect
  import random
  import unittest
  from transformers import XLNetConfig, is_tf_available
  from transformers.testing_utils import require_tf, slow
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 5 for calling the TFXLNetModelTester obj's underlying member method code with example usage: obj.create_and_check_xlnet_lm_head(config, input_ids_1, input_ids_2, input_ids_q, perm_mask, input_mask, target_mapping, segment_ids, lm_labels, sequence_labels, is_impossible_labels) without return types