Returns the type for creating enum members, and the first inherited
        enum class.

        bases: the tuple of bases that was given to __new__
543293
def _get_mixins_(bases):
        
        if not bases or Enum is None:
            return object, Enum


        # double check that we are not subclassing a class with existing
        # enumeration members; while we're at it, see if any other data
        # type has been mixed in so we can use the correct __new__
        member_type = first_enum = None
        for base in bases:
            if  (base is not Enum and
                    issubclass(base, Enum) and
                    base._member_names_):
                raise TypeError("Cannot extend enumerations")
        # base is now the last base in bases
        if not issubclass(base, Enum):
            raise TypeError("new enumerations must be created as "
                    "`ClassName([mixin_type,] enum_type)`")

        # get correct mix-in type (either mix-in type of Enum subclass, or
        # first base if last base is Enum)
        if not issubclass(bases[0], Enum):
            member_type = bases[0]     # first data type
            first_enum = bases[-1]  # enum type
        else:
            for base in bases[0].__mro__:
                # most common: (IntEnum, int, Enum, object)
                # possible:    (<Enum 'AutoIntEnum'>, <Enum 'IntEnum'>,
                #               <class 'int'>, <Enum 'Enum'>,
                #               <class 'object'>)
                if issubclass(base, Enum):
                    if first_enum is None:
                        first_enum = base
                else:
                    if member_type is None:
                        member_type = base

        return member_type, first_enum
792074
def _get_kind(cls):
    
    bases = cls._get_hierarchy()
    if not bases:
      # We have to jump through some hoops to call the superclass'
      # _get_kind() method.  First, this is called by the metaclass
      # before the PolyModel name is defined, so it can't use
      # super(PolyModel, cls)._get_kind().  Second, we can't just call
      # Model._get_kind() because that always returns 'Model'.  Hence
      # the 'im_func' hack.
      return model.Model._get_kind.im_func(cls)
    else:
      return bases[0]._class_name()
1127947
def all_subclasses(cls: type) -> Tuple[type, ...]:
    
    subclasses = []
    for subclass in cls.__subclasses__():
        subclasses.append(subclass)
        subclasses.extend(all_subclasses(subclass))
    return tuple(subclasses)
698736
def _find_base_type(data_type):
    
    bases = type(data_type).__mro__
    for base in bases:
        if base in _ALL:
            return base

    return None
353384
def type_bases(obj, depth=4):
    
    bases = collections.deque([list(obj.__class__.__bases__)])
    for i in range(depth):
        bases.append([i.__base__ for i in bases[-1] if i is not None])
    try:
        bases = np.hstack(bases)
    except IndexError:
        bases = []
    # we do the hasattr as None/NoneType can be in the list of bases
    bases = [i for i in bases if hasattr(i, '__name__')]
    return np.array(bases)
1184780
def _check_base_classes(base_classes, check_for_type):
    
    return_value = False
    for base in base_classes:
        if base.__name__ == check_for_type:
            return_value = True
            break
        else:
            return_value = _check_base_classes(base.__bases__, check_for_type)
            if return_value is True:
                break

    return return_value
412663
def getbase(base=None, dims=None, extent=None, background=None):
    
    if dims is not None:
        extent = dims
    if base is None and background is None:
        return ones(tuple(extent) + (3,))
    elif base is None and background is not None:
        base = zeros(tuple(extent) + (3,))
        for channel in range(3):
            base[:, :, channel] = background[channel]
        return base
    elif base is not None and base.ndim < 3:
        return tile(expand_dims(base, 2),[1, 1, 3])
    else:
        return base
695866
public static Collection<ModelElementType> calculateAllBaseTypes(ModelElementType type) {
    List<ModelElementType> baseTypes = new ArrayList<ModelElementType>();
    ModelElementTypeImpl typeImpl = (ModelElementTypeImpl) type;
    typeImpl.resolveBaseTypes(baseTypes);
    return baseTypes;
  }
275292
def metaclasses(bases):
    ''' 
    '''
    ret = []
    metas = [type(base) for base in bases]
    for k,meta in enumerate(metas):
        if not any(issubclass(m, meta) for m in metas[k+1:]):
            ret.append(meta)

    if type in ret:
        ret.remove(type)
    return ret
167637
def superclasses(access_type = nil)
      QueryResult.new(
        [
          NodeCache.find_children_of_type(self, "Base").select do |base|
            access_type.nil? ? true : base.send("#{access_type}?")
          end
        ].flatten.map {|base| base.cpp_type }
      )
    end
184796
def get_member_types(obj, member_name, prop_getter = False):
    
    cls = obj.__class__
    member = getattr(cls, member_name)
    slf = not (isinstance(member, staticmethod) or isinstance(member, classmethod))
    clsm = isinstance(member, classmethod)
    return _get_types(member, clsm, slf, cls, prop_getter)
1181265
def enum(**enums):
    
    enums['reverse'] = dict((value, key) for key, value in six.iteritems(enums))
    return type('Enum', (), enums)
180335
def unmodified_isinstance(*bases):
    
    class UnmodifiedIsInstance(type):
        if sys.version_info[0] == 2 and sys.version_info[1] <= 6:

            @classmethod
            def __instancecheck__(cls, instance):
                if cls.__name__ in (str(base.__name__) for base in bases):
                    return isinstance(instance, bases)

                subclass = getattr(instance, '__class__', None)
                subtype = type(instance)
                instance_type = getattr(abc, '_InstanceType', None)
                if not instance_type:
                    class test_object:
                        pass
                    instance_type = type(test_object)
                if subtype is instance_type:
                    subtype = subclass
                if subtype is subclass or subclass is None:
                    return cls.__subclasscheck__(subtype)
                return (cls.__subclasscheck__(subclass) or cls.__subclasscheck__(subtype))
        else:
            @classmethod
            def __instancecheck__(cls, instance):
                if cls.__name__ in (str(base.__name__) for base in bases):
                    return isinstance(instance, bases)

                return type.__instancecheck__(cls, instance)

    return with_metaclass(UnmodifiedIsInstance, *bases)
230638
def gt_bases(self):
        
        result = []
        for a in self.gt_alleles:
            if a is None:
                result.append(None)
            elif a == 0:
                result.append(self.site.REF)
            else:
                result.append(self.site.ALT[a - 1].value)
        return tuple(result)
319500
def all_bases (type):
    
    assert isinstance(type, basestring)
    result = []
    while type:
        result.append (type)
        type = __types [type]['base']

    return result
1272505
def types(cls, **kwargs):
    """"""
    named = {name: factory(Arguments._fields.index(name), name)
             for name, factory in six.iteritems(kwargs)}
    return cls(**named)
843900
def build_from_bases(bases, classdict, attr, attr_dict):
    """"""
    output = OrderedDict()
    output_keys = set()
    all_bases = []
    # Go through the bases from furthest to nearest ancestor
    for base in reversed(bases):
        # Only keep the items that are still defined on the bases
        if base is not object and isinstance(base, PropertyMetaclass):
            output_keys = output_keys.union(getattr(base, attr))
        # Collect all bases so we ensure overridden items are assigned
        # in the correct order
        for item in reversed(base.__mro__):
            if item is object or not isinstance(item, PropertyMetaclass):
                continue
            if item not in all_bases:
                all_bases.append(item)
    # Update the items in reverse MRO order; only keep those that are
    # defined on the bases
    for base in all_bases:
        for key, val in iteritems(getattr(base, attr)):
            if key in base.__dict__ and key in output_keys:
                output.update({key: val})
    # Remove all items that were overridden by this class; this is
    # potentially a superset of the items added back in the next step.
    for key in classdict:
        if key in output:
            output.pop(key)
    # Update the items with those defined on this class
    output.update(attr_dict)
    return output