code: def _get_symmetry(a):
      m, n = a.shape
      if m != n:
          return MMFile.SYMMETRY_GENERAL
      issymm = True
      isskew = True
      isherm = a.dtype.char in "FD"
  
      # sparse input
      if isspmatrix(a):
          # check if number of nonzero entries of lower and upper triangle
          # matrix are equal
          a = a.tocoo()
          (row, col) = a.nonzero()
          if (row < col).sum() != (row > col).sum():
              return MMFile.SYMMETRY_GENERAL
  
          # define iterator over symmetric pair entries
          a = a.todok()
  
          def symm_iterator():
              for (i, j), aij in a.items():
                  if i > j:
                      aji = a[j, i]
                      yield (aij, aji, False)
                  elif i == j:
                      yield (aij, aij, True)
  
      # non-sparse input
      else:
          # define iterator over symmetric pair entries
          def symm_iterator():
              for j in range(n):
                  for i in range(j, n):
                      aij, aji = a[i][j], a[j][i]
                      yield (aij, aji, i == j)
  
      # check for symmetry
      # yields aij, aji, is_diagonal
      for aij, aji, is_diagonal in symm_iterator():
          if isskew and is_diagonal and aij != 0:
              isskew = False
          else:
              if issymm and aij != aji:
                  issymm = False
              if isskew and aij != -aji:
                  isskew = False
              if isherm and aij != conj(aji):
                  isherm = False
          if not (issymm or isskew or isherm):
              break
  
      # return symmetry value
      if issymm:
          return MMFile.SYMMETRY_SYMMETRIC
      if isskew:
          return MMFile.SYMMETRY_SKEW_SYMMETRIC
      if isherm:
          return MMFile.SYMMETRY_HERMITIAN
      return MMFile.SYMMETRY_GENERAL
  
imports: import os
  import sys
  from numpy import asarray, real, imag, conj, zeros, ndarray, concatenate, ones, can_cast
  from scipy.sparse import coo_matrix, isspmatrix
label_desc: Use image node_id 15 for calling the MMFile obj's underlying member method code with example usage: obj._get_symmetry(a) and returns: MMFile, MMFile, MMFile, MMFile, MMFile, MMFile