def METHOD_NAME(*,
                           project_collection: ProjectCollection,
                           project_name: str,
                           raise_error: bool = False) -> Project:
    """
    Tries to find a project by name (returns first hit).
    If not found, creates a new project with the given name
    """
    if project_collection.team_id is None:
        warnings.warn("This method should be called through a team, which can be retrieved by "
                      "find_or_create_team.",
                      DeprecationWarning)
    if raise_error:
        project = get_by_name_or_raise_error(collection=project_collection, name=project_name)
    else:
        project = get_by_name_or_create(
            collection=project_collection,
            name=project_name,
            default_provider=lambda: project_collection.register(project_name)
        )
    return project