def search(metadata, keyword, include_readme):
    """Search for the keyword in the repo metadata.

    Args:
        metadata (dict) : The dict on which to run search.
        keyword (str) : The keyword to search for.
        include_readme (bool) : Flag variable indicating whether
        to search keyword inside the README.md or not.

    Returns:
        list : List of repo names which confirm with
        the search.
    """
    keyword = keyword.lower()
    result = list()
    for action, action_metadata in metadata.items():
        if keyword in action.lower():
            result.append(action)
        elif include_readme:
            if keyword in action_metadata['repo_readme'].lower():
                result.append(action)
    return result