code: def testWellKnownInAnyMessage(self):
      message = any_pb2.Any()
      int32_value = wrappers_pb2.Int32Value()
      int32_value.value = 1234
      message.Pack(int32_value)
      self.assertEqual(
          json.loads(json_format.MessageToJson(message, True)),
          json.loads(
              "{\n"
              '  "@type": "type.googleapis.com/google.protobuf.Int32Value",\n'
              '  "value": 1234\n'
              "}\n"
          ),
      )
      parsed_message = any_pb2.Any()
      self.CheckParseBack(message, parsed_message)
  
      timestamp = timestamp_pb2.Timestamp()
      message.Pack(timestamp)
      self.assertEqual(
          json.loads(json_format.MessageToJson(message, True)),
          json.loads(
              "{\n"
              '  "@type": "type.googleapis.com/google.protobuf.Timestamp",\n'
              '  "value": "1970-01-01T00:00:00Z"\n'
              "}\n"
          ),
      )
      self.CheckParseBack(message, parsed_message)
  
      duration = duration_pb2.Duration()
      duration.seconds = 1
      message.Pack(duration)
      self.assertEqual(
          json.loads(json_format.MessageToJson(message, True)),
          json.loads(
              "{\n"
              '  "@type": "type.googleapis.com/google.protobuf.Duration",\n'
              '  "value": "1s"\n'
              "}\n"
          ),
      )
      self.CheckParseBack(message, parsed_message)
  
      field_mask = field_mask_pb2.FieldMask()
      field_mask.paths.append("foo.bar")
      field_mask.paths.append("bar")
      message.Pack(field_mask)
      self.assertEqual(
          json.loads(json_format.MessageToJson(message, True)),
          json.loads(
              "{\n"
              '  "@type": "type.googleapis.com/google.protobuf.FieldMask",\n'
              '  "value": "foo.bar,bar"\n'
              "}\n"
          ),
      )
      self.CheckParseBack(message, parsed_message)
  
      struct_message = struct_pb2.Struct()
      struct_message["name"] = "Jim"
      message.Pack(struct_message)
      self.assertEqual(
          json.loads(json_format.MessageToJson(message, True)),
          json.loads(
              "{\n"
              '  "@type": "type.googleapis.com/google.protobuf.Struct",\n'
              '  "value": {"name": "Jim"}\n'
              "}\n"
          ),
      )
      self.CheckParseBack(message, parsed_message)
  
      nested_any = any_pb2.Any()
      int32_value.value = 5678
      nested_any.Pack(int32_value)
      message.Pack(nested_any)
      self.assertEqual(
          json.loads(json_format.MessageToJson(message, True)),
          json.loads(
              "{\n"
              '  "@type": "type.googleapis.com/google.protobuf.Any",\n'
              '  "value": {\n'
              '    "@type": "type.googleapis.com/google.protobuf.Int32Value",\n'
              '    "value": 5678\n'
              "  }\n"
              "}\n"
          ),
      )
      self.CheckParseBack(message, parsed_message)
  
imports: import json
  import math
  import sys
  from google.protobuf import any_pb2
  from google.protobuf import duration_pb2
  from google.protobuf import field_mask_pb2
  from google.protobuf import struct_pb2
  from google.protobuf import timestamp_pb2
  from google.protobuf import wrappers_pb2
  from google.protobuf.internal import well_known_types
  from google.protobuf import json_format
  from google.protobuf.util import json_format_proto3_pb2
label_desc: Use image node_id 18 for calling the JsonFormatTest obj's underlying member method code with example usage: obj.testWellKnownInAnyMessage() without return types