

def _parse_table_name(self, table_id):
    'Parse a table name in the form of appid_YYYY_MM or\n        YYYY_MM_appid and return a tuple consisting of YYYY-MM and the app id.\n\n        Parameters\n        ----------\n        table_id : str\n            The table id as listed by BigQuery\n\n        Returns\n        -------\n        tuple\n            (year/month, app id), or (None, None) if the table id cannot be\n            parsed.\n        '
    attributes = table_id.split('_')
    year_month = '-'.join(attributes[:2])
    app_id = '-'.join(attributes[2:])
    if ((year_month.count('-') == 1) and all([num.isdigit() for num in year_month.split('-')])):
        return (year_month, app_id)
    attributes = table_id.split('_')
    year_month = '-'.join(attributes[(- 2):])
    app_id = '-'.join(attributes[:(- 2)])
    if ((year_month.count('-') == 1) and all([num.isdigit() for num in table_id.split('-')])):
        return (year_month, app_id)
    return (None, None)

dataset/ETHPy150Open tylertreat/BigQuery-Python/bigquery/client.py BigQueryClient._parse_table_name/VarMisuse@158/337 `year_month`->`table_id`