Checks the availability of domains

    domains_to_check
        array of strings  List of domains to check

    Returns a dictionary mapping the each domain name to a boolean denoting
    whether or not it is available.

    CLI Example:

    .. code-block:: bash

        salt 'my-minion' namecheap_domains.check domain-to-check

def check(*domains_to_check):
    '''
    Checks the availability of domains

    domains_to_check
        array of strings  List of domains to check

    Returns a dictionary mapping the each domain name to a boolean denoting
    whether or not it is available.

    CLI Example:

    .. code-block:: bash

        salt 'my-minion' namecheap_domains.check domain-to-check
    '''
    opts = salt.utils.namecheap.get_opts('namecheap.domains.check')
    opts['DomainList'] = ','.join(domains_to_check)

    response_xml = salt.utils.namecheap.get_request(opts)

    if response_xml is None:
        return {}

    domains_checked = {}
    for result in response_xml.getElementsByTagName("DomainCheckResult"):
        available = result.getAttribute("Available")
        domains_checked[result.getAttribute("Domain").lower()] = salt.utils.namecheap.string_to_value(available)

    return domains_checked