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
abonebi |
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
@Path(URLFactory.SESSION_PATH) | |
@Api | |
@Produces(MediaType.APPLICATION_JSON) | |
public class SessionsResource { | |
(...) | |
@POST | |
@Consumes(MediaType.APPLICATION_JSON) | |
@Produces(MediaType.APPLICATION_JSON) | |
@ApiOperation(value = "Retrieve information of the newly created session", tags="session") |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import time | |
import requests | |
from humanfriendly import Spinner, Timer | |
api = "http://192.168.34.202/" | |
r = requests.get(api + 'allocations?show=current') |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import time | |
import requests | |
from humanfriendly import Spinner, Timer | |
instances_to_create = 50 | |
url = 'http://anon.kmi.open.ac.uk/instances' |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import redis | |
import operator | |
from tabulate import tabulate | |
def sort_table(table, col=0): | |
return sorted(table, key=operator.itemgetter(col)) |
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 SimPy.Simulation import * | |
class DoSth(Process): | |
def __init__(self, timeout, name='eo'): | |
Process.__init__(self, name) | |
self.timeout = timeout | |
def wait(self): | |
yield hold, self, self.timeout | |
print "Finished", self.timeout |