<commit_before>var google = require('googleapis'),
    Promise = require('bluebird'),
    paginator = require('../../lib/paginator'),
    youtube = google.youtube('v3');

/**
 * Channel extension to the YouTube data api channel resource.
 */
function Channel (options) {
  var self = this;
  this._options = options || {};
  this.playlists = {
    list: function(opts){
      var params = opts || {};
      params.channelId = self.id;
      if(params.allPages){
        delete params.allPages;
        var mergePages = params.mergePages;
        delete params.mergePages;
        paginator.options({
          'endpoint': 'playlists.list',
          'params': params,
          'mergePages': mergePages,
        });

        return paginator.getAllPages();
      }
      else{
        promisified = Promise.promisify(youtube.playlists.list);
        return promisified(params);
      }
    }
  };

  this.id = this._options.id || null;<commit_msg>Shared parameters are cloned before use<commit_after>var google = require('googleapis'),
    Promise = require('bluebird'),
    paginator = require('../../lib/paginator'),
    youtube = google.youtube('v3');

/**
 * Channel extension to the YouTube data api channel resource.
 */
function Channel (options) {
  var self = this;
  this._options = options || {};
  this.playlists = {
    list: function (opts) {
      var params = Object.assign({}, opts);
      params.channelId = self.id;
      if(params.allPages){
        delete params.allPages;
        var mergePages = params.mergePages;
        delete params.mergePages;
        paginator.options({
          'endpoint': 'playlists.list',
          'params': params,
          'mergePages': mergePages,
        });

        return paginator.getAllPages();
      }
      else{
        promisified = Promise.promisify(youtube.playlists.list);
        return promisified(params);
      }
    }
  };

  this.id = this._options.id || null;
{'fraction_non_alphanumeric': 0.13540051679586562, 'fraction_numerical': 0.0010335917312661498, 'mean_word_length': 2.4326241134751774, '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': '6392459', 'n_tokens_mistral': 550, 'n_tokens_neox': 537, 'n_words': 124}