def lookup(self, asn=None, inc_raw=False, retry_count=3, response=None,
               field_list=None, asn_alts=None, asn_methods=None):
        """
        The function for retrieving and parsing ASN origin whois information
        via port 43/tcp (WHOIS).

        Args:
            asn (:obj:`str`): The ASN (required).
            inc_raw (:obj:`bool`): Whether to include the raw results in the
                returned dictionary. Defaults to False.
            retry_count (:obj:`int`): The number of times to retry in case
                socket errors, timeouts, connection resets, etc. are
                encountered. Defaults to 3.
            response (:obj:`str`): Optional response object, this bypasses the
                Whois lookup. Defaults to None.
            field_list (:obj:`list`): If provided, fields to parse:
                ['description', 'maintainer', 'updated', 'source']
                If None, defaults to all.
            asn_alts (:obj:`list`): Additional lookup types to attempt if the
                ASN whois lookup fails. If None, defaults to all ['http'].
                *WARNING* deprecated in favor of new argument asn_methods.
            asn_methods (:obj:`list`): ASN lookup types to attempt, in order.
                If None, defaults to all ['whois', 'http'].

        Returns:
            dict: The ASN origin lookup results

            ::

                {
                    'query' (str) - The Autonomous System Number
                    'nets' (list) - Dictionaries containing network
                        information which consists of the fields listed in the
                        ASN_ORIGIN_WHOIS dictionary.
                    'raw' (str) - Raw ASN origin whois results if the inc_raw
                        parameter is True.
                }

        Raises:
            ValueError: methods argument requires one of whois, http.
            ASNOriginLookupError: ASN origin lookup failed.
        """

        if asn[0:2] != 'AS':

            asn = 'AS{0}'.format(asn)

        if asn_methods is None:

            if asn_alts is None:

                lookups = ['whois', 'http']

            else:

                from warnings import warn
                warn('ASNOrigin.lookup() asn_alts argument has been deprecated'
                     ' and will be removed. You should now use the asn_methods'
                     ' argument.')
                lookups = ['whois'] + asn_alts

        else:

            if {'whois', 'http'}.isdisjoint(asn_methods):

                raise ValueError('methods argument requires at least one of '
                                 'whois, http.')

            lookups = asn_methods

        # Create the return dictionary.
        results = {
            'query': asn,
            'nets': [],
            'raw': None
        }

        is_http = False

        # Only fetch the response if we haven't already.
        if response is None:

            for index, lookup_method in enumerate(lookups):

                if lookup_method == 'whois':

                    try:

                        log.debug('Response not given, perform ASN origin '
                                  'WHOIS lookup for {0}'.format(asn))

                        # Retrieve the whois data.
                        response = self._net.get_asn_origin_whois(
                            asn=asn, retry_count=retry_count
                        )

                    except (WhoisLookupError, WhoisRateLimitError) as e:

                        log.debug('ASN origin WHOIS lookup failed: {0}'
                                  ''.format(e))
                        pass

                elif lookup_method == 'http':

                    try:

                        log.debug('Response not given, perform ASN origin '
                                  'HTTP lookup for: {0}'.format(asn))

                        tmp = ASN_ORIGIN_HTTP['radb']['form_data']
                        tmp[str(ASN_ORIGIN_HTTP['radb']['form_data_asn_field']
                                )] = asn
                        response = self._net.get_http_raw(
                            url=ASN_ORIGIN_HTTP['radb']['url'],
                            retry_count=retry_count,
                            request_type='POST',
                            form_data=tmp
                        )
                        is_http = True   # pragma: no cover

                    except HTTPLookupError as e:

                        log.debug('ASN origin HTTP lookup failed: {0}'
                                  ''.format(e))
                        pass

            if response is None:

                raise ASNOriginLookupError('ASN origin lookup failed with no '
                                           'more methods to try.')

        # If inc_raw parameter is True, add the response to return dictionary.
        if inc_raw:

            results['raw'] = response

        nets = []
        nets_response = self.get_nets_radb(response, is_http)

        nets.extend(nets_response)

        if is_http:   # pragma: no cover
            fields = ASN_ORIGIN_HTTP
        else:
            fields = ASN_ORIGIN_WHOIS

        # Iterate through all of the network sections and parse out the
        # appropriate fields for each.
        log.debug('Parsing ASN origin data')

        for index, net in enumerate(nets):

            section_end = None
            if index + 1 < len(nets):

                section_end = nets[index + 1]['start']

            temp_net = self.parse_fields(
                response,
                fields['radb']['fields'],
                section_end,
                net['end'],
                field_list
            )

            # Merge the net dictionaries.
            net.update(temp_net)

            # The start and end values are no longer needed.
            del net['start'], net['end']

        # Add the networks to the return dictionary.
        results['nets'] = nets

        return results
The function for retrieving and parsing ASN origin whois information
        via port 43/tcp (WHOIS).

        Args:
            asn (:obj:`str`): The ASN (required).
            inc_raw (:obj:`bool`): Whether to include the raw results in the
                returned dictionary. Defaults to False.
            retry_count (:obj:`int`): The number of times to retry in case
                socket errors, timeouts, connection resets, etc. are
                encountered. Defaults to 3.
            response (:obj:`str`): Optional response object, this bypasses the
                Whois lookup. Defaults to None.
            field_list (:obj:`list`): If provided, fields to parse:
                ['description', 'maintainer', 'updated', 'source']
                If None, defaults to all.
            asn_alts (:obj:`list`): Additional lookup types to attempt if the
                ASN whois lookup fails. If None, defaults to all ['http'].
                *WARNING* deprecated in favor of new argument asn_methods.
            asn_methods (:obj:`list`): ASN lookup types to attempt, in order.
                If None, defaults to all ['whois', 'http'].

        Returns:
            dict: The ASN origin lookup results

            ::

                {
                    'query' (str) - The Autonomous System Number
                    'nets' (list) - Dictionaries containing network
                        information which consists of the fields listed in the
                        ASN_ORIGIN_WHOIS dictionary.
                    'raw' (str) - Raw ASN origin whois results if the inc_raw
                        parameter is True.
                }

        Raises:
            ValueError: methods argument requires one of whois, http.
            ASNOriginLookupError: ASN origin lookup failed.