human
Complete the below
def convert_json_to_yaml(json_str):

    ''''Convert AWS JSON template format to Heat YAML format.
    :param json_str: a string containing the AWS JSON template format.
    :returns: the equivalent string containing the Heat YAML format.'
    '''
 Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    tpl = jsonutils.loads(json_str, object_pairs_hook=collections.OrderedDict)
    def top_level_items(tpl):
        (yield ('HeatTemplateFormatVersion', '2012-12-12'))
        for (k, v) in six.iteritems(tpl):
            if (k != 'AWSTemplateFormatVersion'):
                (yield (k, v))
    return yaml.dump(collections.OrderedDict(top_level_items(tpl)), Dumper=yaml_dumper)