Reformat the Basic.rewrite docstring

Better indentation and additional explanatory doctests.
Added functionality to Q.real and Q.imaginary and fixed issue:2324

>>> ask(Q.real(x**3),Q.imaginary(x)&Q.real(2))
False
>>> ask(Q.real(x**2),Q.imaginary(x)&Q.real(2))
True
>>> ask(Q.imaginary(x**3),Q.imaginary(x)&Q.real(2))
True
>>> ask(Q.imaginary(x**2),Q.imaginary(x)&Q.real(2))
False
>>> ask(Q.real(x**y),Q.imaginary(x)&Q.imaginary(y))
True
>>> ask(Q.real(x**3),Q.imaginary(x)&Q.real(3))
False
>>> ask(Q.imaginary(x**(3*y)),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary((x*2)**(3*y)),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary(x**y),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary(I**y),True and Q.imaginary(y))
False

probably a fix to the issue:2324
Added functionality to Q.real and Q.imaginary and fixed issue:2324

>>> ask(Q.real(x**3),Q.imaginary(x)&Q.real(2))
False
>>> ask(Q.real(x**2),Q.imaginary(x)&Q.real(2))
True
>>> ask(Q.imaginary(x**3),Q.imaginary(x)&Q.real(2))
True
>>> ask(Q.imaginary(x**2),Q.imaginary(x)&Q.real(2))
False
>>> ask(Q.real(x**y),Q.imaginary(x)&Q.imaginary(y))
True
>>> ask(Q.real(x**3),Q.imaginary(x)&Q.real(3))
False
>>> ask(Q.imaginary(x**(3*y)),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary((x*2)**(3*y)),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary(x**y),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary(I**y),True and Q.imaginary(y))
False

probably a fix to the issue:2324
Added comparions to tuples

>>> Tuple(1,3)>=Tuple(-10,30)
True
>>> Tuple(1,3)<=Tuple(-10,30)
False
>>>
Added functionality to Q.real and Q.imaginary and fixed issue:2324

>>> ask(Q.real(x**3),Q.imaginary(x)&Q.real(2))
False
>>> ask(Q.real(x**2),Q.imaginary(x)&Q.real(2))
True
>>> ask(Q.imaginary(x**3),Q.imaginary(x)&Q.real(2))
True
>>> ask(Q.imaginary(x**2),Q.imaginary(x)&Q.real(2))
False
>>> ask(Q.real(x**y),Q.imaginary(x)&Q.imaginary(y))
True
>>> ask(Q.real(x**3),Q.imaginary(x)&Q.real(3))
False
>>> ask(Q.imaginary(x**(3*y)),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary((x*2)**(3*y)),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary(x**y),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary(I**y),True and Q.imaginary(y))
False

probably a fix to the issue:2324
Added functionality to Q.real and Q.imaginary and fixed issue:2324

>>> ask(Q.real(x**3),Q.imaginary(x)&Q.real(2))
False
>>> ask(Q.real(x**2),Q.imaginary(x)&Q.real(2))
True
>>> ask(Q.imaginary(x**3),Q.imaginary(x)&Q.real(2))
True
>>> ask(Q.imaginary(x**2),Q.imaginary(x)&Q.real(2))
False
>>> ask(Q.real(x**y),Q.imaginary(x)&Q.imaginary(y))
True
>>> ask(Q.real(x**3),Q.imaginary(x)&Q.real(3))
False
>>> ask(Q.imaginary(x**(3*y)),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary((x*2)**(3*y)),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary(x**y),Q.imaginary(x)&Q.imaginary(y))
False
>>> ask(Q.imaginary(I**y),True and Q.imaginary(y))
False

probably a fix to the issue:2324
updated
Updated tests
Corrected spelling
Merge branch 'master' of git://github.com/sympy/sympy into sachin1

Conflicts:
	sympy/assumptions/handlers/sets.py
	sympy/assumptions/tests/test_query.py
Make Matrix sympifiable.

* sympify(<Matrix>) now returns an ImmutableMatrix
* for consistency with general sympy conventions, this forces
  <MutableMatrix> + <ImmutableMatrix> -> ImmutableMatrix.
* Some hacking of arithmetic operator dispatch is required to
  still get scalar * MutableMatrix -> MutableMatrix
Added test cases and removed unnecessary code
3532: Pow.is_real fix for base = -1
3531: sympify IndexedBase and Idx args
Merge pull request #1 from smichr/sachin1

3532: Pow.is_real fix for base = -1
evalf after as_real_imag; handle _prec=1 in is_comparable

Expressions may give a clear 0 for the imaginary part if they
are allowed to simplify through as_real_imag but if evalf is
done first then a _prec=1 result is obtained:

>>> I**(I+2)).n(2)
-0.21 + 0.e-8*I
>>> _.as_real_imag()[1]
0.e-8
>>> _._prec
1

That "1" means there was no precision computed for the imaginary
part.

>>> (I**(I+2)).as_real_imag()
(-I**I, 0)

Now it's clear to see that the imaginary part is zero.

In is_comparable, the answer was being based on n if there was
an i part that had no precision. It seems better to just return
False in that case. This particular method should return T or F
so if it's not clear that the imaginary part is 0 we'll say that
the expression is not comparable.
watch for Add in exponent for is_real

If there is a rational coefficient then it might make
sense to split the power up, making b**(c + r) = b**c*b**r
use map(sympify, it) if unpacking

When unpacking the iterable like a, b = sympyify((a, b)) it is
better to use map, otherwise a superfluous Tuple is created.
Merge pull request #2 from smichr/sachin1

Sachin1
Merge pull request #1156 from sachin004/sachin1

added functionality to Q.real and Q.imaginary and fixed issue:2324