'Decide whether to use a model, based on the model name and the lists of
models to exclude and include.'

def use_model(self, model_name):

    if self.exclude_models:
        for model_pattern in self.exclude_models:
            model_pattern = ('^%s$' % model_pattern.replace('*', '.*'))
            if re.search(model_pattern, model_name):
                return False
    elif self.include_models:
        for model_pattern in self.include_models:
            model_pattern = ('^%s$' % model_pattern.replace('*', '.*'))
            if re.search(model_pattern, model_name):
                return True
    return (not self.include_models)
