code: def pretty_json(obj):
      
      if isinstance(obj, string_types):
          try:
              obj = json.loads(obj)
          except ValueError:
              raise ClientException("`obj` is not a json string")
      json_str = json.dumps(obj, sort_keys=True, indent=2)
      print(highlight(json_str, JsonLexer(), TerminalFormatter()))
docs: Print JSON with indentation and colours
      :param obj: the object to print - can be a dict or a string