code: def is_undirected(matrix):
      
      if isspmatrix(matrix):
          return sparse_allclose(matrix, matrix.transpose())
      
      return np.allclose(matrix, matrix.T)
docs: Determine if the matrix reprensents a directed graph
  
      :param matrix: The matrix to tested
      :returns: boolean