def filename(self,filename=None,ext=None,set_default=False,use_my_ext=False):
if filename is None:<EOL><INDENT>if not hasattr(self,'<STR_LIT>'):<EOL><INDENT>self._filename = None        <EOL><DEDENT>if self._filename:<EOL><INDENT>filename = self._filename<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>my_ext = None<EOL><DEDENT>else:<EOL><INDENT>filename, my_ext = os.path.splitext(filename)<EOL>if set_default:                  <EOL><INDENT>self._filename = filename<EOL><DEDENT><DEDENT>if my_ext and use_my_ext:<EOL><INDENT>ext = my_ext<EOL><DEDENT>if ext is not None:<EOL><INDENT>if ext.startswith(os.extsep):<EOL><INDENT>ext = ext[<NUM_LIT:1>:]  <EOL><DEDENT>if ext != "<STR_LIT>":<EOL><INDENT>filename = filename + os.extsep + ext<EOL><DEDENT><DEDENT>return filename<EOL>
Supply a file name for the class object.

        Typical uses::

           fn = filename()             ---> <default_filename>
           fn = filename('name.ext')   ---> 'name'
           fn = filename(ext='pickle') ---> <default_filename>'.pickle'
           fn = filename('name.inp','pdf') --> 'name.pdf'
           fn = filename('foo.pdf',ext='png',use_my_ext=True) --> 'foo.pdf'

        The returned filename is stripped of the extension
        (``use_my_ext=False``) and if provided, another extension is
        appended. Chooses a default if no filename is given.

        Raises a ``ValueError`` exception if no default file name is known.

        If ``set_default=True`` then the default filename is also set.

        ``use_my_ext=True`` lets the suffix of a provided filename take
        priority over a default ``ext`` tension.

        .. versionchanged:: 0.3.1
           An empty string as *ext* = "" will suppress appending an extension.