docstr: ivy.Container instance method variant of ivy.diag. This method
  simply wraps the function, and so the docstring for ivy.diag also
  applies to this method with minimal changes.
  
  Examples
  --------
  >>> x = ivy.Container(a=[[0, 1, 2],
  >>>                      [3, 4, 5],
  >>>                      [6, 7, 8]])
  >>> ivy.diag(x, k=1)
  {
      a: ivy.array([1, 5])
  }
code: def diag(
      self: ivy.Container,
      /,
      *,
      k: Union[int, ivy.Container] = 0,
      key_chains: Optional[
          Union[List[str], Dict[str, str], ivy.Container]
      ] = None,
      to_apply: Union[bool, ivy.Container] = True,
      prune_unapplied: Union[bool, ivy.Container] = False,
      map_sequences: Union[bool, ivy.Container] = False,
      out: Optional[ivy.Container] = None,
  ) -> ivy.Container:
      """ivy.Container instance method variant of ivy.diag. This method
      simply wraps the function, and so the docstring for ivy.diag also
      applies to this method with minimal changes.
  
      Examples
      --------
      >>> x = ivy.Container(a=[[0, 1, 2],
      >>>                      [3, 4, 5],
      >>>                      [6, 7, 8]])
      >>> ivy.diag(x, k=1)
      {
          a: ivy.array([1, 5])
      }
      """
      return self._static_diag(
          self,
          k=k,
          key_chains=key_chains,
          to_apply=to_apply,
          prune_unapplied=prune_unapplied,
          map_sequences=map_sequences,
          out=out,
      )
  
imports: from typing import Union, Optional, Tuple, Literal, List, Dict, Sequence
  from ivy.data_classes.container.base import ContainerBase
  import ivy
label_desc: Use image node_id 12 for calling the _ContainerWithLinearAlgebra obj's underlying member method code with example usage: obj.diag() and returns: self