<commit_before>require 'nokogiri'

class CASRequest
  def initialize(request)
    @request = request
  end

  def ticket
    @ticket ||= if single_sign_out?
      xml = Nokogiri::XML(@request.params['logoutRequest']).tap do |xml|
        xml.remove_namespaces!
      end
      node = xml.at('/LogoutRequest/SessionIndex')
      node.text unless node.nil?
    else<commit_msg>Handle missing namespace in single sign out XML.<commit_after>require 'nokogiri'

class CASRequest
  def initialize(request)
    @request = request
  end

  def ticket
    @ticket ||= if single_sign_out?
      xml = Nokogiri::XML(@request.params['logoutRequest'])
      node = xml.root.children.find { |c| c.name =~ /SessionIndex/i }
      node.text unless node.nil?
    else
{'fraction_non_alphanumeric': 0.11066666666666666, 'fraction_numerical': 0.0, 'mean_word_length': 3.2670454545454546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '4483046', 'n_tokens_mistral': 244, 'n_tokens_neox': 236, 'n_words': 57}