Returns "a mark" to the current position of this node Cassandra log.
        This is for use with the from_mark parameter of watch_log_for_* methods,
        allowing to watch the log from the position when this method was called.
569
def mark_log(self, filename='system.log'):
        
        log_file = os.path.join(self.get_path(), 'logs', filename)
        if not os.path.exists(log_file):
            return 0
        with open(log_file) as f:
            f.seek(0, os.SEEK_END)
            return f.tell()
1118667
def get_line_relative_to_node(self, target_node: ast.AST, offset: int) -> str:
        
        return self.lines[target_node.lineno - self.node.lineno + offset]
579058
def toosm(self):
        
        node = create_elem('node', {'id': str(self.ident),
                                    'lat': str(self.latitude),
                                    'lon': str(self.longitude)})
        node.set('visible', 'true' if self.visible else 'false')
        if self.user:
            node.set('user', self.user)
        if self.timestamp:
            node.set('timestamp', self.timestamp.isoformat())
        if self.tags:
            for key, value in sorted(self.tags.items()):
                node.append(create_elem('tag', {'k': key, 'v': value}))

        return node
978598
public int getCurrentNode()
  {

    if (!m_cacheNodes)
      throw new RuntimeException(
        "This NodeSetDTM can not do indexing or counting functions!");

    int saved = m_next;
    // because nextNode always increments
    // But watch out for copy29, where the root iterator didn't
    // have nextNode called on it.
    int current = (m_next > 0) ? m_next-1 : m_next; 
    int n = (current < m_firstFree) ? elementAt(current) : DTM.NULL;
    m_next = saved; // HACK: I think this is a bit of a hack.  -sb
    return n;
  }
985610
def get_remembered_position(self):
        """"""
        if not self._able_to_format:
            return self._original_position
        accrued_input_index = 0
        current_output_index = 0
        while (accrued_input_index < self._position_to_remember and
               current_output_index < len(self._current_output)):
            if (self._accrued_input_without_formatting[accrued_input_index] ==
                self._current_output[current_output_index]):
                accrued_input_index += 1
            current_output_index += 1
        return current_output_index
677470
public void markVisited(int from, int upTo) {
    if (checkBounds(from) && checkBounds(upTo - 1)) {
      for (int i = from; i < upTo; i++) {
        this.markVisited(i);
      }
    }
    else {
      throw new RuntimeException("The location " + from + "," + upTo + " out of bounds [0,"
          + (this.registry.length - 1) + "]");
    }
  }
1003794
def follow(self, delay=1.0):
        
        # TODO: Handle log file rotation
        self.trailing = True
        unchanged_stats = 0
        
        while not self.should_stop_follow:
            where = self.file.tell()
            line = self.file.readline()
            if line:    
                if self.trailing and line in self.line_terminators:
                    # This is just the line terminator added to the end of the file
                    # before a new line, ignore.
                    self.trailing = False
                    continue

                if line[-1] in self.line_terminators:
                    line = line[:-1]
                    if line[-1:] == '\r\n' and '\r\n' in self.line_terminators:
                        # found crlf
                        line = line[:-1]

                self.trailing = False
                unchanged_stats = 0
                yield line
            else:
                self.trailing = True
                self.seek(where)
                yield no_new_line
                # Try to catch up rotated log file
                unchanged_stats += 1
                if unchanged_stats >= self.MAX_UNCHANGED_STATS and \
                        where != os.stat(self.file.name).st_size:
                    logger.info('Reopen log file because file may has been rotated.')
                    self.reopen_file()

                time.sleep(delay)
256817
function getMarkerLines(
  loc: NodeLocation,
  source: Array<string>,
  opts: Object,
): { start: number, end: number, markerLines: Object }
1241314
void mark()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "mark");
      SibTr.exit(tc, "mark");
    }

    _marked = true;
  }
687589
def init_cursor(self):
        
        timestamp = self.read_last_checkpoint()

        if timestamp is None or self.only_dump:
            if self.collection_dump:
                # dump collection and update checkpoint
                timestamp = self.dump_collection()
                if self.only_dump:
                    LOG.info("Finished dump. Exiting.")
                    timestamp = None
                    self.running = False

                self.update_checkpoint(timestamp)
                if timestamp is None:
                    return None, True
            else:
                # Collection dump disabled:
                # Return cursor to beginning of oplog but do not set the
                # checkpoint. The checkpoint will be set after an operation
                # has been applied.
                cursor = self.get_oplog_cursor()
                return cursor, self._cursor_empty(cursor)

        cursor = self.get_oplog_cursor(timestamp)
        cursor_empty = self._cursor_empty(cursor)

        if cursor_empty:
            # rollback, update checkpoint, and retry
            LOG.debug("OplogThread: Initiating rollback from " "get_oplog_cursor")
            self.update_checkpoint(self.rollback())
            return self.init_cursor()

        first_oplog_entry = next(cursor)

        oldest_ts_long = util.bson_ts_to_long(self.get_oldest_oplog_timestamp())
        checkpoint_ts_long = util.bson_ts_to_long(timestamp)
        if checkpoint_ts_long < oldest_ts_long:
            # We've fallen behind, the checkpoint has fallen off the oplog
            return None, True

        cursor_ts_long = util.bson_ts_to_long(first_oplog_entry["ts"])
        if cursor_ts_long > checkpoint_ts_long:
            # The checkpoint is not present in this oplog and the oplog
            # did not rollover. This means that we connected to a new
            # primary which did not replicate the checkpoint and which has
            # new changes in its oplog for us to process.
            # rollback, update checkpoint, and retry
            LOG.debug(
                "OplogThread: Initiating rollback from "
                "get_oplog_cursor: new oplog entries found but "
                "checkpoint is not present"
            )
            self.update_checkpoint(self.rollback())
            return self.init_cursor()

        # first entry has been consumed
        return cursor, cursor_empty
221636
boolean isMarked()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "isMarked");
      SibTr.exit(tc, "isMarked", new Boolean(_marked));
    }

    return _marked;
  }
408303
def get_last_an_time(self, utc_time):
        

        # Propagate backwards to ascending node
        dt = np.timedelta64(10, 'm')
        t_old = utc_time
        t_new = t_old - dt
        pos0, vel0 = self.get_position(t_old, normalize=False)
        pos1, vel1 = self.get_position(t_new, normalize=False)
        while not (pos0[2] > 0 and pos1[2] < 0):
            pos0 = pos1
            t_old = t_new
            t_new = t_old - dt
            pos1, vel1 = self.get_position(t_new, normalize=False)

        # Return if z within 1 km of an
        if np.abs(pos0[2]) < 1:
            return t_old
        elif np.abs(pos1[2]) < 1:
            return t_new

        # Bisect to z within 1 km
        while np.abs(pos1[2]) > 1:
            # pos0, vel0 = pos1, vel1
            dt = (t_old - t_new) / 2
            t_mid = t_old - dt
            pos1, vel1 = self.get_position(t_mid, normalize=False)
            if pos1[2] > 0:
                t_old = t_mid
            else:
                t_new = t_mid

        return t_mid
1136358
@Override
    public Long getTrackingPoint() {
        if (underlyingDataBuffer() != this)
            return underlyingDataBuffer() == null ? trackingPoint : underlyingDataBuffer().getTrackingPoint();
        return trackingPoint;
    }
10585
def GetLoggingLocation():
  
  frame = inspect.currentframe()
  this_file = frame.f_code.co_filename
  frame = frame.f_back
  while frame:
    if this_file == frame.f_code.co_filename:
      if 'cdbg_logging_location' in frame.f_locals:
        ret = frame.f_locals['cdbg_logging_location']
        if len(ret) != 3:
          return (None, None, None)
        return ret
    frame = frame.f_back
  return (None, None, None)
1900
async def async_get_sensor_log(self, index: int) -> Optional[SensorLogResponse]:
        

        response = await self._protocol.async_execute(
            GetSensorLogCommand(index))
        if isinstance(response, SensorLogResponse):
            return response
        return None
142189
def get_log(self, offset, count=10, callback=None):
        '''
        
        '''
        params = {'offset': offset, 'count': count}
        return self.execute_command('getLog', params, callback=callback)
764396
private void stateCheckMark() {
        StackEntry e = stack[stk];
        int x = stateCheckPos(e.getStatePStr(), ((SCStackEntry)e).getStateCheck());
        stateCheckBuff[x / 8] |= (1 << (x % 8));
    }