def METHOD_NAME(instances, pattern):
    inst = [key for key in instances.keys() if all([p in key for p in pattern])]
    assert len(inst) > 0, f'{pattern} not found in {instances.keys()}'
    assert len(inst) == 1, f'Collision: {inst}'
    return instances[inst[0]]