Get the Document's state
179262
def state(self):
        """"""
        state = self._resource.get('state', self.default_state)

        if state in State:
            return state
        else:
            return getattr(State, state)
1036350
def _get_last_state(self, state_file):
        """"""
        state = None
        fp = open(state_file)
        try:
            state = int(fp.read())
            print("Found previous state: %d" % (state,))
        finally:
            fp.close()
        return state
1125980
function GetState(state) {
  var SVG = MathJax.OutputJax.SVG,
      TEX = MathJax.InputJax.TeX,
      MML = MathJax.ElementJax.mml,
      AMS = MathJax.Extension["TeX/AMSmath"],
      HUB = MathJax.Hub, HTML = MathJax.HTML,
      GLYPH = (SVG.BBOX||{}).GLYPH;

  if (state && state.AMS) {
    AMS.startNumber = state.AMS.startNumber;
    AMS.labels = state.AMS.labels;
    AMS.IDs = state.AMS.IDs;
    MML.SUPER.ID = state.mmlID;
    GLYPH.glyphs = state.glyphs;
    GLYPH.defs = state.defs;
    GLYPH.n = state.n;
    ID = state.ID;
  } else {
    if (state) {state.AMS = {}}
    if (SVG.resetGlyphs) SVG.resetGlyphs(true);
    if (data.useGlobalCache) {
      state.glyphs = {};
      state.defs = HTML.Element("defs");
      state.n = 0;
    }
    if (TEX.resetEquationNumbers) TEX.resetEquationNumbers();
    MML.SUPER.ID = ID = 0;
    MathJax.OutputJax.CommonHTML.ID = 0;
  }
}
1342889
def document(self):
        
        if self.is_document:
            return self
        return self.adapter.wrap_document(self.adapter.impl_document)
1202050
def document(self):
        
        doc = {'mode': self.__mongos_mode}
        if self.__tag_sets not in (None, [{}]):
            doc['tags'] = self.__tag_sets
        if self.__max_staleness != -1:
            doc['maxStalenessSeconds'] = self.__max_staleness
        return doc
446485
def _get_state(self, **kwargs):
        '''
        

        '''

        return self.describe(fields=dict(state=True), **kwargs)["state"]
234152
def _getMetadata(self, key):
        """"""
        if self.isClosed:
            raise ValueError("operation illegal for closed doc")

        return _fitz.Document__getMetadata(self, key)
798558
function onDocumentState (doc, stateFn, callback) {
  let ready = stateFn(doc)

  if (ready) {
    callback(doc)

    return
  }

  const readyListener = () => {
    if (!stateFn(doc)) {
      return
    }

    if (!ready) {
      ready = true
      callback(doc)
    }

    doc.removeEventListener('readystatechange', readyListener)
  }

  doc.addEventListener('readystatechange', readyListener)
}
190302
def _get_state(pkg):
    '''
    
    '''
    cmd = ['opkg', 'status']
    cmd.append(pkg)
    out = __salt__['cmd.run'](cmd, python_shell=False)
    state_flag = ''
    for line in salt.utils.itertools.split(out, '\n'):
        if line.startswith('Status'):
            _status, _state_want, state_flag, _state_status = line.split()

    return state_flag
170573
def get_state(self, **kwargs):
        ""
        state = {'x_cls':self.x.__class__, 'x_proc':self.x.processor,
                 'y_cls':self.y.__class__, 'y_proc':self.y.processor,
                 'tfms':self.tfms, 'tfm_y':self.tfm_y, 'tfmargs':self.tfmargs}
        if hasattr(self, 'tfms_y'):    state['tfms_y']    = self.tfms_y
        if hasattr(self, 'tfmargs_y'): state['tfmargs_y'] = self.tfmargs_y
        return {**state, **kwargs}
476144
def state(self):
        
        state = self._resource.get('state', self.default_state)
        if state not in State:
            state = getattr(State, state)

        if not self.parent:
            raise Exception('Unable to check the parent state')

        parent_state = self.parent.state

        return max([state, parent_state], key=attrgetter('value'))
636306
function getState(cm, pos) {
	pos = pos || cm.getCursor("start");
	var stat = cm.getTokenAt(pos);
	if(!stat.type) return {};

	var types = stat.type.split(" ");

	var ret = {},
		data, text;
	for(var i = 0; i < types.length; i++) {
		data = types[i];
		if(data === "strong") {
			ret.bold = true;
		} else if(data === "variable-2") {
			text = cm.getLine(pos.line);
			if(/^\s*\d+\.\s/.test(text)) {
				ret["ordered-list"] = true;
			} else {
				ret["unordered-list"] = true;
			}
		} else if(data === "atom") {
			ret.quote = true;
		} else if(data === "em") {
			ret.italic = true;
		} else if(data === "quote") {
			ret.quote = true;
		} else if(data === "strikethrough") {
			ret.strikethrough = true;
		} else if(data === "comment") {
			ret.code = true;
		} else if(data === "link") {
			ret.link = true;
		} else if(data === "tag") {
			ret.image = true;
		} else if(data.match(/^header(\-[1-6])?$/)) {
			ret[data.replace("header", "heading")] = true;
		}
	}
	return ret;
}
456707
def get(self) -> None:
        """"""
        from wdom.document import get_document
        logger.info('connected')
        self.write(get_document().build())
206147
def get_status(id)
			
			if id == nil || id == ""
				return nil
			end			
			
			result = get(@protocol + WebServicesBaseURLGet + "getstatus.ashx?id=" + GrabzIt::Utility.nil_check(id))

			doc = REXML::Document.new(result)

			processing = doc.root.elements["Processing"].text()
			cached = doc.root.elements["Cached"].text()
			expired = doc.root.elements["Expired"].text()
			message = doc.root.elements["Message"].text()

			return ScreenShotStatus.new((processing == TrueString), (cached == TrueString), (expired == TrueString), message)
		end
959045
def in_state(obj, states, stateflowid='review_state'):
    
    if not states:
        return False
    obj_state = getCurrentState(obj, stateflowid=stateflowid)
    return obj_state in states
1320218
function (filepath, source_code) {
	pp.state = {
		docs     : [],
		exports  : [],
		filepath : filepath,
	};

	pp.process(filepath, source_code);

	return pp.state;
}
836254
def _get_state(self):
        

        result = yield from self._execute("showvminfo", [self._vmname, "--machinereadable"])
        for info in result.splitlines():
            if '=' in info:
                name, value = info.split('=', 1)
                if name == "VMState":
                    return value.strip('"')
        return "unknown"