Run the correct serialization to load a file
512191
def load(self, fn_):
        '''
        
        '''
        data = fn_.read()
        fn_.close()
        if data:
            if six.PY3:
                return self.loads(data, encoding='utf-8')
            else:
                return self.loads(data)
1263315
def load_json(filename, **kwargs):
    

    with open(filename, 'r', encoding='utf-8') as f:
        return json.load(f, **kwargs)
1259538
private void init()
    {
        if (_parent != null) {
            _serializerFiles.addAll(_parent._serializerFiles);
            _deserializerFiles.addAll(_parent._deserializerFiles);

            _serializerClassMap.putAll(_parent._serializerClassMap);
            _deserializerClassMap.putAll(_parent._deserializerClassMap);
        }

        if (_parent == null) {
            _serializerClassMap.putAll(_staticSerializerMap);
            _deserializerClassMap.putAll(_staticDeserializerMap);
            _deserializerClassNameMap.putAll(_staticClassNameMap);
        }

        HashMap<Class, Class> classMap;

        classMap = new HashMap<Class, Class>();
        initSerializerFiles("META-INF/hessian/serializers",
            _serializerFiles,
            classMap,
            Serializer.class);

        for (Map.Entry<Class, Class> entry : classMap.entrySet()) {
            try {
                Serializer ser = (Serializer) entry.getValue().newInstance();

                if (entry.getKey().isInterface())
                    _serializerInterfaceMap.put(entry.getKey(), ser);
                else
                    _serializerClassMap.put(entry.getKey().getName(), ser);
            } catch (Exception e) {
                throw new HessianException(e);
            }
        }

        classMap = new HashMap<Class, Class>();
        initSerializerFiles("META-INF/hessian/deserializers",
            _deserializerFiles,
            classMap,
            Deserializer.class);

        for (Map.Entry<Class, Class> entry : classMap.entrySet()) {
            try {
                Deserializer ser = (Deserializer) entry.getValue().newInstance();

                if (entry.getKey().isInterface())
                    _deserializerInterfaceMap.put(entry.getKey(), ser);
                else {
                    _deserializerClassMap.put(entry.getKey().getName(), ser);
                }
            } catch (Exception e) {
                throw new HessianException(e);
            }
        }
    }
136749
def read
      serialized = File.read(path)
      extract_links(JSON.parse(serialized)).flatten.each_slice(4).to_a
    end
1257465
def serialize(path, data)
      # Make a path to the data file if one doesn't already exist
      mkpath_to path

      File.open(path, "w") do |f|
        f.puts data.to_json
      end
    end
410963
private void readObject(ObjectInputStream in)
        throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        if (null != params) {
            this.serializer = params.getDefaultSerializer();
        }
    }
1312807
function Serializer () {
  var self = this, args = fun(arguments);

  self.klass = self.klass || Serializer;

  self.options = Object.merge(self.klass.defaults.options, args.objects()[0] || {}, true);
  self.engine = null;
  self.binary = false;
}
788442
def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw):
        '''
        

        '''
        raise EvaluateException("Unimplemented evaluation", sw.Backtrace(elt))
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))
            )
201251
def do_serialize(self, line):
        """"""
        opts = self.SERIALIZE_OPTS

        if not self.current:
            self._help_noontology()
            return

        line = line.split()
        g = self.current['graph']

        if not line:
            line = ['turtle']

        if line[0] not in opts:
            self.help_serialize()
            return

        elif self.currentEntity:
            self.currentEntity['object'].printSerialize(line[0])

        else:
            self._print(g.rdf_source(format=line[0]))
42907
public static void serialize(Object object, String file) throws Exception {
        if (object instanceof Serializable) {
            try (FileOutputStream fileOut = new FileOutputStream(file); ObjectOutputStream out =
                    new ObjectOutputStream(fileOut)) {
                out.writeObject(object);
            }
        } else {
            throw new Exception(object.getClass().getName() + " doesn't implements serializable interface");
        }
    }
308524
static void serialize(DataOutput out, Serializers serializers)
      throws IOException {
    StringBuilder msg = new StringBuilder(String.format("Serialize %d serializer classes:", serializers.serializers.values().size()));
    int size = serializers.serializers.values().size();

    out.writeInt(size);
    if (size > 0) {
      for (SerializerWrapper sw : serializers.serializers.values()) {
        int index = sw.index;
        String name = sw.serializer.getClass().getName();

        out.writeInt(index);
        out.writeUTF(name);

        msg.append(String.format("%n  (%d) %s", index, name));
      }
      LOGGER.info(msg.toString());
    }
  }
1348907
protected void serialize(DataTree dt,Map<Long, Long> sessions,
            OutputArchive oa, FileHeader header) throws IOException {
        // this is really a programmatic error and not something that can
        // happen at runtime
        if(header==null)
            throw new IllegalStateException(
                    "Snapshot's not open for writing: uninitialized header");
        header.serialize(oa, "fileheader");
        SerializeUtils.serializeSnapshot(dt,oa,sessions);
    }
140512
def load(self, file, name=None):
        """"""
        if name is None:
            name = self.format_from_extension(op.splitext(file)[1])
        file_format = self.file_type(name)
        if file_format == 'text':
            return _read_text(file)
        elif file_format == 'json':
            return _read_json(file)
        else:
            load_function = self._formats[name].get('load', None)
            if load_function is None:
                raise IOError("The format must declare a file type or "
                              "load/save functions.")
            return load_function(file)
832743
def load(path, **kw):
    
    _kw = {}
    if PY3:  # pragma: no cover
        _kw['encoding'] = 'utf-8'
    with open(str(path), **_kw) as fp:
        return json.load(fp, **kw)
407544
def load(self):
        """"""
        if self.is_file_persisted:
            self.object_file.open()
            temp = dill.loads(self.object_file.read())
            self.set_object(temp)
            self.object_file.close()
1367028
def load(self):
        """"""
        if self.is_persisted:
            with open(self.file_name, 'rb') as f:
                self.object_property = pickle.load(f)