code: def from_tri_2_sym(tri, dim):
      """convert a upper triangular matrix in 1D format
         to 2D symmetric matrix
  
  
      Parameters
      ----------
  
      tri: 1D array
          Contains elements of upper triangular matrix
  
      dim : int
          The dimension of target matrix.
  
  
      Returns
      -------
  
      symm : 2D array
          Symmetric matrix in shape=[dim, dim]
      """
      symm = np.zeros((dim, dim))
      symm[np.triu_indices(dim)] = tri
      return symm
  
imports: import numpy
  import re
  import warnings
  import os.path
  import psutil
  from .fmrisim import generate_stimfunction, _double_gamma_hrf, convolve_hrf
  from scipy.fftpack import fft, ifft
  import logging
label_desc: Use image node_id 2 for calling a global function with example usage: from_tri_2_sym(tri, dim) and returns: symm