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: study_steps.rb
    path of file: ./repos/sequencescape/features/support/step_definitions
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

Given /^I have a study called "([^"]*)"$/ do |study|
  FactoryBot.create :study, name: study, state: 'pending'
end

Given /^a study "(.*?)" is pending$/ do
    
def given_study_metadata(attribute, regexp)
  Given(regexp) do |name, value|
    study = Study.find_by(name: name) or raise StandardError, "There appears to be no study named '#{name}'"
    study.study_metadata.send(:"#{attribute}=", value.presence)
    study.save!
  end
end