def __init__(self, resource_name, allocator_function, validator=None):
        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 validator else is_valid
        self._resource_name = resource_name
Initialize a resource allocator.
dataset/ETHPy150Open openstack/neutron/neutron/tests/common/exclusive_resources/resource_allocator.py/ResourceAllocator.__init__