This method include new issues to the ArticleMeta.

        data: legacy SciELO Documents JSON Type 3.
492354
def add_document(self, data):
        

        document = self.dispatcher(
            'add_article',
            data,
            self._admintoken
        )

        return json.loads(document)
582246
@Override
    public DevInfo_3 info_3() throws DevFailed {
        MDC.setContextMap(contextMap);
        xlogger.entry();
        deviceMonitoring.startRequest("Operation info_3");
        final DevInfo_3 info3 = new DevInfo_3();
        final DevInfo info = info();
        info3.dev_class = info.dev_class;
        info3.doc_url = info.doc_url;
        info3.server_host = info.server_host;
        info3.server_id = info.server_id;
        info3.server_version = info.server_version;
        info3.dev_type = deviceType;
        xlogger.exit();
        return info3;
    }
1339644
def as_json(options = {})
      result = self.attributes
      result['organization'] = self.organization.try(:name)
      result['environments'] = environments.map { |e| e.try(:name) }
      result['versions'] = versions.map(&:version)
      result['versions_details'] = versions.map do |v|
        {
          :version => v.version,
          :published => v.created_at.to_s,
          :environments => v.environments.map { |e| e.name }
        }
      end

      if options && options[:environment].present?
        result['repositories'] = repos(options[:environment]).map(&:name)
      end

      result
    end
508383
function prepareEPUBDataForIndexing(metaData) {

    if (!metaData.spineItems.length)
        return;

    var data = [];

    const arrayOfPromises = metaData.spineItems.map(spineItem => {
        return helper.getContent(spineItem.href)
            .then(body => { return cheerio.load(body); })
    });

    return Promise.all(arrayOfPromises)
        .then((arrayOf$) => {

            arrayOf$.forEach(($, i) => {
                const doc = {};
                $("title").each((i, e) => {
                    doc.title = trim($(e).text());
                });
                $("body").each((i, e) => {
                    doc.body = trim($(e).text());
                });
                setMetaData(doc, metaData, metaData.spineItems[i]);
                data.push(doc);
            });
            return data;
        })
        .catch(err => {
            winston.log('error', 'prepareEPUBDataForIndexing: ' + err);
        });
}
621555
@POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
    public static Collection<Utterance> mapTextWithOptions(final AnalysisRequest r)
            throws IOException, InterruptedException, JAXBException, SQLException, ParserConfigurationException,
                   SAXException {

        System.out.println(r);

        // metamap options
        final Collection<Option> opts = new ArrayList<>();
        final Set<String> optionNames = new HashSet<>();
        for (final String o : r.getOptions()) {
            final Option opt = MetaMapOptions.strToOpt(o);
            if (opt != null) {
                optionNames.add(opt.name());
                if (!opt.useProcessorDefault()) opts.add(opt);
            }
        }
        // always make sure we have a restrict_to_sources option
        if (!optionNames.contains(new RestrictToSources().name())) opts.add(new RestrictToSources());

        // tmp files for metamap in/out
        final File infile = File.createTempFile("metamap-input-", ".txt");
        final File outfile = File.createTempFile("metamap-output-", ".xml");
        final String s = r.getText() + (r.getText().endsWith("\n") ? "" : "\n");
        final String ascii = MetaMap.decomposeToAscii(URLDecoder.decode(s, "UTF-8"));
        Files.write(ascii, infile, Charsets.UTF_8);
        // we don't want too much data for a free service
        if (infile.length() > MAX_DATA_BYTES) {
            throw new WebApplicationException(
                    Response.status(Responses.NOT_ACCEPTABLE)
                            .entity("Too much data, currently limited to " + MAX_DATA_BYTES + " bytes.")
                            .type("text/plain").build()
            );
        }

        // process the data with MetaMap
        final MetaMap metaMap = new MetaMap(PUBLIC_MM_DIR, opts);
        if (!metaMap.process(infile, outfile)) {
            throw new WebApplicationException(Response.status(INTERNAL_SERVER_ERROR)
                                                      .entity("Processing failed, aborting.")
                                                      .type("text/plain").build());
        }

        // look up the SNOMED codes from the UMLS CUI code/description combinations returned by MetaMap
        final MMOs root = JaxbLoader.loadXml(outfile);
        try (final SnomedLookup snomedLookup = new SnomedLookup(DB_PATH)) {
            snomedLookup.enrichXml(root);
        }

        //noinspection ResultOfMethodCallIgnored
        infile.delete();
        //noinspection ResultOfMethodCallIgnored
        outfile.delete();

        return destructiveFilter(root);
    }
1322878
@SuppressWarnings("unused") // called through reflection by RequestServer
  public MetadataV3 listSchemas(int version, MetadataV3 docs) {
    Map<String, Class<? extends Schema>> ss = SchemaServer.schemas();
    docs.schemas = new SchemaMetadataV3[ss.size()];

    // NOTE: this will throw an exception if the classname isn't found:
    int i = 0;
    for (Class<? extends Schema> schema_class : ss.values()) {
      // No hardwired version! YAY!  FINALLY!

      Schema schema = Schema.newInstance(schema_class);
      // get defaults
      try {
        Iced impl = (Iced) schema.getImplClass().newInstance();
        schema.fillFromImpl(impl);
      }
      catch (Exception e) {
        // ignore if create fails; this can happen for abstract classes
      }

      docs.schemas[i++] = new SchemaMetadataV3(new SchemaMetadata(schema));
    }
    return docs;
  }
1152295
function(req, res) {
        if (req.headers.accept == 'application/json') {
            res.header('Content-Type', 'application/json');
            res.status(200).json({
                data: {
                    ontologyTxt: req.rawOntology,
                    mimeType: req.mimeType
                },
                requestDelay: req.requestDelay,
                serverTime: new Date().getTime()
            });
        } else {
            res.header('Content-Type', req.mimeType);
            res.status(200).send(req.rawOntology);
        }
    }
748171
function prepareEPUBDataForIndexing(metaData, data) {
    if(!metaData.spineItems.length) {
        return;
    }

    if (!data.FirstSpineItemsId) {
        data.FirstSpineItemsId = [];
    }

    data.FirstSpineItemsId.push(
        metaData.spineItems[0].id + ':' + metaData.title
    );

    metaData.spineItems.forEach( spineItem => {
        const spineItemPath = metaData.manifestPath + '/' + spineItem.href;
        const json = htmlToJSON(spineItemPath);
        setMetaData(json, metaData, spineItem);
        data.push(json);
    });
}
62549
function JsonFind(doc) {
  const possibleJson = JSON.stringify(doc);

  if (possibleJson === undefined) {
    throw new Error('Object is invalid JSON');
  } else if (isAtom(doc) || doc === null) {
    return doc;
  } else {
    return Object.assign(Object.create(JSON_DATA), doc);
  }
}
349645
def update(collection_name, upsert, multi, spec, doc, safe, last_error_args):
    
    options = 0
    if upsert:
        options += 1
    if multi:
        options += 2

    data = __ZERO
    data += bson._make_c_string(collection_name)
    data += struct.pack("<i", options)
    data += bson.BSON.encode(spec)
    data += bson.BSON.encode(doc)
    if safe:
        (_, update_message) = __pack_message(2001, data)
        (request_id, error_message) = __last_error(last_error_args)
        return (request_id, update_message + error_message)
    else:
        return __pack_message(2001, data)
185571
function prepareResponse(validDataSources, invalidDataSources, cb) {
  //There Were Errors Updating Data Sources, should return an error

  logger.debug("prepareResponse Before", validDataSources);
  //For The Valid Data Sources, Just want the updated Document JSON
  validDataSources = _.map(validDataSources, function(validDataSourceData) {
    return processDataSourceResponse(validDataSourceData.document.toJSON());
  });

  logger.debug("prepareResponse After", validDataSources);

  var returnError;
  if (invalidDataSources.length > 0) {
    returnError = buildErrorResponse({
      error: new Error("Error Updating Data Sources"),
      code: ERROR_CODES.FH_FORMS_UNEXPECTED_ERROR
    });
  }

  return cb(returnError, {
    validDataSourceUpdates: validDataSources,
    invalidDataSourceUpdates: invalidDataSources
  });
}
1121438
@Deprecated
  @SuppressWarnings("unused") // called through reflection by RequestServer
  public MetadataV3 fetchSchemaMetadataByClass(int version, MetadataV3 docs) {
    docs.schemas = new SchemaMetadataV3[1];
    // NOTE: this will throw an exception if the classname isn't found:
    SchemaMetadataV3 meta = new SchemaMetadataV3(SchemaMetadata.createSchemaMetadata(docs.classname));
    docs.schemas[0] = meta;
    return docs;
  }
300613
def filtra_json(pandoc_json_tree)
      # Exemplo de código:
      
      # {"blocks":[{"t":"OrderedList","c":[[1,{"t":"LowerAlpha"},{"t":"OneParen"}],[[{"t":"Plain","c":[{"t":"Str","c":"item"},{"t":"Space"},{"t":"Str","c":"1."}]}],[{"t":"Plain","c":[{"t":"Str","c":"item"},{"t":"Space"},{"t":"Str","c":"2."}]}],[{"t":"Plain","c":[{"t":"Str","c":"item"},{"t":"Space"},{"t":"Str","c":"3."}]}]]]}],"pandoc-api-version":[1,17,0,4],"meta":{}}
      tree = JSON.parse(pandoc_json_tree)
      meta = tree["meta"]
      blocks = tree["blocks"]
      api = tree["pandoc-api-version"]
      
      filtrados = []
      anterior = nil
      
      if not blocks
        raise ArgumentError, "Problema no argumento passado: #{pandoc_json_tree}"
      end

      blocks.each do |node|
        if (lista?(node)) then
          lista_modificada = processa_items_da_lista(node)
          filtrados << lista_modificada
        else
          filtrados << node
        end
      end
      JSON.generate({"blocks"=>filtrados, "pandoc-api-version" => api, "meta" => meta})
    end
715043
def safe_json_response(method):
    

    def _safe_document(document):
        """ function modifies the document in place
            it iterates over the json document and stringify all non-string types
            :return: modified document """
        assert isinstance(document, dict), 'Error: provided document is not of DICT type: {0}' \
            .format(document.__class__.__name__)

        for key, value in document.items():
            if isinstance(value, dict):
                document[key] = {k: str(v) for k, v in value.items()}
            elif isinstance(value, list):
                document[key] = [str(v) for v in value]
            else:
                document[key] = str(document[key])
        return document

    @functools.wraps(method)
    def _wrapper(self, *args, **kwargs):
        try:
            document = method(self, *args, **kwargs)
            return _safe_document(document)
        except Exception as e:
            return self.reply_server_error(e)

    return _wrapper
1139670
@SuppressWarnings("unchecked")
  private Map<String, Object> convertToMap(Object jsonDocument) {
    Map<String, Object> jsonMap = new LinkedHashMap<>();

    // Document is a text block
    if (!(jsonDocument instanceof JSONObject)) {
      jsonMap.put("content", jsonDocument);
      return jsonMap;
    }

    JSONObject obj = (JSONObject) jsonDocument;
    for (String key : obj.keySet()) {
      Object value = obj.get(key);

      if (value instanceof JSONObject) {
        value = convertToMap(value);
      } else if (value instanceof JSONArray) {
        ArrayList<Map<String, Object>> collection = new ArrayList<>();

        for (Object element : ((JSONArray) value)) {
          collection.add(convertToMap(element));
        }

        value = collection;
      }

      jsonMap.put(key, value);
    }
    return jsonMap;

  }
82366
def update_mapping_meta(self, doc_type, values, indices=None):
        
        indices = self._validate_indices(indices)
        for index in indices:
            mapping = self.mappings.get_doctype(index, doc_type)
            if mapping is None:
                continue
            meta = mapping.get_meta()
            meta.update(values)
            mapping = {doc_type: {"_meta": meta}}
            self.indices.put_mapping(doc_type=doc_type, mapping=mapping, indices=indices)
937798
function filterJson(query, data) {
  let newData = data;

  if ('summary' in query) {
    newData = _(data).reduce((memo, layer) => {
      memo[layer.name] = {
        features: layer.features.length,
        jsonsize: JSON.stringify(layer).length,
      };
      return memo;
    }, {});
  } else if ('nogeo' in query) {
    // Recursively remove all "geometry" fields, replacing them with geometry's size
    const filter = (val, key) => {
      if (key === 'geometry') {
        return val.length;
      } else if (_.isArray(val)) {
        return _.map(val, filter);
      } else if (_.isObject(val)) {
        _.each(val, (v, k) => {
          val[k] = filter(v, k);
        });
      }
      return val;
    };
    newData = _.map(data, filter);
  }
  return newData;
}