parameters: (self, basename, cwd=None, suffix=None, ext=None)
return_statement: return fname
docstring: Generate a filename based on the given parameters.
  
          The filename will take the form: cwd/basename<suffix><ext>.
  
          Parameters
          ----------
          basename : str
              Filename to base the new filename on.
          cwd : str
              Path to prefix to the new filename. (default is os.getcwd())
          suffix : str
              Suffix to add to the `basename`.  (defaults is '' )
          ext : str
              Extension to add after dot.  (defaults is '' )
  
          Returns
          -------
          fname : str
              New filename based on given parameters.
docstring_summary: Generate a filename based on the given parameters.
docstring_tokens: Generate a filename based on the given parameters .
function: def _gen_fname(self, basename, cwd=None, suffix=None, ext=None):
          """Generate a filename based on the given parameters.
  
          The filename will take the form: cwd/basename<suffix><ext>.
  
          Parameters
          ----------
          basename : str
              Filename to base the new filename on.
          cwd : str
              Path to prefix to the new filename. (default is os.getcwd())
          suffix : str
              Suffix to add to the `basename`.  (defaults is '' )
          ext : str
              Extension to add after dot.  (defaults is '' )
  
          Returns
          -------
          fname : str
              New filename based on given parameters.
  
          """
  
          if basename == '':
              msg = 'Unable to generate filename for command %s. ' % self.cmd
              msg += 'basename is not set!'
              raise ValueError(msg)
          if cwd is None:
              cwd = os.getcwd()
          if suffix is None:
              suffix = ''
          if ext is None:
              if '.nii.gz' in basename:
                  ext = '.nii.gz'
              elif '.nii' in basename:
                  ext = '.nii'
              else:
                  ext = '.nii'
  
          suffix = ''.join((suffix, ext))
  
          fname = fname_presuffix(basename, suffix=suffix,
                                  use_ext=False, newpath=cwd)
          return fname
function_tokens: def _gen_fname ( self , basename , cwd = None , suffix = None , ext = None ) : if basename == '' : msg = 'Unable to generate filename for command %s. ' % self . cmd msg += 'basename is not set!' raise ValueError ( msg ) if cwd is None : cwd = os . getcwd ( ) if suffix is None : suffix = '' if ext is None : if '.nii.gz' in basename : ext = '.nii.gz' elif '.nii' in basename : ext = '.nii' else : ext = '.nii' suffix = '' . join ( ( suffix , ext ) ) fname = fname_presuffix ( basename , suffix = suffix , use_ext = False , newpath = cwd ) return fname