code: def from_file(self, fname, comment_lead=['c'], compressed_with='use_ext'):
          
  
          with FileObject(fname, mode='r', compression=compressed_with) as fobj:
              self.from_fp(fobj.fp, comment_lead)
docs: Read a CNF formula from a file in the DIMACS format. A file name is
              expected as an argument. A default argument is ``comment_lead`` for
              parsing comment lines. A given file can be compressed by either
              gzip, bzip2, or lzma.
  
              :param fname: name of a file to parse.
              :param comment_lead: a list of characters leading comment lines
              :param compressed_with: file compression algorithm
  
              :type fname: str
              :type comment_lead: list(str)
              :type compressed_with: str
  
              Note that the ``compressed_with`` parameter can be ``None`` (i.e.
              the file is uncompressed), ``'gzip'``, ``'bzip2'``, ``'lzma'``, or
              ``'use_ext'``. The latter value indicates that compression type
              should be automatically determined based on the file extension.
              Using ``'lzma'`` in Python 2 requires the ``backports.lzma``
              package to be additionally installed.
  
              Usage example:
  
              .. code-block:: python
  
                  >>> from pysat.formula import CNF
                  >>> cnf1 = CNF()
                  >>> cnf1.from_file('some-file.cnf.gz', compressed_with='gzip')
                  >>>
                  >>> cnf2 = CNF(from_file='another-file.cnf')