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: vm_await.rb
    path of file: ./repos/vagrant-azure/lib/vagrant-azure/util
    
    the code of the file until where you have to start completion: # encoding: utf-8
# Copyrigh
    
        def await_true(env)
          config = env[:machine].provider_config
          parsed = parse_machine_id(env[:machine].id)
          azure = env[:azure_arm_service]
          tries = config.instance_ready_timeout / 2
          count = 0
          task = Concurrent::TimerTask.new(execution_interval: config.instance_check_interval ) do
            task.shutdown if env[:interrupted]

            if count > tries
              task.shutdown
              false
            end

            count += 1
            vm = azure.compute.virtual_machines.get(parsed[:group], parsed[:name], 'instanceView')
            if yield(vm)
              task.shutdown
              true
            end