<commit_before># Copyright (C) 2009-2014 MongoDB, Inc.
#
# 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 'mongo/auth/executable'
require 'mongo/auth/cr'
require 'mongo/auth/ldap'
require 'mongo/auth/user'
require 'mongo/auth/x509'

module Mongo

  # This namespace contains all authentication related behaviour.
  #
  # @since 2.0.0
  module Auth
    extend self

    # The external database name.
    #
    # @since 2.0.0
    EXTERNAL = '$external'.freeze

    # Constant for the nonce command.
    #
    # @since 2.0.0
    GET_NONCE = { getnonce: 1 }.freeze

    # Constant for the logout command.
    #
    # @since 2.0.0
    LOGOUT = { logout: 1 }.freeze

    # Constant for the nonce field.
    #
    # @since 2.0.0
    NONCE = 'nonce'.freeze

    # Map the symbols parsed from the URI connection string to strategies.
    #
    # @since 2.0.0
    SOURCES = {
      # gssapi: Kerberos,
      mongodb_cr: CR,
      mongodb_x509: X509,
      plain: LDAP,
    }.freeze

    # Get the authorization strategy for the provided auth mechanism.
    #
    # @example Get the strategy.
    #   Auth.get(:mongodb_cr)
    #
    # @param [ Symbol ] mechanism The authorization mechanism.
    #
    # @return [ CR, X509, LDAP, Kerberos ] The auth strategy.
    #
    # @since 2.0.0
    def get(mechanism = nil)
      raise InvalidMechanism.new(mechanism) if mechanism && !SOURCES.has_key?(mechanism)
      SOURCES[mechanism || :mongodb_cr]
    end
<commit_msg>Get rid of logout command constant<commit_after># Copyright (C) 2009-2014 MongoDB, Inc.
#
# 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 'mongo/auth/executable'
require 'mongo/auth/cr'
require 'mongo/auth/ldap'
require 'mongo/auth/user'
require 'mongo/auth/x509'

module Mongo

  # This namespace contains all authentication related behaviour.
  #
  # @since 2.0.0
  module Auth
    extend self

    # The external database name.
    #
    # @since 2.0.0
    EXTERNAL = '$external'.freeze

    # Constant for the nonce command.
    #
    # @since 2.0.0
    GET_NONCE = { getnonce: 1 }.freeze

    # Constant for the nonce field.
    #
    # @since 2.0.0
    NONCE = 'nonce'.freeze

    # Map the symbols parsed from the URI connection string to strategies.
    #
    # @since 2.0.0
    SOURCES = {
      # gssapi: Kerberos,
      mongodb_cr: CR,
      mongodb_x509: X509,
      plain: LDAP,
    }.freeze

    # Get the authorization strategy for the provided auth mechanism.
    #
    # @example Get the strategy.
    #   Auth.get(:mongodb_cr)
    #
    # @param [ Symbol ] mechanism The authorization mechanism.
    #
    # @return [ CR, X509, LDAP, Kerberos ] The auth strategy.
    #
    # @since 2.0.0
    def get(mechanism = nil)
      raise InvalidMechanism.new(mechanism) if mechanism && !SOURCES.has_key?(mechanism)
      SOURCES[mechanism || :mongodb_cr]
    end

{'fraction_non_alphanumeric': 0.09503916449086162, 'fraction_numerical': 0.02349869451697128, 'mean_word_length': 2.819541375872383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6154476', 'n_tokens_mistral': 1289, 'n_tokens_neox': 1197, 'n_words': 418}