def METHOD_NAME(self, activated):
    """Check whether a set of features is valid.
    Returns None if it is not and the set of features including implied features if it is.
    """
    newset = activated.copy()
    # handle implications
    for feature, implied in self.implications:
        if feature in newset and implied not in newset:
            newset.add(implied)
    # handle requirements
    featurevars = dict()
    derived = list(map((lambda x_y_z: x_y_z[0]), self.derivations))
    allfeatures = self.features.union(derived, self.externals)
    for feature in allfeatures:
        featurevars[feature] = feature in newset
    for feature, expr, _ in self.requirements:
        if feature in newset:
            if not eval(expr, featurevars):
                return None
    return newset