<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_all_tags_no_auth(image_name, branch=None):
 """ Try to get the tags without any authentication, this does work only for public images. GET /v1/repositories/<namespace>/<repository_name>/tags :param image_name: The docker image name :param branch: The branch to filter by :return: A list of Version instances, latest first """

    output = []
    logging.debug('Getting %s without authentication' % image_name)

    spec = '/%s/tags' % image_name
    headers = {'Accept': 'application/json',
               'Content-Type': 'application/json'}

    try:
        # This works well for any public images:
        response = requests.get(API_URL + spec, headers=headers)
    except RequestException, re:
        raise DockerTagNamingException('HTTP request exception "%s"' % re)

    if response.status_code == 401:
        msg = ('Received unexpected status code %s from the registry'
               ' REST API, the image is private.')
        raise AuthException(msg % response.status_code)

    if response.status_code != 200:
        msg = ('Received unexpected status code %s from the registry'
               ' REST API, the image might not exist')
        raise DockerTagNamingException(msg % response.status_code)

    try:
        json_data = response.json()
    except ValueError:
        msg = 'JSON decode failed! Raw data is: "%s". Please report a bug.'
        raise DockerTagNamingException(msg % (response.content[:25]).strip())

    try:
        tag_names = [tag_info['name'] for tag_info in json_data]
    except Exception:
        msg = ('The JSON data does not contain the expected format!'
               ' Raw data is: "%s". Please report a bug.')
        raise DockerTagNamingException(msg % (response.content[:25]).strip())

    for tag_name in tag_names:

        try:
            version = version_parser(tag_name)
        except Exception, e:
            msg = 'Ignoring version tag "%s" with incorrect format: "%s"'
            logging.debug(msg % (tag_name, e))
            continue

        if branch is not None:
            if version.branch != branch:
                continue

        output.append(version)

    def sort_func(version_a, version_b):
        return cmp(version_b.version_number, version_a.version_number)

    output.sort(sort_func)

    return output