Created
July 9, 2023 21:15
-
-
Save joaofig/4bf53a36a71358fa73527e020f2d1f4d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_successors(h0: int, h1: int) -> Counter: | |
| cnt = get_cache_successors(h0, h1) | |
| if cnt is None: | |
| db = TrajDb() | |
| sql = "select t2 from triple where t0=? and t1=?" | |
| successors = [r[0] for r in db.query(sql, [int(h0), int(h1)])] | |
| cnt = Counter(successors) | |
| set_cache_successors(h0, h1, cnt) | |
| return cnt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment