code: def pubmed_url(args=sys.argv[1:], resolve_doi=True, out=sys.stdout):
      
  
      parser = argparse.ArgumentParser(
          description='Get a publication URL using a PubMed ID or PubMed URL')
      parser.add_argument('query', help='PubMed ID or PubMed URL')
      parser.add_argument(
          '-d', '--doi', action='store_false', help='get DOI URL')
      parser.add_argument(
          '-e', '--email', action='store', help='set user email', default='')
  
      args = parser.parse_args(args=args)
  
      lookup = PubMedLookup(args.query, args.email)
      publication = Publication(lookup, resolve_doi=args.doi)
  
      out.write(publication.url + '\n')
docs: Get a publication URL via the command line using a PubMed ID or PubMed URL