code: def train_and_export_policy_and_model(
      algo_name, num_steps, model_dir, ckpt_dir
  ):
      cls = get_trainable_cls(algo_name)
      config = cls.get_default_config()
      # This Example is only for tf.
      config.framework("tf")
      # Set exporting native (DL-framework) model files to True.
      config.export_native_model_files = True
      config.env = "CartPole-v1"
      alg = config.build()
      for _ in range(num_steps):
          alg.train()
  
      # Export Policy checkpoint.
      alg.export_policy_checkpoint(ckpt_dir)
      # Export tensorflow keras Model for online serving
      alg.export_policy_model(model_dir)
  
file_path: ray/rllib/examples/export/cartpole_dqn_export.py
imports: import numpy
  import os
  import ray
  from ray.rllib.policy.policy import Policy
  from ray.rllib.utils.framework import try_import_tf
  from ray.tune.registry import get_trainable_cls
label_desc: Use image node_id 1 for calling a global function with example usage: train_and_export_policy_and_model(algo_name, num_steps, model_dir, ckpt_dir) without return types