def _NewIndexFromIndexSpecPb(index_spec_pb):
 source = _SOURCE_PB_TO_SOURCES_MAP.get(index_spec_pb.source())
 index = None
 if index_spec_pb.has_namespace():
  index = Index(name=index_spec_pb.name(), namespace=index_spec_pb.namespace(), source=source)
 else:
  index = Index(name=index_spec_pb.name(), source=source)
 return index

def _NewIndexFromIndexSpecPb ( index_spec_pb ) : source = _SOURCE_PB_TO_SOURCES_MAP . get ( index_spec_pb . source ( ) ) index = None if index_spec_pb . has_namespace ( ) : index = Index ( name = index_spec_pb . name ( ) , namespace = index_spec_pb . namespace ( ) , source = source ) else : index = Index ( name = index_spec_pb . name ( ) , source = source ) return index
creates an index from a search_service_pb .