def defer(self): # Return a deferred variable if we aren't on a node. if not self._in_alloc: return DeferredVariable(func.__name__, var_set='sched', sub_keys=sub_keys) else: return str(func(self))
def defer(self): """Return a deferred variable if we aren't on a node.""" if not self.sched.in_alloc: return DeferredVariable() else: value = func(self) norm_val = normalize_value(value) if norm_val is None: raise ValueError( "Invalid variable value returned by {}: {}.".format( func.__name__, value)) return norm_val
def defer(self): """Return a deferred variable if we aren't on a node.""" if not self.sched.in_alloc: return DeferredVariable() else: return str(func(self))