Triggers created event if file exists.
518433
def trigger_created(self, filepath):
        """"""
        if os.path.exists(filepath):
            self._trigger('created', filepath)
67919
function fileExists(file, handle) {
		fs.exists(file, function(exists) {
			handle.apply(null, exists ? [file] : []);
		});
	}
64025
def trigger_event(self, module_name, event):
        
        if module_name:
            self._py3_wrapper.events_thread.process_event(module_name, event)
496017
def write_event(self, event):
    
    self._lock.acquire()
    try:
      self._events_writer.WriteEvent(event)
      self._event_count += 1
      if self._always_flush:
        # We flush on every event within the integration test.
        self._events_writer.Flush()

      if self._event_count == self._check_this_often:
        # Every so often, we check whether the size of the file is too big.
        self._event_count = 0

        # Flush to get an accurate size check.
        self._events_writer.Flush()

        file_path = os.path.join(self._events_directory,
                                 self.get_current_file_name())
        if not tf.io.gfile.exists(file_path):
          # The events file does not exist. Perhaps the user had manually
          # deleted it after training began. Create a new one.
          self._events_writer.Close()
          self._events_writer = self._create_events_writer(
              self._events_directory)
        elif tf.io.gfile.stat(file_path).length > self._single_file_size_cap_bytes:
          # The current events file has gotten too big. Close the previous
          # events writer. Make a new one.
          self._events_writer.Close()
          self._events_writer = self._create_events_writer(
              self._events_directory)
    except IOError as err:
      logger.error(
          "Writing to %s failed: %s", self.get_current_file_name(), err)
    self._lock.release()
447007
def check_create_folder(filename):
    """"""
    os.makedirs(os.path.dirname(filename), exist_ok=True)
406566
def on_created(self, event):
        
        self._logger.debug('Detected create event on watched path: %s', event.src_path)

        self._process_event(event)
234905
def trigger_modified(self, filepath):
        """"""
        mod_time = self._get_modified_time(filepath)
        if mod_time > self._watched_files.get(filepath, 0):
            self._trigger('modified', filepath)
            self._watched_files[filepath] = mod_time
576133
def file_found(filename,force):
    """"""
    if os.path.exists(filename) and not force:
        logger.info("Found %s; skipping..."%filename)
        return True
    else:
        return False
572703
function trigger(context, path, data) {
    if (util.isFunction(_hooksCallbacks[path])) {
        _hooksCallbacks[path].call(context, data, context);
    }
}
720637
def trigger(self, event, filter=None, update=None, documents=None, ids=None, replacements=None):
        

        if not self.has_trigger(event):
            return

        if documents is not None:
            pass
        elif ids is not None:
            documents = self.find_by_ids(ids, read_use="primary")
        elif filter is not None:
            documents = self.find(filter, read_use="primary")
        else:
            raise Exception("Trigger couldn't filter documents")

        for doc in documents:
            getattr(doc, event)(update=update, replacements=replacements)
502234
def on_deleted(self, event):
        
        logger.debug("file removed: %s", event.src_path)
        name = self.file_name(event)

        self.on_delete(self.target_class, name)
1156439
function(event, path) {
            emitter.emit("file:changed", {
                event: event,
                path: path,
                namespace: namespace
            });
        }
1217930
def on_deleted(self, event):
        
        logger.debug("File deleted: %s", event.src_path)
        if not event.is_directory:
            self.update_file(event.src_path)
205017
public void onEvent(final WatchEvent<Path> event) {
        Kind kind = event.kind();
        if (StandardWatchEventKind.ENTRY_CREATE.equals(kind)) {
            File file = new File(event.context().toString());
            listener.fileCreated(file);
        } else if (StandardWatchEventKind.ENTRY_DELETE.equals(kind)) {
            File file = new File(event.context().toString());
            listener.fileDeleted(file);
        } else if (StandardWatchEventKind.ENTRY_MODIFY.equals(kind)) {
            File file = new File(event.context().toString());
            listener.fileChanged(file);
        }
    }
1140026
def trigger_event(self, source, event, args):
		
		actions = []
		for action in event.actions:
			if callable(action):
				ac = action(self, *args)
				if not ac:
					# Handle falsy returns
					continue
				if not hasattr(ac, "__iter__"):
					actions.append(ac)
				else:
					actions += action(self, *args)
			else:
				actions.append(action)
		ret = source.game.trigger(self, actions, args)
		if event.once:
			self._events.remove(event)

		return ret
382894
function exists(file, src, opts) {
	var files = opts.path.map(function (dir) {
		return path.join(dir, file);
	});

	files = globby.sync(files);

	if (!files.length) {
		throw new Error(createError(file, src, opts.path));
	}

	return files[0];
}
698479
@Override
    public void triggerEvent() {
        // delete all outdated events
        try {
            lock.writeLock().lock();
            long currentTime = System.currentTimeMillis();
            if (latestEvent.get() == 0)
                this.latestEvent.set(currentTime);

            actualizeCounts(currentTime);
            int currentBin = (int) TimeUnit.SECONDS.convert(currentTime, TimeUnit.MILLISECONDS) % buckets.length;

            buckets[currentBin]++;

            // nullify next bin
            if (currentBin == buckets.length - 1)
                buckets[0] = 0;
            else
                buckets[currentBin + 1] = 0;

            // set new time
            this.latestEvent.set(currentTime);
        } finally {
            lock.writeLock().unlock();
        }
    }