<commit_before>require 'fog/core/collection'
require 'fog/digitalocean/models/compute_v2/server'
require 'fog/digitalocean/models/paging_collection'

module Fog
  module Compute
    class DigitalOceanV2
      class Servers < Fog::Compute::DigitalOceanV2::PagingCollection
        model Fog::Compute::DigitalOceanV2::Server

        # Returns list of servers
        # @return [Fog::Compute::DigitalOceanV2::Servers]
        # @raise [Fog::Compute::DigitalOceanV2::NotFound] - HTTP 404
        # @raise [Fog::Compute::DigitalOceanV2::BadRequest] - HTTP 400
        # @raise [Fog::Compute::DigitalOceanV2::InternalServerError] - HTTP 500
        # @raise [Fog::Compute::DigitalOceanV2::ServiceError]
        # @see https://developers.digitalocean.com/documentation/v2/#droplets
        def all(filters = {})
          data = service.list_servers(filters)
          links = data.body["links"]
          get_paged_links(links) 
          droplets = data.body["droplets"]
          meta = data.body["meta"]
          load(droplets)
        end

        # Retrieves server
        # @param [String] id for server to be returned
        # @return [Fog::Compute::DigitalOceanV2:Server]
        # @raise [Fog::Compute::DigitalOceanV2::NotFound] - HTTP 404
        # @raise [Fog::Compute::DigitalOceanV2::BadRequest] - HTTP 400
        # @raise [Fog::Compute::DigitalOceanV2::InternalServerError] - HTTP 500
        # @raise [Fog::Compute::DigitalOceanV2::ServiceError]
        # @see https://developers.digitalocean.com/documentation/v2/#retrieve-an-existing-droplet-by-id
        def get(id)
          server = service.get_server_details(id).body['droplet']
          new(server) if server
        rescue Fog::Errors::NotFound
          nil
        end
      end
    end
  end
end<commit_msg>Add more changes<commit_after>require 'fog/core/collection'
require 'fog/digitalocean/models/compute_v2/server'
require 'fog/digitalocean/models/paging_collection'

module Fog
  module Compute
    class DigitalOceanV2
      class Servers < Fog::Compute::DigitalOceanV2::PagingCollection
        model Fog::Compute::DigitalOceanV2::Server

        # Returns list of servers
        # @return [Fog::Compute::DigitalOceanV2::Servers]
        # @raise [Fog::Compute::DigitalOceanV2::NotFound] - HTTP 404
        # @raise [Fog::Compute::DigitalOceanV2::BadRequest] - HTTP 400
        # @raise [Fog::Compute::DigitalOceanV2::InternalServerError] - HTTP 500
        # @raise [Fog::Compute::DigitalOceanV2::ServiceError]
        # @see https://developers.digitalocean.com/documentation/v2/#droplets
        def all(filters = {}, total=false)
          data = service.list_servers(filters)
          links = data.body["links"]
          get_paged_links(links) 
          droplets = data.body["droplets"]
          meta = data.body["meta"]
          if total
            load(meta)
          else
            load(droplets)
          end
        end

        # Retrieves server
        # @param [String] id for server to be returned
        # @return [Fog::Compute::DigitalOceanV2:Server]
        # @raise [Fog::Compute::DigitalOceanV2::NotFound] - HTTP 404
        # @raise [Fog::Compute::DigitalOceanV2::BadRequest] - HTTP 400
        # @raise [Fog::Compute::DigitalOceanV2::InternalServerError] - HTTP 500
        # @raise [Fog::Compute::DigitalOceanV2::ServiceError]
        # @see https://developers.digitalocean.com/documentation/v2/#retrieve-an-existing-droplet-by-id
        def get(id)
          server = service.get_server_details(id).body['droplet']
          new(server) if server
        rescue Fog::Errors::NotFound
          nil
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11977030352748154, 'fraction_numerical': 0.018594476346732294, 'mean_word_length': 2.846477392218717, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '4362265', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1131, 'n_words': 197}