code: def _take_screenshot(self, screenshot=False, name_prefix='unknown'):
          
          if isinstance(screenshot, bool):
              if not screenshot:
                  return
              return self._save_screenshot(name_prefix=name_prefix)
          if isinstance(screenshot, Image.Image):
              return self._save_screenshot(screen=screenshot, name_prefix=name_prefix)
  
          raise TypeError("invalid type for func _take_screenshot: "+ type(screenshot))
docs: This is different from _save_screenshot.
          The return value maybe None or the screenshot path
  
          Args:
              screenshot: bool or PIL image