def scan_used_functions(example_file, gallery_conf):
 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

def scan_used_functions ( example_file , gallery_conf ) : 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
save variables so we can later add links to the documentation .