'This method should only really be used by tests and migration scripts when necessary.
Returns the module store as requested by type.  The type can be a value from ModuleStoreEnum.Type.'

def _get_modulestore_by_type(self, modulestore_type):

    for store in self.modulestores:
        if (store.get_modulestore_type() == modulestore_type):
            return store
    return None
