def isshape(x):
 try:
  (M, N) = x
 except:
  return False
 else:
  if (isintlike(M) and isintlike(N)):
   if ((np.ndim(M) == 0) and (np.ndim(N) == 0)):
    return True
  return False

def isshape ( x ) : try : ( M , N ) = x except : return False else : if ( isintlike ( M ) and isintlike ( N ) ) : if ( ( np . ndim ( M ) == 0 ) and ( np . ndim ( N ) == 0 ) ) : return True return False
is x a valid 2-tuple of dimensions? .