def tag_supplementary_material_sibling_ordinal(tag):
if hasattr(tag, '<STR_LIT:name>') and tag.name != '<STR_LIT>':<EOL><INDENT>return None<EOL><DEDENT>nodenames = ['<STR_LIT>','<STR_LIT>','<STR_LIT>']<EOL>first_parent_tag = first_parent(tag, nodenames)<EOL>sibling_ordinal = <NUM_LIT:1><EOL>if first_parent_tag:<EOL><INDENT>for supp_tag in first_parent_tag.find_all(tag.name):<EOL><INDENT>if tag == supp_tag:<EOL><INDENT>break<EOL><DEDENT>if supp_asset(supp_tag) == supp_asset(tag):<EOL><INDENT>sibling_ordinal += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for prev_tag in tag.find_all_previous(tag.name):<EOL><INDENT>if not first_parent(prev_tag, nodenames):<EOL><INDENT>if supp_asset(prev_tag) == supp_asset(tag):<EOL><INDENT>sibling_ordinal += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT><DEDENT>return sibling_ordinal<EOL>
Strategy is to count the previous supplementary-material tags
having the same asset value to get its sibling ordinal.
The result is its position inside any parent tag that
are the same asset type