def _is_valid_sub_path(path, parent_paths):
 if (not parent_paths):
  return True
 for parent_path in parent_paths:
  if (path[:len(parent_path)] == parent_path):
   return True
 return False

def _is_valid_sub_path ( path , parent_paths ) : if ( not parent_paths ) : return True for parent_path in parent_paths : if ( path [ : len ( parent_path ) ] == parent_path ) : return True return False
check if a sub path is valid given an iterable of parent paths .