<commit_before>module Heathen
  class Client
    module Interface
      def office_to_pdf(file)
        client.convert(:office_to_pdf, file: from_file(file), multipart: true)
      end

      def html_to_pdf(file)
        client.convert(:html_to_pdf, file: from_file(file), multipart: true)
      end

      def url_to_pdf(url)
        client.convert(:url_to_pdf, url: url)
      end

      def download(url, dir)
        client.download(url, dir: dir)
      end

      private

        def from_file(file)
          if file.respond_to?(:read)
            file
          else
            File.new(path, "rb")
          end
        end
    end
  end
end<commit_msg>Revert "allow different kinds of file arguments"<commit_after>module Heathen
  class Client
    module Interface
      def office_to_pdf(path)
        client.convert(:office_to_pdf, file: File.new(path, "rb"), multipart: true)
      end

      def html_to_pdf(path)
        client.convert(:html_to_pdf, file: File.new(path, "rb"), multipart: true)
      end

      def url_to_pdf(url)
        client.convert(:url_to_pdf, url: url)
      end

      def download(url, dir)
        client.download(url, dir: dir)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09075770191507078, 'fraction_numerical': 0.0, 'mean_word_length': 2.213903743315508, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1532560', 'n_tokens_mistral': 394, 'n_tokens_neox': 381, 'n_words': 94}