import re


def load_uses(config_path):
    """Read the set of features that Pently is configured to use."""
    useRE = re.compile(r"PENTLY_USE_([a-zA-Z0-9_]+)\s*=\s*([0-9])+\s*(?:;.*)?")
    with open(config_path, "r") as infp:
        uses = [useRE.match(line.strip()) for line in infp]
    uses = [m.groups() for m in uses if m]
    return {name for name, value in uses if int(value)}