def do_get_metadata(parser, token):
bits = list(token.split_contents())<EOL>tag_name = bits[<NUM_LIT:0>]<EOL>bits = bits[<NUM_LIT:1>:]<EOL>metadata_name = None<EOL>args = { '<STR_LIT>': None, '<STR_LIT>': None, '<STR_LIT>': None, '<STR_LIT>': None }<EOL>if len(bits) % <NUM_LIT:2>:<EOL><INDENT>metadata_name = bits[<NUM_LIT:0>]<EOL>bits = bits[<NUM_LIT:1>:]<EOL><DEDENT>while len(bits):<EOL><INDENT>if len(bits) < <NUM_LIT:2> or bits[<NUM_LIT:0>] not in args:<EOL><INDENT>raise template.TemplateSyntaxError("<STR_LIT>" % tag_name)<EOL><DEDENT>key, value, bits = bits[<NUM_LIT:0>], bits[<NUM_LIT:1>], bits[<NUM_LIT:2>:]<EOL>args[key] = value<EOL><DEDENT>return MetadataNode(metadata_name, <EOL>variable_name = args['<STR_LIT>'], <EOL>target = args['<STR_LIT>'], <EOL>site = args['<STR_LIT>'], <EOL>language = args['<STR_LIT>'])<EOL>
Retrieve an object which can produce (and format) metadata.

    {% get_metadata [for my_path] [in my_language] [on my_site] [as my_variable] %}

    or if you have multiple metadata classes:

    {% get_metadata MyClass [for my_path] [in my_language] [on my_site] [as my_variable] %}