<commit_before>"""This script provides a library for working with Asciidoc markup."""

##==============================================================#
## DEVELOPED 2014, REVISED 2014, <NAME>.                    #
##==============================================================#

##==============================================================#
## SECTION: Function Definitions                                #
##==============================================================#

def format_doc(title, body, date="", author=""):
    """Formats the document text as Asciidoc.

    :param title: (str) Title of the document.
    :param body: (str) Body of the document.
    :param date: (str) Date stamp for the document.
    :param author: (str) Author of the document.
    """
    if not title:
        title = "Untitled"
    doc = "%s\n" % title
    doc += "".join(["=" for i in title])
    doc += "\n"
    if date:
        doc += ":date: %s\n" % date
    if author:
        doc += ":author: %s\n" % author
    doc += "\n"
    doc += body
    return doc

##==============================================================#
## SECTION: Main Body                                           #
##==============================================================#

if __name__ == '__main__':
    print format_doc("", "some test here\nmore text", author="jeff")<commit_msg>Changed order of author and date tags.<commit_after>"""This script provides a library for working with Asciidoc markup."""

##==============================================================#
## DEVELOPED 2014, REVISED 2014, <NAME>.                    #
##==============================================================#

##==============================================================#
## SECTION: Function Definitions                                #
##==============================================================#

def format_doc(title, body, date="", author=""):
    """Formats the document text as Asciidoc.

    :param title: (str) Title of the document.
    :param body: (str) Body of the document.
    :param date: (str) Date stamp for the document.
    :param author: (str) Author of the document.
    """
    if not title:
        title = "Untitled"
    doc = "%s\n" % title
    doc += "".join(["=" for i in title])
    doc += "\n"
    if author:
        doc += ":author: %s\n" % author
    if date:
        doc += ":date: %s\n" % date
    doc += "\n"
    doc += body
    return doc

##==============================================================#
## SECTION: Main Body                                           #
##==============================================================#

if __name__ == '__main__':
    print format_doc("Hello world!", "some test here\nmore text")
{'fraction_non_alphanumeric': 0.38209606986899564, 'fraction_numerical': 0.005822416302765648, 'mean_word_length': 3.1276276276276276, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '566483', 'n_tokens_mistral': 707, 'n_tokens_neox': 644, 'n_words': 215}