A dictionary of Position objects keyed by book_id.
        :return:
552811
def positions_by_book(self):
        
        positions = None
        for book in self.books():
            positions[book] = book.positions()
1072677
def get_book_info(cursor, real_dict_cursor, book_id,
                  book_version, page_id, page_version):
    
    book_ident_hash = join_ident_hash(book_id, book_version)
    page_ident_hash = join_ident_hash(page_id, page_version)
    tree = get_tree(book_ident_hash, cursor)

    # Check if the page appears in the book tree
    if not tree or page_ident_hash not in flatten_tree_to_ident_hashes(tree):
        # Return a 404 error if the page is not actually in the book tree
        raise httpexceptions.HTTPNotFound()

    sql_statement = """
    SELECT m.name as title,
           ident_hash(m.uuid, m.major_version, m.minor_version)
           as ident_hash,
           short_ident_hash(m.uuid, m.major_version, m.minor_version)
           as shortId, ARRAY(
               SELECT row_to_json(user_row)
               FROM (
                   SELECT u.username, u.first_name as firstname,
                        u.last_name as surname, u.full_name as fullname,
                        u.title, u.suffix
               ) as user_row
           ) as authors,
           m.revised
    FROM modules m
    JOIN users as u on u.username = ANY(m.authors)
    WHERE ident_hash(m.uuid, m.major_version, m.minor_version) = %s
    """
    real_dict_cursor.execute(sql_statement, vars=(book_ident_hash,))
    return real_dict_cursor.fetchone()
879605
def get_by_id(self, acct_id) -> Account:
        
        return self.book.get(Account, guid=acct_id)
239940
def todict(self):
        
        return {'index': self.index,
                'seed': hb_encode(self.seed),
                'n': self.n,
                'root': hb_encode(self.root),
                'hmac': hb_encode(self.hmac),
                'timestamp': self.timestamp}
1240112
def get_objs_from_record(self, record, key):
        
        uids = self.get_uids_from_record(record, key)
        objs = map(self.get_object_by_uid, uids)
        return dict(zip(uids, objs))
1242570
def get_nodes_positions(self):
        
        nodes = self.get_nodes()
        output = {}
        for node in nodes:
            output[node[0]] = (float(node[1][consts.Consts.x]), float(node[1][consts.Consts.y]))
        return output
125941
public int bookmarkToIndex(Object bookmark, int iHandleType)
    {
        int iTargetPosition;
        DataRecord thisBookmark = null;
        if (bookmark == null)
            return -1;
//+ Not found, look through the recordlist
        for (iTargetPosition = 0; iTargetPosition < m_iRecordListEnd; iTargetPosition += m_iRecordListStep)
        {
            thisBookmark = (DataRecord)this.elementAt(iTargetPosition);
            if (bookmark.equals(thisBookmark.getHandle(iHandleType)))
                return iTargetPosition;
        }
//+ Still not found, do a binary search through the recordlist for a matching key
        return -1;  // Not found
    }
1085144
def items(self, *keys):
        
        if keys:
            d = []
            for key in keys:
                try:
                    i = self.index(key)
                except KeyError:
                    d.append((key, None))
                else:
                    d.append((self.__keys[i], self[i]))
            return d
        return list((self.__keys[i], super(Record, self).__getitem__(i)) for i in range(len(self)))
50832
def get_books(self):
        
        if self.retrieved:
            raise errors.IllegalState('List has already been retrieved.')
        self.retrieved = True
        return objects.BookList(self._results, runtime=self._runtime)
637068
def _to_dict(self):
        
        if self.all_:
            return {"all": True}

        return {
            "keys": self.keys,
            "ranges": [keyrange._to_dict() for keyrange in self.ranges],
        }
272215
def get_insert_idx(pos_dict, name):
    ""
    keys,i = list(pos_dict.keys()),0
    while i < len(keys) and str.lower(keys[i]) < str.lower(name): i+=1
    if i == len(keys): return -1
    else:              return pos_dict[keys[i]]
782919
def pos(self):
        
        pos = self._pos
        if pos is None:
            return self.p0
        # convert to dict
        pos = {param: self._pos[..., k]
               for (k, param) in enumerate(self.sampling_params)}
        return pos
287777
def index(fks, id):
    
    for i, j in fks.items():
        if fks[i][1] == id:
            return i
    return None
704790
def _get_item_position(self, idx):
        """"""
        start = 0 if idx == 0 else self._index[idx - 1] + 1
        end = self._index[idx]
        return start, end
256545
def get_key_at(self, position):
        
        for row in self.rows:
            if position in row:
                for key in row.keys:
                    if key.is_touched(position):
                        return key
        return None
694
def map_position(pos):
    """"""

    posiction_dict = dict(zip(range(1, 17), [i for i in range(30, 62) if i % 2]))
    return posiction_dict[pos]
222770
def bib_keys(self):
        """"""
        bib_keys = []
        # Get bib keys in this document
        for match in texutils.cite_pattern.finditer(self.text):
            keys = match.group(5).split(',')
            bib_keys += keys

        # Recursion
        for path, document in self._children.iteritems():
            bib_keys += document.bib_keys
        bib_keys = list(set(bib_keys))

        return bib_keys