code: def _get_transpiled_data_if_required(
      frontend_fn,
      frontend_fw_fn,
      frontend,
      backend,
      fn_name,
      generate_frontend_arrays,
      args_for_test,
      kwargs_for_test,
      frontend_fw_args,
      frontend_fw_kwargs,
  ):
      iterations = 1
      # for backend transpilation
      with BackendHandler.update_backend(backend) as ivy_backend:
          if generate_frontend_arrays:
              args_for_test, kwargs_for_test = ivy.nested_map(
                  _frontend_array_to_ivy,
                  (args_for_test, kwargs_for_test),
                  include_derived={"tuple": True},
              )
          else:
              args_for_test, kwargs_for_test = ivy_backend.args_to_ivy(
                  *args_for_test, **kwargs_for_test
              )
      traced_fn = traced_if_required(
          backend,
          frontend_fn,
          test_trace=True,
          args=args_for_test,
          kwargs=kwargs_for_test,
      )
      # running inference to get runtime
      frontend_timings = []
      frontend_fw_timings = []
      for i in range(0, iterations):
          # timing the traced_fn
          start = time.time()
          traced_fn(*args_for_test, **kwargs_for_test)
          end = time.time()
          frontend_timings.append(end - start)
  
          # timing the frontend_fw_fn
          start = time.time()
          frontend_fw_fn(*frontend_fw_args, **frontend_fw_kwargs)
          end = time.time()
          frontend_fw_timings.append(end - start)
  
      # compile to get ivy nodes
      with BackendHandler.update_backend(backend) as ivy_backend:
          traced_fn_to_ivy = ivy_backend.trace_graph(
              frontend_fn,
              to="ivy",
              args=args_for_test,
              kwargs=kwargs_for_test,
          )
      frontend_time = np.mean(frontend_timings).item()
      frontend_fw_time = np.mean(frontend_fw_timings).item()
      backend_nodes = len(traced_fn._functions)
      ivy_nodes = len(traced_fn_to_ivy._functions)
  
      data = {
          "frontend": frontend,
          "frontend_func": fn_name,
          "args": str(args_for_test),
          "kwargs": str(kwargs_for_test),
          "time": frontend_time,
          "fw_time": frontend_fw_time,
          "nodes": backend_nodes,
          "ivy_nodes": ivy_nodes,
      }
  
      # creating json object and creating a file
      _create_transpile_report(data, backend, "report.json")
  
imports: import copy
  import time
  from typing import Union, List, Optional
  import numpy
  import types
  import importlib
  import inspect
  from collections import OrderedDict
  from .globals import mod_backend
  from .pipeline_helper import BackendHandler, BackendHandlerMode, get_frontend_config
  import ivy
  from ivy_tests.test_ivy.helpers.test_parameter_flags import FunctionTestFlags
  import ivy_tests.test_ivy.helpers.test_parameter_flags
  import ivy_tests.test_ivy.helpers.globals
  from ivy.functional.ivy.data_type import _get_function_list, _get_functions_from_string
  from ivy_tests.test_ivy.test_frontends import NativeClass
  from ivy_tests.test_ivy.helpers.structs import FrontendMethodData
  from ivy_tests.test_ivy.helpers.testing_helpers import _create_transpile_report
  from .assertions import value_test, assert_same_type, check_unsupported_dtype
label_desc: Use image node_id 31 for calling a global function with example usage: _get_transpiled_data_if_required(frontend_fn, frontend_fw_fn, frontend, backend, fn_name, generate_frontend_arrays, args_for_test, kwargs_for_test, frontend_fw_args, frontend_fw_kwargs) without return types