def get_stat_vars(configs):
    """  Gets all the stat vars and denominators in the given list of chart
    configs

    Args:
        configs: list of chart configs

    Returns:
        tuple consisting of
            set of all stat var dcids
            set of all denominator stat var dcids
    """
    stat_vars = set()
    denoms = set()
    for config in configs:
        if len(config.get('statsVars', [])) > 0:
            stat_vars.add(config['statsVars'][0])
        if 'relatedChart' in config and config['relatedChart'].get(
                'scale', False):
            denoms.add(config['relatedChart'].get('denominator',
                                                  'Count_Person'))
        if len(config.get('denominator', [])) > 0:
            denoms.add(config['denominator'][0])
    return stat_vars, denoms