code: def unvech(v):
      # quadratic formula, correct fp error
      rows = 0.5 * (-1 + np.sqrt(1 + 8 * len(v)))
      rows = int(np.round(rows))
  
      result = np.zeros((rows, rows))
      result[np.triu_indices(rows)] = v
      result = result + result.T
  
      # divide diagonal elements by 2
      result[np.diag_indices(rows)] /= 2
  
      return result
  
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 12 for calling a global function with example usage: unvech(v) and returns: result