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: formatter.rb
    path of file: ./repos/rouge/lib/rouge
    
    the code of the file until where you have to start completion: # -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
  # A Formatter takes a token stream an
    
    def format(tokens, &b)
      tokens = enum_for(:filter_escapes, tokens) unless Formatter.escape_enabled?

      return stream(tokens, &b) if block_given?

      out = String.new('')
      stream(tokens) { |piece| out << piece }

      out
    end