<commit_before>from .voc_parser import VOCParser
from .data_utils import get_class_names
from .data_utils import merge_two_dictionaries


class DataManager(object):
    def __init__(self, dataset_name='VOC2007', split='train',
                 class_names='all', with_difficult_objects=False,
                 dataset_path='../datasets/VOCdevkit/'):

        self.dataset_name = dataset_name
        self.split = split
        self.with_difficult_objects = with_difficult_objects
        self.class_names = class_names
        if class_names == 'all':
            self.class_names = get_class_names(self.dataset_name)
        self.dataset_path = dataset_path
        self.images_path = None
        self.arg_to_class = None

    def load_data(self):
        if self.dataset_name == 'VOC2007':
            ground_truth_data = self._load_VOC(self.dataset_name, self.split)
        if self.dataset_name == 'VOC2012':
            ground_truth_data = self._load_VOC(self.dataset_name, self.split)
        if isinstance(self.dataset_name, list):
            if not isinstance(self.split, list):
                raise Exception("'split' should also be a list")
            if set(self.dataset_name).issubset(['VOC2007', 'VOC2012']):
                data_0 = self._load_VOC(self.dataset_name[0], self.split[0])<commit_msg>Changed default data flag for difficult_objects to True<commit_after>from .voc_parser import VOCParser
from .data_utils import get_class_names
from .data_utils import merge_two_dictionaries


class DataManager(object):
    def __init__(self, dataset_name='VOC2007', split='train',
                 class_names='all', with_difficult_objects=True,
                 dataset_path='../datasets/VOCdevkit/'):

        self.dataset_name = dataset_name
        self.split = split
        self.with_difficult_objects = with_difficult_objects
        self.class_names = class_names
        if class_names == 'all':
            self.class_names = get_class_names(self.dataset_name)
        self.dataset_path = dataset_path
        self.images_path = None
        self.arg_to_class = None

    def load_data(self):
        if self.dataset_name == 'VOC2007':
            ground_truth_data = self._load_VOC(self.dataset_name, self.split)
        if self.dataset_name == 'VOC2012':
            ground_truth_data = self._load_VOC(self.dataset_name, self.split)
        if isinstance(self.dataset_name, list):
            if not isinstance(self.split, list):
                raise Exception("'split' should also be a list")
            if set(self.dataset_name).issubset(['VOC2007', 'VOC2012']):
                data_0 = self._load_VOC(self.dataset_name[0], self.split[0])
{'fraction_non_alphanumeric': 0.09666541775946047, 'fraction_numerical': 0.017234919445485202, 'mean_word_length': 2.825214899713467, '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': '3194082', 'n_tokens_mistral': 832, 'n_tokens_neox': 781, 'n_words': 154}