<commit_before>begin
  require "readline"
rescue LoadError
  module Readline
    def self.readline(prompt)
      print prompt
      $stdout.flush
      gets
    end

    module HISTORY
      def self.push(cmd)
        # dummy
      end
    end
  end
end
require "heroku/command/base"
require "heroku/helpers/log_displayer"

# run one-off commands (console, rake)
#
class Heroku::Command::Run < Heroku::Command::Base

  # run COMMAND
  #
  # run an attached dyno
  #
  # -s, --size SIZE      # specify dyno size
  # --exit-code          # return exit code from process
  #
  #Example:
  #
  # $ heroku run bash
  # Running `bash` attached to terminal... up, run.1
  # ~ $
  #
  # $ heroku run -s hobby -- myscript.sh -a arg1 -s arg2
  # Running `myscript.sh -a arg1 -s arg2` attached to terminal... up, run.1
  #
  def index
    if ARGV.include?('--') || ARGV.include?('--exit-code')
      Heroku::JSPlugin.run('run', nil, ARGV[1..-1])
      return
    end
    command = args.join(" ")
    error("Usage: heroku run COMMAND") if command.empty?
    warn_if_using_jruby
    run_attached(command)
  end

  # run:detached COMMAND
  #
  # run a detached dyno, where output is sent to your logs
  #
  # -s, --size SIZE      # specify dyno size
  # -t, --tail           # stream logs for the dyno
  #
  #Example:
  #
  # $ heroku run:detached ls
  # Running `ls` detached... up, run.1
  # Use `heroku logs -p run.1` to view the output.
  #
  def detached
    command = args.join(" ")
    error("Usage: heroku run COMMAND") if command.empty?
    opts = { :attach => false, :command => command }
    opts[:size] = options[:size] if options[:size]

    app_name = app
    process_data = action("Running `#{command}` detached", :success => "up") do
      process_data = api.post_ps(app_name, command, opts).body
      status(process_data['process'])
      process_data<commit_msg>remove run command<commit_after>begin
  require "readline"
rescue LoadError
  module Readline
    def self.readline(prompt)
      print prompt
      $stdout.flush
      gets
    end

    module HISTORY
      def self.push(cmd)
        # dummy
      end
    end
  end
end
require "heroku/command/base"
require "heroku/helpers/log_displayer"

# run one-off commands (console, rake)
#
class Heroku::Command::Run < Heroku::Command::Base

  # run:detached COMMAND
  #
  # run a detached dyno, where output is sent to your logs
  #
  # -s, --size SIZE      # specify dyno size
  # -t, --tail           # stream logs for the dyno
  #
  #Example:
  #
  # $ heroku run:detached ls
  # Running `ls` detached... up, run.1
  # Use `heroku logs -p run.1` to view the output.
  #
  def detached
    command = args.join(" ")
    error("Usage: heroku run COMMAND") if command.empty?
    opts = { :attach => false, :command => command }
    opts[:size] = options[:size] if options[:size]

    app_name = app
    process_data = action("Running `#{command}` detached", :success => "up") do
      process_data = api.post_ps(app_name, command, opts).body
      status(process_data['process'])
      process_data
{'fraction_non_alphanumeric': 0.12463199214916584, 'fraction_numerical': 0.003925417075564278, 'mean_word_length': 2.576608187134503, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1276533', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1014, 'n_words': 297}