<human>:  Give me a Python function to get the parent directory name.
<bot>: Here is a Python function to get parent directory name

import os

def get_parent_directory(path):
  """ Returns the parent directory of the path.
  """
  return os.path.dirname(path)

# Enter the path
path = '/home/rosey/Desktop/test.txt'

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

#Example Output
# /home/rosey/Desktop

#Remember to inspect code for bugs.