def METHOD_NAME(self, x):
    if type(x) is bool:
        if x:
            self.encode_tlv(1, max_byte)
        else:
            self.encode_tlv(1, zero_byte)
    elif (type(x) is int) or (type(x) is int64):
        self.encode_tlv(2, util.deflate_long(x))
    elif type(x) is str:
        self.encode_tlv(4, x)
    elif (type(x) is list) or (type(x) is tuple):
        self.encode_tlv(0x30, self.encode_sequence(x))
    else:
        raise BERException(
            "Unknown type for encoding: {!r}".format(type(x))
        )