# Path: openid/oidutil.py
# def string_to_text(value, deprecate_msg):
#     """
#     Return input string coverted to text string.
# 
#     If input is text, it is returned as is.
#     If input is binary, it is decoded using UTF-8 to text.
#     """
#     assert isinstance(value, (six.text_type, six.binary_type))
#     if isinstance(value, six.binary_type):
#         warnings.warn(deprecate_msg, DeprecationWarning)
#         value = value.decode('utf-8')
#     return value
# 
# Path: openid/yadis/etxrd.py
# def expandService(service_element):
#     """Take a service element and expand it into an iterator of:
#     ([type_uri], uri, service_element)
#     """
#     uris = sortedURIs(service_element)
#     if not uris:
#         uris = [None]
# 
#     expanded = []
#     for uri in uris:
#         type_uris = getTypeURIs(service_element)
#         expanded.append((type_uris, uri, service_element))
# 
#     return expanded


from openid.oidutil import string_to_text
from openid.yadis.etxrd import expandService
                # Once one of the filters has returned an
                # endpoint, do not apply any more.
                return e

        return None


class CompoundFilter(object):
    """Create a new filter that applies a set of filters to an endpoint
    and collects their results.
    """

    def __init__(self, subfilters):
        self.subfilters = subfilters

    def getServiceEndpoints(self, yadis_url, service_element):
        """Generate all endpoint objects for all of the subfilters of
        this filter and return their concatenation."""
        endpoints = []
        for subfilter in self.subfilters:
            endpoints.extend(
                subfilter.getServiceEndpoints(yadis_url, service_element))
        return endpoints


# Exception raised when something is not able to be turned into a filter
filter_type_error = TypeError(
    'Expected a filter, an endpoint, a callable or a list of any of these.')



# Path: openid/oidutil.py
# def string_to_text(value, deprecate_msg):
#     """
#     Return input string coverted to text string.
# 
#     If input is text, it is returned as is.
#     If input is binary, it is decoded using UTF-8 to text.
#     """
#     assert isinstance(value, (six.text_type, six.binary_type))
#     if isinstance(value, six.binary_type):
#         warnings.warn(deprecate_msg, DeprecationWarning)
#         value = value.decode('utf-8')
#     return value
# 
# Path: openid/yadis/etxrd.py
# def expandService(service_element):
#     """Take a service element and expand it into an iterator of:
#     ([type_uri], uri, service_element)
#     """
#     uris = sortedURIs(service_element)
#     if not uris:
#         uris = [None]
# 
#     expanded = []
#     for uri in uris:
#         type_uris = getTypeURIs(service_element)
#         expanded.append((type_uris, uri, service_element))
# 
#     return expanded


# Path: openid/yadis/filters.py
from openid.oidutil import string_to_text
from openid.yadis.etxrd import expandService

                # Once one of the filters has returned an
                # endpoint, do not apply any more.
                return e

        return None


class CompoundFilter(object):
    """Create a new filter that applies a set of filters to an endpoint
    and collects their results.
    """

    def __init__(self, subfilters):
        self.subfilters = subfilters

    def getServiceEndpoints(self, yadis_url, service_element):
        """Generate all endpoint objects for all of the subfilters of
        this filter and return their concatenation."""
        endpoints = []
        for subfilter in self.subfilters:
            endpoints.extend(
                subfilter.getServiceEndpoints(yadis_url, service_element))
        return endpoints


# Exception raised when something is not able to be turned into a filter
filter_type_error = TypeError(
    'Expected a filter, an endpoint, a callable or a list of any of these.')



def mkFilter(parts):