Create a Transformer object to transform data for feature engineering.

    Parameters
    ----------
    dataset : SFrame
        The dataset to use for training the model.

    transformers: Transformer  | list[Transformer]
        An Transformer or a list of Transformers.

    See Also
    --------
    turicreate.toolkits.feature_engineering._feature_engineering._TransformerBase

    Examples
    --------

    .. sourcecode:: python

        # Create data.
        >>> sf = turicreate.SFrame({'a': [1,2,3], 'b' : [2,3,4]})

        >>> from turicreate.feature_engineering import FeatureHasher, \
                                               QuadraticFeatures, OneHotEncoder

        # Create a single transformer.
        >>> encoder = turicreate.feature_engineering.create(sf,
                                 OneHotEncoder(max_categories = 10))

        # Create a chain of transformers.
        >>> chain = turicreate.feature_engineering.create(sf, [
                                    QuadraticFeatures(),
                                    FeatureHasher()
                                  ])

        # Create a chain of transformers with names for each of the steps.
        >>> chain = turicreate.feature_engineering.create(sf, [
                                    ('quadratic', QuadraticFeatures()),
                                    ('hasher', FeatureHasher())
                                  ])

def create(dataset, transformers):
    """
    Create a Transformer object to transform data for feature engineering.

    Parameters
    ----------
    dataset : SFrame
        The dataset to use for training the model.

    transformers: Transformer  | list[Transformer]
        An Transformer or a list of Transformers.

    See Also
    --------
    turicreate.toolkits.feature_engineering._feature_engineering._TransformerBase

    Examples
    --------

    .. sourcecode:: python

        # Create data.
        >>> sf = turicreate.SFrame({'a': [1,2,3], 'b' : [2,3,4]})

        >>> from turicreate.feature_engineering import FeatureHasher, \
                                               QuadraticFeatures, OneHotEncoder

        # Create a single transformer.
        >>> encoder = turicreate.feature_engineering.create(sf,
                                 OneHotEncoder(max_categories = 10))

        # Create a chain of transformers.
        >>> chain = turicreate.feature_engineering.create(sf, [
                                    QuadraticFeatures(),
                                    FeatureHasher()
                                  ])

        # Create a chain of transformers with names for each of the steps.
        >>> chain = turicreate.feature_engineering.create(sf, [
                                    ('quadratic', QuadraticFeatures()),
                                    ('hasher', FeatureHasher())
                                  ])


    """
    err_msg = "The parameters 'transformers' must be a valid Transformer object."
    cls = transformers.__class__

    _raise_error_if_not_sframe(dataset, "dataset")

    # List of transformers.
    if (cls == list):
        transformers = TransformerChain(transformers)
    # Transformer.
    else:
        if not issubclass(cls, TransformerBase):
            raise TypeError(err_msg)
    # Fit and return
    transformers.fit(dataset)
    return transformers