code: def _can_encode_icon(icon: str) -> bool:
      """Helper function to check whether an icon can be encoded."""
      try:
          icon.encode(sys.stdout.encoding)
          return True
      except UnicodeEncodeError:
          return False
  
imports: import pathlib
  import re
  import shutil
  import subprocess
  import sys
  import tarfile
  import urllib.request
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import Any, Dict, List, Optional
  import click
  from jinja2 import Environment, FileSystemLoader
  from rich import print
  from rich.panel import Panel
  from rich.status import Status
  from rich.text import Text
  from rich.tree import Tree
  import lightning.app
label_desc: Use image node_id 5 for calling a global function with example usage: _can_encode_icon(icon) and returns: True, False