code: def qr(
      x: Union[(None, mx.ndarray.NDArray)],
      /,
      *,
      mode: str = "reduced",
      out: Optional[
          Tuple[
              (
                  Union[(None, mx.ndarray.NDArray)],
                  Union[(None, mx.ndarray.NDArray)],
              )
          ]
      ] = None,
  ) -> Tuple[
      (
          Union[(None, mx.ndarray.NDArray)],
          Union[(None, mx.ndarray.NDArray)],
      )
  ]:
      res = namedtuple("qr", ["Q", "R"])
      q, r = mx.np.linalg.qr(x, mode=mode)
      return res(q, r)
  
imports: import mxnet
  from typing import Union, Optional, Tuple, Literal, List, Sequence
  from collections import namedtuple
  from ivy import inf
  from ivy.utils.exceptions import IvyNotImplementedException
label_desc: Use image node_id 17 for calling a global function with example usage: qr() and returns: res