Loads all new events from disk.

    Calling Load multiple times in a row will not 'drop' events as long as the
    return value is not iterated over.

    Yields:
      All events in the file that have not been yielded yet.
333845
def Load(self):
    
    for record in super(EventFileLoader, self).Load():
      yield event_pb2.Event.FromString(record)
1267919
def get_events(self):
        '''
        
        '''
        ret = []
        while True:
            event = self.event.get_event(wait=1, full=True)
            if event is None:
                return ret
            ret.append(event)
487417
async def _load(self):
        

        flags = self._kwargs.get('flags')

        if not flags:
            flags = {1: {}}

        cols = {k: [] for k in flags.keys()}

        with open(self._file_path, newline='', encoding='utf-8') as f:
            reader = csv.reader(f)

            for row in reader:
                for i, col in cols.items():
                    try:
                        val = row[i].strip()
                        assert val
                    except (IndexError, AssertionError):
                        pass
                    else:
                        col.append((row[0], val))

        for i, col in cols.items():
            self._update({self._locale: col}, flags[i])
1178825
def events(self):
        # type: () -> Generator[Event, None, None]
        
        while self._events:
            yield self._events.popleft()

        try:
            for frame in self._proto.received_frames():
                if frame.opcode is Opcode.PING:
                    assert frame.frame_finished and frame.message_finished
                    yield Ping(payload=frame.payload)

                elif frame.opcode is Opcode.PONG:
                    assert frame.frame_finished and frame.message_finished
                    yield Pong(payload=frame.payload)

                elif frame.opcode is Opcode.CLOSE:
                    code, reason = frame.payload
                    if self.state is ConnectionState.LOCAL_CLOSING:
                        self._state = ConnectionState.CLOSED
                    else:
                        self._state = ConnectionState.REMOTE_CLOSING
                    yield CloseConnection(code=code, reason=reason)

                elif frame.opcode is Opcode.TEXT:
                    yield TextMessage(
                        data=frame.payload,
                        frame_finished=frame.frame_finished,
                        message_finished=frame.message_finished,
                    )

                elif frame.opcode is Opcode.BINARY:
                    yield BytesMessage(
                        data=frame.payload,
                        frame_finished=frame.frame_finished,
                        message_finished=frame.message_finished,
                    )
        except ParseFailed as exc:
            yield CloseConnection(code=exc.code, reason=str(exc))
735624
def on_created(self, event):
        
        if os.path.isdir(event.src_path):
            return

        logger.debug("File created: %s", event.src_path)

        name = self.file_name(event)

        try:
            result = self.target_class.from_config(
                name, yaml.load(open(event.src_path))
            )
        except Exception as e:
            logger.exception(
                "Error when loading new config file %s: %s",
                event.src_path, str(e)
            )
            return

        if not result:
            return

        self.on_add(self.target_class, name, result)
66902
def reset(self, **kwargs):
        
        self.drop_all(**kwargs)
        file_locations = self.__file_locations__
        self.__file_locations__ = []
        self.load(file_locations, **kwargs)
608342
def Reload(self):
    """"""
    logger.info('Beginning DbImportMultiplexer.Reload()')
    # Defer event sink creation until needed; this ensures it will only exist in
    # the thread that calls Reload(), since DB connections must be thread-local.
    if not self._event_sink:
      self._event_sink = self._CreateEventSink()
    # Use collections.deque() for speed when we don't need blocking since it
    # also has thread-safe appends/pops.
    loader_queue = collections.deque(six.itervalues(self._run_loaders))
    loader_delete_queue = collections.deque()

    def batch_generator():
      while True:
        try:
          loader = loader_queue.popleft()
        except IndexError:
          return
        try:
          for batch in loader.load_batches():
            yield batch
        except directory_watcher.DirectoryDeletedError:
          loader_delete_queue.append(loader)
        except (OSError, IOError) as e:
          logger.error('Unable to load run %r: %s', loader.subdir, e)

    num_threads = min(self._max_reload_threads, len(self._run_loaders))
    if num_threads <= 1:
      logger.info('Importing runs serially on a single thread')
      for batch in batch_generator():
        self._event_sink.write_batch(batch)
    else:
      output_queue = queue.Queue()
      sentinel = object()
      def producer():
        try:
          for batch in batch_generator():
            output_queue.put(batch)
        finally:
          output_queue.put(sentinel)
      logger.info('Starting %d threads to import runs', num_threads)
      for i in xrange(num_threads):
        thread = threading.Thread(target=producer, name='Loader %d' % i)
        thread.daemon = True
        thread.start()
      num_live_threads = num_threads
      while num_live_threads > 0:
        output = output_queue.get()
        if output == sentinel:
          num_live_threads -= 1
          continue
        self._event_sink.write_batch(output)
    for loader in loader_delete_queue:
      logger.warn('Deleting loader %r', loader.subdir)
      del self._run_loaders[loader.subdir]
    logger.info('Finished with DbImportMultiplexer.Reload()')
130742
def run(self) -> Generator[Tuple[int, int, str, type], None, None]:
        
        if is_test_file(self.filename):
            self.load()
            for func in self.all_funcs():
                try:
                    for error in func.check_all():
                        yield (error.line_number, error.offset, error.text, Checker)
                except ValidationError as error:
                    yield error.to_flake8(Checker)
790075
def each
      @dir.synchronize do
        ensure_reader_open
        (0...@reader.max_doc).each do |i|
          yield @reader[i].load unless @reader.deleted?(i)
        end
      end
    end
589316
def reload
      Dir.glob('**/*.rb').each { |file| Reloader.reload_file(file) }

      self.last_run_passed = true
      self.rerun_specs = []
    end
1211259
def load_next_step_handlers(self, filename="./.handler-saves/step.save", del_file_after_loading=True):
        
        self.next_step_saver.load_handlers(filename, del_file_after_loading)
544317
def _iterate_records(self):
        
        raise_invalid_gzip = False
        empty_record = False

        while True:
            try:
                self.record = self._next_record(self.next_line)
                if raise_invalid_gzip:
                    self._raise_invalid_gzip_err()

                yield self.record

            except EOFError:
                empty_record = True

            self.read_to_end()

            if self.reader.decompressor:
                # if another gzip member, continue
                if self.reader.read_next_member():
                    continue

                # if empty record, then we're done
                elif empty_record:
                    break

                # otherwise, probably a gzip
                # containing multiple non-chunked records
                # raise this as an error
                else:
                    raise_invalid_gzip = True

            # non-gzip, so we're done
            elif empty_record:
                break

        self.close()
1359545
def __yield_handlers(self, event_type):
        
        if event_type not in self.event_types:
            raise ValueError("%r not found in %r.event_types == %r" % (event_type, self, self.event_types))

        # Search handler stack for matching event handlers
        for frame in list(self._event_stack):
            if event_type in frame:
                yield frame[event_type]

        # Check instance for an event handler
        if hasattr(self, event_type):
            yield getattr(self, event_type)
893435
async def _load(self):
        

        key = self._kwargs['key']
        pos = self._kwargs['pos']
        neg = self._kwargs['neg']

        with open(self._file_path, newline='', encoding='utf-8') as f:
            reader = csv.reader(f)
            data = {}

            for row in reader:
                try:
                    data[row[key]] = data.get(row[key], []) + [
                        tuple(extract_ranges(row, [pos] + neg))
                    ]
                except IndexError:
                    pass

        self._update({self._locale: data})
24820
function loadFiles(items, event) {
      if(!items.length){
        return; // nothing to do
      }
      $.fire('beforeAdd');
      var files = [];
      processCallbacks(
          Array.prototype.map.call(items, function(item){
            // bind all properties except for callback
            var entry = item;
            if('function' === typeof item.webkitGetAsEntry){
              entry = item.webkitGetAsEntry();
            }
            return processItem.bind(null, entry, "", files);
          }),
          function(){
            if(files.length){
              // at least one file found
              appendFilesFromFileList(files, event);
            }
          }
      );
    }
1134292
def events(options = {})
      batches = Enumerator.new do |y|
        options = options.merge(stack_name: @name)
        resp = @client.describe_stack_events(options)
        resp.each_page do |page|
          batch = []
          page.data.stack_events.each do |s|
            batch << Event.new(
              id: s.event_id,
              data: s,
              client: @client
            )
          end
          y.yield(batch)
        end
      end
      Event::Collection.new(batches)
    end
303679
def yieldable(self):
        """"""
        if self.read_buffer is None:
            return False

        t = _remove_trailing_new_line(self.read_buffer)
        n = _find_furthest_new_line(t)
        if n >= 0:
            return True

        # we have read in entire file and have some unprocessed lines
        if self.read_position == 0 and self.read_buffer is not None:
            return True
        return False