def _get_stats_table(html_page, div, footer=False):
stats_html = html_page(div)<EOL>try:<EOL><INDENT>stats_table = pq(_remove_html_comment_tags(stats_html))<EOL><DEDENT>except (ParserError, XMLSyntaxError):<EOL><INDENT>return None<EOL><DEDENT>if footer:<EOL><INDENT>teams_list = stats_table('<STR_LIT>').items()<EOL><DEDENT>else:<EOL><INDENT>teams_list = stats_table('<STR_LIT>').items()<EOL><DEDENT>return teams_list<EOL>
Returns a generator of all rows in a requested table.

When given a PyQuery HTML object and a requested div, this function creates
a generator where every item is a PyQuery object pertaining to every row in
the table. Generally, each row will contain multiple stats for a given
player or team.

Parameters
----------
html_page : PyQuery object
    A PyQuery object which contains the requested HTML page contents.
div : string
    The requested tag type and id string in the format "<tag>#<id name>"
    which aligns to the desired table in the passed HTML page. For example,
    "div#all_stats_table" or "table#conference_standings".
footer : boolean (optional)
    Optionally return the table footer rows instead of the table header.

Returns
-------
generator
    A generator of all row items in a given table.