

def list_dir(root_dir, dirs_only=False, include_special=False):
    '\n    List directory.\n    :param root_dir: string: directory to list\n    :param dirs_only: boolean\n    :param include_special: boolean\n    :return: list\n    '
    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(path, name)
            if ((not include_special) and name.startswith('.')):
                continue
            if (dirs_only and (not os.path.isdir(path))):
                continue
            res.append(name)
    return res

dataset/ETHPy150Open j-bennet/wharfee/wharfee/helpers.py list_dir/VarMisuse@122/216 `root_dir`->`path`