Sets a deep attribute on an object by resolving a dot-delimited
    path. If path does not exist an `AttributeError` will be raised`.
519313
def deepSetAttr(obj, path, val):
    
    first, _, rest = path.rpartition('.')
    return setattr(deepGetAttr(obj, first) if first else obj, rest, val)
1087212
def _resolve_path(obj, path=None):
        
        if path:
            for attr_name in path.split('__'):
                obj = getattr(obj, attr_name)
        return obj
19213
def set_path (self, path):
        
        assert isinstance(path, basestring)
        self.path_ = os.path.normpath(path)
624068
def truncate_attr_at_path( obj, path ):
    
    target = obj
    last_attr = path[-1]
    message = []

    if type(last_attr) == tuple:
        last_attr = last_attr[-1]
    for attr in path[0:-1]:
        try:
            if type(attr) in ( str, unicode ) and target and hasattr( target, attr ) and hasattr( target, '__getitem__' ):
                target = getattr( target, attr )
            elif target:
                try: target = target[attr]
                except: target = eval( "target." + str( attr ) )
        except:
            pass
        try:
            if not target: return
        except: return
        if isinstance( target, ( tuple, list ) ): target = list(target) # Tuples are immutable. Need to be able to manipulate.

    try:
        del_statement = "del target." + str( last_attr )
        eval( del_statement )
        return
    except: pass

    if type( last_attr ) in ( str, unicode ) and target and hasattr( target, last_attr ):
        try: delattr( target, last_attr )
        except: message.append("Failed to delete attribute" + str(last_attr) + "on target" + str(target) )
    elif type(target) == list:
        try: target.pop(last_attr)
        except: message.append( "Failed to delete value on list" + str(target) + "at index" + str(last_attr) )
    else:
        try: del target[str(last_attr)]
        except: message.append( "failed to delete attribute on subscriptable object" )
1048620
def visit_Attribute(self, node):
        
        obj, path = attr_to_path(node)
        # If no type is given, use a decltype
        if obj.isliteral():
            typename = pytype_to_ctype(obj.signature)
            self.result[node] = self.builder.NamedType(typename)
        else:
            self.result[node] = self.builder.DeclType('::'.join(path) + '{}')
473479
def rsetattr(obj, name, value):
    """"""

    # See goo.gl/BVJ7MN
    path = name.split('.')
    setattr(reduce(getattr, path[:-1], obj), path[-1], value)
409013
def _set_attribute(self, name, value):
        """"""
        setattr(self, name, value)
        self.namespace.update({name: getattr(self, name)})
703519
public void setAttribute(
      JimfsPath path, String attribute, Object value, Set<? super LinkOption> options)
      throws IOException {
    File file = lookUpWithLock(path, options).requireExists(path).file();
    store.setAttribute(file, attribute, value);
  }
829702
def get_attr(obj, path):
    
    try:
        return _get_attr(obj, split_field(path))
    except Exception as e:
        Log = get_logger()
        if PATH_NOT_FOUND in e:
            Log.error(PATH_NOT_FOUND+": {{path}}",  path=path, cause=e)
        else:
            Log.error("Problem setting value", e)
905389
def importpath(path, error_text=None):
    
    result = None
    attrs = []
    parts = path.split('.')
    exception = None
    while parts:
        try:
            result = __import__('.'.join(parts), {}, {}, [''])
        except ImportError as e:
            if exception is None:
                exception = e
            attrs = parts[-1:] + attrs
            parts = parts[:-1]
        else:
            break
    for attr in attrs:
        try:
            result = getattr(result, attr)
        except (AttributeError, ValueError) as e:
            if error_text is not None:
                raise ImproperlyConfigured('Error: %s can import "%s"' % (
                    error_text, path))
            else:
                raise exception
    return result
264142
def mock_attr(self, *args, **kwargs):
        
        self.path.extend(args)
        self.qs.update(kwargs)
        return self
646581
def set_value_for_keypath(obj, path, new_value, preserve_child = False):
    
    parts = path.split('.')
    last_part = len(parts) - 1
    dst = obj
    for i, part in enumerate(parts):
        match = re.match(list_index_re, part)
        if match is not None:
            dst = _extract(dst, match.group(1))
            if not isinstance(dst, list) and not isinstance(dst, tuple):
                raise TypeError('expected list/tuple')
            index = int(match.group(2))
            if i == last_part:
                dst[index] = new_value
            else:
                dst = dst[index]
        else:
            if i != last_part:
                dst = _extract(dst, part)
            else:
                if isinstance(dst, dict):
                    dst[part] = new_value
                else:
                    if not preserve_child:
                        setattr(dst, part, new_value)
                    else:
                        try:
                            v = getattr(dst, part)
                        except AttributeError:
                            setattr(dst, part, new_value)
438885
function deep_set(root, path, value) {
    var twig = root;
    path.split('/').forEach(function (branch, index, branches) {
        if (branch) {
            if (self.camelize) {
                branch = branch.replace(/(\-([a-z]))/g, function (m) { return m[1].toUpperCase(); })
            }
            if (index < branches.length - 1) {
                twig = twig[branch] || (twig[branch] = {});
            } else {
                // optimistically try treating the value as JSON
                try {
                    twig[branch] = JSON.parse(value);
                } catch (e) {
                    twig[branch] = value;
                }
            }
        }
    });
}
283308
def setattr(self, key, value):
		
		if key in _MethodFactoryMeta[self.classId]:
			self.__dict__[key] = value
		elif key == 'errorCode':
			self.errorCode = value
		elif key == 'errorDescr':
			self.errorDescr = value
		elif key == 'invocationResult':
			self.invocationResult = value
		elif key == 'response':
			self.response = value
		else:
			""" no such property """
			# print "No such property ClassId: %s Property:%s" %(self.classId, key)
			return None
493568
def set_attr(self, key: str, value):
        """"""
        self.attr_setter(self, key, value)
509623
def getattr_path(obj, path):
    
    path = path.split('__')
    for name in path:
        obj = getattr(obj, name)
        if obj is None:
            return None
    return obj
1162875
def set_path(self, path, val):
        
        path = tuple(path.split('.')) if isinstance(path , str) else tuple(path)

        disallowed = [p for p in path if not type(self)._sanitizer.allowable(p)]
        if any(disallowed):
            raise Exception("Attribute strings in path elements cannot be "
                            "correctly escaped : %s" % ','.join(repr(el) for el in disallowed))
        if len(path) > 1:
            attrtree = self.__getattr__(path[0])
            attrtree.set_path(path[1:], val)
        else:
            self.__setattr__(path[0], val)