def tag_ordinal(tag):
tag_count = <NUM_LIT:0><EOL>return len(tag.find_all_previous(tag.name)) + <NUM_LIT:1><EOL>
Given a beautiful soup tag, look at the tags of the same name that come before it
to get the tag ordinal. For example, if it is tag name fig
and two fig tags are before it, then it is the third fig (3)