code: def get_pytorch_callbacks(args):
      if args.tensorboard:
          from bigdl.orca.learn.pytorch.callbacks.tensorboard import (
              TensorBoardCallback,
          )
  
          return [
              TensorBoardCallback(
                  log_dir=os.path.join(args.model_dir, "logs"),
                  freq=1000,
              )
          ]
      else:
          return []
  
file_path: BigDL/python/orca/tutorial/NCF/utils.py
imports: import os
  import argparse
  import json
  import tempfile
  from bigdl.dllib.utils.file_utils import is_local_path
  from bigdl.orca.data.file import put_local_file_to_remote, get_remote_file_to_local
  from bigdl.orca import init_orca_context, stop_orca_context, OrcaContext
label_desc: Use image node_id 4 for calling a global function with example usage: get_pytorch_callbacks(args) and returns: list, list