3
U'íc9 ã @ s U d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl
mZ ddlm
Z
ddlmZ d d
lmZ d dlmZ d dlmZ d d
lmZ ejdejdejf dZdZe Zeje e Zeje ddhZ ddhZ!ddhZ"ej#e$ddddddddgfej%e$ddd d!dgfej&e$d"d#d$d%d&dgfe e$d"d'dd&d(dd)dd*g ffZ'ej(ej(ej)ej*e f df 'ejej+e d+d,d-Z,e-e.d.d/d0Z/eed1d2d3Z0ejee1d4d5d6Z2ejee1d4d7d8Z3G d9d: d:eZ4G d;d< d<e4Z5G d=d> d>eZ6G d?d@ d@e6e
Z7dS )AzA sandbox layer that ensures unsafe operations cannot be performed.
Useful when the template itself comes from an untrusted source.
é N)Úformatter_field_name_split)Úabc)Údeque)Ú Formatter)ÚEscapeFormatter)ÚMarkupé )ÚEnvironment)Ú
SecurityError)ÚContext)Ú UndefinedÚF.)Zboundi Úgi_frameÚgi_codeÚcr_frameÚcr_codeÚag_codeÚag_frameÚaddÚclearÚdifference_updateÚdiscardÚpopÚremoveÚsymmetric_difference_updateÚupdateÚpopitemÚ
setdefaultÚappendÚreverseÚinsertÚsortÚextendÚ
appendleftÚ
extendleftÚpopleftÚrotate)ÚcallableÚreturnc C s: t | tjtjf s| jdkr"d S | j}t |tr6|S d S )NÚformatÚ
format_map)r) r* )Ú
isinstanceÚtypesÚ
MethodTypeÚBuiltinMethodTypeÚ__name__Ú__self__Ústr)r'