code: def validate_links(links):
      if links.strip().lower() == "none":
          return {}
  
      links = links.strip().split()
      diff = set(links) - set(DEFAULT_PDVEGAPLOT_LINKS.keys())
      if diff:
          raise ValueError(
              "Following links are invalid: {0}".format(list(diff))
          )
      return dict(
          (link, link in links) for link in DEFAULT_PDVEGAPLOT_LINKS
      )
  
imports: import os
  import json
  import warnings
  import jinja2
  from docutils import nodes
  from docutils.parsers.rst import Directive
  from docutils.parsers.rst.directives import flag, unchanged
  from sphinx.locale import _
  from pdvega import Axes
  from .utils import exec_then_eval
label_desc: Use image node_id 2 for calling a global function with example usage: validate_links(links) and returns: dict, dict