<commit_before># -*- encoding: utf-8 -*-
"""
@authors: <NAME> <EMAIL>
          <NAME>. <EMAIL>

@license:  GNU AFFERO GENERAL PUBLIC LICENSE

SIIM Models are the data definition of SIIM2 Framework
Copyright (C) 2013 Infometrika Ltda.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

#system, and standard library

#neomodel primitives
from neomodel.properties import (Property,
                                 DateTimeProperty,
                                 FloatProperty,
                                 IntegerProperty,
                                 StringProperty)

#CaliopeStorage
from odisea.CaliopeStorage import CaliopeNode


class RegistroPredioCatastroTipo2(CaliopeNode):
    #: Unique and indexed properties first
    sector = StringProperty(unique_index=True)
    chip = StringProperty(unique_index=True)
    cedula_catastral = StringProperty(unique_index=True)
    #: All other
    matricula = StringProperty()
    id_lote = StringProperty()
    codigo_direccion = StringProperty()
    direccion_actual = StringProperty()
    escritura = StringProperty()
    notaria = IntegerProperty()
    fecha_documento = DateTimeProperty()
    area_terreno = FloatProperty()
    area_construida = FloatProperty()
    tipo_propiedad = IntegerProperty()
    codigo_destino = IntegerProperty()
    clase_predio = StringProperty()
    codigo_estrato = IntegerProperty()
    zona_fisica_geoeconomica = StringProperty()


class SIIMForm(CaliopeNode):
    def __init__(self, *args, **kwargs):
        super(SIIMForm, self).__init__(*args, **kwargs)
        for k in kwargs.keys():
            setattr(self, k, kwargs[k])

    def get_form_data(self):
        rv = {}
        for attr in self.__node__.__metadata__['data']:
            rv[attr] = {'value': self.__node__.__metadata__['data'][attr]}
        return rv

    def set_form_data(self, data):
        for k in data.keys():
            setattr(self, k, data[k])




<commit_msg>Refactor to use CaliopeNode methods<commit_after># -*- encoding: utf-8 -*-
"""
@authors: <NAME> <EMAIL>
          <NAME>. <EMAIL>

@license:  GNU AFFERO GENERAL PUBLIC LICENSE

SIIM Models are the data definition of SIIM2 Framework
Copyright (C) 2013 Infometrika Ltda.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""

#system, and standard library

#neomodel primitives
from neomodel.properties import (Property,
                                 DateTimeProperty,
                                 FloatProperty,
                                 IntegerProperty,
                                 StringProperty)

#CaliopeStorage
from odisea.CaliopeStorage import CaliopeNode


class RegistroPredioCatastroTipo2(CaliopeNode):
    #: Unique and indexed properties first
    sector = StringProperty(unique_index=True)
    chip = StringProperty(unique_index=True)
    cedula_catastral = StringProperty(unique_index=True)
    #: All other
    matricula = StringProperty()
    id_lote = StringProperty()
    codigo_direccion = StringProperty()
    direccion_actual = StringProperty()
    escritura = StringProperty()
    notaria = IntegerProperty()
    fecha_documento = DateTimeProperty()
    area_terreno = FloatProperty()
    area_construida = FloatProperty()
    tipo_propiedad = IntegerProperty()
    codigo_destino = IntegerProperty()
    clase_predio = StringProperty()
    codigo_estrato = IntegerProperty()
    zona_fisica_geoeconomica = StringProperty()


class SIIMForm(CaliopeNode):
    def __init__(self, *args, **kwargs):
        super(SIIMForm, self).__init__(*args, **kwargs)

    def get_form_data(self):
        self._get_node_data()

    def set_form_data(self, data):
        return self.evolve(**data)





{'fraction_non_alphanumeric': 0.07523383489223262, 'fraction_numerical': 0.0032533550223668157, 'mean_word_length': 2.982995951417004, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5186687', 'n_tokens_mistral': 1389, 'n_tokens_neox': 1343, 'n_words': 443}