<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_meta(mcs, bases, attr):
 """ Get all of the ``Meta`` classes from bases and combine them with this class. Pops or creates ``Meta`` from attributes, combines all bases, adds ``_meta`` to attributes with all meta :param bases: bases of this class :param attr: class attributes :return: attributes with ``Meta`` class from combined parents """

        # pop the meta class from the attributes
        meta = attr.pop(mcs._meta_cls, types.ClassType(mcs._meta_cls, (), {}))
        # get a list of the meta public class attributes
        meta_attrs = get_public_attributes(meta)
        # check all bases for meta
        for base in bases:
            base_meta = getattr(base, mcs._meta_cls, None)
            # skip if base has no meta
            if base_meta is None:
                continue
            # loop over base meta
            for a in get_public_attributes(base_meta, as_list=False):
                # skip if already in meta
                if a in meta_attrs:
                    continue
                # copy meta-option attribute from base
                setattr(meta, a, getattr(base_meta, a))
        attr[mcs._meta_attr] = meta  # set _meta combined from bases
        return attr