code: def scan_used_functions(example_file, gallery_conf):
      """save variables so we can later add links to the documentation"""
      example_code_obj = identify_names(open(example_file).read())
      if example_code_obj:
          codeobj_fname = example_file[:-3] + "_codeobj.pickle"
          with open(codeobj_fname, "wb") as fid:
              pickle.dump(
                  example_code_obj, fid, pickle.HIGHEST_PROTOCOL
              )
  
      backrefs = set(
          "{module_short}.{name}".format(**entry)
          for entry in example_code_obj.values()
          if entry["module"].startswith(gallery_conf["doc_module"])
      )
  
      return backrefs
  
file_path: tensorly/doc/sphinx_ext/sphinx_gallery/backreferences.py
imports: from __future__ import print_function
  import ast
  import os
label_desc: Use image node_id 3 for calling a global function with example usage: scan_used_functions(example_file, gallery_conf) and returns: backrefs