Get the object as SOFT formatted string.
347292
def _get_object_as_soft(self):
        """"""
        soft = ["^%s = %s" % (self.geotype, self.name),
                self._get_metadata_as_string()]
        return "\n".join(soft)
620129
def as_string(self):
        """"""
        if self.headers_only:
            self.msgobj = self._get_content()

        # We could just use msgobj.as_string() but this is more flexible... we might need it.
        from email.generator import Generator
        fp = StringIO()
        g = Generator(fp, maxheaderlen=60)
        g.flatten(self.msgobj)
        text = fp.getvalue()
        return text
505457
public String objectToString(T object) {
		StringBuilder sb = new StringBuilder(64);
		sb.append(object.getClass().getSimpleName());
		for (FieldType fieldType : fieldTypes) {
			sb.append(' ').append(fieldType.getColumnName()).append('=');
			try {
				sb.append(fieldType.extractJavaFieldValue(object));
			} catch (Exception e) {
				throw new IllegalStateException("Could not generate toString of field " + fieldType, e);
			}
		}
		return sb.toString();
	}
635279
def _asString(self, value):
        """"""
        if sys.version_info[0] == 3:
            if isinstance(value, str):
                return value
            elif isinstance(value, bytes):
                return value.decode('utf-8')
        elif sys.version_info[0] == 2:
            return value.encode('ascii')
434578
def to_string(s, encoding=None, errors='strict'):
    """"""
    encoding = encoding or 'utf-8'
    if isinstance(s, bytes):
        return s.decode(encoding, errors)
    if not is_string(s):
        s = string_type(s)
    return s
840941
def to_string(self):
        """"""
        suffix = '%s %s' % (self.type, self.name)
        if self.initial_value:
            suffix += ' = ' + self.initial_value
        return suffix
565591
def getFullName(obj):
    '''
    
    '''
    if hasattr(obj, 'firstName') and hasattr(obj, 'lastName'):
        return ' '.join([obj.firstName or '', obj.lastName or ''])
    return ' '.join([getattr(obj, 'first_name', ''),getattr(obj, 'last_name', '')])
1096175
def string(self) -> bytes:
        """"""
        if self._raw is not None:
            return self._raw
        self._raw = raw = BytesFormat(b' ').join(
            [b'CAPABILITY', b'IMAP4rev1'] + self.capabilities)
        return raw
1003274
def _str(obj):
    """"""
    values = []
    for name in obj._attribs:
        val = getattr(obj, name)
        if isinstance(val, str):
            val = repr(val)
        val = str(val) if len(str(val)) < 10 else "(...)"
        values.append((name, val))
    values = ", ".join("{}={}".format(k, v) for k, v in values)
    return "{}({})".format(obj.__class__.__name__, values)
350098
public static String dumpAsString(
                                      Object obj)
    {
        if (obj instanceof DERObject)
        {
            return _dumpAsString("", (DERObject) obj);
        }
        else if (obj instanceof DEREncodable)
        {
            return _dumpAsString("", ((DEREncodable) obj).getDERObject());
        }

        return "unknown object type " + obj.toString();
    }
262540
function getObjectWithStringifiedKeys(object) {
	return Object.keys(object).reduce((objectJSON, key) => {
		objectJSON[key] = String(object[key]);

		return objectJSON;
	}, {});
}
758509
def to_json(obj):
    """"""
    i = StringIO.StringIO()
    w = Writer(i, encoding='UTF-8')
    w.write_value(obj)
    return i.getvalue()
162711
def pretty_describe(object, nestedness=0, indent=2):
    """"""
    if not isinstance(object, dict):
        return str(object)
    sep = f'\n{" " * nestedness * indent}'
    out = sep.join((f'{k}: {pretty_describe(v, nestedness + 1)}' for k, v in object.items()))
    if nestedness > 0 and out:
        return f'{sep}{out}'
    return out
451964
def to_str(obj):
    
    if isinstance(obj, str):
        return obj
    if isinstance(obj, unicode):
        return obj.encode('utf-8')
    return str(obj)
437733
@Override
    public String getFormattedMessage() {
        // LOG4J2-763: cache formatted string in case obj changes later
        if (objectString == null) {
            objectString = String.valueOf(obj);
        }
        return objectString;
    }
634647
def not_a_string(obj):
    """"""
    my_type = str(type(obj))
    if is_py3():
        is_str = my_type.find('bytes') < 0 and my_type.find('str') < 0
        return is_str

    return my_type.find('str') < 0 and \
        my_type.find('unicode') < 0
1191389
def loads(astring):
        """"""
        try:
            return marshal.loads(zlib.decompress(astring))
        except zlib.error as e:
            raise SerializerError(
                'Cannot decompress object ("{}")'.format(str(e))
            )
        except Exception as e:
            # marshal module does not provide a proper Exception model
            raise SerializerError(
                'Cannot restore object ("{}")'.format(str(e))
            )