human
Solve the following python programming problem given the following code:
def filter_models(request, models, exclude) : 
    '
    Returns (model, perm,) for all models that match models/exclude patterns
    and are visible by current user.
    ' 
    items = get_avail_models (request) 
    included = [] 
    def full_name(model) : 
        return ('%s.%s' % (model.__module__, model.__name__)) 
if (len (models) == 0) : 
        included = items 
else : 
        for pattern in models : 
            wildcard_models = [] 
            for item in items : 
                (model, perms) = item 
                model_str = full_name (model) 
                if (model_str == pattern) : 
                    included.append (item) 
else : 
                    if (fnmatch (model_str, pattern) and (request not in wildcard_models)) : 
                        wildcard_models.append (item) 
if wildcard_models : 
                wildcard_models.sort (key = (lambda x : x [0]._meta.verbose_name_plural)) 
                included += wildcard_models 
result = included [:] 
    for pattern in exclude : 
        for item in included : 
            (model, perms) = item 
            if fnmatch (full_name (model), pattern) : 
                try : 
                    result.remove (item) 
except ValueError : 
                    pass 
return result 

    
    

    Fix the buggy line: if (fnmatch (model_str, pattern) and (request not in wildcard_models)) :
assistant
#Here is Python program to fix the buggy line: if (fnmatch (model_str, pattern) and (request not in wildcard_models)) :
.

if (fnmatch (model_str, pattern) and (item not in wildcard_models)) :