Dumps the contents of the session attributes.

@param obj the object to dump.
@return the dump of the given object.
189353
public static ObjectGraphNode dump(final Object obj) {
		ObjectGraphDump dump = new ObjectGraphDump(false, true);
		ObjectGraphNode root = new ObjectGraphNode(++dump.nodeCount, null, obj.getClass().getName(),
				obj);
		dump.visit(root);

		return root;
	}
106657
public Object getSessionAttribute(String key, Object defaultValue)
    {
        Object attributeValue = this.sessionAttributes.get(key);
        if (attributeValue == null)
            attributeValue = defaultValue;
        return attributeValue;
    }
50278
public static DERBitString getInstance(
        Object  obj)
    {
        if (obj == null || obj instanceof DERBitString)
        {
            return (DERBitString)obj;
        }

        if (obj instanceof ASN1OctetString)
        {
            byte[]  bytes = ((ASN1OctetString)obj).getOctets();
            int     padBits = bytes[0];
            byte[]  data = new byte[bytes.length - 1];

            System.arraycopy(bytes, 1, data, 0, bytes.length - 1);

            return new DERBitString(data, padBits);
        }

        if (obj instanceof ASN1TaggedObject)
        {
            return getInstance(((ASN1TaggedObject)obj).getObject());
        }

        throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
    }
837054
def dumps_bytes(obj):
    
    b = dumps(obj)
    if isinstance(b, unicode):
        b = b.encode("ascii")
    return b
1093556
def dump_database_object(obj: T, fieldlist: Iterable[str]) -> None:
    """"""
    log.info(_LINE_EQUALS)
    log.info("DUMP OF: {}", obj)
    for f in fieldlist:
        log.info(u"{f}: {v}", f=f, v=getattr(obj, f))
    log.info(_LINE_EQUALS)
990369
public static String convertSerializableToString(Serializable obj) {
        ByteArrayOutputStream baos = null;
        ObjectOutputStream oos = null;
        try {
            baos = new ByteArrayOutputStream();
            oos = new ObjectOutputStream(baos);
            oos.writeObject(obj);

            return new String(baos.toByteArray());
        } catch (IOException e) {
            return null;
        } finally {
            closeQuietly(baos, oos);
            closeQuietly(oos);
        }
    }
572140
public function dump($obj)
    {
        static $ident = 0;

        $str = '';

        if ($obj instanceof Node) {
            $str  .= get_class($obj) . '(' . PHP_EOL;
            $props = get_object_vars($obj);

            foreach ($props as $name => $prop) {
                $ident += 4;
                $str   .= str_repeat(' ', $ident) . '"' . $name . '": '
                      . $this->dump($prop) . ',' . PHP_EOL;
                $ident -= 4;
            }

            $str .= str_repeat(' ', $ident) . ')';
        } elseif (is_array($obj)) {
            $ident += 4;
            $str   .= 'array(';
            $some   = false;

            foreach ($obj as $k => $v) {
                $str .= PHP_EOL . str_repeat(' ', $ident) . '"'
                      . $k . '" => ' . $this->dump($v) . ',';
                $some = true;
            }

            $ident -= 4;
            $str   .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '') . ')';
        } elseif (is_object($obj)) {
            $str .= 'instanceof(' . get_class($obj) . ')';
        } else {
            $str .= var_export($obj, true);
        }

        return $str;
    }
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();
    }
695193
public void serializeBean(Object obj, Set<String> attributesToIgnore) {
        builder.newIndentedline();
        try {
            BeanInfo info = Introspector.getBeanInfo(obj.getClass());
            List<NameValue> values = new ArrayList<>();

            for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
                if (pd.getName().equals("class")) continue;
                Object value = pd.getReadMethod().invoke(obj);
                if (value == null) continue;
                if (value instanceof List && ((List) value).isEmpty()) continue;
                String attribute = getAttributeForField(pd.getName());
                if (!attributesToIgnore.contains(attribute)) {
                    values.add(new NameValue(attribute, value, value instanceof List && isPlainType(((List) value).get(0))));
                }
            }

            for (int i = 0; i < values.size(); i++) {
                NameValue value = values.get(i);
                builder.append(value.name).append(" = ");
                if (value.plain) {
                    serializePlain(value.value);
                } else {
                    serialize(value.value);
                }
                if (i < values.size() - 1) {
                    builder.newline();
                }

            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        builder.unindent().newline();
    }
1319566
public static MOAObject copy(MOAObject obj) {
        try {
            return (MOAObject) SerializeUtils.copyObject(obj);
        } catch (Exception e) {
            throw new RuntimeException("Object copy failed.", e);
        }
    }
735323
public static byte[] getBytesFor(String name, Object obj)
	{
		if(obj == null)
			throw new NullPointerException("obj is null");
		return getBytesFor(name,obj.getClass());
	}
912200
def dump(self, obj):
        
        if self.schema_class:
            obj = self.schema_class().dump(obj).data
        else:
            obj = obj['metadata']
        return super(MARCXMLSerializer, self).dump(obj)
50720
public static Serializable copy(Serializable obj) {
        try {
            ByteArrayOutputStream buf = new ByteArrayOutputStream(4096);
            ObjectOutputStream out = new ObjectOutputStream(buf);
            out.writeObject(obj);
            out.close();

            ByteArrayInputStream buf2 = new ByteArrayInputStream(buf.toByteArray());
            ObjectInputStream in = new ObjectInputStream(buf2);
            Serializable            obj2 = (Serializable) in.readObject();
            in.close();

            return obj2;
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
686823
public String serialize(T obj) {
        try {
            Marshaller marshaller = context.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
            StringWriter writer = new StringWriter();
            marshaller.marshal(obj, writer);
            return writer.toString();
        } catch (JAXBException e) {
            throw new XmlSerializationException("Exception encountered " +
                                                "serializing report: " +
                                                getErrorMsg(e), e);
        }
    }
1271585
def dump(self, obj):
        
        self.references = []
        self.object_obj = obj
        self.object_stream = BytesIO()
        self._writeStreamHeader()
        self.writeObject(obj)
        return self.object_stream.getvalue()
965019
public static String object_to_string_withoutquotes(java.lang.Object obj) throws Exception {
		String str = null;

		Class<?> c = obj.getClass();
		Field[] flds = c.getDeclaredFields();
		if (flds != null) {
			for (int i = 0; i < flds.length; i++)
			{
				flds[i].setAccessible(true);
				if (flds[i].get(obj) != null)
				{
					String strtmp = "";
					if (flds[i].getType().isArray()) {
						Object tmp = flds[i].get(obj);
						if (tmp instanceof String[]) {
							String[] tmp1 = (String[])tmp;
							for (int j = 0 ;j<tmp1.length;j++) {
								strtmp += tmp1[j] + " "; 
							}
						} else if (tmp instanceof Integer[]) {
							Integer[] tmp1 = (Integer[])tmp;
							for (int j = 0 ;j<tmp1.length;j++) {
								strtmp += tmp1[j].toString() + " "; 
							}
						} else if (tmp instanceof Long[]) {
							Long[] tmp1 = (Long[])tmp;
							for (int j = 0 ;j<tmp1.length;j++) {
								strtmp += tmp1[j].toString() + " "; 
							}
						} else if (tmp instanceof Double[]) {
							Double[] tmp1 = (Double[])tmp;
							for (int j = 0 ;j<tmp1.length;j++) {
								strtmp += tmp1[j].toString() + " "; 
							}
						} else if(tmp instanceof Boolean[]) {
							Boolean[] tmp1 = (Boolean[])tmp;
							for (int j = 0 ;j<tmp1.length;j++) {
								strtmp += tmp1[j].toString() + " "; 
							}
						}						
						strtmp = strtmp.trim();
					} else {
						strtmp = flds[i].get(obj).toString();
					}
					if (str != null)
						str = str + ",";
					if (str == null)
					{
						str = flds[i].getName() + ":" + encode(strtmp);
					}
					else
					{
						str = str +flds[i].getName() + ":" + encode(strtmp);
					}
				}
			}
		}
		return str;
	}
6564
public static String toJSONString(final Object obj) {
        try {
            return mapper.writeValueAsString(obj);
        } catch (final JsonProcessingException e) {
            logger.error("Cannot to JSON string", e);
        }
        return null;
    }