Skip to content

Instantly share code, notes, and snippets.

View whardier's full-sized avatar
🧨
Code...

Shane R. Spencer whardier

🧨
Code...
View GitHub Profile
Copyright (c) 2024 The Capital Group Companies Inc.
All rights reserved. Unauthorized use, reproduction, or distribution of this software, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement.
No part of this software may be copied, modified, or distributed without the express written consent of The Capital Group Companies Inc. The source code and other confidential information contained in this software remain the exclusive property of The Capital Group Companies Inc.
For inquiries about use, reproduction, or distribution, please contact the Network Management team at Network-NTM@capgroup.com.
#!/usr/bin/env python3.8
import sys
from collections import Counter
import inflect
root = sys.modules[__name__]
inflector = inflect.engine()
#!/usr/bin/env python3.8
import sys
from collections import Counter
root = sys.modules[__name__]
events = [
{"monkey": "Sam", "state": "hungry", "kind": "banana" },
{"monkey": "Chet", "state": "flinging", "kind": "grass" },
#!/usr/bin/env python3.8
from collections import Counter
events = [
{"monkey": "Sam", "state": "hungry", "kind": "banana" },
{"monkey": "Chet", "state": "flinging", "kind": "grass" },
{"monkey": "Sam", "state": "flinging", "kind": "grass" },
{"monkey": "Sam", "state": "hungry", "kind": "banana" },
{"monkey": "Chet", "state": "hungry", "kind": "banana" },
#!/usr/bin/env python3.8
events = [
{"monkey": "Sam", "state": "hungry", "kind": "banana" },
{"monkey": "Chet", "state": "flinging", "kind": "grass" },
{"monkey": "Sam", "state": "flinging", "kind": "grass" },
{"monkey": "Sam", "state": "hungry", "kind": "banana" },
{"monkey": "Chet", "state": "hungry", "kind": "banana" },
{"monkey": "Chet", "state": "flinging", "kind": "feces" },
{"monkey": "Sam", "state": "flinging", "kind": "grass" },
{
"the_while_loop_delay": 0.1
}
import time
counter = 0
def something():
global counter
counter += 1
print(time.time(), counter)
while True:
import time
import json
import pathlib
configurable_path = pathlib.Path('/tmp/configurable.json')
configurable = {}
counter = 0
import time
import json
import pathlib
configurable_mtime = 0
configurable_path = pathlib.Path('/tmp/configurable.json')
configurable = {}
counter = 0
>>> from enum import Flag, auto
>>> class Thing(Flag):
... left = auto()
... right = auto()
... middle = left | right
...
>>> Thing.middle
<Thing.middle: 3>
>>> Thing(3)
<Thing.middle: 3>