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)
  
      # non-sparse input
      else:
          # define iterator over symmetric pair entries
          def symm_iterator():
              for j in range(n):
                  for i in range(j + 1, n):
                      aij, aji = a[i][j], a[j][i]
                      yield (aij, aji)
  
      # check for symmetry
      for aij, aji in symm_iterator():
          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: from __future__ import division, print_function, absolute_import
  import os
  import sys
  from numpy import asarray, real, imag, conj, zeros, ndarray, concatenate, ones, can_cast
  from numpy.compat import asbytes, asstr
  from scipy._lib.six import string_types
  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