docstr: Testing flatten_dtype
docstr_tok: ["Testing","flatten_dtype"]
code: def test_flatten_dtype(self):
      "Testing flatten_dtype"
      # Standard dtype
      dt = np.dtype([("a", "f8"), ("b", "f8")])
      dt_flat = flatten_dtype(dt)
      assert_equal(dt_flat, [float, float])
      # Recursive dtype
      dt = np.dtype([("a", [("aa", "|S1"), ("ab", "|S2")]), ("b", int)])
      dt_flat = flatten_dtype(dt)
      assert_equal(dt_flat, [np.dtype("|S1"), np.dtype("|S2"), int])
      # dtype with shaped fields
      dt = np.dtype([("a", (float, 2)), ("b", (int, 3))])
      dt_flat = flatten_dtype(dt)
      assert_equal(dt_flat, [float, int])
      dt_flat = flatten_dtype(dt, True)
      assert_equal(dt_flat, [float] * 2 + [int] * 3)
      # dtype w/ titles
      dt = np.dtype([(("a", "A"), "f8"), (("b", "B"), "f8")])
      dt_flat = flatten_dtype(dt)
      assert_equal(dt_flat, [float, float])
  
imports: import time
  from datetime import date
  import numpy
  from numpy.testing import assert_, assert_equal, assert_allclose, assert_raises
  from numpy.lib._iotools import LineSplitter, NameValidator, StringConverter, has_nested_fields, easy_dtype, flatten_dtype
label_desc: Use image node_id 3 for calling the TestMiscFunctions obj's underlying member method code with example usage: obj.test_flatten_dtype() without return types