code: def url_quote(
      obj: t.Any, charset: str = "utf-8", for_qs: bool = False
  ) -> str:
      """Quote a string for use in a URL using the given charset.
  
      :param obj: String or bytes to quote. Other types are converted to
          string then encoded to bytes using the given charset.
      :param charset: Encode text to bytes using this charset.
      :param for_qs: Quote "/" and use "+" for spaces.
      """
      if not isinstance(obj, bytes):
          if not isinstance(obj, str):
              obj = str(obj)
  
          obj = obj.encode(charset)
  
      safe = b"" if for_qs else b"/"
      rv = quote_from_bytes(obj, safe)
  
      if for_qs:
          rv = rv.replace("%20", "+")
  
      return rv
  
imports: import enum
  import json
  import os
  import re
  import typing
  from collections import abc
  from collections import deque
  from random import choice
  from random import randrange
  from threading import Lock
  from types import CodeType
  from urllib.parse import quote_from_bytes
  import markupsafe
label_desc: Use image node_id 14 for calling a global function with example usage: url_quote(obj, charset, for_qs) and returns: rv