# Path: stagehand/toolbox/config.py
# def get_description(var):
#     """
#     Get the description for the given config variable or group.
#     """
#     if isinstance(var, (Group, Container)):
#         return var._desc
#     elif isinstance(var, VarProxy):
#         return var._item._desc
#     elif isinstance(var, Var):
#         return var._desc
#     else:
#         raise ValueError('Supplied config variable is not a config variable')


import os
import sys
import re
import codecs
import xml.sax
import xml.sax.saxutils
import asyncio
import importlib
from io import StringIO
from zipfile import ZipFile
from datetime import datetime
from .toolbox.config import get_description
    from .config import config
    from .config import config
    with ASCII equivalents.
    """
    if not u:
        return u
    # Double quotes
    u = u.replace('\u201c', '"').replace('\u201d', '"')
    # Single quotes
    u = u.replace('\u2018', "'").replace('\u2019', "'")
    # Endash
    u = u.replace('\u2014', '--')
    # Ellipses
    u = u.replace('\u2026', '...')
    return u


def remove_stop_words(s):
    """
    Removes (English) stop words from the given string.
    """
    stopwords = 'a', 'the'
    words = [word for word in s.split() if word.lower() not in stopwords]
    # Join remaining words and remove whitespace.
    return ' '.join(words)


def cfgdesc2html(item):
    """
    Given a config item, returns the description with paragraph breaks
    (double newline) converted to <br> for use in HTML.
    """

# Path: stagehand/toolbox/config.py
# def get_description(var):
#     """
#     Get the description for the given config variable or group.
#     """
#     if isinstance(var, (Group, Container)):
#         return var._desc
#     elif isinstance(var, VarProxy):
#         return var._item._desc
#     elif isinstance(var, Var):
#         return var._desc
#     else:
#         raise ValueError('Supplied config variable is not a config variable')


# Path: stagehand/utils.py
import os
import sys
import re
import codecs
import xml.sax
import xml.sax.saxutils
import asyncio
import importlib
from io import StringIO
from zipfile import ZipFile
from datetime import datetime
from .toolbox.config import get_description
    from .config import config
    from .config import config

    with ASCII equivalents.
    """
    if not u:
        return u
    # Double quotes
    u = u.replace('\u201c', '"').replace('\u201d', '"')
    # Single quotes
    u = u.replace('\u2018', "'").replace('\u2019', "'")
    # Endash
    u = u.replace('\u2014', '--')
    # Ellipses
    u = u.replace('\u2026', '...')
    return u


def remove_stop_words(s):
    """
    Removes (English) stop words from the given string.
    """
    stopwords = 'a', 'the'
    words = [word for word in s.split() if word.lower() not in stopwords]
    # Join remaining words and remove whitespace.
    return ' '.join(words)


def cfgdesc2html(item):
    """
    Given a config item, returns the description with paragraph breaks
    (double newline) converted to <br> for use in HTML.
    """

    desc = get_description(item)