parameters: (base_dir, files, mode=0777, verbose=1, dry_run=0)
docstring: Create all the empty directories under 'base_dir' needed to put 'files'
      there.
  
      'base_dir' is just the a name of a directory which doesn't necessarily
      exist yet; 'files' is a list of filenames to be interpreted relative to
      'base_dir'.  'base_dir' + the directory portion of every file in 'files'
      will be created if it doesn't already exist.  'mode', 'verbose' and
      'dry_run' flags are as for 'mkpath()'.
docstring_summary: Create all the empty directories under 'base_dir' needed to put 'files'
      there.
docstring_tokens: Create all the empty directories under base_dir needed to put files there .
function: def create_tree(base_dir, files, mode=0777, verbose=1, dry_run=0):
      """Create all the empty directories under 'base_dir' needed to put 'files'
      there.
  
      'base_dir' is just the a name of a directory which doesn't necessarily
      exist yet; 'files' is a list of filenames to be interpreted relative to
      'base_dir'.  'base_dir' + the directory portion of every file in 'files'
      will be created if it doesn't already exist.  'mode', 'verbose' and
      'dry_run' flags are as for 'mkpath()'.
      """
      # First get the list of directories to create
      need_dir = {}
      for file in files:
          need_dir[os.path.join(base_dir, os.path.dirname(file))] = 1
      need_dirs = need_dir.keys()
      need_dirs.sort()
  
      # Now create them
      for dir in need_dirs:
          mkpath(dir, mode, verbose=verbose, dry_run=dry_run)
function_tokens: def create_tree ( base_dir , files , mode = 0777 , verbose = 1 , dry_run = 0 ) : # First get the list of directories to create need_dir = { } for file in files : need_dir [ os . path . join ( base_dir , os . path . dirname ( file ) ) ] = 1 need_dirs = need_dir . keys ( ) need_dirs . sort ( ) # Now create them for dir in need_dirs : mkpath ( dir , mode , verbose = verbose , dry_run = dry_run )