This file contains hidden or 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
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): |
This file contains hidden or 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 math | |
import numpy | |
def sigmoid(x): | |
"""вроде как лучше чем 1/(1+e^-x)""" | |
return math.tanh(x) | |
This file contains hidden or 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 -*- | |
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 |
This file contains hidden or 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 -*- | |
import sys | |
import numpy.random | |
import itertools | |
class GostCrypt(object): | |
def __init__(self, key, sbox): | |
assert self._bit_length(key) <= 256 | |
self._key = None |
NewerOlder