human
Complete this python program:
def is_replication_enabled(host=None, core_name=None):
assistant
#Here is the Python program you requested.

    """SLAVE CALL
    Check for errors, and determine if a slave is replicating or not.
    host : str (None)
    The solr host to query. __opts__[\host\] is default.
    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.is_replication_enabled music
    """
    ret = _get_return_dict()
    success = True
    if (_is_master() and (host is None)):
        errors = ['Only    "slave"    minions    can    run    "is_replication_enabled"']
        return ret.update({'success': False, 'errors': errors})
    def _checks(ret, success, resp, core):
        if response['success']:
            slave = resp['data']['details']['slave']
            enabled = 'false'
            master_url = slave['masterUrl']
            if ('ERROR' in slave):
                success = False
                err = '{0}:    {1}    -    {2}'.format(core, slave['ERROR'], master_url)
                resp['errors'].append(err)
                data = (slave if (core is None) else {core: {'data': slave}})
            else:
                enabled = slave['masterDetails']['master']['replicationEnabled']
            if (enabled == 'false'):
                resp['warnings'].append('Replication    is    disabled    on    master.')
                success = False
            if (slave['isPollingDisabled'] == 'true'):
                success = False
                resp['warning'].append('Polling    is    disabled')
            ret = _update_return_dict(ret, success, data, resp['errors'], resp['warnings'])
        return (ret, success)
    if ((_get_none_or_value(core_name) is None) and _check_for_cores()):
        for name in __opts__['solr.cores']:
            response = _replication_request('details', host=host, core_name=name)
            (ret, success) = _checks(ret, success, response, name)
    else:
        response = _replication_request('details', host=host, core_name=core_name)
        (ret, success) = _checks(ret, success, response, core_name)
    return ret