code: def _fields_to_object(descriptor, fields):
      'Helper to convert a descriptor and a set of fields to a Protobuf instance'
      # pylint: disable=protected-access
      obj = descriptor._concrete_class()
  
      for name, value in fields:
          if isinstance(value, tuple):
              subtype = descriptor.fields_by_name[name].message_type
              value = _fields_to_object(subtype, value)
          _assign_to_field(obj, name, value)
  
      return obf _fields_to_object(descriptor, fields):
      'Helper to convert a descriptor and a set of fields to a Protobuf instance'
      # pylint: disable=protected-access
      obj = descriptor._concrete_class()
  
      for name, value in fields:
          if isinstance(value, tuple):
              subtype = descriptor.fields_by_name[name].message_type
              value = _fields_to_object(subtype, value)
          _assign_to_field(obj, name, value)
  
      return obj
docs: Helper to convert a descriptor and a set of fields to a Protobuf instance