<commit_before>require 'morpheus/cli/cli_command'

class Morpheus::Cli::LibraryInstanceTypesCommand
  include Morpheus::Cli::CliCommand
  include Morpheus::Cli::LibraryHelper

  set_command_name :'library-instance-types'
  register_subcommands :list, :get, :add, :update, :remove
  register_subcommands({:'update-logo' => :update_logo})
  register_subcommands({:'toggle-featured' => :toggle_featured})

  def initialize()
    # @appliance_name, @appliance_url = Morpheus::Cli::Remote.active_appliance
  end

  def connect(opts)
    @api_client = establish_remote_appliance_connection(opts)
    @library_instance_types_interface = @api_client.library_instance_types
    @provision_types_interface = @api_client.provision_types
    @option_types_interface = @api_client.option_types
    @option_type_lists_interface = @api_client.option_type_lists
  end

  def handle(args)
    handle_subcommand(args)
  end

  def list(args)
    options = {}
    params = {}
    optparse = Morpheus::Cli::OptionParser.new do |opts|
      opts.banner = subcommand_usage()
      opts.on('--category VALUE', String, "Filter by category") do |val|
        params['category'] = val
      end
      opts.on('--code VALUE', String, "Filter by code") do |val|
        params['code'] = val
      end
      opts.on('--technology VALUE', String, "Filter by technology") do |val|
        params['provisionTypeCode'] = val
      end
      build_common_options(opts, options, [:list, :query, :json, :yaml, :csv, :fields, :dry_run, :remote])
      opts.footer = "List instance types."
    end
    optparse.parse!(args)
    # verify_args!(args:args, optparse:optparse, count:0)
    if args.count > 0
      options[:phrase] = args.join(" ")
    end
    connect(options)
    begin
      # construct payload
      params.merge!(parse_list_options(options))
      @library_instance_types_interface.setopts(options)
      if options[:dry_run]
        print_dry_run @library_instance_types_interface.dry.list(params)
        return
      end<commit_msg>library-instance-types list --featured<commit_after>require 'morpheus/cli/cli_command'

class Morpheus::Cli::LibraryInstanceTypesCommand
  include Morpheus::Cli::CliCommand
  include Morpheus::Cli::LibraryHelper

  set_command_name :'library-instance-types'
  register_subcommands :list, :get, :add, :update, :remove
  register_subcommands({:'update-logo' => :update_logo})
  register_subcommands({:'toggle-featured' => :toggle_featured})

  def initialize()
    # @appliance_name, @appliance_url = Morpheus::Cli::Remote.active_appliance
  end

  def connect(opts)
    @api_client = establish_remote_appliance_connection(opts)
    @library_instance_types_interface = @api_client.library_instance_types
    @provision_types_interface = @api_client.provision_types
    @option_types_interface = @api_client.option_types
    @option_type_lists_interface = @api_client.option_type_lists
  end

  def handle(args)
    handle_subcommand(args)
  end

  def list(args)
    options = {}
    params = {}
    optparse = Morpheus::Cli::OptionParser.new do |opts|
      opts.banner = subcommand_usage()
      opts.on('--category VALUE', String, "Filter by category") do |val|
        params['category'] = val
      end
      opts.on('--code VALUE', String, "Filter by code") do |val|
        params['code'] = val
      end
      opts.on('--technology VALUE', String, "Filter by technology") do |val|
        params['provisionTypeCode'] = val
      end
      opts.on('--featured [true|false]',String, "Filter by featured.") do |val|
        params['featured'] = (val.to_s.downcase != 'false' && val.to_s.downcase != 'off')
      end
      build_common_options(opts, options, [:list, :query, :json, :yaml, :csv, :fields, :dry_run, :remote])
      opts.footer = "List instance types."
    end
    optparse.parse!(args)
    # verify_args!(args:args, optparse:optparse, count:0)
    if args.count > 0
      options[:phrase] = args.join(" ")
    end
    connect(options)
    begin
      # construct payload
      params.merge!(parse_list_options(options))
      @library_instance_types_interface.setopts(options)
      if options[:dry_run]
        print_dry_run @library_instance_types_interface.dry.list(params)
        return
      end
{'fraction_non_alphanumeric': 0.12242968565350981, 'fraction_numerical': 0.0009454029780193808, 'mean_word_length': 3.886836027713626, 'pattern_counts': {'":': 0, '<': 3, '<?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': '414989', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1321, 'n_words': 260}