code: def _get_shape(cls, kws, kw):
      if kw.get("shape") is not None:
          return kw.get("shape")
      elif kws is not None and len(kws) > 0:
          return kws[0].get("shape")
  
imports: import itertools
  from collections.abc import Iterable
  from contextlib import contextmanager
  import numpy
  from ...config import options
  from ...core import recursive_tile
  from ...serialization.serializables import FieldTypes, TupleField, Int32Field
  from ..core import TENSOR_TYPE, TENSOR_CHUNK_TYPE
  from ..utils import decide_chunk_sizes, gen_random_seeds, broadcast_shape
  from ..array_utils import array_module, device
  from ..operands import TensorOperand, TensorMapReduceOperand, TensorOperandMixin
  from ..datasource import tensor
  from ..base import broadcast_to
label_desc: Use image node_id 6 for calling the TensorRandomOperandMixin obj's underlying member method code with example usage: obj._get_shape(cls, kws, kw) and returns: kw, kws