text:
package org.apache.rocketmq.connect.runtime.store;

import io.openmessaging.connector.api.PositionStorageReader;
import java.nio.ByteBuffer;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.apache.rocketmq.connect.runtime.service.PositionManagementService;

public class PositionStorageReaderImpl implements PositionStorageReader {

    private PositionManagementService positionManagementService;

    public PositionStorageReaderImpl(PositionManagementService positionManagementService) {

        this.positionManagementService = positionManagementService;
    }

    @Override
    public ByteBuffer getPosition(ByteBuffer partition) {

        return positionManagementService.getPositionTable().get(partition);
    }

    @Override
    public Map<ByteBuffer, ByteBuffer> getPositions(Collection<ByteBuffer> partitions) {

        Map<ByteBuffer, ByteBuffer> result = new HashMap<>();
        Map<ByteBuffer, ByteBuffer> allData = positionManagementService.getPositionTable();
        for (ByteBuffer key : partitions) {
            if (allData.containsKey(key)) {
                result.put(key, allData.get(key));
            }
        }
        return result;
    }
}


text:
package com.gajdulewicz.finush

import javax.inject.{Inject, Singleton}

import com.gajdulewicz.finush.services.UrlStorage
import com.twitter.finagle.http.Request
import com.twitter.finatra.http.Controller
import com.twitter.finatra.validation.NotEmpty
@Singleton
class UrlController @Inject()(urlStorage: UrlStorage) extends Controller {

  get("/") { request: Request =>
    info("ping")
    "Welcome to Finush"
  }

  get("/url/:id") { request: Request =>
    val id = request.params("id")
    info("You looked up " + id)
    val url = urlStorage.get(id)
    response.movedPermanently.location(url.link)
  }

  get("/url") { request: Request =>
    info("You asked for all")
    urlStorage.getAll()
  }

  post("/url") { lr: LinkRequest =>
    info("You wanted to create a link")
    urlStorage.create(lr.link)
  }

}

case class LinkRequest(@NotEmpty link: String)

redpajama_set_name: RedPajamaGithub


text:
layout: model
title: Spanish Legal RoBERTa Embeddings
author: John Snow Labs
name: roberta_embeddings_RoBERTalex
date: 2022-04-14
tags: [roberta, embeddings, es, open_source]
task: Embeddings
language: es
edition: Spark NLP 3.4.2
spark_version: 3.0
supported: true
recommended: true
annotator: RoBertaEmbeddings
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

RoBERTa Legal Embeddings, trained by `PlanTL-GOB-ES`.

{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
<button class="button button-orange" disabled>Open in Colab</button>
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/public/models/roberta_embeddings_RoBERTalex_es_3.4.2_3.0_1649945353788.zip){:.button.button-orange.button-orange-trans.arr.button-icon}

## How to use

<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}
```python
documentAssembler = DocumentAssembler() \
.setInputCol("text") \
.setOutputCol("document")

tokenizer = Tokenizer() \
.setInputCols("document") \
.setOutputCol("token")

embeddings = RoBertaEmbeddings.pretrained("roberta_embeddings_RoBERTalex","es") \
.setInputCols(["document", "token"]) \
.setOutputCol("embeddings")

pipeline = Pipeline(stages=[documentAssembler, tokenizer, embeddings])

data = spark.createDataFrame([["Me encanta chispa nlp"]]).toDF("text")

result = pipeline.fit(data).transform(data)
```
```scala
val documentAssembler = new DocumentAssembler()
.setInputCol("text")
.setOutputCol("document")

val tokenizer = new Tokenizer()
.setInputCols(Array("document"))
.setOutputCol("token")

val embeddings = RoBertaEmbeddings.pretrained("roberta_embeddings_RoBERTalex","es")
.setInputCols(Array("document", "token"))
.setOutputCol("embeddings")

val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, embeddings))

val data = Seq("Me encanta chispa nlp").toDF("text")

val result = pipeline.fit(data).transform(data)
```

{:.nlu-block}
```python
import nlu
nlu.load("es.embed.RoBERTalex").predict("""Me encanta chispa nlp""")
```

</div>

{:.model-param}
## Model Information

{:.table-model}
|---|---|
|Model Name:|roberta_embeddings_RoBERTalex|
|Compatibility:|Spark NLP 3.4.2+|
|License:|Open Source|
|Edition:|Official|
|Input Labels:|[sentence, token]|
|Output Labels:|[bert]|
|Language:|es|
|Size:|300.9 MB|
|Case sensitive:|true|

## References

- https://huggingface.co/BSC-TeMU/RoBERTalex
- https://github.com/PlanTL-GOB-ES/lm-legal-es


text:
require "spec_helper"

module Doorkeeper::OAuth
  describe ForbiddenTokenResponse do
    describe "#name" do
      it { expect(subject.name).to eq(:invalid_scope) }
    end

    describe "#status" do
      it { expect(subject.status).to eq(:forbidden) }
    end

    describe :from_scopes do
      it "should have a list of acceptable scopes" do
        response = ForbiddenTokenResponse.from_scopes(["public"])
        expect(response.description).to include("public")
      end
    end
  end
end


text:
package blade.migrate.liferay70;

import blade.migrate.api.FileMigrator;
import blade.migrate.core.JavaFileChecker;
import blade.migrate.core.JavaFileMigrator;
import blade.migrate.core.SearchResult;

import java.io.File;
import java.util.List;

import org.osgi.service.component.annotations.Component;

@Component(
	property = {
		"file.extensions=java,jsp,jspf",
		"problem.summary=All Lock APIs previously exposed as Liferay Portal API in 6.2 have been move out from portal-service into separate OSGi modules",
		"problem.tickets=LPS-55791",
		"problem.title=Lock APIs migrated to OSGi module",
		"problem.section=#legacy"
	},
	service = FileMigrator.class
)
public class LockLegacyAPI extends JavaFileMigrator {

	private static final String[] SERVICE_API_PREFIXES =  {
		"com.liferay.portal.service.Lock"
	};

	@Override
	protected List<SearchResult> searchJavaFile(File file, JavaFileChecker javaFileChecker) {
		return javaFileChecker.findServiceAPIs(SERVICE_API_PREFIXES);
	}
}