<commit_before># Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


require "gcloud/datastore/credentials"
require "google/datastore/v1beta3/datastore_services"
require "gcloud/backoff"

module Gcloud
  module Datastore
    ##
    # @private Represents the gRPC Datastore service, including all the API
    # methods.
    class Service
      DEFAULT_HOST = "www.googleapis.com"
      attr_accessor :project, :credentials

      ##
      # Creates a new Service instance.
      def initialize project, credentials
        @project = project
        @credentials = credentials
      end

      def creds
        GRPC::Core::ChannelCredentials.new.compose \
          GRPC::Core::CallCredentials.new credentials.client.updater_proc
      end

      ##
      # The Datastore API URL.
      def host
        @host || ENV["DATASTORE_HOST"] || DEFAULT_HOST
      end

      ##
      # Update the Datastore API URL.
      def host= new_host
        @datastore = nil # Reset the GRPC object when host is set
        @host = new_host<commit_msg>Update Datastore GRPC Host URL<commit_after># Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


require "gcloud/datastore/credentials"
require "google/datastore/v1beta3/datastore_services"
require "gcloud/backoff"

module Gcloud
  module Datastore
    ##
    # @private Represents the gRPC Datastore service, including all the API
    # methods.
    class Service
      DEFAULT_HOST = "datastore.googleapis.com"
      attr_accessor :project, :credentials

      ##
      # Creates a new Service instance.
      def initialize project, credentials
        @project = project
        @credentials = credentials
      end

      def creds
        GRPC::Core::ChannelCredentials.new.compose \
          GRPC::Core::CallCredentials.new credentials.client.updater_proc
      end

      ##
      # The Datastore API URL.
      def host
        @host || ENV["DATASTORE_HOST"] || DEFAULT_HOST
      end

      ##
      # Update the Datastore API URL.
      def host= new_host
        @datastore = nil # Reset the GRPC object when host is set
        @host = new_host
{'fraction_non_alphanumeric': 0.0722588752748979, 'fraction_numerical': 0.006283380458686773, 'mean_word_length': 2.935723114956737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, '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': '1340487', 'n_tokens_mistral': 876, 'n_tokens_neox': 859, 'n_words': 331}