Fake method:
class FakeDriver(object):
def fake_method(self, node, volume, device='default_value', extra={}):
"""
teachess volume to node.
@param node: Node to attach volume to
@type node: L{Node}
# -*- coding:utf-8 -*- | |
import sys | |
import numpy.random | |
import itertools | |
class GostCrypt(object): | |
def __init__(self, key, sbox): | |
assert self._bit_length(key) <= 256 | |
self._key = None |
# -*- coding:utf-8 -*- | |
class GostCrypt(object): | |
def __init__(self, key, sbox): | |
assert self._bit_length(key) <= 256 | |
self._key = None | |
self._subkeys = None | |
self.key = key | |
self.sbox = sbox |
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import math | |
import numpy | |
def sigmoid(x): | |
"""вроде как лучше чем 1/(1+e^-x)""" | |
return math.tanh(x) | |
class BaseServiceHandler(BaseHandler): | |
""" | |
To use this class inherit from it and define _DRIVERS and _Providers | |
Also to encode to json response custom object add them to obj_attrs dict. | |
""" | |
_DRIVERS = None | |
_Providers = None | |
_providers_list_response = None | |
def _get_driver_instance(self): |
def parse_docstring(docstring): | |
""" | |
@param docstring: | |
@type docstring: | |
@return: return dict which contain: | |
description - method description | |
arguments - dict of dicts arg_name: {desctiption, typename, required} | |
return - list of return types | |
@rtype: C{dict} | |
""" |
Fake method:
class FakeDriver(object):
def fake_method(self, node, volume, device='default_value', extra={}):
"""
teachess volume to node.
@param node: Node to attach volume to
@type node: L{Node}
Fake method:
class FakeDriver(object):
def fake_method(self, node, volume, device='/deb/sdb', extra={}):
'''
teachess volume to node.
@param node: Node to attach volume to
@type node: L{Node}
Fake method:
class FakeDriver(object):
def fake_method(self, node, volume, extra, device='/deb/sdb'}):
'''
teachess volume to node.
@param node: Node to attach volume to
@type node: L{Node}
Libcloud follow epytext docstring formatiing.
@param
or @keyword
field and @type
field.@param p: ...
A description of the parameter p for a function or method.@keyword p: ...
A description of the keyword parameter p.{ | |
"website": "http://bluebox.net", | |
"supported_methods": { | |
"detach_volume": { | |
"description": "Detaches a volume from a node.\n", | |
"arguments": [ | |
{ | |
"required": true, | |
"type": "string", | |
"name": "volume_id", |