title: Determine whether a matrix is identity matrix (numpy)
body: <p>What is the best way to determine whether a given matrix 'M' is 
  equal to identity? I.e. something like:</p>
  
  <pre><code>if numpy.identity(3) == M:
       ...
  </code></pre>