code: def _nyoka_pmml_attributes(
      self, attribute: models.Attribute
  ) -> nyoka_pmml.Attribute:
      return nyoka_pmml.Attribute(
          partialScore=attribute.score
          if not isinstance(attribute.score, models.ComplexPartialScore)
          else None,
          ComplexPartialScore=nyoka_pmml.ComplexPartialScore(
              Apply=nyoka_pmml.Apply(
                  function="+",
                  Apply_member=[
                      nyoka_pmml.Apply(
                          function="*",
                          FieldRef=[
                              nyoka_pmml.FieldRef(
                                  field=attribute.score.feature_name
                              )
                          ],
                          Constant=[
                              nyoka_pmml.Constant(
                                  valueOf_=attribute.score.multiplier
                              )
                          ],
                      )
                  ],
                  Constant=[
                      nyoka_pmml.Constant(
                          valueOf_=attribute.score.constant
                      )
                  ],
              )
          )
          if isinstance(attribute.score, models.ComplexPartialScore)
          else None,
          SimplePredicate=None
          if (
              attribute.predicate is None
              or not isinstance(
                  attribute.predicate, models.SimplePredicate
              )
          )
          else nyoka_pmml.SimplePredicate(
              field=attribute.predicate.field,
              operator=attribute.predicate.operator.name,
              value=attribute.predicate.value,
          ),
          CompoundPredicate=None
          if (
              attribute.predicate is None
              or not isinstance(
                  attribute.predicate, models.CompoundPredicate
              )
          )
          else nyoka_pmml.CompoundPredicate(
              booleanOperator=attribute.predicate.booleanOperator.name,
              SimplePredicate=[
                  nyoka_pmml.SimplePredicate(
                      field=sp.field,
                      operator=sp.operator.name,
                      value=sp.value,
                  )
                  for sp in attribute.predicate.simplePredicates
              ],
          ),
          True_=None
          if (
              attribute.predicate is None
              or not isinstance(
                  attribute.predicate, models.TruePredicate
              )
          )
          else nyoka_pmml.True_(),
      )
  
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 12 for calling the NyokaSerializer obj's underlying member method code with example usage: obj._nyoka_pmml_attributes(attribute) and returns: nyoka_pmml