marshal_dump and marshal_load is a fix for unable to cache object of this class.
 This is a temporary solution. Once Restforce::Mash fix this issue, we'll revert this change
512569
def marshal_dump
      h = to_h
      if h[:attributes]
        h[:attributes] = h[:attributes].clone
        h[:attributes].instance_variable_set(:@client, nil)
      end

      if h[:original_object]
        h[:original_object] = h[:original_object].clone
        h[:original_object].instance_variable_set(:@client, nil)

        if h[:original_object]['attributes']
          h[:original_object]['attributes'] = h[:original_object]['attributes'].clone
          h[:original_object]['attributes'].instance_variable_set(:@client, nil)
        end
      end
      h
    end
303680
def deserialize(raw)
      begin
        case @serializer
        when :marshal
          Marshal.load(raw)
        when :json
          JSON.parse(raw, :create_additions => true)
        when :yaml
          YAML.load(raw)
        end
      rescue => e
        PEROBS.log.fatal "Cannot de-serialize object with #{@serializer} " +
          "parser: " + e.message
      end
    end
435297
private boolean dumpCache(){
        if (CacheDumpLogger.isDebugEnabled()) {
            try {
                List<ModelService> services = new ArrayList<ModelService>();
                services.addAll(getCache().values());
                StringBuilder sb = new StringBuilder();
                sb.append("LookupManager dumpped Service Cache at: ").append(System.currentTimeMillis()).append("\n");
                for (ModelService service : services) {
                    sb.append(new String(serialize(service))).append("\n");
                }
                CacheDumpLogger.debug(sb.toString());
            } catch (Exception e) {
                LOGGER.warn("Dump Service Cache failed. Set Logger {} to INFO to disable this message.",
                            CacheDumpLogger.getName());
                if (LOGGER.isTraceEnabled()) {
                    LOGGER.trace("Dump Service Cache failed. ", e);
                }
                return false;
            }
            return true;
        }
        return false;

    }
423614
static function load($class_name, $object_id, $version)
	{
		static $cache = array();
		$hash = '__load:'.$class_name.'-'.$object_id.'-'.$version;
		if(!empty($cache[$hash]))
			return $cache[$hash];

		$object = bors_load($class_name, $object_id);
//		echo $object;
		foreach(bors_find_all(__CLASS__, array(
			'target_class_name' => $class_name,
			'target_id' => $object_id,
			'target_version' => $version,
		)) as $x)
		{
//			echo "{$x->property_name()} = {$x->value()}<br/>\n";
			$object->set_attr('versioning_properties',
				array_merge(
					$object->attr('versioning_properties', array()),
					array($x->property_name() => $object->get($x->property_name()))
				)
			);

			$object->set($x->property_name(), $x->value(), false);
//			$object->set_attr('versioning_property', $x->property_name());
		}

		return $cache[$hash] = $object;
	}
1114845
public void ser(Object datum, OutputStream output) throws IOException {
		Map<Class, Serializer> serializers = cachedSerializers.get();
		Serializer ser = serializers.get(datum.getClass());
		if(ser == null) {
			ser = serialization.getSerializer(datum.getClass());
			if(ser == null) {
				throw new IOException("Serializer for class " + datum.getClass() + " not found");
			}
			serializers.put(datum.getClass(), ser);
		}
		ser.open(output);
		ser.serialize(datum);
		ser.close();
	}
396417
def marshal(self, o, use_value_list=False):
        

        if o is None:
            return
        elif isinstance(o, dict):
            if use_value_list:
                for k, v in o.items():
                    o[k] = [v]
            return o
        elif isinstance(o, six.string_types):
            if use_value_list:
                return {o: [True]}
            else:
                return {o: True}
        else:
            raise TypeError("Marshaller doesn't support given type %s" % type(o))
564652
private static ObjectNode encodeCacheToJSON()
  {
    try
    {
      ObjectNode out = OBJECT_MAPPER.createObjectNode();
      for (Map.Entry<OcspResponseCacheKey, SFPair<Long, String>> elem :
          OCSP_RESPONSE_CACHE.entrySet())
      {
        OcspResponseCacheKey key = elem.getKey();
        SFPair<Long, String> value0 = elem.getValue();
        long currentTimeSecond = value0.left;

        DigestCalculator digest = new SHA1DigestCalculator();
        AlgorithmIdentifier algo = digest.getAlgorithmIdentifier();
        ASN1OctetString nameHash = ASN1OctetString.getInstance(key.nameHash);
        ASN1OctetString keyHash = ASN1OctetString.getInstance(key.keyHash);
        ASN1Integer serialNumber = new ASN1Integer(key.serialNumber);
        CertID cid = new CertID(algo, nameHash, keyHash, serialNumber);
        ArrayNode vout = OBJECT_MAPPER.createArrayNode();
        vout.add(currentTimeSecond);
        vout.add(value0.right);
        out.set(
            Base64.encodeBase64String(cid.toASN1Primitive().getEncoded()),
            vout);
      }
      return out;
    }
    catch (IOException ex)
    {
      LOGGER.debug("Failed to encode ASN1 object.");
    }
    return null;
  }
465832
function(cache) {
    var deps = {};
    var mDeps;

    if (cache instanceof Cache) {
      deps = cache.deps;
      mDeps = cache.mDeps;
    } else if (typeof cache === 'object') {
      deps = cache;
    } else {
      fis.log.error('unable to merge deps of data[%s]', cache);
    }

    fis.util.map(deps, this.deps, true);
    mDeps && fis.util.map(mDeps, this.mDeps, true);
  }
875250
def serialize(obj)
      begin
        case @serializer
        when :marshal
          Marshal.dump(obj)
        when :json
          obj.to_json
        when :yaml
          YAML.dump(obj)
        end
      rescue => e
        PEROBS.log.fatal "Cannot serialize object as #{@serializer}: " +
          e.message
      end
    end
27058
def request(op, *args)
      verify_state
      raise Dalli::NetworkError, "#{name} is down: #{@error} #{@msg}. If you are sure it is running, ensure memcached version is > 1.4." unless alive?
      begin
        send(op, *args)
      rescue Dalli::MarshalError => ex
        Dalli.logger.error "Marshalling error for key '#{args.first}': #{ex.message}"
        Dalli.logger.error "You are trying to cache a Ruby object which cannot be serialized to memcached."
        Dalli.logger.error ex.backtrace.join("\n\t")
        false
      rescue Dalli::DalliError, Dalli::NetworkError, Dalli::ValueOverMaxSize, Timeout::Error
        raise
      rescue => ex
        Dalli.logger.error "Unexpected exception during Dalli request: #{ex.class.name}: #{ex.message}"
        Dalli.logger.error ex.backtrace.join("\n\t")
        down!
      end
    end
1280939
static byte[] marshallIDL4(final AttributeValue_4 attributeValue) throws DevFailed {
        XLOGGER.entry();
        final CDROutputStream os = new CDROutputStream();
        try {
            AttributeValue_4Helper.write(os, attributeValue);
            XLOGGER.exit();
            return cppAlignment(os.getBufferCopy());
        } finally {
            os.close();
        }
    }
604871
@Override
    public WsByteBuffer[] marshallLine() {
        WsByteBuffer[] firstLine = new WsByteBuffer[1];
        firstLine[0] = allocateBuffer(getOutgoingBufferSize());

        firstLine = putBytes(this.myMethod.getByteArray(), firstLine);
        firstLine = putByte(SPACE, firstLine);
        firstLine = putBytes(getMarshalledSecondToken(), firstLine);
        firstLine = putByte(SPACE, firstLine);
        firstLine = putBytes(getVersionValue().getByteArray(), firstLine);
        firstLine = putBytes(BNFHeaders.EOL, firstLine);
        // don't flip the last buffer as headers get tacked on the end
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            String url = GenericUtils.nullOutPasswords(getMarshalledSecondToken(), (byte) '&');
            Tr.event(tc, "Marshalling first line: " + getMethod() + " " + url + " " + getVersion());
        }
        return firstLine;
    }
11001
def in_cache(self, objpath, metahash):
        
        try:
            self.path_in_cache(objpath, metahash)
            return True
        except CacheMiss:
            return False
1127941
def _serialize_function(obj):
    
    try:
        obj = inspect.getsource(obj)
    except (TypeError, IOError):
        try:
            obj = marshal.dumps(obj)
        except ValueError:
            if hasattr(obj, '__dict__'):
                obj = _serialize_dict(obj.__dict__)
    return obj
867804
def dump_cache_fixtures!
      responses.each do |cache_key, response|
        path = filepath_for(cache_key)
        unless File.exist?(path)
          File.open(path, "wb") do |fp|
            fp.write(Marshal.dump(response))
          end
        end
      end
    end
1295648
ModuleMarshal marshal(Class<?> sourceType)
  {
    ModuleMarshal marshal = _marshalSourceMap.get(sourceType);
    
    if (marshal == null) {
      marshal = marshalImpl(sourceType);
      _marshalSourceMap.put(sourceType, marshal);
    }
    
    return marshal;
  }
811340
private void marshalUpdatedTimestamp() {
    PropertyMetadata updatedTimestampMetadata = entityMetadata.getUpdatedTimestampMetadata();
    if (updatedTimestampMetadata != null) {
      applyAutoTimestamp(updatedTimestampMetadata, System.currentTimeMillis());
    }
  }