Return a new _InlineRSTRecorder when its time to record.
166406
def maybe_start_recording(tokens, index):
        """"""
        if tokens[index].type == TokenType.BeginInlineRST:
            return _InlineRSTRecorder(index)
222612
def maybe_start_recording(tokens, index):
        """"""
        if _is_really_comment(tokens, index):
            return _CommentedLineRecorder(index, tokens[index].line)

        return None
802346
public GetRecordingResponse getRecording(String recording) {
        checkStringNotEmpty(recording, "The parameter recording should NOT be null or empty string.");
        GetRecordingRequest request = new GetRecordingRequest();
        InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, RECORDING, recording);
        return invokeHttpClient(internalRequest, GetRecordingResponse.class);
    }
858108
def _make_record(self,
                     level,
                     fmt,
                     args,
                     extra,
                     exc_info,
                     inc_stackinfo,
                     inc_multiproc):
        

        fn = fname = '(unknown file)'
        lno = 0
        func = '(unknown function)'
        code = '(code not available)'
        cc = []
        sinfo = None
        module = '(unknown module)'
        if _srcfile and inc_stackinfo:
            #IronPython doesn't track Python frames, so _find_caller throws an
            #exception on some versionf of IronPython. We trap it here so that
            #IronPython can use logging.
            try:
                fn, lno, func, code, cc, sinfo = self._find_caller()
                fname = os.path.basename(fn)
                module = os.path.splitext(fname)[0]
            except ValueError:
                pass

        if not exc_info or not isinstance(exc_info, tuple):
            # Allow passed in exc_info, but supply it if it isn't
            exc_info = sys.exc_info()

        log_record = { # This is available information for logging functions.
            #TODO:  proc_name, thread_name
            # see http://hg.python.org/cpython/file/74fa415dc715/Lib/logging/__init__.py#l279
            'asctime': time.asctime(), # TODO: actual specifier for format
            'code': code,
            'codecontext': ''.join(cc),
            'excinfo' : exc_info,
            'filename' : fname,
            'funcname' : func,
            'levelname' : level,
            'levelno' : ALL.index(level),
            'lineno' : lno,
            'logmessage' : None,
            'messagefmt' : fmt,
            'module' : module,
            'pathname' : fn,
            'process' : os.getpid(),
            'processname' : None,
            'stackinfo' : sinfo,
            'threadid' : None,
            'threadname' : None,
            'time' : time.time(),
            # The custom `extra` information can only be used to format the
            # default format. The `logmessage` can only be passed a dictionary
            # or a list (as `args`).
            'defaultfmt' : self.config['defaultfmt']
        }
        # If the user passed a single dict, use that with format.  If we're
        # passed a tuple or list, dereference its contents as args to format,
        # too. Otherwise, leave the log message as None.
        if args:
            if (isinstance(args, (tuple, list)) and
                len(args) == 1 and
                isinstance(args[0], dict)):
                log_record['logmessage'] = fmt.format(**args[0])
            else:
                log_record['logmessage'] = fmt.format(*args)
        else:
            log_record['logmessage'] = fmt

        if extra:
            log_record.update(extra) # add custom variables to record

        if threading: # check to use threading
            curthread = threading.current_thread()
            log_record.update({
                'threadid' : curthread.ident,
                'threadname' : curthread.name
            })

        if not inc_multiproc: # check to use multiprocessing
            procname = None
        else:
            procname = 'MainProcess'
            if mp:
                try:
                    procname = mp.curent_process().name
                except StandardError:
                    pass
        log_record['processname'] = procname

        return log_record
309715
def new(self, extension_sequence):
        # type: (int) -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('ES record already initialized!')

        self.extension_sequence = extension_sequence
        self._initialized = True
1279035
def new(self):
        # type: () -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('PL record already initialized!')

        self.parent_log_block_num = 0  # This will get set later

        self._initialized = True
316132
def emit(self, record: logging.LogRecord):
        """"""
        created = datetime.datetime.fromtimestamp(record.created, timezone)
        obj = {
            "level": record.levelname.lower(),
            "msg": record.msg % record.args,
            "source": "%s:%d" % (record.filename, record.lineno),
            "time": format_datetime(created),
            "thread": reduce_thread_id(record.thread),
        }
        if record.exc_info is not None:
            obj["error"] = traceback.format_exception(*record.exc_info)[1:]
        try:
            obj["context"] = self.local.context
        except AttributeError:
            pass
        json.dump(obj, sys.stdout, sort_keys=True)
        sys.stdout.write("\n")
        sys.stdout.flush()
771649
def _record_call(func):
    

    @wraps(func)
    def wrapper(*args, **kwargs):
        global global_error_context

        # log a call as about to take place
        if global_error_context is not None:
            key = CallLogKey(name=func.__name__,
                             args=[serialize_object_for_logging(arg) for arg in args],
                             kwargs={k: serialize_object_for_logging(v) for k, v in kwargs.items()})

            pre_entry = CallLogValue(timestamp_in=datetime.utcnow(),
                                     timestamp_out=None,
                                     return_value=None)
            global_error_context.log[key] = pre_entry

        val = func(*args, **kwargs)

        # poke the return value of that call in
        if global_error_context is not None:
            post_entry = CallLogValue(timestamp_in=pre_entry.timestamp_in,
                                      timestamp_out=datetime.utcnow(),
                                      return_value=serialize_object_for_logging(val))
            global_error_context.log[key] = post_entry

        return val

    return wrapper
1233198
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('ES record not yet initialized!')

        return b'ES' + struct.pack('=BBB', RRESRecord.length(), SU_ENTRY_VERSION, self.extension_sequence)
400200
def record(method, *args, &block)
      self << {method: method, args: DeepDup.(args), block: block} # DISCUSS: options.dup.
    end
281428
private OnePidRecordListImpl startRecordsInProcess(long min, long max, IInternalRecordFilter recFilter) {
		// Find first file of this process records
		File file = fileBrowser.findByMillis(min);
		if (file == null) {
			file = fileBrowser.findNext((File)null, max);
		}
		return new OnePidRecordListMintimeImpl(file, min, max, recFilter);
	}
683006
function record(f) {
              // TODO document why @refreshing exists
              // guards against recursively evaluating this recorded
              // function (@body or an async body) when calling `.get()`
              if (!_this10.refreshing) {
                var res = void 0;
                _this10.disconnect();
                if (recorded) {
                  throw new Error("this refresh has already recorded its dependencies");
                }
                _this10.refreshing = true;
                recorded = true;
                try {
                  res = recorder.record(_this10, function () {
                    return f.call(env);
                  });
                } finally {
                  _this10.refreshing = false;
                }
                if (isSynchronous) {
                  realDone(syncResult);
                }
                return res;
              }
            }
1010898
def _find_recorder(recorder, tokens, index):
    """"""
    if recorder is None:
        # See if we can start recording something
        for recorder_factory in _RECORDERS:
            recorder = recorder_factory.maybe_start_recording(tokens,
                                                              index)
            if recorder is not None:
                return recorder

    return recorder
324582
def recordEditor(self, tableType=None):
        
        if tableType == None:
            tableType = self.tableType()
        
        return self._recordEditors.get(tableType, None)
553738
function recordTiming (name, timing) {
  recorder[name] = parseInt(timing, 10) || Date.now()
  performanceEvent.trigger('update', getTiming())
}
364924
def startRecording(self, url, **options):
        
        self._steps.append(StartRecording(url, **options).obj)
832488
def from_inline(cls: Type[ESSubscribtionEndpointType], inline: str) -> ESSubscribtionEndpointType:
        
        m = ESSubscribtionEndpoint.re_inline.match(inline)
        if m is None:
            raise MalformedDocumentError(ESSubscribtionEndpoint.API)
        server = m.group(1)
        port = int(m.group(2))
        return cls(server, port)