Initialize target's attribuate path,Return the last property value and type.
169091
public ObjectAndType initProperty(final Object target, Type type, final String attr) {
    Object propObj = target;
    Object property = null;

    int index = 0;
    String[] attrs = Strings.split(attr, ".");
    while (index < attrs.length) {
      try {
        property = getProperty(propObj, attrs[index]);
        Type propertyType = null;
        if (attrs[index].contains("[") && null != property) {
          propertyType = new IdentifierType(property.getClass());
        } else {
          propertyType = type.getPropertyType(attrs[index]);
          if (null == propertyType) {
            logger.error("Cannot find property type [{}] of {}", attrs[index], propObj.getClass());
            throw new RuntimeException(
                "Cannot find property type " + attrs[index] + " of " + propObj.getClass().getName());
          }
        }
        if (null == property) {
          property = propertyType.newInstance();
          setProperty(propObj, attrs[index], property);
        }
        index++;
        propObj = property;
        type = propertyType;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return new ObjectAndType(property, type);
  }
1226131
protected String getLastPropertyPart(PAttr attr) {

        if (attr instanceof AIdAttr)
            return ((AIdAttr)attr).getIdentifier().getText().trim();

        ACompoundIdAttr compoundAttr = (ACompoundIdAttr)attr;
            return getLastPropertyPart(compoundAttr.getAttr());
    }
973070
public static Object getByPath(Object target, List<String> path) {
        Object obj = target;

        for (String field : path) {
            if (obj == null) {
                return null;
            }
            obj = evaluate(obj, trimType(field));
        }

        return obj;
    }
996964
function getPropertyOfPath(obj, path) {
    const [child, last] = getLeafOfPath(obj, path, false);
    return child && last ? child[last] : undefined;
}
896316
def init_target_object(self, target, data):
        
        target_object = self.init_single_object(target, data.pop(target, data))
        for key, item in data.items():
            key_alias = MANAGER_ALIASES.get(key, key)
            if item:
                # Item is an OrderedDict with 4 possible structure patterns:
                #   - Just an OrderedDict with (key - value)'s
                #   - OrderedDict with single (key - OrderedDict)
                #   - OrderedDict with multiple (key - OrderedDict)'s
                #   - String (like CreativeCode model)
                if isinstance(item, str):
                    children = item
                else:
                    first_key = list(item.keys())[0]
                    if isinstance(item[first_key], OrderedDict):
                        instances = item.values()
                        if len(instances) > 1:
                            children = [self.init_single_object(key_alias, instance) for instance in instances]
                        else:
                            children = self.init_single_object(key_alias, list(instances)[0])
                    else:
                        children = self.init_single_object(key_alias, item)
                setattr(target_object, key.lower(), children)
            else:
                setattr(target_object, key.lower(), None)
        return target_object
825176
AttributeValue get_last_attr_value() throws DevFailed
	{
		RingElt	record = get_last_element();
		if (record.except == null)
			return record.attr_value;
		else
			throw record.except;
	}
1116295
function getFirstItemAppend(path, obj, target, propName){
  var propValue = utils.getNodeVaue(path, obj);
  if(propValue)
    target[propName][0] = propValue;
}
374184
function getPath(pathType = 'array', _path) {
  return {
    _path: _path || (pathType === 'array' ? [] : ''),
    set(parent, key) {
      let nextPath;
      switch (pathType) {
        case 'array':
          nextPath = this._path.concat([key]);
          break;

        case 'nestedProperty':
          if (this._path.length === 0) {
            nextPath = key;
          } else if (Array.isArray(parent)) {
            nextPath = this._path + `[${key}]`;
          } else {
            nextPath = this._path + '.' + key;
          }
          break;

        default:
          throw new Error('unrecognized pathType ' + pathType);
      }

      return getPath(pathType, nextPath);
    },

    get(parent, key) {
      // in array mode we do not return the leaf node key.
      if (pathType === 'array') {
        return this._path;
      }

      // in nestedProperty mode we return full path including final key
      return this.set(parent, key)._path;
    },
  };
}
1282248
@Nullable
  public <V extends FileAttributeView> V getFileAttributeView(
      final JimfsPath path, Class<V> type, final Set<? super LinkOption> options) {
    return store.getFileAttributeView(
        new FileLookup() {
          @Override
          public File lookup() throws IOException {
            return lookUpWithLock(path, options).requireExists(path).file();
          }
        },
        type);
  }
418150
function initField(target, property, desc) {
        let value = desc.initializer();

        hook(actionSet, action => {
            value = action.payload;
        })

        delete desc.initializer;
        delete desc.writable;

        desc.get = function() {
            return value;
        }
        desc.set = function() {
        }

        return desc;
    }
798072
function setPropertyOfPath(obj, path, value) {
    const [child, last] = getLeafOfPath(obj, path);
    if (child && last) {
        child[last] = value;
    }
}
60347
function shallowCopyTargetProperty(target, source) {
  let properties = Object.keys(target);

  for (let i = 0; i < properties.length; ++i) {
    if (source.hasOwnProperty(properties[i])) {
      target[properties[i]] = source[properties[i]];
    }
  }
}
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" )
1293519
def process_prop(prop_type: PT, value, build_context):
    """"""
    if prop_type in (PT.Target, PT.TargetList):
        return hashify_targets(value, build_context)
    elif prop_type in (PT.File, PT.FileList):
        return hashify_files(value)
    return value
255032
public Object getValue() {
        final String currentPath = getCurrentPath();
        if(Utils.isEmpty(currentPath)) {
            return target;
        } else {
            return propertyValueNavigator.getProperty(target, currentPath);
        }
    }
1286479
def _getattr_path(obj, path):
    
    if not path:
        return None

    for attr in path.split('.'):
        obj = getattr(obj, attr, None)
    return obj
1132983
def target(self):
        """"""
        if not self._ptr:
            raise BfdException("BFD not initialized")

        return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.TARGET)