def validate_integer(option, value):
    if isinstance(value, integer_types):
        return value
    elif isinstance(value, string_type):
        if not value.isdigit():
            raise ValueError("The value of %s must be "
                             "an integer" % (option,))
        return int(value)
    raise TypeError("Wrong type for %s, value must be an integer" % (option,))
Write the code given the node in the class tree, `node`,
dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/common.py/validate_integer--crossover with--dataset/ETHPy150Open enthought/mayavi/tvtk/special_gen.py/SpecialGenerator.generate_code