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
class BinaryIndexTree(list): | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
self._tree = list() | |
self._rebuild_tree() | |
@staticmethod | |
def _lowest_one_bit(i): | |
return i & -i |
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 random | |
from geopandas import GeoDataFrame, GeoSeries, sjoin | |
from shapely.geometry import Point, LineString, Polygon | |
import numpy as np | |
class BenchPredicates: | |
param_names = ["predicate"] |
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
name: Deploy Docs | |
on: | |
workflow_run: | |
workflows: | |
- Build Docs | |
types: | |
- completed | |
jobs: | |
deploy: |
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
name: Build Docs | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
release: | |
types: | |
- published |
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
"""This script is run from docs_deploy.yml | |
It writes JSON like this: | |
{"latest": "refs/heads/main"} | |
To a file called versions.json at the root | |
of the docs branch. | |
It will also update index.html to point to the |
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
exclude: ['_config.yml', '*.py'] | |
include: ['_*', 'versions.json'] |
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 tempfile | |
from timeit import default_timer, timeit | |
from typing import List, Tuple | |
from matplotlib import pyplot as plt | |
import numpy as np | |
from tensorflow import keras | |
from tensorflow.keras.models import load_model | |
from scikeras._saving_utils import pack_keras_model |
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 asyncio | |
import contextvars | |
ctxvar = contextvars.ContextVar("ctx") | |
async def lifespan(): | |
ctxvar.set("spam") | |
return contextvars.copy_context() | |
async def endpoint(): |
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 asyncio | |
from contextlib import asynccontextmanager | |
import contextvars | |
ctxvar = contextvars.ContextVar("ctx") | |
@asynccontextmanager | |
async def lifespan(): | |
ctxvar.set("spam") | |
yield |
OlderNewer