def get_values(self, count):
        param_info = self._param_info
        module = param_info.spec.descriptor.module
        def get():
            values = []
            d = {}
            try:
                exec(self.function) in {}, d
            except Exception, e:
                return [module.default_value] * count
            def evaluate(i):
                try:
                    v = d['value'](i)
                    if v is None:
                        return module.default_value
                    return v
                except Exception, e:
                    debug.unexpected_exception(e)
                    return debug.format_exception(e)
            return [evaluate(i) for i in xrange(self.size)]
        result = get()
        
        if not all(module.validate(x) for x in result):
            show_warning('Failed Validation',
                         'One of the <i>%s</i>\'s user defined '
                         'functions has failed validation, '
                         'which usually means it generated a '
                         'value of a type different '
                         'than that specified by the '
                         'parameter. Parameter Exploration '
                         'aborted.' % param_info.spec.descriptor.name)
            return None
        return result
Prepare to replace the file's contents.
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/gui/modules/paramexplore.py/QUserFunctionEditor.get_values--crossover with--dataset/ETHPy150Open paylogic/pip-accel/pip_accel/utils.py/AtomicReplace.__enter__