helper function to recurse through a vim object and attempt to return all child objects
774301
def _recurse_config_to_dict(t_data):
    '''
    
    '''
    if not isinstance(t_data, type(None)):
        if isinstance(t_data, list):
            t_list = []
            for i in t_data:
                t_list.append(_recurse_config_to_dict(i))
            return t_list
        elif isinstance(t_data, dict):
            t_dict = {}
            for k, v in six.iteritems(t_data):
                t_dict[k] = _recurse_config_to_dict(v)
            return t_dict
        else:
            if hasattr(t_data, '__dict__'):
                return _recurse_config_to_dict(t_data.__dict__)
            else:
                return _serializer(t_data)
996556
def recurse_extends(yml, key, visited)
      assert_not_visited(key, visited)
      return yml[key] unless has_extends?(yml, key)
      return yml[key] unless parents_exist?(yml, key)
      visited[key] = key
      parent_keys = [yml[key]['extends']].flatten
      h = {}
      parent_keys.each do |parent_key|
        from_extends = yml[key].merge(recurse_extends(yml, parent_key, visited)) do |key, child_val, parent_val|
          handle_relative_operators(parent_val, child_val)
        end
        h = h.merge(from_extends) do |key, older_sibling, younger_sibling|
          # In general, go with the younger sibling.
          # UNLESS that younger sibling had a relative operator, in which use the
          # (already computed) relative operator applied, which lands in older_sibling
          # See bug 244.
          sibling = younger_sibling
          %w(+= -= *= /=).each do |op|
            sibling = older_sibling if younger_sibling.to_s.strip.start_with? op
          end
          sibling
        end
      end
      return h
    end
150772
def _get_subclasses_recurse(self, model, levels=None):
        
        related_objects = [
            f for f in model._meta.get_fields()
            if isinstance(f, OneToOneRel)]

        rels = [
            rel for rel in related_objects
            if isinstance(rel.field, OneToOneField)
            and issubclass(rel.field.model, model)
            and model is not rel.field.model
            and rel.parent_link
        ]

        subclasses = []
        if levels:
            levels -= 1
        for rel in rels:
            if levels or levels is None:
                for subclass in self._get_subclasses_recurse(
                        rel.field.model, levels=levels):
                    subclasses.append(
                        rel.get_accessor_name() + LOOKUP_SEP + subclass)
            subclasses.append(rel.get_accessor_name())
        return subclasses
1318090
def get_all(self):
        
        if not self.vars:
            return self.parent
        if not self.parent:
            return self.vars
        return dict(self.parent, **self.vars)
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
1056884
def recurse(*cls):
    
    def wrap(f):
        def wrapped_f(tlist):
            for sgroup in tlist.get_sublists():
                if not isinstance(sgroup, cls):
                    wrapped_f(sgroup)
            f(tlist)

        return wrapped_f

    return wrap
1103306
def _get_full_output(node, for_output=False):
    '''
    
    '''
    ret = {}
    for item in six.iterkeys(node):
        value = node[item]
        if value is not None and for_output:
            value = six.text_type(value)
        ret[item] = value
    return ret
1346241
def each_object(collection):
    """"""
    c_path = collection_path(collection)
    paths = glob('%s/*.%s' % (c_path, _ext))
    for path in paths:
        yield load_object_at_path(path)
269344
def recurse(self, fn, *args):
        """"""
        fn(self, *args)
        for i in self.items:
            if isinstance(i, Hypercat):
                self.recurse(i, *args)
395197
function getRawRecursive(matryoshka) {
	if (matryoshka.type !== 'object') {
		return matryoshka.value;
	}

	const returnObj = {};

	for (const key of Object.keys(matryoshka.value)) {
		returnObj[key] = getRawRecursive(matryoshka.value[key]);
	}

	return returnObj;
}
345790
def _recursive_cleanup(foo):
    
    if isinstance(foo, dict):
        for (key, val) in list(foo.items()):
            if isinstance(val, dict):
                _recursive_cleanup(val)
            if val == "" or val == [] or val == {}:
                del foo[key]
325367
def member_functions(
            self,
            name=None,
            function=None,
            return_type=None,
            arg_types=None,
            header_dir=None,
            header_file=None,
            recursive=None,
            allow_empty=None):
        """"""
        return (
            self._find_multiple(
                self._impl_matchers[scopedef_t.member_function],
                name=name,
                function=function,
                decl_type=self._impl_decl_types[
                    scopedef_t.member_function],
                return_type=return_type,
                arg_types=arg_types,
                header_dir=header_dir,
                header_file=header_file,
                recursive=recursive,
                allow_empty=allow_empty)
        )
290154
def iter_all_children(self):
        '''
        '''
        
        if self.inline_child:
            yield self.inline_child
        for x in self.children:
            yield x
649789
function getChildren(obj, name) {
  return _.filter(obj.children, function(child) {
    return child.name == name;
  });
}
714890
def assure_obj_child_dict(obj, var):
  
  if not var in obj or type(obj[var]) != type({}):
    obj[var] = {}
  return obj
283589
function each(object, func, thisp) {
	return Object.keys(object).map(key => {
		return func.call(thisp, key, object[key]);
	});
}
391127
function traverse(object, iterator, parent, parentProperty) {
        var key, child;
        if (iterator(object, parent, parentProperty) === false)
          return;
        for (key in object) {
          if (!object.hasOwnProperty(key))
            continue;
          if (key == 'location' || key == 'type')
            continue;
          child = object[key];
          if (typeof child == 'object' && child !== null)
            traverse(child, iterator, object, key);
        }
      }