Make sure you already have S3 bucket, access key and secret key before go through this notes.
Boto3 allows Python developers to write software that makes use of services like Amazon S3 and Amazon EC2.
pip install boto3
# This is a work in progress. There are still bugs. Once it is production-ready this will become a full repo. | |
import os | |
def count_tokens(text, model_name="gpt-3.5-turbo", debug=False): | |
""" | |
Count the number of tokens in a given text string without using the OpenAI API. | |
This function tries three methods in the following order: | |
1. tiktoken (preferred): Accurate token counting similar to the OpenAI API. | |
2. nltk: Token counting using the Natural Language Toolkit library. |
import moviepy.editor as mp | |
import math | |
from PIL import Image | |
import numpy | |
def zoom_in_effect(clip, zoom_ratio=0.04): | |
def effect(get_frame, t): | |
img = Image.fromarray(get_frame(t)) | |
base_size = img.size |
@app.route("/sitemap") | |
@app.route("/sitemap/") | |
@app.route("/sitemap.xml") | |
def sitemap(): | |
""" | |
Route to dynamically generate a sitemap of your website/application. | |
lastmod and priority tags omitted on static pages. | |
lastmod included on dynamic content such as blog posts. | |
""" | |
from flask import make_response, request, render_template |
http://www.youtube.com/watch?v=-wtIMTCHWuI | |
http://youtube.com/watch?v=-wtIMTCHWuI | |
http://m.youtube.com/watch?v=-wtIMTCHWuI | |
https://www.youtube.com/watch?v=lalOy8Mbfdc | |
https://youtube.com/watch?v=lalOy8Mbfdc | |
https://m.youtube.com/watch?v=lalOy8Mbfdc | |
http://www.youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail | |
http://youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail | |
http://m.youtube.com/watch?v=yZv2daTWRZU&feature=em-uploademail |
########################################################################### | |
# | |
## @file postgres.py | |
# | |
########################################################################### | |
import psycopg2 | |
########################################################################### | |
# |