tag::live-data[]
191494
@Route(method = HttpMethod.GET, uri = "/live")
    public Result live() throws IOException {
        PipedInputStream in = new PipedInputStream();
        final PipedOutputStream out = new PipedOutputStream(in);
        ///...
        new Thread(
                new Runnable() {
                    Random random = new Random();

                    public void run() {
                        for (int i = 0; i < 50; i++) {
                            try {
                                String s = random.nextInt() + "\n";
                                out.write(s.getBytes());
                                Thread.sleep(100);
                            } catch (Exception e) { //NOSONAR
                                e.printStackTrace();
                            }
                        }
                        try {
                            out.close();
                        } catch (IOException e) { //NOSONAR
                            // ignore.
                        }
                    }
                }
        ).start();
        return ok(in).as(MimeTypes.TEXT);
    }
102867
protected function getTagData($tags, $byIntersect = false) {
		if (is_array($tags)) {
			$tagsData = $this->getTagHolderBackend()->getMany($tags);
			
			if (empty($tagsData)) {
				return;
			}
			
			if ($byIntersect) {
				$tagData = call_user_func_array('array_intersect', $tagsData);
				
				if (empty($tagData)) {
					return;
				}
			} else {
				$tagData = array_unique(call_user_func_array('array_merge', $tagsData));
			}
		} else {
			$tagData = $this->getTagHolderBackend()->get($tags);

			if (empty($tagData)) {
				return;
			}
		}
		
		return $tagData;
	}
1351300
def handle_data(self, data):
        """"""
        # Only process the data when we are in an active a tag and have an URL.
        if not self.active_url:
            return

        # The visible text can have a final slash so strip it off
        if data.strip('/') == self.active_url:
            self.entries.append(self.active_url)
1227072
def live_capture(self, new_timeout=10):
        
        was_enabled = self.is_enabled
        users = self.get_users()
        self.cancel_capture()
        self.verify_user()
        if not self.is_enabled:
            self.enable_device()
        if self.verbose: print ("start live_capture")
        self.reg_event(const.EF_ATTLOG)
        self.__sock.settimeout(new_timeout)
        self.end_live_capture = False
        while not self.end_live_capture:
            try:
                if self.verbose: print ("esperando event")
                data_recv = self.__sock.recv(1032)
                self.__ack_ok()
                if self.tcp:
                    size = unpack('<HHI', data_recv[:8])[2]
                    header = unpack('HHHH', data_recv[8:16])
                    data = data_recv[16:]
                else:
                    size = len(data_recv)
                    header = unpack('<4H', data_recv[:8])
                    data = data_recv[8:]
                if not header[0] == const.CMD_REG_EVENT:
                    if self.verbose: print("not event! %x" % header[0])
                    continue
                if not len(data):
                    if self.verbose: print ("empty")
                    continue
                while len(data) >= 12:
                    if len(data) == 12:
                        user_id, status, punch, timehex = unpack('<IBB6s', data)
                        data = data[12:]
                    elif len(data) == 32:
                        user_id,  status, punch, timehex = unpack('<24sBB6s', data[:32])
                        data = data[32:]
                    elif len(data) == 36:
                        user_id,  status, punch, timehex, _other = unpack('<24sBB6s4s', data[:36])
                        data = data[36:]
                    elif len(data) >= 52:
                        user_id,  status, punch, timehex, _other = unpack('<24sBB6s20s', data[:52])
                        data = data[52:]
                    if isinstance(user_id, int):
                        user_id = str(user_id)
                    else:
                        user_id = (user_id.split(b'\x00')[0]).decode(errors='ignore')
                    timestamp = self.__decode_timehex(timehex)
                    tuser = list(filter(lambda x: x.user_id == user_id, users))
                    if not tuser:
                        uid = int(user_id)
                    else:
                        uid = tuser[0].uid
                    yield Attendance(user_id, timestamp, status, punch, uid)
            except timeout:
                if self.verbose: print ("time out")
                yield None # return to keep watching
            except (KeyboardInterrupt, SystemExit):
                if self.verbose: print ("break")
                break
        if self.verbose: print ("exit gracefully")
        self.__sock.settimeout(self.__timeout)
        self.reg_event(0)
        if not was_enabled:
            self.disable_device()
770836
public void setLiveSearch(final boolean liveSearch) {
        if (liveSearch)
            attrMixin.setAttribute(LIVE_SEARCH, Boolean.toString(true));
        else
            attrMixin.removeAttribute(LIVE_SEARCH);
    }
156119
function(file) {
  console.log("✔ datafile", file)
  this.file = file
  this.tree = {name: '-*-LiveLogging-*-', children: {}, items: []}

  this.queueMessagesCount = 0
  this.flush()
}
1170243
private function checkLiveMode() {
		if(config('dokularavel.LIVE_MODE') == TRUE) {
			$this->prePaymentUrl      = 'https://pay.doku.com/api/payment/PrePayment';
			$this->paymentUrl         = 'https://pay.doku.com/api/payment/paymentMip';
			$this->directPaymentUrl   = 'https://pay.doku.com/api/payment/PaymentMIPDirect';
			$this->generateCodeUrl    = 'https://pay.doku.com/api/payment/doGeneratePaymentCode';
			$this->redirectPaymentUrl = 'https://pay.doku.com/api/payment/doInitiatePayment';
			$this->captureUrl         = 'https://pay.doku.com/api/payment/DoCapture';
			$this->paymentStatusUrl   = 'https://pay.doku.com/Suite/CheckStatus';
		}
	}
80158
function createFromData(data, container) {
  if (data === undefined) {
    return Promise.resolve([])
  }

  if (!(isObject(data) || Array.isArray(data))) {
    return Promise.reject(new Error('Invalid animation data'))
  }
  return Promise.resolve(create(data, container))
}
1170932
public boolean buildData(String[] data) {
        final int length = data.length;

        for (int i = 0; i < length; i++) {
            addAddressToList(data[i]);
        }

        return true;
    }
847671
public Object[] getGroupData(Object[] data) {

        if (isSimpleAggregate) {
            if (simpleAggregateData == null) {
                simpleAggregateData = data;

                return null;
            }

            return simpleAggregateData;
        }

        RowIterator it = groupIndex.findFirstRow(session, store, data);

        if (it.hasNext()) {
            Row row = it.getNextRow();

            if (isAggregate) {
                row.setChanged();
            }

            return row.getData();
        }

        return null;
    }
865179
function onData( numValues ) {
		var i = -1, buffer;

		// Initialize the buffer array used for chunking:
		buffer = new Array( numValues );

		/**
		* FUNCTION: onData( newVal, encoding, clbk )
		*	Data event handler. Chunks data.
		*
		* @private
		* @param {Number} newVal - new streamed data value
		* @param {String} encoding
		* @param {Function} clbk - callback to invoke after handling streamed data. Function accepts two arguments: [ error, chunk ].
		*/
		return function onData( newVal, encoding, clbk ) {
			i += 1;
			buffer[ i ] = newVal;
			if ( i === numValues-1 ) {
				i = -1;
				clbk( null, buffer.slice() );
				return;
			}
			clbk();
		}; // end FUNCTION onData()
	}
553636
function () {
    var write = function (node, enc, cb) {
      node.value = encoder.encode(node.value, dag.valueEncoding)
      stream.node(node, cb)
    }

    stream.emit('live')
    pipe(dag.createReadStream({since: changes, live: true}), through.obj(write))
  }
800423
public BatchLiveStatus[] batchLiveStatus(String[] streamTitles) throws PiliException {
        String path = baseUrl + "/livestreams";
        String json = gson.toJson(new BatchLiveStatusOptions(streamTitles));
        try {
            String resp = cli.callWithJson(path, json);

            BatchLiveStatusRet ret = gson.fromJson(resp, BatchLiveStatusRet.class);
            return ret.items;
        } catch (PiliException e) {
            throw e;
        } catch (Exception e) {
            throw new PiliException(e);
        }
    }
357293
function dataArray(data, context) {
  data = Array.isArray(data) ? data : [data];
  return context ? data.map(d => Object.assign(Object.create(context), d)) : data;
}
321366
def propose_live(self):
        """"""

        i = self.rstate.randint(self.nlive)
        u = self.live_u[i, :]

        # Choose axes.
        if self.sampling in ['rwalk', 'rstagger', 'rslice']:
            ax = self.ell.axes
        elif self.sampling == 'slice':
            ax = self.ell.paxes
        else:
            ax = np.identity(self.npdim)

        return u, ax
1046907
function( data, tag, searchData ) {

			var letter, l, depth = 2,
				current = searchData;

			for ( l = 0; l < depth; l++ ) {
				letter = tag.substring(l, l + 1);
				if (!current[letter] ) {
					current[letter] = {};
					current[letter].list = [];
				}
				if ( indexOf(current[letter].list, data) == -1 ) {
					current[letter].list.push(data);
				}
				current = current[letter];
			}
		}
835394
function (elements) {
      if (!validateArguments(elements, function () {})) return

      if (!Array.isArray(elements)) {
          elements = [ elements ]
      }

      liveElements.filter(function (e) {
          return elements.indexOf(e.element) !== -1
      }).forEach(function (e) {
          e.element.removeEventListener('input', e.handler)
      })

      liveElements = liveElements.filter(function (e) {
          return elements.indexOf(e.element) === -1
      })

      return this
    }