def METHOD_NAME(self):
    # Instantiate the ShareClient from a connection string
    from azure.storage.fileshare import ShareClient
    share = ShareClient.from_connection_string(self.connection_string, "directorysamples2")
    # Create the share
    share.create_share()
    try:
        # Get the directory client
        parent_dir = share.get_directory_client(directory_path="parentdir")
        # [START create_subdirectory]
        # Create the directory
        parent_dir.create_directory()
        # Create a subdirectory
        subdir = parent_dir.create_subdirectory("subdir")
        # [END create_subdirectory]
        # Upload a file to the parent directory
        with open(SOURCE_FILE, "rb") as source:
            parent_dir.upload_file(file_name="sample", data=source)
        # Upload a file to the subdirectory
        with open(SOURCE_FILE, "rb") as source:
            subdir.upload_file(file_name="sample", data=source)
        # [START lists_directory]
        # List the directories and files under the parent directory
        my_list = list(parent_dir.list_directories_and_files())
        print(my_list)
        # [END lists_directory]
        # You must delete the file in the subdirectory before deleting the subdirectory
        subdir.delete_file("sample")
        # [START delete_subdirectory]
        parent_dir.delete_subdirectory("subdir")
        # [END delete_subdirectory]
    finally:
        # Delete the share
        share.delete_share()