def get(self, path=None, persist=True):
        path = '/' + (path or '').strip('/')
        alts = {}
        exists = False
        first_record = None
        label_i18n = None

        for alt in chain([PRIMARY_ALT], self.pad.db.config.list_alternatives()):
            record = self.pad.get(path, alt=alt, persist=persist,
                                  allow_virtual=False)
            if first_record is None:
                first_record = record
            if record is not None:
                exists = True
            alts[alt] = Alt(alt, record)

        # These flags only really make sense if we found an existing
        # record, otherwise we fall back to some sort of sane default.
        # Note that in theory different alts can disagree on what
        # datamodel they use but this is something that is really not
        # supported.  This cannot happen if you edit based on the admin
        # panel and if you edit it manually and screw up the part, we
        # cannot really do anything about it.
        #
        # More importantly we genreally assume that first_record is the
        # primary alt.  There are some situations in which case this is
        # not true, for instance if no primary alt exists.  In this case
        # we just go with any record.
        is_visible = True
        is_attachment = False
        attachment_type = None
        can_have_children = False
        can_have_attachments = False
        can_be_deleted = exists and path != '/'

        if first_record is not None:
            is_attachment = first_record.is_attachment
            is_visible = first_record.is_visible
            dm = first_record.datamodel
            if not is_attachment:
                can_have_children = dm.has_own_children
                can_have_attachments = dm.has_own_attachments
                if dm.protected:
                    can_be_deleted = False
            else:
                attachment_type = first_record['_attachment_type'] or None
            label_i18n = first_record.get_record_label_i18n()

        return TreeItem(self, path, alts, exists, is_attachment=is_attachment,
                        attachment_type=attachment_type,
                        can_have_children=can_have_children,
                        can_have_attachments=can_have_attachments,
                        can_be_deleted=can_be_deleted,
                        is_visible=is_visible, label_i18n=label_i18n)
convert a number > 1024 to printable format, either in 4 char -h format as
dataset/ETHPy150Open lektor/lektor/lektor/db.py/Tree.get--crossover with--dataset/ETHPy150Open openstack/python-swiftclient/swiftclient/utils.py/prt_bytes