Converts the path segment weights into a debug string.
543948
def ToDebugString(self):
    """"""
    text_parts = ['Path segment index\tWeight']
    for path_segment_index, weight in self._weight_per_index.items():
      text_parts.append('{0:d}\t\t\t{1:d}'.format(
          path_segment_index, weight))
    text_parts.append('')

    text_parts.append('Weight\t\t\tPath segment index(es)')
    for weight, path_segment_indexes in self._indexes_per_weight.items():
      text_parts.append('{0:d}\t\t\t{1!s}'.format(
          weight, path_segment_indexes))
    text_parts.append('')

    return '\n'.join(text_parts)
918313
def debug(value):
    
    print("%s %s: " % (type(value), value))
    print(dir(value))
    print('\n\n')
    return ''
756228
function pathStrToPathArr(path) {
	path = path.substr(1).split('/').map(part => {
		// De-tokenize '/' characters in path name
		return part.replace(/~1/g, '/');
	});

	// For some reason, path arrays whose only item is an empty string cause errors.
	// In this case, we replace the path with an empty array, which seems to be fine.
	if (path.length === 1 && path[0] === '') {
		path = [];
	}

	return path;
}
618651
private function path_tracer() {
		
		//TODO: consider working out how to trace paths one at a time, so the list of valid paths comes back in a more predictable manner.
		
		$tracerData = array();
		$this->validPaths = array();
		//build the initial tracerData for exploring the depths of this beastly array...
		foreach($this->data as $path=>$data) {
			if(is_array($data)) {
				$tracerData[] = array(
					'path'	=> "/". $path,
					'data'	=> $data
				);
			}
			else {
				//initial key ($path) doesn't have an array beneath it, so it's a blank root path.
				$this->validPaths[] = '/'. $path;
			}
		}
		
		//If we have anything left, we'll need to do some crazy while() looping madness.
		if(is_array($tracerData) && count($tracerData)) {
			while($myData = array_shift($tracerData)) {
				if(is_array($myData['data']) && count($myData['data'])) {
					$basePath = $myData['path'];
					foreach($myData['data'] as $key=>$val) {
						$tracerData[] = array(
							'path'	=> $basePath .'/'. $key,
							'data'	=> $val
						);
					}
				}
				else {
					$this->validPaths[] = $myData['path'];
				}
			}
		}
		
		
	}
410681
private static String[] getPathStack(String path) {
        String normalizedPath = path.replace(File.separatorChar, '/');

        return normalizedPath.split("/");
    }
815922
function setDebugLevel(level, printf) {
  var outLevel = 0;

  debug = debug2 = debug3 = debugTree = function() {};

  switch (String(level)) {
    case '3':
      debug3 = printf;
      outLevel++;
      // fall through
    case '2':
      debugTree = function (fmt, tree) {
        printf(fmt, util.inspect(tree.toJSON(), false, 64));
      };
      debug2 = printf;
      outLevel++;
      // fall through
    case '1':
      debug = printf;
      outLevel++;
      // fall through
    default:
      return outLevel;
  }
}
933490
def debug_string(self, max_debug=MAX_DEBUG_TRIALS):
        """"""
        messages = self._debug_messages()
        states = collections.defaultdict(set)
        limit_per_state = collections.Counter()
        for t in self._trials:
            states[t.status].add(t)

        # Show at most max_debug total, but divide the limit fairly
        while max_debug > 0:
            start_num = max_debug
            for s in states:
                if limit_per_state[s] >= len(states[s]):
                    continue
                max_debug -= 1
                limit_per_state[s] += 1
            if max_debug == start_num:
                break

        for local_dir in sorted({t.local_dir for t in self._trials}):
            messages.append("Result logdir: {}".format(local_dir))

        num_trials_per_state = {
            state: len(trials)
            for state, trials in states.items()
        }
        total_number_of_trials = sum(num_trials_per_state.values())
        if total_number_of_trials > 0:
            messages.append("Number of trials: {} ({})"
                            "".format(total_number_of_trials,
                                      num_trials_per_state))

        for state, trials in sorted(states.items()):
            limit = limit_per_state[state]
            messages.append("{} trials:".format(state))
            sorted_trials = sorted(
                trials, key=lambda t: _naturalize(t.experiment_tag))
            if len(trials) > limit:
                tail_length = limit // 2
                first = sorted_trials[:tail_length]
                for t in first:
                    messages.append(" - {}:\t{}".format(
                        t, t.progress_string()))
                messages.append(
                    "  ... {} not shown".format(len(trials) - tail_length * 2))
                last = sorted_trials[-tail_length:]
                for t in last:
                    messages.append(" - {}:\t{}".format(
                        t, t.progress_string()))
            else:
                for t in sorted_trials:
                    messages.append(" - {}:\t{}".format(
                        t, t.progress_string()))

        return "\n".join(messages) + "\n"
1022910
public String getLastPathSegment() {
        if (StringUtils.isBlank(path)) {
            return StringUtils.EMPTY;
        }
        String segment = path;
        segment = StringUtils.substringAfterLast(segment, "/");
        return segment;
    }
289251
public static function debugTrail() {
		$trail = debug_backtrace();
		$trail = array_reverse($trail);
		array_pop($trail);

		$path = array();
		foreach ($trail as $dat) {
			$pathFragment = $dat['class'] . $dat['type'] . $dat['function'];
				// add the path of the included file
			if (in_array($dat['function'], array('require', 'include', 'require_once', 'include_once'))) {
				$pathFragment .= '(' . substr($dat['args'][0], strlen(PATH_site)) . '),' . substr($dat['file'], strlen(PATH_site));
			}
			$path[] = $pathFragment . '#' . $dat['line'];
		}

		return implode(' // ', $path);
	}
433632
def debugDumpAttrList(self, output, depth):
        
        libxml2mod.xmlDebugDumpAttrList(output, self._o, depth)
464141
public String debug()
  {
    String data = null;
    
    StringBuffer sb = new StringBuffer();
    
    sb.append("ConsumerProperties");
    sb.append("\n");
    sb.append("------------------");
    sb.append("\n");
    
    sb.append("Destination: ");
    sb.append(getJmsDestination());
    sb.append("\n");
    
    sb.append("DestType: ");
    sb.append(getDestinationType());
    sb.append("\n");
    
    sb.append("Selector: ");
    sb.append(getSelector());
    sb.append("\n");
    
    sb.append("NoLocal: ");
    sb.append(noLocal());
    sb.append("\n");
    
    sb.append("Reliablity: ");
    sb.append(getReliability());
    sb.append("\n");
    
    sb.append("ClientID: ");
    sb.append(getClientID());
    sb.append("\n");
    
    sb.append("SubName: ");
    sb.append(getSubName());
    sb.append("\n");
    
    sb.append("DurableSubHome: ");
    sb.append(getDurableSubscriptionHome());
    sb.append("\n");
    
    sb.append("ReadAhead: ");
    sb.append(readAhead());
    sb.append("\n");
    
    sb.append("UnrecoverableReliability: ");
    sb.append(getUnrecovReliability());
    sb.append("\n");
    
    sb.append("Supports Multiple: ");
    sb.append(supportsMultipleConsumers());
    sb.append("\n");
    
    if (dest instanceof Queue)
    {
      sb.append("GatherMessages: ");
      sb.append(isGatherMessages());
      sb.append("\n");
      
    }
    
    data = sb.toString();
    return data;    
   
  }
1050500
private static String[] getPathStrings(String commaSeparatedPaths) {
    int length = commaSeparatedPaths.length();
    int curlyOpen = 0;
    int pathStart = 0;
    boolean globPattern = false;
    List<String> pathStrings = new ArrayList<String>();
    
    for (int i=0; i<length; i++) {
      char ch = commaSeparatedPaths.charAt(i);
      switch(ch) {
        case '{' : {
          curlyOpen++;
          if (!globPattern) {
            globPattern = true;
          }
          break;
        }
        case '}' : {
          curlyOpen--;
          if (curlyOpen == 0 && globPattern) {
            globPattern = false;
          }
          break;
        }
        case ',' : {
          if (!globPattern) {
            pathStrings.add(commaSeparatedPaths.substring(pathStart, i));
            pathStart = i + 1 ;
          }
          break;
        }
      }
    }
    pathStrings.add(commaSeparatedPaths.substring(pathStart, length));
    
    return pathStrings.toArray(new String[0]);
  }
820249
void dfsPathSplit(String path, String[] result)
    {
        int ri = 0, rlast = result.length - 1;
        int i = 0, b = 0, len = path.length();

        do {
            if (ri == rlast) {
                result[rlast] = path.substring(b);
                return;
            }
            if (i == len || path.charAt(i) == '\\') {
                result[ri++] = path.substring(b, i);
                b = i + 1;
            }
        } while (i++ < len);

        while (ri < result.length) {
            result[ri++] = "";
        }
    }
1071717
def os_path_split_asunder(path, debug=False):
        
        parts = []
        while True:
            newpath, tail = os.path.split(path)
            if debug: print repr(path), (newpath, tail)
            if newpath == path:
                assert not tail
                if path: parts.append(path)
                break
            parts.append(tail)
            path = newpath
        parts.reverse()
        return parts
324513
function() {

            var segments = this.segments;
            var numSegments = segments.length;
            if (numSegments === 0) return null; // if segments is an empty array

            var bbox;
            for (var i = 0; i < numSegments; i++) {

                var segment = segments[i];
                if (segment.isVisible) {
                    var segmentBBox = segment.bbox();
                    bbox = bbox ? bbox.union(segmentBBox) : segmentBBox;
                }
            }

            if (bbox) return bbox;

            // if the path has only invisible elements, return end point of last segment
            var lastSegment = segments[numSegments - 1];
            return new Rect(lastSegment.end.x, lastSegment.end.y, 0, 0);
        }
1035737
public String getDebugToken() {
    char asChar = getChar();
    if (asChar == NodewalkerCodec.FALLBACK) return "<STOP>";
    if (asChar == NodewalkerCodec.END_OF_STRING) return "<NULL>";
    if (asChar == NodewalkerCodec.ESCAPE) return "<ESC>";
    if (asChar == '\\') return "\\\\";
    if (asChar == '\n') return "\\n";
    return new String(new char[]{asChar});
  }
241620
public static String toSimpleTraversrPath(Object[] paths) {
        StringBuilder pathBuilder = new StringBuilder();
        for(int i=0; i<paths.length; i++) {
            Object path = paths[i];
            if(path instanceof Integer) {
                pathBuilder.append("[").append(((Integer) path).intValue()).append("]");
            }
            else if(path instanceof String) {
                pathBuilder.append(path.toString());
            }
            else{
                throw new UnsupportedOperationException("Only Strings and Integers are supported as path element");
            }
            if(!(i+1 == paths.length)) {
                pathBuilder.append(".");
            }
        }
        return pathBuilder.toString();
    }