class_docstr: Serialize ``sklearn.pipeline.Pipeline`` objects.
class_docstr_tok: ["Serialize","``","sklearn.pipeline.Pipeline","``","objects","."]
docstr: Encode given pipeline.
docstr_tok: ["Encode","given","pipeline","."]
code: def default(self, obj):
      """Encode given pipeline."""
      if isinstance(obj, Pipeline):
          pipeline_steps = str(obj.named_steps)
          pipeline_steps = re.sub(r"\n", "", pipeline_steps)
          pipeline_steps = re.sub(r"\s+", " ", pipeline_steps)
          return pipeline_steps
      return json.JSONEncoder.default(self, obj)
  
imports: import json
  import math
  import re
  from collections import defaultdict
  from typing import Any, Dict, List, Union
  import numpy
  from sklearn.base import BaseEstimator
  from sklearn.pipeline import Pipeline
  from tabulate import tabulate
  from skll.types import EvaluateTaskResults, LabelType
  from skll.utils.logging import get_skll_logger
label_desc: Use image node_id 1 for calling the PipelineTypeEncoder obj's underlying member method code with example usage: obj.default(obj) and returns: json, pipeline_steps