code: def quote(
      identifier: str,
      is_html_string=HTML_STRING.match,
      is_valid_id=ID.match,
      dot_keywords=KEYWORDS,
      escape_unescaped_quotes=ESCAPE_UNESCAPED_QUOTES,
  ) -> str:
      r"""Return DOT identifier from string, quote if needed.
  
      >>> quote('')
      '""'
  
      >>> quote('spam')
      'spam'
  
      >>> quote('spam spam')
      '"spam spam"'
  
      >>> quote('-4.2')
      '-4.2'
  
      >>> quote('.42')
      '.42'
  
      >>> quote('<<b>spam</b>>')
      '<<b>spam</b>>'
  
      >>> quote(nohtml('<>'))
      '"<>"'
  
      >>> print(quote('"'))
      "\""
  
      >>> print(quote('\\"'))
      "\""
  
      >>> print(quote('\\\\"'))
      "\\\""
  
      >>> print(quote('\\\\\\"'))
      "\\\""
      """
      if is_html_string(identifier) and not isinstance(
          identifier, NoHtml
      ):
          pass
      elif (
          not is_valid_id(identifier)
          or identifier.lower() in dot_keywords
      ):
          return f'"{escape_unescaped_quotes(identifier)}"'
      return identifier
  
file_path: catboost/contrib/python/graphviz/py3/graphviz/lang.py
imports: import functools
  import re
  import typing
  from .None import tools
label_desc: Use image node_id 1 for calling a global function with example usage: quote(identifier, is_html_string, is_valid_id, dot_keywords, escape_unescaped_quotes) and returns: identifier, str, escape_unescaped_quotes, str