code: def get_ids_for_gene(hgnc_name, **kwargs):
      hgnc_id = hgnc_client.get_hgnc_id(hgnc_name)
      if hgnc_id is None:
          raise ValueError('Invalid HGNC name.')
      entrez_id = hgnc_client.get_entrez_id(hgnc_id)
      if entrez_id is None:
          raise ValueError('Entrez ID not found in HGNC table.')
      params = {'db': 'gene',
                'retmode': 'xml',
                'id': entrez_id}
      params.update(kwargs)
      tree = send_request(pubmed_fetch, params)
      if tree is None:
          return []
      if tree.find('ERROR') is not None:
          logger.error(tree.find('ERROR').text)
          return []
      id_terms = tree.findall('.//PubMedId')
      if id_terms is None:
          return []
      ids = list(set([idt.text for idt in id_terms]))
      return ids