Function used when agent is `lazy`.
        It is being processed only when `ready` condition is satisfied
432079
def ready(self):
        
        logger = self.get_logger()
        now = current_ts()
        logger.trace("Current time: {0}".format(now))
        logger.trace("Last Run: {0}".format(self._last_run))
        delta = (now - self._last_run)
        logger.trace("Delta: {0}, Interval: {1}"
                     .format(delta, self.interval * 1000))
        return delta > self.interval * 1000
1296969
function __lazyload(key, node, dfd){
			callback.call(self, node, "loading");
			node.load().done(function(){
				self.loadKeyPath.call(self, loadMap[key], callback, node).always(_makeResolveFunc(dfd, self));
			}).fail(function(errMsg){
				self.warn("loadKeyPath: error loading: " + key + " (parent: " + root + ")");
				callback.call(self, node, "error");
				dfd.reject();
			});
		}
182632
function api_ready(ready) {
    var self = this

    if ('function' === typeof ready) {
      setImmediate(function register_ready() {
        if (root$.private$.ge.isclear()) {
          execute_ready(ready.bind(self))
        } else {
          root$.private$.ready_list.push(ready.bind(self))
        }
      })
    }

    return self
  }
432538
function waitResolveable() {
    var ms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;

    var ret = {};
    ret.promise = new Promise(function (res) {
        ret.resolve = function (x) {
            return res(x);
        };
        setTimeout(res, ms);
    });
    return ret;
}
460723
private void lazyInit() {

    if (tokenToPosTagMap != null) {
      return;
    }

    Map<String, List<MultiWordEntry>> map = new HashMap<>();

    try (InputStream stream = JLanguageTool.getDataBroker().getFromResourceDirAsStream(filename)) {
      List<String> posTokens = loadWords(stream);

      for (String posToken : posTokens) {
        String[] tokenAndTag = posToken.split("\t");
        if (tokenAndTag.length != 2) {
          throw new RuntimeException("Invalid format in " + filename + ": '" + posToken + "', expected two tab-separated parts");
        }
        
        String[] tokens = tokenAndTag[0].split(" ");
        String posTag = tokenAndTag[1];
        
        List<MultiWordEntry> multiwordItems;
        if( map.containsKey(tokens[0]) ) {
          multiwordItems = map.get(tokens[0]);
        }
        else {
          multiwordItems = new ArrayList<>();
          map.put(tokens[0], multiwordItems);
        }
        
        multiwordItems.add(new MultiWordEntry(Arrays.asList(tokens), posTag));
      }
      
      tokenToPosTagMap = map;
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
362050
function ready(callback) {
  let onLoaded = (event) => {
    if (document.addEventListener) {
      document.removeEventListener('DOMContentLoaded', onLoaded, false);
      window.removeEventListener('load', onLoaded, false);
    }
    else if (document.attachEvent) {
      document.detachEvent('onreadystatechange', onLoaded);
      window.detachEvent('onload', onLoaded);
    }

    setTimeout(callback, 1);
  };

  if (document.readyState === 'complete') return setTimeout(callback, 1);

  if (document.addEventListener) {
    document.addEventListener('DOMContentLoaded', onLoaded, false);
    window.addEventListener('load', onLoaded, false);
  }
  else if (document.attachEvent) {
    document.attachEvent('onreadystatechange', onLoaded);
    window.attachEvent('onload', onLoaded);
  }
}
135081
def lazy_result(f):
    """"""
    @wraps(f)
    def decorated(ctx, param, value):
        return LocalProxy(lambda: f(ctx, param, value))
    return decorated
1043956
private synchronized void lazyLoad() {
    	
    	if (formula != null) {
    		// We've already done this...
    		return;
    	}
    	
		try {

			// Obtain the Formula...
			Class<?> c = grammar.getClassLoader().loadClass(clazz);
			Bootstrappable b = (Bootstrappable) c.newInstance();
			Formula frm = b.getFormula();

			// Sanity check -- refuse the formula if the class doesn't match!
			if (!frm.getImplementationClass().equals(c)) {
				String msg = "Invalid Formula Provided by Task or Phrase Implementation:  class '"
							+ c.getName() + "' provided a formula specifying implementation class '"
							+ frm.getImplementationClass().getName() + "'.";
				throw new RuntimeException(msg);
			}

			// Evaluate the mappings...
			Map<Reagent,Object> mpg = new HashMap<Reagent,Object>();
			if (contentModel != null) {
				for (Reagent r : frm.getReagents()) {
					Object value = r.getReagentType().evaluate(grammar, contentModel, r.getXpath());
					if (value != null) {
						mpg.put(r, value);
					}
				}
			}
			
			// Evaluate the type...
			Entry.Type y = null;
			if (b instanceof Phrase) {
				// NB:  For the moment it seems perilous to allow a 
				// single class to define both a Phrase and a Task;  
				// if it implements Phrase, it's a Phrase. 
				y = Entry.Type.PHRASE;
			} else if (b instanceof Task) {
				y = Entry.Type.TASK;
			} else {
				String msg = "The specified IMPL class does not implement a " +
												"known entry type:  " + clazz;
				throw new RuntimeException(msg);
			}

			// Set the member variables that were lazyLoaded...
			this.type = y;
			this.formula = frm;
			this.mappings = mpg;

		} catch (Throwable t) {
			String msg = "Unable to lazyLoad() the specified entry:" +
							"\n\t\tname=" + this.name +
							"\n\t\timpl=" + this.clazz;
			throw new RuntimeException(msg, t);
		}

    }
827175
function execWaitReadyFunctions() {
    if (isReady()) {
        logger.info('Page is ready. Executing ' + callbacksOnReady.length + ' functions that are waiting.');
        for (var i = 0; i < callbacksOnReady.length; i++) {
            var callback = callbacksOnReady[i];
            callback();
        }
    }
}
372219
function whenReady(callback) {

		function onLoaded() {
			document.removeEventListener( "DOMContentLoaded", onLoaded, false );
			callback();
		}

		if ( document.readyState === 'complete' ) {
			callback();
		} else {
			document.addEventListener( "DOMContentLoaded", onLoaded, false );
		}
	}
1004669
function forceReady(timeout) {
    if (timeout === undefined) {
      queue.ready();
      return;
    }
    var handle = setTimeout(function() {
      queue.ready();
    }, timeout);
    Polymer.whenReady(function() {
      clearTimeout(handle);
    });
  }
1039315
function then(onFulfilled, onRejected){
        var react = {
          ok:   typeof onFulfilled == 'function' ? onFulfilled : true,
          fail: typeof onRejected == 'function'  ? onRejected  : false
        };
        var promise = react.P = new (speciesConstructor(this, P))(function(res, rej){
          react.res = res;
          react.rej = rej;
        });
        aFunction(react.res);
        aFunction(react.rej);
        var record = this[RECORD];
        record.c.push(react);
        if(record.a)record.a.push(react);
        if(record.s)notify(record, false);
        return promise;
      }
641799
function lazyDo(fn, timeOut, doName, obj) {
  var sto = null;

  if (!obj) {
    obj = window;
  }
  if (timeOut == null) {
    timeOut = 25;
  }

  //If before the implementation of the operation has not exceeded the time,then make it cancel.
  if (doName && obj[doName]) {
    clearTimeout(obj[doName]);
  }

  //Delay for a period of time to perform the operation.
  sto = setTimeout(function () {
    fn.call(obj);
  }, timeOut);

  if (doName) {
    obj[doName] = sto;
  }

  return sto;
}
11206
function ontick(next) {
      // No point in waiting that long
      if (next >= timeoutOn) {
        timeout();
        return;
      }

      const activeWindow = eventLoop.active;
      if (completionFunction && activeWindow.document.documentElement)
        try {
          const waitFor   = Math.max(next - Date.now(), 0);
          // Event processed, are we ready to complete?
          const completed = completionFunction(activeWindow, waitFor);
          if (completed)
            done();
        } catch (error) {
          done(error);
        }

    }
900319
function lazy(schema, defaults, options) {
  if (kindOf(schema) !== 'function') {
    if (process.env.NODE_ENV !== 'production') {
      throw new Error(
        `Lazy structs must be defined as an function that returns a schema, but you passed: ${schema}`
      )
    } else {
      throw new Error(`Invalid schema: ${schema}`)
    }
  }

  let kind
  let struct
  const name = 'lazy'
  const type = `lazy...`
  const compile = value => {
    struct = schema()
    kind.name = struct.kind
    kind.type = struct.type
    kind.validate = struct.validate
    return kind.validate(value)
  }

  kind = new Kind(name, type, compile)
  return kind
}
97033
function lazyBuildObjectTree(priv, formatted) {
  definePropertyGetters(formatted, {
    children: lazy(function() { return priv.fqnMap.getChildrenOf(formatted.fqn); }),
    fields: lazy(function() { return formatted.children.filter(Filter.ofType('property')); }),
    methods: lazy(function() { return formatted.children.filter(Filter.ofType('function')); }),
    parent: lazy(function() { return priv.fqnMap.getParentOf(formatted.fqn); }),
    parentElement: lazy(function() { return priv.fqnMap.get(formatted.idTags['parent-element']); }),
  });
}
133190
function whenDocumentReady( callback ) {
   return new Promise( ( resolve, reject ) => {
      function ready() {
         try {
            resolve( callback() );
         }
         catch( err ) {
            reject( err );
         }
      }

      if( document.readyState === 'complete' || document.readyState === 'interactive' ) {
         ready();
      }
      else {
         document.addEventListener( 'DOMContentLoaded', ready );
      }
   } );
}