def checkOwners(dir_name, owned_directories, error_messages):
    'Checks to make sure a given directory is present either in CODEOWNERS or OWNED_EXTENSIONS\n\n  Args:\n    dir_name: the directory being checked.\n    owned_directories: directories currently listed in CODEOWNERS.\n    error_messages: where to put an error message for new unowned directories.\n  '
    found = False
    for owned in owned_directories:
        if (owned.startswith(dir_name) or dir_name.startswith(owned)):
            found = True
    if ((not found) and (dir_name not in UNOWNED_EXTENSIONS)):
        error_messages.append(('New directory %s appears to not have owners in CODEOWNERS' % dir_name))
Checks to make sure a given directory is present either in CODEOWNERS or OWNED_EXTENSIONS

Args:
  dir_name: the directory being checked.
  owned_directories: directories currently listed in CODEOWNERS.
  error_messages: where to put an error message for new unowned directories.
def checkOwners(dir_name, owned_directories, error_messages):
    'Checks to make sure a given directory is present either in CODEOWNERS or OWNED_EXTENSIONS\n\n  Args:\n    dir_name: the directory being checked.\n    owned_directories: directories currently listed in CODEOWNERS.\n    error_messages: where to put an error message for new unowned directories.\n  '
    found = False
    for owned in owned_directories:
        if (owned.startswith(dir_name) or dir_name.startswith(owned)):
            found = True
    if ((not found) and (dir_name not in UNOWNED_EXTENSIONS)):
        error_messages.append(('New directory %s appears to not have owners in CODEOWNERS' % dir_name))