def jaccard_similarity(set_a, set_b, alternative_union=False):

    if isinstance(set_a, set) and isinstance(set_b, set):
        intersection = len(set_a.intersection(set_b))

        if alternative_union:
            union = len(set_a) + len(set_b)
        else:
            union = len(set_a.union(set_b))

        return intersection / union

    if isinstance(set_a, (list, tuple)) and isinstance(set_b, (list, tuple)):
        intersection = [element for element in set_a if element in set_b]

        if alternative_union:
            union = len(set_a) + len(set_b)
            return len(intersection) / union
        else:
            union = set_a + [element for element in set_b if element not in set_a]
            return len(intersection) / len(union)

        return len(intersection) / len(union)
    return None