def validate(self, obj, name, value):

        # pylint: disable=E1101
        if isinstance(value, UncertainDistribution):
            value = value.getvalue()

        # Support for complex step method. We can step this trait in the
        # complex direction while keeping the Range validator.
        is_complex_step = False
        if isinstance(value, complex):
            value_imag = value.imag
            value = value.real
            if value_imag != 0:
                is_complex_step = True

        try:
            new_val = self._validator.validate(obj, name, value)
        except Exception:
            self.error(obj, name, value)

        if is_complex_step:
            new_val += value_imag*1j

        #print name, new_val
        return new_val
Validates that a specified value is valid for this trait.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/datatypes/float.py/Float.validate