'Initialize an XMLModuleStore from data_dir
Args:
data_dir (str): path to data directory containing the course directories
default_class (str): dot-separated string defining the default descriptor
class to use if none is specified in entry_points
source_dirs or course_ids (list of str): If specified, the list of source_dirs or course_ids to load.
Otherwise, load all courses. Note, providing both'

def __init__(self, data_dir, default_class=None, source_dirs=None, course_ids=None, load_error_modules=True, i18n_service=None, fs_service=None, user_service=None, signal_handler=None, target_course_id=None, **kwargs):

    super(XMLModuleStore, self).__init__(**kwargs)
    self.data_dir = path(data_dir)
    self.modules = defaultdict(dict)
    self.courses = {}
    self.errored_courses = {}
    if (course_ids is not None):
        course_ids = [SlashSeparatedCourseKey.from_deprecated_string(course_id) for course_id in course_ids]
    self.load_error_modules = load_error_modules
    if (default_class is None):
        self.default_class = None
    else:
        (module_path, _, class_name) = default_class.rpartition('.')
        class_ = getattr(import_module(module_path), class_name)
        self.default_class = class_
    self.field_data = inheriting_field_data(kvs=DictKeyValueStore())
    self.i18n_service = i18n_service
    self.fs_service = fs_service
    self.user_service = user_service
    if (source_dirs is None):
        source_dirs = sorted([d for d in os.listdir(self.data_dir) if os.path.exists(((self.data_dir / d) / self.parent_xml))])
    for course_dir in source_dirs:
        self.try_load_course(course_dir, course_ids, target_course_id)
