def configure(self, *choices):
        self.regex = "(%s)" % '|'.join(re.escape(x) for x in choices)

        if self.default is not None:
            dl = self.default.lower()
            for choice in choices:
                if choice.lower() == dl:
                    self.default = choice
                    break
            else:
                raise ValueError("Default value %r is not a valid "
                                 "choice." % self.default)
dataset/ETHPy150Open ecdavis/pants/pants/web/application.py/Any.configure/original