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: popen.rb
    path of file: ./repos/gitlabhq/lib/gitlab
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'fileutils'
require 'open3'

module Gitlab
  module Popen
    extend 
    
    def popen(cmd, path = nil, vars = {}, &block)
      result = popen_with_detail(cmd, path, vars, &block)

      # Process#waitpid returns Process::Status, which holds a 16-bit value.
      # The higher-order 8 bits hold the exit() code (`exitstatus`).
      # The lower-order bits holds whether the process was terminated.
      # If the process didn't exit normally, `exitstatus` will be `nil`,
      # but we still want a non-zero code, even if the value is
      # platform-dependent.
      status = result.status&.exitstatus || result.status.to_i

      ["#{result.stdout}#{result.stderr}", status]
    end