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: search_shards.rb
    path of file: ./repos/elasticsearch-ruby/elasticsearch-api/lib/elasticsearch/api/actions
    
    the code of the file until where you have to start completion: # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed 
    
      def search_shards(arguments = {})
        request_opts = { endpoint: arguments[:endpoint] || 'search_shards' }

        defined_params = [:index].each_with_object({}) do |variable, set_variables|
          set_variables[variable] = arguments[variable] if arguments.key?(variable)
        end
        request_opts[:defined_params] = defined_params unless defined_params.empty?

        arguments = arguments.clone
        headers = arguments.delete(:headers) || {}

        body   = nil

        _index = arguments.delete(:index)

        method = Elasticsearch::API::HTTP_GET
        path   = if _index
                   "#{Utils.__listify(_index)}/_search_shards"
                 else
                   '_search_shards'
                 end