converts a DiscourseDocumentGraph into a Geoff file and
    writes it to the given file (or file path).

def write_geoff(discoursegraph, output_file):
    """
    converts a DiscourseDocumentGraph into a Geoff file and
    writes it to the given file (or file path).
    """
    if isinstance(output_file, str):
        with open(output_file, 'w') as outfile:
            outfile.write(convert_to_geoff(discoursegraph))
    else:  # output_file is a file object
        output_file.write(convert_to_geoff(discoursegraph))