def check_redirect_uris(uris, client_type=None):
    """
    This function checks all return uris provided and tries to deduce
    as what type of client we should register.

    :param uris: The redirect URIs to check.
    :type uris: list
    :param client_type: An indicator of which client type you are expecting
        to be used. If this does not match the deduced type, an error will
        be raised.
    :type client_type: str
    :returns: The deduced client type.
    :rtype: str
    :raises ValueError: An error occured while checking the redirect uris.

    .. versionadded:: 1.0
    """
    if client_type not in [None, 'native', 'web']:
        raise ValueError('Invalid client type indicator used')
    if not isinstance(uris, list):
        raise ValueError('uris needs to be a list of strings')
    if len(uris) < 1:
        raise ValueError('At least one return URI needs to be provided')
    for uri in uris:
        if uri.startswith('https://'):
            if client_type == 'native':
                raise ValueError('https url with native client')
            client_type = 'web'
        elif uri.startswith('http://localhost'):
            if client_type == 'web':
                raise ValueError('http://localhost url with web client')
            client_type = 'native'
        elif uri.startswith('http://') and not uri.startswith(
            'http://localhost'):
            raise ValueError('http:// url with non-localhost is illegal')
        else:
            raise ValueError('Invalid uri provided: %s' % uri)
    return client_type
