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
forecast = [ | |
[1, 5.0], | |
[2, 6.2], | |
[3, 4.1], | |
[4, 6.0], | |
[5, 6.2], | |
[6, 6.8], | |
[7, 6.1], | |
[8, 4.9], | |
[9, 2.0], |
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 MaterializedDataAccess: | |
def __init__(self, eventSource): | |
# In-memory cache to hold all entity data materialized | |
# as a projection of the event stream. | |
# In a real world application, we would probably hydrate this in memory | |
# with state retrieved from a snapshot stored in a database rather than | |
# re-building it from the entire event stream history every time the | |
# application starts up. But if current entity state is a pure function | |
# of past domain events, there is no reason (performance concerns aside) | |
# we _couldn't_ hydrate state using only the event history. |
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 Rule: | |
def __init__(self, type, checkFunction, reasonMessage=None): | |
# TODO: Perform sanity checks on input types | |
self.type = type | |
self.checkFunction = checkFunction | |
self.reasonMessage = reasonMessage | |
def check(self, roles, data=None): | |
# Evaluate check function | |
try: |
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
from typing import List, Tuple, Any, Optional, Callable, TypeVar, Dict | |
""" Permission result is a tuple defining a decision and optional reason string(s) """ | |
PermissionResult = Tuple[bool, Optional[List[str]]] | |
""" Validation result is a tuple defining a decision and optional error string(s) | |
Eventually it could return more detailed information about the location of | |
a validation error. """ | |
ValidationResult = Tuple[bool, Optional[List[str]]] |
This file has been truncated, but you can view the full file.
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
[Word list from http://pastebin.com/anKcMdvk] | |
kids firm | |
isnt iron | |
Word says | |
mens tips | |
free luke | |
gang wash | |
make card |