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
#!/usr/bin/env python | |
"""I was trying to programatically remove a Virtual Private Cloud (VPC) in | |
AWS and the error message was not helpful: | |
botocore.exceptions.ClientError: An error occurred (DependencyViolation) | |
when calling the DeleteVpc operation: The vpc 'vpc-c12029b9' has | |
dependencies and cannot be deleted. | |
Searching for a quick solution was not fruitful but I was able to glean some | |
knowledge from Neil Swinton's gist: |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Memory-aware LRU Cache function decorator | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
A modification of the builtin ``functools.lru_cache`` decorator that takes an | |
additional keyword argument, ``use_memory_up_to``. The cache is considered full | |
if there are fewer than ``use_memory_up_to`` bytes of memory available. |