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

__all__ = ["TakeFilter"]


from ....entrypoints.transforms_rowtakefilter import transforms_rowtakefilter
from ....utils.utils import trace
from ...base_pipeline_item import BasePipelineItem, NoOutputSignature


class TakeFilter(BasePipelineItem, NoOutputSignature):
    """

    Take N first rows of the dataset, allowing limiting input to a subset
    of rows.

    :param count: number of rows to keep from the beginning of the dataset.

    :param params: Additional arguments sent to compute engine.

    .. index:: transform, random

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

    @trace
    def __init__(
            self,
            count=9223372036854775807,
            **params):
        BasePipelineItem.__init__(
            self, type='transform', **params)

        self.count = count

    @property
    def _entrypoint(self):
        return transforms_rowtakefilter

    @trace
    def _get_node(self, **all_args):
        algo_args = dict(
            count=self.count)

        all_args.update(algo_args)
        return self._entrypoint(**all_args)
