def get_definition(self, entity_definition_keyname):
        """
        Returns Entity definition (with property definitions).

        """
        if not entity_definition_keyname:
            return

        if type(entity_definition_keyname) is not list:
            entity_definition_keyname = [entity_definition_keyname]

        sql = """
            SELECT
                entity_definition.keyname AS entity_definition_keyname,
                property_definition.keyname AS property_keyname,
                property_definition.formula AS property_formula,
                property_definition.datatype AS property_datatype,
                property_definition.dataproperty AS property_dataproperty,
                property_definition.mandatory AS property_mandatory,
                property_definition.multilingual AS property_multilingual,
                property_definition.multiplicity AS property_multiplicity,
                property_definition.ordinal AS property_ordinal,
                property_definition.public AS property_public,
                property_definition.readonly AS property_readonly,
                property_definition.visible AS property_visible,
                property_definition.classifying_entity_definition_keyname AS property_classifier_id
            FROM
                entity_definition,
                property_definition
            WHERE entity_definition.keyname = property_definition.entity_definition_keyname
            AND entity_definition.keyname IN (%s)
        """ % ','.join(['\'%s\'' % x for x in map(str, entity_definition_keyname)])
        # logging.debug(sql)

        defs = []
        for r in self.db_query(sql):
            defs.append({
                'entity_definition_keyname': r.get('entity_definition_keyname'),
                'entity_label': self.__get_system_translation(field='label', entity_definition_keyname=r.get('entity_definition_keyname')),
                'entity_label_plural': self.__get_system_translation(field='label_plural', entity_definition_keyname=r.get('entity_definition_keyname')),
                'entity_description': self.__get_system_translation(field='description', entity_definition_keyname=r.get('entity_definition_keyname')),
                'entity_displayname': self.__get_system_translation(field='displayname', entity_definition_keyname=r.get('entity_definition_keyname')),
                'entity_displayinfo': self.__get_system_translation(field='displayinfo', entity_definition_keyname=r.get('entity_definition_keyname')),
                'entity_displaytable': self.__get_system_translation(field='displaytable', entity_definition_keyname=r.get('entity_definition_keyname')),
                'property_keyname': r.get('property_keyname'),
                'property_fieldset': self.__get_system_translation(field='fieldset', property_definition_keyname=r.get('property_keyname')),
                'property_label': self.__get_system_translation(field='label', property_definition_keyname=r.get('property_keyname')),
                'property_label_plural': self.__get_system_translation(field='label_plural', property_definition_keyname=r.get('property_keyname')),
                'property_description': self.__get_system_translation(field='description', property_definition_keyname=r.get('property_keyname')),
                'property_datatype': r.get('property_datatype'),
                'property_dataproperty': r.get('property_dataproperty'),
                'property_mandatory': bool(r.get('property_mandatory')),
                'property_multilingual': bool(r.get('property_multilingual')),
                'property_multiplicity': r.get('property_multiplicity'),
                'property_ordinal': r.get('property_ordinal'),
                'property_public': bool(r.get('property_public')),
                'property_readonly': bool(r.get('property_readonly')),
                'property_visible': bool(r.get('property_visible')),
                'property_classifier_id': r.get('property_classifier_id'),
            })

        return defs
dataset/ETHPy150Open argoroots/Entu/app/main/db.py/Entity.get_definition/original