docs: def save(path, data, compression='default'):
      """
      Save any Python structure to an HDF5 file. It is particularly suited for
      Numpy arrays. This function works similar to ``numpy.save``, except if you
      save a Python object at the top level, you do not need to issue
      ``data.flat[0]`` to retrieve it from inside a Numpy array of type
      ``object``.
  
      Some types of objects get saved natively in HDF5. The rest get serialized
      automatically.  For most needs, you should be able to stick to the natively
      supported types, which are:
  
      * Dictionaries
      * Short lists and tuples (<256 in length)
      * Basic data types (including strings and None)
      * Numpy arrays
      * Scipy sparse matrices
      * Pandas ``DataFrame``, ``Series``, and ``Panel``
      * SimpleNamespaces (for Python >= 3.3, but see note below)
  
      A recommendation is to always convert your data to using only these types
      That way your data will be portable and can be opened through any HDF5
      reader. A class that helps you with this is
      :class:`deepdish.util.Saveable`.
  
      Lists and tuples are supported and can contain heterogeneous types. This is
      mostly useful and plays well with HDF5 for short lists and tuples. If you
      have a long list (>256) it will be serialized automatically. However,
      in such cases it is common for the elements to have the same type, in which
      case we strongly recommend converting to a Numpy array first.
  
      Note that the SimpleNamespace type will be read in as dictionaries for
      earlier versions of Python.
  
      This function requires the `PyTables <http://www.pytables.org/>`_ module to
      be installed.
  
      You can change the default compression method to ``blosc`` (much faster,
      but less portable) by creating a ``~/.deepdish.conf`` with::
  
          [io]
              compression: blosc
  
      This is the recommended compression method if you plan to use your HDF5
      files exclusively through deepdish (or PyTables).
  
      Parameters
      ----------
      path : string
          Filename to which the data is saved.
      data : anything
          Data to be saved. This can be anything from a Numpy array, a string, an
          object, or a dictionary containing all of them including more
          dictionaries.
      compression : string or tuple
          Set compression method, choosing from `blosc`, `zlib`, `lzo`, `bzip2`
          and more (see PyTables documentation). It can also be specified as a
          tuple (e.g. ``('blosc', 5)``), with the latter value specifying the
          level of compression, choosing from 0 (no compression) to 9 (maximum
          compression).  Set to `None` to turn off compression. The default is
          `zlib`, since it is highly portable; for much greater speed, try for
          instance `blosc`.
  
      See also
      --------
      load
      """
      filters = _get_compression_filters(compression)
  
      with tables.open_file(path, mode='w') as h5file:
          # If the data is a dictionary, put it flatly in the root
          group = h5file.root
          group._v_attrs[DEEPDISH_IO_VERSION_STR] = IO_VERSION
          idtable = {}  # dict to keep track of objects already saved
          # Sparse matrices match isinstance(data, dict), so we'll have to be
          # more strict with the type checking
          if type(data) == type({}) and _dict_native_ok(data):
              idtable[id(data)] = '/'
              for key, value in data.items():
                  _save_level(h5file, group, value, name=key,
                              filters=filters, idtable=idtable)
  
          elif (_sns and isinstance(data, SimpleNamespace) and
                _dict_native_ok(data.__dict__)):
              idtable[id(data)] = '/'
              group._v_attrs[DEEPDISH_IO_ROOT_IS_SNS] = True
              for key, value in data.__dict__.items():
                  _save_level(h5file, group, value, name=key,
                              filters=filters, idtable=idtable)
  
          else:
              _save_level(h5file, group, data, name='data',
                          filters=filters, idtable=idtable)
              # Mark this to automatically unpack when loaded
              group._v_attrs[DEEPDISH_IO_UNPACK] = True