code: def get_semantic_shape(arr_or_var, *, assumed_layout=_unspecified):
      if not isinstance(arr_or_var, chainer.Variable):
          # array
          shape = arr_or_var.shape
          if assumed_layout is not _unspecified:
              shape = _transpose_shape(shape, assumed_layout, None)
          return shape
  
      # variable
      if assumed_layout is not _unspecified:
          # TODO(niboshi): Raise exception
          assert arr_or_var.layout == assumed_layout
      return arr_or_var.shape
  
file_path: chainer/chainer/memory_layouts.py
imports: import chainer
  from chainer import function_node
  from chainer.utils import type_check
label_desc: Use image node_id 2 for calling a global function with example usage: get_semantic_shape(arr_or_var) and returns: arr_or_var, shape