def METHOD_NAME(self, predicate):
    if predicate:
        file_handle = open("foo", encoding="utf8")  # must not trigger
        with file_handle:
            result = file_handle.read()
    else:
        result = "shiny watermelon"
    return result