def media(soup):
media = []<EOL>media_tags = raw_parser.media(soup)<EOL>position = <NUM_LIT:1><EOL>for tag in media_tags:<EOL><INDENT>media_item = {}<EOL>copy_attribute(tag.attrs, '<STR_LIT>', media_item)<EOL>copy_attribute(tag.attrs, '<STR_LIT>', media_item)<EOL>copy_attribute(tag.attrs, '<STR_LIT>', media_item, '<STR_LIT>')<EOL>copy_attribute(tag.attrs, '<STR_LIT>', media_item)<EOL>nodenames = ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]<EOL>details = tag_details(tag, nodenames)<EOL>copy_attribute(details, '<STR_LIT>', media_item)<EOL>copy_attribute(details, '<STR_LIT:type>', media_item)<EOL>copy_attribute(details, '<STR_LIT>', media_item)<EOL>parent_tag = first_parent(tag, nodenames)<EOL>if parent_tag:<EOL><INDENT>acting_parent_tag = component_acting_parent_tag(parent_tag, tag)<EOL>if acting_parent_tag:<EOL><INDENT>details = tag_details(acting_parent_tag, nodenames)<EOL>copy_attribute(details, '<STR_LIT:type>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL><DEDENT>p_parent_tag = first_parent(parent_tag, nodenames)<EOL>if p_parent_tag:<EOL><INDENT>acting_p_parent_tag = component_acting_parent_tag(p_parent_tag, parent_tag)<EOL>if acting_p_parent_tag:<EOL><INDENT>details = tag_details(acting_p_parent_tag, nodenames)<EOL>copy_attribute(details, '<STR_LIT:type>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL><DEDENT>p_p_parent_tag = first_parent(p_parent_tag, nodenames)<EOL>if p_p_parent_tag:<EOL><INDENT>acting_p_p_parent_tag = component_acting_parent_tag(p_p_parent_tag, p_parent_tag)<EOL>if acting_p_p_parent_tag:<EOL><INDENT>details = tag_details(acting_p_p_parent_tag, nodenames)<EOL>copy_attribute(details, '<STR_LIT:type>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL>copy_attribute(details, '<STR_LIT>', media_item, '<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT><DEDENT>media_item['<STR_LIT>'] = position<EOL>media_item['<STR_LIT>'] = tag_ordinal(tag)<EOL>media.append(media_item)<EOL>position += <NUM_LIT:1><EOL><DEDENT>return media<EOL>
All media tags and some associated data about the related component doi
and the parent of that doi (not always present)