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

def version(core_name=None):
    '''
    Gets the solr version for the core specified.  You should specify a core
    here as all the cores will run under the same servlet container and so will
    all have the same version.

    core_name : str (None)
        The name of the solr core if using cores. Leave this blank if you are
        not using cores or if you want to check all cores.

    Return : dict<str,obj>::

        {'success':boolean, 'data':dict, 'errors':list, 'warnings':list}

    CLI Example:

    .. code-block:: bash

        salt '*' solr.version
    '''
    ret = _get_return_dict()
    # do we want to check for all the cores?
    if _get_none_or_value(core_name) is None and _check_for_cores():
        success = True
        for name in __opts__['solr.cores']:
            resp = _get_admin_info('system', core_name=name)
            if resp['success']:
                lucene = resp['data']['lucene']
                data = {name: {'version': lucene['solr-spec-version']}}
            else:
                success = False
                data = {name: {'version': None}}
            ret = _update_return_dict(ret, success, data,
                                      resp['errors'], resp['warnings'])
        return ret
    else:
        resp = _get_admin_info('system', core_name=core_name)
        if resp['success']:
            version_num = resp['data']['lucene']['solr-spec-version']
            return _get_return_dict(True, {'version': version_num},
                                    resp['errors'], resp['warnings'])
        else:
            return resp