This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from llama_index.vector_stores.simple import SimpleVectorStoreData, SimpleVectorStore | |
from llama_index.indices.vector_store import GPTVectorStoreIndex | |
from llama_index.data_structs.data_structs_v2 import SimpleIndexDict | |
from llama_index.docstore.simple_docstore import SimpleDocumentStore | |
def merge_vector_indices(vector_indices): | |
""" | |
Merges multiple instances of GPTSimpleVectorIndex from | |
the LlamaIndex (0.5.27) library into a single GPTVectorStoreIndex instance. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import png | |
f = open('icon.png', 'wb') | |
w = png.Writer(1, 1, greyscale=True) | |
w.write(f, [[240]]) | |
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Simple 2D packing for PlotDevice by Takahiro Kamatani | |
Based on https://pypi.python.org/pypi/ortoolpy by Saito Tsutomu | |
License: Python Software Foundation License | |
""" | |
class Cut(object): | |
V = True | |
H = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def event_usage(self, task_id, since, until, interval="1m"): | |
interval_ms = 60000 # 1 minute | |
quantize = lambda t: (t // interval_ms) * interval_ms | |
q_since, q_until = quantize(since), quantize(until) | |
# --- scripts --- | |
quantize_closure = "quantize = { it.intdiv(interval_ms) * interval_ms }\n" | |
script = {} | |
script['init'] = """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mecab="mecab-0.996" | |
mecab_python="mecab-python-0.996" | |
mecab_googlecode="https://mecab.googlecode.com/files/" | |
if ! type curl > /dev/null; then | |
downloader='wget ' | |
else | |
downloader='curl -O ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# requirement: mecab | |
crfpp="CRF++-0.58" | |
crfpp_googlecode="https://crfpp.googlecode.com/files/" | |
cabocha="cabocha-0.68" | |
cabocha_googlecode="https://cabocha.googlecode.com/files/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Satoh's shoe rack OpenSCAD file | |
shoe_rack_height = 780 - 200; | |
support_width = 45; | |
support_thick = 15; | |
module shoe_rack_support(x, y) { | |
translate([x, y, 0]) { | |
cube([support_width, support_thick, shoe_rack_height]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
from random import sample | |
def try_boy(): | |
result = [] | |
child = sample(("Boy", "Girl"), 1)[0] | |
result.append(child) | |
if child == 'Girl': | |
result.extend(try_boy()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import codecs | |
import HTMLParser | |
import sys | |
import re | |
import bz2 | |
DEBUG = False |
NewerOlder