docs: def convert(ids, from_type):
      '''Uses the NCBI IP Converter API to converts a list of publication IDs in the same format e.g. DOI identifiers to
      another format e.g. PubMed identifiers.
          ids is a list of IDs of the type from_type e.g. a from_type of 'doi' specifies DOI identifiers.
          The function returns a Python dict with the mappings from the input IDs to IDs of all other types.
      '''
  
      if from_type not in converter_types:
          raise PubMedConverterTypeException(from_type)
  
      # Avoid multiple requests of the same ID
      mapping = {}
      ids = list(set(ids))
  
      # Request the mapping from the server
      query_string = "?ids=%s&idtype=%s" % (urllib2.quote(",".join(ids), ''), from_type)
      xml = get_resource("www.ncbi.nlm.nih.gov", '/pmc/utils/idconv/v1.0/%s' % query_string).strip()
  
      # Parse the response
      try:
          _dom = parseString(xml)
          main_tag = _dom.getElementsByTagName("pmcids")
          assert(len(main_tag) == 1)
          main_tag = main_tag[0]
          request_status = main_tag.getAttribute('status')
      except Exception, e:
          raise PubMedIDRetrievalException('An error occurred retrieving the XML from the PubMed ID Converter API: %s.' % str(e))
  
      if request_status == 'ok':
          for record_tag in main_tag.getElementsByTagName("record"):
              attributes = record_tag.attributes
              record_keys = attributes.keys()
              assert('requested-id' in record_keys)
              from_key = attributes['requested-id'].value
              assert(from_key not in mapping)
              mapping[from_key] = {}
              for k in record_keys:
                  if k != 'requested-id':
                      mapping[from_key][k] = attributes[k].value
      else:
          # todo: parse the error tag here to print more details
          raise PubMedIDRetrievalException('The request to the PubMed ID Converter API failed. Please check that the IDs are of the correct types.')
  
      return mapping