<human>:  What is a good Python function to check if a directory is empty or has files with no files.
<bot>: Here is a Python function to check if a directory is empty or has files

import os

def is_dir_empty(dir_path):
    """
    check if directory is empty or has files with
    """
    if os.path.isdir(dir_path):
      for root, dirs, files in os.walk(dir_path):
        for f in files:
          if os.path.isfile(os.path.join(root, f)):
            return False
        return True
    return True

# Enter the directory path
dir_path = '/Users/rosey/Desktop/test'

# Calling the function
print((is_dir_empty(dir_path)))

#Example Output
# True

#Remember to inspect code for bugs.