human
Solve the following python programming problem given the following code:
def ListProperties(self, pattern = None, _type = None, **kwargs) : 
    '
        Returns a list of property names from the PropertyList with optional filters
        @param pattern: list properties with specific names with optional wildcard *. Default is all.
        @param _type: get properties of specific types. See self.kPropertyTypes.keys() for names
        
        Optional parameters True/False for testing from FBProperty:
        IsAnimatable
        IsInternal
        IsList
        IsMaxClamp
        IsMinClamp
        IsObjectList
        IsReadOnly
        IsReferenceProperty
        IsUserProperty
        ' 
    def passesOptionalTest(x) : 
        for (arg, challenge) in kwargs.iteritems () : 
            func = getattr (x, arg, None) 
            if (func and (func () != challenge)) : 
                return False 
return True 
if pattern : 
        if ('*' in pattern) : 
            pattern = pattern.replace ('*', '.*') 
            passesNameTest = (lambda x : re.match (pattern, x.GetName ())) 
else : 
            passesNameTest = (lambda x : (pattern == x.GetName ())) 
else : 
        passesNameTest = (lambda x : True) 
if _type : 
        propertyType = self.kPropertyTypes [p] [0] 
        passesTypeTest = (lambda x : (x.GetPropertyType () == propertyType)) 
else : 
        passesTypeTest = (lambda x : True) 
properties = [] 
    for p in self.component.PropertyList : 
        if (p is None) : 
            continue 
if (not passesOptionalTest (p)) : 
            continue 
if (not passesTypeTest (p)) : 
            continue 
if passesNameTest (p) : 
            properties.append (p) 
return properties 

    
    

    Fix the buggy line: propertyType = self.kPropertyTypes [p] [0]
assistant
#Here is Python code to fix the buggy line: propertyType = self.

propertyType = self.kPropertyTypes [_type] [0]