Get the glyph for the specified history index, creating if necessary.
549436
protected ChatGlyph getHistorySubtitle (int index, Graphics2D layoutGfx)
    {
        // do a brute search (over a small set) for an already-created subtitle
        for (int ii = 0, nn = _showingHistory.size(); ii < nn; ii++) {
            ChatGlyph cg = _showingHistory.get(ii);
            if (cg.histIndex == index) {
                return cg;
            }
        }

        // it looks like we have to create a new one: expensive!
        ChatGlyph cg = createHistorySubtitle(index, layoutGfx);
        cg.histIndex = index;
        cg.setDim(_dimmed);
        _showingHistory.add(cg);
        return cg;
    }
761976
def _get_xq_history(self):
        
        data = {
            "cube_symbol": str(self.account_config["portfolio_code"]),
            "count": 20,
            "page": 1,
        }
        resp = self.s.get(self.config["history_url"], params=data)
        res = json.loads(resp.text)
        return res["list"]
1325633
private Glyph getGlyphToLink(Entity e, String linkID)
	{
		if (ubiqueDet == null || !ubiqueDet.isUbique(e))
		{
			return glyphMap.get(convertID(e.getUri()));
		}
		else {
			// Create a new glyph for each use of ubique
			Glyph g = createGlyphBasics(e, false);
			g.setId(convertID(e.getUri()) + "_" + ModelUtils.md5hex(linkID));
			Set<String> uris = new HashSet<String>();
			uris.add(e.getUri());
			sbgn2BPMap.put(g.getId(), uris);
			if(e instanceof PhysicalEntity && ((PhysicalEntity)e).getCellularLocation() != null) {
				assignLocation((PhysicalEntity) e, g);
			}
			ubiqueSet.add(g);
			return g;
		}
	}
382462
def history(ctx, archive_name):
    '''
    
    '''

    _generate_api(ctx)
    var = ctx.obj.api.get_archive(archive_name)
    click.echo(pprint.pformat(var.get_history()))
1370681
def find_in_history(self, tocursor, start_idx, backward):
        """'"""
        if start_idx is None:
            start_idx = len(self.history)
        # Finding text in history
        step = -1 if backward else 1
        idx = start_idx
        if len(tocursor) == 0 or self.hist_wholeline:
            idx += step
            if idx >= len(self.history) or len(self.history) == 0:
                return "", len(self.history)
            elif idx < 0:
                idx = 0
            self.hist_wholeline = True
            return self.history[idx], idx
        else:
            for index in range(len(self.history)):
                idx = (start_idx+step*(index+1)) % len(self.history)
                entry = self.history[idx]
                if entry.startswith(tocursor):
                    return entry[len(tocursor):], idx
            else:
                return None, start_idx
747264
def _init_glyph(self, plot, mapping, properties, key):
        
        properties = mpl_to_bokeh(properties)
        plot_method = '_'.join(key.split('_')[:-1])
        renderer = getattr(plot, plot_method)(**dict(properties, **mapping))
        return renderer, renderer.glyph
443815
protected ChatGlyph createHistorySubtitle (int index, Graphics2D layoutGfx)
    {
        ChatMessage message = _history.get(index);
        int type = getType(message, true);
        return createSubtitle(message, type, layoutGfx, false);
    }
204251
function getHMTX($numberOfHMetrics, $numGlyphs, &$glyphToChar, $scale)
	{
		$start = $this->seek_table("hmtx");
		$aw = 0;
		$this->charWidths = str_pad('', 256 * 256 * 2, "\x00");
		if ($this->maxUniChar > 65536) {
			$this->charWidths .= str_pad('', 256 * 256 * 2, "\x00");
		} // Plane 1 SMP
		if ($this->maxUniChar > 131072) {
			$this->charWidths .= str_pad('', 256 * 256 * 2, "\x00");
		} // Plane 2 SMP
		$nCharWidths = 0;
		if (($numberOfHMetrics * 4) < $this->maxStrLenRead) {
			$data = $this->get_chunk($start, ($numberOfHMetrics * 4));
			$arr = unpack("n*", $data);
		} else {
			$this->seek($start);
		}
		for ($glyph = 0; $glyph < $numberOfHMetrics; $glyph++) {
			if (($numberOfHMetrics * 4) < $this->maxStrLenRead) {
				$aw = $arr[($glyph * 2) + 1];
			} else {
				$aw = $this->read_ushort();
				$lsb = $this->read_ushort();
			}
			if (isset($glyphToChar[$glyph]) || $glyph == 0) {
				if ($aw >= (1 << 15)) {
					$aw = 0;
				} // 1.03 Some (arabic) fonts have -ve values for width
				// although should be unsigned value - comes out as e.g. 65108 (intended -50)
				if ($glyph == 0) {
					$this->defaultWidth = $scale * $aw;
					continue;
				}
				foreach ($glyphToChar[$glyph] as $char) {
					//$this->charWidths[$char] = intval(round($scale*$aw));
					if ($char != 0 && $char != 65535) {
						$w = intval(round($scale * $aw));
						if ($w == 0) {
							$w = 65535;
						}
						if ($char < 196608) {
							$this->charWidths[$char * 2] = chr($w >> 8);
							$this->charWidths[$char * 2 + 1] = chr($w & 0xFF);
							$nCharWidths++;
						}
					}
				}
			}
		}
		$data = $this->get_chunk(($start + $numberOfHMetrics * 4), ($numGlyphs * 2));
		$arr = unpack("n*", $data);
		$diff = $numGlyphs - $numberOfHMetrics;
		$w = intval(round($scale * $aw));
		if ($w == 0) {
			$w = 65535;
		}
		for ($pos = 0; $pos < $diff; $pos++) {
			$glyph = $pos + $numberOfHMetrics;
			if (isset($glyphToChar[$glyph])) {
				foreach ($glyphToChar[$glyph] as $char) {
					if ($char != 0 && $char != 65535) {
						if ($char < 196608) {
							$this->charWidths[$char * 2] = chr($w >> 8);
							$this->charWidths[$char * 2 + 1] = chr($w & 0xFF);
							$nCharWidths++;
						}
					}
				}
			}
		}
		// NB 65535 is a set width of 0
		// First bytes define number of chars in font
		$this->charWidths[0] = chr($nCharWidths >> 8);
		$this->charWidths[1] = chr($nCharWidths & 0xFF);
	}
159828
def _init_glyph(self, plot, mapping, properties):
        
        box = Span(level=properties.get('level', 'glyph'), **mapping)
        plot.renderers.append(box)
        return None, box
753431
def read_history(self, symbol):
        
        find = self.find({'symbol': symbol}, sort=[('start_time', pymongo.ASCENDING)])
        times = []
        entries = []
        for item in find:
            times.append(item['start_time'])
            entries.append(item['metadata'])
        return pd.DataFrame({symbol: entries}, times)
215559
function getGlyphs($originalGlyphIdx, &$start, &$glyphSet, &$subsetglyphs)
	{
		$glyphPos = $this->glyphPos[$originalGlyphIdx];
		$glyphLen = $this->glyphPos[$originalGlyphIdx + 1] - $glyphPos;
		if (!$glyphLen) {
			return;
		}
		$this->seek($start + $glyphPos);
		$numberOfContours = $this->read_short();
		if ($numberOfContours < 0) {
			$this->skip(8);
			$flags = GlyphOperator::MORE;
			while ($flags & GlyphOperator::MORE) {
				$flags = $this->read_ushort();
			}
			$glyphIdx = $this->read_ushort();
			if (!isset($glyphSet[$glyphIdx])) {
				$glyphSet[$glyphIdx] = count($subsetglyphs); // old glyphID to new glyphID
				$subsetglyphs[$glyphIdx] = true;
			}
			$savepos = ftell($this->fh);
			$this->getGlyphs($glyphIdx, $start, $glyphSet, $subsetglyphs);
			$this->seek($savepos);
			if ($flags & GlyphOperator::WORDS) {
				$this->skip(4);
			} else {
				$this->skip(2);
			}
			if ($flags & GlyphOperator::SCALE) {
				$this->skip(2);
			} else {
				if ($flags & GlyphOperator::XYSCALE) {
					$this->skip(4);
				} else {
					if ($flags & GlyphOperator::TWOBYTWO) {
						$this->skip(8);
					}
				}
			}
		}
	}
1280637
public function historyBadge(ModelHistory $history): string
    {
        $action = '';
        switch ($history->action) {
            case ModelHistory::ACTION_UPDATE:
                $icon = 'refresh';
                break;
            case ModelHistory::ACTION_DELETE:
                $icon = 'minus-circle';
                break;
            case ModelHistory::ACTION_COMMENT:
                $icon = 'comments';
                break;
            default:
            case ModelHistory::ACTION_CREATE:
                $icon = 'plus-circle';
                break;
        }

        return '<i class="fa fa-' . $icon . '"></i>';
    }
87411
private Glyph createGlyph(Entity e)
	{
		String id = convertID(e.getUri());
		if (glyphMap.containsKey(id))
			return glyphMap.get(id);

		// Create its glyph and register
		Glyph g = createGlyphBasics(e, true);
		glyphMap.put(g.getId(), g);

		//TODO: export metadata (e.g., from bpe.getAnnotations() map) using the SBGN Extension feature
//		SBGNBase.Extension ext = new SBGNBase.Extension();
//		g.setExtension(ext);
//		Element el = biopaxMetaDoc.createElement(e.getModelInterface().getSimpleName());
//		el.setAttribute("uri", e.getUri());
//		ext.getAny().add(el);

		if (g.getClone() != null)
			ubiqueSet.add(g);

		if(e instanceof PhysicalEntity) {
			PhysicalEntity pe = (PhysicalEntity) e;
			assignLocation(pe, g);
			if("or".equalsIgnoreCase(g.getClazz())) {
				buildGeneric(pe, g, null);
			} else if (pe instanceof Complex) {
				createComplexContent((Complex) pe, g);
			}
		}

		return g;
	}
372890
def getCharStringForGlyph(self, glyph, private, globalSubrs):
        
        width = glyph.width
        defaultWidth = private.defaultWidthX
        nominalWidth = private.nominalWidthX
        if width == defaultWidth:
            # if width equals the default it can be omitted from charstring
            width = None
        else:
            # subtract the nominal width
            width -= nominalWidth
        if width is not None:
            width = otRound(width)
        pen = T2CharStringPen(width, self.allGlyphs,
                              roundTolerance=self.roundTolerance)
        glyph.draw(pen)
        charString = pen.getCharString(
            private, globalSubrs, optimize=self.optimizeCFF
        )
        return charString
477828
protected void viewDidScroll (List<? extends ChatGlyph> glyphs, int dx, int dy)
    {
        for (ChatGlyph glyph : glyphs) {
            glyph.viewDidScroll(dx, dy);
        }
    }
1177895
@GET
    @Path("{id}/history/{asOf: " + DATE_REGEX + "}")
    public Response fetchHistoryAsOf(@PathParam("id") URI_ID id, @PathParam("asof") Timestamp asOf) throws Exception {
        return super.fetchHistoryAsOf(id, asOf);
    }
888832
def get_history_item(self, index):
        '''
        item = self.history[index - 1]
        log(u"get_history_item: index:%d item:%r"%(index, item))
        return item.get_line_text()