<commit_before>import unittest

import numpy as np
from matplotlib import pyplot as plt

from roipoly import RoiPoly


class TestRoiPoly(unittest.TestCase):

    def setUp(self):
        roi1_properties = {
            'x': [1, 1, 3, 3],
            'y': [1, 3, 3, 1]
        }<commit_msg>update tests to use agg backend if no display is set<commit_after>import unittest
import os

import numpy as np
from matplotlib import pyplot as plt
import matplotlib

from roipoly import RoiPoly

if os.environ.get('DISPLAY', '') == '':
    print('No DISPLAY found. Using non-interactive "Agg" backend.')
    matplotlib.use('Agg')


class TestRoiPoly(unittest.TestCase):

    def setUp(self):
        roi1_properties = {
            'x': [1, 1, 3, 3],
            'y': [1, 3, 3, 1]
        }
{'fraction_non_alphanumeric': 0.11282051282051282, 'fraction_numerical': 0.023076923076923078, 'mean_word_length': 2.736842105263158, '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': '3882077', 'n_tokens_mistral': 278, 'n_tokens_neox': 262, 'n_words': 86}