code: def duplication_matrix(n):
      """
      Create duplication matrix D_n which satisfies vec(S) = D_n vech(S) for
      symmetric matrix S
  
      Returns
      -------
      D_n : ndarray
      """
      n = int_like(n, "n")
      tmp = np.eye(n * (n + 1) // 2)
      return np.array([unvech(x).ravel() for x in tmp]).T
  
imports: from __future__ import annotations
  from statsmodels.compat.python import Literal, lrange
  import warnings
  import numpy
  import pandas
  from pandas import DataFrame
  from pandas.tseries import offsets
  from pandas.tseries.frequencies import to_offset
  from statsmodels.tools.data import _is_recarray, _is_using_pandas
  from statsmodels.tools.sm_exceptions import ValueWarning
  from statsmodels.tools.typing import NDArray
  from statsmodels.tools.validation import array_like, bool_like, int_like, string_like
label_desc: Use image node_id 13 for calling a global function with example usage: duplication_matrix(n) and returns: np