code: def test_tofile_fromfile(self):
      with temppath(suffix=".bin") as path:
          path = Path(path)
          np.random.seed(123)
          a = np.random.rand(10).astype("f8,i4,a5")
          a[5] = (0.5, 10, "abcde")
          with path.open("wb") as fd:
              a.tofile(fd)
          x = np.core.records.fromfile(
              path, formats="f8,i4,a5", shape=10
          )
          assert_array_equal(x, a)
  
imports: import collections.abc
  import textwrap
  from io import BytesIO
  from os import path
  from pathlib import Path
  import pytest
  import numpy
  from numpy.testing import assert_, assert_equal, assert_array_equal, assert_array_almost_equal, assert_raises, temppath
  from numpy.compat import pickle
label_desc: Use image node_id 1 for calling the TestPathUsage obj's underlying member method code with example usage: obj.test_tofile_fromfile() without return types