code: def is_worksheet_context():
      
      request = api.get_request()
      parents = request.get("PARENTS", [])
      portal_types_names = map(lambda p: getattr(p, "portal_type", None), parents)
      if "Worksheet" in portal_types_names:
          return True
  
      # Check if the worksheet is declared in request explicitly
      ws_uid = request.get("ws_uid", "")
      obj = api.get_object_by_uid(ws_uid, None)
      if IWorksheet.providedBy(obj):
          return True
  
      return False
docs: Returns whether the current context from the request is a Worksheet