def __object_has_attr(instance, attribute_name):
    """
    Checks if an attribute with the given name
    exists in the given instance.
    This method provides an additional layer of abstraction
    that allows it to be used in objects or in maps.

    :type instance: Object
    :param instance: The instance to be checked
    for attribute.
    :type attribute_name: String
    :param attribute_name: The name of the attribute
    to be checked in the instance.
    :rtype: bool
    :return: The result of the has attribute testing
    in the instance.
    """
    instance_type = type(instance)
    if instance_type == dict:
        return attribute_name in instance
    else:
        return hasattr(instance, attribute_name)
