parameters: (self, pil, alpha=True)
return_statement: return image
docstring: Converts a PIL image into a :class:`Image`.
  
          :param `pil`: a PIL image;
          :param `alpha`: ``True`` if the image contains alpha transparency, ``False``
           otherwise.
docstring_summary: Converts a PIL image into a :class:`Image`.
docstring_tokens: Converts a PIL image into a : class : Image .
function: def ConvertPILToWX(self, pil, alpha=True):
          """
          Converts a PIL image into a :class:`Image`.
  
          :param `pil`: a PIL image;
          :param `alpha`: ``True`` if the image contains alpha transparency, ``False``
           otherwise.
          """
  
          if alpha:
              image = apply(wx.EmptyImage, pil.size)
              image.SetData(pil.convert("RGB").tostring())
              image.SetAlphaData(pil.convert("RGBA").tostring()[3::4])
          else:
              image = wx.EmptyImage(pil.size[0], pil.size[1])
              new_image = pil.convert('RGB')
              data = new_image.tostring()
              image.SetData(data)
  
          return image
function_tokens: def ConvertPILToWX ( self , pil , alpha = True ) : if alpha : image = apply ( wx . EmptyImage , pil . size ) image . SetData ( pil . convert ( "RGB" ) . tostring ( ) ) image . SetAlphaData ( pil . convert ( "RGBA" ) . tostring ( ) [ 3 : : 4 ] ) else : image = wx . EmptyImage ( pil . size [ 0 ] , pil . size [ 1 ] ) new_image = pil . convert ( 'RGB' ) data = new_image . tostring ( ) image . SetData ( data ) return image