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

require 'capybara/selector/selector'

module Capybara
  class Selector
    class CSS
      def sel
    
      def self.escape(str)
        value = str.dup
        out = +''
        out << value.slice!(0...1) if value.match?(/^[-_]/)
        out << (value[0].match?(NMSTART) ? value.slice!(0...1) : escape_char(value.slice!(0...1)))
        out << value.gsub(/[^a-zA-Z0-9_-]/) { |char| escape_char char }
        out
      end