Returns a string showing the available conversions.
        Useful tool in interactive mode.
967263
def conversions(self):
        
        return "\n".join(str(self.to(unit)) for unit in self.supported_units)
1025709
public static String getString() {
    final StringBuilder buf = new StringBuilder();
    buf.append("Feature List:\n");
    for (Feature f : Feature.values()) {
      buf.append(f).append(" introduced in layout version ")
          .append(f.lv).append(" (").
      append(f.description).append(")\n");
    }
    
    buf.append("\n\nLayoutVersion and supported features:\n");
    for (Feature f : Feature.values()) {
      buf.append(f.lv).append(": ").append(map.get(f.lv))
          .append("\n");
    }
    return buf.toString();
  }
745899
def as_strings(self):
        """"""
        if self.value == '' or self.value is None:
            return '{0};\n'.format(self.name)
        if '"' not in self.value and (';' in self.value or '#' in self.value):
            return '{0} "{1}";\n'.format(self.name, self.value)
        return '{0} {1};\n'.format(self.name, self.value)
1012378
public String getString()
    {
        try {
            return Converter.formatObjectToString(this.getData(), this.getDataClass(), this.getDefault());
        } catch (Exception ex) {
            return null;
        }
    }
763216
private String getStatsString() {
    SplitTypeStats allTypeStats = splitTypeStatsMap.get(SplitType.ALL);
    Map<String, Map<String, Number>> statsMapMap =
      new HashMap<String, Map<String, Number>>();
    for (Map.Entry<SplitType, SplitTypeStats> entry :
        splitTypeStatsMap.entrySet()) {
      Map<String, Number> statsMap = new HashMap<String, Number>();
      statsMapMap.put(entry.getKey().toString(), statsMap);

      float percentTotalSplitCount =
        (100f * entry.getValue().getTotalSplitCount()) /
        allTypeStats.getTotalSplitCount();
      float percentTotalSize =
        (100f * entry.getValue().getTotalSize()) /
        allTypeStats.getTotalSize();
      float percentTotalBlockCount =
          (100f * entry.getValue().getTotalBlockCount()) /
          allTypeStats.getTotalBlockCount();
      float averageSizePerSplit =
          ((float) entry.getValue().getTotalSize()) /
          entry.getValue().getTotalSplitCount();
      float averageHostCountPerSplit =
         ((float) entry.getValue().getTotalHostCount()) /
         entry.getValue().getTotalSplitCount();
      float averageBlockCountPerSplit =
          ((float) entry.getValue().getTotalBlockCount()) /
          entry.getValue().getTotalSplitCount();
      statsMap.put("totalSplitCount", entry.getValue().getTotalSplitCount());
      statsMap.put("percentTotalSplitCount", percentTotalSplitCount);
      statsMap.put("totalSize", entry.getValue().getTotalSize());
      statsMap.put("percentTotalSize", percentTotalSize);
      statsMap.put("averageSizePerSplit", averageSizePerSplit);
      statsMap.put("totalHostCount", entry.getValue().getTotalHostCount());
      statsMap.put("averageHostCountPerSplit", averageHostCountPerSplit);
      statsMap.put("totalBlockCount", entry.getValue().getTotalBlockCount());
      statsMap.put("percentTotalBlockCount", percentTotalBlockCount);
      statsMap.put("averageBlockCountPerSplit", averageBlockCountPerSplit);
    }
    return JSON.toString(statsMapMap);
  }
25261
def formatted_usage
      return "" if @opt_types.empty?
      @opt_types.map do |opt, type|
        val = respond_to?("usage_for_#{type}", true) ?
          send("usage_for_#{type}", opt) : "#{opt}=:#{type}"
        "[" + val + "]"
      end.join(" ")
    end
603834
def _to_string(self):
        """"""
        if self.sections:
            start = "/" if self.bound_start else "**/"
            sections = "/**/".join(str(section) for section in self.sections)
            end = "" if self.bound_end else "/**"
        else:
            start = ""
            sections = ""
            end = "" if self.bound_end else "**"
        return "{0}{1}{2}/{3}".format(start, sections, end, str(self.file_pattern))
919732
def _check_conversion(key, valid_dict):
    """"""
    if key not in valid_dict and key not in valid_dict.values():
        # Only show users the nice string values
        keys = [v for v in valid_dict.keys() if isinstance(v, string_types)]
        raise ValueError('value must be one of %s, not %s' % (keys, key))
    return valid_dict[key] if key in valid_dict else key
6907
def to_s
      str = ''
      if @width > 0
        fmt = @width.truncate == @width ? '%d' : '%.2f'
        str << format(fmt, @width)
        str << '%' if @flag == PercentGeometry
      end

      str << 'x' if (@width > 0 && @flag != PercentGeometry) || (@height > 0)

      if @height > 0
        fmt = @height.truncate == @height ? '%d' : '%.2f'
        str << format(fmt, @height)
        str << '%' if @flag == PercentGeometry
      end
      str << format('%+d%+d', @x, @y) if @x != 0 || @y != 0
      str << FLAGS[@flag.to_i] if @flag != PercentGeometry
      str
    end
411598
def _ToString(x):
    """"""
    # Some cross-language values for primitives.  This is tested in
    # jsontemplate_test.py.
    if x is None:
        return 'null'
    if isinstance(x, six.string_types):
        return x
    return pprint.pformat(x)
599939
def current_version_string():
    """"""
    return "{0}.{1}.{2}".format(sys.version_info.major,
                                sys.version_info.minor,
                                sys.version_info.micro)
679369
public List<ConversionMethod> getConversionMethods (Class<?> clazz){
		List<ConversionMethod> conversions = new ArrayList<ConversionMethod>();
		Map<String, List<ConversionMethod>> conversionsMap = this.conversionsLoad();
		for (Class<?> classToCheck : getAllsuperClasses(clazz)){
			List<ConversionMethod> methods = conversionsMap.get(classToCheck.getName());
			if(methods != null)conversions.addAll(methods);
		}
		return conversions;
	}
1136466
def str_rate(self):
        """"""
        # Handle special cases.
        if not self._eta.started or self._eta.stalled or not self.rate:
            return '--- KiB/s'

        unit_rate, unit = UnitByte(self.rate).auto_no_thousands
        if unit_rate >= 10:
            formatter = '%d'
        else:
            formatter = '%0.1f'
        return '{0} {1}/s'.format(locale.format(formatter, unit_rate, grouping=False), unit)
367955
private static String osString()
    {
        OSType osType = calculateOS();
        return osType.toString().toLowerCase(Locale.ENGLISH);
    }
1346400
private List<String> convertImports( Collection<ImportedVariable> importedVariables ) {

		List<String> result = new ArrayList<> ();
		for( ImportedVariable var : importedVariables ) {
			String componentOrFacet = VariableHelpers.parseVariableName( var.getName()).getKey();
			String s = applyLink( var.getName(), componentOrFacet );
			s += var.isOptional() ? this.messages.get( "optional" ) : this.messages.get( "required" ); //$NON-NLS-1$ //$NON-NLS-2$
			if( var.isExternal())
				s += this.messages.get( "external" ); //$NON-NLS-1$

			result.add( s );
		}

		return result;
	}
261553
private String extractNumericVersion(Collection<String> versionStrings) {
        if (versionStrings == null) {
            return "";
        }
        for (String value : versionStrings) {
            String releaseValue = calculateReleaseVersion(value);
            if (!releaseValue.equals(value)) {
                return releaseValue;
            }
        }
        return "";
    }
170827
def _get_conversion_type(self, convert_to=None):
        '''

        '''
        acceptable = ['singularity', 'docker']

        # Default is to convert to opposite kind
        conversion = "singularity"
        if self.name == "singularity":
            conversion = "docker"

        # Unless the user asks for a specific type
        if convert_to is not None and convert_to in acceptable:
            conversion = convert_to
        return conversion