Module Expr Str ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias If NameLoad body Import alias Assign NameStore Dict Assign NameStore Dict FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareNotIn NameLoad Call NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad If NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIn NameLoad NameLoad body For NameStore SubscriptLoad NameLoad Index NameLoad body Expr Call NameLoad NameLoad NameLoad If CompareIn NameLoad NameLoad body Expr Call SubscriptLoad NameLoad Index NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str For NameStore Call NameLoad body Assign SubscriptStore NameLoad Index NameLoad ListLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body If BoolOpAnd NameLoad BoolOpOr CompareLtELt TupleLoad Num Num SubscriptLoad AttributeLoad NameLoad attr Slice Num TupleLoad Num Num CompareLtELt TupleLoad Num Num SubscriptLoad AttributeLoad NameLoad attr Slice Num TupleLoad Num Num body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Num Num NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Num orelse Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr handlers ExceptHandler body Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq NameLoad AttributeLoad NameLoad attr body If Call AttributeLoad Call AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore BinOpMod Str TupleLoad NameLoad Call AttributeLoad NameLoad attr Str Str NameLoad TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call NameLoad Call AttributeLoad NameLoad attr decorator_list
N/A N/A Signal handling functions. __future__ absolute_import N/A logging N/A os N/A re N/A signal N/A sys N/A traceback gslib.util IS_WINDOWS gslib.util UTF8 N/A IS_WINDOWS N/A N/A ctypes N/A _non_final_signal_handlers N/A N/A _final_signal_handlers N/A RegisterSignalHandler N/A N/A signal_num handler is_final_handler N/A False N/A N/A Registers a handler for signal signal_num.

  Unlike calling signal.signal():
    - This function can be called from any thread (and will cause the handler to
      be run by the main thread when the signal is received).
    - Handlers are cumulative: When a given signal is received, all registered
      handlers will be executed (with the exception that only the last handler
      to register with is_final_handler=True will be called).

  Handlers should make no ordering assumptions, other than that the last handler
  to register with is_final_handler=True will be called after all the other
  handlers.

  Args:
    signal_num: The signal number with which to associate handler.
    handler: The handler.
    is_final_handler: Bool indicator whether handler should be called last among
                      all the handlers for this signal_num. The last handler to
                      register this way survives; other handlers registered with
                      is_final_handler=True will not be called when the signal
                      is received.
  Raises:
    RuntimeError: if attempt is made to register a signal_num not in
        GetCaughtSignals.
   N/A N/A signal_num N/A GetCaughtSignals N/A N/A N/A RuntimeError N/A Attempt to register handler (%s) for signal %d, which is not in GetCaughtSignals N/A handler signal_num N/A is_final_handler N/A N/A N/A _final_signal_handlers N/A signal_num handler N/A N/A N/A N/A N/A _non_final_signal_handlers N/A signal_num append handler N/A _SignalHandler N/A N/A signal_num cur_stack_frame N/A N/A N/A Global signal handler.

  When a signal is caught we execute each registered handler for that signal.

  Args:
    signal_num: Signal that was caught.
    cur_stack_frame: Unused.
   N/A N/A signal_num _non_final_signal_handlers N/A N/A handler N/A _non_final_signal_handlers N/A signal_num N/A N/A N/A handler signal_num cur_stack_frame N/A N/A signal_num _final_signal_handlers N/A N/A N/A N/A _final_signal_handlers N/A signal_num signal_num cur_stack_frame N/A InitializeSignalHandling N/A N/A N/A N/A N/A Initializes global signal handling.

  Sets up global signal handler for each signal we handle.
   N/A signal_num N/A GetCaughtSignals N/A N/A N/A _non_final_signal_handlers N/A signal_num N/A N/A N/A N/A signal signal signal_num _SignalHandler N/A GetCaughtSignals N/A N/A N/A N/A N/A Returns terminating signals that can be caught on this OS platform. N/A signals N/A N/A signal SIGINT N/A signal SIGTERM N/A N/A IS_WINDOWS N/A N/A N/A N/A signals append N/A signal SIGQUIT N/A signals N/A KillProcess N/A N/A pid N/A N/A N/A Make best effort to kill the given process.

  We ignore all exceptions so a caller looping through a list of processes will
  continue attempting to kill each, even if one encounters a problem.

  Args:
    pid: The process ID.
   N/A N/A N/A N/A IS_WINDOWS N/A N/A N/A 2 6 N/A N/A sys version_info N/A 3 N/A 2 7 N/A N/A 3 0 N/A N/A sys version_info N/A 3 N/A 3 2 N/A N/A kernel32 N/A N/A ctypes windll kernel32 N/A handle N/A N/A kernel32 OpenProcess 1 0 pid N/A N/A N/A kernel32 TerminateProcess handle 0 N/A N/A N/A N/A os kill pid N/A signal SIGKILL N/A N/A N/A N/A N/A MultithreadedMainSignalHandler N/A N/A signal_num cur_stack_frame N/A N/A N/A Final signal handler for multi-threaded main process. N/A N/A signal_num N/A signal SIGINT N/A N/A N/A N/A N/A N/A logging getLogger isEnabledFor N/A logging DEBUG N/A N/A stack_trace N/A N/A join N/A N/A traceback format_list N/A N/A traceback extract_stack N/A err N/A DEBUG: Caught CTRL-C (signal %d) - Exception stack trace:
    %s N/A signal_num N/A N/A re sub \n stack_trace N/A N/A N/A N/A N/A N/A sys stderr write N/A N/A err encode UTF8 N/A N/A N/A UnicodeDecodeError N/A N/A N/A N/A N/A sys stderr write err N/A N/A N/A N/A N/A sys stderr write N/A Caught CTRL-C (signal %d) - exiting
 signal_num N/A N/A KillProcess N/A N/A os getpid N/A ChildProcessSignalHandler N/A N/A signal_num cur_stack_frame N/A N/A N/A Final signal handler for child processes. N/A N/A KillProcess N/A N/A os getpid N/A