code: def chown(self, path, uid, gid, dir_fd=None, follow_symlinks=None):
          
          if follow_symlinks is None:
              follow_symlinks = True
          elif sys.version_info < (3, 3):
              raise TypeError(
                  "chown() got an unexpected keyword argument 'follow_symlinks'")
          path = self._path_with_dir_fd(path, self.chown, dir_fd)
          try:
              file_object = self.filesystem.resolve(
                  path, follow_symlinks, allow_fd=True)
          except IOError as io_error:
              if io_error.errno == errno.ENOENT:
                  self.filesystem.raise_os_error(errno.ENOENT, path)
              raise
          if not ((is_int_type(uid) or uid is None) and
                  (is_int_type(gid) or gid is None)):
              raise TypeError("An integer is required")
          if uid != -1:
              file_object.st_uid = uid
          if gid != -1:
              file_object.st_gid = gid
docs: Set ownership of a faked file.
  
          Args:
              path: (str) Path to the file or directory.
              uid: (int) Numeric uid to set the file or directory to.
              gid: (int) Numeric gid to set the file or directory to.
              dir_fd: (int) If not `None`, the file descriptor of a directory,
                  with `path` being relative to this directory.
                  New in Python 3.3.
              follow_symlinks: (bool) If `False` and path points to a symlink,
                  the link itself is changed instead of the linked object.
                  New in Python 3.3.
  
          Raises:
              OSError: if path does not exist.
  
          `None` is also allowed for `uid` and `gid`.  This permits `os.rename`
          to use `os.chown` even when the source file `uid` and `gid` are
          `None` (unset).