Copied from http://stackoverflow.com/questions/13523951/how-to-check-the-depth-of-an-object
503498
function(object) {
  var level = 1;
  var key;
  for (key in object) {
    if (!object.hasOwnProperty(key)) continue;

    if (_.isObjectLike(object[key])) {
      var depth = depthOf(object[key]) + 1;
      level = Math.max(depth, level);
    }
  }
  return level;
}
58465
function (node){
		// getBoundingClientRect returns t
		var o = node.getBoundingClientRect();
		if (!o.width || !o.height) {
			return {
				left: o.left,
				right: o.right,
				top: o.top,
				bottom: o.bottom,
				width: o.right - o.left,
				height: o.bottom - o.top
			};
		}
		return o;
	}
681566
public int getClassDepth() {
        int depth = 0;

        ClassFile outer = mOuterClass;
        while (outer != null) {
            depth++;
            outer = outer.mOuterClass;
        }

        return depth;
    }
838099
function ( obj ) {
		var result = 0;

		if ( obj.length > 0 ) {
			result = obj.reduce( function ( prev, cur ) {
				return prev + cur;
			});
		}

		return result;
	}
684494
function(left_obj, right_obj, size_buffer, given_spec) {

		console.log("TOP of diff_entire_buffers");

		var total_diffs = 0;
		var total_raw_left = 0;
		var total_raw_right = 0;

		var left_buffer = left_obj.buffer;
		var right_buffer = right_obj.buffer;

		for (var index = 0; index < size_buffer; index++) {

			total_diffs += Math.abs(left_buffer[index] - right_buffer[index]);

			total_raw_left  += Math.abs(left_buffer[index]);
			total_raw_right += Math.abs(right_buffer[index]);
		};

		console.log("total_diffs ", total_diffs);

		given_spec.total_diffs = total_diffs;

		given_spec.total_raw_left  = total_raw_left;
		given_spec.total_raw_right = total_raw_right;
	}
1314323
public int depth(Tree node) {
        Tree p = node.parent(this);
        if (this == node) {
            return 0;
        }
        if (p == null) {
            return -1;
        }
        int depth = 1;
        while (this != p) {
            p = p.parent(this);
            depth++;
        }
        return depth;
    }
365254
protected int getDepth( final WebdavRequest req )
    {
        int depth = INFINITY;
        final String depthStr = req.getHeader( "Depth" );
        if ( depthStr != null )
        {
            if ( depthStr.equals( "0" ) )
            {
                depth = 0;
            }
            else if ( depthStr.equals( "1" ) )
            {
                depth = 1;
            }
        }
        return depth;
    }
1128754
def find(max_depth=3):
        """"""
        i = 0
        for c, d, f in walk_up(os.getcwd()):
            i += 1

            if i < max_depth:
                if 'Pipfile':
                    p = os.path.join(c, 'Pipfile')
                    if os.path.isfile(p):
                        return p
        raise RuntimeError('No Pipfile found!')
1137645
function() {
			if (!this.children.length)
				return null;
				
			var deepestChild = this;
			while (deepestChild.children.length) {
				deepestChild = deepestChild.children[deepestChild.children.length - 1];
			}
			
			return deepestChild;
		}
608997
function shallowEqual(objA, objB, options = {}) {
  if (is(objA, objB)) {
    return true;
  }

  if ((typeof objA === 'undefined' ? 'undefined' : _typeof(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : _typeof(objB)) !== 'object' || objB === null) {
    return false;
  }

  if(objA instanceof Date && objB instanceof Date) {
    return objA === objB;
  }

  const keysA = Object.keys(objA);
  const keysB = Object.keys(objB);

  if (keysA.length !== keysB.length) {
    return false;
  }

  const {
    omitKeys,
    deepKeys,
  } = options;

  // Test for A's keys different from B.
  for (let i = 0; i < keysA.length; i++) {
    // if key is an omitted key, skip comparison
    if (omitKeys && omitKeys.length && ~omitKeys.indexOf(keysA[i])) continue;


    if (deepKeys && deepKeys.length && ~deepKeys.indexOf(keysA[i])) {
      const result = shallowEqual(objA[keysA[i]], objB[keysA[i]]);

      if (!result) return false;
    } else if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
      return false;
    }
  }

  return true;
}
989781
def get_depth(self, update=False):
        

        if self.parent_id is None:
            return 1

        try:
            if update:
                del self._cached_depth
            else:
                return self._cached_depth
        except AttributeError:
            pass

        depth = 0
        node = self
        while node:
            node = node.parent
            depth += 1
        self._cached_depth = depth
        return depth
1146032
def __get_depth(root):
    
    if root is None:
        return 0
    left  = __get_depth(root.left)
    right = __get_depth(root.right)
    if abs(left-right) > 1 or -1 in [left, right]:
        return -1
    return 1 + max(left, right)
526704
def validate_depth(self, depth: DepthDefinitionType) -> Optional[int]:
        
        if depth is not None:
            try:
                depth = int(depth)
            except ValueError:
                raise ValueError(f"Depth '{depth}' can't be converted to int.")

            if depth < 1:
                raise ValueError(f"Depth '{depth}' isn't a positive number")

            return depth
        return None
1298397
function(deep) {
			var cl = this.children,
				i,
				l,
				n;
			if (!cl) {
				return 0;
			}
			n = cl.length;
			if (deep !== false) {
				for (i = 0, l = n; i < l; i++) {
					n += cl[i].countChildren();
				}
			}
			return n;
		}
982257
function checkDepth(selector, rule) {
      var depth;
      // Stripping "[...]", "(...)", "+", "~" (the last two might come with
      // spaces) for simplicity and since we don't need those to count depth
      var stripped = selector.replace(/\(.*?\)|\[.*?\]|(\s*)[+~](\s*)/g, []);
      // Trimming redundant spaces
      stripped = stripped.replace(/\s+/g, ' ');
      // Finally find everything between spaces and ">" (possibly with spaces)
      depth = stripped.match(/[^\s>]+/g).length;
      if (depth > max) {
        stylelint.utils.report({
          ruleName: ruleName,
          result: result,
          node: rule,
          message: messages.rejected(selector, max)
        });
      }
    }
554685
def at_depth(depth , *strings)
      prefix = " " * 2 * depth
      strings.collect{|str| prefix + str}.join("\n")
    end
818054
function dims( arr, d, depth ) {
	if ( depth && isArray( arr ) ) {
		d.push( arr.length );
		dims( arr[ 0 ], d, depth-1 );
	}
	return d;
}