(ns, tf, log_details)
return tf
For convenience, perform operations on the input stream before passing
    along to other data processing code
For convenience, perform operations on the input stream before passing
    along to other data processing code
For convenience perform operations on the input stream before passing along to other data processing code
def pre_process_data(ns, tf, log_details):
    """
    For convenience, perform operations on the input stream before passing
    along to other data processing code
    """
    if ns.sample:
        log.info('sampling a percentage of input data without replacement',
                 extra=dict(sampling_pct=ns.sample, **log_details))
        tf = tf.sample(False, ns.sample, 0)
    if ns.mapjson:
        log.info('converting all elements in data stream to json')
        tf = tf.map(simplejson.loads)
    return tf
def pre_process_data ( ns , tf , log_details ) : if ns . sample : log . info ( 'sampling a percentage of input data without replacement' , extra = dict ( sampling_pct = ns . sample , * * log_details ) ) tf = tf . sample ( False , ns . sample , 0 ) if ns . mapjson : log . info ( 'converting all elements in data stream to json' ) tf = tf . map ( simplejson . loads ) return tf