code: def _get_theme_css(self):
      css = {}
      dark_css = {}
  
      for attr, val in self.__dict__.items():
          if attr.startswith("_"):
              continue
          if val is None:
              if attr.endswith("_dark"):
                  dark_css[attr[:-5]] = None
                  continue
              else:
                  raise ValueError(
                      f"Cannot set '{attr}' to None - only dark mode variables can be None."
                  )
          val = str(val)
          pattern = r"(\*)([\w_]+)(\b)"
  
          def repl_func(match):
              full_match = match.group(0)
              if full_match.startswith("*") and full_match.endswith(
                  "_dark"
              ):
                  raise ValueError(
                      f"Cannot refer '{attr}' to '{val}' - dark variable references are automatically used for dark mode attributes, so do not use the _dark suffix in the value."
                  )
              if (
                  attr.endswith("_dark")
                  and full_match.startswith("*")
                  and attr[:-5] == full_match[1:]
              ):
                  raise ValueError(
                      f"Cannot refer '{attr}' to '{val}' - if dark and light mode values are the same, set dark mode version to None."
                  )
  
              word = match.group(2)
              word = word.replace("_", "-")
              return f"var(--{word})"
  
          val = re.sub(pattern, repl_func, val)
  
          attr = attr.replace("_", "-")
  
          if attr.endswith("-dark"):
              attr = attr[:-5]
              dark_css[attr] = val
          else:
              css[attr] = val
  
      for attr, val in css.items():
          if attr not in dark_css:
              dark_css[attr] = val
  
      css_code = (
          ":root {\n"
          + "\n".join(
              [f"  --{attr}: {val};" for attr, val in css.items()]
          )
          + "\n}"
      )
      dark_css_code = (
          ".dark {\n"
          + "\n".join(
              [f"  --{attr}: {val};" for attr, val in dark_css.items()]
          )
          + "\n}"
      )
  
      return f"{css_code}\n{dark_css_code}"
  
imports: from __future__ import annotations
  import json
  import re
  import tempfile
  import textwrap
  from pathlib import Path
  from typing import Iterable
  import huggingface_hub
  import semantic_version
  from gradio_client.documentation import document, set_documentation_group
  from huggingface_hub import CommitOperationAdd
  from gradio.themes.utils import colors, fonts, get_matching_version, get_theme_assets, sizes
  from gradio.themes.utils.readme_content import README_CONTENT
label_desc: Use image node_id 2 for calling the ThemeClass obj's underlying member method code with example usage: obj._get_theme_css() and returns: css_code, str, dark_css_code, str, word, str