code: def _truncate(val, truncate_to):
      string_val = str(val)
      if truncate_to and len(string_val) > truncate_to:
          return string_val[: max(truncate_to - 3, 0)] + "..."
      else:
          return string_val
  
imports: import deepdiff
  from google.protobuf import json_format
label_desc: Use image node_id 1 for calling a global function with example usage: _truncate(val, truncate_to) and returns: unknown, string_val