You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: event_entity.rb
    path of file: ./repos/gitlabhq/app/serializers/analytics/cycle_analytics
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Analytics
  module CycleAnalytics
    class EventEntity < Grape::Entity
      expose :name
      expose :identifier
      expose :type
      expose :can_be_start_event?, as: :can_b
    
      def allowed_end_events
        pairing_rules.fetch(object, []).map do |event|
          event.identifier unless stage_events.internal_events.include?(event)
        end.compact
      end

      def pairing_rules
        stage_events.pairing_rules
      end

      def stage_events
        Gitlab::Analytics::CycleAnalytics::StageEvents
      end
    end