code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class PayListAdmin(views.MethodView): <NEW_LINE> <INDENT> template = 'panel/pay_list.html' <NEW_LINE> @login_required <NEW_LINE> @panel_permission.require(401) <NEW_LINE> def get(self): <NEW_LINE> <INDENT> pays = (PayModel.query .order_by(PayModel.date_created.desc()) .all()) <NEW_LINE> return render_template(self.temp...
`get`: 查询账款列表
62598ede851cf427c66b6868
class Unregister(Message): <NEW_LINE> <INDENT> MESSAGE_TYPE = 66 <NEW_LINE> def __init__(self, request, registration): <NEW_LINE> <INDENT> assert(type(request) in six.integer_types) <NEW_LINE> assert(type(registration) in six.integer_types) <NEW_LINE> Message.__init__(self) <NEW_LINE> self.request = request <NEW_LINE> ...
A WAMP `UNREGISTER` message. Format: ``[UNREGISTER, Request|id, REGISTERED.Registration|id]``
62598ede23849d37ff84f651
class DBStoreRequestTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.database = configuration.get_config_value('logging', 'database') <NEW_LINE> self.session = get_session() <NEW_LINE> assert self.session <NEW_LINE> <DEDENT> def test_insert_request(self): <NEW_LINE> <INDENT> reques...
Store process request to database and retrieve it again
62598ede01c39578d7f1133f
class SelectorError(Exception): <NEW_LINE> <INDENT> pass
Common parent for :class:`SelectorSyntaxError` and :class:`ExpressionError`. You can just use ``except SelectorError:`` when calling :meth:`~GenericTranslator.css_to_xpath` and handle both exceptions types.
62598ede6aa9bd52df0d3445
class AccessLog(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(settings.AUTH_USER_MODEL, db_index=True) <NEW_LINE> timestamp = models.DateTimeField(auto_now_add=True, db_index=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> index_together = (('user', 'timestamp'), ) <NEW_LINE> <...
Base class which logs access of information. Attributes: user: The user which accessed the data. timestamp: Timestamp of the access.
62598edefbf16365ca79263a
class BaseConfig: <NEW_LINE> <INDENT> TESTING = False <NEW_LINE> SQLALCHEMY_TRACK_MODIFICATIONS = False <NEW_LINE> SECRET_KEY = 'my_precious' <NEW_LINE> DEBUG_TB_ENABLED = False <NEW_LINE> DEBUG_TB_INTERCEPT_REDIRECTS = False
Base configuation
62598ede99cbb53fe682f449
class Int16(Int): <NEW_LINE> <INDENT> def __init__(self, msg_fields, required=False, values=None, note=None): <NEW_LINE> <INDENT> super(Int16, self).__init__(msg_fields, required=required, values=values, min=0, max=0xFFFF, note=note)
An 2 bytes integer.
62598ede4428ac0f6e656aea
class CosineAnnealingLR_with_Restart(_LRScheduler): <NEW_LINE> <INDENT> def __init__(self, optimizer, T_max, T_mult, eta_min=0, last_epoch=-1): <NEW_LINE> <INDENT> self.T_max = T_max <NEW_LINE> self.T_mult = T_mult <NEW_LINE> self.Te = self.T_max <NEW_LINE> self.eta_min = eta_min <NEW_LINE> self.current_epoch = last_ep...
Set the learning rate of each parameter group using a cosine annealing schedule, where :math:`\eta_{max}` is set to the initial lr and :math:`T_{cur}` is the number of epochs since the last restart in SGDR: .. math:: \eta_t = \eta_{min} + rac{1}{2}(\eta_{max} - \eta_{min})(1 + \cos( rac{T_{cur}}{T_{max}}\pi)...
62598edecb5e8a47e493b445
class Calendar(calendar.Calendar): <NEW_LINE> <INDENT> def itermonthdates2(self, year, month): <NEW_LINE> <INDENT> date = datetime.date(year, month, 1) <NEW_LINE> days = (date.weekday() - self.firstweekday) % 7 <NEW_LINE> date -= datetime.timedelta(days=days) <NEW_LINE> oneday = datetime.timedelta(days=1) <NEW_LINE> fo...
>>> cal = Calendar() >>> cal.monthdays2calendar2(2013, 2) [[(28, 0), (29, 1), (30, 2), (31, 3), (1, 4), (2, 5), (3, 6)], [(4, 0), (5, 1), (6, 2), (7, 3), (8, 4), (9, 5), (10, 6)], [(11, 0), (12, 1), (13, 2), (14, 3), (15, 4), (16, 5), (17, 6)], [(18, 0), (19, 1), (20, 2), (21, 3), (22, 4), (23, 5), (24, 6)], [(25, 0), ...
62598eded6c5a102081e06c8
class Division(UUIDPKMixin, TimeStampedMixin, ClassMethodMixin): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> ordering = ['index', 'name'] <NEW_LINE> verbose_name = _('division') <NEW_LINE> verbose_name_plural = _('divisions') <NEW_LINE> unique_together = (('name', 'domain'),) <NEW_LINE> <DEDENT> objects = Divis...
Division divides the domain into logical groupings to model structure.
62598ede4527f215b58e849c
class ItemList: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_index(): <NEW_LINE> <INDENT> return list(Person.select().dicts().iterator()) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_dpt(): <NEW_LINE> <INDENT> return list(Department.select().dicts().iterator()) <NEW_LINE> <DEDENT> @staticmethod <NEW_LIN...
Используется для доступа к коллекции элементов с помощью REST API
62598edea79ad161977685b5
class MintermTree: <NEW_LINE> <INDENT> def __init__(self, alphabet, transitions_set): <NEW_LINE> <INDENT> self.alphabet = alphabet <NEW_LINE> self.transitions_set = transitions_set <NEW_LINE> self.root = MintermTreeNode(alphabet) <NEW_LINE> self.leaves = [self.root] <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def compu...
Class representing minterm tree structure.
62598ede32920d7e50bc45c6
class forceKeyFrame_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not No...
Attributes: - success
62598ede01c39578d7f11340
class UserTestCase(BaseTestCase): <NEW_LINE> <INDENT> def test_create_user(self): <NEW_LINE> <INDENT> test_user = User( uuid="-KdQsMt4M0ixIy_-yWTSZ", name="Test User Model", photo="https://lh6.googleusercontent.com/-1DhBLOJentg/AAAAAAAAA" "AI/AAAAAAAAABc/ImM13eP_cAI/photo.jpg?sz=50", email="test.user@andela.com", cente...
Test models.
62598ede55399d3f05624ac7
class AlertService(Service): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def create(cls, host=None, binary=None, topic=None, manager=None, periodic_interval=None, periodic_fuzzy_delay=None, service_name=None, coordination=False, *args, **kwargs): <NEW_LINE> <INDENT> kwargs['trap_receiver_address'] = CONF.trap_receiver_...
Service object for triggering trap receiver functionalities.
62598eded7e4931a7ef3a635
class PlusspiderGzhUpdateItem(scrapy.Item): <NEW_LINE> <INDENT> remark = scrapy.Field() <NEW_LINE> send_article_sum = scrapy.Field() <NEW_LINE> average_send_article = scrapy.Field() <NEW_LINE> average_top_read = scrapy.Field() <NEW_LINE> average_nottop_read = scrapy.Field() <NEW_LINE> average_top_agree = scrapy.Field()...
公众号基本信息
62598ede56b00c62f0fb0e69
class IList(form.Schema): <NEW_LINE> <INDENT> title = schema.TextLine( title=_(u"Name of the list of people"), required=True ) <NEW_LINE> people_per_page = schema.Int( title=_(u"Number of people shown on each page"), required=True, default=50 )
A list of IPerson objects.
62598ede2c8b7c6e89bd1d58
class Emitter(object): <NEW_LINE> <INDENT> def __init__(self, sampler, host, port): <NEW_LINE> <INDENT> self.sampler = sampler <NEW_LINE> self.host = host <NEW_LINE> self.port = port <NEW_LINE> <DEDENT> def handle_request(self, environ, start_response): <NEW_LINE> <INDENT> stats = self.sampler.output_stats() <NEW_LINE>...
A really basic HTTP server that listens on (host, port) and serves the process's profile data when requested. Resets internal sampling stats if reset=true is passed.
62598ede4f6381625f198789
class ImageView(ObjectView): <NEW_LINE> <INDENT> OMERO_TYPE = 'Image' <NEW_LINE> CAN_DELETE = False <NEW_LINE> urls = { 'url:datasets': {'name': 'api_image_datasets', 'kwargs': {'image_id': 'OBJECT_ID'}}, 'url:rois': {'name': 'api_image_rois', 'kwargs': {'image_id': 'OBJECT_ID'}}, } <NEW_LINE> def get_opts(self, reques...
Handle access to an individual Image to GET or DELETE it.
62598edebd1bec0571e14398
class TRPhoneNumberField(CharField): <NEW_LINE> <INDENT> default_error_messages = { 'invalid': _('Phone numbers must be in 0XXX XXX XXXX format.'), } <NEW_LINE> def clean(self, value): <NEW_LINE> <INDENT> super(TRPhoneNumberField, self).clean(value) <NEW_LINE> if value in EMPTY_VALUES: <NEW_LINE> <INDENT> return '' <NE...
A form field that validates input as a Turkish phone number. The correct format is 0xxx xxx xxxx. +90xxx xxx xxxx and inputs without spaces also validates. The result is normalized to xxx xxx xxxx format.
62598ede23849d37ff84f653
class ConnectionException(Exception): <NEW_LINE> <INDENT> pass
Raised when we can't generate a good connection.
62598eded486a94d0ba2a570
class FirefoxRemoteTests(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.logger = mozlog.unstructured.getLogger(self.__class__.__name__) <NEW_LINE> self.logger.setLevel('ERROR') <NEW_LINE> self.temp_dir = tempfile.mkdtemp() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> mo...
Test all scraper classes for Firefox against the remote server
62598ede009cb60464cffae8
class AlreadyExistsError(APIError): <NEW_LINE> <INDENT> pass
Link etc. Already Exists Code: 403
62598edefff4ab517ebcbd7d
class PackagingFinder(FileSystemFinder): <NEW_LINE> <INDENT> storage_class = PackagingStorage <NEW_LINE> extension_static_dir = None <NEW_LINE> def list(self, ignore_patterns, all_storages=False): <NEW_LINE> <INDENT> if all_storages: <NEW_LINE> <INDENT> locations = self.locations <NEW_LINE> <DEDENT> else: <NEW_LINE> <I...
Finds static media files for an extension. This is used during packaging to list only static media files provided by the extension, but to allow looking up static media from all apps. It works with PackagingStorage to do the appropriate lookup given the parameters passed. Essentially, when collecting static media (u...
62598ede7d43ff24874266c8
class BasePointView: <NEW_LINE> <INDENT> def __init__(self, basePoint): <NEW_LINE> <INDENT> self.basePoint = ui.editor.BasePoint(basePoint.point, basePoint.alpha, basePoint.gradient) <NEW_LINE> <DEDENT> def Draw(self, context): <NEW_LINE> <INDENT> p2d = context.bounds.ModelToView(self.basePoint.point) <NEW_LINE> index ...
A view for base point.
62598ede9b70327d1c57d353
class TestResourceConfiguration(BaseRuleTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestResourceConfiguration, self).setUp() <NEW_LINE> self.collection.register(Required()) <NEW_LINE> <DEDENT> def test_file_positive(self): <NEW_LINE> <INDENT> self.helper_file_positive() <NEW_LINE> <DEDENT>...
Test Resource Properties
62598ede8e7ae83300ee7629
class UserPermission(BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> groups = list(request.user.groups.values_list('name', flat=True)) <NEW_LINE> if not groups: <NEW_LINE> <INDENT> raise Exception(f'user group for user {request.user} not found') <NEW_LINE> <DEDENT> if '...
User permissions for viewsets
62598edea219f33f346c4dd1
class Source(models.Model): <NEW_LINE> <INDENT> description = models.CharField(max_length=255) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return u"%s" % self.description <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> ordering = ['description']
This class represents the organization situation @author: Fabio Martins @version: 1.0
62598edef548e778e5969b31
@Substitution( axis=AXIS_DOC, level=LEVEL_DOC, pat=PAT_DOC, case=CASE_DOC, flags=FLAGS_DOC ) <NEW_LINE> class Contains(LabelMask): <NEW_LINE> <INDENT> def __init__( self, pat: str, case: bool = True, flags: int = 0, regex: bool = True, axis: Axis = "columns", level: Optional[Level] = None, ): <NEW_LINE> <INDENT> contai...
Select labels that contain a pattern or regular expression. Parameters ---------- %(pat)s %(case)s %(flags)s regex : default True If True, assumes that ``pat`` is a regular expression. If False, treats that ``pat`` as a literal string. %(axis)s %(level)s See Also -------- :meth:`pandas.Series.str.contains`: B...
62598ede32920d7e50bc45c7
class ACLDecoder: <NEW_LINE> <INDENT> packetBoundaryNames = [ "reserved_boundary_flag_00", "continuation", "first_packet", "reserved_boundary_flag_11", ] <NEW_LINE> broadcastFlagNames = [ "", " active_slave_broadcast", " parked_slave_broadcast", " reserved_broadcast_flag_11", ] <NEW_LINE> def handleEvent(self, event): ...
This decodes incoming or outgoing Bulk data, which represents ACL transfers via the Bluetooth HCI protocol.
62598ede92d797404e387e48
class SPC(object): <NEW_LINE> <INDENT> type = 'SPC' <NEW_LINE> def __init__(self, model): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> self.n = 0 <NEW_LINE> self._comments = [] <NEW_LINE> self.constraint_id = None <NEW_LINE> self.grid_id = [] <NEW_LINE> self.components = defaultdict(list) <NEW_LINE> self.value = [...
Defines enforced displacement/temperature (static analysis) velocity/acceleration (dynamic analysis). +-----+-----+----+----+------+----+----+----+ | SPC | SID | G1 | C1 | D1 | G2 | C2 | D2 | +-----+-----+----+----+------+----+----+----+ | SPC | 2 | 32 | 3 | -2.6 | 5 | | | +-----+-----+----+----+-----...
62598ede66656f66f7d5897a
class Solution: <NEW_LINE> <INDENT> def groupStrings(self, strings): <NEW_LINE> <INDENT> d = {} <NEW_LINE> ret = [] <NEW_LINE> for s in strings: <NEW_LINE> <INDENT> diff = ord(s[0]) - ord('a') <NEW_LINE> tmp = "" <NEW_LINE> for c in s: <NEW_LINE> <INDENT> shift_diff = chr(ord(c) - diff) <NEW_LINE> if shift_diff < 'a': ...
@param strings: a string array @return: return a list of string array
62598ede30dc7b766599de22
@sequence.serializable("SeriesColumns") <NEW_LINE> class SeriesColumns(namedlist("SeriesColumns", "type columns")): <NEW_LINE> <INDENT> pass
Holds a series of uniformly labeled columns
62598ede435de62698e9a370
class RGBAButtonPreference(Preference): <NEW_LINE> <INDENT> def __init__(self, preferences, widget): <NEW_LINE> <INDENT> Preference.__init__(self, preferences, widget) <NEW_LINE> <DEDENT> def _setup_change(self): <NEW_LINE> <INDENT> self.widget.connect('color-set', self.change) <NEW_LINE> <DEDENT> def _set_value(self):...
A class to represent the color button
62598ede63d6d428bbee0d6c
class Doc2VecGenerator(VectorGenerator): <NEW_LINE> <INDENT> model = {} <NEW_LINE> dimensionality=0 <NEW_LINE> def __init__(self,model): <NEW_LINE> <INDENT> self.model=model <NEW_LINE> self.dimensionality=model.vector_size <NEW_LINE> <DEDENT> def get_vector(self,doi): <NEW_LINE> <INDENT> doc_vec= self.model.docvecs[doi...
Implements VectorGenerator. Fetches vectors from doc2vec model
62598edebaa26c4b54d4d86b
class MetricsHandler(BaseHandler): <NEW_LINE> <INDENT> async def get(self, user_x: str, user_y: str): <NEW_LINE> <INDENT> collection_user = await UserDocument().objects.filter({"_id": ObjectId(user_x)}).find_all() <NEW_LINE> document_user_x = collection_user[-1] <NEW_LINE> critic_x = document_user_x.critic <NEW_LINE> c...
Класс для получения результатов вычисления различных метрик расстояний между пользователями.
62598ede85dfad0860cbed37
class BaseAgent: <NEW_LINE> <INDENT> name = "BaseAgent" <NEW_LINE> def __init__(self, mark: Mark): <NEW_LINE> <INDENT> self.mark = mark <NEW_LINE> <DEDENT> @property <NEW_LINE> def opponent_mark(self): <NEW_LINE> <INDENT> return next_mark(self.mark) <NEW_LINE> <DEDENT> def act(self, state, my_env): <NEW_LINE> <INDENT> ...
Most basic agent. Plays winning move if possible, random otherwise.
62598edecc0a2c111447959c
class LoginFrame(wx.Frame): <NEW_LINE> <INDENT> def __init__(self, parent, _id, title, size): <NEW_LINE> <INDENT> wx.Frame.__init__(self, parent, _id, title) <NEW_LINE> self.SetSize(size) <NEW_LINE> self.Center() <NEW_LINE> self.serverAddressLabel = wx.StaticText(self, label="Server Address", pos=(10, 50), size=(120, 2...
登录窗口
62598edea79ad161977685b6
class MembersClientJSON(service_client.ServiceClient): <NEW_LINE> <INDENT> def list_members(self, pool_id, params=None): <NEW_LINE> <INDENT> url = 'v2.0/lbaas/pools/{0}/members'.format(pool_id) <NEW_LINE> if params: <NEW_LINE> <INDENT> url = "{0}?{1}".format(url, urllib.urlencode(params)) <NEW_LINE> <DEDENT> resp, body...
Tests Members API
62598eded268445f26638e5b
class Alchemies(object): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> self._engines = {} <NEW_LINE> self._sessions = {} <NEW_LINE> app.teardown_request(self._teardown) <NEW_LINE> <DEDENT> @synchronized(threading.Lock()) <NEW_LINE> def engine(self, dbname): <NEW_LINE> <INDEN...
A container that handles access to SQLALchemy metadata and connection pools. This is available in requests at g.db, or as current_app.db.
62598ede21a7993f00c64507
@registerElement <NEW_LINE> @registerElementClass <NEW_LINE> class ACLPrincipalPropSet (WebDAVElement): <NEW_LINE> <INDENT> name = "acl-principal-prop-set" <NEW_LINE> allowed_children = { WebDAVElement: (0, None) } <NEW_LINE> def validate(self): <NEW_LINE> <INDENT> super(ACLPrincipalPropSet, self).validate() <NEW_LINE>...
Report which returns, for all principals in the DAV:acl property (of the resource identified by the Request-URI) that are identified by http(s) URLs or by a DAV:property principal, the value of the properties specified in the REPORT request body. (RFC 3744, section 9.2)
62598ede9c8ee8231303f425
@baseObject.route('/') <NEW_LINE> class index(baseObject.baseHTTPObject): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> raise web.seeother("pyte/file/")
Simple redirection for when only /pyte/ is accessed
62598ede32920d7e50bc45c8
class ArmTemplateParameterProperties(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs ): <NEW_LINE> <INDENT> super(Ar...
Properties of an Azure Resource Manager template parameter. :param name: The name of the template parameter. :type name: str :param value: The value of the template parameter. :type value: str
62598ede01c39578d7f11342
class ResourceExtension(object): <NEW_LINE> <INDENT> def __init__(self, collection, controller, parent=None, collection_actions=None, member_actions=None, custom_routes_fn=None): <NEW_LINE> <INDENT> if not collection_actions: <NEW_LINE> <INDENT> collection_actions = {} <NEW_LINE> <DEDENT> if not member_actions: <NEW_LI...
Add top level resources to the OpenStack API in raksha.
62598ede0a50d4780f703943
class TestRunBranchedWorkflowBlocking(BaseWorkflowRunnerTests, UnittestPythonCompatibility): <NEW_LINE> <INDENT> expected_output = {u'test1': 4, u'test3': 7, u'test2': 6, u'test5': 11, u'test4': 10, u'test7': 10, u'test6': 9, u'test9': 12, u'test8': 11, u'test10': 13} <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(c...
Run the branched workflow build in TestBuildBranchedWorkflow but replacing the threaded PythonTask for a BlockingPythonTask
62598ede442bda511e95aa02
class Network(object): <NEW_LINE> <INDENT> def __init__(self,layers): <NEW_LINE> <INDENT> self.connections=Connections() <NEW_LINE> self.layers=[] <NEW_LINE> for i in range(len(layers)): <NEW_LINE> <INDENT> self.layers.append(layer(i,layers[i])) <NEW_LINE> <DEDENT> for i in range(len(layers)-1): <NEW_LINE> <INDENT> con...
搭建网络结构的类
62598ede4e4d5625663709b4
class CityGame: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.score = 0 <NEW_LINE> self.last_char = None <NEW_LINE> self._city_list = defaultdict(set) <NEW_LINE> <DEDENT> def _create_city_list(self): <NEW_LINE> <INDENT> with open(settings.CITY_DB_NAME, 'r', encoding='utf-8') as file: <NEW_LINE> <INDE...
Класс для игры в города
62598edecc0a2c111447959d
class BruijnGraph(object): <NEW_LINE> <INDENT> def __init__(self, edgesList, edgeSize): <NEW_LINE> <INDENT> self.edgeSize = edgeSize <NEW_LINE> self.edgesList = edgesList <NEW_LINE> <DEDENT> def nodesDic(self): <NEW_LINE> <INDENT> nodes = defaultdict(list) <NEW_LINE> for kmer in self.edgesList: <NEW_LINE> <INDENT> star...
Construct the de Bruijn graph from a list of kmers. Attributes: edgeSize - the edge length edgesList - the sequence Methodes: nodesDic - dict representation of the graph output - Rosalind output format
62598eded7e4931a7ef3a638
class Wireguard(IntervalModule): <NEW_LINE> <INDENT> color_up = "#00ff00" <NEW_LINE> color_down = "#FF0000" <NEW_LINE> status_up = '▲' <NEW_LINE> status_down = '▼' <NEW_LINE> format = "{vpn_name} {status}" <NEW_LINE> status_command = "systemctl is-active wg-quick@{vpn_name}" <NEW_LINE> vpn_up_command = "sudo /bin/syste...
Monitor Wireguard connections. .. note:: You might want to add something like this to /etc/sudoers: ``%wheel ALL = NOPASSWD: /bin/systemctl start wg-quick@wg0.service,/bin/systemctl stop wg-quick@wg0.service`` Formatters: * {vpn_name} — Same as setting. * {status} — Unicode up or down symbol. * {output} — O...
62598ede23849d37ff84f655
class GameLoop: <NEW_LINE> <INDENT> def __init__(self, surface): <NEW_LINE> <INDENT> self.surface = surface <NEW_LINE> self.clock = pygame.time.Clock() <NEW_LINE> self.lives = 3 <NEW_LINE> self.current_level = 1 <NEW_LINE> self.is_alive = True <NEW_LINE> self.is_paused = False <NEW_LINE> self.level = 1 <NEW_LINE> <DEDE...
Game Loop
62598edefff4ab517ebcbd7f
class Etudiant(models.Model): <NEW_LINE> <INDENT> uidNumber = models.IntegerField(unique=True) <NEW_LINE> uid = models.CharField(max_length=50) <NEW_LINE> nom = models.CharField(max_length=50) <NEW_LINE> prenom = models.CharField(max_length=50) <NEW_LINE> classe = models.CharField(max_length=10) <NEW_...
Représente un étudiant qui peut "voter". Les champs "uidNumber" et "uid" identifient l'étudiant dans l'annuaire LDAP de l'établissement.
62598ede10dbd63aa1c6f10b
class SmoothL1Loss(_Loss): <NEW_LINE> <INDENT> def __init__(self, size_average=True, reduce=True): <NEW_LINE> <INDENT> super(SmoothL1Loss, self).__init__(size_average, reduce) <NEW_LINE> <DEDENT> def forward(self, input, target): <NEW_LINE> <INDENT> _assert_no_grad(target) <NEW_LINE> return F.smooth_l1_loss(input, targ...
Creates a criterion that uses a squared term if the absolute element-wise error falls below 1 and an L1 term otherwise. It is less sensitive to outliers than the `MSELoss` and in some cases prevents exploding gradients (e.g. see "Fast R-CNN" paper by Ross Girshick). Also known as the Huber loss: .. math:: \text{lo...
62598ede9b70327d1c57d355
class Server(Connection): <NEW_LINE> <INDENT> _tlsClientDefault = False <NEW_LINE> def __init__(self, sock, protocol, clientAddr, serverAddr, sessionno, reactor): <NEW_LINE> <INDENT> Connection.__init__(self, sock, protocol, reactor) <NEW_LINE> self.serverAddr = serverAddr <NEW_LINE> self.clientAddr = clientAddr <NEW_L...
Serverside socket-stream connection class. I am a serverside network connection transport; a socket which came from an accept() on a server. @ivar _tlsClientDefault: Always C{False}, indicating that this is a server connection, and by default when TLS is negotiated this class will act as a TLS server.
62598ede7cff6e4e811b3f88
@PBRTv3Addon.addon_register_class <NEW_LINE> class pbrtv3_TF_M2_socket(bpy.types.NodeSocket): <NEW_LINE> <INDENT> bl_idname = 'pbrtv3_TF_M2_socket' <NEW_LINE> bl_label = 'M2 socket' <NEW_LINE> def M2_update(self, context): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> M2 = bpy.props.FloatProperty(name=get_props(TF_M2, '...
M2 socket
62598ede435de62698e9a371
class IssueSearchFilter(filters.BaseFilterBackend): <NEW_LINE> <INDENT> def filter_queryset(self, request, queryset, view): <NEW_LINE> <INDENT> search_param = settings.api_settings.SEARCH_PARAM <NEW_LINE> search_term = request.query_params.get(search_param, '') <NEW_LINE> return queryset.filter(search_term)
Search term is set by a ?search=... query parameter
62598ede4a966d76dd5ed47f
class date(GenericGetSetCommandClass): <NEW_LINE> <INDENT> cmd = 'System:DATE' <NEW_LINE> full_acces = 'system.date' <NEW_LINE> value = Argument(0, ["<year>,<month>,<day>"])
Sets the instrument‟s calendar. (SCPI Vol.2 §21.7) // PM100D only
62598ede4428ac0f6e656aee
class fixed(BackoffBase): <NEW_LINE> <INDENT> def __init__(self, sleep, max_sleep=None, jrc=0, kwargs=None): <NEW_LINE> <INDENT> super().__init__(sleep, max_sleep, jrc, kwargs) <NEW_LINE> if isinstance(sleep, (list, set)): <NEW_LINE> <INDENT> self.queue = deque(sleep, len(sleep)) <NEW_LINE> self.fixed_sleep = self.min(...
Fixed backoff interval(s). Sleep can be a single fixed interval, or a list with sleep intervals. In the case of a list, each retry iteration will use the next value in the list as the back-off interval, until it reaches the last item, which will repeat indefinitely.
62598ede45492302aabfaa4f
class QDoubleSpinBoxPlayback(QtGui.QDoubleSpinBox): <NEW_LINE> <INDENT> def quiet_update(self, minimum=None, maximum=None, value=None): <NEW_LINE> <INDENT> b = self.blockSignals(True) <NEW_LINE> if minimum is not None: <NEW_LINE> <INDENT> self.setMinimum(minimum) <NEW_LINE> <DEDENT> if maximum is not None: <NEW_LINE> <...
QSpinBox with playback features
62598ede1f5feb6acb1611ed
class Parallelize(luigi.WrapperTask): <NEW_LINE> <INDENT> config = luigi.Parameter() <NEW_LINE> length = luigi.IntParameter() <NEW_LINE> perms = luigi.IntParameter() <NEW_LINE> def requires(self): <NEW_LINE> <INDENT> prefix = self.config[:-4] <NEW_LINE> sizes = {} <NEW_LINE> with open(self.config, 'r') as infile: <NEW_...
Class for parallelizing the region splicing task param config: (string) name of config file param length: (int) length of chromosome param perms: (int) number of permutations
62598ede92d797404e387e49
class Rectangle: <NEW_LINE> <INDENT> number_of_instances = 0 <NEW_LINE> print_symbol = "#" <NEW_LINE> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> Rectangle.number_of_instances += 1 <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> if ...
Defines the Rectangle type
62598edef7d966606f74658c
class TestSingleton(unittest.TestCase): <NEW_LINE> <INDENT> def test_singleton_subclass(self): <NEW_LINE> <INDENT> class SingletonTest(Singleton): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> singleton_a = SingletonTest.get_instance() <NEW_LINE> singleton_b = SingletonTest.get_instance() <NEW_LINE> self.assertEqual(sin...
Test the Singleton class/mixin
62598ede7047854f4633d97d
class ShelveCacheDec: <NEW_LINE> <INDENT> def __init__(self, path = ".cache"): <NEW_LINE> <INDENT> self.path = Path(path).absolute() <NEW_LINE> self.path.mkdir(parents=True, exist_ok=True) <NEW_LINE> <DEDENT> def __call__(self, fnc): <NEW_LINE> <INDENT> self.fnc = fnc <NEW_LINE> self.fnc_sig = signature(fnc) <NEW_LINE>...
Provides a decorator to cache the return value of a function to disk. Use a shelve to store the data, so pickle is used to store the return object. The arguments are mapped to a dictionary including the full signature of the function (with default arguments). The key is constructed using the binfootprint module. This ...
62598ede99cbb53fe682f44e
class BillResultSet(ResultSet): <NEW_LINE> <INDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None)
Retrieve the value for the "Response" output from this choreography execution. (The resopnse from GovTrack.)
62598ede4527f215b58e84a0
class WeightStandardization(link_hook.LinkHook): <NEW_LINE> <INDENT> name = 'WeightStandardization' <NEW_LINE> def __init__(self, *, eps=1e-5, weight_name='W', name=None): <NEW_LINE> <INDENT> self.eps = eps <NEW_LINE> self.weight_name = weight_name <NEW_LINE> self._initialized = False <NEW_LINE> if name is not None: <N...
Weight Standardization (WS) link hook implementation. This hook standardizes a weight by *weight statistics*. This link hook implements a WS which computes the mean and variance along axis "output channels", then normalizes by these statistics. WS improves training by reducing the Lipschitz constants of the loss and ...
62598eded6c5a102081e06cd
class ChangeType(object,IDisposable): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def ConcatenateChangeTypes(changeType1,changeType2): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Contains(self,changeType): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Dispose(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT>...
A class representing a change that can be detected and tracked during Dynamic Update.
62598ede85dfad0860cbed38
class HuddleEdit(HuddleCreate): <NEW_LINE> <INDENT> id = django.forms.IntegerField(widget=django.forms.HiddenInput) <NEW_LINE> editReason = django.forms.CharField(label='Reason for editing') <NEW_LINE> @classmethod <NEW_LINE> def from_huddle_instance(cls, huddle): <NEW_LINE> <INDENT> repr = {} <NEW_LINE> repr['id'] = h...
Form for editing conversations.
62598edeeab8aa0e5d30a313
class QuantMeasure(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_bits=8, shape_measure=(1,), flatten_dims=_DEFAULT_FLATTEN, inplace=False, dequantize=True, stochastic=False, momentum=0.1, measure=False): <NEW_LINE> <INDENT> super(QuantMeasure, self).__init__() <NEW_LINE> self.register_buffer('running_zero_poin...
docstring for QuantMeasure.
62598eded268445f26638e5c
class Server: <NEW_LINE> <INDENT> def start(self, port): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def stop(self): <NEW_LINE> <INDENT> raise NotImplementedError()
Server representation API | Usage -------- | -------- Public | `from frictionless import Schema`
62598edef8510a7c17d7d44a
class IntroductionPage(Gtk.VBox): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> GObject.GObject.__init__(self) <NEW_LINE> image = Gtk.Image() <NEW_LINE> image.set_from_file(SPLASH) <NEW_LINE> label = Gtk.Label(label=self.__get_intro_text()) <NEW_LINE> label.set_line_wrap(True) <NEW_LINE> label.set_use_mar...
A page containing introductory text.
62598ede097d151d1a2bf5bb
class BackupProtocol(models.Protocol): <NEW_LINE> <INDENT> def on_start(self): <NEW_LINE> <INDENT> files = {} <NEW_LINE> if self.args.submit: <NEW_LINE> <INDENT> files['submit'] = True <NEW_LINE> <DEDENT> for file in self.assignment.src: <NEW_LINE> <INDENT> if not self.is_file(file): <NEW_LINE> <INDENT> contents = '' <...
The contents of source files are sent to the server.
62598ede91f36d47f2230172
class ToolBar(ConstraintsWidget): <NEW_LINE> <INDENT> button_style = d_(Enum( 'icon_only', 'text_only', 'text_beside_icon', 'text_under_icon' )) <NEW_LINE> movable = d_(Bool(True)) <NEW_LINE> floatable = d_(Bool(True)) <NEW_LINE> floating = d_(Bool(False)) <NEW_LINE> dock_area = d_(Enum('top', 'right', 'left', 'bottom'...
A widget which displays a row of tool buttons. A ToolBar is typically used as a child of a MainWindow where it can be dragged and docked in various locations in the same fashion as a DockPane. However, a ToolBar can also be used as the child of a Container and layed out with constraints, though in this case it will lo...
62598ede656771135c487c2d
class Field(object): <NEW_LINE> <INDENT> def __init__(self, x, y, random): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.random = random <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.points = self.random.choice(POINTS) <NEW_LINE> self.direction = self.rando...
Holds field state.
62598ede60cbc95b063628d9
class ClassificationFeatureExtractor: <NEW_LINE> <INDENT> def __init__(self, model, mean_img): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> self.mean_img = mean_img <NEW_LINE> self.shape = tuple(self.model.input.shape[1:3].as_list()) <NEW_LINE> <DEDENT> def __call__(self, img): <NEW_LINE> <INDENT> img = np.flip(im...
Functor for extraction of classification features from detections.
62598ede460517430c430a26
class DescribeImagesInputSet(InputSet): <NEW_LINE> <INDENT> def set_AWSAccessKeyId(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AWSAccessKeyId', value) <NEW_LINE> <DEDENT> def set_AWSSecretKeyId(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AWSSecretKeyId', value) <NEW_LINE> <DEDENT> def ...
An InputSet with methods appropriate for specifying the inputs to the DescribeImages Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598ede56ac1b37e630078a
class ImageEvaluator(StimEvaluater): <NEW_LINE> <INDENT> def __init__(self, img_metric='pixel correlation'): <NEW_LINE> <INDENT> super().__init__(img_metric) <NEW_LINE> <DEDENT> def __call__(self, recon_img, true_img): <NEW_LINE> <INDENT> if len(recon_img[0].shape) != 3: <NEW_LINE> <INDENT> raise('The shape is not matc...
calculate specified metric between two input images Args: StimEvaluater ([object]): Abstract class Returns: np.array (batch_size, height, width, channel): the first element is the batch_size of the inputs For the second each elements is the metric calculated.
62598ede01c39578d7f11345
class EnumFieldDto: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'name', None, None, ), (2, TType.STRING, 'value', None, None, ), ) <NEW_LINE> def __init__(self, name=None, value=None,): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LIN...
Attributes: - name - value
62598ede82261d6c5272f185
class DynamicFilter(DynamicPolicy,Filter): <NEW_LINE> <INDENT> pass
Abstact class for dynamic filter policies. The behavior of a dynamic filter policy changes each time self.policy is reassigned.
62598ede76e4537e8c3edb59
class Reservation(core_models.TimeStampedModel): <NEW_LINE> <INDENT> STATUS_PENDING = "pending" <NEW_LINE> STATUS_CONFIRMED = "confirmed" <NEW_LINE> STATUS_CANCELLED = "canceled" <NEW_LINE> STATUS_CHOICES = ( (STATUS_PENDING, "Pending"), (STATUS_CONFIRMED, "Confirmed"), (STATUS_CANCELLED, "Canceled"), ) <NEW_LINE> stat...
Reservation Model Definition
62598edee1aae11d1e7cdb0d
class StudentListView(ListView): <NEW_LINE> <INDENT> model = UserProfile <NEW_LINE> template_name = 'students/students_list.html'
CBV для формирования списка студентов.
62598edee5267d203ee69ea0
class ErrorsEnum(Enum): <NEW_LINE> <INDENT> E101 = 'E101 indentation contains mixed spaces and tabs' <NEW_LINE> E111 = 'E111 indentation is not a multiple of four' <NEW_LINE> E112 = 'E112 expected an indented block' <NEW_LINE> E113 = 'E113 unexpected indentation' <NEW_LINE> W191 = 'W191 indentation contains tabs' <NEW_...
Errors' enum
62598ede4a966d76dd5ed481
class Experiment(): <NEW_LINE> <INDENT> def __init__(self, gpu, config, title=None): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> self.title = title <NEW_LINE> if gpu is None: <NEW_LINE> <INDENT> gpu = [str(idx) for idx in range(cuda.device_count())] if cuda.is_available() else None <NEW_LINE> <DEDENT> self.gpu ...
a experiment object gpu : number of gpus to use (list) config : path to config (str)
62598ede442bda511e95aa05
class ResStateCity(models.Model): <NEW_LINE> <INDENT> _name = 'res.state.city' <NEW_LINE> _description = u'City' <NEW_LINE> name = fields.Char(string='Name', size=64, required=True) <NEW_LINE> state_id = fields.Many2one(comodel_name='res.country.state', string='State', required=True) <NEW_LINE> ibge_code = fields.Char(...
Este objeto persite todos os municípios relacionado a um estado. No Brasil é necessário em alguns documentos fiscais informar o código do IBGE dos município envolvidos da transação.
62598ede379a373c97d97598
class Cathode(Node): <NEW_LINE> <INDENT> def __init__(self, value_changed = None): <NEW_LINE> <INDENT> super(Cathode, self).__init__(False, value_changed)
A Cathode is a type of node which receives a value (like a Cathode which received electrons!).abs A Cathode's value cannot be changed directly, it can only be changed by a node which connects to it.
62598ede21bff66bcd7211f0
class MyFrame(wx.Frame): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> super(MyFrame, self).__init__(parent, title=TITLE, size=(1280, 768)) <NEW_LINE> icon_path = 'Assets/Microsoft-logo_rgb_c-gray.png' <NEW_LINE> self.SetIcon(wx.Icon(icon_path)) <NEW_LINE> sizer = wx.BoxSizer(wx.VERTICAL) <NEW_LIN...
Main Frame.
62598ede7d847024c075a96d
class UserBlog(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(UserProfile,verbose_name='作者') <NEW_LINE> blog = models.ForeignKey(Blog,verbose_name='作者博客') <NEW_LINE> add_time = models.DateTimeField(auto_now_add=True,verbose_name='发表时间') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = "用户博客" <NEW_...
用户博客
62598edebe8e80087fbbd5ea
class RotateUserAgentMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, user_agents): <NEW_LINE> <INDENT> self.enabled = False <NEW_LINE> self.user_agents = user_agents <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_crawler(cls, crawler): <NEW_LINE> <INDENT> user_agents = crawler.settings.get('USER_AGENT_...
Middleware used for rotating user-agent for each request
62598ede63d6d428bbee0d70
class LSTMAttn(nn.Module): <NEW_LINE> <INDENT> def __init__(self, hidden_size, concat_size=None): <NEW_LINE> <INDENT> super(LSTMAttn, self).__init__() <NEW_LINE> self.hidden_size = hidden_size <NEW_LINE> self.concat_size = concat_size <NEW_LINE> if not concat_size: <NEW_LINE> <INDENT> self.concat_size = self.hidden_siz...
Used by SimpleDecoder
62598ede99cbb53fe682f450
class gamma(Function): <NEW_LINE> <INDENT> nargs = 1 <NEW_LINE> unbranched = True <NEW_LINE> def fdiff(self, argindex=1): <NEW_LINE> <INDENT> if argindex == 1: <NEW_LINE> <INDENT> return gamma(self.args[0])*polygamma(0, self.args[0]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ArgumentIndexError(self, argindex)...
The gamma function returns a function which passes through the integral values of the factorial function, i.e. though defined in the complex plane, when n is an integer, `gamma(n) = (n - 1)!` Reference: http://en.wikipedia.org/wiki/Gamma_function
62598ede4527f215b58e84a2
class W_Type(W_Root): <NEW_LINE> <INDENT> php_type = -1 <NEW_LINE> def as_bool(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def as_float(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def as_int(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT...
Base type class representing each type in PHP and common operations
62598edee64d504609df868f
class WriteSummary(object): <NEW_LINE> <INDENT> def __init__(self,log_path): <NEW_LINE> <INDENT> self.log_path = log_path <NEW_LINE> if not os.path.exists(self.log_path): <NEW_LINE> <INDENT> os.makedirs(self.log_path) <NEW_LINE> <DEDENT> self.writer = tf.contrib.summary.create_file_writer(self.log_path) <NEW_LINE> <DED...
日志记录器,方便后续tensorboard查看
62598ede38b623060ffa7632
class LayerReLU: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def forward(self, input): <NEW_LINE> <INDENT> self.d_input = (np.sign(input) + 1) / 2 <NEW_LINE> return np.maximum(input, 0) <NEW_LINE> <DEDENT> def backward(self, gradient): <NEW_LINE> <INDENT> return gradient * self....
Computes the activations of an input using Rectified Linear Units.
62598edeac7a0e7691f70ab2
@tf_export('keras.callbacks.LearningRateScheduler') <NEW_LINE> class LearningRateScheduler(Callback): <NEW_LINE> <INDENT> def __init__(self, schedule, verbose=0): <NEW_LINE> <INDENT> super(LearningRateScheduler, self).__init__() <NEW_LINE> self.schedule = schedule <NEW_LINE> self.verbose = verbose <NEW_LINE> <DEDENT> d...
Learning rate scheduler. Arguments: schedule: a function that takes an epoch index as input (integer, indexed from 0) and returns a new learning rate as output (float). verbose: int. 0: quiet, 1: update messages.
62598eded6c5a102081e06cf
class Taxonomy(ind.Taxonomy): <NEW_LINE> <INDENT> def __init__(self, attribs): <NEW_LINE> <INDENT> super(Taxonomy, self).__init__() <NEW_LINE> self.name = None <NEW_LINE> for key, value in attribs.items(): <NEW_LINE> <INDENT> setattr(self, key, value) <NEW_LINE> <DEDENT> self.ChildParent = [] <NEW_LINE> self.Extension ...
Represents a <Taxonomy> tag in v4.2 and provides methods to convert to PFA.
62598ede32920d7e50bc45cc
class CreateCameraAlertsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Alerts = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("Alerts") is not None: <NEW_LINE> <INDENT> self.Alerts = [] <NEW_LINE> for item in params.get("Alerts"): <N...
CreateCameraAlerts请求参数结构体
62598ede55399d3f05624acd
class Context(object): <NEW_LINE> <INDENT> def __init__(self, is_admin=False, tenant_id=None): <NEW_LINE> <INDENT> self.is_admin = is_admin <NEW_LINE> self.tenant_id = tenant_id
Create a pseudo Context object Since this tool does not use the REST interface, we do not have a request from which to build a Context.
62598ede656771135c487c2f
class TestChartSourceQuery(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testChartSourceQuery(self): <NEW_LINE> <INDENT> pass
ChartSourceQuery unit test stubs
62598ede56b00c62f0fb0e6f
class _Distance: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def _dist_vectors(x, y): <NEW_LINE> <INDENT> if not type(x) is np.ndarray: <NEW_LINE> <INDENT> x = np.array(x) <NEW_LINE> <DEDENT> if not type(y) is np.ndarray: <NEW_LINE> <INDENT> y = np.array(y) <NEW_LINE> <DEDENT> return x, y <NEW_LINE> <DEDENT> @abstract...
Abstract class for Distance class implementations.
62598ede4f6381625f19878c
class StoryElementNodeSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> all_characters = CharacterInstanceSerializer(many=True, read_only=True, required=False, help_text=_('All characters associated with this node its descendants.')) <NEW_LINE> all_locations = LocationInstanceSerializer(many=True, read_only=...
Serializer for StoryElementNode Two special fields here: :attribute all_characters: All characters associated with this node or its descendants. :attribute all_locations: All locations associated with this node of its descendants.
62598ede56ac1b37e630078c
class UserModels(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.db = users <NEW_LINE> <DEDENT> def fetch_users(self): <NEW_LINE> <INDENT> if not users: <NEW_LINE> <INDENT> return jsonify({"Err": "There no registered users yet"}), 404 <NEW_LINE> <DEDENT> return jsonify(self.db), 200 <NEW_LINE>...
This class Users contains the methods used while interacting with users and manipulating user details.
62598ede0c0af96317c5493c
class Mode(object): <NEW_LINE> <INDENT> def __init__(self, *commands): <NEW_LINE> <INDENT> if hasattr(self, '__initialised'): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.__initialised = True <NEW_LINE> self.shell = None <NEW_LINE> self.commands = {} <NEW_LINE> for m in dir(type(self)): <NEW_LINE> <INDENT> try: ...
A interpreter shell mode. Each mode may have a distinctive prompt and its own set of commands, and may in addition store whatever state it likes.
62598ede82261d6c5272f186