code: def physical_shape_3d_from_topology_proto_4d(mesh_shape):
      """Convert a 4d shape that we get from TPU estimator to a 3d shape.
  
      Args:
        mesh_shape: a list of length 4
      Returns:
        a list of length 3
      """
      if len(mesh_shape) != 4:
          raise ValueError("Expected a 4d shape [x, y, z, core]")
      return (
          [mesh_shape[0] * mesh_shape[1], mesh_shape[2], mesh_shape[3]]
          if FLAGS.fold_xy
          else [
              mesh_shape[1] * mesh_shape[2],
              mesh_shape[0],
              mesh_shape[3],
          ]
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import os
  import gin
  from mesh_tensorflow import ops_with_redefined_builtins
  from mesh_tensorflow import tpu_variables
  from mesh_tensorflow import utils
  from six.moves import xrange
  import tensorflow.compat.v1
  from tensorflow.python.tpu.ops import tpu_ops
label_desc: Use image node_id 4 for calling a global function with example usage: physical_shape_3d_from_topology_proto_4d(mesh_shape) and returns: unknown