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: control_builder.rb
    path of file: ./repos/hitobito/app/helpers/contact_attrs
    
    the code of the file until where you have to start completion: # encoding: utf-8

#  Copyright (c) 2017, Pfadibewegung Schweiz. This file is part of
#  hitobito and licensed under the Affero General Public License version 3
#  or later
    
    def checked?(attr, option)
      attr = attr.to_s
      required = event.required_contact_attrs.include?(attr)
      hidden = event.hidden_contact_attrs.include?(attr)
      return required if option == :required
      return hidden if option == :hidden
      !required && !hidden
    end