<commit_before>package scalapb.compiler

import com.google.protobuf.DescriptorProtos.{DescriptorProto, FileDescriptorProto, SourceCodeInfo}
import com.google.protobuf.Descriptors._
import com.google.protobuf.WireFormat.FieldType

import scalapb.options.compiler.Scalapb
import scalapb.options.compiler.Scalapb._
import scala.collection.JavaConverters._
import scala.collection.immutable.IndexedSeq

trait DescriptorPimps {
  def params: GeneratorParams

  val SCALA_RESERVED_WORDS = Set(
    "abstract", "case", "catch", "class", "def",
    "do", "else", "extends", "false", "final",
    "finally", "for", "forSome", "if", "implicit",
    "import", "lazy", "macro", "match", "new", "null",
    "object", "override", "package", "private", "protected",
    "return", "sealed", "super", "then", "this", "throw",
    "trait", "try", "true", "type", "val",
    "var", "while", "with", "yield",
    "ne", "scala")

  implicit class AsSymbolPimp(val s: String) {
    def asSymbol: String = if (SCALA_RESERVED_WORDS.contains(s)) s"`$s`" else s
  }

  implicit final class MethodDescriptorPimp(self: MethodDescriptor) {
    def scalaOut: String = self.getOutputType.scalaTypeName

    def scalaIn: String = self.getInputType.scalaTypeName

    def isClientStreaming = self.toProto.getClientStreaming

    def isServerStreaming = self.toProto.getServerStreaming

    def streamType: StreamType = {
      (isClientStreaming, isServerStreaming) match {
        case (false, false) => StreamType.Unary
        case (true, false) => StreamType.ClientStreaming
        case (false, true) => StreamType.ServerStreaming
        case (true, true) => StreamType.Bidirectional
      }
    }

    def canBeBlocking = !self.toProto.getClientStreaming

    private def name0: String = NameUtils.snakeCaseToCamelCase(self.getName)

    def name: String = name0.asSymbol

    def descriptorName = s"METHOD_${NameUtils.toAllCaps(self.getName)}"
  }<commit_msg>Remove scala from keyword list.<commit_after>package scalapb.compiler

import com.google.protobuf.DescriptorProtos.{DescriptorProto, FileDescriptorProto, SourceCodeInfo}
import com.google.protobuf.Descriptors._
import com.google.protobuf.WireFormat.FieldType

import scalapb.options.compiler.Scalapb
import scalapb.options.compiler.Scalapb._
import scala.collection.JavaConverters._
import scala.collection.immutable.IndexedSeq

trait DescriptorPimps {
  def params: GeneratorParams

  val SCALA_RESERVED_WORDS = Set(
    "abstract", "case", "catch", "class", "def",
    "do", "else", "extends", "false", "final",
    "finally", "for", "forSome", "if", "implicit",
    "import", "lazy", "macro", "match", "new", "null",
    "object", "override", "package", "private", "protected",
    "return", "sealed", "super", "then", "this", "throw",
    "trait", "try", "true", "type", "val",
    "var", "while", "with", "yield",
    "ne")

  implicit class AsSymbolPimp(val s: String) {
    def asSymbol: String = if (SCALA_RESERVED_WORDS.contains(s)) s"`$s`" else s
  }

  implicit final class MethodDescriptorPimp(self: MethodDescriptor) {
    def scalaOut: String = self.getOutputType.scalaTypeName

    def scalaIn: String = self.getInputType.scalaTypeName

    def isClientStreaming = self.toProto.getClientStreaming

    def isServerStreaming = self.toProto.getServerStreaming

    def streamType: StreamType = {
      (isClientStreaming, isServerStreaming) match {
        case (false, false) => StreamType.Unary
        case (true, false) => StreamType.ClientStreaming
        case (false, true) => StreamType.ServerStreaming
        case (true, true) => StreamType.Bidirectional
      }
    }

    def canBeBlocking = !self.toProto.getClientStreaming

    private def name0: String = NameUtils.snakeCaseToCamelCase(self.getName)

    def name: String = name0.asSymbol

    def descriptorName = s"METHOD_${NameUtils.toAllCaps(self.getName)}"
  }
{'fraction_non_alphanumeric': 0.13257673458859942, 'fraction_numerical': 0.0010317255610007739, 'mean_word_length': 4.393602225312935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5107963', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1231, 'n_words': 279}