code: def _nyoka_rule_set(
      self, rule_set: models.RuleSet
  ) -> nyoka_pmml.RuleSet:
      return nyoka_pmml.RuleSet(
          RuleSelectionMethod=None
          if rule_set.ruleSelectionMethod is None
          else [
              nyoka_pmml.RuleSelectionMethod(criterion=m.name)
              for m in rule_set.ruleSelectionMethod
          ],
          SimpleRule=None
          if rule_set.rules is None
          else [self._nyoka_rule(r) for r in rule_set.rules],
          recordCount=rule_set.recordCount,
          nbCorrect=rule_set.nbCorrect,
          defaultScore=rule_set.defaultScore,
          defaultConfidence=rule_set.defaultConfidence,
      )
  
imports: import typing
  import datetime
  import io
  import nyoka.PMML44
  import nyoka.base.constants
  from .abstract_serializer import AbstractSerializer
  from ..None import __version__
  from ..None import models
label_desc: Use image node_id 8 for calling the NyokaSerializer obj's underlying member method code with example usage: obj._nyoka_rule_set(rule_set) and returns: nyoka_pmml