<commit_before>import os
import numpy as np
from unittest import TestCase, skipUnless

try:
    import matplotlib
    if not os.environ.get('DISPLAY'):
        # Use non-interactive Agg backend
        matplotlib.use('Agg')
    from matplotlib import pyplot as plt
except ImportError:
    import platform
    if platform.python_implementation() == 'PyPy':
        havePlt = False
        # PyPy doesn't have a version of matplotlib. Make a fake class that
        # raises if used.

        class plt(object):
            def __getattr__(self, _):
                raise NotImplementedError(
                    'matplotlib is not supported under pypy')
    else:
        raise
else:
    havePlt = True

try:
    from unittest.mock import call, MagicMock, ANY
except ImportError:
    from mock import call, MagicMock, ANY

from Bio.SeqFeature import FeatureLocation, SeqFeature
from Bio.SeqRecord import SeqRecord

from dark.features import (Feature, FeatureList, _FeatureAdder,
                           ProteinFeatureAdder, NucleotideFeatureAdder)


class Test_Feature(TestCase):
    """
    Tests of the C{Feature} class.
    """

    def testNotSubfeatureByDefault(self):
        """
        A feature must not be a subfeature by default.
        """
        location = FeatureLocation(100, 200)<commit_msg>Fixed trivial matplotlib import warning in test_features.py<commit_after>import numpy as np
from unittest import TestCase, skipUnless

try:
    import matplotlib
except ImportError:
    import platform
    if platform.python_implementation() == 'PyPy':
        havePlt = False
        # PyPy doesn't have a version of matplotlib. Make a fake class that
        # raises if used.

        class plt(object):
            def __getattr__(self, _):
                raise NotImplementedError(
                    'matplotlib is not supported under pypy')
    else:
        raise
else:
    matplotlib.use('PDF')
    from matplotlib import pyplot as plt
    havePlt = True

try:
    from unittest.mock import call, MagicMock, ANY
except ImportError:
    from mock import call, MagicMock, ANY

from Bio.SeqFeature import FeatureLocation, SeqFeature
from Bio.SeqRecord import SeqRecord

from dark.features import (Feature, FeatureList, _FeatureAdder,
                           ProteinFeatureAdder, NucleotideFeatureAdder)


class Test_Feature(TestCase):
    """
    Tests of the C{Feature} class.
    """

    def testNotSubfeatureByDefault(self):
        """
        A feature must not be a subfeature by default.
        """
        location = FeatureLocation(100, 200)
{'fraction_non_alphanumeric': 0.0675990675990676, 'fraction_numerical': 0.004662004662004662, 'mean_word_length': 2.591352859135286, 'pattern_counts': {'":': 0, '<': 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': '6473222', 'n_tokens_mistral': 725, 'n_tokens_neox': 692, 'n_words': 240}