text:
package lagom.build

import lagom.build.Dependencies.akkaActorTyped
import lagom.build.Dependencies.junit
import sbt.Keys._
import sbt._

object Dependencies {
  object Versions {
    // Version numbers

    val Scala210 = "2.10.7"
    val Scala212 = "2.12.13"
    val Scala213 = "2.13.5"
    val Scala    = Seq(Scala212, Scala213)
    val SbtScala = Seq(Scala212, Scala210)

    // If you update the version of Play, you probably need to update the other Play* variables.
    val Play             = "2.8.11" // sync with docs/build.sbt
    val PlayJson         = "2.9.1"
    val PlayStandaloneWs = "2.1.6"
    val Twirl            = "1.5.1" // sync with docs/project/plugins.sbt
    val PlayFileWatch    = "1.1.14"

    val Akka: String = sys.props.getOrElse("lagom.build.akka.version", "2.6.17") // sync with docs/build.sbt
    val AkkaHttp     = "10.1.15"

    val AkkaPersistenceCassandra = "0.106"
    // this is the version used in AkkaPersistenceCassandra, we stick with it
    val CassandraDriver     = "3.7.2"
    val AkkaPersistenceJdbc = "3.5.3"
    val AkkaManagement      = "1.0.5"

    val Disruptor = "3.4.2"

    // Also be sure to update ScalaTestVersion in docs/build.sbt.
    val ScalaTest            = "3.0.8"
    val Jackson              = "2.11.4"
    val JacksonCore          = Jackson
    val JacksonDatatype      = Jackson
    val JacksonDatabind      = Jackson
    val Guava                = "30.1.1-jre"
    val Maven                = "3.6.2"
    val MavenWagon           = "3.3.3"
    val MavenResolver        = "1.4.1"
    val Netty                = "4.1.63.Final"
    val NettyReactiveStreams = "2.0.5"
    val Kafka                = "2.1.1"
    // adapt links in (java/scala)/KafkaClient.md for minor version changes
    val AlpakkaKafka  = "1.1.0"
    val Curator       = "2.12.0"
    val Immutables    = "2.8.2"
    val HibernateCore = "5.4.8.Final"
    val PCollections  = "3.0.5"

    val ScalaJava8Compat = "1.0.2"
    val ScalaXml         = "2.0.1"
    val Slick            = "3.3.2"
    // JUnit[Interface] should be sync with:
    //   lagomJUnitDeps in dev/sbt-plugin/src/main/scala/com/lightbend/lagom/sbt/LagomImport.scala
    //   JUnitVersion in docs/build.sbt
    val JUnit          = "4.13.2"
    val JUnitInterface = "0.11"

    val Slf4j   = "1.7.32"
    val Logback = "1.2.3"
    val Log4j   = "2.15.0"

    val jetty = "9.4.20.v20190813"

    val Selenium  = "3.141.59"
    val ByteBuddy = "1.10.5"
  }

  // Some setup before we start creating ModuleID vals
  private val slf4jApi = "org.slf4j" % "slf4j-api" % Versions.Slf4j
  private val slf4j: Seq[ModuleID] = Seq("jcl-over-slf4j", "jul-to-slf4j", "log4j-over-slf4j").map {
    "org.slf4j" % _ % Versions.Slf4j
  } ++ Seq(slf4jApi)
  private val excludeSlf4j = slf4j.map { moduleId =>
    ExclusionRule(moduleId.organization, moduleId.name)
  }
  private val log4jModules = Seq(
    "log4j-api",
    "log4j-core",
    "log4j-slf4j-impl"
  ).map(artifactId => ("org.apache.logging.log4j" % artifactId % Versions.Log4j).excludeAll(excludeSlf4j: _*))

  // Specific libraries that get reused
  private val scalaTest: ModuleID    = ("org.scalatest" %% "scalatest" % Versions.ScalaTest).excludeAll(excludeSlf4j: _*)
  private val guava                  = "com.google.guava" % "guava" % Versions.Guava
  private val scalaJava8Compat       = "org.scala-lang.modules" %% "scala-java8-compat" % Versions.ScalaJava8Compat
  private val scalaCollectionCompat  = "org.scala-lang.modules" %% "scala-collection-compat" % "2.1.2"
  private val scalaXml               = "org.scala-lang.modules" %% "scala-xml" % Versions.ScalaXml
  private val javassist              = "org.javassist" % "javassist" % "3.28.0-GA"
  private val byteBuddy              = "net.bytebuddy" % "byte-buddy" % Versions.ByteBuddy
  private val scalaParserCombinators = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
  private val typesafeConfig         = "com.typesafe" % "config" % "1.4.0"
  private val sslConfig              = "com.typesafe" %% "ssl-config-core" % "0.4.2"
  private val h2                     = "com.h2database" % "h2" % "1.4.192"
  private val cassandraDriverCore =
    ("com.datastax.cassandra" % "cassandra-driver-core" % Versions.CassandraDriver).excludeAll(excludeSlf4j: _*)

  private val akkaActor              = "com.typesafe.akka" %% "akka-actor" % Versions.Akka
  private val akkaRemote             = "com.typesafe.akka" %% "akka-remote" % Versions.Akka
  private val akkaCluster            = "com.typesafe.akka" %% "akka-cluster" % Versions.Akka
  private val akkaClusterSharding    = "com.typesafe.akka" %% "akka-cluster-sharding" % Versions.Akka
  private val akkaClusterTools       = "com.typesafe.akka" %% "akka-cluster-tools" % Versions.Akka
  private val akkaDistributedData    = "com.typesafe.akka" %% "akka-distributed-data" % Versions.Akka
  private val akkaJackson            = "com.typesafe.akka" %% "akka-serialization-jackson" % Versions.Akka
  private val akkaMultiNodeTestkit   = "com.typesafe.akka" %% "akka-multi-node-testkit" % Versions.Akka
  private val akkaPersistence        = "com.typesafe.akka" %% "akka-persistence" % Versions.Akka
  private val akkaPersistenceQuery   = "com.typesafe.akka" %% "akka-persistence-query" % Versions.Akka
  private val akkaPersistenceTestkit = "com.typesafe.akka" %% "akka-persistence-testkit" % Versions.Akka
  private val akkaSlf4j              = ("com.typesafe.akka" %% "akka-slf4j" % Versions.Akka).excludeAll(excludeSlf4j: _*)
  private val akkaStream             = "com.typesafe.akka" %% "akka-stream" % Versions.Akka
  private val akkaStreamTyped        = "com.typesafe.akka" %% "akka-stream-typed" % Versions.Akka
  private val akkaProtobuf_v3        = "com.typesafe.akka" %% "akka-protobuf-v3" % Versions.Akka

  // akka typed dependencies
  private val akkaActorTyped           = "com.typesafe.akka" %% "akka-actor-typed"            % Versions.Akka
  private val akkaClusterTyped         = "com.typesafe.akka" %% "akka-cluster-typed"          % Versions.Akka
  private val akkaPersistenceTyped     = "com.typesafe.akka" %% "akka-persistence-typed"      % Versions.Akka
  private val akkaClusterShardingTyped = "com.typesafe.akka" %% "akka-cluster-sharding-typed" % Versions.Akka

  private val akkaManagement                 = "com.lightbend.akka.management" %% "akka-management"                   % Versions.AkkaManagement
  private val akkaManagementClusterHttp      = "com.lightbend.akka.management" %% "akka-management-cluster-http"      % Versions.AkkaManagement
  private val akkaManagementClusterBootstrap = "com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % Versions.AkkaManagement

  private val akkaTestkit       = "com.typesafe.akka"   %% "akka-testkit"             % Versions.Akka
  private val akkaStreamTestkit = "com.typesafe.akka"   %% "akka-stream-testkit"      % Versions.Akka
  private val akkaTestkitTyped  = "com.typesafe.akka"   %% "akka-actor-testkit-typed" % Versions.Akka
  private val reactiveStreams   = "org.reactivestreams" % "reactive-streams"          % "1.0.3"

  private val akkaDiscovery = "com.typesafe.akka" %% "akka-discovery" % Versions.Akka

  private val akkaPersistenceJdbc =
    ("com.github.dnvriend" %% "akka-persistence-jdbc" % Versions.AkkaPersistenceJdbc).excludeAll(excludeSlf4j: _*)

  // latest version of APC depend on a Cassandra driver core that's not compatible with Lagom (newer netty/guava/etc... under the covers)
  private val akkaPersistenceCassandra         = "com.typesafe.akka" %% "akka-persistence-cassandra"          % Versions.AkkaPersistenceCassandra
  private val akkaPersistenceCassandraLauncher = "com.typesafe.akka" %% "akka-persistence-cassandra-launcher" % Versions.AkkaPersistenceCassandra
  private val akkaStreamKafka                  = "com.typesafe.akka" %% "akka-stream-kafka"                   % Versions.AlpakkaKafka
  private val kafkaClients                     = "org.apache.kafka"  % "kafka-clients"                        % Versions.Kafka

  private val akkaHttpCore      = "com.typesafe.akka" %% "akka-http-core"       % Versions.AkkaHttp
  private val akkaHttpRouteDsl  = "com.typesafe.akka" %% "akka-http"            % Versions.AkkaHttp
  private val akkaHttpSprayJson = "com.typesafe.akka" %% "akka-http-spray-json" % Versions.AkkaHttp
  private val akkaParsing       = "com.typesafe.akka" %% "akka-parsing"         % Versions.AkkaHttp

  private val sprayJson = "io.spray" %% "spray-json" % "1.3.6"

  private val play           = ("com.typesafe.play" %% "play"           % Versions.Play).excludeAll(excludeSlf4j: _*)
  private val playBuildLink  = ("com.typesafe.play" % "build-link"      % Versions.Play).excludeAll(excludeSlf4j: _*)
  private val playExceptions = ("com.typesafe.play" % "play-exceptions" % Versions.Play).excludeAll(excludeSlf4j: _*)
  private val playGuice      = ("com.typesafe.play" %% "play-guice"     % Versions.Play).excludeAll(excludeSlf4j: _*)
  private val playJava       = ("com.typesafe.play" %% "play-java"      % Versions.Play).excludeAll(excludeSlf4j: _*)
  private val playJdbc       = ("com.typesafe.play" %% "play-jdbc"      % Versions.Play).excludeAll(excludeSlf4j: _*)
  private val playNettyServer =
    ("com.typesafe.play" %% "play-netty-server" % Versions.Play).excludeAll(excludeSlf4j: _*)
  private val playAkkaHttpServer =
    ("com.typesafe.play" %% "play-akka-http-server" % Versions.Play).excludeAll(excludeSlf4j: _*)
  private val playServer = ("com.typesafe.play" %% "play-server" % Versions.Play).excludeAll(excludeSlf4j: _*)
  private val playTest   = ("com.typesafe.play" %% "play-test"   % Versions.Play).excludeAll(excludeSlf4j: _*)

  private val playWs    = ("com.typesafe.play" %% "play-ws"     % Versions.Play).excludeAll(excludeSlf4j: _*)
  private val playAhcWs = ("com.typesafe.play" %% "play-ahc-ws" % Versions.Play).excludeAll(excludeSlf4j: _*)
  private val playJson  = ("com.typesafe.play" %% "play-json"   % Versions.PlayJson).excludeAll(excludeSlf4j: _*)
  private val playFunctional =
    ("com.typesafe.play" %% "play-functional" % Versions.PlayJson).excludeAll(excludeSlf4j: _*)
  private val playFileWatch =
    ("com.lightbend.play" %% "play-file-watch" % Versions.PlayFileWatch).excludeAll(excludeSlf4j: _*)

  private val pcollections          = "org.pcollections" % "pcollections" % Versions.PCollections
  private val jsr250                = "javax.annotation" % "jsr250-api" % "1.0"
  private val junit                 = "junit" % "junit" % Versions.JUnit
  private val commonsLang           = "org.apache.commons" % "commons-lang3" % "3.9"
  private val javaxAnnotationApi    = "javax.annotation" % "javax.annotation-api" % "1.3.2"
  private val dropwizardMetricsCore = ("io.dropwizard.metrics" % "metrics-core" % "3.2.6").excludeAll(excludeSlf4j: _*)

  private val checkerQual = "org.checkerframework" % "checker-qual" % "3.8.0"

  private val okhttp3 = "com.squareup.okhttp3" % "okhttp" % "3.11.0"
  private val okio    = "com.squareup.okio"    % "okio"   % "2.4.1"
  private val kotlinDeps = Seq(
    "org.jetbrains.kotlin" % "kotlin-stdlib"        % "1.3.50",
    "org.jetbrains.kotlin" % "kotlin-stdlib-common" % "1.3.50",
    "org.jetbrains"        % "annotations"          % "13.0"
  )

  val ow2asmDeps = libraryFamily("org.ow2.asm", "7.2")(
    "asm",
    "asm-analysis",
    "asm-commons",
    "asm-tree",
    "asm-util"
  )

  private val jffi         = "com.github.jnr" % "jffi"          % "1.2.22"
  private val jnrConstants = "com.github.jnr" % "jnr-constants" % "0.9.14"
  private val jnrFfi       = "com.github.jnr" % "jnr-ffi"       % "2.1.10"
  private val jnrPosix     = "com.github.jnr" % "jnr-posix"     % "3.0.50"
  private val jnra64asm    = "com.github.jnr" % "jnr-a64asm"    % "1.0.0"
  private val jnrx86asm    = "com.github.jnr" % "jnr-x86asm"    % "1.0.2"

  private val mockitoCore = "org.mockito" % "mockito-core" % "3.2.4"

  private val jacksonFamily =
    libraryFamily("com.fasterxml.jackson.core", Versions.JacksonCore)(
      "jackson-annotations",
      "jackson-core"
    ) ++ libraryFamily("com.fasterxml.jackson.core", Versions.JacksonDatabind)(
      "jackson-databind"
    ) ++ libraryFamily("com.fasterxml.jackson.datatype", Versions.JacksonDatatype)(
      "jackson-datatype-jdk8",
      "jackson-datatype-jsr310",
      "jackson-datatype-guava",
      "jackson-datatype-pcollections",
    ) ++ libraryFamily("com.fasterxml.jackson.module", Versions.JacksonDatatype)(
      "jackson-module-parameter-names",
      "jackson-module-paranamer"
    ) ++ Seq("com.fasterxml.jackson.module" %% "jackson-module-scala" % Versions.JacksonDatatype) ++ libraryFamily(
      "com.fasterxml.jackson.dataformat",
      Versions.JacksonDatatype
    )(
      "jackson-dataformat-cbor",
    )

  val scalaParserCombinatorOverrides = Seq(scalaParserCombinators)

  // A whitelist of dependencies that Lagom is allowed to depend on, either directly or transitively.
  // This list is used to validate all of Lagom's dependencies.
  // By maintaining this whitelist, we can be absolutely sure of what we depend on, that we consistently depend on the
  // same versions of libraries across our modules, we can ensure also that we have no partial upgrades of families of
  // libraries (such as Play or Akka), and we will also be alerted when a transitive dependency is upgraded (because
  // the validation task will fail) which means we can manually check that it is safe to upgrade that dependency.
  val DependencyWhitelist: Def.Initialize[Seq[ModuleID]] = Def.setting {
    val scalaVersion = Keys.scalaVersion.value

    Seq(
      "aopalliance" % "aopalliance" % "1.0",
      cassandraDriverCore,
      akkaPersistenceJdbc,
      jffi,
      jnrConstants,
      jnrFfi,
      jnrPosix,
      jnra64asm,
      jnrx86asm,
      "com.google.code.findbugs" % "jsr305"                  % "3.0.2",
      "com.google.errorprone"    % "error_prone_annotations" % "2.5.1",
      guava,
      "com.google.j2objc"            % "j2objc-annotations"   % "1.3",
      "com.google.inject"            % "guice"                % "4.2.3",
      "com.google.inject.extensions" % "guice-assistedinject" % "4.2.3",
      "com.googlecode.usc"           % "jdbcdslog"            % "1.0.6.2",
      checkerQual,
      "javax.xml.bind"   % "jaxb-api"             % "2.3.1",
      "jakarta.xml.bind" % "jakarta.xml.bind-api" % "2.3.3",
      h2,
      "com.jolbox"   % "bonecp"          % "0.8.0.RELEASE",
      "com.lmax"     % "disruptor"       % Versions.Disruptor,
      "com.novocode" % "junit-interface" % Versions.JUnitInterface,
      typesafeConfig,
      sslConfig,
      akkaDiscovery,
      akkaHttpCore,
      akkaHttpRouteDsl,
      akkaHttpSprayJson,
      akkaStreamKafka,
      akkaJackson,
      akkaParsing,
      akkaManagement,
      akkaManagementClusterHttp,
      akkaManagementClusterBootstrap,
      akkaPersistenceCassandra,
      akkaPersistenceCassandraLauncher,
      akkaPersistenceTestkit,
      sprayJson,
      "com.typesafe.netty" % "netty-reactive-streams"      % Versions.NettyReactiveStreams,
      "com.typesafe.netty" % "netty-reactive-streams-http" % Versions.NettyReactiveStreams,
      "com.typesafe.play"  %% "cachecontrol"               % "2.0.0",
      playJson,
      playFunctional,
      // play client libs
      playWs,
      playAhcWs,
      "com.typesafe.play" %% "play-ws-standalone"      % Versions.PlayStandaloneWs,
      "com.typesafe.play" %% "play-ws-standalone-xml"  % Versions.PlayStandaloneWs,
      "com.typesafe.play" %% "play-ws-standalone-json" % Versions.PlayStandaloneWs,
      "com.typesafe.play" %% "play-ahc-ws-standalone"  % Versions.PlayStandaloneWs,
      "com.typesafe.play" % "shaded-asynchttpclient"   % Versions.PlayStandaloneWs,
      "com.typesafe.play" % "shaded-oauth"             % Versions.PlayStandaloneWs,
      playTest,
      // dependencies added by play-test
      "org.fluentlenium"        % "fluentlenium-core"       % "3.7.1",
      "org.seleniumhq.selenium" % "selenium-support"        % Versions.Selenium,
      "org.seleniumhq.selenium" % "selenium-api"            % Versions.Selenium,
      "org.seleniumhq.selenium" % "selenium-remote-driver"  % Versions.Selenium,
      "org.seleniumhq.selenium" % "selenium-firefox-driver" % Versions.Selenium,
      byteBuddy,
      "org.apache.commons"   % "commons-exec"    % "1.3",
      "commons-logging"      % "commons-logging" % "1.2",
      "com.google.code.gson" % "gson"            % "2.8.4",
      okhttp3,
      okio,
      "org.atteo.classindex"        % "classindex"         % "3.4",
      "org.seleniumhq.selenium"     % "htmlunit-driver"    % "2.36.0",
      "xalan"                       % "xalan"              % "2.7.2",
      "xalan"                       % "serializer"         % "2.7.2",
      "org.apache.commons"          % "commons-text"       % "1.7",
      "org.apache.httpcomponents"   % "httpmime"           % "4.5.9",
      "org.apache.httpcomponents"   % "httpclient"         % "4.5.9",
      "org.apache.httpcomponents"   % "httpcore"           % "4.4.11",
      "net.sourceforge.htmlunit"    % "htmlunit"           % "2.36.0",
      "net.sourceforge.htmlunit"    % "htmlunit-core-js"   % "2.36.0",
      "net.sourceforge.htmlunit"    % "neko-htmlunit"      % "2.36.0",
      "org.brotli"                  % "dec"                % "0.1.2",
      "xerces"                      % "xercesImpl"         % "2.12.0",
      "xml-apis"                    % "xml-apis"           % "1.4.01",
      "net.sourceforge.htmlunit"    % "htmlunit-cssparser" % "1.5.0",
      "commons-io"                  % "commons-io"         % "2.6",
      "commons-net"                 % "commons-net"        % "3.6",
      "org.eclipse.jetty.websocket" % "websocket-client"   % Versions.jetty,
      "org.eclipse.jetty"           % "jetty-client"       % Versions.jetty,
      "org.eclipse.jetty"           % "jetty-http"         % Versions.jetty,
      "org.eclipse.jetty"           % "jetty-util"         % Versions.jetty,
      "org.eclipse.jetty"           % "jetty-io"           % Versions.jetty,
      "org.eclipse.jetty"           % "jetty-xml"          % Versions.jetty,
      "org.eclipse.jetty.websocket" % "websocket-common"   % Versions.jetty,
      "org.eclipse.jetty.websocket" % "websocket-api"      % Versions.jetty,
      jsr250,
      "com.typesafe.play"  %% "twirl-api"      % Versions.Twirl,
      "com.typesafe.slick" %% "slick"          % Versions.Slick,
      "com.typesafe.slick" %% "slick-hikaricp" % Versions.Slick,
      "com.zaxxer"         % "HikariCP"        % "3.4.5",
      "commons-codec"      % "commons-codec"   % "1.11",
      dropwizardMetricsCore,
      "io.jsonwebtoken" % "jjwt" % "0.9.1",
      // Netty 3 uses a different package to Netty 4, and a different artifact ID, so can safely coexist
      "io.netty"            % "netty"                   % "3.10.6.Final",
      "javax.cache"         % "cache-api"               % "1.1.1",
      "javax.inject"        % "javax.inject"            % "1",
      "javax.transaction"   % "jta"                     % "1.1",
      "jakarta.transaction" % "jakarta.transaction-api" % "1.3.3",
      "joda-time"           % "joda-time"               % "2.10.5",
      "junit"               % "junit"                   % Versions.JUnit,
      "net.jodah"           % "typetools"               % "0.5.0",
      "org.lz4"             % "lz4-java"                % "1.8.0",
      "com.github.luben"    % "zstd-jni"                % "1.3.7-1",
      "org.agrona"          % "agrona"                  % "1.9.0",
      commonsLang,
      kafkaClients,
      "org.codehaus.mojo"               % "animal-sniffer-annotations" % "1.18",
      "org.hibernate"                   % "hibernate-validator"        % "5.2.4.Final",
      "org.hibernate.javax.persistence" % "hibernate-jpa-2.1-api"      % "1.0.2.Final",
      "org.immutables"                  % "value"                      % Versions.Immutables,
      javassist,
      "org.joda"       % "joda-convert"  % "1.9.2",
      "org.hamcrest"   % "hamcrest-core" % "1.3",
      "org.lmdbjava"   % "lmdbjava"      % "0.7.0",
      "com.hierynomus" % "asn-one"       % "0.5.0",
      pcollections,
      reactiveStreams,
      "org.scalactic" %% "scalactic" % Versions.ScalaTest,
      scalaTest,
      "org.scala-lang.modules" %% "scala-java8-compat" % Versions.ScalaJava8Compat,
      scalaParserCombinators,
      scalaXml,
      "org.scala-sbt"     % "test-interface" % "1.0",
      "org.typelevel"     %% "macro-compat"  % "1.1.1",
      "org.xerial.snappy" % "snappy-java"    % "1.1.7.2",
      "tyrex"             % "tyrex"          % "1.0.1",
      javaxAnnotationApi,
      scalaCollectionCompat,
      "com.google.guava"           % "failureaccess"          % "1.0.1",
      "com.google.guava"           % "listenablefuture"       % "9999.0-empty-to-avoid-conflict-with-guava",
      "com.google.protobuf"        % "protobuf-java"          % "3.10.0",
      "javax.activation"           % "activation"             % "1.1",
      "javax.activation"           % "javax.activation-api"   % "1.2.0",
      "jakarta.activation"         % "jakarta.activation-api" % "1.2.2",
      "com.thoughtworks.paranamer" % "paranamer"              % "2.8",
      mockitoCore,
      "org.objenesis" % "objenesis"        % "2.6",
      "net.bytebuddy" % "byte-buddy-agent" % Versions.ByteBuddy
    ) ++ jacksonFamily ++ crossLibraryFamily("com.typesafe.akka", Versions.Akka)(
      "akka-actor",
      "akka-actor-typed",
      "akka-cluster",
      "akka-cluster-typed",
      "akka-cluster-sharding",
      "akka-cluster-sharding-typed",
      "akka-cluster-tools",
      "akka-distributed-data",
      "akka-multi-node-testkit",
      "akka-persistence",
      "akka-persistence-typed",
      "akka-actor-testkit-typed", // remove this when https://github.com/akka/akka/pull/27830 is fixed
      "akka-persistence-query",
      "akka-protobuf-v3",
      "akka-remote",
      "akka-slf4j",
      "akka-stream",
      "akka-stream-typed",
      "akka-stream-testkit",
      "akka-testkit",
      "akka-coordination",
      "akka-pki"
    ) ++ libraryFamily("com.typesafe.play", Versions.Play)(
      "build-link",
      "play-exceptions",
      "play-netty-utils"
    ) ++ crossLibraryFamily("com.typesafe.play", Versions.Play)(
      "play",
      "play-guice",
      "play-java",
      "play-jdbc",
      "play-jdbc-api",
      "play-netty-server",
      "play-akka-http-server",
      "play-server",
      "play-streams",
    ) ++ libraryFamily("ch.qos.logback", Versions.Logback)(
      "logback-classic",
      "logback-core"
    ) ++ libraryFamily("io.netty", Versions.Netty)(
      "netty-buffer",
      "netty-codec",
      "netty-codec-http",
      "netty-common",
      "netty-handler",
      "netty-resolver",
      "netty-transport",
      "netty-transport-native-epoll",
      "netty-transport-native-unix-common"
    ) ++ libraryFamily("org.apache.logging.log4j", Versions.Log4j)(
      "log4j-api",
      "log4j-core",
      "log4j-slf4j-impl"
    ) ++ libraryFamily("org.scala-lang", scalaVersion)(
      "scala-library",
      "scala-reflect"
    ) ++ libraryFamily("org.slf4j", Versions.Slf4j)(
      "jcl-over-slf4j",
      "jul-to-slf4j",
      "log4j-over-slf4j",
      "slf4j-api",
      "slf4j-nop",
      "slf4j-log4j12"
    ) ++ ow2asmDeps ++ kotlinDeps.map(_ % Test)
  }

  // These dependencies are used by JPA to test, but we don't want to export them as part of our regular whitelist,
  // so we maintain it separately.
  val JpaTestWhitelist = Seq(
    "antlr"                            % "antlr"                           % "2.7.7",
    "com.fasterxml"                    % "classmate"                       % "1.3.4",
    "org.dom4j"                        % "dom4j"                           % "2.1.1",
    "javax.el"                         % "el-api"                          % "2.2",
    "javax.enterprise"                 % "cdi-api"                         % "1.1",
    "org.apache.geronimo.specs"        % "geronimo-jta_1.1_spec"           % "1.1.1",
    "org.hibernate"                    % "hibernate-core"                  % Versions.HibernateCore,
    "org.hibernate.common"             % "hibernate-commons-annotations"   % "5.1.0.Final",
    "org.jboss"                        % "jandex"                          % "2.0.5.Final",
    "org.jboss.logging"                % "jboss-logging"                   % "3.3.2.Final",
    "org.jboss.spec.javax.interceptor" % "jboss-interceptors-api_1.1_spec" % "1.0.0.Beta1",
    "javax.persistence"                % "javax.persistence-api"           % "2.2",
    "org.jboss.spec.javax.transaction" % "jboss-transaction-api_1.2_spec"  % "1.1.1.Final",
    "org.glassfish.jaxb"               % "jaxb-runtime"                    % "2.3.1",
    "org.glassfish.jaxb"               % "txw2"                            % "2.3.1",
    "com.sun.istack"                   % "istack-commons-runtime"          % "3.0.7",
    "org.jvnet.staxex"                 % "stax-ex"                         % "1.8",
    "com.sun.xml.fastinfoset"          % "FastInfoset"                     % "1.2.15"
  )

  // These dependencies are used by the Kafka tests, but we don't want to export them as part of our regular
  // whitelist, so we maintain it separately.
  val KafkaTestWhitelist = Seq(
    "com.101tec"                 % "zkclient"             % "0.11",
    "com.yammer.metrics"         % "metrics-core"         % "2.2.0",
    "jline"                      % "jline"                % "0.9.94",
    "com.typesafe.scala-logging" %% "scala-logging"       % "3.9.0",
    "net.sf.jopt-simple"         % "jopt-simple"          % "5.0.4",
    "org.apache.commons"         % "commons-math"         % "2.2",
    "org.apache.curator"         % "curator-client"       % Versions.Curator,
    "org.apache.curator"         % "curator-framework"    % Versions.Curator,
    "org.apache.curator"         % "curator-test"         % Versions.Curator,
    "org.apache.kafka"           %% "kafka"               % Versions.Kafka,
    "org.apache.zookeeper"       % "zookeeper"            % "3.4.13",
    "org.apache.yetus"           % "audience-annotations" % "0.5.0"
  )

  private def crossLibraryFamily(groupId: String, version: String)(artifactIds: String*) = {
    artifactIds.map(aid => groupId %% aid % version)
  }

  private def libraryFamily(groupId: String, version: String)(artifactIds: String*) = {
    artifactIds.map(aid => groupId % aid % version)
  }

  // Dependencies for each module
  val api = libraryDependencies ++= Seq(
    scalaParserCombinators,
    scalaXml,
    akkaActor,
    akkaSlf4j,
    akkaStream,
    akkaStreamTyped,
    akkaActorTyped,
    akkaJackson,
    play,
    guava,
    // Upgrades needed to match whitelist versions
    sslConfig,
    pcollections,
    playJson,
    jnrFfi,
    jffi,
    jnra64asm,
    jnrConstants,
    slf4jApi,
    scalaJava8Compat
  ) ++ jacksonFamily ++ ow2asmDeps // to match whitelist versions

  val `api-javadsl` = libraryDependencies ++= Seq(
    playJava,
    playGuice,
    pcollections,
    // Upgrades needed to match whitelist versions
    sslConfig,
    scalaTest                      % Test,
    "com.fasterxml.jackson.module" % "jackson-module-parameter-names" % Versions.Jackson % Test
  )

  val `api-scaladsl` = libraryDependencies ++= Seq(
    scalaCollectionCompat,
    // Upgrades needed to match whitelist versions
    sslConfig,
    scalaTest % Test
  )

  val immutables = libraryDependencies += "org.immutables" % "value" % Versions.Immutables

  val jackson = libraryDependencies ++= jacksonFamily ++ Seq(
    // Upgrades needed to match whitelist versions
    sslConfig,
    pcollections,
    akkaJackson,
    scalaJava8Compat,
    akkaTestkit    % Test,
    akkaActorTyped % Test,
    scalaTest      % Test,
    junit          % Test,
    slf4jApi       % Test,
    "com.novocode" % "junit-interface" % "0.11" % Test,
  )

  val `play-json` = libraryDependencies ++= Seq(
    playJson,
    akkaActor,
    akkaTestkit % Test,
    scalaTest   % Test,
    // Upgrades needed to match whitelist versions
    scalaOrganization.value % "scala-reflect" % scalaVersion.value,
    scalaJava8Compat,
    pcollections,
    scalaXml               % Test,
    scalaParserCombinators % Test
    // explicitly depend on particular versions of jackson
  ) ++ jacksonFamily ++ Seq(
    // explicitly depend on particular versions of guava
    guava
  )

  val `api-tools` = libraryDependencies ++= Seq(
    play,
    scalaTest % Test,
    // Upgrades needed to match whitelist versions
    reactiveStreams,
    sslConfig,
    playJson,
    scalaParserCombinators,
    scalaXml,
    akkaStream,
    akkaStreamTyped,
    akkaActor,
    akkaActorTyped,
    akkaJackson,
    akkaSlf4j,
    akkaProtobuf_v3,
    guava,
    jnrFfi,
    jffi,
    jnra64asm,
    jnrConstants,
    pcollections,
  ) ++ jacksonFamily ++ ow2asmDeps // to match whitelist versions

  val client = libraryDependencies ++= Seq(
    slf4jApi,
    playWs,
    playAhcWs,
    dropwizardMetricsCore,
    "com.typesafe.netty" % "netty-reactive-streams" % Versions.NettyReactiveStreams,
    "io.netty"           % "netty-codec-http" % Versions.Netty,
    scalaTest            % Test,
    // Upgrades needed to match whitelist versions
    sslConfig,
    "io.netty" % "netty-handler" % Versions.Netty,
    // update to enforce using snapshots in nightly jobs
    akkaActorTyped % Test,
  )

  val `client-javadsl` = libraryDependencies ++= Seq(
    akkaTestkit % Test,
    scalaTest   % Test,
    junit       % Test,
    mockitoCore % Test,
    // Upgrades needed to match allowed versions
    byteBuddy % Test
  )

  val `client-scaladsl` = libraryDependencies ++= Seq(
    scalaTest % Test
  )

  val `integration-client-javadsl` = libraryDependencies ++= Seq(
    playWs,
    playAhcWs,
    // we need to explicitly add akka-remote in test scope
    // because the test for LagomClientFactory needs it
    akkaRemote % Test,
    scalaTest  % Test,
    // Upgrades needed to match whitelist versions
    scalaCollectionCompat,
    // update to enforce using snapshots in nightly jobs
    akkaActorTyped % Test,
    akkaJackson
  )

  val server = libraryDependencies ++= Nil

  val `server-javadsl` = libraryDependencies ++= Seq(
    akkaManagement,
    slf4jApi,
    commonsLang,
    javaxAnnotationApi
  )

  val `server-scaladsl` = libraryDependencies ++= Seq(
    akkaManagement,
    slf4jApi,
    scalaTest % Test,
    // update to enforce using snapshots in nightly jobs
    akkaActorTyped % Test,
  )

  val `testkit-core` = libraryDependencies ++= Seq(
    akkaActor,
    akkaStream,
    akkaStreamTyped,
    play,
    akkaPersistenceCassandraLauncher,
    // Upgrades needed to match whitelist versions
    sslConfig,
    playJson,
    akkaSlf4j,
    scalaXml,
    jffi,
    jnrFfi,
    jnrConstants,
    jnrPosix,
    byteBuddy,
    // update to enforce using snapshots in nightly jobs
    akkaActorTyped,
    akkaJackson
  ) ++ ow2asmDeps // to match whitelist versions

  val `testkit-javadsl` = libraryDependencies ++= Seq(
    akkaStreamTestkit,
    playAkkaHttpServer % Test,
    scalaTest          % Test,
    "junit"            % "junit" % Versions.JUnit,
    h2                 % Test,
    // Without any binding, slf4j will print warnings when running tests
    "org.slf4j" % "slf4j-nop" % Versions.Slf4j % Test
  )

  val `testkit-scaladsl` = libraryDependencies ++= Seq(
    akkaStreamTestkit,
    playAkkaHttpServer % Test,
    scalaTest          % Test,
    "junit"            % "junit" % Versions.JUnit,
    h2                 % Test,
    // Without any binding, slf4j will print warnings when running tests
    "org.slf4j" % "slf4j-nop" % Versions.Slf4j % Test
  )

  val `integration-tests-javadsl` = libraryDependencies ++= Seq(
    playAkkaHttpServer % Test,
    playNettyServer    % Test,
    playTest           % Test,
    junit              % Test,
    slf4jApi           % Test,
    "com.novocode"     % "junit-interface" % "0.11" % Test,
    scalaTest,
    // Upgrades needed to match whitelist versions
    okio        % Test,
    byteBuddy   % Test,
    commonsLang % Test,
    "io.netty"  % "netty-transport-native-epoll" % Versions.Netty,
    "io.netty"  % "netty-transport-native-unix-common" % Versions.Netty,
    // update to enforce using snapshots in nightly jobs
    akkaActorTyped % Test,
  )

  val `integration-tests-scaladsl` = libraryDependencies ++= Seq(
    playAkkaHttpServer % Test,
    playNettyServer    % Test,
    playTest           % Test,
    junit              % Test,
    slf4jApi           % Test,
    "com.novocode"     % "junit-interface" % "0.11" % Test,
    scalaTest,
    okio        % Test,
    byteBuddy   % Test,
    commonsLang % Test,
    "io.netty"  % "netty-transport-native-epoll" % Versions.Netty,
    "io.netty"  % "netty-transport-native-unix-common" % Versions.Netty
  )

  val `lagom-akka-discovery-service-locator-core` = libraryDependencies ++= Seq(
    akkaDiscovery,
    slf4jApi,
    scalaTest % Test,
    // Upgrades needed to match whitelist versions
    scalaJava8Compat,
    scalaXml
  )

  val `lagom-akka-discovery-service-locator-scaladsl` = libraryDependencies ++= Seq(
    scalaTest          % Test,
    playAkkaHttpServer % Test,
    // update to enforce using snapshots in nightly jobs
    akkaStream
  )

  val `akka-management-core` = libraryDependencies ++= Seq(
    play,
    akkaManagement,
    // Upgrades needed to match whitelist versions
    akkaStream,
    akkaStreamTyped,
    akkaActor,
    akkaActorTyped,
    akkaJackson,
    akkaProtobuf_v3,
    akkaSlf4j,
    scalaXml,
    akkaHttpCore,
    akkaHttpRouteDsl,
    akkaHttpSprayJson,
    akkaParsing,
    guava,
    jnrFfi,
    jffi,
    jnra64asm,
    jnrConstants,
    pcollections,
    slf4jApi,
    playJson,
    playFunctional,
    scalaJava8Compat
  ) ++ jacksonFamily ++ ow2asmDeps // to match allowed versions

  val `akka-management-javadsl`  = libraryDependencies ++= Seq.empty[ModuleID]
  val `akka-management-scaladsl` = libraryDependencies ++= Seq.empty[ModuleID]

  val `cluster-core` = libraryDependencies ++= Seq(
    akkaCluster,
    akkaClusterTyped,
    akkaManagementClusterBootstrap,
    akkaManagementClusterHttp,
    akkaProtobuf_v3,
    akkaTestkit          % Test,
    akkaMultiNodeTestkit % Test,
    scalaTest            % Test,
    junit                % Test,
    slf4jApi             % Test,
    "com.novocode"       % "junit-interface" % "0.11" % Test,
    // Upgrades needed to match whitelist versions
    sslConfig,
    scalaJava8Compat,
    scalaParserCombinators,
    scalaXml,
    akkaSlf4j,
    playJson,
    sprayJson,
    jffi,
    jnrFfi,
    jnrConstants,
    // transitive dependencies from Akka Management
    // may not match the Akka version in use so
    // must be explicitly bumped
    akkaDiscovery,
    akkaClusterSharding,
    akkaClusterShardingTyped,
    akkaDistributedData,
    akkaPersistence,
    akkaClusterTools
  ) ++ Seq("logback-core", "logback-classic").map(
    "ch.qos.logback" % _ % Versions.Logback % Test
  )

  val `cluster-javadsl` = libraryDependencies ++= Seq(
    akkaTestkit          % Test,
    akkaMultiNodeTestkit % Test,
    scalaTest            % Test,
    junit                % Test,
    "com.novocode"       % "junit-interface" % "0.11" % Test,
    // Upgrades needed to match whitelist versions
    slf4jApi,
  )

  val `cluster-scaladsl` = libraryDependencies ++= Seq(
    akkaTestkit          % Test,
    akkaMultiNodeTestkit % Test,
    scalaTest            % Test,
    junit                % Test,
    "com.novocode"       % "junit-interface" % "0.11" % Test,
    // Upgrades needed to match whitelist versions
    sslConfig,
    scalaXml,
    akkaSlf4j
    // explicitly depend on particular versions of jackson
  ) ++ jacksonFamily ++ Seq(
    // explicitly depend on particular versions of guava
    guava,
    // Upgrades needed to match whitelist versions
    slf4jApi,
  )

  val `pubsub-javadsl` = libraryDependencies ++= Seq(
    akkaClusterTools,
    akkaTestkit          % Test,
    akkaMultiNodeTestkit % Test,
    akkaStreamTestkit    % Test,
    scalaTest            % Test,
    junit                % Test,
    slf4jApi             % Test,
    "com.novocode"       % "junit-interface" % "0.11" % Test,
    slf4jApi             % Test,
    // Upgrades needed to match whitelist versions
    jnrConstants,
    // explicitly depend on particular versions of jackson
  ) ++ jacksonFamily ++ Seq(
    // explicitly depend on particular versions of guava
    guava
  )

  val `pubsub-scaladsl` = libraryDependencies ++= Seq(
    akkaClusterTools,
    akkaTestkit          % Test,
    akkaMultiNodeTestkit % Test,
    akkaStreamTestkit    % Test,
    scalaTest            % Test,
    slf4jApi             % Test,
    // Upgrades needed to match whitelist versions
    sslConfig,
    scalaXml % Test,
    akkaSlf4j,
    jnrConstants
  )

  val `projection-core` = libraryDependencies ++= Seq(
    akkaClusterSharding,
    akkaSlf4j,
    akkaTestkit          % Test,
    akkaMultiNodeTestkit % Test,
    akkaStreamTestkit    % Test,
    scalaTest            % Test,
    junit                % Test,
    "com.novocode"       % "junit-interface" % "0.11" % Test,
    // Upgrades needed to match whitelist versions
    jnrConstants,
  )

  val `projection-scaladsl` = libraryDependencies ++= Seq.empty[ModuleID]

  val `projection-javadsl` = libraryDependencies ++= Seq.empty[ModuleID]

  val `persistence-core` = libraryDependencies ++= Seq(
    akkaActor, // explicit dependency for CRON builds using Akka snapshot versions
    akkaActorTyped,
    akkaPersistence,
    akkaPersistenceQuery,
    akkaClusterSharding,
    akkaPersistenceTyped,
    akkaClusterShardingTyped,
    akkaJackson,
    akkaSlf4j,
    play,
    akkaTestkit          % Test,
    akkaMultiNodeTestkit % Test,
    akkaStreamTestkit    % Test,
    scalaTest            % Test,
    junit                % Test,
    "com.novocode"       % "junit-interface" % "0.11" % Test,
    // Upgrades needed to match whitelist versions
    sslConfig,
    playJson,
    scalaXml
  ) ++ jacksonFamily // akka typed brings in jackson deps, but we Lagom has a more recent one

  val `persistence-testkit` = libraryDependencies ++= Seq(
    akkaPersistence,
    akkaTestkit,
    akkaTestkitTyped,
    slf4jApi,
    scalaJava8Compat,
    // Upgrades needed to match whitelist versions
    sslConfig
  )

  val `persistence-javadsl` = libraryDependencies ++= Seq(
    slf4jApi,
    // this mean we have production code depending on testkit
    akkaTestkit
  )

  val `persistence-scaladsl` = libraryDependencies ++= Seq(
    slf4jApi,
    // this mean we have production code depending on testkit
    akkaTestkit
  )
  val `persistence-cassandra-core` = libraryDependencies ++= Seq(
    slf4jApi,
    akkaPersistenceCassandra,
    akkaPersistenceCassandraLauncher % Test,
    // Upgrades needed to match whitelist versions
    sslConfig,
    dropwizardMetricsCore,
    scalaXml,
    jnrConstants,
    jnrPosix,
    "io.netty" % "netty-handler" % Versions.Netty
  )

  val `persistence-cassandra-javadsl` = libraryDependencies ++= Seq(
    junit % Test,
    jsr250
  )

  val `persistence-cassandra-scaladsl` = libraryDependencies ++= Seq(
    )

  val `persistence-jdbc-core` = libraryDependencies ++= Seq(
    slf4jApi,
    akkaPersistenceJdbc,
    playJdbc,
    junit % Test,
    h2    % Test,
    // Upgrades needed to match whitelist versions
    scalaCollectionCompat,
    scalaXml,
    jnrConstants,
    pcollections,
  )

  val `persistence-jdbc-javadsl` = libraryDependencies ++= Seq(
    h2 % Test
  )

  val `persistence-jdbc-scaladsl` = libraryDependencies ++= Seq(
    h2 % Test
  )

  val `persistence-jpa-javadsl` = libraryDependencies ++= Seq(
    "org.hibernate.javax.persistence" % "hibernate-jpa-2.1-api" % "1.0.2.Final" % Provided,
    "org.hibernate"                   % "hibernate-core" % Versions.HibernateCore % Test,
    h2                                % Test,
    javassist                         % Test,
    // Upgrades needed to match whitelist versions
    byteBuddy,
    jnrConstants
  )

  val `broker-javadsl` = libraryDependencies ++= Nil

  val `broker-scaladsl` = libraryDependencies ++= Nil

  val `kafka-client` = libraryDependencies ++= Seq(
    "org.slf4j" % "log4j-over-slf4j" % Versions.Slf4j,
    akkaStreamKafka.exclude("org.slf4j", "slf4j-log4j12"),
    scalaTest % Test,
    // Upgrades needed to match whitelist versions
    sslConfig,
    kafkaClients,
    scalaCollectionCompat,
    scalaJava8Compat
  )

  val `kafka-client-javadsl` = libraryDependencies ++= Seq(
    scalaTest % Test,
    // Upgrades needed to match whitelist versions
    sslConfig,
    kafkaClients,
    jnrConstants,
    scalaJava8Compat
  )

  val `kafka-client-scaladsl` = libraryDependencies ++= Seq(
    scalaTest % Test,
    // Upgrades needed to match whitelist versions
    sslConfig,
    kafkaClients,
    jnrConstants,
    scalaJava8Compat
  )

  val `kafka-broker` = libraryDependencies ++= Seq(
    kafkaClients,
    // Upgrades needed to match whitelist versions
    jnrConstants,
    pcollections,
    scalaCollectionCompat,
  )

  val `kafka-broker-javadsl` = libraryDependencies ++= Seq(
    slf4jApi,
    scalaTest % Test,
    junit     % Test,
    // Upgrades needed to match whitelist versions
    jnrPosix
  )

  val `kafka-broker-scaladsl` = libraryDependencies ++= Seq(
    scalaTest % Test,
    junit     % Test,
    // Upgrades needed to match whitelist versions
    jnrPosix
  )

  val logback = libraryDependencies ++= slf4j ++ Seq(
    // needed only because we use play.utils.Colors
    play,
    // Upgrades needed to match whitelist versions
    reactiveStreams,
    sslConfig,
    playJson,
    scalaParserCombinators,
    akkaStream,
    akkaStreamTyped,
    akkaActor,
    akkaActorTyped,
    akkaJackson,
    akkaSlf4j,
    akkaProtobuf_v3,
    scalaXml,
    guava,
    jnrFfi,
    jffi,
    jnra64asm,
    jnrConstants,
    pcollections,
    scalaJava8Compat
  ) ++ jacksonFamily ++ ow2asmDeps ++ Seq("logback-core", "logback-classic").map(
    "ch.qos.logback" % _ % Versions.Logback
  )

  val log4j2 = libraryDependencies ++= Seq(slf4jApi) ++
    log4jModules ++
    ow2asmDeps ++ // to match whitelist versions
    jacksonFamily ++
    Seq(
      "com.lmax" % "disruptor" % Versions.Disruptor,
      play,
      // Upgrades needed to match whitelist versions
      reactiveStreams,
      sslConfig,
      playJson,
      scalaXml,
      scalaParserCombinators,
      akkaStream,
      akkaStreamTyped,
      akkaActor,
      akkaActorTyped,
      akkaJackson,
      akkaSlf4j,
      akkaProtobuf_v3,
      guava,
      jnrFfi,
      jffi,
      jnra64asm,
      jnrConstants,
      pcollections,
      scalaJava8Compat
    )

  val `reloadable-server` = libraryDependencies ++= Seq(
    playServer,
    // Upgrades needed to match whitelist versions
    reactiveStreams,
    playJson,
    scalaParserCombinators,
    scalaXml,
    akkaStream,
    akkaStreamTyped,
    akkaActor,
    akkaActorTyped,
    slf4jApi,
    akkaSlf4j,
    akkaProtobuf_v3,
    jnrFfi,
    jffi,
    jnra64asm,
    jnrConstants,
    guava,
    scalaJava8Compat
//    checkerQual
  ) ++ ow2asmDeps // to match allowed versions

  val `server-containers` = libraryDependencies ++= Seq(
    // This is used in the code to check if the embedded cassandra server is started
    cassandraDriverCore,
  )

  val `build-tool-support` = libraryDependencies ++= Seq(
    playExceptions,
    playBuildLink,
    playFileWatch,
    // explicitly depend on particular versions of guava
    guava,
    scalaTest % Test
  )

  val `sbt-plugin` = libraryDependencies ++= Seq(
    // And this is needed to silence the datastax driver logging
    "org.slf4j" % "slf4j-nop" % Versions.Slf4j,
    scalaTest   % Test
  )

  val `maven-plugin` = libraryDependencies ++= Seq(
    "org.apache.maven"                % "maven-plugin-api"             % Versions.Maven,
    "org.apache.maven"                % "maven-core"                   % Versions.Maven,
    "org.apache.maven.plugin-testing" % "maven-plugin-testing-harness" % "3.3.0" % Test,
    slf4jApi,
    scalaTest % Test
  )

  val `maven-launcher` = libraryDependencies := Seq(
    "org.apache.maven" % "apache-maven" % Versions.Maven
  )

  val `service-locator` = libraryDependencies ++= Seq(
    playAkkaHttpServer,
    akkaHttpCore,
    scalaTest % Test,
    // update to enforce using snapshots in nightly jobs
    akkaActorTyped,
  )

  val `dev-mode-ssl-support` = libraryDependencies ++= Seq(
    playServer,
    akkaHttpCore,
    // updates to match whitelist
    akkaActor,
    akkaActorTyped,
    akkaJackson,
    akkaStream,
    akkaStreamTyped,
    akkaProtobuf_v3,
    akkaSlf4j,
    slf4jApi,
    pcollections,
    typesafeConfig,
    sslConfig,
    scalaXml,
    playJson,
    guava,
    scalaJava8Compat
//    checkerQual
  ) ++ jacksonFamily

  val `service-registry-client-core` =
    libraryDependencies ++= Seq(
      akkaDiscovery,
      slf4jApi,
      akkaTestkit % Test,
      scalaTest   % Test,
      // updates to match whitelist
      akkaActor,
      akkaActorTyped,
      scalaJava8Compat,
      // update to enforce using snapshots in nightly jobs
      akkaActorTyped % Test,
    )

  val `service-registry-client-javadsl` =
    libraryDependencies ++= Seq(
      akkaDiscovery,
      akkaTestkit    % Test,
      junit          % Test,
      "com.novocode" % "junit-interface" % "0.11" % Test,
      // update to enforce using snapshots in nightly jobs
      akkaActorTyped % Test,
    )

  val `service-registration-javadsl` = libraryDependencies ++= Nil

  val `devmode-scaladsl` =
    libraryDependencies ++= Seq(
      akkaDiscovery
    )

  val `play-integration-javadsl` = libraryDependencies ++= Nil

  val `cassandra-server` = libraryDependencies ++= Seq(
    akkaPersistenceCassandraLauncher,
    akkaPersistenceCassandra,
    // explicitly depend on particular versions of guava
    guava
  )

  val `kafka-server` = libraryDependencies ++= Seq(
    "org.apache.kafka" %% "kafka" % Versions.Kafka,
    // Note that curator 3.x is only compatible with zookeeper 3.5.x. Kafka currently uses zookeeper 3.4, hence we have
    // to use curator 2.x, which is compatible with zookeeper 3.4 (see the notice in
    // http://curator.apache.org/index.html - make sure to scroll to the bottom)
    "org.apache.curator" % "curator-framework" % Versions.Curator,
    "org.apache.curator" % "curator-test"      % Versions.Curator,
    javassist,
    scalaJava8Compat,
    scalaTest % Test,
    // explicitly depend on particular versions of guava
    guava
  )

  val validateDependencies = taskKey[Unit]("Validate Lagom dependencies to ensure they are whitelisted")
  val dependencyWhitelist  = settingKey[Seq[ModuleID]]("The whitelist of dependencies")
  val pruneWhitelist       = taskKey[Unit]("List items that can be pruned from the whitelist ")

  val validateDependenciesTask: Def.Initialize[Task[Unit]] = Def.task {
    // We validate compile dependencies to ensure that whatever we are exporting, we are exporting the right
    // versions. We validate test dependencies to ensure that our tests run against the same versions that we are
    // exporting
    val compileClasspath = (managedClasspath in Compile).value
    val testClasspath    = (managedClasspath in Test).value
    val cross            = CrossVersion(scalaVersion.value, scalaBinaryVersion.value)
    val log              = streams.value.log
    val svb              = scalaBinaryVersion.value

    val whitelist = (dependencyWhitelist.value ++ KafkaTestWhitelist).iterator
      .map(cross)
      .toTraversable
      .groupBy(crossModuleId => (crossModuleId.organization, crossModuleId.name))
      .iterator
      .map { case (key, crossModuleIds) => key -> crossModuleIds.map(_.revision) }
      .toMap

    val dupes = whitelist.collect { case (key, versions) if versions.size > 1 => (key, versions) }
    if (dupes.nonEmpty) {
      dupes.foreach {
        case ((org, id), revs) =>
          val revsS = revs.mkString("[", ", ", "]")
          log.error(s"[${name.value}] dependency $org:$id in whitelist with multiple versions: $revsS")
      }
      throw new DependencyWhitelistValidationFailed
    }

    def collectProblems(scope: String, classpath: Classpath) = {
      classpath.collect(Function.unlift { dep =>
        val moduleId = dep.get(moduleID.key).getOrElse {
          sys.error(s"Managed classpath dependency without moduleID: $dep")
        }

        whitelist.get((moduleId.organization, moduleId.name)) match {
          case None =>
            Some(moduleId -> s"[${name.value}] $scope dependency not in whitelist: $moduleId")
          case Some(revs) if revs.forall(moduleId.revision != _) =>
            val unmatched = revs.mkString("[", ", ", "]")
            Some(
              moduleId -> s"[${name.value}] $scope dependency ${moduleId.organization}:${moduleId.name} version ${moduleId.revision} doesn't match whitelist versions $unmatched"
            )
          case _ => None
        }
      })
    }

    val problems = collectProblems("Compile", compileClasspath) ++ collectProblems("Test", testClasspath)

    if (problems.nonEmpty) {
      problems.foreach(p => log.error(p._2))
      log.error(s"Found ${problems.length} errors.")

      log.debug {
        // This makes it very easy to fix the problem, by outputting a formatted list of dependencies to add.
        problems
          .map { problem =>
            val mid   = problem._1
            val cross = mid.name.endsWith("_" + svb)
            val m     = if (cross) "%%" else "%"
            val name  = if (cross) mid.name.dropRight(svb.length + 1) else mid.name
            s""""${mid.organization}" $m "$name" % "${mid.revision}""""
          }
          .sorted
          .mkString(
            "The following dependencies need to be added to the whitelist:\n",
            ",\n",
            ""
          )
      }
      if (sys.env.get("TRAVIS_EVENT_TYPE") != Some("cron"))
        throw new DependencyWhitelistValidationFailed
    }
  }

  val pruneWhitelistTask: Def.Initialize[Task[Unit]] = Def.task {
    val compileClasspath = (managedClasspath in Compile).value
    val testClasspath    = (managedClasspath in Test).value
    val cross            = CrossVersion(scalaVersion.value, scalaBinaryVersion.value)
    val log              = streams.value.log
    val svb              = scalaBinaryVersion.value

    val whitelist: Map[(String, String), String] = dependencyWhitelist.value.map { moduleId =>
      val crossModuleId = cross(moduleId)
      (crossModuleId.organization, crossModuleId.name) -> crossModuleId.revision
    }.toMap

    def collectProblems(scope: String, classpath: Classpath): Set[(String, String)] = {
      val modules: Set[(String, String)] =
        classpath.toSet[Attributed[File]].flatMap(_.get(moduleID.key)).map(mod => (mod.organization, mod.name))
      whitelist.keySet -- modules
    }

    val problems = collectProblems("Compile", compileClasspath) ++ collectProblems("Test", testClasspath)

    if (problems.nonEmpty) {
      problems.foreach(p => log.error(s"${name.value} - Found unnecessary whitelisted item: ${p._1}:${p._2}"))
    } else {
      log.error(s"${name.value} needs a complete whitelist.")
    }
  }
  val pruneWhitelistSetting = pruneWhitelist := pruneWhitelistTask.value

  val validateDependenciesSetting = validateDependencies := validateDependenciesTask.value
  val dependencyWhitelistSetting  = dependencyWhitelist := DependencyWhitelist.value

  private class DependencyWhitelistValidationFailed extends RuntimeException with FeedbackProvidedException {
    override def toString = "Dependency whitelist validation failed!"
  }
}


text:
package hu.akarnokd.rxjava2flow.internal.operators.nbp;

import static org.junit.Assert.*;
import static org.mockito.Mockito.*;

import org.junit.Test;

import hu.akarnokd.rxjava2flow.*;
import hu.akarnokd.rxjava2flow.NbpObservable.*;
import hu.akarnokd.rxjava2flow.disposables.Disposable;
import hu.akarnokd.rxjava2flow.subjects.nbp.NbpPublishSubject;
import hu.akarnokd.rxjava2flow.subscribers.nbp.NbpTestSubscriber;

public class NbpOperatorTakeUntilTest {

    @Test
    public void testTakeUntil() {
        Disposable sSource = mock(Disposable.class);
        Disposable sOther = mock(Disposable.class);
        TestObservable source = new TestObservable(sSource);
        TestObservable other = new TestObservable(sOther);

        NbpSubscriber<String> result = TestHelper.mockNbpSubscriber();
        NbpObservable<String> stringObservable = NbpObservable.create(source)
                .takeUntil(NbpObservable.create(other));
        stringObservable.subscribe(result);
        source.sendOnNext("one");
        source.sendOnNext("two");
        other.sendOnNext("three");
        source.sendOnNext("four");
        source.sendOnCompleted();
        other.sendOnCompleted();

        verify(result, times(1)).onNext("one");
        verify(result, times(1)).onNext("two");
        verify(result, times(0)).onNext("three");
        verify(result, times(0)).onNext("four");
        verify(sSource, times(1)).dispose();
        verify(sOther, times(1)).dispose();

    }

    @Test
    public void testTakeUntilSourceCompleted() {
        Disposable sSource = mock(Disposable.class);
        Disposable sOther = mock(Disposable.class);
        TestObservable source = new TestObservable(sSource);
        TestObservable other = new TestObservable(sOther);

        NbpSubscriber<String> result = TestHelper.mockNbpSubscriber();
        NbpObservable<String> stringObservable = NbpObservable.create(source).takeUntil(NbpObservable.create(other));
        stringObservable.subscribe(result);
        source.sendOnNext("one");
        source.sendOnNext("two");
        source.sendOnCompleted();

        verify(result, times(1)).onNext("one");
        verify(result, times(1)).onNext("two");
        verify(sSource, times(1)).dispose();
        verify(sOther, times(1)).dispose();

    }

    @Test
    public void testTakeUntilSourceError() {
        Disposable sSource = mock(Disposable.class);
        Disposable sOther = mock(Disposable.class);
        TestObservable source = new TestObservable(sSource);
        TestObservable other = new TestObservable(sOther);
        Throwable error = new Throwable();

        NbpSubscriber<String> result = TestHelper.mockNbpSubscriber();
        NbpObservable<String> stringObservable = NbpObservable.create(source).takeUntil(NbpObservable.create(other));
        stringObservable.subscribe(result);
        source.sendOnNext("one");
        source.sendOnNext("two");
        source.sendOnError(error);
        source.sendOnNext("three");

        verify(result, times(1)).onNext("one");
        verify(result, times(1)).onNext("two");
        verify(result, times(0)).onNext("three");
        verify(result, times(1)).onError(error);
        verify(sSource, times(1)).dispose();
        verify(sOther, times(1)).dispose();

    }

    @Test
    public void testTakeUntilOtherError() {
        Disposable sSource = mock(Disposable.class);
        Disposable sOther = mock(Disposable.class);
        TestObservable source = new TestObservable(sSource);
        TestObservable other = new TestObservable(sOther);
        Throwable error = new Throwable();

        NbpSubscriber<String> result = TestHelper.mockNbpSubscriber();
        NbpObservable<String> stringObservable = NbpObservable.create(source).takeUntil(NbpObservable.create(other));
        stringObservable.subscribe(result);
        source.sendOnNext("one");
        source.sendOnNext("two");
        other.sendOnError(error);
        source.sendOnNext("three");

        verify(result, times(1)).onNext("one");
        verify(result, times(1)).onNext("two");
        verify(result, times(0)).onNext("three");
        verify(result, times(1)).onError(error);
        verify(result, times(0)).onComplete();
        verify(sSource, times(1)).dispose();
        verify(sOther, times(1)).dispose();

    }

    /**
     * If the 'other' onCompletes then we unsubscribe from the source and onComplete
     */
    @Test
    public void testTakeUntilOtherCompleted() {
        Disposable sSource = mock(Disposable.class);
        Disposable sOther = mock(Disposable.class);
        TestObservable source = new TestObservable(sSource);
        TestObservable other = new TestObservable(sOther);

        NbpSubscriber<String> result = TestHelper.mockNbpSubscriber();
        NbpObservable<String> stringObservable = NbpObservable.create(source).takeUntil(NbpObservable.create(other));
        stringObservable.subscribe(result);
        source.sendOnNext("one");
        source.sendOnNext("two");
        other.sendOnCompleted();
        source.sendOnNext("three");

        verify(result, times(1)).onNext("one");
        verify(result, times(1)).onNext("two");
        verify(result, times(0)).onNext("three");
        verify(result, times(1)).onComplete();
        verify(sSource, times(1)).dispose();
        verify(sOther, times(1)).dispose(); // unsubscribed since SafeSubscriber unsubscribes after onComplete

    }

    private static class TestObservable implements NbpOnSubscribe<String> {

        NbpSubscriber<? super String> NbpObserver;
        Disposable s;

        public TestObservable(Disposable s) {
            this.s = s;
        }

        /* used to simulate subscription */
        public void sendOnCompleted() {
            NbpObserver.onComplete();
        }

        /* used to simulate subscription */
        public void sendOnNext(String value) {
            NbpObserver.onNext(value);
        }

        /* used to simulate subscription */
        public void sendOnError(Throwable e) {
            NbpObserver.onError(e);
        }

        @Override
        public void accept(NbpSubscriber<? super String> NbpObserver) {
            this.NbpObserver = NbpObserver;
            NbpObserver.onSubscribe(s);
        }
    }

    @Test
    public void testUntilFires() {
        NbpPublishSubject<Integer> source = NbpPublishSubject.create();
        NbpPublishSubject<Integer> until = NbpPublishSubject.create();

        NbpTestSubscriber<Integer> ts = new NbpTestSubscriber<>();

        source.takeUntil(until).unsafeSubscribe(ts);

        assertTrue(source.hasSubscribers());
        assertTrue(until.hasSubscribers());

        source.onNext(1);

        ts.assertValue(1);
        until.onNext(1);

        ts.assertValue(1);
        ts.assertNoErrors();
        ts.assertTerminated();

        assertFalse("Source still has observers", source.hasSubscribers());
        assertFalse("Until still has observers", until.hasSubscribers());
        assertFalse("NbpTestSubscriber is unsubscribed", ts.isCancelled());
    }
    @Test
    public void testMainCompletes() {
        NbpPublishSubject<Integer> source = NbpPublishSubject.create();
        NbpPublishSubject<Integer> until = NbpPublishSubject.create();

        NbpTestSubscriber<Integer> ts = new NbpTestSubscriber<>();

        source.takeUntil(until).unsafeSubscribe(ts);

        assertTrue(source.hasSubscribers());
        assertTrue(until.hasSubscribers());

        source.onNext(1);
        source.onComplete();

        ts.assertValue(1);
        ts.assertNoErrors();
        ts.assertTerminated();

        assertFalse("Source still has observers", source.hasSubscribers());
        assertFalse("Until still has observers", until.hasSubscribers());
        assertFalse("NbpTestSubscriber is unsubscribed", ts.isCancelled());
    }
    @Test
    public void testDownstreamUnsubscribes() {
        NbpPublishSubject<Integer> source = NbpPublishSubject.create();
        NbpPublishSubject<Integer> until = NbpPublishSubject.create();

        NbpTestSubscriber<Integer> ts = new NbpTestSubscriber<>();

        source.takeUntil(until).take(1).unsafeSubscribe(ts);

        assertTrue(source.hasSubscribers());
        assertTrue(until.hasSubscribers());

        source.onNext(1);

        ts.assertValue(1);
        ts.assertNoErrors();
        ts.assertTerminated();

        assertFalse("Source still has observers", source.hasSubscribers());
        assertFalse("Until still has observers", until.hasSubscribers());
        assertFalse("NbpTestSubscriber is unsubscribed", ts.isCancelled());
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

/**
 * AlterFunctionStatement class file.
 *
 * @author Anastaszor
 */
class AlterFunctionStatement
		extends CachalotObject implements IAlterFunctionStatement
{

	/**
	 * The name of the function to alter.
	 *
	 * @var string
	 */
	private $_function_name = null;

	/**
	 * The Characteristics of the function to alter.
	 *
	 * @var ICharacteristicStatement[]
	 */
	private $_characteristics = array();

	/**
	 * Sets the name of the function to alter.
	 *
	 * @param string $name
	 */
	public function setFunctionName($name)
	{
		$this->_function_name = $name;
	}

	/**
	 * (non-PHPdoc)
	 * @see IAlterFunctionStatement::getFunctionName()
	 */
	public function getFunctionName()
	{
		return $this->_function_name;
	}

	/**
	 * Adds the Characteristic to the list for the function to alter.
	 *
	 * @param ICharacteristicStatement $statement
	 */
	public function addCharacteristic(ICharacteristicStatement $statement)
	{
		$stclass = get_class($statement);
		foreach($this->_characteristics as $i => $characteristic)
		{
			if(get_class($characteristic) == $stclass)
			{
				// on remplace, on a trouvé
				$this->_characteristics[$i] = $statement;
				return;
			}
		}
		// on a pas trouvé, on append
		$this->_characteristics[] = $statement;
	}

	/**
	 * (non-PHPdoc)
	 * @see IAlterFunctionStatement::getCharacteristic()
	 */
	public function getCharacteristics()
	{
		return $this->_characteristics;
	}

	/**
	 * (non-PHPdoc)
	 * @see IExecutableStatement::execute()
	 */
	public function execute(Executor $executor)
	{
		return $executor->alterFunction($this);
	}

	/**
	 * (non-PHPdoc)
	 * @see IStatement::validate()
	 */
	public function validate()
	{
		$ok = !empty($this->_function_name)
			&& count($this->getCharacteristics()) > 0;
		foreach($this->getCharacteristics() as $charac)
		{
			$ok &= $charac->validate();
		}
		return $ok;
	}

	/**
	 * (non-PHPdoc)
	 * @see IStatement::toSQL()
	 */
	public function toSQL(IDialect $dialect)
	{
		return $dialect->alterFunction($this);
	}

}


text: """Importer Tests for IAM package."""


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('core', '0002_wallet_template'),
    ]

    operations = [
        migrations.AddField(
            model_name='wallet',
            name='description',
            field=models.TextField(blank=True),
        ),
        migrations.AddField(
            model_name='wallet',
            name='name',
            field=models.CharField(default='example wallet', max_length=100),
            preserve_default=False,
        ),
    ]


text:
package com.edgar.banner.indicator;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.edgar.banner.BannerItem;
import com.edgar.banner.R;

/**
 * Created by Edgar on 2017/5/1.
 * 圆点标题
 */
public class CircleTitleIndicator extends RelativeLayout implements BannerIndicator,IndicatorAttributeSet{
    private TextView mTitle;
    private LinearLayout mIndicatorView;

    private Drawable mUnSelectedDrawable;
    private Drawable mSelectedDrawable;

    private int mPointMargin;
    private int mCurItem;

    public CircleTitleIndicator(Context context) {
        this(context,null);
    }

    public CircleTitleIndicator(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs,0);
    }

    public CircleTitleIndicator(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        Resources resources = getResources();
        inflate(context,R.layout.circle_title_indicator,this);
        mTitle = (TextView) findViewById(R.id.title);
        mIndicatorView = (LinearLayout) findViewById(R.id.indicator_view);

        int horPadding = resources.getDimensionPixelOffset(R.dimen.indicator_hor_padding);
        int verPadding = resources.getDimensionPixelOffset(R.dimen.indicator_ver_padding);
        setPadding(horPadding,verPadding,horPadding,verPadding);
    }

    @Override
    public void addView(View child) {
        super.addView(child);
    }

    @Override
    public void onBannerSelected(BannerItem bannerItem, int position) {
        mTitle.setText(bannerItem.getBannerTitle());
        mIndicatorView.getChildAt(mCurItem).setBackgroundDrawable(mUnSelectedDrawable);
        mCurItem = position;
        mIndicatorView.getChildAt(mCurItem).setBackgroundDrawable(mSelectedDrawable);
    }

    @Override
    public void onBannerScrolled(int position, float positionOffset, int positionOffsetPixels) {
    }

    @Override
    public void onBannerScrollStateChanged(int state) {
    }

    @Override
    public void onBannerPageUpdate(int newCount) {
        mIndicatorView.removeAllViews();
        if (newCount > 0){
            for (int i = 0; i < newCount; i++) {
                mIndicatorView.addView(createPointView());
            }
            mCurItem = 0;
            mIndicatorView.getChildAt(mCurItem).setBackgroundDrawable(mSelectedDrawable);
        }
    }

    @Override
    public View getView() {
        return this;
    }

    private ImageView createPointView(){
        Resources resources = getResources();
        ImageView pointView = new ImageView(getContext());
        pointView.setBackgroundDrawable(mUnSelectedDrawable);
        int pointSize = resources.getDimensionPixelSize(R.dimen.point_size);
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(pointSize,pointSize);
        params.leftMargin = mPointMargin;
        pointView.setLayoutParams(params);
        return pointView;
    }

    @Override
    public void setIndicatorGravity(int indicatorGravity) {
        if (indicatorGravity == IndicatorGravity.LEFT){
            LayoutParams params = (LayoutParams) mIndicatorView.getLayoutParams();
            params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
            params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT,0);
            params = (LayoutParams) mTitle.getLayoutParams();
            params.addRule(RelativeLayout.LEFT_OF,0);
            params.addRule(RelativeLayout.RIGHT_OF,R.id.indicator_view);
            mTitle.setGravity(Gravity.RIGHT);
        } else if (indicatorGravity == IndicatorGravity.RIGHT){
            LayoutParams params = (LayoutParams) mIndicatorView.getLayoutParams();
            params.addRule(RelativeLayout.ALIGN_PARENT_LEFT,0);
            params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
            params = (LayoutParams) mTitle.getLayoutParams();
            params.addRule(RelativeLayout.RIGHT_OF,0);
            params.addRule(RelativeLayout.LEFT_OF,R.id.indicator_view);
            mTitle.setGravity(Gravity.LEFT);
        } else {
            LayoutParams params = (LayoutParams) mIndicatorView.getLayoutParams();
            params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT,0);
            params.addRule(RelativeLayout.ALIGN_PARENT_LEFT,0);
            params.addRule(RelativeLayout.CENTER_HORIZONTAL);
            params.addRule(RelativeLayout.CENTER_VERTICAL);
            params = (LayoutParams) mTitle.getLayoutParams();
            params.addRule(RelativeLayout.RIGHT_OF,0);
            params.addRule(RelativeLayout.LEFT_OF,R.id.indicator_view);
            mTitle.setGravity(Gravity.LEFT);
        }
    }

    @Override
    public void setPointPadding(int pointPadding) {
        mPointMargin = pointPadding;
    }

    @Override
    public void setPointDrawable(Drawable unSelectDrawable, Drawable selectDrawable) {
        mUnSelectedDrawable = unSelectDrawable;
        mSelectedDrawable = selectDrawable;
    }
}


text:
package org.agrona.collections;

import org.agrona.generation.DoNotSub;

/**
 * Variation of {@link Int2ObjectHashMap} that allows {@code null} values.
 *
 * @param <V> type of values stored in the {@link java.util.Map}
 */
public class Int2NullableObjectHashMap<V> extends Int2ObjectHashMap<V>
{
    public Int2NullableObjectHashMap()
    {
    }

    public Int2NullableObjectHashMap(
        @DoNotSub final int initialCapacity, final float loadFactor)
    {
        super(initialCapacity, loadFactor);
    }

    /**
     * Construct a new map allowing a configuration for initial capacity and load factor.
     * @param initialCapacity       for the backing array
     * @param loadFactor            limit for resizing on puts
     * @param shouldAvoidAllocation should allocation be avoided by caching iterators and map entries.
     */
    public Int2NullableObjectHashMap(
        @DoNotSub final int initialCapacity, final float loadFactor, final boolean shouldAvoidAllocation)
    {
        super(initialCapacity, loadFactor, shouldAvoidAllocation);
    }

    /**
     * Copy construct a new map from an existing one.
     *
     * @param mapToCopy for construction.
     */
    public Int2NullableObjectHashMap(final Int2ObjectHashMap<V> mapToCopy)
    {
        super(mapToCopy);
    }

    protected Object mapNullValue(final Object value)
    {
        return value == null ? NullReference.INSTANCE : value;
    }

    @SuppressWarnings("unchecked")
    protected V unmapNullValue(final Object value)
    {
        return value == NullReference.INSTANCE ? null : (V)value;
    }
}


text:
class BarbaClientApp : public BarbaApp
{
public:
	BarbaClientApp();
	virtual ~BarbaClientApp();
	void Initialize() override;
	void Dispose() override;
	bool IsServerMode() override {return false;}
	LPCTSTR GetName() override {return _T("Barba Client");}
	BarbaClientConfig* FindConfigForOutboundPacket(PacketHelper* packet);
	BarbaClientConfig* FindConfigForInboundPacket(PacketHelper* packet);
	bool ProcessOutboundPacket(PacketHelper* packet) override;
	bool ProcessInboundPacket(PacketHelper* packet) override;
	static bool IsConfigForInboundPacket(BarbaClientConfig* config, PacketHelper* packet);
	static bool IsConfigForOutboundPacket(BarbaClientConfig* config, PacketHelper* packet);

	BarbaArray<BarbaClientConfig> Configs;
	BarbaClientConnectionManager ConnectionManager;
	std::string HttpGetTemplate;
	std::string HttpPostTemplate;
	std::string HttpGetTemplateBombard;
	std::string HttpPostTemplateBombard;

protected:
	void Load() override;
};

extern BarbaClientApp* theClientApp;


text:
import sqlite3 as lite

con = lite.connect(r"./die_zeit.db")

with con:

    cur = con.cursor()

    cur.execute("CREATE TABLE Articles(id INT, uuid TEXT, title TEXT, releaseDate DATETIME, subtitle TEXT, uri TEXT, href TEXT)")


text:
<a href="<?php echo admin_url($this->pagedir); ?>" onclick="return check_form_changed();">일반기능

<a href="<?php echo admin_url($this->pagedir . '/points'); ?>" onclick="return check_form_changed();">시간/포인트설정

<a href="<?php echo admin_url($this->pagedir . '/cleanlog'); ?>" onclick="return check_form_changed();">오래된 로그삭제

        <?php
        echo validation_errors('
', '
');
        echo show_alert_message(element('alert_message', $view), '
<button type="button" class="close alertclose" >×</button>', '
');
        $attributes = array('class' => 'form-horizontal', 'name' => 'fadminwrite', 'id' => 'fadminwrite');
        echo form_open(current_full_url(), $attributes);
        ?>
            <input type="hidden" name="is_submit" value="1" />

                    출석체크 기능 사용

                            <input type="checkbox" name="use_attendance" id="use_attendance" value="1" <?php echo set_checkbox('use_attendance', '1', (element('use_attendance', element('data', $view)) ? true : false)); ?> /> 사용합니다

                            <a href="<?php echo site_url('attendance'); ?>" target="_blank"><?php echo site_url('attendance'); ?>

                    정렬방법

                        <select class="form-control" name="attendance_order" id="attendance_order">
                            <option value="asc" <?php echo set_select('attendance_order', 'asc', (element('attendance_order', element('data', $view)) === 'asc' ? true : false)); ?> >먼저 출석한 사람을 먼저 출력</option>
                            <option value="desc" <?php echo set_select('attendance_order', 'desc', (element('attendance_order', element('data', $view)) === 'desc' ? true : false)); ?> >나중에 출석한 사람을 먼저 출력</option>
                        </select>

                    한페이지당 출력개수

                        <input type="number" class="form-control" name="attendance_page_count" id="attendance_page_count" value="<?php echo set_value('attendance_page_count', element('attendance_page_count', element('data', $view)) + 0); ?>" />
                        한 페이지에 보이는 출석자 수입니다

                    출석시간표시

                            <input type="checkbox" name="attendance_show_attend_time" id="attendance_show_attend_time" value="1" <?php echo set_checkbox('attendance_show_attend_time', '1', (element('attendance_show_attend_time', element('data', $view)) ? true : false)); ?> /> PC

                            <input type="checkbox" name="attendance_mobile_show_attend_time" id="attendance_mobile_show_attend_time" value="1" <?php echo set_checkbox('attendance_mobile_show_attend_time', '1', (element('attendance_mobile_show_attend_time', element('data', $view)) ? true : false)); ?> /> 모바일

                         출석 시간을 표시할 것인지를 결정합니다

                    출석시간 표시 방법 (PC)

                        <select name="attendance_date_style" class="form-control select-date-style" data-display-target="attendance_date_style_manual_wrapper">
                            <option value="" <?php echo set_select('attendance_date_style', '', ( ! element('attendance_date_style', element('data', $view)) ? true : false)); ?>>기본</option>
                            <option value="sns" <?php echo set_select('attendance_date_style', 'sns', (element('attendance_date_style', element('data', $view)) === 'sns' ? true : false)); ?>>SNS 스타일</option>
                            <option value="user" <?php echo set_select('attendance_date_style', 'user', (element('attendance_date_style', element('data', $view)) === 'user' ? true : false)); ?>>사용자정의</option>
                        </select>
                        <span id="attendance_date_style_manual_wrapper" style="display:<?php echo (element('attendance_date_style', element('data', $view)) === 'user') ? 'inline' : 'none'; ?>">
                        <?php echo date("<input type="text" class="form-control" name="attendance_date_style_manual" value="<?php echo set_value('attendance_date_style_manual', element('attendance_date_style_manual', element('data', $view))); ?>" />", $time); ?>

                    출석시간 표시 방법 (모바일)

                        <select name="attendance_mobile_date_style" class="form-control select-date-style" data-display-target="attendance_mobile_date_style_manual_wrapper">
                            <option value="" <?php echo set_select('attendance_mobile_date_style', '', ( ! element('attendance_mobile_date_style', element('data', $view)) ? true : false)); ?>>기본</option>
                            <option value="sns" <?php echo set_select('attendance_mobile_date_style', 'sns', (element('attendance_mobile_date_style', element('data', $view)) === 'sns' ? true : false)); ?>>SNS 스타일</option>
                            <option value="user" <?php echo set_select('attendance_mobile_date_style', 'user', (element('attendance_mobile_date_style', element('data', $view)) === 'user' ? true : false)); ?>>사용자정의</option>
                        </select>
                        <span id="attendance_mobile_date_style_manual_wrapper" style="display:<?php echo (element('attendance_mobile_date_style', element('data', $view)) === 'user') ? 'inline' : 'none'; ?>">
                        <?php echo date("<input type="text" class="form-control" name="attendance_mobile_date_style_manual" value="<?php echo set_value('attendance_mobile_date_style_manual', element('attendance_mobile_date_style_manual', element('data', $view))); ?>" />", $time); ?>

                    인사말 길이

                        <input type="number" class="form-control" name="attendance_memo_length" id="attendance_memo_length" value="<?php echo set_value('attendance_memo_length', element('attendance_memo_length', element('data', $view)) + 0); ?>" /> 글자 이내

                    PC 레이아웃/스킨

                        레이아웃 -
                        <select name="layout_attendance" id="layout_attendance" class="form-control" >
                            <?php echo element('layout_attendance_option', element('data', $view)); ?>
                        </select>
                        사이드바 -
                        <select class="form-control" name="sidebar_attendance" id="sidebar_attendance">
                            <option value="">기본설정따름</option>
                            <option value="1" <?php echo set_select('sidebar_attendance', '1', (element('sidebar_attendance', element('data', $view)) === '1' ? true : false)); ?> >사용</option>
                            <option value="2" <?php echo set_select('sidebar_attendance', '2', (element('sidebar_attendance', element('data', $view)) === '2' ? true : false)); ?> >사용하지않음</option>
                        </select>
                        스킨 -
                        <select name="skin_attendance" id="skin_attendance" class="form-control" >
                            <?php echo element('skin_attendance_option', element('data', $view)); ?>
                        </select>

                    모바일 레이아웃/스킨

                        레이아웃 -
                        <select name="mobile_layout_attendance" id="mobile_layout_attendance" class="form-control" >
                            <?php echo element('mobile_layout_attendance_option', element('data', $view)); ?>
                        </select>
                        사이드바 -
                        <select class="form-control" name="mobile_sidebar_attendance" id="mobile_sidebar_attendance">
                            <option value="">기본설정따름</option>
                            <option value="1" <?php echo set_select('mobile_sidebar_attendance', '1', (element('mobile_sidebar_attendance', element('data', $view)) === '1' ? true : false)); ?> >사용</option>
                            <option value="2" <?php echo set_select('mobile_sidebar_attendance', '2', (element('mobile_sidebar_attendance', element('data', $view)) === '2' ? true : false)); ?> >사용하지않음</option>
                        </select>
                        스킨 -
                        <select name="mobile_skin_attendance" id="mobile_skin_attendance" class="form-control" >
                            <?php echo element('mobile_skin_attendance_option', element('data', $view)); ?>
                        </select>

                    메타태그 설정

공통적으로 사용할 수 있는 치환가능변수 : {홈페이지제목}, {현재주소}, {회원아이디}, {회원닉네임}, {회원레벨}, {회원포인트}

Title :  <title>여기에 입력하신 내용이 들어갑니다</title>

meta description :  <meta name="description" content="여기에 입력하신 내용이 들어갑니다">

meta keywords :  <meta name="keywords" content="여기에 입력하신 내용이 들어갑니다">

meta author :  <meta name="author" content="여기에 입력하신 내용이 들어갑니다">

page name :  현재접속자 페이지에 보입니다

                출석체크 메타태그

                                    내용
                                    치환가능변수

Title

<input type="text" class="form-control" name="site_meta_title_attendance" value="<?php echo set_value('site_meta_title_attendance', element('site_meta_title_attendance', element('data', $view))); ?>" />

meta description

<input type="text" class="form-control" name="site_meta_description_attendance" value="<?php echo set_value('site_meta_description_attendance', element('site_meta_description_attendance', element('data', $view))); ?>" />

meta keywords

<input type="text" class="form-control" name="site_meta_keywords_attendance" value="<?php echo set_value('site_meta_keywords_attendance', element('site_meta_keywords_attendance', element('data', $view))); ?>" />

meta author

<input type="text" class="form-control" name="site_meta_author_attendance" value="<?php echo set_value('site_meta_author_attendance', element('site_meta_author_attendance', element('data', $view))); ?>" />

page name

<input type="text" class="form-control" name="site_page_name_attendance" value="<?php echo set_value('site_page_name_attendance', element('site_page_name_attendance', element('data', $view))); ?>" />

                                    {홈페이지제목}, {현재주소}, {회원아이디}, {회원닉네임}, {회원레벨}, {회원포인트}

                    <button type="submit" class="btn btn-success btn-sm">저장하기</button>

        <?php echo form_close(); ?>


text:
class ApplicationController < ActionController::API
  include DeviseTokenAuth::Concerns::SetUserByToken
  before_action :configure_permitted_parameters, if: :devise_controller?

  rescue_from(ActionController::ParameterMissing) do |parameter_missing_exception|
    error = {}
    error[parameter_missing_exception.param] = ['parameter is required']
    response = { errors: [error] }
    render json: response, status: :unprocessable_entity
  end

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) << :name
  end
end


text:
"""Motor control PWM client library functions. Find implementation details in
LPC17xx CMSIS-Compliant Standard Peripheral Firmware Driver Library
documentation.
"""

from internals import robocaller, cstruct

__author__ =      "Neil MacMunn"
__credits__ =     ["Neil MacMunn", "NXP MCU SW Application Team"]
__maintainer__ =  "Neil MacMunn"
__email__ =       "neil@gumstix.com"
__copyright__ =   "Copyright 2011, Gumstix Inc"
__license__ =     "BSD 2-Clause"
__version__ =     "0.1"

# Edge aligned mode for channel in MCPWM
MCPWM_CHANNEL_EDGE_MODE = ((0))
# Center aligned mode for channel in MCPWM
MCPWM_CHANNEL_CENTER_MODE = ((1))
# Polarity of the MCOA and MCOB pins: Passive state is LOW, active state is HIGH
MCPWM_CHANNEL_PASSIVE_LO = ((0))
# Polarity of the MCOA and MCOB pins: Passive state is HIGH, active state is LOW
MCPWM_CHANNEL_PASSIVE_HI = ((1))

# Output Patent in 3-phase DC mode, the internal MCOA0 signal is routed to any or all of
# the six output pins under the control of the bits in this register
# MCOA0 tracks internal MCOA0
MCPWM_PATENT_A0 = ((1<<0))
# MCOB0 tracks internal MCOA0
MCPWM_PATENT_B0 = ((1<<1))
# MCOA1 tracks internal MCOA0
MCPWM_PATENT_A1 = ((1<<2))
# MCOB1 tracks internal MCOA0
MCPWM_PATENT_B1 = ((1<<3))
# MCOA2 tracks internal MCOA0
MCPWM_PATENT_A2 = ((1<<4))
# MCOB2 tracks internal MCOA0
MCPWM_PATENT_B2 = ((1<<5))

# Limit interrupt for channel (n)
def MCPWM_INT_ILIM(n):
  if ((n>=0)&(n<=2)):
    return (1<<((n*4)+0))
  else:
    return 0

# Match interrupt for channel (n)
def MCPWM_INT_IMAT(n):
  if ((n>=0)&(n<=2)):
    return (1<<((n*4)+1))
  else:
    return 0

# Capture interrupt for channel (n)
def MCPWM_INT_ICAP(n):
  if ((n>=0)&(n<=2)):
    return (1<<((n*4)+2))
  else:
    return 0

# Fast abort interrupt
MCPWM_INT_ABORT = (1<<15)

# Interrupt type in MCPWM
# Limit interrupt for channel (0)
MCPWM_INTFLAG_LIM0 = MCPWM_INT_ILIM(0)
# Match interrupt for channel (0)
MCPWM_INTFLAG_MAT0 = MCPWM_INT_IMAT(0)
# Capture interrupt for channel (0)
MCPWM_INTFLAG_CAP0 = MCPWM_INT_ICAP(0)
# Limit interrupt for channel (1)
MCPWM_INTFLAG_LIM1 = MCPWM_INT_ILIM(1)
# Match interrupt for channel (1)
MCPWM_INTFLAG_MAT1 = MCPWM_INT_IMAT(1)
# Capture interrupt for channel (1)
MCPWM_INTFLAG_CAP1 = MCPWM_INT_ICAP(1)
# Limit interrupt for channel (2)
MCPWM_INTFLAG_LIM2 = MCPWM_INT_ILIM(2)
# Match interrupt for channel (2)
MCPWM_INTFLAG_MAT2 = MCPWM_INT_IMAT(2)
# Capture interrupt for channel (2)
MCPWM_INTFLAG_CAP2 = MCPWM_INT_ICAP(2)
# Fast abort interrupt
MCPWM_INTFLAG_ABORT = MCPWM_INT_ABORT

class MCPWM_CHANNEL_CFG_Type(cstruct):
  '''Motor Control PWM Channel Configuration structure type definition.

   channelType:  Edge/center aligned mode for this channel, should be:
                MCPWM_CHANNEL_EDGE_MODE: Channel is in Edge mode
                MCPWM_CHANNEL_CENTER_MODE: Channel is in Center mode
  channelPolarity:  Polarity of the MCOA and MCOB pins, should be:
                    MCPWM_CHANNEL_PASSIVE_LO: Passive state is LOW, active state
                    is HIGH
                    MCPWM_CHANNEL_PASSIVE_HI: Passive state is HIGH, active
                    state is LOW
  channelDeadtimeEnable:  Enable/Disable DeadTime function for channel, should
                          be: ENABLE or DISABLE.
  channelDeadtimeValue: DeadTime value, should be less than 0x3FF
  channelUpdateEnable:  Enable/Disable updates of functional registers, should
                        be: ENABLE or DISABLE.
  channelTimercounterValue: MCPWM Timer Counter value
  channelPeriodValue:  MCPWM Period value
  channelPulsewidthValue:  MCPWM Pulse Width value
  ptr:  LPC1769 memory address where structure is stored. Use this in place of
        the C reference operator (&).

  '''
  pass

class MCPWM_COUNT_CFG_Type(cstruct):
  '''MCPWM Count Control Configuration type definition.

  counterChannel: Counter Channel Number, should be in range from 0 to 2
  countRising:  Enable/Disable Capture on Rising Edge event, should be: ENABLE
                or DISABLE.
  countFalling: Enable/Disable Capture on Falling Edge event, should be: ENABLE
                or DISABLE.
  ptr:  LPC1769 memory address where structure is stored. Use this in place of
        the C reference operator (&).

  '''
  pass

class MCPWM_CAPTURE_CFG_Type(cstruct):
  '''MCPWM Capture Configuration type definition.

  captureChannel: Capture Channel Number, should be in range from 0 to 2 */
  captureRising:  Enable/Disable Capture on Rising Edge event, should be:
                  ENABLE or DISABLE.
  captureFalling: Enable/Disable Capture on Falling Edge event, should be:
                  ENABLE or DISABLE.
  timerReset: Enable/Disable Timer reset function an capture, should be:
              ENABLE or DISABLE.
  hnfEnable:  Enable/Disable Hardware noise filter function, should be:
              ENABLE or DISABLE.
  ptr:  LPC1769 memory address where structure is stored. Use this in place of
        the C reference operator (&).

  '''
  pass

def MCPWM_ConfigCapture(MCPWMx, channelNum, captureConfig):
  '''Configures capture function in MCPWM peripheral.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  channelNum: MCI (Motor Control Input pin) number. Should be: 0..2
  captureConfig:  Pointer to a MCPWM_CAPTURE_CFG_Type structure that contains
                  the configuration information for the specified MCPWM capture.

  '''
  return robocaller("MCPWM_ConfigCapture", "void", MCPWMx, channelNum, captureConfig)

def MCPWM_IntConfig(MCPWMx, ulIntType, NewState):
  '''Configures the specified interrupt in MCPWM peripheral.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  ulIntType:  Interrupt type, should be:
              MCPWM_INTFLAG_LIM0: Limit interrupt for channel (0)
              MCPWM_INTFLAG_MAT0: Match interrupt for channel (0)
              MCPWM_INTFLAG_CAP0: Capture interrupt for channel (0)
              MCPWM_INTFLAG_LIM1: Limit interrupt for channel (1)
              MCPWM_INTFLAG_MAT1: Match interrupt for channel (1)
              MCPWM_INTFLAG_CAP1: Capture interrupt for channel (1)
              MCPWM_INTFLAG_LIM2: Limit interrupt for channel (2)
              MCPWM_INTFLAG_MAT2: Match interrupt for channel (2)
              MCPWM_INTFLAG_CAP2: Capture interrupt for channel (2)
              MCPWM_INTFLAG_ABORT: Fast abort interrupt
  NewState: New State of this command, should be: ENABLE or DISABLE.

  '''
  return robocaller("MCPWM_IntConfig", "void", MCPWMx, ulIntType, NewState)

def MCPWM_ACMode(MCPWMx, acMode):
  '''Enables/Disables 3-phase AC motor mode on MCPWM peripheral.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  acMode: State of this command, should be: ENABLE or DISABLE.

  '''
  return robocaller("MCPWM_ACMode", "void", MCPWMx, acMode)

def MCPWM_Init(MCPWMx):
  '''Initializes the MCPWM peripheral.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM

  '''
  return robocaller("MCPWM_Init", "void", MCPWMx)

def MCPWM_GetIntStatus(MCPWMx, ulIntType):
  '''Check whether if the specified interrupt in MCPWM is set or not.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  ulIntType:  Interrupt type, should be:
              MCPWM_INTFLAG_LIM0: Limit interrupt for channel (0)
              MCPWM_INTFLAG_MAT0: Match interrupt for channel (0)
              MCPWM_INTFLAG_CAP0: Capture interrupt for channel (0)
              MCPWM_INTFLAG_LIM1: Limit interrupt for channel (1)
              MCPWM_INTFLAG_MAT1: Match interrupt for channel (1)
              MCPWM_INTFLAG_CAP1: Capture interrupt for channel (1)
              MCPWM_INTFLAG_LIM2: Limit interrupt for channel (2)
              MCPWM_INTFLAG_MAT2: Match interrupt for channel (2)
              MCPWM_INTFLAG_CAP2: Capture interrupt for channel (2)
              MCPWM_INTFLAG_ABORT: Fast abort interrupt
  return: SET or RESET

  '''
  return robocaller("MCPWM_GetIntStatus", "FlagStatus", MCPWMx, ulIntType)

def MCPWM_Stop(MCPWMx, channel0, channel1, channel2):
  '''Stop MCPWM activity for each MCPWM channel.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  channel0: State of this command on channel 0:
            ENABLE: 'Stop' command will effect on channel 0
            DISABLE: 'Stop' command will not effect on channel 0
  channel1: State of this command on channel 1:
            ENABLE: 'Stop' command will effect on channel 1
            DISABLE: 'Stop' command will not effect on channel 1
  channel2: State of this command on channel 2:
            ENABLE: 'Stop' command will effect on channel 2
            DISABLE: 'Stop' command will not effect on channel 2

  '''
  return robocaller("MCPWM_Stop", "void", MCPWMx, channel0, channel1, channel2)

def MCPWM_Start(MCPWMx, channel0, channel1, channel2):
  '''Start MCPWM activity for each MCPWM channel.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  channel0: State of this command on channel 0:
            ENABLE: 'Start' command will effect on channel 0
            DISABLE: 'Start' command will not effect on channel 0
  channel1: State of this command on channel 1:
            ENABLE: 'Start' command will effect on channel 1
            DISABLE: 'Start' command will not effect on channel 1
  channel2: State of this command on channel 2:
            ENABLE: 'Start' command will effect on channel 2
            DISABLE: 'Start' command will not effect on channel 2

  '''
  return robocaller("MCPWM_Start", "void", MCPWMx, channel0, channel1, channel2)

def MCPWM_GetCapture(MCPWMx, captureChannel):
  '''Get current captured value in specified capture channel.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  captureChannel: Capture channel number, should be: 0..2
  return: Captured value in channel 0, 1, or 2

  '''
  return robocaller("MCPWM_GetCapture", "uint32_t", MCPWMx, captureChannel)

def MCPWM_IntSet(MCPWMx, ulIntType):
  '''Sets/Forces the specified interrupt for MCPWM peripheral.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  ulIntType:  Interrupt type, should be:
              MCPWM_INTFLAG_LIM0: Limit interrupt for channel (0)
              MCPWM_INTFLAG_MAT0: Match interrupt for channel (0)
              MCPWM_INTFLAG_CAP0: Capture interrupt for channel (0)
              MCPWM_INTFLAG_LIM1: Limit interrupt for channel (1)
              MCPWM_INTFLAG_MAT1: Match interrupt for channel (1)
              MCPWM_INTFLAG_CAP1: Capture interrupt for channel (1)
              MCPWM_INTFLAG_LIM2: Limit interrupt for channel (2)
              MCPWM_INTFLAG_MAT2: Match interrupt for channel (2)
              MCPWM_INTFLAG_CAP2: Capture interrupt for channel (2)
              MCPWM_INTFLAG_ABORT: Fast abort interrupt

  '''
  return robocaller("MCPWM_IntSet", "void", MCPWMx, ulIntType)

def MCPWM_ConfigChannel(MCPWMx, channelNum, channelSetup):
  '''Configures each channel in MCPWM peripheral according to the specified
  parameters in the MCPWM_CHANNEL_CFG_Type.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  channelNum: Channel number, should be: 0..2.
  channelSetup: Pointer to a MCPWM_CHANNEL_CFG_Type structure that contains the
                configuration information for the specified MCPWM channel.

  '''
  return robocaller("MCPWM_ConfigChannel", "void", MCPWMx, channelNum, channelSetup)

def MCPWM_ClearCapture(MCPWMx, captureChannel):
  '''Clears current captured value in specified capture channel.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  captureChannel: Capture channel number, should be: 0..2

  '''
  return robocaller("MCPWM_ClearCapture", "void", MCPWMx, captureChannel)

def MCPWM_DCMode(MCPWMx, dcMode, outputInvered, outputPattern):
  '''Enables/Disables 3-phase DC motor mode on MCPWM peripheral.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  dcMode: State of this command, should be: ENABLE or DISABLE.
  outputInvered:  Polarity of the MCOB outputs for all 3 channels, should be:
                  ENABLE: The MCOB outputs have opposite polarity from the MCOA
                  outputs.
                  DISABLE: The MCOB outputs have the same basic polarity as the
                  MCOA outputs.
  outputPattern:  A value contains bits that enables/disables the specified
                  output pins route to the internal MCOA0 signal, should be:
                  MCPWM_PATENT_A0:    MCOA0 tracks internal MCOA0
                  MCPWM_PATENT_B0:    MCOB0 tracks internal MCOA0
                  MCPWM_PATENT_A1:    MCOA1 tracks internal MCOA0
                  MCPWM_PATENT_B1:    MCOB1 tracks internal MCOA0
                  MCPWM_PATENT_A2:    MCOA2 tracks internal MCOA0
                  MCPWM_PATENT_B2:    MCOB2 tracks internal MCOA0

  '''
  return robocaller("MCPWM_DCMode", "void", MCPWMx, dcMode, outputInvered, outputPattern)

def MCPWM_CountConfig(MCPWMx, channelNum, countMode, countConfig):
  '''Configures Count control in MCPWM peripheral.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  channelNum: Channel number, should be: 0..2
  countMode:  Count mode, should be:
              ENABLE: Enables count mode.
              DISABLE: Disable count mode, the channel is in timer mode.
  countConfig:  Pointer to a MCPWM_COUNT_CFG_Type structure that contains the
                configuration information for the specified MCPWM count control.

  '''
  return robocaller("MCPWM_CountConfig", "void", MCPWMx, channelNum, countMode, countConfig)

def MCPWM_WriteToShadow(MCPWMx, channelNum, channelSetup):
  '''Write to MCPWM shadow registers - Update the value for period and pulse
  width in MCPWM peripheral.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  channelNum: Channel number, should be: 0..2
  channelSetup: Pointer to a MCPWM_CHANNEL_CFG_Type structure that contains the
                configuration information for the specified MCPWM channel.

  '''
  return robocaller("MCPWM_WriteToShadow", "void", MCPWMx, channelNum, channelSetup)

def MCPWM_IntClear(MCPWMx, ulIntType):
  '''Clear the specified interrupt pending for MCPWM peripheral.

  MCPWMx: Motor Control PWM peripheral selected. Should be: LPC_MCPWM
  ulIntType:  Interrupt type, should be:
              MCPWM_INTFLAG_LIM0: Limit interrupt for channel (0)
              MCPWM_INTFLAG_MAT0: Match interrupt for channel (0)
              MCPWM_INTFLAG_CAP0: Capture interrupt for channel (0)
              MCPWM_INTFLAG_LIM1: Limit interrupt for channel (1)
              MCPWM_INTFLAG_MAT1: Match interrupt for channel (1)
              MCPWM_INTFLAG_CAP1: Capture interrupt for channel (1)
              MCPWM_INTFLAG_LIM2: Limit interrupt for channel (2)
              MCPWM_INTFLAG_MAT2: Match interrupt for channel (2)
              MCPWM_INTFLAG_CAP2: Capture interrupt for channel (2)
              MCPWM_INTFLAG_ABORT: Fast abort interrupt

  '''
  return robocaller("MCPWM_IntClear", "void", MCPWMx, ulIntType)


text:
<?php
namespace Bitrix24\Presets\App;
/**
 * Class App
 * @package Bitrix24\Presets
 * @link https://training.bitrix24.com/rest_help/general/app_info.php
 */
class App
{
	/**
	 * @var string Specifies the application ID.
	 */
	const CODE = 'CODE';
	/**
	 * @var string Specifies the application version
	 */
	const VERSION = 'VERSION';
	/**
	 * @var string The application status. It can be one of the following values:
	 * 	F (Free) - free;
	 * 	D (Demo) - demo version;
	 * 	T (Trial) - trial version, time limited;
	 * 	P (Paid) - the application has been purchased.
	 */
	const STATUS = 'STATUS';
	/**
	 * @var string application status id free
	 */
	const STATUS_FREE = 'F';
	/**
	 * @var string application status is demo
	 */
	const STATUS_DEMO = 'D';
	/**
	 * @var string application status is trial
	 */
	const STATUS_TRIAL = 'T';
	/**
	 * @var string application status is paid
	 */
	const STATUS_PAID = 'P';
	/**
	 * @var string [Y|N]: if Y, the application license or trial period has expired.
	 */
	const PAYMENT_EXPIRED = 'PAYMENT_EXPIRED';
	/**
	 * @var string Specifies the number of days left until the application license or trial period expires. After the license expires,
	 * the application may remain fully functional for a certain grace period to account for possible delay of payment.
	 * Finally, if the license has not been renewed, the application is reverted back to demo mode or cease functioning at all.
	 * In that case, the value of  PAYMENT_EXPIRED is Y, and the value of DAYS is negative.
	 */
	const DAYS = 'DAYS';
	/**
	 * @var string information about portal licence
	 */
	const LICENSE = 'LICENSE';
	/**
	 * @var string
	 */
	const PORTAL_LICENSE_PROJECT = 'project';
	/**
	 * @var string
	 */
	const PORTAL_LICENSE_CORPORATION = 'corporation';
	/**
	 * @var string
	 */
	const PORTAL_LICENSE_COMPANY = 'company';
	/**
	 * @var string
	 */
	const PORTAL_LICENSE_TEAM = 'team';
	/**
	 * @var string
	 */
	const PORTAL_LICENSE_DEMO = 'demo';
	/**
	 * @var string
	 */
	const PORTAL_LICENSE_NFR = 'nfr';
	/**
	 * @var string
	 */
	const PORTAL_LICENSE_TEAM_PLUS = 'tf';
}