def write_pot_file(potfile, msgs):
    if os.path.exists(potfile):
        # Strip the header
        msgs = '\n'.join(dropwhile(len, msgs.split('\n')))
    else:
        msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8')
    with io.open(potfile, 'a', encoding='utf-8') as fp:
        fp.write(msgs)
Write the :param potfile: POT file with the :param msgs: contents,
dataset/ETHPy150Open django/django/django/core/management/commands/makemessages.py/write_pot_file