code: def debug_mode(header, data_object, debug=False, halt=False):
      
      if debug:
          print('\n  ' + str(header) + '\n')
          try:
              export_json_object(data_object)
          except Exception:
              print(data_object)
          if halt:
              sys.exit(0)
      return True
docs: debug output