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: make_csv_orgchart.rb
    path of file: ./repos/metasploit-framework/modules/post/windows/gather
    
    the code of the file until where you have to start completion: ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Post
  include Msf::Auxiliary::Report
  include Msf::Post::Windows::LDAP

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'Generate CSV Organizational Chart Data Using Manager Information',
        'Description' => %q{
          This module will generate a CSV file containing all users and their managers, which can be
          imported into Visio which will render it.
        },
        'License' => MSF_LICENSE,
        'Author' => [
          'Stuart Morgan <stuart.morgan[at]mwrinfosecurity.com>'
        ],
  
    
  def run
    max_search = datastore['MAX_SEARCH']
    user_fields = ['cn', 'manager', 'description', 'title', 'telephoneNumber', 'department', 'division', 'userPrincipalName', 'company']

    begin
      qs = []
      qs << '(objectCategory=person)'
      qs << '(objectClass=user)'
      qs << '(!userAccountControl:1.2.840.113556.1.4.803:=2)' if datastore['ACTIVE_USERS_ONLY']
      qs << '(manager=*)' if datastore['WITH_MANAGERS_ONLY']
      qs << "(#{datastore['FILTER']})" if datastore['FILTER'] != ''

      query_string = "(&(#{qs.join('')}))"
      vprint_status("Executing #{query_string}")
      q = query(query_string, max_search, user_fields)
    rescue ::RuntimeError, ::Rex::Post::Meterpreter::RequestError => e
      # Can't bind or in a network w/ limited accounts
      print_error(e.message)
      return
    end