code: def size(self, st_size):
          
  
          self._check_positive_int(st_size)
          current_size = self.st_size or 0
          self.filesystem.change_disk_usage(
              st_size - current_size, self.name, self.st_dev)
          if self._byte_contents:
              if st_size < current_size:
                  self._byte_contents = self._byte_contents[:st_size]
              else:
                  if IS_PY2:
                      self._byte_contents = '%s%s' % (
                          self._byte_contents, '\0' * (st_size - current_size))
                  else:
                      self._byte_contents += b'\0' * (st_size - current_size)
          self.st_size = st_size
          self.epoch += 1
docs: Resizes file content, padding with nulls if new size exceeds the
          old size.
  
          Args:
            st_size: The desired size for the file.
  
          Raises:
            IOError: if the st_size arg is not a non-negative integer
                     or if st_size exceeds the available file system space