<commit_before>module Jetpants
  
  #--
  # MySQL server manipulation methods ##########################################
  #++
  
  class DB
    # Shuts down MySQL, and confirms that it is no longer listening.
    # OK to use this if MySQL is already stopped; it's a no-op then.
    def stop_mysql
      output "Attempting to shutdown MySQL"
      disconnect if @db
      output service(:stop, 'mysql')
      running = ssh_cmd "netstat -ln | grep ':#{@port}' | wc -l"
      raise "[#{@ip}] Failed to shut down MySQL: Something is still listening on port #{@port}" unless running.chomp == '0'
      @options = []
      @running = false
    end
    
    # Starts MySQL, and confirms that something is now listening on the port.
    # Raises an exception if MySQL is already running or if something else is
    # already running on its port.
    # Options should be supplied as positional method args, for example:<commit_msg>Bound port for running service grep<commit_after>module Jetpants
  
  #--
  # MySQL server manipulation methods ##########################################
  #++
  
  class DB
    # Shuts down MySQL, and confirms that it is no longer listening.
    # OK to use this if MySQL is already stopped; it's a no-op then.
    def stop_mysql
      output "Attempting to shutdown MySQL"
      disconnect if @db
      output service(:stop, 'mysql')
      running = ssh_cmd "netstat -ln | grep \"\s:#{@port}\s\" | wc -l"
      raise "[#{@ip}] Failed to shut down MySQL: Something is still listening on port #{@port}" unless running.chomp == '0'
      @options = []
      @running = false
    end
    
    # Starts MySQL, and confirms that something is now listening on the port.
    # Raises an exception if MySQL is already running or if something else is
    # already running on its port.
    # Options should be supplied as positional method args, for example:
{'fraction_non_alphanumeric': 0.12593383137673425, 'fraction_numerical': 0.0010672358591248667, 'mean_word_length': 2.939075630252101, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4706975', 'n_tokens_mistral': 541, 'n_tokens_neox': 501, 'n_words': 232}