callback to be executed when the call to stat completes or immediately if a stat object was passed as an argument
341036
function doReadFile(stat) {
            if (stat.size > (FileUtils.MAX_FILE_SIZE)) {
                callback(FileSystemError.EXCEEDS_MAX_FILE_SIZE);
            } else {
                appshell.fs.readFile(path, encoding, function (_err, _data, encoding, preserveBOM) {
                    if (_err) {
                        callback(_mapError(_err));
                    } else {
                        callback(null, _data, encoding, preserveBOM, stat);
                    }
                });
            }
        }
272155
def update_stat(self, mode='open', infostr='', stat=''):
        
        self._update_stat[mode](mode, infostr, stat)
1052144
def GetStat(self):
    
    if self._stat_object is None:
      self._stat_object = self._GetStat()
    return self._stat_object
1050270
function (summarise, callback) {
            if (_.isFunction(summarise) && !callback) {
                callback = summarise;
                summarise = true;
            }

            this.interrupt('abort', {
                summarise: summarise
            }, callback);

            _.isFunction(this.__resume) && this.resume();
        }
245721
function (args, onDone) {
	
	// check if we've init / connected already
	if (!l_connector) {
		var err = 'connection to monitor not yet established, cannot report';
		LOG.error(err, l_name);
		return UTIL.safeCall(onDone, err);
	}
	
	var serverID = SR.Settings.SERVER_INFO.id;
	
	var send_once = function (onSent) {
		var data = (typeof args.status === 'function' ? args.status() : args.status);
		
		// send a report (including status type & sender's serverID)
		// TODO: error handling?
		l_connector.send('SR_REPORT_STATUS', {
			serverID: serverID,
			type: args.type,
			data: data
		}, 'SR_REGISTER_STATUS', function (res) {
			UTIL.safeCall(onSent);
		});	
	}
	
	// send once only
	send_once(function () {
		UTIL.safeCall(onDone, null);
	});
}
762884
def _watch_callback(obj_weakref, method_name, *args, **kwargs):
    
    obj = obj_weakref()
    if obj is None:
        return
    getattr(obj, method_name)(*args, **kwargs)
715493
function stat(p) {
    var def = Q.defer();
    fs.stat(p, def.makeNodeResolver());
    return def.promise;
}
1053132
function statFile(filePath, callback) {
  fs.stat(filePath, function(err, stats) {

    // Resource does not exist
    if (err && (err.code === 'ENOENT' || err.code === 'ENOTDIR')) {
      const error = new Error('Resource does not exist');
      error.httpCode = 404;

      callback(error);

    // Not a file
    } else if (!stats.isFile()) {
      const error = new Error('Resource is not a file');
      error.httpCode = 400;

      callback(error);

    // Server error
    } else if (err) {
      const error = new Error('Server error');
      error.httpCode = 500;

      callback(error);

    // Success. Get the stats.
    } else {
      callback(null, stats);
    }
  });
}
1339431
function stat(dir) {
    return new Promise(resolve => {
        fs.lstat(dir, (err, stats) => resolve(err ? null : stats));
    });
}
1252604
def stats_timing(stats_key, stats_logger):
    """"""
    start_ts = now_as_float()
    try:
        yield start_ts
    except Exception as e:
        raise e
    finally:
        stats_logger.timing(stats_key, now_as_float() - start_ts)
434497
def __callback(self, event, *args, **kwargs):
        # type: (str, *Any, **Any) -> Any
        
        comp_callback = self.context.get_callback(event)
        if not comp_callback:
            # No registered callback
            return True

        # Call it
        result = comp_callback(self.instance, *args, **kwargs)
        if result is None:
            # Special case, if the call back returns nothing
            return True

        return result
562608
def Stat(self, ext_attrs=None):
    """"""
    del ext_attrs  # Unused.
    return self.MakeStatResponse(self.fd, tsk_attribute=self.tsk_attribute)
1009339
function stat(filepath, callback) {
  return fs.lstat(filepath, function(err, stats) {
    if (err) {
      return callback(err);
    }
    stats.path = filepath;
    stats.filename = path.basename(filepath);
    stats.mime = mime.lookup(filepath);
    return callback(null, stats);
  });
}
309159
def on_finish(self):
        
        r = self.response
        r.request_time = time.time() - self.start_time
        if self.callback:
            self.callback(r)
1174138
void callback(boolean ask) {
        if (viStatusCallback != null) {
            if (states.remove(callState.toString().toLowerCase())) {
                if (logger.isInfoEnabled()) {
                    logger.info("About to execute viStatusCallback: " + viStatusCallback.toString());
                }
                if (viStatusCallbackMethod == null) {
                    viStatusCallbackMethod = "POST";
                }
                final List<NameValuePair> parameters = parameters();
                requestCallback = new HttpRequestDescriptor(viStatusCallback, viStatusCallbackMethod, parameters);
                if (!ask) {
                    downloader.tell(requestCallback, null);
                } else if (ask) {
                    final Timeout timeout = new Timeout(Duration.create(5, TimeUnit.SECONDS));
                    Future<Object> future = (Future<Object>) ask(downloader, requestCallback, timeout);
                    DownloaderResponse downloaderResponse = null;
                    try {
                        downloaderResponse = (DownloaderResponse) Await.result(future, Duration.create(10, TimeUnit.SECONDS));
                    } catch (Exception e) {
                        logger.error("Exception during callback with ask pattern");
                    }
                }
            } else {
                if (logger.isInfoEnabled()) {
                    logger.info("Status Callback has been already executed for state: ",callState.toString());
                }
            }
        } else if(logger.isInfoEnabled()){
            logger.info("status callback is null");
        }

    }
740359
function when(){
		// handle if we get called with a function
		var args = makeArray(arguments),
			last = args[args.length -1];
			
		if(typeof last === 'function' ){
			args[args.length -1] = {
				'fn' : last
			}
			args.push("fn");
		};
		
		var waitMeth = args.pop(), 
			waitObj = args.pop(),
			joined = new join(waitObj, waitMeth); 
		
		for(var i =0; i < args.length; i = i+2){
			joined.add(args[i], args[i+1])
		}
		
		// call right away if it should
		joined.go();
	}
68549
def stat_object(self, container, obj):
        
        LOG.debug('stat_object() with %s is success.', self.driver)
        return self.driver.stat_object(container, obj)