class_docstr: Override how headers are copied.
  
  The install_headers that comes with setuptools copies all files to
  the same directory. But we need the files to be in a specific directory
  hierarchy for -I <include_dir> to work correctly.
class_docstr_tok: ["Override","how","headers","are","copied",".","The","install_headers","that","comes","with","setuptools","copies","all","files","to","the","same","directory",".","But","we","need","the","files","to","be","in","a","specific","directory","hierarchy","for","-I","<","include_dir",">","to","work","correctly","."]
code: def mkdir_and_copy_file(self, header):
      install_dir = os.path.join(
          self.install_dir, os.path.dirname(header)
      )
      # Get rid of some extra intervening directories so we can have fewer
      # directories for -I
      install_dir = re.sub(
          "/google/protobuf_archive/src", "", install_dir
      )
  
      # Copy external code headers into tensorflow/include.
      # A symlink would do, but the wheel file that gets created ignores
      # symlink within the directory hierarchy.
      # NOTE(keveman): Figure out how to customize bdist_wheel package so
      # we can do the symlink.
      # pylint: disable=line-too-long
      external_header_locations = {
          "/tensorflow/include/external/com_google_absl": "",
          "/tensorflow/include/external/ducc": "/ducc",
          "/tensorflow/include/external/eigen_archive": "",
          "/tensorflow/include/external/ml_dtypes": "/ml_dtypes",
          "/tensorflow/include/tensorflow/compiler/xla": (
              "/tensorflow/include/xla"
          ),
          "/tensorflow/include/tensorflow/tsl": "/tensorflow/include/tsl",
      }
      # pylint: enable=line-too-long
  
      for location in external_header_locations:
          if location in install_dir:
              extra_dir = install_dir.replace(
                  location, external_header_locations[location]
              )
              if not os.path.exists(extra_dir):
                  self.mkpath(extra_dir)
              self.copy_file(header, extra_dir)
  
      if not os.path.exists(install_dir):
          self.mkpath(install_dir)
      return self.copy_file(header, install_dir)
  
imports: import datetime
  import fnmatch
  import os
  import platform
  import re
  import sys
  from setuptools import Command
  from setuptools import find_namespace_packages
  from setuptools import setup
  from setuptools.command.install import install
  from setuptools.dist import Distribution
label_desc: Use image node_id 3 for calling the InstallHeaders obj's underlying member method code with example usage: obj.mkdir_and_copy_file(header) and returns: self