code: def _generate_output_dir(settings, path):
          
  
          relpath = os.path.relpath(settings.root,path)
          count = relpath.count(os.sep) + 1
  
          return relpath+os.path.sep, count
docs: This is a separate function, so that it can be more easily tested