code: def record_xml_attribute(request):
      """Add extra xml attributes to the tag for the calling test.
      The fixture is callable with ``(name, value)``, with value being
      automatically xml-encoded
      """
      from _pytest.warning_types import PytestExperimentalApiWarning
  
      request.node.warn(
          PytestExperimentalApiWarning(
              "record_xml_attribute is an experimental feature"
          )
      )
  
      _warn_incompatibility_with_xunit2(request, "record_xml_attribute")
  
      # Declare noop
      def add_attr_noop(name, value):
          pass
  
      attr_func = add_attr_noop
  
      xml = getattr(request.config, "_xml", None)
      if xml is not None:
          node_reporter = xml.node_reporter(request.node.nodeid)
          attr_func = node_reporter.add_attribute
  
      return attr_func
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import os
  import platform
  import re
  import sys
  import time
  from datetime import datetime
  import py
  import six
  import pytest
  from _pytest import nodes
  from _pytest.config import filename_arg
label_desc: Use image node_id 5 for calling a global function with example usage: record_xml_attribute(request) and returns: attr_func