def IsPathInSubdirectories(filename,
                           subdirectories,
                           normcase=os.path.normcase):
  file_dir = normcase(os.path.dirname(os.path.abspath(filename)))
  for parent in subdirectories:
    fixed_parent = normcase(os.path.abspath(parent))
    if os.path.commonprefix([file_dir, fixed_parent]) == fixed_parent:
      return True
  return False
Determines if a filename is contained within one of a set of directories.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/dev_appserver_import_hook.py/IsPathInSubdirectories