<commit_before>"use strict";

var request = require("request");

function Genius(accessToken) {

  function _makeRequest(options, callback) {
    var baseRequest = request.defaults({
      baseUrl: "https://api.genius.com",
      headers: { "Authorization": "Bearer " + accessToken }
    });

    baseRequest(options, function(error, response) {
      if (response.statusCode > 399) {
        callback(response.body);
        return;
      }
      callback(null, response.body);
    });
  }

  this.search = function(query, callback) {
    var request = {
      url: "https://api.genius.com/search",
      qs: { "q": query }
    };
    _makeRequest(request, callback);
  };

  this.getArtist = function(artistId, options, callback) {
    if (typeof options === "function") {
      callback = options;
    }

    var request = {
      url: "artists/" + artistId,
      qs: options
    };
    _makeRequest(request, callback);
  };

  this.getArtistSongs = function(artistId, options, callback) {
    if (typeof options === "function") {
      callback = options;<commit_msg>added comment to search function<commit_after>"use strict";

var request = require("request");

function Genius(accessToken) {

  function _makeRequest(options, callback) {
    var baseRequest = request.defaults({
      baseUrl: "https://api.genius.com",
      headers: { "Authorization": "Bearer " + accessToken }
    });

    baseRequest(options, function(error, response) {
      if (response.statusCode > 399) {
        callback(response.body);
        return;
      }
      callback(null, response.body);
    });
  }
  
  /**
   * Search genius.com.
   * @param  {String}   query    The term to search for.
   * @param  {Function} callback The function to call once the search results are available.
   * @see https://docs.genius.com/#search-h2
   */
  this.search = function(query, callback) {
    var request = {
      url: "https://api.genius.com/search",
      qs: { "q": query }
    };
    _makeRequest(request, callback);
  };

  this.getArtist = function(artistId, options, callback) {
    if (typeof options === "function") {
      callback = options;
    }

    var request = {
      url: "artists/" + artistId,
      qs: options
    };
    _makeRequest(request, callback);
  };

  this.getArtistSongs = function(artistId, options, callback) {
    if (typeof options === "function") {
      callback = options;
{'fraction_non_alphanumeric': 0.14023372287145242, 'fraction_numerical': 0.002921535893155259, 'mean_word_length': 2.768867924528302, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 5, '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': '1618670', 'n_tokens_mistral': 741, 'n_tokens_neox': 716, 'n_words': 168}