def validate_no_marriage_to_siblings(gedcom):
    """
        US18: No marriage to siblings
    """
    errors = []

    def get_families_with_spouse(spouse_id):
        result = []
        for family in gedcom.families: 
            if family.husband_id == spouse_id:
                result.append(family)
            elif family.wife_id == spouse_id:
                result.append(family)
        return result

    for family in gedcom.families:
        # Check whether child is married to their parent
        if not family.children or len(family.children) == 0:
            pass

        for child_id in family.children:
            siblings = list(filter(lambda x: x is not child_id, family.children))

            # Check this child's fmailies to see if their spouses are siblings
            childs_families = get_families_with_spouse(child_id)
            for childs_family in childs_families:
                if childs_family.husband_id in siblings:
                    errors.append(f'Error: US18: Individiual {childs_family.husband_id} is married to {child_id}, a sibling of theirs in Family {family.id}.')
                if childs_family.wife_id in siblings:
                    errors.append(f'Error: US18: Individiual {childs_family.wife_id} is married to {child_id}, a sibling of theirs in Family {family.id}.')
    return errors