Set or retrieve an attribute ``name`` from thread ``ct``.

    If ``ct`` is not given used the current thread. If ``value``
    is None, it will get the value otherwise it will set the value.
920
def thread_data(name, value=NOTHING, ct=None):
    '''
    '''
    ct = ct or current_thread()
    if is_mainthread(ct):
        loc = process_data()
    elif not hasattr(ct, '_pulsar_local'):
        ct._pulsar_local = loc = {}
    else:
        loc = ct._pulsar_local
    if value is not NOTHING:
        if name in loc:
            if loc[name] is not value:
                raise RuntimeError(
                    '%s is already available on this thread' % name)
        else:
            loc[name] = value
    return loc.get(name)
304867
def getattr(self, name, context=None):
        
        if name in self.instance_attrs:
            return self.instance_attrs[name]
        if name in self.special_attributes:
            return [self.special_attributes.lookup(name)]
        raise exceptions.AttributeInferenceError(target=self, attribute=name)
177425
def set_attr_value(self, key, attr, value):
        
        idx = self._keys[key]
        self._attrs[attr][idx].set(value)
1362310
def _setable_get_(name, self):
        ""

        raise AttributeError(
            "'{typename}' object has no attribute '{name}'".format(
                typename=type(self).__name__,
                name=name
            )
        )
1289897
def view_setattr():
    

    def view_setattr(value, context, **_params):
        setattr(context["view"], context["key"], value)
        return _attr()

    return view_setattr
1371043
def _set_int(self, commands, name):
        
        if name in commands:
            try:
                value = int(commands[name])
                setattr(self, name, value)
            except ValueError:
                pass
152689
def assign(A, attr, B, lock=False):
    '''
    '''
    class NoAttr(object): pass

    context = threading.Lock if lock else null_context
    with context():
        if not hasattr(A, attr):
            tmp = NoAttr
        else:
            tmp = getattr(A, attr)

        setattr(A, attr, B)

        try:
            yield B

        finally:
            if tmp is NoAttr:
                delattr(A, attr)
            else:
                setattr(A, attr, tmp)
1198666
def _imm_getattribute(self, name):
    '''
    
    '''
    if _imm_is_init(self):
        return _imm_init_getattribute(self, name)
    else:
        dd = object.__getattribute__(self, '__dict__')
        if name == '__dict__': return dd
        curval = dd.get(name, dd)
        if curval is not dd: return dd[name]
        values = _imm_value_data(self)
        if name not in values:
            return object.__getattribute__(self, name)
        (args, memfn, _) = values[name]
        value = memfn(*[getattr(self, arg) for arg in args])
        dd[name] = value
        # if this is a const, it may have checks to run
        if name in _imm_const_data(self):
            # #TODO
            # Note that there's a race condition that eventually needs to be handled here:
            # If dd[name] is set then a check fails, there may have been something that read the
            # improper value in the meantime
            try:
                _imm_check(self, [name])
            except:
                del dd[name]
                raise
        # if those pass, then we're fine
        return value
650518
def __makeattr(self, name):
        """"""
        # print "makeattr", self.__name__, name
        target = None
        if '__onfirstaccess__' in self.__map__:
            target = self.__map__.pop('__onfirstaccess__')
            importobj(*target)()
        try:
            modpath, attrname = self.__map__[name]
        except KeyError:
            if target is not None and name != '__onfirstaccess__':
                # retry, onfirstaccess might have set attrs
                return getattr(self, name)
            raise AttributeError(name)
        else:
            result = importobj(modpath, attrname)
            setattr(self, name, result)
            try:
                del self.__map__[name]
            except KeyError:
                pass  # in a recursive-import situation a double-del can happen
            return result
1287371
def set_name(self,name=None):
        
        if name:
            self.name = name[:254]
        else:
            self.name = self.extract_name()[:254]

        self.save()

        return self.name
897142
def name(self, value):
        

        if value is not None:
            assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format("name", value)
        self.__name = value
1269972
def set_attribute(self, name, type_, value):
        
        if not self._linked:
            raise RuntimeError('Cannot set attribute when program has no code')
        # Get handle for the attribute, first try cache
        handle = self._handles.get(name, -1)
        if handle < 0:
            if name in self._known_invalid:
                return
            handle = gl.glGetAttribLocation(self._handle, name)
            self._unset_variables.discard(name)  # Mark as set
            self._handles[name] = handle  # Store in cache
            if handle < 0:
                self._known_invalid.add(name)
                if value[0] != 0 and value[2] > 0:  # VBO with offset
                    return  # Probably an unused element in a structured VBO
                logger.info('Variable %s is not an active attribute' % name)
                return
        # Program needs to be active in order to set uniforms
        self.activate()
        # Triage depending on VBO or tuple data
        if value[0] == 0:
            # Look up function call
            funcname = self.ATYPEMAP[type_]
            func = getattr(gl, funcname)
            # Set data
            self._attributes[name] = 0, handle, func, value[1:]
        else:
            # Get meta data
            vbo_id, stride, offset = value
            size, gtype, dtype = self.ATYPEINFO[type_]
            # Get associated VBO
            vbo = self._parser.get_object(vbo_id)
            if vbo == JUST_DELETED:
                return
            if vbo is None:
                raise RuntimeError('Could not find VBO with id %i' % vbo_id)
            # Set data
            func = gl.glVertexAttribPointer
            args = size, gtype, gl.GL_FALSE, stride, offset
            self._attributes[name] = vbo.handle, handle, func, args
860903
def get_attribute(cls, soup, key, unknown=None):
        
        if key in soup.attrs:
            return soup.get(key)
        return unknown
618876
@Override
    public void setAttribute(String name, Object value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Setting attribute: " + name);
        }
        this.attributes.put(name, value);
    }
257505
function (name, value) {
            /*  sanity check scenario  */
            if (typeof name === "undefined")
                throw _cs.exception("access", "no attribute name given");
            var obj = this.obj();
            if (obj === null)
                throw _cs.exception("access", "still no object attached");
            if (typeof obj[name] === "undefined")
                throw _cs.exception("access", "invalid attribute \"" + name + "\"");

            /*  access the attribute  */
            var value_old = obj[name];
            if (typeof value !== "undefined")
                obj[name] = value;
            return value_old;
        }
769183
private void setAttrValue(final AttrName _attrName,
                              final String _value)
    {
        synchronized (this.attrValues) {
            this.attrValues.put(_attrName, _value);
        }
    }
1021308
def thread_local_property(name):
    ''''''
    name = '_thread_local_' + name

    def fget(self):
        try:
            return getattr(self, name).value
        except AttributeError:
            return None

    def fset(self, value):
        getattr(self, name).value = value

    return property(fget=fget, fset=fset)