@task
def elasticsearch():
    if platform.linux_distribution()[0] == 'Ubuntu':
        run("sudo service elasticsearch restart")
    elif platform.system() == 'Darwin':  # Mac OSX
        run('elasticsearch')
    else:
        print(
            "Your system is not recognized, you will have to start elasticsearch manually")
Log memory usage before and after a method.
dataset/ETHPy150Open CenterForOpenScience/scrapi/tasks.py/elasticsearch--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/cloudstorage/common.py/memory_usage