code: def url_quote(url):
      """
      Encode a unicode URL to a safe byte string
      """
      # quote() works reliably only with (byte)strings in Python2,
      # hence we need to .encode('utf-8') first. To see by yourself,
      # try quote(u'\xff') in python2. Python3 converts the output
      # always to Unicode, hence we need the outer to_bytes() too.
      #
      # We mark colon as a safe character to keep simple ASCII urls
      # nice looking, e.g. "http://google.com"
      return to_bytes(quote(to_bytes(url), safe="/:"))
  
imports: import os
  import shutil
  import sys
  import tempfile
  import zlib
  import base64
  from functools import wraps
  from io import BytesIO
  from itertools import takewhile
  import re
  from metaflow.exception import MetaflowUnknownUser, MetaflowInternalError
  from typing import NamedTuple
label_desc: Use image node_id 4 for calling a global function with example usage: url_quote(url) and returns: to_bytes