import Image, cStringIO
def response(context, flow):
    if flow.response.headers["content-type"] == ["image/png"]:
        s = cStringIO.StringIO(flow.response.content)
        img = Image.open(s).rotate(180)
        s2 = cStringIO.StringIO()
        img.save(s2, "png")
        flow.response.content = s2.getvalue()

import cStringIO
from PIL import Image

def response(context, flow):
    if flow.response.headers["content-type"] == ["image/png"]:
        s = cStringIO.StringIO(flow.response.content)
        img = Image.open(s).rotate(180)
        s2 = cStringIO.StringIO()
        img.save(s2, "png")
        flow.response.content = s2.getvalue()

Update another reference to PIL.
Update another reference to PIL.

- import Image, cStringIO
+ import cStringIO
+ from PIL import Image
+ 
  def response(context, flow):
      if flow.response.headers["content-type"] == ["image/png"]:
          s = cStringIO.StringIO(flow.response.content)
          img = Image.open(s).rotate(180)
          s2 = cStringIO.StringIO()
          img.save(s2, "png")
          flow.response.content = s2.getvalue()
  
Update another reference to PIL.
## Code Before:
import Image, cStringIO
def response(context, flow):
    if flow.response.headers["content-type"] == ["image/png"]:
        s = cStringIO.StringIO(flow.response.content)
        img = Image.open(s).rotate(180)
        s2 = cStringIO.StringIO()
        img.save(s2, "png")
        flow.response.content = s2.getvalue()

## Instruction:
Update another reference to PIL.
## Code After:
import cStringIO
from PIL import Image

def response(context, flow):
    if flow.response.headers["content-type"] == ["image/png"]:
        s = cStringIO.StringIO(flow.response.content)
        img = Image.open(s).rotate(180)
        s2 = cStringIO.StringIO()
        img.save(s2, "png")
        flow.response.content = s2.getvalue()
