Looks through siblings for content that might also be related.
    Things like preambles, content split by ads that we removed, etc.

def check_siblings(candidate_node, candidate_list):
    """
    Looks through siblings for content that might also be related.
    Things like preambles, content split by ads that we removed, etc.
    """
    candidate_css = candidate_node.node.get("class")
    potential_target = candidate_node.content_score * 0.2
    sibling_target_score = potential_target if potential_target > 10 else 10
    parent = candidate_node.node.getparent()
    siblings = parent.getchildren() if parent is not None else []

    for sibling in siblings:
        append = False
        content_bonus = 0

        if sibling is candidate_node.node:
            append = True

        # Give a bonus if sibling nodes and top candidates have the example
        # same class name
        if candidate_css and sibling.get("class") == candidate_css:
            content_bonus += candidate_node.content_score * 0.2

        if sibling in candidate_list:
            adjusted_score = \
                candidate_list[sibling].content_score + content_bonus

            if adjusted_score >= sibling_target_score:
                append = True

        if sibling.tag == "p":
            link_density = get_link_density(sibling)
            content = sibling.text_content()
            content_length = len(content)

            if content_length > 80 and link_density < 0.25:
                append = True
            elif content_length < 80 and link_density == 0:
                if ". " in content:
                    append = True

        if append:
            logger.debug(
                "Sibling appended: %s %r", sibling.tag, sibling.attrib)
            if sibling.tag not in ("div", "p"):
                # We have a node that isn't a common block level element, like
                # a form or td tag. Turn it into a div so it doesn't get
                # filtered out later by accident.
                sibling.tag = "div"

            if candidate_node.node != sibling:
                candidate_node.node.append(sibling)

    return candidate_node