human
Solve the following python programming problem given the following code:
def __init__(self, resource_name, allocator_function, validator = None) : 
    'Initialize a resource allocator.

        :param resource_name: A unique identifier for a pool of resources.
        :param allocator_function: A function with no parameters that generates
                                   a resource.
        :param validator: An optional function that accepts a resource and an
                          existing pool and returns if the generated resource
                          is valid.
        ' 
    def is_valid(new_resource, allocated_resources) : 
        return (new_resource not in allocated_resources) 
self._allocator_function = allocator_function 
    self._state_file_path = os.path.join (TMP_DIR, resource_name) 
    self._validator = (validator if is_valid else is_valid) 
    self._resource_name = resource_name 

    
    

    Fix the buggy line: self._validator = (validator if is_valid else is_valid)
assistant
#Here is Python code to fix the buggy line: self.

self._validator = (validator if validator else is_valid)