<commit_before>require 'avocado/commands'
require 'avocado/event'
require 'avocado/event_builder'

class Avocado::Commands::Events
  attr_reader :api, :config, :args

  def initialize api, config, args
    @api, @config, @args = api, config, args
  end

  def execute
    command = args.shift
    case command
    when nil
      list
    when 'create'
      create
      list
    end
  end

  def list
    api.events.all.each_with_index do |attributes, index|
      event = Avocado::Event.parse attributes
      puts "#{event.start_time.strftime('%a %I:%M%P')} #{event.title}"
    end
  end<commit_msg>add user to event list<commit_after>require 'avocado/commands'
require 'avocado/event'
require 'avocado/event_builder'

class Avocado::Commands::Events
  include Avocado::Users
  attr_reader :api, :config, :args

  def initialize api, config, args
    @api, @config, @args = api, config, args
  end

  def execute
    command = args.shift
    case command
    when nil
      list
    when 'create'
      create
      list
    end
  end

  def list
    api.events.all.each_with_index do |attributes, index|
      event = Avocado::Event.parse attributes
      puts "#{event.start_time.strftime('%a %I:%M%P')} #{event.title} (by #{users_hash[event.user_id]})"
    end
  end
{'fraction_non_alphanumeric': 0.11006289308176101, 'fraction_numerical': 0.0, 'mean_word_length': 3.1601307189542482, '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': '3078184', 'n_tokens_mistral': 430, 'n_tokens_neox': 414, 'n_words': 115}