Collect all values from all object found in the path subtree
198264
private void collectGroupValues(Entity obj, PathEntry entry, GroupSetEntry groupSetEntry, Set<String>[] groupKeys) {
		if(entry.query != null) {
			timers.start("Where", entry.queryText);
			boolean result = entry.checkCondition(obj);
			timers.stop("Where", entry.queryText, result ? 1 : 0);
			if (!result) return;
		}

		for(PathEntry field : entry.leafBranches) {
			String fieldName = field.name;
			int groupIndex = field.groupIndex;
			if(fieldName == PathEntry.ANY) {
			    groupSetEntry.m_groupPaths[groupIndex].addValueKeys(groupKeys[groupIndex], obj.id().toString());
			}
			else {
				String value = obj.get(fieldName);
				if(value == null || value.indexOf(CommonDefs.MV_SCALAR_SEP_CHAR) == -1) {
				    groupSetEntry.m_groupPaths[groupIndex].addValueKeys(groupKeys[groupIndex], value);
				}
				else {
					String[] values = value.split(CommonDefs.MV_SCALAR_SEP_CHAR);
					for(String collectionValue : values) {
					    groupSetEntry.m_groupPaths[groupIndex].addValueKeys(groupKeys[groupIndex], collectionValue);
					}
				}
			}
		}
        for(PathEntry child : entry.linkBranches) {
			boolean hasLinkedEntities = false;
            if(child.nestedLinks == null || child.nestedLinks.size() == 0) {
                for(Entity linkedObj : obj.getLinkedEntities(child.name, child.fieldNames)) {
    				hasLinkedEntities = true;
                    collectGroupValues(linkedObj, child, groupSetEntry, groupKeys);
                }
            }
            else {
                for(LinkInfo linkInfo : child.nestedLinks) {
                    for(Entity linkedObj : obj.getLinkedEntities(linkInfo.name, child.fieldNames)) {
        				hasLinkedEntities = true;
                        collectGroupValues(linkedObj, child, groupSetEntry, groupKeys);
                    }
                }
            }
			if(!hasLinkedEntities && !child.hasUnderlyingQuery())
				nullifyGroupKeys(child, groupSetEntry, groupKeys);
        }
    }
925456
def each_object_id(collection):
    """"""
    c_path = collection_path(collection)
    paths = glob('%s/*.%s' % (c_path, _ext))
    for path in paths:
        match = regex.match(r'.+/(.+)\.%s$' % _ext, path)
        yield match.groups()[0]
597288
function() {
    var dir, leaf, name, names, root, _i, _j, _len, _name;
    root = arguments[0], names = 3 <= arguments.length ? __slice.call(arguments, 1, _i = arguments.length - 1) : (_i = 1, []), name = arguments[_i++];
    leaf = this;
    dir = path.resolve(root);
    for (_j = 0, _len = names.length; _j < _len; _j++) {
      _name = names[_j];
      if (!isObject(leaf[_name])) {
        leaf[_name] = {};
      }
      leaf = leaf[_name];
      dir = path.resolve(dir, _name);
    }
    if (name == null) {
      name = path.basename(dir, path.extname(dir));
      dir = path.dirname(dir);
    }
    walk(leaf, dir, name);
    return this;
  }
518366
def traverse(obj, *path, **kwargs):
    
    if path:
        if isinstance(obj, list) or isinstance(obj, tuple):
            #If the current state of the object received is a
            #list, return a list of each of its children elements,
            #traversed with the current state of the string
            return [traverse(x, *path) for x in obj]
        elif isinstance(obj, dict):
            #If the current state of the object received is a
            #dictionary, do the following...
            if isinstance(path[0], list) or isinstance(path[0], tuple):
                #If the current top item in the path is a list,
                #return a dictionary with keys to each of the
                #items in the list, each traversed recursively.
                for branch in path[0]:
                    if not isinstance(branch, basestring):
                        raise TraversalError(obj, path[0])
                return {name: traverse(obj[name], *path[1:], split=True) for name in path[0]}
            elif not isinstance(path[0], basestring):
                #If the key isn't a string (or a list; handled
                #previously), raise an exception.
                raise TraversalError(obj, path[0])
            elif path[0] == '\\*':
                #If the key is a wildcard, return a dict containing
                #each item, traversed down recursively.
                return {name: traverse(item, *path[1:], split=True) for name, item in obj.items()}
            elif path[0] in obj:
                #The individual key is in the current object;
                #traverse it and return the result.
                return traverse(obj[path[0]], *path[1:])
            else:
                #The individual key doesn't exist in the
                #current object; raise an error
                raise TraversalError(obj, path[0])
        else:
            #If the current object isn't either a list or
            #a dict, then do one of two things:
            if kwargs.get('split', False):
                #If the previously-recursed operation caused
                #a split in a dict, just return the object; it's
                #been specifically called out, but it isn't
                #possible to recurse further.
                return obj
            else:
                #The object can't be traversed, and we didn't
                #specifically call it out to do something
                #else with. Raise an exception.
                raise TraversalError(obj, path[0])
    else:
        #If there's no path left, then just return the
        #object that we received.
        return obj
81147
function (subpath) {
    var value = this.sub(subpath).get();
    return Imm.Iterable.isIterable(value) ? value.toJS() : value;
  }
529258
def get(obj, path, view=False, afilter=None):
    
    index = 0
    path_count = len(path) - 1
    target = obj
    head = type(target)()
    tail = head
    up = None
    for pair in path:
        key = pair[0]
        target = target[key]

        if view:
            if isinstance(tail, MutableMapping):
                if issubclass(pair[1], (MutableSequence, MutableMapping)) and index != path_count:
                    tail[key] = pair[1]()
                else:
                    tail[key] = target
                up = tail
                tail = tail[key]
            elif issubclass(tail.__class__, MutableSequence):
                if issubclass(pair[1], (MutableSequence, MutableMapping)) and index != path_count:
                    tail.append(pair[1]())
                else:
                    tail.append(target)
                up = tail
                tail = tail[-1]

        if not issubclass(target.__class__, (MutableSequence, MutableMapping)):
            if (afilter and (not afilter(target))):
                raise dpath.exceptions.FilteredValue

        index += 1

    if view:
        return head
    else:
        return target
983630
def get_value_from_path(self, keypath):
        
        if isinstance(keypath, list):
            if len(keypath) == 0:
                # empty list is root
                return 
            val = self 
            for next_key in keypath:
                val = val[next_key]
            return val
        else:
            return self.__dict__['p'][keypath]
1090312
function deep_get(root, path) {
    var twig = root, result = undefined;
    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];
            } else {
                result = twig && twig[branch];
            }
        }
    });
    return result;
}
12617
def _traverse_tree(tree, path):
        """"""
        path_steps = (step for step in path.split('.') if step != '')
        # Special handling for first step, because the first step isn't under 'objects'
        first_step = path_steps.next()
        subtree = tree[first_step]

        for step in path_steps:
            subtree = subtree['children'][step]
        return subtree
1122772
function findAll (tree, test) {
  var found = test(tree) ? [tree] : []
  if (isNode(tree)) {
    if (tree.children.length > 0) {
      tree.children.forEach(function (child) {
        found = found.concat(findAll(child, test))
      })
    }
  }

  return found
}
983248
function (target, path, traverseArrays) {
      
      // if traversing arrays is enabled and this is an array, loop
      // may be a "array-like" node list (or similar), in which case it needs to be converted
      if (traverseArrays && Sysmo.isArrayLike(target)) {
        
        target = Sysmo.makeArray(target);
        
        var children = [];
        
        for (var i = 0; i < target.length; i++) {
          // recursively loop through children
          var child = Sysmo.getDeepValue(target[i], path, traverseArrays);
          
          // ignore if undefined
          if (typeof child != "undefined") {
            //flatten array because the original path points to one flat result set
            if (Sysmo.isArray(child)) {
              
              for (var j = 0; j < child.length; j++) {
                children.push(child[j]);
              }
              
            } else {
              
              children.push(child);
              
            }
          }
        }
        
        return (children.length) ? children : void(0);
      }
      
      var invoke_regex = /\(\)$/,
          properties = path.split('.'),
          property;

      if (target != null && properties.length) {
        
        var propertyName = properties.shift(),
            invoke = invoke_regex.test(propertyName)
        
        if (invoke) {
          propertyName = propertyName.replace(invoke_regex, "");
        }
        
        if (invoke && propertyName in target) {
          target = target[propertyName]();
        } else {
          target = target[propertyName];
        }
        
        path = properties.join('.');
        
        if (path) {
          target = Sysmo.getDeepValue(target, path, traverseArrays);
        }
      }
      
      return target;
    }
865478
function getProp (obj, path, isArray) {
  var next;
  path = _.isString(path) ? path.split('.') : path;

  // We have more traversing to do
  if (path.length > 1) {
    next = path.shift();
    if (_.isArray(obj[next])) {
      isArray = true;
      var arr = _.compact(_.flatten(obj[next].map(function (el, i) {
        return getProp(el, _.clone(path), isArray);
      })));
      return arr.length ? arr : undefined;
    } else {
      if (!obj[next]) { return; }
      return getProp(obj[next], path, isArray);
    }

  // No more traversing. We can now target the final node with path[0]
  } else {
    next = path[0];
    // if we are at the end of the path and `obj` is an array
    if (_.isArray(obj)) {
      return _.pluck(obj, next);
    } else {
      if (!obj[next]) { return; }
      return isArray ? [obj[next]] : obj[next];
    }
  }
}
1091066
function getValue(data, path) {
  if (typeof data !== 'object' || data === null) {
    return void 0;
  } else if (path.length === 1) {
    return data[path[0]];
  }
  return getValue(data[path[0]], path.slice(1));
}
572196
def find_all(self, collection):
        
        obj = getattr(self.db, collection)
        result = obj.find()
        return result
401931
def values(obj, glob, separator="/", afilter=None, dirs=True):
    
    return [x[1] for x in dpath.util.search(obj, glob, yielded=True, separator=separator, afilter=afilter, dirs=dirs)]
610400
def _inner_search(obj, glob, separator, dirs=True, leaves=False):
    """"""
    for path in dpath.path.paths(obj, dirs, leaves, skip=True):
        if dpath.path.match(path, glob):
            yield path
387954
def each_indexed_object(collection, index_name, **where):
    """"""
    index = _db[collection].indexes[index_name]
    for id in index.value_map.get(indexed_value(index, where), []):
        yield get_object(collection, id)