def _CopyFieldToProtocolBuffer(field, pb):
 pb.set_name(field.name.encode('utf-8'))
 field_value_pb = pb.mutable_value()
 if field.language:
  field_value_pb.set_language(field.language.encode('utf-8'))
 if (field.value is not None):
  field._CopyValueToProtocolBuffer(field_value_pb)
 return pb

def _CopyFieldToProtocolBuffer ( field , pb ) : pb . set_name ( field . name . encode ( 'utf-8' ) ) field_value_pb = pb . mutable_value ( ) if field . language : field_value_pb . set_language ( field . language . encode ( 'utf-8' ) ) if ( field . value is not None ) : field . _CopyValueToProtocolBuffer ( field_value_pb ) return pb
copies fields contents to a document_pb .