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
sample = np.random.choice(processed_data.index, size=int(len(processed_data)*0.9), replace=False) | |
train_data, test_data = processed_data.iloc[sample], processed_data.drop(sample) |
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 boto3 | |
from boto3.s3.transfer import S3Transfer | |
from flask import Flask, Response | |
app = Flask(__name__) | |
class S3Storage: | |
def __init__(self, bucket_name, pictures_path="", video_path=""): |
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
{ | |
"query": "how much revenue did we generate in the last quarter from XYZ Corp?", | |
"response": { ... } | |
} |
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
# $1 is the first argument | |
# remove result.txt | |
#rm output/result.txt | |
fname=`echo "$1" | awk -F "/" '{print $(NF)}'` | |
# convert the pdf to a group of tiffs | |
if [ ! -e extracted_tz_parliament/$fname.txt ]; | |
then |
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 from GraphML | |
CALL apoc.import.graphml('/tmp/complete-graph.graphml', {batchSize: 10000, storeNodeIds: 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
// Export entire database | |
CALL apoc.export.graphml.all('/tmp/complete-graph.graphml', {useTypes:true, storeNodeIds: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
''' | |
testing celery progress reporting/polling | |
* start server | |
python tempserver.py | |
* start worker | |
celery -A tempserver.celery worker -c 1 --loglevel=DEBUG | |
* browse to localhost:5000/ | |
''' | |
from flask import Flask, request, render_template_string |
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 PIL import Image, ImageDraw, ImageFont | |
import matplotlib.pyplot as plt | |
import numpy as np | |
image = Image.new('RGB', (700, 40)) | |
# Make sure the location to the font is correct | |
draw.text((40,5), 'നമ്മുടെ മലയാളം അടിപൊളിയായി ഇമേജിൽ വരുന്നു', font=ImageFont.truetype('./Manjari-Bold.ttf', 25)) | |
plt.imshow(np.asarray(image)) |
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
/* | |
, , | |
/ \/ \ | |
(/ //_ \_ | |
.-._ \|| . \ | |
\ '-._ _,:__.-"/---\_ \ | |
______/___ '. .--------------------'~-'--.)__( , )\ \ | |
`'--.___ _\ / | Here ,' \)|\ `\| | |
/_.-' _\ \ _:,_ Be Dragons " || ( | |
.'__ _.' \'-/,`-~` |/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.