<commit_before>#!/usr/bin/env python
"""
Stub function and module used as a setuptools entry point.
Based on augur's __main__.py and setup.py
"""

from __future__ import print_function, division, absolute_import
import sys
from treetime import version, make_parser
import matplotlib

matplotlib.use("AGG")

# Entry point for setuptools-installed script and bin/augur dev wrapper.
def main():
    parser = make_parser()

    params = parser.parse_args()
    return_code = params.func(params)

    sys.exit(return_code)


# Run when called as `python -m treetime`, here for good measure.
if __name__ == "__main__":
    main()
<commit_msg>feat: move matplotlib import after arg parse to reduce time to failure<commit_after>#!/usr/bin/env python
"""
Stub function and module used as a setuptools entry point.
Based on augur's __main__.py and setup.py
"""

from __future__ import print_function, division, absolute_import
import sys
from treetime import version, make_parser


# Entry point for setuptools-installed script and bin/augur dev wrapper.
def main():
    parser = make_parser()

    params = parser.parse_args()

    # Import matplotlib after parsing cli args
    # to speed up time till error if there's an arg error
    import matplotlib
    matplotlib.use("AGG")

    return_code = params.func(params)

    sys.exit(return_code)


# Run when called as `python -m treetime`, here for good measure.
if __name__ == "__main__":
    main()

{'fraction_non_alphanumeric': 0.08587257617728532, 'fraction_numerical': 0.0, 'mean_word_length': 4.106007067137809, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '879495', 'n_tokens_mistral': 442, 'n_tokens_neox': 428, 'n_words': 162}