code: def FilterArgsFromSemanticProtobuf(protobuf, kwargs):
    
    for descriptor in protobuf.type_infos:
      value = kwargs.pop(descriptor.name, None)
      if value is not None:
        setattr(protobuf, descriptor.name, value)
docs: Assign kwargs to the protobuf, and remove them from the kwargs dict.