

def format_attributes(self, obj, attrname=None, crop=True):
    '\n        Helper function that returns info about attributes and/or\n        non-persistent data stored on object\n        '
    if attrname:
        db_attr = [(string, obj.attributes.get(attrname))]
        try:
            ndb_attr = [(attrname, object.__getattribute__(obj.ndb, attrname))]
        except Exception:
            ndb_attr = None
    else:
        db_attr = [(attr.key, attr.value) for attr in obj.db_attributes.all()]
        try:
            ndb_attr = obj.nattributes.all(return_tuples=True)
        except Exception:
            ndb_attr = None
    string = ''
    if (db_attr and db_attr[0]):
        string += '\n{wPersistent attributes{n:'
        for (attr, value) in db_attr:
            string += self.list_attribute(crop, attr, value)
    if (ndb_attr and ndb_attr[0]):
        string += '\n{wNon-Persistent attributes{n:'
        for (attr, value) in ndb_attr:
            string += self.list_attribute(crop, attr, value)
    return string

dataset/ETHPy150Open evennia/evennia/evennia/commands/default/building.py CmdExamine.format_attributes/VarMisuse@31/75 `attrname`->`string`