Add docstring for scan_dir