<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _dump_list(list_data, jsonify, stream=sys.stdout):
    '''
    Dump list to output stream, optionally encoded as JSON.

    Parameters
    ----------
    list_data : list
    jsonify : bool
    stream : file-like
    '''
    if not jsonify and list_data:
        print >> stream, '\n'.join(list_data)
    else:
        print >> stream, json.dumps(list_data)