import types


def has_variable(object, name):
    """Check if the given object has a variable with the given name"""
    attribute = getattr(object, name, None)
    if attribute is not None:
        if not callable(attribute):
            return True
        # if callable, it might be a callable object, a function, or method
        # A variable can be an object or a function, but not a method.
        return not isinstance(attribute, types.MethodType)  # types.FunctionType
    return False