This file contains 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
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 [email protected]. |
This file contains 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
#!/usr/bin/env python3.8 | |
import sys | |
from collections import Counter | |
import inflect | |
root = sys.modules[__name__] | |
inflector = inflect.engine() |
This file contains 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
#!/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" }, |
This file contains 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
#!/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" }, |
This file contains 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
#!/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" }, |
This file contains 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
{ | |
"the_while_loop_delay": 0.1 | |
} |
This file contains 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 time | |
counter = 0 | |
def something(): | |
global counter | |
counter += 1 | |
print(time.time(), counter) | |
while True: |
This file contains 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 time | |
import json | |
import pathlib | |
configurable_path = pathlib.Path('/tmp/configurable.json') | |
configurable = {} | |
counter = 0 |
This file contains 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 time | |
import json | |
import pathlib | |
configurable_mtime = 0 | |
configurable_path = pathlib.Path('/tmp/configurable.json') | |
configurable = {} | |
counter = 0 |
This file contains 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 enum import Flag, auto | |
>>> class Thing(Flag): | |
... left = auto() | |
... right = auto() | |
... middle = left | right | |
... | |
>>> Thing.middle | |
<Thing.middle: 3> | |
>>> Thing(3) | |
<Thing.middle: 3> |
NewerOlder