<commit_before>module MMS

  class Agent

    def initialize(username, apikey)
      MMS::Client.instance.auth_setup(username, apikey)
    end

    def groups
      _findGroups
    end

    def clusters
      cluster_list = []
      groups.each do |group|
        cluster_list.concat group.clusters
      end
      cluster_list
    end

    def snapshots
      snapshot_list = []
      clusters.each do |cluster|
        snapshot_list.concat cluster.snapshots
      end
      snapshot_list
    end

    def restorejobs
      restorejob_list = []
      clusters.each do |cluster|
        restorejob_list.concat cluster.restorejobs
      end
      restorejob_list
    end

    def restorejobs_create(group_id, cluster_id, snapshot_id)
      snapshot = MMS::Resource::Snapshot.new snapshot_id, cluster_id, group_id
      snapshot.create_restorejob
    end

    private

    def _findGroups(page = 1, limit = 1000)
      group_list = []
      MMS::Client.instance.get('/groups?pageNum=' + page.to_s + '&itemsPerPage=' + limit.to_s).each do |group|
        group_list.push MMS::Resource::Group.new(group['id'], group)
      end
      group_list
    end

  end
end
<commit_msg>Added findGroup() on agent; removed _findGroups()<commit_after>module MMS

  class Agent

    def initialize(username, apikey)
      MMS::Client.instance.auth_setup(username, apikey)
    end

    def groups
      group_list = []
      MMS::Client.instance.get('/groups').each do |group|
        group_list.push MMS::Resource::Group.new group['id'], group
      end
      group_list
    end

    def clusters
      cluster_list = []
      groups.each do |group|
        cluster_list.concat group.clusters
      end
      cluster_list
    end

    def snapshots
      snapshot_list = []
      clusters.each do |cluster|
        snapshot_list.concat cluster.snapshots
      end
      snapshot_list
    end

    def restorejobs
      restorejob_list = []
      clusters.each do |cluster|
        restorejob_list.concat cluster.restorejobs
      end
      restorejob_list
    end

    def restorejobs_create(group_id, cluster_id, snapshot_id)
      findGroup(group_id).cluster(cluster_id).snapshot(snapshot_id).create_restorejob
    end

    def findGroup(id)
      MMS::Resource::Group.new id
    end
  end
end

{'fraction_non_alphanumeric': 0.07989464442493416, 'fraction_numerical': 0.0021949078138718174, 'mean_word_length': 2.4635258358662613, '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': '7272506', 'n_tokens_mistral': 702, 'n_tokens_neox': 686, 'n_words': 153}