<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_record(self, is_sslv2=None, is_tls13=None):
 """ Add a new TLS or SSLv2 or TLS 1.3 record to the packets buffered out. """

        if is_sslv2 is None and is_tls13 is None:
            v = (self.cur_session.tls_version or
                 self.cur_session.advertised_tls_version)
            if v in [0x0200, 0x0002]:
                is_sslv2 = True
            elif v >= 0x0304:
                is_tls13 = True
        if is_sslv2:
            self.buffer_out.append(SSLv2(tls_session=self.cur_session))
        elif is_tls13:
            self.buffer_out.append(TLS13(tls_session=self.cur_session))
        else:
            self.buffer_out.append(TLS(tls_session=self.cur_session))