parameters: (x)
docstring: Is x a valid 2-tuple of dimensions?
docstring_summary: Is x a valid 2-tuple of dimensions?
docstring_tokens: Is x a valid 2 - tuple of dimensions?
function: def isshape(x):
      """Is x a valid 2-tuple of dimensions?
      """
      try:
          # Assume it's a tuple of matrix dimensions (M, N)
          (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
function_tokens: def isshape ( x ) : try : # Assume it's a tuple of matrix dimensions (M, N) ( 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