code: def _path_with_dir_fd(self, path, fct, dir_fd):
          
          if dir_fd is not None:
              if sys.version_info < (3, 3):
                  raise TypeError("%s() got an unexpected keyword "
                                  "argument 'dir_fd'" % fct.__name__)
              # check if fd is supported for the built-in real function
              real_fct = getattr(os, fct.__name__)
              if real_fct not in self.supports_dir_fd:
                  raise NotImplementedError(
                      'dir_fd unavailable on this platform')
              if isinstance(path, int):
                  raise ValueError("%s: Can't specify dir_fd without "
                                   "matching path" % fct.__name__)
              if not self.path.isabs(path):
                  return self.path.join(
                      self.filesystem.get_open_file(
                          dir_fd).get_object().path, path)
          return path
docs: Return the path considering dir_fd. Raise on nmvalid parameters.