Start the worker:
celery -A tasks worker --loglevel=info -c 2 --pidfile=celery.pid
In another terminal send 6 tasks:
python script.py
""" usage: | |
a4.py train TRAIN_FEATURE_FILE [--new] [--validate] | |
a4.py classify MUSIC_FEATURE_FILE | |
The files should be CSV with 6 columns, the last of which is the target/label/class (or empty, if classifying), and the first of which is ignored. | |
""" | |
#------------------------------------------------------------------------------- | |
# Name: Pat Kujawa | |
# Purpose: MM audio classification asn 4 | |
#------------------------------------------------------------------------------- |
# Metaprogramming/Singleton.py | |
class Singleton(type): | |
instance = None | |
def __call__(cls, *args, **kw): | |
if not cls.instance: | |
cls.instance = super(Singleton, cls).__call__(*args, **kw) | |
return cls.instance | |
class ASingleton(object): |
''' quick example showing how to attach a pdf to multipart messages | |
and then send them from SES via boto | |
''' | |
from email.mime.text import MIMEText | |
from email.mime.application import MIMEApplication | |
from email.mime.multipart import MIMEMultipart | |
import boto |
from gevent import monkey; monkey.patch_all() | |
import gevent | |
import gevent.greenlet | |
from functools import partial | |
from random import random | |
import urllib | |
import urllib2 | |
def on_exception(fun, greenlet): |
"""SocksiPy - Python SOCKS module. | |
Version 1.00 | |
Copyright 2006 Dan-Haim. All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, | |
are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright notice, |