
    ͑i@	                     b    S r SSKrSSKr\R                  " 5       r/ rS rS rS r	S r
S rS rg)	a  
Default scope function.

`Paddle` manages Scope as programming language's scope.  It just a
thread-local stack of Scope. Top of that stack is current scope, the bottom
of that stack is all scopes' parent.

Invoking `var/find_var`  can `new/find` variable in current scope.
Invoking `enter_local_scope/leave_local_scope` can create or destroy local
scope.

A `scoped_function` will take a `function` as input. That function will be
invoked in a new local scope.
    Nc                  *   [        [        SS5      n U c  / [        l        [        [        R                  5      S:X  aE  [        R                  R	                  [
        R                  R                  R                  5       5        [        R                  S   $ )z3
Get current scope.
:rtype: paddle.base.core.Scope
	cur_scopeNr   )	getattr__tl_scope__r   lenappendpaddlebasecoreScope)cur_scope_stacks    _/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddle/base/default_scope_funcs.pyget_cur_scoper   &   sk    
 lK>O!#
<!!"a'%%fkk&6&6&<&<&>?!!"%%    c                  v    [        5       n U R                  5       n[        R                  R	                  U5        g)z
Enter a new local scope
N)r   	new_scoper   r   r	   )r   r   s     r   enter_local_scoper   3   s-     I##%I!!),r   c                  p    [         R                  R                  5         [        5       R	                  5         g)z
Leave local scope
N)r   r   popr   	drop_kids r   r   leave_local_scoper   <   s$      Or   c                 4    [        5       R                  U 5      $ )z#
create variable in current scope.
)r   varnames    r   r   r   D   s     ?t$$r   c                 4    [        5       R                  U 5      $ )z 
get variable in current scope.
)r   find_varr   s    r   r   r   K   s     ?##D))r   c                 h    [        5          U " 5          [        5         g!   e = f! [        5         f = f)zs
invoke `func` in new scope.

:param func: a callable function that will be run in new scope.
:type func: callable
N)r   r   )funcs    r   scoped_functionr"   R   s-      	s    "% 1)__doc__	threadingpaddle.base.corer
   localr   __all__r   r   r   r   r   r"   r   r   r   <module>r(      sA      

&- %*r   