<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cnpj(self, with_mask: bool = True) -> str: """Get a random CNPJ. :param with_mask: Use cnpj mask (###.###.###-##) :returns: Random cnpj. :Example: 77.732.230/0001-70 """

        def get_verifying_digit_cnpj(cnpj, peso):
            """Calculate the verifying digit for the CNPJ.

            :param cnpj: List of integers with the CNPJ.
            :param peso: Integer with the weight for the modulo 11 calculate.
            :returns: The verifying digit for the CNPJ.
            """
            soma = 0
            if peso == 5:
                peso_list = [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]
            elif peso == 6:
                peso_list = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]
            for i, _ in enumerate(cnpj):
                soma += peso_list[i] * cnpj[i]
            resto = soma % 11
            if resto < 2:
                return 0
            return 11 - resto

        cnpj_without_dv = [self.random.randint(0, 9) for _ in range(12)]

        first_dv = get_verifying_digit_cnpj(cnpj_without_dv, 5)
        cnpj_without_dv.append(first_dv)

        second_dv = get_verifying_digit_cnpj(cnpj_without_dv, 6)
        cnpj_without_dv.append(second_dv)

        cnpj = ''.join([str(i) for i in cnpj_without_dv])

        if with_mask:
            return '{}.{}.{}/{}-{}'.format(cnpj[:2], cnpj[2:5],
                                           cnpj[5:8], cnpj[8:12], cnpj[12:])
        return cnpj