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 asyncio | |
import logging | |
import collections | |
import urllib.parse | |
from pprint import pprint | |
import aiohttp | |
import bs4 | |
class AsyncCrawler: |
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 re | |
import math | |
import operator | |
import logging | |
from collections import defaultdict, Counter | |
import numpy as np | |
class Tokenizer: | |
def __init__(self, stop_words, ): |
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
""" | |
Lispy: Scheme Interpreter in Python | |
Peter Norvig's lis.py studied here | |
http://norvig.com/lispy.html | |
The beauty of Scheme is that the full language only needs 5 keywords and 8 syntactic forms. | |
In comparison, Python has 33 keywords and 110 syntactic forms, | |
and Java has 50 keywords and 133 syntactic forms. |
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 | |
""" | |
a simple concurrent web server | |
socket -> bind -> listen -> accept -> loop | |
""" | |
import socket | |
import os | |
import time | |
import signal |
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 | |
from flask.json import JSONEncoder | |
import datetime | |
class CustomJSONEncoder(JSONEncoder): | |
"Add support for serializing time" | |
def default(self, 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
""" | |
Machine Learning model to predict the genres of a movie from its summary | |
""" | |
import os | |
import pickle | |
from io import StringIO | |
from flask import Flask, request | |
from sklearn.preprocessing import MultiLabelBinarizer |
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
""" | |
this server recognize a person in photos after just seeing a single photo of the person | |
""" | |
import face_recognition | |
import os | |
import pickle | |
from flask import Flask, jsonify, request | |
from requests.exceptions import RequestException, Timeout, ConnectionError | |
from io import BytesIO |
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 django_filters.rest_framework import FilterSet | |
from django_filters import DateFromToRangeFilter | |
from api.models import Record | |
from django_filters.rest_framework import DjangoFilterBackend | |
from rest_framework import filters | |
class CustomFilter(FilterSet): | |
date = DateFromToRangeFilter() |
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 django.apps import AppConfig | |
class UsersConfig(AppConfig): | |
name = "users" |
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
#include "headers/audio.h" | |
#define fifo_threshold 96 //Audio out fifo | |
/**************************************************************************************** | |
* For playing the audio contained in passed array | |
****************************************************************************************/ | |
void play_audio(int audio[],int audio_len) | |
{ | |
int fifospace; |