async def monitoring(handler, root, info: ResolveInfo, **kwargs):
t_start = time.perf_counter()
result = handler(root, info, **kwargs)
if not isawaitable(result):
return result
result = await result
duration = max(time.perf_counter() - t_start, 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
import threading | |
import dill | |
def main(): | |
lock = threading.RLock() | |
dill_lock = dill.loads(dill.dumps(lock)) | |
print(dill_lock) # Prints as "unlocked" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import gunicorn.glogging | |
import structlog | |
_logger = structlog.get_logger(__name__) | |
class Logger(gunicorn.glogging.Logger): | |
def setup(self, cfg): | |
""" |
I hereby claim:
- I am joar on github.
- I am joar (https://keybase.io/joar) on keybase.
- I have a public key ASDguJoosHWHVEV2ET5ZsmTMDMbBz9Nf36vJ8ZzIxFEsnQo
To claim this, I am signing this object:
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
"""Terminal utilities.""" | |
# Author: Steen Lumholt. | |
from termios import * | |
__all__ = ["setraw", "setcbreak"] | |
# Indexes for termios list. | |
IFLAG = 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
# Subcommand parsing | |
function __kctl_pos_args | |
set -l pos_args (__fish_print_cmd_args_without_options) | |
# echo __fish_print_cmd_args_without_options pos_args $pos_args > /dev/stderr | |
# remove "kubectl" | |
set -e pos_args[1] | |
string join \n $pos_args | |
end |