code: def generate_test_cpp_sources(test_params, template):
      (
          cpp_args_construction_stmts,
          _,
      ) = compute_cpp_args_construction_stmts_and_forward_arg_symbols(
          test_params
      )
  
      test_cpp_sources = template.substitute(
          functional_variant_name=test_params.functional_variant_name,
          cpp_args_construction_stmts=";\n  ".join(
              cpp_args_construction_stmts
          ),
          cpp_function_call=test_params.cpp_function_call,
      )
      return test_cpp_sources
  
file_path: pytorch/test/cpp_api_parity/functional_impl_check.py
imports: import tempfile
  from string import Template
  import re
  import pprint
  import os
  import torch
  from cpp_api_parity.utils import TorchNNFunctionalTestParams, TORCH_NN_COMMON_TEST_HARNESS, compile_cpp_code_inline, set_python_tensors_requires_grad, move_python_tensors_to_device, add_test, compute_cpp_args_construction_stmts_and_forward_arg_symbols, serialize_arg_dict_as_script_module, compute_arg_dict, decorate_test_fn, compute_temp_file_path, generate_error_msg, is_torch_nn_functional_test, try_remove_folder
  from cpp_api_parity.sample_functional import SAMPLE_FUNCTIONAL_CPP_SOURCE
label_desc: Use image node_id 7 for calling a global function with example usage: generate_test_cpp_sources(test_params, template) and returns: test_cpp_sources