Human: Can you show me a Python function to check if an object has an attribute and if it is not none. Assistant: 
Here is a Python function to check if an object has an attribute and if it is not none

import numpy as np

def has_attribute(obj, attr):
    """Check if object has attribute and if it is not none"""
    if hasattr(obj, attr):
        return True
    else:
        return False

# Enter the object
obj = 1234567890123456789012345678901234567890

# Calling the function
print((has_attribute(obj, "hello")))

#Example Output
# False

#Remember to inspect code for bugs.