def _CopyMatchScorerToScorerSpecProtocolBuffer(match_scorer, limit, pb):
 if isinstance(match_scorer, RescoringMatchScorer):
  pb.set_scorer(search_service_pb.ScorerSpec.RESCORING_MATCH_SCORER)
 elif isinstance(match_scorer, MatchScorer):
  pb.set_scorer(search_service_pb.ScorerSpec.MATCH_SCORER)
 else:
  raise TypeError(('match_scorer must be a MatchScorer or RescoringMatchRescorer, got %s' % match_scorer.__class__.__name__))
 pb.set_limit(limit)
 return pb

def _CopyMatchScorerToScorerSpecProtocolBuffer ( match_scorer , limit , pb ) : if isinstance ( match_scorer , RescoringMatchScorer ) : pb . set_scorer ( search_service_pb . ScorerSpec . RESCORING_MATCH_SCORER ) elif isinstance ( match_scorer , MatchScorer ) : pb . set_scorer ( search_service_pb . ScorerSpec . MATCH_SCORER ) else : raise TypeError ( ( 'match_scorer must be a MatchScorer or RescoringMatchRescorer, got %s' % match_scorer . __class__ . __name__ ) ) pb . set_limit ( limit ) return pb
copies a matchscorer to a search_service_pb .