def _CopyMetadataToProtocolBuffer(index, spec_pb):
 spec_pb.set_name(index.name.encode('utf-8'))
 spec_pb.set_namespace(index.namespace.encode('utf-8'))
 if (index._source != Index.SEARCH):
  spec_pb.set_source(_SOURCES_TO_PB_MAP.get(index._source))

def _CopyMetadataToProtocolBuffer ( index , spec_pb ) : spec_pb . set_name ( index . name . encode ( 'utf-8' ) ) spec_pb . set_namespace ( index . namespace . encode ( 'utf-8' ) ) if ( index . _source != Index . SEARCH ) : spec_pb . set_source ( _SOURCES_TO_PB_MAP . get ( index . _source ) )
copies index specification to a search_service_pb .