Tell Metalsmith Assets to process the data.

@param {string} filename The file to filter on.
@param {function} callback A asyncronous callback that's made once the processing is complete.
512194
function assetFile(filename, callback) {
      const data = {
        source: files[filename].source,
        destination: files[filename].destination || path.join(path.dirname(filename), '.')
      }
      delete files[filename]
      metalsmithAssets(data)(files, metalsmith, callback)
    }
82027
function(pattern, callback) {
    glob(pattern, opts, function(err, globbedFiles) {
      if (isArray(globbedFiles) && globbedFiles.length && !err) {
        callback(null, globbedFiles);
      }
      else {
        console.error('The glob pattern ' + JSON.stringify(pattern) + ' did not match any files!');
        callback(null, []);
      }
    });
  }
1352897
function filterFile(file, callback) {
      // Ensure it matches the extension.
      const correctExtention = path.extname(file) === opts.extname

      // Make sure it has defined files.
      const source = files[file].source || false
      const destination = files[file].destination || '.'
      callback(null, correctExtention && source && destination)
    }
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);
}
1101878
function processFilePath(directory: string, fileName: string) {
      // If we were rejected then we should not continue.
      if (rejected === true) {
        return;
      }
      // We are now waiting on this asynchronous task.
      waiting++;
      // Get the file file path for this file.
      const filePath = path.join(directory, fileName);
      // Get the stats for the file.
      fs.lstat(filePath, (error, stats) => {
        if (error) {
          return reject(error);
        }
        // If this is a directory...
        if (stats.isDirectory()) {
          // ...and it is not an ignored directory...
          if (
            fileName !== 'node_modules' &&
            fileName !== 'flow-typed' &&
            fileName !== '__flowtests__'
          ) {
            // ...then recursively process the directory.
            processDirectory(filePath);
          }
        } else if (stats.isFile()) {
          // Otherwise if this is a JavaScript/JSX file and it is not an ignored
          // JavaScript file...
          const fileIsJsOrJsx = /\.jsx?$/.test(fileName);
          const fileIsIgnored = fileName.endsWith('-flowtest.js');
          if (fileIsJsOrJsx && !fileIsIgnored) {
            // Then process the file path as JavaScript.
            processJavaScriptFilePath(filePath, stats.size);
          }
          // If this is a Flow file then we don't need to check the file pragma
          // and can add the file to our paths immediately.
          if (fileName.endsWith('.flow')) {
            filePaths.push(filePath);
          }
        }
        // We are done with this async task
        done();
      });
    }
290208
function hashFile(filename, callback) {

    var calledBack = false,
        md5sum = crypto.createHash('md5'),
        stream = fs.ReadStream(filename);

    stream.on('data', function (data) {
      md5sum.update(data);
    });

    stream.on('end', function () {
      var hash = md5sum.digest('hex');
      callback(null, hash);
    });

    stream.on('error', function(err) {
      handleResponse(err);
    });

    function handleResponse(err, hash) {
      if (calledBack) {
        return;
      }

      calledBack = true;
      callback(err, hash);
    }
  }
1098694
function loadArff(fileName, callback) {
  ARFF.load(fileName, (error, data) => {
    if (error) {
      throw new Error(filename + error);
    }
    callback(data);
  });
  
  return 'THIS IS ASYNCHRONOUS';
}
365751
function(asyncFunc, callback) {
  asyncFunc(function(err, buffer) {
    if(callback) {
      callback(err, buffer.toHex().toString());
    }
  });
}
1351353
function (file, callback) {

                var self = this,
                    reader = new FileReader();

                var uploadDesign = this.$.imageUploadService.upload(file, function (err) {
                    if (!err) {
                        self.trigger("uploadComplete", {
                            uploadDesign: uploadDesign
                        });
                    } else {
                        self.trigger("uploadError", {
                            error: err,
                            uploadDesign: uploadDesign
                        });
                    }

                    callback && callback(err, uploadDesign);
                });

                reader.onload = function(evt) {

                    var img = new Image();
                    img.onload = function() {
                        uploadDesign.set({
                            previewImage: evt.target.result,
                            localImage: evt.target.result
                        });
                    };
                    img.src = evt.target.result;
                };

                reader.readAsDataURL(file);


                return uploadDesign;
            }
549424
function(self, options, callback) {
  if (typeof options === 'function') {
    callback = options;
    options = {};
  }

  options = options || self.writeConcern;

  if (self.fileId != null) {
    self.chunkCollection().remove({ files_id: self.fileId }, options, function(err) {
      if (err) return callback(err, false);
      callback(null, true);
    });
  } else {
    callback(null, true);
  }
}
362648
protected function applyCallback($callbackName, \Upload\FileInfoInterface $file)
    {
        if (in_array($callbackName, array('beforeValidation', 'afterValidation', 'beforeUpload', 'afterUpload')) === true) {
            if (isset($this->$callbackName) === true) {
                call_user_func_array($this->$callbackName, array($file));
            }
        }
    }
925576
function flush(callback) {
    fs.writeFile(_this._filename, JSON.stringify(_this._cache), callback);
  }
1353717
function (filename, callbackFn) {
                    var self = this,
                        url = self.options.hostAndPort + '/page/functions/render';

                    self.options.debug && console.log('calling url: %s', url);
                    request.post(url, {form:{ args:JSON.stringify(
                            [
                                filename
                            ], null, 4)}},
                        function (error, response, body) {
                            error && console.error(error);
                            if (response && response.statusCode === 200) {
                                callbackFn && callbackFn.call(self, !!body);
                            }
                            else {
                                console.error(body);
                                callbackFn && callbackFn.call(self, body);
                            }
                        }
                    );
                }
902230
function(callback) {
      fs.exists(options.source, function(exists) {
        if(!exists) { callback(new Error('Source file do not exists!')); }
        else { callback(null, true); }
      });
    }
614050
function check_STEP_file(filename, callback) {

    "use strict";

    // "ISO-10303-21;"
    // "HEADER;"
    var stream = fs.createReadStream(filename, {flags:"r"});

    var fileData = "";
    stream.on('data', function (data) {
        fileData += data;

        // The next lines should be improved
        var lines = fileData.split("\n");

        if (lines.length >= 2) {

            stream.destroy();
            if (!pattern_ISO_10303_21.test(lines[0])) {
                my_callback(new Error("this file is not a STEP FILE : ISO_10303_21 missing"));
            } else {
                my_callback(null, lines[0]);
            }
        }
    });
    stream.on('error', function () {
        my_callback('Error', null);
    });

    stream.on('end', function () {
        my_callback('File end reached without finding line', null);
    });

    var callback_called = false;

    function my_callback(err, data) {
        if (!callback_called) {
            callback_called = true;
            callback(err, data);
        }
    }
}
920746
function(callback) {
		// TODO: don't wait until the end. Instead, emit immediately upon finding the template

		if (!templateFile) throw new Error('template not found in stream');

		templateFile.data = templateFile.data || {};

		files.forEach(function(file) {
			var newFile = templateFile.clone();

			newFile.data.file = file;
			newFile.path = file.path;

			this.push(newFile);
		}, this);

		callback();
	}
364696
function(files, metalsmith, done){
            var yuiDocsData = require('../docs/data.json');

            var makeUrl = function(docClass, method){
                var out = '/docs/classes/' + docClass + '.html';
                if(method){
                    out += '#method_' + method;
                }
                return out;
            };

            for(var key in files){
                var file = files[key];
                if(file.docs_class){
                    file.yui_class_data = yuiDocsData.classes[file.docs_class];
                    if(file.docs_method){
                        file.yui_method_url = makeUrl(file.docs_class) + '#method_' + file.docs_class;
                    }
                }
                var relatedDocs = file.related_methods;
                var relatedDocsFormatted = [];
                if(relatedDocs){
                    relatedDocs.forEach(function(doc){
                        if(doc.indexOf('.') !== -1){
                            var arr = doc.split('.');
                            relatedDocsFormatted.push({
                                name: arr[0] + '.prototype.' + arr[1] + '()',
                                class: arr[0],
                                method: arr[1],
                                url: makeUrl(arr[0], arr[1])
                            });
                        } else {
                            relatedDocsFormatted.push({
                                name: doc + '()',
                                class: doc,
                                url: makeUrl(doc)
                            });
                        }
                    });
                    file.related_docs = relatedDocsFormatted;
                }
            }
            done();
        }