docs: def lookup(self, nir=None, inc_raw=False, retry_count=3, response=None,
                 field_list=None, is_offline=False):
          """
          The function for retrieving and parsing NIR whois information for an IP
          address via HTTP (HTML scraping).
  
          Args:
              nir (:obj:`str`): The NIR to query ('jpnic' or 'krnic'). Required
                  if response is None.
              inc_raw (:obj:`bool`, optional): 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
                  NIR lookup. Required when is_offline=True.
              field_list (:obj:`list` of :obj:`str`): If provided, fields to
                  parse. Defaults to :obj:`ipwhois.nir.BASE_NET`.
              is_offline (:obj:`bool`): Whether to perform lookups offline. If
                  True, response and asn_data must be provided. Primarily used
                  for testing.
  
          Returns:
              dict: The NIR whois results:
  
              ::
  
                  {
                      'query' (str) - The IP address.
                      'nets' (list of dict) - Network information which consists
                          of the fields listed in the ipwhois.nir.NIR_WHOIS
                          dictionary.
                      'raw' (str) - Raw NIR whois results if the inc_raw
                          parameter is True.
                  }
          """
  
          if nir not in NIR_WHOIS.keys():
  
              raise KeyError('Invalid arg for nir (National Internet Registry')
  
          # Create the return dictionary.
          results = {
              'query': self._net.address_str,
              'raw': None
          }
  
          # Only fetch the response if we haven't already.
          if response is None:
  
              if is_offline:
  
                  raise KeyError('response argument required when '
                                 'is_offline=True')
  
              log.debug('Response not given, perform WHOIS lookup for {0}'
                        .format(self._net.address_str))
  
              form_data = None
              if NIR_WHOIS[nir]['form_data_ip_field']:
                  form_data = {NIR_WHOIS[nir]['form_data_ip_field']:
                               self._net.address_str}
  
              # Retrieve the whois data.
              response = self._net.get_http_raw(
                  url=str(NIR_WHOIS[nir]['url']).format(self._net.address_str),
                  retry_count=retry_count,
                  headers=NIR_WHOIS[nir]['request_headers'],
                  request_type=NIR_WHOIS[nir]['request_type'],
                  form_data=form_data
              )
  
          # If inc_raw parameter is True, add the response to return dictionary.
          if inc_raw:
  
              results['raw'] = response
  
          nets = []
          nets_response = None
          if nir == 'jpnic':
  
              nets_response = self.get_nets_jpnic(response)
  
          elif nir == 'krnic':
  
              nets_response = self.get_nets_krnic(response)
  
          nets.extend(nets_response)
  
          global_contacts = {}
  
          # Iterate through all of the network sections and parse out the
          # appropriate fields for each.
          log.debug('Parsing NIR WHOIS data')
          for index, net in enumerate(nets):
  
              section_end = None
              if index + 1 < len(nets):
                  section_end = nets[index + 1]['start']
  
              try:
  
                  dt_format = NIR_WHOIS[nir]['dt_format']
  
              except KeyError:  # pragma: no cover
  
                  dt_format = None
  
              temp_net = self.parse_fields(
                  response=response,
                  fields_dict=NIR_WHOIS[nir]['fields'],
                  net_start=section_end,
                  net_end=net['end'],
                  dt_format=dt_format,
                  field_list=field_list,
                  hourdelta=int(NIR_WHOIS[nir]['dt_hourdelta'])
              )
              temp_net['country'] = NIR_WHOIS[nir]['country_code']
              contacts = {
                  'admin': temp_net['contact_admin'],
                  'tech': temp_net['contact_tech']
              }
  
              del (
                  temp_net['contact_admin'],
                  temp_net['contact_tech']
              )
  
              if not is_offline:
  
                  for key, val in contacts.items():
  
                      if len(val) > 0:
  
                          if isinstance(val, str):
  
                              val = val.splitlines()
  
                          for contact in val:
  
                              if contact in global_contacts.keys():
  
                                  temp_net['contacts'][key] = (
                                      global_contacts[contact]
                                  )
  
                              else:
  
                                  if nir == 'krnic':
  
                                      tmp_response = contact
                                      tmp_handle = None
  
                                  else:
  
                                      tmp_response = None
                                      tmp_handle = contact
  
                                  temp_net['contacts'][key] = self.get_contact(
                                      response=tmp_response,
                                      handle=tmp_handle,
                                      nir=nir,
                                      retry_count=retry_count,
                                      dt_format=dt_format
                                  )
                                  global_contacts[contact] = (
                                      temp_net['contacts'][key]
                                  )
  
              # 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