code: def generate(config_file):
      global _config
  
      with open(config_file, "r") as file:
          _config = json.load(file)
  
      global _target_backend
      _target_backend = _config["name"]
  
      backends_root = "ivy/functional/backends/"
      backend_reference_path = backends_root + _backend_reference
      backend_generation_path = backends_root + _target_backend
  
      _create_type_mapping(
          _config, f"{backend_reference_path}/__init__.py"
      )
      # Copy and generate backend tree
      _copy_tree(backend_reference_path, backend_generation_path)
  
      with open(
          os.path.join(backend_reference_path, "__init__.py")
      ) as ref_file:
          # Read source file from reference backend
          ref_str = ref_file.read()
  
      ref_tree = ast.parse(ref_str)
      try:
          tree_to_write = _parse_module(ref_tree, keep_private=True)
          params = {
              "valid_devices": f"({_config['valid_devices']},)",
              "invalid_devices": f"({_config['invalid_devices']},)",
              "backend": f'"{_config["name"]}"',
              "supports_gradients": _config[
                  "supports_gradients"
              ].__str__(),
              "native_inplace_support": _config[
                  "native_inplace_support"
              ].__str__(),
          }
          valids = [
              "valid_dtypes",
              "valid_numeric_dtypes",
              "valid_float_dtypes",
              "valid_complex_dtypes",
              "valid_int_dtypes",
              "valid_uint_dtypes",
          ]
          for key in valids:
              params[f"{key}_dict"] = {
                  "None": tuple(f"ivy.{x}" for x in _config[key])
              }.__str__()
              params[f"in{key}_dict"] = {
                  "None": tuple(f"ivy.{x}" for x in _config[f"in{key}"])
              }.__str__()
          InitFileTransformer(params).visit(tree_to_write)
      except Exception as e:
          print(
              "Failed to parse "
              f"{os.path.join(backend_generation_path, '__init__.py')}, {e}"
          )
  
      # Create target backend
      with open(
          os.path.join(backend_generation_path, "__init__.py"), "w"
      ) as generated_file:
          generated_file.write(astunparse.unparse(tree_to_write))
  
      subprocess.run(["black", "-q", backend_generation_path])
      subprocess.run(
          [
              "autoflake",
              "-i",
              "--remove-all-unused-imports",
              "--ignore-init-module-imports",
              "--quiet",
              "-r",
              backend_generation_path,
          ]
      )
  
imports: import astunparse
  import ast
  import json
  import sys
  import subprocess
  import os
  import logging
  from shared import BackendNativeObject
label_desc: Use image node_id 4 for calling a global function with example usage: generate(config_file) without return types