<commit_before>#!/usr/bin/env python
"""
Abstract: Calculate categorized gramox data and plot it.

Author: <NAME>

Date: 02/09/2016
"""

import sys
import argparse
from collections import defaultdict
importerrors = []
try:
    import biom
except ImportError:
    importerrors.append("biom")
try:
    import numpy as np
except ImportError:
    importerrors.append("numpy")
try:
    import pandas as pd
except ImportError:
    importerrors.append("pandas")
try:
    import matplotlib.pyplot as plt
except ImportError:
    importerrors.append("matplotlib")
try:
    import seaborn as sns
except ImportError:
    importerrors.append("seaborn")
try:
    from phylotoast import otu_calc as oc, biom_calc as bc
except ImportError:
    importerrors.append("phylotoast")
if len(importerrors) > 0:
    for err in importerrors:
        print "Please install missing module: {}".format(err)
    sys.exit()

<commit_msg>Improved ImportError error handling in pct_gramox_abd.py.<commit_after>#!/usr/bin/env python
"""
Abstract: Calculate categorized gramox data and plot it.
Author: <NAME>
Date: 02/09/2016
"""

import sys
import argparse
from collections import defaultdict
importerrors = []
try:
    import biom
except ImportError as ie:
    importerrors.append(ie)
try:
    import numpy as np
except ImportError as ie:
    importerrors.append(ie)
try:
    import pandas as pd
except ImportError as ie:
    importerrors.append(ie)
try:
    import matplotlib.pyplot as plt
except ImportError as ie:
    importerrors.append(ie)
try:
    import seaborn as sns
except ImportError as ie:
    importerrors.append(ie)
try:
    from phylotoast import otu_calc as oc, biom_calc as bc
except ImportError as ie:
    importerrors.append(ie)
if len(importerrors) > 0:
    for err in importerrors:
        print "Import Error: {}".format(err)
    sys.exit()


{'fraction_non_alphanumeric': 0.0872885979268958, 'fraction_numerical': 0.009819967266775777, 'mean_word_length': 3.983695652173913, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2726104', 'n_tokens_mistral': 613, 'n_tokens_neox': 582, 'n_words': 191}