def typeless_equals(entity1, entity2, check_class, check_instance):
    """
    Checks if entities are equal. The check is different whether
    entities are classes or instances, which is specified in
    corresponding parameters. If neither checks are specified,
    True is returned
    """
    if check_class:
        return isinstance(entity1, entity2)
    if check_instance:
        return entity1 == entity2
    return True