code: def set_transform_interface_params(
      spec,
      input_features,
      output_features,
      are_optional=False,
      training_features=None,
      array_datatype=Model_pb2.ArrayFeatureType.DOUBLE,
  ):
      """
      Common utilities to set transform interface params.
      """
      input_features = _fm.process_or_validate_features(input_features)
      output_features = _fm.process_or_validate_features(
          output_features
      )
  
      # Add input and output features
      for fname, ftype in input_features:
          input_ = spec.description.input.add()
          input_.name = fname
          datatypes._set_datatype(
              input_.type, ftype, array_datatype=array_datatype
          )
          if are_optional:
              input_.type.isOptional = are_optional
  
      for fname, ftype in output_features:
          output_ = spec.description.output.add()
          output_.name = fname
          datatypes._set_datatype(
              output_.type, ftype, array_datatype=array_datatype
          )
  
      # Add training features
      if training_features is not None:
          spec = set_training_features(spec, training_features)
  
      return spec
  
imports: from ..proto import Model_pb2
  from .None import _feature_management
  from .None import datatypes
label_desc: Use image node_id 3 for calling a global function with example usage: set_transform_interface_params(spec, input_features, output_features, are_optional, training_features, array_datatype) and returns: spec