<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def do_json_cat(self, params):
 """ \x1b[1mNAME\x1b[0m json_cat - Pretty prints a znode's JSON \x1b[1mSYNOPSIS\x1b[0m json_cat <path> [recursive] \x1b[1mOPTIONS\x1b[0m * recursive: recurse to all children (default: false) \x1b[1mEXAMPLES\x1b[0m > json_cat /configs/clusters { "dc0": { "network": "10.2.0.0/16", }, } > json_cat /configs true /configs/clusters: { "dc0": { "network": "10.2.0.0/16", }, } /configs/dns_servers: [ "10.2.0.1", "10.3.0.1" ] """

        def json_output(path, print_path):
            value, _ = self._zk.get(path)

            if value is not None:
                try:
                    value = json.dumps(json.loads(value), indent=4)
                except ValueError:
                    pass

            if print_path:
                self.show_output("%s:\n%s", os.path.basename(path), value)
            else:
                self.show_output(value)

        if not params.recursive:
            json_output(params.path, False)
        else:
            for cpath, _ in self._zk.tree(params.path, 0, full_path=True):
                json_output(cpath, True)