def _build_variant_map():
  result = {}
  for name in dir(messages):
    value = getattr(messages, name)
    if isinstance(value, type) and issubclass(value, messages.Field):
      for variant in getattr(value, 'VARIANTS', []):
        result[variant] = value
  return result
Map variants to fields.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/protorpc/protorpc/definition.py/_build_variant_map