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: note_data_proxy.rb
    path of file: ./repos/metasploit-framework/lib/metasploit/framework/data_service/proxy
    
    the code of the file until where you have to start completion: module NoteDataProxy

  def notes(opts)
    begin
      self.data_service_operation do |data_service|
        add_opts_workspace(opts)
        data_service.notes(opts)
      end
    rescue => e
      self.log_error(e, "Problem retrieving notes")
    end
  end

  def find_or_create_n
    
  def find_or_create_note(opts)
    begin
      # create separate opts for find operation since the report operation uses slightly different keys
      # TODO: standardize option keys used for the find and report operations
      find_opts = opts.clone
      # convert type to ntype
      find_opts[:ntype] = find_opts.delete(:type) if find_opts.key?(:type)
      # convert host to nested hosts address
      find_opts[:hosts] = {address: find_opts.delete(:host)} if find_opts.key?(:host)

      note = notes(find_opts)
      if note.nil? || note.first.nil?
        note = report_note(opts.clone)
      else
        note = note.first
      end