def suppress_setattr(obj, attr, value, filter_none=False):
    """
    Set an attribute, suppressing any exceptions and skipping the attempt on failure.

    :param Any obj: Object to set the attribute on
    :param str attr: The attribute name to set
    :param Any value: The value to set the attribute to
    :param bool filter_none: [description], defaults to False
    :return: Nothing
    :rtype: None

    :Example:

    >>> class MyClass(object):
    ...     def __init__(self, name):
    ...         self.name = name
    ...         self.parent = None
    ...     def __repr__(self):
    ...         return "<{0!r} instance (name={1!r}, parent={2!r})>".format(
    ...             self.__class__.__name__, self.name, self.parent
    ...         )
    ...     def __str__(self):
    ...         return self.name
    >>> me = MyClass("Dan")
    >>> dad = MyClass("John")
    >>> grandfather = MyClass("Joe")
    >>> suppress_setattr(dad, "parent", grandfather)
    >>> dad
    <'MyClass' instance (name='John', parent=<'MyClass' instance (name='Joe', parent=None
    )>)>
    >>> suppress_setattr(me, "parent", dad)
    >>> me
    <'MyClass' instance (name='Dan', parent=<'MyClass' instance (name='John', parent=<'My
    Class' instance (name='Joe', parent=None)>)>)>
    >>> suppress_setattr(me, "grandparent", grandfather)
    >>> me
    <'MyClass' instance (name='Dan', parent=<'MyClass' instance (name='John', parent=<'My
    Class' instance (name='Joe', parent=None)>)>)>
    """
    if filter_none and value is None:
        pass
    try:
        setattr(obj, attr, value)
    except Exception:
        pass
