def get(self, path, alt=PRIMARY_ALT, page_num=None, persist=True,
            allow_virtual=True):
        virt_markers = path.count('@')

        # If the virtual marker is included, we also want to look up the
        # virtual path below an item.  Special case: if virtual paths are
        # not allowed but one was passed, we just return `None`.
        if virt_markers == 1:
            if page_num is not None:
                raise RuntimeError('Cannot use both virtual paths and '
                                   'explicit page number lookups.  You '
                                   'need to one or the other.')
            if not allow_virtual:
                return None
            path, virtual_path = path.split('@', 1)
            rv = self.get(path, alt=alt, page_num=page_num,
                          persist=persist)
            if rv is None:
                return None
            return self.get_virtual(rv, virtual_path)

        # Sanity check: there must only be one or things will get weird.
        elif virt_markers > 1:
            return None

        path = cleanup_path(path)
        virtual_path = None
        if page_num is not None:
            virtual_path = str(page_num)

        rv = self.cache.get(path, alt, virtual_path)
        if rv is not Ellipsis:
            if rv is not None:
                self.db.track_record_dependency(rv)
            return rv

        raw_data = self.db.load_raw_data(path, alt=alt)
        if raw_data is None:
            self.cache.remember_as_missing(path, alt, virtual_path)
            return

        rv = self.instance_from_data(raw_data, page_num=page_num)

        if persist:
            self.cache.persist(rv)
        else:
            self.cache.remember(rv)

        return self.db.track_record_dependency(rv)
Loads a record by path.
dataset/ETHPy150Open lektor/lektor/lektor/db.py/Pad.get