code: def _calc_order(self, a, b, out):
      if out is not None:
          return out.order
  
      if self._order in "A":
          if (
              a.order == TensorOrder.C_ORDER
              or b.order == TensorOrder.C_ORDER
          ):
              return TensorOrder.C_ORDER
          else:
              return TensorOrder.F_ORDER
      elif self._order in "CK":
          return TensorOrder.C_ORDER
      else:
          return TensorOrder.F_ORDER
  
imports: import itertools
  import numpy
  from ...None import opcodes
  from ...serialization.serializables import KeyField, StringField
  from ...utils import has_unknown_shape
  from ..core import Tensor, TensorOrder
  from ..utils import broadcast_shape, check_out_param, unify_chunks, check_order
  from ..array_utils import device, as_same_device, is_sparse_module
  from ..operands import TensorOperand, TensorOperandMixin
  from ..arithmetic.utils import chunk_tree_add
  from ..datasource import tensor
label_desc: Use image node_id 7 for calling the TensorMatmul obj's underlying member method code with example usage: obj._calc_order(a, b, out) and returns: out, TensorOrder, TensorOrder, TensorOrder, TensorOrder