def _is_path_in_directories(filename, directories):
 fixed_path = os.path.normcase(os.path.abspath(filename))
 for parent in directories:
  fixed_parent = os.path.normcase(os.path.abspath(parent))
  if (os.path.commonprefix([fixed_path, fixed_parent]) == fixed_parent):
   return True
 return False

def _is_path_in_directories ( filename , directories ) : fixed_path = os . path . normcase ( os . path . abspath ( filename ) ) for parent in directories : fixed_parent = os . path . normcase ( os . path . abspath ( parent ) ) if ( os . path . commonprefix ( [ fixed_path , fixed_parent ] ) == fixed_parent ) : return True return False
determines if a filename is contained within one of a set of directories .