async_kernel.utils
Functions:
- 
            mark_thread_pydev_do_not_trace–Modifies the given thread's attributes to hide or unhide it from the debugger (e.g., debugpy). 
- 
            do_not_debug_this_thread–A context to mark the thread for debugpy to not debug. 
- 
            wait_thread_event–Wait for thread_eventto be set.
- 
            get_job–Get the job for the current context. 
- 
            get_parent–Get the parent message for the current context. 
- 
            get_metadata–Gets metadata for the current context. 
- 
            get_tags–Gets the tags for the current context. 
- 
            get_execute_request_timeout–Gets the execute_request_timeout for the current context. 
- 
            get_execution_count–Gets the execution count for the current context, defaults to the current kernel count. 
- 
            setattr_nested–Set a nested attribute of an object. 
mark_thread_pydev_do_not_trace(thread: Thread, *, remove=False)
Modifies the given thread's attributes to hide or unhide it from the debugger (e.g., debugpy).
Source code in src/async_kernel/utils.py
              | 43 44 45 |  | 
do_not_debug_this_thread()
A context to mark the thread for debugpy to not debug.
Source code in src/async_kernel/utils.py
              | 48 49 50 51 52 53 54 55 56 57 |  | 
async
  
¶
wait_thread_event(thread_event: Event)
Wait for thread_event to be set.
Info
- On external cancellation the eventis set here to prevent the thread from waiting forever.
Source code in src/async_kernel/utils.py
              | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |  | 
get_kernel() -> Kernel
Get the current kernel.
Source code in src/async_kernel/utils.py
              | 90 91 92 |  | 
    Get the job for the current context.
Source code in src/async_kernel/utils.py
              | 95 96 97 98 99 100 |  | 
    Get the parent message for the current context.
Source code in src/async_kernel/utils.py
              | 103 104 105 |  | 
    Gets metadata for the current context.
Source code in src/async_kernel/utils.py
              | 108 109 110 |  | 
    Gets the tags for the current context.
Source code in src/async_kernel/utils.py
              | 113 114 115 |  | 
    Gets the execute_request_timeout for the current context.
Source code in src/async_kernel/utils.py
              | 118 119 120 121 122 123 124 125 |  | 
get_execution_count() -> int
Gets the execution count for the current context, defaults to the current kernel count.
Source code in src/async_kernel/utils.py
              | 128 129 130 131 |  | 
    Set a nested attribute of an object.
If the attribute name contains dots, it is interpreted as a nested attribute. For example, if name is "a.b.c", then the code will attempt to set obj.a.b.c to value.
This is primarily intended for use with async_kernel.command.command_line to set the nesteded attributes on on kernels.
Parameters:
- 
(obj¶object) –The object to set the attribute on. 
- 
(name¶str) –The name of the attribute to set. 
- 
(value¶str | Any) –The value to set the attribute to. 
Returns:
- 
              dict[str, Any]–The mapping of the name to the set value if the value has been set. 
- 
              dict[str, Any]–An empty dict indicates the value was not set. 
Source code in src/async_kernel/utils.py
              | 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |  |