code: def prepare_metadata_for_build_wheel(
      self, metadata_directory, config_settings=None
  ):
      sys.argv = sys.argv[:1] + [
          "dist_info",
          "--egg-base",
          _to_str(metadata_directory),
      ]
      self.run_setup()
  
      dist_info_directory = metadata_directory
      while True:
          dist_infos = [
              f
              for f in os.listdir(dist_info_directory)
              if f.endswith(".dist-info")
          ]
  
          if (
              len(dist_infos) == 0
              and len(
                  _get_immediate_subdirectories(dist_info_directory)
              )
              == 1
          ):
              dist_info_directory = os.path.join(
                  dist_info_directory,
                  os.listdir(dist_info_directory)[0],
              )
              continue
  
          assert len(dist_infos) == 1
          break
  
      # PEP 517 requires that the .dist-info directory be placed in the
      # metadata_directory. To comply, we MUST copy the directory to the root
      if dist_info_directory != metadata_directory:
          shutil.move(
              os.path.join(dist_info_directory, dist_infos[0]),
              metadata_directory,
          )
          shutil.rmtree(dist_info_directory, ignore_errors=True)
  
      return dist_infos[0]
  
imports: import io
  import os
  import sys
  import tokenize
  import shutil
  import contextlib
  import setuptools
  import distutils
  from setuptools.py31compat import TemporaryDirectory
  from pkg_resources import parse_requirements
  from pkg_resources.py31compat import makedirs
label_desc: Use image node_id 6 for calling the _BuildMetaBackend obj's underlying member method code with example usage: obj.prepare_metadata_for_build_wheel(metadata_directory, config_settings) and returns: dist_infos