argscichat_allennlp/utility/json_utils.py
def dump_jsonl(data, output_path, append=False):
    """
    Write list of objects to a JSON lines file.
    """
    mode = 'a+' if append else 'w'
    with open(output_path, mode, encoding='utf-8') as f:
        for line in data:
            json_record = simplejson.dumps(line, ensure_ascii=False)
            f.write(json_record + '\n')
    print('Wrote {} records to {}'.format(len(data), output_path))

    Write list of objects to a JSON lines file.
    
Write list of objects to a JSON lines file.
Write list of objects to a JSON lines file .
def dump_jsonl(data, output_path, append=False):
    mode = 'a+' if append else 'w'
    with open(output_path, mode, encoding='utf-8') as f:
        for line in data:
            json_record = simplejson.dumps(line, ensure_ascii=False)
            f.write(json_record + '\n')
    print('Wrote {} records to {}'.format(len(data), output_path))
def dump_jsonl ( data , output_path , append = False ) : mode = 'a+' if append else 'w' with open ( output_path , mode , encoding = 'utf-8' ) as f : for line in data : json_record = simplejson . dumps ( line , ensure_ascii = False ) f . write ( json_record + '\n' ) print ( 'Wrote {} records to {}' . format ( len ( data ) , output_path ) )
Write list of objects to a JSON lines file.
Write list of objects to a JSON lines file .
"""
    Write list of objects to a JSON lines file.
    """
data
output_path
append