human
Write me a Python function to get the parent directory name.
assistant
Here is a Python function to get parent directory name

import os

def get_parent_dir(path):
    """Get parent directory name.
    """
    return os.path.dirname(path)

# Enter the path
path = "/home/rosey/Desktop/test.py"

# Calling the function
print((get_parent_dir(path)))

#Example Output
# /home/rosey/Desktop

#Remember to inspect code for bugs.