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: simple_sequence.rb
    path of file: ./repos/stackneveroverflow/vendor/bundle/ruby/2.3.0/gems/sass-3.4.24/lib/sass/selector
    
    the code of the file until where you have to start completion: module Sass
  module Selector
    # A unseparated sequence of selectors
    # that all apply to a single element.
    # For example, `.foo#bar[attr=baz]` is a simple sequence
    # of the 
    
      def do_extend(extends, parent_directives, replace, seen)
        seen_with_pseudo_selectors = seen.dup

        modified_original = false
        members = self.members.map do |sel|
          next sel unless sel.is_a?(Pseudo) && sel.selector
          next sel if seen.include?([sel])
          extended = sel.selector.do_extend(extends, parent_directives, replace, seen, false)
          next sel if extended == sel.selector
          extended.members.reject! {|seq| seq.has_placeholder?}

          # For `:not()`, we usually want to get rid of any complex
          # selectors because that will cause the selector to fail to
          # parse on all browsers at time of writing. We can keep them
          # if either the original selector had a complex selector, or
          # the result of extending has only complex selectors,
          # because either way we aren't breaking anything that isn't
          # already broken.
          if sel.normalized_name == 'not' &&
              (sel.selector.members.none? {|seq| seq.members.length > 1} &&
               extended.members.any? {|seq| seq.members.length == 1})
            extended.members.reject! {|seq| seq.members.length > 1}
          end

          modified_original = true
          result = sel.with_selector(extended)
          result.each {|new_sel| seen_with_pseudo_selectors << [new_sel]}
          result
        end.flatten

        groups = Sass::Util.group_by_to_a(extends[members.to_set]) {|ex| ex.extender}
        groups.map! do |seq, group|
          sels = group.map {|e| e.target}.flatten
          # If A {@extend B} and C {...},
          # seq is A, sels is B, and self is C

          self_without_sel = Sass::Util.array_minus(members, sels)
          group.each {|e| e.result = :failed_to_unify unless e.result == :succeeded}
          unified = seq.members.last.unify(SimpleSequence.new(self_without_sel, subject?))
          next unless unified
          group.each {|e| e.result = :succeeded}
          group.each {|e| check_directives_match!(e, parent_directives)}
          new_seq = Sequence.new(seq.members[0...-1] + [unified])
          new_seq.add_sources!(sources + [seq])
          [sels, new_seq]
        end
        groups.compact!
        groups.map! do |sels, seq|
          next [] if seen.include?(sels)
          seq.do_extend(
            extends, parent_directives, false, seen_with_pseudo_selectors + [sels], false)
        end
        groups.flatten!

        if modified_original || !replace || groups.empty?
          # First Law of Extend: the result of extending a selector should
          # (almost) always contain the base selector.
          #
          # See https://github.com/nex3/sass/issues/324.
          original = Sequence.new([SimpleSequence.new(members, @subject, source_range)])
          original.add_sources! sources
          groups.unshift original
        end