code: def _write_func(archive, func, dist, keymap=None):
      """write stored function and distance information to archive
  
      Args:
          archive (klepto.archive): function archive (output of ``_read_func``)
          func (function): with interface ``y = f(x)``, ``x`` is a list of floats
          dist (dict): distance information
          keymap (klepto.keymap): keymap used for key encoding
  
      Returns:
          None
      """
      arxiv = getattr(archive, "__archive__", archive)
      entries = {len(arxiv): (func, dist)}
      write(archive, entries, keymap=keymap)  # apply keymap to keys
      return
  
file_path: mystic/mystic/cache/archive.py
imports: from klepto.archives import dict_archive, dir_archive, file_archive, hdf_archive, hdfdir_archive, null_archive, sql_archive, sqltable_archive
label_desc: Use image node_id 5 for calling a global function with example usage: _write_func(archive, func, dist, keymap) without return types