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 os | |
import logging | |
import sys | |
import textwrap | |
from llama_index import ( | |
GPTKeywordTableIndex, | |
SimpleDirectoryReader, | |
LLMPredictor, | |
) |
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 datetime import datetime | |
from csv import DictWriter | |
from cStringIO import StringIO | |
from parts.util.encoding import ensure_str | |
from twist.init import init_twist | |
init_twist(EXPOSE_MODULES=False) | |
from twist.models.database import main_db, close_current_connections |
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
{ | |
"title": "Growth numbers for April 2017", | |
"content": "Hi team,\nThese are our growth numbers for **April 2017**...", | |
} |
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 -*- | |
""" | |
Start video conversations from Twist by just typing `/appear room-name` | |
""" | |
from flask import Flask | |
from flask import jsonify | |
from flask import request | |
app = Flask(__name__) |
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
# Rewritten code from /r2/r2/lib/db/_sorts.pyx | |
from math import sqrt | |
def _confidence(ups, downs): | |
n = ups + downs | |
if n == 0: | |
return 0 | |
z = 1.281551565545 |
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 bitmapist import cohort | |
dates_data = cohort.get_dates_data(select1='user:active', | |
select2='task:complete', | |
select3=None, | |
time_group='days') | |
html_data = cohort.render_html_data(dates_data, | |
time_group='days') |
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 bitmapist import cohort | |
html_form = cohort.render_html_form( | |
action_url='/_Cohort', | |
selections1=[ ('Are Active', 'user:active'), ], | |
selections2=[ ('Task completed', 'task:complete'), ] | |
) | |
print html_form |
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
# Store | |
class CounterStore extends EventEmitter | |
constructor: -> | |
@count = 0 | |
@dispatchToken = @registerToDispatcher() | |
increaseValue: (delta) -> | |
@count += 1 |
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
class ModelCounter | |
constructor: (@value=1) -> | |
increaseValue: (delta) => | |
@value += delta | |
class ControllerCounter | |
constructor: (opts) -> |
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
-- List functions | |
-- | |
-- | |
LIST_DELIM = "~" | |
function list_add(key, value) | |
--- Determine the limit by inspecting if | is in the key | |
local limit = 200 | |
if string.find(key, '|') then |
NewerOlder