<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def initialize_service(service, operation, api_protocol):
 """create lib and test dirs if not exist """

    lib_dir = get_lib_dir(service)
    test_dir = get_test_dir(service)

    print_progress('Initializing service', service, 'green')

    client = boto3.client(service)
    service_class = client.__class__.__name__
    endpoint_prefix = client._service_model.endpoint_prefix

    tmpl_context = {
        'service': service,
        'service_class': service_class,
        'endpoint_prefix': endpoint_prefix,
        'api_protocol': api_protocol,
        'escaped_service': get_escaped_service(service)
    }

    # initialize service directory
    if os.path.exists(lib_dir):
        print_progress('skip creating', lib_dir, 'yellow')
    else:
        print_progress('creating', lib_dir, 'green')
        os.makedirs(lib_dir)

    tmpl_dir = os.path.join(TEMPLATE_DIR, 'lib')
    for tmpl_filename in os.listdir(tmpl_dir):
        render_template(
            tmpl_dir, tmpl_filename, tmpl_context, service
        )

    # initialize test directory
    if os.path.exists(test_dir):
        print_progress('skip creating', test_dir, 'yellow')
    else:
        print_progress('creating', test_dir, 'green')
        os.makedirs(test_dir)
    tmpl_dir = os.path.join(TEMPLATE_DIR, 'test')
    for tmpl_filename in os.listdir(tmpl_dir):
        alt_filename = 'test_{}.py'.format(get_escaped_service(service)) if tmpl_filename == 'test_service.py.j2' else None
        render_template(
            tmpl_dir, tmpl_filename, tmpl_context, service, alt_filename
        )

    # append mock to init files
    append_mock_to_init_py(service)
    append_mock_import_to_backends_py(service)
    append_mock_dict_to_backends_py(service)