code: def _populate_field_defaults(self):
          
          for namespace in self.api.namespaces.values():
              for data_type in namespace.data_types:
                  # Only struct fields can have default
                  if not isinstance(data_type, Struct):
                      continue
  
                  for field in data_type.fields:
                      if not field._ast_node.has_default:
                          continue
  
                      if isinstance(field._ast_node.default, AstTagRef):
                          default_value = TagRef(
                              field.data_type, field._ast_node.default.tag)
                      else:
                          default_value = field._ast_node.default
                      if not (field._ast_node.type_ref.nullable and default_value is None):
                          # Verify that the type of the default value is correct for this field
                          try:
                              if field.data_type.name in ('Float32', 'Float64'):
                                  # You can assign int to the default value of float type
                                  # However float type should always have default value in float
                                  default_value = float(default_value)
                              field.data_type.check(default_value)
                          except ValueError as e:
                              raise InvalidSpec(
                                  'Field %s has an invalid default: %s' %
                                  (quote(field._ast_node.name), e),
                                  field._ast_node.lineno, field._ast_node.path)
                      field.set_default(default_value)
docs: Populate the defaults of each field. This is done in a separate pass
          because defaults that specify a union tag require the union to have
          been defined.