Module Expr Str Import alias Import alias Import alias identifier Import alias identifier Import alias identifier Import alias identifier Import alias Import alias identifier Import alias Assign NameStore Str ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr If BoolOpAnd Call NameLoad NameLoad AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr NameLoad CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr If BoolOpAnd Call NameLoad NameLoad AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr NameLoad CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list Assign NameStore BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Str Exec NameLoad Call NameLoad Call NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore NameLoad For NameStore NameLoad body If BoolOpAnd CompareEq Call NameLoad SubscriptLoad NameLoad Index Str Num BoolOpOr Call AttributeLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Num attr Str Call AttributeLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Num attr Str body Assign NameStore Call NameLoad NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Num SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Index Str TryExcept body Expr Call NameLoad handlers ExceptHandler body Return AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Index Num attr decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults BinOpMult Num Num body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Assign TupleStore NameStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Lambda arguments args defaults vararg kwarg NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Dict Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore ListLoad For NameStore AttributeLoad AttributeLoad NameLoad attr attr body If CompareNotIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr Return Dict Assign NameStore Call AttributeLoad Call NameLoad attr TryExcept body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Assign AttributeStore NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Dict Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr If Call NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr TupleLoad NameLoad Call AttributeLoad Call AttributeLoad SubscriptLoad NameLoad Index Num attr attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body TryExcept body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Dict For NameStore Call NameLoad Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad SubscriptLoad NameLoad Index NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index NameLoad handlers ExceptHandler type TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr name NameStore body Assign AttributeStore NameLoad attr BinOpSub AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Raise NameLoad ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr BinOpSub AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Raise If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign AttributeStore NameLoad attr BinOpSub AttributeLoad NameLoad attr Num Raise NameLoad NameLoad NameLoad Raise Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Pass decorator_list
N/A N/A 
WithBlockExecutor

Extracts the Python code nested in its code-block and automatically sends
that code as a callable to the pyfora cluster
 N/A traceback N/A logging N/A pyfora.PyforaInspect PyforaInspect N/A pyfora.Exceptions Exceptions N/A pyfora.pyAst.PyAstUtil PyAstUtil N/A pyfora.DownloadPolicy DownloadPolicy N/A sys N/A pyfora.PyforaWithBlock PyforaWithBlock N/A ast N/A INNER_FUNCTION_NAME inner AugmentRaiseFunctionModificationVisitor N/A N/A ast NodeVisitor N/A N/A Takes a line number, column number, and function name updates the AST.

    All nodes that have a 'lineno' attribute have their lineno and col attributes
    set, and any identifier (in FunctionDef or Name nodes) whose text is
    'INNER_FUNCTION_NAME' is replaced with the provided function name. __init__ N/A N/A self line col functionName N/A None N/A N/A N/A self line line N/A N/A self col col N/A N/A self functionName functionName N/A generic_visit N/A N/A self node N/A N/A N/A N/A N/A N/A super AugmentRaiseFunctionModificationVisitor self generic_visit node N/A N/A hasattr node N/A PyAstUtil LINENO_ATTRIBUTE_NAME N/A N/A N/A node lineno N/A self line N/A N/A node col_offset N/A self col N/A N/A N/A isinstance node N/A ast FunctionDef N/A N/A node name INNER_FUNCTION_NAME N/A N/A self functionName None N/A N/A N/A node name N/A self functionName N/A N/A N/A isinstance node N/A ast Name N/A N/A node id INNER_FUNCTION_NAME N/A N/A self functionName None N/A N/A N/A node id N/A self functionName N/A N/A N/A augmentRaiseFunctionTemplate N/A N/A N/A 
def _augmentRaiseFunctionTempl(rf):
    def  INNER_FUNCTION_NAME ():
        if rf is None:
            raise Exception()
        else:
            rf()
    return  INNER_FUNCTION_NAME augmentRaiseFunction N/A N/A raiseFunction path line col N/A N/A N/A codeAst N/A N/A PyAstUtil getAstFromFilePath path N/A enclosingFunctionName N/A N/A PyAstUtil findEnclosingFunctionName codeAst line N/A vis N/A AugmentRaiseFunctionModificationVisitor line col enclosingFunctionName N/A module N/A N/A ast parse augmentRaiseFunctionTemplate N/A N/A N/A vis visit module N/A code N/A compile module path exec N/A code N/A globals N/A locals N/A N/A _augmentRaiseFunctionTempl raiseFunction N/A syntheticTraceback N/A N/A trace N/A N/A N/A raiseFunction None N/A elt trace N/A N/A N/A N/A N/A len N/A elt N/A path 1 N/A N/A N/A N/A N/A elt N/A path N/A 0 endswith .py N/A N/A N/A N/A elt N/A path N/A 0 endswith .pyc N/A N/A raiseFunction N/A augmentRaiseFunction raiseFunction N/A N/A elt N/A path N/A 0 N/A N/A N/A elt N/A range N/A start N/A line N/A N/A N/A elt N/A range N/A start N/A col N/A N/A N/A N/A raiseFunction N/A N/A N/A N/A N/A N/A N/A N/A sys exc_info N/A 2 tb_next N/A WithBlockExecutor N/A object N/A N/A A helper object used to synchronously run blocks of code on a cluster.

    When entering a ``with`` block using a :class:`WithBlockExecutor`, the body of
    the block is extracted and submitted to the pyfora cluster for execution, along
    with all its local dependencies. Variable assignments within the block are
    returned as :class:`~RemotePythonObject.RemotePythonObject` and reassigned to
    their corresponding local varialbes when exiting the block.

    Use :func:`~WithBlockExecutor.downloadAll`, :func:`~WithBlockExecutor.remoteAll`,
    and :func:`~WithBlockExecutor.downloadSmall` to modify the default behavior and
    select which objects should be downloaded from the server and
    which objects should be returned as :class:`~RemotePythonObject.RemotePythonObject`
    futures.

    Note:
        Instances of :class:`WithBlockExecutor` are only intended to be created by
        :class:`~pyfora.Executor.Executor`. User code typically uses :attr:`~Executor.Executor.remotely`
        to get a :class:`WithBlockExecutor`.
     __init__ N/A N/A self executor N/A N/A N/A N/A self executor executor N/A N/A self lineNumber None N/A N/A self sourceText None N/A N/A self stackFrame None N/A N/A self sourceFileName None N/A N/A self traceAndException None N/A N/A self frame None N/A N/A self compileOnly False N/A N/A self downloadPolicy N/A N/A DownloadPolicy DownloadNonePolicy N/A asCompileOnly N/A N/A self N/A N/A N/A N/A self compileOnly True N/A self N/A downloadAll N/A N/A self N/A N/A N/A Modify the executor to download all results into the local namespace.

        Returns:
            ``self`` to support chaining.
         N/A N/A self downloadPolicy N/A N/A DownloadPolicy DownloadAllPolicy N/A self N/A remoteAll N/A N/A self N/A N/A N/A Modify the executor to leave all results on the server and only return proxies (default).

        Returns:
            ``self`` to support chaining.
         N/A N/A self downloadPolicy N/A N/A DownloadPolicy DownloadNonePolicy N/A self N/A downloadSmall N/A N/A self bytecount N/A N/A 10 1000 N/A N/A Modify the executor to download small results into the local namespace
        and return proxies for everything else.

        Returns:
            ``self`` to support chaining.
         N/A N/A self downloadPolicy N/A N/A DownloadPolicy DownloadSmallPolicy bytecount N/A self N/A __enter__ N/A N/A self N/A N/A N/A N/A self frame N/A N/A PyforaInspect currentframe 1 N/A N/A sourceFileName lineNumber _ _ _ N/A N/A PyforaInspect getframeinfo N/A self frame N/A N/A self sourceFileName sourceFileName N/A N/A self lineNumber lineNumber N/A N/A self sourceText N/A N/A join N/A N/A PyforaInspect getlines N/A self sourceFileName N/A N/A N/A sys settrace N/A N/A N/A N/A args keys None N/A N/A N/A self frame f_trace N/A self trace N/A __exit__ N/A N/A self excType excValue trace N/A N/A N/A N/A isinstance excValue WithBlockCompleted N/A blockOperation N/A N/A self frame N/A N/A N/A boundVariables N/A N/A N/A N/A boundVariables update N/A frame f_globals N/A N/A N/A boundVariables update N/A frame f_locals N/A unboundLocals N/A N/A var N/A N/A frame f_code co_varnames N/A N/A N/A var N/A frame f_locals N/A N/A N/A N/A unboundLocals append var N/A unboundLocals N/A sorted unboundLocals N/A withBlock N/A N/A PyforaWithBlock PyforaWithBlock lineNumber N/A self lineNumber sourceText N/A self sourceText boundVariables boundVariables sourceFileName N/A self sourceFileName unboundLocals unboundLocals N/A f_proxy N/A N/A N/A N/A N/A self executor define withBlock resultWithWakeup N/A N/A self compileOnly N/A N/A N/A N/A N/A N/A f_proxy triggerCompilation resultWithWakeup N/A N/A N/A f_result_proxy N/A N/A N/A f_proxy resultWithWakeup N/A N/A N/A tuple_of_proxies N/A N/A N/A N/A f_result_proxy toTupleOfProxies resultWithWakeup N/A N/A N/A N/A Exceptions ComputationError N/A e N/A N/A N/A self traceAndException N/A N/A e trace N/A e remoteException N/A N/A N/A proxy_trace N/A tuple_of_proxies N/A 1 N/A trace N/A N/A N/A N/A proxy_trace toLocal resultWithWakeup N/A N/A isinstance trace tuple N/A N/A N/A self traceAndException N/A trace N/A N/A N/A N/A N/A tuple_of_proxies N/A 2 toLocal resultWithWakeup N/A proxy_dict N/A tuple_of_proxies N/A 0 N/A dict_of_proxies N/A N/A N/A N/A proxy_dict toDictOfAssignedVarsToProxyValues resultWithWakeup N/A dict_of_proxies N/A trace N/A N/A self frame event arg N/A N/A N/A N/A N/A f_locals N/A frame f_locals N/A globalsToSet N/A N/A self blockOperation frame N/A policyInstances N/A N/A keyname N/A list N/A N/A globalsToSet keys N/A N/A N/A policyInstances N/A keyname N/A N/A N/A self downloadPolicy initiatePolicyCheck keyname N/A globalsToSet N/A keyname N/A N/A k _ N/A N/A globalsToSet iteritems N/A N/A N/A f_locals N/A k N/A N/A N/A self downloadPolicy resolveToFinalValue N/A policyInstances N/A k N/A N/A N/A N/A N/A Exceptions PythonToForaConversionError N/A Exceptions ForaToPythonConversionError N/A err N/A N/A N/A frame f_lineno N/A N/A frame f_lineno 1 N/A N/A N/A logging error Re-raising exception to partially hide traceback.
%s N/A N/A traceback format_exc N/A err N/A N/A Exception N/A N/A N/A frame f_lineno N/A N/A frame f_lineno 1 N/A N/A N/A logging error Re-raising exception after amending lineno.
%s N/A N/A traceback format_exc N/A N/A N/A N/A self traceAndException None N/A N/A exceptionValue N/A N/A self traceAndException N/A 1 N/A tb N/A syntheticTraceback N/A N/A self traceAndException N/A 0 N/A N/A frame f_lineno N/A N/A frame f_lineno 1 N/A exceptionValue None tb N/A N/A WithBlockCompleted N/A N/A WithBlockCompleted N/A Exception N/A N/A N/A