<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def isVisible(self, field, mode="view", default="visible"):
 """Returns whether the field is visible in a given mode """

        if mode != "edit":
            return default

        # If this is a Secondary Analysis Request, this field is not editable
        if IAnalysisRequestSecondary.providedBy(self.context):
            return "invisible"

        return self.context.isOpen() and "visible" or "invisible"