Skip to content

Instantly share code, notes, and snippets.

View wholehope's full-sized avatar

Anjing Wang wholehope

View GitHub Profile
@Horizon733
Horizon733 / actions.py
Created April 9, 2022 06:23
Rasa Fallback tutorial
from rasa_sdk import Tracker, Action
from typing import Any, Text
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.types import DomainDict
# DO NOT copy paste whole file
class ActionFallback(Action):
def name(self) -> Text:
@stvar
stvar / youtube-search.py
Last active June 20, 2023 14:23
Find YouTube channel IDs by custom URLs or user names
#!/usr/bin/python3
# Copyright (C) 2020 Stefan Vargyas
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@spatialtime
spatialtime / iso8601_duration.py
Last active May 14, 2024 18:55
Python and ISO 8601 durations
# This snippet demonstrates Pythonic formatting and parsing of
# ISO 8601 durations.
# A little work is required to navigate between Python's
# timedelta syntax and ISO 8601 duration syntax.
import re
from datetime import datetime
from datetime import timedelta