def get_cleaned_attrs_from_object(
    object_in, ignore_callable=True, ignore_types=None, ignore_prefixes="__"
):
    """
    Return all the attributes of an object that pass criteria
    :param object_in: Any python object
    the attributes with the "sub_object" they belong to. Default: False
    :param ignore_callable: Don't return attributes than can be called.
    Default: True
    :param ignore_types: Don't return attributes of this type
    (or tuple of types). Default: None.
    :param ignore_prefixes: Don't return attributes starting with prefixes
     (as strings) in this list. Default: "__"
    :return: list of attributes meeting criteria
    """

    attributes = [attr for attr in dir(object_in)]

    if ignore_callable:
        attributes = [
            attr
            for attr in attributes
            if not callable(getattr(object_in, attr))
        ]

    if ignore_types is not None:
        attributes = [
            attr
            for attr in attributes
            if not isinstance(getattr(object_in, attr), ignore_types)
        ]

    if ignore_prefixes is not None:
        for prefix in ignore_prefixes:
            attributes = [
                attr for attr in attributes if not attr.startswith(prefix)
            ]

    return attributes