Skip to content

Instantly share code, notes, and snippets.

@joaofig
Created July 12, 2023 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joaofig/260ca5bd2899be2a134cd44c8104f13e to your computer and use it in GitHub Desktop.
Save joaofig/260ca5bd2899be2a134cd44c8104f13e to your computer and use it in GitHub Desktop.
def predict(max_branch: int = 3,
max_length: int = 10) -> FeatureGroup | None:
fg = folium.FeatureGroup(name="polylines")
if "token_list" in st.session_state:
token_list = st.session_state["token_list"]
seed = token_list[-3:-1]
if len(seed) > 1:
paths = expand_seed(seed[0], seed[1],
max_branch=max_branch,
max_length=max_length)
for path in paths[:max_branch]:
fg.add_child(path.get_polyline())
return fg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment