def directives(entrystream, type=None):
for directive in entry_type_filter(entrystream, tag.Directive):<EOL><INDENT>if not type or type == directive.type:<EOL><INDENT>yield directive<EOL><DEDENT><DEDENT>
Pull directives out of the specified entry stream.

:param entrystream: a stream of entries
:param type: retrieve only directives of the specified type; set to
             :code:`None` to retrieve all directives