code: def testAddFieldByNestedName(self):
      f_a = schema.Scalar(blob=core.BlobReference("blob1"))
      f_b = schema.Struct(
          (
              "c",
              schema.Struct(
                  (
                      "d",
                      schema.Scalar(blob=core.BlobReference("blob2")),
                  ),
              ),
          ),
      )
      f_x = schema.Struct(
          ("x", schema.Scalar(blob=core.BlobReference("blob3"))),
      )
  
      with self.assertRaises(TypeError):
          st = schema.Struct(
              ("a", f_a),
              ("b", f_b),
              ("b:c:d", f_x),
          )
      with self.assertRaises(TypeError):
          st = schema.Struct(
              ("a", f_a),
              ("b", f_b),
              ("b:c:d:e", f_x),
          )
  
      st = schema.Struct(
          ("a", f_a),
          ("b", f_b),
          ("e:f", f_x),
      )
      self.assertEqual(["a", "b:c:d", "e:f:x"], st.field_names())
      self.assertEqual(["blob1", "blob2", "blob3"], st.field_blobs())
  
      st = schema.Struct(
          ("a", f_a),
          ("b:c:e", f_x),
          ("b", f_b),
      )
      self.assertEqual(["a", "b:c:e:x", "b:c:d"], st.field_names())
      self.assertEqual(["blob1", "blob3", "blob2"], st.field_blobs())
  
      st = schema.Struct(
          ("a:a1", f_a),
          ("b:b1", f_b),
          ("a", f_x),
      )
      self.assertEqual(["a:a1", "a:x", "b:b1:c:d"], st.field_names())
      self.assertEqual(["blob1", "blob3", "blob2"], st.field_blobs())
  
imports: from caffe2.python import core, schema
  import numpy
  import unittest
  import pickle
  import random
label_desc: Use image node_id 21 for calling the TestDB obj's underlying member method code with example usage: obj.testAddFieldByNestedName() without return types