code: def screenshot(self, filename=None):
          '''
          Take ios screenshot
          Args:
              - filename(string): optional
          Returns:
              PIL.Image object
          '''
          image = self.d.screenshot()
          if self.rotation:
              method = getattr(Image, 'ROTATE_{}'.format(self.rotation*90))
              image = image.transpose(method)
          if filename:
              image.save(filename)
          return imagf screenshot(self, filename=None):
          '''
          Take ios screenshot
          Args:
              - filename(string): optional
          Returns:
              PIL.Image object
          '''
          image = self.d.screenshot()
          if self.rotation:
              method = getattr(Image, 'ROTATE_{}'.format(self.rotation*90))
              image = image.transpose(method)
          if filename:
              image.save(filename)
          return image
docs: Take ios screenshot
          Args:
              - filename(string): optional
          Returns:
              PIL.Image object