code: def serialize(
      self,
      model: typing.Union[
          models.SimplePMMLRuleSetModel, models.Scorecard
      ],
  ) -> str:
      if isinstance(model, models.SimplePMMLRuleSetModel):
          pmml_model = self._nyoka_pmml_model(
              model,
              RuleSetModel=None
              if model.ruleSetModel is None
              else [self._nyoka_rule_set_model(model.ruleSetModel)],
          )
      elif isinstance(model, models.Scorecard):
          pmml_model = self._nyoka_pmml_model(
              model,
              Scorecard=None
              if model is None
              else [self._nyoka_scorecard_model(model)],
          )
      else:
          raise NotImplemented
      string_io = io.StringIO()
      pmml_model.export(outfile=string_io, level=0)
      return string_io.getvalue()
  
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 2 for calling the NyokaSerializer obj's underlying member method code with example usage: obj.serialize(model) and returns: string_io