Convenience to string method.
167455
def device_time_str(self, resp, indent="  "):
        
        time = resp.time
        uptime = resp.uptime
        downtime = resp.downtime
        time_s = datetime.datetime.utcfromtimestamp(time/1000000000) if time != None else None
        uptime_s = round(nanosec_to_hours(uptime), 2) if uptime != None else None
        downtime_s = round(nanosec_to_hours(downtime), 2) if downtime != None else None
        s = "Current Time: {} ({} UTC)\n".format(time, time_s)
        s += indent + "Uptime (ns): {} ({} hours)\n".format(uptime, uptime_s)
        s += indent + "Last Downtime Duration +/-5s (ns): {} ({} hours)\n".format(downtime, downtime_s)
        return s
835515
def mapping_to_str(mapping):
    """"""
    result = ["<"]
    for i, (key, value) in enumerate(mapping.items()):
        if i > 0:
            result.append(",")
        result += [key, "=", serialize_for_header(key, value)]
    result += [">"]
    return "".join(result)
170699
def chars(string: any) -> str:
        """"""
        return ''.join([c if c.isalpha() else '' for c in str(string)])
210686
public String getString(String key) {
    Object value = get(key);
    if (value instanceof String) {
      return (String) value;
    } else if (value != null) {
      return String.valueOf(value);
    }
    return null;
  }
137654
def p_string_literal(self, p):
        """"""
        p[0] = self.asttypes.String(p[1])
        p[0].setpos(p)
1162085
def to_str(self):
        """"""
        val = c_backend.pystring_get_str(self._ptr)
        delattr(self, '_ptr')
        setattr(self, 'to_str', _dangling_pointer)
        return val.decode("utf-8")
839751
private static String concatenateStrings(String... stringsToConcatenate) {
        StringBuilder builder = new StringBuilder();
        final int stringsLength = stringsToConcatenate.length;
        for (int i = 0; i < stringsLength; i++) {
            if (i == stringsLength - 1 && stringsLength != 1) {
                builder.append(" or ");
            } else if (i != 0) {
                builder.append(", ");
            }
            builder.append(stringsToConcatenate[i]);
        }
        return builder.toString();
    }
314589
def String(self, str):
        
        ret = libxml2mod.xmlTextReaderConstString(self._o, str)
        return ret
1061052
public static String asString(Throwable self) {
        StringBuilderWriter sw = new StringBuilderWriter();

        try (PrintWriter pw = new PrintWriter(sw)) {
            self.printStackTrace(pw);
        }

        return sw.toString();
    }
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)
849183
public static final Function<Short,String> toStr() {
        return (Function<Short,String>)((Function)FnNumber.toStr());
    }
204322
def parameters_as_string(self):
        """"""
        params = ", ".join([ p.name for p in self.ordered_parameters ])
        return params
834145
def read_string(self, string, source='<string>'):
        """"""
        sfile = io.StringIO(string)
        self.read_file(sfile, source)
405543
private static String cleanString(String s) {
		if (s != null) {
			s = s.trim();
			if (s.equals("")) {
				s = null;
			}
		}
		return s;
	}
633145
def construct_from_string(cls, string):
        
        if string == cls.name:
            return cls()
        raise TypeError("Cannot construct a '{}' from "
                        "'{}'".format(cls, string))
840941
def to_string(self):
        """"""
        suffix = '%s %s' % (self.type, self.name)
        if self.initial_value:
            suffix += ' = ' + self.initial_value
        return suffix
598180
def set_string(self, string):
        """"""
        self.string = string
        self.length = len(string)
        self.reset_position()