code: def gh_role(
      name, rawtext, text, lineno, inliner, options={}, content=[]
  ):
      """Link to a GitHub issue.
  
      adapted from
      https://doughellmann.com/blog/2010/05/09/defining-custom-roles-in-sphinx/
      """
      try:
          # issue/PR mode (issues/PR-num will redirect to pull/PR-num)
          int(text)
      except ValueError:
          # direct link mode
          slug = text
      else:
          slug = "issues/" + text
      text = "#" + text
      ref = "https://github.com/mne-tools/mne-python/" + slug
      set_classes(options)
      node = reference(rawtext, text, refuri=ref, **options)
      return [node], []
  
imports: from docutils.nodes import reference
  from docutils.parsers.rst.roles import set_classes
label_desc: Use image node_id 1 for calling a global function with example usage: gh_role(name, rawtext, text, lineno, inliner, options, content) and returns: list,  list