def METHOD_NAME(self, entity: Entity) -> bool:
    """Return whether the merge request should be counted."""
    request_matches_state = entity["state"] in self._parameter("merge_request_state")
    branches = self._parameter("target_branches_to_include")
    target_branch = entity["target_branch"]
    request_matches_branches = match_string_or_regular_expression(target_branch, branches) if branches else True
    # If the required number of upvotes is zero, merge requests are included regardless of how many upvotes they
    # actually have. If the required number of upvotes is more than zero then only merge requests that have fewer
    # than the minimum number of upvotes are included in the count:
    required_upvotes = int(cast(str, self._parameter("upvotes")))
    request_has_fewer_than_min_upvotes = required_upvotes == 0 or int(entity["upvotes"]) < required_upvotes
    return request_matches_state and request_matches_branches and request_has_fewer_than_min_upvotes