Returns:
            The value to assign to the variable.

        Note:
            Subclasses will implement the abstract method
            :meth:`_get_value_to_set`, which should return a new value to
            set, or return None to do nothing.
359064
def get_value_to_set(self):
        
        ret = self._get_value_to_set()
        if ret is not None and ret != self._last_value:
            if self.epoch_num != self._last_epoch_set:  # Print this message at most once every epoch
                if self._last_value is None:
                    logger.info("[HyperParamSetter] At global_step={}, {} is set to {:.6f}".format(
                        self.global_step, self.param.readable_name, ret))
                else:
                    logger.info("[HyperParamSetter] At global_step={}, {} changes from {:.6f} to {:.6f}".format(
                        self.global_step, self.param.readable_name, self._last_value, ret))
            self._last_epoch_set = self.epoch_num
            self._last_value = ret
        return ret
559411
def set(self, instance, value, **kw):  # noqa
        
        ref = []
        # The value is an UID
        if api.is_uid(value):
            ref.append(value)

        # The value is a dictionary, get the UIDs.
        if u.is_dict(value):
            ref = ref.append(value.get("uid"))

        # The value is already an object
        if api.is_at_content(value):
            ref.append(value)

        # The value is a list
        if u.is_list(value):
            for item in value:
                # uid
                if api.is_uid(item):
                    ref.append(item)
                # dict (catalog query)
                elif u.is_dict(item):
                    # If there is UID of objects, just use it.
                    uid = item.get('uid', None)
                    if uid:
                        ref.append(uid)

        # Handle non multi valued fields
        if not self.multi_valued:
            if len(ref) > 1:
                raise ValueError("Multiple values given for single valued "
                                 "field {}".format(repr(self.field)))
            else:
                ref = ref[0]

        return self._set(instance, ref, **kw)
982301
def _var(self):
        
        class Variables(object):
            def __getitem__(_self, name):
                return self.getVariable(name)

            def __setitem__(_self, name, value):
                self.getVariable(name).setValue(value)

            def __iter__(_self):
                return self.getVariables()

        return Variables()
1107766
def get_value_tuple(self):
        
        retval = tuple()
        for val in self.VALUES:
            retval += (getattr(self, val),)
        return retval
609404
def values(self):
        
        if not hasattr(self, VALUES_ATTR_NAME):
            setattr(self, VALUES_ATTR_NAME, {})
        return getattr(self, VALUES_ATTR_NAME)
989826
def value(self):
        
        # Does the variable name have tags to parse?
        if len(self._element):
            var = ''.join(map(str, self.trigger.agentml.parse_tags(self._element, self.trigger)))
        else:
            var = self._element.text or attribute(self._element, 'name')

        # Is there a default value defined?
        default = attribute(self._element, 'default')

        try:
            self._log.debug('Retrieving {type} variable {var}'.format(type=self.type, var=var))
            if self.type == 'user':
                return self.trigger.user.get_var(var)
            else:
                return self.trigger.agentml.get_var(var)
        except VarNotDefinedError:
            # Do we have a default value?
            if default:
                self._log.info('{type} variable {var} not set, returning default: {default}'
                               .format(type=self.type.capitalize(), var=var, default=default))

            self._log.info('{type} variable {var} not set and no default value has been specified'
                           .format(type=self.type.capitalize(), var=var))
            return ''
921522
def get_value(self, index=None):
        

        if self.value is None:
            return self.default
        if index is not None:
            if self.value[index] is None:
                return self.default
            else:
                value = self.value[index]
        else:
            value = self.value

        return value
896416
def setValue(self, value):
        
        if isinstance(value, Text):
            self.value = value
        else:
            self.value = Text(value)
        return self
136639
def get_value_from_set(self, key):
        
        #TODO: This should be done locally. 
        # We do not really need to call centralised server if the set is already
        # reserved as the data there is immutable during execution
        key = key.lower()
        if self._remotelib:
            while True:
                value = self._remotelib.run_keyword('get_value_from_set',
                                                    [key, self._my_id], {})
                if value:
                    return value
                time.sleep(0.1)
                logger.debug('waiting for a value')
        else:
            return _PabotLib.get_value_from_set(self, key, self._my_id)
292624
def get_value(self, instance):
        
        return instance.values.get(self.alias, self.default)
1155126
def generic_var(self, key, value=None):
        
        return self._get_or_set('{0}{1}'.format(self._GENERIC_VAR_KEY_PREFIX, key), value)
214385
def bound_variable(self):
        
        class BoundVariable:
            def __init__(self, variable):
                self.__variable = variable
                self.changed_event = Event.Event()
                self.needs_rebind_event = Event.Event()
                def property_changed(key):
                    if key == "value":
                        self.changed_event.fire()
                self.__variable_property_changed_listener = variable.property_changed_event.listen(property_changed)
            @property
            def value(self):
                return self.__variable.value
            def close(self):
                self.__variable_property_changed_listener.close()
                self.__variable_property_changed_listener = None

        return BoundVariable(self)
216212
def GetValue(self):
    '''
    
    '''
    self.AssertInitialization('Choice')
    if self._widget.GetValue() == self._DEFAULT_VALUE:
      return None
    return ' '.join(
      [self._action.option_strings[0] if self._action.option_strings else '',  # get the verbose copy if available
       self._widget.GetValue()])
742975
def value(self):
        
        try:
            if isinstance(self.__value, Expression):
                return self.__value.value
            return self.__value
        except AttributeError:
            return 0
489817
def assign_to(self, value):
        
        if value == None or len(self) == 0:
            return

        RecursiveObjectWriter.copy_properties(value, self)
303298
def updateCurrentValue(self, value):
        
        try:
            method = getattr(self._targetObject, self._setter)
        except AttributeError:
            return
        
        try:
            method(unwrapVariant(value))
        except:
            return
329530
def value(self):
        
        if self._enum and issubclass(self._enum, Enumeration):
            name = self._enum.get_name(self._value)
            if name:
                return name
        return self._value