def find_assign(data, varname):
    ASSIGN_RE = re.compile(BASE_ASSIGN_PATTERN.format(varname))

    if len(ASSIGN_RE.findall(data)) > 1:
        raise PluginError('Found multiple {}-strings.'.format(varname))

    if len(ASSIGN_RE.findall(data)) < 1:
        raise PluginError('No version assignment ("{}") found.'
                          .format(varname))

    return ASSIGN_RE.search(data).group(2)
Finds a substring that looks like an assignment.
dataset/ETHPy150Open mbr/unleash/unleash/plugins/utils_assign.py/find_assign