def __init__(self, size = 1000, discard_sample = False, method = 'first'):
        """Creates and initializes sample node

        :Parameters:
            * `size` - number of records to be sampled
            * `discard_sample` - flag whether the sample is discarded or included. By default `False` -
              sample is included.
            * `mode` - sampling mode - ``first`` (default) - get first N items, ``nth`` - get one in n, ``random``
              - get random number - ``percent`` - get random percent. Note: mode is not yet implemented.
            """
        super(SampleNode, self).__init__()
        self.size = size
        self.discard_sample = discard_sample
        self.method = method
        # random nodes need a stack to hold intermediate records
        if method == "random":
            self.stack = Stack(size)
        else:
            self.stack = None
        if method == "percent" and ((size>100) or (size<0)):
            raise ValueError, "Sample size must be between 0 and 100 with 'percent' method."
dataset/ETHPy150Open Stiivi/brewery/brewery/nodes/record_nodes.py/SampleNode.__init__/original