def list_dir(root_dir, dirs_only=False, include_special=False):
    root_dir = '.' if not root_dir else root_dir
    res = []

    if '~' in root_dir:
        root_dir = os.path.expanduser(root_dir)

    if not os.path.exists(root_dir):
        root_dir, _ = os.path.split(root_dir)

    if os.path.exists(root_dir):
        for name in os.listdir(root_dir):
            path = os.path.join(root_dir, name)
            if not include_special and name.startswith('.'):
                continue
            if dirs_only and not os.path.isdir(path):
                continue
            res.append(name)
    return res
Called to indicate the size of the terminal.
dataset/ETHPy150Open j-bennet/wharfee/wharfee/helpers.py/list_dir--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/conch/insults/insults.py/ITerminalProtocol.terminalSize