# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------------------------
# - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
ColumnDuplicator
"""

__all__ = ["ColumnDuplicator"]


from sklearn.base import TransformerMixin

from ...base_transform import BaseTransform
from ...internal.core.preprocessing.schema.columnduplicator import \
    ColumnDuplicator as core
from ...internal.utils.utils import trace


class ColumnDuplicator(core, BaseTransform, TransformerMixin):
    """

    Duplicates columns from the dataset

    :param columns: a dictionary of key-value pairs, where key is the output
        column name and value is a list of input column names.

        * Only one key-value pair is allowed.
        * Input column type: numeric or string.
        * Output column type:
         `Vector Type </nimbusml/concepts/types#vectortype-column>`_.

        The << operator can be used to set this value (see
        `Column Operator </nimbusml/concepts/columns>`_)

        For example
         * ColumnDuplicator(columns={'age_copy': 'age', 'parity_copy':
        'parity'})
         * ColumnDuplicator() << {'age_copy': 'age', 'parity_copy':
        'parity'})

        For more details see `Columns </nimbusml/concepts/columns>`_.

    :param params: Additional arguments sent to compute engine.

    .. seealso::
        :py:class:`ColumnDropper
        <nimbusml.preprocessing.schema.ColumnDropper>`,
        :py:class:`ColumnSelector
        <nimbusml.preprocessing.schema.ColumnSelector>`.

    .. index:: transform, schema

    Example:
       .. literalinclude:: /../nimbusml/examples/ColumnDuplicator.py
              :language: python
    """

    @trace
    def __init__(
            self,
            columns=None,
            **params):

        if columns:
            params['columns'] = columns
        BaseTransform.__init__(self, **params)
        core.__init__(
            self,
            **params)
        self._columns = columns

    def get_params(self, deep=False):
        """
        Get the parameters for this operator.
        """
        return core.get_params(self)
