code: def test_serialisation_of_numpy_ndarray(tmpdir):
      from sacred.observers.tinydb_hashfs.bases import NdArraySerializer
      from tinydb_serialization import SerializationMiddleware
      import numpy as np
  
      # Setup Serialisation object for non list/dict objects
      serialization_store = SerializationMiddleware()
      serialization_store.register_serializer(
          NdArraySerializer(), "TinyArray"
      )
  
      db = TinyDB(
          os.path.join(tmpdir.strpath, "metadata.json"),
          storage=serialization_store,
      )
  
      eye_mat = np.eye(3)
      ones_array = np.ones(5)
  
      document = {
          "foo": "bar",
          "some_array": eye_mat,
          "nested": {"ones": ones_array},
      }
  
      db.insert(document)
      returned_doc = db.all()[0]
  
      assert returned_doc["foo"] == "bar"
      assert (returned_doc["some_array"] == eye_mat).all()
      assert (returned_doc["nested"]["ones"] == ones_array).all()
  
imports: from __future__ import division, print_function, unicode_literals, absolute_import
  import os
  import datetime
  import tempfile
  import io
  import pytest
  from tinydb import TinyDB
  from hashfs import HashFS
  from sacred.dependencies import get_digest
  from sacred.observers.tinydb_hashfs import TinyDbObserver, tiny_db_option
  from sacred.observers.tinydb_hashfs.bases import BufferedReaderWrapper
  from sacred import optional
  from sacred.experiment import Experiment
label_desc: Use image node_id 18 for calling a global function with example usage: test_serialisation_of_numpy_ndarray(tmpdir) without return types