Tries to find a suitable L{pyamf.ClassAlias} subclass for C{klass}.

def get_class_alias(klass):
    """
    Tries to find a suitable L{pyamf.ClassAlias} subclass for C{klass}.
    """
    for k, v in pyamf.ALIAS_TYPES.iteritems():
        for kl in v:
            try:
                if issubclass(klass, kl):
                    return k
            except TypeError:
                # not a class
                if hasattr(kl, '__call__'):
                    if kl(klass) is True:
                        return k