def has_obj_value(data_obj, attr):
    """Return weather dict has the given key or object has the given attribute."""
    if isinstance(data_obj, dict):
        return attr in data_obj.keys()
    return hasattr(data_obj, attr)