code: def json_encode(value: Any) -> str:
      """JSON-encodes the given Python object.
  
      Equivalent to `json.dumps` with the additional guarantee that the output
      will never contain the character sequence ``</`` which can be problematic
      when JSON is embedded in an HTML ``<script>`` tag.
      """
      # JSON permits but does not require forward slashes to be escaped.
      # This is useful when json data is emitted in a <script> tag
      # in HTML, as it prevents </script> tags from prematurely terminating
      # the JavaScript.  Some json libraries do this escaping by default,
      # although python's standard library does not, so we do it here.
      # http://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped
      return json.dumps(value).replace("</", "<\\/")
  
imports: import html
  import json
  import re
  import urllib.parse
  from tornado.util import unicode_type
  import typing
  from typing import Union, Any, Optional, Dict, List, Callable
label_desc: Use image node_id 3 for calling a global function with example usage: json_encode(value) and returns: json