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
| .pointer-events-none { pointer-events : none } | |
| .pointer-events-auto { pointer-events : auto } | |
| .visible { visibility : visible } | |
| .invisible { visibility : hidden } | |
| .collapse { visibility : collapse } | |
| .static { position : static } | |
| .fixed { position : fixed } | |
| .absolute { position : absolute } | |
| .relative { position : relative } | |
| .sticky { position : sticky } |
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
| import numpy as np | |
| from tqdm import trange | |
| def get_neighbour_matrix(x, L, R): | |
| dx = np.subtract.outer(x[:, 0], x[:, 0]) | |
| dy = np.subtract.outer(x[:, 1], x[:, 1]) | |
| dx[dx > (L / 2) ** 2] -= (L / 2) ** 2 | |
| dy[dy > (L / 2) ** 2] -= (L / 2) ** 2 | |
| pair_dist = dx ** 2 + dy ** 2 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| """An example of a cache decorator.""" | |
| import json | |
| from functools import wraps | |
| from redis import StrictRedis | |
| redis = StrictRedis() | |
| def cached(func): |