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: io.rb
    path of file: ./repos/jruby/spec/mspec/lib/mspec/helpers
    
    the code of the file until where you have to start completion: require 'mspec/guards/feature'

cla
    
def new_fd(name, mode = "w:utf-8")
  if mode.kind_of? Hash
    if mode.key? :mode
      mode = mode[:mode]
    else
      raise ArgumentError, "new_fd options Hash must include :mode"
    end