def _validate_servicetype_ref(data, valid_values=None):
 svc_type_id = data
 svctype_mgr = servicetype_db.ServiceTypeManager.get_instance()
 try:
  svctype_mgr.get_service_type(context.get_admin_context(), svc_type_id)
 except servicetype_db.ServiceTypeNotFound:
  return (_("The service type '%s' does not exist") % svc_type_id)

def _validate_servicetype_ref ( data , valid_values = None ) : svc_type_id = data svctype_mgr = servicetype_db . ServiceTypeManager . get_instance ( ) try : svctype_mgr . get_service_type ( context . get_admin_context ( ) , svc_type_id ) except servicetype_db . ServiceTypeNotFound : return ( _ ( "The service type '%s' does not exist" ) % svc_type_id )
verify the service type id exists .