Get a list of gifs related to a given gif

@param {Object} options
@param {string} options.id - gfycat id
@param {requestCallback} callback - (optional) callback function to run when the request completes.
480566
function(options, callback) {
    return this._request({
      api: '/gfycats',
      endpoint: '/' + options.id + '/related',
      method: 'GET',
      query: {
        cursor: options.cursor,
        count: options.count,
        from: options.from
      }
    }, callback);
  }
598487
function convertAnimatedGifsicle(context, callback) {
        var crop = context.crop;
        var imageSizes = context.sizes;
        var baseArgs = [];
        if (crop) {
          baseArgs.push('--crop');
          baseArgs.push(crop.left + ',' + crop.top + '+' + crop.width + 'x' + crop.height);
        }
        baseArgs.push(context.workingPath);
        return async.series([ convertOriginal, convertSizes ], callback);
        function convertOriginal(callback) {
          if (!context.copyOriginal) {
            return setImmediate(callback);
          }
          var path = context.tempFolder + '/original.' + context.extension;
          context.adjustedOriginal = path;
          var args = baseArgs.slice();
          args.push('--optimize');
          args.push('-o');
          args.push(path);
          return spawnThen('gifsicle', args, callback);
        }
        function convertSizes(callback) {
          return async.eachSeries(imageSizes, convertSize, callback);
        }
        function convertSize(size, callback) {
          var args = baseArgs.slice();
          args.push('--resize');
          // "Largest that fits in the box" is not a built-in feature of gifsicle, so we do the math
          var originalWidth = (crop && crop.width) || context.info.width;
          var originalHeight = (crop && crop.height) || context.info.height;
          var width = originalWidth;
          var height = Math.round(size.width * originalHeight / originalWidth);
          if (height > originalHeight) {
            height = size.height;
            width = Math.round(size.height * originalWidth / originalHeight);
          }
          args.push(width + 'x' + height);
          args.push('--optimize');
          args.push('-o');
          var suffix = size.name + '.' + context.extension;
          var tempFile = context.tempFolder + '/' + suffix;
          args.push(tempFile);
          return spawnThen('gifsicle', args, callback);
        }
      }
1197339
function(callback) {
            fs.exists(file, function(exists) {
                if(!exists) {
                    rawData = file;
                    if(typeof rawData === "string") rawData = new Buffer(file);
                    return callback();
                }

                fs.readFile(file, function(err, data) {
                    if(err) return callback(err);
                    rawData = data;
                    return callback();
                });
            });
        }
400767
function fetchAndParse(gexf_url, callback) {
    if (typeof callback === 'function') {
      return fetch(gexf_url, function(gexf) {
        callback(Graph(gexf));
      });
    } else
      return Graph(fetch(gexf_url));
  }
115584
function gistSha (options, callback) {
  if (!options.id) return callback(new Error('missing option: id'))

  var url = '/gists/' + options.id

  request({
    url: url,
    qs: {
      access_token: options.token
    }
  }, function (err, json) {
    if (err) return callback(err)
    if (json.message) return callback(new Error(json.message))
    if (json.updated_at) return callback(null, json.updated_at)
    callback(new Error('could not get sha for ' + url))
  })
}
975540
function qG(options) {
  var defer = q.defer();
  var compiledData = [];

  // Recursive call to paginate
  function qGCall(pageLink) {
    var methodCall;

    // Callback
    function callback(error, data) {
      if (error) {
        defer.reject(new Error(error));
      }
      else {
        compiledData = compiledData.concat(data);
        if (github.hasNextPage(data)) {
          qGCall(data);
        }
        else {
          defer.resolve(compiledData);
        }
      }
    }

    // If the call is a link to another page, use that.
    if (pageLink) {
      method = github.getNextPage(pageLink, callback);
    }
    else {
      githubAuth()[options.obj][options.method](options, callback);
    }
  }
  qGCall();

  return defer.promise;
}
161851
function render (callback) {

    if (effectAttrs.speed !== undefined) {
      setTimeout(function () {
        id = requestAnimationFrame(callback);
      }, effectAttrs.speed);
    } else {
      id = requestAnimationFrame(callback);
    }
  }
732824
function getStagedFiles(callback) {

    const options = [ 'diff', '--cached', '--name-only', '--diff-filter=ACM' ]

    execFile('git', options, (err, stdout) => {

        if (err) return callback(err)

        const stagedFiles = stdout
            .split('\n')
            .filter(filename => filename.match(/.js$/))

        callback(null, stagedFiles)

    })

}
864905
function (options, callback) {
            options = options || {};

            if (options.limit || options.offset) {
                this.$offset = options.offset || 0;
                this.$limit = options.limit || this.$limit;
            }

            var self = this;

            function pageFetchedComplete(err, page, originalCallback) {
                var callback = function (err, page) {
                    if (originalCallback) {
                        originalCallback(err, page, options);
                    }
                };


                if (options.fetchModels || options.fetchSubModels) {

                    // TODO: introduce poolSize parameter for par, and parEach

                    flow()
                        .parEach(page.$items, function (model, cb) {
                            model.fetch({
                                fetchSubModels: options.fetchSubModels
                            }, cb);
                        })
                        .exec(function (err) {
                            callback(err, page);
                        });

                } else {
                    callback(err, page);
                }

            }

            if (this._fetch.state === State.LOADING) {
                // currently fetching -> register callback
                this._fetch.callbacks.push(function (err, page) {
                    pageFetchedComplete(err, page, callback);
                });
            } else if (this._fetch.state == State.LOADED) {
                // completed loaded -> execute
                pageFetchedComplete(null, this, callback);
            } else {
                // set state and start loading
                self._fetch.state = State.LOADING;

                this.$collection.$context.$dataSource.loadCollectionPage(this, options, function (err, page) {
                    self._fetch.state = err ? State.ERROR : State.LOADED;

                    // execute callbacks
                    pageFetchedComplete(err, page, callback);

                    _.each(self._fetch.callbacks, function (cb) {
                        cb(err, page);
                    });
                });
            }
        }
327270
function(callback){
    var options = {},//  utils.clone( this.options ),
        self = this;

    options.baseUrl = self.url;

    self.startedUFParse = new Date();
    //console.log(self.url)

    try
    {
      parser.parseHtml (self.html, options, function(err, data){

        //console.log( JSON.stringify(data) );
        if(data){

          self.profile.hCards = self.getArrayOfContentType(data, 'h-card' );
          self.profile.hResumes = self.getArrayOfContentType(data, 'hresume' );
          self.profile.xfn = self.getArrayOfContentType(data, 'xfn' );

        }
        if(callback){
          callback();
        }
      });
    }
    catch(err)
    {
      self.options.logger.warn('error parsing microformats in page: ' + self.url);
      self.error = err;
      callback();
    }

    self.endedUFParse = new Date();
    self.parseTime = self.endedUFParse.getTime() - self.startedUFParse.getTime();
    self.options.logger.log('time to parse microformats in page: ' + self.parseTime + 'ms - ' + self.url);
  }
471581
function parse_javascript(file, options, callback) { 
  fs.readFile(file, 'utf8', function (err, source) {
    if (err) {
      callback(err);
      return;
    }
    process_jsd(source, file, options, callback);
  });
}
1235790
function (param, options, callback) {
              embedProcessor.log(param.worker + ' started with parameters = ', param);
              param.status = true;
              param.duration = false;
              param.duration_formatted = false;
              param.thumbnail_url = false;
              param.favicon_url = '';
              param.service_name = '';
              param.provider_url = '';
              param.html = false;
              param.views = false;
              if (embedProcessor._sources[param.source] && embedProcessor._sources[param.source].prepareEmbedCode) {
                param = embedProcessor._sources[param.source].prepareEmbedCode(param);
              }
              param = embedProcessor._paramEmbedCodeNormalizer(param);
              embedProcessor.log(param.worker + ' receive parameters = ', param);
              callback(param);
            }
927226
function check(gif) {
  if (!gif.src) {
    throw new Error(ERROR_NO_SRC)
  }
  if (typeof gif.src !== 'string') {
    throw new Error(ERROR_SRC_NOT_STRING)
  }
  if (!(/^(http|https):\/\/ucarecdn\.com/).test(gif.src)) {
    throw new Error(ERROR_SRC_NOT_CDN)
  }
}
897887
function(callback){
    var argFiles,
        filePath,
        i;

    if(!program.files || program.files.length === 0){
        return callback(null, true);
    }

    argFiles = program.files.split(',');

    output("Loading files...");

    for(i=0; i<argFiles.length; i++){
        filePath = path.resolve(__dirname, argFiles[i].toString());
        output("Reading file..." + filePath);
        if(fs.existsSync(filePath)){
            files.push(fs.readFileSync(filePath));
        }else{
            return callback("File does not exist, " + filePath, false);
        }
    }

    callback(null, true);
}
1295839
function (options, callback) {
    var self = this,
        requestOptions = {
          path: _urlPrefix
    };

    if (typeof options === 'function') {
      callback = options;
      options = {};
    }

    self._request(requestOptions, function (err, body) {
      if (err) {
        return callback(err);
      }

      else if (!body || !body.loadBalancers) {
        return callback(new Error('Unexpected empty response'));
      }

      else {
        return callback(null, body.loadBalancers.map(function (loadBalancer) {
          return new lb.LoadBalancer(self, loadBalancer);
        }));
      }
    });
  }
129112
function(url, callback) {
        if (isBrowser) {
            // Browser environments can't pipe, so download the file and add it
            return this.getImageDataFromUrl(url, function(err, data) {
                if (err) {
                    return callback(err);
                }

                this.addImageFromBuffer(data, callback);
            }.bind(this));
        }

        // Pipe the source URL into a POST-request
        request({ uri: url }).pipe(request({
            method: 'POST',
            uri: this.getSignedResourceUrl('POST', this.getImagesUrl()),
            json: true,
            headers: {
                'Accept': 'application/json',
                'User-Agent': 'imboclient-js'
            },
            onComplete: function(err, res, body) {
                callback(err, body ? body.imageIdentifier : null, body, res);
            }
        }));

        return this;
    }
268108
function AddCallback(mesgId, callbackFunction, callbackTimeout) {
    var callbackElement, now;

    now = new Date().getTime();

    callbackElement = {
        id      :   mesgId,
        func    :   callbackFunction,
        timeout :   now + callbackTimeout
    };

    callbackList.push(callbackElement);
}