def METHOD_NAME(self, predicate):
    if predicate:
        file_handle = open("foo", encoding="utf8")
    else:
        file_handle = open(  # [consider-using-with]
            "bar", encoding="utf8"
        )
    file_handle = None
    return file_handle