code: def _trace_symbanded(a, b, lower=0):
      """
      Compute the trace(ab) for two upper or banded real symmetric matrices
      stored either in either upper or lower form.
  
      INPUTS:
         a, b    -- two banded real symmetric matrices (either lower or upper)
         lower   -- if True, a and b are assumed to be the lower half
  
  
      OUTPUTS: trace
         trace   -- trace(ab)
      """
  
      if lower:
          t = _zero_triband(a * b, lower=1)
          return t[0].sum() + 2 * t[1:].sum()
      else:
          t = _zero_triband(a * b, lower=0)
          return t[-1].sum() + 2 * t[:-1].sum()
  
imports: import numpy
  import numpy.linalg
  from scipy.linalg import solveh_banded
  from scipy.optimize import golden
  from models import _hbspline
  import warnings
label_desc: Use image node_id 5 for calling a global function with example usage: _trace_symbanded(a, b, lower) and returns: unknown, unknown