class_docstr: Class for embedding local file links in an IPython session, based on path
  
  e.g. to embed links to files that were generated in the IPython notebook
  under ``my/data``, you would do::
  
      local_files = FileLinks("my/data")
      display(local_files)
  
  or in the HTML notebook, just::
  
      FileLinks("my/data")
class_docstr_tok: ["Class","for","embedding","local","file","links","in","an","IPython","session",",","based","on","path","e.g",".","to","embed","links","to","files","that","were","generated","in","the","IPython","notebook","under","``","my\/data","``",",","you","would","do",":",":","local_files","=","FileLinks","(","``","my\/data","''",")","display","(","local_files",")","or","in","the","HTML","notebook",",","just",":",":","FileLinks","(","``","my\/data","''",")"]
code: def _format_path(self):
      result_lines = []
      if self.recursive:
          walked_dir = list(walk(self.path))
      else:
          walked_dir = [next(walk(self.path))]
      walked_dir.sort()
      for dirname, subdirs, fnames in walked_dir:
          result_lines += self.notebook_display_formatter(
              dirname, fnames, self.included_suffixes
          )
      return "\n".join(result_lines)
  
imports: from os.path import exists, isfile, splitext, abspath, join, isdir
  from os import walk, sep
  from IPython.core.display import DisplayObject
label_desc: Use image node_id 5 for calling the FileLinks obj's underlying member method code with example usage: obj._format_path() and returns: str