<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def accept_line(self, logevent):
 """Return True if the log line has the nominated yaxis field."""

        if self.regex_mode:
            return bool(re.search(self.field, logevent.line_str))
        else:
            return getattr(logevent, self.field) is not None