# ---------------------------------------------------------------------------
# file collection  (get_files_and_dirs) -- local-only rewrite
# ---------------------------------------------------------------------------
def get_files_and_dirs(*args, recursive=True, include_files=True, **kwargs):
    """
    Return ``(dirs, files)`` collected from one or more directories.

    Args:
        *args: directories to scan (defaults to the current working directory).
        recursive: walk subdirectories when True, otherwise only the top level.
        include_files: include files in the result when True.

    Remote/SSH options accepted by the original implementation are ignored.
    """
    directories = [a for a in args if a] or [os.getcwd()]
    dirs, files = [], []
    for directory in directories:
        if not os.path.isdir(directory):
            continue
        if recursive:
            for root, dnames, fnames in os.walk(directory):
                for d in dnames:
                    dirs.append(os.path.join(root, d))
                if include_files:
                    for fn in fnames:
                        files.append(os.path.join(root, fn))
        else:
            for name in os.listdir(directory):
                full = os.path.join(directory, name)
                if os.path.isdir(full):
                    dirs.append(full)
                elif include_files and os.path.isfile(full):
                    files.append(full)
    return dirs, files
