parameters: (self, size=None)
return_statement: return size
docstring: Truncate the file to at most size bytes.
  
          Size defaults to the current file position, as returned by tell().
          The current file position is changed to the value of size.
docstring_summary: Truncate the file to at most size bytes.
docstring_tokens: Truncate the file to at most size bytes .
function: def truncate(self, size=None):
          """Truncate the file to at most size bytes.
  
          Size defaults to the current file position, as returned by tell().
          The current file position is changed to the value of size.
          """
          self._checkClosed()
          self._checkWritable()
          if size is None:
              size = self.tell()
          os.ftruncate(self._fd, size)
          return size
function_tokens: def truncate ( self , size = None ) : self . _checkClosed ( ) self . _checkWritable ( ) if size is None : size = self . tell ( ) os . ftruncate ( self . _fd , size ) return size