def face(gray=False):
import bz2<EOL>import os<EOL>with open(os.path.join(os.path.dirname(__file__), '<STR_LIT>'), '<STR_LIT:rb>') as f:<EOL><INDENT>rawdata = f.read()<EOL><DEDENT>data = bz2.decompress(rawdata)<EOL>face = fromstring(data, dtype='<STR_LIT>')<EOL>face.shape = (<NUM_LIT>, <NUM_LIT>, <NUM_LIT:3>)<EOL>if gray is True:<EOL><INDENT>face = (<NUM_LIT> * face[:,:,<NUM_LIT:0>] + <NUM_LIT> * face[:,:,<NUM_LIT:1>] + <NUM_LIT> * face[:,:,<NUM_LIT:2>]).astype('<STR_LIT>')<EOL><DEDENT>return face<EOL>
Get a 1024 x 768, color image of a raccoon face.

raccoon-procyon-lotor.jpg at http://www.public-domain-image.com

Parameters
----------
gray : bool, optional
    If True then return color image, otherwise return an 8-bit gray-scale

Returns
-------
face : ndarray
    image of a racoon face

Examples
--------
>>> import scipy.misc
>>> face = scipy.misc.face()
>>> face.shape
(768, 1024, 3)
>>> face.max()
230
>>> face.dtype
dtype('uint8')

>>> import matplotlib.pyplot as plt
>>> plt.gray()
>>> plt.imshow(face)
>>> plt.show()