def is_in(obj, iterable):
    """
    Determine if an obj instance is in a list. Needed to prevent Python from
    using __eq__ method which throws errors for ndarrays.
    """
    for element in iterable:
        if element is obj:
            return True
    return False