def tagged_members(obj, meta=None, meta_value=None):
    """ Utility function to retrieve tagged members from an object

    Parameters
    ----------
    obj : Atom
        Object from which the tagged members should be retrieved.

    meta : str, optional
        The tag to look for, only member which has this tag will be returned

    meta_value : optional
        The value of the metadata used for filtering the members returned

    Returns
    -------
    tagged_members : dict(str, Member)
        Dictionary of the members whose metadatas corresponds to the predicate

    """
    members = obj.members()
    if meta is None and meta_value is None:
        return members
    elif meta_value is None:
        return {key: member for key, member in members.items()
                if member.metadata is not None and meta in member.metadata}
    else:
        return {key: member for key, member in members.items()
                if member.metadata is not None and
                meta in member.metadata and
                member.metadata[meta] == meta_value}