Module ImportFrom alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias Assign NameStore Str FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad decorator_list If Call AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str For NameStore TupleLoad Str body Assign SubscriptStore Call NameLoad Index NameLoad Call NameLoad NameLoad NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad NameLoad keyword Lambda arguments args NameParam defaults TupleLoad Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad TryFinally body Expr Yield finalbody Expr Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type TupleLoad NameLoad AttributeLoad NameLoad attr body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpAnd Call NameLoad NameLoad Str Call NameLoad AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore Str Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Return NameLoad Return Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list
N/A contextlib contextmanager N/A io N/A logging N/A os N/A threading N/A sys exceptions ExceptionWrapper N/A LOG_FORMAT %(name)s.%(module)s.%(funcName)s: %(message)s enable_logging N/A N/A N/A N/A N/A N/A N/A logging basicConfig level N/A logging DEBUG format LOG_FORMAT N/A N/A N/A N/A N/A os environ get INVOKE_DEBUG N/A N/A N/A enable_logging N/A log N/A N/A logging getLogger invoke N/A x N/A debug N/A N/A N/A N/A globals N/A x N/A getattr log x sort_names N/A N/A names N/A N/A N/A 
    Sort task ``names`` by nesting depth & then as regular strings.
     N/A N/A sorted names key N/A N/A N/A x N/A N/A N/A N/A x count . x N/A cd N/A N/A where N/A N/A N/A cwd N/A N/A os getcwd N/A N/A N/A os chdir where N/A N/A N/A N/A N/A N/A N/A N/A os chdir cwd N/A contextmanager has_fileno N/A N/A stream N/A N/A N/A 
    Cleanly determine whether ``stream`` has a useful ``.fileno()``.

    .. note::
        This function helps determine if a given file-like object can be used
        with various terminal-oriented modules and functions such as `select`,
        `termios`, and `tty`. For most of those, a fileno is all that is
        required; they'll function even if ``stream.isatty()`` is ``False``.

    :param stream: A file-like object.

    :returns:
        ``True`` if ``stream.fileno()`` returns an integer, ``False`` otherwise
        (this includes when ``stream`` lacks a ``fileno`` method).
     N/A N/A N/A N/A isinstance N/A N/A stream fileno int N/A N/A N/A N/A AttributeError N/A io UnsupportedOperation N/A N/A False N/A isatty N/A N/A stream N/A N/A N/A 
    Cleanly determine whether ``stream`` is a TTY.

    Specifically, first try calling ``stream.isatty()``, and if that fails
    (e.g. due to lacking the method entirely) fallback to `os.isatty`.

    .. note::
        Most of the time, we don't actually care about true TTY-ness, but
        merely whether the stream seems to have a fileno (per `has_fileno`).
        However, in some cases (notably the use of `pty.fork` to present a
        local pseudoterminal) we need to tell if a given stream has a valid
        fileno but *isn't* tied to an actual terminal. Thus, this function.

    :param stream: A file-like object.

    :returns:
        A boolean depending on the result of calling ``.isatty()`` and/or
        `os.isatty`.
     N/A N/A N/A hasattr stream isatty N/A callable N/A stream isatty N/A N/A N/A N/A stream isatty N/A N/A N/A has_fileno stream N/A N/A N/A N/A os isatty N/A N/A stream fileno N/A False N/A ExceptionHandlingThread N/A N/A threading Thread N/A N/A 
    Thread handler making it easier for parent to handle thread exceptions.

    Based in part on Fabric 1's ThreadHandler. See also Fabric GH issue #204.
     __init__ N/A N/A self N/A kwargs N/A N/A N/A N/A N/A super ExceptionHandlingThread self __init__ kwargs N/A N/A self daemon True N/A N/A self kwargs kwargs N/A N/A self exc_info None N/A run N/A N/A self N/A N/A N/A N/A N/A N/A N/A N/A super ExceptionHandlingThread self run N/A N/A N/A BaseException N/A N/A N/A self exc_info N/A N/A sys exc_info N/A msg Encountered exception {0!r} in thread for {1!r} N/A N/A debug N/A N/A msg format N/A N/A self exc_info N/A 1 N/A N/A N/A self kwargs N/A target __name__ N/A exception N/A N/A self N/A N/A N/A 
        If an exception occurred, return an `.ExceptionWrapper` around it.

        :returns:
            An `.ExceptionWrapper` managing the result of `sys.exc_info`, if an
            exception was raised during thread execution. If no exception
            occurred, returns ``None`` instead.
         N/A N/A N/A self exc_info None N/A N/A None N/A N/A ExceptionWrapper N/A self kwargs N/A self exc_info N/A N/A