<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def pull(config, repo, tag=None, username=None, password=None, email=None, *args, **kwargs):
    '''
    Pulls an repo from any registry. See above documentation for
    how to configure authenticated access.

    :type repo: string
    :param repo: The repository to pull. \
        [registryurl://]REPOSITORY_NAME
        eg::

            index.docker.io:MyRepo
            superaddress.cdn:MyRepo
            MyRepo

    :type tag: string
    :param tag: The specific tag  to pull

    :rtype: dict
    :returns: the repo details
    '''
    err = "Unknown"
    client = _get_client(config)
    try:
        if username:
            url = repo.split(":")
            url = (url[0] if len(url) > 1 else None)
            if not login(config,username,password,email,url):
                raise Exception("Can't login")
        print "Pulling repository %s ... (This may take a while)"%repo
        ret = client.pull(repo, tag=tag)
        if ret:
            logs, infos = _parse_image_multilogs_string(config, ret, repo)
            if infos and infos.get('Id', None):
                repotag = repo
                if tag:
                    repotag = '{0}:{1}'.format(repo, tag)
                print 'Repo {0} was pulled ({1})'.format(repotag, infos['Id'])
                return infos, False
            else:
                err = _pull_assemble_error_status(logs)
    except Exception as e:
        err = e
    utils.error("An error has occured pulling repo %s: %s"%(repo,err))
    return None, True