def getMatrixTetragridMatrix(matrixTetragrid, prefix, xmlElement):
 matrixKey = (prefix + 'matrix')
 evaluatedDictionary = evaluate.getEvaluatedDictionary([matrixKey], xmlElement)
 if (len(evaluatedDictionary.keys()) < 1):
  return matrixTetragrid
 value = evaluatedDictionary[matrixKey]
 if ((value == None) or (value == 'None')):
  print 'Warning, value in getMatrixTetragridMatrix in matrix is None for matrixKey for dictionary:'
  print matrixKey
  print evaluatedDictionary
 else:
  matrixTetragrid = getIdentityMatrixTetragrid(matrixTetragrid)
  for (rowIndex, row) in enumerate(value):
   for (elementIndex, element) in enumerate(row):
    matrixTetragrid[rowIndex][elementIndex] = element
 euclidean.removeListFromDictionary(xmlElement.attributeDictionary, [matrixKey])
 return matrixTetragrid

def getMatrixTetragridMatrix ( matrixTetragrid , prefix , xmlElement ) : matrixKey = ( prefix + 'matrix' ) evaluatedDictionary = evaluate . getEvaluatedDictionary ( [ matrixKey ] , xmlElement ) if ( len ( evaluatedDictionary . keys ( ) ) < 1 ) : return matrixTetragrid value = evaluatedDictionary [ matrixKey ] if ( ( value == None ) or ( value == 'None' ) ) : print 'Warning, value in getMatrixTetragridMatrix in matrix is None for matrixKey for dictionary:' print matrixKey print evaluatedDictionary else : matrixTetragrid = getIdentityMatrixTetragrid ( matrixTetragrid ) for ( rowIndex , row ) in enumerate ( value ) : for ( elementIndex , element ) in enumerate ( row ) : matrixTetragrid [ rowIndex ] [ elementIndex ] = element euclidean . removeListFromDictionary ( xmlElement . attributeDictionary , [ matrixKey ] ) return matrixTetragrid
get the matrix tetragrid from the xmlelement matrix value .