<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate_output_nir(self, json_data=None, hr=True, show_name=False, colorize=True):
 """ The function for generating CLI output NIR network results. Args: json_data (:obj:`dict`):
 The data to process. Defaults to None. hr (:obj:`bool`):
 Enable human readable key translations. Defaults to True. show_name (:obj:`bool`):
 Show human readable name (default is to only show short). Defaults to False. colorize (:obj:`bool`):
 Colorize the console output with ANSI colors. Defaults to True. Returns: str: The generated output. """


        if json_data is None:
            json_data = {}

        output = generate_output(
            line='0',
            short=HR_WHOIS_NIR['nets']['_short'] if hr else 'nir_nets',
            name=HR_WHOIS_NIR['nets']['_name'] if (hr and show_name) else None,
            is_parent=True,
            colorize=colorize
        )

        count = 0
        if json_data['nir']:

            for net in json_data['nir']['nets']:

                if count > 0:

                    output += self.generate_output_newline(
                        line='1',
                        colorize=colorize
                    )

                count += 1

                output += generate_output(
                    line='1',
                    short=net['handle'],
                    is_parent=True,
                    colorize=colorize
                )

                for key, val in net.items():

                    if val and (isinstance(val, dict) or '\n' in val or
                                key == 'nameservers'):

                        output += generate_output(
                            line='2',
                            short=(
                                HR_WHOIS_NIR['nets'][key]['_short'] if (
                                    hr) else key
                            ),
                            name=HR_WHOIS_NIR['nets'][key]['_name'] if (
                                hr and show_name) else None,
                            is_parent=False if (val is None or
                                                len(val) == 0) else True,
                            value='None' if (val is None or
                                             len(val) == 0) else None,
                            colorize=colorize
                        )

                        if key == 'contacts':

                            for k, v in val.items():

                                if v:

                                    output += generate_output(
                                        line='3',
                                        is_parent=False if (
                                            len(v) == 0) else True,
                                        name=k,
                                        colorize=colorize
                                    )

                                    for contact_key, contact_val in v.items():

                                        if v is not None:

                                            tmp_out = '{0}{1}{2}'.format(
                                                contact_key,
                                                ': ',
                                                contact_val
                                            )

                                            output += generate_output(
                                                line='4',
                                                value=tmp_out,
                                                colorize=colorize
                                            )
                        elif key == 'nameservers':

                            for v in val:
                                output += generate_output(
                                    line='3',
                                    value=v,
                                    colorize=colorize
                                )
                        else:

                            for v in val.split('\n'):
                                output += generate_output(
                                    line='3',
                                    value=v,
                                    colorize=colorize
                                )

                    else:

                        output += generate_output(
                            line='2',
                            short=(
                                HR_WHOIS_NIR['nets'][key]['_short'] if (
                                    hr) else key
                            ),
                            name=HR_WHOIS_NIR['nets'][key]['_name'] if (
                                hr and show_name) else None,
                            value=val,
                            colorize=colorize
                        )

        else:

            output += 'None'

        return output