:param value: SOME STRUCTURE
    :param depth: THE MAX DEPTH OF PROPERTIES, DEEPER WILL BE STRING-IFIED
    :return: FLATTER STRUCTURE
431901
def _deep_json_to_string(value, depth):
    
    if is_data(value):
        if depth == 0:
            return strings.limit(value2json(value), LOG_STRING_LENGTH)

        return {k: _deep_json_to_string(v, depth - 1) for k, v in value.items()}
    elif is_sequence(value):
        return strings.limit(value2json(value), LOG_STRING_LENGTH)
    elif isinstance(value, number_types):
        return value
    elif is_text(value):
        return strings.limit(value, LOG_STRING_LENGTH)
    elif is_binary(value):
        return strings.limit(bytes2base64(value), LOG_STRING_LENGTH)
    elif isinstance(value, (date, datetime)):
        return datetime2unix(value)
    else:
        return strings.limit(value2json(value), LOG_STRING_LENGTH)
996266
function flattenValues (report) {
    if (Object.prototype.toString.call(report.values) === '[object Array]') {
      report.values.forEach(function (value) {
        Object.assign(report, value)
      })
    }
    return report
  }
393672
def _str(value, depth):
    
    output = []
    if depth >0 and _get(value, CLASS) in data_types:
        for k, v in value.items():
            output.append(str(k) + "=" + _str(v, depth - 1))
        return "{" + ",\n".join(output) + "}"
    elif depth >0 and is_list(value):
        for v in value:
            output.append(_str(v, depth-1))
        return "[" + ",\n".join(output) + "]"
    else:
        return str(type(value))
464145
def depth(sequence, func=max, _depth=0):
    
    if isinstance(sequence, dict):
        sequence = list(sequence.values())
    depth_list = [depth(item, func=func, _depth=_depth + 1)
                  for item in sequence if (isinstance(item, dict) or util_type.is_listlike(item))]
    if len(depth_list) > 0:
        return func(depth_list)
    else:
        return _depth
805604
def enrich_value(value)
      return value unless value.is_a?(DPLA::MAP::WebResource) && value.node?
      nil
    end
910745
def wrap(self, value):
        ''' 
        '''
        self.validate_wrap(value)
        ret = {}
        for k, v in value.items():
            ret[k] = self.value_type.wrap(v)
        return ret
48942
def max(self, value):
        
        if value == self._defaults['max'] and 'max' in self._values:
            del self._values['max']
        else:
            self._values['max'] = value
65706
def to_representation(self, value):
        """"""
        value = apply_subfield_projection(self, value, deep=True)
        return super().to_representation(value)
1283712
def enrich_value(value)
      set_label(value) if value.is_a?(DPLA::MAP::TimeSpan) && 
                          value.prefLabel.empty?
      value
    end
1192824
function deepFromEntries(parent, parentKey, path, value) {
  const key = path.shift()
  const current = isNaN(key) ? {} : []

  // TODO: Refactor that function to reduce code.
  if (!parent) {
    if (path.length === 0) {
      current[key] = value

      return current
    }

    current[key] = deepFromEntries(current[key], key, path, value)

    return current
  }

  if (isPlainObject(parent) || isArray(parent)) {
    if (path.length === 0) {
      parent[key] = value

      return parent
    }

    parent[key] = deepFromEntries(parent[key], key, path, value)

    return parent
  }

  if (path.length === 0) {
    current[key] = value

    return current
  }

  current[key] = deepFromEntries(parent[key], key, path, value)

  return current
}
548070
def values_at(self, depth):
        
        if depth < 1:
            yield self
        else:
            for dict_tree in self.values():
                for value in dict_tree.values_at(depth - 1):
                    yield value
1331373
def maximum(self, value):
        
        self._remove_max()
        if value is None:
            return
        self._add_max(val=value)
962944
def to_representation(self, value):
        
        return {
            six.text_type(key): self.child.to_representation(val)
            for key, val in value.items()
        }
1225037
def deepcopy(value):
    

    if not isinstance(value, (dict, list, tuple)):
        return value

    if isinstance(value, dict):
        copy = {}
        for k, v in value.items():
            copy[k] = deepcopy(v)

    if isinstance(value, tuple):
        copy = list(range(len(value)))

        for k in get_keys(list(value)):
            copy[k] = deepcopy(value[k])

        copy = tuple(copy)

    if isinstance(value, list):
        copy = list(range(len(value)))

        for k in get_keys(value):
            copy[k] = deepcopy(value[k])

    return copy
1084723
@Deprecated
	public static String toJson(Object value, int depth) {
		Json json = Json.getJson();
		// 仅 JFinalJson 实现支持 int depth 参数
		if (json instanceof JFinalJson) {
			((JFinalJson)json).setConvertDepth(depth);
		}
		return json.toJson(value);
	}
370850
def _max_recursion_depth(obj):
    ''' 
    '''
    neurites = obj.neurites if hasattr(obj, 'neurites') else [obj]

    return max(sum(1 for _ in neu.iter_sections()) for neu in neurites)
533115
def _set_topMargin(self, value):
        
        bounds = self.bounds
        if bounds is None:
            self.height = value
        else:
            xMin, yMin, xMax, yMax = bounds
            self.height = yMax + value