parameters: (self,
                                 dirname_output_format,
                                 fname_output_format,
                                 fp_format,
                                 fp_cleaner=None)
return_statement: return f
docstring: generate built-in formatter function
  
             this is used to define both the notebook and terminal built-in
              formatters as they only differ by some wrapper text for each entry
  
             dirname_output_format: string to use for formatting directory
              names, dirname will be substituted for a single "%s" which
              must appear in this string
             fname_output_format: string to use for formatting file names,
              if a single "%s" appears in the string, fname will be substituted
              if two "%s" appear in the string, the path to fname will be
               substituted for the first and fname will be substituted for the
               second
             fp_format: string to use for formatting filepaths, must contain
              exactly two "%s" and the dirname will be substituted for the first
              and fname will be substituted for the second
docstring_summary: generate built-in formatter function
docstring_tokens: generate built - in formatter function
function: def _get_display_formatter(self,
                                 dirname_output_format,
                                 fname_output_format,
                                 fp_format,
                                 fp_cleaner=None):
          """ generate built-in formatter function
  
             this is used to define both the notebook and terminal built-in
              formatters as they only differ by some wrapper text for each entry
  
             dirname_output_format: string to use for formatting directory
              names, dirname will be substituted for a single "%s" which
              must appear in this string
             fname_output_format: string to use for formatting file names,
              if a single "%s" appears in the string, fname will be substituted
              if two "%s" appear in the string, the path to fname will be
               substituted for the first and fname will be substituted for the
               second
             fp_format: string to use for formatting filepaths, must contain
              exactly two "%s" and the dirname will be substituted for the first
              and fname will be substituted for the second
          """
          def f(dirname, fnames, included_suffixes=None):
              result = []
              # begin by figuring out which filenames, if any,
              # are going to be displayed
              display_fnames = []
              for fname in fnames:
                  if (isfile(join(dirname,fname)) and
                         (included_suffixes is None or
                          splitext(fname)[1] in included_suffixes)):
                        display_fnames.append(fname)
  
              if len(display_fnames) == 0:
                  # if there are no filenames to display, don't print anything
                  # (not even the directory name)
                  pass
              else:
                  # otherwise print the formatted directory name followed by
                  # the formatted filenames
                  dirname_output_line = dirname_output_format % dirname
                  result.append(dirname_output_line)
                  for fname in display_fnames:
                      fp = fp_format % (dirname,fname)
                      if fp_cleaner is not None:
                          fp = fp_cleaner(fp)
                      try:
                          # output can include both a filepath and a filename...
                          fname_output_line = fname_output_format % (fp, fname)
                      except TypeError:
                          # ... or just a single filepath
                          fname_output_line = fname_output_format % fname
                      result.append(fname_output_line)
              return result
          return f
function_tokens: def _get_display_formatter ( self , dirname_output_format , fname_output_format , fp_format , fp_cleaner = None ) : def f ( dirname , fnames , included_suffixes = None ) : result = [ ] # begin by figuring out which filenames, if any, # are going to be displayed display_fnames = [ ] for fname in fnames : if ( isfile ( join ( dirname , fname ) ) and ( included_suffixes is None or splitext ( fname ) [ 1 ] in included_suffixes ) ) : display_fnames . append ( fname ) if len ( display_fnames ) == 0 : # if there are no filenames to display, don't print anything # (not even the directory name) pass else : # otherwise print the formatted directory name followed by # the formatted filenames dirname_output_line = dirname_output_format % dirname result . append ( dirname_output_line ) for fname in display_fnames : fp = fp_format % ( dirname , fname ) if fp_cleaner is not None : fp = fp_cleaner ( fp ) try : # output can include both a filepath and a filename... fname_output_line = fname_output_format % ( fp , fname ) except TypeError : # ... or just a single filepath fname_output_line = fname_output_format % fname result . append ( fname_output_line ) return result return f