parameters: (fname, size=(100, 100), aspect_ratio=False)
return_statement: return im
docstring: @type fname: C{string}
      @param: Full path to image file
      @type size: C{tuple}
      @param: Width and height of the thumbnail
  
      @rtype: C{Image}
      @return: Returns PIL Image object
function: def create_thumbnail(fname, size=(100, 100), aspect_ratio=False):
      """
  
      @type fname: C{string}
      @param: Full path to image file
      @type size: C{tuple}
      @param: Width and height of the thumbnail
  
      @rtype: C{Image}
      @return: Returns PIL Image object
      """
  
      im = Image.open(fname)
      width, height = im.size
  
      if width > height:
          delta = width - height
          left = int(delta / 2)
          upper = 0
          right = height + left
          lower = height
      else:
          delta = height - width
          left = 0
          upper = int(delta / 2)
          right = width
          lower = width + upper
  
      if not aspect_ratio:
          im = im.crop((left, upper, right, lower))
  
      im.thumbnail(size, Image.ANTIALIAS)
  
      return im
function_tokens: def create_thumbnail ( fname , size = ( 100 , 100 ) , aspect_ratio = False ) : im = Image . open ( fname ) width , height = im . size if width > height : delta = width - height left = int ( delta / 2 ) upper = 0 right = height + left lower = height else : delta = height - width left = 0 upper = int ( delta / 2 ) right = width lower = width + upper if not aspect_ratio : im = im . crop ( ( left , upper , right , lower ) ) im . thumbnail ( size , Image . ANTIALIAS ) return im