def resize_avatar(self, img, base_width):
w_percent = (base_width / float(img.size[<NUM_LIT:0>]))<EOL>h_size = int((float(img.size[<NUM_LIT:1>]) * float(w_percent)))<EOL>img = img.resize((base_width, h_size), PIL.Image.ANTIALIAS)<EOL>return img<EOL>
Resize an avatar.

        :param img: The image that needs to be resize.
        :param base_width: The width of output image.