repo
stringlengths 7
54
| path
stringlengths 4
223
| func_name
stringlengths 1
134
| original_string
stringlengths 75
104k
| language
stringclasses 1
value | code
stringlengths 75
104k
| code_tokens
listlengths 20
28.4k
| docstring
stringlengths 1
46.3k
| docstring_tokens
listlengths 1
1.66k
| sha
stringlengths 40
40
| url
stringlengths 87
315
| partition
stringclasses 1
value | summary
stringlengths 4
350
| obf_code
stringlengths 7.85k
764k
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
awslabs/serverless-application-model
|
samtranslator/swagger/swagger.py
|
SwaggerEditor.swagger
|
def swagger(self):
"""
Returns a **copy** of the Swagger document as a dictionary.
:return dict: Dictionary containing the Swagger document
"""
# Make sure any changes to the paths are reflected back in output
self._doc["paths"] = self.paths
if self.security_definitions:
self._doc["securityDefinitions"] = self.security_definitions
if self.gateway_responses:
self._doc[self._X_APIGW_GATEWAY_RESPONSES] = self.gateway_responses
return copy.deepcopy(self._doc)
|
python
|
def swagger(self):
"""
Returns a **copy** of the Swagger document as a dictionary.
:return dict: Dictionary containing the Swagger document
"""
# Make sure any changes to the paths are reflected back in output
self._doc["paths"] = self.paths
if self.security_definitions:
self._doc["securityDefinitions"] = self.security_definitions
if self.gateway_responses:
self._doc[self._X_APIGW_GATEWAY_RESPONSES] = self.gateway_responses
return copy.deepcopy(self._doc)
|
[
"def",
"swagger",
"(",
"self",
")",
":",
"# Make sure any changes to the paths are reflected back in output",
"self",
".",
"_doc",
"[",
"\"paths\"",
"]",
"=",
"self",
".",
"paths",
"if",
"self",
".",
"security_definitions",
":",
"self",
".",
"_doc",
"[",
"\"securityDefinitions\"",
"]",
"=",
"self",
".",
"security_definitions",
"if",
"self",
".",
"gateway_responses",
":",
"self",
".",
"_doc",
"[",
"self",
".",
"_X_APIGW_GATEWAY_RESPONSES",
"]",
"=",
"self",
".",
"gateway_responses",
"return",
"copy",
".",
"deepcopy",
"(",
"self",
".",
"_doc",
")"
] |
Returns a **copy** of the Swagger document as a dictionary.
:return dict: Dictionary containing the Swagger document
|
[
"Returns",
"a",
"**",
"copy",
"**",
"of",
"the",
"Swagger",
"document",
"as",
"a",
"dictionary",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/swagger/swagger.py#L528-L543
|
train
|
Returns a copy of the Swagger document as a dictionary.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8q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,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(53) + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(0b100000 + 0o117) + chr(49) + '\x32' + chr(53), 45939 - 45931), ehT0Px3KOsy9('\060' + chr(0b111011 + 0o64) + '\062' + '\067' + '\x32', 6027 - 6019), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + '\x31' + chr(1231 - 1181), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(9302 - 9191) + chr(0b110010) + '\061' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\157' + '\x34' + chr(1141 - 1086), ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b110010 + 0o75) + chr(0b101 + 0o55) + chr(55) + chr(0b11 + 0o60), 14440 - 14432), ehT0Px3KOsy9('\060' + chr(9770 - 9659) + chr(617 - 562) + chr(2370 - 2320), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b1001 + 0o51) + chr(50) + chr(0b10111 + 0o36), 9153 - 9145), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\065' + chr(1975 - 1926), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(51) + chr(0b10010 + 0o43), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010011 + 0o34) + chr(818 - 768) + '\x32' + chr(694 - 645), 0o10), ehT0Px3KOsy9('\060' + chr(7474 - 7363) + chr(51) + chr(48) + chr(0b1010 + 0o55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101000 + 0o12) + '\067' + chr(53), 35742 - 35734), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1283 - 1232) + chr(0b1101 + 0o50) + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(0b101001 + 0o106) + '\061' + chr(51) + chr(1838 - 1783), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101 + 0o142) + chr(1260 - 1210) + chr(51) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(2140 - 2092) + chr(0b1011110 + 0o21) + '\x31' + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1433 - 1383) + chr(0b110001) + '\060', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\061' + '\062' + chr(2039 - 1986), 8), ehT0Px3KOsy9(chr(282 - 234) + '\157' + chr(2266 - 2215) + '\064' + '\063', 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + chr(51) + '\x37' + '\064', 0b1000), ehT0Px3KOsy9(chr(788 - 740) + chr(0b1101111) + chr(49) + chr(0b101111 + 0o5), 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + chr(0b110101) + chr(0b110101), 38127 - 38119), ehT0Px3KOsy9('\060' + chr(11459 - 11348) + '\x32' + chr(710 - 662) + chr(1841 - 1791), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111111 + 0o60) + chr(0b110011) + chr(0b100110 + 0o14) + chr(0b100001 + 0o21), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(785 - 732) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011111 + 0o20) + chr(0b110110) + '\062', 29997 - 29989), ehT0Px3KOsy9('\x30' + chr(0b11011 + 0o124) + '\x31' + chr(51) + chr(55), 8), ehT0Px3KOsy9('\060' + chr(0b11010 + 0o125) + '\x31' + chr(0b110000) + chr(0b11001 + 0o27), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(54) + chr(0b110001 + 0o1), 23613 - 23605), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1000001 + 0o56) + chr(0b1110 + 0o47) + '\x30', 0b1000), ehT0Px3KOsy9(chr(1755 - 1707) + chr(111) + '\061' + chr(0b110001) + chr(49), 8809 - 8801), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b11000 + 0o35) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + '\062' + '\065' + '\061', 21255 - 21247), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b110000 + 0o77) + chr(0b110 + 0o54) + chr(53) + chr(1063 - 1014), 8), ehT0Px3KOsy9(chr(48) + chr(1534 - 1423) + chr(50) + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + chr(7742 - 7631) + '\x31' + chr(0b1110 + 0o42), 0b1000), ehT0Px3KOsy9(chr(2158 - 2110) + '\157' + chr(0b11100 + 0o25) + '\x32' + '\065', 8), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(49) + '\x36', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1000100 + 0o53) + chr(0b110101) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x00'), chr(100) + '\x65' + '\x63' + chr(0b1101111) + '\144' + chr(0b1100101))('\165' + chr(0b1110100) + chr(102) + chr(45) + chr(0b11000 + 0o40)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def vKQLfCidaf7H(oVre8I6UXc3b):
oVre8I6UXc3b.vPvFW0zvMumN[xafqLlk3kkUe(SXOLrMavuUCe(b'^4\xce\xe2\xfe'), '\144' + chr(115 - 14) + chr(0b101110 + 0o65) + '\157' + chr(0b111010 + 0o52) + chr(101))(chr(0b11011 + 0o132) + chr(116) + chr(0b1000000 + 0o46) + chr(45) + chr(0b111000))] = oVre8I6UXc3b.L5ghGbOkzBG7
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'q,\xff\xed\xdev\xd6]\xad:\xbb\xe0'), chr(8330 - 8230) + chr(101) + chr(99) + chr(0b1101111) + chr(0b1011111 + 0o5) + chr(101))('\x75' + chr(3005 - 2889) + chr(102) + chr(45) + chr(0b101000 + 0o20))):
oVre8I6UXc3b.vPvFW0zvMumN[xafqLlk3kkUe(SXOLrMavuUCe(b']0\xd9\xff\xffN\xcfC\xd1\x0c\xbb\xf8\xa9\xd4\x9d6\xf2a\xfb'), chr(0b1100100) + chr(101) + '\x63' + chr(0b1000000 + 0o57) + chr(0b1100100) + chr(101))('\165' + '\164' + chr(10111 - 10009) + chr(0b10001 + 0o34) + '\070')] = oVre8I6UXc3b._yEgSQmg8Sfq
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'a\x04\xe3\xd5\xd7B\x8dk\xdd9\xab\xc3'), chr(4888 - 4788) + chr(1814 - 1713) + '\x63' + chr(8704 - 8593) + chr(0b1100100) + chr(0b1100001 + 0o4))('\x75' + chr(116) + '\x66' + '\055' + chr(0b111000))):
oVre8I6UXc3b.vPvFW0zvMumN[oVre8I6UXc3b.ElktSt__dLjs] = oVre8I6UXc3b.OQY_Ze6QHPvR
return xafqLlk3kkUe(igThHS4jwVsa, xafqLlk3kkUe(SXOLrMavuUCe(b'J0\xdf\xfa\xeeH\xcbC'), chr(0b1100100) + chr(0b10 + 0o143) + chr(0b101001 + 0o72) + chr(111) + '\144' + chr(101))('\165' + chr(0b1110100) + chr(102) + chr(45) + '\070'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'X\x05\xcc\xcc\xda\x17\xc1L\xd8\x1c\xb0\xdf'), chr(0b1100100) + chr(0b1100101) + '\143' + '\157' + chr(100) + chr(101))(chr(11296 - 11179) + '\x74' + '\146' + chr(45) + chr(0b101 + 0o63))))
|
awslabs/serverless-application-model
|
samtranslator/swagger/swagger.py
|
SwaggerEditor.is_valid
|
def is_valid(data):
"""
Checks if the input data is a Swagger document
:param dict data: Data to be validated
:return: True, if data is a Swagger
"""
return bool(data) and \
isinstance(data, dict) and \
bool(data.get("swagger")) and \
isinstance(data.get('paths'), dict)
|
python
|
def is_valid(data):
"""
Checks if the input data is a Swagger document
:param dict data: Data to be validated
:return: True, if data is a Swagger
"""
return bool(data) and \
isinstance(data, dict) and \
bool(data.get("swagger")) and \
isinstance(data.get('paths'), dict)
|
[
"def",
"is_valid",
"(",
"data",
")",
":",
"return",
"bool",
"(",
"data",
")",
"and",
"isinstance",
"(",
"data",
",",
"dict",
")",
"and",
"bool",
"(",
"data",
".",
"get",
"(",
"\"swagger\"",
")",
")",
"and",
"isinstance",
"(",
"data",
".",
"get",
"(",
"'paths'",
")",
",",
"dict",
")"
] |
Checks if the input data is a Swagger document
:param dict data: Data to be validated
:return: True, if data is a Swagger
|
[
"Checks",
"if",
"the",
"input",
"data",
"is",
"a",
"Swagger",
"document"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/swagger/swagger.py#L546-L556
|
train
|
Checks if the input data is a Swagger document
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp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SX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1609 - 1561) + chr(0b1010111 + 0o30) + chr(2448 - 2397) + chr(2462 - 2411) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1100101 + 0o12) + '\x32' + chr(588 - 537) + chr(491 - 442), 0o10), ehT0Px3KOsy9(chr(687 - 639) + chr(0b110101 + 0o72) + chr(0b110011) + chr(0b110011) + chr(0b11100 + 0o24), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\x32' + chr(0b10000 + 0o45), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(53) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(8391 - 8280) + '\061' + chr(0b110100) + chr(0b110011), 64145 - 64137), ehT0Px3KOsy9('\x30' + chr(3646 - 3535) + chr(0b110010) + '\x35' + chr(2152 - 2100), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + '\067' + chr(0b11010 + 0o32), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(49) + chr(0b10100 + 0o40), 0o10), ehT0Px3KOsy9(chr(1962 - 1914) + chr(0b1101111) + chr(48), 24190 - 24182), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100101 + 0o15) + chr(0b110110) + chr(53), 0o10), ehT0Px3KOsy9('\x30' + chr(10238 - 10127) + '\063' + '\x30' + chr(1128 - 1078), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(0b1111 + 0o46) + chr(0b10110 + 0o41), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(53) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(6963 - 6852) + chr(0b101001 + 0o15), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11110 + 0o121) + chr(49) + chr(0b10 + 0o60), 0b1000), ehT0Px3KOsy9('\060' + chr(473 - 362) + '\063' + chr(2146 - 2098), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + '\062', 15772 - 15764), ehT0Px3KOsy9(chr(48) + chr(0b11001 + 0o126) + chr(0b110010) + chr(49) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1101111) + chr(872 - 822) + '\063' + chr(0b110100), 47098 - 47090), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + chr(51) + '\066' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(5431 - 5320) + '\x31' + chr(52) + '\063', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(1854 - 1804) + '\067', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b101110 + 0o4) + chr(610 - 556) + chr(2073 - 2024), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1111 + 0o140) + chr(0b1000 + 0o53) + '\065' + chr(1546 - 1497), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\x31' + chr(0b10000 + 0o42), 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\x6f' + chr(50) + '\x31' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(1659 - 1604) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + '\067' + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1115 - 1065) + chr(1018 - 970) + chr(54), 38606 - 38598), ehT0Px3KOsy9(chr(1953 - 1905) + '\157' + chr(1948 - 1897) + chr(0b0 + 0o67) + '\063', 0o10), ehT0Px3KOsy9('\x30' + chr(10932 - 10821) + chr(1655 - 1604) + chr(0b101000 + 0o12) + '\066', 54302 - 54294), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(668 - 619) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(55) + chr(2016 - 1966), 8819 - 8811), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000110 + 0o51) + chr(0b110010) + '\x36' + chr(1700 - 1646), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + '\060' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + '\061' + '\x33' + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + '\x33' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b100111 + 0o110) + chr(0b101000 + 0o12) + '\064', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + '\x35' + chr(0b1101 + 0o43), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1'), '\x64' + '\x65' + chr(99) + chr(111) + '\x64' + chr(101))(chr(117) + chr(116) + '\146' + chr(45) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def cU1z7dBJBr5q(ULnjp6D6efFH):
return WbBjf8Y7v9VN(ULnjp6D6efFH) and PlSM16l2KDPD(ULnjp6D6efFH, wLqBDw8l0eIm) and WbBjf8Y7v9VN(xafqLlk3kkUe(ULnjp6D6efFH, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8\xfc\xac'), '\144' + '\x65' + chr(0b1100011) + chr(6892 - 6781) + chr(100) + '\x65')(chr(117) + chr(0b1110100) + chr(1690 - 1588) + '\055' + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xac\xee\xb92\x8e\x06\xde'), chr(0b110000 + 0o64) + chr(101) + chr(0b10111 + 0o114) + '\157' + chr(0b1100100) + chr(1698 - 1597))('\x75' + chr(0b1110100) + '\x66' + '\055' + chr(2399 - 2343)))) and PlSM16l2KDPD(xafqLlk3kkUe(ULnjp6D6efFH, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8\xfc\xac'), '\144' + '\x65' + chr(4207 - 4108) + chr(0b1001111 + 0o40) + chr(0b1100100) + '\145')(chr(0b1010000 + 0o45) + chr(116) + '\x66' + chr(0b11110 + 0o17) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xaf\xf8\xac=\x9a'), '\x64' + chr(3235 - 3134) + '\143' + '\157' + chr(0b1100100) + '\x65')('\165' + '\164' + chr(6733 - 6631) + '\055' + chr(0b111000))), wLqBDw8l0eIm)
|
awslabs/serverless-application-model
|
samtranslator/swagger/swagger.py
|
SwaggerEditor._normalize_method_name
|
def _normalize_method_name(method):
"""
Returns a lower case, normalized version of HTTP Method. It also know how to handle API Gateway specific methods
like "ANY"
NOTE: Always normalize before using the `method` value passed in as input
:param string method: Name of the HTTP Method
:return string: Normalized method name
"""
if not method or not isinstance(method, string_types):
return method
method = method.lower()
if method == 'any':
return SwaggerEditor._X_ANY_METHOD
else:
return method
|
python
|
def _normalize_method_name(method):
"""
Returns a lower case, normalized version of HTTP Method. It also know how to handle API Gateway specific methods
like "ANY"
NOTE: Always normalize before using the `method` value passed in as input
:param string method: Name of the HTTP Method
:return string: Normalized method name
"""
if not method or not isinstance(method, string_types):
return method
method = method.lower()
if method == 'any':
return SwaggerEditor._X_ANY_METHOD
else:
return method
|
[
"def",
"_normalize_method_name",
"(",
"method",
")",
":",
"if",
"not",
"method",
"or",
"not",
"isinstance",
"(",
"method",
",",
"string_types",
")",
":",
"return",
"method",
"method",
"=",
"method",
".",
"lower",
"(",
")",
"if",
"method",
"==",
"'any'",
":",
"return",
"SwaggerEditor",
".",
"_X_ANY_METHOD",
"else",
":",
"return",
"method"
] |
Returns a lower case, normalized version of HTTP Method. It also know how to handle API Gateway specific methods
like "ANY"
NOTE: Always normalize before using the `method` value passed in as input
:param string method: Name of the HTTP Method
:return string: Normalized method name
|
[
"Returns",
"a",
"lower",
"case",
"normalized",
"version",
"of",
"HTTP",
"Method",
".",
"It",
"also",
"know",
"how",
"to",
"handle",
"API",
"Gateway",
"specific",
"methods",
"like",
"ANY"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/swagger/swagger.py#L576-L593
|
train
|
Normalizes the HTTP Method name.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7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AZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(314 - 266) + '\157' + chr(1433 - 1382) + '\067' + chr(48), 5349 - 5341), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110001) + chr(874 - 823), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b111110 + 0o61) + chr(1705 - 1654) + chr(0b110110) + chr(0b101101 + 0o10), 15359 - 15351), ehT0Px3KOsy9('\060' + '\x6f' + chr(55) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b101 + 0o152) + chr(2831 - 2777) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(145 - 97) + '\x6f' + '\x33' + chr(0b110010) + chr(0b1101 + 0o50), 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(111) + '\063' + chr(1884 - 1835) + chr(55), 6552 - 6544), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\061' + '\062', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(515 - 465) + chr(49) + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + '\x33' + '\062', 60396 - 60388), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1541 - 1490) + chr(448 - 398) + '\x35', 8), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1101111) + '\063' + '\x34' + '\x31', 23914 - 23906), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + chr(50) + chr(48) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(518 - 470) + '\x6f' + chr(50) + chr(53) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(0b110101) + chr(0b10000 + 0o41), 0b1000), ehT0Px3KOsy9(chr(1638 - 1590) + chr(0b1101111) + '\061' + chr(0b11 + 0o62) + '\x36', 63708 - 63700), ehT0Px3KOsy9(chr(48) + chr(657 - 546) + chr(0b110011) + chr(0b110001), 22791 - 22783), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(0b10011 + 0o35) + chr(863 - 815), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(1973 - 1921) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1011100 + 0o23) + chr(0b1001 + 0o53) + chr(1925 - 1873), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11001 + 0o30) + chr(0b101001 + 0o16) + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + chr(10154 - 10043) + '\061' + chr(1116 - 1065) + chr(0b100000 + 0o21), 0o10), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(111) + chr(777 - 725) + chr(0b110011 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10111 + 0o32) + '\063' + chr(51), 31834 - 31826), ehT0Px3KOsy9('\x30' + '\x6f' + chr(55) + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(50) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b11111 + 0o120) + '\066' + chr(1327 - 1272), 55622 - 55614), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11100 + 0o26) + chr(1179 - 1124) + chr(676 - 621), 0b1000), ehT0Px3KOsy9(chr(430 - 382) + chr(0b1011100 + 0o23) + '\x31' + chr(0b110101) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + '\x32' + chr(0b1011 + 0o47) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b110010) + '\060', 0b1000), ehT0Px3KOsy9(chr(478 - 430) + chr(111) + chr(50) + '\x36' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100010 + 0o115) + chr(49) + chr(51) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b11111 + 0o120) + chr(50) + '\x31' + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(50) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(1622 - 1574) + '\157' + chr(0b110011) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(941 - 893) + '\157' + chr(0b110001) + chr(0b110101) + chr(1428 - 1377), ord("\x08")), ehT0Px3KOsy9(chr(842 - 794) + chr(111) + '\x32' + '\x33' + chr(55), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(1137 - 1087) + '\x34' + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + chr(0b11000 + 0o127) + chr(0b1010 + 0o50) + '\065' + chr(0b110100), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1465 - 1417) + chr(0b101100 + 0o103) + '\x35' + chr(1467 - 1419), 17289 - 17281)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6'), chr(1440 - 1340) + '\x65' + chr(0b100 + 0o137) + chr(0b1101111) + chr(0b1100000 + 0o4) + chr(0b11111 + 0o106))(chr(0b1011001 + 0o34) + chr(116) + '\146' + '\055' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def IwBiXTqsY_MN(CVRCXTcnOnH6):
if not CVRCXTcnOnH6 or not PlSM16l2KDPD(CVRCXTcnOnH6, sInLJQno9SRQ):
return CVRCXTcnOnH6
CVRCXTcnOnH6 = CVRCXTcnOnH6.lower()
if CVRCXTcnOnH6 == xafqLlk3kkUe(SXOLrMavuUCe(b'\x99%\x8c'), chr(4256 - 4156) + chr(0b1000101 + 0o40) + '\143' + '\157' + chr(0b110110 + 0o56) + chr(0b100100 + 0o101))(chr(0b1110101) + '\x74' + chr(0b1100110) + '\055' + chr(447 - 391)):
return xafqLlk3kkUe(IX7SCU7eVrph, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7\x13\xaa{|\x8c\x90\xc7\xc9\x0e\x9d\xae\xc0'), chr(5189 - 5089) + chr(0b1100101) + '\143' + chr(0b1101111) + '\x64' + '\145')(chr(0b1010111 + 0o36) + chr(6712 - 6596) + '\146' + '\x2d' + chr(1761 - 1705)))
else:
return CVRCXTcnOnH6
|
awslabs/serverless-application-model
|
samtranslator/plugins/globals/globals_plugin.py
|
GlobalsPlugin.on_before_transform_template
|
def on_before_transform_template(self, template_dict):
"""
Hook method that runs before a template gets transformed. In this method, we parse and process Globals section
from the template (if present).
:param dict template_dict: SAM template as a dictionary
"""
try:
global_section = Globals(template_dict)
except InvalidGlobalsSectionException as ex:
raise InvalidDocumentException([ex])
# For each resource in template, try and merge with Globals if necessary
template = SamTemplate(template_dict)
for logicalId, resource in template.iterate():
resource.properties = global_section.merge(resource.type, resource.properties)
template.set(logicalId, resource)
# Remove the Globals section from template if necessary
Globals.del_section(template_dict)
|
python
|
def on_before_transform_template(self, template_dict):
"""
Hook method that runs before a template gets transformed. In this method, we parse and process Globals section
from the template (if present).
:param dict template_dict: SAM template as a dictionary
"""
try:
global_section = Globals(template_dict)
except InvalidGlobalsSectionException as ex:
raise InvalidDocumentException([ex])
# For each resource in template, try and merge with Globals if necessary
template = SamTemplate(template_dict)
for logicalId, resource in template.iterate():
resource.properties = global_section.merge(resource.type, resource.properties)
template.set(logicalId, resource)
# Remove the Globals section from template if necessary
Globals.del_section(template_dict)
|
[
"def",
"on_before_transform_template",
"(",
"self",
",",
"template_dict",
")",
":",
"try",
":",
"global_section",
"=",
"Globals",
"(",
"template_dict",
")",
"except",
"InvalidGlobalsSectionException",
"as",
"ex",
":",
"raise",
"InvalidDocumentException",
"(",
"[",
"ex",
"]",
")",
"# For each resource in template, try and merge with Globals if necessary",
"template",
"=",
"SamTemplate",
"(",
"template_dict",
")",
"for",
"logicalId",
",",
"resource",
"in",
"template",
".",
"iterate",
"(",
")",
":",
"resource",
".",
"properties",
"=",
"global_section",
".",
"merge",
"(",
"resource",
".",
"type",
",",
"resource",
".",
"properties",
")",
"template",
".",
"set",
"(",
"logicalId",
",",
"resource",
")",
"# Remove the Globals section from template if necessary",
"Globals",
".",
"del_section",
"(",
"template_dict",
")"
] |
Hook method that runs before a template gets transformed. In this method, we parse and process Globals section
from the template (if present).
:param dict template_dict: SAM template as a dictionary
|
[
"Hook",
"method",
"that",
"runs",
"before",
"a",
"template",
"gets",
"transformed",
".",
"In",
"this",
"method",
"we",
"parse",
"and",
"process",
"Globals",
"section",
"from",
"the",
"template",
"(",
"if",
"present",
")",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/globals/globals_plugin.py#L20-L40
|
train
|
This method is called by the template parsing and merging the SAM template with the Globals section.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrv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vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(0b110101) + chr(0b1101 + 0o46), 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1000011 + 0o54) + chr(0b110010) + '\x33' + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1001 + 0o51) + '\x34' + chr(53), 6748 - 6740), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(2756 - 2703) + chr(0b10001 + 0o45), 0o10), ehT0Px3KOsy9('\060' + chr(0b101011 + 0o104) + chr(0b101010 + 0o7) + chr(0b101 + 0o55) + chr(1295 - 1247), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(0b110010 + 0o1) + '\063', 57560 - 57552), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + chr(2020 - 1971) + '\066', 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(4663 - 4552) + chr(1514 - 1464) + chr(0b10001 + 0o41) + '\062', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110101), 54526 - 54518), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(689 - 638) + chr(0b101100 + 0o5) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + '\x35' + chr(0b110111), 42400 - 42392), ehT0Px3KOsy9(chr(48) + chr(6578 - 6467) + '\062' + '\x35', 50471 - 50463), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b110011 + 0o74) + '\061' + '\x36' + chr(0b10001 + 0o43), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1721 - 1672) + chr(53) + chr(1577 - 1529), 57461 - 57453), ehT0Px3KOsy9(chr(48) + chr(3206 - 3095) + '\x33' + chr(0b110100) + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + chr(10034 - 9923) + chr(0b101001 + 0o12) + chr(452 - 403) + '\065', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(0b0 + 0o65) + '\066', 47900 - 47892), ehT0Px3KOsy9(chr(151 - 103) + chr(111) + chr(705 - 654) + chr(559 - 509) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101111) + chr(1301 - 1252) + chr(0b101101 + 0o7) + chr(0b110 + 0o55), ord("\x08")), ehT0Px3KOsy9(chr(584 - 536) + chr(0b1101111) + chr(0b110001) + chr(1171 - 1116) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(48) + chr(4888 - 4777) + chr(0b111 + 0o54) + '\061' + chr(0b101001 + 0o15), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10011 + 0o36) + '\x36', 58801 - 58793), ehT0Px3KOsy9('\060' + '\157' + chr(52) + chr(0b11011 + 0o27), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10100 + 0o35) + chr(49) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(647 - 536) + '\065', 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(48) + chr(52), 28997 - 28989), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(2656 - 2601) + chr(0b11000 + 0o37), 0o10), ehT0Px3KOsy9(chr(1291 - 1243) + chr(0b1101111) + '\067' + chr(0b100100 + 0o22), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(1436 - 1385) + '\x33', 41996 - 41988), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000010 + 0o55) + '\061' + '\x34' + '\063', 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(55), 0o10), ehT0Px3KOsy9(chr(1650 - 1602) + '\157' + '\x32' + '\060' + chr(0b101101 + 0o6), 16835 - 16827), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2237 - 2188) + chr(461 - 410) + chr(0b101 + 0o57), 39946 - 39938), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(1606 - 1556) + chr(2688 - 2636), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100100 + 0o16) + '\065' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + chr(2773 - 2718), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(6923 - 6812) + '\061' + chr(0b101001 + 0o7) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1010100 + 0o33) + '\x33' + chr(53) + chr(896 - 846), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10011 + 0o40) + '\x33' + '\066', 31103 - 31095)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1010 + 0o145) + '\065' + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5'), '\144' + chr(101) + chr(0b100001 + 0o102) + chr(0b1011 + 0o144) + chr(7090 - 6990) + '\145')(chr(8106 - 7989) + chr(3718 - 3602) + chr(0b100010 + 0o104) + chr(0b100110 + 0o7) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def gj1OHc_ZqbSb(oVre8I6UXc3b, PPP5FvnpV6j7):
try:
EKiHa8hN9k2U = cjHEIR4sMQqi(PPP5FvnpV6j7)
except fdAiPp6PgU6Z as DfdhY28yEwAF:
raise WAOffgnUIwTZ([DfdhY28yEwAF])
jJBnSHEgylNZ = EY6e8ub0jb5c(PPP5FvnpV6j7)
for (gvQh1eVhOwBf, o9IPj2MJBBod) in xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xe9\xc0\xdc1\xaf\xab'), '\x64' + '\x65' + chr(0b10101 + 0o116) + chr(111) + chr(2719 - 2619) + chr(1004 - 903))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(45) + '\x38'))():
o9IPj2MJBBod.o4Mv82sLmOP8 = EKiHa8hN9k2U.mP5l0dPhBkus(o9IPj2MJBBod.wmQmyeWBmUpv, o9IPj2MJBBod.o4Mv82sLmOP8)
xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\x98\xf8\xd1'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b111000 + 0o67) + chr(100) + chr(0b1010010 + 0o23))(chr(117) + '\164' + '\146' + '\055' + chr(0b1001 + 0o57)))(gvQh1eVhOwBf, o9IPj2MJBBod)
xafqLlk3kkUe(cjHEIR4sMQqi, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8f\xf8\xc9\xf1#\xbe\xad\xe6ll\xa4'), chr(0b1100100) + '\x65' + chr(99) + chr(0b1010010 + 0o35) + chr(0b1100100) + chr(1971 - 1870))('\x75' + chr(0b1110100) + '\x66' + chr(45) + chr(56)))(PPP5FvnpV6j7)
|
awslabs/serverless-application-model
|
samtranslator/model/types.py
|
is_type
|
def is_type(valid_type):
"""Returns a validator function that succeeds only for inputs of the provided valid_type.
:param type valid_type: the type that should be considered valid for the validator
:returns: a function which returns True its input is an instance of valid_type, and raises TypeError otherwise
:rtype: callable
"""
def validate(value, should_raise=True):
if not isinstance(value, valid_type):
if should_raise:
raise TypeError("Expected value of type {expected}, actual value was of type {actual}.".format(
expected=valid_type, actual=type(value)))
return False
return True
return validate
|
python
|
def is_type(valid_type):
"""Returns a validator function that succeeds only for inputs of the provided valid_type.
:param type valid_type: the type that should be considered valid for the validator
:returns: a function which returns True its input is an instance of valid_type, and raises TypeError otherwise
:rtype: callable
"""
def validate(value, should_raise=True):
if not isinstance(value, valid_type):
if should_raise:
raise TypeError("Expected value of type {expected}, actual value was of type {actual}.".format(
expected=valid_type, actual=type(value)))
return False
return True
return validate
|
[
"def",
"is_type",
"(",
"valid_type",
")",
":",
"def",
"validate",
"(",
"value",
",",
"should_raise",
"=",
"True",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"valid_type",
")",
":",
"if",
"should_raise",
":",
"raise",
"TypeError",
"(",
"\"Expected value of type {expected}, actual value was of type {actual}.\"",
".",
"format",
"(",
"expected",
"=",
"valid_type",
",",
"actual",
"=",
"type",
"(",
"value",
")",
")",
")",
"return",
"False",
"return",
"True",
"return",
"validate"
] |
Returns a validator function that succeeds only for inputs of the provided valid_type.
:param type valid_type: the type that should be considered valid for the validator
:returns: a function which returns True its input is an instance of valid_type, and raises TypeError otherwise
:rtype: callable
|
[
"Returns",
"a",
"validator",
"function",
"that",
"succeeds",
"only",
"for",
"inputs",
"of",
"the",
"provided",
"valid_type",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/types.py#L15-L29
|
train
|
Returns a validator function that succeeds only for inputs of the provided type.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU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8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + '\x34' + chr(49), 8032 - 8024), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + '\067' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(51) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\x30' + chr(51), 0b1000), ehT0Px3KOsy9(chr(137 - 89) + '\x6f' + chr(0b110001) + '\x30' + chr(0b110000 + 0o7), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(111) + chr(89 - 38) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(55) + chr(0b110001), 901 - 893), ehT0Px3KOsy9(chr(48) + chr(1957 - 1846) + chr(548 - 495) + chr(0b1 + 0o57), 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1110 + 0o141) + '\x31' + chr(54) + chr(2209 - 2161), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(1935 - 1885) + chr(308 - 259), 0b1000), ehT0Px3KOsy9(chr(689 - 641) + '\x6f' + chr(49) + '\x32' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + '\x34' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b10 + 0o155) + chr(49) + chr(48) + chr(0b101010 + 0o11), 8), ehT0Px3KOsy9(chr(1068 - 1020) + chr(0b1000010 + 0o55) + chr(0b110001) + chr(0b110111) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(0b100111 + 0o13), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11000 + 0o31) + chr(0b110011) + chr(0b100100 + 0o22), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8730 - 8619) + '\x33' + chr(50) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(51) + chr(1301 - 1248), 0o10), ehT0Px3KOsy9(chr(2223 - 2175) + chr(0b1011001 + 0o26) + chr(0b10110 + 0o35) + '\065' + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10100 + 0o36) + chr(2593 - 2538) + '\063', 45098 - 45090), ehT0Px3KOsy9(chr(1275 - 1227) + '\x6f' + '\x32' + chr(0b110000) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(0b1000111 + 0o50) + '\063' + chr(49) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(518 - 469) + chr(1008 - 958), ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\157' + chr(50) + '\x32' + chr(51), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(1774 - 1723) + chr(0b110111) + chr(0b110100), 6000 - 5992), ehT0Px3KOsy9(chr(857 - 809) + '\x6f' + chr(51) + chr(49) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(0b110010) + chr(0b110000) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(49) + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(50) + chr(618 - 569), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(1781 - 1732) + chr(50) + chr(2774 - 2720), 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + chr(0b10110 + 0o36) + '\062', 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + '\062' + chr(51), 12888 - 12880), ehT0Px3KOsy9(chr(48) + chr(12016 - 11905) + chr(0b100110 + 0o20) + chr(2670 - 2618), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + '\066' + chr(1050 - 1002), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(52) + chr(1338 - 1289), 8), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(11024 - 10913) + chr(50) + '\064', 0o10), ehT0Px3KOsy9('\060' + chr(11793 - 11682) + chr(53) + chr(2215 - 2163), 10946 - 10938), ehT0Px3KOsy9(chr(48) + chr(0b1001101 + 0o42) + '\x33' + '\062' + chr(0b11110 + 0o24), ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + chr(50) + '\x34' + chr(1457 - 1402), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(808 - 760) + chr(7690 - 7579) + '\x35' + chr(1487 - 1439), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'O'), chr(0b100101 + 0o77) + chr(0b111110 + 0o47) + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(11417 - 11300) + '\x74' + '\x66' + '\x2d' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def bhRJw4zBnl2n(dIInFE0uogSl):
def HnJAyqLuKsT1(QmmgWUB13VCJ, TqyHm2Pm5Mq5=ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101100 + 0o3) + '\x31', 19045 - 19037)):
if not PlSM16l2KDPD(QmmgWUB13VCJ, dIInFE0uogSl):
if TqyHm2Pm5Mq5:
raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'$\x81\xad&$k\xdcLP\xe74\x8d6\x1d"1\xb6\xbd\x99\xc2\xf2\xab\xaa\xe8\x99\xb7\xf5)2"GwI\\\xc1hwX\xa7\xc6\r\xd9\xab"+j\xdc\x08\x07\xf0&\xc1,\x1e"*\xa9\xed\x88\x9b\xf9\xaf\xe9\xe7\x89\xae\xe91\x7f'), chr(100) + '\x65' + '\143' + chr(111) + '\144' + chr(0b1001100 + 0o31))(chr(0b1110101) + '\x74' + chr(0b111101 + 0o51) + chr(0b101101) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'7\xcd\xaf,\x0f~\xea\x1b \xe10\x8b'), '\x64' + chr(101) + chr(8153 - 8054) + chr(0b101101 + 0o102) + '\144' + chr(101))(chr(4844 - 4727) + '\x74' + chr(372 - 270) + chr(0b101101) + chr(2842 - 2786)))(expected=dIInFE0uogSl, actual=wmQmyeWBmUpv(QmmgWUB13VCJ)))
return ehT0Px3KOsy9(chr(2137 - 2089) + '\157' + chr(0b110000), ord("\x08"))
return ehT0Px3KOsy9(chr(48) + '\157' + chr(49), 8)
return HnJAyqLuKsT1
|
awslabs/serverless-application-model
|
samtranslator/model/types.py
|
list_of
|
def list_of(validate_item):
"""Returns a validator function that succeeds only if the input is a list, and each item in the list passes as input
to the provided validator validate_item.
:param callable validate_item: the validator function for items in the list
:returns: a function which returns True its input is an list of valid items, and raises TypeError otherwise
:rtype: callable
"""
def validate(value, should_raise=True):
validate_type = is_type(list)
if not validate_type(value, should_raise=should_raise):
return False
for item in value:
try:
validate_item(item)
except TypeError as e:
if should_raise:
samtranslator.model.exceptions.prepend(e, "list contained an invalid item")
raise
return False
return True
return validate
|
python
|
def list_of(validate_item):
"""Returns a validator function that succeeds only if the input is a list, and each item in the list passes as input
to the provided validator validate_item.
:param callable validate_item: the validator function for items in the list
:returns: a function which returns True its input is an list of valid items, and raises TypeError otherwise
:rtype: callable
"""
def validate(value, should_raise=True):
validate_type = is_type(list)
if not validate_type(value, should_raise=should_raise):
return False
for item in value:
try:
validate_item(item)
except TypeError as e:
if should_raise:
samtranslator.model.exceptions.prepend(e, "list contained an invalid item")
raise
return False
return True
return validate
|
[
"def",
"list_of",
"(",
"validate_item",
")",
":",
"def",
"validate",
"(",
"value",
",",
"should_raise",
"=",
"True",
")",
":",
"validate_type",
"=",
"is_type",
"(",
"list",
")",
"if",
"not",
"validate_type",
"(",
"value",
",",
"should_raise",
"=",
"should_raise",
")",
":",
"return",
"False",
"for",
"item",
"in",
"value",
":",
"try",
":",
"validate_item",
"(",
"item",
")",
"except",
"TypeError",
"as",
"e",
":",
"if",
"should_raise",
":",
"samtranslator",
".",
"model",
".",
"exceptions",
".",
"prepend",
"(",
"e",
",",
"\"list contained an invalid item\"",
")",
"raise",
"return",
"False",
"return",
"True",
"return",
"validate"
] |
Returns a validator function that succeeds only if the input is a list, and each item in the list passes as input
to the provided validator validate_item.
:param callable validate_item: the validator function for items in the list
:returns: a function which returns True its input is an list of valid items, and raises TypeError otherwise
:rtype: callable
|
[
"Returns",
"a",
"validator",
"function",
"that",
"succeeds",
"only",
"if",
"the",
"input",
"is",
"a",
"list",
"and",
"each",
"item",
"in",
"the",
"list",
"passes",
"as",
"input",
"to",
"the",
"provided",
"validator",
"validate_item",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/types.py#L32-L54
|
train
|
Returns a validator function that succeeds only if the input is a list and each item in the list passes as input
.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,N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srOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b110001 + 0o76) + chr(51) + '\060' + chr(0b110100), 53687 - 53679), ehT0Px3KOsy9(chr(1628 - 1580) + chr(0b101101 + 0o102) + chr(0b1011 + 0o46) + chr(0b110000) + chr(0b1111 + 0o43), 0b1000), ehT0Px3KOsy9(chr(1373 - 1325) + chr(0b1101111) + chr(49) + chr(0b100 + 0o63) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\063' + '\x36' + chr(0b100111 + 0o13), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + '\x32' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(53) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(52) + '\x33', 0o10), ehT0Px3KOsy9(chr(2069 - 2021) + chr(0b11101 + 0o122) + chr(51) + chr(0b1000 + 0o52) + chr(0b1100 + 0o53), ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(12269 - 12158) + chr(51) + chr(0b11001 + 0o34) + chr(55), 0o10), ehT0Px3KOsy9('\060' + chr(0b10111 + 0o130) + chr(0b101010 + 0o10) + '\060' + chr(0b100101 + 0o20), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(0b110001) + '\x31', 44636 - 44628), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(6447 - 6336) + chr(1099 - 1050) + chr(0b100001 + 0o21) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(4970 - 4859) + chr(490 - 441) + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5049 - 4938) + '\x31' + '\063' + chr(53), 49421 - 49413), ehT0Px3KOsy9('\x30' + '\157' + '\064' + chr(49), 41380 - 41372), ehT0Px3KOsy9('\060' + chr(0b101110 + 0o101) + chr(0b101010 + 0o10) + '\x30' + chr(0b11 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(1076 - 1027) + chr(0b110101) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000110 + 0o51) + chr(0b110010) + '\061' + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010101 + 0o32) + chr(0b110011) + '\062' + chr(898 - 848), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001110 + 0o41) + chr(0b100100 + 0o16) + chr(0b110010 + 0o4) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101010 + 0o10) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(111) + chr(1184 - 1134) + chr(0b0 + 0o61) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b110111 + 0o70) + chr(1001 - 952) + chr(0b110111) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101101 + 0o5) + chr(0b100001 + 0o24) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001), 19084 - 19076), ehT0Px3KOsy9('\x30' + chr(6470 - 6359) + chr(0b110111) + chr(53), 0b1000), ehT0Px3KOsy9(chr(1939 - 1891) + chr(111) + '\062' + chr(53) + chr(0b11010 + 0o30), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101 + 0o55) + chr(1520 - 1472) + '\066', 0o10), ehT0Px3KOsy9(chr(1906 - 1858) + chr(111) + '\x32' + '\060' + '\061', 8), ehT0Px3KOsy9(chr(1989 - 1941) + chr(111) + chr(0b101000 + 0o12) + '\x32' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2853 - 2798) + chr(0b10001 + 0o43), 31852 - 31844), ehT0Px3KOsy9(chr(1494 - 1446) + chr(7913 - 7802) + '\x35' + chr(2940 - 2885), 57244 - 57236), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b110110) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(48) + '\x31', 0o10), ehT0Px3KOsy9(chr(1634 - 1586) + chr(0b1101111) + '\x32' + chr(49) + '\061', 13598 - 13590), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(0b110111) + '\064', 20473 - 20465), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1101111) + chr(49) + chr(54) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b1001 + 0o52) + chr(0b110011) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(955 - 907) + chr(111) + chr(1448 - 1397) + chr(0b110000) + '\060', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(50) + '\065' + '\x37', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1117 - 1069) + '\x6f' + chr(53) + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xea'), chr(4485 - 4385) + chr(101) + chr(0b1100011) + '\157' + chr(0b1001 + 0o133) + chr(0b1100101))(chr(0b100110 + 0o117) + chr(116) + chr(0b100101 + 0o101) + chr(0b100111 + 0o6) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ec4TyCSN5mHV(wNbI69ZFNL7t):
def HnJAyqLuKsT1(QmmgWUB13VCJ, TqyHm2Pm5Mq5=ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + chr(2094 - 2045), 8)):
CxXLgtuWd2cG = bhRJw4zBnl2n(YyaZ4tpXu4lf)
if not CxXLgtuWd2cG(QmmgWUB13VCJ, should_raise=TqyHm2Pm5Mq5):
return ehT0Px3KOsy9(chr(1593 - 1545) + '\x6f' + chr(48), 0b1000)
for N7j7ePTXzzI0 in QmmgWUB13VCJ:
try:
wNbI69ZFNL7t(N7j7ePTXzzI0)
except sznFqDbNBHlx as GlnVAPeT6CUe:
if TqyHm2Pm5Mq5:
xafqLlk3kkUe(mVlXNJiDNdOK.model.exceptions, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb40\x1e\x82\xf7\x83\xc7'), chr(0b100110 + 0o76) + chr(6102 - 6001) + '\x63' + '\157' + chr(0b1000111 + 0o35) + chr(0b1101 + 0o130))(chr(0b1110011 + 0o2) + chr(0b1110100) + chr(0b11 + 0o143) + chr(45) + chr(328 - 272)))(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8+\x08\x86\xb2\x8e\xcc\xb9\x9b\xe4 8n9\x01\xe0\x04\xaf\xbb\xd9c\xe9\x11\xc5e\x1d\xc3\xf2\xe4\xf8'), '\x64' + chr(101) + '\x63' + chr(0b100111 + 0o110) + chr(100) + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(45) + '\x38'))
raise
return ehT0Px3KOsy9(chr(0b110000) + chr(0b1010000 + 0o37) + chr(1999 - 1951), 8)
return ehT0Px3KOsy9('\x30' + chr(2278 - 2167) + chr(446 - 397), 8)
return HnJAyqLuKsT1
|
awslabs/serverless-application-model
|
samtranslator/model/types.py
|
dict_of
|
def dict_of(validate_key, validate_item):
"""Returns a validator function that succeeds only if the input is a dict, and each key and value in the dict passes
as input to the provided validators validate_key and validate_item, respectively.
:param callable validate_key: the validator function for keys in the dict
:param callable validate_item: the validator function for values in the list
:returns: a function which returns True its input is an dict of valid items, and raises TypeError otherwise
:rtype: callable
"""
def validate(value, should_raise=True):
validate_type = is_type(dict)
if not validate_type(value, should_raise=should_raise):
return False
for key, item in value.items():
try:
validate_key(key)
except TypeError as e:
if should_raise:
samtranslator.model.exceptions.prepend(e, "dict contained an invalid key")
raise
return False
try:
validate_item(item)
except TypeError as e:
if should_raise:
samtranslator.model.exceptions.prepend(e, "dict contained an invalid value")
raise
return False
return True
return validate
|
python
|
def dict_of(validate_key, validate_item):
"""Returns a validator function that succeeds only if the input is a dict, and each key and value in the dict passes
as input to the provided validators validate_key and validate_item, respectively.
:param callable validate_key: the validator function for keys in the dict
:param callable validate_item: the validator function for values in the list
:returns: a function which returns True its input is an dict of valid items, and raises TypeError otherwise
:rtype: callable
"""
def validate(value, should_raise=True):
validate_type = is_type(dict)
if not validate_type(value, should_raise=should_raise):
return False
for key, item in value.items():
try:
validate_key(key)
except TypeError as e:
if should_raise:
samtranslator.model.exceptions.prepend(e, "dict contained an invalid key")
raise
return False
try:
validate_item(item)
except TypeError as e:
if should_raise:
samtranslator.model.exceptions.prepend(e, "dict contained an invalid value")
raise
return False
return True
return validate
|
[
"def",
"dict_of",
"(",
"validate_key",
",",
"validate_item",
")",
":",
"def",
"validate",
"(",
"value",
",",
"should_raise",
"=",
"True",
")",
":",
"validate_type",
"=",
"is_type",
"(",
"dict",
")",
"if",
"not",
"validate_type",
"(",
"value",
",",
"should_raise",
"=",
"should_raise",
")",
":",
"return",
"False",
"for",
"key",
",",
"item",
"in",
"value",
".",
"items",
"(",
")",
":",
"try",
":",
"validate_key",
"(",
"key",
")",
"except",
"TypeError",
"as",
"e",
":",
"if",
"should_raise",
":",
"samtranslator",
".",
"model",
".",
"exceptions",
".",
"prepend",
"(",
"e",
",",
"\"dict contained an invalid key\"",
")",
"raise",
"return",
"False",
"try",
":",
"validate_item",
"(",
"item",
")",
"except",
"TypeError",
"as",
"e",
":",
"if",
"should_raise",
":",
"samtranslator",
".",
"model",
".",
"exceptions",
".",
"prepend",
"(",
"e",
",",
"\"dict contained an invalid value\"",
")",
"raise",
"return",
"False",
"return",
"True",
"return",
"validate"
] |
Returns a validator function that succeeds only if the input is a dict, and each key and value in the dict passes
as input to the provided validators validate_key and validate_item, respectively.
:param callable validate_key: the validator function for keys in the dict
:param callable validate_item: the validator function for values in the list
:returns: a function which returns True its input is an dict of valid items, and raises TypeError otherwise
:rtype: callable
|
[
"Returns",
"a",
"validator",
"function",
"that",
"succeeds",
"only",
"if",
"the",
"input",
"is",
"a",
"dict",
"and",
"each",
"key",
"and",
"value",
"in",
"the",
"dict",
"passes",
"as",
"input",
"to",
"the",
"provided",
"validators",
"validate_key",
"and",
"validate_item",
"respectively",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/types.py#L57-L88
|
train
|
Returns a validator function that succeeds only if the input is a dict and each key and value in the dict passes validate_key and validate_item respectively.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GX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S9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10011 + 0o37) + '\x30' + chr(0b10 + 0o61), 0o10), ehT0Px3KOsy9(chr(483 - 435) + chr(0b10110 + 0o131) + '\x32' + '\x30' + chr(0b10000 + 0o47), 23839 - 23831), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + '\061' + '\x36' + chr(0b101110 + 0o3), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001010 + 0o45) + chr(1008 - 958) + '\066' + chr(0b10110 + 0o37), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5379 - 5268) + chr(0b10011 + 0o40) + chr(0b1011 + 0o47) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(50) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\065' + chr(0b10010 + 0o41), 52835 - 52827), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + '\x31' + chr(0b110110) + '\x33', 21049 - 21041), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(0b1011 + 0o47) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b10110 + 0o35) + chr(54) + '\061', 40740 - 40732), ehT0Px3KOsy9(chr(1336 - 1288) + '\x6f' + '\x33' + chr(0b110001) + '\062', 54028 - 54020), ehT0Px3KOsy9(chr(1366 - 1318) + chr(0b1101111) + chr(0b110101), 1024 - 1016), ehT0Px3KOsy9(chr(48) + chr(2317 - 2206) + chr(0b110010) + chr(2148 - 2096) + chr(0b1010 + 0o54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6573 - 6462) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(348 - 298) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(2266 - 2155) + chr(51) + chr(637 - 583) + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(0b100000 + 0o117) + chr(51) + '\060', 32914 - 32906), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100100 + 0o22) + '\065', 39089 - 39081), ehT0Px3KOsy9(chr(48) + chr(6342 - 6231) + chr(51) + chr(2634 - 2580) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(775 - 725) + '\062' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(815 - 767) + '\157' + chr(50) + chr(52) + chr(2138 - 2089), 0b1000), ehT0Px3KOsy9(chr(2136 - 2088) + chr(0b1101111) + '\063' + chr(2497 - 2442) + chr(2026 - 1974), 36188 - 36180), ehT0Px3KOsy9(chr(1090 - 1042) + chr(111) + chr(0b110001 + 0o0) + chr(2034 - 1982) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b111 + 0o150) + chr(1385 - 1334) + chr(1318 - 1267) + chr(536 - 485), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011111 + 0o20) + chr(51) + chr(0b111 + 0o60) + '\064', 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(1796 - 1746) + chr(0b10111 + 0o31), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\062' + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + '\x33' + '\062' + chr(0b10010 + 0o37), 265 - 257), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(7926 - 7815) + '\x35' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(816 - 768) + '\x6f' + '\063' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(7663 - 7552) + '\063' + chr(0b1001 + 0o51) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(0b101110 + 0o2) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(10937 - 10826) + chr(50) + chr(54) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\x6f' + chr(0b110011) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(0b110000) + chr(0b11110 + 0o27), 7060 - 7052), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(564 - 515) + chr(2122 - 2068) + chr(0b110011), 8), ehT0Px3KOsy9('\060' + chr(0b1000111 + 0o50) + chr(509 - 457) + chr(840 - 788), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5782 - 5671) + '\x31' + chr(0b110110 + 0o1) + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + '\062' + chr(0b110011), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1001101 + 0o42) + chr(0b110101) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xad'), chr(0b1011011 + 0o11) + chr(101) + chr(7829 - 7730) + chr(111) + '\x64' + '\145')(chr(0b1110101) + '\164' + '\x66' + chr(342 - 297) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def M_QX33IsIU1U(NO3RDfbPPwfl, wNbI69ZFNL7t):
def HnJAyqLuKsT1(QmmgWUB13VCJ, TqyHm2Pm5Mq5=ehT0Px3KOsy9(chr(1087 - 1039) + '\157' + chr(0b110001), 0o10)):
CxXLgtuWd2cG = bhRJw4zBnl2n(wLqBDw8l0eIm)
if not CxXLgtuWd2cG(QmmgWUB13VCJ, should_raise=TqyHm2Pm5Mq5):
return ehT0Px3KOsy9(chr(48) + chr(3220 - 3109) + '\x30', ord("\x08"))
for (K3J4ZwSlE0sT, N7j7ePTXzzI0) in xafqLlk3kkUe(QmmgWUB13VCJ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd\xfd\x07\xd0A\x8d\xe5"\x1f\xc4\xb9\xf3'), chr(0b1011100 + 0o10) + '\145' + chr(0b1101 + 0o126) + '\x6f' + chr(233 - 133) + chr(2373 - 2272))(chr(117) + chr(116) + chr(201 - 99) + chr(745 - 700) + '\x38'))():
try:
NO3RDfbPPwfl(K3J4ZwSlE0sT)
except sznFqDbNBHlx as GlnVAPeT6CUe:
if TqyHm2Pm5Mq5:
xafqLlk3kkUe(mVlXNJiDNdOK.model.exceptions, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3\xf5\x14\xc5m\xb9\xb2'), chr(100) + '\x65' + chr(99) + '\x6f' + chr(0b1100100 + 0o0) + chr(5146 - 5045))(chr(0b1110101) + chr(0b1001 + 0o153) + '\146' + '\055' + '\070'))(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe7\xee\x12\xc1(\xb4\xb9\x05\x07\xf6\x98\xa4`\xc2#v\x9c8\\\x9b\xe3\xc0\x90\t\xbf\xdc\xfb\xb1\xa8'), chr(100) + '\145' + chr(4288 - 4189) + chr(9960 - 9849) + '\x64' + chr(0b1100101 + 0o0))(chr(117) + chr(0b10111 + 0o135) + '\146' + '\055' + '\x38'))
raise
return ehT0Px3KOsy9(chr(48) + chr(1863 - 1752) + chr(48), 8)
try:
wNbI69ZFNL7t(N7j7ePTXzzI0)
except sznFqDbNBHlx as GlnVAPeT6CUe:
if TqyHm2Pm5Mq5:
xafqLlk3kkUe(mVlXNJiDNdOK.model.exceptions, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3\xf5\x14\xc5m\xb9\xb2'), chr(100) + chr(1175 - 1074) + '\x63' + '\x6f' + chr(0b1110 + 0o126) + chr(6950 - 6849))(chr(0b110 + 0o157) + chr(7434 - 7318) + '\146' + chr(45) + '\070'))(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe7\xee\x12\xc1(\xb4\xb9\x05\x07\xf6\x98\xa4`\xc2#v\x9c8\\\x9b\xe3\xc0\x90\t\xbf\xdc\xe6\xb5\xbdYz'), chr(7696 - 7596) + chr(101) + chr(0b1000 + 0o133) + chr(0b101001 + 0o106) + '\x64' + chr(9111 - 9010))(chr(117) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(56)))
raise
return ehT0Px3KOsy9(chr(48) + chr(471 - 360) + '\x30', 8)
return ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\x6f' + chr(0b10101 + 0o34), 8)
return HnJAyqLuKsT1
|
awslabs/serverless-application-model
|
samtranslator/model/types.py
|
one_of
|
def one_of(*validators):
"""Returns a validator function that succeeds only if the input passes at least one of the provided validators.
:param callable validators: the validator functions
:returns: a function which returns True its input passes at least one of the validators, and raises TypeError
otherwise
:rtype: callable
"""
def validate(value, should_raise=True):
if any(validate(value, should_raise=False) for validate in validators):
return True
if should_raise:
raise TypeError("value did not match any allowable type")
return False
return validate
|
python
|
def one_of(*validators):
"""Returns a validator function that succeeds only if the input passes at least one of the provided validators.
:param callable validators: the validator functions
:returns: a function which returns True its input passes at least one of the validators, and raises TypeError
otherwise
:rtype: callable
"""
def validate(value, should_raise=True):
if any(validate(value, should_raise=False) for validate in validators):
return True
if should_raise:
raise TypeError("value did not match any allowable type")
return False
return validate
|
[
"def",
"one_of",
"(",
"*",
"validators",
")",
":",
"def",
"validate",
"(",
"value",
",",
"should_raise",
"=",
"True",
")",
":",
"if",
"any",
"(",
"validate",
"(",
"value",
",",
"should_raise",
"=",
"False",
")",
"for",
"validate",
"in",
"validators",
")",
":",
"return",
"True",
"if",
"should_raise",
":",
"raise",
"TypeError",
"(",
"\"value did not match any allowable type\"",
")",
"return",
"False",
"return",
"validate"
] |
Returns a validator function that succeeds only if the input passes at least one of the provided validators.
:param callable validators: the validator functions
:returns: a function which returns True its input passes at least one of the validators, and raises TypeError
otherwise
:rtype: callable
|
[
"Returns",
"a",
"validator",
"function",
"that",
"succeeds",
"only",
"if",
"the",
"input",
"passes",
"at",
"least",
"one",
"of",
"the",
"provided",
"validators",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/types.py#L91-L106
|
train
|
Returns a validator function that succeeds only if the input passes at least one of the provided validators.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoy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x4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(491 - 441) + chr(55) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010100 + 0o33) + chr(2295 - 2246) + chr(2064 - 2012) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001011 + 0o44) + '\061' + '\x34' + chr(0b10111 + 0o31), 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(6242 - 6131) + '\063' + chr(1002 - 947) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(7282 - 7171) + '\061' + chr(0b110110) + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(53) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b101000 + 0o107) + chr(0b0 + 0o65) + chr(0b110110), 56256 - 56248), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(132 - 84), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001110 + 0o41) + chr(0b100010 + 0o17) + chr(0b11010 + 0o31) + '\062', 43431 - 43423), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110100) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000000 + 0o57) + chr(0b10010 + 0o37) + chr(0b110101) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(2214 - 2160) + chr(1641 - 1586), 25071 - 25063), ehT0Px3KOsy9(chr(1866 - 1818) + chr(10157 - 10046) + '\x33' + '\x36' + chr(794 - 742), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(51) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101101 + 0o5) + chr(0b1110 + 0o51) + chr(0b101011 + 0o11), 11704 - 11696), ehT0Px3KOsy9('\060' + chr(0b111001 + 0o66) + '\061' + chr(0b11001 + 0o31) + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101001 + 0o10) + '\061' + chr(0b1011 + 0o47), 31606 - 31598), ehT0Px3KOsy9('\x30' + '\157' + '\061' + '\x30' + '\063', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(0b110000) + chr(0b110010 + 0o4), 9848 - 9840), ehT0Px3KOsy9('\060' + chr(0b100001 + 0o116) + chr(0b101110 + 0o7) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\063' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(6947 - 6836) + '\x31' + chr(51) + '\x31', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + '\063' + chr(50), 63695 - 63687), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(1298 - 1248) + '\064', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(52) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + '\065' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(111) + '\067' + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1197 - 1147) + '\x35', 8), ehT0Px3KOsy9(chr(398 - 350) + chr(9685 - 9574) + '\061' + chr(0b110111) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\x6f' + chr(0b1 + 0o65) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + '\064' + '\062', 5441 - 5433), ehT0Px3KOsy9(chr(0b110000) + chr(6141 - 6030) + chr(0b110001) + '\065' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1111 + 0o140) + '\061' + chr(0b100100 + 0o14) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + chr(0b1000 + 0o51) + chr(0b100100 + 0o16) + chr(130 - 81), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(2290 - 2239) + chr(0b110 + 0o54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11010 + 0o125) + chr(789 - 740) + chr(0b110001) + '\062', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100110 + 0o20) + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1152 - 1102) + chr(0b110101) + chr(856 - 804), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(55) + chr(952 - 902), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(538 - 427) + chr(53) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x93'), '\x64' + '\145' + '\143' + chr(7217 - 7106) + chr(0b0 + 0o144) + '\x65')(chr(117) + chr(0b1110100) + chr(0b101001 + 0o75) + chr(0b101101) + chr(0b11000 + 0o40)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def miZ_f3LxGjdq(*fMw8MZNCpULM):
def HnJAyqLuKsT1(QmmgWUB13VCJ, TqyHm2Pm5Mq5=ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31', ord("\x08"))):
if UVSi4XW7eBIM((HnJAyqLuKsT1(QmmgWUB13VCJ, should_raise=ehT0Px3KOsy9(chr(0b110000) + chr(0b11010 + 0o125) + chr(0b101001 + 0o7), 8)) for HnJAyqLuKsT1 in fMw8MZNCpULM)):
return ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1215 - 1166), 8)
if TqyHm2Pm5Mq5:
raise sznFqDbNBHlx(xafqLlk3kkUe(SXOLrMavuUCe(b'\xcb\x04\x0c\x89\x14OJi>F\x06\x18\x80\xb9\xd16> \xae\r87\xe35\xb5\xc8\x02Vb\x1bP\xce\x0ee%c:R'), '\144' + chr(0b110110 + 0o57) + chr(99) + '\x6f' + chr(0b1100100) + chr(0b101001 + 0o74))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b101101) + '\x38'))
return ehT0Px3KOsy9(chr(872 - 824) + chr(111) + chr(0b101100 + 0o4), 8)
return HnJAyqLuKsT1
|
awslabs/serverless-application-model
|
samtranslator/policy_template_processor/template.py
|
Template.to_statement
|
def to_statement(self, parameter_values):
"""
With the given values for each parameter, this method will return a policy statement that can be used
directly with IAM.
:param dict parameter_values: Dict containing values for each parameter defined in the template
:return dict: Dictionary containing policy statement
:raises InvalidParameterValues: If parameter values is not a valid dictionary or does not contain values
for all parameters
:raises InsufficientParameterValues: If the parameter values don't have values for all required parameters
"""
missing = self.missing_parameter_values(parameter_values)
if len(missing) > 0:
# str() of elements of list to prevent any `u` prefix from being displayed in user-facing error message
raise InsufficientParameterValues("Following required parameters of template '{}' don't have values: {}"
.format(self.name, [str(m) for m in missing]))
# Select only necessary parameter_values. this is to prevent malicious or accidental
# injection of values for parameters not intended in the template. This is important because "Ref" resolution
# will substitute any references for which a value is provided.
necessary_parameter_values = {name: value for name, value in parameter_values.items()
if name in self.parameters}
# Only "Ref" is supported
supported_intrinsics = {
RefAction.intrinsic_name: RefAction()
}
resolver = IntrinsicsResolver(necessary_parameter_values, supported_intrinsics)
definition_copy = copy.deepcopy(self.definition)
return resolver.resolve_parameter_refs(definition_copy)
|
python
|
def to_statement(self, parameter_values):
"""
With the given values for each parameter, this method will return a policy statement that can be used
directly with IAM.
:param dict parameter_values: Dict containing values for each parameter defined in the template
:return dict: Dictionary containing policy statement
:raises InvalidParameterValues: If parameter values is not a valid dictionary or does not contain values
for all parameters
:raises InsufficientParameterValues: If the parameter values don't have values for all required parameters
"""
missing = self.missing_parameter_values(parameter_values)
if len(missing) > 0:
# str() of elements of list to prevent any `u` prefix from being displayed in user-facing error message
raise InsufficientParameterValues("Following required parameters of template '{}' don't have values: {}"
.format(self.name, [str(m) for m in missing]))
# Select only necessary parameter_values. this is to prevent malicious or accidental
# injection of values for parameters not intended in the template. This is important because "Ref" resolution
# will substitute any references for which a value is provided.
necessary_parameter_values = {name: value for name, value in parameter_values.items()
if name in self.parameters}
# Only "Ref" is supported
supported_intrinsics = {
RefAction.intrinsic_name: RefAction()
}
resolver = IntrinsicsResolver(necessary_parameter_values, supported_intrinsics)
definition_copy = copy.deepcopy(self.definition)
return resolver.resolve_parameter_refs(definition_copy)
|
[
"def",
"to_statement",
"(",
"self",
",",
"parameter_values",
")",
":",
"missing",
"=",
"self",
".",
"missing_parameter_values",
"(",
"parameter_values",
")",
"if",
"len",
"(",
"missing",
")",
">",
"0",
":",
"# str() of elements of list to prevent any `u` prefix from being displayed in user-facing error message",
"raise",
"InsufficientParameterValues",
"(",
"\"Following required parameters of template '{}' don't have values: {}\"",
".",
"format",
"(",
"self",
".",
"name",
",",
"[",
"str",
"(",
"m",
")",
"for",
"m",
"in",
"missing",
"]",
")",
")",
"# Select only necessary parameter_values. this is to prevent malicious or accidental",
"# injection of values for parameters not intended in the template. This is important because \"Ref\" resolution",
"# will substitute any references for which a value is provided.",
"necessary_parameter_values",
"=",
"{",
"name",
":",
"value",
"for",
"name",
",",
"value",
"in",
"parameter_values",
".",
"items",
"(",
")",
"if",
"name",
"in",
"self",
".",
"parameters",
"}",
"# Only \"Ref\" is supported",
"supported_intrinsics",
"=",
"{",
"RefAction",
".",
"intrinsic_name",
":",
"RefAction",
"(",
")",
"}",
"resolver",
"=",
"IntrinsicsResolver",
"(",
"necessary_parameter_values",
",",
"supported_intrinsics",
")",
"definition_copy",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
".",
"definition",
")",
"return",
"resolver",
".",
"resolve_parameter_refs",
"(",
"definition_copy",
")"
] |
With the given values for each parameter, this method will return a policy statement that can be used
directly with IAM.
:param dict parameter_values: Dict containing values for each parameter defined in the template
:return dict: Dictionary containing policy statement
:raises InvalidParameterValues: If parameter values is not a valid dictionary or does not contain values
for all parameters
:raises InsufficientParameterValues: If the parameter values don't have values for all required parameters
|
[
"With",
"the",
"given",
"values",
"for",
"each",
"parameter",
"this",
"method",
"will",
"return",
"a",
"policy",
"statement",
"that",
"can",
"be",
"used",
"directly",
"with",
"IAM",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/policy_template_processor/template.py#L30-L62
|
train
|
Returns a dictionary containing the values for each parameter in the template that can be used by IAM.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,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6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + chr(0b110011) + chr(0b100011 + 0o15) + chr(412 - 361), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110110) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(150 - 102) + chr(0b1101111) + '\x32' + chr(0b100111 + 0o13) + '\063', 54406 - 54398), ehT0Px3KOsy9('\060' + chr(0b1010110 + 0o31) + '\x31' + '\x30' + chr(0b110000 + 0o1), 13168 - 13160), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + '\x31' + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100011 + 0o17) + chr(0b110000) + chr(0b110110), 10704 - 10696), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + '\x30' + chr(1088 - 1038), 0o10), ehT0Px3KOsy9(chr(985 - 937) + chr(12157 - 12046) + chr(0b110010) + chr(0b110100) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + chr(0b110010) + chr(0b10111 + 0o31) + chr(50), 46068 - 46060), ehT0Px3KOsy9('\060' + chr(111) + chr(0b111 + 0o56) + chr(1403 - 1353), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(0b110010) + '\x36' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(99 - 49) + chr(0b100 + 0o55) + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(1205 - 1153) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10010 + 0o135) + '\x31' + chr(54) + '\x34', 24915 - 24907), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(52) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(0b101011 + 0o7) + '\x36', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b110101) + chr(49), 51825 - 51817), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(55) + chr(51), 0o10), ehT0Px3KOsy9('\060' + chr(2628 - 2517) + chr(0b101 + 0o55) + chr(0b110011) + chr(447 - 393), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(356 - 301) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(494 - 441), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(0b110011) + chr(0b110110), 8), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(0b11110 + 0o27), 8), ehT0Px3KOsy9(chr(1740 - 1692) + '\x6f' + chr(0b1 + 0o60) + chr(48) + chr(0b10000 + 0o42), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\062' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(0b110011 + 0o3) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100011 + 0o114) + chr(0b10101 + 0o35) + chr(50) + chr(0b110100), 25691 - 25683), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1857 - 1808) + '\062' + chr(0b110000 + 0o0), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(8659 - 8548) + chr(53) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b101110 + 0o10) + chr(0b1001 + 0o50), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1000 + 0o147) + chr(0b10100 + 0o35) + chr(0b100110 + 0o12) + chr(0b101011 + 0o7), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(1539 - 1490) + chr(0b110010) + chr(1005 - 951), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3787 - 3676) + '\063' + chr(0b101100 + 0o6) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1000100 + 0o53) + chr(0b110111) + chr(0b10000 + 0o46), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1838 - 1784) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(51) + chr(55), 4700 - 4692), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + '\067' + chr(1463 - 1410), ord("\x08")), ehT0Px3KOsy9(chr(498 - 450) + '\x6f' + '\x32' + chr(319 - 270) + chr(0b10010 + 0o43), 55276 - 55268), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\064' + chr(0b110010), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101101 + 0o2) + chr(0b101100 + 0o11) + chr(1780 - 1732), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xed'), chr(100) + chr(101) + chr(0b101101 + 0o66) + '\x6f' + chr(0b10101 + 0o117) + '\x65')('\165' + '\164' + chr(5411 - 5309) + chr(0b101101) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def MGbY051ak4NW(oVre8I6UXc3b, PPceYe5Mkdxr):
XO3DPCTKfaWs = oVre8I6UXc3b.missing_parameter_values(PPceYe5Mkdxr)
if c2A0yzQpDQB3(XO3DPCTKfaWs) > ehT0Px3KOsy9(chr(745 - 697) + '\157' + '\060', 0o10):
raise UcDcxasz3cn2(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x85_\xff-\xa1\xf1+\xcf\xe5\n\xc7\xedR\x01\x0b\xe4\xcc\xdf\xbeHt\xect/c\xe1\x13\xe6#\x0c\x9e$v\xa3[_/\x11\xec\xd6\xa6\x10\xb4:\xb3\xa1b\xc5\xedD\x92\xfc\x03\x1c\x03\xe0\xcc\x9b\xe8Yy\xebp1<\xb5\r\xe9'), chr(0b1001101 + 0o27) + '\x65' + chr(0b1110 + 0o125) + chr(0b1011111 + 0o20) + chr(100) + '\145')(chr(0b1110101) + chr(2044 - 1928) + chr(0b1000110 + 0o40) + chr(1572 - 1527) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x95\x04\xe1.\x86\xe7\x11\x92\xd2Z\xd0\xe2'), chr(100) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(3336 - 3235))(chr(7620 - 7503) + '\164' + chr(102) + chr(0b1 + 0o54) + '\070'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82y\xe5\x0b\x9c\xfc\x0e\xc5\xc6L\xd2\xce'), '\x64' + '\145' + '\x63' + chr(111) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(116) + '\x66' + chr(0b101101) + chr(977 - 921))), [M8_cKLkHVB2V(r8ufID9JCHnI) for r8ufID9JCHnI in XO3DPCTKfaWs]))
RLyvKzNkA5vx = {AIvJRzLdDfgF: QmmgWUB13VCJ for (AIvJRzLdDfgF, QmmgWUB13VCJ) in PPceYe5Mkdxr.NzveIZ3IlSH9() if AIvJRzLdDfgF in oVre8I6UXc3b.parameters}
u_6E7KbSOYCK = {o3aZ6aZKhMt9.intrinsic_name: o3aZ6aZKhMt9()}
Tzg1m6NDO1Cq = Ie_QGVddKhNC(RLyvKzNkA5vx, u_6E7KbSOYCK)
Vfe0hlA6Ouo_ = igThHS4jwVsa.deepcopy(oVre8I6UXc3b.definition)
return xafqLlk3kkUe(Tzg1m6NDO1Cq, xafqLlk3kkUe(SXOLrMavuUCe(b"\xb1U\xe0.\xa2\xf0'\xfe\xf2K\xc7\xe9N\x11\x16\xf3\xdb\xe4\xec]s\xed"), chr(0b10110 + 0o116) + '\x65' + chr(0b1100011) + '\157' + '\x64' + '\x65')(chr(0b1101 + 0o150) + chr(12087 - 11971) + chr(4759 - 4657) + chr(45) + chr(0b111000)))(Vfe0hlA6Ouo_)
|
awslabs/serverless-application-model
|
samtranslator/policy_template_processor/template.py
|
Template.missing_parameter_values
|
def missing_parameter_values(self, parameter_values):
"""
Checks if the given input contains values for all parameters used by this template
:param dict parameter_values: Dictionary of values for each parameter used in the template
:return list: List of names of parameters that are missing.
:raises InvalidParameterValues: When parameter values is not a valid dictionary
"""
if not self._is_valid_parameter_values(parameter_values):
raise InvalidParameterValues("Parameter values are required to process a policy template")
return list(set(self.parameters.keys()) - set(parameter_values.keys()))
|
python
|
def missing_parameter_values(self, parameter_values):
"""
Checks if the given input contains values for all parameters used by this template
:param dict parameter_values: Dictionary of values for each parameter used in the template
:return list: List of names of parameters that are missing.
:raises InvalidParameterValues: When parameter values is not a valid dictionary
"""
if not self._is_valid_parameter_values(parameter_values):
raise InvalidParameterValues("Parameter values are required to process a policy template")
return list(set(self.parameters.keys()) - set(parameter_values.keys()))
|
[
"def",
"missing_parameter_values",
"(",
"self",
",",
"parameter_values",
")",
":",
"if",
"not",
"self",
".",
"_is_valid_parameter_values",
"(",
"parameter_values",
")",
":",
"raise",
"InvalidParameterValues",
"(",
"\"Parameter values are required to process a policy template\"",
")",
"return",
"list",
"(",
"set",
"(",
"self",
".",
"parameters",
".",
"keys",
"(",
")",
")",
"-",
"set",
"(",
"parameter_values",
".",
"keys",
"(",
")",
")",
")"
] |
Checks if the given input contains values for all parameters used by this template
:param dict parameter_values: Dictionary of values for each parameter used in the template
:return list: List of names of parameters that are missing.
:raises InvalidParameterValues: When parameter values is not a valid dictionary
|
[
"Checks",
"if",
"the",
"given",
"input",
"contains",
"values",
"for",
"all",
"parameters",
"used",
"by",
"this",
"template"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/policy_template_processor/template.py#L64-L76
|
train
|
Checks if the given input contains values for all parameters used by this template and returns a list of names that are missing.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,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,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101 + 0o54) + '\x30' + chr(0b100000 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(1629 - 1581) + '\x6f' + '\x31' + chr(0b110000) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(2273 - 2220) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4743 - 4632) + '\x31' + '\060' + '\067', 9435 - 9427), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + '\x33' + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(760 - 711) + chr(53) + chr(1220 - 1166), 0b1000), ehT0Px3KOsy9(chr(1868 - 1820) + chr(3557 - 3446) + chr(0b101010 + 0o10) + '\064' + chr(0b1111 + 0o44), 43904 - 43896), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(48) + '\067', 8), ehT0Px3KOsy9('\060' + chr(0b1000 + 0o147) + chr(0b111 + 0o57) + '\x31', 37446 - 37438), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + '\062' + chr(0b10010 + 0o42), 0o10), ehT0Px3KOsy9(chr(2182 - 2134) + chr(0b11101 + 0o122) + '\x32' + chr(718 - 665) + chr(0b10111 + 0o33), 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\x6f' + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\064' + chr(0b11001 + 0o35), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101011 + 0o7) + '\063' + chr(50), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + '\x34' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5769 - 5658) + chr(0b110010) + chr(0b1111 + 0o50) + chr(0b100 + 0o54), 24668 - 24660), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(0b110110) + chr(0b110010), 2289 - 2281), ehT0Px3KOsy9(chr(0b110000) + chr(0b111011 + 0o64) + chr(55) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(8597 - 8486) + '\x32' + chr(48) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(0b1 + 0o62) + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(404 - 355) + chr(50), 45125 - 45117), ehT0Px3KOsy9(chr(685 - 637) + chr(4370 - 4259) + '\064', 20934 - 20926), ehT0Px3KOsy9(chr(1412 - 1364) + '\x6f' + chr(50) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(0b100101 + 0o15) + '\060' + '\065', 0b1000), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + '\062' + chr(1540 - 1489) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(11715 - 11604) + '\063', 8), ehT0Px3KOsy9(chr(962 - 914) + chr(111) + chr(51) + chr(0b110010) + chr(0b100101 + 0o15), 0o10), ehT0Px3KOsy9('\060' + chr(597 - 486) + chr(1911 - 1861) + chr(0b101001 + 0o10) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2547 - 2496) + chr(52) + chr(1428 - 1377), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b10000 + 0o45), 46458 - 46450), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(48) + chr(0b100100 + 0o15), 0b1000), ehT0Px3KOsy9(chr(1456 - 1408) + '\157' + '\x31' + chr(0b1010 + 0o46), 63978 - 63970), ehT0Px3KOsy9(chr(1814 - 1766) + chr(111) + chr(0b110011) + '\x36' + chr(418 - 367), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(0b10000 + 0o41) + chr(0b100101 + 0o15), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + '\060' + '\061', 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1157 - 1107) + '\x33' + '\067', 8), ehT0Px3KOsy9(chr(2031 - 1983) + '\x6f' + '\062' + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x37' + chr(410 - 361), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100011 + 0o20) + '\064' + chr(0b100110 + 0o16), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110111 + 0o70) + '\x32' + '\x35' + chr(0b110011), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(79 - 31) + chr(0b1100000 + 0o17) + '\065' + chr(0b1111 + 0o41), 38282 - 38274)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'o'), chr(0b0 + 0o144) + '\x65' + chr(0b1100011) + '\157' + chr(100) + chr(0b1100001 + 0o4))(chr(0b1001101 + 0o50) + chr(0b1100101 + 0o17) + chr(7981 - 7879) + '\055' + chr(0b101011 + 0o15)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Yjzu6966GbsK(oVre8I6UXc3b, PPceYe5Mkdxr):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e*\x98\x18\xed\x0f\xcf.U\x8b\xdabT\xfb\n\xdd\x06[\xf2\x05<ey\xf0\xfap'), '\x64' + chr(101) + '\x63' + '\157' + chr(0b1100100) + chr(0b100011 + 0o102))(chr(6054 - 5937) + '\x74' + chr(0b1100110) + chr(1157 - 1112) + chr(56)))(PPceYe5Mkdxr):
raise ximFfMoqQjty(xafqLlk3kkUe(SXOLrMavuUCe(b'\x11"\x99&\xf6\x0b\xd7"C\xf4\xdcbJ\xef\x02\xcbR_\xf2?jvp\xf4\xeaj\xa0\xe8\x87=\xb5g\xd3\xba3\xf0p\\\x97\xd8a"\xcb7\xf4\x02\xca$H\xf4\xdefK\xea\x0b\xd9\x06['), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + '\157' + '\x64' + chr(101))(chr(0b1001 + 0o154) + chr(0b1110100) + chr(0b1100110) + '\x2d' + chr(0b111000)))
return YyaZ4tpXu4lf(MVEN8G6CxlvR(xafqLlk3kkUe(oVre8I6UXc3b.parameters, xafqLlk3kkUe(SXOLrMavuUCe(b'*&\x924'), chr(0b1100100) + '\x65' + chr(227 - 128) + chr(111) + chr(0b1100100) + chr(101))(chr(1182 - 1065) + '\x74' + '\x66' + chr(0b11000 + 0o25) + '\x38'))()) - MVEN8G6CxlvR(xafqLlk3kkUe(PPceYe5Mkdxr, xafqLlk3kkUe(SXOLrMavuUCe(b'*&\x924'), chr(0b1100100) + '\x65' + chr(0b11111 + 0o104) + '\x6f' + '\x64' + '\x65')(chr(4918 - 4801) + chr(0b1110100) + chr(0b1001010 + 0o34) + chr(193 - 148) + chr(0b111000)))()))
|
awslabs/serverless-application-model
|
samtranslator/policy_template_processor/template.py
|
Template.from_dict
|
def from_dict(template_name, template_values_dict):
"""
Parses the input and returns an instance of this class.
:param string template_name: Name of the template
:param dict template_values_dict: Dictionary containing the value of the template. This dict must have passed
the JSON Schema validation.
:return Template: Instance of this class containing the values provided in this dictionary
"""
parameters = template_values_dict.get("Parameters", {})
definition = template_values_dict.get("Definition", {})
return Template(template_name, parameters, definition)
|
python
|
def from_dict(template_name, template_values_dict):
"""
Parses the input and returns an instance of this class.
:param string template_name: Name of the template
:param dict template_values_dict: Dictionary containing the value of the template. This dict must have passed
the JSON Schema validation.
:return Template: Instance of this class containing the values provided in this dictionary
"""
parameters = template_values_dict.get("Parameters", {})
definition = template_values_dict.get("Definition", {})
return Template(template_name, parameters, definition)
|
[
"def",
"from_dict",
"(",
"template_name",
",",
"template_values_dict",
")",
":",
"parameters",
"=",
"template_values_dict",
".",
"get",
"(",
"\"Parameters\"",
",",
"{",
"}",
")",
"definition",
"=",
"template_values_dict",
".",
"get",
"(",
"\"Definition\"",
",",
"{",
"}",
")",
"return",
"Template",
"(",
"template_name",
",",
"parameters",
",",
"definition",
")"
] |
Parses the input and returns an instance of this class.
:param string template_name: Name of the template
:param dict template_values_dict: Dictionary containing the value of the template. This dict must have passed
the JSON Schema validation.
:return Template: Instance of this class containing the values provided in this dictionary
|
[
"Parses",
"the",
"input",
"and",
"returns",
"an",
"instance",
"of",
"this",
"class",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/policy_template_processor/template.py#L102-L115
|
train
|
Parses the input and returns an instance of this class containing the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v33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(257 - 206) + '\066', 37445 - 37437), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10000 + 0o46) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b111001 + 0o66) + '\062' + chr(50) + '\063', 0o10), ehT0Px3KOsy9('\060' + chr(1994 - 1883) + '\062' + chr(55) + '\x33', 61458 - 61450), ehT0Px3KOsy9('\x30' + chr(1440 - 1329) + '\063' + '\x33' + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x36' + chr(0b10110 + 0o36), 8), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(3688 - 3577) + chr(50) + chr(696 - 647) + chr(0b110110), 5900 - 5892), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b100000 + 0o21) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + '\063' + '\063' + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(0b101100 + 0o103) + chr(0b110100) + chr(0b101001 + 0o13), 60958 - 60950), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(0b100110 + 0o21) + chr(0b110011), 8), ehT0Px3KOsy9(chr(1745 - 1697) + chr(9356 - 9245) + chr(0b101110 + 0o5) + chr(950 - 899) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(156 - 106) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101 + 0o55) + chr(389 - 335) + chr(0b1011 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101010 + 0o14) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7993 - 7882) + chr(54) + chr(0b110001 + 0o6), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(0b110 + 0o52), 56097 - 56089), ehT0Px3KOsy9(chr(520 - 472) + '\157' + '\x31' + chr(0b11010 + 0o27) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1010110 + 0o31) + chr(0b100101 + 0o15) + chr(0b101000 + 0o17) + '\x30', 47196 - 47188), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\x31', 0o10), ehT0Px3KOsy9('\x30' + chr(6373 - 6262) + '\x35' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1352 - 1301) + chr(107 - 59) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101000 + 0o13) + chr(55) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b11010 + 0o27) + chr(1928 - 1877), 0b1000), ehT0Px3KOsy9(chr(1302 - 1254) + chr(0b110100 + 0o73) + '\x34' + '\062', 8838 - 8830), ehT0Px3KOsy9(chr(0b110000) + chr(8129 - 8018) + chr(0b10101 + 0o36) + '\x35' + chr(0b110000 + 0o0), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6534 - 6423) + chr(0b110001) + '\x32' + chr(2032 - 1977), 53417 - 53409), ehT0Px3KOsy9('\x30' + chr(0b1 + 0o156) + chr(1101 - 1050) + chr(0b110101) + chr(2090 - 2036), 63518 - 63510), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1010011 + 0o34) + chr(0b1010 + 0o51) + '\060', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\066' + chr(0b10100 + 0o36), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(833 - 783) + '\x33' + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101111 + 0o4) + chr(581 - 532) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061', 0o10), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + chr(0b10001 + 0o40) + chr(0b11111 + 0o22) + chr(58 - 6), 8), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(1795 - 1744) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10010 + 0o135) + '\x32' + '\066' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + chr(0b100011 + 0o17) + '\x37' + chr(0b100100 + 0o17), 8), ehT0Px3KOsy9(chr(48) + chr(11057 - 10946) + '\x34' + chr(2093 - 2038), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(49) + '\x33', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(53) + chr(0b110000), 21846 - 21838)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'p'), chr(0b1100100) + chr(0b1100100 + 0o1) + chr(806 - 707) + chr(5519 - 5408) + chr(100) + chr(9045 - 8944))(chr(117) + chr(9546 - 9430) + chr(0b110111 + 0o57) + '\x2d' + chr(260 - 204)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def stXNDgRnmnP9(atJVpui1QHD3, V5mx94aPk45I):
YwMyLskbiCrd = V5mx94aPk45I.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0eU\xe1\xda\xb4Q\xfa\xaa\xacy'), chr(0b0 + 0o144) + chr(6875 - 6774) + chr(0b1100011) + '\157' + '\x64' + chr(101))(chr(0b1110101) + '\164' + chr(0b111101 + 0o51) + chr(0b10011 + 0o32) + chr(0b111000)), {})
rjZEOs0mSxe7 = V5mx94aPk45I.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1aQ\xf5\xd2\xb7]\xfa\xa6\xb1d'), chr(100) + chr(0b100001 + 0o104) + '\x63' + '\157' + '\x64' + chr(6307 - 6206))('\x75' + '\x74' + chr(2630 - 2528) + '\x2d' + chr(1600 - 1544)), {})
return ZJv8JeJ7qyB4(atJVpui1QHD3, YwMyLskbiCrd, rjZEOs0mSxe7)
|
awslabs/serverless-application-model
|
samtranslator/plugins/__init__.py
|
SamPlugins.register
|
def register(self, plugin):
"""
Register a plugin. New plugins are added to the end of the plugins list.
:param samtranslator.plugins.BasePlugin plugin: Instance/subclass of BasePlugin class that implements hooks
:raises ValueError: If plugin is not an instance of samtranslator.plugins.BasePlugin or if it is already
registered
:return: None
"""
if not plugin or not isinstance(plugin, BasePlugin):
raise ValueError("Plugin must be implemented as a subclass of BasePlugin class")
if self.is_registered(plugin.name):
raise ValueError("Plugin with name {} is already registered".format(plugin.name))
self._plugins.append(plugin)
|
python
|
def register(self, plugin):
"""
Register a plugin. New plugins are added to the end of the plugins list.
:param samtranslator.plugins.BasePlugin plugin: Instance/subclass of BasePlugin class that implements hooks
:raises ValueError: If plugin is not an instance of samtranslator.plugins.BasePlugin or if it is already
registered
:return: None
"""
if not plugin or not isinstance(plugin, BasePlugin):
raise ValueError("Plugin must be implemented as a subclass of BasePlugin class")
if self.is_registered(plugin.name):
raise ValueError("Plugin with name {} is already registered".format(plugin.name))
self._plugins.append(plugin)
|
[
"def",
"register",
"(",
"self",
",",
"plugin",
")",
":",
"if",
"not",
"plugin",
"or",
"not",
"isinstance",
"(",
"plugin",
",",
"BasePlugin",
")",
":",
"raise",
"ValueError",
"(",
"\"Plugin must be implemented as a subclass of BasePlugin class\"",
")",
"if",
"self",
".",
"is_registered",
"(",
"plugin",
".",
"name",
")",
":",
"raise",
"ValueError",
"(",
"\"Plugin with name {} is already registered\"",
".",
"format",
"(",
"plugin",
".",
"name",
")",
")",
"self",
".",
"_plugins",
".",
"append",
"(",
"plugin",
")"
] |
Register a plugin. New plugins are added to the end of the plugins list.
:param samtranslator.plugins.BasePlugin plugin: Instance/subclass of BasePlugin class that implements hooks
:raises ValueError: If plugin is not an instance of samtranslator.plugins.BasePlugin or if it is already
registered
:return: None
|
[
"Register",
"a",
"plugin",
".",
"New",
"plugins",
"are",
"added",
"to",
"the",
"end",
"of",
"the",
"plugins",
"list",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/__init__.py#L64-L80
|
train
|
Register a new plugin.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvO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Ma,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(111) + chr(0b10000 + 0o41) + chr(0b1100 + 0o53) + chr(0b110000), 45493 - 45485), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\x6f' + chr(0b100111 + 0o14) + chr(49) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + '\x31' + chr(0b101111 + 0o5) + chr(0b110100 + 0o1), 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + '\061' + '\061' + chr(55), 12129 - 12121), ehT0Px3KOsy9(chr(0b110000) + chr(7795 - 7684) + chr(0b10001 + 0o42) + chr(0b110011) + chr(0b100000 + 0o27), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(1523 - 1473) + chr(0b10101 + 0o42), 7853 - 7845), ehT0Px3KOsy9(chr(48) + chr(8792 - 8681) + chr(50) + chr(0b110101) + chr(1027 - 976), 12517 - 12509), ehT0Px3KOsy9('\x30' + chr(9405 - 9294) + chr(0b110011) + chr(50) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + chr(0b110011) + chr(0b110100) + chr(0b10111 + 0o31), ord("\x08")), ehT0Px3KOsy9(chr(2027 - 1979) + '\x6f' + chr(49) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b100 + 0o55) + chr(1906 - 1855), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + '\x31' + '\065' + chr(50), 3522 - 3514), ehT0Px3KOsy9(chr(179 - 131) + chr(0b110100 + 0o73) + chr(2310 - 2259) + chr(55) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(0b101000 + 0o13), 26940 - 26932), ehT0Px3KOsy9(chr(1625 - 1577) + chr(0b1101111) + '\x32' + '\x37' + chr(948 - 894), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8248 - 8137) + chr(49) + chr(0b1111 + 0o45) + chr(398 - 347), 46987 - 46979), ehT0Px3KOsy9(chr(0b110000) + chr(0b11001 + 0o126) + chr(55) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + chr(0b110010) + chr(0b110111) + chr(985 - 934), 16735 - 16727), ehT0Px3KOsy9(chr(0b110000) + chr(326 - 215) + chr(50) + chr(2441 - 2388) + '\062', 19927 - 19919), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + chr(0b10001 + 0o42) + chr(0b11 + 0o64) + chr(49), 0o10), ehT0Px3KOsy9('\x30' + chr(6908 - 6797) + '\062' + chr(0b110111) + '\064', 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + chr(0b110001) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110 + 0o54) + chr(0b110100) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + '\062' + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b11111 + 0o26) + chr(2616 - 2562), 15349 - 15341), ehT0Px3KOsy9(chr(608 - 560) + '\x6f' + chr(0b110011) + '\063' + chr(0b100111 + 0o15), 0b1000), ehT0Px3KOsy9('\x30' + chr(2265 - 2154) + chr(0b10101 + 0o35) + chr(2774 - 2719) + '\x36', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100001 + 0o22) + chr(49) + '\067', 0b1000), ehT0Px3KOsy9('\060' + chr(6881 - 6770) + '\062' + '\x37' + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + chr(0b110011) + chr(0b110001) + chr(53), 0b1000), ehT0Px3KOsy9(chr(1760 - 1712) + chr(0b1101010 + 0o5) + chr(388 - 338) + chr(0b110101) + chr(0b11111 + 0o22), 31511 - 31503), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(6358 - 6247) + chr(0b10010 + 0o40) + '\x37' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + chr(50) + chr(49) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(735 - 687) + '\157' + '\x32' + chr(50) + chr(48), 54210 - 54202), ehT0Px3KOsy9(chr(48) + '\157' + chr(1208 - 1159) + '\067' + chr(0b110110), 28160 - 28152), ehT0Px3KOsy9(chr(48) + chr(0b1100101 + 0o12) + '\x32' + chr(0b110101) + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b110000) + chr(10483 - 10372) + chr(0b110011) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(357 - 309) + chr(0b1000111 + 0o50) + chr(0b110010) + chr(55) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(0b110001 + 0o76) + chr(0b101100 + 0o5) + '\061' + '\062', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(1492 - 1442) + '\x37' + '\065', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1010011 + 0o34) + chr(0b101100 + 0o11) + chr(48), 55054 - 55046)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'V'), chr(0b101010 + 0o72) + '\145' + chr(6960 - 6861) + chr(0b10101 + 0o132) + '\144' + chr(6172 - 6071))('\x75' + '\164' + '\x66' + '\x2d' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def WlGrEKpik_hR(oVre8I6UXc3b, GG_JKdX7j9bN):
if not GG_JKdX7j9bN or not PlSM16l2KDPD(GG_JKdX7j9bN, Crli0FSQUpzc):
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'(\xa6\x10(\xb6\xb9\x8b\xbb\x95}?J\x9cv\x9e\nT\xcb\xc6\x9c\xd1o\xc9!\xcb\xb8\x9e\xae\xcd\xed\xc8\x9a\xfa\xe5\x1c\xcdq\xd99\xceX\xa5\x03o\x9d\xb6\xd8\xb3\xb0b>\r\x97}\x9e\x00U\xda\xd9\x8a'), chr(543 - 443) + chr(0b110001 + 0o64) + chr(0b1100011) + chr(10676 - 10565) + '\144' + chr(101))(chr(117) + chr(116) + chr(102) + chr(0b100000 + 0o15) + chr(0b11101 + 0o33)))
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x11\xb9:=\xba\xb0\xc2\xa5\x94k9\x0f\x9a'), '\144' + chr(0b1100101) + chr(99) + chr(9669 - 9558) + '\144' + chr(101))('\x75' + '\x74' + '\146' + chr(0b11100 + 0o21) + chr(0b111000)))(xafqLlk3kkUe(GG_JKdX7j9bN, xafqLlk3kkUe(SXOLrMavuUCe(b'9\x83\x13\x05\x8d\xad\xe7\xb2\xa4h,,'), chr(100) + chr(0b1100000 + 0o5) + '\143' + chr(111) + chr(2392 - 2292) + '\x65')(chr(117) + chr(5090 - 4974) + chr(0b1100110) + '\x2d' + '\070'))):
raise q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'(\xa6\x10(\xb6\xb9\x8b\xa1\x89z#J\x90r\xd3\x06\x19\xc0\xd7\xd9\xd5y\x874\xc2\xae\xdb\xae\xda\xb4\x89\xc8\xec\xf7\x17\xddi\xdd8\xd8\x1c'), chr(100) + chr(380 - 279) + '\143' + chr(0b1101111) + chr(1875 - 1775) + chr(101))(chr(0b1110101) + '\x74' + chr(0b1100010 + 0o4) + chr(0b101101) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'.\xfe\x17 \x97\xb6\xf8\xe5\xb0~.\x00'), chr(100) + chr(0b111001 + 0o54) + '\143' + chr(0b1101111) + '\x64' + chr(0b1001000 + 0o35))('\x75' + '\x74' + '\146' + chr(1534 - 1489) + '\070'))(xafqLlk3kkUe(GG_JKdX7j9bN, xafqLlk3kkUe(SXOLrMavuUCe(b'9\x83\x13\x05\x8d\xad\xe7\xb2\xa4h,,'), '\144' + chr(0b101010 + 0o73) + chr(99) + chr(0b1101111) + chr(100) + chr(0b1011110 + 0o7))(chr(0b1101110 + 0o7) + chr(116) + '\x66' + chr(0b101101) + '\070'))))
xafqLlk3kkUe(oVre8I6UXc3b._plugins, xafqLlk3kkUe(SXOLrMavuUCe(b'\x19\xba\x15*\xb1\xb3'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(0b1100001 + 0o16) + chr(2104 - 2004) + chr(580 - 479))(chr(117) + '\x74' + chr(0b1100110) + chr(0b111 + 0o46) + chr(0b111000)))(GG_JKdX7j9bN)
|
awslabs/serverless-application-model
|
samtranslator/plugins/__init__.py
|
SamPlugins._get
|
def _get(self, plugin_name):
"""
Retrieves the plugin with given name
:param plugin_name: Name of the plugin to retrieve
:return samtranslator.plugins.BasePlugin: Returns the plugin object if found. None, otherwise
"""
for p in self._plugins:
if p.name == plugin_name:
return p
return None
|
python
|
def _get(self, plugin_name):
"""
Retrieves the plugin with given name
:param plugin_name: Name of the plugin to retrieve
:return samtranslator.plugins.BasePlugin: Returns the plugin object if found. None, otherwise
"""
for p in self._plugins:
if p.name == plugin_name:
return p
return None
|
[
"def",
"_get",
"(",
"self",
",",
"plugin_name",
")",
":",
"for",
"p",
"in",
"self",
".",
"_plugins",
":",
"if",
"p",
".",
"name",
"==",
"plugin_name",
":",
"return",
"p",
"return",
"None"
] |
Retrieves the plugin with given name
:param plugin_name: Name of the plugin to retrieve
:return samtranslator.plugins.BasePlugin: Returns the plugin object if found. None, otherwise
|
[
"Retrieves",
"the",
"plugin",
"with",
"given",
"name"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542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O1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(0b11000 + 0o32) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\x6f' + chr(879 - 829) + chr(557 - 505) + chr(0b10100 + 0o36), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(0b101101 + 0o6) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(1538 - 1488) + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b100101 + 0o112) + chr(50) + chr(0b101000 + 0o10), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b110011) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1001000 + 0o47) + '\x31' + chr(55) + chr(0b1100 + 0o50), 28533 - 28525), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(0b1100 + 0o45) + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(0b11000 + 0o127) + chr(49) + chr(626 - 576) + chr(0b110111), 15891 - 15883), ehT0Px3KOsy9(chr(237 - 189) + chr(0b10001 + 0o136) + '\063' + '\x35' + chr(2292 - 2240), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(0b1010 + 0o54) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(1889 - 1841) + chr(111) + '\064' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(987 - 939) + chr(1500 - 1389) + chr(50) + chr(0b110111) + chr(0b10011 + 0o43), 0b1000), ehT0Px3KOsy9('\060' + chr(1767 - 1656) + '\061' + chr(0b110010) + chr(0b100011 + 0o22), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(48) + chr(0b101 + 0o57), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + chr(8232 - 8121) + chr(0b110001) + chr(884 - 836) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1111 + 0o140) + '\061' + chr(0b10101 + 0o33) + chr(0b1101 + 0o44), 17488 - 17480), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(96 - 46) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(50) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(5274 - 5163) + '\063' + '\062' + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1659 - 1610) + '\x30' + '\065', 0b1000), ehT0Px3KOsy9(chr(2076 - 2028) + chr(111) + chr(170 - 121) + '\063' + chr(604 - 552), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(788 - 739) + chr(1845 - 1791) + chr(105 - 54), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\x31' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(2075 - 2026) + '\064' + chr(0b11110 + 0o31), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\x34' + chr(1200 - 1151), 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(111) + '\x32' + '\x31' + '\065', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1011 + 0o47) + '\061' + chr(0b1101 + 0o50), 8), ehT0Px3KOsy9(chr(48) + chr(0b110 + 0o151) + chr(0b110011) + chr(49) + chr(0b110101), 64839 - 64831), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + '\062' + '\064' + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b10000 + 0o40) + chr(52), 8), ehT0Px3KOsy9(chr(1149 - 1101) + chr(0b1101111) + chr(0b1010 + 0o50) + chr(0b110000) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(949 - 901) + chr(0b101000 + 0o107) + '\061' + chr(76 - 27) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(0b110011) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011100 + 0o23) + chr(745 - 694) + chr(766 - 711) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x37' + chr(0b11110 + 0o24), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + '\x32' + chr(0b100101 + 0o14) + chr(0b100011 + 0o20), 13303 - 13295), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\067' + chr(52), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(3795 - 3684) + '\065' + chr(0b11011 + 0o25), 48758 - 48750)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc'), '\144' + chr(101) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(101))(chr(117) + chr(0b1110100) + '\x66' + '\055' + chr(2757 - 2701)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def VFKX9mX3bZyN(oVre8I6UXc3b, H6PpA3BNZEQI):
for UyakMW2IMFEj in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd\xd2\xf7\xa4w5\x12\xfd'), chr(100) + chr(0b100001 + 0o104) + chr(9190 - 9091) + '\157' + chr(5919 - 5819) + '\x65')(chr(4377 - 4260) + chr(0b110001 + 0o103) + chr(0b1011001 + 0o15) + chr(0b101101) + chr(0b110100 + 0o4))):
if xafqLlk3kkUe(UyakMW2IMFEj, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3\xeb\xed\x9bB&0\xea\x13\x8a\x95g'), chr(100) + chr(2829 - 2728) + chr(0b1100011) + '\x6f' + chr(100) + '\145')(chr(7417 - 7300) + chr(0b101101 + 0o107) + chr(102) + chr(45) + '\070')) == H6PpA3BNZEQI:
return UyakMW2IMFEj
return None
|
awslabs/serverless-application-model
|
samtranslator/plugins/__init__.py
|
SamPlugins.act
|
def act(self, event, *args, **kwargs):
"""
Act on the specific life cycle event. The action here is to invoke the hook function on all registered plugins.
*args and **kwargs will be passed directly to the plugin's hook functions
:param samtranslator.plugins.LifeCycleEvents event: Event to act upon
:return: Nothing
:raises ValueError: If event is not a valid life cycle event
:raises NameError: If a plugin does not have the hook method defined
:raises Exception: Any exception that a plugin raises
"""
if not isinstance(event, LifeCycleEvents):
raise ValueError("'event' must be an instance of LifeCycleEvents class")
method_name = "on_" + event.name
for plugin in self._plugins:
if not hasattr(plugin, method_name):
raise NameError("'{}' method is not found in the plugin with name '{}'"
.format(method_name, plugin.name))
try:
getattr(plugin, method_name)(*args, **kwargs)
except InvalidResourceException as ex:
# Don't need to log these because they don't result in crashes
raise ex
except Exception as ex:
logging.exception("Plugin '%s' raised an exception: %s", plugin.name, ex)
raise ex
|
python
|
def act(self, event, *args, **kwargs):
"""
Act on the specific life cycle event. The action here is to invoke the hook function on all registered plugins.
*args and **kwargs will be passed directly to the plugin's hook functions
:param samtranslator.plugins.LifeCycleEvents event: Event to act upon
:return: Nothing
:raises ValueError: If event is not a valid life cycle event
:raises NameError: If a plugin does not have the hook method defined
:raises Exception: Any exception that a plugin raises
"""
if not isinstance(event, LifeCycleEvents):
raise ValueError("'event' must be an instance of LifeCycleEvents class")
method_name = "on_" + event.name
for plugin in self._plugins:
if not hasattr(plugin, method_name):
raise NameError("'{}' method is not found in the plugin with name '{}'"
.format(method_name, plugin.name))
try:
getattr(plugin, method_name)(*args, **kwargs)
except InvalidResourceException as ex:
# Don't need to log these because they don't result in crashes
raise ex
except Exception as ex:
logging.exception("Plugin '%s' raised an exception: %s", plugin.name, ex)
raise ex
|
[
"def",
"act",
"(",
"self",
",",
"event",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"event",
",",
"LifeCycleEvents",
")",
":",
"raise",
"ValueError",
"(",
"\"'event' must be an instance of LifeCycleEvents class\"",
")",
"method_name",
"=",
"\"on_\"",
"+",
"event",
".",
"name",
"for",
"plugin",
"in",
"self",
".",
"_plugins",
":",
"if",
"not",
"hasattr",
"(",
"plugin",
",",
"method_name",
")",
":",
"raise",
"NameError",
"(",
"\"'{}' method is not found in the plugin with name '{}'\"",
".",
"format",
"(",
"method_name",
",",
"plugin",
".",
"name",
")",
")",
"try",
":",
"getattr",
"(",
"plugin",
",",
"method_name",
")",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"except",
"InvalidResourceException",
"as",
"ex",
":",
"# Don't need to log these because they don't result in crashes",
"raise",
"ex",
"except",
"Exception",
"as",
"ex",
":",
"logging",
".",
"exception",
"(",
"\"Plugin '%s' raised an exception: %s\"",
",",
"plugin",
".",
"name",
",",
"ex",
")",
"raise",
"ex"
] |
Act on the specific life cycle event. The action here is to invoke the hook function on all registered plugins.
*args and **kwargs will be passed directly to the plugin's hook functions
:param samtranslator.plugins.LifeCycleEvents event: Event to act upon
:return: Nothing
:raises ValueError: If event is not a valid life cycle event
:raises NameError: If a plugin does not have the hook method defined
:raises Exception: Any exception that a plugin raises
|
[
"Act",
"on",
"the",
"specific",
"life",
"cycle",
"event",
".",
"The",
"action",
"here",
"is",
"to",
"invoke",
"the",
"hook",
"function",
"on",
"all",
"registered",
"plugins",
".",
"*",
"args",
"and",
"**",
"kwargs",
"will",
"be",
"passed",
"directly",
"to",
"the",
"plugin",
"s",
"hook",
"functions"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/__init__.py#L106-L136
|
train
|
Act on the specific life cycle event.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sH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rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(54) + '\x35', 5250 - 5242), ehT0Px3KOsy9(chr(1545 - 1497) + chr(0b1101111) + chr(767 - 717) + chr(51) + '\060', 16496 - 16488), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1015 - 966) + '\x31' + chr(607 - 558), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9551 - 9440) + chr(0b110010) + chr(0b110101) + chr(0b11001 + 0o36), 0b1000), ehT0Px3KOsy9(chr(621 - 573) + chr(111) + '\x33' + chr(0b110001 + 0o2) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11111 + 0o22) + chr(0b110010) + chr(1558 - 1510), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1011 + 0o50) + chr(0b101011 + 0o6) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + chr(0b110000 + 0o2) + chr(0b11000 + 0o34) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(601 - 548) + chr(49), 60704 - 60696), ehT0Px3KOsy9(chr(961 - 913) + chr(0b101001 + 0o106) + '\061' + '\063' + chr(1755 - 1700), 33880 - 33872), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b110011) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000101 + 0o52) + '\061' + chr(1840 - 1790) + '\060', 8), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + '\x33' + chr(1177 - 1123), 0b1000), ehT0Px3KOsy9(chr(208 - 160) + chr(0b1000111 + 0o50) + chr(49) + '\x36', 340 - 332), ehT0Px3KOsy9('\060' + chr(0b10110 + 0o131) + chr(1957 - 1906) + '\064' + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11705 - 11594) + chr(1599 - 1548) + chr(0b110000) + chr(0b110100), 15541 - 15533), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + chr(1748 - 1699) + chr(0b110110) + chr(49), 23929 - 23921), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(53) + '\062', 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + '\061' + chr(428 - 379) + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1101 + 0o47) + chr(258 - 209), 0b1000), ehT0Px3KOsy9(chr(714 - 666) + chr(0b1101111) + chr(53) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(1796 - 1748) + '\x6f' + '\x36' + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\063' + '\063' + chr(51), 8), ehT0Px3KOsy9(chr(48) + chr(111) + '\062', 12422 - 12414), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + chr(553 - 504) + '\x32' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + '\066' + chr(0b100001 + 0o24), ord("\x08")), ehT0Px3KOsy9(chr(963 - 915) + '\157' + '\063' + chr(0b100111 + 0o14) + chr(2070 - 2020), 38829 - 38821), ehT0Px3KOsy9(chr(48) + chr(0b101011 + 0o104) + '\x33' + chr(0b101100 + 0o4) + '\064', 8), ehT0Px3KOsy9('\060' + chr(0b1011001 + 0o26) + '\061' + '\x33' + chr(2079 - 2024), 8), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\x6f' + '\061' + '\064' + chr(2390 - 2335), 48766 - 48758), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + '\063' + chr(0b100111 + 0o15), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(1091 - 1043), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110100 + 0o73) + '\x31' + chr(0b110010 + 0o4) + chr(0b11111 + 0o23), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(0b110101) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(9896 - 9785) + chr(0b11011 + 0o25), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(0b110111) + '\067', 37937 - 37929), ehT0Px3KOsy9('\060' + '\157' + chr(1801 - 1751) + '\x33' + chr(2215 - 2166), 0o10), ehT0Px3KOsy9('\x30' + chr(2767 - 2656) + chr(196 - 147) + chr(0b110000) + chr(1619 - 1570), 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1 + 0o156) + chr(0b10011 + 0o40) + chr(0b110110) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(0b11 + 0o57) + chr(53) + chr(0b101010 + 0o12), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100010 + 0o23) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x1b'), chr(100) + chr(101) + chr(5946 - 5847) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(116) + '\146' + chr(301 - 256) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def bDiRwJOGVSOl(oVre8I6UXc3b, SGm65G84ZKM5, *kJDRfRhcZHjS, **M8EIoTs2GJXE):
if not PlSM16l2KDPD(SGm65G84ZKM5, YL6Sdfw_L5US):
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x12\xfd?\xca\xb5$\xe8\x86D*\xad$>l\x86\xe4\x10\xc4jHDA\xafc=\x96\xbf\xe40\x01\xbc\\\x1b\x08e<\xe0"\x9c\xc9p\xee,\xc1\xaf#\xef\xc5E>\xad#'), chr(9307 - 9207) + '\145' + chr(99) + chr(6645 - 6534) + chr(100) + '\x65')(chr(0b1110101) + '\x74' + chr(9097 - 8995) + chr(0b101101) + chr(0b111000)))
kXYCGf8FzWpJ = xafqLlk3kkUe(SXOLrMavuUCe(b'Z\xf6\x16'), chr(0b1100100) + chr(101) + '\143' + chr(111) + chr(0b1010101 + 0o17) + '\145')(chr(117) + chr(9245 - 9129) + chr(7328 - 7226) + chr(361 - 316) + chr(1628 - 1572)) + SGm65G84ZKM5.AIvJRzLdDfgF
for GG_JKdX7j9bN in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'j\xe8%\xda\xbc9\xa1\xd5'), chr(0b1001110 + 0o26) + '\x65' + '\143' + chr(0b1101111) + '\144' + chr(2648 - 2547))('\x75' + chr(9712 - 9596) + chr(665 - 563) + chr(0b101101) + chr(56))):
if not lot1PSoAwYhj(GG_JKdX7j9bN, kXYCGf8FzWpJ):
raise V5s4UV3vwoyK(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x12\xe34\x88\xfb=\xaa\xd2A0\xbapw}\xc3\xaa\x1e\xdejGEG\xb5fs\x9c\xb4\xe4+\x0f\xf90\x02\x02u\x18\xf0/\xd0\xdb\\\xec!\x8f\xb51\xa2\xc3\tx\xa5-9'), '\x64' + '\x65' + chr(99) + chr(111) + '\144' + chr(101))(chr(0b1110101) + '\x74' + chr(0b110000 + 0o66) + '\x2d' + chr(0b1100 + 0o54)), xafqLlk3kkUe(SXOLrMavuUCe(b'c\xac;\xc0\x931\x9c\x95y/\xbb:'), '\144' + chr(0b1011111 + 0o6) + chr(5045 - 4946) + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(0b1110101 + 0o0) + chr(0b1110100) + chr(0b1000000 + 0o46) + chr(0b100101 + 0o10) + '\x38'))(kXYCGf8FzWpJ, xafqLlk3kkUe(GG_JKdX7j9bN, xafqLlk3kkUe(SXOLrMavuUCe(b't\xd1?\xe5\x89*\x83\xc2m9\xb9\x16'), chr(5563 - 5463) + chr(0b10110 + 0o117) + chr(8446 - 8347) + '\157' + chr(0b101101 + 0o67) + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(9265 - 9163) + chr(0b1000 + 0o45) + '\x38'))))
try:
xafqLlk3kkUe(GG_JKdX7j9bN, kXYCGf8FzWpJ)(*kJDRfRhcZHjS, **M8EIoTs2GJXE)
except ow8Lll3lwq0h as DfdhY28yEwAF:
raise DfdhY28yEwAF
except jLmadlzMdunT as DfdhY28yEwAF:
xafqLlk3kkUe(UeotCCWOPSQS, xafqLlk3kkUe(SXOLrMavuUCe(b'P\xe0*\xca\xab$\xa6\xc9G'), chr(1302 - 1202) + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(101))('\165' + chr(7859 - 7743) + chr(0b1100110) + chr(45) + chr(0b101111 + 0o11)))(xafqLlk3kkUe(SXOLrMavuUCe(b'e\xf4<\xc8\xb2>\xef\x81\x0c,\xf9plo\x8a\xb7\x14\xcej@D\x12\xbez0\x90\xaa\xb06\x08\xf2*RKs'), chr(8921 - 8821) + '\145' + chr(0b1011010 + 0o11) + '\157' + chr(100) + chr(0b1000001 + 0o44))('\x75' + chr(116) + '\146' + chr(0b101100 + 0o1) + '\x38'), xafqLlk3kkUe(GG_JKdX7j9bN, xafqLlk3kkUe(SXOLrMavuUCe(b't\xd1?\xe5\x89*\x83\xc2m9\xb9\x16'), '\144' + chr(0b111000 + 0o55) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + '\x65')('\x75' + chr(0b1110100) + '\146' + chr(45) + chr(56))), DfdhY28yEwAF)
raise DfdhY28yEwAF
|
awslabs/serverless-application-model
|
samtranslator/model/preferences/deployment_preference.py
|
DeploymentPreference.from_dict
|
def from_dict(cls, logical_id, deployment_preference_dict):
"""
:param logical_id: the logical_id of the resource that owns this deployment preference
:param deployment_preference_dict: the dict object taken from the SAM template
:return:
"""
enabled = deployment_preference_dict.get('Enabled', True)
if not enabled:
return DeploymentPreference(None, None, None, None, False, None)
if 'Type' not in deployment_preference_dict:
raise InvalidResourceException(logical_id, "'DeploymentPreference' is missing required Property 'Type'")
deployment_type = deployment_preference_dict['Type']
hooks = deployment_preference_dict.get('Hooks', dict())
if not isinstance(hooks, dict):
raise InvalidResourceException(logical_id,
"'Hooks' property of 'DeploymentPreference' must be a dictionary")
pre_traffic_hook = hooks.get('PreTraffic', None)
post_traffic_hook = hooks.get('PostTraffic', None)
alarms = deployment_preference_dict.get('Alarms', None)
role = deployment_preference_dict.get('Role', None)
return DeploymentPreference(deployment_type, pre_traffic_hook, post_traffic_hook, alarms, enabled, role)
|
python
|
def from_dict(cls, logical_id, deployment_preference_dict):
"""
:param logical_id: the logical_id of the resource that owns this deployment preference
:param deployment_preference_dict: the dict object taken from the SAM template
:return:
"""
enabled = deployment_preference_dict.get('Enabled', True)
if not enabled:
return DeploymentPreference(None, None, None, None, False, None)
if 'Type' not in deployment_preference_dict:
raise InvalidResourceException(logical_id, "'DeploymentPreference' is missing required Property 'Type'")
deployment_type = deployment_preference_dict['Type']
hooks = deployment_preference_dict.get('Hooks', dict())
if not isinstance(hooks, dict):
raise InvalidResourceException(logical_id,
"'Hooks' property of 'DeploymentPreference' must be a dictionary")
pre_traffic_hook = hooks.get('PreTraffic', None)
post_traffic_hook = hooks.get('PostTraffic', None)
alarms = deployment_preference_dict.get('Alarms', None)
role = deployment_preference_dict.get('Role', None)
return DeploymentPreference(deployment_type, pre_traffic_hook, post_traffic_hook, alarms, enabled, role)
|
[
"def",
"from_dict",
"(",
"cls",
",",
"logical_id",
",",
"deployment_preference_dict",
")",
":",
"enabled",
"=",
"deployment_preference_dict",
".",
"get",
"(",
"'Enabled'",
",",
"True",
")",
"if",
"not",
"enabled",
":",
"return",
"DeploymentPreference",
"(",
"None",
",",
"None",
",",
"None",
",",
"None",
",",
"False",
",",
"None",
")",
"if",
"'Type'",
"not",
"in",
"deployment_preference_dict",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"\"'DeploymentPreference' is missing required Property 'Type'\"",
")",
"deployment_type",
"=",
"deployment_preference_dict",
"[",
"'Type'",
"]",
"hooks",
"=",
"deployment_preference_dict",
".",
"get",
"(",
"'Hooks'",
",",
"dict",
"(",
")",
")",
"if",
"not",
"isinstance",
"(",
"hooks",
",",
"dict",
")",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"\"'Hooks' property of 'DeploymentPreference' must be a dictionary\"",
")",
"pre_traffic_hook",
"=",
"hooks",
".",
"get",
"(",
"'PreTraffic'",
",",
"None",
")",
"post_traffic_hook",
"=",
"hooks",
".",
"get",
"(",
"'PostTraffic'",
",",
"None",
")",
"alarms",
"=",
"deployment_preference_dict",
".",
"get",
"(",
"'Alarms'",
",",
"None",
")",
"role",
"=",
"deployment_preference_dict",
".",
"get",
"(",
"'Role'",
",",
"None",
")",
"return",
"DeploymentPreference",
"(",
"deployment_type",
",",
"pre_traffic_hook",
",",
"post_traffic_hook",
",",
"alarms",
",",
"enabled",
",",
"role",
")"
] |
:param logical_id: the logical_id of the resource that owns this deployment preference
:param deployment_preference_dict: the dict object taken from the SAM template
:return:
|
[
":",
"param",
"logical_id",
":",
"the",
"logical_id",
"of",
"the",
"resource",
"that",
"owns",
"this",
"deployment",
"preference",
":",
"param",
"deployment_preference_dict",
":",
"the",
"dict",
"object",
"taken",
"from",
"the",
"SAM",
"template",
":",
"return",
":"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/preferences/deployment_preference.py#L37-L60
|
train
|
Creates a new DeploymentPreference object from a dictionary.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHA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kZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1001 + 0o146) + '\062' + '\x37' + chr(53), 9947 - 9939), ehT0Px3KOsy9(chr(48) + chr(10748 - 10637) + chr(0b110011) + chr(0b100101 + 0o14) + chr(0b110100), 13912 - 13904), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b111 + 0o54) + chr(0b1001 + 0o56), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4853 - 4742) + chr(0b110010) + chr(868 - 819) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(4383 - 4272) + '\x33' + chr(0b101000 + 0o10) + chr(0b1001 + 0o55), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(500 - 450) + chr(0b110001) + chr(0b11111 + 0o24), 19204 - 19196), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + chr(903 - 792) + chr(0b100001 + 0o20) + chr(53) + chr(0b10100 + 0o40), ord("\x08")), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + chr(0b110010) + chr(0b110001) + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(0b101 + 0o152) + '\061' + '\x34' + chr(0b11011 + 0o34), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4942 - 4831) + '\x31' + chr(0b110010) + chr(0b11111 + 0o26), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(7846 - 7735) + '\x32' + '\060' + chr(1619 - 1566), 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(6032 - 5921) + chr(0b110010) + chr(0b10001 + 0o37) + chr(1233 - 1179), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001001 + 0o46) + chr(1032 - 983) + chr(0b110111) + chr(0b1011 + 0o52), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110111) + chr(145 - 96), 50124 - 50116), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(0b110101) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(1000 - 952) + chr(0b1101111) + chr(1358 - 1303) + chr(50), 62850 - 62842), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + chr(49) + chr(53) + '\064', 8), ehT0Px3KOsy9(chr(395 - 347) + '\157' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(2391 - 2342) + chr(0b110000) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(438 - 385) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(10932 - 10821) + chr(49) + chr(0b10101 + 0o34) + chr(2887 - 2832), 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + chr(0b11000 + 0o31) + chr(870 - 821) + chr(62 - 11), 0b1000), ehT0Px3KOsy9('\060' + chr(0b10 + 0o155) + chr(0b101 + 0o55) + '\065' + chr(0b101 + 0o54), 62066 - 62058), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(0b110010) + '\x34' + chr(0b1101 + 0o45), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + '\063' + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + chr(404 - 355) + '\061' + chr(2246 - 2196), 47816 - 47808), ehT0Px3KOsy9(chr(48) + chr(0b100010 + 0o115) + chr(0b11110 + 0o25) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(0b110001), 50664 - 50656), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + '\x32' + chr(0b110101) + '\x34', 8), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + '\x37' + chr(0b11001 + 0o33), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1010110 + 0o31) + chr(0b110010) + chr(0b110010 + 0o5) + chr(0b111 + 0o55), 29320 - 29312), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\x35' + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(1111 - 1000) + chr(50) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1157 - 1108) + '\x34' + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + '\064' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + chr(51) + chr(49), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(48), 56729 - 56721), ehT0Px3KOsy9('\x30' + chr(0b101001 + 0o106) + chr(290 - 240) + chr(51) + '\062', 33630 - 33622), ehT0Px3KOsy9(chr(48) + chr(1823 - 1712) + chr(2818 - 2764) + chr(2498 - 2445), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2678 - 2625) + chr(48), 5040 - 5032)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x93'), chr(3967 - 3867) + '\145' + chr(0b1100011) + chr(0b1011 + 0o144) + chr(100) + chr(8415 - 8314))('\x75' + chr(116) + chr(102) + chr(1502 - 1457) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def stXNDgRnmnP9(NSstowUUZlxS, NpZr66MdBhVG, oarNwPTF32Uv):
PG24zxmxDc0E = oarNwPTF32Uv.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\xa2\xbe\xef\xaa\xee}'), '\144' + chr(0b1100101) + chr(0b111101 + 0o46) + chr(111) + chr(2635 - 2535) + '\145')(chr(0b101001 + 0o114) + chr(0b1110100) + '\x66' + chr(0b11 + 0o52) + chr(56)), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061', 0o10))
if not PG24zxmxDc0E:
return EwT5zOq9vyAl(None, None, None, None, ehT0Px3KOsy9(chr(2006 - 1958) + chr(111) + chr(48), 21317 - 21309), None)
if xafqLlk3kkUe(SXOLrMavuUCe(b'\xe9\xb5\xaf\xe8'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(3480 - 3380) + chr(0b1001 + 0o134))(chr(117) + chr(0b1110100) + chr(102) + chr(0b101101) + '\x38') not in oarNwPTF32Uv:
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(SXOLrMavuUCe(b"\x9a\x88\xba\xfd\xaa\xe4`\x01\xef\t!\xd5\xf4\x18_\x0fH\tm#\xc9hk\xc0\xd1~'rz\xdf\x15\xd2\x883\x17\x83he\xf3G\xd8\xa8\xff\xdd\xb4\xe4i\t\xf8\x13,\xa5\xa1)@\x1a_K"), '\144' + chr(0b110 + 0o137) + '\x63' + chr(865 - 754) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(12312 - 12196) + '\x66' + chr(0b101101) + chr(0b10 + 0o66)))
BnaoJCVl1oV5 = oarNwPTF32Uv[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe9\xb5\xaf\xe8'), chr(7706 - 7606) + chr(0b1010 + 0o133) + '\143' + chr(0b1101111) + '\144' + '\x65')(chr(0b1110101) + '\164' + chr(102) + '\055' + chr(56))]
rxW1_nsw8u9L = oarNwPTF32Uv.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\xa3\xb0\xe6\xb5'), chr(2522 - 2422) + '\x65' + chr(0b1001001 + 0o32) + chr(0b11101 + 0o122) + '\144' + '\x65')(chr(0b1011111 + 0o26) + chr(12293 - 12177) + chr(4908 - 4806) + '\055' + '\x38'), wLqBDw8l0eIm())
if not PlSM16l2KDPD(rxW1_nsw8u9L, wLqBDw8l0eIm):
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9a\x84\xb0\xe2\xad\xf8>L\xfa\x15:\xf5\xe3\x0fM\x13\x1a\x03e`\x8b\x0b.\xd9\xce13vl\xc2\x08\xec\x9dv\x03\x83ku\xf4V\xd8\xeb\xff\xe0\xb3\xf8mL\xe8\x02u\xe4\xa6\x19P\tN\x05l.\xcd=2'), chr(4497 - 4397) + chr(0b1011000 + 0o15) + chr(1085 - 986) + chr(0b1101111) + chr(0b11111 + 0o105) + '\145')('\x75' + chr(13172 - 13056) + chr(0b1100110) + chr(0b1001 + 0o44) + chr(0b111000)))
uGfW4vBUUhsA = rxW1_nsw8u9L.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xed\xbe\xba\xd9\xb4\xea\x7f\n\xe3\x04'), chr(0b1100010 + 0o2) + chr(101) + chr(0b1100011) + '\x6f' + chr(0b1010 + 0o132) + chr(0b1000 + 0o135))(chr(0b1110101) + '\164' + chr(0b101 + 0o141) + chr(0b101101) + chr(0b111000)), None)
aURqpdXCnOUp = rxW1_nsw8u9L.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xed\xa3\xac\xf9\x92\xf9x\n\xec\x0e6'), chr(100) + chr(101) + '\143' + chr(11658 - 11547) + chr(4036 - 3936) + '\145')(chr(0b11000 + 0o135) + chr(0b1110100) + chr(0b0 + 0o146) + chr(0b101101) + '\070'), None)
PWwlx0QaH18O = oarNwPTF32Uv.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfc\xa0\xbe\xff\xab\xf8'), chr(100) + '\145' + chr(99) + chr(0b10101 + 0o132) + chr(0b1100100) + chr(0b1001010 + 0o33))(chr(0b1001 + 0o154) + '\x74' + '\x66' + chr(629 - 584) + chr(1646 - 1590)), None)
Bqfqb6knzosF = oarNwPTF32Uv.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xef\xa3\xb3\xe8'), '\144' + chr(101) + chr(0b1100011) + chr(7239 - 7128) + '\x64' + chr(0b1100101))(chr(0b1110101) + '\164' + chr(0b1100110) + chr(0b101101) + '\070'), None)
return EwT5zOq9vyAl(BnaoJCVl1oV5, uGfW4vBUUhsA, aURqpdXCnOUp, PWwlx0QaH18O, PG24zxmxDc0E, Bqfqb6knzosF)
|
awslabs/serverless-application-model
|
examples/2016-10-31/encryption_proxy/src/decryption.py
|
decrypt
|
def decrypt(message):
'''decrypt leverages KMS decrypt and base64-encode decrypted blob
More info on KMS decrypt API:
https://docs.aws.amazon.com/kms/latest/APIReference/API_decrypt.html
'''
try:
ret = kms.decrypt(
CiphertextBlob=base64.decodestring(message))
decrypted_data = ret.get('Plaintext')
except Exception as e:
# returns http 500 back to user and log error details in Cloudwatch Logs
raise Exception("Unable to decrypt data: ", e)
return decrypted_data
|
python
|
def decrypt(message):
'''decrypt leverages KMS decrypt and base64-encode decrypted blob
More info on KMS decrypt API:
https://docs.aws.amazon.com/kms/latest/APIReference/API_decrypt.html
'''
try:
ret = kms.decrypt(
CiphertextBlob=base64.decodestring(message))
decrypted_data = ret.get('Plaintext')
except Exception as e:
# returns http 500 back to user and log error details in Cloudwatch Logs
raise Exception("Unable to decrypt data: ", e)
return decrypted_data
|
[
"def",
"decrypt",
"(",
"message",
")",
":",
"try",
":",
"ret",
"=",
"kms",
".",
"decrypt",
"(",
"CiphertextBlob",
"=",
"base64",
".",
"decodestring",
"(",
"message",
")",
")",
"decrypted_data",
"=",
"ret",
".",
"get",
"(",
"'Plaintext'",
")",
"except",
"Exception",
"as",
"e",
":",
"# returns http 500 back to user and log error details in Cloudwatch Logs",
"raise",
"Exception",
"(",
"\"Unable to decrypt data: \"",
",",
"e",
")",
"return",
"decrypted_data"
] |
decrypt leverages KMS decrypt and base64-encode decrypted blob
More info on KMS decrypt API:
https://docs.aws.amazon.com/kms/latest/APIReference/API_decrypt.html
|
[
"decrypt",
"leverages",
"KMS",
"decrypt",
"and",
"base64",
"-",
"encode",
"decrypted",
"blob"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/2016-10-31/encryption_proxy/src/decryption.py#L15-L29
|
train
|
decrypt leverages KMS decrypt and base64 - encode decrypted blob
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j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V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(2020 - 1972) + chr(1238 - 1127) + chr(50) + '\064' + '\x30', 46762 - 46754), ehT0Px3KOsy9(chr(982 - 934) + chr(0b1101111) + chr(0b1001 + 0o52) + chr(0b110010) + chr(2388 - 2334), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(1994 - 1940) + chr(0b101 + 0o62), 40593 - 40585), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(7120 - 7009) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(0b1 + 0o65) + chr(0b110010), 27002 - 26994), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(1293 - 1245) + chr(48), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1111 + 0o42) + chr(0b1000 + 0o50) + chr(0b110110), 126 - 118), ehT0Px3KOsy9('\x30' + chr(0b1100000 + 0o17) + '\061' + chr(0b100110 + 0o21) + '\063', 59025 - 59017), ehT0Px3KOsy9('\060' + chr(111) + chr(0b100011 + 0o16) + chr(652 - 599) + chr(1345 - 1293), 29628 - 29620), ehT0Px3KOsy9(chr(1602 - 1554) + chr(5553 - 5442) + chr(0b110011) + '\066' + chr(143 - 94), 47377 - 47369), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1602 - 1553) + chr(608 - 553) + '\x33', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(406 - 355) + chr(50 - 1) + chr(0b110011), 36089 - 36081), ehT0Px3KOsy9(chr(48) + chr(0b1001111 + 0o40) + chr(50) + chr(0b11101 + 0o24) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(8971 - 8860) + chr(49) + chr(0b100111 + 0o14) + chr(0b100110 + 0o14), 14881 - 14873), ehT0Px3KOsy9('\x30' + chr(6215 - 6104) + chr(53) + chr(53), 0o10), ehT0Px3KOsy9('\060' + chr(3553 - 3442) + '\062' + chr(49) + chr(55), 59097 - 59089), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2244 - 2195) + chr(52) + '\x36', 15474 - 15466), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + '\x35' + chr(0b100 + 0o63), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + chr(0b110001) + chr(51) + '\x37', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10011 + 0o36) + chr(0b110101) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111011 + 0o64) + chr(0b10100 + 0o35) + chr(52) + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + chr(50) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b1111 + 0o42) + chr(389 - 341) + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(408 - 357) + chr(0b110110) + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(0b100010 + 0o21) + '\062', 8), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + chr(0b10011 + 0o44) + '\066', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9335 - 9224) + chr(0b1010 + 0o55), 30207 - 30199), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(0b110001) + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(53) + chr(0b10111 + 0o37), 37635 - 37627), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + '\061', 23346 - 23338), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1100 + 0o45) + chr(1274 - 1225) + '\x34', 0b1000), ehT0Px3KOsy9('\060' + chr(4735 - 4624) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(0b101010 + 0o105) + '\061' + '\x32' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + chr(0b11011 + 0o32) + chr(0b111 + 0o52), 0b1000), ehT0Px3KOsy9('\060' + chr(0b11111 + 0o120) + chr(632 - 582) + chr(54) + chr(391 - 337), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b0 + 0o63) + chr(55) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101111) + chr(0b11 + 0o64) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + '\063' + chr(0b110011) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + '\065' + chr(52), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + '\x35' + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e'), chr(0b100001 + 0o103) + '\145' + chr(99) + '\x6f' + '\144' + '\145')('\x75' + '\164' + '\146' + chr(45) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def oFtj0vQK9hiq(R2mbIkZzeu1B):
try:
VHn4CV4Ymrei = gJuRIm25WqT5.decrypt(CiphertextBlob=w4uTFQps09Ty.decodestring(R2mbIkZzeu1B))
saFJGhzMjdHw = VHn4CV4Ymrei.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0\xba\xd6m\x9c\xf4#\x03\x18'), chr(1435 - 1335) + chr(101) + '\x63' + chr(111) + chr(4486 - 4386) + chr(0b1100101))(chr(117) + chr(116) + chr(0b1111 + 0o127) + '\x2d' + chr(56)))
except jLmadlzMdunT as GlnVAPeT6CUe:
raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\xb8\xd6f\x9e\xe5f\x0f\x03\xd1\x1f\xae\xee(T\xff\x12\xcf;\x0c\x17\xb63f'), chr(0b1001110 + 0o26) + chr(0b1100101) + '\x63' + '\157' + chr(0b1100100) + '\x65')(chr(0b1011101 + 0o30) + chr(0b1100100 + 0o20) + chr(102) + chr(0b10101 + 0o30) + chr(336 - 280)), GlnVAPeT6CUe)
return saFJGhzMjdHw
|
awslabs/serverless-application-model
|
samtranslator/model/exceptions.py
|
prepend
|
def prepend(exception, message, end=': '):
"""Prepends the first argument (i.e., the exception message) of the a BaseException with the provided message.
Useful for reraising exceptions with additional information.
:param BaseException exception: the exception to prepend
:param str message: the message to prepend
:param str end: the separator to add to the end of the provided message
:returns: the exception
"""
exception.args = exception.args or ('',)
exception.args = (message + end + exception.args[0], ) + exception.args[1:]
return exception
|
python
|
def prepend(exception, message, end=': '):
"""Prepends the first argument (i.e., the exception message) of the a BaseException with the provided message.
Useful for reraising exceptions with additional information.
:param BaseException exception: the exception to prepend
:param str message: the message to prepend
:param str end: the separator to add to the end of the provided message
:returns: the exception
"""
exception.args = exception.args or ('',)
exception.args = (message + end + exception.args[0], ) + exception.args[1:]
return exception
|
[
"def",
"prepend",
"(",
"exception",
",",
"message",
",",
"end",
"=",
"': '",
")",
":",
"exception",
".",
"args",
"=",
"exception",
".",
"args",
"or",
"(",
"''",
",",
")",
"exception",
".",
"args",
"=",
"(",
"message",
"+",
"end",
"+",
"exception",
".",
"args",
"[",
"0",
"]",
",",
")",
"+",
"exception",
".",
"args",
"[",
"1",
":",
"]",
"return",
"exception"
] |
Prepends the first argument (i.e., the exception message) of the a BaseException with the provided message.
Useful for reraising exceptions with additional information.
:param BaseException exception: the exception to prepend
:param str message: the message to prepend
:param str end: the separator to add to the end of the provided message
:returns: the exception
|
[
"Prepends",
"the",
"first",
"argument",
"(",
"i",
".",
"e",
".",
"the",
"exception",
"message",
")",
"of",
"the",
"a",
"BaseException",
"with",
"the",
"provided",
"message",
".",
"Useful",
"for",
"reraising",
"exceptions",
"with",
"additional",
"information",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/exceptions.py#L87-L98
|
train
|
Prepends the first argument of the exception with the provided message.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,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,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101001 + 0o12) + chr(2162 - 2111) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + '\x31' + chr(0b110010), 42255 - 42247), ehT0Px3KOsy9(chr(998 - 950) + chr(111) + '\064', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b11011 + 0o27) + chr(55) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1 + 0o156) + chr(0b110001) + chr(0b10000 + 0o42) + chr(2512 - 2458), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2064 - 2015) + chr(0b110010) + chr(2479 - 2425), 8), ehT0Px3KOsy9(chr(2034 - 1986) + '\x6f' + '\067' + '\x35', 12939 - 12931), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(9178 - 9067) + '\x37', 24172 - 24164), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b11010 + 0o34) + chr(487 - 434), 39762 - 39754), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + chr(0b110011) + chr(51) + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b110111) + '\062', 6393 - 6385), ehT0Px3KOsy9(chr(2304 - 2256) + chr(9381 - 9270) + '\063' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1100010 + 0o15) + chr(145 - 94) + '\062' + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100 + 0o143) + chr(2331 - 2278) + '\063', 51134 - 51126), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + '\065' + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + '\x33' + chr(0b110111), 30860 - 30852), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(9253 - 9142) + '\063' + chr(0b110000 + 0o6) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(818 - 770) + chr(111) + chr(0b10100 + 0o37) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(0b11110 + 0o24), 1360 - 1352), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(111) + chr(0b110011) + chr(2054 - 2002) + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b10011 + 0o134) + '\x32' + chr(0b110100) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + chr(0b110011) + '\x32' + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + '\062' + chr(0b10101 + 0o34), 0b1000), ehT0Px3KOsy9(chr(1244 - 1196) + chr(5290 - 5179) + '\x32' + chr(49) + chr(2897 - 2842), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1706 - 1655) + chr(0b100110 + 0o16), 8), ehT0Px3KOsy9(chr(2302 - 2254) + '\x6f' + chr(49) + chr(54) + chr(0b110001), 51592 - 51584), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + '\x32' + chr(0b11110 + 0o24), 8), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\157' + '\x33' + '\064' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + '\x35' + chr(51), 40072 - 40064), ehT0Px3KOsy9(chr(388 - 340) + chr(0b10100 + 0o133) + '\062' + chr(48) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + chr(0b110000 + 0o3) + chr(55) + chr(0b11000 + 0o35), 17290 - 17282), ehT0Px3KOsy9('\x30' + chr(0b110101 + 0o72) + chr(0b110001 + 0o4) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(268 - 157) + chr(52) + '\x36', 0o10), ehT0Px3KOsy9(chr(2150 - 2102) + chr(0b101 + 0o152) + chr(0b110001) + chr(0b110010) + '\064', 0o10), ehT0Px3KOsy9(chr(68 - 20) + chr(0b1101111) + chr(0b100100 + 0o17) + chr(1785 - 1731) + chr(1793 - 1739), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1101111) + chr(1279 - 1224) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(643 - 595) + '\157' + chr(50) + chr(1049 - 1000) + chr(55), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10111 + 0o33) + chr(2746 - 2693) + chr(53), 0b1000), ehT0Px3KOsy9(chr(418 - 370) + '\x6f' + '\x33' + chr(1778 - 1729) + chr(0b110100 + 0o0), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(2345 - 2234) + '\062' + chr(0b110110) + '\061', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + chr(53) + '\060', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0'), chr(0b1100100) + '\x65' + chr(0b110011 + 0o60) + '\x6f' + chr(0b11000 + 0o114) + chr(0b1100101))(chr(1474 - 1357) + chr(6765 - 6649) + chr(4110 - 4008) + '\x2d' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def vB8WhsoLOtpG(mfDdKhdzI25A, R2mbIkZzeu1B, whWDZq5_lP01=xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4j'), '\144' + chr(0b1000111 + 0o36) + chr(5440 - 5341) + chr(0b1101111 + 0o0) + '\144' + chr(101))(chr(0b1110101) + chr(1919 - 1803) + '\x66' + chr(167 - 122) + chr(0b1001 + 0o57))):
mfDdKhdzI25A.kJDRfRhcZHjS = mfDdKhdzI25A.kJDRfRhcZHjS or (xafqLlk3kkUe(SXOLrMavuUCe(b''), '\x64' + chr(0b1100101) + chr(99) + chr(0b1100101 + 0o12) + chr(0b1100100) + '\x65')(chr(11215 - 11098) + chr(0b100101 + 0o117) + chr(0b1100001 + 0o5) + '\055' + chr(3001 - 2945)),)
mfDdKhdzI25A.kJDRfRhcZHjS = (R2mbIkZzeu1B + whWDZq5_lP01 + mfDdKhdzI25A.kJDRfRhcZHjS[ehT0Px3KOsy9(chr(282 - 234) + chr(0b1101111) + chr(0b101011 + 0o5), 0b1000)],) + mfDdKhdzI25A.kJDRfRhcZHjS[ehT0Px3KOsy9(chr(1591 - 1543) + '\157' + chr(49), 47765 - 47757):]
return mfDdKhdzI25A
|
awslabs/serverless-application-model
|
examples/apps/api-gateway-authorizer-python/lambda_function.py
|
lambda_handler
|
def lambda_handler(event, context):
# incoming token value
token = event['authorizationToken']
print("Method ARN: " + event['methodArn'])
'''
Validate the incoming token and produce the principal user identifier
associated with the token. This can be accomplished in a number of ways:
1. Call out to the OAuth provider
2. Decode a JWT token inline
3. Lookup in a self-managed DB
'''
principalId = 'user|a1b2c3d4'
'''
You can send a 401 Unauthorized response to the client by failing like so:
raise Exception('Unauthorized')
If the token is valid, a policy must be generated which will allow or deny
access to the client. If access is denied, the client will receive a 403
Access Denied response. If access is allowed, API Gateway will proceed with
the backend integration configured on the method that was called.
This function must generate a policy that is associated with the recognized
principal user identifier. Depending on your use case, you might store
policies in a DB, or generate them on the fly.
Keep in mind, the policy is cached for 5 minutes by default (TTL is
configurable in the authorizer) and will apply to subsequent calls to any
method/resource in the RestApi made with the same token.
The example policy below denies access to all resources in the RestApi.
'''
tmp = event['methodArn'].split(':')
apiGatewayArnTmp = tmp[5].split('/')
awsAccountId = tmp[4]
policy = AuthPolicy(principalId, awsAccountId)
policy.restApiId = apiGatewayArnTmp[0]
policy.region = tmp[3]
policy.stage = apiGatewayArnTmp[1]
policy.denyAllMethods()
#policy.allowMethod(HttpVerb.GET, '/pets/*')
# Finally, build the policy
authResponse = policy.build()
# new! -- add additional key-value pairs associated with the authenticated principal
# these are made available by APIGW like so: $context.authorizer.<key>
# additional context is cached
context = {
'key': 'value', # $context.authorizer.key -> value
'number': 1,
'bool': True
}
# context['arr'] = ['foo'] <- this is invalid, APIGW will not accept it
# context['obj'] = {'foo':'bar'} <- also invalid
authResponse['context'] = context
return authResponse
|
python
|
def lambda_handler(event, context):
# incoming token value
token = event['authorizationToken']
print("Method ARN: " + event['methodArn'])
'''
Validate the incoming token and produce the principal user identifier
associated with the token. This can be accomplished in a number of ways:
1. Call out to the OAuth provider
2. Decode a JWT token inline
3. Lookup in a self-managed DB
'''
principalId = 'user|a1b2c3d4'
'''
You can send a 401 Unauthorized response to the client by failing like so:
raise Exception('Unauthorized')
If the token is valid, a policy must be generated which will allow or deny
access to the client. If access is denied, the client will receive a 403
Access Denied response. If access is allowed, API Gateway will proceed with
the backend integration configured on the method that was called.
This function must generate a policy that is associated with the recognized
principal user identifier. Depending on your use case, you might store
policies in a DB, or generate them on the fly.
Keep in mind, the policy is cached for 5 minutes by default (TTL is
configurable in the authorizer) and will apply to subsequent calls to any
method/resource in the RestApi made with the same token.
The example policy below denies access to all resources in the RestApi.
'''
tmp = event['methodArn'].split(':')
apiGatewayArnTmp = tmp[5].split('/')
awsAccountId = tmp[4]
policy = AuthPolicy(principalId, awsAccountId)
policy.restApiId = apiGatewayArnTmp[0]
policy.region = tmp[3]
policy.stage = apiGatewayArnTmp[1]
policy.denyAllMethods()
#policy.allowMethod(HttpVerb.GET, '/pets/*')
# Finally, build the policy
authResponse = policy.build()
# new! -- add additional key-value pairs associated with the authenticated principal
# these are made available by APIGW like so: $context.authorizer.<key>
# additional context is cached
context = {
'key': 'value', # $context.authorizer.key -> value
'number': 1,
'bool': True
}
# context['arr'] = ['foo'] <- this is invalid, APIGW will not accept it
# context['obj'] = {'foo':'bar'} <- also invalid
authResponse['context'] = context
return authResponse
|
[
"def",
"lambda_handler",
"(",
"event",
",",
"context",
")",
":",
"# incoming token value",
"token",
"=",
"event",
"[",
"'authorizationToken'",
"]",
"print",
"(",
"\"Method ARN: \"",
"+",
"event",
"[",
"'methodArn'",
"]",
")",
"principalId",
"=",
"'user|a1b2c3d4'",
"'''\n You can send a 401 Unauthorized response to the client by failing like so:\n\n raise Exception('Unauthorized')\n\n If the token is valid, a policy must be generated which will allow or deny\n access to the client. If access is denied, the client will receive a 403\n Access Denied response. If access is allowed, API Gateway will proceed with\n the backend integration configured on the method that was called.\n\n This function must generate a policy that is associated with the recognized\n principal user identifier. Depending on your use case, you might store\n policies in a DB, or generate them on the fly.\n\n Keep in mind, the policy is cached for 5 minutes by default (TTL is\n configurable in the authorizer) and will apply to subsequent calls to any\n method/resource in the RestApi made with the same token.\n\n The example policy below denies access to all resources in the RestApi.\n '''",
"tmp",
"=",
"event",
"[",
"'methodArn'",
"]",
".",
"split",
"(",
"':'",
")",
"apiGatewayArnTmp",
"=",
"tmp",
"[",
"5",
"]",
".",
"split",
"(",
"'/'",
")",
"awsAccountId",
"=",
"tmp",
"[",
"4",
"]",
"policy",
"=",
"AuthPolicy",
"(",
"principalId",
",",
"awsAccountId",
")",
"policy",
".",
"restApiId",
"=",
"apiGatewayArnTmp",
"[",
"0",
"]",
"policy",
".",
"region",
"=",
"tmp",
"[",
"3",
"]",
"policy",
".",
"stage",
"=",
"apiGatewayArnTmp",
"[",
"1",
"]",
"policy",
".",
"denyAllMethods",
"(",
")",
"#policy.allowMethod(HttpVerb.GET, '/pets/*')",
"# Finally, build the policy",
"authResponse",
"=",
"policy",
".",
"build",
"(",
")",
"# new! -- add additional key-value pairs associated with the authenticated principal",
"# these are made available by APIGW like so: $context.authorizer.<key>",
"# additional context is cached",
"context",
"=",
"{",
"'key'",
":",
"'value'",
",",
"# $context.authorizer.key -> value",
"'number'",
":",
"1",
",",
"'bool'",
":",
"True",
"}",
"# context['arr'] = ['foo'] <- this is invalid, APIGW will not accept it",
"# context['obj'] = {'foo':'bar'} <- also invalid",
"authResponse",
"[",
"'context'",
"]",
"=",
"context",
"return",
"authResponse"
] |
Validate the incoming token and produce the principal user identifier
associated with the token. This can be accomplished in a number of ways:
1. Call out to the OAuth provider
2. Decode a JWT token inline
3. Lookup in a self-managed DB
|
[
"Validate",
"the",
"incoming",
"token",
"and",
"produce",
"the",
"principal",
"user",
"identifier",
"associated",
"with",
"the",
"token",
".",
"This",
"can",
"be",
"accomplished",
"in",
"a",
"number",
"of",
"ways",
":"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/api-gateway-authorizer-python/lambda_function.py#L6-L68
|
train
|
This function is called by the Lambda function that is called when the event is received from the API Gateway. It is responsible for generating the authResponse and then sending it to the backend.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,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xp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11110 + 0o23) + chr(440 - 385) + chr(0b1010 + 0o50), 0b1000), ehT0Px3KOsy9(chr(1162 - 1114) + chr(0b1010100 + 0o33) + chr(0b110010) + chr(0b110101) + chr(0b11111 + 0o25), 28638 - 28630), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(0b110110) + chr(349 - 300), 10705 - 10697), ehT0Px3KOsy9(chr(643 - 595) + chr(0b110000 + 0o77) + chr(49) + chr(2617 - 2562) + '\x35', 23174 - 23166), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + chr(51) + chr(0b110010) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b110001) + '\x30', 22222 - 22214), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(1509 - 1454) + chr(0b110110 + 0o1), 0b1000), ehT0Px3KOsy9(chr(1485 - 1437) + '\157' + chr(1355 - 1305) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(1434 - 1323) + chr(0b101 + 0o55) + chr(48) + chr(0b1001 + 0o50), 0b1000), ehT0Px3KOsy9(chr(207 - 159) + '\x6f' + '\062' + chr(680 - 630) + '\065', 49688 - 49680), ehT0Px3KOsy9(chr(0b110000) + chr(7670 - 7559) + chr(0b110101) + chr(2563 - 2509), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(585 - 534) + '\x35', 58366 - 58358), ehT0Px3KOsy9('\x30' + chr(0b1101100 + 0o3) + chr(0b110001) + '\067' + chr(1714 - 1659), 8), ehT0Px3KOsy9(chr(117 - 69) + chr(0b1101111) + chr(736 - 687) + '\061' + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(11168 - 11057) + chr(0b110001) + chr(55) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9521 - 9410) + '\063' + chr(0b110110), 41546 - 41538), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(9072 - 8961) + chr(0b110001 + 0o4) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101110 + 0o3) + chr(2614 - 2559) + chr(0b100010 + 0o17), 8), ehT0Px3KOsy9(chr(499 - 451) + chr(0b1101111) + '\x33' + '\061' + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + chr(4291 - 4180) + chr(0b1 + 0o60) + chr(0b10 + 0o61), ord("\x08")), ehT0Px3KOsy9(chr(1759 - 1711) + '\x6f' + '\x31' + chr(55) + '\065', 8), ehT0Px3KOsy9('\060' + chr(0b1000000 + 0o57) + '\x32' + chr(1689 - 1636) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(111) + chr(0b110010) + chr(0b110001) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\157' + chr(0b100 + 0o57) + chr(1552 - 1503) + chr(49), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2374 - 2325), 0o10), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\x6f' + '\061' + chr(49) + chr(0b100100 + 0o15), 0o10), ehT0Px3KOsy9('\060' + chr(0b100011 + 0o114) + '\062' + chr(152 - 101) + chr(809 - 755), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(244 - 195) + chr(0b110110) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(51) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + '\x31' + '\x35', 45887 - 45879), ehT0Px3KOsy9(chr(0b110000) + chr(5096 - 4985) + chr(0b100100 + 0o21) + chr(0b10110 + 0o36), ord("\x08")), ehT0Px3KOsy9(chr(2159 - 2111) + chr(0b101100 + 0o103) + chr(0b110001) + '\x37' + '\061', 8), ehT0Px3KOsy9(chr(48) + chr(0b1010110 + 0o31) + '\067' + chr(0b11001 + 0o31), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(0b10010 + 0o42) + chr(0b110101), 29367 - 29359), ehT0Px3KOsy9('\x30' + chr(6163 - 6052) + chr(0b110011) + chr(0b11101 + 0o32) + chr(0b101000 + 0o15), 16813 - 16805), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(3418 - 3307) + chr(1299 - 1248) + chr(51) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(55) + chr(0b10111 + 0o33), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(53) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(1685 - 1634) + '\066' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(225 - 176) + chr(2670 - 2618) + chr(538 - 488), 34500 - 34492)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + '\065' + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'T'), chr(0b1100100) + chr(101) + chr(1324 - 1225) + '\x6f' + chr(0b1100100) + chr(0b1010100 + 0o21))(chr(11345 - 11228) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def G1tjmr_C39El(SGm65G84ZKM5, vUUG4_3aIqQC):
mTy3fac_AqJ5 = SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x1b\xd9\x85\x15\xbf:\x16o\xe0\xe1G\xf2\x11\x1f\x16uM\x17'), chr(0b1100100) + chr(2217 - 2116) + chr(99) + '\x6f' + chr(0b1100100) + '\x65')('\x75' + chr(1199 - 1083) + chr(0b1100110) + chr(0b101100 + 0o1) + chr(95 - 39))]
zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'7\xc9\x85\x15\xbf,_T\xd3\xdb\x14\xbd'), '\x64' + chr(101) + chr(6613 - 6514) + chr(111) + chr(0b111 + 0o135) + '\x65')(chr(0b1110101) + chr(4212 - 4096) + '\146' + chr(0b1010 + 0o43) + chr(56)) + SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x17\xc9\x85\x15\xbf,>g\xef'), chr(0b1100100) + '\145' + chr(3926 - 3827) + chr(0b1000 + 0o147) + chr(9293 - 9193) + chr(0b1100101 + 0o0))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(0b100011 + 0o12) + chr(0b1111 + 0o51))])
x6oJdmXi7FKM = xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\xdf\x94\x0f\xac)Nw\xb3\xf6\x1d\xf9K'), '\144' + chr(101) + chr(0b1100011) + '\157' + chr(0b1100100) + '\145')('\165' + chr(0b1110001 + 0o3) + '\146' + '\055' + '\x38')
J8N_NsgU9OIv = SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x17\xc9\x85\x15\xbf,>g\xef'), chr(100) + chr(0b100100 + 0o101) + chr(6384 - 6285) + chr(111) + chr(9959 - 9859) + chr(101))('\x75' + chr(6389 - 6273) + '\146' + '\x2d' + '\070')].split(xafqLlk3kkUe(SXOLrMavuUCe(b'@'), '\x64' + chr(0b100110 + 0o77) + chr(3123 - 3024) + '\x6f' + '\x64' + chr(9831 - 9730))('\165' + chr(116) + chr(0b110001 + 0o65) + '\x2d' + '\x38'))
pGiv1SS4KoEi = J8N_NsgU9OIv[ehT0Px3KOsy9('\x30' + chr(0b1100000 + 0o17) + chr(2257 - 2204), 0b1000)].split(xafqLlk3kkUe(SXOLrMavuUCe(b'U'), chr(0b101011 + 0o71) + chr(0b1100101) + '\x63' + '\x6f' + chr(0b1100100) + chr(101))(chr(5397 - 5280) + '\x74' + '\x66' + '\055' + chr(0b111000)))
vDNM7t1ey1Eq = J8N_NsgU9OIv[ehT0Px3KOsy9(chr(2036 - 1988) + chr(111) + chr(52), 44108 - 44100)]
s617wIX8Hbiy = VoXCnYt2h0mA(x6oJdmXi7FKM, vDNM7t1ey1Eq)
s617wIX8Hbiy.wAw4OykGFhfX = pGiv1SS4KoEi[ehT0Px3KOsy9(chr(48) + chr(0b1101101 + 0o2) + chr(48), ord("\x08"))]
s617wIX8Hbiy.bgxypzqGSFYT = J8N_NsgU9OIv[ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011), 0o10)]
s617wIX8Hbiy.VRrhsVxQMv59 = pGiv1SS4KoEi[ehT0Px3KOsy9('\060' + '\157' + chr(1651 - 1602), 8)]
xafqLlk3kkUe(s617wIX8Hbiy, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e\xc9\x9f\x04\x91$\x13X\xe4\xe1F\xf2\x1b8'), chr(0b1100100) + chr(101) + '\x63' + chr(0b1101001 + 0o6) + '\144' + chr(0b1100101))('\165' + '\x74' + chr(5798 - 5696) + '\x2d' + chr(56)))()
lDfOJlXWU_W1 = s617wIX8Hbiy.build()
vUUG4_3aIqQC = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x11\xc9\x88'), chr(0b1100100) + chr(0b1100000 + 0o5) + chr(99) + chr(11528 - 11417) + '\144' + '\x65')(chr(117) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(0b111000)): xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\xcd\x9d\x08\xb5'), '\144' + chr(101) + chr(99) + chr(1176 - 1065) + chr(4804 - 4704) + chr(0b1100101))(chr(117) + chr(10083 - 9967) + chr(7086 - 6984) + chr(45) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\xd9\x9c\x1f\xb5:'), chr(7748 - 7648) + chr(0b1100101) + chr(9539 - 9440) + chr(9101 - 8990) + chr(9020 - 8920) + '\x65')('\165' + '\164' + chr(0b1101 + 0o131) + '\055' + chr(56)): ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1457 - 1408), 8), xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\xc3\x9e\x11'), '\144' + chr(8312 - 8211) + '\x63' + chr(111) + chr(0b1010111 + 0o15) + chr(101))('\x75' + '\164' + chr(455 - 353) + '\055' + '\070'): ehT0Px3KOsy9(chr(0b110000) + chr(0b101000 + 0o107) + chr(0b110001), 8)}
lDfOJlXWU_W1[xafqLlk3kkUe(SXOLrMavuUCe(b'\x19\xc3\x9f\t\xb50\x0b'), chr(7190 - 7090) + chr(0b1100101) + '\143' + chr(111) + chr(100) + chr(0b1100101))(chr(117) + chr(116) + '\146' + chr(1812 - 1767) + chr(1527 - 1471))] = vUUG4_3aIqQC
return lDfOJlXWU_W1
|
awslabs/serverless-application-model
|
examples/apps/api-gateway-authorizer-python/lambda_function.py
|
AuthPolicy._getStatementForEffect
|
def _getStatementForEffect(self, effect, methods):
'''This function loops over an array of objects containing a resourceArn and
conditions statement and generates the array of statements for the policy.'''
statements = []
if len(methods) > 0:
statement = self._getEmptyStatement(effect)
for curMethod in methods:
if curMethod['conditions'] is None or len(curMethod['conditions']) == 0:
statement['Resource'].append(curMethod['resourceArn'])
else:
conditionalStatement = self._getEmptyStatement(effect)
conditionalStatement['Resource'].append(curMethod['resourceArn'])
conditionalStatement['Condition'] = curMethod['conditions']
statements.append(conditionalStatement)
if statement['Resource']:
statements.append(statement)
return statements
|
python
|
def _getStatementForEffect(self, effect, methods):
'''This function loops over an array of objects containing a resourceArn and
conditions statement and generates the array of statements for the policy.'''
statements = []
if len(methods) > 0:
statement = self._getEmptyStatement(effect)
for curMethod in methods:
if curMethod['conditions'] is None or len(curMethod['conditions']) == 0:
statement['Resource'].append(curMethod['resourceArn'])
else:
conditionalStatement = self._getEmptyStatement(effect)
conditionalStatement['Resource'].append(curMethod['resourceArn'])
conditionalStatement['Condition'] = curMethod['conditions']
statements.append(conditionalStatement)
if statement['Resource']:
statements.append(statement)
return statements
|
[
"def",
"_getStatementForEffect",
"(",
"self",
",",
"effect",
",",
"methods",
")",
":",
"statements",
"=",
"[",
"]",
"if",
"len",
"(",
"methods",
")",
">",
"0",
":",
"statement",
"=",
"self",
".",
"_getEmptyStatement",
"(",
"effect",
")",
"for",
"curMethod",
"in",
"methods",
":",
"if",
"curMethod",
"[",
"'conditions'",
"]",
"is",
"None",
"or",
"len",
"(",
"curMethod",
"[",
"'conditions'",
"]",
")",
"==",
"0",
":",
"statement",
"[",
"'Resource'",
"]",
".",
"append",
"(",
"curMethod",
"[",
"'resourceArn'",
"]",
")",
"else",
":",
"conditionalStatement",
"=",
"self",
".",
"_getEmptyStatement",
"(",
"effect",
")",
"conditionalStatement",
"[",
"'Resource'",
"]",
".",
"append",
"(",
"curMethod",
"[",
"'resourceArn'",
"]",
")",
"conditionalStatement",
"[",
"'Condition'",
"]",
"=",
"curMethod",
"[",
"'conditions'",
"]",
"statements",
".",
"append",
"(",
"conditionalStatement",
")",
"if",
"statement",
"[",
"'Resource'",
"]",
":",
"statements",
".",
"append",
"(",
"statement",
")",
"return",
"statements"
] |
This function loops over an array of objects containing a resourceArn and
conditions statement and generates the array of statements for the policy.
|
[
"This",
"function",
"loops",
"over",
"an",
"array",
"of",
"objects",
"containing",
"a",
"resourceArn",
"and",
"conditions",
"statement",
"and",
"generates",
"the",
"array",
"of",
"statements",
"for",
"the",
"policy",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/api-gateway-authorizer-python/lambda_function.py#L151-L171
|
train
|
This function loops over an array of objects containing a resourceArn and
conditions statement and generates the array of statements for the policy.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKs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qssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x37' + chr(1234 - 1179), 49407 - 49399), ehT0Px3KOsy9(chr(1039 - 991) + chr(111) + '\063' + chr(0b11 + 0o60) + '\x33', 17341 - 17333), ehT0Px3KOsy9('\060' + chr(0b1010110 + 0o31) + '\x33' + chr(48), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\x30' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\063', 41103 - 41095), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + '\063' + chr(54), 62836 - 62828), ehT0Px3KOsy9('\x30' + chr(504 - 393) + '\065' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(54) + chr(406 - 357), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\157' + chr(49) + chr(0b110000) + '\066', 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b110000 + 0o2) + '\061', 8699 - 8691), ehT0Px3KOsy9(chr(689 - 641) + '\x6f' + chr(0b110001) + chr(0b100100 + 0o14) + chr(2138 - 2090), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010100 + 0o33) + chr(0b110001) + '\x34' + chr(74 - 26), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1000110 + 0o51) + chr(0b1011 + 0o50) + chr(0b101111 + 0o1) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(1680 - 1569) + '\062' + '\060' + chr(0b1101 + 0o52), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110001) + '\066', 0o10), ehT0Px3KOsy9(chr(1427 - 1379) + chr(10628 - 10517) + chr(50) + chr(0b100101 + 0o20) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(51) + '\x36', 34136 - 34128), ehT0Px3KOsy9(chr(48) + chr(0b11 + 0o154) + '\x32' + '\x31' + chr(0b0 + 0o62), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(0b100011 + 0o20) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(256 - 208) + chr(0b1101111) + chr(2405 - 2355) + chr(0b110001) + chr(0b10010 + 0o41), 34672 - 34664), ehT0Px3KOsy9(chr(0b110000) + chr(0b110001 + 0o76) + chr(50) + '\x30' + chr(0b111 + 0o54), 0o10), ehT0Px3KOsy9(chr(2266 - 2218) + '\157' + chr(0b110001) + chr(0b10100 + 0o43) + chr(49), 0b1000), ehT0Px3KOsy9(chr(890 - 842) + chr(111) + chr(0b11010 + 0o27) + '\x37' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(198 - 150) + '\157' + chr(51) + chr(0b101100 + 0o4) + chr(0b110000), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + '\x32' + chr(0b101011 + 0o7), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5875 - 5764) + chr(2281 - 2231) + '\x31' + chr(0b101 + 0o56), 8), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(738 - 688) + '\060' + chr(624 - 573), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110000 + 0o2) + chr(0b110011) + chr(1896 - 1848), 4223 - 4215), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011001 + 0o26) + '\064' + chr(0b101101 + 0o5), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\x35' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010111 + 0o30) + '\062' + '\x37' + '\x32', 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + '\062' + '\x30' + '\060', 0b1000), ehT0Px3KOsy9('\x30' + chr(2722 - 2611) + chr(55) + '\060', 25900 - 25892), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + chr(797 - 742) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(1880 - 1832) + chr(0b1100011 + 0o14) + chr(2218 - 2166) + chr(54), 38961 - 38953), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(12009 - 11898) + chr(0b1101 + 0o44) + chr(997 - 946) + chr(0b1101 + 0o47), 49662 - 49654), ehT0Px3KOsy9(chr(1481 - 1433) + '\x6f' + '\x31' + chr(2297 - 2246) + '\x31', 32561 - 32553), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(2664 - 2611) + chr(203 - 154), 0b1000), ehT0Px3KOsy9(chr(916 - 868) + '\x6f' + '\062' + '\x31' + chr(80 - 26), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b101000 + 0o107) + chr(0b110101) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x91'), chr(100) + chr(3326 - 3225) + chr(0b1100011) + chr(111) + '\144' + '\145')('\x75' + chr(0b100100 + 0o120) + '\146' + '\x2d' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def tx0QfBCLobxr(oVre8I6UXc3b, AruPxu5zDQrG, ei_WkXhIFGHj):
t3nDT3tQJ6l3 = []
if c2A0yzQpDQB3(ei_WkXhIFGHj) > ehT0Px3KOsy9(chr(877 - 829) + chr(111) + chr(0b110000), 21211 - 21203):
jnYUlAnryFDm = oVre8I6UXc3b._getEmptyStatement(AruPxu5zDQrG)
for _IeMGfFT8mrv in ei_WkXhIFGHj:
if _IeMGfFT8mrv[xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc\xb4v"j*B\x9eq5'), '\x64' + chr(101) + '\x63' + chr(0b11101 + 0o122) + chr(0b11100 + 0o110) + '\145')(chr(2259 - 2142) + chr(0b1101110 + 0o6) + chr(486 - 384) + '\055' + chr(2938 - 2882))] is None or c2A0yzQpDQB3(_IeMGfFT8mrv[xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc\xb4v"j*B\x9eq5'), '\x64' + chr(0b110010 + 0o63) + chr(0b111111 + 0o44) + chr(111) + '\144' + '\x65')(chr(10237 - 10120) + '\164' + '\146' + chr(45) + '\070')]) == ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + chr(0b11111 + 0o21), 8):
xafqLlk3kkUe(jnYUlAnryFDm[xafqLlk3kkUe(SXOLrMavuUCe(b'\xed\xbek)v,H\x94'), '\144' + chr(0b1100101) + chr(99) + chr(0b110111 + 0o70) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b111101 + 0o51) + chr(0b101101) + chr(2189 - 2133))], xafqLlk3kkUe(SXOLrMavuUCe(b'\xde\xabh#m:'), chr(0b110011 + 0o61) + '\145' + chr(0b1100011) + '\157' + '\144' + '\x65')(chr(0b1110101) + '\164' + chr(102) + chr(0b101011 + 0o2) + chr(56)))(_IeMGfFT8mrv[xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd\xbek)v,H\x94^4\xff'), chr(8481 - 8381) + chr(0b1100101) + chr(0b111 + 0o134) + '\x6f' + chr(3718 - 3618) + chr(0b1100101))(chr(0b1110101) + chr(8657 - 8541) + '\x66' + chr(0b101101) + '\x38')])
else:
zvb9dE4iClNQ = oVre8I6UXc3b._getEmptyStatement(AruPxu5zDQrG)
xafqLlk3kkUe(zvb9dE4iClNQ[xafqLlk3kkUe(SXOLrMavuUCe(b'\xed\xbek)v,H\x94'), '\144' + chr(0b1100101) + '\143' + chr(7261 - 7150) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(9086 - 8984) + '\055' + chr(0b1100 + 0o54))], xafqLlk3kkUe(SXOLrMavuUCe(b'\xde\xabh#m:'), '\144' + chr(101) + chr(99) + chr(0b1100 + 0o143) + chr(0b1100100) + '\145')(chr(0b1100101 + 0o20) + chr(116) + '\x66' + chr(1864 - 1819) + '\070'))(_IeMGfFT8mrv[xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd\xbek)v,H\x94^4\xff'), '\x64' + '\x65' + chr(0b1100011) + '\x6f' + '\144' + chr(0b1100101))('\x75' + chr(0b1110100) + '\146' + chr(88 - 43) + chr(56))])
zvb9dE4iClNQ[xafqLlk3kkUe(SXOLrMavuUCe(b'\xfc\xb4v"j*B\x9eq'), chr(100) + chr(5104 - 5003) + chr(0b1100011) + chr(111) + chr(0b1001110 + 0o26) + chr(101))('\x75' + '\x74' + chr(0b1100110) + chr(1765 - 1720) + chr(0b11111 + 0o31))] = _IeMGfFT8mrv[xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc\xb4v"j*B\x9eq5'), chr(3356 - 3256) + chr(0b10011 + 0o122) + chr(0b1011110 + 0o5) + chr(3432 - 3321) + chr(0b1000011 + 0o41) + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(0b11010 + 0o114) + chr(45) + chr(0b11000 + 0o40))]
xafqLlk3kkUe(t3nDT3tQJ6l3, xafqLlk3kkUe(SXOLrMavuUCe(b'\xde\xabh#m:'), chr(0b1000000 + 0o44) + '\x65' + chr(7302 - 7203) + chr(12276 - 12165) + chr(0b100011 + 0o101) + '\145')(chr(117) + chr(11315 - 11199) + '\146' + chr(0b101 + 0o50) + chr(0b111000)))(zvb9dE4iClNQ)
if jnYUlAnryFDm[xafqLlk3kkUe(SXOLrMavuUCe(b'\xed\xbek)v,H\x94'), chr(1349 - 1249) + chr(101) + chr(9151 - 9052) + chr(111) + chr(1355 - 1255) + chr(0b11100 + 0o111))(chr(0b1110010 + 0o3) + '\164' + '\146' + chr(0b11010 + 0o23) + chr(0b111000))]:
xafqLlk3kkUe(t3nDT3tQJ6l3, xafqLlk3kkUe(SXOLrMavuUCe(b'\xde\xabh#m:'), '\144' + chr(101) + chr(99) + '\x6f' + chr(0b1100100) + chr(101))('\x75' + '\164' + chr(0b1011111 + 0o7) + chr(0b100111 + 0o6) + chr(0b111000)))(jnYUlAnryFDm)
return t3nDT3tQJ6l3
|
awslabs/serverless-application-model
|
samtranslator/plugins/policies/policy_templates_plugin.py
|
PolicyTemplatesForFunctionPlugin.on_before_transform_resource
|
def on_before_transform_resource(self, logical_id, resource_type, resource_properties):
"""
Hook method that gets called before "each" SAM resource gets processed
:param string logical_id: Logical ID of the resource being processed
:param string resource_type: Type of the resource being processed
:param dict resource_properties: Properties of the resource
:return: Nothing
"""
if not self._is_supported(resource_type):
return
function_policies = FunctionPolicies(resource_properties, self._policy_template_processor)
if len(function_policies) == 0:
# No policies to process
return
result = []
for policy_entry in function_policies.get():
if policy_entry.type is not PolicyTypes.POLICY_TEMPLATE:
# If we don't know the type, skip processing and pass to result as is.
result.append(policy_entry.data)
continue
# We are processing policy templates. We know they have a particular structure:
# {"templateName": { parameter_values_dict }}
template_data = policy_entry.data
template_name = list(template_data.keys())[0]
template_parameters = list(template_data.values())[0]
try:
# 'convert' will return a list of policy statements
result.append(self._policy_template_processor.convert(template_name, template_parameters))
except InsufficientParameterValues as ex:
# Exception's message will give lot of specific details
raise InvalidResourceException(logical_id, str(ex))
except InvalidParameterValues:
raise InvalidResourceException(logical_id,
"Must specify valid parameter values for policy template '{}'"
.format(template_name))
# Save the modified policies list to the input
resource_properties[FunctionPolicies.POLICIES_PROPERTY_NAME] = result
|
python
|
def on_before_transform_resource(self, logical_id, resource_type, resource_properties):
"""
Hook method that gets called before "each" SAM resource gets processed
:param string logical_id: Logical ID of the resource being processed
:param string resource_type: Type of the resource being processed
:param dict resource_properties: Properties of the resource
:return: Nothing
"""
if not self._is_supported(resource_type):
return
function_policies = FunctionPolicies(resource_properties, self._policy_template_processor)
if len(function_policies) == 0:
# No policies to process
return
result = []
for policy_entry in function_policies.get():
if policy_entry.type is not PolicyTypes.POLICY_TEMPLATE:
# If we don't know the type, skip processing and pass to result as is.
result.append(policy_entry.data)
continue
# We are processing policy templates. We know they have a particular structure:
# {"templateName": { parameter_values_dict }}
template_data = policy_entry.data
template_name = list(template_data.keys())[0]
template_parameters = list(template_data.values())[0]
try:
# 'convert' will return a list of policy statements
result.append(self._policy_template_processor.convert(template_name, template_parameters))
except InsufficientParameterValues as ex:
# Exception's message will give lot of specific details
raise InvalidResourceException(logical_id, str(ex))
except InvalidParameterValues:
raise InvalidResourceException(logical_id,
"Must specify valid parameter values for policy template '{}'"
.format(template_name))
# Save the modified policies list to the input
resource_properties[FunctionPolicies.POLICIES_PROPERTY_NAME] = result
|
[
"def",
"on_before_transform_resource",
"(",
"self",
",",
"logical_id",
",",
"resource_type",
",",
"resource_properties",
")",
":",
"if",
"not",
"self",
".",
"_is_supported",
"(",
"resource_type",
")",
":",
"return",
"function_policies",
"=",
"FunctionPolicies",
"(",
"resource_properties",
",",
"self",
".",
"_policy_template_processor",
")",
"if",
"len",
"(",
"function_policies",
")",
"==",
"0",
":",
"# No policies to process",
"return",
"result",
"=",
"[",
"]",
"for",
"policy_entry",
"in",
"function_policies",
".",
"get",
"(",
")",
":",
"if",
"policy_entry",
".",
"type",
"is",
"not",
"PolicyTypes",
".",
"POLICY_TEMPLATE",
":",
"# If we don't know the type, skip processing and pass to result as is.",
"result",
".",
"append",
"(",
"policy_entry",
".",
"data",
")",
"continue",
"# We are processing policy templates. We know they have a particular structure:",
"# {\"templateName\": { parameter_values_dict }}",
"template_data",
"=",
"policy_entry",
".",
"data",
"template_name",
"=",
"list",
"(",
"template_data",
".",
"keys",
"(",
")",
")",
"[",
"0",
"]",
"template_parameters",
"=",
"list",
"(",
"template_data",
".",
"values",
"(",
")",
")",
"[",
"0",
"]",
"try",
":",
"# 'convert' will return a list of policy statements",
"result",
".",
"append",
"(",
"self",
".",
"_policy_template_processor",
".",
"convert",
"(",
"template_name",
",",
"template_parameters",
")",
")",
"except",
"InsufficientParameterValues",
"as",
"ex",
":",
"# Exception's message will give lot of specific details",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"str",
"(",
"ex",
")",
")",
"except",
"InvalidParameterValues",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"\"Must specify valid parameter values for policy template '{}'\"",
".",
"format",
"(",
"template_name",
")",
")",
"# Save the modified policies list to the input",
"resource_properties",
"[",
"FunctionPolicies",
".",
"POLICIES_PROPERTY_NAME",
"]",
"=",
"result"
] |
Hook method that gets called before "each" SAM resource gets processed
:param string logical_id: Logical ID of the resource being processed
:param string resource_type: Type of the resource being processed
:param dict resource_properties: Properties of the resource
:return: Nothing
|
[
"Hook",
"method",
"that",
"gets",
"called",
"before",
"each",
"SAM",
"resource",
"gets",
"processed"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/policies/policy_templates_plugin.py#L31-L78
|
train
|
Hook method that gets called before each SAM resource gets processed
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEOh2,LgE_IO_tHXvM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5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1737 - 1689) + chr(0b1101111) + chr(53) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011011 + 0o24) + chr(51) + '\066' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2258 - 2208) + chr(2478 - 2428), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101000 + 0o12) + chr(50) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b10 + 0o61) + chr(0b110010) + '\064', 63264 - 63256), ehT0Px3KOsy9(chr(2247 - 2199) + '\157' + chr(0b10000 + 0o41) + chr(52) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10000 + 0o41) + chr(0b101000 + 0o14) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(2093 - 2045) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\157' + chr(0b110001) + '\x30' + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(0b110111) + chr(51), 0o10), ehT0Px3KOsy9(chr(1980 - 1932) + chr(5357 - 5246) + chr(0b110010) + '\x37' + chr(0b110101), 0o10), ehT0Px3KOsy9('\060' + chr(0b100010 + 0o115) + chr(0b100000 + 0o22) + '\062' + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(54) + chr(52), 0o10), ehT0Px3KOsy9(chr(652 - 604) + chr(111) + chr(50) + chr(0b101 + 0o57) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + chr(53) + chr(0b1101 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + '\064' + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(8648 - 8537) + chr(2367 - 2317) + chr(0b110100) + chr(0b11011 + 0o25), 0o10), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + chr(0b110001) + '\x34' + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + '\x32' + '\x34' + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100000 + 0o17) + chr(0b110100) + chr(0b1111 + 0o41), 0o10), ehT0Px3KOsy9('\060' + chr(7649 - 7538) + '\061' + chr(0b110011) + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(0b101110 + 0o101) + chr(49) + '\x35' + '\x31', 20709 - 20701), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001111 + 0o40) + '\x33' + chr(1725 - 1670) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\062' + chr(0b110100), 8), ehT0Px3KOsy9(chr(504 - 456) + chr(0b1101111) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b111 + 0o150) + chr(55) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000001 + 0o56) + chr(0b10111 + 0o32) + chr(54) + chr(55), 14189 - 14181), ehT0Px3KOsy9('\x30' + chr(6893 - 6782) + '\062' + chr(52) + '\x37', 28761 - 28753), ehT0Px3KOsy9('\060' + chr(0b101000 + 0o107) + '\061' + chr(0b101010 + 0o7) + chr(1979 - 1928), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11101 + 0o122) + chr(51) + chr(0b10101 + 0o33) + chr(48), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(758 - 708) + '\066' + chr(0b101100 + 0o13), 58635 - 58627), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100010 + 0o20) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + chr(51) + chr(0b110000) + chr(2237 - 2189), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(0b110011) + chr(49), 8), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b111111 + 0o60) + '\x31' + chr(2036 - 1982) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(0b110001), 22306 - 22298), ehT0Px3KOsy9('\x30' + chr(6315 - 6204) + '\063' + '\x30' + '\x32', 40983 - 40975), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1110 + 0o50) + '\061', 63314 - 63306), ehT0Px3KOsy9('\x30' + chr(4957 - 4846) + chr(49) + chr(0b11000 + 0o33) + chr(0b110100), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101011 + 0o4) + chr(0b0 + 0o65) + chr(0b111 + 0o51), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x04'), chr(0b1100100) + '\x65' + chr(99) + '\x6f' + '\144' + '\145')(chr(0b1110101) + chr(116) + chr(102) + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def SvZckcG871D3(oVre8I6UXc3b, NpZr66MdBhVG, wObOWxcCoSC5, QgHO_KwjD4NI):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'u\x99a\xcf\xa7\x13\x104)\t\xc9\xf3\xd0'), '\144' + chr(101) + '\x63' + '\x6f' + chr(0b1010101 + 0o17) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(0b100101 + 0o23)))(wObOWxcCoSC5):
return
aPGD38ExPbsX = d8XWLwSMJ1m_(QgHO_KwjD4NI, oVre8I6UXc3b._policy_template_processor)
if c2A0yzQpDQB3(aPGD38ExPbsX) == ehT0Px3KOsy9('\x30' + chr(111) + '\060', 8):
return
ShZmEKfTkAOZ = []
for W8gif_57JI2i in xafqLlk3kkUe(aPGD38ExPbsX, xafqLlk3kkUe(SXOLrMavuUCe(b'M\x95f'), chr(6761 - 6661) + '\x65' + '\143' + '\x6f' + chr(690 - 590) + '\x65')(chr(117) + '\164' + chr(0b1100110) + chr(442 - 397) + chr(0b100010 + 0o26)))():
if xafqLlk3kkUe(W8gif_57JI2i, xafqLlk3kkUe(SXOLrMavuUCe(b']\x9dC\xfd\xad\x037\x06+.\xcd\xe0'), chr(8428 - 8328) + chr(0b11010 + 0o113) + chr(99) + chr(258 - 147) + '\144' + '\x65')('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b100101 + 0o10) + chr(0b110001 + 0o7))) is not xafqLlk3kkUe(YDHMfN5EeoKo, xafqLlk3kkUe(SXOLrMavuUCe(b'z\xbf^\xd9\x97??\x10\x036\xed\xda\xf5\xf0j'), '\x64' + '\145' + '\x63' + chr(111) + chr(7637 - 7537) + '\145')(chr(117) + chr(0b1110100) + '\x66' + chr(0b100011 + 0o12) + '\070')):
xafqLlk3kkUe(ShZmEKfTkAOZ, xafqLlk3kkUe(SXOLrMavuUCe(b'K\x80b\xf5\xba\x02'), '\x64' + '\x65' + chr(0b1100011) + '\x6f' + '\x64' + '\x65')('\x75' + '\164' + chr(102) + chr(45) + chr(3037 - 2981)))(xafqLlk3kkUe(W8gif_57JI2i, xafqLlk3kkUe(SXOLrMavuUCe(b'\x7f\xbc|\xfa\xa4P$r#\x1d\xfb\xde'), chr(100) + '\x65' + chr(0b1100011) + chr(0b1101111) + '\x64' + '\x65')(chr(5705 - 5588) + '\164' + chr(0b1100110) + chr(45) + '\x38')))
continue
vNmHHNJFDDWC = W8gif_57JI2i.ULnjp6D6efFH
atJVpui1QHD3 = YyaZ4tpXu4lf(vNmHHNJFDDWC.keys())[ehT0Px3KOsy9('\x30' + chr(12124 - 12013) + '\x30', 8)]
V0_g7OkpzFNZ = YyaZ4tpXu4lf(vNmHHNJFDDWC.SPnCNu54H1db())[ehT0Px3KOsy9(chr(0b110000) + chr(5935 - 5824) + chr(0b110000), 8)]
try:
xafqLlk3kkUe(ShZmEKfTkAOZ, xafqLlk3kkUe(SXOLrMavuUCe(b'K\x80b\xf5\xba\x02'), chr(100) + '\145' + chr(2750 - 2651) + '\157' + chr(7585 - 7485) + '\x65')(chr(0b1110101) + chr(764 - 648) + chr(0b101111 + 0o67) + chr(708 - 663) + chr(0b111000)))(xafqLlk3kkUe(oVre8I6UXc3b._policy_template_processor, xafqLlk3kkUe(SXOLrMavuUCe(b'A\x9c{\xc4\x92SU\x11+?\xf0\xec'), chr(0b1011000 + 0o14) + chr(0b1100101) + chr(7175 - 7076) + chr(6319 - 6208) + chr(0b111111 + 0o45) + chr(0b1001110 + 0o27))(chr(0b1110101) + '\x74' + chr(0b1100110) + '\x2d' + chr(56)))(atJVpui1QHD3, V0_g7OkpzFNZ))
except UcDcxasz3cn2 as DfdhY28yEwAF:
raise ow8Lll3lwq0h(NpZr66MdBhVG, M8_cKLkHVB2V(DfdhY28yEwAF))
except ximFfMoqQjty:
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'g\x85a\xe4\xf4\x15\x10!%\x12\xdb\xef\x94\xd2N\n\xc9\x02\x83P8\x1b\x98\xb9e~Y\x05\x87=\xa1\xdb`\xa5*Sw\xadC|Z\x9f~\xf9\xb7\x1f@0#\x16\xcd\xfa\xd5\xd0JF\x87\x1d\xde\x07'), chr(100) + chr(0b1001100 + 0o31) + chr(9646 - 9547) + chr(0b1101111) + '\144' + '\x65')(chr(117) + chr(0b1110100) + '\x66' + '\x2d' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'|\xc4`\xff\x9c\x073w\x16\x0b\xd8\xfc'), '\x64' + '\x65' + chr(0b110000 + 0o63) + chr(111) + chr(0b1100100) + chr(101))(chr(323 - 206) + chr(0b101011 + 0o111) + chr(0b1100110) + chr(1777 - 1732) + chr(0b111000)))(atJVpui1QHD3))
QgHO_KwjD4NI[d8XWLwSMJ1m_.vs6GPKF2oyE7] = ShZmEKfTkAOZ
|
awslabs/serverless-application-model
|
examples/apps/kinesis-analytics-process-kpl-record/lambda_function.py
|
lambda_handler
|
def lambda_handler(event, context):
'''A Python AWS Lambda function to process aggregated records sent to KinesisAnalytics.'''
raw_kpl_records = event['records']
output = [process_kpl_record(kpl_record) for kpl_record in raw_kpl_records]
# Print number of successful and failed records.
success_count = sum(1 for record in output if record['result'] == 'Ok')
failure_count = sum(1 for record in output if record['result'] == 'ProcessingFailed')
print('Processing completed. Successful records: {0}, Failed records: {1}.'.format(success_count, failure_count))
return {'records': output}
|
python
|
def lambda_handler(event, context):
'''A Python AWS Lambda function to process aggregated records sent to KinesisAnalytics.'''
raw_kpl_records = event['records']
output = [process_kpl_record(kpl_record) for kpl_record in raw_kpl_records]
# Print number of successful and failed records.
success_count = sum(1 for record in output if record['result'] == 'Ok')
failure_count = sum(1 for record in output if record['result'] == 'ProcessingFailed')
print('Processing completed. Successful records: {0}, Failed records: {1}.'.format(success_count, failure_count))
return {'records': output}
|
[
"def",
"lambda_handler",
"(",
"event",
",",
"context",
")",
":",
"raw_kpl_records",
"=",
"event",
"[",
"'records'",
"]",
"output",
"=",
"[",
"process_kpl_record",
"(",
"kpl_record",
")",
"for",
"kpl_record",
"in",
"raw_kpl_records",
"]",
"# Print number of successful and failed records.",
"success_count",
"=",
"sum",
"(",
"1",
"for",
"record",
"in",
"output",
"if",
"record",
"[",
"'result'",
"]",
"==",
"'Ok'",
")",
"failure_count",
"=",
"sum",
"(",
"1",
"for",
"record",
"in",
"output",
"if",
"record",
"[",
"'result'",
"]",
"==",
"'ProcessingFailed'",
")",
"print",
"(",
"'Processing completed. Successful records: {0}, Failed records: {1}.'",
".",
"format",
"(",
"success_count",
",",
"failure_count",
")",
")",
"return",
"{",
"'records'",
":",
"output",
"}"
] |
A Python AWS Lambda function to process aggregated records sent to KinesisAnalytics.
|
[
"A",
"Python",
"AWS",
"Lambda",
"function",
"to",
"process",
"aggregated",
"records",
"sent",
"to",
"KinesisAnalytics",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/kinesis-analytics-process-kpl-record/lambda_function.py#L25-L35
|
train
|
A Python AWS Lambda function to process aggregated records sent to KinesisAnalytics.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP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ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101010 + 0o5) + '\x36' + chr(2409 - 2357), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + chr(0b11010 + 0o27) + '\x32' + '\x37', 62526 - 62518), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + '\x33' + chr(2376 - 2321) + chr(0b1101 + 0o44), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(405 - 354) + '\065' + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11538 - 11427) + chr(0b110011) + chr(901 - 850) + chr(0b10000 + 0o44), 38373 - 38365), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x36' + '\x34', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(53) + chr(1279 - 1226), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100110 + 0o13) + '\065', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(52) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6615 - 6504) + chr(714 - 663) + chr(1421 - 1366) + '\067', 36962 - 36954), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11110 + 0o24) + chr(49) + chr(0b10001 + 0o42), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + '\x31' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + chr(0b101110 + 0o11) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(51) + chr(0b101000 + 0o13) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11 + 0o56) + chr(0b110110) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(266 - 155) + chr(2054 - 2005) + chr(52) + '\061', 51627 - 51619), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + '\x33' + chr(0b11000 + 0o34) + '\066', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b100011 + 0o114) + '\061' + chr(355 - 302) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(12299 - 12188) + '\x32' + chr(2612 - 2557), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + '\x31' + chr(1228 - 1173), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(0b110001) + chr(0b110011) + chr(2306 - 2254), ord("\x08")), ehT0Px3KOsy9(chr(1146 - 1098) + chr(111) + chr(2099 - 2049) + '\x35' + chr(1132 - 1078), 25270 - 25262), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + '\066' + chr(2085 - 2037), 0o10), ehT0Px3KOsy9(chr(1048 - 1000) + chr(0b1101111) + chr(49) + '\x35' + chr(347 - 298), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(49) + chr(49), 34550 - 34542), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(2118 - 2063) + '\060', 59873 - 59865), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2070 - 2020) + '\062' + chr(0b100000 + 0o27), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1101111) + chr(0b101111 + 0o4) + chr(642 - 592) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(2239 - 2191) + '\157' + '\063' + '\066' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(0b110 + 0o56) + chr(0b1001 + 0o52), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b10010 + 0o135) + chr(1650 - 1599) + chr(0b110110) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x36' + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + '\x33' + '\067' + chr(0b10010 + 0o45), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b110010) + '\x37', 8), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + '\x35' + chr(2026 - 1972), 22033 - 22025), ehT0Px3KOsy9(chr(48) + chr(0b1010000 + 0o37) + chr(0b10010 + 0o37) + chr(500 - 446) + '\x33', 2835 - 2827), ehT0Px3KOsy9(chr(631 - 583) + '\157' + chr(0b110010) + '\x33' + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(993 - 941), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + '\060' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(240 - 185) + '\060', 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + '\x35' + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a'), '\144' + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(4319 - 4219) + chr(0b1100101))('\x75' + chr(0b10010 + 0o142) + chr(102) + '\055' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def G1tjmr_C39El(SGm65G84ZKM5, vUUG4_3aIqQC):
zw26ZfYOi6Bw = SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'F2\x9a\x87\xaeP\x9e'), chr(0b1100100) + '\x65' + chr(7606 - 7507) + chr(0b1101111) + '\144' + chr(101))('\x75' + chr(116) + chr(0b1011000 + 0o16) + '\x2d' + '\x38')]
e1jVqMSBZ01Y = [UrBHDUWbEnrq(N0b6tkcH7WcE) for N0b6tkcH7WcE in zw26ZfYOi6Bw]
qNYQNgtRuaI9 = xkxBmo49x2An((ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001), ord("\x08")) for SIWbn6wzltxD in e1jVqMSBZ01Y if SIWbn6wzltxD[xafqLlk3kkUe(SXOLrMavuUCe(b'F2\x8a\x9d\xb0@'), '\x64' + chr(0b1100101) + '\143' + '\157' + chr(100) + '\x65')(chr(0b1100110 + 0o17) + chr(12461 - 12345) + '\146' + chr(45) + chr(56))] == xafqLlk3kkUe(SXOLrMavuUCe(b'{<'), '\x64' + chr(101) + chr(0b1100011) + chr(10839 - 10728) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + '\164' + chr(3786 - 3684) + chr(45) + chr(1267 - 1211))))
OHHikaj7ziyn = xkxBmo49x2An((ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001), 8) for SIWbn6wzltxD in e1jVqMSBZ01Y if SIWbn6wzltxD[xafqLlk3kkUe(SXOLrMavuUCe(b'F2\x8a\x9d\xb0@'), chr(0b1100100) + chr(5315 - 5214) + chr(99) + '\x6f' + '\x64' + '\x65')('\x75' + chr(0b110101 + 0o77) + chr(0b1100110) + '\x2d' + chr(56))] == xafqLlk3kkUe(SXOLrMavuUCe(b'd%\x96\x8b\xb9G\x9ed\r\x98\xcd\xadW\xb5\x13\x05'), '\x64' + chr(101) + chr(0b101101 + 0o66) + '\x6f' + chr(0b101 + 0o137) + chr(101))(chr(117) + chr(3607 - 3491) + chr(102) + chr(0b11 + 0o52) + chr(1717 - 1661))))
zLUzGokYBM2Z(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'd%\x96\x8b\xb9G\x9ed\r\x98\xab\xafQ\xb4\x06\r\x83\x18r+r\x8e\x90:\xfc\xdb\xf4\xb7\x87\xd0\x91\xc6\x93w\\\x16\xfck\xf6\xdcGm\xd9\x93\xecI\xc1-%\x9e\xe2\xa0[\xbdV\x13\x83\x0fx=8\xdd\x8aI\xf2\x89\xea\xfc'), chr(0b1100100) + chr(4719 - 4618) + chr(99) + chr(0b1101111) + '\144' + chr(6505 - 6404))(chr(117) + '\x74' + chr(0b1100110) + chr(45) + chr(2532 - 2476)), xafqLlk3kkUe(SXOLrMavuUCe(b'bc\x8b\x87\x94U\xbe>3\x8f\xee\xa6'), '\x64' + '\145' + '\x63' + '\x6f' + '\x64' + '\145')(chr(5093 - 4976) + chr(116) + chr(102) + '\x2d' + chr(56)))(qNYQNgtRuaI9, OHHikaj7ziyn))
return {xafqLlk3kkUe(SXOLrMavuUCe(b'F2\x9a\x87\xaeP\x9e'), chr(0b110010 + 0o62) + chr(101) + chr(755 - 656) + '\x6f' + '\x64' + chr(101))('\x75' + chr(116) + chr(6100 - 5998) + chr(0b1 + 0o54) + chr(56)): e1jVqMSBZ01Y}
|
awslabs/serverless-application-model
|
samtranslator/translator/transform.py
|
transform
|
def transform(input_fragment, parameter_values, managed_policy_loader):
"""Translates the SAM manifest provided in the and returns the translation to CloudFormation.
:param dict input_fragment: the SAM template to transform
:param dict parameter_values: Parameter values provided by the user
:returns: the transformed CloudFormation template
:rtype: dict
"""
sam_parser = Parser()
translator = Translator(managed_policy_loader.load(), sam_parser)
return translator.translate(input_fragment, parameter_values=parameter_values)
|
python
|
def transform(input_fragment, parameter_values, managed_policy_loader):
"""Translates the SAM manifest provided in the and returns the translation to CloudFormation.
:param dict input_fragment: the SAM template to transform
:param dict parameter_values: Parameter values provided by the user
:returns: the transformed CloudFormation template
:rtype: dict
"""
sam_parser = Parser()
translator = Translator(managed_policy_loader.load(), sam_parser)
return translator.translate(input_fragment, parameter_values=parameter_values)
|
[
"def",
"transform",
"(",
"input_fragment",
",",
"parameter_values",
",",
"managed_policy_loader",
")",
":",
"sam_parser",
"=",
"Parser",
"(",
")",
"translator",
"=",
"Translator",
"(",
"managed_policy_loader",
".",
"load",
"(",
")",
",",
"sam_parser",
")",
"return",
"translator",
".",
"translate",
"(",
"input_fragment",
",",
"parameter_values",
"=",
"parameter_values",
")"
] |
Translates the SAM manifest provided in the and returns the translation to CloudFormation.
:param dict input_fragment: the SAM template to transform
:param dict parameter_values: Parameter values provided by the user
:returns: the transformed CloudFormation template
:rtype: dict
|
[
"Translates",
"the",
"SAM",
"manifest",
"provided",
"in",
"the",
"and",
"returns",
"the",
"translation",
"to",
"CloudFormation",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/translator/transform.py#L5-L16
|
train
|
Translates the SAM manifest provided in the and returns the translation to CloudFormation.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZp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,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(0b110001) + chr(49) + chr(0b101110 + 0o10), 0b1000), ehT0Px3KOsy9(chr(1395 - 1347) + chr(0b101111 + 0o100) + '\x32' + '\x30' + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + chr(0b100110 + 0o15) + chr(0b110100) + '\x36', 8460 - 8452), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + chr(54) + chr(63 - 8), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + '\x34' + chr(0b100010 + 0o24), 8), ehT0Px3KOsy9(chr(48) + chr(0b1100111 + 0o10) + chr(0b110011) + '\x37' + chr(0b10000 + 0o41), 0o10), ehT0Px3KOsy9(chr(1368 - 1320) + chr(0b1101111) + chr(50) + '\x36' + chr(2729 - 2674), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(0b110011) + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(0b101100 + 0o6) + '\060', 7292 - 7284), ehT0Px3KOsy9('\x30' + '\x6f' + chr(52) + '\066', 10438 - 10430), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(51) + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + chr(2472 - 2361) + chr(51) + chr(54) + chr(0b110001 + 0o2), 38580 - 38572), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\157' + chr(1668 - 1613) + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(417 - 306) + chr(0b11110 + 0o23) + '\x33' + chr(0b10011 + 0o42), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(0b100011 + 0o23) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(291 - 236) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(2022 - 1911) + chr(53) + '\x30', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1011 + 0o50) + '\061' + chr(48), 18614 - 18606), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\x6f' + chr(0b110011) + chr(0b110011) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(53) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(53) + '\x32', 55225 - 55217), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + chr(455 - 405) + chr(0b110011) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b110011 + 0o74) + chr(2023 - 1972) + chr(177 - 123) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(52) + chr(1257 - 1208), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(0b1111 + 0o47) + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(749 - 700) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11110 + 0o121) + chr(1158 - 1108) + chr(2288 - 2237) + chr(182 - 129), 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(111) + chr(49) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10100 + 0o133) + chr(1790 - 1739) + '\x34' + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b101100 + 0o103) + chr(0b100010 + 0o17) + chr(0b110000 + 0o6) + '\063', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(0b110110) + '\x30', 7652 - 7644), ehT0Px3KOsy9(chr(0b110000) + chr(0b101100 + 0o103) + chr(649 - 600) + chr(2869 - 2814), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b11101 + 0o122) + chr(251 - 199) + chr(1721 - 1669), 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + '\066' + chr(48), 54356 - 54348), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11100 + 0o27) + chr(2481 - 2430), ord("\x08")), ehT0Px3KOsy9(chr(1924 - 1876) + '\157' + chr(0b110010 + 0o0) + '\062' + chr(2393 - 2340), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101001 + 0o11) + '\x35' + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + chr(7029 - 6918) + '\065' + '\x30', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1920 - 1872) + '\157' + chr(662 - 609) + chr(2015 - 1967), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'`'), chr(0b11110 + 0o106) + chr(0b1110 + 0o127) + chr(0b1100011) + '\157' + '\x64' + chr(0b1100101))('\x75' + chr(0b1110100) + chr(6412 - 6310) + chr(0b11111 + 0o16) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ASNeIOBhze_M(N9Umxk7P8bkZ, PPceYe5Mkdxr, QK_Ns2fbc0Dc):
yO7iS9cOfwAf = dE5EyB_iQEYW()
TmOApm_eJ9Sj = qf1f9C9FrV6G(QK_Ns2fbc0Dc.mxtdQMeiwJZJ(), yO7iS9cOfwAf)
return xafqLlk3kkUe(TmOApm_eJ9Sj, xafqLlk3kkUe(SXOLrMavuUCe(b':\xf3\x87Y\x95\x95\xd6.\xb5'), '\144' + chr(4751 - 4650) + chr(0b10 + 0o141) + chr(111) + '\x64' + chr(0b1100101))(chr(0b1110101) + '\x74' + '\x66' + chr(0b11011 + 0o22) + '\x38'))(N9Umxk7P8bkZ, parameter_values=PPceYe5Mkdxr)
|
awslabs/serverless-application-model
|
samtranslator/model/update_policy.py
|
UpdatePolicy.to_dict
|
def to_dict(self):
"""
:return: a dict that can be used as part of a cloudformation template
"""
dict_with_nones = self._asdict()
codedeploy_lambda_alias_update_dict = dict((k, v) for k, v in dict_with_nones.items()
if v != ref(None) and v is not None)
return {'CodeDeployLambdaAliasUpdate': codedeploy_lambda_alias_update_dict}
|
python
|
def to_dict(self):
"""
:return: a dict that can be used as part of a cloudformation template
"""
dict_with_nones = self._asdict()
codedeploy_lambda_alias_update_dict = dict((k, v) for k, v in dict_with_nones.items()
if v != ref(None) and v is not None)
return {'CodeDeployLambdaAliasUpdate': codedeploy_lambda_alias_update_dict}
|
[
"def",
"to_dict",
"(",
"self",
")",
":",
"dict_with_nones",
"=",
"self",
".",
"_asdict",
"(",
")",
"codedeploy_lambda_alias_update_dict",
"=",
"dict",
"(",
"(",
"k",
",",
"v",
")",
"for",
"k",
",",
"v",
"in",
"dict_with_nones",
".",
"items",
"(",
")",
"if",
"v",
"!=",
"ref",
"(",
"None",
")",
"and",
"v",
"is",
"not",
"None",
")",
"return",
"{",
"'CodeDeployLambdaAliasUpdate'",
":",
"codedeploy_lambda_alias_update_dict",
"}"
] |
:return: a dict that can be used as part of a cloudformation template
|
[
":",
"return",
":",
"a",
"dict",
"that",
"can",
"be",
"used",
"as",
"part",
"of",
"a",
"cloudformation",
"template"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/update_policy.py#L23-L30
|
train
|
Returns a dict that can be used as part of a cloudformation template
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ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2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b100110 + 0o111) + '\x31' + chr(0b10000 + 0o43) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(7139 - 7028) + chr(0b110000 + 0o1) + '\x33' + '\062', 8), ehT0Px3KOsy9(chr(1090 - 1042) + '\157' + chr(54) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\060' + '\061', 20785 - 20777), ehT0Px3KOsy9(chr(1583 - 1535) + chr(7474 - 7363) + chr(0b1101 + 0o51) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(3990 - 3879) + chr(0b110011) + '\066' + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b110111) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + chr(8151 - 8040) + '\x32' + chr(50) + chr(0b101100 + 0o10), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(3228 - 3117) + '\x31' + chr(48) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(1257 - 1209) + '\x6f' + chr(0b110010) + chr(53) + chr(51), 0o10), ehT0Px3KOsy9(chr(1818 - 1770) + '\157' + '\x33' + chr(0b110000) + chr(2162 - 2110), 43973 - 43965), ehT0Px3KOsy9(chr(0b110000) + chr(0b1111 + 0o140) + '\x33' + chr(0b110110) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(6266 - 6155) + '\061' + '\064' + chr(0b101100 + 0o4), 21116 - 21108), ehT0Px3KOsy9(chr(48) + chr(0b10101 + 0o132) + chr(466 - 417) + chr(0b110000), 8), ehT0Px3KOsy9(chr(504 - 456) + chr(111) + chr(2186 - 2131) + chr(1266 - 1215), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(48) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + '\x31' + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b111001 + 0o66) + chr(0b110011) + '\063' + chr(54), 0o10), ehT0Px3KOsy9(chr(358 - 310) + chr(0b1101111) + '\061' + chr(561 - 509), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + '\x36' + chr(50), 63817 - 63809), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b11000 + 0o32) + chr(0b110100), 60218 - 60210), ehT0Px3KOsy9(chr(0b110000) + chr(1153 - 1042) + chr(50) + chr(0b11101 + 0o26) + chr(1693 - 1639), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101000 + 0o107) + chr(0b110010) + chr(0b110101) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(521 - 470) + chr(0b110010) + chr(2374 - 2324), 56254 - 56246), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1101111) + '\x31' + chr(51) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10000 + 0o137) + chr(49) + chr(999 - 946) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(4446 - 4335) + '\061' + chr(49) + '\067', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(0b11011 + 0o32) + '\x35', 0o10), ehT0Px3KOsy9(chr(1628 - 1580) + chr(0b1101111) + '\063' + '\x32' + chr(0b110000 + 0o7), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110000 + 0o2) + chr(2501 - 2447) + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b110001) + '\x35', 12363 - 12355), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + '\x30' + chr(0b1010 + 0o55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b10010 + 0o135) + chr(0b110100) + chr(1137 - 1087), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(700 - 649) + chr(155 - 103), ord("\x08")), ehT0Px3KOsy9(chr(1324 - 1276) + chr(0b1101111) + chr(869 - 817) + chr(0b101110 + 0o5), 0o10), ehT0Px3KOsy9('\x30' + chr(2988 - 2877) + '\063' + '\x30' + '\062', 33909 - 33901), ehT0Px3KOsy9(chr(833 - 785) + chr(3011 - 2900) + chr(50) + chr(0b101011 + 0o7) + chr(49), 48958 - 48950), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1101111) + chr(2091 - 2040) + chr(1947 - 1898) + chr(49), 9266 - 9258)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + '\x35' + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b't'), chr(0b1100100) + chr(101) + chr(0b100110 + 0o75) + '\x6f' + '\x64' + chr(569 - 468))(chr(0b1000101 + 0o60) + chr(0b1110100) + chr(6261 - 6159) + chr(0b101101) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ANIlnSK1rtks(oVre8I6UXc3b):
kFHDQCWGT_LT = oVre8I6UXc3b._asdict()
uoUZmdHtHUTU = wLqBDw8l0eIm(((OolUPRJhRaJd, cMbll0QYhULo) for (OolUPRJhRaJd, cMbll0QYhULo) in kFHDQCWGT_LT.NzveIZ3IlSH9() if cMbll0QYhULo != X4s0pSydcnYR(None) and cMbll0QYhULo is not None))
return {xafqLlk3kkUe(SXOLrMavuUCe(b"\x195T\xe4w\x93\x0ed\xfb:M\xca\xa9\x92\x04iz\xa9'\xbf\x7fg$\xfa\xc9\xa6<"), chr(100) + chr(101) + '\143' + chr(0b1101111) + chr(0b10000 + 0o124) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b111100 + 0o52) + '\x2d' + chr(56)): uoUZmdHtHUTU}
|
awslabs/serverless-application-model
|
samtranslator/plugins/api/implicit_api_plugin.py
|
ImplicitApiPlugin.on_before_transform_template
|
def on_before_transform_template(self, template_dict):
"""
Hook method that gets called before the SAM template is processed.
The template has pass the validation and is guaranteed to contain a non-empty "Resources" section.
:param dict template_dict: Dictionary of the SAM template
:return: Nothing
"""
template = SamTemplate(template_dict)
# Temporarily add Serverless::Api resource corresponding to Implicit API to the template.
# This will allow the processing code to work the same way for both Implicit & Explicit APIs
# If there are no implicit APIs, we will remove from the template later.
# If the customer has explicitly defined a resource with the id of "ServerlessRestApi",
# capture it. If the template ends up not defining any implicit api's, instead of just
# removing the "ServerlessRestApi" resource, we just restore what the author defined.
self.existing_implicit_api_resource = copy.deepcopy(template.get(self.implicit_api_logical_id))
template.set(self.implicit_api_logical_id, ImplicitApiResource().to_dict())
errors = []
for logicalId, function in template.iterate(SamResourceType.Function.value):
api_events = self._get_api_events(function)
condition = function.condition
if len(api_events) == 0:
continue
try:
self._process_api_events(function, api_events, template, condition)
except InvalidEventException as ex:
errors.append(InvalidResourceException(logicalId, ex.message))
self._maybe_add_condition_to_implicit_api(template_dict)
self._maybe_add_conditions_to_implicit_api_paths(template)
self._maybe_remove_implicit_api(template)
if len(errors) > 0:
raise InvalidDocumentException(errors)
|
python
|
def on_before_transform_template(self, template_dict):
"""
Hook method that gets called before the SAM template is processed.
The template has pass the validation and is guaranteed to contain a non-empty "Resources" section.
:param dict template_dict: Dictionary of the SAM template
:return: Nothing
"""
template = SamTemplate(template_dict)
# Temporarily add Serverless::Api resource corresponding to Implicit API to the template.
# This will allow the processing code to work the same way for both Implicit & Explicit APIs
# If there are no implicit APIs, we will remove from the template later.
# If the customer has explicitly defined a resource with the id of "ServerlessRestApi",
# capture it. If the template ends up not defining any implicit api's, instead of just
# removing the "ServerlessRestApi" resource, we just restore what the author defined.
self.existing_implicit_api_resource = copy.deepcopy(template.get(self.implicit_api_logical_id))
template.set(self.implicit_api_logical_id, ImplicitApiResource().to_dict())
errors = []
for logicalId, function in template.iterate(SamResourceType.Function.value):
api_events = self._get_api_events(function)
condition = function.condition
if len(api_events) == 0:
continue
try:
self._process_api_events(function, api_events, template, condition)
except InvalidEventException as ex:
errors.append(InvalidResourceException(logicalId, ex.message))
self._maybe_add_condition_to_implicit_api(template_dict)
self._maybe_add_conditions_to_implicit_api_paths(template)
self._maybe_remove_implicit_api(template)
if len(errors) > 0:
raise InvalidDocumentException(errors)
|
[
"def",
"on_before_transform_template",
"(",
"self",
",",
"template_dict",
")",
":",
"template",
"=",
"SamTemplate",
"(",
"template_dict",
")",
"# Temporarily add Serverless::Api resource corresponding to Implicit API to the template.",
"# This will allow the processing code to work the same way for both Implicit & Explicit APIs",
"# If there are no implicit APIs, we will remove from the template later.",
"# If the customer has explicitly defined a resource with the id of \"ServerlessRestApi\",",
"# capture it. If the template ends up not defining any implicit api's, instead of just",
"# removing the \"ServerlessRestApi\" resource, we just restore what the author defined.",
"self",
".",
"existing_implicit_api_resource",
"=",
"copy",
".",
"deepcopy",
"(",
"template",
".",
"get",
"(",
"self",
".",
"implicit_api_logical_id",
")",
")",
"template",
".",
"set",
"(",
"self",
".",
"implicit_api_logical_id",
",",
"ImplicitApiResource",
"(",
")",
".",
"to_dict",
"(",
")",
")",
"errors",
"=",
"[",
"]",
"for",
"logicalId",
",",
"function",
"in",
"template",
".",
"iterate",
"(",
"SamResourceType",
".",
"Function",
".",
"value",
")",
":",
"api_events",
"=",
"self",
".",
"_get_api_events",
"(",
"function",
")",
"condition",
"=",
"function",
".",
"condition",
"if",
"len",
"(",
"api_events",
")",
"==",
"0",
":",
"continue",
"try",
":",
"self",
".",
"_process_api_events",
"(",
"function",
",",
"api_events",
",",
"template",
",",
"condition",
")",
"except",
"InvalidEventException",
"as",
"ex",
":",
"errors",
".",
"append",
"(",
"InvalidResourceException",
"(",
"logicalId",
",",
"ex",
".",
"message",
")",
")",
"self",
".",
"_maybe_add_condition_to_implicit_api",
"(",
"template_dict",
")",
"self",
".",
"_maybe_add_conditions_to_implicit_api_paths",
"(",
"template",
")",
"self",
".",
"_maybe_remove_implicit_api",
"(",
"template",
")",
"if",
"len",
"(",
"errors",
")",
">",
"0",
":",
"raise",
"InvalidDocumentException",
"(",
"errors",
")"
] |
Hook method that gets called before the SAM template is processed.
The template has pass the validation and is guaranteed to contain a non-empty "Resources" section.
:param dict template_dict: Dictionary of the SAM template
:return: Nothing
|
[
"Hook",
"method",
"that",
"gets",
"called",
"before",
"the",
"SAM",
"template",
"is",
"processed",
".",
"The",
"template",
"has",
"pass",
"the",
"validation",
"and",
"is",
"guaranteed",
"to",
"contain",
"a",
"non",
"-",
"empty",
"Resources",
"section",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/api/implicit_api_plugin.py#L48-L89
|
train
|
This method is called before the SAM template is processed. It is called by the SAM template processor to process the SAM template.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ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Nl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1456 - 1405) + '\060' + chr(0b0 + 0o64), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(49) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9813 - 9702) + '\063' + chr(0b11101 + 0o26) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11100 + 0o31) + chr(2611 - 2557), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + '\067' + chr(48), 0o10), ehT0Px3KOsy9('\x30' + chr(12315 - 12204) + chr(456 - 403) + '\067', 0b1000), ehT0Px3KOsy9(chr(1643 - 1595) + chr(0b111010 + 0o65) + chr(55) + chr(0b1100 + 0o45), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10111 + 0o130) + chr(0b110100) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001111 + 0o40) + chr(0b10000 + 0o42) + chr(1295 - 1246), 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(53) + '\x37', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101011 + 0o6) + chr(0b110001) + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\066' + chr(2244 - 2195), 26606 - 26598), ehT0Px3KOsy9(chr(2212 - 2164) + '\157' + chr(52) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(54), 28509 - 28501), ehT0Px3KOsy9(chr(0b110000) + chr(0b11000 + 0o127) + '\061' + chr(2073 - 2019), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100100 + 0o16) + chr(51) + chr(0b10001 + 0o44), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + '\x33' + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b11101 + 0o122) + '\062' + chr(51) + chr(1685 - 1632), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + '\065' + chr(0b101111 + 0o6), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(0b10011 + 0o37) + chr(49), 36243 - 36235), ehT0Px3KOsy9(chr(48) + '\157' + '\064' + '\066', 24012 - 24004), ehT0Px3KOsy9(chr(603 - 555) + '\x6f' + chr(0b100000 + 0o23) + '\067' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b11001 + 0o126) + chr(52) + chr(49), 8), ehT0Px3KOsy9('\060' + chr(0b110001 + 0o76) + chr(53) + chr(0b110110), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(989 - 938) + chr(0b110100) + '\065', 27275 - 27267), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(998 - 947) + chr(0b110111) + chr(0b1000 + 0o56), 55686 - 55678), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\157' + '\062' + chr(0b10001 + 0o43) + chr(0b101 + 0o56), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + '\x32' + '\067', 55846 - 55838), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b110101) + chr(266 - 218), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(0b10100 + 0o40) + chr(0b1111 + 0o45), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(1147 - 1096) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101 + 0o56) + chr(50) + chr(55), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101000 + 0o12) + '\067', 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\x6f' + chr(0b10101 + 0o40) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(0b110001) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10 + 0o57) + '\x30' + chr(0b100000 + 0o24), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b111101 + 0o62) + chr(0b110100) + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(2338 - 2227) + chr(0b110001) + chr(2731 - 2677) + chr(0b11011 + 0o27), 0b1000), ehT0Px3KOsy9(chr(1343 - 1295) + chr(0b1101111) + chr(54) + chr(0b1000 + 0o57), 16532 - 16524), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(9771 - 9660) + chr(784 - 733) + chr(0b110001) + '\067', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + '\065' + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xea'), chr(8032 - 7932) + chr(0b1010010 + 0o23) + '\x63' + '\x6f' + '\144' + chr(0b1100101))(chr(0b1110101) + chr(13027 - 12911) + '\x66' + chr(0b101101) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def gj1OHc_ZqbSb(oVre8I6UXc3b, PPP5FvnpV6j7):
jJBnSHEgylNZ = EY6e8ub0jb5c(PPP5FvnpV6j7)
oVre8I6UXc3b.qmspXIIoh7Mh = igThHS4jwVsa.deepcopy(jJBnSHEgylNZ.get(oVre8I6UXc3b.implicit_api_logical_id))
xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7\xee\xaa'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(3676 - 3565) + chr(1243 - 1143) + chr(101))('\165' + chr(0b1001100 + 0o50) + chr(0b1100110) + chr(743 - 698) + '\070'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xe6\xaeBQLPUNN:\x98|ba\xfa\xf6\xfe\x0c=y\x92E'), chr(0b1100100) + chr(0b1100101) + chr(0b100101 + 0o76) + '\x6f' + chr(5588 - 5488) + chr(0b111100 + 0o51))(chr(9995 - 9878) + chr(9019 - 8903) + chr(102) + '\x2d' + chr(2530 - 2474))), xafqLlk3kkUe(_a66f_qxI2AQ(), xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0\xe4\x81JQLM'), '\144' + '\x65' + '\x63' + chr(12038 - 11927) + '\144' + chr(1608 - 1507))(chr(0b111101 + 0o70) + '\164' + chr(0b1000010 + 0o44) + chr(1139 - 1094) + chr(1732 - 1676)))())
vrC59GzZXTIL = []
for (gvQh1eVhOwBf, bBC93MgSHzUB) in xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xff\xbb\\Y[\\'), chr(0b1101 + 0o127) + chr(101) + chr(0b110011 + 0o60) + chr(0b1100111 + 0o10) + chr(100) + chr(0b10010 + 0o123))(chr(0b1110101) + chr(116) + chr(0b10111 + 0o117) + chr(0b101101) + '\070'))(xafqLlk3kkUe(N9D7M1lGWFFe.Function, xafqLlk3kkUe(SXOLrMavuUCe(b'\x95\xe6\xb3Ioz{\x10"y\t\xbb'), chr(0b1100100) + chr(101) + chr(99) + '\x6f' + chr(9786 - 9686) + '\145')(chr(11018 - 10901) + '\x74' + '\146' + chr(1466 - 1421) + '\070'))):
G3MCYKKmZ4u9 = oVre8I6UXc3b._get_api_events(bBC93MgSHzUB)
z3jGhw6b9vwa = bBC93MgSHzUB.z3jGhw6b9vwa
if c2A0yzQpDQB3(G3MCYKKmZ4u9) == ehT0Px3KOsy9('\x30' + chr(0b110000 + 0o77) + chr(48), ord("\x08")):
continue
try:
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b\xfb\xacA[JJRNN:\x98|kx\xf8\xf1\xe9\x1e'), chr(0b1100100) + chr(0b111111 + 0o46) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(4964 - 4863))(chr(0b10011 + 0o142) + chr(3793 - 3677) + '\146' + chr(45) + chr(1487 - 1431)))(bBC93MgSHzUB, G3MCYKKmZ4u9, jJBnSHEgylNZ, z3jGhw6b9vwa)
except eXWqlSUlGxPF as DfdhY28yEwAF:
xafqLlk3kkUe(vrC59GzZXTIL, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5\xfb\xaeKVK'), '\144' + chr(0b1100101) + chr(7756 - 7657) + chr(111) + '\x64' + '\x65')(chr(0b10100 + 0o141) + chr(0b1110100) + chr(0b1100110) + chr(0b11110 + 0o17) + '\x38'))(ow8Lll3lwq0h(gvQh1eVhOwBf, xafqLlk3kkUe(DfdhY28yEwAF, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9\xee\xad]YH\\'), chr(1855 - 1755) + chr(0b1010101 + 0o20) + '\143' + chr(0b1101111) + chr(5702 - 5602) + chr(101))(chr(0b11101 + 0o130) + chr(0b1110100) + chr(1367 - 1265) + '\055' + chr(56)))))
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b\xe6\xbfWZJf@uK\x15\x92L`j\xf4\xeb\xf4\x02?y\x8fNq\x8c\x93\xd3\xbb\x81\x87s\xa3HJ8-'), chr(0b1000011 + 0o41) + chr(0b1100 + 0o131) + chr(0b10100 + 0o117) + chr(0b1101111) + '\144' + chr(1432 - 1331))('\x75' + chr(2982 - 2866) + chr(0b1000101 + 0o41) + chr(0b11100 + 0o21) + '\070'))(PPP5FvnpV6j7)
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b\xe6\xbfWZJf@uK\x15\x92L`j\xf4\xeb\xf4\x02?U\xa4UA\xba\x97\xce\xa7\x84\x8dy\xbect)4I-G\xae\xb0\xe3\xad'), chr(0b110011 + 0o61) + chr(101) + chr(0b111010 + 0o51) + chr(0b1101111) + '\144' + chr(0b1100101))('\165' + '\164' + chr(1404 - 1302) + chr(169 - 124) + chr(56)))(jJBnSHEgylNZ)
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b\xe6\xbfWZJfStB%\x87FQg\xf0\xef\xf1\x042O\x8f~O\x95\x97'), chr(100) + chr(101) + '\143' + chr(0b1101111) + chr(0b1100100) + '\145')(chr(0b1000101 + 0o60) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b111000)))(jJBnSHEgylNZ)
if c2A0yzQpDQB3(vrC59GzZXTIL) > ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\060', 8):
raise WAOffgnUIwTZ(vrC59GzZXTIL)
|
awslabs/serverless-application-model
|
samtranslator/plugins/api/implicit_api_plugin.py
|
ImplicitApiPlugin._get_api_events
|
def _get_api_events(self, function):
"""
Method to return a dictionary of API Events on the function
:param SamResource function: Function Resource object
:return dict: Dictionary of API events along with any other configuration passed to it.
Example: {
FooEvent: {Path: "/foo", Method: "post", RestApiId: blah, MethodSettings: {<something>},
Cors: {<something>}, Auth: {<something>}},
BarEvent: {Path: "/bar", Method: "any", MethodSettings: {<something>}, Cors: {<something>},
Auth: {<something>}}"
}
"""
if not (function.valid() and
isinstance(function.properties, dict) and
isinstance(function.properties.get("Events"), dict)
):
# Function resource structure is invalid.
return {}
api_events = {}
for event_id, event in function.properties["Events"].items():
if event and isinstance(event, dict) and event.get("Type") == "Api":
api_events[event_id] = event
return api_events
|
python
|
def _get_api_events(self, function):
"""
Method to return a dictionary of API Events on the function
:param SamResource function: Function Resource object
:return dict: Dictionary of API events along with any other configuration passed to it.
Example: {
FooEvent: {Path: "/foo", Method: "post", RestApiId: blah, MethodSettings: {<something>},
Cors: {<something>}, Auth: {<something>}},
BarEvent: {Path: "/bar", Method: "any", MethodSettings: {<something>}, Cors: {<something>},
Auth: {<something>}}"
}
"""
if not (function.valid() and
isinstance(function.properties, dict) and
isinstance(function.properties.get("Events"), dict)
):
# Function resource structure is invalid.
return {}
api_events = {}
for event_id, event in function.properties["Events"].items():
if event and isinstance(event, dict) and event.get("Type") == "Api":
api_events[event_id] = event
return api_events
|
[
"def",
"_get_api_events",
"(",
"self",
",",
"function",
")",
":",
"if",
"not",
"(",
"function",
".",
"valid",
"(",
")",
"and",
"isinstance",
"(",
"function",
".",
"properties",
",",
"dict",
")",
"and",
"isinstance",
"(",
"function",
".",
"properties",
".",
"get",
"(",
"\"Events\"",
")",
",",
"dict",
")",
")",
":",
"# Function resource structure is invalid.",
"return",
"{",
"}",
"api_events",
"=",
"{",
"}",
"for",
"event_id",
",",
"event",
"in",
"function",
".",
"properties",
"[",
"\"Events\"",
"]",
".",
"items",
"(",
")",
":",
"if",
"event",
"and",
"isinstance",
"(",
"event",
",",
"dict",
")",
"and",
"event",
".",
"get",
"(",
"\"Type\"",
")",
"==",
"\"Api\"",
":",
"api_events",
"[",
"event_id",
"]",
"=",
"event",
"return",
"api_events"
] |
Method to return a dictionary of API Events on the function
:param SamResource function: Function Resource object
:return dict: Dictionary of API events along with any other configuration passed to it.
Example: {
FooEvent: {Path: "/foo", Method: "post", RestApiId: blah, MethodSettings: {<something>},
Cors: {<something>}, Auth: {<something>}},
BarEvent: {Path: "/bar", Method: "any", MethodSettings: {<something>}, Cors: {<something>},
Auth: {<something>}}"
}
|
[
"Method",
"to",
"return",
"a",
"dictionary",
"of",
"API",
"Events",
"on",
"the",
"function"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/api/implicit_api_plugin.py#L91-L118
|
train
|
Method to return a dictionary of API Events on the function.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,h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V2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\157' + chr(50) + '\065' + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b100100 + 0o113) + '\x32' + chr(1425 - 1376) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\x6f' + chr(0b11000 + 0o33) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x33' + '\x36' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(11983 - 11872) + chr(0b1 + 0o60) + chr(0b110111) + '\x36', 0o10), ehT0Px3KOsy9('\060' + chr(3488 - 3377) + '\x31' + chr(2156 - 2106) + chr(48), 35121 - 35113), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(0b110001) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + chr(10395 - 10284) + chr(0b101100 + 0o12) + '\x32', 19019 - 19011), ehT0Px3KOsy9(chr(2047 - 1999) + '\x6f' + chr(51) + chr(0b110101) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + chr(1922 - 1870) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(2109 - 2059) + chr(0b11011 + 0o26) + '\065', 0b1000), ehT0Px3KOsy9(chr(1560 - 1512) + chr(0b1101111) + chr(2075 - 2024) + chr(0b10011 + 0o37) + chr(0b100110 + 0o20), 0o10), ehT0Px3KOsy9('\060' + chr(11873 - 11762) + chr(0b11110 + 0o25) + chr(0b110011) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100000 + 0o117) + chr(50) + chr(0b10 + 0o57) + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + chr(2902 - 2791) + chr(51) + chr(53) + '\065', 0b1000), ehT0Px3KOsy9(chr(587 - 539) + '\157' + '\x32' + '\062' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(11436 - 11325) + chr(1292 - 1241) + chr(54) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(2323 - 2272) + '\061' + chr(54), 37105 - 37097), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1010001 + 0o36) + '\x31' + '\062' + chr(0b110100), 2694 - 2686), ehT0Px3KOsy9(chr(0b110000) + chr(7856 - 7745) + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b111011 + 0o64) + '\x34' + chr(0b100010 + 0o22), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(1294 - 1240) + chr(1786 - 1731), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(492 - 443) + chr(51) + chr(50), 0b1000), ehT0Px3KOsy9('\060' + chr(7097 - 6986) + chr(855 - 805) + chr(741 - 686) + chr(427 - 376), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(3747 - 3636) + chr(0b1001 + 0o52) + '\067', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + '\x31' + '\x33', 10232 - 10224), ehT0Px3KOsy9(chr(48) + chr(4773 - 4662) + chr(51) + chr(0b1111 + 0o41) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2184 - 2134) + chr(2671 - 2618) + chr(1030 - 980), 20933 - 20925), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + '\062' + '\064' + chr(0b100101 + 0o15), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(972 - 924) + chr(0b1101111) + chr(1532 - 1483) + chr(2892 - 2838), 0o10), ehT0Px3KOsy9('\060' + chr(0b11 + 0o154) + chr(2397 - 2347) + '\066' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + '\x30' + chr(601 - 546), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b10111 + 0o130) + chr(0b110011) + chr(2373 - 2320) + '\063', 52735 - 52727), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\061' + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9439 - 9328) + '\063' + '\x36' + '\x32', 28185 - 28177), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + '\061' + '\067', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\067' + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b100111 + 0o110) + '\061' + chr(0b110001) + chr(0b110011), 8), ehT0Px3KOsy9(chr(1412 - 1364) + chr(4207 - 4096) + '\x33' + chr(288 - 234) + chr(0b110110), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110101) + chr(48), 62893 - 62885)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x87'), '\144' + chr(6821 - 6720) + '\x63' + '\157' + chr(0b10 + 0o142) + chr(0b1100101))('\x75' + chr(1853 - 1737) + chr(4271 - 4169) + chr(45) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def f1K5VX8yFnOI(oVre8I6UXc3b, bBC93MgSHzUB):
if not (xafqLlk3kkUe(bBC93MgSHzUB, xafqLlk3kkUe(SXOLrMavuUCe(b'\xeb\xd6O\xa7N<\xb8f\x92\xb3\xc2\xee'), chr(0b1000110 + 0o36) + chr(0b1001010 + 0o33) + chr(3924 - 3825) + '\157' + '\x64' + chr(101))(chr(0b100 + 0o161) + chr(116) + chr(0b1100110) + chr(0b0 + 0o55) + '\070'))() and PlSM16l2KDPD(xafqLlk3kkUe(bBC93MgSHzUB, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc6\xb8R\x83Fb\xbc~\x85\xab\xdd\xee'), chr(5827 - 5727) + '\145' + chr(5952 - 5853) + '\157' + chr(4332 - 4232) + chr(0b1100101))(chr(0b1011 + 0o152) + chr(116) + '\x66' + chr(0b101101) + chr(0b110100 + 0o4))), wLqBDw8l0eIm) and PlSM16l2KDPD(xafqLlk3kkUe(bBC93MgSHzUB.properties, xafqLlk3kkUe(SXOLrMavuUCe(b'\xce\xe9k'), chr(0b1100100) + chr(101) + chr(7269 - 7170) + '\x6f' + '\x64' + chr(101))('\x75' + '\x74' + chr(9910 - 9808) + '\055' + chr(1115 - 1059)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xec\xfaz\x9b\n#'), chr(0b11100 + 0o110) + chr(0b10011 + 0o122) + '\143' + '\157' + '\144' + chr(4365 - 4264))(chr(117) + chr(9128 - 9012) + chr(0b1100110) + chr(0b10100 + 0o31) + chr(0b11111 + 0o31))), wLqBDw8l0eIm)):
return {}
G3MCYKKmZ4u9 = {}
for (mlmIF0P1KCK5, SGm65G84ZKM5) in xafqLlk3kkUe(bBC93MgSHzUB.properties[xafqLlk3kkUe(SXOLrMavuUCe(b'\xec\xfaz\x9b\n#'), chr(0b11000 + 0o114) + chr(101) + chr(99) + chr(0b1101111) + chr(0b100001 + 0o103) + '\145')('\x75' + chr(116) + chr(10324 - 10222) + chr(0b100100 + 0o11) + chr(0b10101 + 0o43))], xafqLlk3kkUe(SXOLrMavuUCe(b'\xe7\xf6i\x907\n\xfc{\x84\xb7\xc5\xef'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(6055 - 5944) + '\144' + chr(101))(chr(117) + chr(0b1110100) + '\x66' + '\055' + '\x38'))():
if SGm65G84ZKM5 and PlSM16l2KDPD(SGm65G84ZKM5, wLqBDw8l0eIm) and (xafqLlk3kkUe(SGm65G84ZKM5, xafqLlk3kkUe(SXOLrMavuUCe(b'\xce\xe9k'), '\144' + '\145' + chr(0b10010 + 0o121) + chr(11922 - 11811) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(6917 - 6801) + chr(2414 - 2312) + chr(0b1010 + 0o43) + chr(0b100011 + 0o25)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfd\xf5o\x90'), chr(100) + chr(8755 - 8654) + chr(0b1100011) + chr(8989 - 8878) + chr(0b11101 + 0o107) + chr(8422 - 8321))(chr(8218 - 8101) + chr(116) + chr(0b1100110) + chr(0b101000 + 0o5) + chr(56))) == xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8\xfcv'), chr(0b1100100) + chr(199 - 98) + '\x63' + chr(0b1101111) + '\144' + chr(101))(chr(0b1110101) + chr(13270 - 13154) + chr(2501 - 2399) + '\055' + chr(183 - 127))):
G3MCYKKmZ4u9[mlmIF0P1KCK5] = SGm65G84ZKM5
return G3MCYKKmZ4u9
|
awslabs/serverless-application-model
|
samtranslator/plugins/api/implicit_api_plugin.py
|
ImplicitApiPlugin._process_api_events
|
def _process_api_events(self, function, api_events, template, condition=None):
"""
Actually process given API events. Iteratively adds the APIs to Swagger JSON in the respective Serverless::Api
resource from the template
:param SamResource function: SAM Function containing the API events to be processed
:param dict api_events: API Events extracted from the function. These events will be processed
:param SamTemplate template: SAM Template where Serverless::Api resources can be found
:param str condition: optional; this is the condition that is on the function with the API event
"""
for logicalId, event in api_events.items():
event_properties = event.get("Properties", {})
if not event_properties:
continue
self._add_implicit_api_id_if_necessary(event_properties)
api_id = self._get_api_id(event_properties)
try:
path = event_properties["Path"]
method = event_properties["Method"]
except KeyError as e:
raise InvalidEventException(logicalId, "Event is missing key {}.".format(e))
if (not isinstance(path, six.string_types)):
raise InvalidEventException(logicalId,
"Api Event must have a String specified for 'Path'.")
if (not isinstance(method, six.string_types)):
raise InvalidEventException(logicalId,
"Api Event must have a String specified for 'Method'.")
api_dict = self.api_conditions.setdefault(api_id, {})
method_conditions = api_dict.setdefault(path, {})
method_conditions[method] = condition
self._add_api_to_swagger(logicalId, event_properties, template)
api_events[logicalId] = event
# We could have made changes to the Events structure. Write it back to function
function.properties["Events"].update(api_events)
|
python
|
def _process_api_events(self, function, api_events, template, condition=None):
"""
Actually process given API events. Iteratively adds the APIs to Swagger JSON in the respective Serverless::Api
resource from the template
:param SamResource function: SAM Function containing the API events to be processed
:param dict api_events: API Events extracted from the function. These events will be processed
:param SamTemplate template: SAM Template where Serverless::Api resources can be found
:param str condition: optional; this is the condition that is on the function with the API event
"""
for logicalId, event in api_events.items():
event_properties = event.get("Properties", {})
if not event_properties:
continue
self._add_implicit_api_id_if_necessary(event_properties)
api_id = self._get_api_id(event_properties)
try:
path = event_properties["Path"]
method = event_properties["Method"]
except KeyError as e:
raise InvalidEventException(logicalId, "Event is missing key {}.".format(e))
if (not isinstance(path, six.string_types)):
raise InvalidEventException(logicalId,
"Api Event must have a String specified for 'Path'.")
if (not isinstance(method, six.string_types)):
raise InvalidEventException(logicalId,
"Api Event must have a String specified for 'Method'.")
api_dict = self.api_conditions.setdefault(api_id, {})
method_conditions = api_dict.setdefault(path, {})
method_conditions[method] = condition
self._add_api_to_swagger(logicalId, event_properties, template)
api_events[logicalId] = event
# We could have made changes to the Events structure. Write it back to function
function.properties["Events"].update(api_events)
|
[
"def",
"_process_api_events",
"(",
"self",
",",
"function",
",",
"api_events",
",",
"template",
",",
"condition",
"=",
"None",
")",
":",
"for",
"logicalId",
",",
"event",
"in",
"api_events",
".",
"items",
"(",
")",
":",
"event_properties",
"=",
"event",
".",
"get",
"(",
"\"Properties\"",
",",
"{",
"}",
")",
"if",
"not",
"event_properties",
":",
"continue",
"self",
".",
"_add_implicit_api_id_if_necessary",
"(",
"event_properties",
")",
"api_id",
"=",
"self",
".",
"_get_api_id",
"(",
"event_properties",
")",
"try",
":",
"path",
"=",
"event_properties",
"[",
"\"Path\"",
"]",
"method",
"=",
"event_properties",
"[",
"\"Method\"",
"]",
"except",
"KeyError",
"as",
"e",
":",
"raise",
"InvalidEventException",
"(",
"logicalId",
",",
"\"Event is missing key {}.\"",
".",
"format",
"(",
"e",
")",
")",
"if",
"(",
"not",
"isinstance",
"(",
"path",
",",
"six",
".",
"string_types",
")",
")",
":",
"raise",
"InvalidEventException",
"(",
"logicalId",
",",
"\"Api Event must have a String specified for 'Path'.\"",
")",
"if",
"(",
"not",
"isinstance",
"(",
"method",
",",
"six",
".",
"string_types",
")",
")",
":",
"raise",
"InvalidEventException",
"(",
"logicalId",
",",
"\"Api Event must have a String specified for 'Method'.\"",
")",
"api_dict",
"=",
"self",
".",
"api_conditions",
".",
"setdefault",
"(",
"api_id",
",",
"{",
"}",
")",
"method_conditions",
"=",
"api_dict",
".",
"setdefault",
"(",
"path",
",",
"{",
"}",
")",
"method_conditions",
"[",
"method",
"]",
"=",
"condition",
"self",
".",
"_add_api_to_swagger",
"(",
"logicalId",
",",
"event_properties",
",",
"template",
")",
"api_events",
"[",
"logicalId",
"]",
"=",
"event",
"# We could have made changes to the Events structure. Write it back to function",
"function",
".",
"properties",
"[",
"\"Events\"",
"]",
".",
"update",
"(",
"api_events",
")"
] |
Actually process given API events. Iteratively adds the APIs to Swagger JSON in the respective Serverless::Api
resource from the template
:param SamResource function: SAM Function containing the API events to be processed
:param dict api_events: API Events extracted from the function. These events will be processed
:param SamTemplate template: SAM Template where Serverless::Api resources can be found
:param str condition: optional; this is the condition that is on the function with the API event
|
[
"Actually",
"process",
"given",
"API",
"events",
".",
"Iteratively",
"adds",
"the",
"APIs",
"to",
"Swagger",
"JSON",
"in",
"the",
"respective",
"Serverless",
"::",
"Api",
"resource",
"from",
"the",
"template"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/api/implicit_api_plugin.py#L120-L162
|
train
|
Processes API events and adds them to the Swagger JSON.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEOh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QmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(2123 - 2075) + chr(111) + '\x31' + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(5276 - 5165) + chr(0b11111 + 0o22) + '\062' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + '\067' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11011 + 0o27) + '\063' + chr(54), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b111010 + 0o65) + chr(0b110011) + chr(0b110111) + chr(0b100010 + 0o20), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(2973 - 2862) + '\x31' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(1682 - 1634) + '\157' + chr(0b110 + 0o55) + chr(0b11111 + 0o27) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(4459 - 4348) + '\x32' + chr(0b110110) + chr(466 - 417), 0b1000), ehT0Px3KOsy9('\x30' + chr(4088 - 3977) + '\x32' + chr(425 - 373) + '\067', 0o10), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + chr(0b110011) + '\064' + chr(906 - 855), ord("\x08")), ehT0Px3KOsy9(chr(1357 - 1309) + chr(0b1100011 + 0o14) + chr(0b110011) + chr(542 - 490), 28605 - 28597), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1010110 + 0o31) + chr(0b10101 + 0o34) + chr(55) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(172 - 120) + chr(1991 - 1937), 0o10), ehT0Px3KOsy9(chr(916 - 868) + '\x6f' + chr(51) + chr(1098 - 1050) + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(1604 - 1554), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1111 + 0o42) + '\064' + chr(55), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + chr(10755 - 10644) + chr(50) + chr(230 - 179) + '\067', 0o10), ehT0Px3KOsy9(chr(755 - 707) + chr(0b110010 + 0o75) + '\x36' + '\062', 43799 - 43791), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\x6f' + chr(2367 - 2316) + chr(0b110010) + '\x37', 37772 - 37764), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + '\x31' + chr(49), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(2180 - 2130) + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100 + 0o143) + '\062' + chr(1811 - 1762) + chr(1589 - 1540), 8), ehT0Px3KOsy9(chr(48) + chr(0b1011010 + 0o25) + chr(0b111 + 0o52) + '\x30' + chr(0b101011 + 0o14), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(1271 - 1221) + chr(0b110011), 64719 - 64711), ehT0Px3KOsy9(chr(0b110000) + chr(11530 - 11419) + '\064' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010111 + 0o30) + chr(1924 - 1875) + chr(50), 8), ehT0Px3KOsy9(chr(646 - 598) + '\157' + chr(960 - 911) + chr(50) + '\065', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(1062 - 1014) + chr(0b1110 + 0o46), 0b1000), ehT0Px3KOsy9(chr(1177 - 1129) + chr(366 - 255) + chr(0b10000 + 0o41) + '\x35' + chr(0b101101 + 0o6), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\067' + '\061', 4571 - 4563), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11101 + 0o31) + chr(0b110010), 8), ehT0Px3KOsy9(chr(48) + chr(7758 - 7647) + chr(0b11000 + 0o32) + '\x32' + chr(0b100001 + 0o17), 0b1000), ehT0Px3KOsy9(chr(277 - 229) + '\157' + '\061' + chr(2406 - 2351) + chr(180 - 132), 27900 - 27892), ehT0Px3KOsy9(chr(127 - 79) + '\x6f' + chr(0b110010) + chr(0b110101), 48158 - 48150), ehT0Px3KOsy9(chr(48) + chr(1135 - 1024) + '\x33' + chr(51) + chr(0b10000 + 0o41), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10100 + 0o35) + chr(2735 - 2682) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100100 + 0o113) + '\x35' + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(50) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b110111 + 0o0) + chr(2372 - 2317), 59910 - 59902)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(2150 - 2102) + chr(207 - 96) + chr(53) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'%'), chr(100) + chr(5778 - 5677) + '\143' + chr(0b1001010 + 0o45) + chr(100) + '\x65')(chr(117) + '\x74' + chr(0b110111 + 0o57) + '\055' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def dloKd8KTehBs(oVre8I6UXc3b, bBC93MgSHzUB, G3MCYKKmZ4u9, jJBnSHEgylNZ, z3jGhw6b9vwa=None):
for (gvQh1eVhOwBf, SGm65G84ZKM5) in xafqLlk3kkUe(G3MCYKKmZ4u9, xafqLlk3kkUe(SXOLrMavuUCe(b'E.L\xfb\xb3P\xc4\xf8\xcb\xb0TD'), chr(100) + chr(7105 - 7004) + '\143' + '\157' + chr(0b1100100) + chr(0b110010 + 0o63))(chr(5652 - 5535) + chr(813 - 697) + chr(6548 - 6446) + '\x2d' + chr(0b10000 + 0o50)))():
Zs4hLSKPtP6m = SGm65G84ZKM5.get(xafqLlk3kkUe(SXOLrMavuUCe(b'[&U\xee\x9fx\x83\xd8\xc2\x90'), '\x64' + '\145' + '\143' + chr(7545 - 7434) + chr(5091 - 4991) + '\x65')(chr(0b1010100 + 0o41) + chr(9161 - 9045) + chr(849 - 747) + chr(0b1111 + 0o36) + '\070'), {})
if not Zs4hLSKPtP6m:
continue
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'T5^\xfa\xa5c\x9a\xc1\xcb\x8a\x7f\x14R\x9c{\x17m\xc0[\xb3\xd6\xb8\xef\x18=Gi07\x18\x98@\xe9'), '\144' + chr(101) + chr(9446 - 9347) + chr(4027 - 3916) + chr(100) + chr(9957 - 9856))('\165' + chr(8753 - 8637) + chr(0b1000110 + 0o40) + chr(1955 - 1910) + '\x38'))(Zs4hLSKPtP6m)
X7mnYJ6SRw0h = oVre8I6UXc3b._get_api_id(Zs4hLSKPtP6m)
try:
EaCjyhZptSer = Zs4hLSKPtP6m[xafqLlk3kkUe(SXOLrMavuUCe(b'[5N\xf6'), chr(5062 - 4962) + chr(101) + chr(0b1100011) + chr(111) + chr(0b110111 + 0o55) + '\145')(chr(11819 - 11702) + '\x74' + '\146' + chr(0b101101) + '\070')]
CVRCXTcnOnH6 = Zs4hLSKPtP6m[xafqLlk3kkUe(SXOLrMavuUCe(b'F1N\xf6\x95n'), chr(100) + '\x65' + '\x63' + '\157' + chr(0b1100100) + chr(8793 - 8692))('\x75' + '\164' + chr(0b1100110) + chr(1841 - 1796) + '\070')]
except RQ6CSRrFArYB as GlnVAPeT6CUe:
raise eXWqlSUlGxPF(gvQh1eVhOwBf, xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'N"_\xf0\x8e*\x9e\xc2\x87\x8eu\x0eU\xaat\x00$\xf4W\xae\xa9\xaa\xf4i'), chr(0b11111 + 0o105) + chr(101) + chr(5415 - 5316) + '\157' + '\x64' + chr(101))(chr(3198 - 3081) + chr(116) + '\146' + '\055' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b']`H\xf1\xb2k\xa4\x82\xf7\x93y\x17'), chr(0b1011001 + 0o13) + chr(101) + '\143' + chr(111) + chr(100) + '\145')(chr(117) + chr(8217 - 8101) + '\146' + '\055' + chr(0b10101 + 0o43)))(GlnVAPeT6CUe))
if not PlSM16l2KDPD(EaCjyhZptSer, xafqLlk3kkUe(sYby0kpfssd4, xafqLlk3kkUe(SXOLrMavuUCe(b'x H\xf7\x94m\xa8\xc5\xde\x93y\x0e'), chr(0b1001 + 0o133) + chr(1892 - 1791) + '\143' + '\157' + '\144' + chr(101))(chr(117) + chr(0b1110100) + '\x66' + chr(1094 - 1049) + '\x38'))):
raise eXWqlSUlGxPF(gvQh1eVhOwBf, xafqLlk3kkUe(SXOLrMavuUCe(b'J$S\xbe\xbf|\x92\xdf\xd3\xc3q\x08U\xb7:\x0fe\xe9W\xf7\xe8\xf1\xda3!Kd2d\x18\x89W\xf3\x11s\xb0\x0bOvYd&\x1a\xb9\xaak\x83\xd9\x80\xcd'), '\x64' + '\145' + chr(0b1100011) + '\157' + '\144' + '\x65')('\x75' + chr(0b1011 + 0o151) + '\146' + chr(1490 - 1445) + chr(0b111000)))
if not PlSM16l2KDPD(CVRCXTcnOnH6, xafqLlk3kkUe(sYby0kpfssd4, xafqLlk3kkUe(SXOLrMavuUCe(b'x H\xf7\x94m\xa8\xc5\xde\x93y\x0e'), chr(0b1100100) + chr(1482 - 1381) + '\143' + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b101010 + 0o113) + '\x74' + chr(0b1100110) + chr(650 - 605) + '\x38'))):
raise eXWqlSUlGxPF(gvQh1eVhOwBf, xafqLlk3kkUe(SXOLrMavuUCe(b'J$S\xbe\xbf|\x92\xdf\xd3\xc3q\x08U\xb7:\x0fe\xe9W\xf7\xe8\xf1\xda3!Kd2d\x18\x89W\xf3\x11s\xb0\x0bOvYd&\x1a\xb9\xb7o\x83\xd9\xc8\x87;S'), chr(0b1010110 + 0o16) + chr(101) + '\143' + '\157' + chr(0b1100100) + chr(1423 - 1322))('\x75' + '\x74' + chr(7325 - 7223) + chr(0b101000 + 0o5) + chr(0b111000)))
Jj8z51C18y68 = oVre8I6UXc3b.api_conditions.setdefault(X7mnYJ6SRw0h, {})
hdPOQZhbk0ke = Jj8z51C18y68.setdefault(EaCjyhZptSer, {})
hdPOQZhbk0ke[CVRCXTcnOnH6] = z3jGhw6b9vwa
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'T5^\xfa\xa5k\x87\xd8\xf8\x97s"U\xb4{\x00c\xfa@'), chr(0b10111 + 0o115) + '\145' + chr(0b1001 + 0o132) + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b1110 + 0o37) + '\070'))(gvQh1eVhOwBf, Zs4hLSKPtP6m, jJBnSHEgylNZ)
G3MCYKKmZ4u9[gvQh1eVhOwBf] = SGm65G84ZKM5
xafqLlk3kkUe(bBC93MgSHzUB.properties[xafqLlk3kkUe(SXOLrMavuUCe(b'N"_\xf0\x8ey'), chr(3437 - 3337) + '\145' + chr(7655 - 7556) + '\x6f' + chr(0b1100100) + chr(684 - 583))(chr(0b1110101) + '\164' + chr(0b1100110) + chr(0b11010 + 0o23) + '\x38')], xafqLlk3kkUe(SXOLrMavuUCe(b'Q {\xdb\x93D\xbd\xdf\xde\xd7yM'), chr(100) + chr(101) + '\143' + chr(1498 - 1387) + chr(264 - 164) + chr(2792 - 2691))(chr(117) + chr(2167 - 2051) + '\x66' + chr(45) + '\x38'))(G3MCYKKmZ4u9)
|
awslabs/serverless-application-model
|
samtranslator/plugins/api/implicit_api_plugin.py
|
ImplicitApiPlugin._add_api_to_swagger
|
def _add_api_to_swagger(self, event_id, event_properties, template):
"""
Adds the API path/method from the given event to the Swagger JSON of Serverless::Api resource this event
refers to.
:param string event_id: LogicalId of the event
:param dict event_properties: Properties of the event
:param SamTemplate template: SAM Template to search for Serverless::Api resources
"""
# Need to grab the AWS::Serverless::Api resource for this API event and update its Swagger definition
api_id = self._get_api_id(event_properties)
# RestApiId is not pointing to a valid API resource
if isinstance(api_id, dict) or not template.get(api_id):
raise InvalidEventException(event_id,
"RestApiId must be a valid reference to an 'AWS::Serverless::Api' resource "
"in same template")
# Make sure Swagger is valid
resource = template.get(api_id)
if not (resource and
isinstance(resource.properties, dict) and
SwaggerEditor.is_valid(resource.properties.get("DefinitionBody"))):
# This does not have an inline Swagger. Nothing can be done about it.
return
if not resource.properties.get("__MANAGE_SWAGGER"):
# Do not add the api to Swagger, if the resource is not actively managed by SAM.
# ie. Implicit API resources are created & managed by SAM on behalf of customers.
# But for explicit API resources, customers write their own Swagger and manage it.
# If a path is present in Events section but *not* present in the Explicit API Swagger, then it is
# customer's responsibility to add to Swagger. We will not modify the Swagger here.
#
# In the future, we will might expose a flag that will allow SAM to manage explicit API Swagger as well.
# Until then, we will not modify explicit explicit APIs.
return
swagger = resource.properties.get("DefinitionBody")
path = event_properties["Path"]
method = event_properties["Method"]
editor = SwaggerEditor(swagger)
editor.add_path(path, method)
resource.properties["DefinitionBody"] = editor.swagger
template.set(api_id, resource)
|
python
|
def _add_api_to_swagger(self, event_id, event_properties, template):
"""
Adds the API path/method from the given event to the Swagger JSON of Serverless::Api resource this event
refers to.
:param string event_id: LogicalId of the event
:param dict event_properties: Properties of the event
:param SamTemplate template: SAM Template to search for Serverless::Api resources
"""
# Need to grab the AWS::Serverless::Api resource for this API event and update its Swagger definition
api_id = self._get_api_id(event_properties)
# RestApiId is not pointing to a valid API resource
if isinstance(api_id, dict) or not template.get(api_id):
raise InvalidEventException(event_id,
"RestApiId must be a valid reference to an 'AWS::Serverless::Api' resource "
"in same template")
# Make sure Swagger is valid
resource = template.get(api_id)
if not (resource and
isinstance(resource.properties, dict) and
SwaggerEditor.is_valid(resource.properties.get("DefinitionBody"))):
# This does not have an inline Swagger. Nothing can be done about it.
return
if not resource.properties.get("__MANAGE_SWAGGER"):
# Do not add the api to Swagger, if the resource is not actively managed by SAM.
# ie. Implicit API resources are created & managed by SAM on behalf of customers.
# But for explicit API resources, customers write their own Swagger and manage it.
# If a path is present in Events section but *not* present in the Explicit API Swagger, then it is
# customer's responsibility to add to Swagger. We will not modify the Swagger here.
#
# In the future, we will might expose a flag that will allow SAM to manage explicit API Swagger as well.
# Until then, we will not modify explicit explicit APIs.
return
swagger = resource.properties.get("DefinitionBody")
path = event_properties["Path"]
method = event_properties["Method"]
editor = SwaggerEditor(swagger)
editor.add_path(path, method)
resource.properties["DefinitionBody"] = editor.swagger
template.set(api_id, resource)
|
[
"def",
"_add_api_to_swagger",
"(",
"self",
",",
"event_id",
",",
"event_properties",
",",
"template",
")",
":",
"# Need to grab the AWS::Serverless::Api resource for this API event and update its Swagger definition",
"api_id",
"=",
"self",
".",
"_get_api_id",
"(",
"event_properties",
")",
"# RestApiId is not pointing to a valid API resource",
"if",
"isinstance",
"(",
"api_id",
",",
"dict",
")",
"or",
"not",
"template",
".",
"get",
"(",
"api_id",
")",
":",
"raise",
"InvalidEventException",
"(",
"event_id",
",",
"\"RestApiId must be a valid reference to an 'AWS::Serverless::Api' resource \"",
"\"in same template\"",
")",
"# Make sure Swagger is valid",
"resource",
"=",
"template",
".",
"get",
"(",
"api_id",
")",
"if",
"not",
"(",
"resource",
"and",
"isinstance",
"(",
"resource",
".",
"properties",
",",
"dict",
")",
"and",
"SwaggerEditor",
".",
"is_valid",
"(",
"resource",
".",
"properties",
".",
"get",
"(",
"\"DefinitionBody\"",
")",
")",
")",
":",
"# This does not have an inline Swagger. Nothing can be done about it.",
"return",
"if",
"not",
"resource",
".",
"properties",
".",
"get",
"(",
"\"__MANAGE_SWAGGER\"",
")",
":",
"# Do not add the api to Swagger, if the resource is not actively managed by SAM.",
"# ie. Implicit API resources are created & managed by SAM on behalf of customers.",
"# But for explicit API resources, customers write their own Swagger and manage it.",
"# If a path is present in Events section but *not* present in the Explicit API Swagger, then it is",
"# customer's responsibility to add to Swagger. We will not modify the Swagger here.",
"#",
"# In the future, we will might expose a flag that will allow SAM to manage explicit API Swagger as well.",
"# Until then, we will not modify explicit explicit APIs.",
"return",
"swagger",
"=",
"resource",
".",
"properties",
".",
"get",
"(",
"\"DefinitionBody\"",
")",
"path",
"=",
"event_properties",
"[",
"\"Path\"",
"]",
"method",
"=",
"event_properties",
"[",
"\"Method\"",
"]",
"editor",
"=",
"SwaggerEditor",
"(",
"swagger",
")",
"editor",
".",
"add_path",
"(",
"path",
",",
"method",
")",
"resource",
".",
"properties",
"[",
"\"DefinitionBody\"",
"]",
"=",
"editor",
".",
"swagger",
"template",
".",
"set",
"(",
"api_id",
",",
"resource",
")"
] |
Adds the API path/method from the given event to the Swagger JSON of Serverless::Api resource this event
refers to.
:param string event_id: LogicalId of the event
:param dict event_properties: Properties of the event
:param SamTemplate template: SAM Template to search for Serverless::Api resources
|
[
"Adds",
"the",
"API",
"path",
"/",
"method",
"from",
"the",
"given",
"event",
"to",
"the",
"Swagger",
"JSON",
"of",
"Serverless",
"::",
"Api",
"resource",
"this",
"event",
"refers",
"to",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/api/implicit_api_plugin.py#L175-L221
|
train
|
Adds the API path and method from the given event to the Swagger JSON of Serverless API resources.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T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X,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + '\x32' + '\x34' + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + '\x31' + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(0b111101 + 0o62) + chr(0b110001) + chr(53) + chr(2806 - 2753), ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + '\062' + chr(0b11100 + 0o24) + chr(902 - 847), 0b1000), ehT0Px3KOsy9('\x30' + chr(11669 - 11558) + chr(50) + '\066' + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(0b110110) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + chr(0b11000 + 0o34), 30152 - 30144), ehT0Px3KOsy9('\x30' + chr(0b110110 + 0o71) + chr(0b110110) + chr(0b100000 + 0o27), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1001001 + 0o46) + chr(0b110001) + '\062' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9569 - 9458) + chr(0b110101) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + chr(4435 - 4324) + chr(0b110001) + chr(0b100 + 0o62) + '\x37', 52920 - 52912), ehT0Px3KOsy9(chr(680 - 632) + chr(111) + chr(590 - 540) + '\061' + chr(2238 - 2186), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(0b11101 + 0o24), 34084 - 34076), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110 + 0o53) + '\x37' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(53) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\157' + chr(1555 - 1504) + chr(54) + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010011 + 0o34) + chr(0b101 + 0o55) + chr(884 - 834) + '\x36', 21441 - 21433), ehT0Px3KOsy9(chr(1533 - 1485) + chr(111) + chr(0b101000 + 0o12) + chr(0b110000) + chr(54), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\066' + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + '\x36' + chr(98 - 43), 0o10), ehT0Px3KOsy9(chr(1541 - 1493) + '\157' + chr(438 - 389) + chr(0b1000 + 0o53) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(52) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(0b110001) + '\067' + chr(0b101111 + 0o7), ord("\x08")), ehT0Px3KOsy9(chr(568 - 520) + '\x6f' + '\065' + chr(0b11110 + 0o22), 58373 - 58365), ehT0Px3KOsy9(chr(0b110000) + chr(4751 - 4640) + chr(0b100010 + 0o20) + chr(0b110001) + '\x37', 0o10), ehT0Px3KOsy9(chr(2249 - 2201) + chr(0b1100100 + 0o13) + chr(50) + chr(0b110001) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + chr(11742 - 11631) + '\x32' + chr(48) + chr(54), 8), ehT0Px3KOsy9(chr(48) + chr(0b1001000 + 0o47) + chr(0b1010 + 0o47) + chr(0b110010) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x37' + chr(0b11 + 0o56), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b1101 + 0o44) + chr(0b101101 + 0o12) + chr(0b110110), 8), ehT0Px3KOsy9('\060' + chr(0b1001 + 0o146) + '\064' + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(4697 - 4586) + chr(0b1010 + 0o50) + chr(787 - 739) + chr(54), 8), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(1910 - 1799) + '\x31' + chr(50) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1011 + 0o144) + chr(1046 - 997) + chr(0b110110) + chr(0b11101 + 0o23), 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\x6f' + chr(51) + chr(0b110001 + 0o3) + chr(2250 - 2198), 0b1000), ehT0Px3KOsy9(chr(135 - 87) + chr(0b1101111) + chr(1336 - 1286) + chr(2350 - 2299) + chr(53), 0o10), ehT0Px3KOsy9(chr(815 - 767) + chr(5692 - 5581) + chr(0b110001) + chr(1617 - 1565) + chr(0b1000 + 0o54), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1001 + 0o146) + '\x33' + '\061' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(711 - 663) + '\x6f' + chr(0b100110 + 0o13) + chr(0b111 + 0o54) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011101 + 0o22) + chr(0b110110) + chr(0b100010 + 0o23), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1011111 + 0o20) + chr(1533 - 1480) + chr(48), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c'), '\x64' + chr(0b101100 + 0o71) + chr(2761 - 2662) + chr(685 - 574) + chr(0b1001100 + 0o30) + chr(101))(chr(0b1110101) + '\x74' + chr(102) + chr(45) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def l2J44N3vuMFm(oVre8I6UXc3b, mlmIF0P1KCK5, Zs4hLSKPtP6m, jJBnSHEgylNZ):
X7mnYJ6SRw0h = oVre8I6UXc3b._get_api_id(Zs4hLSKPtP6m)
if PlSM16l2KDPD(X7mnYJ6SRw0h, wLqBDw8l0eIm) or not xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5+\x19'), chr(5887 - 5787) + chr(0b1100101) + '\x63' + chr(111) + '\x64' + chr(0b1000000 + 0o45))(chr(0b1110101) + '\164' + chr(0b100000 + 0o106) + chr(45) + '\070'))(X7mnYJ6SRw0h):
raise eXWqlSUlGxPF(mlmIF0P1KCK5, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0+\x1e\xf3\xf1\xc6m~3\x0e\x1a\xf9b\t\x8c\x91\xf3\xa6W\xd7*C\x12A\xeb\xa8\xf44_\x1bR\xe3=\x13\x81\xbd\x10\xa1~T\xccnJ\xc6\xe7\xe5>\r\x04K\x05\xfat\x0f\xc0\x96\xe5\xf5\x0c\xcd\x1dR\x17\x0f\xaf\xfa\xe3"V\x0bR\xe56P\x8d\xf3D\xbd?X\xc7n\x19\xe2\xdd\xc6hV#K'), '\144' + chr(3373 - 3272) + '\143' + '\x6f' + chr(9979 - 9879) + '\145')(chr(0b110110 + 0o77) + chr(0b1110100) + chr(6990 - 6888) + chr(0b110 + 0o47) + '\070'))
o9IPj2MJBBod = jJBnSHEgylNZ.get(X7mnYJ6SRw0h)
if not (o9IPj2MJBBod and PlSM16l2KDPD(xafqLlk3kkUe(o9IPj2MJBBod, xafqLlk3kkUe(SXOLrMavuUCe(b"\xcdz \xf1\x88\x84w{:a'\xb4"), chr(100) + chr(101) + chr(250 - 151) + chr(5725 - 5614) + '\144' + chr(0b1100101))(chr(117) + '\164' + '\x66' + chr(0b101101) + chr(715 - 659))), wLqBDw8l0eIm) and xafqLlk3kkUe(IX7SCU7eVrph, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcb=2\xf1\xd1\xdamS'), chr(0b1 + 0o143) + '\x65' + chr(99) + chr(0b1101111) + '\144' + chr(0b10011 + 0o122))(chr(0b1110101) + chr(2690 - 2574) + chr(9333 - 9231) + '\055' + chr(616 - 560)))(xafqLlk3kkUe(o9IPj2MJBBod.properties, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5+\x19'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(0b1010001 + 0o36) + chr(5484 - 5384) + chr(732 - 631))('\x75' + chr(10068 - 9952) + '\x66' + '\055' + chr(202 - 146)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6+\x0b\xee\xde\xdfp^8@5\xe3u\x04'), chr(0b1100100) + chr(4585 - 4484) + chr(0b1100 + 0o127) + chr(5070 - 4959) + chr(6758 - 6658) + chr(0b1011010 + 0o13))(chr(5412 - 5295) + chr(3039 - 2923) + chr(102) + chr(0b101101) + chr(56))))):
return
if not xafqLlk3kkUe(o9IPj2MJBBod.properties, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5+\x19'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(9341 - 9230) + chr(182 - 82) + chr(101))('\x75' + chr(0b1110100) + chr(6514 - 6412) + chr(0b100000 + 0o15) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfd\x11 \xc6\xfe\xf7Cr\x08} \xcdV:\xe9\xa1'), '\144' + chr(101) + chr(8440 - 8341) + chr(8137 - 8026) + chr(100) + chr(0b1100101))(chr(117) + chr(0b1110100) + '\x66' + chr(407 - 362) + chr(56))):
return
vKQLfCidaf7H = o9IPj2MJBBod.properties.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6+\x0b\xee\xde\xdfp^8@5\xe3u\x04'), chr(100) + '\x65' + chr(0b1010000 + 0o23) + chr(0b1101111) + chr(0b1000000 + 0o44) + chr(0b111110 + 0o47))(chr(8390 - 8273) + chr(8389 - 8273) + '\x66' + '\055' + chr(0b111000)))
EaCjyhZptSer = Zs4hLSKPtP6m[xafqLlk3kkUe(SXOLrMavuUCe(b'\xf2/\x19\xef'), '\x64' + chr(0b1100101) + chr(99) + chr(111) + '\x64' + '\x65')('\x75' + '\164' + '\146' + chr(0b101101) + chr(56))]
CVRCXTcnOnH6 = Zs4hLSKPtP6m[xafqLlk3kkUe(SXOLrMavuUCe(b'\xef+\x19\xef\xdf\xd2'), chr(0b1010001 + 0o23) + chr(9233 - 9132) + '\x63' + '\x6f' + '\x64' + '\145')('\x75' + chr(116) + '\x66' + '\055' + '\070')]
QP6wN7VyBwGk = IX7SCU7eVrph(vKQLfCidaf7H)
xafqLlk3kkUe(QP6wN7VyBwGk, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3*\t\xd8\xc0\xd7p_'), chr(0b1100100) + chr(0b1100101) + chr(5820 - 5721) + chr(0b1000001 + 0o56) + chr(2710 - 2610) + '\x65')('\x75' + chr(0b1110100) + '\x66' + chr(45) + chr(56)))(EaCjyhZptSer, CVRCXTcnOnH6)
o9IPj2MJBBod.o4Mv82sLmOP8[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6+\x0b\xee\xde\xdfp^8@5\xe3u\x04'), '\x64' + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(100) + '\x65')(chr(0b1110101) + chr(116) + '\146' + chr(45) + chr(1222 - 1166))] = QP6wN7VyBwGk.swagger
xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd1+\x19'), '\x64' + chr(9103 - 9002) + '\x63' + '\x6f' + chr(7229 - 7129) + chr(0b10001 + 0o124))('\x75' + chr(0b0 + 0o164) + chr(0b1000110 + 0o40) + chr(763 - 718) + chr(0b1011 + 0o55)))(X7mnYJ6SRw0h, o9IPj2MJBBod)
|
awslabs/serverless-application-model
|
samtranslator/plugins/api/implicit_api_plugin.py
|
ImplicitApiPlugin._get_api_id
|
def _get_api_id(self, event_properties):
"""
Get API logical id from API event properties.
Handles case where API id is not specified or is a reference to a logical id.
"""
api_id = event_properties.get("RestApiId")
if isinstance(api_id, dict) and "Ref" in api_id:
api_id = api_id["Ref"]
return api_id
|
python
|
def _get_api_id(self, event_properties):
"""
Get API logical id from API event properties.
Handles case where API id is not specified or is a reference to a logical id.
"""
api_id = event_properties.get("RestApiId")
if isinstance(api_id, dict) and "Ref" in api_id:
api_id = api_id["Ref"]
return api_id
|
[
"def",
"_get_api_id",
"(",
"self",
",",
"event_properties",
")",
":",
"api_id",
"=",
"event_properties",
".",
"get",
"(",
"\"RestApiId\"",
")",
"if",
"isinstance",
"(",
"api_id",
",",
"dict",
")",
"and",
"\"Ref\"",
"in",
"api_id",
":",
"api_id",
"=",
"api_id",
"[",
"\"Ref\"",
"]",
"return",
"api_id"
] |
Get API logical id from API event properties.
Handles case where API id is not specified or is a reference to a logical id.
|
[
"Get",
"API",
"logical",
"id",
"from",
"API",
"event",
"properties",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/api/implicit_api_plugin.py#L223-L232
|
train
|
Get API id from API event properties.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjV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Error,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1245 - 1197) + '\157' + '\062' + '\066' + chr(0b110001 + 0o0), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + chr(0b110001) + '\x35' + chr(1787 - 1736), 0o10), ehT0Px3KOsy9(chr(48) + chr(11882 - 11771) + chr(51) + chr(1155 - 1104) + chr(1880 - 1830), 0o10), ehT0Px3KOsy9(chr(623 - 575) + '\x6f' + chr(2089 - 2040) + chr(1927 - 1877), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(0b110101) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\066' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1001011 + 0o44) + chr(52) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(2203 - 2155) + chr(111) + chr(0b110011) + '\x33' + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\063' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(1380 - 1332) + chr(111) + chr(51) + chr(0b110111) + chr(0b11110 + 0o30), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b110101) + chr(1747 - 1697), 8), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(2815 - 2704) + chr(0b110011) + chr(0b100010 + 0o17) + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(0b100111 + 0o110) + chr(50) + chr(0b110110) + '\060', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1690 - 1641) + '\x35' + chr(2377 - 2322), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b110111) + '\x31', 0o10), ehT0Px3KOsy9(chr(1942 - 1894) + chr(3215 - 3104) + '\x33' + chr(0b100000 + 0o24) + chr(0b110101), 2555 - 2547), ehT0Px3KOsy9('\060' + '\157' + chr(0b1000 + 0o57) + '\067', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(53) + chr(0b100000 + 0o23), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(0b110001) + chr(968 - 914) + '\x33', 0b1000), ehT0Px3KOsy9(chr(249 - 201) + '\x6f' + '\061' + '\x37' + chr(50), 4474 - 4466), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100 + 0o57) + chr(0b101 + 0o55) + chr(2645 - 2591), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1000 + 0o147) + chr(0b101011 + 0o7) + '\x37' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(5046 - 4935) + chr(0b110010) + '\x35' + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + chr(50) + chr(2158 - 2106) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101101 + 0o4) + chr(0b110001) + '\x35', 25017 - 25009), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100100 + 0o17) + chr(0b110100) + chr(2181 - 2132), 44610 - 44602), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + '\x36' + '\062', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + chr(54), 52665 - 52657), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(54) + chr(0b11010 + 0o34), 0b1000), ehT0Px3KOsy9('\x30' + chr(3932 - 3821) + chr(51) + '\063' + chr(0b1101 + 0o44), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(52) + chr(55), 0b1000), ehT0Px3KOsy9(chr(446 - 398) + chr(6035 - 5924) + chr(0b100000 + 0o22) + chr(0b1110 + 0o50) + '\062', 8), ehT0Px3KOsy9(chr(1695 - 1647) + chr(0b1011001 + 0o26) + chr(50) + '\066' + chr(0b1000 + 0o53), 0b1000), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\157' + chr(884 - 833) + chr(0b10 + 0o60) + '\061', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(2043 - 1993) + '\x35' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(1543 - 1495) + '\x6f' + chr(1792 - 1741) + chr(302 - 253) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + chr(49) + chr(1398 - 1346) + chr(2087 - 2038), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2244 - 2194) + '\064' + chr(683 - 630), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(434 - 384) + chr(0b1111 + 0o46) + chr(55), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + chr(1786 - 1736) + chr(0b110001), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1110 + 0o47) + chr(0b110000), 49150 - 49142)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f'), '\x64' + chr(5433 - 5332) + chr(99) + '\157' + chr(100) + '\x65')('\x75' + chr(116) + chr(102) + chr(0b101101) + chr(0b110011 + 0o5)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def CIg7RkQFOboA(oVre8I6UXc3b, Zs4hLSKPtP6m):
X7mnYJ6SRw0h = Zs4hLSKPtP6m.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe3\x0e\xa9~\xabAL\x91\xbd'), chr(100) + chr(1759 - 1658) + '\x63' + '\x6f' + chr(0b1100100) + chr(0b1000100 + 0o41))(chr(0b101000 + 0o115) + chr(1705 - 1589) + chr(102) + chr(45) + chr(0b111000)))
if PlSM16l2KDPD(X7mnYJ6SRw0h, wLqBDw8l0eIm) and xafqLlk3kkUe(SXOLrMavuUCe(b'\xe3\x0e\xbc'), '\144' + chr(101) + chr(0b10000 + 0o123) + '\157' + '\x64' + chr(0b111100 + 0o51))(chr(0b111101 + 0o70) + chr(0b1010111 + 0o35) + '\x66' + '\055' + chr(56)) in X7mnYJ6SRw0h:
X7mnYJ6SRw0h = X7mnYJ6SRw0h[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe3\x0e\xbc'), chr(0b1000111 + 0o35) + chr(0b1100101) + chr(99) + chr(111) + chr(100) + '\x65')(chr(0b1110101) + '\164' + chr(8688 - 8586) + chr(0b101101) + chr(0b111000))]
return X7mnYJ6SRw0h
|
awslabs/serverless-application-model
|
samtranslator/plugins/api/implicit_api_plugin.py
|
ImplicitApiPlugin._maybe_add_condition_to_implicit_api
|
def _maybe_add_condition_to_implicit_api(self, template_dict):
"""
Decides whether to add a condition to the implicit api resource.
:param dict template_dict: SAM template dictionary
"""
# Short-circuit if template doesn't have any functions with implicit API events
if not self.api_conditions.get(self.implicit_api_logical_id, {}):
return
# Add a condition to the API resource IFF all of its resource+methods are associated with serverless functions
# containing conditions.
implicit_api_conditions = self.api_conditions[self.implicit_api_logical_id]
all_resource_method_conditions = set([condition
for path, method_conditions in implicit_api_conditions.items()
for method, condition in method_conditions.items()])
at_least_one_resource_method = len(all_resource_method_conditions) > 0
all_resource_methods_contain_conditions = None not in all_resource_method_conditions
if at_least_one_resource_method and all_resource_methods_contain_conditions:
implicit_api_resource = template_dict.get('Resources').get(self.implicit_api_logical_id)
if len(all_resource_method_conditions) == 1:
condition = all_resource_method_conditions.pop()
implicit_api_resource['Condition'] = condition
else:
# If multiple functions with multiple different conditions reference the Implicit Api, we need to
# aggregate those conditions in order to conditionally create the Implicit Api. See RFC:
# https://github.com/awslabs/serverless-application-model/issues/758
implicit_api_resource['Condition'] = self.implicit_api_condition
self._add_combined_condition_to_template(
template_dict, self.implicit_api_condition, all_resource_method_conditions)
|
python
|
def _maybe_add_condition_to_implicit_api(self, template_dict):
"""
Decides whether to add a condition to the implicit api resource.
:param dict template_dict: SAM template dictionary
"""
# Short-circuit if template doesn't have any functions with implicit API events
if not self.api_conditions.get(self.implicit_api_logical_id, {}):
return
# Add a condition to the API resource IFF all of its resource+methods are associated with serverless functions
# containing conditions.
implicit_api_conditions = self.api_conditions[self.implicit_api_logical_id]
all_resource_method_conditions = set([condition
for path, method_conditions in implicit_api_conditions.items()
for method, condition in method_conditions.items()])
at_least_one_resource_method = len(all_resource_method_conditions) > 0
all_resource_methods_contain_conditions = None not in all_resource_method_conditions
if at_least_one_resource_method and all_resource_methods_contain_conditions:
implicit_api_resource = template_dict.get('Resources').get(self.implicit_api_logical_id)
if len(all_resource_method_conditions) == 1:
condition = all_resource_method_conditions.pop()
implicit_api_resource['Condition'] = condition
else:
# If multiple functions with multiple different conditions reference the Implicit Api, we need to
# aggregate those conditions in order to conditionally create the Implicit Api. See RFC:
# https://github.com/awslabs/serverless-application-model/issues/758
implicit_api_resource['Condition'] = self.implicit_api_condition
self._add_combined_condition_to_template(
template_dict, self.implicit_api_condition, all_resource_method_conditions)
|
[
"def",
"_maybe_add_condition_to_implicit_api",
"(",
"self",
",",
"template_dict",
")",
":",
"# Short-circuit if template doesn't have any functions with implicit API events",
"if",
"not",
"self",
".",
"api_conditions",
".",
"get",
"(",
"self",
".",
"implicit_api_logical_id",
",",
"{",
"}",
")",
":",
"return",
"# Add a condition to the API resource IFF all of its resource+methods are associated with serverless functions",
"# containing conditions.",
"implicit_api_conditions",
"=",
"self",
".",
"api_conditions",
"[",
"self",
".",
"implicit_api_logical_id",
"]",
"all_resource_method_conditions",
"=",
"set",
"(",
"[",
"condition",
"for",
"path",
",",
"method_conditions",
"in",
"implicit_api_conditions",
".",
"items",
"(",
")",
"for",
"method",
",",
"condition",
"in",
"method_conditions",
".",
"items",
"(",
")",
"]",
")",
"at_least_one_resource_method",
"=",
"len",
"(",
"all_resource_method_conditions",
")",
">",
"0",
"all_resource_methods_contain_conditions",
"=",
"None",
"not",
"in",
"all_resource_method_conditions",
"if",
"at_least_one_resource_method",
"and",
"all_resource_methods_contain_conditions",
":",
"implicit_api_resource",
"=",
"template_dict",
".",
"get",
"(",
"'Resources'",
")",
".",
"get",
"(",
"self",
".",
"implicit_api_logical_id",
")",
"if",
"len",
"(",
"all_resource_method_conditions",
")",
"==",
"1",
":",
"condition",
"=",
"all_resource_method_conditions",
".",
"pop",
"(",
")",
"implicit_api_resource",
"[",
"'Condition'",
"]",
"=",
"condition",
"else",
":",
"# If multiple functions with multiple different conditions reference the Implicit Api, we need to",
"# aggregate those conditions in order to conditionally create the Implicit Api. See RFC:",
"# https://github.com/awslabs/serverless-application-model/issues/758",
"implicit_api_resource",
"[",
"'Condition'",
"]",
"=",
"self",
".",
"implicit_api_condition",
"self",
".",
"_add_combined_condition_to_template",
"(",
"template_dict",
",",
"self",
".",
"implicit_api_condition",
",",
"all_resource_method_conditions",
")"
] |
Decides whether to add a condition to the implicit api resource.
:param dict template_dict: SAM template dictionary
|
[
"Decides",
"whether",
"to",
"add",
"a",
"condition",
"to",
"the",
"implicit",
"api",
"resource",
".",
":",
"param",
"dict",
"template_dict",
":",
"SAM",
"template",
"dictionary"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/api/implicit_api_plugin.py#L234-L262
|
train
|
Adds a condition to the implicit API resource if it is not already present in the template.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv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fhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + '\065' + '\066', 0b1000), ehT0Px3KOsy9(chr(1102 - 1054) + chr(111) + chr(665 - 614) + chr(54) + '\x33', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(0b110011 + 0o0) + chr(0b110000 + 0o0), 47627 - 47619), ehT0Px3KOsy9(chr(1689 - 1641) + '\157' + chr(0b101000 + 0o13) + chr(0b110001) + chr(49), 0o10), ehT0Px3KOsy9(chr(778 - 730) + chr(0b111111 + 0o60) + chr(51) + '\060' + chr(1342 - 1291), 0o10), ehT0Px3KOsy9('\x30' + chr(3861 - 3750) + chr(51) + chr(52) + chr(844 - 790), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(544 - 493) + chr(52) + '\061', 43224 - 43216), ehT0Px3KOsy9(chr(2197 - 2149) + chr(0b1101111) + chr(0b10110 + 0o33) + chr(0b110101) + chr(2078 - 2027), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100111 + 0o12) + '\x31' + '\x30', 23587 - 23579), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + '\x30' + chr(0b11 + 0o56), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(55) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1000111 + 0o50) + chr(49) + '\062' + chr(0b101101 + 0o4), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(0b110111 + 0o0) + chr(0b10100 + 0o40), ord("\x08")), ehT0Px3KOsy9(chr(1828 - 1780) + chr(0b110000 + 0o77) + chr(49) + chr(0b10001 + 0o43) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + '\066' + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11111 + 0o23) + '\x31' + chr(2963 - 2908), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(53) + chr(54), 0b1000), ehT0Px3KOsy9(chr(2189 - 2141) + chr(0b101010 + 0o105) + chr(704 - 654) + chr(0b10010 + 0o36) + chr(2043 - 1988), 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + '\x31' + chr(49) + chr(585 - 532), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(0b110001) + chr(49) + chr(54), 41280 - 41272), ehT0Px3KOsy9('\060' + chr(950 - 839) + chr(801 - 750) + chr(0b110010), 17644 - 17636), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(1103 - 1055) + chr(111) + chr(0b110010) + '\x33' + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101001 + 0o10) + '\x30' + chr(2291 - 2239), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + '\x37' + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010011 + 0o34) + '\x33' + '\063' + chr(0b110011 + 0o1), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001100 + 0o43) + '\067' + '\x31', 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010 + 0o1) + chr(0b110011) + chr(0b110011), 13691 - 13683), ehT0Px3KOsy9(chr(637 - 589) + '\x6f' + '\063' + chr(0b110010) + '\x34', 48044 - 48036), ehT0Px3KOsy9(chr(863 - 815) + chr(0b11010 + 0o125) + chr(0b11000 + 0o33) + chr(0b110101) + chr(55), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1414 - 1363) + '\067' + chr(0b100000 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(727 - 678) + chr(0b1110 + 0o47) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2372 - 2319) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + '\063' + '\066' + chr(943 - 889), 31853 - 31845), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\x36' + chr(0b1010 + 0o50), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(923 - 873) + '\063' + '\x34', 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10110 + 0o35) + chr(49) + '\062', 20844 - 20836), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(208 - 97) + chr(49) + chr(52) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + chr(0b110001) + '\065' + '\x34', 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b110111) + chr(0b110010), 7880 - 7872)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b11000 + 0o127) + chr(0b110101) + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0'), '\x64' + chr(5377 - 5276) + chr(0b11110 + 0o105) + chr(111) + chr(0b1100100) + chr(0b1100101))(chr(0b1101010 + 0o13) + '\164' + chr(7522 - 7420) + '\055' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def TjmYxk8Y2p5E(oVre8I6UXc3b, PPP5FvnpV6j7):
if not xafqLlk3kkUe(oVre8I6UXc3b.api_conditions, xafqLlk3kkUe(SXOLrMavuUCe(b'\x89\x96,'), '\x64' + chr(101) + '\143' + chr(111) + chr(0b1100100) + '\145')('\x75' + chr(0b11110 + 0o126) + '\146' + chr(0b100010 + 0o13) + chr(0b11001 + 0o37)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x87\x9e(\xa5\xaa\x85\x88\x1f\x17\xa0I8\xe3\r\x9b\xe8\xc7\xe4,"E{\xf8'), chr(9237 - 9137) + chr(0b1100101) + chr(99) + chr(3896 - 3785) + chr(0b1100100) + chr(0b1011 + 0o132))(chr(0b1110001 + 0o4) + chr(3133 - 3017) + '\x66' + chr(45) + '\070')), {}):
return
d5JRAR0pBm3B = oVre8I6UXc3b.api_conditions[oVre8I6UXc3b.implicit_api_logical_id]
bWWQsirg_ImC = MVEN8G6CxlvR([z3jGhw6b9vwa for (EaCjyhZptSer, hdPOQZhbk0ke) in d5JRAR0pBm3B.NzveIZ3IlSH9() for (CVRCXTcnOnH6, z3jGhw6b9vwa) in hdPOQZhbk0ke.NzveIZ3IlSH9()])
xIw1BaH_cR_u = c2A0yzQpDQB3(bWWQsirg_ImC) > ehT0Px3KOsy9('\x30' + '\157' + chr(647 - 599), ord("\x08"))
NH_AU3iX8kvq = None not in bWWQsirg_ImC
if xIw1BaH_cR_u and NH_AU3iX8kvq:
tuyWflhlejom = PPP5FvnpV6j7.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\x96+\xa6\xb6\x94\x82\x0e;'), chr(0b10011 + 0o121) + chr(0b11111 + 0o106) + chr(0b1100011) + '\157' + chr(0b1001110 + 0o26) + '\145')(chr(416 - 299) + '\164' + chr(0b1111 + 0o127) + '\055' + chr(0b100101 + 0o23))).get(oVre8I6UXc3b.implicit_api_logical_id)
if c2A0yzQpDQB3(bWWQsirg_ImC) == ehT0Px3KOsy9('\060' + chr(8572 - 8461) + chr(49), ord("\x08")):
z3jGhw6b9vwa = bWWQsirg_ImC.pop()
tuyWflhlejom[xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\x9c6\xad\xaa\x92\x88\x04&'), '\144' + chr(101) + chr(0b1100011) + chr(2105 - 1994) + '\144' + '\x65')(chr(0b101000 + 0o115) + '\x74' + chr(2166 - 2064) + chr(1396 - 1351) + chr(1776 - 1720))] = z3jGhw6b9vwa
else:
tuyWflhlejom[xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\x9c6\xad\xaa\x92\x88\x04&'), chr(936 - 836) + '\145' + chr(0b10101 + 0o116) + chr(111) + chr(0b1100100) + chr(0b111000 + 0o55))(chr(9167 - 9050) + chr(0b1110100) + chr(0b1011010 + 0o14) + '\x2d' + chr(0b111000))] = oVre8I6UXc3b.implicit_api_condition
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\x92<\xad\x9c\x85\x8e\x06*\xa8W4\xd8>\x97\xe0\xc0\xe3$:s}\xf2\x1b\x8c\xb3f\xaf\xb1\x82\x89\x00N\x82\x17'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(9433 - 9322) + chr(100) + chr(0b1100101))('\165' + chr(10709 - 10593) + chr(3712 - 3610) + chr(45) + chr(56)))(PPP5FvnpV6j7, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"\x87\x9e(\xa5\xaa\x85\x88\x1f\x17\xa0I8\xe3\x02\x9b\xe1\xca\xee9'u|"), chr(0b1100100) + chr(101) + chr(556 - 457) + chr(4943 - 4832) + chr(0b101011 + 0o71) + '\145')('\x75' + '\164' + chr(0b11 + 0o143) + chr(0b101101) + chr(2006 - 1950))), bWWQsirg_ImC)
|
awslabs/serverless-application-model
|
samtranslator/plugins/api/implicit_api_plugin.py
|
ImplicitApiPlugin._add_combined_condition_to_template
|
def _add_combined_condition_to_template(self, template_dict, condition_name, conditions_to_combine):
"""
Add top-level template condition that combines the given list of conditions.
:param dict template_dict: SAM template dictionary
:param string condition_name: Name of top-level template condition
:param list conditions_to_combine: List of conditions that should be combined (via OR operator) to form
top-level condition.
"""
# defensive precondition check
if not conditions_to_combine or len(conditions_to_combine) < 2:
raise ValueError('conditions_to_combine must have at least 2 conditions')
template_conditions = template_dict.setdefault('Conditions', {})
new_template_conditions = make_combined_condition(sorted(list(conditions_to_combine)), condition_name)
for name, definition in new_template_conditions.items():
template_conditions[name] = definition
|
python
|
def _add_combined_condition_to_template(self, template_dict, condition_name, conditions_to_combine):
"""
Add top-level template condition that combines the given list of conditions.
:param dict template_dict: SAM template dictionary
:param string condition_name: Name of top-level template condition
:param list conditions_to_combine: List of conditions that should be combined (via OR operator) to form
top-level condition.
"""
# defensive precondition check
if not conditions_to_combine or len(conditions_to_combine) < 2:
raise ValueError('conditions_to_combine must have at least 2 conditions')
template_conditions = template_dict.setdefault('Conditions', {})
new_template_conditions = make_combined_condition(sorted(list(conditions_to_combine)), condition_name)
for name, definition in new_template_conditions.items():
template_conditions[name] = definition
|
[
"def",
"_add_combined_condition_to_template",
"(",
"self",
",",
"template_dict",
",",
"condition_name",
",",
"conditions_to_combine",
")",
":",
"# defensive precondition check",
"if",
"not",
"conditions_to_combine",
"or",
"len",
"(",
"conditions_to_combine",
")",
"<",
"2",
":",
"raise",
"ValueError",
"(",
"'conditions_to_combine must have at least 2 conditions'",
")",
"template_conditions",
"=",
"template_dict",
".",
"setdefault",
"(",
"'Conditions'",
",",
"{",
"}",
")",
"new_template_conditions",
"=",
"make_combined_condition",
"(",
"sorted",
"(",
"list",
"(",
"conditions_to_combine",
")",
")",
",",
"condition_name",
")",
"for",
"name",
",",
"definition",
"in",
"new_template_conditions",
".",
"items",
"(",
")",
":",
"template_conditions",
"[",
"name",
"]",
"=",
"definition"
] |
Add top-level template condition that combines the given list of conditions.
:param dict template_dict: SAM template dictionary
:param string condition_name: Name of top-level template condition
:param list conditions_to_combine: List of conditions that should be combined (via OR operator) to form
top-level condition.
|
[
"Add",
"top",
"-",
"level",
"template",
"condition",
"that",
"combines",
"the",
"given",
"list",
"of",
"conditions",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/api/implicit_api_plugin.py#L264-L280
|
train
|
Add a combined condition to the SAM template dictionary.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCH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,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + chr(1932 - 1879) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + chr(50) + chr(0b101111 + 0o4) + chr(0b11100 + 0o32), 42363 - 42355), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(54) + chr(770 - 722), 0o10), ehT0Px3KOsy9(chr(341 - 293) + chr(0b1101111) + '\x31' + chr(54) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + '\063' + chr(0b110000) + chr(53), 20477 - 20469), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101100 + 0o5) + '\x37' + '\067', 60448 - 60440), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2290 - 2235) + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(564 - 515) + chr(0b110000) + chr(1933 - 1885), ord("\x08")), ehT0Px3KOsy9(chr(1181 - 1133) + '\x6f' + '\x33' + chr(0b11000 + 0o31) + chr(0b101100 + 0o13), 25840 - 25832), ehT0Px3KOsy9(chr(48) + chr(0b1101001 + 0o6) + '\x32' + chr(0b100010 + 0o21) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + '\061' + chr(0b1001 + 0o53) + chr(1620 - 1566), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + '\065' + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + chr(0b110010) + chr(0b10001 + 0o37) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\x6f' + '\x31' + '\065' + chr(1469 - 1421), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111000 + 0o67) + '\063' + '\066' + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(0b110110) + chr(0b1010 + 0o46), 50703 - 50695), ehT0Px3KOsy9(chr(1105 - 1057) + chr(0b1101111) + chr(0b110100) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(577 - 528) + '\x34' + chr(0b110000), 19545 - 19537), ehT0Px3KOsy9(chr(0b110000) + chr(0b100010 + 0o115) + chr(2273 - 2223) + '\062' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(843 - 790) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(408 - 360) + chr(0b11101 + 0o122) + chr(50) + chr(48) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + '\063' + '\x34', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(54) + chr(673 - 619), 62420 - 62412), ehT0Px3KOsy9('\060' + chr(2397 - 2286) + chr(0b100011 + 0o16) + chr(50) + chr(0b101 + 0o53), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(2864 - 2810) + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(2419 - 2368) + '\063' + chr(2183 - 2130), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10111 + 0o33) + chr(0b110010), 35694 - 35686), ehT0Px3KOsy9(chr(2195 - 2147) + '\x6f' + chr(51) + '\061' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + chr(0b110110) + chr(2323 - 2269), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b110011) + chr(0b110100), 8), ehT0Px3KOsy9('\060' + chr(0b1000 + 0o147) + chr(50) + '\062' + chr(1395 - 1347), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + chr(0b110010) + chr(51) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(216 - 162) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + chr(352 - 302) + '\x31' + '\x31', 60710 - 60702), ehT0Px3KOsy9('\060' + chr(0b1100100 + 0o13) + '\x31' + chr(0b110001) + '\x37', 25540 - 25532), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + chr(0b110010) + '\x35' + chr(51), 27639 - 27631), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11101 + 0o27) + '\064', 53137 - 53129), ehT0Px3KOsy9(chr(1644 - 1596) + chr(0b1101111) + chr(0b110011) + chr(472 - 421) + '\066', 0o10), ehT0Px3KOsy9(chr(1510 - 1462) + chr(8219 - 8108) + chr(50) + '\067' + chr(0b110000), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(53) + chr(1833 - 1785), 39609 - 39601)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x03'), '\x64' + chr(101) + chr(2494 - 2395) + '\x6f' + '\x64' + chr(101))(chr(0b110001 + 0o104) + '\x74' + chr(3261 - 3159) + '\055' + chr(973 - 917)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def z7Zq8cC4mMUA(oVre8I6UXc3b, PPP5FvnpV6j7, LatlulWW6yXk, qBbPTA83L_qw):
if not qBbPTA83L_qw or c2A0yzQpDQB3(qBbPTA83L_qw) < ehT0Px3KOsy9(chr(433 - 385) + chr(815 - 704) + chr(0b110010), 0b1000):
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'N\xf1\x9e\x14\xac\x0beU.\xbc\xc3\x12\xc6\xd8\x0b\x9c\xddD\t\xf8L\xa1\xb1C#\x86\xfdz\xab@\xf9\xb0\xf8\xc2\xa9#\xceE\xad\xcc\r\xac\xd0\x13\xaa\x11hS4\xa6\xf3\x08\xda'), chr(9060 - 8960) + chr(101) + chr(0b10011 + 0o120) + chr(0b1011110 + 0o21) + chr(7803 - 7703) + chr(0b1100101))(chr(0b1110101) + chr(0b1011100 + 0o30) + '\146' + chr(434 - 389) + chr(56)))
ydunvk4ts0RA = PPP5FvnpV6j7.setdefault(xafqLlk3kkUe(SXOLrMavuUCe(b'n\xf1\x9e\x14\xac\x0beU.\xbc'), chr(0b1100100) + chr(101) + '\143' + chr(0b1001 + 0o146) + chr(8352 - 8252) + chr(101))(chr(6391 - 6274) + chr(116) + '\146' + chr(0b101101) + chr(56)), {})
CD8nkLPsurQ9 = gXpKBRJ8xT4P(vUlqIvNSaRMa(YyaZ4tpXu4lf(qBbPTA83L_qw)), LatlulWW6yXk)
for (AIvJRzLdDfgF, rjZEOs0mSxe7) in xafqLlk3kkUe(CD8nkLPsurQ9, xafqLlk3kkUe(SXOLrMavuUCe(b'c\xe4\x86\x15\x8c%?s,\x9c\xd4_'), chr(6165 - 6065) + chr(101) + chr(0b1100011) + chr(11372 - 11261) + chr(100) + chr(0b1100101))(chr(0b1110101) + '\164' + '\x66' + chr(0b1111 + 0o36) + chr(460 - 404)))():
ydunvk4ts0RA[AIvJRzLdDfgF] = rjZEOs0mSxe7
|
awslabs/serverless-application-model
|
samtranslator/plugins/api/implicit_api_plugin.py
|
ImplicitApiPlugin._maybe_add_conditions_to_implicit_api_paths
|
def _maybe_add_conditions_to_implicit_api_paths(self, template):
"""
Add conditions to implicit API paths if necessary.
Implicit API resource methods are constructed from API events on individual serverless functions within the SAM
template. Since serverless functions can have conditions on them, it's possible to have a case where all methods
under a resource path have conditions on them. If all of these conditions evaluate to false, the entire resource
path should not be defined either. This method checks all resource paths' methods and if all methods under a
given path contain a condition, a composite condition is added to the overall template Conditions section and
that composite condition is added to the resource path.
"""
for api_id, api in template.iterate(SamResourceType.Api.value):
if not api.properties.get('__MANAGE_SWAGGER'):
continue
swagger = api.properties.get("DefinitionBody")
editor = SwaggerEditor(swagger)
for path in editor.iter_on_path():
all_method_conditions = set(
[condition for method, condition in self.api_conditions[api_id][path].items()]
)
at_least_one_method = len(all_method_conditions) > 0
all_methods_contain_conditions = None not in all_method_conditions
if at_least_one_method and all_methods_contain_conditions:
if len(all_method_conditions) == 1:
editor.make_path_conditional(path, all_method_conditions.pop())
else:
path_condition_name = self._path_condition_name(api_id, path)
self._add_combined_condition_to_template(
template.template_dict, path_condition_name, all_method_conditions)
editor.make_path_conditional(path, path_condition_name)
api.properties["DefinitionBody"] = editor.swagger
template.set(api_id, api)
|
python
|
def _maybe_add_conditions_to_implicit_api_paths(self, template):
"""
Add conditions to implicit API paths if necessary.
Implicit API resource methods are constructed from API events on individual serverless functions within the SAM
template. Since serverless functions can have conditions on them, it's possible to have a case where all methods
under a resource path have conditions on them. If all of these conditions evaluate to false, the entire resource
path should not be defined either. This method checks all resource paths' methods and if all methods under a
given path contain a condition, a composite condition is added to the overall template Conditions section and
that composite condition is added to the resource path.
"""
for api_id, api in template.iterate(SamResourceType.Api.value):
if not api.properties.get('__MANAGE_SWAGGER'):
continue
swagger = api.properties.get("DefinitionBody")
editor = SwaggerEditor(swagger)
for path in editor.iter_on_path():
all_method_conditions = set(
[condition for method, condition in self.api_conditions[api_id][path].items()]
)
at_least_one_method = len(all_method_conditions) > 0
all_methods_contain_conditions = None not in all_method_conditions
if at_least_one_method and all_methods_contain_conditions:
if len(all_method_conditions) == 1:
editor.make_path_conditional(path, all_method_conditions.pop())
else:
path_condition_name = self._path_condition_name(api_id, path)
self._add_combined_condition_to_template(
template.template_dict, path_condition_name, all_method_conditions)
editor.make_path_conditional(path, path_condition_name)
api.properties["DefinitionBody"] = editor.swagger
template.set(api_id, api)
|
[
"def",
"_maybe_add_conditions_to_implicit_api_paths",
"(",
"self",
",",
"template",
")",
":",
"for",
"api_id",
",",
"api",
"in",
"template",
".",
"iterate",
"(",
"SamResourceType",
".",
"Api",
".",
"value",
")",
":",
"if",
"not",
"api",
".",
"properties",
".",
"get",
"(",
"'__MANAGE_SWAGGER'",
")",
":",
"continue",
"swagger",
"=",
"api",
".",
"properties",
".",
"get",
"(",
"\"DefinitionBody\"",
")",
"editor",
"=",
"SwaggerEditor",
"(",
"swagger",
")",
"for",
"path",
"in",
"editor",
".",
"iter_on_path",
"(",
")",
":",
"all_method_conditions",
"=",
"set",
"(",
"[",
"condition",
"for",
"method",
",",
"condition",
"in",
"self",
".",
"api_conditions",
"[",
"api_id",
"]",
"[",
"path",
"]",
".",
"items",
"(",
")",
"]",
")",
"at_least_one_method",
"=",
"len",
"(",
"all_method_conditions",
")",
">",
"0",
"all_methods_contain_conditions",
"=",
"None",
"not",
"in",
"all_method_conditions",
"if",
"at_least_one_method",
"and",
"all_methods_contain_conditions",
":",
"if",
"len",
"(",
"all_method_conditions",
")",
"==",
"1",
":",
"editor",
".",
"make_path_conditional",
"(",
"path",
",",
"all_method_conditions",
".",
"pop",
"(",
")",
")",
"else",
":",
"path_condition_name",
"=",
"self",
".",
"_path_condition_name",
"(",
"api_id",
",",
"path",
")",
"self",
".",
"_add_combined_condition_to_template",
"(",
"template",
".",
"template_dict",
",",
"path_condition_name",
",",
"all_method_conditions",
")",
"editor",
".",
"make_path_conditional",
"(",
"path",
",",
"path_condition_name",
")",
"api",
".",
"properties",
"[",
"\"DefinitionBody\"",
"]",
"=",
"editor",
".",
"swagger",
"template",
".",
"set",
"(",
"api_id",
",",
"api",
")"
] |
Add conditions to implicit API paths if necessary.
Implicit API resource methods are constructed from API events on individual serverless functions within the SAM
template. Since serverless functions can have conditions on them, it's possible to have a case where all methods
under a resource path have conditions on them. If all of these conditions evaluate to false, the entire resource
path should not be defined either. This method checks all resource paths' methods and if all methods under a
given path contain a condition, a composite condition is added to the overall template Conditions section and
that composite condition is added to the resource path.
|
[
"Add",
"conditions",
"to",
"implicit",
"API",
"paths",
"if",
"necessary",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/api/implicit_api_plugin.py#L282-L317
|
train
|
Add conditions to implicit API paths if necessary.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydD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Is,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(9124 - 9013) + chr(209 - 159) + chr(0b110100) + chr(0b101001 + 0o13), 0b1000), ehT0Px3KOsy9(chr(1174 - 1126) + '\157' + chr(866 - 816) + '\x33' + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\063' + '\x32' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(50) + chr(0b10110 + 0o36), 0b1000), ehT0Px3KOsy9(chr(2125 - 2077) + chr(0b101011 + 0o104) + '\067' + chr(2311 - 2260), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101110 + 0o1) + '\x32' + chr(0b100010 + 0o22) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(590 - 542) + chr(0b1101111) + chr(0b10011 + 0o40) + chr(1951 - 1903) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(7087 - 6976) + '\063' + chr(0b110100) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1924 - 1869) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(51) + chr(54) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1001110 + 0o41) + chr(50) + chr(52) + '\x37', 19325 - 19317), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000010 + 0o55) + chr(1352 - 1302) + chr(52) + '\064', 8), ehT0Px3KOsy9(chr(753 - 705) + '\x6f' + chr(51) + chr(0b100111 + 0o20) + chr(0b110010), 22933 - 22925), ehT0Px3KOsy9(chr(523 - 475) + chr(0b1101111) + '\x31' + chr(0b1101 + 0o44) + '\065', 0o10), ehT0Px3KOsy9(chr(1620 - 1572) + chr(111) + chr(0b110001) + '\x37' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1100111 + 0o10) + chr(0b101101 + 0o5) + chr(797 - 745) + chr(0b11100 + 0o33), 8), ehT0Px3KOsy9(chr(689 - 641) + chr(111) + chr(0b110001) + '\x30' + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(0b1111 + 0o140) + chr(0b110011) + chr(0b10 + 0o56) + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + '\x30' + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(4332 - 4221) + chr(1984 - 1935), 12581 - 12573), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11010 + 0o27) + chr(0b110101) + chr(1754 - 1705), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\x31' + chr(0b100111 + 0o11), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(2894 - 2839) + chr(582 - 530), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + '\064' + '\062', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b110100 + 0o73) + chr(51) + '\064', 36308 - 36300), ehT0Px3KOsy9(chr(1375 - 1327) + '\157' + chr(49) + chr(53) + '\062', 0b1000), ehT0Px3KOsy9(chr(48) + chr(1329 - 1218) + '\062' + chr(2551 - 2500) + chr(450 - 397), 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b10010 + 0o135) + chr(2429 - 2378) + '\x33' + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(0b100011 + 0o114) + chr(54) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(219 - 171) + chr(0b1101111) + chr(50) + chr(50) + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b110111 + 0o70) + chr(0b110011) + chr(2136 - 2082) + '\061', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\065' + chr(0b101110 + 0o7), 0o10), ehT0Px3KOsy9(chr(340 - 292) + chr(0b1101111) + chr(61 - 11) + chr(0b10000 + 0o45) + '\x33', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + '\x36' + chr(0b110100), 57967 - 57959), ehT0Px3KOsy9(chr(985 - 937) + chr(0b1000100 + 0o53) + '\061' + chr(1902 - 1850) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(6657 - 6546) + '\063' + '\x36' + '\x34', 46471 - 46463), ehT0Px3KOsy9(chr(0b110000) + chr(6910 - 6799) + chr(50) + '\067' + chr(0b1111 + 0o47), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(1084 - 1034) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(0b110110) + '\060', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + '\065' + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a'), chr(0b100000 + 0o104) + '\x65' + chr(9209 - 9110) + chr(111) + chr(0b1100100) + chr(101))(chr(0b11000 + 0o135) + chr(2062 - 1946) + '\x66' + chr(1807 - 1762) + chr(0b11000 + 0o40)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def wLtNi2TaCAWk(oVre8I6UXc3b, jJBnSHEgylNZ):
for (X7mnYJ6SRw0h, M8HTx_I8VoWH) in xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd\xeb\xb4&Z\xd6{'), chr(5460 - 5360) + chr(101) + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(117) + chr(116) + chr(102) + chr(0b101000 + 0o5) + chr(2764 - 2708)))(xafqLlk3kkUe(N9D7M1lGWFFe.Api, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\xf2\xbc3l\xf7\\\xf6\xd5o\xb3\xed'), '\144' + chr(873 - 772) + chr(99) + chr(0b1101111) + chr(100) + chr(8998 - 8897))('\165' + chr(116) + chr(7589 - 7487) + chr(0b100100 + 0o11) + '\070'))):
if not xafqLlk3kkUe(M8HTx_I8VoWH.properties, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3\xfa\xa5'), '\x64' + '\145' + chr(4674 - 4575) + chr(7153 - 7042) + chr(100) + chr(101))('\x75' + chr(0b1110100) + '\146' + chr(0b101010 + 0o3) + chr(0b110101 + 0o3)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb\xc0\x9c\x15u\xe3Y\x82\xb9j\xa7\xe6\xe3\xbd\x08+'), chr(100) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(12433 - 12316) + '\164' + chr(102) + '\055' + chr(0b101101 + 0o13))):
continue
vKQLfCidaf7H = M8HTx_I8VoWH.properties.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\xfa\xb7=U\xcbj\xae\x89W\xb2\xc8\xc0\x83'), '\x64' + chr(2791 - 2690) + chr(1307 - 1208) + chr(111) + chr(0b11101 + 0o107) + chr(0b1100101))('\165' + chr(116) + '\x66' + chr(0b101101) + chr(56)))
QP6wN7VyBwGk = IX7SCU7eVrph(vKQLfCidaf7H)
for EaCjyhZptSer in xafqLlk3kkUe(QP6wN7VyBwGk, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd\xeb\xb4&d\xcdp\x98\x96X\x84\xcf'), chr(0b10011 + 0o121) + '\x65' + '\x63' + '\x6f' + chr(0b11 + 0o141) + chr(2234 - 2133))('\x75' + '\164' + chr(0b1100110) + chr(0b100 + 0o51) + chr(0b111000)))():
LYME1KHzuIxG = MVEN8G6CxlvR([z3jGhw6b9vwa for (CVRCXTcnOnH6, z3jGhw6b9vwa) in oVre8I6UXc3b.api_conditions[X7mnYJ6SRw0h][EaCjyhZptSer].NzveIZ3IlSH9()])
Y9jlrlHr88MN = c2A0yzQpDQB3(LYME1KHzuIxG) > ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\060', 0b1000)
PJ8re2yIaxBu = None not in LYME1KHzuIxG
if Y9jlrlHr88MN and PJ8re2yIaxBu:
if c2A0yzQpDQB3(LYME1KHzuIxG) == ehT0Px3KOsy9(chr(1306 - 1258) + '\x6f' + '\x31', 8):
xafqLlk3kkUe(QP6wN7VyBwGk, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9\xfe\xba1d\xd2\x7f\xb3\x8ef\x93\xc8\xca\x9e$\r\xce-\xa8&m'), chr(100) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(0b1000001 + 0o44))('\165' + '\x74' + chr(0b1110 + 0o130) + chr(1213 - 1168) + chr(0b111000)))(EaCjyhZptSer, xafqLlk3kkUe(LYME1KHzuIxG, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd4\xf0\xa1'), chr(0b1100100) + chr(101) + '\143' + chr(2114 - 2003) + chr(0b101000 + 0o74) + chr(101))(chr(638 - 521) + chr(116) + '\146' + chr(45) + chr(748 - 692)))())
else:
wOUMavvRxEop = oVre8I6UXc3b._path_condition_name(X7mnYJ6SRw0h, EaCjyhZptSer)
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb\xfe\xb50d\xc1q\xaa\x84P\x9e\xc2\xc0\xa5.\x16\xc9&\xaf3h\x06\xa6#\xd6s5\xe9\xbc\\\xe0\x9d\x0c\xdf\x11'), '\144' + '\145' + chr(0b1100011) + chr(111) + chr(0b1010000 + 0o24) + '\x65')('\x75' + chr(116) + '\146' + chr(45) + chr(56)))(xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd0\xfa\xbc$W\xc3j\xa2\xb9]\x99\xc4\xd0'), chr(0b1100100) + chr(0b1000010 + 0o43) + chr(0b1100011) + chr(8621 - 8510) + '\x64' + '\145')(chr(0b1110101) + chr(0b1001010 + 0o52) + chr(102) + chr(0b11001 + 0o24) + chr(0b111000))), wOUMavvRxEop, LYME1KHzuIxG)
xafqLlk3kkUe(QP6wN7VyBwGk, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9\xfe\xba1d\xd2\x7f\xb3\x8ef\x93\xc8\xca\x9e$\r\xce-\xa8&m'), '\144' + '\145' + '\x63' + chr(111) + chr(6499 - 6399) + chr(101))(chr(0b10000 + 0o145) + '\164' + chr(102) + chr(0b100101 + 0o10) + chr(1900 - 1844)))(EaCjyhZptSer, wOUMavvRxEop)
M8HTx_I8VoWH.o4Mv82sLmOP8[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\xfa\xb7=U\xcbj\xae\x89W\xb2\xc8\xc0\x83'), chr(100) + chr(0b1100101) + chr(0b1001010 + 0o31) + chr(111) + chr(0b1011101 + 0o7) + '\x65')(chr(0b110001 + 0o104) + chr(116) + chr(9238 - 9136) + chr(0b101 + 0o50) + chr(0b111000))] = QP6wN7VyBwGk.swagger
xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7\xfa\xa5'), chr(0b110101 + 0o57) + chr(101) + chr(0b1010111 + 0o14) + chr(0b1101111) + '\144' + chr(101))('\x75' + '\164' + '\146' + chr(362 - 317) + chr(0b111000)))(X7mnYJ6SRw0h, M8HTx_I8VoWH)
|
awslabs/serverless-application-model
|
samtranslator/plugins/api/implicit_api_plugin.py
|
ImplicitApiPlugin._path_condition_name
|
def _path_condition_name(self, api_id, path):
"""
Generate valid condition logical id from the given API logical id and swagger resource path.
"""
# only valid characters for CloudFormation logical id are [A-Za-z0-9], but swagger paths can contain
# slashes and curly braces for templated params, e.g., /foo/{customerId}. So we'll replace
# non-alphanumeric characters.
path_logical_id = path.replace('/', 'SLASH').replace('{', 'OB').replace('}', 'CB')
return '{}{}PathCondition'.format(api_id, path_logical_id)
|
python
|
def _path_condition_name(self, api_id, path):
"""
Generate valid condition logical id from the given API logical id and swagger resource path.
"""
# only valid characters for CloudFormation logical id are [A-Za-z0-9], but swagger paths can contain
# slashes and curly braces for templated params, e.g., /foo/{customerId}. So we'll replace
# non-alphanumeric characters.
path_logical_id = path.replace('/', 'SLASH').replace('{', 'OB').replace('}', 'CB')
return '{}{}PathCondition'.format(api_id, path_logical_id)
|
[
"def",
"_path_condition_name",
"(",
"self",
",",
"api_id",
",",
"path",
")",
":",
"# only valid characters for CloudFormation logical id are [A-Za-z0-9], but swagger paths can contain",
"# slashes and curly braces for templated params, e.g., /foo/{customerId}. So we'll replace",
"# non-alphanumeric characters.",
"path_logical_id",
"=",
"path",
".",
"replace",
"(",
"'/'",
",",
"'SLASH'",
")",
".",
"replace",
"(",
"'{'",
",",
"'OB'",
")",
".",
"replace",
"(",
"'}'",
",",
"'CB'",
")",
"return",
"'{}{}PathCondition'",
".",
"format",
"(",
"api_id",
",",
"path_logical_id",
")"
] |
Generate valid condition logical id from the given API logical id and swagger resource path.
|
[
"Generate",
"valid",
"condition",
"logical",
"id",
"from",
"the",
"given",
"API",
"logical",
"id",
"and",
"swagger",
"resource",
"path",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/api/implicit_api_plugin.py#L319-L327
|
train
|
Generate valid logical id from the given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hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1001011 + 0o44) + '\x31' + chr(2230 - 2177) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + '\064' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b111001 + 0o66) + chr(984 - 933) + chr(0b110000) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1001110 + 0o41) + '\061' + chr(1350 - 1295) + chr(2554 - 2502), 17582 - 17574), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001000 + 0o47) + chr(0b1001 + 0o51) + chr(1992 - 1944) + chr(803 - 751), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + '\063', 42259 - 42251), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11101 + 0o26) + '\x35' + chr(314 - 265), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + chr(0b10000 + 0o42), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11001 + 0o126) + chr(0b110001) + '\063' + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + chr(6457 - 6346) + chr(0b111 + 0o53) + '\x32' + '\062', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + '\062' + chr(0b11001 + 0o32), 7939 - 7931), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\x36' + chr(1609 - 1560), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101001 + 0o6) + chr(0b100100 + 0o16) + '\067' + chr(2480 - 2430), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2521 - 2466) + chr(1870 - 1818), ord("\x08")), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(10290 - 10179) + chr(0b100010 + 0o21), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(175 - 126) + '\063' + chr(54), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + '\x31', 16541 - 16533), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2764 - 2711) + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001 + 0o1) + chr(55) + chr(51), 17213 - 17205), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(2323 - 2269) + '\066', 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + chr(0b10001 + 0o44) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101000 + 0o13) + chr(2575 - 2522) + chr(0b10001 + 0o45), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100001 + 0o22) + chr(2303 - 2250) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100 + 0o143) + chr(51) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(52) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(1412 - 1364) + '\157' + chr(1197 - 1144) + chr(0b110111), 8), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + '\064' + '\065', 0o10), ehT0Px3KOsy9(chr(1030 - 982) + chr(0b1101111) + chr(2589 - 2538) + chr(0b10011 + 0o37) + chr(0b11000 + 0o37), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + '\065' + chr(1221 - 1168), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111010 + 0o65) + chr(0b110011 + 0o0) + chr(0b10111 + 0o33), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(55) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(1119 - 1068) + chr(54) + chr(0b110001), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001011 + 0o44) + '\061' + chr(0b110111) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(0b101000 + 0o107) + '\x31' + '\x31' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(0b1001 + 0o51) + chr(888 - 837), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + '\066' + '\x31', 31885 - 31877), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + '\x31' + chr(53) + chr(2452 - 2397), 19019 - 19011), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + chr(0b110010) + '\x35', 14423 - 14415), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(0b110110) + chr(0b101 + 0o57), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + chr(0b110101) + chr(0b10001 + 0o37), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'G'), chr(0b1100100) + chr(6286 - 6185) + chr(0b1100011) + chr(111) + '\144' + '\x65')(chr(12422 - 12305) + chr(0b1110100) + chr(3269 - 3167) + '\x2d' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def KaTzFv3Nis3M(oVre8I6UXc3b, X7mnYJ6SRw0h, EaCjyhZptSer):
TXaVgk1PWqtN = EaCjyhZptSer.replace(xafqLlk3kkUe(SXOLrMavuUCe(b'F'), chr(5987 - 5887) + chr(101) + chr(1184 - 1085) + '\157' + '\x64' + '\145')('\x75' + chr(0b1010100 + 0o40) + chr(0b1100110) + chr(45) + chr(0b110000 + 0o10)), xafqLlk3kkUe(SXOLrMavuUCe(b':.\x81U4'), chr(100) + '\x65' + '\143' + '\157' + chr(0b1100100) + chr(0b1100100 + 0o1))(chr(117) + chr(0b1110100 + 0o0) + chr(102) + '\055' + chr(0b111000))).replace(xafqLlk3kkUe(SXOLrMavuUCe(b'\x12'), chr(8663 - 8563) + '\x65' + chr(0b11010 + 0o111) + chr(111) + chr(100) + chr(101))('\165' + chr(116) + chr(0b1100110) + chr(815 - 770) + chr(444 - 388)), xafqLlk3kkUe(SXOLrMavuUCe(b'& '), '\144' + chr(1516 - 1415) + chr(1072 - 973) + chr(8728 - 8617) + chr(8259 - 8159) + chr(0b110011 + 0o62))('\165' + chr(116) + chr(0b1100110 + 0o0) + chr(0b101101) + '\070')).replace(xafqLlk3kkUe(SXOLrMavuUCe(b'\x14'), chr(100) + chr(101) + chr(0b1100011) + '\x6f' + chr(7501 - 7401) + chr(0b1100101))(chr(0b1110101) + chr(7746 - 7630) + chr(0b1100110) + '\x2d' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'* '), chr(0b101101 + 0o67) + '\x65' + chr(99) + '\x6f' + chr(0b1100100) + chr(101))(chr(117) + '\x74' + chr(102) + '\x2d' + '\070'))
return xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x12\x1f\xbb{,\xe5\x7f\x81I0\xfc\xf7\x98\xceUl0'), chr(9709 - 9609) + chr(4482 - 4381) + '\143' + '\x6f' + chr(100) + chr(0b1100000 + 0o5))(chr(0b1110101) + chr(0b100 + 0o160) + '\146' + chr(45) + chr(1332 - 1276)), xafqLlk3kkUe(SXOLrMavuUCe(b'?V\xb2i4\xe5X\xdaZ/\xf7\xf9'), '\x64' + chr(1374 - 1273) + '\x63' + chr(11564 - 11453) + chr(100) + '\145')(chr(117) + '\x74' + chr(102) + chr(1808 - 1763) + chr(1619 - 1563)))(X7mnYJ6SRw0h, TXaVgk1PWqtN)
|
awslabs/serverless-application-model
|
samtranslator/plugins/api/implicit_api_plugin.py
|
ImplicitApiPlugin._maybe_remove_implicit_api
|
def _maybe_remove_implicit_api(self, template):
"""
Implicit API resource are tentatively added to the template for uniform handling of both Implicit & Explicit
APIs. They need to removed from the template, if there are *no* API events attached to this resource.
This method removes the Implicit API if it does not contain any Swagger paths (added in response to API events).
:param SamTemplate template: SAM Template containing the Implicit API resource
"""
# Remove Implicit API resource if no paths got added
implicit_api_resource = template.get(self.implicit_api_logical_id)
if implicit_api_resource and len(implicit_api_resource.properties["DefinitionBody"]["paths"]) == 0:
# If there's no implicit api and the author defined a "ServerlessRestApi"
# resource, restore it
if self.existing_implicit_api_resource:
template.set(self.implicit_api_logical_id, self.existing_implicit_api_resource)
else:
template.delete(self.implicit_api_logical_id)
|
python
|
def _maybe_remove_implicit_api(self, template):
"""
Implicit API resource are tentatively added to the template for uniform handling of both Implicit & Explicit
APIs. They need to removed from the template, if there are *no* API events attached to this resource.
This method removes the Implicit API if it does not contain any Swagger paths (added in response to API events).
:param SamTemplate template: SAM Template containing the Implicit API resource
"""
# Remove Implicit API resource if no paths got added
implicit_api_resource = template.get(self.implicit_api_logical_id)
if implicit_api_resource and len(implicit_api_resource.properties["DefinitionBody"]["paths"]) == 0:
# If there's no implicit api and the author defined a "ServerlessRestApi"
# resource, restore it
if self.existing_implicit_api_resource:
template.set(self.implicit_api_logical_id, self.existing_implicit_api_resource)
else:
template.delete(self.implicit_api_logical_id)
|
[
"def",
"_maybe_remove_implicit_api",
"(",
"self",
",",
"template",
")",
":",
"# Remove Implicit API resource if no paths got added",
"implicit_api_resource",
"=",
"template",
".",
"get",
"(",
"self",
".",
"implicit_api_logical_id",
")",
"if",
"implicit_api_resource",
"and",
"len",
"(",
"implicit_api_resource",
".",
"properties",
"[",
"\"DefinitionBody\"",
"]",
"[",
"\"paths\"",
"]",
")",
"==",
"0",
":",
"# If there's no implicit api and the author defined a \"ServerlessRestApi\"",
"# resource, restore it",
"if",
"self",
".",
"existing_implicit_api_resource",
":",
"template",
".",
"set",
"(",
"self",
".",
"implicit_api_logical_id",
",",
"self",
".",
"existing_implicit_api_resource",
")",
"else",
":",
"template",
".",
"delete",
"(",
"self",
".",
"implicit_api_logical_id",
")"
] |
Implicit API resource are tentatively added to the template for uniform handling of both Implicit & Explicit
APIs. They need to removed from the template, if there are *no* API events attached to this resource.
This method removes the Implicit API if it does not contain any Swagger paths (added in response to API events).
:param SamTemplate template: SAM Template containing the Implicit API resource
|
[
"Implicit",
"API",
"resource",
"are",
"tentatively",
"added",
"to",
"the",
"template",
"for",
"uniform",
"handling",
"of",
"both",
"Implicit",
"&",
"Explicit",
"APIs",
".",
"They",
"need",
"to",
"removed",
"from",
"the",
"template",
"if",
"there",
"are",
"*",
"no",
"*",
"API",
"events",
"attached",
"to",
"this",
"resource",
".",
"This",
"method",
"removes",
"the",
"Implicit",
"API",
"if",
"it",
"does",
"not",
"contain",
"any",
"Swagger",
"paths",
"(",
"added",
"in",
"response",
"to",
"API",
"events",
")",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/api/implicit_api_plugin.py#L329-L347
|
train
|
Remove the Implicit API resource from the SAM template if there are no paths.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixt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68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110100) + '\060', 63367 - 63359), ehT0Px3KOsy9(chr(539 - 491) + chr(0b1101111) + '\x34' + chr(0b110110), 16414 - 16406), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(0b11101 + 0o25) + chr(1558 - 1508), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(2094 - 2043) + chr(49) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(5340 - 5229) + chr(49) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b110010) + chr(1725 - 1677), 0b1000), ehT0Px3KOsy9(chr(1913 - 1865) + '\x6f' + chr(0b110011) + '\x34' + chr(53), 55990 - 55982), ehT0Px3KOsy9('\060' + '\157' + chr(1598 - 1548) + chr(0b101010 + 0o13) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b101001 + 0o106) + '\x31' + '\x33' + chr(139 - 91), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100011 + 0o14) + '\x31' + chr(0b110011) + '\063', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b10011 + 0o42) + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(48) + chr(0b100 + 0o63), ord("\x08")), ehT0Px3KOsy9(chr(484 - 436) + chr(7114 - 7003) + chr(2225 - 2171) + chr(122 - 67), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110111) + chr(0b1001 + 0o50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100011 + 0o20) + '\x32' + chr(0b1110 + 0o44), 0b1000), ehT0Px3KOsy9('\060' + chr(4571 - 4460) + chr(0b110001) + '\x34' + '\066', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(2426 - 2376) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(0b110011) + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1100 + 0o45) + '\x32' + chr(0b1101 + 0o45), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(8889 - 8778) + '\062' + chr(0b100000 + 0o20), 0b1000), ehT0Px3KOsy9(chr(2277 - 2229) + '\157' + chr(50) + chr(2904 - 2850) + chr(0b110100), 25871 - 25863), ehT0Px3KOsy9('\x30' + chr(111) + chr(809 - 760) + '\x30' + chr(49), 30481 - 30473), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(4808 - 4697) + chr(2044 - 1995) + '\x36' + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(2206 - 2151) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9350 - 9239) + '\063' + chr(52) + chr(0b110101), 8), ehT0Px3KOsy9(chr(48) + chr(3933 - 3822) + chr(51) + chr(0b110100) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(7375 - 7264) + chr(0b110010) + '\067' + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000111 + 0o50) + '\067' + '\x36', 9908 - 9900), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1100000 + 0o17) + '\x33' + chr(0b10001 + 0o40) + chr(0b101000 + 0o14), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + '\x37' + '\066', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(54) + '\x37', 5979 - 5971), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(49) + chr(0b110001), 36990 - 36982), ehT0Px3KOsy9('\060' + chr(7406 - 7295) + '\x31' + '\x33' + chr(0b1111 + 0o47), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(1199 - 1148) + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(0b11000 + 0o127) + chr(2376 - 2327) + chr(1226 - 1171) + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10101 + 0o35) + chr(0b110101) + chr(50), 2450 - 2442), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\157' + chr(51) + chr(0b110011 + 0o2) + chr(0b11111 + 0o25), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b1101 + 0o47) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\x6f' + '\062' + '\061' + chr(2941 - 2886), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(3904 - 3793) + chr(53) + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e'), chr(100) + '\145' + chr(6131 - 6032) + '\157' + chr(100) + chr(101))('\x75' + chr(0b1110100) + chr(102) + chr(569 - 524) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def gEvEG67pDf7X(oVre8I6UXc3b, jJBnSHEgylNZ):
tuyWflhlejom = jJBnSHEgylNZ.get(oVre8I6UXc3b.implicit_api_logical_id)
if tuyWflhlejom and c2A0yzQpDQB3(xafqLlk3kkUe(tuyWflhlejom, xafqLlk3kkUe(SXOLrMavuUCe(b'O\x12\xdf\xba1\xe2\x96\xe15\x14z\xbf'), '\x64' + chr(0b1100101) + '\143' + chr(111) + chr(100) + chr(0b1100101))(chr(12129 - 12012) + chr(0b111001 + 0o73) + chr(0b1100010 + 0o4) + chr(0b101101) + '\070'))[xafqLlk3kkUe(SXOLrMavuUCe(b'dC\xf4\xa5g\xb9\x91\xc475h\xe8S@'), '\x64' + chr(0b1100101) + chr(0b110100 + 0o57) + chr(6301 - 6190) + chr(0b1000101 + 0o37) + chr(101))(chr(0b1110101) + chr(116) + chr(5909 - 5807) + '\055' + '\070')][xafqLlk3kkUe(SXOLrMavuUCe(b'PG\xe6\xa4z'), chr(0b1100100) + chr(0b11110 + 0o107) + chr(8696 - 8597) + '\x6f' + chr(9853 - 9753) + chr(101))(chr(117) + '\164' + '\x66' + '\055' + '\070')]) == ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b111011 + 0o64) + chr(0b101111 + 0o1), ord("\x08")):
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'QK\xe1\xbcQ\x99\xac\xc20lg\xef'), '\x64' + chr(0b1100101) + chr(0b101011 + 0o70) + chr(0b1101111) + chr(100) + chr(357 - 256))(chr(117) + chr(116) + '\x66' + chr(45) + chr(56))):
xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'SC\xe6'), '\x64' + chr(0b1100101) + '\143' + chr(3845 - 3734) + '\x64' + chr(101))(chr(9272 - 9155) + chr(0b1110100) + chr(0b111 + 0o137) + chr(1995 - 1950) + chr(0b111000)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'IK\xe2\xa0`\xb3\x8c\xd9\x07:Z\xeehU\xbd\x019\xfd3|\xeb(\x16'), chr(0b1100100) + chr(0b1100101) + '\143' + '\x6f' + '\144' + chr(101))(chr(117) + '\164' + chr(0b1001011 + 0o33) + chr(45) + '\070')), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'QK\xe1\xbcQ\x99\xac\xc20lg\xef'), chr(100) + '\x65' + '\143' + '\157' + chr(5483 - 5383) + chr(0b101111 + 0o66))(chr(9106 - 8989) + '\x74' + chr(0b1011 + 0o133) + '\055' + chr(0b1110 + 0o52))))
else:
xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'DC\xfe\xa9}\xb5'), chr(0b1100100) + chr(0b111101 + 0o50) + '\x63' + '\x6f' + chr(0b1100100) + '\145')(chr(0b1100100 + 0o21) + chr(0b1001000 + 0o54) + chr(102) + chr(1142 - 1097) + chr(0b11000 + 0o40)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'IK\xe2\xa0`\xb3\x8c\xd9\x07:Z\xeehU\xbd\x019\xfd3|\xeb(\x16'), chr(0b1100100) + chr(0b10110 + 0o117) + chr(99) + chr(111) + '\x64' + chr(101))('\165' + chr(7392 - 7276) + chr(0b1100110) + chr(1449 - 1404) + '\x38')))
|
awslabs/serverless-application-model
|
samtranslator/model/apigateway.py
|
ApiGatewayDeployment.make_auto_deployable
|
def make_auto_deployable(self, stage, swagger=None):
"""
Sets up the resource such that it will triggers a re-deployment when Swagger changes
:param swagger: Dictionary containing the Swagger definition of the API
"""
if not swagger:
return
# CloudFormation does NOT redeploy the API unless it has a new deployment resource
# that points to latest RestApi resource. Append a hash of Swagger Body location to
# redeploy only when the API data changes. First 10 characters of hash is good enough
# to prevent redeployment when API has not changed
# NOTE: `str(swagger)` is for backwards compatibility. Changing it to a JSON or something will break compat
generator = logical_id_generator.LogicalIdGenerator(self.logical_id, str(swagger))
self.logical_id = generator.gen()
hash = generator.get_hash(length=40) # Get the full hash
self.Description = "RestApi deployment id: {}".format(hash)
stage.update_deployment_ref(self.logical_id)
|
python
|
def make_auto_deployable(self, stage, swagger=None):
"""
Sets up the resource such that it will triggers a re-deployment when Swagger changes
:param swagger: Dictionary containing the Swagger definition of the API
"""
if not swagger:
return
# CloudFormation does NOT redeploy the API unless it has a new deployment resource
# that points to latest RestApi resource. Append a hash of Swagger Body location to
# redeploy only when the API data changes. First 10 characters of hash is good enough
# to prevent redeployment when API has not changed
# NOTE: `str(swagger)` is for backwards compatibility. Changing it to a JSON or something will break compat
generator = logical_id_generator.LogicalIdGenerator(self.logical_id, str(swagger))
self.logical_id = generator.gen()
hash = generator.get_hash(length=40) # Get the full hash
self.Description = "RestApi deployment id: {}".format(hash)
stage.update_deployment_ref(self.logical_id)
|
[
"def",
"make_auto_deployable",
"(",
"self",
",",
"stage",
",",
"swagger",
"=",
"None",
")",
":",
"if",
"not",
"swagger",
":",
"return",
"# CloudFormation does NOT redeploy the API unless it has a new deployment resource",
"# that points to latest RestApi resource. Append a hash of Swagger Body location to",
"# redeploy only when the API data changes. First 10 characters of hash is good enough",
"# to prevent redeployment when API has not changed",
"# NOTE: `str(swagger)` is for backwards compatibility. Changing it to a JSON or something will break compat",
"generator",
"=",
"logical_id_generator",
".",
"LogicalIdGenerator",
"(",
"self",
".",
"logical_id",
",",
"str",
"(",
"swagger",
")",
")",
"self",
".",
"logical_id",
"=",
"generator",
".",
"gen",
"(",
")",
"hash",
"=",
"generator",
".",
"get_hash",
"(",
"length",
"=",
"40",
")",
"# Get the full hash",
"self",
".",
"Description",
"=",
"\"RestApi deployment id: {}\"",
".",
"format",
"(",
"hash",
")",
"stage",
".",
"update_deployment_ref",
"(",
"self",
".",
"logical_id",
")"
] |
Sets up the resource such that it will triggers a re-deployment when Swagger changes
:param swagger: Dictionary containing the Swagger definition of the API
|
[
"Sets",
"up",
"the",
"resource",
"such",
"that",
"it",
"will",
"triggers",
"a",
"re",
"-",
"deployment",
"when",
"Swagger",
"changes"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/apigateway.py#L76-L95
|
train
|
Sets up the resource such that it will trigger a re - deployment when the Swagger changes
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEOh2,L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eWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(49) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(1522 - 1474) + '\x6f' + chr(0b101100 + 0o10) + chr(0b100001 + 0o24), 0b1000), ehT0Px3KOsy9('\x30' + chr(6492 - 6381) + chr(0b110010) + chr(0b110110) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\x30' + chr(133 - 79), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(52) + '\062', 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(10800 - 10689) + '\x32' + '\064' + chr(2779 - 2726), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\063' + '\x37' + chr(2031 - 1977), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010), 54682 - 54674), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(0b1011 + 0o54), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(53) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101010 + 0o13) + '\063', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b1100 + 0o53) + chr(0b110101), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(51) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(523 - 412) + chr(1025 - 970) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(5386 - 5275) + chr(0b10010 + 0o41) + '\067' + chr(0b1111 + 0o46), 61236 - 61228), ehT0Px3KOsy9('\x30' + chr(6037 - 5926) + chr(0b110001) + chr(49) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + '\x31' + chr(50), 57596 - 57588), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(0b0 + 0o62) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1001111 + 0o40) + chr(621 - 571) + '\062' + chr(130 - 81), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(825 - 714) + chr(0b110011) + chr(0b10111 + 0o35) + chr(218 - 163), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2223 - 2172) + '\064' + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + '\062' + chr(0b100111 + 0o17), ord("\x08")), ehT0Px3KOsy9(chr(1338 - 1290) + '\x6f' + '\x31' + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + chr(5038 - 4927) + chr(1043 - 991) + chr(1183 - 1128), 0b1000), ehT0Px3KOsy9(chr(120 - 72) + chr(111) + '\x32' + '\x37' + '\063', 60661 - 60653), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + '\x33' + '\x35' + chr(1369 - 1317), 12348 - 12340), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + chr(0b110100) + chr(49), 27779 - 27771), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(190 - 141) + chr(0b11000 + 0o31) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + '\x36' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(1372 - 1318) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(8641 - 8530) + chr(0b11000 + 0o31) + '\060' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(1883 - 1833) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(122 - 74) + '\x6f' + '\064' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(0b110111) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + chr(930 - 819) + '\x32' + '\x31' + chr(0b110 + 0o55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(303 - 192) + '\063' + '\x34' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\x6f' + chr(1245 - 1194) + chr(0b110011) + chr(0b10010 + 0o45), 55826 - 55818), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(51) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\157' + '\x31' + '\x32', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + '\x35' + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4'), '\x64' + chr(3960 - 3859) + '\x63' + '\157' + chr(0b100100 + 0o100) + chr(2340 - 2239))('\x75' + '\x74' + chr(102) + '\055' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def InBTRlhHmE4R(oVre8I6UXc3b, VRrhsVxQMv59, vKQLfCidaf7H=None):
if not vKQLfCidaf7H:
return
bTFcxMKbQoFz = LH9cA0AXOw_a.LogicalIdGenerator(oVre8I6UXc3b.logical_id, M8_cKLkHVB2V(vKQLfCidaf7H))
oVre8I6UXc3b.NpZr66MdBhVG = bTFcxMKbQoFz.gen()
xfhwxiBOH72k = bTFcxMKbQoFz.get_hash(length=ehT0Px3KOsy9('\x30' + '\x6f' + chr(53) + chr(1031 - 983), 8))
oVre8I6UXc3b.Gg5N_G5JhGDN = xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8@\xc6\xb2\xa3\xd5\x97"s\n[Q\xf1B\x90+$\xa7 \xf8\x83\xdevpZ'), chr(7214 - 7114) + chr(101) + chr(0b1100 + 0o127) + '\157' + chr(7822 - 7722) + chr(101))(chr(9961 - 9844) + chr(0b1110100) + '\146' + chr(0b101101) + chr(2985 - 2929)).V4roHaS3Ppej(xfhwxiBOH72k)
xafqLlk3kkUe(VRrhsVxQMv59, xafqLlk3kkUe(SXOLrMavuUCe(b'\xffU\xd1\xa7\x96\xc0\xa1fr\x1fGR\xe7V\x98 >\x8cr\xf4\x81'), chr(2450 - 2350) + '\x65' + '\x63' + chr(0b1101111) + chr(0b1110 + 0o126) + chr(101))(chr(117) + '\x74' + '\x66' + '\x2d' + chr(56)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4U\xef\xb4\xd4\x93\xb3fU\x07}z'), chr(0b1100100) + '\145' + chr(99) + chr(0b11 + 0o154) + '\144' + chr(2026 - 1925))(chr(117) + '\164' + '\146' + chr(0b1001 + 0o44) + '\070')))
|
awslabs/serverless-application-model
|
examples/apps/greengrass-hello-world/greengrasssdk/Lambda.py
|
Client._invoke_internal
|
def _invoke_internal(self, function_arn, payload, client_context, invocation_type="RequestResponse"):
"""
This private method is seperate from the main, public invoke method so that other code within this SDK can
give this Lambda client a raw payload/client context to invoke with, rather than having it built for them.
This lets you include custom ExtensionMap_ values like subject which are needed for our internal pinned Lambdas.
"""
customer_logger.info('Invoking Lambda function "{}" with Greengrass Message "{}"'.format(function_arn, payload))
try:
invocation_id = self.ipc.post_work(function_arn, payload, client_context, invocation_type)
if invocation_type == "Event":
# TODO: Properly return errors based on BOTO response
# https://boto3.readthedocs.io/en/latest/reference/services/lambda.html#Lambda.Client.invoke
return {'Payload': b'', 'FunctionError': ''}
work_result_output = self.ipc.get_work_result(function_arn, invocation_id)
if not work_result_output.func_err:
output_payload = StreamingBody(work_result_output.payload)
else:
output_payload = work_result_output.payload
invoke_output = {
'Payload': output_payload,
'FunctionError': work_result_output.func_err,
}
return invoke_output
except IPCException as e:
customer_logger.exception(e)
raise InvocationException('Failed to invoke function due to ' + str(e))
|
python
|
def _invoke_internal(self, function_arn, payload, client_context, invocation_type="RequestResponse"):
"""
This private method is seperate from the main, public invoke method so that other code within this SDK can
give this Lambda client a raw payload/client context to invoke with, rather than having it built for them.
This lets you include custom ExtensionMap_ values like subject which are needed for our internal pinned Lambdas.
"""
customer_logger.info('Invoking Lambda function "{}" with Greengrass Message "{}"'.format(function_arn, payload))
try:
invocation_id = self.ipc.post_work(function_arn, payload, client_context, invocation_type)
if invocation_type == "Event":
# TODO: Properly return errors based on BOTO response
# https://boto3.readthedocs.io/en/latest/reference/services/lambda.html#Lambda.Client.invoke
return {'Payload': b'', 'FunctionError': ''}
work_result_output = self.ipc.get_work_result(function_arn, invocation_id)
if not work_result_output.func_err:
output_payload = StreamingBody(work_result_output.payload)
else:
output_payload = work_result_output.payload
invoke_output = {
'Payload': output_payload,
'FunctionError': work_result_output.func_err,
}
return invoke_output
except IPCException as e:
customer_logger.exception(e)
raise InvocationException('Failed to invoke function due to ' + str(e))
|
[
"def",
"_invoke_internal",
"(",
"self",
",",
"function_arn",
",",
"payload",
",",
"client_context",
",",
"invocation_type",
"=",
"\"RequestResponse\"",
")",
":",
"customer_logger",
".",
"info",
"(",
"'Invoking Lambda function \"{}\" with Greengrass Message \"{}\"'",
".",
"format",
"(",
"function_arn",
",",
"payload",
")",
")",
"try",
":",
"invocation_id",
"=",
"self",
".",
"ipc",
".",
"post_work",
"(",
"function_arn",
",",
"payload",
",",
"client_context",
",",
"invocation_type",
")",
"if",
"invocation_type",
"==",
"\"Event\"",
":",
"# TODO: Properly return errors based on BOTO response",
"# https://boto3.readthedocs.io/en/latest/reference/services/lambda.html#Lambda.Client.invoke",
"return",
"{",
"'Payload'",
":",
"b''",
",",
"'FunctionError'",
":",
"''",
"}",
"work_result_output",
"=",
"self",
".",
"ipc",
".",
"get_work_result",
"(",
"function_arn",
",",
"invocation_id",
")",
"if",
"not",
"work_result_output",
".",
"func_err",
":",
"output_payload",
"=",
"StreamingBody",
"(",
"work_result_output",
".",
"payload",
")",
"else",
":",
"output_payload",
"=",
"work_result_output",
".",
"payload",
"invoke_output",
"=",
"{",
"'Payload'",
":",
"output_payload",
",",
"'FunctionError'",
":",
"work_result_output",
".",
"func_err",
",",
"}",
"return",
"invoke_output",
"except",
"IPCException",
"as",
"e",
":",
"customer_logger",
".",
"exception",
"(",
"e",
")",
"raise",
"InvocationException",
"(",
"'Failed to invoke function due to '",
"+",
"str",
"(",
"e",
")",
")"
] |
This private method is seperate from the main, public invoke method so that other code within this SDK can
give this Lambda client a raw payload/client context to invoke with, rather than having it built for them.
This lets you include custom ExtensionMap_ values like subject which are needed for our internal pinned Lambdas.
|
[
"This",
"private",
"method",
"is",
"seperate",
"from",
"the",
"main",
"public",
"invoke",
"method",
"so",
"that",
"other",
"code",
"within",
"this",
"SDK",
"can",
"give",
"this",
"Lambda",
"client",
"a",
"raw",
"payload",
"/",
"client",
"context",
"to",
"invoke",
"with",
"rather",
"than",
"having",
"it",
"built",
"for",
"them",
".",
"This",
"lets",
"you",
"include",
"custom",
"ExtensionMap_",
"values",
"like",
"subject",
"which",
"are",
"needed",
"for",
"our",
"internal",
"pinned",
"Lambdas",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/greengrass-hello-world/greengrasssdk/Lambda.py#L86-L114
|
train
|
Internal method to invoke a function with the given payload.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,y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UdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + '\060' + chr(0b110110), 14247 - 14239), ehT0Px3KOsy9(chr(48) + chr(0b1101010 + 0o5) + chr(0b0 + 0o62) + chr(0b110010) + chr(55), 0o10), ehT0Px3KOsy9(chr(1339 - 1291) + chr(5685 - 5574) + chr(861 - 812) + '\x30' + chr(51), 36671 - 36663), ehT0Px3KOsy9(chr(827 - 779) + chr(111) + '\x33' + chr(1190 - 1138) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10101 + 0o42), 0o10), ehT0Px3KOsy9('\060' + chr(0b1010010 + 0o35) + '\062' + '\x34' + chr(0b110110), 0b1000), ehT0Px3KOsy9('\x30' + chr(525 - 414) + '\x32' + '\061' + '\063', 0o10), ehT0Px3KOsy9(chr(48) + chr(623 - 512) + '\x31' + chr(48) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\067' + chr(0b110001 + 0o2), 0b1000), ehT0Px3KOsy9(chr(343 - 295) + chr(0b1101111) + '\063' + '\062' + chr(0b11111 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + '\067' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b100010 + 0o115) + '\062' + chr(0b10000 + 0o40) + chr(0b1 + 0o65), 8), ehT0Px3KOsy9(chr(1465 - 1417) + chr(3962 - 3851) + chr(0b110011) + chr(54) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b110011) + '\066', 61046 - 61038), ehT0Px3KOsy9(chr(0b110000) + chr(5770 - 5659) + chr(0b11 + 0o60) + chr(55) + chr(53), 0o10), ehT0Px3KOsy9('\060' + chr(6743 - 6632) + chr(52) + chr(0b11111 + 0o22), 43136 - 43128), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b101011 + 0o104) + chr(0b110001) + chr(0b110101) + chr(0b110101), 16808 - 16800), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b110000) + chr(0b1100 + 0o50), 0o10), ehT0Px3KOsy9('\060' + chr(0b10110 + 0o131) + chr(0b110001) + '\065' + chr(0b1001 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + '\x32' + chr(1427 - 1375) + chr(0b110011 + 0o4), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(61 - 10) + '\062' + chr(0b100001 + 0o20), 59711 - 59703), ehT0Px3KOsy9('\060' + chr(0b1100 + 0o143) + chr(53), 0b1000), ehT0Px3KOsy9(chr(1138 - 1090) + chr(0b1101111) + chr(49) + '\x36' + '\x35', 37747 - 37739), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11000 + 0o31) + chr(53) + '\x34', 0o10), ehT0Px3KOsy9('\x30' + chr(0b111111 + 0o60) + '\062' + '\060' + '\060', 0b1000), ehT0Px3KOsy9(chr(374 - 326) + '\157' + '\x37' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(1393 - 1345) + '\x6f' + chr(0b110011) + '\x36' + '\060', 0o10), ehT0Px3KOsy9('\060' + chr(3971 - 3860) + '\x32' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + '\x31' + chr(0b110010) + chr(140 - 85), 0o10), ehT0Px3KOsy9(chr(927 - 879) + chr(111) + chr(0b11000 + 0o32) + chr(0b110100) + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(2841 - 2786) + chr(0b1001 + 0o50), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b10101 + 0o132) + chr(0b101000 + 0o11) + chr(0b1001 + 0o52) + chr(0b1001 + 0o54), 0o10), ehT0Px3KOsy9(chr(904 - 856) + chr(1897 - 1786) + chr(0b11010 + 0o31) + chr(0b100 + 0o62) + chr(0b101111 + 0o7), 5787 - 5779), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(5090 - 4979) + chr(50) + '\066' + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\065' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(0b100011 + 0o22) + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(0b100101 + 0o112) + chr(51) + chr(2671 - 2618) + chr(0b101101 + 0o6), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(0b110000) + '\063', 8), ehT0Px3KOsy9(chr(1493 - 1445) + chr(4438 - 4327) + chr(49) + '\060' + chr(0b1110 + 0o44), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10 + 0o61) + '\x33' + chr(0b110001), 55375 - 55367)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b101100 + 0o103) + chr(0b1011 + 0o52) + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8'), '\x64' + chr(101) + '\x63' + '\x6f' + chr(100) + chr(6108 - 6007))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b1010 + 0o43) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def bRt7HNJtDZln(oVre8I6UXc3b, gJYAmrulne1a, nOhAvpnA71Xj, jFcs3RNBT1hx, JOBWbuvEJQYf=xafqLlk3kkUe(SXOLrMavuUCe(b'\xd4\xf22\x94b\xd5\xff\x12\xde\xa5\x8a\xe9\x9c\xed\x98'), chr(0b111110 + 0o46) + '\x65' + chr(7064 - 6965) + chr(3161 - 3050) + chr(7691 - 7591) + chr(101))(chr(10397 - 10280) + chr(5916 - 5800) + '\x66' + '\x2d' + chr(2512 - 2456))):
xafqLlk3kkUe(WscHqcix6FmU, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5\xa0\x0b\x99r\xc5\xecw\xd1\xba\xa0\xed'), '\x64' + chr(0b10101 + 0o120) + chr(4793 - 4694) + chr(0b1101111) + chr(100) + chr(0b1000110 + 0o37))(chr(0b1110101) + chr(0b1110100) + chr(102) + '\x2d' + '\070'))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf\xf95\x8el\xcf\xe5\'\x9b\x9a\x9b\xeb\x90\xfa\x9c\x01\x0b\xf1\x05\xc4\xa5l\x1a\x02\xa0\x1d\x8bnu\x83\xce4\x82\xde\r\xed\x99&\'\xb7\xe1\xe5"\x92t\x86\xc6%\xc8\xa5\x9b\xe1\x97\xbe\xdfZ\x10\xa6'), chr(100) + chr(101) + chr(0b1100011) + '\x6f' + chr(0b1010111 + 0o15) + '\145')('\165' + chr(6511 - 6395) + chr(10329 - 10227) + chr(0b100000 + 0o15) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xd0\xa31\x8eO\xc7\xd8s\xeb\xa6\x9f\xec'), '\144' + '\x65' + chr(0b1100011) + chr(11870 - 11759) + '\x64' + '\145')(chr(0b1110101) + chr(116) + chr(8345 - 8243) + chr(1610 - 1565) + chr(56)))(gJYAmrulne1a, nOhAvpnA71Xj))
try:
dF1l04SaLrfg = oVre8I6UXc3b.ipc.post_work(gJYAmrulne1a, nOhAvpnA71Xj, jFcs3RNBT1hx, JOBWbuvEJQYf)
if JOBWbuvEJQYf == xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3\xe1&\x8fs'), chr(100) + chr(0b1100000 + 0o5) + '\x63' + '\x6f' + chr(0b1100100) + chr(3275 - 3174))(chr(0b1011101 + 0o30) + '\x74' + chr(0b1100110) + chr(0b101100 + 0o1) + chr(0b11001 + 0o37)):
return {xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6\xf6:\x8dh\xc7\xef'), chr(0b1100100) + chr(8901 - 8800) + chr(5590 - 5491) + '\x6f' + chr(1274 - 1174) + '\145')('\165' + '\164' + '\x66' + '\x2d' + chr(0b111000)): SXOLrMavuUCe(b''), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0\xe2-\x82s\xcf\xe4.\xfe\xa4\x88\xe9\x80'), '\144' + chr(0b1100101) + '\x63' + chr(0b1101111) + '\x64' + '\x65')(chr(0b1011110 + 0o27) + '\164' + chr(102) + '\055' + chr(0b111000)): xafqLlk3kkUe(SXOLrMavuUCe(b''), '\144' + chr(0b10010 + 0o123) + chr(0b1001100 + 0o27) + chr(0b11110 + 0o121) + chr(0b1100100) + chr(0b1100101))(chr(117) + '\164' + chr(0b1100110) + '\055' + chr(585 - 529))}
RZMV0hKNg6cS = oVre8I6UXc3b.ipc.get_work_result(gJYAmrulne1a, dF1l04SaLrfg)
if not xafqLlk3kkUe(RZMV0hKNg6cS, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\xe2-\x82X\xc3\xf92'), chr(0b11110 + 0o106) + '\x65' + '\x63' + '\x6f' + chr(0b1100100) + chr(101))(chr(11229 - 11112) + '\164' + '\x66' + '\055' + chr(0b111000))):
wx4UfKtkqO_Z = wzeEZVMYLFBH(RZMV0hKNg6cS.payload)
else:
wx4UfKtkqO_Z = RZMV0hKNg6cS.payload
JMFWvH2UbkIt = {xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6\xf6:\x8dh\xc7\xef'), chr(0b1110 + 0o126) + '\145' + '\143' + '\157' + chr(3924 - 3824) + chr(0b1100101))(chr(117) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(2725 - 2669)): wx4UfKtkqO_Z, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0\xe2-\x82s\xcf\xe4.\xfe\xa4\x88\xe9\x80'), '\144' + '\x65' + chr(5256 - 5157) + chr(0b1101111) + '\144' + '\145')(chr(117) + chr(7266 - 7150) + '\146' + chr(0b101101) + chr(0b111000)): RZMV0hKNg6cS.func_err}
return JMFWvH2UbkIt
except w4EQXFPtfO4w as GlnVAPeT6CUe:
xafqLlk3kkUe(WscHqcix6FmU, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe3\xef \x84w\xd2\xe2/\xd5'), '\144' + '\145' + chr(99) + chr(0b100100 + 0o113) + chr(100) + chr(101))(chr(12417 - 12300) + chr(1325 - 1209) + chr(9065 - 8963) + chr(45) + chr(0b111000)))(GlnVAPeT6CUe)
raise RfSJZzX6FUsp(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0\xf6*\x8db\xc2\xab4\xd4\xf6\x93\xe8\x84\xf1\x96DM\xe2\x1e\xc9\xb2q\x1c\x03\xee\x1f\x94f2\x83\xcd2\xd6'), chr(100) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(8715 - 8598) + chr(0b1000111 + 0o55) + '\146' + '\x2d' + chr(56)) + M8_cKLkHVB2V(GlnVAPeT6CUe))
|
awslabs/serverless-application-model
|
examples/apps/greengrass-hello-world/greengrasssdk/Lambda.py
|
StreamingBody.read
|
def read(self, amt=None):
"""Read at most amt bytes from the stream.
If the amt argument is omitted, read all data.
"""
chunk = self._raw_stream.read(amt)
self._amount_read += len(chunk)
return chunk
|
python
|
def read(self, amt=None):
"""Read at most amt bytes from the stream.
If the amt argument is omitted, read all data.
"""
chunk = self._raw_stream.read(amt)
self._amount_read += len(chunk)
return chunk
|
[
"def",
"read",
"(",
"self",
",",
"amt",
"=",
"None",
")",
":",
"chunk",
"=",
"self",
".",
"_raw_stream",
".",
"read",
"(",
"amt",
")",
"self",
".",
"_amount_read",
"+=",
"len",
"(",
"chunk",
")",
"return",
"chunk"
] |
Read at most amt bytes from the stream.
If the amt argument is omitted, read all data.
|
[
"Read",
"at",
"most",
"amt",
"bytes",
"from",
"the",
"stream",
".",
"If",
"the",
"amt",
"argument",
"is",
"omitted",
"read",
"all",
"data",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/greengrass-hello-world/greengrasssdk/Lambda.py#L126-L132
|
train
|
Read at most amt bytes from the stream.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw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ZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(945 - 896) + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(2040 - 1992) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(157 - 102) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(1047 - 999) + chr(11599 - 11488) + chr(0b101010 + 0o11) + '\067' + '\065', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1729 - 1678) + '\064' + chr(2202 - 2151), 50324 - 50316), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10001 + 0o136) + chr(0b101111 + 0o2) + chr(54) + chr(0b110100), 24055 - 24047), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(0b110000) + '\x36', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + '\060' + chr(1911 - 1861), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1011 + 0o144) + '\x31' + chr(0b110111) + chr(0b110101), 40828 - 40820), ehT0Px3KOsy9('\060' + '\x6f' + chr(833 - 782) + '\x35' + chr(2801 - 2747), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(51) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b100000 + 0o117) + '\066' + '\x37', 14802 - 14794), ehT0Px3KOsy9(chr(48) + chr(0b0 + 0o157) + chr(0b10010 + 0o40) + chr(0b10 + 0o56) + chr(105 - 53), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\x32' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(173 - 125) + '\157' + '\063' + '\064' + chr(1676 - 1626), ord("\x08")), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\x6f' + chr(0b110011) + '\064' + chr(0b110010), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b110000) + '\x37', 4008 - 4000), ehT0Px3KOsy9(chr(1543 - 1495) + chr(111) + chr(51) + chr(0b100100 + 0o14) + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(8972 - 8861) + '\064' + chr(53), 52721 - 52713), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + '\x30' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(0b110100) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(1252 - 1204) + chr(0b1011011 + 0o24) + chr(0b110010 + 0o4) + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + chr(4523 - 4412) + chr(0b110010) + chr(0b11000 + 0o33) + chr(52), 0o10), ehT0Px3KOsy9(chr(152 - 104) + chr(0b1011000 + 0o27) + '\062' + chr(0b110100) + '\064', 0o10), ehT0Px3KOsy9('\060' + chr(0b1011 + 0o144) + '\x33' + '\067' + '\062', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + chr(1212 - 1162), 47136 - 47128), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(10935 - 10824) + chr(55) + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(0b1000 + 0o51) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + chr(2214 - 2163) + chr(0b110101) + chr(0b110010), 19790 - 19782), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101010 + 0o11) + chr(0b1000 + 0o52) + chr(0b10000 + 0o42), 30236 - 30228), ehT0Px3KOsy9('\x30' + chr(0b1100001 + 0o16) + chr(0b110010) + chr(0b110110) + chr(1585 - 1535), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + '\x37' + '\x31', 0o10), ehT0Px3KOsy9(chr(472 - 424) + '\157' + chr(0b100100 + 0o17) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011 + 0o144) + '\x33' + chr(2782 - 2729) + '\062', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101011 + 0o10) + chr(54) + '\066', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b10100 + 0o133) + '\x33' + '\x35' + chr(0b10100 + 0o36), 8), ehT0Px3KOsy9(chr(149 - 101) + chr(111) + chr(0b110011), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + '\065' + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'f'), '\x64' + chr(0b1100101) + '\x63' + '\x6f' + chr(100) + chr(101))('\x75' + chr(0b1001101 + 0o47) + chr(102) + chr(0b100101 + 0o10) + chr(939 - 883)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def U6MiWrhuCi2Y(oVre8I6UXc3b, X0efCKhvY2x5=None):
qrKMvKviNzHg = oVre8I6UXc3b._raw_stream.U6MiWrhuCi2Y(X0efCKhvY2x5)
oVre8I6UXc3b.UJBJCJ1B2yQC += c2A0yzQpDQB3(qrKMvKviNzHg)
return qrKMvKviNzHg
|
awslabs/serverless-application-model
|
examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/ipc_client.py
|
IPCClient.post_work
|
def post_work(self, function_arn, input_bytes, client_context, invocation_type="RequestResponse"):
"""
Send work item to specified :code:`function_arn`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:param input_bytes: The data making up the work being posted.
:type input_bytes: bytes
:param client_context: The base64 encoded client context byte string that will be provided to the Lambda
function being invoked.
:type client_context: bytes
:returns: Invocation ID for obtaining result of the work.
:type returns: str
"""
url = self._get_url(function_arn)
runtime_logger.info('Posting work for function [{}] to {}'.format(function_arn, url))
request = Request(url, input_bytes or b'')
request.add_header(HEADER_CLIENT_CONTEXT, client_context)
request.add_header(HEADER_AUTH_TOKEN, self.auth_token)
request.add_header(HEADER_INVOCATION_TYPE, invocation_type)
response = urlopen(request)
invocation_id = response.info().get(HEADER_INVOCATION_ID)
runtime_logger.info('Work posted with invocation id [{}]'.format(invocation_id))
return invocation_id
|
python
|
def post_work(self, function_arn, input_bytes, client_context, invocation_type="RequestResponse"):
"""
Send work item to specified :code:`function_arn`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:param input_bytes: The data making up the work being posted.
:type input_bytes: bytes
:param client_context: The base64 encoded client context byte string that will be provided to the Lambda
function being invoked.
:type client_context: bytes
:returns: Invocation ID for obtaining result of the work.
:type returns: str
"""
url = self._get_url(function_arn)
runtime_logger.info('Posting work for function [{}] to {}'.format(function_arn, url))
request = Request(url, input_bytes or b'')
request.add_header(HEADER_CLIENT_CONTEXT, client_context)
request.add_header(HEADER_AUTH_TOKEN, self.auth_token)
request.add_header(HEADER_INVOCATION_TYPE, invocation_type)
response = urlopen(request)
invocation_id = response.info().get(HEADER_INVOCATION_ID)
runtime_logger.info('Work posted with invocation id [{}]'.format(invocation_id))
return invocation_id
|
[
"def",
"post_work",
"(",
"self",
",",
"function_arn",
",",
"input_bytes",
",",
"client_context",
",",
"invocation_type",
"=",
"\"RequestResponse\"",
")",
":",
"url",
"=",
"self",
".",
"_get_url",
"(",
"function_arn",
")",
"runtime_logger",
".",
"info",
"(",
"'Posting work for function [{}] to {}'",
".",
"format",
"(",
"function_arn",
",",
"url",
")",
")",
"request",
"=",
"Request",
"(",
"url",
",",
"input_bytes",
"or",
"b''",
")",
"request",
".",
"add_header",
"(",
"HEADER_CLIENT_CONTEXT",
",",
"client_context",
")",
"request",
".",
"add_header",
"(",
"HEADER_AUTH_TOKEN",
",",
"self",
".",
"auth_token",
")",
"request",
".",
"add_header",
"(",
"HEADER_INVOCATION_TYPE",
",",
"invocation_type",
")",
"response",
"=",
"urlopen",
"(",
"request",
")",
"invocation_id",
"=",
"response",
".",
"info",
"(",
")",
".",
"get",
"(",
"HEADER_INVOCATION_ID",
")",
"runtime_logger",
".",
"info",
"(",
"'Work posted with invocation id [{}]'",
".",
"format",
"(",
"invocation_id",
")",
")",
"return",
"invocation_id"
] |
Send work item to specified :code:`function_arn`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:param input_bytes: The data making up the work being posted.
:type input_bytes: bytes
:param client_context: The base64 encoded client context byte string that will be provided to the Lambda
function being invoked.
:type client_context: bytes
:returns: Invocation ID for obtaining result of the work.
:type returns: str
|
[
"Send",
"work",
"item",
"to",
"specified",
":",
"code",
":",
"function_arn",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/ipc_client.py#L81-L110
|
train
|
Send a work item to the Lambda function.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,h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_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + chr(0b110101) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11011 + 0o27) + '\x37' + '\067', 19602 - 19594), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(55) + chr(938 - 890), 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(403 - 353) + chr(0b1 + 0o62) + chr(543 - 493), 62729 - 62721), ehT0Px3KOsy9(chr(1868 - 1820) + chr(111) + '\063' + chr(0b100110 + 0o14) + chr(0b110001), 61498 - 61490), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(0b110110) + chr(0b1111 + 0o50), ord("\x08")), ehT0Px3KOsy9(chr(810 - 762) + chr(111) + chr(0b110001) + chr(2188 - 2136) + chr(55), 0o10), ehT0Px3KOsy9(chr(90 - 42) + chr(111) + chr(0b100000 + 0o22) + chr(1448 - 1394) + chr(48), 56456 - 56448), ehT0Px3KOsy9('\x30' + chr(0b1001001 + 0o46) + chr(0b11000 + 0o36) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + '\x30' + '\060', 2888 - 2880), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b1001 + 0o52) + chr(0b110111), 44165 - 44157), ehT0Px3KOsy9(chr(1976 - 1928) + '\157' + '\061' + chr(0b100011 + 0o16) + '\067', 50572 - 50564), ehT0Px3KOsy9('\060' + '\157' + chr(0b110100) + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + chr(6871 - 6760) + '\x31' + chr(53) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101010 + 0o5) + '\x33' + chr(0b11101 + 0o26) + chr(0b110111), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1 + 0o60) + chr(55) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(1545 - 1497) + chr(0b1100110 + 0o11) + '\062' + chr(0b10000 + 0o46) + '\065', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(49) + chr(48), 28436 - 28428), ehT0Px3KOsy9(chr(1511 - 1463) + chr(111) + '\061' + chr(1011 - 958) + '\x34', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(0b11100 + 0o26) + chr(397 - 345), ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\157' + chr(0b110010) + chr(846 - 792) + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(0b110110) + '\x30', 0o10), ehT0Px3KOsy9(chr(177 - 129) + '\157' + chr(0b111 + 0o53) + chr(51) + chr(50), 8), ehT0Px3KOsy9(chr(992 - 944) + '\157' + chr(50) + chr(1625 - 1572) + chr(2234 - 2185), 0b1000), ehT0Px3KOsy9('\060' + chr(0b111000 + 0o67) + '\061' + chr(2933 - 2878) + chr(0b10011 + 0o43), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1100100 + 0o13) + '\x36' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b0 + 0o157) + '\x31' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(389 - 338) + chr(0b101 + 0o57) + chr(48), 33510 - 33502), ehT0Px3KOsy9(chr(1457 - 1409) + '\x6f' + chr(0b110001) + chr(0b110000 + 0o4), 0b1000), ehT0Px3KOsy9(chr(1681 - 1633) + chr(6388 - 6277) + chr(959 - 909) + chr(0b1110 + 0o46), ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1000110 + 0o51) + chr(0b100 + 0o57) + chr(51) + chr(0b11010 + 0o27), 0b1000), ehT0Px3KOsy9(chr(1940 - 1892) + chr(11710 - 11599) + chr(49) + chr(1574 - 1523) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + chr(1568 - 1517) + '\x34' + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10011 + 0o134) + '\062' + '\067' + '\066', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(1500 - 1452), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1 + 0o60) + chr(2778 - 2724), 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + '\x33' + chr(0b1000 + 0o50) + '\065', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + '\066' + '\067', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(1764 - 1653) + chr(0b100000 + 0o25) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x06'), chr(0b1100100) + '\145' + '\143' + chr(1064 - 953) + '\144' + chr(101))(chr(117) + chr(116) + chr(0b1100101 + 0o1) + chr(1640 - 1595) + chr(2216 - 2160)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Ormlfng_cuOb(oVre8I6UXc3b, gJYAmrulne1a, tZyKLwt2RGTk, jFcs3RNBT1hx, JOBWbuvEJQYf=xafqLlk3kkUe(SXOLrMavuUCe(b'z\xda\x89\xef\xb4\x04\x13\xe2T3\xaf L\x1b\xba'), chr(0b101001 + 0o73) + chr(0b1100101) + chr(0b1100011) + chr(0b11000 + 0o127) + chr(0b1100100) + chr(326 - 225))('\165' + chr(0b1110100) + '\146' + chr(0b100101 + 0o10) + chr(1816 - 1760))):
CYCr3xzMHl4K = oVre8I6UXc3b._get_url(gJYAmrulne1a)
xafqLlk3kkUe(tHsekZuX_0R7, xafqLlk3kkUe(SXOLrMavuUCe(b'{\x88\xb0\xe2\xa4\x14\x00\x87[,\x85$'), chr(0b1100100) + chr(3006 - 2905) + chr(0b10010 + 0o121) + chr(11768 - 11657) + chr(0b1100100) + chr(0b11010 + 0o113))('\165' + chr(116) + chr(3822 - 3720) + chr(1871 - 1826) + chr(2121 - 2065)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"x\xd0\x8b\xee\xb8\x19\x00\x90F/\xad$\x02\x0e\xb0\t\x95\xee\x19\xfa\xd7\x84\xf3\xc6\x10'orw\xbd,`\xb6z\x98\xc3"), chr(0b1100100) + '\145' + '\x63' + chr(0b111011 + 0o64) + chr(0b11110 + 0o106) + chr(101))(chr(117) + '\x74' + chr(9331 - 9229) + chr(45) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'~\x8b\x8a\xf5\x99\x164\x83a0\xba%'), chr(1591 - 1491) + chr(0b10100 + 0o121) + chr(99) + chr(12147 - 12036) + '\144' + chr(2090 - 1989))(chr(0b1000011 + 0o62) + '\164' + chr(0b1100110) + '\055' + chr(56)))(gJYAmrulne1a, CYCr3xzMHl4K))
r9Xp41HGNpwj = OIfWRB_hTcOp(CYCr3xzMHl4K, tZyKLwt2RGTk or SXOLrMavuUCe(b''))
xafqLlk3kkUe(r9Xp41HGNpwj, xafqLlk3kkUe(SXOLrMavuUCe(b'I\xdb\x9c\xc5\xb9\x12\x06\xd4T2'), '\x64' + chr(101) + chr(3226 - 3127) + chr(2614 - 2503) + chr(0b1100100) + chr(0b1100101))(chr(2153 - 2036) + chr(116) + chr(102) + chr(45) + chr(147 - 91)))(aBxreuzvOer5, jFcs3RNBT1hx)
xafqLlk3kkUe(r9Xp41HGNpwj, xafqLlk3kkUe(SXOLrMavuUCe(b'I\xdb\x9c\xc5\xb9\x12\x06\xd4T2'), '\144' + '\x65' + chr(0b1100011) + '\x6f' + chr(2634 - 2534) + chr(0b1011001 + 0o14))(chr(117) + '\164' + chr(0b1100110) + chr(0b1000 + 0o45) + '\070'))(QcH1ramjmnBj, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'I\xca\x8c\xf2\x8e\x03\x08\xdbT.'), chr(8617 - 8517) + '\145' + '\143' + '\x6f' + chr(100) + chr(0b0 + 0o145))('\x75' + '\x74' + '\x66' + '\x2d' + '\x38')))
xafqLlk3kkUe(r9Xp41HGNpwj, xafqLlk3kkUe(SXOLrMavuUCe(b'I\xdb\x9c\xc5\xb9\x12\x06\xd4T2'), chr(7001 - 6901) + '\145' + '\143' + '\157' + '\x64' + chr(0b1100101))(chr(1699 - 1582) + chr(116) + '\146' + chr(45) + '\x38'))(biOp6cT1ZVH0, JOBWbuvEJQYf)
ekFGDFIe9V8v = LYikF4pp6hFm(r9Xp41HGNpwj)
dF1l04SaLrfg = ekFGDFIe9V8v.info().get(dqwcaIVB2svQ)
xafqLlk3kkUe(tHsekZuX_0R7, xafqLlk3kkUe(SXOLrMavuUCe(b'{\x88\xb0\xe2\xa4\x14\x00\x87[,\x85$'), chr(0b1100100) + '\x65' + chr(99) + '\x6f' + chr(6832 - 6732) + '\x65')('\165' + '\x74' + chr(8600 - 8498) + chr(0b101101) + '\x38'))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\x7f\xd0\x8a\xf1\xf1\x07\x08\xc3E%\xbboU\x01\xab\x13\x95\xe1\x02\xe2\xdb\x93\xfb\xdd\x17hZ)c\x84,O\xa2'\xbe"), chr(0b100110 + 0o76) + chr(0b1100101) + chr(0b100001 + 0o102) + '\157' + '\144' + '\x65')(chr(0b1110101) + '\164' + chr(102) + '\055' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'~\x8b\x8a\xf5\x99\x164\x83a0\xba%'), chr(0b1100100) + '\145' + chr(0b1100011 + 0o0) + chr(0b1001100 + 0o43) + '\x64' + chr(3197 - 3096))('\165' + chr(6958 - 6842) + chr(9938 - 9836) + chr(0b101101) + chr(0b11010 + 0o36)))(dF1l04SaLrfg))
return dF1l04SaLrfg
|
awslabs/serverless-application-model
|
examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/ipc_client.py
|
IPCClient.get_work
|
def get_work(self, function_arn):
"""
Retrieve the next work item for specified :code:`function_arn`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:returns: Next work item to be processed by the function.
:type returns: WorkItem
"""
url = self._get_work_url(function_arn)
runtime_logger.info('Getting work for function [{}] from {}'.format(function_arn, url))
request = Request(url)
request.add_header(HEADER_AUTH_TOKEN, self.auth_token)
response = urlopen(request)
invocation_id = response.info().get(HEADER_INVOCATION_ID)
client_context = response.info().get(HEADER_CLIENT_CONTEXT)
runtime_logger.info('Got work item with invocation id [{}]'.format(invocation_id))
return WorkItem(
invocation_id=invocation_id,
payload=response.read(),
client_context=client_context)
|
python
|
def get_work(self, function_arn):
"""
Retrieve the next work item for specified :code:`function_arn`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:returns: Next work item to be processed by the function.
:type returns: WorkItem
"""
url = self._get_work_url(function_arn)
runtime_logger.info('Getting work for function [{}] from {}'.format(function_arn, url))
request = Request(url)
request.add_header(HEADER_AUTH_TOKEN, self.auth_token)
response = urlopen(request)
invocation_id = response.info().get(HEADER_INVOCATION_ID)
client_context = response.info().get(HEADER_CLIENT_CONTEXT)
runtime_logger.info('Got work item with invocation id [{}]'.format(invocation_id))
return WorkItem(
invocation_id=invocation_id,
payload=response.read(),
client_context=client_context)
|
[
"def",
"get_work",
"(",
"self",
",",
"function_arn",
")",
":",
"url",
"=",
"self",
".",
"_get_work_url",
"(",
"function_arn",
")",
"runtime_logger",
".",
"info",
"(",
"'Getting work for function [{}] from {}'",
".",
"format",
"(",
"function_arn",
",",
"url",
")",
")",
"request",
"=",
"Request",
"(",
"url",
")",
"request",
".",
"add_header",
"(",
"HEADER_AUTH_TOKEN",
",",
"self",
".",
"auth_token",
")",
"response",
"=",
"urlopen",
"(",
"request",
")",
"invocation_id",
"=",
"response",
".",
"info",
"(",
")",
".",
"get",
"(",
"HEADER_INVOCATION_ID",
")",
"client_context",
"=",
"response",
".",
"info",
"(",
")",
".",
"get",
"(",
"HEADER_CLIENT_CONTEXT",
")",
"runtime_logger",
".",
"info",
"(",
"'Got work item with invocation id [{}]'",
".",
"format",
"(",
"invocation_id",
")",
")",
"return",
"WorkItem",
"(",
"invocation_id",
"=",
"invocation_id",
",",
"payload",
"=",
"response",
".",
"read",
"(",
")",
",",
"client_context",
"=",
"client_context",
")"
] |
Retrieve the next work item for specified :code:`function_arn`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:returns: Next work item to be processed by the function.
:type returns: WorkItem
|
[
"Retrieve",
"the",
"next",
"work",
"item",
"for",
"specified",
":",
"code",
":",
"function_arn",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/ipc_client.py#L113-L138
|
train
|
Retrieves the next work item for the specified Lambda function.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o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voPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(1834 - 1784) + '\x32', 0o10), ehT0Px3KOsy9(chr(1039 - 991) + chr(0b1101111) + chr(0b10110 + 0o34) + chr(234 - 186) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(1017 - 969) + chr(0b100111 + 0o110) + '\063' + chr(0b1101 + 0o47) + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(1644 - 1593) + '\x36' + chr(0b100110 + 0o20), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(1789 - 1738) + chr(0b110001) + chr(2311 - 2260), 4651 - 4643), ehT0Px3KOsy9('\x30' + chr(0b10100 + 0o133) + chr(0b110011) + '\x30' + chr(54), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101110 + 0o1) + chr(50) + '\066' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9501 - 9390) + '\061' + chr(710 - 656) + chr(0b110110), 29457 - 29449), ehT0Px3KOsy9('\x30' + chr(0b1010 + 0o145) + chr(78 - 24) + '\062', 12707 - 12699), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b110100) + '\063', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x35' + '\063', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(50) + chr(0b100101 + 0o14), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(1384 - 1334), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1101 + 0o46) + '\065' + '\066', 0b1000), ehT0Px3KOsy9(chr(1140 - 1092) + '\157' + chr(0b110011) + '\067', 0o10), ehT0Px3KOsy9(chr(152 - 104) + chr(4293 - 4182) + chr(50) + chr(53) + '\063', 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\x6f' + '\x32' + chr(49) + chr(536 - 486), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\066' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(2223 - 2171) + chr(2252 - 2199), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101100 + 0o5) + '\061' + chr(1245 - 1191), ord("\x08")), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + chr(0b1011 + 0o50) + chr(55) + chr(555 - 503), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(0b110000), 44774 - 44766), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b110101), 57534 - 57526), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + '\x37' + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + '\x35' + chr(0b10 + 0o61), ord("\x08")), ehT0Px3KOsy9(chr(1061 - 1013) + chr(356 - 245) + chr(497 - 447) + chr(55) + chr(2304 - 2256), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\067' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(0b110110) + chr(353 - 303), 8), ehT0Px3KOsy9('\x30' + chr(11785 - 11674) + '\063' + chr(1638 - 1587) + '\062', 0b1000), ehT0Px3KOsy9(chr(1771 - 1723) + chr(0b10111 + 0o130) + '\063' + chr(2438 - 2388) + chr(0b110 + 0o52), 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + chr(0b110001) + chr(0b110001) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101010 + 0o5) + chr(0b110011) + chr(48) + chr(0b11110 + 0o27), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011110 + 0o21) + chr(0b10101 + 0o36) + chr(1091 - 1041) + '\x35', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\063' + '\x30' + '\066', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1930 - 1881) + chr(0b110000) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1011111 + 0o20) + chr(98 - 49) + chr(0b101100 + 0o12) + chr(0b110110), 8), ehT0Px3KOsy9(chr(48) + chr(0b1010010 + 0o35) + '\061' + chr(0b110100 + 0o0) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b11000 + 0o37) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + '\x33' + chr(0b110010) + chr(593 - 539), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1 + 0o61) + chr(0b11001 + 0o27) + '\x35', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + '\065' + chr(0b10001 + 0o37), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc'), chr(0b101111 + 0o65) + chr(101) + chr(265 - 166) + '\157' + chr(100) + '\x65')(chr(117) + '\164' + chr(0b1100110) + '\055' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def DoDfAWE0lDAI(oVre8I6UXc3b, gJYAmrulne1a):
CYCr3xzMHl4K = oVre8I6UXc3b._get_work_url(gJYAmrulne1a)
xafqLlk3kkUe(tHsekZuX_0R7, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1\xb6\xaf\x8e\xbe\xa5\xd5AX\x8fq\xba'), chr(4063 - 3963) + chr(4380 - 4279) + '\143' + chr(0b110010 + 0o75) + chr(2914 - 2814) + chr(101))('\165' + chr(1164 - 1048) + chr(0b1100110) + chr(0b101101) + chr(56)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5\xe4\x93\x82\xa2\xa8\xd5VE\x8cY\xba:\x88p\xd9\xaa\x91\x10 \x9fd|\x92\x85\x98$\xc9\xa7\x8di\xa3\xa7\xa9*V\x18\xc2'), chr(2582 - 2482) + chr(0b1100101) + chr(99) + '\157' + chr(0b1100011 + 0o1) + chr(3412 - 3311))(chr(117) + '\164' + chr(0b10 + 0o144) + '\055' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4\xb5\x95\x99\x83\xa7\xe1Eb\x93N\xbb'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(111) + '\x64' + chr(0b1100101))(chr(10415 - 10298) + chr(4325 - 4209) + chr(0b1100110) + chr(0b1100 + 0o41) + chr(0b11111 + 0o31)))(gJYAmrulne1a, CYCr3xzMHl4K))
r9Xp41HGNpwj = OIfWRB_hTcOp(CYCr3xzMHl4K)
xafqLlk3kkUe(r9Xp41HGNpwj, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3\xe5\x83\xa9\xa3\xa3\xd3\x12W\x91'), chr(0b111100 + 0o50) + chr(2794 - 2693) + chr(0b1000100 + 0o37) + '\x6f' + chr(100) + chr(1214 - 1113))(chr(1251 - 1134) + chr(0b1110100) + chr(102) + chr(991 - 946) + chr(0b111000)))(QcH1ramjmnBj, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3\xf4\x93\x9e\x94\xb2\xdd\x1dW\x8d'), '\144' + chr(101) + chr(99) + '\x6f' + chr(3728 - 3628) + chr(0b11001 + 0o114))(chr(0b1010010 + 0o43) + '\x74' + chr(0b101111 + 0o67) + chr(45) + chr(1488 - 1432))))
ekFGDFIe9V8v = LYikF4pp6hFm(r9Xp41HGNpwj)
dF1l04SaLrfg = ekFGDFIe9V8v.info().get(dqwcaIVB2svQ)
jFcs3RNBT1hx = ekFGDFIe9V8v.info().get(aBxreuzvOer5)
xafqLlk3kkUe(tHsekZuX_0R7, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1\xb6\xaf\x8e\xbe\xa5\xd5AX\x8fq\xba'), chr(0b1100100) + '\145' + chr(9327 - 9228) + '\157' + chr(0b100011 + 0o101) + chr(0b1011111 + 0o6))('\x75' + chr(0b111010 + 0o72) + '\146' + chr(621 - 576) + chr(0b0 + 0o70)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\xd5\xee\x93\xd6\xbc\xa9\xc0\x1d\x12\x8a_\xb4w\xceh\xc2\xfe\x9fE'\x92fz\x9e\x8a\xcc\x16\xdd\xb4\xf0 \xa1\xf5\x9d<\x0b>"), '\144' + chr(5853 - 5752) + chr(933 - 834) + chr(10494 - 10383) + chr(0b1001111 + 0o25) + chr(0b111010 + 0o53))('\x75' + '\x74' + chr(0b1100110) + '\x2d' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4\xb5\x95\x99\x83\xa7\xe1Eb\x93N\xbb'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(0b1111 + 0o126))(chr(2918 - 2801) + chr(116) + chr(0b1000111 + 0o37) + '\055' + chr(56)))(dF1l04SaLrfg))
return bJ_ZgATQP3Xi(invocation_id=dF1l04SaLrfg, payload=xafqLlk3kkUe(ekFGDFIe9V8v, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc7\xb7\xaa\x9f\x9c\xb4\xda\x03q\x8a\x19\x88'), chr(100) + chr(1479 - 1378) + chr(0b11101 + 0o106) + chr(11902 - 11791) + '\x64' + chr(5777 - 5676))(chr(117) + chr(0b1110100) + '\x66' + '\055' + '\x38'))(), client_context=jFcs3RNBT1hx)
|
awslabs/serverless-application-model
|
examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/ipc_client.py
|
IPCClient.post_work_result
|
def post_work_result(self, function_arn, work_item):
"""
Post the result of processing work item by :code:`function_arn`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:param work_item: The WorkItem holding the results of the work being posted.
:type work_item: WorkItem
:returns: None
"""
url = self._get_work_url(function_arn)
runtime_logger.info('Posting work result for invocation id [{}] to {}'.format(work_item.invocation_id, url))
request = Request(url, work_item.payload or b'')
request.add_header(HEADER_INVOCATION_ID, work_item.invocation_id)
request.add_header(HEADER_AUTH_TOKEN, self.auth_token)
urlopen(request)
runtime_logger.info('Posted work result for invocation id [{}]'.format(work_item.invocation_id))
|
python
|
def post_work_result(self, function_arn, work_item):
"""
Post the result of processing work item by :code:`function_arn`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:param work_item: The WorkItem holding the results of the work being posted.
:type work_item: WorkItem
:returns: None
"""
url = self._get_work_url(function_arn)
runtime_logger.info('Posting work result for invocation id [{}] to {}'.format(work_item.invocation_id, url))
request = Request(url, work_item.payload or b'')
request.add_header(HEADER_INVOCATION_ID, work_item.invocation_id)
request.add_header(HEADER_AUTH_TOKEN, self.auth_token)
urlopen(request)
runtime_logger.info('Posted work result for invocation id [{}]'.format(work_item.invocation_id))
|
[
"def",
"post_work_result",
"(",
"self",
",",
"function_arn",
",",
"work_item",
")",
":",
"url",
"=",
"self",
".",
"_get_work_url",
"(",
"function_arn",
")",
"runtime_logger",
".",
"info",
"(",
"'Posting work result for invocation id [{}] to {}'",
".",
"format",
"(",
"work_item",
".",
"invocation_id",
",",
"url",
")",
")",
"request",
"=",
"Request",
"(",
"url",
",",
"work_item",
".",
"payload",
"or",
"b''",
")",
"request",
".",
"add_header",
"(",
"HEADER_INVOCATION_ID",
",",
"work_item",
".",
"invocation_id",
")",
"request",
".",
"add_header",
"(",
"HEADER_AUTH_TOKEN",
",",
"self",
".",
"auth_token",
")",
"urlopen",
"(",
"request",
")",
"runtime_logger",
".",
"info",
"(",
"'Posted work result for invocation id [{}]'",
".",
"format",
"(",
"work_item",
".",
"invocation_id",
")",
")"
] |
Post the result of processing work item by :code:`function_arn`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:param work_item: The WorkItem holding the results of the work being posted.
:type work_item: WorkItem
:returns: None
|
[
"Post",
"the",
"result",
"of",
"processing",
"work",
"item",
"by",
":",
"code",
":",
"function_arn",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/ipc_client.py#L141-L163
|
train
|
Post the result of processing the work item by function_arn.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0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Im,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(52) + chr(975 - 921), 7473 - 7465), ehT0Px3KOsy9('\x30' + chr(0b111001 + 0o66) + chr(0b110001) + chr(0b110011) + '\x35', 37343 - 37335), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(0b100110 + 0o16) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(55), 0o10), ehT0Px3KOsy9(chr(1600 - 1552) + chr(0b1101111) + chr(0b10010 + 0o37) + '\067' + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(357 - 307) + '\x31' + chr(0b1000 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(1333 - 1285) + chr(111) + chr(50) + chr(468 - 416) + chr(0b110010), 47533 - 47525), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b110111) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(6581 - 6470) + '\x33' + chr(1754 - 1704) + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(0b110111) + '\x36', 8), ehT0Px3KOsy9(chr(0b110000) + chr(7133 - 7022) + '\x37' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + chr(0b10011 + 0o37) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(1592 - 1540) + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110011) + chr(50), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b100000 + 0o23) + '\066' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b100010 + 0o115) + chr(0b10010 + 0o37) + '\x34' + chr(2633 - 2578), 26196 - 26188), ehT0Px3KOsy9(chr(362 - 314) + chr(0b100001 + 0o116) + '\061' + '\x33', 0o10), ehT0Px3KOsy9(chr(1867 - 1819) + chr(0b1101111) + '\063' + chr(0b110111) + chr(0b110111), 39566 - 39558), ehT0Px3KOsy9('\x30' + chr(0b101100 + 0o103) + chr(1653 - 1601) + chr(1594 - 1544), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(0b110010) + chr(1577 - 1525), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + chr(0b1110 + 0o50) + chr(0b11111 + 0o30), 0b1000), ehT0Px3KOsy9(chr(722 - 674) + '\157' + chr(51) + '\064' + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(2524 - 2413) + chr(337 - 284) + chr(0b10000 + 0o43), 25261 - 25253), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101 + 0o56) + chr(49), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(52) + '\061', 8), ehT0Px3KOsy9('\060' + '\157' + chr(50) + '\x35' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(787 - 739) + '\x6f' + chr(49) + chr(0b110110) + chr(580 - 529), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(49) + chr(53), 0b1000), ehT0Px3KOsy9('\060' + chr(1872 - 1761) + chr(2270 - 2219) + chr(49) + chr(1403 - 1355), 61861 - 61853), ehT0Px3KOsy9('\x30' + '\157' + chr(1489 - 1438) + '\x30', 10217 - 10209), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + '\x30' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(602 - 554) + chr(0b1101111) + '\061' + '\060' + chr(0b11110 + 0o30), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(55) + chr(1808 - 1759), 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + '\x31' + chr(54) + '\062', 51973 - 51965), ehT0Px3KOsy9('\060' + chr(0b101000 + 0o107) + '\063' + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\157' + chr(51) + '\062' + chr(1905 - 1857), 38643 - 38635), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(9577 - 9466) + chr(1882 - 1827) + chr(2465 - 2415), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10011 + 0o40) + chr(0b101011 + 0o14), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(1138 - 1088) + chr(1401 - 1351) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\066' + chr(0b110111), 31330 - 31322)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b100011 + 0o114) + chr(0b100110 + 0o17) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x88'), chr(5717 - 5617) + chr(0b10010 + 0o123) + '\143' + chr(0b1101111) + chr(0b1011110 + 0o6) + chr(5185 - 5084))('\x75' + '\x74' + '\146' + chr(0b101101) + chr(0b100001 + 0o27)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def DVkTkqEVTtXx(oVre8I6UXc3b, gJYAmrulne1a, WpnOxc4ILMi4):
CYCr3xzMHl4K = oVre8I6UXc3b._get_work_url(gJYAmrulne1a)
xafqLlk3kkUe(tHsekZuX_0R7, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5j\xaaw\x0b\xe9\xc5O\xbd\x12fy'), chr(0b1000111 + 0o35) + chr(1997 - 1896) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(1251 - 1134) + '\164' + chr(102) + '\055' + '\x38'))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf62\x91{\x17\xe4\xc5X\xa0\x11Ny\x87\xe8\x96\x14~\x93V\xb4Q\x8eY9\x88\xc1\x05"\xaby4/\x96\x1c<\xb9^?\xcb\x8c\xdb\x00\xc2{\x11\xaa\xd9\x05'), chr(3502 - 3402) + '\x65' + chr(0b1100011) + chr(0b1001100 + 0o43) + chr(0b111101 + 0o47) + chr(0b10000 + 0o125))(chr(0b1110101) + '\x74' + '\x66' + chr(177 - 132) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0i\x90`6\xeb\xf1K\x87\x0eYx'), '\144' + '\x65' + chr(0b1000010 + 0o41) + '\157' + '\144' + '\x65')('\165' + '\x74' + '\x66' + '\x2d' + chr(0b111000)))(xafqLlk3kkUe(WpnOxc4ILMi4, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf3\x94`\x1d\xeb\xd6\x11\xb8\x10c{\xc3'), chr(4386 - 4286) + '\145' + chr(99) + chr(5071 - 4960) + chr(0b1001000 + 0o34) + '\145')('\165' + chr(116) + '\x66' + '\x2d' + chr(0b101010 + 0o16))), CYCr3xzMHl4K))
r9Xp41HGNpwj = OIfWRB_hTcOp(CYCr3xzMHl4K, WpnOxc4ILMi4.payload or SXOLrMavuUCe(b''))
xafqLlk3kkUe(r9Xp41HGNpwj, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc79\x86P\x16\xef\xc3\x1c\xb2\x0c'), chr(0b1100100) + chr(8360 - 8259) + chr(0b1100011) + chr(0b1101111) + chr(0b10000 + 0o124) + chr(2890 - 2789))(chr(117) + chr(0b1110100) + '\x66' + '\x2d' + chr(0b111000)))(dqwcaIVB2svQ, xafqLlk3kkUe(WpnOxc4ILMi4, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf3\x94`\x1d\xeb\xd6\x11\xb8\x10c{\xc3'), chr(509 - 409) + chr(0b11001 + 0o114) + '\x63' + chr(4604 - 4493) + chr(0b111101 + 0o47) + '\x65')(chr(0b1000010 + 0o63) + chr(0b1110100) + '\x66' + chr(0b101001 + 0o4) + '\x38')))
xafqLlk3kkUe(r9Xp41HGNpwj, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc79\x86P\x16\xef\xc3\x1c\xb2\x0c'), '\x64' + '\145' + '\143' + chr(0b1101111) + chr(0b1100100) + '\145')(chr(1222 - 1105) + chr(12403 - 12287) + chr(0b1100001 + 0o5) + chr(45) + '\070'))(QcH1ramjmnBj, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc7(\x96g!\xfe\xcd\x13\xb2\x10'), chr(100) + '\x65' + chr(2713 - 2614) + chr(10798 - 10687) + chr(0b1100100) + '\145')('\x75' + '\x74' + chr(0b1100110) + chr(45) + chr(56))))
LYikF4pp6hFm(r9Xp41HGNpwj)
xafqLlk3kkUe(tHsekZuX_0R7, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5j\xaaw\x0b\xe9\xc5O\xbd\x12fy'), '\x64' + chr(0b1001000 + 0o35) + chr(0b1000011 + 0o40) + chr(0b1101111) + '\144' + chr(0b111110 + 0o47))(chr(0b100010 + 0o123) + '\164' + chr(102) + '\055' + chr(0b111000)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf62\x91{\x1b\xee\x82\x0f\xb8\x0cW2\xd5\xff\x80\x12g\x8b\x02\xf2X\x93\x0bp\x8f\xd9\x1c.\xa9l))\x97Ru\xb4\x1aD\xeb\x8a\xfb'), '\x64' + '\145' + '\x63' + chr(0b1101111) + chr(0b100 + 0o140) + '\145')('\165' + '\164' + chr(10391 - 10289) + chr(45) + chr(0b110101 + 0o3)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0i\x90`6\xeb\xf1K\x87\x0eYx'), chr(0b1100100) + chr(101) + chr(99) + chr(111) + chr(0b1100100) + chr(0b1100101))('\165' + '\x74' + '\146' + chr(1458 - 1413) + '\070'))(xafqLlk3kkUe(WpnOxc4ILMi4, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf3\x94`\x1d\xeb\xd6\x11\xb8\x10c{\xc3'), chr(100) + chr(0b1100101) + chr(3113 - 3014) + chr(0b1100010 + 0o15) + chr(0b1000010 + 0o42) + chr(0b1100101))(chr(117) + chr(1645 - 1529) + '\146' + '\055' + chr(0b111000)))))
|
awslabs/serverless-application-model
|
examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/ipc_client.py
|
IPCClient.post_handler_err
|
def post_handler_err(self, function_arn, invocation_id, handler_err):
"""
Post the error message from executing the function handler for :code:`function_arn`
with specifid :code:`invocation_id`
:param function_arn: Arn of the Lambda function which has the handler error message.
:type function_arn: string
:param invocation_id: Invocation ID of the work that is being requested
:type invocation_id: string
:param handler_err: the error message caught from handler
:type handler_err: string
"""
url = self._get_work_url(function_arn)
runtime_logger.info('Posting handler error for invocation id [{}] to {}'.format(invocation_id, url))
payload = json.dumps({
"errorMessage": handler_err,
}).encode('utf-8')
request = Request(url, payload)
request.add_header(HEADER_INVOCATION_ID, invocation_id)
request.add_header(HEADER_FUNCTION_ERR_TYPE, "Handled")
request.add_header(HEADER_AUTH_TOKEN, self.auth_token)
urlopen(request)
runtime_logger.info('Posted handler error for invocation id [{}]'.format(invocation_id))
|
python
|
def post_handler_err(self, function_arn, invocation_id, handler_err):
"""
Post the error message from executing the function handler for :code:`function_arn`
with specifid :code:`invocation_id`
:param function_arn: Arn of the Lambda function which has the handler error message.
:type function_arn: string
:param invocation_id: Invocation ID of the work that is being requested
:type invocation_id: string
:param handler_err: the error message caught from handler
:type handler_err: string
"""
url = self._get_work_url(function_arn)
runtime_logger.info('Posting handler error for invocation id [{}] to {}'.format(invocation_id, url))
payload = json.dumps({
"errorMessage": handler_err,
}).encode('utf-8')
request = Request(url, payload)
request.add_header(HEADER_INVOCATION_ID, invocation_id)
request.add_header(HEADER_FUNCTION_ERR_TYPE, "Handled")
request.add_header(HEADER_AUTH_TOKEN, self.auth_token)
urlopen(request)
runtime_logger.info('Posted handler error for invocation id [{}]'.format(invocation_id))
|
[
"def",
"post_handler_err",
"(",
"self",
",",
"function_arn",
",",
"invocation_id",
",",
"handler_err",
")",
":",
"url",
"=",
"self",
".",
"_get_work_url",
"(",
"function_arn",
")",
"runtime_logger",
".",
"info",
"(",
"'Posting handler error for invocation id [{}] to {}'",
".",
"format",
"(",
"invocation_id",
",",
"url",
")",
")",
"payload",
"=",
"json",
".",
"dumps",
"(",
"{",
"\"errorMessage\"",
":",
"handler_err",
",",
"}",
")",
".",
"encode",
"(",
"'utf-8'",
")",
"request",
"=",
"Request",
"(",
"url",
",",
"payload",
")",
"request",
".",
"add_header",
"(",
"HEADER_INVOCATION_ID",
",",
"invocation_id",
")",
"request",
".",
"add_header",
"(",
"HEADER_FUNCTION_ERR_TYPE",
",",
"\"Handled\"",
")",
"request",
".",
"add_header",
"(",
"HEADER_AUTH_TOKEN",
",",
"self",
".",
"auth_token",
")",
"urlopen",
"(",
"request",
")",
"runtime_logger",
".",
"info",
"(",
"'Posted handler error for invocation id [{}]'",
".",
"format",
"(",
"invocation_id",
")",
")"
] |
Post the error message from executing the function handler for :code:`function_arn`
with specifid :code:`invocation_id`
:param function_arn: Arn of the Lambda function which has the handler error message.
:type function_arn: string
:param invocation_id: Invocation ID of the work that is being requested
:type invocation_id: string
:param handler_err: the error message caught from handler
:type handler_err: string
|
[
"Post",
"the",
"error",
"message",
"from",
"executing",
"the",
"function",
"handler",
"for",
":",
"code",
":",
"function_arn",
"with",
"specifid",
":",
"code",
":",
"invocation_id"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/ipc_client.py#L166-L196
|
train
|
Post the error message from executing the function handler for the given function_arn and invocation_id.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc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ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100010 + 0o17) + chr(0b11111 + 0o30) + '\x37', 18198 - 18190), ehT0Px3KOsy9(chr(1140 - 1092) + chr(111) + chr(0b110011) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b0 + 0o157) + chr(2624 - 2570) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + chr(49) + chr(0b110101) + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + '\064' + chr(53), 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\x6f' + '\x31' + chr(0b110110) + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(0b110110) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1110 - 1058) + chr(2173 - 2119), 32031 - 32023), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + chr(0b1110 + 0o44) + chr(1928 - 1876) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(11498 - 11387) + chr(49) + '\066' + '\067', 0b1000), ehT0Px3KOsy9(chr(935 - 887) + '\x6f' + chr(50) + chr(523 - 468) + chr(82 - 32), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(1648 - 1600) + chr(2608 - 2555), ord("\x08")), ehT0Px3KOsy9(chr(142 - 94) + chr(0b1101111) + chr(1688 - 1637) + chr(0b100 + 0o55) + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + '\063' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110010 + 0o75) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(1260 - 1212) + chr(0b1101111) + chr(707 - 658) + chr(0b100001 + 0o17) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(186 - 138) + chr(0b1101111) + chr(49) + chr(497 - 444) + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\x32' + '\062', 3156 - 3148), ehT0Px3KOsy9('\x30' + chr(0b11010 + 0o125) + '\061' + '\067' + chr(53), 23082 - 23074), ehT0Px3KOsy9('\060' + chr(2414 - 2303) + chr(0b110011) + '\x30' + chr(2731 - 2678), 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b110100 + 0o73) + chr(49) + '\x32' + chr(2431 - 2381), 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + chr(49) + chr(49) + '\064', 50393 - 50385), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1100101 + 0o12) + chr(0b110001) + chr(55) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(8559 - 8448) + '\x31' + '\060' + '\064', 8), ehT0Px3KOsy9(chr(2303 - 2255) + chr(0b1100010 + 0o15) + chr(1273 - 1223) + '\062' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1100 + 0o143) + '\x33' + chr(1253 - 1201) + chr(55), 17114 - 17106), ehT0Px3KOsy9(chr(1605 - 1557) + chr(111) + chr(765 - 714) + chr(0b110101) + '\x33', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(820 - 769) + chr(53) + chr(0b100000 + 0o25), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(0b100010 + 0o25) + chr(1373 - 1320), 0o10), ehT0Px3KOsy9(chr(48) + chr(4124 - 4013) + '\062' + chr(48) + chr(48), 0b1000), ehT0Px3KOsy9(chr(1228 - 1180) + '\x6f' + chr(0b110101) + chr(0b101010 + 0o11), 45550 - 45542), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\157' + chr(0b110011) + '\064' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\157' + '\061' + '\065' + chr(0b10000 + 0o42), ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(8237 - 8126) + '\062' + '\063' + chr(0b110000), 57714 - 57706), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(0b11110 + 0o26), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(1516 - 1463), 8), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(1700 - 1649) + chr(0b110001) + chr(0b10001 + 0o46), 8), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1101011 + 0o4) + chr(0b1111 + 0o44) + '\065' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + '\065' + chr(0b1011 + 0o52), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(111) + chr(53) + chr(0b110000), 5699 - 5691)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'3'), '\x64' + '\145' + '\143' + '\x6f' + '\x64' + chr(0b1100101))(chr(117) + chr(8084 - 7968) + chr(6548 - 6446) + chr(0b111 + 0o46) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def bfnEckkRqG_X(oVre8I6UXc3b, gJYAmrulne1a, dF1l04SaLrfg, nEoemzuWqWh2):
CYCr3xzMHl4K = oVre8I6UXc3b._get_work_url(gJYAmrulne1a)
xafqLlk3kkUe(tHsekZuX_0R7, xafqLlk3kkUe(SXOLrMavuUCe(b'NHTK\x18\x06\x16\xc4L\xcb-\xd1'), '\x64' + chr(0b10101 + 0o120) + chr(1799 - 1700) + chr(5935 - 5824) + '\144' + chr(0b1100101))('\x75' + chr(116) + chr(102) + '\055' + '\070'))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"M\x10oG\x04\x0b\x16\xd3N\xc6\x19\xde)\xaa\xe9'!\x1e\xa0\x12\xb7r*\x116\xb3\x8e\x85\x9b\x92\xe3J\x90\x03\xf7r=\xa6\x8b\x8dF\x04anM\x11\x1e\xd3]\xda"), chr(4248 - 4148) + '\x65' + chr(99) + '\x6f' + chr(100) + '\145')(chr(0b10010 + 0o143) + chr(0b101011 + 0o111) + '\146' + chr(0b100110 + 0o7) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'KKn\\%\x04"\xc0v\xd7\x12\xd0'), '\x64' + chr(0b100011 + 0o102) + chr(0b1100010 + 0o1) + '\x6f' + '\x64' + chr(101))(chr(117) + chr(3814 - 3698) + chr(0b1100110) + '\055' + chr(0b111000)))(dF1l04SaLrfg, CYCr3xzMHl4K))
nOhAvpnA71Xj = fXk443epxtd5.dumps({xafqLlk3kkUe(SXOLrMavuUCe(b'x\rn\\\x1f(\x14\x80U\xc6\x10\xdf'), '\x64' + chr(8884 - 8783) + chr(99) + chr(111) + chr(0b11111 + 0o105) + chr(4841 - 4740))('\x75' + chr(0b1110100) + chr(102) + '\055' + chr(0b111000)): nEoemzuWqWh2}).encode(xafqLlk3kkUe(SXOLrMavuUCe(b'h\x0bz\x1eU'), chr(100) + chr(9737 - 9636) + '\x63' + chr(0b1101111) + '\144' + '\x65')('\x75' + chr(0b1110100) + chr(102) + chr(0b101101) + chr(56)))
r9Xp41HGNpwj = OIfWRB_hTcOp(CYCr3xzMHl4K, nOhAvpnA71Xj)
xafqLlk3kkUe(r9Xp41HGNpwj, xafqLlk3kkUe(SXOLrMavuUCe(b'|\x1bxl\x05\x00\x10\x97C\xd5'), '\144' + chr(10030 - 9929) + '\143' + chr(7806 - 7695) + chr(100) + chr(0b100100 + 0o101))('\x75' + '\x74' + chr(0b110001 + 0o65) + chr(45) + chr(0b111000)))(dqwcaIVB2svQ, dF1l04SaLrfg)
xafqLlk3kkUe(r9Xp41HGNpwj, xafqLlk3kkUe(SXOLrMavuUCe(b'|\x1bxl\x05\x00\x10\x97C\xd5'), chr(100) + '\x65' + chr(99) + chr(111) + chr(0b1011111 + 0o5) + chr(0b1100101))(chr(0b101001 + 0o114) + chr(9710 - 9594) + chr(1519 - 1417) + chr(0b10111 + 0o26) + chr(0b111000)))(A6p3gAs7G9mR, xafqLlk3kkUe(SXOLrMavuUCe(b'U\x1erW\x01\x00\x15'), chr(518 - 418) + chr(0b1010000 + 0o25) + chr(0b1010 + 0o131) + chr(0b1001100 + 0o43) + chr(0b11001 + 0o113) + chr(0b11 + 0o142))(chr(0b1110101) + '\x74' + chr(0b1001010 + 0o34) + '\055' + chr(56)))
xafqLlk3kkUe(r9Xp41HGNpwj, xafqLlk3kkUe(SXOLrMavuUCe(b'|\x1bxl\x05\x00\x10\x97C\xd5'), '\144' + '\x65' + '\143' + chr(4007 - 3896) + chr(5353 - 5253) + '\145')('\x75' + '\164' + '\x66' + chr(1115 - 1070) + chr(0b111000)))(QcH1ramjmnBj, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'|\nh[2\x11\x1e\x98C\xc9'), '\144' + chr(10199 - 10098) + '\x63' + chr(2385 - 2274) + '\144' + chr(101))(chr(7377 - 7260) + '\x74' + chr(7551 - 7449) + chr(45) + chr(0b10 + 0o66))))
LYikF4pp6hFm(r9Xp41HGNpwj)
xafqLlk3kkUe(tHsekZuX_0R7, xafqLlk3kkUe(SXOLrMavuUCe(b'NHTK\x18\x06\x16\xc4L\xcb-\xd1'), chr(0b1100100) + chr(101) + chr(7791 - 7692) + chr(0b1101111) + '\x64' + '\x65')(chr(0b1110101) + chr(0b1101011 + 0o11) + '\x66' + chr(0b101101) + chr(100 - 44)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'M\x10oG\x08\x01Q\x9bG\xc9\x13\xd6 \xbd\xbbb6\x1e\xbd\x0f\xe54#\x0cd\xfa\x89\x9d\x82\x9e\xe1_\x8d\x05\xf6<t\xab\xcf\xf6f\x02A'), chr(0b1011010 + 0o12) + '\x65' + '\x63' + chr(0b1101111) + chr(100) + chr(101))('\x75' + chr(0b1110100) + chr(1095 - 993) + chr(0b1100 + 0o41) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'KKn\\%\x04"\xc0v\xd7\x12\xd0'), '\144' + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(0b111010 + 0o53))(chr(0b1110101) + '\x74' + '\146' + chr(0b101101) + chr(2464 - 2408)))(dF1l04SaLrfg))
|
awslabs/serverless-application-model
|
examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/ipc_client.py
|
IPCClient.get_work_result
|
def get_work_result(self, function_arn, invocation_id):
"""
Retrieve the result of the work processed by :code:`function_arn`
with specified :code:`invocation_id`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:param invocation_id: Invocation ID of the work that is being requested
:type invocation_id: string
:returns: The get work result output contains result payload and function error type if the invoking is failed.
:type returns: GetWorkResultOutput
"""
url = self._get_url(function_arn)
runtime_logger.info('Getting work result for invocation id [{}] from {}'.format(invocation_id, url))
request = Request(url)
request.add_header(HEADER_INVOCATION_ID, invocation_id)
request.add_header(HEADER_AUTH_TOKEN, self.auth_token)
response = urlopen(request)
runtime_logger.info('Got result for invocation id [{}]'.format(invocation_id))
payload = response.read()
func_err = response.info().get(HEADER_FUNCTION_ERR_TYPE)
return GetWorkResultOutput(
payload=payload,
func_err=func_err)
|
python
|
def get_work_result(self, function_arn, invocation_id):
"""
Retrieve the result of the work processed by :code:`function_arn`
with specified :code:`invocation_id`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:param invocation_id: Invocation ID of the work that is being requested
:type invocation_id: string
:returns: The get work result output contains result payload and function error type if the invoking is failed.
:type returns: GetWorkResultOutput
"""
url = self._get_url(function_arn)
runtime_logger.info('Getting work result for invocation id [{}] from {}'.format(invocation_id, url))
request = Request(url)
request.add_header(HEADER_INVOCATION_ID, invocation_id)
request.add_header(HEADER_AUTH_TOKEN, self.auth_token)
response = urlopen(request)
runtime_logger.info('Got result for invocation id [{}]'.format(invocation_id))
payload = response.read()
func_err = response.info().get(HEADER_FUNCTION_ERR_TYPE)
return GetWorkResultOutput(
payload=payload,
func_err=func_err)
|
[
"def",
"get_work_result",
"(",
"self",
",",
"function_arn",
",",
"invocation_id",
")",
":",
"url",
"=",
"self",
".",
"_get_url",
"(",
"function_arn",
")",
"runtime_logger",
".",
"info",
"(",
"'Getting work result for invocation id [{}] from {}'",
".",
"format",
"(",
"invocation_id",
",",
"url",
")",
")",
"request",
"=",
"Request",
"(",
"url",
")",
"request",
".",
"add_header",
"(",
"HEADER_INVOCATION_ID",
",",
"invocation_id",
")",
"request",
".",
"add_header",
"(",
"HEADER_AUTH_TOKEN",
",",
"self",
".",
"auth_token",
")",
"response",
"=",
"urlopen",
"(",
"request",
")",
"runtime_logger",
".",
"info",
"(",
"'Got result for invocation id [{}]'",
".",
"format",
"(",
"invocation_id",
")",
")",
"payload",
"=",
"response",
".",
"read",
"(",
")",
"func_err",
"=",
"response",
".",
"info",
"(",
")",
".",
"get",
"(",
"HEADER_FUNCTION_ERR_TYPE",
")",
"return",
"GetWorkResultOutput",
"(",
"payload",
"=",
"payload",
",",
"func_err",
"=",
"func_err",
")"
] |
Retrieve the result of the work processed by :code:`function_arn`
with specified :code:`invocation_id`.
:param function_arn: Arn of the Lambda function intended to receive the work for processing.
:type function_arn: string
:param invocation_id: Invocation ID of the work that is being requested
:type invocation_id: string
:returns: The get work result output contains result payload and function error type if the invoking is failed.
:type returns: GetWorkResultOutput
|
[
"Retrieve",
"the",
"result",
"of",
"the",
"work",
"processed",
"by",
":",
"code",
":",
"function_arn",
"with",
"specified",
":",
"code",
":",
"invocation_id",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/greengrass-hello-world/greengrass_ipc_python_sdk/ipc_client.py#L199-L230
|
train
|
Retrieves the result of the work processed by Lambda function with specified invocation_id.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24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YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(10417 - 10306) + '\062' + chr(0b110001), 51709 - 51701), ehT0Px3KOsy9(chr(1130 - 1082) + '\x6f' + '\061' + chr(0b1111 + 0o47) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1101111) + chr(55) + chr(0b110011), 61410 - 61402), ehT0Px3KOsy9(chr(453 - 405) + chr(0b1101111) + chr(49) + chr(49) + chr(2480 - 2429), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + chr(51) + '\x35' + chr(2240 - 2192), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b111 + 0o54) + '\x36' + chr(895 - 842), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b101000 + 0o107) + chr(0b10000 + 0o42) + chr(0b110110) + chr(0b100111 + 0o14), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100000 + 0o17) + chr(0b11100 + 0o25) + chr(49) + '\061', 28667 - 28659), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1000110 + 0o51) + chr(1012 - 957) + chr(0b10011 + 0o42), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(3711 - 3600) + chr(2496 - 2446) + '\x30' + '\x30', 23988 - 23980), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + '\x31' + chr(48), 44151 - 44143), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(54) + chr(0b111 + 0o51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(395 - 345) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(325 - 274) + chr(0b100010 + 0o20), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(0b110010) + chr(204 - 156), 27759 - 27751), ehT0Px3KOsy9(chr(385 - 337) + chr(0b11110 + 0o121) + chr(0b110001) + chr(2241 - 2193) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1678 - 1627) + '\x35' + chr(2985 - 2930), ord("\x08")), ehT0Px3KOsy9(chr(1612 - 1564) + chr(0b1101111) + chr(0b11011 + 0o26) + '\x36' + chr(52), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b10010 + 0o37) + chr(0b101001 + 0o14) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1256 - 1205) + '\061' + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(8676 - 8565) + chr(51) + '\064' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + '\x32' + '\064' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(2009 - 1961) + '\157' + '\062' + chr(50) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101111) + chr(51) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(1479 - 1429) + chr(55) + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1011000 + 0o27) + chr(0b110010) + chr(53) + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101011 + 0o4) + chr(50) + chr(0b110110) + chr(0b101111 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(1805 - 1757) + chr(111) + chr(1922 - 1870) + '\067', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(0b110010) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(0b110010) + chr(1867 - 1818), 63954 - 63946), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(0b10001 + 0o46) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\x6f' + '\063' + '\x30' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1083 - 1033) + chr(0b110001) + chr(0b11010 + 0o30), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(0b1111 + 0o50) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + '\x30' + '\x30', 25900 - 25892), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(52) + '\x37', 14430 - 14422), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + '\x30' + chr(0b0 + 0o60), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(243 - 193) + chr(2085 - 2037) + '\061', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(50) + chr(2438 - 2386), 61971 - 61963)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\x6f' + chr(0b1110 + 0o47) + chr(2091 - 2043), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'?'), chr(0b100010 + 0o102) + chr(2886 - 2785) + chr(0b1110 + 0o125) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(117) + '\164' + chr(0b1111 + 0o127) + chr(0b11001 + 0o24) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def wQg1le8z6mOT(oVre8I6UXc3b, gJYAmrulne1a, dF1l04SaLrfg):
CYCr3xzMHl4K = oVre8I6UXc3b._get_url(gJYAmrulne1a)
xafqLlk3kkUe(tHsekZuX_0R7, xafqLlk3kkUe(SXOLrMavuUCe(b'BDs3\x9d\x96\xd4~W\xec[\xa3'), '\144' + '\x65' + '\x63' + chr(0b1010010 + 0o35) + chr(6115 - 6015) + '\145')(chr(11745 - 11628) + chr(785 - 669) + chr(0b1100110) + chr(1683 - 1638) + chr(613 - 557)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'V\x16O?\x81\x9b\xd4iJ\xefs\xa3\xd0\xe6?\xe34\x83\x00N\xaf\x88\xd0\xb3v\xd6\xdc\xdeD\xf7%\x17\xa8\xe4\x99)\xc3\xa0\xda/l.\x1b-\x9a\x9a\xdeiF\xfd'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(5765 - 5654) + '\x64' + chr(101))('\x75' + chr(7138 - 7022) + chr(0b1 + 0o145) + '\055' + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'GGI$\xa0\x94\xe0zm\xf0d\xa2'), chr(0b100 + 0o140) + chr(101) + chr(0b1010011 + 0o20) + '\157' + chr(2488 - 2388) + '\145')(chr(0b1101001 + 0o14) + chr(0b1110100) + chr(0b101001 + 0o75) + chr(45) + '\070'))(dF1l04SaLrfg, CYCr3xzMHl4K))
r9Xp41HGNpwj = OIfWRB_hTcOp(CYCr3xzMHl4K)
xafqLlk3kkUe(r9Xp41HGNpwj, xafqLlk3kkUe(SXOLrMavuUCe(b'p\x17_\x14\x80\x90\xd2-X\xf2'), chr(0b1100100) + '\145' + chr(99) + chr(0b1011101 + 0o22) + '\144' + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + '\x38'))(dqwcaIVB2svQ, dF1l04SaLrfg)
xafqLlk3kkUe(r9Xp41HGNpwj, xafqLlk3kkUe(SXOLrMavuUCe(b'p\x17_\x14\x80\x90\xd2-X\xf2'), chr(0b111111 + 0o45) + chr(0b1100101) + '\143' + '\x6f' + chr(0b1100100) + chr(0b1100101))('\165' + chr(0b1110100) + chr(0b1011101 + 0o11) + chr(1704 - 1659) + '\x38'))(QcH1ramjmnBj, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'p\x06O#\xb7\x81\xdc"X\xee'), chr(100) + chr(0b111001 + 0o54) + '\143' + chr(111) + chr(3764 - 3664) + chr(0b101101 + 0o70))('\x75' + '\164' + chr(0b1100110) + chr(0b101101) + chr(56))))
ekFGDFIe9V8v = LYikF4pp6hFm(r9Xp41HGNpwj)
xafqLlk3kkUe(tHsekZuX_0R7, xafqLlk3kkUe(SXOLrMavuUCe(b'BDs3\x9d\x96\xd4~W\xec[\xa3'), chr(0b1100100) + '\145' + '\143' + chr(0b1101111) + chr(6300 - 6200) + chr(0b100100 + 0o101))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b101101) + '\070'))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'V\x1cOk\x9a\x90\xc0<Q\xf4!\xae\x9f\xe6z\xf9/\x99\x1b\r\xa8\x93\xcb\xfcq\x98\xc3\xd5\x07\xcd*\x03\x9a'), chr(100) + chr(101) + chr(9599 - 9500) + chr(111) + chr(0b1100100) + '\145')(chr(11506 - 11389) + chr(116) + chr(0b11 + 0o143) + '\x2d' + chr(0b10 + 0o66)), xafqLlk3kkUe(SXOLrMavuUCe(b'GGI$\xa0\x94\xe0zm\xf0d\xa2'), chr(2090 - 1990) + '\x65' + chr(99) + '\x6f' + chr(3159 - 3059) + chr(0b1100101))('\165' + chr(0b10101 + 0o137) + '\x66' + chr(0b101101) + '\070'))(dF1l04SaLrfg))
nOhAvpnA71Xj = ekFGDFIe9V8v.U6MiWrhuCi2Y()
FZqs6ihym5rU = ekFGDFIe9V8v.info().get(A6p3gAs7G9mR)
return qlXnaqaxC6Qc(payload=nOhAvpnA71Xj, func_err=FZqs6ihym5rU)
|
awslabs/serverless-application-model
|
samtranslator/plugins/application/serverless_app_plugin.py
|
ServerlessAppPlugin.on_before_transform_template
|
def on_before_transform_template(self, template_dict):
"""
Hook method that gets called before the SAM template is processed.
The template has passed the validation and is guaranteed to contain a non-empty "Resources" section.
This plugin needs to run as soon as possible to allow some time for templates to become available.
This verifies that the user has access to all specified applications.
:param dict template_dict: Dictionary of the SAM template
:return: Nothing
"""
template = SamTemplate(template_dict)
intrinsic_resolvers = self._get_intrinsic_resolvers(template_dict.get('Mappings', {}))
service_call = None
if self._validate_only:
service_call = self._handle_get_application_request
else:
service_call = self._handle_create_cfn_template_request
for logical_id, app in template.iterate(SamResourceType.Application.value):
if not self._can_process_application(app):
# Handle these cases in the on_before_transform_resource event
continue
app_id = self._replace_value(app.properties[self.LOCATION_KEY],
self.APPLICATION_ID_KEY, intrinsic_resolvers)
semver = self._replace_value(app.properties[self.LOCATION_KEY],
self.SEMANTIC_VERSION_KEY, intrinsic_resolvers)
if isinstance(app_id, dict) or isinstance(semver, dict):
key = (json.dumps(app_id), json.dumps(semver))
self._applications[key] = False
continue
key = (app_id, semver)
if key not in self._applications:
try:
# Lazy initialization of the client- create it when it is needed
if not self._sar_client:
self._sar_client = boto3.client('serverlessrepo')
service_call(app_id, semver, key, logical_id)
except InvalidResourceException as e:
# Catch all InvalidResourceExceptions, raise those in the before_resource_transform target.
self._applications[key] = e
|
python
|
def on_before_transform_template(self, template_dict):
"""
Hook method that gets called before the SAM template is processed.
The template has passed the validation and is guaranteed to contain a non-empty "Resources" section.
This plugin needs to run as soon as possible to allow some time for templates to become available.
This verifies that the user has access to all specified applications.
:param dict template_dict: Dictionary of the SAM template
:return: Nothing
"""
template = SamTemplate(template_dict)
intrinsic_resolvers = self._get_intrinsic_resolvers(template_dict.get('Mappings', {}))
service_call = None
if self._validate_only:
service_call = self._handle_get_application_request
else:
service_call = self._handle_create_cfn_template_request
for logical_id, app in template.iterate(SamResourceType.Application.value):
if not self._can_process_application(app):
# Handle these cases in the on_before_transform_resource event
continue
app_id = self._replace_value(app.properties[self.LOCATION_KEY],
self.APPLICATION_ID_KEY, intrinsic_resolvers)
semver = self._replace_value(app.properties[self.LOCATION_KEY],
self.SEMANTIC_VERSION_KEY, intrinsic_resolvers)
if isinstance(app_id, dict) or isinstance(semver, dict):
key = (json.dumps(app_id), json.dumps(semver))
self._applications[key] = False
continue
key = (app_id, semver)
if key not in self._applications:
try:
# Lazy initialization of the client- create it when it is needed
if not self._sar_client:
self._sar_client = boto3.client('serverlessrepo')
service_call(app_id, semver, key, logical_id)
except InvalidResourceException as e:
# Catch all InvalidResourceExceptions, raise those in the before_resource_transform target.
self._applications[key] = e
|
[
"def",
"on_before_transform_template",
"(",
"self",
",",
"template_dict",
")",
":",
"template",
"=",
"SamTemplate",
"(",
"template_dict",
")",
"intrinsic_resolvers",
"=",
"self",
".",
"_get_intrinsic_resolvers",
"(",
"template_dict",
".",
"get",
"(",
"'Mappings'",
",",
"{",
"}",
")",
")",
"service_call",
"=",
"None",
"if",
"self",
".",
"_validate_only",
":",
"service_call",
"=",
"self",
".",
"_handle_get_application_request",
"else",
":",
"service_call",
"=",
"self",
".",
"_handle_create_cfn_template_request",
"for",
"logical_id",
",",
"app",
"in",
"template",
".",
"iterate",
"(",
"SamResourceType",
".",
"Application",
".",
"value",
")",
":",
"if",
"not",
"self",
".",
"_can_process_application",
"(",
"app",
")",
":",
"# Handle these cases in the on_before_transform_resource event",
"continue",
"app_id",
"=",
"self",
".",
"_replace_value",
"(",
"app",
".",
"properties",
"[",
"self",
".",
"LOCATION_KEY",
"]",
",",
"self",
".",
"APPLICATION_ID_KEY",
",",
"intrinsic_resolvers",
")",
"semver",
"=",
"self",
".",
"_replace_value",
"(",
"app",
".",
"properties",
"[",
"self",
".",
"LOCATION_KEY",
"]",
",",
"self",
".",
"SEMANTIC_VERSION_KEY",
",",
"intrinsic_resolvers",
")",
"if",
"isinstance",
"(",
"app_id",
",",
"dict",
")",
"or",
"isinstance",
"(",
"semver",
",",
"dict",
")",
":",
"key",
"=",
"(",
"json",
".",
"dumps",
"(",
"app_id",
")",
",",
"json",
".",
"dumps",
"(",
"semver",
")",
")",
"self",
".",
"_applications",
"[",
"key",
"]",
"=",
"False",
"continue",
"key",
"=",
"(",
"app_id",
",",
"semver",
")",
"if",
"key",
"not",
"in",
"self",
".",
"_applications",
":",
"try",
":",
"# Lazy initialization of the client- create it when it is needed",
"if",
"not",
"self",
".",
"_sar_client",
":",
"self",
".",
"_sar_client",
"=",
"boto3",
".",
"client",
"(",
"'serverlessrepo'",
")",
"service_call",
"(",
"app_id",
",",
"semver",
",",
"key",
",",
"logical_id",
")",
"except",
"InvalidResourceException",
"as",
"e",
":",
"# Catch all InvalidResourceExceptions, raise those in the before_resource_transform target.",
"self",
".",
"_applications",
"[",
"key",
"]",
"=",
"e"
] |
Hook method that gets called before the SAM template is processed.
The template has passed the validation and is guaranteed to contain a non-empty "Resources" section.
This plugin needs to run as soon as possible to allow some time for templates to become available.
This verifies that the user has access to all specified applications.
:param dict template_dict: Dictionary of the SAM template
:return: Nothing
|
[
"Hook",
"method",
"that",
"gets",
"called",
"before",
"the",
"SAM",
"template",
"is",
"processed",
".",
"The",
"template",
"has",
"passed",
"the",
"validation",
"and",
"is",
"guaranteed",
"to",
"contain",
"a",
"non",
"-",
"empty",
"Resources",
"section",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/application/serverless_app_plugin.py#L64-L109
|
train
|
This method is called before the SAM template is processed. It is called by the before_transform_template method of the SAM template processor.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,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p=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1010001 + 0o36) + '\x33' + chr(0b1101 + 0o46) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b110100 + 0o73) + chr(0b11101 + 0o25) + chr(0b110110) + chr(0b110011 + 0o0), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\065' + chr(1790 - 1741), 19317 - 19309), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(3447 - 3336) + chr(55) + '\x34', 37727 - 37719), ehT0Px3KOsy9(chr(1902 - 1854) + chr(111) + chr(0b11101 + 0o26) + chr(730 - 681), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(837 - 782) + '\x34', 8), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + chr(0b101111 + 0o2) + chr(0b110010) + '\x34', 24333 - 24325), ehT0Px3KOsy9('\060' + chr(6686 - 6575) + '\x32' + '\060' + chr(0b11000 + 0o30), 42926 - 42918), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(682 - 630) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1100101 + 0o12) + chr(0b1111 + 0o42) + chr(0b10011 + 0o42) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(54) + chr(0b10000 + 0o40), 49715 - 49707), ehT0Px3KOsy9('\060' + '\157' + chr(0b110110) + chr(1251 - 1200), 0o10), ehT0Px3KOsy9(chr(863 - 815) + chr(0b1101111) + chr(651 - 602) + chr(50) + chr(977 - 922), 52245 - 52237), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(2246 - 2196) + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1011 + 0o51) + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51), 0o10), ehT0Px3KOsy9(chr(1835 - 1787) + chr(111) + chr(51) + chr(2153 - 2105), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(146 - 97) + chr(48) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(0b110010) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1025 - 974) + chr(0b101101 + 0o11) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(520 - 472) + chr(0b1101111) + '\063' + chr(0b110 + 0o57) + '\065', 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + chr(51) + chr(50) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011000 + 0o27) + chr(0b11010 + 0o33) + chr(0b11010 + 0o31), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10001 + 0o136) + chr(0b110001) + chr(514 - 464) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1086 - 1035), 8), ehT0Px3KOsy9(chr(0b110000) + chr(5496 - 5385) + '\x32' + chr(0b110101) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(1401 - 1353) + chr(0b111100 + 0o63) + chr(0b110010) + chr(0b100101 + 0o13) + chr(0b101010 + 0o6), 8), ehT0Px3KOsy9(chr(48) + chr(0b1010000 + 0o37) + chr(766 - 717) + chr(0b110100 + 0o2), 60594 - 60586), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2501 - 2448) + chr(2466 - 2414), ord("\x08")), ehT0Px3KOsy9(chr(970 - 922) + chr(111) + chr(2049 - 2000) + chr(49) + chr(0b101101 + 0o3), ord("\x08")), ehT0Px3KOsy9('\060' + chr(3177 - 3066) + chr(619 - 570) + chr(48) + chr(0b101111 + 0o7), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011010 + 0o25) + chr(54) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + '\062' + chr(0b110011) + chr(506 - 452), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(0b110110) + chr(0b101101 + 0o6), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(396 - 344) + chr(54), 0b1000), ehT0Px3KOsy9(chr(674 - 626) + chr(111) + chr(0b11000 + 0o35), 11682 - 11674), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110110), 38652 - 38644), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + '\x33' + chr(0b110100), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(0b110111) + chr(0b110 + 0o61), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(449 - 338) + chr(1653 - 1600) + chr(0b10011 + 0o35), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf2'), '\x64' + '\x65' + '\143' + '\x6f' + chr(100) + '\145')(chr(117) + chr(0b1011101 + 0o27) + '\x66' + chr(0b110 + 0o47) + chr(0b101001 + 0o17)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def gj1OHc_ZqbSb(oVre8I6UXc3b, PPP5FvnpV6j7):
jJBnSHEgylNZ = EY6e8ub0jb5c(PPP5FvnpV6j7)
xAFDQnuhVdWI = oVre8I6UXc3b._get_intrinsic_resolvers(PPP5FvnpV6j7.get(xafqLlk3kkUe(SXOLrMavuUCe(b'\x91\xd2\xd9LpR3\xf3'), chr(0b1100100) + chr(5039 - 4938) + chr(99) + '\x6f' + chr(0b111000 + 0o54) + chr(101))(chr(117) + '\x74' + chr(102) + chr(0b11010 + 0o23) + chr(0b100011 + 0o25)), {}))
YjC_V9clWQt3 = None
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x83\xc5\xc8PpX5\xf4\xc52\x9f];}'), '\144' + '\145' + chr(0b101010 + 0o71) + '\x6f' + '\144' + chr(101))(chr(0b1110101) + chr(116) + chr(102) + chr(603 - 558) + chr(0b100111 + 0o21))):
YjC_V9clWQt3 = oVre8I6UXc3b._handle_get_application_request
else:
YjC_V9clWQt3 = oVre8I6UXc3b._handle_create_cfn_template_request
for (NpZr66MdBhVG, J8d5LengsZGV) in xafqLlk3kkUe(jJBnSHEgylNZ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb5\xc7\xccNxH1'), '\x64' + chr(0b1100101) + chr(5843 - 5744) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(0b1101111 + 0o5) + chr(2975 - 2873) + chr(61 - 16) + '\x38'))(xafqLlk3kkUe(N9D7M1lGWFFe.Application, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8d\xde\xc4[Ni\x16\xb1\x93;\xb3y'), chr(100) + chr(0b101000 + 0o75) + '\143' + '\157' + chr(0b1011101 + 0o7) + chr(2732 - 2631))(chr(0b1110101) + '\164' + '\146' + chr(0b101101) + '\x38'))):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x83\xd0\xc8RFL&\xef\xc3\x08\x83@\x08e\xe4Toq"2\x81\x84\xbfE'), '\144' + '\145' + '\143' + '\x6f' + chr(0b1100100) + chr(0b111011 + 0o52))(chr(2804 - 2687) + chr(116) + '\146' + chr(1858 - 1813) + '\x38'))(J8d5LengsZGV):
continue
QR5BSXpbet6P = oVre8I6UXc3b._replace_value(J8d5LengsZGV.o4Mv82sLmOP8[oVre8I6UXc3b.LOCATION_KEY], oVre8I6UXc3b.APPLICATION_ID_KEY, xAFDQnuhVdWI)
PrrpAglVqsQG = oVre8I6UXc3b._replace_value(J8d5LengsZGV.o4Mv82sLmOP8[oVre8I6UXc3b.LOCATION_KEY], oVre8I6UXc3b.SEMANTIC_VERSION_KEY, xAFDQnuhVdWI)
if PlSM16l2KDPD(QR5BSXpbet6P, wLqBDw8l0eIm) or PlSM16l2KDPD(PrrpAglVqsQG, wLqBDw8l0eIm):
K3J4ZwSlE0sT = (fXk443epxtd5.dumps(QR5BSXpbet6P), fXk443epxtd5.dumps(PrrpAglVqsQG))
oVre8I6UXc3b.kDNaz3VrFX6E[K3J4ZwSlE0sT] = ehT0Px3KOsy9('\x30' + chr(5568 - 5457) + chr(48), 0b1000)
continue
K3J4ZwSlE0sT = (QR5BSXpbet6P, PrrpAglVqsQG)
if K3J4ZwSlE0sT not in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7\xf7\xe7]c\x0f\x02\xf2\xe65\xc6v'), chr(0b1100100) + chr(101) + chr(0b100000 + 0o103) + '\157' + chr(0b1000 + 0o134) + chr(7650 - 7549))(chr(0b1000111 + 0o56) + chr(3845 - 3729) + '\146' + '\x2d' + chr(1177 - 1121))):
try:
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x83\xc0\xc8NF_8\xe9\xc5\x03\x84'), chr(2268 - 2168) + chr(9547 - 9446) + chr(0b10100 + 0o117) + chr(111) + chr(0b1100100) + '\145')(chr(117) + chr(11820 - 11704) + chr(0b1100100 + 0o2) + '\055' + chr(971 - 915))):
oVre8I6UXc3b.yD0incn6JVh5 = OyjxW8JV9GLL.iBSv7CWmC2h1(xafqLlk3kkUe(SXOLrMavuUCe(b"\xaf\xd6\xdbJ|N8\xe5\xd3\x1e\x82V'k"), '\144' + chr(5427 - 5326) + '\x63' + '\157' + chr(1690 - 1590) + chr(0b111100 + 0o51))(chr(0b1110101) + chr(0b1110100) + chr(102) + '\x2d' + '\x38'))
YjC_V9clWQt3(QR5BSXpbet6P, PrrpAglVqsQG, K3J4ZwSlE0sT, NpZr66MdBhVG)
except ow8Lll3lwq0h as GlnVAPeT6CUe:
oVre8I6UXc3b.kDNaz3VrFX6E[K3J4ZwSlE0sT] = GlnVAPeT6CUe
|
awslabs/serverless-application-model
|
samtranslator/plugins/application/serverless_app_plugin.py
|
ServerlessAppPlugin._can_process_application
|
def _can_process_application(self, app):
"""
Determines whether or not the on_before_transform_template event can process this application
:param dict app: the application and its properties
"""
return (self.LOCATION_KEY in app.properties and
isinstance(app.properties[self.LOCATION_KEY], dict) and
self.APPLICATION_ID_KEY in app.properties[self.LOCATION_KEY] and
self.SEMANTIC_VERSION_KEY in app.properties[self.LOCATION_KEY])
|
python
|
def _can_process_application(self, app):
"""
Determines whether or not the on_before_transform_template event can process this application
:param dict app: the application and its properties
"""
return (self.LOCATION_KEY in app.properties and
isinstance(app.properties[self.LOCATION_KEY], dict) and
self.APPLICATION_ID_KEY in app.properties[self.LOCATION_KEY] and
self.SEMANTIC_VERSION_KEY in app.properties[self.LOCATION_KEY])
|
[
"def",
"_can_process_application",
"(",
"self",
",",
"app",
")",
":",
"return",
"(",
"self",
".",
"LOCATION_KEY",
"in",
"app",
".",
"properties",
"and",
"isinstance",
"(",
"app",
".",
"properties",
"[",
"self",
".",
"LOCATION_KEY",
"]",
",",
"dict",
")",
"and",
"self",
".",
"APPLICATION_ID_KEY",
"in",
"app",
".",
"properties",
"[",
"self",
".",
"LOCATION_KEY",
"]",
"and",
"self",
".",
"SEMANTIC_VERSION_KEY",
"in",
"app",
".",
"properties",
"[",
"self",
".",
"LOCATION_KEY",
"]",
")"
] |
Determines whether or not the on_before_transform_template event can process this application
:param dict app: the application and its properties
|
[
"Determines",
"whether",
"or",
"not",
"the",
"on_before_transform_template",
"event",
"can",
"process",
"this",
"application"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/application/serverless_app_plugin.py#L126-L135
|
train
|
Determines whether or not the on_before_transform_template event can process this application.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,Wa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RfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b111101 + 0o62) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(0b110100) + chr(48), 17328 - 17320), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(887 - 838) + chr(1311 - 1261), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b110011) + chr(1194 - 1140), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011001 + 0o26) + chr(0b110001 + 0o0) + '\x30' + chr(51), 45202 - 45194), ehT0Px3KOsy9(chr(416 - 368) + '\x6f' + chr(0b1100 + 0o46) + '\067' + chr(0b11111 + 0o25), 16545 - 16537), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1100101 + 0o12) + '\x33' + '\x36' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b110110 + 0o71) + chr(0b110001) + chr(0b110011) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b10100 + 0o133) + '\x33' + chr(0b110110) + '\060', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(1096 - 1046) + '\x31' + chr(0b1100 + 0o46), 8), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + '\x33' + '\x37' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9265 - 9154) + chr(1560 - 1510) + chr(52) + '\066', 0b1000), ehT0Px3KOsy9(chr(1105 - 1057) + '\157' + chr(0b110110) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(5453 - 5342) + '\x33' + '\x36' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\x6f' + chr(49) + chr(0b1100 + 0o52) + chr(0b11111 + 0o21), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(1892 - 1843) + chr(0b110010) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(1716 - 1663) + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101001 + 0o12) + chr(0b11 + 0o57) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\x6f' + '\x31' + chr(0b110000), 31965 - 31957), ehT0Px3KOsy9('\060' + chr(4580 - 4469) + chr(0b110001) + chr(0b110000) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + chr(0b110010) + chr(51) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(1451 - 1400) + '\067' + chr(2722 - 2669), 0b1000), ehT0Px3KOsy9(chr(101 - 53) + chr(0b1000100 + 0o53) + chr(50) + chr(0b101010 + 0o13) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(1777 - 1729) + chr(111) + chr(0b1000 + 0o52) + chr(2435 - 2380) + chr(306 - 257), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(604 - 493) + chr(1086 - 1037) + chr(0b110110) + chr(0b11111 + 0o21), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100110 + 0o14) + chr(2154 - 2102), 30613 - 30605), ehT0Px3KOsy9('\060' + '\157' + chr(0b10100 + 0o35) + '\x37' + chr(1291 - 1237), 45658 - 45650), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1362 - 1308) + chr(0b101100 + 0o7), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b110110) + '\x37', 24878 - 24870), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11000 + 0o32) + chr(0b110001) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\x6f' + '\061' + chr(1999 - 1947), ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + chr(50) + chr(48) + '\x34', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(0b110101) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\x6f' + chr(0b101110 + 0o3) + chr(55) + chr(1510 - 1458), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(0b0 + 0o63) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(670 - 621) + '\064' + chr(1958 - 1906), 0o10), ehT0Px3KOsy9(chr(658 - 610) + '\157' + chr(0b1000 + 0o52) + '\061' + chr(0b101010 + 0o13), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + chr(0b110001) + chr(0b1 + 0o64) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(10669 - 10558) + chr(50) + chr(0b110011) + chr(0b1110 + 0o44), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b111000 + 0o67) + chr(0b101100 + 0o5) + '\066', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(93 - 40) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'-'), chr(0b1100100) + '\x65' + '\143' + '\157' + '\144' + chr(10056 - 9955))(chr(0b1110101) + chr(116) + chr(3285 - 3183) + chr(0b1010 + 0o43) + chr(320 - 264)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def F3uUA4gIJHt3(oVre8I6UXc3b, J8d5LengsZGV):
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'O/\xc9\x9f\x17\xf5\xbe\x17\xaf\xc1\xbf\xff'), '\x64' + chr(0b1100101) + chr(99) + '\157' + '\x64' + chr(101))('\165' + '\164' + chr(4410 - 4308) + '\055' + '\x38')) in xafqLlk3kkUe(J8d5LengsZGV, xafqLlk3kkUe(SXOLrMavuUCe(b'lT\xc7\xa8{\x8e\x82\x15\x9d\xc5\xaa\x9e'), chr(100) + chr(0b1100101) + '\x63' + chr(0b110110 + 0o71) + chr(0b1010111 + 0o15) + '\145')(chr(0b1110101) + chr(0b0 + 0o164) + chr(0b100100 + 0o102) + chr(0b101101) + chr(56))) and PlSM16l2KDPD(xafqLlk3kkUe(J8d5LengsZGV, xafqLlk3kkUe(SXOLrMavuUCe(b'lT\xc7\xa8{\x8e\x82\x15\x9d\xc5\xaa\x9e'), '\144' + '\x65' + chr(0b1100011) + '\x6f' + chr(100) + chr(101))(chr(0b10000 + 0o145) + chr(116) + chr(0b1100110) + chr(1403 - 1358) + chr(850 - 794)))[xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'O/\xc9\x9f\x17\xf5\xbe\x17\xaf\xc1\xbf\xff'), '\144' + chr(2512 - 2411) + chr(0b110011 + 0o60) + '\157' + chr(9367 - 9267) + chr(0b1100101))('\x75' + chr(0b1110100) + '\146' + '\055' + chr(0b1000 + 0o60)))], wLqBDw8l0eIm) and (xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'B0\xda\x92\n\xff\xb0\r\xb9\xc5\xb4\xf9\x7f\xb7/\x1fj\x8e'), '\144' + chr(0b101010 + 0o73) + chr(99) + chr(3500 - 3389) + chr(0b111111 + 0o45) + chr(1160 - 1059))(chr(0b1010000 + 0o45) + chr(116) + chr(0b1100110) + chr(1776 - 1731) + chr(0b110001 + 0o7))) in xafqLlk3kkUe(J8d5LengsZGV, xafqLlk3kkUe(SXOLrMavuUCe(b'lT\xc7\xa8{\x8e\x82\x15\x9d\xc5\xaa\x9e'), '\144' + chr(600 - 499) + '\143' + '\x6f' + '\144' + '\x65')('\x75' + '\x74' + chr(102) + chr(45) + chr(0b111000)))[xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'O/\xc9\x9f\x17\xf5\xbe\x17\xaf\xc1\xbf\xff'), '\x64' + chr(101) + chr(0b111101 + 0o46) + '\x6f' + chr(6092 - 5992) + chr(2194 - 2093))(chr(0b10001 + 0o144) + chr(9969 - 9853) + chr(9269 - 9167) + chr(0b1111 + 0o36) + chr(56)))]) and (xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'P%\xc7\x9f\r\xe8\xb8\x1a\xaf\xdc\xbf\xf4e\xba?\x1ap\x9cM\x19'), '\144' + '\x65' + chr(8585 - 8486) + chr(8376 - 8265) + chr(100) + chr(0b1001010 + 0o33))('\x75' + '\164' + chr(102) + chr(0b101101) + chr(56))) in xafqLlk3kkUe(J8d5LengsZGV, xafqLlk3kkUe(SXOLrMavuUCe(b'lT\xc7\xa8{\x8e\x82\x15\x9d\xc5\xaa\x9e'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(2922 - 2811) + chr(100) + '\145')(chr(6953 - 6836) + chr(0b1000 + 0o154) + chr(0b1100110) + chr(0b101101) + '\070'))[xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'O/\xc9\x9f\x17\xf5\xbe\x17\xaf\xc1\xbf\xff'), '\x64' + chr(7961 - 7860) + chr(0b1100011) + '\157' + chr(0b1100010 + 0o2) + chr(101))('\165' + chr(0b10011 + 0o141) + chr(0b1100110) + chr(819 - 774) + chr(56)))])
|
awslabs/serverless-application-model
|
samtranslator/plugins/application/serverless_app_plugin.py
|
ServerlessAppPlugin._handle_create_cfn_template_request
|
def _handle_create_cfn_template_request(self, app_id, semver, key, logical_id):
"""
Method that handles the create_cloud_formation_template API call to the serverless application repo
:param string app_id: ApplicationId
:param string semver: SemanticVersion
:param string key: The dictionary key consisting of (ApplicationId, SemanticVersion)
:param string logical_id: the logical_id of this application resource
"""
create_cfn_template = (lambda app_id, semver: self._sar_client.create_cloud_formation_template(
ApplicationId=self._sanitize_sar_str_param(app_id),
SemanticVersion=self._sanitize_sar_str_param(semver)
))
response = self._sar_service_call(create_cfn_template, logical_id, app_id, semver)
self._applications[key] = response[self.TEMPLATE_URL_KEY]
if response['Status'] != "ACTIVE":
self._in_progress_templates.append((response[self.APPLICATION_ID_KEY], response['TemplateId']))
|
python
|
def _handle_create_cfn_template_request(self, app_id, semver, key, logical_id):
"""
Method that handles the create_cloud_formation_template API call to the serverless application repo
:param string app_id: ApplicationId
:param string semver: SemanticVersion
:param string key: The dictionary key consisting of (ApplicationId, SemanticVersion)
:param string logical_id: the logical_id of this application resource
"""
create_cfn_template = (lambda app_id, semver: self._sar_client.create_cloud_formation_template(
ApplicationId=self._sanitize_sar_str_param(app_id),
SemanticVersion=self._sanitize_sar_str_param(semver)
))
response = self._sar_service_call(create_cfn_template, logical_id, app_id, semver)
self._applications[key] = response[self.TEMPLATE_URL_KEY]
if response['Status'] != "ACTIVE":
self._in_progress_templates.append((response[self.APPLICATION_ID_KEY], response['TemplateId']))
|
[
"def",
"_handle_create_cfn_template_request",
"(",
"self",
",",
"app_id",
",",
"semver",
",",
"key",
",",
"logical_id",
")",
":",
"create_cfn_template",
"=",
"(",
"lambda",
"app_id",
",",
"semver",
":",
"self",
".",
"_sar_client",
".",
"create_cloud_formation_template",
"(",
"ApplicationId",
"=",
"self",
".",
"_sanitize_sar_str_param",
"(",
"app_id",
")",
",",
"SemanticVersion",
"=",
"self",
".",
"_sanitize_sar_str_param",
"(",
"semver",
")",
")",
")",
"response",
"=",
"self",
".",
"_sar_service_call",
"(",
"create_cfn_template",
",",
"logical_id",
",",
"app_id",
",",
"semver",
")",
"self",
".",
"_applications",
"[",
"key",
"]",
"=",
"response",
"[",
"self",
".",
"TEMPLATE_URL_KEY",
"]",
"if",
"response",
"[",
"'Status'",
"]",
"!=",
"\"ACTIVE\"",
":",
"self",
".",
"_in_progress_templates",
".",
"append",
"(",
"(",
"response",
"[",
"self",
".",
"APPLICATION_ID_KEY",
"]",
",",
"response",
"[",
"'TemplateId'",
"]",
")",
")"
] |
Method that handles the create_cloud_formation_template API call to the serverless application repo
:param string app_id: ApplicationId
:param string semver: SemanticVersion
:param string key: The dictionary key consisting of (ApplicationId, SemanticVersion)
:param string logical_id: the logical_id of this application resource
|
[
"Method",
"that",
"handles",
"the",
"create_cloud_formation_template",
"API",
"call",
"to",
"the",
"serverless",
"application",
"repo"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/application/serverless_app_plugin.py#L161-L177
|
train
|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wAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1808 - 1759) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(2528 - 2473) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(730 - 680) + '\066' + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(992 - 881) + chr(50) + '\x30' + chr(0b101111 + 0o4), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(9976 - 9865) + chr(0b110001) + '\x33' + chr(48), 20650 - 20642), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(711 - 663) + chr(54), 0b1000), ehT0Px3KOsy9(chr(1820 - 1772) + chr(1716 - 1605) + chr(0b110101) + chr(0b110101), 5034 - 5026), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(958 - 907) + chr(1067 - 1019) + chr(53), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + '\064' + '\061', 38617 - 38609), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + '\x30' + chr(1604 - 1554), 46039 - 46031), ehT0Px3KOsy9(chr(1847 - 1799) + chr(0b1101111) + '\x32' + '\x32' + chr(0b110001), 55518 - 55510), ehT0Px3KOsy9('\x30' + '\157' + chr(0b11010 + 0o32) + chr(0b10011 + 0o40), ord("\x08")), ehT0Px3KOsy9(chr(1727 - 1679) + '\x6f' + '\x31' + chr(1886 - 1837) + chr(2056 - 2003), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(2005 - 1894) + '\063' + '\063' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b111101 + 0o62) + chr(51) + '\067' + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(1809 - 1759) + chr(529 - 481) + chr(51), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\062' + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101000 + 0o7) + chr(0b1 + 0o61) + '\x32' + chr(2384 - 2335), 8), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1000011 + 0o54) + '\x33' + chr(1180 - 1129) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b11100 + 0o123) + '\063' + '\060' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(1051 - 1003) + '\157' + '\063' + '\061' + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b110011) + chr(0b100011 + 0o24), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010000 + 0o37) + '\x31' + chr(2660 - 2606) + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(0b110111) + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(7826 - 7715) + '\063' + '\062' + chr(1549 - 1497), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b110110 + 0o71) + chr(0b110011) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + '\060' + chr(0b100 + 0o63), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b0 + 0o61) + chr(1555 - 1501) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + chr(11580 - 11469) + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1001101 + 0o42) + chr(471 - 421) + chr(0b110000) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1101111) + chr(0b110010) + chr(0b110010) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2230 - 2181) + chr(0b110011) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(111) + chr(0b110101) + chr(189 - 140), 37799 - 37791), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + chr(0b11101 + 0o31), 60856 - 60848), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2008 - 1957) + chr(1358 - 1310) + chr(0b10010 + 0o43), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + chr(204 - 151) + '\x32', 44084 - 44076), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11100 + 0o32), 0o10), ehT0Px3KOsy9(chr(1504 - 1456) + chr(111) + chr(0b110011) + '\x37' + chr(0b110011 + 0o1), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(2061 - 2013) + '\x6f' + chr(327 - 274) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'%'), '\144' + chr(0b1100101) + chr(4444 - 4345) + chr(7739 - 7628) + '\144' + chr(0b1001110 + 0o27))(chr(0b1110101) + chr(0b1011010 + 0o32) + '\146' + chr(0b101101) + chr(0b101100 + 0o14)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def kF2K_aQVSqPX(oVre8I6UXc3b, QR5BSXpbet6P, PrrpAglVqsQG, K3J4ZwSlE0sT, NpZr66MdBhVG):
tIwu8ClLCn3V = lambda QR5BSXpbet6P, PrrpAglVqsQG: oVre8I6UXc3b._sar_client.create_cloud_formation_template(ApplicationId=oVre8I6UXc3b._sanitize_sar_str_param(QR5BSXpbet6P), SemanticVersion=oVre8I6UXc3b._sanitize_sar_str_param(PrrpAglVqsQG))
ekFGDFIe9V8v = oVre8I6UXc3b._sar_service_call(tIwu8ClLCn3V, NpZr66MdBhVG, QR5BSXpbet6P, PrrpAglVqsQG)
oVre8I6UXc3b.kDNaz3VrFX6E[K3J4ZwSlE0sT] = ekFGDFIe9V8v[oVre8I6UXc3b.TEMPLATE_URL_KEY]
if ekFGDFIe9V8v[xafqLlk3kkUe(SXOLrMavuUCe(b'X\xcf\xd4\xf7u+'), '\144' + chr(4738 - 4637) + chr(99) + chr(0b1101111) + chr(0b111 + 0o135) + chr(4786 - 4685))('\165' + chr(12302 - 12186) + chr(0b1100110) + '\x2d' + chr(0b101000 + 0o20))] != xafqLlk3kkUe(SXOLrMavuUCe(b'J\xf8\xe1\xcaV\x1d'), chr(100) + '\145' + chr(0b1000000 + 0o43) + '\157' + '\x64' + '\145')(chr(0b1110101) + '\x74' + chr(0b110100 + 0o62) + chr(0b11110 + 0o17) + '\x38'):
xafqLlk3kkUe(oVre8I6UXc3b._in_progress_templates, xafqLlk3kkUe(SXOLrMavuUCe(b'j\xcb\xc5\xe6n<'), chr(1182 - 1082) + '\145' + '\x63' + chr(0b1000110 + 0o51) + '\x64' + chr(101))(chr(117) + chr(0b1110100) + chr(8317 - 8215) + '\055' + chr(656 - 600)))((ekFGDFIe9V8v[xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'J\xeb\xe5\xcfI\x1b\xc7y\x8c.\x8c\xcej\t\x81\xb6B\xda'), chr(0b101110 + 0o66) + chr(4906 - 4805) + chr(0b1000101 + 0o36) + chr(111) + '\x64' + '\145')('\x75' + '\164' + chr(0b1100110) + '\055' + chr(0b111 + 0o61)))], ekFGDFIe9V8v[xafqLlk3kkUe(SXOLrMavuUCe(b'_\xde\xd8\xf3l9\xf2H\x8c\x05'), '\x64' + chr(101) + '\143' + '\157' + chr(0b10 + 0o142) + '\145')(chr(0b1110101) + chr(2530 - 2414) + '\146' + '\x2d' + '\070')]))
|
awslabs/serverless-application-model
|
samtranslator/plugins/application/serverless_app_plugin.py
|
ServerlessAppPlugin.on_before_transform_resource
|
def on_before_transform_resource(self, logical_id, resource_type, resource_properties):
"""
Hook method that gets called before "each" SAM resource gets processed
Replaces the ApplicationId and Semantic Version pairs with a TemplateUrl.
:param string logical_id: Logical ID of the resource being processed
:param string resource_type: Type of the resource being processed
:param dict resource_properties: Properties of the resource
:return: Nothing
"""
if not self._resource_is_supported(resource_type):
return
# Sanitize properties
self._check_for_dictionary_key(logical_id, resource_properties, [self.LOCATION_KEY])
# If location isn't a dictionary, don't modify the resource.
if not isinstance(resource_properties[self.LOCATION_KEY], dict):
resource_properties[self.TEMPLATE_URL_KEY] = resource_properties[self.LOCATION_KEY]
return
# If it is a dictionary, check for other required parameters
self._check_for_dictionary_key(logical_id, resource_properties[self.LOCATION_KEY],
[self.APPLICATION_ID_KEY, self.SEMANTIC_VERSION_KEY])
app_id = resource_properties[self.LOCATION_KEY].get(self.APPLICATION_ID_KEY)
if not app_id:
raise InvalidResourceException(logical_id, "Property 'ApplicationId' cannot be blank.")
if isinstance(app_id, dict):
raise InvalidResourceException(logical_id, "Property 'ApplicationId' cannot be resolved. Only FindInMap "
"and Ref intrinsic functions are supported.")
semver = resource_properties[self.LOCATION_KEY].get(self.SEMANTIC_VERSION_KEY)
if not semver:
raise InvalidResourceException(logical_id, "Property 'SemanticVersion' cannot be blank.")
if isinstance(semver, dict):
raise InvalidResourceException(logical_id, "Property 'SemanticVersion' cannot be resolved. Only FindInMap "
"and Ref intrinsic functions are supported.")
key = (app_id, semver)
# Throw any resource exceptions saved from the before_transform_template event
if isinstance(self._applications[key], InvalidResourceException):
raise self._applications[key]
# validation does not resolve an actual template url
if not self._validate_only:
resource_properties[self.TEMPLATE_URL_KEY] = self._applications[key]
|
python
|
def on_before_transform_resource(self, logical_id, resource_type, resource_properties):
"""
Hook method that gets called before "each" SAM resource gets processed
Replaces the ApplicationId and Semantic Version pairs with a TemplateUrl.
:param string logical_id: Logical ID of the resource being processed
:param string resource_type: Type of the resource being processed
:param dict resource_properties: Properties of the resource
:return: Nothing
"""
if not self._resource_is_supported(resource_type):
return
# Sanitize properties
self._check_for_dictionary_key(logical_id, resource_properties, [self.LOCATION_KEY])
# If location isn't a dictionary, don't modify the resource.
if not isinstance(resource_properties[self.LOCATION_KEY], dict):
resource_properties[self.TEMPLATE_URL_KEY] = resource_properties[self.LOCATION_KEY]
return
# If it is a dictionary, check for other required parameters
self._check_for_dictionary_key(logical_id, resource_properties[self.LOCATION_KEY],
[self.APPLICATION_ID_KEY, self.SEMANTIC_VERSION_KEY])
app_id = resource_properties[self.LOCATION_KEY].get(self.APPLICATION_ID_KEY)
if not app_id:
raise InvalidResourceException(logical_id, "Property 'ApplicationId' cannot be blank.")
if isinstance(app_id, dict):
raise InvalidResourceException(logical_id, "Property 'ApplicationId' cannot be resolved. Only FindInMap "
"and Ref intrinsic functions are supported.")
semver = resource_properties[self.LOCATION_KEY].get(self.SEMANTIC_VERSION_KEY)
if not semver:
raise InvalidResourceException(logical_id, "Property 'SemanticVersion' cannot be blank.")
if isinstance(semver, dict):
raise InvalidResourceException(logical_id, "Property 'SemanticVersion' cannot be resolved. Only FindInMap "
"and Ref intrinsic functions are supported.")
key = (app_id, semver)
# Throw any resource exceptions saved from the before_transform_template event
if isinstance(self._applications[key], InvalidResourceException):
raise self._applications[key]
# validation does not resolve an actual template url
if not self._validate_only:
resource_properties[self.TEMPLATE_URL_KEY] = self._applications[key]
|
[
"def",
"on_before_transform_resource",
"(",
"self",
",",
"logical_id",
",",
"resource_type",
",",
"resource_properties",
")",
":",
"if",
"not",
"self",
".",
"_resource_is_supported",
"(",
"resource_type",
")",
":",
"return",
"# Sanitize properties",
"self",
".",
"_check_for_dictionary_key",
"(",
"logical_id",
",",
"resource_properties",
",",
"[",
"self",
".",
"LOCATION_KEY",
"]",
")",
"# If location isn't a dictionary, don't modify the resource.",
"if",
"not",
"isinstance",
"(",
"resource_properties",
"[",
"self",
".",
"LOCATION_KEY",
"]",
",",
"dict",
")",
":",
"resource_properties",
"[",
"self",
".",
"TEMPLATE_URL_KEY",
"]",
"=",
"resource_properties",
"[",
"self",
".",
"LOCATION_KEY",
"]",
"return",
"# If it is a dictionary, check for other required parameters",
"self",
".",
"_check_for_dictionary_key",
"(",
"logical_id",
",",
"resource_properties",
"[",
"self",
".",
"LOCATION_KEY",
"]",
",",
"[",
"self",
".",
"APPLICATION_ID_KEY",
",",
"self",
".",
"SEMANTIC_VERSION_KEY",
"]",
")",
"app_id",
"=",
"resource_properties",
"[",
"self",
".",
"LOCATION_KEY",
"]",
".",
"get",
"(",
"self",
".",
"APPLICATION_ID_KEY",
")",
"if",
"not",
"app_id",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"\"Property 'ApplicationId' cannot be blank.\"",
")",
"if",
"isinstance",
"(",
"app_id",
",",
"dict",
")",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"\"Property 'ApplicationId' cannot be resolved. Only FindInMap \"",
"\"and Ref intrinsic functions are supported.\"",
")",
"semver",
"=",
"resource_properties",
"[",
"self",
".",
"LOCATION_KEY",
"]",
".",
"get",
"(",
"self",
".",
"SEMANTIC_VERSION_KEY",
")",
"if",
"not",
"semver",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"\"Property 'SemanticVersion' cannot be blank.\"",
")",
"if",
"isinstance",
"(",
"semver",
",",
"dict",
")",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"\"Property 'SemanticVersion' cannot be resolved. Only FindInMap \"",
"\"and Ref intrinsic functions are supported.\"",
")",
"key",
"=",
"(",
"app_id",
",",
"semver",
")",
"# Throw any resource exceptions saved from the before_transform_template event",
"if",
"isinstance",
"(",
"self",
".",
"_applications",
"[",
"key",
"]",
",",
"InvalidResourceException",
")",
":",
"raise",
"self",
".",
"_applications",
"[",
"key",
"]",
"# validation does not resolve an actual template url",
"if",
"not",
"self",
".",
"_validate_only",
":",
"resource_properties",
"[",
"self",
".",
"TEMPLATE_URL_KEY",
"]",
"=",
"self",
".",
"_applications",
"[",
"key",
"]"
] |
Hook method that gets called before "each" SAM resource gets processed
Replaces the ApplicationId and Semantic Version pairs with a TemplateUrl.
:param string logical_id: Logical ID of the resource being processed
:param string resource_type: Type of the resource being processed
:param dict resource_properties: Properties of the resource
:return: Nothing
|
[
"Hook",
"method",
"that",
"gets",
"called",
"before",
"each",
"SAM",
"resource",
"gets",
"processed"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/application/serverless_app_plugin.py#L194-L247
|
train
|
Hook method that gets called before each SAM resource gets processed
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAz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dDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(821 - 773) + '\x6f' + chr(49) + chr(0b110000) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(265 - 214) + chr(0b110010) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(1109 - 1059) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\061', 36112 - 36104), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(49) + chr(49), 17879 - 17871), ehT0Px3KOsy9(chr(1049 - 1001) + chr(8380 - 8269) + chr(0b100101 + 0o14) + '\x33' + '\067', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2135 - 2084), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(1027 - 916) + chr(0b100 + 0o55) + chr(1928 - 1877) + chr(1949 - 1899), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b110110) + chr(0b110100), 23122 - 23114), ehT0Px3KOsy9(chr(48) + chr(2500 - 2389) + '\x32' + chr(1381 - 1329) + chr(53), 47621 - 47613), ehT0Px3KOsy9(chr(0b110000) + chr(0b111100 + 0o63) + chr(462 - 411) + chr(0b101000 + 0o11), 62302 - 62294), ehT0Px3KOsy9('\x30' + chr(111) + chr(219 - 168) + '\x35' + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101010 + 0o105) + chr(0b10110 + 0o33) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\065' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\x36' + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10000 + 0o41) + chr(0b100110 + 0o14) + '\065', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b11100 + 0o26) + chr(0b11110 + 0o27) + chr(1570 - 1522), 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\157' + chr(0b100 + 0o57) + chr(0b110101) + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + chr(4179 - 4068) + chr(51) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10101 + 0o34) + '\063' + '\x37', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101011 + 0o4) + chr(0b110010) + '\x33' + '\066', 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(348 - 294) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + chr(1629 - 1579) + '\x34' + chr(0b10 + 0o60), 59917 - 59909), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(55) + chr(2027 - 1972), 0o10), ehT0Px3KOsy9(chr(447 - 399) + chr(899 - 788) + chr(50) + chr(1354 - 1301) + chr(2719 - 2665), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(48) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(0b110101) + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\x37' + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101010 + 0o10) + chr(0b110010) + chr(986 - 932), 20347 - 20339), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10111 + 0o32) + chr(0b101011 + 0o13) + chr(345 - 290), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1101 + 0o52) + '\062', 29388 - 29380), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101111) + '\063' + '\061' + chr(0b10011 + 0o40), 49192 - 49184), ehT0Px3KOsy9(chr(0b110000) + chr(0b10111 + 0o130) + '\065', 0o10), ehT0Px3KOsy9(chr(1321 - 1273) + chr(111) + '\x32' + chr(0b110001) + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1011100 + 0o23) + '\061' + chr(569 - 516) + chr(49), 26973 - 26965), ehT0Px3KOsy9(chr(1636 - 1588) + '\157' + chr(0b110011 + 0o0) + '\063', 23461 - 23453), ehT0Px3KOsy9(chr(981 - 933) + chr(9064 - 8953) + '\x33' + '\061', 8), ehT0Px3KOsy9(chr(1342 - 1294) + '\157' + chr(0b10001 + 0o42) + '\064' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(229 - 181) + chr(0b1001110 + 0o41) + '\061' + chr(51) + chr(0b110111), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + '\065' + chr(2269 - 2221), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'k'), chr(0b1000011 + 0o41) + '\x65' + chr(7418 - 7319) + chr(111) + '\144' + chr(4180 - 4079))(chr(117) + chr(0b10111 + 0o135) + chr(0b1010101 + 0o21) + '\x2d' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def SvZckcG871D3(oVre8I6UXc3b, NpZr66MdBhVG, wObOWxcCoSC5, QgHO_KwjD4NI):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a\xa1\xb2b&*q9\x11\xfap\x9dW[\x86%\xd8\x80l+\xfbT'), '\x64' + chr(4681 - 4580) + '\x63' + chr(0b110101 + 0o72) + '\x64' + '\x65')(chr(0b11010 + 0o133) + chr(0b1101001 + 0o13) + chr(2066 - 1964) + chr(0b10110 + 0o27) + chr(1394 - 1338)))(wObOWxcCoSC5):
return
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a\xb0\xbft*4\\<\x1b\xd7F\x8aaK\x87<\xc7\x81\x7f-\xe7o\xc9Z\xd7'), '\144' + chr(5057 - 4956) + chr(99) + '\x6f' + chr(0b1100100) + '\145')(chr(1294 - 1177) + chr(3679 - 3563) + chr(5042 - 4940) + chr(1673 - 1628) + chr(0b1100 + 0o54)))(NpZr66MdBhVG, QgHO_KwjD4NI, [xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x9c\x94P\x1d\x16L\x14+\xee\\\xb7'), '\144' + chr(0b1000111 + 0o36) + chr(3263 - 3164) + chr(111) + chr(100) + '\145')(chr(0b1110101) + chr(0b110101 + 0o77) + chr(0b1001001 + 0o35) + '\x2d' + chr(56)))])
if not PlSM16l2KDPD(QgHO_KwjD4NI[xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x9c\x94P\x1d\x16L\x14+\xee\\\xb7'), chr(0b1100100) + chr(10015 - 9914) + chr(0b1100011) + chr(0b1000001 + 0o56) + '\144' + '\x65')(chr(0b10 + 0o163) + '\164' + chr(0b1001111 + 0o27) + '\055' + chr(0b11100 + 0o34)))], wLqBDw8l0eIm):
QgHO_KwjD4NI[oVre8I6UXc3b.qtZYsWNaRcUd] = QgHO_KwjD4NI[oVre8I6UXc3b.LOCATION_KEY]
return
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a\xb0\xbft*4\\<\x1b\xd7F\x8aaK\x87<\xc7\x81\x7f-\xe7o\xc9Z\xd7'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(6260 - 6149) + '\144' + chr(3308 - 3207))(chr(0b100010 + 0o123) + chr(5894 - 5778) + chr(102) + chr(1252 - 1207) + chr(930 - 874)))(NpZr66MdBhVG, QgHO_KwjD4NI[xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\x9c\x94P\x1d\x16L\x14+\xee\\\xb7'), chr(0b1100000 + 0o4) + chr(0b1010 + 0o133) + '\x63' + chr(111) + '\x64' + chr(101))(chr(4387 - 4270) + chr(0b11 + 0o161) + '\146' + chr(0b100000 + 0o15) + '\x38'))], [xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\x83\x87]\x00\x1cB\x0e=\xeaW\xb1Al\xac\x1e\xed\xb6'), '\144' + '\145' + chr(0b1100011) + chr(111) + chr(0b1010011 + 0o21) + chr(0b1100101))(chr(8623 - 8506) + chr(10513 - 10397) + '\146' + chr(0b101 + 0o50) + chr(0b110000 + 0o10))), xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16\x96\x9aP\x07\x0bJ\x19+\xf3\\\xbc[a\xbc\x1b\xf7\xa4[\x06'), chr(0b1100100) + chr(0b1100101 + 0o0) + chr(99) + chr(0b11 + 0o154) + '\144' + '\145')(chr(117) + '\x74' + chr(0b1001110 + 0o30) + chr(0b101101 + 0o0) + '\x38'))])
QR5BSXpbet6P = QgHO_KwjD4NI[oVre8I6UXc3b.LOCATION_KEY].get(oVre8I6UXc3b.APPLICATION_ID_KEY)
if not QR5BSXpbet6P:
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(SXOLrMavuUCe(b"\x15\xa1\xb8a,-w#T\x82X\x9exD\x9a6\xc9\x9bw0\xf0y\xc6\x18\x8ei'\xc7\x94\xf9\x03\x1a\xa9`\xad\x0bwx\x884k"), chr(0b1100100) + '\145' + chr(0b1100011) + chr(0b101 + 0o152) + chr(100) + chr(6868 - 6767))(chr(0b1110101) + chr(0b1101111 + 0o5) + chr(0b1100110) + chr(45) + '\x38'))
if PlSM16l2KDPD(QR5BSXpbet6P, wLqBDw8l0eIm):
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(SXOLrMavuUCe(b"\x15\xa1\xb8a,-w#T\x82X\x9exD\x9a6\xc9\x9bw0\xf0y\xc6\x18\x8ei'\xc7\x94\xf9\x03\x1a\xa9`\xad\x1b~j\x8933\xb6\xb3?i\x10m6\r\x85_\x87fL\xba;\xe5\x8en\x7f\xff^\xc6\x1f\xfco \x89\x93\xf8\x03H\xa2k\xfe\x00x9\x80*+\xb0\xa3x&1pz\x15\xd7|\xce{]\x83%\xc7\x9dj:\xfa\x1e"), '\x64' + '\145' + '\143' + '\157' + chr(100) + chr(4277 - 4176))('\165' + chr(0b111110 + 0o66) + '\x66' + '\x2d' + chr(904 - 848)))
PrrpAglVqsQG = QgHO_KwjD4NI[oVre8I6UXc3b.LOCATION_KEY].get(oVre8I6UXc3b.SEMANTIC_VERSION_KEY)
if not PrrpAglVqsQG:
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(SXOLrMavuUCe(b'\x15\xa1\xb8a,-w#T\x82J\x8beI\x9d!\xc1\x8cH:\xecC\xcbP\xc0-f\xca\x9b\xf8\x19U\xbf%\xef\x0c;{\x8a>+\xb8\xf9'), '\x64' + chr(101) + chr(0b101 + 0o136) + '\157' + chr(500 - 400) + chr(0b0 + 0o145))(chr(117) + chr(0b100101 + 0o117) + chr(102) + chr(0b101101) + chr(0b111000)))
if PlSM16l2KDPD(PrrpAglVqsQG, wLqBDw8l0eIm):
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(SXOLrMavuUCe(b'\x15\xa1\xb8a,-w#T\x82J\x8beI\x9d!\xc1\x8cH:\xecC\xcbP\xc0-f\xca\x9b\xf8\x19U\xbf%\xef\x0c;k\x83,*\xbf\xa1t-q#\x15\x1a\xc9`\xceNA\x9d1\xe1\x81S>\xee\x10\xc3Q\xca*\x14\xcc\x9c\xb6\x1eT\xbfw\xe4\x07hp\x85\x7f#\xa6\xb9r=6l4\x07\x85x\x9cm\x08\x80 \xd8\x9fq-\xeaU\xc6\x11'), '\x64' + chr(101) + chr(99) + '\157' + '\x64' + chr(0b1011001 + 0o14))(chr(5510 - 5393) + '\164' + chr(102) + '\x2d' + chr(56)))
K3J4ZwSlE0sT = (QR5BSXpbet6P, PrrpAglVqsQG)
if PlSM16l2KDPD(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'.\x97\x99p3lU(2\xfd/\xab'), chr(9057 - 8957) + chr(5506 - 5405) + chr(99) + chr(9684 - 9573) + '\144' + '\x65')('\x75' + '\x74' + '\x66' + chr(0b101101) + chr(0b110011 + 0o5)))[K3J4ZwSlE0sT], ow8Lll3lwq0h):
raise xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'.\x97\x99p3lU(2\xfd/\xab'), chr(0b1100100) + chr(5885 - 5784) + chr(2776 - 2677) + '\x6f' + chr(100) + '\x65')('\165' + chr(116) + chr(0b0 + 0o146) + chr(1490 - 1445) + chr(56)))[K3J4ZwSlE0sT]
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a\xa5\xb6} ;b.\x11\xfav\x80dQ'), chr(0b110100 + 0o60) + chr(8069 - 7968) + chr(4865 - 4766) + '\157' + chr(0b1100100) + chr(9239 - 9138))(chr(0b11101 + 0o130) + chr(751 - 635) + chr(8077 - 7975) + '\x2d' + chr(2513 - 2457))):
QgHO_KwjD4NI[oVre8I6UXc3b.qtZYsWNaRcUd] = oVre8I6UXc3b.kDNaz3VrFX6E[K3J4ZwSlE0sT]
|
awslabs/serverless-application-model
|
samtranslator/plugins/application/serverless_app_plugin.py
|
ServerlessAppPlugin._check_for_dictionary_key
|
def _check_for_dictionary_key(self, logical_id, dictionary, keys):
"""
Checks a dictionary to make sure it has a specific key. If it does not, an
InvalidResourceException is thrown.
:param string logical_id: logical id of this resource
:param dict dictionary: the dictionary to check
:param list keys: list of keys that should exist in the dictionary
"""
for key in keys:
if key not in dictionary:
raise InvalidResourceException(logical_id, 'Resource is missing the required [{}] '
'property.'.format(key))
|
python
|
def _check_for_dictionary_key(self, logical_id, dictionary, keys):
"""
Checks a dictionary to make sure it has a specific key. If it does not, an
InvalidResourceException is thrown.
:param string logical_id: logical id of this resource
:param dict dictionary: the dictionary to check
:param list keys: list of keys that should exist in the dictionary
"""
for key in keys:
if key not in dictionary:
raise InvalidResourceException(logical_id, 'Resource is missing the required [{}] '
'property.'.format(key))
|
[
"def",
"_check_for_dictionary_key",
"(",
"self",
",",
"logical_id",
",",
"dictionary",
",",
"keys",
")",
":",
"for",
"key",
"in",
"keys",
":",
"if",
"key",
"not",
"in",
"dictionary",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"'Resource is missing the required [{}] '",
"'property.'",
".",
"format",
"(",
"key",
")",
")"
] |
Checks a dictionary to make sure it has a specific key. If it does not, an
InvalidResourceException is thrown.
:param string logical_id: logical id of this resource
:param dict dictionary: the dictionary to check
:param list keys: list of keys that should exist in the dictionary
|
[
"Checks",
"a",
"dictionary",
"to",
"make",
"sure",
"it",
"has",
"a",
"specific",
"key",
".",
"If",
"it",
"does",
"not",
"an",
"InvalidResourceException",
"is",
"thrown",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/application/serverless_app_plugin.py#L249-L261
|
train
|
Checks a dictionary to make sure that the key in the keys list is in the keys list. If it does not raise an InvalidResourceException
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5Fy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tyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + '\060' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\x6f' + chr(51) + chr(0b10010 + 0o45) + chr(0b11100 + 0o32), 22752 - 22744), ehT0Px3KOsy9(chr(741 - 693) + chr(6794 - 6683) + chr(0b110111) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(8633 - 8522) + chr(0b10100 + 0o37) + '\066' + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10110 + 0o34) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110110) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b110101 + 0o72) + chr(51) + chr(0b1001 + 0o54) + '\063', 35116 - 35108), ehT0Px3KOsy9(chr(48) + chr(4663 - 4552) + chr(0b110001) + chr(0b110001) + chr(49), 45664 - 45656), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11100 + 0o27) + chr(55) + chr(0b10100 + 0o35), 0o10), ehT0Px3KOsy9('\060' + chr(0b111001 + 0o66) + chr(1760 - 1709) + chr(0b110111) + '\061', 8), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(6131 - 6020) + '\x31' + chr(0b110010) + '\060', 36680 - 36672), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b100 + 0o57) + chr(0b11001 + 0o30), 4173 - 4165), ehT0Px3KOsy9(chr(89 - 41) + chr(0b1101111) + chr(0b101001 + 0o11) + '\x33' + chr(2252 - 2197), 1785 - 1777), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(111) + '\x32' + chr(0b110110) + chr(0b110101), 31133 - 31125), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110101 + 0o0) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(111) + chr(0b110001) + chr(0b110110 + 0o0) + '\x35', 15690 - 15682), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(365 - 314) + chr(0b1 + 0o64) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(1132 - 1084) + chr(0b1000100 + 0o53) + chr(49) + chr(0b10011 + 0o37) + chr(453 - 399), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7869 - 7758) + chr(50) + chr(0b10111 + 0o32) + chr(0b1001 + 0o54), ord("\x08")), ehT0Px3KOsy9(chr(1552 - 1504) + chr(0b1101111) + chr(0b110010) + chr(49) + chr(601 - 551), 48978 - 48970), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + '\x31' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(51) + chr(0b101101 + 0o7) + '\060', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(263 - 212) + '\061', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b1111 + 0o42) + '\065' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(514 - 466) + '\157' + chr(0b110011) + '\x31' + chr(85 - 35), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + '\x35' + chr(397 - 342), 62475 - 62467), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(985 - 874) + chr(508 - 459) + chr(1141 - 1090), 13868 - 13860), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x35' + chr(0b101000 + 0o11), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1329 - 1279) + '\066' + chr(531 - 481), 0o10), ehT0Px3KOsy9(chr(977 - 929) + chr(0b110000 + 0o77) + chr(0b110010) + chr(1418 - 1368) + chr(48), 0b1000), ehT0Px3KOsy9(chr(1917 - 1869) + '\x6f' + chr(2039 - 1989) + chr(0b110011) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(1223 - 1175) + chr(0b1101111) + chr(51) + '\x30' + chr(0b1111 + 0o45), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(2317 - 2265) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(1883 - 1835) + '\157' + chr(0b110011) + chr(0b110111) + chr(49), 8), ehT0Px3KOsy9('\x30' + '\x6f' + '\064' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(10343 - 10232) + '\062' + '\066' + chr(206 - 155), 45681 - 45673), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11 + 0o57) + '\x34' + chr(0b110 + 0o55), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(52) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(0b0 + 0o67) + chr(58 - 8), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + chr(1152 - 1098) + '\x36', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011 + 0o2) + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa'), chr(0b1010100 + 0o20) + chr(101) + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(101))(chr(0b1100100 + 0o21) + chr(0b1100001 + 0o23) + chr(0b10000 + 0o126) + chr(45) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ccZdYjNuS13t(oVre8I6UXc3b, NpZr66MdBhVG, uGRoYQpWwd_a, w8H8C9ec5BO1):
for K3J4ZwSlE0sT in w8H8C9ec5BO1:
if K3J4ZwSlE0sT not in uGRoYQpWwd_a:
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6\x9bK\x9ddC\x88,\xd9\x90#y\xf2\xdcY\x06\x868\xea\xaa>\x88|H\xb8\nz\xdc\xdb\xe2\xf8\xa0\x81\xa2]\xce\xfe\x85\n\x84\xeb\x8e]\x80eH\xc5'), '\144' + chr(0b100100 + 0o101) + '\143' + chr(0b10 + 0o155) + chr(0b11101 + 0o107) + chr(3393 - 3292))(chr(13572 - 13455) + '\x74' + chr(102) + chr(0b10 + 0o53) + chr(2074 - 2018)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2\xcaJ\x9dYP\xb8z\xa9\x8953'), '\144' + chr(0b1100101) + '\x63' + '\x6f' + '\144' + chr(7626 - 7525))(chr(117) + chr(116) + chr(0b1100110) + '\055' + '\x38'))(K3J4ZwSlE0sT))
|
awslabs/serverless-application-model
|
samtranslator/plugins/application/serverless_app_plugin.py
|
ServerlessAppPlugin.on_after_transform_template
|
def on_after_transform_template(self, template):
"""
Hook method that gets called after the template is processed
Go through all the stored applications and make sure they're all ACTIVE.
:param dict template: Dictionary of the SAM template
:return: Nothing
"""
if self._wait_for_template_active_status and not self._validate_only:
start_time = time()
while (time() - start_time) < self.TEMPLATE_WAIT_TIMEOUT_SECONDS:
temp = self._in_progress_templates
self._in_progress_templates = []
# Check each resource to make sure it's active
for application_id, template_id in temp:
get_cfn_template = (lambda application_id, template_id:
self._sar_client.get_cloud_formation_template(
ApplicationId=self._sanitize_sar_str_param(application_id),
TemplateId=self._sanitize_sar_str_param(template_id)))
response = self._sar_service_call(get_cfn_template, application_id, application_id, template_id)
self._handle_get_cfn_template_response(response, application_id, template_id)
# Don't sleep if there are no more templates with PREPARING status
if len(self._in_progress_templates) == 0:
break
# Sleep a little so we don't spam service calls
sleep(self.SLEEP_TIME_SECONDS)
# Not all templates reached active status
if len(self._in_progress_templates) != 0:
application_ids = [items[0] for items in self._in_progress_templates]
raise InvalidResourceException(application_ids, "Timed out waiting for nested stack templates "
"to reach ACTIVE status.")
|
python
|
def on_after_transform_template(self, template):
"""
Hook method that gets called after the template is processed
Go through all the stored applications and make sure they're all ACTIVE.
:param dict template: Dictionary of the SAM template
:return: Nothing
"""
if self._wait_for_template_active_status and not self._validate_only:
start_time = time()
while (time() - start_time) < self.TEMPLATE_WAIT_TIMEOUT_SECONDS:
temp = self._in_progress_templates
self._in_progress_templates = []
# Check each resource to make sure it's active
for application_id, template_id in temp:
get_cfn_template = (lambda application_id, template_id:
self._sar_client.get_cloud_formation_template(
ApplicationId=self._sanitize_sar_str_param(application_id),
TemplateId=self._sanitize_sar_str_param(template_id)))
response = self._sar_service_call(get_cfn_template, application_id, application_id, template_id)
self._handle_get_cfn_template_response(response, application_id, template_id)
# Don't sleep if there are no more templates with PREPARING status
if len(self._in_progress_templates) == 0:
break
# Sleep a little so we don't spam service calls
sleep(self.SLEEP_TIME_SECONDS)
# Not all templates reached active status
if len(self._in_progress_templates) != 0:
application_ids = [items[0] for items in self._in_progress_templates]
raise InvalidResourceException(application_ids, "Timed out waiting for nested stack templates "
"to reach ACTIVE status.")
|
[
"def",
"on_after_transform_template",
"(",
"self",
",",
"template",
")",
":",
"if",
"self",
".",
"_wait_for_template_active_status",
"and",
"not",
"self",
".",
"_validate_only",
":",
"start_time",
"=",
"time",
"(",
")",
"while",
"(",
"time",
"(",
")",
"-",
"start_time",
")",
"<",
"self",
".",
"TEMPLATE_WAIT_TIMEOUT_SECONDS",
":",
"temp",
"=",
"self",
".",
"_in_progress_templates",
"self",
".",
"_in_progress_templates",
"=",
"[",
"]",
"# Check each resource to make sure it's active",
"for",
"application_id",
",",
"template_id",
"in",
"temp",
":",
"get_cfn_template",
"=",
"(",
"lambda",
"application_id",
",",
"template_id",
":",
"self",
".",
"_sar_client",
".",
"get_cloud_formation_template",
"(",
"ApplicationId",
"=",
"self",
".",
"_sanitize_sar_str_param",
"(",
"application_id",
")",
",",
"TemplateId",
"=",
"self",
".",
"_sanitize_sar_str_param",
"(",
"template_id",
")",
")",
")",
"response",
"=",
"self",
".",
"_sar_service_call",
"(",
"get_cfn_template",
",",
"application_id",
",",
"application_id",
",",
"template_id",
")",
"self",
".",
"_handle_get_cfn_template_response",
"(",
"response",
",",
"application_id",
",",
"template_id",
")",
"# Don't sleep if there are no more templates with PREPARING status",
"if",
"len",
"(",
"self",
".",
"_in_progress_templates",
")",
"==",
"0",
":",
"break",
"# Sleep a little so we don't spam service calls",
"sleep",
"(",
"self",
".",
"SLEEP_TIME_SECONDS",
")",
"# Not all templates reached active status",
"if",
"len",
"(",
"self",
".",
"_in_progress_templates",
")",
"!=",
"0",
":",
"application_ids",
"=",
"[",
"items",
"[",
"0",
"]",
"for",
"items",
"in",
"self",
".",
"_in_progress_templates",
"]",
"raise",
"InvalidResourceException",
"(",
"application_ids",
",",
"\"Timed out waiting for nested stack templates \"",
"\"to reach ACTIVE status.\"",
")"
] |
Hook method that gets called after the template is processed
Go through all the stored applications and make sure they're all ACTIVE.
:param dict template: Dictionary of the SAM template
:return: Nothing
|
[
"Hook",
"method",
"that",
"gets",
"called",
"after",
"the",
"template",
"is",
"processed"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/application/serverless_app_plugin.py#L263-L298
|
train
|
This method gets called after the template is processed by the SAR. It is called by the SAR service to check if the template is in the ACTIVE status.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWY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4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1741 - 1693) + chr(0b1101111) + chr(0b11001 + 0o30) + chr(0b110100) + chr(0b111 + 0o53), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011010 + 0o25) + chr(0b101010 + 0o11) + '\x36' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(1056 - 1008) + '\157' + '\x32' + chr(0b100110 + 0o13) + '\x36', 0b1000), ehT0Px3KOsy9(chr(1294 - 1246) + chr(3077 - 2966) + chr(1288 - 1237) + chr(0b110100) + chr(2700 - 2646), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101100 + 0o12) + chr(0b10100 + 0o35), 0o10), ehT0Px3KOsy9('\x30' + chr(3348 - 3237) + chr(0b110001) + '\x34' + '\x31', 29508 - 29500), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\157' + chr(0b100101 + 0o15) + '\060' + chr(1742 - 1693), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\x32' + chr(2639 - 2584), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1684 - 1634) + chr(0b101010 + 0o12) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101 + 0o56) + chr(0b11101 + 0o25) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(0b101111 + 0o2) + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(0b1010101 + 0o32) + '\x33' + chr(51) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100011 + 0o14) + chr(0b110001 + 0o0) + '\066', 0o10), ehT0Px3KOsy9(chr(252 - 204) + chr(9713 - 9602) + chr(0b110011) + chr(48) + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + chr(2480 - 2369) + '\x31' + chr(2534 - 2482) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100100 + 0o13) + chr(50) + '\060' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(4659 - 4548) + chr(2294 - 2243) + chr(48) + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + chr(1771 - 1660) + chr(0b110111) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(0b11100 + 0o27) + chr(0b1110 + 0o46), ord("\x08")), ehT0Px3KOsy9(chr(294 - 246) + '\157' + chr(0b10100 + 0o41) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(0b110011), 24887 - 24879), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(415 - 361) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(1034 - 986) + chr(10674 - 10563) + chr(50) + chr(51) + chr(0b101111 + 0o3), 0b1000), ehT0Px3KOsy9(chr(1359 - 1311) + chr(8493 - 8382) + chr(1568 - 1517) + chr(0b11010 + 0o26) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + chr(0b110010) + '\x35' + chr(0b10100 + 0o40), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(0b110000) + chr(0b110001), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(54) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b10101 + 0o34) + '\061', 8), ehT0Px3KOsy9(chr(1056 - 1008) + chr(0b1101111) + chr(0b110001) + chr(48) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(2026 - 1978) + chr(0b1101111) + '\062' + chr(68 - 13) + chr(373 - 324), 45611 - 45603), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11101 + 0o25) + chr(0b100110 + 0o15) + chr(0b1111 + 0o44), 0b1000), ehT0Px3KOsy9(chr(91 - 43) + chr(111) + '\x33' + chr(91 - 39) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(1762 - 1714) + chr(111) + chr(0b11101 + 0o25) + '\062' + chr(852 - 797), 8), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(0b100011 + 0o21) + '\x36', 8), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101111) + '\x31' + '\x32' + chr(52), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b11101 + 0o24) + chr(2313 - 2260) + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(0b110100) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(10384 - 10273) + '\x31' + chr(0b110011) + chr(0b101001 + 0o12), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(4199 - 4088) + chr(0b10000 + 0o43) + '\x30' + chr(0b100111 + 0o14), 7556 - 7548)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(53) + chr(660 - 612), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'L'), chr(100) + '\145' + '\x63' + chr(6335 - 6224) + '\144' + chr(0b1100101))(chr(0b100111 + 0o116) + chr(116) + '\146' + chr(1955 - 1910) + chr(0b110101 + 0o3)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def b00_NcTrhu_o(oVre8I6UXc3b, jJBnSHEgylNZ):
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'=\x81\xef\x8fE>\xe7\xf8\xd6\x8f\xfd\xbac\xb7\t\xe2\xb4]CJpD\xf3\xb6\xc9\xdeG\xfd$\xcd\xee\x92'), chr(100) + chr(0b1100101) + '\143' + chr(0b1101111) + '\144' + chr(0b1101 + 0o130))(chr(0b11111 + 0o126) + chr(0b1110100) + chr(0b111101 + 0o51) + '\055' + chr(266 - 210))) and (not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'=\x80\xef\x8aX\x05\xe0\xe3\xc1\x8f\xe6\xb1b\xbe'), chr(100) + chr(101) + chr(0b111000 + 0o53) + '\x6f' + chr(0b100 + 0o140) + '\x65')(chr(0b1110101) + chr(0b1010001 + 0o43) + '\146' + '\x2d' + chr(2283 - 2227)))):
tSzPDN5a8DrS = ltvhPP4VhXre()
while ltvhPP4VhXre() - tSzPDN5a8DrS < xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'6\xb3\xc3\xb6} \xd5\xd2\xfb\x87\xc8\x96Z\x981\xca\x8d}S~Go\xc9\x85\xef\xcez\xcd\x16'), '\144' + chr(0b100101 + 0o100) + chr(0b11100 + 0o107) + chr(0b1101111) + chr(0b10100 + 0o120) + chr(0b100100 + 0o101))('\165' + chr(9903 - 9787) + '\x66' + chr(0b101101) + chr(619 - 563))):
zVVasn9fT73C = oVre8I6UXc3b._in_progress_templates
oVre8I6UXc3b.fPhpc78qyGX1 = []
for (pGmpomPY1HXr, ZMuwXcOqVMxJ) in zVVasn9fT73C:
vFIiUuwRglDA = lambda pGmpomPY1HXr, ZMuwXcOqVMxJ: oVre8I6UXc3b._sar_client.get_cloud_formation_template(ApplicationId=oVre8I6UXc3b._sanitize_sar_str_param(pGmpomPY1HXr), TemplateId=oVre8I6UXc3b._sanitize_sar_str_param(ZMuwXcOqVMxJ))
ekFGDFIe9V8v = oVre8I6UXc3b._sar_service_call(vFIiUuwRglDA, pGmpomPY1HXr, pGmpomPY1HXr, ZMuwXcOqVMxJ)
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'=\x9e\xef\x88U\r\xe4\xc8\xc3\xb5\xfd\x80m\xa1\x0b\xdc\xb4]q[\x7fQ\xee\xa5\xf3\xf3Q\xfa5\xd6\xf5\x92\xf2'), '\144' + chr(101) + '\143' + '\157' + chr(100) + chr(3294 - 3193))(chr(117) + '\164' + '\146' + chr(0b101101) + '\x38'))(ekFGDFIe9V8v, pGmpomPY1HXr, ZMuwXcOqVMxJ)
if c2A0yzQpDQB3(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\xa6\xe6\x96RV\xb9\xe6\xdd\x97\xd1\xee'), chr(100) + '\145' + chr(8346 - 8247) + chr(111) + chr(100) + chr(0b110010 + 0o63))(chr(10864 - 10747) + '\x74' + '\x66' + chr(708 - 663) + chr(0b111000)))) == ehT0Px3KOsy9(chr(48) + chr(0b110010 + 0o75) + chr(0b110000), 49793 - 49785):
break
KFP8A3f9JvFY(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'1\xba\xcb\xa3a>\xd5\xde\xe9\x95\xd6\x8cK\x84*\xcd\x84k'), chr(100) + '\145' + chr(0b1100011) + chr(111) + chr(3205 - 3105) + chr(0b1100101))(chr(7476 - 7359) + chr(279 - 163) + chr(0b110101 + 0o61) + chr(1085 - 1040) + '\x38')))
if c2A0yzQpDQB3(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\xa6\xe6\x96RV\xb9\xe6\xdd\x97\xd1\xee'), chr(6128 - 6028) + chr(6525 - 6424) + '\143' + '\157' + chr(2557 - 2457) + chr(0b1100101))(chr(0b1011001 + 0o34) + chr(10402 - 10286) + '\146' + chr(0b101101) + chr(0b0 + 0o70)))) != ehT0Px3KOsy9('\x30' + chr(0b1011001 + 0o26) + chr(48), 8):
TF5zkKccLuOB = [NzveIZ3IlSH9[ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10000 + 0o40), 8)] for NzveIZ3IlSH9 in oVre8I6UXc3b.fPhpc78qyGX1]
raise ow8Lll3lwq0h(TF5zkKccLuOB, xafqLlk3kkUe(SXOLrMavuUCe(b'6\x9f\xe3\x83UA\xee\xe2\xd0\xf0\xfe\xbeg\xb3\x0c\xed\xa7\x18zDa\x10\xf4\xa5\xdf\xf5Q\xede\xca\xef\x80\xf4l\xc6 \x0b\xcc+\xaf\x03\x82\xeb\x95\x11\x15\xee\xb7\xd6\xb5\xe8\xbcf\xe7$\xc0\x94qJn3C\xee\xa1\xd8\xf4G\xa7'), '\144' + chr(0b1100101) + chr(99) + '\x6f' + '\144' + chr(0b111000 + 0o55))('\165' + '\x74' + chr(0b1100110) + chr(45) + '\070'))
|
awslabs/serverless-application-model
|
samtranslator/plugins/application/serverless_app_plugin.py
|
ServerlessAppPlugin._handle_get_cfn_template_response
|
def _handle_get_cfn_template_response(self, response, application_id, template_id):
"""
Handles the response from the SAR service call
:param dict response: the response dictionary from the app repo
:param string application_id: the ApplicationId
:param string template_id: the unique TemplateId for this application
"""
status = response['Status']
if status != "ACTIVE":
# Other options are PREPARING and EXPIRED.
if status == 'EXPIRED':
message = ("Template for {} with id {} returned status: {}. Cannot access an expired "
"template.".format(application_id, template_id, status))
raise InvalidResourceException(application_id, message)
self._in_progress_templates.append((application_id, template_id))
|
python
|
def _handle_get_cfn_template_response(self, response, application_id, template_id):
"""
Handles the response from the SAR service call
:param dict response: the response dictionary from the app repo
:param string application_id: the ApplicationId
:param string template_id: the unique TemplateId for this application
"""
status = response['Status']
if status != "ACTIVE":
# Other options are PREPARING and EXPIRED.
if status == 'EXPIRED':
message = ("Template for {} with id {} returned status: {}. Cannot access an expired "
"template.".format(application_id, template_id, status))
raise InvalidResourceException(application_id, message)
self._in_progress_templates.append((application_id, template_id))
|
[
"def",
"_handle_get_cfn_template_response",
"(",
"self",
",",
"response",
",",
"application_id",
",",
"template_id",
")",
":",
"status",
"=",
"response",
"[",
"'Status'",
"]",
"if",
"status",
"!=",
"\"ACTIVE\"",
":",
"# Other options are PREPARING and EXPIRED.",
"if",
"status",
"==",
"'EXPIRED'",
":",
"message",
"=",
"(",
"\"Template for {} with id {} returned status: {}. Cannot access an expired \"",
"\"template.\"",
".",
"format",
"(",
"application_id",
",",
"template_id",
",",
"status",
")",
")",
"raise",
"InvalidResourceException",
"(",
"application_id",
",",
"message",
")",
"self",
".",
"_in_progress_templates",
".",
"append",
"(",
"(",
"application_id",
",",
"template_id",
")",
")"
] |
Handles the response from the SAR service call
:param dict response: the response dictionary from the app repo
:param string application_id: the ApplicationId
:param string template_id: the unique TemplateId for this application
|
[
"Handles",
"the",
"response",
"from",
"the",
"SAR",
"service",
"call"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/application/serverless_app_plugin.py#L300-L315
|
train
|
Handles the response from the GetCfnTemplate API call.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2B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kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(111) + chr(54) + '\065', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\066' + '\x37', 0b1000), ehT0Px3KOsy9(chr(1215 - 1167) + '\157' + chr(723 - 671) + chr(1781 - 1728), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11101 + 0o122) + '\062' + '\x31' + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1605 - 1555) + chr(0b110011) + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10000 + 0o137) + chr(1356 - 1305) + chr(2182 - 2131) + '\066', 0o10), ehT0Px3KOsy9(chr(1004 - 956) + chr(0b1101111) + chr(49) + chr(0b100110 + 0o13) + chr(1153 - 1099), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4570 - 4459) + chr(49) + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(1487 - 1436) + chr(53) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(111) + chr(0b110001) + '\x31' + '\061', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(0b11100 + 0o27) + chr(624 - 573), 31218 - 31210), ehT0Px3KOsy9('\060' + chr(1276 - 1165) + chr(0b110011) + chr(54) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(0b110001) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(1570 - 1459) + chr(1320 - 1271) + chr(0b110111) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b11000 + 0o127) + chr(820 - 770) + chr(2993 - 2938) + chr(973 - 924), 45783 - 45775), ehT0Px3KOsy9(chr(48) + chr(5936 - 5825) + chr(53) + chr(0b100100 + 0o14), 0o10), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1000111 + 0o50) + chr(0b11011 + 0o27) + chr(898 - 847), 8414 - 8406), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(0b110010) + chr(0b101011 + 0o12), 0o10), ehT0Px3KOsy9(chr(2278 - 2230) + chr(0b1010100 + 0o33) + '\x33' + '\061' + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(2965 - 2854) + chr(0b100100 + 0o16) + '\x35' + chr(0b101 + 0o57), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(53) + chr(55), 0b1000), ehT0Px3KOsy9(chr(371 - 323) + chr(9688 - 9577) + '\063' + '\065' + '\x37', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10110 + 0o35) + '\x33' + chr(1912 - 1862), 63910 - 63902), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + '\061' + chr(50) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(484 - 436) + '\x6f' + chr(0b1101 + 0o52) + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(2480 - 2430) + chr(0b110010 + 0o5), 0o10), ehT0Px3KOsy9('\060' + chr(11022 - 10911) + chr(0b11010 + 0o30) + chr(320 - 272) + chr(50), 17057 - 17049), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(111) + chr(0b100111 + 0o13) + chr(0b110000) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001101 + 0o42) + '\x36' + chr(1968 - 1920), 39003 - 38995), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110111) + chr(54), 2069 - 2061), ehT0Px3KOsy9(chr(867 - 819) + '\157' + chr(0b110001) + '\x33' + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + '\063' + chr(935 - 882), 0o10), ehT0Px3KOsy9(chr(1576 - 1528) + chr(7020 - 6909) + chr(49) + chr(2488 - 2438), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(2620 - 2509) + '\067' + '\x32', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x35' + chr(0b11100 + 0o33), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(49) + chr(0b100110 + 0o16), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(6950 - 6839) + chr(0b110010) + chr(421 - 366) + '\x36', 42020 - 42012), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b11100 + 0o25) + chr(0b101111 + 0o3), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9045 - 8934) + chr(0b1 + 0o62) + '\x32', 13285 - 13277)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1078 - 1025) + chr(2135 - 2087), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x1b'), chr(100) + '\x65' + chr(0b100100 + 0o77) + chr(0b1101101 + 0o2) + '\144' + chr(4166 - 4065))('\x75' + '\164' + '\146' + '\x2d' + chr(0b101101 + 0o13)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def GkXg90U4eYd7(oVre8I6UXc3b, ekFGDFIe9V8v, pGmpomPY1HXr, ZMuwXcOqVMxJ):
vBsMWH4gAEfy = ekFGDFIe9V8v[xafqLlk3kkUe(SXOLrMavuUCe(b'fCD\xfe\xec\xad'), '\x64' + chr(0b110100 + 0o61) + chr(0b1100011) + chr(10246 - 10135) + chr(0b11000 + 0o114) + chr(4077 - 3976))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(1245 - 1200) + chr(56))]
if vBsMWH4gAEfy != xafqLlk3kkUe(SXOLrMavuUCe(b'ttq\xc3\xcf\x9b'), chr(100) + '\x65' + chr(99) + '\x6f' + chr(0b1001110 + 0o26) + chr(5900 - 5799))('\x75' + chr(0b101001 + 0o113) + chr(102) + chr(99 - 54) + chr(56)):
if vBsMWH4gAEfy == xafqLlk3kkUe(SXOLrMavuUCe(b'pou\xc3\xcb\x9b\n'), '\x64' + '\x65' + chr(0b101010 + 0o71) + chr(0b10101 + 0o132) + '\x64' + chr(101))(chr(117) + chr(0b1110100) + chr(1648 - 1546) + chr(0b101101) + chr(0b111000)):
R2mbIkZzeu1B = xafqLlk3kkUe(SXOLrMavuUCe(b'aRH\xfa\xf5\xbf:n\xc9/4\x85\xee\x04\xc4\x08d\xbc\xbf\xc4O\x86\xbep@*\xa2\xf7UJ(\xafd_K6?\xca+n@D\x1f\xaa\xe2\xa3`+\xaa(5\x99\xa1\x0b\x99Ip\xb6\xae\xdf\x1c\xcf\xbb>\x1b2\xfa\xf5YL8\xb9*NJ{<\xd2+nP\x19'), chr(9410 - 9310) + chr(7836 - 7735) + '\x63' + chr(0b10001 + 0o136) + '\x64' + chr(101))('\x75' + chr(0b110101 + 0o77) + chr(6374 - 6272) + '\055' + chr(0b111000)).V4roHaS3Ppej(pGmpomPY1HXr, ZMuwXcOqVMxJ, vBsMWH4gAEfy)
raise ow8Lll3lwq0h(pGmpomPY1HXr, R2mbIkZzeu1B)
xafqLlk3kkUe(oVre8I6UXc3b._in_progress_templates, xafqLlk3kkUe(SXOLrMavuUCe(b'TGU\xef\xf7\xba'), chr(100) + chr(0b101101 + 0o70) + chr(0b1100011) + '\x6f' + chr(0b1010100 + 0o20) + '\145')(chr(0b1110101) + chr(116) + chr(0b1011001 + 0o15) + '\055' + chr(0b11111 + 0o31)))((pGmpomPY1HXr, ZMuwXcOqVMxJ))
|
awslabs/serverless-application-model
|
samtranslator/plugins/application/serverless_app_plugin.py
|
ServerlessAppPlugin._sar_service_call
|
def _sar_service_call(self, service_call_lambda, logical_id, *args):
"""
Handles service calls and exception management for service calls
to the Serverless Application Repository.
:param lambda service_call_lambda: lambda function that contains the service call
:param string logical_id: Logical ID of the resource being processed
:param list *args: arguments for the service call lambda
"""
try:
response = service_call_lambda(*args)
logging.info(response)
return response
except ClientError as e:
error_code = e.response['Error']['Code']
if error_code in ('AccessDeniedException', 'NotFoundException'):
raise InvalidResourceException(logical_id, e.response['Error']['Message'])
# 'ForbiddenException'- SAR rejects connection
logging.exception(e)
raise e
|
python
|
def _sar_service_call(self, service_call_lambda, logical_id, *args):
"""
Handles service calls and exception management for service calls
to the Serverless Application Repository.
:param lambda service_call_lambda: lambda function that contains the service call
:param string logical_id: Logical ID of the resource being processed
:param list *args: arguments for the service call lambda
"""
try:
response = service_call_lambda(*args)
logging.info(response)
return response
except ClientError as e:
error_code = e.response['Error']['Code']
if error_code in ('AccessDeniedException', 'NotFoundException'):
raise InvalidResourceException(logical_id, e.response['Error']['Message'])
# 'ForbiddenException'- SAR rejects connection
logging.exception(e)
raise e
|
[
"def",
"_sar_service_call",
"(",
"self",
",",
"service_call_lambda",
",",
"logical_id",
",",
"*",
"args",
")",
":",
"try",
":",
"response",
"=",
"service_call_lambda",
"(",
"*",
"args",
")",
"logging",
".",
"info",
"(",
"response",
")",
"return",
"response",
"except",
"ClientError",
"as",
"e",
":",
"error_code",
"=",
"e",
".",
"response",
"[",
"'Error'",
"]",
"[",
"'Code'",
"]",
"if",
"error_code",
"in",
"(",
"'AccessDeniedException'",
",",
"'NotFoundException'",
")",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"e",
".",
"response",
"[",
"'Error'",
"]",
"[",
"'Message'",
"]",
")",
"# 'ForbiddenException'- SAR rejects connection",
"logging",
".",
"exception",
"(",
"e",
")",
"raise",
"e"
] |
Handles service calls and exception management for service calls
to the Serverless Application Repository.
:param lambda service_call_lambda: lambda function that contains the service call
:param string logical_id: Logical ID of the resource being processed
:param list *args: arguments for the service call lambda
|
[
"Handles",
"service",
"calls",
"and",
"exception",
"management",
"for",
"service",
"calls",
"to",
"the",
"Serverless",
"Application",
"Repository",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/plugins/application/serverless_app_plugin.py#L317-L337
|
train
|
Handles service calls and exceptions management for service calls and exception management for service calls
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7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WkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1080 - 1025) + chr(54), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10110 + 0o41) + '\x31', 0o10), ehT0Px3KOsy9(chr(757 - 709) + chr(111) + '\062' + chr(1752 - 1703) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(1988 - 1940) + chr(0b10001 + 0o136) + '\061' + chr(0b11011 + 0o25) + '\x35', 0b1000), ehT0Px3KOsy9(chr(1882 - 1834) + chr(0b1101111) + chr(0b11011 + 0o31) + chr(0b1000 + 0o54), 0o10), ehT0Px3KOsy9('\060' + chr(251 - 140) + chr(0b110001) + '\065' + chr(1308 - 1258), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010100 + 0o33) + chr(0b1111 + 0o42) + chr(0b110001) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1111 + 0o43) + chr(49) + '\x37', 8), ehT0Px3KOsy9(chr(854 - 806) + '\x6f' + chr(88 - 38) + chr(1925 - 1874) + chr(70 - 15), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(919 - 868) + '\064', 60079 - 60071), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(52) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10101 + 0o132) + '\062' + chr(0b10100 + 0o34) + '\066', 0o10), ehT0Px3KOsy9(chr(48) + chr(4420 - 4309) + '\x33' + chr(1402 - 1348) + chr(2593 - 2539), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(1947 - 1897) + chr(0b11 + 0o57) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + '\061' + chr(0b101001 + 0o13) + '\067', 3532 - 3524), ehT0Px3KOsy9(chr(48) + chr(7362 - 7251) + '\062' + '\065' + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1000110 + 0o51) + chr(0b110010) + '\062' + '\061', 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + chr(0b110001) + '\063' + chr(629 - 574), 30147 - 30139), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2134 - 2085) + chr(2901 - 2847) + chr(0b101100 + 0o5), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10011 + 0o36) + '\065' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\157' + chr(53) + '\061', 63514 - 63506), ehT0Px3KOsy9(chr(1828 - 1780) + chr(111) + chr(1850 - 1800) + '\x32', 0b1000), ehT0Px3KOsy9(chr(564 - 516) + '\x6f' + '\x33' + chr(52) + '\067', 0o10), ehT0Px3KOsy9('\x30' + chr(0b111000 + 0o67) + chr(756 - 705) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100111 + 0o17) + chr(0b110011), 13003 - 12995), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101101 + 0o2) + chr(0b0 + 0o62) + chr(2109 - 2059) + chr(2762 - 2708), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(1469 - 1419) + chr(0b110 + 0o60) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\x36' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(2135 - 2087) + chr(0b11000 + 0o127) + chr(54) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(501 - 452) + chr(48) + chr(2011 - 1960), 0b1000), ehT0Px3KOsy9(chr(48) + chr(11499 - 11388) + chr(1830 - 1779) + chr(1066 - 1014) + chr(55), 8), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + chr(0b110000 + 0o1) + chr(0b1101 + 0o43) + chr(0b101010 + 0o11), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(191 - 140), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(1373 - 1320) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(0b11001 + 0o32) + '\067' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(1795 - 1740) + chr(1026 - 974), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + '\063' + '\x36' + chr(2132 - 2083), ord("\x08")), ehT0Px3KOsy9(chr(399 - 351) + chr(1081 - 970) + chr(0b110011) + chr(0b110011 + 0o1) + chr(388 - 339), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(2309 - 2260), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(2218 - 2170) + '\063', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1107 - 1059) + chr(0b1101111) + chr(0b110101) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x10'), chr(1485 - 1385) + chr(0b10001 + 0o124) + chr(0b1100011) + '\157' + chr(0b111100 + 0o50) + '\x65')('\x75' + chr(0b1101101 + 0o7) + '\146' + chr(0b0 + 0o55) + chr(1442 - 1386)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def FFXFNufhvBC6(oVre8I6UXc3b, qTXDMSTmuU4V, NpZr66MdBhVG, *kJDRfRhcZHjS):
try:
ekFGDFIe9V8v = qTXDMSTmuU4V(*kJDRfRhcZHjS)
xafqLlk3kkUe(UeotCCWOPSQS, xafqLlk3kkUe(SXOLrMavuUCe(b'm\x0e\xc7=Q\t-\xb8\xf5\xb0\xfe\xed'), '\144' + chr(349 - 248) + chr(1080 - 981) + chr(2659 - 2548) + chr(0b1100100) + '\x65')(chr(8524 - 8407) + '\164' + '\146' + '\x2d' + chr(56)))(ekFGDFIe9V8v)
return ekFGDFIe9V8v
except m7I_55SCb3An as GlnVAPeT6CUe:
cxZYA4CJJjZy = GlnVAPeT6CUe.response[xafqLlk3kkUe(SXOLrMavuUCe(b'{K\xfd*V'), chr(0b1100100) + chr(0b1100101) + chr(0b111 + 0o134) + chr(0b10101 + 0o132) + chr(2471 - 2371) + '\145')(chr(0b1110101) + chr(0b110100 + 0o100) + chr(102) + chr(0b100 + 0o51) + chr(418 - 362))][xafqLlk3kkUe(SXOLrMavuUCe(b'}V\xeb '), chr(6178 - 6078) + '\x65' + chr(99) + chr(0b1100001 + 0o16) + chr(9397 - 9297) + '\145')('\165' + '\164' + chr(0b111010 + 0o54) + '\055' + '\x38')]
if cxZYA4CJJjZy in (xafqLlk3kkUe(SXOLrMavuUCe(b'\x7fZ\xec W\x19\x0e\xea\xf1\xb5\xc1\xe2\xb3\xee\x04\xcf\xe1+\x18\x07G'), chr(0b1000100 + 0o40) + '\145' + chr(99) + chr(0b1000001 + 0o56) + chr(100) + chr(4147 - 4046))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(976 - 931) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'pV\xfb\x03K\x1f$\xeb\xda\xa4\xc7\xe3\x86\xe2\x0e\xc5\xff'), chr(0b1100100) + chr(0b10000 + 0o125) + chr(0b1010101 + 0o16) + '\157' + chr(0b1000111 + 0o35) + '\x65')('\165' + chr(0b1110100) + chr(0b1010001 + 0o25) + chr(0b101101) + chr(0b111000))):
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(GlnVAPeT6CUe, xafqLlk3kkUe(SXOLrMavuUCe(b'L\\\xfc5K\x049\xea'), '\x64' + chr(3208 - 3107) + chr(0b110001 + 0o62) + chr(0b1101111) + chr(0b11111 + 0o105) + chr(0b1100100 + 0o1))(chr(0b1110000 + 0o5) + chr(1978 - 1862) + chr(0b1100110) + chr(0b101101) + chr(557 - 501)))[xafqLlk3kkUe(SXOLrMavuUCe(b'{K\xfd*V'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\x6f' + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(8261 - 8145) + chr(0b1100110) + chr(0b101 + 0o50) + '\x38')][xafqLlk3kkUe(SXOLrMavuUCe(b's\\\xfc6E\r/'), chr(100) + chr(6469 - 6368) + '\143' + chr(0b11100 + 0o123) + chr(8379 - 8279) + chr(5724 - 5623))('\165' + chr(0b1110100) + '\x66' + chr(0b11011 + 0o22) + '\x38')])
xafqLlk3kkUe(UeotCCWOPSQS, xafqLlk3kkUe(SXOLrMavuUCe(b'[A\xec T\x1e#\xe0\xf1'), '\x64' + chr(101) + chr(4378 - 4279) + chr(0b100001 + 0o116) + '\x64' + '\x65')(chr(7370 - 7253) + '\x74' + '\x66' + chr(0b101101) + '\070'))(GlnVAPeT6CUe)
raise GlnVAPeT6CUe
|
awslabs/serverless-application-model
|
samtranslator/parser/parser.py
|
Parser._validate
|
def _validate(self, sam_template, parameter_values):
""" Validates the template and parameter values and raises exceptions if there's an issue
:param dict sam_template: SAM template
:param dict parameter_values: Dictionary of parameter values provided by the user
"""
if parameter_values is None:
raise ValueError("`parameter_values` argument is required")
if ("Resources" not in sam_template or not isinstance(sam_template["Resources"], dict) or not
sam_template["Resources"]):
raise InvalidDocumentException(
[InvalidTemplateException("'Resources' section is required")])
if (not all(isinstance(sam_resource, dict) for sam_resource in sam_template["Resources"].values())):
raise InvalidDocumentException(
[InvalidTemplateException(
"All 'Resources' must be Objects. If you're using YAML, this may be an "
"indentation issue."
)])
sam_template_instance = SamTemplate(sam_template)
for resource_logical_id, sam_resource in sam_template_instance.iterate():
# NOTE: Properties isn't required for SimpleTable, so we can't check
# `not isinstance(sam_resources.get("Properties"), dict)` as this would be a breaking change.
# sam_resource.properties defaults to {} in SamTemplate init
if (not isinstance(sam_resource.properties, dict)):
raise InvalidDocumentException(
[InvalidResourceException(resource_logical_id,
"All 'Resources' must be Objects and have a 'Properties' Object. If "
"you're using YAML, this may be an indentation issue."
)])
SamTemplateValidator.validate(sam_template)
|
python
|
def _validate(self, sam_template, parameter_values):
""" Validates the template and parameter values and raises exceptions if there's an issue
:param dict sam_template: SAM template
:param dict parameter_values: Dictionary of parameter values provided by the user
"""
if parameter_values is None:
raise ValueError("`parameter_values` argument is required")
if ("Resources" not in sam_template or not isinstance(sam_template["Resources"], dict) or not
sam_template["Resources"]):
raise InvalidDocumentException(
[InvalidTemplateException("'Resources' section is required")])
if (not all(isinstance(sam_resource, dict) for sam_resource in sam_template["Resources"].values())):
raise InvalidDocumentException(
[InvalidTemplateException(
"All 'Resources' must be Objects. If you're using YAML, this may be an "
"indentation issue."
)])
sam_template_instance = SamTemplate(sam_template)
for resource_logical_id, sam_resource in sam_template_instance.iterate():
# NOTE: Properties isn't required for SimpleTable, so we can't check
# `not isinstance(sam_resources.get("Properties"), dict)` as this would be a breaking change.
# sam_resource.properties defaults to {} in SamTemplate init
if (not isinstance(sam_resource.properties, dict)):
raise InvalidDocumentException(
[InvalidResourceException(resource_logical_id,
"All 'Resources' must be Objects and have a 'Properties' Object. If "
"you're using YAML, this may be an indentation issue."
)])
SamTemplateValidator.validate(sam_template)
|
[
"def",
"_validate",
"(",
"self",
",",
"sam_template",
",",
"parameter_values",
")",
":",
"if",
"parameter_values",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"`parameter_values` argument is required\"",
")",
"if",
"(",
"\"Resources\"",
"not",
"in",
"sam_template",
"or",
"not",
"isinstance",
"(",
"sam_template",
"[",
"\"Resources\"",
"]",
",",
"dict",
")",
"or",
"not",
"sam_template",
"[",
"\"Resources\"",
"]",
")",
":",
"raise",
"InvalidDocumentException",
"(",
"[",
"InvalidTemplateException",
"(",
"\"'Resources' section is required\"",
")",
"]",
")",
"if",
"(",
"not",
"all",
"(",
"isinstance",
"(",
"sam_resource",
",",
"dict",
")",
"for",
"sam_resource",
"in",
"sam_template",
"[",
"\"Resources\"",
"]",
".",
"values",
"(",
")",
")",
")",
":",
"raise",
"InvalidDocumentException",
"(",
"[",
"InvalidTemplateException",
"(",
"\"All 'Resources' must be Objects. If you're using YAML, this may be an \"",
"\"indentation issue.\"",
")",
"]",
")",
"sam_template_instance",
"=",
"SamTemplate",
"(",
"sam_template",
")",
"for",
"resource_logical_id",
",",
"sam_resource",
"in",
"sam_template_instance",
".",
"iterate",
"(",
")",
":",
"# NOTE: Properties isn't required for SimpleTable, so we can't check",
"# `not isinstance(sam_resources.get(\"Properties\"), dict)` as this would be a breaking change.",
"# sam_resource.properties defaults to {} in SamTemplate init",
"if",
"(",
"not",
"isinstance",
"(",
"sam_resource",
".",
"properties",
",",
"dict",
")",
")",
":",
"raise",
"InvalidDocumentException",
"(",
"[",
"InvalidResourceException",
"(",
"resource_logical_id",
",",
"\"All 'Resources' must be Objects and have a 'Properties' Object. If \"",
"\"you're using YAML, this may be an indentation issue.\"",
")",
"]",
")",
"SamTemplateValidator",
".",
"validate",
"(",
"sam_template",
")"
] |
Validates the template and parameter values and raises exceptions if there's an issue
:param dict sam_template: SAM template
:param dict parameter_values: Dictionary of parameter values provided by the user
|
[
"Validates",
"the",
"template",
"and",
"parameter",
"values",
"and",
"raises",
"exceptions",
"if",
"there",
"s",
"an",
"issue"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/parser/parser.py#L16-L50
|
train
|
Validates the SAM template and parameter values and raises exceptions if there s an issue
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeX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M4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + chr(1293 - 1243) + '\x32' + chr(54), 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b101001 + 0o106) + chr(0b1101 + 0o44) + '\060' + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2048 - 1997) + '\066' + chr(1805 - 1751), 0b1000), ehT0Px3KOsy9('\060' + chr(0b100111 + 0o110) + '\x37' + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(71 - 21) + chr(0b110111) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1703 - 1654) + chr(53) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(0b110110) + chr(0b100110 + 0o16), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(0b101100 + 0o7) + '\x34', 19152 - 19144), ehT0Px3KOsy9('\060' + chr(0b1100 + 0o143) + chr(1835 - 1782) + chr(0b1000 + 0o54), 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(1572 - 1461) + '\064' + chr(0b111 + 0o52), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + '\060' + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(0b1001011 + 0o44) + chr(758 - 707) + '\x35', 23877 - 23869), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + chr(0b100101 + 0o14) + chr(0b110111) + chr(0b110 + 0o53), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(0b110001), 15304 - 15296), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1 + 0o62) + chr(48) + chr(0b110111), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(802 - 747) + '\x37', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(547 - 497) + chr(0b110110) + '\x34', 24277 - 24269), ehT0Px3KOsy9('\x30' + chr(111) + chr(2404 - 2354) + '\x32', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b110100) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b111111 + 0o60) + chr(1675 - 1624), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b10011 + 0o134) + chr(0b110101) + '\063', 26507 - 26499), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x31' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + '\x32' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(55) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(4048 - 3937) + chr(49) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b11001 + 0o126) + chr(49) + chr(0b1100 + 0o50), 0o10), ehT0Px3KOsy9(chr(1358 - 1310) + chr(0b1101111) + chr(0b100000 + 0o21) + chr(55) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b111110 + 0o61) + chr(0b110001) + '\066' + chr(795 - 742), 515 - 507), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + '\x37' + chr(49), 8), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1110 + 0o141) + chr(2323 - 2272) + chr(269 - 220) + chr(0b110010), 19233 - 19225), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11111 + 0o22) + '\065' + chr(0b1110 + 0o42), 8), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + '\x33' + chr(49) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10011 + 0o36) + '\066' + chr(0b10110 + 0o40), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(1005 - 954) + chr(1062 - 1009) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(50) + chr(0b1111 + 0o46) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + '\x32' + '\x33', 0b1000), ehT0Px3KOsy9(chr(473 - 425) + chr(11355 - 11244) + chr(466 - 417) + '\x33' + chr(0b11010 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1467 - 1356) + chr(0b110010) + chr(0b110101) + chr(0b110010), 14641 - 14633), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(2491 - 2436) + chr(0b111 + 0o52), 8), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b11011 + 0o32) + chr(51), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1001110 + 0o41) + chr(53) + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8'), '\144' + '\x65' + chr(99) + '\x6f' + '\144' + '\145')(chr(7015 - 6898) + chr(0b1110100) + chr(102) + '\055' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def mCArq4frRHUO(oVre8I6UXc3b, b8qPeGfJV4aN, PPceYe5Mkdxr):
if PPceYe5Mkdxr is None:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf67\x97J\xde\x05\x11\xa8IS\x98k\x18e\xb2\xda\xc7r\x81bY\xeb"\x91kb\x08U\x10\xb9H\xba\x13\x99\xde\xba,\xcf\x1d'), chr(6131 - 6031) + '\x65' + chr(0b111011 + 0o50) + chr(226 - 115) + '\144' + chr(0b10011 + 0o122))(chr(117) + '\x74' + chr(0b1100110) + '\x2d' + chr(56)))
if xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4"\x85W\xca\x1a\x17\xb9_'), chr(1664 - 1564) + chr(8276 - 8175) + '\143' + '\157' + '\144' + chr(101))(chr(117) + '\164' + chr(8529 - 8427) + chr(45) + chr(56)) not in b8qPeGfJV4aN or not PlSM16l2KDPD(b8qPeGfJV4aN[xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4"\x85W\xca\x1a\x17\xb9_'), chr(6216 - 6116) + '\145' + chr(0b11000 + 0o113) + chr(0b1100101 + 0o12) + chr(0b1100100) + '\x65')('\x75' + '\164' + chr(0b1001011 + 0o33) + '\055' + '\x38')], wLqBDw8l0eIm) or (not b8qPeGfJV4aN[xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4"\x85W\xca\x1a\x17\xb9_'), chr(0b1100100) + chr(101) + chr(7593 - 7494) + chr(0b1001001 + 0o46) + chr(0b1100100) + chr(6263 - 6162))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(0b11000 + 0o25) + '\x38')]):
raise WAOffgnUIwTZ([pFZeGuJCK2EG(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\x15\x93K\xd0\x1d\x06\xbfIR\xe0=\nl\xa4\xcb\xdd}\xcf#B\xffw\x8ek}\t\x1c\x0b\xaf\x0c'), chr(0b1100100) + '\x65' + chr(0b100101 + 0o76) + chr(0b1101 + 0o142) + chr(0b101001 + 0o73) + chr(0b10 + 0o143))('\x75' + chr(0b1110100) + chr(0b100010 + 0o104) + chr(45) + chr(0b111000)))])
if not Dl48nj1rbi23((PlSM16l2KDPD(bpmAfFUAptBv, wLqBDw8l0eIm) for bpmAfFUAptBv in xafqLlk3kkUe(b8qPeGfJV4aN[xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4"\x85W\xca\x1a\x17\xb9_'), chr(8854 - 8754) + '\x65' + chr(7049 - 6950) + chr(0b11110 + 0o121) + chr(0b1010000 + 0o24) + chr(3024 - 2923))(chr(0b1110101) + chr(116) + '\146' + chr(1117 - 1072) + '\x38')], xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5\x17\x98{\xf1\x1dA\xe8d\x10\xa3\x7f'), '\x64' + chr(0b1100101) + chr(7321 - 7222) + chr(582 - 471) + '\144' + chr(101))(chr(0b1110101) + chr(0b1101100 + 0o10) + chr(0b1100110) + chr(0b101101) + '\070'))())):
raise WAOffgnUIwTZ([pFZeGuJCK2EG(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7+\x9a\x18\x98:\x11\xafCT\xb5~\x1cz\xe0\x9f\xd9g\xd2w\x0b\xee2\xdcAn\x16\x10\x1a\xbe\x1b\xe6V\xa1\xcd\xf3\'\xc5\x0c\xcc\xe4"\xd6M\xcc\x01\x1a\xbb\x0cx\x86P5%\xe7\xcb\xdc{\xd2#F\xed.\xdcli\\\x14\x17\xea\x01\xa6\x12\x8d\xc5\xa7?\xde\x10\x84\xf8g\x9fK\xcc\x1d\x11\xf2'), chr(2236 - 2136) + chr(0b1100101) + chr(99) + chr(267 - 156) + chr(0b1100100) + chr(665 - 564))(chr(2969 - 2852) + '\164' + '\146' + '\055' + chr(2877 - 2821)))])
RmZpBSu4hATx = EY6e8ub0jb5c(b8qPeGfJV4aN)
for (aUj_7PUg_bJf, bpmAfFUAptBv) in xafqLlk3kkUe(RmZpBSu4hATx, xafqLlk3kkUe(SXOLrMavuUCe(b'\xff3\x93J\xde\x1c\x11'), chr(608 - 508) + chr(101) + '\x63' + chr(0b1101111) + chr(100) + '\145')(chr(12214 - 12097) + chr(116) + chr(0b111100 + 0o52) + chr(834 - 789) + '\x38'))():
if not PlSM16l2KDPD(xafqLlk3kkUe(bpmAfFUAptBv, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9s\xbbN\x87Z\x07\x90An\x97%'), chr(100) + chr(0b11110 + 0o107) + chr(99) + chr(11416 - 11305) + chr(0b1100100) + chr(7917 - 7816))(chr(0b111 + 0o156) + chr(0b1110100) + chr(102) + '\055' + '\070')), wLqBDw8l0eIm):
raise WAOffgnUIwTZ([ow8Lll3lwq0h(aUj_7PUg_bJf, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7+\x9a\x18\x98:\x11\xafCT\xb5~\x1cz\xe0\x9f\xd9g\xd2w\x0b\xee2\xdcAn\x16\x10\x1a\xbe\x1b\xe8\x17\x86\xcf\xf36\xcb\x0f\x8e\xb6&\xd6\x1f\xef\x1a\x1b\xacIS\xb3t\x1cz\xe0\x9f\xfbp\xcbfH\xf8y\xdcGj\\\x0c\x16\xbfO\xba\x13\xc8\xde\xa07\xc4\x1e\xcb\xcf\x06\xbbt\x93H\x00\xb4ER\xe7p\x18p\xe7\xdd\xd12\xc0m\x0b\xe59\x98kb\x08\x14\r\xa3\x07\xa6V\x81\xd8\xa0+\xcfW'), chr(100) + chr(2155 - 2054) + chr(2896 - 2797) + '\x6f' + '\144' + chr(0b1100100 + 0o1))(chr(0b1101001 + 0o14) + chr(0b1001000 + 0o54) + chr(3795 - 3693) + chr(45) + chr(0b111 + 0o61)))])
xafqLlk3kkUe(h494nh_dmI7g, xafqLlk3kkUe(SXOLrMavuUCe(b'\xde)\xbcy\xc6\x198\xa9gR\x93,'), '\x64' + '\145' + chr(0b1100011) + chr(7191 - 7080) + chr(0b1100100) + chr(101))('\x75' + chr(6225 - 6109) + chr(211 - 109) + '\x2d' + chr(0b111000)))(b8qPeGfJV4aN)
|
awslabs/serverless-application-model
|
samtranslator/sdk/template.py
|
SamTemplate.iterate
|
def iterate(self, resource_type=None):
"""
Iterate over all resources within the SAM template, optionally filtering by type
:param string resource_type: Optional type to filter the resources by
:yields (string, SamResource): Tuple containing LogicalId and the resource
"""
for logicalId, resource_dict in self.resources.items():
resource = SamResource(resource_dict)
needs_filter = resource.valid()
if resource_type:
needs_filter = needs_filter and resource.type == resource_type
if needs_filter:
yield logicalId, resource
|
python
|
def iterate(self, resource_type=None):
"""
Iterate over all resources within the SAM template, optionally filtering by type
:param string resource_type: Optional type to filter the resources by
:yields (string, SamResource): Tuple containing LogicalId and the resource
"""
for logicalId, resource_dict in self.resources.items():
resource = SamResource(resource_dict)
needs_filter = resource.valid()
if resource_type:
needs_filter = needs_filter and resource.type == resource_type
if needs_filter:
yield logicalId, resource
|
[
"def",
"iterate",
"(",
"self",
",",
"resource_type",
"=",
"None",
")",
":",
"for",
"logicalId",
",",
"resource_dict",
"in",
"self",
".",
"resources",
".",
"items",
"(",
")",
":",
"resource",
"=",
"SamResource",
"(",
"resource_dict",
")",
"needs_filter",
"=",
"resource",
".",
"valid",
"(",
")",
"if",
"resource_type",
":",
"needs_filter",
"=",
"needs_filter",
"and",
"resource",
".",
"type",
"==",
"resource_type",
"if",
"needs_filter",
":",
"yield",
"logicalId",
",",
"resource"
] |
Iterate over all resources within the SAM template, optionally filtering by type
:param string resource_type: Optional type to filter the resources by
:yields (string, SamResource): Tuple containing LogicalId and the resource
|
[
"Iterate",
"over",
"all",
"resources",
"within",
"the",
"SAM",
"template",
"optionally",
"filtering",
"by",
"type"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/sdk/template.py#L22-L38
|
train
|
Iterate over all resources within the SAM template optionally filtering by type
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,Wa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RfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b10101 + 0o132) + chr(0b110010) + chr(0b100111 + 0o20), 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1101111) + chr(0b11111 + 0o24), 33562 - 33554), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + '\x32' + '\062' + chr(0b101010 + 0o6), 0b1000), ehT0Px3KOsy9(chr(1243 - 1195) + chr(111) + '\062' + '\062' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(496 - 448) + chr(111) + chr(0b110010) + chr(0b110101) + chr(1664 - 1612), 10248 - 10240), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + chr(0b110100) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100100 + 0o15) + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101010 + 0o5) + '\066' + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(91 - 41) + chr(2524 - 2471), 2028 - 2020), ehT0Px3KOsy9(chr(1902 - 1854) + '\157' + chr(2102 - 2052) + chr(48) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x35' + chr(54), 13211 - 13203), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1101111) + chr(0b110001) + chr(1010 - 956) + chr(54), 0o10), ehT0Px3KOsy9(chr(810 - 762) + chr(1081 - 970) + chr(1978 - 1928) + '\060' + chr(2590 - 2536), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(454 - 405) + '\061' + '\x32', 0o10), ehT0Px3KOsy9(chr(1757 - 1709) + '\x6f' + '\062' + '\x33' + chr(0b110 + 0o57), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1853 - 1804) + chr(0b100100 + 0o22) + chr(1737 - 1687), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(52) + chr(48), 7527 - 7519), ehT0Px3KOsy9(chr(486 - 438) + '\157' + chr(2394 - 2345) + chr(989 - 934) + chr(838 - 783), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + '\x30' + chr(0b10000 + 0o45), 35194 - 35186), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + chr(0b1010 + 0o47) + chr(0b110100) + '\x34', 35548 - 35540), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11100 + 0o25) + '\x34' + chr(667 - 614), 29288 - 29280), ehT0Px3KOsy9(chr(649 - 601) + chr(0b1101111) + chr(0b110001) + chr(55) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101111) + chr(0b110100) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1101 + 0o44) + chr(1886 - 1831) + '\x30', 8), ehT0Px3KOsy9(chr(48) + chr(0b111111 + 0o60) + chr(0b110111) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2528 - 2477) + chr(0b110010) + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + '\x31' + chr(0b110001), 58735 - 58727), ehT0Px3KOsy9(chr(1862 - 1814) + chr(111) + chr(1929 - 1880) + '\x31' + chr(0b10 + 0o65), 20249 - 20241), ehT0Px3KOsy9(chr(48) + chr(4629 - 4518) + '\x31' + chr(531 - 483) + chr(0b10001 + 0o43), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b110111) + chr(0b11011 + 0o25), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + '\x35' + chr(0b10100 + 0o40), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(54) + chr(2904 - 2849), ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b111100 + 0o63) + chr(0b110001) + '\065' + chr(577 - 529), 51853 - 51845), ehT0Px3KOsy9('\x30' + chr(6722 - 6611) + '\x32' + chr(0b110000) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1011000 + 0o27) + '\063' + '\x31' + '\x30', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(2398 - 2345) + '\067', 17494 - 17486), ehT0Px3KOsy9('\060' + chr(0b110010 + 0o75) + chr(49) + '\062' + chr(1374 - 1321), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100011 + 0o20) + chr(54) + chr(0b110100), 52220 - 52212), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2391 - 2340) + chr(0b100011 + 0o24) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(8168 - 8057) + chr(51) + chr(0b110101) + chr(0b101000 + 0o16), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101010 + 0o5) + chr(53) + chr(1692 - 1644), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'9'), chr(100) + '\145' + '\143' + chr(7207 - 7096) + chr(5517 - 5417) + '\x65')('\165' + chr(0b1101001 + 0o13) + chr(0b1100110) + chr(45) + chr(1086 - 1030)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def mqftQW07SKml(oVre8I6UXc3b, wObOWxcCoSC5=None):
for (gvQh1eVhOwBf, YRwNbm9OifOu) in xafqLlk3kkUe(oVre8I6UXc3b.resources, xafqLlk3kkUe(SXOLrMavuUCe(b'Yy\xe6\xf3\xe5\xbd<xy\xd3fO'), '\x64' + chr(101) + '\x63' + chr(0b1001000 + 0o47) + '\144' + chr(101))(chr(10990 - 10873) + chr(1719 - 1603) + chr(478 - 376) + '\x2d' + '\x38'))():
o9IPj2MJBBod = u2fDvHsVYPSH(YRwNbm9OifOu)
X_BVpmG_K7Nx = o9IPj2MJBBod.BZPR0lwTzWO8()
if wObOWxcCoSC5:
X_BVpmG_K7Nx = X_BVpmG_K7Nx and o9IPj2MJBBod.wmQmyeWBmUpv == wObOWxcCoSC5
if X_BVpmG_K7Nx:
yield (gvQh1eVhOwBf, o9IPj2MJBBod)
|
awslabs/serverless-application-model
|
samtranslator/sdk/template.py
|
SamTemplate.set
|
def set(self, logicalId, resource):
"""
Adds the resource to dictionary with given logical Id. It will overwrite, if the logicalId is already used.
:param string logicalId: Logical Id to set to
:param SamResource or dict resource: The actual resource data
"""
resource_dict = resource
if isinstance(resource, SamResource):
resource_dict = resource.to_dict()
self.resources[logicalId] = resource_dict
|
python
|
def set(self, logicalId, resource):
"""
Adds the resource to dictionary with given logical Id. It will overwrite, if the logicalId is already used.
:param string logicalId: Logical Id to set to
:param SamResource or dict resource: The actual resource data
"""
resource_dict = resource
if isinstance(resource, SamResource):
resource_dict = resource.to_dict()
self.resources[logicalId] = resource_dict
|
[
"def",
"set",
"(",
"self",
",",
"logicalId",
",",
"resource",
")",
":",
"resource_dict",
"=",
"resource",
"if",
"isinstance",
"(",
"resource",
",",
"SamResource",
")",
":",
"resource_dict",
"=",
"resource",
".",
"to_dict",
"(",
")",
"self",
".",
"resources",
"[",
"logicalId",
"]",
"=",
"resource_dict"
] |
Adds the resource to dictionary with given logical Id. It will overwrite, if the logicalId is already used.
:param string logicalId: Logical Id to set to
:param SamResource or dict resource: The actual resource data
|
[
"Adds",
"the",
"resource",
"to",
"dictionary",
"with",
"given",
"logical",
"Id",
".",
"It",
"will",
"overwrite",
"if",
"the",
"logicalId",
"is",
"already",
"used",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/sdk/template.py#L40-L52
|
train
|
Adds the resource to the dictionary with given logical Id.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zr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L,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111100 + 0o63) + chr(0b110001) + '\067' + chr(0b10110 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1101111) + chr(0b101001 + 0o11) + chr(52) + chr(241 - 186), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(193 - 143) + chr(0b10111 + 0o36), 49838 - 49830), ehT0Px3KOsy9(chr(0b110000) + chr(9041 - 8930) + '\063' + chr(2085 - 2034) + chr(821 - 767), 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(10822 - 10711) + chr(0b10101 + 0o36) + chr(390 - 339) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(1185 - 1137) + '\157' + '\064', 0b1000), ehT0Px3KOsy9(chr(1744 - 1696) + chr(111) + '\063' + chr(920 - 868) + chr(0b100 + 0o60), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(49) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b1000 + 0o55) + '\x36', 0b1000), ehT0Px3KOsy9(chr(327 - 279) + chr(0b110001 + 0o76) + chr(79 - 29) + '\x35' + chr(53), 64329 - 64321), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + '\x32' + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(49) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(2230 - 2182) + chr(0b1100 + 0o143) + chr(49) + chr(0b1100 + 0o46) + chr(0b110010 + 0o4), 21085 - 21077), ehT0Px3KOsy9('\060' + chr(0b1000101 + 0o52) + '\x33' + chr(2318 - 2268) + chr(51), 11593 - 11585), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1011000 + 0o27) + chr(0b10100 + 0o41) + chr(1981 - 1926), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b10000 + 0o137) + chr(55) + chr(104 - 50), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(1459 - 1411) + chr(2140 - 2090), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(50) + chr(0b11100 + 0o27), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6305 - 6194) + '\x33' + '\065' + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(0b110110) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(52) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(1919 - 1871) + chr(0b1101 + 0o142) + chr(51) + chr(48) + chr(0b100010 + 0o22), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010001 + 0o36) + chr(0b101100 + 0o5) + chr(0b1010 + 0o53) + chr(0b10101 + 0o37), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + '\x30' + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111 + 0o0) + chr(0b10 + 0o61) + '\x37' + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101110 + 0o1) + '\x33' + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + chr(0b110111), 43071 - 43063), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1100110 + 0o11) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(54) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100101 + 0o112) + chr(133 - 84) + '\x33' + chr(53 - 2), 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + chr(1036 - 982) + chr(804 - 755), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1100001 + 0o16) + chr(0b10001 + 0o42) + '\066' + chr(0b110010), 36118 - 36110), ehT0Px3KOsy9(chr(0b110000) + chr(12067 - 11956) + '\x33' + chr(0b110111) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(9129 - 9018) + chr(0b10 + 0o60) + '\x34' + chr(0b11101 + 0o27), 0b1000), ehT0Px3KOsy9(chr(1574 - 1526) + chr(111) + '\064' + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(3896 - 3785) + '\063' + '\062' + chr(1635 - 1584), 8), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\x6f' + chr(1245 - 1194) + chr(385 - 332) + chr(0b1001 + 0o54), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(0b110100), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + chr(0b110101) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b"'"), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(111) + '\x64' + '\145')(chr(0b1110101) + '\164' + chr(102) + '\x2d' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def MVEN8G6CxlvR(oVre8I6UXc3b, gvQh1eVhOwBf, o9IPj2MJBBod):
YRwNbm9OifOu = o9IPj2MJBBod
if PlSM16l2KDPD(o9IPj2MJBBod, u2fDvHsVYPSH):
YRwNbm9OifOu = o9IPj2MJBBod.to_dict()
oVre8I6UXc3b.z4Xs9XhDbg00[gvQh1eVhOwBf] = YRwNbm9OifOu
|
awslabs/serverless-application-model
|
samtranslator/sdk/template.py
|
SamTemplate.get
|
def get(self, logicalId):
"""
Gets the resource at the given logicalId if present
:param string logicalId: Id of the resource
:return SamResource: Resource, if available at the Id. None, otherwise
"""
if logicalId not in self.resources:
return None
return SamResource(self.resources.get(logicalId))
|
python
|
def get(self, logicalId):
"""
Gets the resource at the given logicalId if present
:param string logicalId: Id of the resource
:return SamResource: Resource, if available at the Id. None, otherwise
"""
if logicalId not in self.resources:
return None
return SamResource(self.resources.get(logicalId))
|
[
"def",
"get",
"(",
"self",
",",
"logicalId",
")",
":",
"if",
"logicalId",
"not",
"in",
"self",
".",
"resources",
":",
"return",
"None",
"return",
"SamResource",
"(",
"self",
".",
"resources",
".",
"get",
"(",
"logicalId",
")",
")"
] |
Gets the resource at the given logicalId if present
:param string logicalId: Id of the resource
:return SamResource: Resource, if available at the Id. None, otherwise
|
[
"Gets",
"the",
"resource",
"at",
"the",
"given",
"logicalId",
"if",
"present"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/sdk/template.py#L54-L64
|
train
|
Gets the resource at the given logicalId.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEOh2,LgE_IO_tHX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1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(8689 - 8578) + '\063' + chr(1107 - 1058) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(9513 - 9402) + '\x31' + chr(0b110101) + '\062', 20354 - 20346), ehT0Px3KOsy9('\060' + chr(0b111101 + 0o62) + '\x33' + '\065' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110100 + 0o73) + '\062' + chr(0b110000) + '\067', 1637 - 1629), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b10100 + 0o133) + '\063' + '\x34' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(252 - 141) + '\x31' + '\x35' + chr(2448 - 2396), 14720 - 14712), ehT0Px3KOsy9('\x30' + chr(12234 - 12123) + '\062' + '\065', 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(2021 - 1971) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + chr(50) + chr(49) + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + chr(937 - 826) + chr(50) + '\x33' + '\060', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(2380 - 2326), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2336 - 2287) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b11101 + 0o122) + '\061' + chr(53) + chr(705 - 651), 18183 - 18175), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + '\061' + chr(148 - 99), 19071 - 19063), ehT0Px3KOsy9(chr(48) + chr(0b10111 + 0o130) + chr(80 - 29) + '\063' + '\x37', 36644 - 36636), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + '\066', 8), ehT0Px3KOsy9('\x30' + '\157' + chr(512 - 462) + chr(678 - 626), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(55) + chr(586 - 532), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\x35' + chr(50), 43030 - 43022), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b100010 + 0o25) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b110000 + 0o77) + chr(0b110010) + chr(0b100001 + 0o22) + chr(55), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(55) + chr(0b11010 + 0o32), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1101 + 0o44) + chr(2347 - 2292) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1000101 + 0o52) + chr(49) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5956 - 5845) + '\063' + chr(49) + chr(458 - 410), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1010 + 0o53) + chr(0b110 + 0o54), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b110011) + '\066', 0o10), ehT0Px3KOsy9(chr(290 - 242) + chr(0b1101111) + chr(0b1110 + 0o43) + chr(0b110101) + chr(0b111 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\065' + '\063', 52408 - 52400), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b10010 + 0o36) + chr(1132 - 1083), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1847 - 1798) + chr(1226 - 1177) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000001 + 0o56) + chr(2285 - 2234) + chr(0b110011) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(0b1101 + 0o44) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + chr(0b100001 + 0o26) + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(1510 - 1399) + '\065' + '\067', 0b1000), ehT0Px3KOsy9('\060' + chr(971 - 860) + chr(49) + '\067' + chr(0b110110), 8), ehT0Px3KOsy9('\x30' + '\157' + '\063' + '\x34' + chr(748 - 699), 30580 - 30572), ehT0Px3KOsy9(chr(1681 - 1633) + chr(0b1100101 + 0o12) + '\061' + chr(0b110101) + chr(542 - 494), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1001 + 0o146) + chr(0b110010) + '\062' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + '\x33' + '\x37', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1216 - 1168) + chr(9832 - 9721) + chr(339 - 286) + chr(0b100110 + 0o12), 41755 - 41747)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1'), '\x64' + '\145' + '\143' + chr(0b1101111) + chr(0b1011000 + 0o14) + chr(8867 - 8766))(chr(0b1011000 + 0o35) + '\x74' + chr(0b110111 + 0o57) + '\x2d' + chr(1883 - 1827)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Q8b5UytA0vqH(oVre8I6UXc3b, gvQh1eVhOwBf):
if gvQh1eVhOwBf not in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb5^\xb6\xf4\xdd4}U\xef\xff&='), '\x64' + chr(9371 - 9270) + chr(0b1100011) + chr(0b1101111) + chr(0b1001 + 0o133) + '\x65')(chr(0b100100 + 0o121) + chr(116) + chr(0b1000000 + 0o46) + '\x2d' + chr(56))):
return None
return u2fDvHsVYPSH(xafqLlk3kkUe(oVre8I6UXc3b.resources, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8\x0f\x9a'), '\x64' + chr(0b110 + 0o137) + chr(99) + '\x6f' + '\144' + chr(0b1100101))(chr(0b111001 + 0o74) + chr(1920 - 1804) + chr(0b1010001 + 0o25) + '\055' + chr(0b0 + 0o70)))(gvQh1eVhOwBf))
|
awslabs/serverless-application-model
|
samtranslator/translator/translator.py
|
prepare_plugins
|
def prepare_plugins(plugins, parameters={}):
"""
Creates & returns a plugins object with the given list of plugins installed. In addition to the given plugins,
we will also install a few "required" plugins that are necessary to provide complete support for SAM template spec.
:param plugins: list of samtranslator.plugins.BasePlugin plugins: List of plugins to install
:param parameters: Dictionary of parameter values
:return samtranslator.plugins.SamPlugins: Instance of `SamPlugins`
"""
required_plugins = [
DefaultDefinitionBodyPlugin(),
make_implicit_api_plugin(),
GlobalsPlugin(),
make_policy_template_for_function_plugin(),
]
plugins = [] if not plugins else plugins
# If a ServerlessAppPlugin does not yet exist, create one and add to the beginning of the required plugins list.
if not any(isinstance(plugin, ServerlessAppPlugin) for plugin in plugins):
required_plugins.insert(0, ServerlessAppPlugin(parameters=parameters))
# Execute customer's plugins first before running SAM plugins. It is very important to retain this order because
# other plugins will be dependent on this ordering.
return SamPlugins(plugins + required_plugins)
|
python
|
def prepare_plugins(plugins, parameters={}):
"""
Creates & returns a plugins object with the given list of plugins installed. In addition to the given plugins,
we will also install a few "required" plugins that are necessary to provide complete support for SAM template spec.
:param plugins: list of samtranslator.plugins.BasePlugin plugins: List of plugins to install
:param parameters: Dictionary of parameter values
:return samtranslator.plugins.SamPlugins: Instance of `SamPlugins`
"""
required_plugins = [
DefaultDefinitionBodyPlugin(),
make_implicit_api_plugin(),
GlobalsPlugin(),
make_policy_template_for_function_plugin(),
]
plugins = [] if not plugins else plugins
# If a ServerlessAppPlugin does not yet exist, create one and add to the beginning of the required plugins list.
if not any(isinstance(plugin, ServerlessAppPlugin) for plugin in plugins):
required_plugins.insert(0, ServerlessAppPlugin(parameters=parameters))
# Execute customer's plugins first before running SAM plugins. It is very important to retain this order because
# other plugins will be dependent on this ordering.
return SamPlugins(plugins + required_plugins)
|
[
"def",
"prepare_plugins",
"(",
"plugins",
",",
"parameters",
"=",
"{",
"}",
")",
":",
"required_plugins",
"=",
"[",
"DefaultDefinitionBodyPlugin",
"(",
")",
",",
"make_implicit_api_plugin",
"(",
")",
",",
"GlobalsPlugin",
"(",
")",
",",
"make_policy_template_for_function_plugin",
"(",
")",
",",
"]",
"plugins",
"=",
"[",
"]",
"if",
"not",
"plugins",
"else",
"plugins",
"# If a ServerlessAppPlugin does not yet exist, create one and add to the beginning of the required plugins list.",
"if",
"not",
"any",
"(",
"isinstance",
"(",
"plugin",
",",
"ServerlessAppPlugin",
")",
"for",
"plugin",
"in",
"plugins",
")",
":",
"required_plugins",
".",
"insert",
"(",
"0",
",",
"ServerlessAppPlugin",
"(",
"parameters",
"=",
"parameters",
")",
")",
"# Execute customer's plugins first before running SAM plugins. It is very important to retain this order because",
"# other plugins will be dependent on this ordering.",
"return",
"SamPlugins",
"(",
"plugins",
"+",
"required_plugins",
")"
] |
Creates & returns a plugins object with the given list of plugins installed. In addition to the given plugins,
we will also install a few "required" plugins that are necessary to provide complete support for SAM template spec.
:param plugins: list of samtranslator.plugins.BasePlugin plugins: List of plugins to install
:param parameters: Dictionary of parameter values
:return samtranslator.plugins.SamPlugins: Instance of `SamPlugins`
|
[
"Creates",
"&",
"returns",
"a",
"plugins",
"object",
"with",
"the",
"given",
"list",
"of",
"plugins",
"installed",
".",
"In",
"addition",
"to",
"the",
"given",
"plugins",
"we",
"will",
"also",
"install",
"a",
"few",
"required",
"plugins",
"that",
"are",
"necessary",
"to",
"provide",
"complete",
"support",
"for",
"SAM",
"template",
"spec",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/translator/translator.py#L163-L188
|
train
|
Creates & returns a new SamPlugins object with the given list of plugins installed.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,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BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1001 + 0o146) + '\062' + chr(0b1101 + 0o51) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1101111) + '\063' + chr(55) + '\060', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b110000) + chr(0b100111 + 0o20), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8944 - 8833) + chr(49) + '\066' + chr(0b11100 + 0o27), 42396 - 42388), ehT0Px3KOsy9(chr(0b110000) + chr(304 - 193) + chr(0b110011) + chr(0b110100) + '\x35', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b1111 + 0o44) + chr(0b110101) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110111) + '\061', 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + '\063' + chr(0b10 + 0o63) + chr(0b1101 + 0o51), 0b1000), ehT0Px3KOsy9(chr(1008 - 960) + chr(0b1101111) + chr(51) + '\060' + chr(50), 60116 - 60108), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + chr(0b11111 + 0o22) + '\x30' + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(0b110100 + 0o2) + chr(0b100100 + 0o21), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x35' + chr(1086 - 1031), 62762 - 62754), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1501 - 1450) + '\x35' + chr(51), 8), ehT0Px3KOsy9(chr(333 - 285) + chr(111) + chr(51) + chr(48) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + '\x33' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(9069 - 8958) + chr(0b101101 + 0o12) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(49) + chr(55 - 6), 61210 - 61202), ehT0Px3KOsy9(chr(368 - 320) + '\157' + '\x31' + chr(0b110111) + '\061', 28737 - 28729), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1010 + 0o47) + chr(0b110000) + '\060', 8), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1011000 + 0o27) + '\x33' + chr(50) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(360 - 312) + '\063', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(51) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1010111 + 0o30) + '\061' + chr(0b110011) + chr(1517 - 1468), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(1752 - 1703) + chr(54), 53334 - 53326), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\x33' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(0b11011 + 0o25), 0o10), ehT0Px3KOsy9(chr(904 - 856) + '\x6f' + '\x32' + chr(1067 - 1017) + chr(0b11011 + 0o34), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\064' + '\x30', 5774 - 5766), ehT0Px3KOsy9(chr(2264 - 2216) + chr(0b111111 + 0o60) + chr(0b1111 + 0o44) + chr(0b100100 + 0o15) + chr(0b100001 + 0o17), 30078 - 30070), ehT0Px3KOsy9(chr(311 - 263) + chr(4370 - 4259) + '\062' + '\x31' + chr(0b11010 + 0o31), 0b1000), ehT0Px3KOsy9(chr(943 - 895) + chr(0b1101 + 0o142) + '\061' + chr(49) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b101011 + 0o104) + '\x31' + chr(48) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101101 + 0o2) + '\x32' + '\067' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(618 - 570) + chr(0b1010100 + 0o33) + chr(0b10110 + 0o35) + chr(0b100101 + 0o14), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(529 - 474) + chr(98 - 43), 25720 - 25712), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\157' + chr(51) + '\064' + '\x35', 8), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\x35' + chr(2056 - 2006), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(232 - 180) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b100000 + 0o23) + chr(0b110101) + chr(55), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(919 - 866) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f'), '\x64' + chr(0b100011 + 0o102) + chr(0b1100011) + '\x6f' + '\x64' + '\x65')(chr(0b101011 + 0o112) + chr(0b1110100) + chr(0b1100110 + 0o0) + '\055' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def CHq0eBb1UpG7(Q_9rt8O3UnMu, YwMyLskbiCrd={}):
CpmW7QbBKf45 = [HHGaHsTa2uID(), fL9i9WS2bKxd(), D0W2T08AuFiO(), lVUetmvYhk97()]
Q_9rt8O3UnMu = [] if not Q_9rt8O3UnMu else Q_9rt8O3UnMu
if not UVSi4XW7eBIM((PlSM16l2KDPD(GG_JKdX7j9bN, MDXrEXqVz9i5) for GG_JKdX7j9bN in Q_9rt8O3UnMu)):
xafqLlk3kkUe(CpmW7QbBKf45, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\x96\xb4\x16\x97\x9f'), '\144' + '\x65' + chr(99) + chr(0b1101111) + chr(0b100001 + 0o103) + chr(7987 - 7886))(chr(3035 - 2918) + '\x74' + chr(5609 - 5507) + '\x2d' + '\070'))(ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + chr(0b110000), 0b1000), MDXrEXqVz9i5(parameters=YwMyLskbiCrd))
return AMHjLYdSBTFo(Q_9rt8O3UnMu + CpmW7QbBKf45)
|
awslabs/serverless-application-model
|
samtranslator/translator/translator.py
|
Translator.translate
|
def translate(self, sam_template, parameter_values):
"""Loads the SAM resources from the given SAM manifest, replaces them with their corresponding
CloudFormation resources, and returns the resulting CloudFormation template.
:param dict sam_template: the SAM manifest, as loaded by json.load() or yaml.load(), or as provided by \
CloudFormation transforms.
:param dict parameter_values: Map of template parameter names to their values. It is a required parameter that
should at least be an empty map. By providing an empty map, the caller explicitly opts-into the idea
that some functionality that relies on resolving parameter references might not work as expected
(ex: auto-creating new Lambda Version when CodeUri contains reference to template parameter). This is
why this parameter is required
:returns: a copy of the template with SAM resources replaced with the corresponding CloudFormation, which may \
be dumped into a valid CloudFormation JSON or YAML template
"""
sam_parameter_values = SamParameterValues(parameter_values)
sam_parameter_values.add_default_parameter_values(sam_template)
sam_parameter_values.add_pseudo_parameter_values()
parameter_values = sam_parameter_values.parameter_values
# Create & Install plugins
sam_plugins = prepare_plugins(self.plugins, parameter_values)
self.sam_parser.parse(
sam_template=sam_template,
parameter_values=parameter_values,
sam_plugins=sam_plugins
)
template = copy.deepcopy(sam_template)
macro_resolver = ResourceTypeResolver(sam_resources)
intrinsics_resolver = IntrinsicsResolver(parameter_values)
deployment_preference_collection = DeploymentPreferenceCollection()
supported_resource_refs = SupportedResourceReferences()
document_errors = []
changed_logical_ids = {}
for logical_id, resource_dict in self._get_resources_to_iterate(sam_template, macro_resolver):
try:
macro = macro_resolver\
.resolve_resource_type(resource_dict)\
.from_dict(logical_id, resource_dict, sam_plugins=sam_plugins)
kwargs = macro.resources_to_link(sam_template['Resources'])
kwargs['managed_policy_map'] = self.managed_policy_map
kwargs['intrinsics_resolver'] = intrinsics_resolver
kwargs['deployment_preference_collection'] = deployment_preference_collection
translated = macro.to_cloudformation(**kwargs)
supported_resource_refs = macro.get_resource_references(translated, supported_resource_refs)
# Some resources mutate their logical ids. Track those to change all references to them:
if logical_id != macro.logical_id:
changed_logical_ids[logical_id] = macro.logical_id
del template['Resources'][logical_id]
for resource in translated:
if verify_unique_logical_id(resource, sam_template['Resources']):
template['Resources'].update(resource.to_dict())
else:
document_errors.append(DuplicateLogicalIdException(
logical_id, resource.logical_id, resource.resource_type))
except (InvalidResourceException, InvalidEventException) as e:
document_errors.append(e)
if deployment_preference_collection.any_enabled():
template['Resources'].update(deployment_preference_collection.codedeploy_application.to_dict())
if not deployment_preference_collection.can_skip_service_role():
template['Resources'].update(deployment_preference_collection.codedeploy_iam_role.to_dict())
for logical_id in deployment_preference_collection.enabled_logical_ids():
template['Resources'].update(deployment_preference_collection.deployment_group(logical_id).to_dict())
# Run the after-transform plugin target
try:
sam_plugins.act(LifeCycleEvents.after_transform_template, template)
except (InvalidDocumentException, InvalidResourceException) as e:
document_errors.append(e)
# Cleanup
if 'Transform' in template:
del template['Transform']
if len(document_errors) == 0:
template = intrinsics_resolver.resolve_sam_resource_id_refs(template, changed_logical_ids)
template = intrinsics_resolver.resolve_sam_resource_refs(template, supported_resource_refs)
return template
else:
raise InvalidDocumentException(document_errors)
|
python
|
def translate(self, sam_template, parameter_values):
"""Loads the SAM resources from the given SAM manifest, replaces them with their corresponding
CloudFormation resources, and returns the resulting CloudFormation template.
:param dict sam_template: the SAM manifest, as loaded by json.load() or yaml.load(), or as provided by \
CloudFormation transforms.
:param dict parameter_values: Map of template parameter names to their values. It is a required parameter that
should at least be an empty map. By providing an empty map, the caller explicitly opts-into the idea
that some functionality that relies on resolving parameter references might not work as expected
(ex: auto-creating new Lambda Version when CodeUri contains reference to template parameter). This is
why this parameter is required
:returns: a copy of the template with SAM resources replaced with the corresponding CloudFormation, which may \
be dumped into a valid CloudFormation JSON or YAML template
"""
sam_parameter_values = SamParameterValues(parameter_values)
sam_parameter_values.add_default_parameter_values(sam_template)
sam_parameter_values.add_pseudo_parameter_values()
parameter_values = sam_parameter_values.parameter_values
# Create & Install plugins
sam_plugins = prepare_plugins(self.plugins, parameter_values)
self.sam_parser.parse(
sam_template=sam_template,
parameter_values=parameter_values,
sam_plugins=sam_plugins
)
template = copy.deepcopy(sam_template)
macro_resolver = ResourceTypeResolver(sam_resources)
intrinsics_resolver = IntrinsicsResolver(parameter_values)
deployment_preference_collection = DeploymentPreferenceCollection()
supported_resource_refs = SupportedResourceReferences()
document_errors = []
changed_logical_ids = {}
for logical_id, resource_dict in self._get_resources_to_iterate(sam_template, macro_resolver):
try:
macro = macro_resolver\
.resolve_resource_type(resource_dict)\
.from_dict(logical_id, resource_dict, sam_plugins=sam_plugins)
kwargs = macro.resources_to_link(sam_template['Resources'])
kwargs['managed_policy_map'] = self.managed_policy_map
kwargs['intrinsics_resolver'] = intrinsics_resolver
kwargs['deployment_preference_collection'] = deployment_preference_collection
translated = macro.to_cloudformation(**kwargs)
supported_resource_refs = macro.get_resource_references(translated, supported_resource_refs)
# Some resources mutate their logical ids. Track those to change all references to them:
if logical_id != macro.logical_id:
changed_logical_ids[logical_id] = macro.logical_id
del template['Resources'][logical_id]
for resource in translated:
if verify_unique_logical_id(resource, sam_template['Resources']):
template['Resources'].update(resource.to_dict())
else:
document_errors.append(DuplicateLogicalIdException(
logical_id, resource.logical_id, resource.resource_type))
except (InvalidResourceException, InvalidEventException) as e:
document_errors.append(e)
if deployment_preference_collection.any_enabled():
template['Resources'].update(deployment_preference_collection.codedeploy_application.to_dict())
if not deployment_preference_collection.can_skip_service_role():
template['Resources'].update(deployment_preference_collection.codedeploy_iam_role.to_dict())
for logical_id in deployment_preference_collection.enabled_logical_ids():
template['Resources'].update(deployment_preference_collection.deployment_group(logical_id).to_dict())
# Run the after-transform plugin target
try:
sam_plugins.act(LifeCycleEvents.after_transform_template, template)
except (InvalidDocumentException, InvalidResourceException) as e:
document_errors.append(e)
# Cleanup
if 'Transform' in template:
del template['Transform']
if len(document_errors) == 0:
template = intrinsics_resolver.resolve_sam_resource_id_refs(template, changed_logical_ids)
template = intrinsics_resolver.resolve_sam_resource_refs(template, supported_resource_refs)
return template
else:
raise InvalidDocumentException(document_errors)
|
[
"def",
"translate",
"(",
"self",
",",
"sam_template",
",",
"parameter_values",
")",
":",
"sam_parameter_values",
"=",
"SamParameterValues",
"(",
"parameter_values",
")",
"sam_parameter_values",
".",
"add_default_parameter_values",
"(",
"sam_template",
")",
"sam_parameter_values",
".",
"add_pseudo_parameter_values",
"(",
")",
"parameter_values",
"=",
"sam_parameter_values",
".",
"parameter_values",
"# Create & Install plugins",
"sam_plugins",
"=",
"prepare_plugins",
"(",
"self",
".",
"plugins",
",",
"parameter_values",
")",
"self",
".",
"sam_parser",
".",
"parse",
"(",
"sam_template",
"=",
"sam_template",
",",
"parameter_values",
"=",
"parameter_values",
",",
"sam_plugins",
"=",
"sam_plugins",
")",
"template",
"=",
"copy",
".",
"deepcopy",
"(",
"sam_template",
")",
"macro_resolver",
"=",
"ResourceTypeResolver",
"(",
"sam_resources",
")",
"intrinsics_resolver",
"=",
"IntrinsicsResolver",
"(",
"parameter_values",
")",
"deployment_preference_collection",
"=",
"DeploymentPreferenceCollection",
"(",
")",
"supported_resource_refs",
"=",
"SupportedResourceReferences",
"(",
")",
"document_errors",
"=",
"[",
"]",
"changed_logical_ids",
"=",
"{",
"}",
"for",
"logical_id",
",",
"resource_dict",
"in",
"self",
".",
"_get_resources_to_iterate",
"(",
"sam_template",
",",
"macro_resolver",
")",
":",
"try",
":",
"macro",
"=",
"macro_resolver",
".",
"resolve_resource_type",
"(",
"resource_dict",
")",
".",
"from_dict",
"(",
"logical_id",
",",
"resource_dict",
",",
"sam_plugins",
"=",
"sam_plugins",
")",
"kwargs",
"=",
"macro",
".",
"resources_to_link",
"(",
"sam_template",
"[",
"'Resources'",
"]",
")",
"kwargs",
"[",
"'managed_policy_map'",
"]",
"=",
"self",
".",
"managed_policy_map",
"kwargs",
"[",
"'intrinsics_resolver'",
"]",
"=",
"intrinsics_resolver",
"kwargs",
"[",
"'deployment_preference_collection'",
"]",
"=",
"deployment_preference_collection",
"translated",
"=",
"macro",
".",
"to_cloudformation",
"(",
"*",
"*",
"kwargs",
")",
"supported_resource_refs",
"=",
"macro",
".",
"get_resource_references",
"(",
"translated",
",",
"supported_resource_refs",
")",
"# Some resources mutate their logical ids. Track those to change all references to them:",
"if",
"logical_id",
"!=",
"macro",
".",
"logical_id",
":",
"changed_logical_ids",
"[",
"logical_id",
"]",
"=",
"macro",
".",
"logical_id",
"del",
"template",
"[",
"'Resources'",
"]",
"[",
"logical_id",
"]",
"for",
"resource",
"in",
"translated",
":",
"if",
"verify_unique_logical_id",
"(",
"resource",
",",
"sam_template",
"[",
"'Resources'",
"]",
")",
":",
"template",
"[",
"'Resources'",
"]",
".",
"update",
"(",
"resource",
".",
"to_dict",
"(",
")",
")",
"else",
":",
"document_errors",
".",
"append",
"(",
"DuplicateLogicalIdException",
"(",
"logical_id",
",",
"resource",
".",
"logical_id",
",",
"resource",
".",
"resource_type",
")",
")",
"except",
"(",
"InvalidResourceException",
",",
"InvalidEventException",
")",
"as",
"e",
":",
"document_errors",
".",
"append",
"(",
"e",
")",
"if",
"deployment_preference_collection",
".",
"any_enabled",
"(",
")",
":",
"template",
"[",
"'Resources'",
"]",
".",
"update",
"(",
"deployment_preference_collection",
".",
"codedeploy_application",
".",
"to_dict",
"(",
")",
")",
"if",
"not",
"deployment_preference_collection",
".",
"can_skip_service_role",
"(",
")",
":",
"template",
"[",
"'Resources'",
"]",
".",
"update",
"(",
"deployment_preference_collection",
".",
"codedeploy_iam_role",
".",
"to_dict",
"(",
")",
")",
"for",
"logical_id",
"in",
"deployment_preference_collection",
".",
"enabled_logical_ids",
"(",
")",
":",
"template",
"[",
"'Resources'",
"]",
".",
"update",
"(",
"deployment_preference_collection",
".",
"deployment_group",
"(",
"logical_id",
")",
".",
"to_dict",
"(",
")",
")",
"# Run the after-transform plugin target",
"try",
":",
"sam_plugins",
".",
"act",
"(",
"LifeCycleEvents",
".",
"after_transform_template",
",",
"template",
")",
"except",
"(",
"InvalidDocumentException",
",",
"InvalidResourceException",
")",
"as",
"e",
":",
"document_errors",
".",
"append",
"(",
"e",
")",
"# Cleanup",
"if",
"'Transform'",
"in",
"template",
":",
"del",
"template",
"[",
"'Transform'",
"]",
"if",
"len",
"(",
"document_errors",
")",
"==",
"0",
":",
"template",
"=",
"intrinsics_resolver",
".",
"resolve_sam_resource_id_refs",
"(",
"template",
",",
"changed_logical_ids",
")",
"template",
"=",
"intrinsics_resolver",
".",
"resolve_sam_resource_refs",
"(",
"template",
",",
"supported_resource_refs",
")",
"return",
"template",
"else",
":",
"raise",
"InvalidDocumentException",
"(",
"document_errors",
")"
] |
Loads the SAM resources from the given SAM manifest, replaces them with their corresponding
CloudFormation resources, and returns the resulting CloudFormation template.
:param dict sam_template: the SAM manifest, as loaded by json.load() or yaml.load(), or as provided by \
CloudFormation transforms.
:param dict parameter_values: Map of template parameter names to their values. It is a required parameter that
should at least be an empty map. By providing an empty map, the caller explicitly opts-into the idea
that some functionality that relies on resolving parameter references might not work as expected
(ex: auto-creating new Lambda Version when CodeUri contains reference to template parameter). This is
why this parameter is required
:returns: a copy of the template with SAM resources replaced with the corresponding CloudFormation, which may \
be dumped into a valid CloudFormation JSON or YAML template
|
[
"Loads",
"the",
"SAM",
"resources",
"from",
"the",
"given",
"SAM",
"manifest",
"replaces",
"them",
"with",
"their",
"corresponding",
"CloudFormation",
"resources",
"and",
"returns",
"the",
"resulting",
"CloudFormation",
"template",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/translator/translator.py#L34-L122
|
train
|
Translate the SAM template into CloudFormation template.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJ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yh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(2383 - 2329) + '\060', 0b1000), ehT0Px3KOsy9(chr(245 - 197) + chr(0b1101111) + '\x31' + chr(0b1101 + 0o43) + chr(0b110011), 11771 - 11763), ehT0Px3KOsy9(chr(1784 - 1736) + '\157' + chr(0b110011) + '\x33' + chr(0b100 + 0o55), 0o10), ehT0Px3KOsy9(chr(1028 - 980) + '\x6f' + '\x33' + chr(0b110110) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(341 - 293) + chr(111) + '\x32' + '\x35' + chr(0b100 + 0o55), 48162 - 48154), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b110100) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1101111) + '\x36' + '\065', 0b1000), ehT0Px3KOsy9(chr(1474 - 1426) + chr(111) + chr(2151 - 2096) + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(10852 - 10741) + chr(0b1101 + 0o46) + chr(52) + '\x30', 13156 - 13148), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(967 - 918) + chr(0b11011 + 0o26), 57897 - 57889), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(2639 - 2584) + chr(0b10 + 0o65), 35206 - 35198), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110110) + chr(0b100000 + 0o26), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110110) + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x37' + chr(1666 - 1613), 22114 - 22106), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1010001 + 0o36) + chr(51) + chr(0b111 + 0o60) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1101111) + chr(0b1100 + 0o47) + chr(52) + chr(0b101101 + 0o10), 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1101111) + '\061' + '\067' + '\x34', 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + chr(0b110101) + '\067', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(927 - 876) + chr(1059 - 1006) + '\x35', 41696 - 41688), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b101000 + 0o17) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(4940 - 4829) + chr(51) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(54) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2517 - 2462) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2388 - 2339) + '\064' + '\x31', 63329 - 63321), ehT0Px3KOsy9(chr(747 - 699) + chr(0b1101111) + '\063' + '\x36' + chr(0b11000 + 0o31), ord("\x08")), ehT0Px3KOsy9(chr(373 - 325) + chr(0b1000001 + 0o56) + chr(0b100101 + 0o14) + '\062' + chr(0b11000 + 0o32), 2215 - 2207), ehT0Px3KOsy9(chr(48) + chr(4199 - 4088) + '\067' + chr(51), 8865 - 8857), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(53) + '\x37', 23371 - 23363), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + '\x34' + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b11100 + 0o123) + chr(0b110110) + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(48) + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1100011 + 0o14) + chr(0b110001) + chr(2016 - 1964) + chr(54), 8), ehT0Px3KOsy9(chr(0b110000) + chr(11812 - 11701) + '\x33' + '\065' + chr(0b110101), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(0b110001) + chr(52), 28328 - 28320), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010 + 0o4) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b100111 + 0o110) + '\062' + chr(52) + '\x34', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110 + 0o53) + '\063' + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b111 + 0o55) + chr(51), 386 - 378), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010 + 0o0) + '\x33' + chr(0b100001 + 0o20), ord("\x08")), ehT0Px3KOsy9('\060' + chr(1246 - 1135) + chr(0b110011) + chr(49), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11010 + 0o33) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xde'), chr(0b1100100) + chr(0b1001010 + 0o33) + chr(0b1100011) + chr(8774 - 8663) + chr(0b1100100) + '\x65')('\165' + '\164' + chr(7749 - 7647) + chr(631 - 586) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def M3DrKJMRcF55(oVre8I6UXc3b, b8qPeGfJV4aN, PPceYe5Mkdxr):
Zzik5o9ywYeY = b6LCRunT2UvV(PPceYe5Mkdxr)
xafqLlk3kkUe(Zzik5o9ywYeY, xafqLlk3kkUe(SXOLrMavuUCe(b"\x91'\xbd\xab\xcd\x03S^\x95e\x8bi@\\\x8b\x84\x11J\x99\xdfmlH\x00\x9d'^\xdc"), chr(0b100100 + 0o100) + chr(0b1100101) + chr(0b1100011) + chr(6699 - 6588) + '\144' + chr(101))(chr(3280 - 3163) + chr(10679 - 10563) + '\x66' + chr(59 - 14) + chr(0b111000)))(b8qPeGfJV4aN)
xafqLlk3kkUe(Zzik5o9ywYeY, xafqLlk3kkUe(SXOLrMavuUCe(b"\x91'\xbd\xab\xd9\x15PJ\x84f\xa0FQO\x98\x88\x19[\x88\xc8@E_\r\x847H"), chr(0b101101 + 0o67) + '\145' + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1110101) + '\164' + chr(0b1000100 + 0o42) + chr(1581 - 1536) + chr(2063 - 2007)))()
PPceYe5Mkdxr = Zzik5o9ywYeY.PPceYe5Mkdxr
xTcXYyyLbR1j = CHq0eBb1UpG7(oVre8I6UXc3b.plugins, PPceYe5Mkdxr)
xafqLlk3kkUe(oVre8I6UXc3b.sam_parser, xafqLlk3kkUe(SXOLrMavuUCe(b'\x80"\xab\x87\xcc'), chr(0b1100100) + chr(101) + '\x63' + chr(111) + '\x64' + '\145')(chr(0b1110101) + chr(116) + chr(8107 - 8005) + chr(45) + '\x38'))(sam_template=b8qPeGfJV4aN, parameter_values=PPceYe5Mkdxr, sam_plugins=xTcXYyyLbR1j)
jJBnSHEgylNZ = igThHS4jwVsa.deepcopy(b8qPeGfJV4aN)
d0Q42vRcmi8g = yzsLqBf_I2Id(SXQfQ05yPbiM)
M8xEnnSGIF9g = Ie_QGVddKhNC(PPceYe5Mkdxr)
yk3gNLcIEzh3 = Hv241oBzP9nd()
KvSmPUitKt7D = HHh4hsHyR5op()
DNivkzoUDhSE = []
Cxt6F9ZvGLZo = {}
for (NpZr66MdBhVG, YRwNbm9OifOu) in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaf$\xbc\x80\xf6\x14PL\x8f|\x8dUUN\xa6\x91\x13p\x84\xcezA_\x15\x94'), chr(3035 - 2935) + '\145' + '\143' + '\x6f' + '\144' + '\x65')(chr(0b1110101) + '\x74' + chr(0b1100010 + 0o4) + chr(0b11001 + 0o24) + '\x38'))(b8qPeGfJV4aN, d0Q42vRcmi8g):
try:
gpqwUrG1lGtW = d0Q42vRcmi8g.resolve_resource_type(YRwNbm9OifOu).from_dict(NpZr66MdBhVG, YRwNbm9OifOu, sam_plugins=xTcXYyyLbR1j)
M8EIoTs2GJXE = gpqwUrG1lGtW.resources_to_link(b8qPeGfJV4aN[xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2&\xaa\x9b\xdc\x14VZ\x93'), '\x64' + chr(0b1100101) + chr(0b1011000 + 0o13) + chr(0b110111 + 0o70) + '\144' + chr(101))(chr(0b11010 + 0o133) + chr(0b111011 + 0o71) + '\x66' + '\x2d' + chr(56))])
M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d"\xb7\x95\xce\x03Q`\x90f\x93_SD\xa6\x88\x1d_'), chr(293 - 193) + '\145' + chr(8269 - 8170) + chr(3991 - 3880) + chr(0b1100100) + chr(0b111 + 0o136))(chr(7087 - 6970) + '\164' + chr(0b1100110) + chr(0b101101) + chr(0b10010 + 0o46))] = oVre8I6UXc3b.managed_policy_map
M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b'\x99-\xad\x86\xc0\x08FV\x83z\xa0DUN\x96\x89\nJ\x9f'), '\x64' + chr(101) + chr(0b101000 + 0o73) + chr(4643 - 4532) + chr(100) + chr(0b1100101))('\165' + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(0b1010 + 0o56))] = M8xEnnSGIF9g
M8EIoTs2GJXE[xafqLlk3kkUe(SXOLrMavuUCe(b'\x94&\xa9\x98\xc6\x1fXZ\x8e}\xa0FBX\x9f\x80\x0eJ\x83\xd9zl]\x0e\x9d>^\xcc\x97]*\x08'), chr(0b1100100) + chr(0b1100101) + chr(0b101011 + 0o70) + chr(0b1101111) + chr(2956 - 2856) + chr(0b1100101))('\x75' + chr(0b101010 + 0o112) + chr(102) + '\x2d' + '\070')] = yk3gNLcIEzh3
_KkUAwnxQLu8 = gpqwUrG1lGtW.to_cloudformation(**M8EIoTs2GJXE)
KvSmPUitKt7D = gpqwUrG1lGtW.get_resource_references(_KkUAwnxQLu8, KvSmPUitKt7D)
if NpZr66MdBhVG != xafqLlk3kkUe(gpqwUrG1lGtW, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe3\x83\x86\x9fPx[\xa2a\xa9q'), '\144' + chr(0b1001001 + 0o34) + '\143' + chr(0b1101111) + '\x64' + '\145')(chr(5354 - 5237) + '\x74' + chr(0b1100110) + chr(0b11000 + 0o25) + chr(56))):
Cxt6F9ZvGLZo[NpZr66MdBhVG] = gpqwUrG1lGtW.NpZr66MdBhVG
del jJBnSHEgylNZ[xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2&\xaa\x9b\xdc\x14VZ\x93'), '\x64' + chr(0b1011100 + 0o11) + chr(0b0 + 0o143) + chr(10129 - 10018) + '\x64' + '\145')('\x75' + '\x74' + '\146' + '\x2d' + chr(897 - 841))][NpZr66MdBhVG]
for o9IPj2MJBBod in _KkUAwnxQLu8:
if FI8nOiiZCV5y(o9IPj2MJBBod, b8qPeGfJV4aN[xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2&\xaa\x9b\xdc\x14VZ\x93'), chr(0b1100100) + chr(101) + '\x63' + '\x6f' + '\x64' + '\145')('\x75' + chr(0b1110100) + '\146' + chr(0b101011 + 0o2) + chr(0b111000))]):
xafqLlk3kkUe(jJBnSHEgylNZ[xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2&\xaa\x9b\xdc\x14VZ\x93'), chr(0b1010001 + 0o23) + chr(6113 - 6012) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(117) + '\x74' + chr(102) + chr(0b101101) + '\x38')], xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa7\x98\xb1\xc0(\x7fQ\x99=\x9a\x06'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(371 - 271) + chr(101))(chr(0b1010101 + 0o40) + chr(116) + '\x66' + chr(0b101101) + chr(0b111000)))(xafqLlk3kkUe(o9IPj2MJBBod, xafqLlk3kkUe(SXOLrMavuUCe(b'\x84,\x86\x90\xc0\x05A'), chr(0b1010010 + 0o22) + '\145' + chr(4500 - 4401) + chr(0b1101111) + chr(6350 - 6250) + chr(0b100111 + 0o76))('\165' + chr(0b1110100) + chr(0b1100110) + chr(338 - 293) + '\x38'))())
else:
xafqLlk3kkUe(DNivkzoUDhSE, xafqLlk3kkUe(SXOLrMavuUCe(b'\x913\xa9\x91\xc7\x02'), chr(0b1100100) + '\x65' + chr(99) + '\x6f' + chr(0b1100100) + '\x65')(chr(0b1110 + 0o147) + chr(2490 - 2374) + '\x66' + chr(45) + chr(0b111000)))(p14tONqdb2mg(NpZr66MdBhVG, xafqLlk3kkUe(o9IPj2MJBBod, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe3\x83\x86\x9fPx[\xa2a\xa9q'), chr(2832 - 2732) + '\145' + chr(5087 - 4988) + '\x6f' + chr(621 - 521) + '\145')(chr(0b1011110 + 0o27) + '\164' + chr(0b1100110) + chr(899 - 854) + chr(0b11001 + 0o37))), xafqLlk3kkUe(o9IPj2MJBBod, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82&\xaa\x9b\xdc\x14VZ\xbf}\x86FU'), chr(100) + '\x65' + chr(0b1100 + 0o127) + chr(0b1101010 + 0o5) + '\x64' + chr(6818 - 6717))(chr(390 - 273) + chr(0b1110100) + '\x66' + chr(45) + chr(3007 - 2951)))))
except (ow8Lll3lwq0h, eXWqlSUlGxPF) as GlnVAPeT6CUe:
xafqLlk3kkUe(DNivkzoUDhSE, xafqLlk3kkUe(SXOLrMavuUCe(b'\x913\xa9\x91\xc7\x02'), '\x64' + chr(9941 - 9840) + chr(9721 - 9622) + chr(0b1001110 + 0o41) + chr(8218 - 8118) + '\145')(chr(0b110000 + 0o105) + '\164' + chr(0b100111 + 0o77) + '\x2d' + chr(2508 - 2452)))(GlnVAPeT6CUe)
if xafqLlk3kkUe(yk3gNLcIEzh3, xafqLlk3kkUe(SXOLrMavuUCe(b'\x91-\xa0\xab\xcc\x08T]\x8cl\x9b'), '\144' + '\145' + '\x63' + chr(111) + '\x64' + '\145')(chr(2478 - 2361) + chr(0b110011 + 0o101) + chr(102) + chr(45) + '\070'))():
xafqLlk3kkUe(jJBnSHEgylNZ[xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2&\xaa\x9b\xdc\x14VZ\x93'), chr(1733 - 1633) + chr(0b100 + 0o141) + '\x63' + '\157' + '\144' + chr(8350 - 8249))(chr(117) + '\x74' + '\146' + chr(1950 - 1905) + chr(0b111000))], xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa7\x98\xb1\xc0(\x7fQ\x99=\x9a\x06'), chr(0b1100100) + chr(101) + chr(0b11110 + 0o105) + chr(111) + '\144' + chr(896 - 795))(chr(117) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(2449 - 2393)))(xafqLlk3kkUe(yk3gNLcIEzh3.codedeploy_application, xafqLlk3kkUe(SXOLrMavuUCe(b'\x84,\x86\x90\xc0\x05A'), chr(100) + chr(0b1100101) + chr(99) + '\x6f' + chr(100) + chr(0b1100101))(chr(7045 - 6928) + chr(0b1100 + 0o150) + '\146' + chr(45) + chr(2287 - 2231)))())
if not xafqLlk3kkUe(yk3gNLcIEzh3, xafqLlk3kkUe(SXOLrMavuUCe(b'\x93"\xb7\xab\xda\r\\O\xbfz\x9aDFT\x9a\x80#]\x82\xd6z'), chr(0b100111 + 0o75) + chr(0b1100101) + chr(8431 - 8332) + chr(111) + chr(2225 - 2125) + chr(10068 - 9967))(chr(0b1110101) + '\164' + chr(102) + chr(0b101101) + chr(0b1011 + 0o55)))():
xafqLlk3kkUe(jJBnSHEgylNZ[xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2&\xaa\x9b\xdc\x14VZ\x93'), '\x64' + '\x65' + chr(99) + '\157' + chr(6727 - 6627) + chr(101))(chr(0b1110101) + chr(0b1110011 + 0o1) + chr(0b100111 + 0o77) + chr(0b1000 + 0o45) + chr(0b111000))], xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa7\x98\xb1\xc0(\x7fQ\x99=\x9a\x06'), chr(7684 - 7584) + '\x65' + '\143' + '\x6f' + chr(0b101101 + 0o67) + '\x65')('\x75' + chr(2987 - 2871) + '\146' + chr(0b101101) + '\x38'))(xafqLlk3kkUe(yk3gNLcIEzh3.codedeploy_iam_role, xafqLlk3kkUe(SXOLrMavuUCe(b'\x84,\x86\x90\xc0\x05A'), '\x64' + chr(3257 - 3156) + chr(5169 - 5070) + '\157' + chr(0b1100100) + chr(0b1011000 + 0o15))(chr(117) + chr(0b100110 + 0o116) + '\x66' + '\x2d' + chr(56)))())
for NpZr66MdBhVG in xafqLlk3kkUe(yk3gNLcIEzh3, xafqLlk3kkUe(SXOLrMavuUCe(b'\x95-\xb8\x96\xc5\x03Q`\x8cf\x98_S\\\x95\xba\x15K\x9e'), '\x64' + '\x65' + chr(6349 - 6250) + chr(0b1101111) + '\x64' + chr(101))(chr(0b1011011 + 0o32) + '\164' + chr(0b1100 + 0o132) + chr(45) + chr(0b111000)))():
xafqLlk3kkUe(jJBnSHEgylNZ[xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2&\xaa\x9b\xdc\x14VZ\x93'), chr(0b100001 + 0o103) + chr(0b1100101 + 0o0) + chr(0b111100 + 0o47) + chr(111) + chr(0b1000001 + 0o43) + chr(0b100011 + 0o102))('\x75' + chr(11648 - 11532) + chr(0b100001 + 0o105) + '\x2d' + '\070')], xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa7\x98\xb1\xc0(\x7fQ\x99=\x9a\x06'), '\x64' + '\145' + chr(99) + chr(8294 - 8183) + chr(9520 - 9420) + chr(0b1100101))(chr(117) + chr(0b111010 + 0o72) + chr(0b1100110) + chr(0b101101) + '\070'))(xafqLlk3kkUe(yk3gNLcIEzh3.deployment_group(NpZr66MdBhVG), xafqLlk3kkUe(SXOLrMavuUCe(b'\x84,\x86\x90\xc0\x05A'), chr(6546 - 6446) + chr(8444 - 8343) + '\143' + chr(111) + chr(0b10000 + 0o124) + chr(101))(chr(5728 - 5611) + '\164' + '\146' + chr(0b101101) + '\070'))())
try:
xafqLlk3kkUe(xTcXYyyLbR1j, xafqLlk3kkUe(SXOLrMavuUCe(b'\x91 \xad'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(0b10111 + 0o130) + '\144' + chr(531 - 430))('\x75' + '\x74' + '\x66' + chr(45) + '\x38'))(xafqLlk3kkUe(YL6Sdfw_L5US, xafqLlk3kkUe(SXOLrMavuUCe(b'\x91%\xad\x91\xdb9AM\x81g\x8cP_O\x94\xba\x08J\x80\xcasRJ\x04'), '\144' + chr(101) + chr(99) + '\157' + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(116) + '\x66' + chr(0b101010 + 0o3) + chr(0b111000))), jJBnSHEgylNZ)
except (WAOffgnUIwTZ, ow8Lll3lwq0h) as GlnVAPeT6CUe:
xafqLlk3kkUe(DNivkzoUDhSE, xafqLlk3kkUe(SXOLrMavuUCe(b'\x913\xa9\x91\xc7\x02'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(5313 - 5212))('\x75' + chr(0b1110100) + chr(1043 - 941) + chr(45) + chr(56)))(GlnVAPeT6CUe)
if xafqLlk3kkUe(SXOLrMavuUCe(b'\xa41\xb8\x9a\xda\x00ZM\x8d'), chr(100) + chr(0b101 + 0o140) + chr(0b100101 + 0o76) + chr(10530 - 10419) + chr(100) + chr(8145 - 8044))(chr(117) + chr(0b1011000 + 0o34) + chr(0b1100110) + chr(726 - 681) + chr(56)) in jJBnSHEgylNZ:
del jJBnSHEgylNZ[xafqLlk3kkUe(SXOLrMavuUCe(b'\xa41\xb8\x9a\xda\x00ZM\x8d'), '\x64' + chr(0b1100101) + chr(99) + chr(8765 - 8654) + chr(0b1100100) + chr(0b1010010 + 0o23))(chr(117) + chr(0b1100101 + 0o17) + chr(6172 - 6070) + chr(844 - 799) + chr(56))]
if c2A0yzQpDQB3(DNivkzoUDhSE) == ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1011101 + 0o22) + chr(152 - 104), 0b1000):
jJBnSHEgylNZ = M8xEnnSGIF9g.resolve_sam_resource_id_refs(jJBnSHEgylNZ, Cxt6F9ZvGLZo)
jJBnSHEgylNZ = M8xEnnSGIF9g.resolve_sam_resource_refs(jJBnSHEgylNZ, KvSmPUitKt7D)
return jJBnSHEgylNZ
else:
raise WAOffgnUIwTZ(DNivkzoUDhSE)
|
awslabs/serverless-application-model
|
samtranslator/translator/translator.py
|
Translator._get_resources_to_iterate
|
def _get_resources_to_iterate(self, sam_template, macro_resolver):
"""
Returns a list of resources to iterate, order them based on the following order:
1. AWS::Serverless::Function - because API Events need to modify the corresponding Serverless::Api resource.
2. AWS::Serverless::Api
3. Anything else
This is necessary because a Function resource with API Events will modify the API resource's Swagger JSON.
Therefore API resource needs to be parsed only after all the Swagger modifications are complete.
:param dict sam_template: SAM template
:param macro_resolver: Resolver that knows if a resource can be processed or not
:return list: List containing tuple of (logicalId, resource_dict) in the order of processing
"""
functions = []
apis = []
others = []
resources = sam_template["Resources"]
for logicalId, resource in resources.items():
data = (logicalId, resource)
# Skip over the resource if it is not a SAM defined Resource
if not macro_resolver.can_resolve(resource):
continue
elif resource["Type"] == "AWS::Serverless::Function":
functions.append(data)
elif resource["Type"] == "AWS::Serverless::Api":
apis.append(data)
else:
others.append(data)
return functions + apis + others
|
python
|
def _get_resources_to_iterate(self, sam_template, macro_resolver):
"""
Returns a list of resources to iterate, order them based on the following order:
1. AWS::Serverless::Function - because API Events need to modify the corresponding Serverless::Api resource.
2. AWS::Serverless::Api
3. Anything else
This is necessary because a Function resource with API Events will modify the API resource's Swagger JSON.
Therefore API resource needs to be parsed only after all the Swagger modifications are complete.
:param dict sam_template: SAM template
:param macro_resolver: Resolver that knows if a resource can be processed or not
:return list: List containing tuple of (logicalId, resource_dict) in the order of processing
"""
functions = []
apis = []
others = []
resources = sam_template["Resources"]
for logicalId, resource in resources.items():
data = (logicalId, resource)
# Skip over the resource if it is not a SAM defined Resource
if not macro_resolver.can_resolve(resource):
continue
elif resource["Type"] == "AWS::Serverless::Function":
functions.append(data)
elif resource["Type"] == "AWS::Serverless::Api":
apis.append(data)
else:
others.append(data)
return functions + apis + others
|
[
"def",
"_get_resources_to_iterate",
"(",
"self",
",",
"sam_template",
",",
"macro_resolver",
")",
":",
"functions",
"=",
"[",
"]",
"apis",
"=",
"[",
"]",
"others",
"=",
"[",
"]",
"resources",
"=",
"sam_template",
"[",
"\"Resources\"",
"]",
"for",
"logicalId",
",",
"resource",
"in",
"resources",
".",
"items",
"(",
")",
":",
"data",
"=",
"(",
"logicalId",
",",
"resource",
")",
"# Skip over the resource if it is not a SAM defined Resource",
"if",
"not",
"macro_resolver",
".",
"can_resolve",
"(",
"resource",
")",
":",
"continue",
"elif",
"resource",
"[",
"\"Type\"",
"]",
"==",
"\"AWS::Serverless::Function\"",
":",
"functions",
".",
"append",
"(",
"data",
")",
"elif",
"resource",
"[",
"\"Type\"",
"]",
"==",
"\"AWS::Serverless::Api\"",
":",
"apis",
".",
"append",
"(",
"data",
")",
"else",
":",
"others",
".",
"append",
"(",
"data",
")",
"return",
"functions",
"+",
"apis",
"+",
"others"
] |
Returns a list of resources to iterate, order them based on the following order:
1. AWS::Serverless::Function - because API Events need to modify the corresponding Serverless::Api resource.
2. AWS::Serverless::Api
3. Anything else
This is necessary because a Function resource with API Events will modify the API resource's Swagger JSON.
Therefore API resource needs to be parsed only after all the Swagger modifications are complete.
:param dict sam_template: SAM template
:param macro_resolver: Resolver that knows if a resource can be processed or not
:return list: List containing tuple of (logicalId, resource_dict) in the order of processing
|
[
"Returns",
"a",
"list",
"of",
"resources",
"to",
"iterate",
"order",
"them",
"based",
"on",
"the",
"following",
"order",
":"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/translator/translator.py#L125-L160
|
train
|
Returns a list of resources to iterate over based on the given SAM template and macro resolver.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BM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kSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + '\062' + chr(0b1001 + 0o56), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\157' + chr(49), 38870 - 38862), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(3714 - 3603) + chr(49) + chr(0b10110 + 0o41) + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10101 + 0o34) + '\061' + '\x37', 6394 - 6386), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(55) + chr(2348 - 2293), ord("\x08")), ehT0Px3KOsy9(chr(1551 - 1503) + '\x6f' + chr(51) + '\x33' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(493 - 445) + '\x6f' + chr(0b100100 + 0o23) + chr(0b101000 + 0o15), 14311 - 14303), ehT0Px3KOsy9('\x30' + chr(0b10001 + 0o136) + '\x31', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b110011) + chr(55), 25517 - 25509), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(0b1111 + 0o44) + chr(0b1110 + 0o44), ord("\x08")), ehT0Px3KOsy9(chr(1661 - 1613) + '\157' + '\x31', 8), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\157' + chr(2023 - 1973) + '\x36' + chr(55), 10156 - 10148), ehT0Px3KOsy9('\060' + chr(111) + chr(1954 - 1904) + chr(0b10000 + 0o40) + chr(0b0 + 0o63), ord("\x08")), ehT0Px3KOsy9(chr(1719 - 1671) + chr(111) + '\x33' + chr(0b110110) + chr(624 - 570), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10011 + 0o134) + '\061' + '\067' + chr(0b11100 + 0o32), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b111 + 0o60) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(0b110010) + chr(491 - 440), 0o10), ehT0Px3KOsy9('\x30' + chr(1438 - 1327) + chr(338 - 288) + chr(0b110001 + 0o6) + chr(1180 - 1130), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b11100 + 0o123) + chr(0b110011) + chr(1842 - 1794) + chr(0b110011 + 0o3), 0b1000), ehT0Px3KOsy9(chr(964 - 916) + chr(111) + chr(0b1011 + 0o46) + chr(0b110001) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5193 - 5082) + chr(0b110001) + chr(0b110 + 0o56) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + '\061' + chr(641 - 593) + chr(546 - 497), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110100 + 0o3) + chr(1208 - 1154), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + '\x37' + '\x36', 8), ehT0Px3KOsy9('\x30' + chr(0b1100011 + 0o14) + chr(0b110011) + chr(53) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(1575 - 1527) + '\x6f' + chr(49) + chr(0b110100) + chr(0b110011 + 0o1), 0b1000), ehT0Px3KOsy9(chr(805 - 757) + chr(0b1101111) + chr(0b110001) + '\067' + chr(0b100110 + 0o16), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(0b10010 + 0o42) + chr(53), 22773 - 22765), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(0b110001) + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(2278 - 2228) + '\x35' + chr(1512 - 1463), 0b1000), ehT0Px3KOsy9(chr(549 - 501) + chr(0b100111 + 0o110) + chr(2413 - 2361) + chr(0b101010 + 0o13), 18472 - 18464), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(0b110100) + chr(955 - 900), 20499 - 20491), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(53) + chr(578 - 529), 29474 - 29466), ehT0Px3KOsy9('\x30' + '\157' + chr(1627 - 1576) + chr(0b110001) + chr(726 - 678), ord("\x08")), ehT0Px3KOsy9(chr(1231 - 1183) + chr(5787 - 5676) + chr(129 - 78) + chr(52) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(4570 - 4459) + chr(0b110001) + chr(827 - 772) + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2389 - 2339) + '\064' + chr(0b101000 + 0o10), 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(1861 - 1812) + chr(1608 - 1555) + chr(0b10000 + 0o47), 12695 - 12687), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100100 + 0o17) + '\x33' + chr(52), 60502 - 60494), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(50), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + chr(53) + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'y'), chr(100) + chr(101) + chr(7581 - 7482) + chr(111) + chr(0b1100100) + '\145')(chr(117) + chr(12371 - 12255) + '\x66' + chr(45) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def HOeLY9nuEcPw(oVre8I6UXc3b, b8qPeGfJV4aN, d0Q42vRcmi8g):
C1R32KxhgJbQ = []
V1IN103w2ZAe = []
mgRG23A_LfH9 = []
z4Xs9XhDbg00 = b8qPeGfJV4aN[xafqLlk3kkUe(SXOLrMavuUCe(b'\x05d\x0e \x8a\xaa^d\xec'), chr(0b1100100) + chr(0b1100101) + '\x63' + '\x6f' + '\144' + chr(101))(chr(117) + chr(12724 - 12608) + '\146' + chr(1456 - 1411) + chr(2902 - 2846))]
for (gvQh1eVhOwBf, o9IPj2MJBBod) in xafqLlk3kkUe(z4Xs9XhDbg00, xafqLlk3kkUe(SXOLrMavuUCe(b'\x19{\x0b*\xb6\x82\x0eH\xf3\x89I\x8e'), '\144' + chr(0b1011111 + 0o6) + chr(935 - 836) + chr(0b1101111) + '\144' + chr(7359 - 7258))('\x75' + '\164' + chr(102) + chr(45) + chr(0b10100 + 0o44)))():
ULnjp6D6efFH = (gvQh1eVhOwBf, o9IPj2MJBBod)
if not xafqLlk3kkUe(d0Q42vRcmi8g, xafqLlk3kkUe(SXOLrMavuUCe(b'4`\x13\x10\x8d\xbdNn\xf3\xacd'), '\144' + chr(0b1100101) + chr(0b1100011) + '\157' + '\x64' + '\145')(chr(0b1110101) + '\x74' + chr(6023 - 5921) + '\x2d' + chr(0b111000)))(o9IPj2MJBBod):
continue
elif o9IPj2MJBBod[xafqLlk3kkUe(SXOLrMavuUCe(b'\x03x\r*'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(862 - 751) + chr(0b1100100) + chr(101))(chr(1680 - 1563) + '\164' + chr(0b1100110) + chr(45) + chr(0b10111 + 0o41))] == xafqLlk3kkUe(SXOLrMavuUCe(b'\x16V.u\xc5\x8bXs\xe9\xbfs\xdb\xe6\x85\r\x83\xe9\xfc\xb3"\x025\x17\x11\x83'), '\144' + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(4537 - 4436))('\165' + chr(116) + '\x66' + chr(0b11001 + 0o24) + chr(56)):
xafqLlk3kkUe(C1R32KxhgJbQ, xafqLlk3kkUe(SXOLrMavuUCe(b'6q\r*\x91\xbc'), chr(7832 - 7732) + chr(314 - 213) + chr(0b1100011) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(3040 - 2923) + chr(0b1110100) + chr(0b1100110) + chr(45) + '\070'))(ULnjp6D6efFH)
elif o9IPj2MJBBod[xafqLlk3kkUe(SXOLrMavuUCe(b'\x03x\r*'), chr(7507 - 7407) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b101000 + 0o74) + chr(0b1100101))('\165' + chr(0b1110100 + 0o0) + '\146' + chr(0b101011 + 0o2) + chr(56))] == xafqLlk3kkUe(SXOLrMavuUCe(b'\x16V.u\xc5\x8bXs\xe9\xbfs\xdb\xe6\x85\r\x83\xe9\xfb\xb6%'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1000011 + 0o41) + chr(7731 - 7630))('\165' + chr(5249 - 5133) + chr(0b1100110) + chr(883 - 838) + '\x38'):
xafqLlk3kkUe(V1IN103w2ZAe, xafqLlk3kkUe(SXOLrMavuUCe(b'6q\r*\x91\xbc'), chr(100) + chr(101) + chr(5159 - 5060) + chr(111) + chr(0b1100100) + chr(6232 - 6131))(chr(117) + '\x74' + chr(102) + chr(0b10000 + 0o35) + chr(0b101000 + 0o20)))(ULnjp6D6efFH)
else:
xafqLlk3kkUe(mgRG23A_LfH9, xafqLlk3kkUe(SXOLrMavuUCe(b'6q\r*\x91\xbc'), '\x64' + '\145' + '\x63' + chr(111) + chr(100) + '\145')('\165' + '\164' + chr(0b1100110) + chr(0b101101) + chr(1643 - 1587)))(ULnjp6D6efFH)
return C1R32KxhgJbQ + V1IN103w2ZAe + mgRG23A_LfH9
|
awslabs/serverless-application-model
|
samtranslator/model/__init__.py
|
Resource.from_dict
|
def from_dict(cls, logical_id, resource_dict, relative_id=None, sam_plugins=None):
"""Constructs a Resource object with the given logical id, based on the given resource dict. The resource dict
is the value associated with the logical id in a CloudFormation template's Resources section, and takes the
following format. ::
{
"Type": "<resource type>",
"Properties": {
<set of properties>
}
}
:param str logical_id: The logical id of this Resource
:param dict resource_dict: The value associated with this logical id in the CloudFormation template, a mapping \
containing the resource's Type and Properties.
:param str relative_id: The logical id of this resource relative to the logical_id. This is useful
to identify sub-resources.
:param samtranslator.plugins.SamPlugins sam_plugins: Optional plugins object to help enhance functionality of
translator
:returns: a Resource object populated from the provided parameters
:rtype: Resource
:raises TypeError: if the provided parameters are invalid
"""
resource = cls(logical_id, relative_id=relative_id)
resource._validate_resource_dict(logical_id, resource_dict)
# Default to empty properties dictionary. If customers skip the Properties section, an empty dictionary
# accurately captures the intent.
properties = resource_dict.get("Properties", {})
if sam_plugins:
sam_plugins.act(LifeCycleEvents.before_transform_resource, logical_id, cls.resource_type, properties)
for name, value in properties.items():
setattr(resource, name, value)
if 'DependsOn' in resource_dict:
resource.depends_on = resource_dict['DependsOn']
# Parse only well known properties. This is consistent with earlier behavior where we used to ignore resource
# all resource attributes ie. all attributes were unsupported before
for attr in resource._supported_resource_attributes:
if attr in resource_dict:
resource.set_resource_attribute(attr, resource_dict[attr])
resource.validate_properties()
return resource
|
python
|
def from_dict(cls, logical_id, resource_dict, relative_id=None, sam_plugins=None):
"""Constructs a Resource object with the given logical id, based on the given resource dict. The resource dict
is the value associated with the logical id in a CloudFormation template's Resources section, and takes the
following format. ::
{
"Type": "<resource type>",
"Properties": {
<set of properties>
}
}
:param str logical_id: The logical id of this Resource
:param dict resource_dict: The value associated with this logical id in the CloudFormation template, a mapping \
containing the resource's Type and Properties.
:param str relative_id: The logical id of this resource relative to the logical_id. This is useful
to identify sub-resources.
:param samtranslator.plugins.SamPlugins sam_plugins: Optional plugins object to help enhance functionality of
translator
:returns: a Resource object populated from the provided parameters
:rtype: Resource
:raises TypeError: if the provided parameters are invalid
"""
resource = cls(logical_id, relative_id=relative_id)
resource._validate_resource_dict(logical_id, resource_dict)
# Default to empty properties dictionary. If customers skip the Properties section, an empty dictionary
# accurately captures the intent.
properties = resource_dict.get("Properties", {})
if sam_plugins:
sam_plugins.act(LifeCycleEvents.before_transform_resource, logical_id, cls.resource_type, properties)
for name, value in properties.items():
setattr(resource, name, value)
if 'DependsOn' in resource_dict:
resource.depends_on = resource_dict['DependsOn']
# Parse only well known properties. This is consistent with earlier behavior where we used to ignore resource
# all resource attributes ie. all attributes were unsupported before
for attr in resource._supported_resource_attributes:
if attr in resource_dict:
resource.set_resource_attribute(attr, resource_dict[attr])
resource.validate_properties()
return resource
|
[
"def",
"from_dict",
"(",
"cls",
",",
"logical_id",
",",
"resource_dict",
",",
"relative_id",
"=",
"None",
",",
"sam_plugins",
"=",
"None",
")",
":",
"resource",
"=",
"cls",
"(",
"logical_id",
",",
"relative_id",
"=",
"relative_id",
")",
"resource",
".",
"_validate_resource_dict",
"(",
"logical_id",
",",
"resource_dict",
")",
"# Default to empty properties dictionary. If customers skip the Properties section, an empty dictionary",
"# accurately captures the intent.",
"properties",
"=",
"resource_dict",
".",
"get",
"(",
"\"Properties\"",
",",
"{",
"}",
")",
"if",
"sam_plugins",
":",
"sam_plugins",
".",
"act",
"(",
"LifeCycleEvents",
".",
"before_transform_resource",
",",
"logical_id",
",",
"cls",
".",
"resource_type",
",",
"properties",
")",
"for",
"name",
",",
"value",
"in",
"properties",
".",
"items",
"(",
")",
":",
"setattr",
"(",
"resource",
",",
"name",
",",
"value",
")",
"if",
"'DependsOn'",
"in",
"resource_dict",
":",
"resource",
".",
"depends_on",
"=",
"resource_dict",
"[",
"'DependsOn'",
"]",
"# Parse only well known properties. This is consistent with earlier behavior where we used to ignore resource",
"# all resource attributes ie. all attributes were unsupported before",
"for",
"attr",
"in",
"resource",
".",
"_supported_resource_attributes",
":",
"if",
"attr",
"in",
"resource_dict",
":",
"resource",
".",
"set_resource_attribute",
"(",
"attr",
",",
"resource_dict",
"[",
"attr",
"]",
")",
"resource",
".",
"validate_properties",
"(",
")",
"return",
"resource"
] |
Constructs a Resource object with the given logical id, based on the given resource dict. The resource dict
is the value associated with the logical id in a CloudFormation template's Resources section, and takes the
following format. ::
{
"Type": "<resource type>",
"Properties": {
<set of properties>
}
}
:param str logical_id: The logical id of this Resource
:param dict resource_dict: The value associated with this logical id in the CloudFormation template, a mapping \
containing the resource's Type and Properties.
:param str relative_id: The logical id of this resource relative to the logical_id. This is useful
to identify sub-resources.
:param samtranslator.plugins.SamPlugins sam_plugins: Optional plugins object to help enhance functionality of
translator
:returns: a Resource object populated from the provided parameters
:rtype: Resource
:raises TypeError: if the provided parameters are invalid
|
[
"Constructs",
"a",
"Resource",
"object",
"with",
"the",
"given",
"logical",
"id",
"based",
"on",
"the",
"given",
"resource",
"dict",
".",
"The",
"resource",
"dict",
"is",
"the",
"value",
"associated",
"with",
"the",
"logical",
"id",
"in",
"a",
"CloudFormation",
"template",
"s",
"Resources",
"section",
"and",
"takes",
"the",
"following",
"format",
".",
"::"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/__init__.py#L78-L126
|
train
|
Constructs a Resource object from a dictionary containing the logical id and the properties of the resource.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmN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ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11 + 0o56) + chr(0b11110 + 0o26) + chr(55), 7926 - 7918), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + '\x33' + '\063' + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101000 + 0o107) + chr(0b10101 + 0o40) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10110 + 0o34) + '\x37' + chr(171 - 121), 20873 - 20865), ehT0Px3KOsy9('\060' + '\157' + chr(0b101001 + 0o12), 20948 - 20940), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b110110) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(0b0 + 0o62) + '\x30', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(371 - 320), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b11 + 0o55) + chr(1017 - 966), ord("\x08")), ehT0Px3KOsy9(chr(1787 - 1739) + '\x6f' + '\x31' + chr(55) + chr(2164 - 2111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7589 - 7478) + chr(0b110010) + chr(50) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1000 + 0o147) + '\x33' + '\x35' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(1729 - 1678) + '\065', 37320 - 37312), ehT0Px3KOsy9(chr(48) + chr(5315 - 5204) + chr(0b110001) + '\x37' + '\067', 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(111) + chr(1514 - 1465) + chr(0b11111 + 0o22) + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110101) + '\064', 0b1000), ehT0Px3KOsy9(chr(509 - 461) + chr(0b1101111) + '\x33' + chr(0b110 + 0o60) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(2577 - 2523) + '\x30', 12866 - 12858), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\x6f' + chr(52) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b101 + 0o152) + '\061' + chr(52) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(298 - 245) + chr(2495 - 2442), 0b1000), ehT0Px3KOsy9(chr(1160 - 1112) + '\157' + chr(0b1101 + 0o46) + chr(937 - 885) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(638 - 590) + chr(7216 - 7105) + chr(521 - 471) + chr(785 - 734) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(1462 - 1414) + chr(0b1101111) + chr(0b101100 + 0o6) + chr(0b10001 + 0o45) + chr(0b1110 + 0o46), ord("\x08")), ehT0Px3KOsy9(chr(413 - 365) + chr(0b100011 + 0o114) + '\x33' + '\x33' + chr(0b100011 + 0o16), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + '\x35', 0o10), ehT0Px3KOsy9('\x30' + chr(984 - 873) + chr(49) + '\064' + '\x31', 24311 - 24303), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + '\060' + chr(304 - 254), 11973 - 11965), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1855 - 1806) + chr(739 - 691) + chr(0b1011 + 0o45), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(0b110011) + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(1066 - 1016) + chr(0b110110), 52086 - 52078), ehT0Px3KOsy9('\060' + chr(0b1001000 + 0o47) + chr(0b110011) + chr(0b11000 + 0o32), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\061' + '\063' + chr(0b110010), 11720 - 11712), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011 + 0o0) + chr(0b110110) + '\x34', 26522 - 26514), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\x33' + chr(50), 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1011101 + 0o22) + chr(2318 - 2269) + '\x31' + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(48), 0o10), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + chr(699 - 648) + '\065' + '\x31', 5498 - 5490), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101101 + 0o6) + chr(0b101111 + 0o2) + '\064', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1822 - 1774) + '\x6f' + '\x35' + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'I'), chr(0b1100100) + '\x65' + '\143' + chr(5249 - 5138) + '\144' + chr(0b1010 + 0o133))(chr(5264 - 5147) + '\164' + chr(0b1100110) + chr(0b101101) + chr(0b10011 + 0o45)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def stXNDgRnmnP9(NSstowUUZlxS, NpZr66MdBhVG, YRwNbm9OifOu, qd5H4fq4bsuF=None, xTcXYyyLbR1j=None):
o9IPj2MJBBod = NSstowUUZlxS(NpZr66MdBhVG, relative_id=qd5H4fq4bsuF)
xafqLlk3kkUe(o9IPj2MJBBod, xafqLlk3kkUe(SXOLrMavuUCe(b'8\xa9N\xd6j\x921g\xe6"\xe1\x89\xee\x10>^\x93UMC\t\x0e\x94'), chr(0b11000 + 0o114) + '\x65' + chr(0b110001 + 0o62) + '\157' + chr(0b1100100) + chr(101))(chr(11001 - 10884) + chr(0b1110100) + '\x66' + '\055' + chr(1366 - 1310)))(NpZr66MdBhVG, YRwNbm9OifOu)
o4Mv82sLmOP8 = YRwNbm9OifOu.get(xafqLlk3kkUe(SXOLrMavuUCe(b'7\xad@\xcaf\x84$z\xe6\x0e'), chr(0b1000100 + 0o40) + chr(9784 - 9683) + chr(0b100000 + 0o103) + '\x6f' + chr(100) + chr(101))('\165' + chr(8116 - 8000) + chr(102) + chr(0b11011 + 0o22) + chr(0b111000)), {})
if xTcXYyyLbR1j:
xafqLlk3kkUe(xTcXYyyLbR1j, xafqLlk3kkUe(SXOLrMavuUCe(b'\x06\xbc['), chr(5099 - 4999) + '\145' + '\143' + '\x6f' + chr(0b1100100) + chr(101))(chr(0b111101 + 0o70) + '\164' + '\x66' + chr(0b100001 + 0o14) + '\x38'))(xafqLlk3kkUe(YL6Sdfw_L5US, xafqLlk3kkUe(SXOLrMavuUCe(b'\x05\xbaI\xd5q\x93\x0fg\xf1\x1c\xfd\x9f\xfb\x109A\xafBwT\x0f\x18\x92\xf9\xd1'), chr(7839 - 7739) + chr(101) + '\x63' + '\x6f' + chr(0b1100100) + '\145')('\165' + chr(116) + '\x66' + '\055' + '\070')), NpZr66MdBhVG, xafqLlk3kkUe(NSstowUUZlxS, xafqLlk3kkUe(SXOLrMavuUCe(b'\x15\xba\\\xd5v\x843v\xdc\t\xea\x9c\xf8'), chr(0b1010000 + 0o24) + chr(0b1100101) + chr(3653 - 3554) + '\x6f' + chr(0b11001 + 0o113) + '\145')(chr(6275 - 6158) + chr(116) + chr(0b1010011 + 0o23) + '\055' + '\070')), o4Mv82sLmOP8)
for (AIvJRzLdDfgF, QmmgWUB13VCJ) in xafqLlk3kkUe(o4Mv82sLmOP8, xafqLlk3kkUe(SXOLrMavuUCe(b')\xa5Y\xdfJ\xaccZ\xef.\xdb\xd5'), chr(0b1010110 + 0o16) + chr(0b1100101) + chr(0b1011 + 0o130) + chr(7745 - 7634) + '\x64' + chr(3759 - 3658))('\x75' + chr(0b100100 + 0o120) + chr(2617 - 2515) + '\x2d' + '\070'))():
t0rOMsrOC7R_(o9IPj2MJBBod, AIvJRzLdDfgF, QmmgWUB13VCJ)
if xafqLlk3kkUe(SXOLrMavuUCe(b'#\xba_\xdfm\x92#\\\xed'), chr(0b0 + 0o144) + '\145' + '\x63' + chr(0b1101111) + '\x64' + '\x65')('\165' + '\164' + '\x66' + chr(0b101101) + chr(0b110100 + 0o4)) in YRwNbm9OifOu:
o9IPj2MJBBod.oayEYOknteBp = YRwNbm9OifOu[xafqLlk3kkUe(SXOLrMavuUCe(b'#\xba_\xdfm\x92#\\\xed'), chr(100) + chr(6698 - 6597) + chr(7898 - 7799) + chr(111) + '\x64' + chr(0b100001 + 0o104))(chr(12189 - 12072) + '\x74' + chr(102) + '\055' + '\070')]
for uwnd9_euJYKT in xafqLlk3kkUe(o9IPj2MJBBod, xafqLlk3kkUe(SXOLrMavuUCe(b'8\xacZ\xcas\x99"g\xe6\x19\xcc\x9e\xf8\x0c$Y\x82Swx\x01\x19\x94\xe8\xdd\xbbp\x15\xa73'), '\144' + chr(0b1100101) + chr(8775 - 8676) + '\157' + chr(100) + chr(1016 - 915))(chr(1942 - 1825) + chr(0b1110100) + '\x66' + chr(791 - 746) + chr(266 - 210))):
if uwnd9_euJYKT in YRwNbm9OifOu:
xafqLlk3kkUe(o9IPj2MJBBod, xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\xba[\xe5q\x93#|\xf6\x0f\xf0\x89\xc2\x1e?X\x82YpR\x14\x08'), chr(6742 - 6642) + chr(101) + '\x63' + chr(9618 - 9507) + '\144' + '\x65')('\x75' + '\x74' + '\x66' + chr(45) + chr(56)))(uwnd9_euJYKT, YRwNbm9OifOu[uwnd9_euJYKT])
xafqLlk3kkUe(o9IPj2MJBBod, xafqLlk3kkUe(SXOLrMavuUCe(b'\x11\xbeC\xd3g\x97$v\xdc\r\xe1\x83\xed\x1a9X\x99Ua'), '\144' + '\x65' + chr(99) + chr(0b1000111 + 0o50) + '\144' + chr(7704 - 7603))('\165' + chr(0b1110100) + chr(0b1010001 + 0o25) + '\055' + chr(56)))()
return o9IPj2MJBBod
|
awslabs/serverless-application-model
|
samtranslator/model/__init__.py
|
Resource._validate_logical_id
|
def _validate_logical_id(cls, logical_id):
"""Validates that the provided logical id is an alphanumeric string.
:param str logical_id: the logical id to validate
:returns: True if the logical id is valid
:rtype: bool
:raises TypeError: if the logical id is invalid
"""
pattern = re.compile(r'^[A-Za-z0-9]+$')
if logical_id is not None and pattern.match(logical_id):
return True
raise InvalidResourceException(logical_id, "Logical ids must be alphanumeric.")
|
python
|
def _validate_logical_id(cls, logical_id):
"""Validates that the provided logical id is an alphanumeric string.
:param str logical_id: the logical id to validate
:returns: True if the logical id is valid
:rtype: bool
:raises TypeError: if the logical id is invalid
"""
pattern = re.compile(r'^[A-Za-z0-9]+$')
if logical_id is not None and pattern.match(logical_id):
return True
raise InvalidResourceException(logical_id, "Logical ids must be alphanumeric.")
|
[
"def",
"_validate_logical_id",
"(",
"cls",
",",
"logical_id",
")",
":",
"pattern",
"=",
"re",
".",
"compile",
"(",
"r'^[A-Za-z0-9]+$'",
")",
"if",
"logical_id",
"is",
"not",
"None",
"and",
"pattern",
".",
"match",
"(",
"logical_id",
")",
":",
"return",
"True",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"\"Logical ids must be alphanumeric.\"",
")"
] |
Validates that the provided logical id is an alphanumeric string.
:param str logical_id: the logical id to validate
:returns: True if the logical id is valid
:rtype: bool
:raises TypeError: if the logical id is invalid
|
[
"Validates",
"that",
"the",
"provided",
"logical",
"id",
"is",
"an",
"alphanumeric",
"string",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/__init__.py#L129-L140
|
train
|
Validates that the provided logical id is an alphanumeric string.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,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6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(842 - 789) + chr(332 - 280), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1219 - 1170) + '\x30' + chr(928 - 880), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(0b101101 + 0o3) + chr(48), 28427 - 28419), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(0b111 + 0o55) + chr(0b110101), 32928 - 32920), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(0b110101) + '\x37', 0o10), ehT0Px3KOsy9(chr(179 - 131) + '\x6f' + '\063' + chr(0b11000 + 0o31) + chr(53), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + chr(0b110000) + chr(0b110110), 18804 - 18796), ehT0Px3KOsy9('\x30' + '\157' + '\063' + chr(0b100111 + 0o17) + chr(400 - 349), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(0b110111) + '\060', 0b1000), ehT0Px3KOsy9(chr(1279 - 1231) + '\x6f' + chr(0b110001) + chr(674 - 619), ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(0b110001) + chr(0b1011 + 0o52), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101011 + 0o7) + '\062' + chr(51), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(0b101111 + 0o5) + chr(1231 - 1182), ord("\x08")), ehT0Px3KOsy9(chr(597 - 549) + chr(111) + chr(51) + '\061' + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(0b110010) + chr(0b110110), 26750 - 26742), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + chr(1109 - 1060) + chr(48) + chr(50), 0b1000), ehT0Px3KOsy9(chr(1709 - 1661) + '\157' + '\061' + chr(53) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b101 + 0o62) + chr(2203 - 2150), 0b1000), ehT0Px3KOsy9('\060' + chr(0b10 + 0o155) + chr(0b11011 + 0o27) + chr(55) + '\061', 57338 - 57330), ehT0Px3KOsy9(chr(638 - 590) + chr(0b1011011 + 0o24) + chr(50) + '\x32' + chr(0b101010 + 0o7), 0b1000), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1101111) + chr(727 - 676) + chr(0b110111) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + chr(0b100010 + 0o16) + chr(52), 50906 - 50898), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(1717 - 1666) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(3990 - 3879) + '\x35' + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(0b1110 + 0o51), ord("\x08")), ehT0Px3KOsy9('\060' + chr(6925 - 6814) + chr(0b101100 + 0o6) + chr(51), 0o10), ehT0Px3KOsy9('\060' + chr(0b1011110 + 0o21) + chr(50) + chr(0b11110 + 0o30) + '\064', 63578 - 63570), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + '\x34' + chr(0b100000 + 0o21), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(0b1111 + 0o45) + chr(0b10100 + 0o42), 30763 - 30755), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(0b11000 + 0o32) + chr(0b110101) + chr(0b110000), 52941 - 52933), ehT0Px3KOsy9(chr(0b110000) + chr(7608 - 7497) + chr(0b110010) + chr(0b101100 + 0o5) + chr(0b110 + 0o55), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\x6f' + chr(0b101 + 0o55) + chr(0b1011 + 0o50) + chr(1948 - 1898), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b100 + 0o56) + '\064' + chr(48), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(55) + chr(50), 3594 - 3586), ehT0Px3KOsy9(chr(0b110000) + chr(4591 - 4480) + chr(1780 - 1731) + '\x37' + chr(2576 - 2525), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(0b100101 + 0o17) + '\063', 47279 - 47271), ehT0Px3KOsy9('\x30' + chr(0b111011 + 0o64) + chr(126 - 77) + chr(48) + chr(0b110110), 2369 - 2361), ehT0Px3KOsy9(chr(570 - 522) + chr(0b1101111) + chr(1812 - 1761) + chr(51) + chr(52), 65087 - 65079), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010 + 0o145) + '\061' + chr(50) + '\x35', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10100 + 0o37) + chr(0b11101 + 0o27) + '\060', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1867 - 1814) + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'B'), '\x64' + chr(101) + chr(99) + chr(111) + '\144' + chr(2484 - 2383))(chr(1105 - 988) + chr(0b1110100) + chr(9062 - 8960) + chr(0b11110 + 0o17) + chr(0b10101 + 0o43)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def uQFd0nRWg3K2(NSstowUUZlxS, NpZr66MdBhVG):
D7PcF8SpuWmc = _7u55U49WwX2.compile(xafqLlk3kkUe(SXOLrMavuUCe(b'2\x1b\x81\xc85\xac\xeb\x89\x88"4\xce\x8a\xee'), chr(0b1000 + 0o134) + chr(0b1010110 + 0o17) + chr(0b111111 + 0o44) + chr(0b1100001 + 0o16) + chr(0b1100100) + '\145')('\165' + chr(11544 - 11428) + chr(102) + '\055' + chr(0b111000)))
if NpZr66MdBhVG is not None and xafqLlk3kkUe(D7PcF8SpuWmc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x01!\xb4\x86\x07'), chr(0b1000110 + 0o36) + '\x65' + chr(99) + chr(7539 - 7428) + chr(100) + chr(0b1100101))(chr(5736 - 5619) + chr(0b1110100) + chr(0b1100110) + chr(0b101 + 0o50) + chr(0b111000)))(NpZr66MdBhVG):
return ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11011 + 0o26), 0b1000)
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(SXOLrMavuUCe(b' /\xa7\x8c\x0c\xac\xaa\xd3\xd1k~\xb3\xcc\xbf\xa56H_\xdc\xb1\x9e(\xaaDv}\xc1L\x03\xda\xe2\xf9\x8e'), '\x64' + '\145' + chr(99) + chr(0b1101110 + 0o1) + chr(0b1010100 + 0o20) + '\x65')(chr(0b0 + 0o165) + '\x74' + '\146' + chr(0b101101) + chr(0b100101 + 0o23)))
|
awslabs/serverless-application-model
|
samtranslator/model/__init__.py
|
Resource._validate_resource_dict
|
def _validate_resource_dict(cls, logical_id, resource_dict):
"""Validates that the provided resource dict contains the correct Type string, and the required Properties dict.
:param dict resource_dict: the resource dict to validate
:returns: True if the resource dict has the expected format
:rtype: bool
:raises InvalidResourceException: if the resource dict has an invalid format
"""
if 'Type' not in resource_dict:
raise InvalidResourceException(logical_id, "Resource dict missing key 'Type'.")
if resource_dict['Type'] != cls.resource_type:
raise InvalidResourceException(logical_id, "Resource has incorrect Type; expected '{expected}', "
"got '{actual}'".format(
expected=cls.resource_type,
actual=resource_dict['Type']))
if 'Properties' in resource_dict and not isinstance(resource_dict['Properties'], dict):
raise InvalidResourceException(logical_id, "Properties of a resource must be an object.")
|
python
|
def _validate_resource_dict(cls, logical_id, resource_dict):
"""Validates that the provided resource dict contains the correct Type string, and the required Properties dict.
:param dict resource_dict: the resource dict to validate
:returns: True if the resource dict has the expected format
:rtype: bool
:raises InvalidResourceException: if the resource dict has an invalid format
"""
if 'Type' not in resource_dict:
raise InvalidResourceException(logical_id, "Resource dict missing key 'Type'.")
if resource_dict['Type'] != cls.resource_type:
raise InvalidResourceException(logical_id, "Resource has incorrect Type; expected '{expected}', "
"got '{actual}'".format(
expected=cls.resource_type,
actual=resource_dict['Type']))
if 'Properties' in resource_dict and not isinstance(resource_dict['Properties'], dict):
raise InvalidResourceException(logical_id, "Properties of a resource must be an object.")
|
[
"def",
"_validate_resource_dict",
"(",
"cls",
",",
"logical_id",
",",
"resource_dict",
")",
":",
"if",
"'Type'",
"not",
"in",
"resource_dict",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"\"Resource dict missing key 'Type'.\"",
")",
"if",
"resource_dict",
"[",
"'Type'",
"]",
"!=",
"cls",
".",
"resource_type",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"\"Resource has incorrect Type; expected '{expected}', \"",
"\"got '{actual}'\"",
".",
"format",
"(",
"expected",
"=",
"cls",
".",
"resource_type",
",",
"actual",
"=",
"resource_dict",
"[",
"'Type'",
"]",
")",
")",
"if",
"'Properties'",
"in",
"resource_dict",
"and",
"not",
"isinstance",
"(",
"resource_dict",
"[",
"'Properties'",
"]",
",",
"dict",
")",
":",
"raise",
"InvalidResourceException",
"(",
"logical_id",
",",
"\"Properties of a resource must be an object.\"",
")"
] |
Validates that the provided resource dict contains the correct Type string, and the required Properties dict.
:param dict resource_dict: the resource dict to validate
:returns: True if the resource dict has the expected format
:rtype: bool
:raises InvalidResourceException: if the resource dict has an invalid format
|
[
"Validates",
"that",
"the",
"provided",
"resource",
"dict",
"contains",
"the",
"correct",
"Type",
"string",
"and",
"the",
"required",
"Properties",
"dict",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/__init__.py#L143-L160
|
train
|
Validates that the provided resource dict contains the correct Type string and the required Properties dict.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5H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ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + chr(2218 - 2169) + chr(2063 - 2012) + '\066', 0b1000), ehT0Px3KOsy9(chr(462 - 414) + '\x6f' + '\x33' + chr(1360 - 1307) + chr(1192 - 1143), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(0b110000) + chr(1154 - 1101), 16872 - 16864), ehT0Px3KOsy9('\060' + chr(617 - 506) + chr(2395 - 2346) + chr(49) + chr(0b111 + 0o51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(0b111 + 0o55) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(1428 - 1380) + chr(0b1101111) + chr(0b110010) + '\x31' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(2537 - 2426) + '\x33' + '\067' + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + '\064' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + chr(0b110010) + chr(483 - 435) + chr(1761 - 1708), 8), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(9502 - 9391) + chr(720 - 671) + chr(0b110011) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b100111 + 0o110) + chr(1752 - 1702) + chr(0b110101) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + chr(51) + chr(0b100101 + 0o15) + chr(0b110010 + 0o0), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(3233 - 3122) + chr(1838 - 1789) + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11110 + 0o30) + chr(0b10000 + 0o42), 0o10), ehT0Px3KOsy9(chr(319 - 271) + chr(0b1011010 + 0o25) + chr(49) + chr(48) + '\060', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(478 - 424) + chr(0b11111 + 0o23), 8), ehT0Px3KOsy9(chr(48) + chr(3755 - 3644) + chr(1271 - 1221) + chr(0b110011) + '\063', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(0b110011) + '\062', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1000010 + 0o55) + chr(51) + chr(51) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1800 - 1751) + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(1193 - 1082) + chr(51) + chr(0b110100) + chr(278 - 226), 7867 - 7859), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(2960 - 2849) + chr(0b10101 + 0o35) + chr(1246 - 1192) + chr(259 - 209), 0o10), ehT0Px3KOsy9(chr(1019 - 971) + chr(5453 - 5342) + '\x33', 0o10), ehT0Px3KOsy9('\x30' + chr(10677 - 10566) + chr(51) + chr(0b110011) + chr(0b110010), 8), ehT0Px3KOsy9(chr(48) + chr(4161 - 4050) + chr(0b10010 + 0o37) + chr(414 - 362) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(11681 - 11570) + chr(0b111 + 0o52) + '\x33' + chr(51), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10101 + 0o35) + chr(0b110010) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(1851 - 1803) + chr(0b100101 + 0o112) + '\x33' + chr(903 - 855) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(6741 - 6630) + chr(2008 - 1959) + chr(55) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10 + 0o60) + chr(1841 - 1788), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(0b10010 + 0o45) + chr(1690 - 1639), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b101001 + 0o106) + chr(0b110010) + chr(0b110110) + '\x30', 37022 - 37014), ehT0Px3KOsy9(chr(629 - 581) + chr(111) + '\061' + chr(55) + chr(0b110111 + 0o0), 58826 - 58818), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b100011 + 0o114) + '\x33' + '\x35' + chr(0b110011), 58756 - 58748), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\157' + '\061' + '\x31' + '\x37', 0b1000), ehT0Px3KOsy9(chr(210 - 162) + '\x6f' + chr(0b11010 + 0o31) + '\061' + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1314 - 1262) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(337 - 289) + chr(111) + chr(0b0 + 0o62) + '\x34' + chr(50), 0b1000), ehT0Px3KOsy9('\060' + chr(9402 - 9291) + chr(0b101111 + 0o2) + chr(52) + chr(918 - 869), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110101) + chr(48), 43209 - 43201)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'p'), chr(0b110110 + 0o56) + chr(0b110010 + 0o63) + chr(0b1100011) + chr(0b110010 + 0o75) + chr(9188 - 9088) + '\145')(chr(117) + '\164' + chr(102) + chr(1194 - 1149) + chr(0b11 + 0o65)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def dhnlnLgqTQNk(NSstowUUZlxS, NpZr66MdBhVG, YRwNbm9OifOu):
if xafqLlk3kkUe(SXOLrMavuUCe(b'\n\x90\xf5-'), chr(0b1011111 + 0o5) + chr(101) + chr(0b1010111 + 0o14) + '\157' + chr(100) + chr(8460 - 8359))(chr(0b100010 + 0o123) + chr(0b1110100) + chr(0b1100101 + 0o1) + chr(0b101101) + chr(0b110000 + 0o10)) not in YRwNbm9OifOu:
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(SXOLrMavuUCe(b"\x0c\x8c\xf6'\x97\xfd\x9c\x00\xa5?\xc5\xb1x\x12-[\xe8\xa9\xb0`\x83\x92h\xbf\x18{\xb6\x91\x03e\x9e%\x9e"), '\144' + '\x65' + chr(0b1000101 + 0o36) + chr(11090 - 10979) + chr(9211 - 9111) + '\145')(chr(117) + chr(116) + chr(0b10100 + 0o122) + chr(1238 - 1193) + chr(56)))
if YRwNbm9OifOu[xafqLlk3kkUe(SXOLrMavuUCe(b'\n\x90\xf5-'), chr(0b1000111 + 0o35) + '\x65' + '\x63' + chr(0b111 + 0o150) + chr(0b1100100) + chr(7231 - 7130))(chr(117) + chr(0b1110100) + chr(0b1100100 + 0o2) + '\055' + chr(56))] != xafqLlk3kkUe(NSstowUUZlxS, xafqLlk3kkUe(SXOLrMavuUCe(b",\x8c\xf6'\x97\xfd\x9c\x00\xda/\xd5\xa2i"), '\x64' + '\x65' + '\143' + chr(9640 - 9529) + chr(7366 - 7266) + '\145')(chr(117) + chr(0b11110 + 0o126) + chr(5007 - 4905) + '\x2d' + chr(0b111000))):
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\x0c\x8c\xf6'\x97\xfd\x9c\x00\xa53\xcd\xa1,[.Q\xf4\xa8\xabk\x87\xc6#\x8e\x18+\xf4\xfeZp\x83r\xd5\x1c\x9f*\xac\x06\x85\x1a;\x91\xf5-\x81\xfb\x9a\x01\xf8|\x80\xf2k]4\x12\xbc\xa1\xb8m\x90\xc7b\xb6\x1c|"), chr(9979 - 9879) + '\x65' + chr(0b100111 + 0o74) + chr(111) + chr(1006 - 906) + '\145')('\165' + chr(0b1110100) + '\x66' + chr(45) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b"\x08\xdd\xf7'\xaa\xee\xacV\xd5+\xc9\xb8"), '\144' + chr(101) + chr(0b110001 + 0o62) + chr(0b1101111) + chr(0b111100 + 0o50) + chr(4002 - 3901))(chr(117) + chr(12655 - 12539) + chr(102) + chr(45) + '\x38'))(expected=xafqLlk3kkUe(NSstowUUZlxS, xafqLlk3kkUe(SXOLrMavuUCe(b",\x8c\xf6'\x97\xfd\x9c\x00\xda/\xd5\xa2i"), chr(2635 - 2535) + chr(1242 - 1141) + chr(0b1100011) + chr(0b1000000 + 0o57) + '\144' + chr(0b1100101))(chr(0b1110001 + 0o4) + '\x74' + '\146' + chr(45) + chr(56))), actual=YRwNbm9OifOu[xafqLlk3kkUe(SXOLrMavuUCe(b'\n\x90\xf5-'), '\x64' + chr(101) + chr(8402 - 8303) + '\x6f' + chr(0b1100100) + chr(101))(chr(5865 - 5748) + '\x74' + '\146' + chr(0b101101) + chr(0b111000))]))
if xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e\x9b\xea8\x87\xfd\x8b\x0c\xe0('), '\144' + chr(0b110001 + 0o64) + chr(0b1000101 + 0o36) + chr(111) + '\144' + '\145')('\165' + '\164' + chr(0b10 + 0o144) + chr(0b1111 + 0o36) + chr(0b10001 + 0o47)) in YRwNbm9OifOu and (not PlSM16l2KDPD(YRwNbm9OifOu[xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e\x9b\xea8\x87\xfd\x8b\x0c\xe0('), '\144' + '\x65' + '\x63' + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(117) + chr(116) + chr(0b1010110 + 0o20) + chr(1365 - 1320) + '\070')], wLqBDw8l0eIm)):
raise ow8Lll3lwq0h(NpZr66MdBhVG, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e\x9b\xea8\x87\xfd\x8b\x0c\xe0(\x8c\xbdj\x12!\x12\xe9\xbf\xaaa\x91\xc0`\xbfA6\xe4\xb6\x0e5\x99g\x90\x1e\x85o\xa7D\xc8\x04=\x9d\xab'), chr(4477 - 4377) + chr(0b1100101) + '\143' + chr(111) + chr(0b1100100) + chr(720 - 619))(chr(117) + chr(116) + chr(2261 - 2159) + '\x2d' + chr(0b101000 + 0o20)))
|
awslabs/serverless-application-model
|
samtranslator/model/__init__.py
|
Resource.to_dict
|
def to_dict(self):
"""Validates that the required properties for this Resource have been provided, then returns a dict
corresponding to the given Resource object. This dict will take the format of a single entry in the Resources
section of a CloudFormation template, and will take the following format. ::
{
"<logical id>": {
"Type": "<resource type>",
"DependsOn": "<value specified by user>",
"Properties": {
<set of properties>
}
}
}
The resulting dict can then be serialized to JSON or YAML and included as part of a CloudFormation template.
:returns: a dict corresponding to this Resource's entry in a CloudFormation template
:rtype: dict
:raises TypeError: if a required property is missing from this Resource
"""
self.validate_properties()
resource_dict = self._generate_resource_dict()
return {self.logical_id: resource_dict}
|
python
|
def to_dict(self):
"""Validates that the required properties for this Resource have been provided, then returns a dict
corresponding to the given Resource object. This dict will take the format of a single entry in the Resources
section of a CloudFormation template, and will take the following format. ::
{
"<logical id>": {
"Type": "<resource type>",
"DependsOn": "<value specified by user>",
"Properties": {
<set of properties>
}
}
}
The resulting dict can then be serialized to JSON or YAML and included as part of a CloudFormation template.
:returns: a dict corresponding to this Resource's entry in a CloudFormation template
:rtype: dict
:raises TypeError: if a required property is missing from this Resource
"""
self.validate_properties()
resource_dict = self._generate_resource_dict()
return {self.logical_id: resource_dict}
|
[
"def",
"to_dict",
"(",
"self",
")",
":",
"self",
".",
"validate_properties",
"(",
")",
"resource_dict",
"=",
"self",
".",
"_generate_resource_dict",
"(",
")",
"return",
"{",
"self",
".",
"logical_id",
":",
"resource_dict",
"}"
] |
Validates that the required properties for this Resource have been provided, then returns a dict
corresponding to the given Resource object. This dict will take the format of a single entry in the Resources
section of a CloudFormation template, and will take the following format. ::
{
"<logical id>": {
"Type": "<resource type>",
"DependsOn": "<value specified by user>",
"Properties": {
<set of properties>
}
}
}
The resulting dict can then be serialized to JSON or YAML and included as part of a CloudFormation template.
:returns: a dict corresponding to this Resource's entry in a CloudFormation template
:rtype: dict
:raises TypeError: if a required property is missing from this Resource
|
[
"Validates",
"that",
"the",
"required",
"properties",
"for",
"this",
"Resource",
"have",
"been",
"provided",
"then",
"returns",
"a",
"dict",
"corresponding",
"to",
"the",
"given",
"Resource",
"object",
".",
"This",
"dict",
"will",
"take",
"the",
"format",
"of",
"a",
"single",
"entry",
"in",
"the",
"Resources",
"section",
"of",
"a",
"CloudFormation",
"template",
"and",
"will",
"take",
"the",
"following",
"format",
".",
"::"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/__init__.py#L162-L187
|
train
|
Returns a dict representation of this Resource object.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiS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pInYwBvYW,iDQ_gSK8V7h0,Rurm1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(322 - 274) + chr(0b1100100 + 0o13) + chr(51) + chr(0b110000 + 0o4) + '\x34', 19156 - 19148), ehT0Px3KOsy9(chr(444 - 396) + chr(0b1010100 + 0o33) + chr(50) + chr(0b100 + 0o56) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1011101 + 0o22) + chr(0b1001 + 0o51) + chr(458 - 406) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + chr(48) + chr(0b110110 + 0o0), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110110) + '\064', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1000111 + 0o50) + chr(0b110011) + '\063' + chr(0b110110), 14036 - 14028), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(50) + '\066', 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(111) + chr(51) + '\x33' + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100010 + 0o24) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(1274 - 1226) + chr(3447 - 3336) + chr(0b110001) + chr(0b11 + 0o57) + chr(0b101 + 0o56), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1001 + 0o50) + chr(0b110011) + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x34' + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(0b11111 + 0o24) + '\x32', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(0b10000 + 0o42) + chr(1776 - 1722), 8), ehT0Px3KOsy9('\060' + chr(111) + '\x37' + chr(589 - 536), 0o10), ehT0Px3KOsy9(chr(1708 - 1660) + chr(0b1011101 + 0o22) + '\063' + chr(0b100101 + 0o20) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(0b101111 + 0o2) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10 + 0o61) + '\x34' + chr(0b100001 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1000 + 0o53) + chr(0b110000) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + '\x35' + chr(50), 38569 - 38561), ehT0Px3KOsy9('\060' + chr(0b1000100 + 0o53) + chr(0b100010 + 0o20) + chr(0b101011 + 0o11) + chr(54), 20741 - 20733), ehT0Px3KOsy9(chr(871 - 823) + '\157' + chr(0b110001) + chr(0b11100 + 0o24) + chr(0b110100 + 0o0), 0o10), ehT0Px3KOsy9('\060' + chr(5412 - 5301) + chr(0b110011) + chr(55) + chr(0b10111 + 0o37), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b110010 + 0o75) + chr(0b101001 + 0o10) + chr(0b10111 + 0o35) + '\060', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111 + 0o0) + chr(0b101001 + 0o12) + '\063' + chr(502 - 450), 8), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + chr(1987 - 1936) + chr(52) + chr(1688 - 1637), 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(7875 - 7764) + chr(1279 - 1230) + chr(1066 - 1018), 52785 - 52777), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100101 + 0o12) + chr(50) + chr(53) + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(2210 - 2159) + '\067' + chr(1759 - 1706), 255 - 247), ehT0Px3KOsy9(chr(0b110000) + chr(11188 - 11077) + chr(1003 - 954) + '\060' + '\x30', 12148 - 12140), ehT0Px3KOsy9('\060' + chr(0b1100101 + 0o12) + chr(0b1101 + 0o46) + '\065' + '\x35', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11111 + 0o24) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(0b10001 + 0o136) + chr(0b110001) + chr(54) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(2244 - 2196) + '\157' + chr(0b110010) + chr(0b110000) + chr(913 - 858), 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + '\x32' + chr(48) + chr(543 - 488), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b11100 + 0o27) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(0b110011) + chr(2382 - 2328) + chr(0b1000 + 0o50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(0b100101 + 0o22) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(9164 - 9053) + chr(1346 - 1296) + '\065' + chr(2705 - 2651), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(53) + chr(0b100000 + 0o21), 65337 - 65329)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + chr(986 - 933) + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xca'), '\x64' + chr(10015 - 9914) + chr(0b1100011) + chr(11983 - 11872) + chr(0b1100100) + '\145')(chr(8671 - 8554) + '\x74' + chr(0b111000 + 0o56) + chr(0b1111 + 0o36) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ANIlnSK1rtks(oVre8I6UXc3b):
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xf3\xcf/P\xbf"\xb9m#*N\xea3O\x9c\xe6\x87\xb0'), chr(2868 - 2768) + chr(101) + '\x63' + '\157' + '\x64' + chr(9730 - 9629))(chr(6497 - 6380) + chr(0b111111 + 0o65) + chr(0b1010100 + 0o22) + chr(45) + chr(56)))()
YRwNbm9OifOu = oVre8I6UXc3b._generate_resource_dict()
return {xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa\xe2\xf94\x02\xe8\x1b\xb8p;\x0ef'), chr(100) + chr(101) + chr(0b1100011) + chr(111) + chr(0b101110 + 0o66) + '\x65')('\165' + '\x74' + chr(102) + '\055' + chr(1877 - 1821))): YRwNbm9OifOu}
|
awslabs/serverless-application-model
|
samtranslator/model/__init__.py
|
Resource._generate_resource_dict
|
def _generate_resource_dict(self):
"""Generates the resource dict for this Resource, the value associated with the logical id in a CloudFormation
template's Resources section.
:returns: the resource dict for this Resource
:rtype: dict
"""
resource_dict = {}
resource_dict['Type'] = self.resource_type
if self.depends_on:
resource_dict['DependsOn'] = self.depends_on
resource_dict.update(self.resource_attributes)
properties_dict = {}
for name in self.property_types:
value = getattr(self, name)
if value is not None:
properties_dict[name] = value
resource_dict['Properties'] = properties_dict
return resource_dict
|
python
|
def _generate_resource_dict(self):
"""Generates the resource dict for this Resource, the value associated with the logical id in a CloudFormation
template's Resources section.
:returns: the resource dict for this Resource
:rtype: dict
"""
resource_dict = {}
resource_dict['Type'] = self.resource_type
if self.depends_on:
resource_dict['DependsOn'] = self.depends_on
resource_dict.update(self.resource_attributes)
properties_dict = {}
for name in self.property_types:
value = getattr(self, name)
if value is not None:
properties_dict[name] = value
resource_dict['Properties'] = properties_dict
return resource_dict
|
[
"def",
"_generate_resource_dict",
"(",
"self",
")",
":",
"resource_dict",
"=",
"{",
"}",
"resource_dict",
"[",
"'Type'",
"]",
"=",
"self",
".",
"resource_type",
"if",
"self",
".",
"depends_on",
":",
"resource_dict",
"[",
"'DependsOn'",
"]",
"=",
"self",
".",
"depends_on",
"resource_dict",
".",
"update",
"(",
"self",
".",
"resource_attributes",
")",
"properties_dict",
"=",
"{",
"}",
"for",
"name",
"in",
"self",
".",
"property_types",
":",
"value",
"=",
"getattr",
"(",
"self",
",",
"name",
")",
"if",
"value",
"is",
"not",
"None",
":",
"properties_dict",
"[",
"name",
"]",
"=",
"value",
"resource_dict",
"[",
"'Properties'",
"]",
"=",
"properties_dict",
"return",
"resource_dict"
] |
Generates the resource dict for this Resource, the value associated with the logical id in a CloudFormation
template's Resources section.
:returns: the resource dict for this Resource
:rtype: dict
|
[
"Generates",
"the",
"resource",
"dict",
"for",
"this",
"Resource",
"the",
"value",
"associated",
"with",
"the",
"logical",
"id",
"in",
"a",
"CloudFormation",
"template",
"s",
"Resources",
"section",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/__init__.py#L189-L213
|
train
|
Generates the resource dict for this Resource object
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDz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,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x34' + chr(0b110110), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(0b10101 + 0o35) + chr(55), 20139 - 20131), ehT0Px3KOsy9(chr(358 - 310) + chr(0b0 + 0o157) + chr(218 - 169) + chr(0b110101) + chr(2514 - 2460), 17319 - 17311), ehT0Px3KOsy9('\060' + chr(111) + '\063', 0o10), ehT0Px3KOsy9(chr(1988 - 1940) + chr(9032 - 8921) + chr(0b110001) + chr(0b110011) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11 + 0o60) + chr(49) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(0b110010) + chr(0b110000), 48291 - 48283), ehT0Px3KOsy9(chr(800 - 752) + chr(111) + chr(54) + '\060', 12351 - 12343), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1100 + 0o45) + chr(0b110101) + '\x30', 16026 - 16018), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(0b110010) + chr(0b11010 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(0b10101 + 0o33), ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + chr(55) + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(942 - 889) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b110 + 0o56) + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(0b100100 + 0o113) + chr(1248 - 1193) + chr(0b110011), 2898 - 2890), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(0b110010) + chr(2538 - 2487), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(55) + chr(53), 45391 - 45383), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + chr(0b110001) + chr(48) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(11203 - 11092) + chr(53) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1394 - 1346) + chr(0b1101111) + chr(0b110011 + 0o0) + chr(53) + chr(0b10001 + 0o44), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(0b110111) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(699 - 650) + '\066', 0o10), ehT0Px3KOsy9(chr(1325 - 1277) + '\x6f' + '\x31' + '\060' + chr(0b0 + 0o67), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + '\067' + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(2900 - 2789) + chr(49) + chr(0b110011) + chr(1822 - 1773), ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(111) + chr(49) + chr(52) + chr(0b11110 + 0o24), 0o10), ehT0Px3KOsy9('\060' + chr(0b101101 + 0o102) + chr(1164 - 1113) + chr(1392 - 1343), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + '\061' + chr(55), 4799 - 4791), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(0b110011) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + chr(8891 - 8780) + chr(0b110011) + chr(0b11 + 0o60) + chr(1395 - 1344), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110 + 0o53) + chr(1054 - 1000) + chr(0b100010 + 0o22), 0b1000), ehT0Px3KOsy9(chr(1838 - 1790) + chr(6919 - 6808) + chr(51) + chr(0b1101 + 0o47) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b101000 + 0o107) + chr(128 - 79) + chr(0b1001 + 0o53) + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\x34', 57614 - 57606), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b111 + 0o52) + chr(1663 - 1609) + chr(1744 - 1695), 0b1000), ehT0Px3KOsy9('\x30' + chr(2480 - 2369) + chr(0b0 + 0o64) + '\066', 8), ehT0Px3KOsy9(chr(218 - 170) + chr(2145 - 2034) + chr(50) + '\064' + chr(245 - 197), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\063' + chr(51), 8), ehT0Px3KOsy9(chr(48) + chr(0b1100111 + 0o10) + chr(2374 - 2323) + chr(0b110100) + '\062', 0o10), ehT0Px3KOsy9(chr(1414 - 1366) + '\157' + chr(1134 - 1085) + chr(48) + chr(48), 4441 - 4433)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(53) + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x08'), '\x64' + '\145' + chr(4269 - 4170) + chr(0b1101000 + 0o7) + chr(4513 - 4413) + chr(9475 - 9374))('\165' + chr(116) + chr(0b101101 + 0o71) + '\055' + chr(0b101000 + 0o20)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def q1fhqjIHsLsq(oVre8I6UXc3b):
YRwNbm9OifOu = {}
YRwNbm9OifOu[xafqLlk3kkUe(SXOLrMavuUCe(b'r\xae\x1ef'), '\x64' + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(100) + chr(101))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b101101) + chr(1640 - 1584))] = oVre8I6UXc3b.resource_type
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'I\xb6\x17F\x06\x83\xbb^\x1c\xf3RI'), chr(0b1100100) + '\145' + chr(99) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(13218 - 13101) + '\164' + '\146' + chr(1762 - 1717) + chr(0b11000 + 0o40))):
YRwNbm9OifOu[xafqLlk3kkUe(SXOLrMavuUCe(b'b\xb2\x1ef1\xa8\xa3\x7f\x06'), '\144' + '\x65' + '\x63' + '\157' + chr(0b1000100 + 0o40) + chr(101))('\x75' + chr(0b1110100) + chr(9333 - 9231) + chr(0b101101) + '\070')] = oVre8I6UXc3b.oayEYOknteBp
xafqLlk3kkUe(YRwNbm9OifOu, xafqLlk3kkUe(SXOLrMavuUCe(b'|\xa3/F6\x82\x9a^\x11\xa2u\t'), chr(100) + '\x65' + '\143' + '\157' + chr(100) + '\145')(chr(0b1110101) + '\164' + chr(0b101010 + 0o74) + '\x2d' + chr(1065 - 1009)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'T\xb2\x1dl*\xbe\xb3U7\xf7dM\x1a\xccY\xa6I#Y'), chr(3975 - 3875) + chr(1547 - 1446) + '\x63' + chr(111) + '\144' + chr(0b1100101))(chr(117) + chr(10005 - 9889) + chr(0b1100110) + '\x2d' + chr(0b111000))))
x0wCjP0FJOTh = {}
for AIvJRzLdDfgF in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'V\xa5\x01s:\xbe\xa4I7\xe2iI\r\xd6'), chr(1244 - 1144) + chr(101) + chr(5199 - 5100) + chr(111) + chr(0b1001 + 0o133) + '\x65')(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b101101) + '\070')):
QmmgWUB13VCJ = xafqLlk3kkUe(oVre8I6UXc3b, AIvJRzLdDfgF)
if QmmgWUB13VCJ is not None:
x0wCjP0FJOTh[AIvJRzLdDfgF] = QmmgWUB13VCJ
YRwNbm9OifOu[xafqLlk3kkUe(SXOLrMavuUCe(b'v\xa5\x01s:\xbe\xa4Y\r\xe5'), chr(0b1100100) + chr(0b100011 + 0o102) + '\x63' + chr(0b1101111) + chr(535 - 435) + chr(0b100110 + 0o77))(chr(117) + chr(0b1110100) + '\146' + chr(45) + chr(0b111000))] = x0wCjP0FJOTh
return YRwNbm9OifOu
|
awslabs/serverless-application-model
|
samtranslator/model/__init__.py
|
Resource.validate_properties
|
def validate_properties(self):
"""Validates that the required properties for this Resource have been populated, and that all properties have
valid values.
:returns: True if all properties are valid
:rtype: bool
:raises TypeError: if any properties are invalid
"""
for name, property_type in self.property_types.items():
value = getattr(self, name)
# If the property value is an intrinsic function, any remaining validation has to be left to CloudFormation
if property_type.supports_intrinsics and self._is_intrinsic_function(value):
continue
# If the property value has not been set, verify that the property is not required.
if value is None:
if property_type.required:
raise InvalidResourceException(
self.logical_id,
"Missing required property '{property_name}'.".format(property_name=name))
# Otherwise, validate the value of the property.
elif not property_type.validate(value, should_raise=False):
raise InvalidResourceException(
self.logical_id,
"Type of property '{property_name}' is invalid.".format(property_name=name))
|
python
|
def validate_properties(self):
"""Validates that the required properties for this Resource have been populated, and that all properties have
valid values.
:returns: True if all properties are valid
:rtype: bool
:raises TypeError: if any properties are invalid
"""
for name, property_type in self.property_types.items():
value = getattr(self, name)
# If the property value is an intrinsic function, any remaining validation has to be left to CloudFormation
if property_type.supports_intrinsics and self._is_intrinsic_function(value):
continue
# If the property value has not been set, verify that the property is not required.
if value is None:
if property_type.required:
raise InvalidResourceException(
self.logical_id,
"Missing required property '{property_name}'.".format(property_name=name))
# Otherwise, validate the value of the property.
elif not property_type.validate(value, should_raise=False):
raise InvalidResourceException(
self.logical_id,
"Type of property '{property_name}' is invalid.".format(property_name=name))
|
[
"def",
"validate_properties",
"(",
"self",
")",
":",
"for",
"name",
",",
"property_type",
"in",
"self",
".",
"property_types",
".",
"items",
"(",
")",
":",
"value",
"=",
"getattr",
"(",
"self",
",",
"name",
")",
"# If the property value is an intrinsic function, any remaining validation has to be left to CloudFormation",
"if",
"property_type",
".",
"supports_intrinsics",
"and",
"self",
".",
"_is_intrinsic_function",
"(",
"value",
")",
":",
"continue",
"# If the property value has not been set, verify that the property is not required.",
"if",
"value",
"is",
"None",
":",
"if",
"property_type",
".",
"required",
":",
"raise",
"InvalidResourceException",
"(",
"self",
".",
"logical_id",
",",
"\"Missing required property '{property_name}'.\"",
".",
"format",
"(",
"property_name",
"=",
"name",
")",
")",
"# Otherwise, validate the value of the property.",
"elif",
"not",
"property_type",
".",
"validate",
"(",
"value",
",",
"should_raise",
"=",
"False",
")",
":",
"raise",
"InvalidResourceException",
"(",
"self",
".",
"logical_id",
",",
"\"Type of property '{property_name}' is invalid.\"",
".",
"format",
"(",
"property_name",
"=",
"name",
")",
")"
] |
Validates that the required properties for this Resource have been populated, and that all properties have
valid values.
:returns: True if all properties are valid
:rtype: bool
:raises TypeError: if any properties are invalid
|
[
"Validates",
"that",
"the",
"required",
"properties",
"for",
"this",
"Resource",
"have",
"been",
"populated",
"and",
"that",
"all",
"properties",
"have",
"valid",
"values",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/__init__.py#L230-L255
|
train
|
Validates that all properties of this resource have been populated and that all properties have valid values.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2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ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + '\063' + '\x37', 15400 - 15392), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(48) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b110011) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(5343 - 5232) + chr(49) + chr(1746 - 1694) + chr(808 - 757), 0b1000), ehT0Px3KOsy9(chr(1836 - 1788) + chr(111) + '\x33' + '\x34' + chr(51), 0b1000), ehT0Px3KOsy9(chr(1196 - 1148) + chr(111) + chr(0b110001) + chr(0b110111) + '\066', 33623 - 33615), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2370 - 2319) + chr(0b110111) + chr(0b11000 + 0o32), 35534 - 35526), ehT0Px3KOsy9('\x30' + chr(0b11110 + 0o121) + chr(0b110010) + '\x34' + '\x37', 0b1000), ehT0Px3KOsy9(chr(2033 - 1985) + '\157' + chr(0b101010 + 0o13) + chr(0b1101 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(1205 - 1157) + chr(111) + '\062' + chr(0b110001) + '\065', 28512 - 28504), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10010 + 0o40) + chr(0b110000) + '\x36', 56308 - 56300), ehT0Px3KOsy9('\060' + chr(1166 - 1055) + chr(50) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1010100 + 0o33) + chr(0b110 + 0o55) + chr(0b110010) + chr(0b101010 + 0o10), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010), 31947 - 31939), ehT0Px3KOsy9('\060' + chr(111) + chr(629 - 580) + chr(49) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101110 + 0o1) + chr(0b110001) + '\x31' + chr(2535 - 2483), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + '\x36' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(6474 - 6363) + chr(0b110011) + chr(51) + chr(0b110111), 40459 - 40451), ehT0Px3KOsy9(chr(1433 - 1385) + chr(0b1101111) + chr(0b11110 + 0o25) + chr(1244 - 1191) + '\x30', 0b1000), ehT0Px3KOsy9(chr(154 - 106) + chr(0b1101111) + chr(1786 - 1737) + chr(891 - 840) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5096 - 4985) + chr(0b100101 + 0o14) + '\064' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b100000 + 0o117) + '\064' + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100011 + 0o16) + chr(1861 - 1809) + chr(895 - 845), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(0b110110) + chr(51), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(51) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + chr(0b100010 + 0o21) + chr(49) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + chr(2068 - 1957) + chr(51) + chr(827 - 779) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2388 - 2337) + chr(265 - 212) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101110 + 0o1) + '\x31' + chr(0b10001 + 0o45) + chr(1538 - 1483), ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(294 - 245) + chr(53) + chr(0b110100 + 0o2), 20229 - 20221), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\157' + '\062' + '\061' + chr(48), 0b1000), ehT0Px3KOsy9(chr(2258 - 2210) + '\157' + chr(55) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\x6f' + chr(1539 - 1490) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(8864 - 8753) + chr(51) + chr(0b10000 + 0o43) + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + chr(9323 - 9212) + chr(49) + '\061' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\157' + '\062' + chr(0b110011) + chr(1152 - 1099), 26168 - 26160), ehT0Px3KOsy9(chr(48) + chr(0b1011111 + 0o20) + chr(0b110011) + chr(726 - 672) + chr(2525 - 2474), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1197 - 1146) + '\066' + chr(0b110101), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(221 - 173) + chr(0b1101111) + chr(0b110101) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1'), chr(0b111011 + 0o51) + '\x65' + chr(7803 - 7704) + chr(111) + '\144' + '\x65')('\x75' + '\x74' + chr(2820 - 2718) + '\055' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def afPg9obZrsQ7(oVre8I6UXc3b):
for (AIvJRzLdDfgF, VQVbwiaMVCXp) in xafqLlk3kkUe(oVre8I6UXc3b.property_types, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd18\xac\x06\xaa$\xc9\xee@\xde\xce.'), chr(100) + chr(9671 - 9570) + '\143' + chr(0b1101111) + chr(810 - 710) + '\145')(chr(117) + chr(0b1100010 + 0o22) + chr(102) + '\055' + chr(1439 - 1383)))():
QmmgWUB13VCJ = xafqLlk3kkUe(oVre8I6UXc3b, AIvJRzLdDfgF)
if xafqLlk3kkUe(VQVbwiaMVCXp, xafqLlk3kkUe(SXOLrMavuUCe(b"\xec7\xaa\x13\x8c\x0c\x8e\xd4s\xe4\xe8c\xa0k'?\x99\xbc\x9b"), chr(100) + chr(0b1100101) + '\x63' + '\157' + '\x64' + chr(101))('\x75' + chr(0b1110100) + chr(102) + chr(0b11001 + 0o24) + chr(56))) and xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0+\xa9<\x8a\x10\x8e\xd5E\xe3\xf5~\xb1]/9\x9e\xbc\x9c2\tK'), chr(0b1100100) + '\x65' + '\x63' + '\x6f' + chr(0b1100100) + '\145')('\165' + chr(0b110111 + 0o75) + chr(0b1100110) + '\055' + chr(0b111000)))(QmmgWUB13VCJ):
continue
if QmmgWUB13VCJ is None:
if xafqLlk3kkUe(VQVbwiaMVCXp, xafqLlk3kkUe(SXOLrMavuUCe(b"\xed'\xab\x16\x8a\x0c\x9f\xc3"), chr(100) + chr(101) + chr(99) + chr(0b110001 + 0o76) + '\x64' + chr(5695 - 5594))('\165' + '\164' + '\146' + '\x2d' + '\070')):
raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd12\x80\x11\xd5H\xb7\xc3n\xe5\xd0P'), chr(0b110000 + 0o64) + '\145' + chr(0b1100011) + '\157' + chr(3216 - 3116) + '\x65')(chr(117) + chr(116) + chr(102) + chr(782 - 737) + '\070')), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2+\xa9\x10\x8a\x10\x9d\x87^\xe8\xf7b\xbbp,(\xd0\xaf\x9a4\x16@\x10r\nz\xe8\xbe\x9d\x05\x01u\xedOz\xa0\x12\xf3\x92\x98\xfa?\xfdM'), '\144' + '\x65' + chr(324 - 225) + chr(111) + chr(0b101000 + 0o74) + chr(0b1100101))(chr(0b1101111 + 0o6) + chr(0b101010 + 0o112) + chr(4099 - 3997) + chr(0b100111 + 0o6) + chr(0b10001 + 0o47)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9v\xa8\x0c\xab\x1f\xa9\x94|\xfd\xe3}'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\157' + chr(100) + '\x65')(chr(0b101001 + 0o114) + '\164' + chr(0b1001101 + 0o31) + chr(528 - 483) + chr(0b1 + 0o67)))(property_name=AIvJRzLdDfgF))
elif not xafqLlk3kkUe(VQVbwiaMVCXp, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7,\x90"\x9a\x0f\xb6\xd2g\xfe\xd2&'), '\x64' + chr(0b111101 + 0o50) + chr(7162 - 7063) + chr(10258 - 10147) + chr(0b1111 + 0o125) + chr(0b1100101))(chr(0b1110101) + chr(0b10000 + 0o144) + chr(3175 - 3073) + chr(663 - 618) + chr(56)))(QmmgWUB13VCJ, should_raise=ehT0Px3KOsy9(chr(1030 - 982) + chr(0b1101011 + 0o4) + chr(2106 - 2058), ord("\x08"))):
raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd12\x80\x11\xd5H\xb7\xc3n\xe5\xd0P'), '\x64' + chr(7483 - 7382) + chr(8729 - 8630) + chr(3114 - 3003) + chr(0b1100 + 0o130) + '\145')(chr(0b110111 + 0o76) + '\x74' + chr(102) + chr(346 - 301) + chr(0b1110 + 0o52))), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xcb;\xaa\x06\xc3\x11\x9c\x87\\\xff\xe9g\xb7p=5\xd0\xf8\x93+\x14J\x12c\x01.\xb6\x9a\x83\x16\x03`\xf5\x1a.\xb0>\xbd\x9a\x9b\xe9#\xb6\n\x87P'), '\x64' + chr(0b1100101) + chr(0b1011111 + 0o4) + chr(111) + chr(0b1100100) + chr(0b111000 + 0o55))(chr(12680 - 12563) + '\164' + chr(4187 - 4085) + '\x2d' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9v\xa8\x0c\xab\x1f\xa9\x94|\xfd\xe3}'), chr(0b110100 + 0o60) + '\145' + '\143' + chr(0b10 + 0o155) + chr(3075 - 2975) + chr(0b1010100 + 0o21))(chr(0b0 + 0o165) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(56)))(property_name=AIvJRzLdDfgF))
|
awslabs/serverless-application-model
|
samtranslator/model/__init__.py
|
Resource.set_resource_attribute
|
def set_resource_attribute(self, attr, value):
"""Sets attributes on resource. Resource attributes are top-level entries of a CloudFormation resource
that exist outside of the Properties dictionary
:param attr: Attribute name
:param value: Attribute value
:return: None
:raises KeyError if `attr` is not in the supported attribute list
"""
if attr not in self._supported_resource_attributes:
raise KeyError("Unsupported resource attribute specified: %s" % attr)
self.resource_attributes[attr] = value
|
python
|
def set_resource_attribute(self, attr, value):
"""Sets attributes on resource. Resource attributes are top-level entries of a CloudFormation resource
that exist outside of the Properties dictionary
:param attr: Attribute name
:param value: Attribute value
:return: None
:raises KeyError if `attr` is not in the supported attribute list
"""
if attr not in self._supported_resource_attributes:
raise KeyError("Unsupported resource attribute specified: %s" % attr)
self.resource_attributes[attr] = value
|
[
"def",
"set_resource_attribute",
"(",
"self",
",",
"attr",
",",
"value",
")",
":",
"if",
"attr",
"not",
"in",
"self",
".",
"_supported_resource_attributes",
":",
"raise",
"KeyError",
"(",
"\"Unsupported resource attribute specified: %s\"",
"%",
"attr",
")",
"self",
".",
"resource_attributes",
"[",
"attr",
"]",
"=",
"value"
] |
Sets attributes on resource. Resource attributes are top-level entries of a CloudFormation resource
that exist outside of the Properties dictionary
:param attr: Attribute name
:param value: Attribute value
:return: None
:raises KeyError if `attr` is not in the supported attribute list
|
[
"Sets",
"attributes",
"on",
"resource",
".",
"Resource",
"attributes",
"are",
"top",
"-",
"level",
"entries",
"of",
"a",
"CloudFormation",
"resource",
"that",
"exist",
"outside",
"of",
"the",
"Properties",
"dictionary"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/__init__.py#L257-L270
|
train
|
Sets the value of the specified attribute on the resource.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HP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3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(111) + chr(174 - 125) + chr(68 - 16) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(618 - 570) + chr(0b101011 + 0o7), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(10971 - 10860) + chr(281 - 231) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(1870 - 1822) + chr(0b1101111) + chr(0b110100) + '\067', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(54) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + '\x33' + chr(0b0 + 0o65) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\067' + chr(53), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b10110 + 0o33) + '\064' + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11101 + 0o24) + chr(1926 - 1874) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + '\x36' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\x6f' + chr(2324 - 2272) + chr(0b110111), 8), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(11718 - 11607) + chr(1211 - 1158) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(111) + chr(51) + chr(0b110010) + chr(0b100100 + 0o14), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(0b110001) + chr(2508 - 2456), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(7623 - 7512) + chr(0b100 + 0o55) + chr(55), 0o10), ehT0Px3KOsy9('\060' + chr(0b10110 + 0o131) + chr(0b110011) + '\x30' + '\063', 51469 - 51461), ehT0Px3KOsy9('\060' + chr(9620 - 9509) + '\061' + chr(54) + '\x34', 42867 - 42859), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + '\063' + '\x37', 47472 - 47464), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(2571 - 2520) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + chr(1694 - 1640) + chr(0b101111 + 0o1), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1001111 + 0o40) + '\x33' + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + chr(4370 - 4259) + '\062' + '\066' + chr(97 - 49), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\066', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(1023 - 974) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1817 - 1767) + chr(0b10 + 0o61), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\063' + chr(0b110010 + 0o4), 0b1000), ehT0Px3KOsy9(chr(443 - 395) + chr(6527 - 6416) + chr(50) + chr(0b101 + 0o61) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(6369 - 6258) + chr(52) + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(1846 - 1797) + chr(0b11110 + 0o25) + '\x37', 56011 - 56003), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\157' + chr(432 - 382) + '\x31' + chr(1586 - 1537), 47723 - 47715), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(2173 - 2122) + '\066' + chr(0b100111 + 0o13), 0b1000), ehT0Px3KOsy9('\060' + chr(11226 - 11115) + chr(50) + chr(2520 - 2466) + chr(0b101000 + 0o16), 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\x6f' + '\061' + chr(55) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\x6f' + '\x32' + chr(50) + chr(1705 - 1650), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(0b110110) + chr(49), 30313 - 30305), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1110 + 0o44) + '\x36' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001100 + 0o43) + '\063' + chr(51) + '\064', 0b1000), ehT0Px3KOsy9(chr(1020 - 972) + '\x6f' + chr(50) + chr(324 - 276) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\065' + '\060', 14980 - 14972), ehT0Px3KOsy9(chr(0b110000) + chr(6447 - 6336) + chr(0b11000 + 0o33) + chr(55) + chr(139 - 90), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + chr(53) + chr(1043 - 995), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'O'), chr(0b1100100) + '\x65' + chr(0b100010 + 0o101) + chr(0b11 + 0o154) + chr(0b1001110 + 0o26) + chr(9200 - 9099))(chr(0b1000 + 0o155) + '\164' + '\146' + chr(0b1101 + 0o40) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def LJH9gajsNM11(oVre8I6UXc3b, uwnd9_euJYKT, QmmgWUB13VCJ):
if uwnd9_euJYKT not in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'>\xb1`WA\x87O\x16\x06\x92x^\xb5\xff`\xb6\x06\xbc\xfbo{\xc4j\xf9z<\xc0V:\xfa'), '\x64' + chr(6536 - 6435) + chr(0b1100011) + '\x6f' + chr(100) + chr(5001 - 4900))('\x75' + chr(724 - 608) + '\146' + chr(0b101101) + chr(1612 - 1556))):
raise RQ6CSRrFArYB(xafqLlk3kkUe(SXOLrMavuUCe(b'4\xacfRA\x98R\x10\x17\x93C\x0c\xa2\xe9|\xac\x01\xad\xfdU:\xd1j\xffa7\xd7W+\xec\xd2\xc5\r\xf2\xd2\xdb\xba\xedM\x9d[\xe20T'), chr(0b1100100) + '\145' + chr(99) + '\157' + chr(0b10000 + 0o124) + '\145')('\x75' + chr(13155 - 13039) + '\x66' + chr(0b101101) + chr(56)) % uwnd9_euJYKT)
oVre8I6UXc3b.x7ddN_ki5nGn[uwnd9_euJYKT] = QmmgWUB13VCJ
|
awslabs/serverless-application-model
|
samtranslator/model/__init__.py
|
Resource.get_resource_attribute
|
def get_resource_attribute(self, attr):
"""Gets the resource attribute if available
:param attr: Name of the attribute
:return: Value of the attribute, if set in the resource. None otherwise
"""
if attr not in self.resource_attributes:
raise KeyError("%s is not in resource attributes" % attr)
return self.resource_attributes[attr]
|
python
|
def get_resource_attribute(self, attr):
"""Gets the resource attribute if available
:param attr: Name of the attribute
:return: Value of the attribute, if set in the resource. None otherwise
"""
if attr not in self.resource_attributes:
raise KeyError("%s is not in resource attributes" % attr)
return self.resource_attributes[attr]
|
[
"def",
"get_resource_attribute",
"(",
"self",
",",
"attr",
")",
":",
"if",
"attr",
"not",
"in",
"self",
".",
"resource_attributes",
":",
"raise",
"KeyError",
"(",
"\"%s is not in resource attributes\"",
"%",
"attr",
")",
"return",
"self",
".",
"resource_attributes",
"[",
"attr",
"]"
] |
Gets the resource attribute if available
:param attr: Name of the attribute
:return: Value of the attribute, if set in the resource. None otherwise
|
[
"Gets",
"the",
"resource",
"attribute",
"if",
"available"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/__init__.py#L272-L281
|
train
|
Gets the resource attribute if available.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtr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sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + '\063' + chr(1829 - 1781) + chr(0b100010 + 0o21), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(0b110010) + chr(0b100100 + 0o14), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(4022 - 3911) + chr(49) + chr(53) + chr(803 - 750), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b101100 + 0o103) + chr(0b110101) + chr(102 - 51), ord("\x08")), ehT0Px3KOsy9(chr(374 - 326) + chr(0b100101 + 0o112) + '\x32' + '\065' + '\064', 10302 - 10294), ehT0Px3KOsy9('\060' + chr(111) + chr(0b111 + 0o56) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100010 + 0o21) + chr(48) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + '\x36' + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x35', 32418 - 32410), ehT0Px3KOsy9(chr(1270 - 1222) + '\x6f' + '\067' + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(2515 - 2404) + '\x33' + '\x31' + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100000 + 0o21) + '\062' + chr(0b110000), 8), ehT0Px3KOsy9(chr(1056 - 1008) + '\x6f' + chr(682 - 633) + '\x30' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(1505 - 1457) + '\157' + '\062' + chr(0b110010) + chr(740 - 690), 0o10), ehT0Px3KOsy9(chr(1345 - 1297) + chr(2078 - 1967) + chr(1524 - 1473) + chr(50) + chr(164 - 115), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(717 - 665) + chr(0b11000 + 0o35), 0o10), ehT0Px3KOsy9(chr(1290 - 1242) + chr(0b1101111) + chr(0b101 + 0o55) + chr(49) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(54) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1179 - 1130) + '\064' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(0b11010 + 0o30) + '\x34', 40109 - 40101), ehT0Px3KOsy9(chr(0b110000) + chr(4116 - 4005) + '\x36' + chr(222 - 169), 23907 - 23899), ehT0Px3KOsy9(chr(82 - 34) + chr(3972 - 3861) + chr(876 - 827) + '\x34' + chr(51), 11872 - 11864), ehT0Px3KOsy9(chr(1924 - 1876) + '\157' + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\x31' + chr(1142 - 1094), 8), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(10404 - 10293) + '\x33' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(1381 - 1332) + chr(48) + chr(51), 8), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + '\064' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\065' + '\063', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(48) + '\065', 18350 - 18342), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\157' + '\063' + '\063' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + '\x34' + chr(2135 - 2087), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(55) + chr(0b110101), 13879 - 13871), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11 + 0o56) + '\066' + chr(0b11010 + 0o27), 28796 - 28788), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(0b110111) + chr(0b100111 + 0o12), 47627 - 47619), ehT0Px3KOsy9('\x30' + '\157' + chr(605 - 555) + '\063' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(1666 - 1618) + '\x6f' + chr(0b110000 + 0o7) + '\x35', 31258 - 31250), ehT0Px3KOsy9(chr(503 - 455) + chr(0b1101111) + chr(1762 - 1711) + chr(1888 - 1838) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1000 + 0o51) + chr(55) + chr(1107 - 1058), 8), ehT0Px3KOsy9(chr(1128 - 1080) + '\x6f' + chr(0b110011) + chr(51) + '\x32', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b101000 + 0o107) + '\x35' + chr(1967 - 1919), 31747 - 31739)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xed'), chr(0b1100100) + '\145' + chr(7458 - 7359) + chr(0b1101111) + '\144' + chr(101))(chr(0b1110101) + chr(6754 - 6638) + '\146' + '\x2d' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def VWI7mQK8LUpK(oVre8I6UXc3b, uwnd9_euJYKT):
if uwnd9_euJYKT not in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbbg\tO\xe2r\xaa\x9b0Q\x8f>'), '\144' + '\145' + '\143' + '\157' + chr(0b10110 + 0o116) + chr(0b1010110 + 0o17))(chr(117) + chr(0b1110100) + chr(10302 - 10200) + '\055' + chr(2252 - 2196))):
raise RQ6CSRrFArYB(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6#MB\xdf\r\xaf\x9dq\x1f\xa1>c\xe0\xb4\x16\xe4\xc1\x15\xf7PCc\xbcj1\xceI\xf0{\xbb\x13'), chr(2272 - 2172) + chr(2217 - 2116) + chr(0b100000 + 0o103) + chr(0b1101111) + '\x64' + '\145')(chr(0b1110101) + '\164' + chr(0b101010 + 0o74) + '\055' + chr(56)) % uwnd9_euJYKT)
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbbg\tO\xe2r\xaa\x9b0Q\x8f>'), chr(100) + chr(101) + '\x63' + '\157' + chr(100) + '\145')(chr(117) + '\164' + '\x66' + chr(0b101101) + chr(0b111000)))[uwnd9_euJYKT]
|
awslabs/serverless-application-model
|
samtranslator/model/__init__.py
|
Resource.get_runtime_attr
|
def get_runtime_attr(self, attr_name):
"""
Returns a CloudFormation construct that provides value for this attribute. If the resource does not provide
this attribute, then this method raises an exception
:return: Dictionary that will resolve to value of the attribute when CloudFormation stack update is executed
"""
if attr_name in self.runtime_attrs:
return self.runtime_attrs[attr_name](self)
else:
raise NotImplementedError(attr_name + " attribute is not implemented for resource " + self.resource_type)
|
python
|
def get_runtime_attr(self, attr_name):
"""
Returns a CloudFormation construct that provides value for this attribute. If the resource does not provide
this attribute, then this method raises an exception
:return: Dictionary that will resolve to value of the attribute when CloudFormation stack update is executed
"""
if attr_name in self.runtime_attrs:
return self.runtime_attrs[attr_name](self)
else:
raise NotImplementedError(attr_name + " attribute is not implemented for resource " + self.resource_type)
|
[
"def",
"get_runtime_attr",
"(",
"self",
",",
"attr_name",
")",
":",
"if",
"attr_name",
"in",
"self",
".",
"runtime_attrs",
":",
"return",
"self",
".",
"runtime_attrs",
"[",
"attr_name",
"]",
"(",
"self",
")",
"else",
":",
"raise",
"NotImplementedError",
"(",
"attr_name",
"+",
"\" attribute is not implemented for resource \"",
"+",
"self",
".",
"resource_type",
")"
] |
Returns a CloudFormation construct that provides value for this attribute. If the resource does not provide
this attribute, then this method raises an exception
:return: Dictionary that will resolve to value of the attribute when CloudFormation stack update is executed
|
[
"Returns",
"a",
"CloudFormation",
"construct",
"that",
"provides",
"value",
"for",
"this",
"attribute",
".",
"If",
"the",
"resource",
"does",
"not",
"provide",
"this",
"attribute",
"then",
"this",
"method",
"raises",
"an",
"exception"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/__init__.py#L295-L306
|
train
|
Returns a CloudFormation construct that provides value for this attribute.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTst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tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + chr(1627 - 1577) + chr(48) + '\064', 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1001001 + 0o46) + '\x32' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(1433 - 1383) + chr(0b100001 + 0o21), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101100 + 0o3) + chr(278 - 228) + '\066' + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(52) + chr(2464 - 2412), 0o10), ehT0Px3KOsy9(chr(573 - 525) + '\x6f' + chr(0b110110) + '\x34', 40402 - 40394), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(50) + chr(2671 - 2618), 8668 - 8660), ehT0Px3KOsy9('\060' + chr(5311 - 5200) + chr(50) + chr(0b100101 + 0o16) + chr(245 - 194), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(5982 - 5871) + '\x31' + chr(0b110100) + chr(0b110011), 54808 - 54800), ehT0Px3KOsy9(chr(486 - 438) + '\x6f' + chr(0b110010) + chr(0b110000) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + chr(52) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(111) + '\061' + '\x31' + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(54) + '\062', 39864 - 39856), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1886 - 1837) + '\066' + '\x37', 8975 - 8967), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(1959 - 1906) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111111 + 0o60) + chr(0b1000 + 0o56) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011010 + 0o25) + chr(0b110001) + chr(2279 - 2229) + chr(1724 - 1673), 0o10), ehT0Px3KOsy9(chr(135 - 87) + chr(0b1101111) + chr(51) + '\x30' + chr(0b110011 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(1013 - 965) + chr(4258 - 4147) + chr(210 - 161) + chr(0b11010 + 0o30) + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1162 - 1112) + chr(53) + chr(52), 40687 - 40679), ehT0Px3KOsy9(chr(604 - 556) + chr(0b1101111) + chr(0b110011) + chr(52) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100010 + 0o17) + '\x36' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(288 - 237) + chr(0b110100 + 0o1) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(3154 - 3043) + '\x32' + chr(849 - 797), 8), ehT0Px3KOsy9('\060' + chr(1909 - 1798) + chr(1160 - 1109) + chr(52) + chr(52), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10111 + 0o33) + '\x36' + chr(0b110111), 61520 - 61512), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(0b100111 + 0o12) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(281 - 233) + '\x6f' + chr(0b110010) + chr(0b101011 + 0o6) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(9141 - 9030) + chr(0b110001) + '\061' + '\x33', 8), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + '\063', 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1101111) + chr(0b110001) + '\x31' + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b100111 + 0o110) + chr(0b101010 + 0o10) + chr(0b110100) + '\065', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x34' + '\062', 0b1000), ehT0Px3KOsy9(chr(220 - 172) + chr(871 - 760) + chr(50) + chr(54) + chr(673 - 625), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(8355 - 8244) + '\062' + chr(51) + chr(54), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110 + 0o54) + chr(55) + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + chr(0b10100 + 0o133) + chr(0b11001 + 0o31) + '\x35' + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + chr(10078 - 9967) + chr(51) + '\060' + chr(54), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + '\067' + chr(382 - 333), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10000 + 0o41) + chr(1644 - 1589) + chr(0b101100 + 0o12), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x35' + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa'), chr(100) + chr(101) + chr(99) + chr(0b11 + 0o154) + chr(0b1100100) + chr(8895 - 8794))('\165' + chr(0b1110100) + chr(0b1000 + 0o136) + chr(259 - 214) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def SrpJ1bhRSM7S(oVre8I6UXc3b, PZZCL8W8tfZ6):
if PZZCL8W8tfZ6 in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf6a\xfc\xc2\x8dY\xf0\xc4\x02\xf6\x129A'), chr(100) + chr(0b1 + 0o144) + chr(1037 - 938) + chr(2535 - 2424) + '\144' + chr(0b110110 + 0o57))(chr(8995 - 8878) + chr(10717 - 10601) + '\x66' + '\055' + '\x38')):
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf6a\xfc\xc2\x8dY\xf0\xc4\x02\xf6\x129A'), chr(0b1100100) + chr(0b1100101) + chr(0b1011011 + 0o10) + '\157' + chr(100) + chr(0b1000000 + 0o45))('\165' + chr(0b10001 + 0o143) + '\x66' + '\x2d' + chr(56)))[PZZCL8W8tfZ6](oVre8I6UXc3b)
else:
raise _zJ24Vce7wp0(PZZCL8W8tfZ6 + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4u\xe6\xc2\x96]\xf7\xee\x17\xe7F"AW\x04X\'\xe58\xc1\x91\x1a\x89y\x81\xd9\xfa\xea/#-\xcaP\x90\xec\xdf\xdc\xa9\x0c\x0c\xe7q\xb2'), chr(7901 - 7801) + chr(101) + chr(1159 - 1060) + chr(7913 - 7802) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b110110 + 0o60) + chr(0b1000 + 0o45) + '\070') + xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf6q\xe1\xd9\x91F\xf6\xfe<\xf6\x1f;W'), '\x64' + chr(8673 - 8572) + chr(0b101001 + 0o72) + '\x6f' + chr(0b1011100 + 0o10) + chr(4531 - 4430))('\165' + chr(5442 - 5326) + chr(0b1000101 + 0o41) + '\x2d' + '\070')))
|
awslabs/serverless-application-model
|
samtranslator/model/__init__.py
|
SamResourceMacro.get_resource_references
|
def get_resource_references(self, generated_cfn_resources, supported_resource_refs):
"""
Constructs the list of supported resource references by going through the list of CFN resources generated
by to_cloudformation() on this SAM resource. Each SAM resource must provide a map of properties that it
supports and the type of CFN resource this property resolves to.
:param list of Resource object generated_cfn_resources: List of CloudFormation resources generated by this
SAM resource
:param samtranslator.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Object
holding the mapping between property names and LogicalId of the generated CFN resource it maps to
:return: Updated supported_resource_refs
"""
if supported_resource_refs is None:
raise ValueError("`supported_resource_refs` object is required")
# Create a map of {ResourceType: LogicalId} for quick access
resource_id_by_type = {resource.resource_type: resource.logical_id for resource in generated_cfn_resources}
for property, cfn_type in self.referable_properties.items():
if cfn_type in resource_id_by_type:
supported_resource_refs.add(self.logical_id, property, resource_id_by_type[cfn_type])
return supported_resource_refs
|
python
|
def get_resource_references(self, generated_cfn_resources, supported_resource_refs):
"""
Constructs the list of supported resource references by going through the list of CFN resources generated
by to_cloudformation() on this SAM resource. Each SAM resource must provide a map of properties that it
supports and the type of CFN resource this property resolves to.
:param list of Resource object generated_cfn_resources: List of CloudFormation resources generated by this
SAM resource
:param samtranslator.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Object
holding the mapping between property names and LogicalId of the generated CFN resource it maps to
:return: Updated supported_resource_refs
"""
if supported_resource_refs is None:
raise ValueError("`supported_resource_refs` object is required")
# Create a map of {ResourceType: LogicalId} for quick access
resource_id_by_type = {resource.resource_type: resource.logical_id for resource in generated_cfn_resources}
for property, cfn_type in self.referable_properties.items():
if cfn_type in resource_id_by_type:
supported_resource_refs.add(self.logical_id, property, resource_id_by_type[cfn_type])
return supported_resource_refs
|
[
"def",
"get_resource_references",
"(",
"self",
",",
"generated_cfn_resources",
",",
"supported_resource_refs",
")",
":",
"if",
"supported_resource_refs",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"`supported_resource_refs` object is required\"",
")",
"# Create a map of {ResourceType: LogicalId} for quick access",
"resource_id_by_type",
"=",
"{",
"resource",
".",
"resource_type",
":",
"resource",
".",
"logical_id",
"for",
"resource",
"in",
"generated_cfn_resources",
"}",
"for",
"property",
",",
"cfn_type",
"in",
"self",
".",
"referable_properties",
".",
"items",
"(",
")",
":",
"if",
"cfn_type",
"in",
"resource_id_by_type",
":",
"supported_resource_refs",
".",
"add",
"(",
"self",
".",
"logical_id",
",",
"property",
",",
"resource_id_by_type",
"[",
"cfn_type",
"]",
")",
"return",
"supported_resource_refs"
] |
Constructs the list of supported resource references by going through the list of CFN resources generated
by to_cloudformation() on this SAM resource. Each SAM resource must provide a map of properties that it
supports and the type of CFN resource this property resolves to.
:param list of Resource object generated_cfn_resources: List of CloudFormation resources generated by this
SAM resource
:param samtranslator.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Object
holding the mapping between property names and LogicalId of the generated CFN resource it maps to
:return: Updated supported_resource_refs
|
[
"Constructs",
"the",
"list",
"of",
"supported",
"resource",
"references",
"by",
"going",
"through",
"the",
"list",
"of",
"CFN",
"resources",
"generated",
"by",
"to_cloudformation",
"()",
"on",
"this",
"SAM",
"resource",
".",
"Each",
"SAM",
"resource",
"must",
"provide",
"a",
"map",
"of",
"properties",
"that",
"it",
"supports",
"and",
"the",
"type",
"of",
"CFN",
"resource",
"this",
"property",
"resolves",
"to",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/__init__.py#L383-L406
|
train
|
Constructs the list of supported resource references by going through the list of generated CFN resources and adding them to the list of supported resource references.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJm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Rurm1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b101101 + 0o102) + '\x31' + chr(51) + '\062', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + '\x37' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\157' + chr(0b100010 + 0o21) + chr(0b10101 + 0o37) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(1614 - 1503) + chr(51) + '\x31' + chr(53), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(0b100101 + 0o17) + chr(1890 - 1842), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7228 - 7117) + '\x31' + chr(480 - 426) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b110001 + 0o76) + chr(55) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + chr(0b10101 + 0o35) + '\065' + chr(67 - 14), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3493 - 3382) + '\063' + '\061' + '\x31', 58933 - 58925), ehT0Px3KOsy9(chr(964 - 916) + chr(9773 - 9662) + '\x31' + chr(0b110100) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11110 + 0o24) + chr(49) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + chr(0b110011) + chr(48) + chr(54), 19827 - 19819), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(511 - 460) + chr(0b110100) + chr(54), 50169 - 50161), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + '\067' + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b10100 + 0o41) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + '\x32' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1100110 + 0o11) + chr(49) + chr(49), 60489 - 60481), ehT0Px3KOsy9('\060' + chr(0b111011 + 0o64) + chr(0b110011) + chr(0b110111) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(55), 40239 - 40231), ehT0Px3KOsy9(chr(48) + chr(2109 - 1998) + chr(0b101101 + 0o6) + chr(0b101 + 0o54) + '\x31', 8), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + chr(0b100110 + 0o20) + chr(2438 - 2383), 11 - 3), ehT0Px3KOsy9('\x30' + chr(8096 - 7985) + chr(0b100000 + 0o23) + chr(0b100111 + 0o16) + chr(1906 - 1856), 41946 - 41938), ehT0Px3KOsy9('\060' + chr(595 - 484) + chr(0b110011) + chr(1762 - 1714) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + chr(0b110011) + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b11001 + 0o35) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100111 + 0o110) + '\x32' + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(0b110000) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\x6f' + chr(115 - 65) + chr(55 - 4) + '\x34', 30746 - 30738), ehT0Px3KOsy9('\060' + chr(9381 - 9270) + chr(0b100100 + 0o16) + chr(847 - 799) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b11111 + 0o24) + chr(54) + '\060', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(0b110100) + chr(475 - 426), 0b1000), ehT0Px3KOsy9('\060' + chr(7827 - 7716) + chr(49) + chr(54) + '\x32', 14897 - 14889), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(111) + chr(336 - 285) + '\066', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11 + 0o57) + chr(448 - 400) + '\065', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11001 + 0o33) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(259 - 211) + chr(0b1101111) + chr(52) + '\063', 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + chr(0b110011) + chr(0b110110) + chr(2276 - 2226), 0o10), ehT0Px3KOsy9('\x30' + chr(0b100011 + 0o114) + chr(0b100110 + 0o13) + '\061' + '\063', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(1323 - 1274) + chr(1393 - 1339), 24300 - 24292), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\x30' + chr(940 - 889), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101000 + 0o7) + '\065' + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b't'), chr(100) + chr(6055 - 5954) + '\x63' + '\157' + chr(4398 - 4298) + chr(0b100010 + 0o103))(chr(5053 - 4936) + chr(0b1110100) + '\146' + chr(45) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def f3GwSMiYsJTU(oVre8I6UXc3b, GweV7vmUvScq, KvSmPUitKt7D):
if KvSmPUitKt7D is None:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b':\x8f\x95\xbd\x10\x19L\xd9\xac\x03\xd7\xb4\x83\xcb\xc3`{\x99j\x96E\x8f\xa7\xac\x117+\xfe\xed\x95\x02\x06>\xecR\x03\x80.\xbf\xb63\x8e\x85\xa9'), chr(100) + '\x65' + chr(99) + chr(0b1101111) + chr(0b110001 + 0o63) + chr(8273 - 8172))(chr(0b1110101) + chr(0b1011101 + 0o27) + chr(0b1100110) + chr(0b101101) + '\x38'))
oWl0ae9gADXL = {o9IPj2MJBBod.resource_type: o9IPj2MJBBod.NpZr66MdBhVG for o9IPj2MJBBod in GweV7vmUvScq}
for (FL7SmUoxlR9h, poe3QHUaXjsa) in xafqLlk3kkUe(oVre8I6UXc3b.referable_properties, xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\x86\x96\xa8),\r\xe4\xa54\xc0\xff'), '\x64' + chr(0b1010001 + 0o24) + chr(0b0 + 0o143) + chr(111) + chr(0b1100000 + 0o4) + chr(0b1001111 + 0o26))(chr(117) + chr(3797 - 3681) + chr(0b1100110) + chr(0b101101) + chr(0b11010 + 0o36)))():
if poe3QHUaXjsa in oWl0ae9gADXL:
xafqLlk3kkUe(KvSmPUitKt7D, xafqLlk3kkUe(SXOLrMavuUCe(b'/\xb6\xd0\xbcY\x15y\x98\x93(\xda\xf5'), chr(0b110001 + 0o63) + chr(6573 - 6472) + chr(0b110010 + 0o61) + chr(111) + '\x64' + chr(9019 - 8918))('\x75' + chr(0b1110100) + chr(102) + chr(846 - 801) + chr(0b110000 + 0o10)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x14\x8c\xba\xbfV@s\xc9\x8b\x0f\xde\x81'), '\144' + chr(0b110011 + 0o62) + chr(0b1011 + 0o130) + chr(0b1101111) + chr(7125 - 7025) + '\145')('\x75' + chr(116) + chr(102) + chr(1956 - 1911) + chr(0b11101 + 0o33))), FL7SmUoxlR9h, oWl0ae9gADXL[poe3QHUaXjsa])
return KvSmPUitKt7D
|
awslabs/serverless-application-model
|
samtranslator/model/__init__.py
|
ResourceTypeResolver.resolve_resource_type
|
def resolve_resource_type(self, resource_dict):
"""Returns the Resource class corresponding to the 'Type' key in the given resource dict.
:param dict resource_dict: the resource dict to resolve
:returns: the resolved Resource class
:rtype: class
"""
if not self.can_resolve(resource_dict):
raise TypeError("Resource dict has missing or invalid value for key Type. Event Type is: {}.".format(
resource_dict.get('Type')))
if resource_dict['Type'] not in self.resource_types:
raise TypeError("Invalid resource type {resource_type}".format(resource_type=resource_dict['Type']))
return self.resource_types[resource_dict['Type']]
|
python
|
def resolve_resource_type(self, resource_dict):
"""Returns the Resource class corresponding to the 'Type' key in the given resource dict.
:param dict resource_dict: the resource dict to resolve
:returns: the resolved Resource class
:rtype: class
"""
if not self.can_resolve(resource_dict):
raise TypeError("Resource dict has missing or invalid value for key Type. Event Type is: {}.".format(
resource_dict.get('Type')))
if resource_dict['Type'] not in self.resource_types:
raise TypeError("Invalid resource type {resource_type}".format(resource_type=resource_dict['Type']))
return self.resource_types[resource_dict['Type']]
|
[
"def",
"resolve_resource_type",
"(",
"self",
",",
"resource_dict",
")",
":",
"if",
"not",
"self",
".",
"can_resolve",
"(",
"resource_dict",
")",
":",
"raise",
"TypeError",
"(",
"\"Resource dict has missing or invalid value for key Type. Event Type is: {}.\"",
".",
"format",
"(",
"resource_dict",
".",
"get",
"(",
"'Type'",
")",
")",
")",
"if",
"resource_dict",
"[",
"'Type'",
"]",
"not",
"in",
"self",
".",
"resource_types",
":",
"raise",
"TypeError",
"(",
"\"Invalid resource type {resource_type}\"",
".",
"format",
"(",
"resource_type",
"=",
"resource_dict",
"[",
"'Type'",
"]",
")",
")",
"return",
"self",
".",
"resource_types",
"[",
"resource_dict",
"[",
"'Type'",
"]",
"]"
] |
Returns the Resource class corresponding to the 'Type' key in the given resource dict.
:param dict resource_dict: the resource dict to resolve
:returns: the resolved Resource class
:rtype: class
|
[
"Returns",
"the",
"Resource",
"class",
"corresponding",
"to",
"the",
"Type",
"key",
"in",
"the",
"given",
"resource",
"dict",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/__init__.py#L469-L481
|
train
|
Resolves the resource type key in the given resource dict.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0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4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\x6f' + chr(1174 - 1124) + chr(53) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100000 + 0o117) + '\x32' + chr(50) + chr(50), 0b1000), ehT0Px3KOsy9(chr(1068 - 1020) + '\157' + '\061' + '\x30' + chr(2650 - 2596), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(1047 - 996), 902 - 894), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001 + 0o2) + chr(0b1000 + 0o51) + chr(0b100010 + 0o17), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + '\064', 50651 - 50643), ehT0Px3KOsy9(chr(0b110000) + chr(6878 - 6767) + chr(352 - 301) + chr(51) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + chr(0b110000 + 0o4) + '\x35', 30881 - 30873), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1 + 0o156) + chr(0b11101 + 0o25) + '\062', 53061 - 53053), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + '\064' + chr(494 - 444), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\063' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + '\064' + chr(0b1011 + 0o51), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101110 + 0o1) + chr(50) + '\x35' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10101 + 0o132) + chr(0b110010) + '\x36' + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(0b0 + 0o157) + chr(0b100011 + 0o20) + chr(55) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b101011 + 0o7) + '\067' + '\x35', 0b1000), ehT0Px3KOsy9(chr(767 - 719) + '\x6f' + chr(2348 - 2297) + '\x36' + chr(966 - 913), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(0b101000 + 0o14) + '\x33', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + '\x36' + chr(0b11100 + 0o26), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\067' + '\x37', 48371 - 48363), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(1661 - 1612) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100111 + 0o110) + chr(0b110011) + chr(54) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100 + 0o61) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b101101 + 0o102) + '\x33' + chr(0b110111 + 0o0) + '\x30', 8), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(4006 - 3895) + chr(0b1011 + 0o47) + chr(0b110000) + chr(0b100010 + 0o25), 0o10), ehT0Px3KOsy9(chr(1339 - 1291) + '\157' + chr(51), 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + '\x35' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1011 + 0o53) + chr(0b111 + 0o55), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b110000) + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + chr(0b101000 + 0o11), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101010 + 0o5) + chr(0b11010 + 0o30) + chr(2013 - 1963), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + chr(1992 - 1943) + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + chr(507 - 396) + chr(0b11000 + 0o31) + '\x32' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(821 - 770) + chr(0b100110 + 0o13) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100000 + 0o21) + chr(0b110000) + chr(50), 712 - 704), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\x33' + chr(54), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101101 + 0o5) + chr(1311 - 1261) + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(55) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(50) + chr(0b1010 + 0o47), 8002 - 7994)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + chr(53) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x81'), chr(0b1100100) + chr(10160 - 10059) + '\143' + '\157' + '\144' + chr(101))('\165' + '\164' + chr(102) + chr(45) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def p9qel3cBKnCo(oVre8I6UXc3b, YRwNbm9OifOu):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcc\xf3(\\\xbbq\xa9J~\x14\xbe'), chr(100) + chr(0b1100101) + chr(99) + chr(3501 - 3390) + chr(5600 - 5500) + chr(101))(chr(0b101101 + 0o110) + '\164' + '\x66' + chr(45) + chr(56)))(YRwNbm9OifOu):
raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfd\xf75l\xbcf\xb9@2\x06\xb2\x07\xdd\x97\x90\xdc\x86\x83\xdfV\xbc\x87G\x96\xe0#\x02Ffh|w(8\xa5&\xbe\xe6Z=\xda\xf7fe\xa6f\xfaNw\x1b\xfb0\xd0\xc7\x9d\x93\xd5\xe6\xc4Z\xa1\x80\x0e\xac\xfes\x08\x14/r(!2)\xe2'), chr(9624 - 9524) + '\145' + chr(0b1100011) + chr(9142 - 9031) + '\x64' + '\x65')('\165' + '\x74' + chr(102) + '\x2d' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9\xa64l\x81u\x89\x16B\x12\xbe\x0e'), chr(7294 - 7194) + chr(0b1100101) + chr(99) + chr(111) + chr(0b1001011 + 0o31) + '\x65')(chr(0b1110101) + '\164' + '\146' + chr(1982 - 1937) + chr(0b101110 + 0o12)))(xafqLlk3kkUe(YRwNbm9OifOu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8\xf72'), chr(0b1011010 + 0o12) + chr(9612 - 9511) + chr(684 - 585) + '\157' + '\144' + chr(0b1100101))(chr(1178 - 1061) + chr(0b1110100) + '\x66' + chr(45) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb\xeb6f'), chr(100) + chr(101) + '\143' + chr(0b1101111) + '\144' + '\145')(chr(12620 - 12503) + chr(116) + '\x66' + chr(0b101101) + chr(0b111000)))))
if YRwNbm9OifOu[xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb\xeb6f'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(7922 - 7822) + chr(10082 - 9981))(chr(117) + chr(0b0 + 0o164) + chr(0b1100110) + chr(0b101101) + '\070')] not in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xf75l\xbcf\xb9@M\x16\xa2\x14\xcc\xc4'), '\144' + chr(0b1100101) + chr(0b10101 + 0o116) + '\157' + '\144' + chr(9539 - 9438))(chr(117) + '\164' + '\x66' + chr(1651 - 1606) + '\x38')):
raise sznFqDbNBHlx(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\xe6\xfc0b\xa5}\xbe\x05`\x07\xa8\x0b\xdc\xc5\x9b\xd8\xd5\xd7\xcbO\xaa\xd4U\x8a\xe2p\x02A4bw^=-\xbc'\xe3"), '\x64' + '\x65' + chr(0b1100011) + chr(0b1001101 + 0o42) + chr(2429 - 2329) + chr(0b1100 + 0o131))(chr(0b1110101) + chr(116) + '\x66' + '\x2d' + chr(2807 - 2751)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9\xa64l\x81u\x89\x16B\x12\xbe\x0e'), '\144' + chr(0b10 + 0o143) + chr(0b11 + 0o140) + chr(111) + chr(0b1100100) + chr(101))(chr(0b1010 + 0o153) + chr(6500 - 6384) + chr(102) + chr(0b101101) + chr(0b111000)))(resource_type=YRwNbm9OifOu[xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb\xeb6f'), chr(0b10100 + 0o120) + '\145' + chr(0b110101 + 0o56) + chr(0b1101111) + chr(0b1100000 + 0o4) + chr(101))(chr(0b111101 + 0o70) + '\x74' + chr(0b1100110) + '\x2d' + chr(0b10 + 0o66))]))
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd\xf75l\xbcf\xb9@M\x16\xa2\x14\xcc\xc4'), '\144' + '\x65' + chr(4128 - 4029) + '\x6f' + '\144' + chr(0b111001 + 0o54))(chr(0b1110101) + chr(3771 - 3655) + chr(0b1100110) + '\055' + chr(0b111000)))[YRwNbm9OifOu[xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb\xeb6f'), chr(0b1100100) + chr(101) + chr(0b110001 + 0o62) + '\157' + chr(0b10110 + 0o116) + chr(101))(chr(117) + chr(116) + chr(0b1 + 0o145) + '\055' + chr(0b100101 + 0o23))]]
|
awslabs/serverless-application-model
|
examples/apps/lex-make-appointment-python/lambda_function.py
|
build_response_card
|
def build_response_card(title, subtitle, options):
"""
Build a responseCard with a title, subtitle, and an optional set of options which should be displayed as buttons.
"""
buttons = None
if options is not None:
buttons = []
for i in range(min(5, len(options))):
buttons.append(options[i])
return {
'contentType': 'application/vnd.amazonaws.card.generic',
'version': 1,
'genericAttachments': [{
'title': title,
'subTitle': subtitle,
'buttons': buttons
}]
}
|
python
|
def build_response_card(title, subtitle, options):
"""
Build a responseCard with a title, subtitle, and an optional set of options which should be displayed as buttons.
"""
buttons = None
if options is not None:
buttons = []
for i in range(min(5, len(options))):
buttons.append(options[i])
return {
'contentType': 'application/vnd.amazonaws.card.generic',
'version': 1,
'genericAttachments': [{
'title': title,
'subTitle': subtitle,
'buttons': buttons
}]
}
|
[
"def",
"build_response_card",
"(",
"title",
",",
"subtitle",
",",
"options",
")",
":",
"buttons",
"=",
"None",
"if",
"options",
"is",
"not",
"None",
":",
"buttons",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"min",
"(",
"5",
",",
"len",
"(",
"options",
")",
")",
")",
":",
"buttons",
".",
"append",
"(",
"options",
"[",
"i",
"]",
")",
"return",
"{",
"'contentType'",
":",
"'application/vnd.amazonaws.card.generic'",
",",
"'version'",
":",
"1",
",",
"'genericAttachments'",
":",
"[",
"{",
"'title'",
":",
"title",
",",
"'subTitle'",
":",
"subtitle",
",",
"'buttons'",
":",
"buttons",
"}",
"]",
"}"
] |
Build a responseCard with a title, subtitle, and an optional set of options which should be displayed as buttons.
|
[
"Build",
"a",
"responseCard",
"with",
"a",
"title",
"subtitle",
"and",
"an",
"optional",
"set",
"of",
"options",
"which",
"should",
"be",
"displayed",
"as",
"buttons",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/lex-make-appointment-python/lambda_function.py#L75-L93
|
train
|
Build a responseCard with a title subtitle and optional set of options which should be displayed as buttons.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,G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lgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1104 - 1054) + '\062' + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(314 - 265) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b10010 + 0o37) + chr(2426 - 2372) + '\x33', 64083 - 64075), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + '\x34' + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1098 - 1049) + '\x35' + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101010 + 0o11) + chr(0b110001) + chr(0b1000 + 0o51), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b101100 + 0o103) + '\x32' + chr(0b1101 + 0o45) + '\x30', 2511 - 2503), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(0b110 + 0o60) + chr(1784 - 1732), ord("\x08")), ehT0Px3KOsy9(chr(622 - 574) + chr(0b11010 + 0o125) + '\061' + '\064' + chr(770 - 719), 3085 - 3077), ehT0Px3KOsy9(chr(48) + chr(10244 - 10133) + '\x32' + '\x33' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(842 - 794) + '\x6f' + '\063' + chr(1601 - 1549) + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(0b110000) + '\067', 0o10), ehT0Px3KOsy9(chr(1084 - 1036) + chr(0b101000 + 0o107) + chr(51) + '\x37' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b100100 + 0o113) + chr(2815 - 2760) + chr(309 - 256), 57657 - 57649), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(2980 - 2869) + chr(1255 - 1203) + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(878 - 828) + chr(51) + '\062', 8), ehT0Px3KOsy9('\x30' + chr(1425 - 1314) + '\061' + '\x33' + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + chr(1896 - 1785) + chr(50) + chr(770 - 718), ord("\x08")), ehT0Px3KOsy9(chr(1844 - 1796) + chr(0b1101111) + chr(49) + chr(50) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + '\060' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10 + 0o155) + '\x33' + chr(0b10101 + 0o35) + '\x37', 15643 - 15635), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(55) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(524 - 474) + '\x30' + chr(1160 - 1110), 0o10), ehT0Px3KOsy9(chr(397 - 349) + '\157' + '\x32' + '\x31' + '\063', 9729 - 9721), ehT0Px3KOsy9(chr(511 - 463) + chr(8683 - 8572) + '\062' + chr(1048 - 997) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b111010 + 0o65) + chr(1414 - 1364) + chr(0b1101 + 0o46), 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\x6f' + chr(49) + chr(2596 - 2545), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b110000 + 0o77) + chr(0b1011 + 0o46) + '\x33', 8), ehT0Px3KOsy9(chr(1212 - 1164) + '\x6f' + '\x33' + chr(0b1000 + 0o50) + '\062', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10110 + 0o34) + chr(55) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(7881 - 7770) + chr(0b110001) + '\067' + '\065', 55218 - 55210), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + '\x32' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100000 + 0o17) + chr(0b110011) + chr(521 - 469) + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + chr(4353 - 4242) + '\063' + chr(0b110000), 40778 - 40770), ehT0Px3KOsy9(chr(48) + chr(0b111110 + 0o61) + chr(0b110011) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\x6f' + chr(0b100101 + 0o15) + chr(428 - 379) + chr(49), 44544 - 44536), ehT0Px3KOsy9('\x30' + chr(0b1100111 + 0o10) + chr(863 - 814) + chr(0b110010) + '\x31', 24950 - 24942), ehT0Px3KOsy9(chr(0b110000) + chr(8077 - 7966) + '\061' + chr(48), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + '\062' + '\x36' + '\066', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b11100 + 0o123) + '\065' + chr(1880 - 1832), 39822 - 39814)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8'), '\144' + chr(5516 - 5415) + '\143' + '\x6f' + '\x64' + chr(9580 - 9479))(chr(8812 - 8695) + chr(1218 - 1102) + chr(102) + chr(0b11100 + 0o21) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def DEotPGyanzgs(IkttdaI0bGlA, paL7Hxmp9isk, vvlcdVOK7clu):
m5ahQnKJ5WOQ = None
if vvlcdVOK7clu is not None:
m5ahQnKJ5WOQ = []
for WVxHKyX45z_L in vQr8gNKaIaWE(Dx22bkKPdt5d(ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110101), 0o10), c2A0yzQpDQB3(vvlcdVOK7clu))):
xafqLlk3kkUe(m5ahQnKJ5WOQ, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf7{\x03\xc0\x05\xad'), chr(0b1011011 + 0o11) + '\x65' + chr(0b10101 + 0o116) + chr(111) + chr(0b1100100) + '\145')('\x75' + chr(0b1110100) + chr(2805 - 2703) + chr(0b100001 + 0o14) + '\070'))(vvlcdVOK7clu[WVxHKyX45z_L])
return {xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5d\x1d\xd1\x0e\xa7\xe4\xa0\x1a\xea\x85'), chr(0b1100100) + chr(0b1011000 + 0o15) + chr(0b1100011) + chr(384 - 273) + chr(0b1100100) + chr(0b1100101))(chr(6309 - 6192) + chr(0b1101 + 0o147) + chr(102) + chr(1548 - 1503) + chr(0b10 + 0o66)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xf7{\x03\xc9\x02\xaa\xf1\x80\n\xf5\x8e\xe8\x88aY\x08\xfb7u*(\xb9\xd9\xf5\xf8\xb2pjy\xa6\x97\x1a0\x8f}m\xe02'), chr(6167 - 6067) + chr(5762 - 5661) + chr(0b1100011) + chr(111) + chr(100) + chr(0b1100101))(chr(7182 - 7065) + chr(0b1110100) + chr(102) + chr(0b110 + 0o47) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0n\x01\xd6\x02\xa6\xfe'), '\144' + chr(101) + chr(0b110100 + 0o57) + '\157' + '\144' + chr(0b1100101))(chr(0b1110101) + chr(0b110001 + 0o103) + '\146' + chr(0b10001 + 0o34) + chr(0b101110 + 0o12)): ehT0Px3KOsy9(chr(0b110000) + chr(10028 - 9917) + chr(49), 0b1000), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1n\x1d\xc0\x19\xa0\xf3\xb5\x17\xee\x81\xa4\x96bXH\xee)'), chr(100) + chr(3488 - 3387) + '\143' + chr(8473 - 8362) + chr(100) + chr(101))('\x75' + chr(0b1110100) + chr(0b111110 + 0o50) + chr(45) + chr(0b111000)): [{xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2b\x07\xc9\x0e'), chr(100) + '\145' + '\143' + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(0b1110101) + '\x74' + chr(0b1100110) + '\055' + chr(2086 - 2030)): IkttdaI0bGlA, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe5~\x11\xf1\x02\xbd\xfc\x91'), '\x64' + chr(101) + '\x63' + chr(0b111001 + 0o66) + chr(0b111011 + 0o51) + '\145')('\x75' + '\164' + '\x66' + chr(1929 - 1884) + chr(3004 - 2948)): paL7Hxmp9isk, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf4~\x07\xd1\x04\xa7\xe3'), '\144' + chr(0b1100101) + chr(99) + '\157' + '\x64' + '\145')(chr(117) + chr(0b1101001 + 0o13) + '\146' + '\x2d' + chr(0b111000)): m5ahQnKJ5WOQ}]}
|
awslabs/serverless-application-model
|
examples/apps/lex-make-appointment-python/lambda_function.py
|
get_random_int
|
def get_random_int(minimum, maximum):
"""
Returns a random integer between min (included) and max (excluded)
"""
min_int = math.ceil(minimum)
max_int = math.floor(maximum)
return random.randint(min_int, max_int - 1)
|
python
|
def get_random_int(minimum, maximum):
"""
Returns a random integer between min (included) and max (excluded)
"""
min_int = math.ceil(minimum)
max_int = math.floor(maximum)
return random.randint(min_int, max_int - 1)
|
[
"def",
"get_random_int",
"(",
"minimum",
",",
"maximum",
")",
":",
"min_int",
"=",
"math",
".",
"ceil",
"(",
"minimum",
")",
"max_int",
"=",
"math",
".",
"floor",
"(",
"maximum",
")",
"return",
"random",
".",
"randint",
"(",
"min_int",
",",
"max_int",
"-",
"1",
")"
] |
Returns a random integer between min (included) and max (excluded)
|
[
"Returns",
"a",
"random",
"integer",
"between",
"min",
"(",
"included",
")",
"and",
"max",
"(",
"excluded",
")"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/lex-make-appointment-python/lambda_function.py#L125-L132
|
train
|
Returns a random integer between min and max
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ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,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1001011 + 0o44) + chr(0b110010) + chr(0b110000) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101101 + 0o2) + '\x32' + chr(157 - 105) + '\064', 0b1000), ehT0Px3KOsy9(chr(935 - 887) + chr(111) + chr(182 - 131) + '\065' + chr(49), 44178 - 44170), ehT0Px3KOsy9(chr(48) + '\157' + chr(1764 - 1715) + '\065' + chr(410 - 358), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + '\x32' + chr(1388 - 1337), 0b1000), ehT0Px3KOsy9('\060' + chr(8805 - 8694) + chr(0b110101) + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(2071 - 1960) + '\x32' + chr(2768 - 2715) + '\x35', 26693 - 26685), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(111) + chr(0b100011 + 0o22) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(2753 - 2642) + '\067' + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b110101), 44877 - 44869), ehT0Px3KOsy9(chr(48) + chr(0b1001 + 0o146) + chr(0b110010) + chr(0b101011 + 0o14) + chr(0b100011 + 0o20), 4202 - 4194), ehT0Px3KOsy9(chr(48) + chr(0b110011 + 0o74) + chr(49) + chr(0b110101), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + chr(1917 - 1865) + chr(52), 35750 - 35742), ehT0Px3KOsy9('\060' + chr(10421 - 10310) + '\x31' + chr(0b110001 + 0o1) + chr(517 - 465), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b111 + 0o54) + '\x31' + chr(1517 - 1464), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101111) + chr(53) + chr(0b11000 + 0o30), 8), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b100110 + 0o15) + chr(0b10101 + 0o36), 0b1000), ehT0Px3KOsy9('\x30' + chr(10233 - 10122) + chr(0b110011) + '\x34' + chr(52), 0b1000), ehT0Px3KOsy9(chr(754 - 706) + chr(0b1101111) + chr(2157 - 2106) + '\x36' + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\067' + '\x36', 1277 - 1269), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(52) + '\060', 0b1000), ehT0Px3KOsy9(chr(1895 - 1847) + '\157' + chr(1930 - 1880) + chr(2717 - 2664) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(54) + chr(389 - 334), 51046 - 51038), ehT0Px3KOsy9(chr(1975 - 1927) + chr(0b1101111) + chr(0b101 + 0o54) + chr(53), 8), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + chr(0b110010) + chr(2155 - 2100) + chr(53), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(536 - 485) + chr(1259 - 1208) + '\060', 17592 - 17584), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2402 - 2350) + chr(0b100101 + 0o22), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\x37' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101111) + '\x32' + chr(382 - 334) + '\066', 8), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + chr(907 - 858) + chr(54) + chr(54), 47148 - 47140), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010110 + 0o31) + chr(0b110111) + chr(1674 - 1623), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010 + 0o145) + '\062' + chr(0b110101) + chr(51), 0b1000), ehT0Px3KOsy9(chr(58 - 10) + chr(111) + chr(0b110010) + chr(0b110101) + '\x35', 8), ehT0Px3KOsy9('\x30' + chr(11450 - 11339) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(767 - 719) + chr(0b1001110 + 0o41) + '\x33' + '\064' + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + '\066' + chr(174 - 125), 63026 - 63018), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + '\060' + chr(1821 - 1773), 58561 - 58553), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1100001 + 0o16) + '\061' + chr(403 - 348) + chr(0b100010 + 0o22), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1011110 + 0o21) + '\065' + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8'), chr(1378 - 1278) + chr(0b100110 + 0o77) + chr(0b1100011) + chr(111) + chr(0b1100100) + '\x65')(chr(9163 - 9046) + chr(116) + chr(0b101 + 0o141) + '\x2d' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def yyJN8NVbr_Mz(YIAZqmKHfin_, _dNSs6gxhn0f):
TFu3TJVVesVm = yhiZVkosCjBm.ceil(YIAZqmKHfin_)
vukQRVwg7nXM = yhiZVkosCjBm.floor(_dNSs6gxhn0f)
return xafqLlk3kkUe(drxw09AdRdci, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0\xfc\x8b\x1c#f\x95``\x7f\xf5I'), chr(0b1100100) + chr(101) + '\x63' + chr(0b1101111) + chr(100) + '\x65')(chr(0b111110 + 0o67) + chr(0b1110100) + chr(102) + '\x2d' + '\x38'))(TFu3TJVVesVm, vukQRVwg7nXM - ehT0Px3KOsy9(chr(0b110000) + chr(0b10111 + 0o130) + '\061', 3454 - 3446))
|
awslabs/serverless-application-model
|
examples/apps/lex-make-appointment-python/lambda_function.py
|
get_availabilities
|
def get_availabilities(date):
"""
Helper function which in a full implementation would feed into a backend API to provide query schedule availability.
The output of this function is an array of 30 minute periods of availability, expressed in ISO-8601 time format.
In order to enable quick demonstration of all possible conversation paths supported in this example, the function
returns a mixture of fixed and randomized results.
On Mondays, availability is randomized; otherwise there is no availability on Tuesday / Thursday and availability at
10:00 - 10:30 and 4:00 - 5:00 on Wednesday / Friday.
"""
day_of_week = dateutil.parser.parse(date).weekday()
availabilities = []
available_probability = 0.3
if day_of_week == 0:
start_hour = 10
while start_hour <= 16:
if random.random() < available_probability:
# Add an availability window for the given hour, with duration determined by another random number.
appointment_type = get_random_int(1, 4)
if appointment_type == 1:
availabilities.append('{}:00'.format(start_hour))
elif appointment_type == 2:
availabilities.append('{}:30'.format(start_hour))
else:
availabilities.append('{}:00'.format(start_hour))
availabilities.append('{}:30'.format(start_hour))
start_hour += 1
if day_of_week == 2 or day_of_week == 4:
availabilities.append('10:00')
availabilities.append('16:00')
availabilities.append('16:30')
return availabilities
|
python
|
def get_availabilities(date):
"""
Helper function which in a full implementation would feed into a backend API to provide query schedule availability.
The output of this function is an array of 30 minute periods of availability, expressed in ISO-8601 time format.
In order to enable quick demonstration of all possible conversation paths supported in this example, the function
returns a mixture of fixed and randomized results.
On Mondays, availability is randomized; otherwise there is no availability on Tuesday / Thursday and availability at
10:00 - 10:30 and 4:00 - 5:00 on Wednesday / Friday.
"""
day_of_week = dateutil.parser.parse(date).weekday()
availabilities = []
available_probability = 0.3
if day_of_week == 0:
start_hour = 10
while start_hour <= 16:
if random.random() < available_probability:
# Add an availability window for the given hour, with duration determined by another random number.
appointment_type = get_random_int(1, 4)
if appointment_type == 1:
availabilities.append('{}:00'.format(start_hour))
elif appointment_type == 2:
availabilities.append('{}:30'.format(start_hour))
else:
availabilities.append('{}:00'.format(start_hour))
availabilities.append('{}:30'.format(start_hour))
start_hour += 1
if day_of_week == 2 or day_of_week == 4:
availabilities.append('10:00')
availabilities.append('16:00')
availabilities.append('16:30')
return availabilities
|
[
"def",
"get_availabilities",
"(",
"date",
")",
":",
"day_of_week",
"=",
"dateutil",
".",
"parser",
".",
"parse",
"(",
"date",
")",
".",
"weekday",
"(",
")",
"availabilities",
"=",
"[",
"]",
"available_probability",
"=",
"0.3",
"if",
"day_of_week",
"==",
"0",
":",
"start_hour",
"=",
"10",
"while",
"start_hour",
"<=",
"16",
":",
"if",
"random",
".",
"random",
"(",
")",
"<",
"available_probability",
":",
"# Add an availability window for the given hour, with duration determined by another random number.",
"appointment_type",
"=",
"get_random_int",
"(",
"1",
",",
"4",
")",
"if",
"appointment_type",
"==",
"1",
":",
"availabilities",
".",
"append",
"(",
"'{}:00'",
".",
"format",
"(",
"start_hour",
")",
")",
"elif",
"appointment_type",
"==",
"2",
":",
"availabilities",
".",
"append",
"(",
"'{}:30'",
".",
"format",
"(",
"start_hour",
")",
")",
"else",
":",
"availabilities",
".",
"append",
"(",
"'{}:00'",
".",
"format",
"(",
"start_hour",
")",
")",
"availabilities",
".",
"append",
"(",
"'{}:30'",
".",
"format",
"(",
"start_hour",
")",
")",
"start_hour",
"+=",
"1",
"if",
"day_of_week",
"==",
"2",
"or",
"day_of_week",
"==",
"4",
":",
"availabilities",
".",
"append",
"(",
"'10:00'",
")",
"availabilities",
".",
"append",
"(",
"'16:00'",
")",
"availabilities",
".",
"append",
"(",
"'16:30'",
")",
"return",
"availabilities"
] |
Helper function which in a full implementation would feed into a backend API to provide query schedule availability.
The output of this function is an array of 30 minute periods of availability, expressed in ISO-8601 time format.
In order to enable quick demonstration of all possible conversation paths supported in this example, the function
returns a mixture of fixed and randomized results.
On Mondays, availability is randomized; otherwise there is no availability on Tuesday / Thursday and availability at
10:00 - 10:30 and 4:00 - 5:00 on Wednesday / Friday.
|
[
"Helper",
"function",
"which",
"in",
"a",
"full",
"implementation",
"would",
"feed",
"into",
"a",
"backend",
"API",
"to",
"provide",
"query",
"schedule",
"availability",
".",
"The",
"output",
"of",
"this",
"function",
"is",
"an",
"array",
"of",
"30",
"minute",
"periods",
"of",
"availability",
"expressed",
"in",
"ISO",
"-",
"8601",
"time",
"format",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/lex-make-appointment-python/lambda_function.py#L135-L169
|
train
|
This function returns a list of 30 minute periods of availability for a given date.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2Q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MOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\x33' + chr(2461 - 2409), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + '\x37' + '\x35', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(2641 - 2530) + chr(0b110011) + chr(0b110000) + chr(359 - 306), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(634 - 585) + chr(1400 - 1351) + chr(54), 0o10), ehT0Px3KOsy9(chr(2035 - 1987) + chr(2649 - 2538) + chr(2266 - 2217) + chr(2182 - 2132) + '\x31', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(280 - 230) + '\x35' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(10766 - 10655) + chr(0b110100 + 0o1), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001000 + 0o47) + chr(51) + '\065' + '\x31', 0b1000), ehT0Px3KOsy9(chr(1934 - 1886) + chr(0b100111 + 0o110) + '\062' + '\066' + chr(1278 - 1230), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(0b101110 + 0o3) + chr(0b110001) + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011100 + 0o23) + chr(0b110111 + 0o0) + chr(1387 - 1338), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(8815 - 8704) + chr(51) + chr(0b110010) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + chr(50) + chr(0b110110) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110011 + 0o74) + chr(0b1010 + 0o50) + chr(0b110110) + chr(0b101 + 0o54), 0b1000), ehT0Px3KOsy9(chr(409 - 361) + chr(0b1001111 + 0o40) + chr(0b1111 + 0o44) + chr(0b1111 + 0o41) + chr(0b100011 + 0o22), 8), ehT0Px3KOsy9(chr(48) + chr(0b1000101 + 0o52) + chr(49) + chr(1119 - 1069) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(1557 - 1509) + chr(111) + chr(51) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(8682 - 8571) + chr(1464 - 1415) + '\x36' + chr(1650 - 1596), 62387 - 62379), ehT0Px3KOsy9('\060' + chr(9685 - 9574) + chr(0b110011) + '\x37' + chr(48), 0b1000), ehT0Px3KOsy9(chr(1005 - 957) + '\x6f' + chr(1670 - 1622), ord("\x08")), ehT0Px3KOsy9(chr(1207 - 1159) + chr(0b1101111) + chr(0b110010) + chr(0b101110 + 0o5) + chr(0b110010), 326 - 318), ehT0Px3KOsy9(chr(1382 - 1334) + chr(0b1101010 + 0o5) + '\063' + chr(0b110101) + chr(2323 - 2269), 0b1000), ehT0Px3KOsy9('\x30' + chr(3296 - 3185) + chr(0b100000 + 0o23) + chr(0b110111) + chr(0b10100 + 0o41), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b10100 + 0o40) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(2648 - 2595) + chr(83 - 28), 0o10), ehT0Px3KOsy9(chr(1185 - 1137) + '\x6f' + chr(0b10110 + 0o33) + '\065' + chr(350 - 297), 64499 - 64491), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\x6f' + chr(2570 - 2516) + '\x31', 37130 - 37122), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + chr(314 - 265) + '\x35' + chr(0b110101), 8), ehT0Px3KOsy9('\x30' + '\157' + '\061' + '\x32' + chr(0b10010 + 0o36), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b10001 + 0o136) + chr(59 - 8) + '\x34' + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(366 - 311) + chr(0b101000 + 0o13), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(0b110110), 19237 - 19229), ehT0Px3KOsy9(chr(0b110000) + chr(0b111001 + 0o66) + '\x32' + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b0 + 0o64) + chr(2507 - 2456), ord("\x08")), ehT0Px3KOsy9(chr(2140 - 2092) + '\x6f' + '\x31' + '\067' + '\x32', 15259 - 15251), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(50) + '\066' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100 + 0o57) + chr(53) + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + '\060' + chr(627 - 576), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(0b101 + 0o61) + chr(0b11001 + 0o36), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x35' + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf2'), chr(100) + '\145' + chr(3601 - 3502) + chr(0b1101111) + '\x64' + chr(5810 - 5709))(chr(0b1110101) + chr(0b1001101 + 0o47) + '\x66' + chr(1445 - 1400) + chr(2928 - 2872)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def _6pmlEXqYTRf(J4aeFOr3sjPo):
vwAATgzn4Dt_ = NHjt7rg938wZ.parser.parse(J4aeFOr3sjPo).weekday()
EZyAezyAzuci = []
IklEgBwLtfjt = 0.3
if vwAATgzn4Dt_ == ehT0Px3KOsy9(chr(582 - 534) + chr(0b1101111) + '\060', 8):
bP51057CTqca = ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110000 + 0o1) + chr(0b11111 + 0o23), 0o10)
while bP51057CTqca <= ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1917 - 1867) + '\060', 8):
if xafqLlk3kkUe(drxw09AdRdci, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8\x0f~\xb2~h\xeba\xbb\xd4.P'), '\144' + chr(0b110000 + 0o65) + '\x63' + chr(3291 - 3180) + chr(9269 - 9169) + '\x65')(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b1111 + 0o36) + chr(640 - 584)))() < IklEgBwLtfjt:
xFbpm3qQSFuC = yyJN8NVbr_Mz(ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110000 + 0o4), 0b1000))
if xFbpm3qQSFuC == ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061', 8):
xafqLlk3kkUe(EZyAezyAzuci, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\rv\xa0 5'), chr(0b1100100) + chr(101) + chr(0b1100011) + '\157' + '\x64' + '\x65')('\165' + chr(0b11 + 0o161) + chr(0b1100110) + '\055' + chr(0b1010 + 0o56)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7\x00<\xf5~'), '\x64' + '\145' + chr(7292 - 7193) + '\x6f' + '\x64' + chr(6834 - 6733))(chr(0b110101 + 0o100) + chr(0b1110100) + chr(1117 - 1015) + '\x2d' + chr(1802 - 1746)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x8aIt\xaa\x060\xf96\xb9\xc0(S'), chr(100) + chr(0b1010001 + 0o24) + '\143' + '\157' + '\144' + chr(0b1100101))(chr(0b11010 + 0o133) + chr(4103 - 3987) + chr(0b1100110) + '\x2d' + chr(1378 - 1322)))(bP51057CTqca))
elif xFbpm3qQSFuC == ehT0Px3KOsy9('\060' + chr(111) + chr(0b100110 + 0o14), 0o10):
xafqLlk3kkUe(EZyAezyAzuci, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\rv\xa0 5'), '\144' + '\145' + '\x63' + '\x6f' + '\x64' + chr(101))('\x75' + chr(0b1011000 + 0o34) + chr(102) + chr(1303 - 1258) + '\070'))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7\x00<\xf6~'), '\x64' + chr(0b1100101) + chr(3555 - 3456) + '\x6f' + '\144' + '\x65')('\x75' + chr(0b1000011 + 0o61) + chr(3267 - 3165) + '\x2d' + chr(0b111000 + 0o0)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x8aIt\xaa\x060\xf96\xb9\xc0(S'), chr(0b1100100) + chr(101) + '\143' + '\x6f' + chr(7711 - 7611) + '\145')('\165' + chr(0b1110100) + '\146' + '\055' + '\x38'))(bP51057CTqca))
else:
xafqLlk3kkUe(EZyAezyAzuci, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\rv\xa0 5'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(0b1100000 + 0o4) + '\x65')(chr(3269 - 3152) + chr(0b1110100) + chr(102) + '\x2d' + chr(56)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7\x00<\xf5~'), chr(100) + '\145' + chr(0b1100001 + 0o2) + chr(0b110001 + 0o76) + '\144' + chr(0b1000010 + 0o43))(chr(0b1011100 + 0o31) + chr(0b1100100 + 0o20) + chr(2644 - 2542) + chr(75 - 30) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x8aIt\xaa\x060\xf96\xb9\xc0(S'), chr(100) + chr(3887 - 3786) + chr(0b1100011) + chr(111) + '\x64' + chr(101))('\165' + '\164' + chr(0b1100110) + '\x2d' + chr(56)))(bP51057CTqca))
xafqLlk3kkUe(EZyAezyAzuci, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\rv\xa0 5'), chr(8921 - 8821) + chr(3745 - 3644) + chr(0b1100000 + 0o3) + '\x6f' + chr(0b101100 + 0o70) + chr(1575 - 1474))('\165' + '\x74' + chr(0b1100110) + chr(0b10100 + 0o31) + '\x38'))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7\x00<\xf6~'), chr(100) + chr(101) + chr(4833 - 4734) + chr(0b111100 + 0o63) + '\x64' + chr(9757 - 9656))(chr(0b110111 + 0o76) + chr(10686 - 10570) + chr(0b1100110) + chr(45) + chr(0b110011 + 0o5)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x8aIt\xaa\x060\xf96\xb9\xc0(S'), chr(0b111111 + 0o45) + chr(0b101100 + 0o71) + '\x63' + chr(0b1101111) + chr(0b1011010 + 0o12) + chr(0b111 + 0o136))(chr(117) + chr(116) + '\146' + chr(0b101101) + '\x38'))(bP51057CTqca))
bP51057CTqca += ehT0Px3KOsy9('\x30' + '\157' + chr(49), 8)
if vwAATgzn4Dt_ == ehT0Px3KOsy9('\060' + chr(111) + '\062', 8) or vwAATgzn4Dt_ == ehT0Px3KOsy9(chr(48) + chr(4113 - 4002) + '\064', 8):
xafqLlk3kkUe(EZyAezyAzuci, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\rv\xa0 5'), chr(0b1100100) + '\145' + chr(99) + '\157' + chr(1176 - 1076) + chr(5197 - 5096))('\165' + chr(0b1 + 0o163) + '\146' + '\x2d' + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xedM<\xf5~'), chr(0b1100010 + 0o2) + chr(101) + '\x63' + chr(0b1101111) + '\x64' + '\x65')('\165' + '\164' + chr(0b1100110) + chr(1842 - 1797) + chr(0b11010 + 0o36)))
xafqLlk3kkUe(EZyAezyAzuci, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\rv\xa0 5'), '\144' + chr(101) + '\143' + '\157' + '\144' + '\145')(chr(10984 - 10867) + chr(0b1110100) + chr(0b1000000 + 0o46) + '\x2d' + chr(0b100001 + 0o27)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xedK<\xf5~'), chr(430 - 330) + chr(0b0 + 0o145) + chr(554 - 455) + chr(0b1101111) + '\144' + chr(101))(chr(292 - 175) + chr(5819 - 5703) + chr(0b11101 + 0o111) + '\x2d' + chr(1001 - 945)))
xafqLlk3kkUe(EZyAezyAzuci, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\rv\xa0 5'), '\144' + '\x65' + chr(0b1100011) + chr(0b1101010 + 0o5) + chr(100) + chr(2044 - 1943))(chr(6226 - 6109) + chr(0b1110100) + chr(8950 - 8848) + '\x2d' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xedK<\xf6~'), '\144' + chr(0b1100101) + chr(99) + chr(111) + '\144' + chr(0b1100101))('\165' + chr(116) + '\x66' + '\055' + chr(153 - 97)))
return EZyAezyAzuci
|
awslabs/serverless-application-model
|
examples/apps/lex-make-appointment-python/lambda_function.py
|
is_available
|
def is_available(time, duration, availabilities):
"""
Helper function to check if the given time and duration fits within a known set of availability windows.
Duration is assumed to be one of 30, 60 (meaning minutes). Availabilities is expected to contain entries of the format HH:MM.
"""
if duration == 30:
return time in availabilities
elif duration == 60:
second_half_hour_time = increment_time_by_thirty_mins(time)
return time in availabilities and second_half_hour_time in availabilities
# Invalid duration ; throw error. We should not have reached this branch due to earlier validation.
raise Exception('Was not able to understand duration {}'.format(duration))
|
python
|
def is_available(time, duration, availabilities):
"""
Helper function to check if the given time and duration fits within a known set of availability windows.
Duration is assumed to be one of 30, 60 (meaning minutes). Availabilities is expected to contain entries of the format HH:MM.
"""
if duration == 30:
return time in availabilities
elif duration == 60:
second_half_hour_time = increment_time_by_thirty_mins(time)
return time in availabilities and second_half_hour_time in availabilities
# Invalid duration ; throw error. We should not have reached this branch due to earlier validation.
raise Exception('Was not able to understand duration {}'.format(duration))
|
[
"def",
"is_available",
"(",
"time",
",",
"duration",
",",
"availabilities",
")",
":",
"if",
"duration",
"==",
"30",
":",
"return",
"time",
"in",
"availabilities",
"elif",
"duration",
"==",
"60",
":",
"second_half_hour_time",
"=",
"increment_time_by_thirty_mins",
"(",
"time",
")",
"return",
"time",
"in",
"availabilities",
"and",
"second_half_hour_time",
"in",
"availabilities",
"# Invalid duration ; throw error. We should not have reached this branch due to earlier validation.",
"raise",
"Exception",
"(",
"'Was not able to understand duration {}'",
".",
"format",
"(",
"duration",
")",
")"
] |
Helper function to check if the given time and duration fits within a known set of availability windows.
Duration is assumed to be one of 30, 60 (meaning minutes). Availabilities is expected to contain entries of the format HH:MM.
|
[
"Helper",
"function",
"to",
"check",
"if",
"the",
"given",
"time",
"and",
"duration",
"fits",
"within",
"a",
"known",
"set",
"of",
"availability",
"windows",
".",
"Duration",
"is",
"assumed",
"to",
"be",
"one",
"of",
"30",
"60",
"(",
"meaning",
"minutes",
")",
".",
"Availabilities",
"is",
"expected",
"to",
"contain",
"entries",
"of",
"the",
"format",
"HH",
":",
"MM",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/lex-make-appointment-python/lambda_function.py#L172-L184
|
train
|
Helper function to check if a given time and duration fits within a known set of availability windows.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLm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s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(111) + '\x37' + '\067', 0o10), ehT0Px3KOsy9('\x30' + chr(0b10100 + 0o133) + '\x33' + chr(0b110011) + chr(51), 0b1000), ehT0Px3KOsy9(chr(744 - 696) + chr(0b1101111) + chr(50) + chr(49) + chr(48), 1366 - 1358), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1277 - 1227) + chr(48) + chr(0b100100 + 0o14), 45842 - 45834), ehT0Px3KOsy9('\060' + '\157' + '\063' + '\061' + chr(54), 0o10), ehT0Px3KOsy9(chr(504 - 456) + chr(111) + chr(50) + chr(1570 - 1519) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(6554 - 6443) + chr(0b1111 + 0o43) + chr(0b110100) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(502 - 454) + chr(0b1101111) + chr(0b110010 + 0o1) + chr(0b100011 + 0o20) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100001 + 0o20) + chr(0b110000) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + '\067' + chr(1811 - 1757), 30229 - 30221), ehT0Px3KOsy9(chr(2192 - 2144) + '\x6f' + chr(0b11 + 0o60) + chr(48) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b100111 + 0o16) + chr(2201 - 2150), 0o10), ehT0Px3KOsy9(chr(1083 - 1035) + chr(0b1101111) + chr(0b100001 + 0o26) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + chr(0b1101 + 0o46) + chr(50), 15869 - 15861), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + chr(1590 - 1539) + '\061' + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\x6f' + chr(0b110011) + chr(983 - 933) + chr(0b11011 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(8204 - 8093) + '\x37' + chr(55), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b110011 + 0o74) + chr(49) + '\064' + '\066', 11509 - 11501), ehT0Px3KOsy9(chr(48) + chr(2887 - 2776) + '\x33' + chr(50) + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100000 + 0o17) + chr(50) + chr(0b11110 + 0o25) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100100 + 0o113) + chr(0b110010) + '\x37' + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(2857 - 2802) + chr(50), 19792 - 19784), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10000 + 0o43) + chr(0b111 + 0o60) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(779 - 731) + chr(111) + chr(0b110100 + 0o0) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1101111) + chr(974 - 925) + '\065' + chr(0b110001), 26099 - 26091), ehT0Px3KOsy9(chr(938 - 890) + '\157' + chr(49) + chr(115 - 61) + chr(739 - 689), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b110111) + chr(0b100110 + 0o16), 0b1000), ehT0Px3KOsy9('\060' + chr(524 - 413) + chr(49) + '\x30' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1812 - 1701) + chr(1172 - 1121) + '\062' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011011 + 0o24) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + chr(359 - 308) + '\x32' + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(54), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(412 - 362) + '\x33' + '\064', 8), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + '\x37' + chr(900 - 850), 8), ehT0Px3KOsy9('\060' + chr(3309 - 3198) + '\x31' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + chr(50) + chr(0b100010 + 0o24) + chr(0b1011 + 0o46), 33651 - 33643), ehT0Px3KOsy9(chr(48) + '\157' + chr(55) + chr(2019 - 1964), 8), ehT0Px3KOsy9('\060' + chr(8774 - 8663) + '\x32' + chr(0b110011) + chr(1793 - 1742), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + '\063' + chr(2012 - 1961), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(111) + '\065' + chr(0b101000 + 0o10), 9328 - 9320)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x11'), '\x64' + chr(3434 - 3333) + '\143' + '\x6f' + chr(100) + chr(0b1100101))('\165' + '\x74' + chr(0b1100110) + chr(279 - 234) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def RzCfARRZ6h00(ltvhPP4VhXre, AW3Z20f3DKFA, EZyAezyAzuci):
if AW3Z20f3DKFA == ehT0Px3KOsy9(chr(0b110000) + chr(3694 - 3583) + '\x33' + '\x36', 8):
return ltvhPP4VhXre in EZyAezyAzuci
elif AW3Z20f3DKFA == ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110111) + chr(52), 0o10):
vtCsz6Jl8mBX = vZo_qEWa1g2D(ltvhPP4VhXre)
return ltvhPP4VhXre in EZyAezyAzuci and vtCsz6Jl8mBX in EZyAezyAzuci
raise jLmadlzMdunT(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'h\xba\xfb\xa0\xa0\xf0\xd6\xfc"\\\xad\xce\x1bn\xa6\xf0J\x08\xb7\xf9\xcf\x89\x8fAg\rR\x980\xa3e\xa1w\xf3\x94.\xcaB'), chr(0b1100100) + chr(101) + chr(99) + chr(111) + chr(100) + '\x65')(chr(12614 - 12497) + '\164' + '\x66' + '\055' + chr(1465 - 1409)), xafqLlk3kkUe(SXOLrMavuUCe(b'i\xef\xfa\xef\x86\xfe\xf1\xef\x13N\xa4\xc1'), chr(100) + chr(101) + chr(5867 - 5768) + chr(9511 - 9400) + '\x64' + chr(0b11010 + 0o113))(chr(0b1110101) + chr(116) + chr(0b10100 + 0o122) + '\055' + chr(0b110010 + 0o6)))(AW3Z20f3DKFA))
|
awslabs/serverless-application-model
|
examples/apps/lex-make-appointment-python/lambda_function.py
|
get_availabilities_for_duration
|
def get_availabilities_for_duration(duration, availabilities):
"""
Helper function to return the windows of availability of the given duration, when provided a set of 30 minute windows.
"""
duration_availabilities = []
start_time = '10:00'
while start_time != '17:00':
if start_time in availabilities:
if duration == 30:
duration_availabilities.append(start_time)
elif increment_time_by_thirty_mins(start_time) in availabilities:
duration_availabilities.append(start_time)
start_time = increment_time_by_thirty_mins(start_time)
return duration_availabilities
|
python
|
def get_availabilities_for_duration(duration, availabilities):
"""
Helper function to return the windows of availability of the given duration, when provided a set of 30 minute windows.
"""
duration_availabilities = []
start_time = '10:00'
while start_time != '17:00':
if start_time in availabilities:
if duration == 30:
duration_availabilities.append(start_time)
elif increment_time_by_thirty_mins(start_time) in availabilities:
duration_availabilities.append(start_time)
start_time = increment_time_by_thirty_mins(start_time)
return duration_availabilities
|
[
"def",
"get_availabilities_for_duration",
"(",
"duration",
",",
"availabilities",
")",
":",
"duration_availabilities",
"=",
"[",
"]",
"start_time",
"=",
"'10:00'",
"while",
"start_time",
"!=",
"'17:00'",
":",
"if",
"start_time",
"in",
"availabilities",
":",
"if",
"duration",
"==",
"30",
":",
"duration_availabilities",
".",
"append",
"(",
"start_time",
")",
"elif",
"increment_time_by_thirty_mins",
"(",
"start_time",
")",
"in",
"availabilities",
":",
"duration_availabilities",
".",
"append",
"(",
"start_time",
")",
"start_time",
"=",
"increment_time_by_thirty_mins",
"(",
"start_time",
")",
"return",
"duration_availabilities"
] |
Helper function to return the windows of availability of the given duration, when provided a set of 30 minute windows.
|
[
"Helper",
"function",
"to",
"return",
"the",
"windows",
"of",
"availability",
"of",
"the",
"given",
"duration",
"when",
"provided",
"a",
"set",
"of",
"30",
"minute",
"windows",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/lex-make-appointment-python/lambda_function.py#L192-L207
|
train
|
Helper function to return the windows of availability of the given duration.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEOh2,LgE_IO_tHXvM,Kk1hd194VKEC,OZYzwAeSQh7N,jFWsnpH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VEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(51) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + chr(332 - 283) + '\x34' + chr(1094 - 1046), 47262 - 47254), ehT0Px3KOsy9(chr(2033 - 1985) + '\157' + '\x34' + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10111 + 0o33) + chr(0b1000 + 0o53) + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + chr(7296 - 7185) + chr(0b110010) + chr(0b110100) + chr(0b10 + 0o64), 56693 - 56685), ehT0Px3KOsy9('\060' + chr(0b11101 + 0o122) + chr(49) + '\065' + '\062', 46686 - 46678), ehT0Px3KOsy9(chr(924 - 876) + '\x6f' + '\x31' + chr(55) + chr(2525 - 2470), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110100) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(266 - 218) + chr(0b1101111) + chr(0b110011) + '\x32' + chr(1529 - 1474), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(9043 - 8932) + chr(0b110001) + '\063' + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(0b101 + 0o56) + '\061', 31359 - 31351), ehT0Px3KOsy9('\x30' + '\157' + chr(933 - 882) + chr(1827 - 1772) + chr(1290 - 1239), 0o10), ehT0Px3KOsy9('\060' + chr(0b1100000 + 0o17) + chr(1230 - 1179) + chr(52) + chr(0b1000 + 0o57), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + chr(1130 - 1081) + chr(1680 - 1625) + chr(1687 - 1639), 0b1000), ehT0Px3KOsy9('\060' + chr(0b100001 + 0o116) + chr(125 - 75) + chr(1452 - 1401) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(10025 - 9914) + chr(51) + '\x33' + chr(0b10110 + 0o34), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(873 - 823) + chr(0b1001 + 0o54) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011 + 0o2) + chr(0b101011 + 0o11), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1157 - 1106) + chr(0b110000) + chr(1521 - 1471), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + '\x31', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + '\060' + '\065', 57585 - 57577), ehT0Px3KOsy9('\060' + chr(0b1000101 + 0o52) + chr(0b11101 + 0o26) + chr(2089 - 2034) + '\065', 0o10), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + chr(0b11010 + 0o31) + chr(0b110101) + chr(980 - 930), ord("\x08")), ehT0Px3KOsy9(chr(1976 - 1928) + chr(0b1101111) + chr(0b101100 + 0o6) + chr(0b100 + 0o54) + chr(1849 - 1801), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4655 - 4544) + chr(1365 - 1314) + chr(1341 - 1286) + chr(0b11 + 0o63), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\x34' + chr(332 - 280), 56332 - 56324), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(1086 - 1038) + '\067', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001101 + 0o42) + chr(0b11010 + 0o27) + chr(54) + chr(51), 13235 - 13227), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\157' + chr(49) + '\x30' + chr(0b10 + 0o56), ord("\x08")), ehT0Px3KOsy9(chr(196 - 148) + chr(8342 - 8231) + '\x32' + chr(0b1101 + 0o51) + chr(2666 - 2613), 0o10), ehT0Px3KOsy9('\060' + chr(9569 - 9458) + '\063' + chr(0b101001 + 0o16) + chr(48), 23812 - 23804), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(53) + '\x32', 0b1000), ehT0Px3KOsy9(chr(173 - 125) + chr(6361 - 6250) + chr(50) + chr(0b110011) + chr(0b110111), 11382 - 11374), ehT0Px3KOsy9(chr(0b110000) + chr(817 - 706) + '\x32' + chr(0b110110) + chr(0b11 + 0o56), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + '\x31' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(497 - 449) + '\x6f' + chr(1524 - 1473) + chr(2468 - 2413) + '\060', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000010 + 0o55) + '\x32' + chr(78 - 27) + '\060', 8), ehT0Px3KOsy9(chr(48) + chr(111) + '\x35' + chr(1583 - 1533), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(0b110010) + chr(54) + chr(51), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + '\065' + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'q'), chr(0b110011 + 0o61) + '\145' + chr(0b1100001 + 0o2) + '\x6f' + chr(0b110110 + 0o56) + '\x65')(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b101101) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def hVWBInHmJPc1(AW3Z20f3DKFA, EZyAezyAzuci):
nyGnBSIMQmG7 = []
tSzPDN5a8DrS = xafqLlk3kkUe(SXOLrMavuUCe(b'nP\x1e\xaa\x96'), chr(0b101011 + 0o71) + chr(101) + '\x63' + chr(0b1101111) + chr(9367 - 9267) + '\x65')('\x75' + chr(7576 - 7460) + chr(0b1100110) + '\x2d' + '\x38')
while tSzPDN5a8DrS != xafqLlk3kkUe(SXOLrMavuUCe(b'nW\x1e\xaa\x96'), '\144' + '\x65' + chr(99) + chr(0b1101101 + 0o2) + '\144' + '\x65')(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(45) + chr(56)):
if tSzPDN5a8DrS in EZyAezyAzuci:
if AW3Z20f3DKFA == ehT0Px3KOsy9('\x30' + chr(0b1000111 + 0o50) + chr(51) + chr(2658 - 2604), 0o10):
xafqLlk3kkUe(nyGnBSIMQmG7, xafqLlk3kkUe(SXOLrMavuUCe(b'>\x10T\xff\xc8\x0e'), chr(100) + chr(101) + chr(0b100001 + 0o102) + chr(111) + '\x64' + chr(101))(chr(117) + '\164' + '\146' + '\x2d' + '\070'))(tSzPDN5a8DrS)
elif vZo_qEWa1g2D(tSzPDN5a8DrS) in EZyAezyAzuci:
xafqLlk3kkUe(nyGnBSIMQmG7, xafqLlk3kkUe(SXOLrMavuUCe(b'>\x10T\xff\xc8\x0e'), chr(100) + chr(0b1100101) + chr(9762 - 9663) + '\157' + '\144' + chr(6832 - 6731))(chr(0b100010 + 0o123) + '\x74' + chr(0b100011 + 0o103) + chr(45) + '\070'))(tSzPDN5a8DrS)
tSzPDN5a8DrS = vZo_qEWa1g2D(tSzPDN5a8DrS)
return nyGnBSIMQmG7
|
awslabs/serverless-application-model
|
examples/apps/lex-make-appointment-python/lambda_function.py
|
build_available_time_string
|
def build_available_time_string(availabilities):
"""
Build a string eliciting for a possible time slot among at least two availabilities.
"""
prefix = 'We have availabilities at '
if len(availabilities) > 3:
prefix = 'We have plenty of availability, including '
prefix += build_time_output_string(availabilities[0])
if len(availabilities) == 2:
return '{} and {}'.format(prefix, build_time_output_string(availabilities[1]))
return '{}, {} and {}'.format(prefix, build_time_output_string(availabilities[1]), build_time_output_string(availabilities[2]))
|
python
|
def build_available_time_string(availabilities):
"""
Build a string eliciting for a possible time slot among at least two availabilities.
"""
prefix = 'We have availabilities at '
if len(availabilities) > 3:
prefix = 'We have plenty of availability, including '
prefix += build_time_output_string(availabilities[0])
if len(availabilities) == 2:
return '{} and {}'.format(prefix, build_time_output_string(availabilities[1]))
return '{}, {} and {}'.format(prefix, build_time_output_string(availabilities[1]), build_time_output_string(availabilities[2]))
|
[
"def",
"build_available_time_string",
"(",
"availabilities",
")",
":",
"prefix",
"=",
"'We have availabilities at '",
"if",
"len",
"(",
"availabilities",
")",
">",
"3",
":",
"prefix",
"=",
"'We have plenty of availability, including '",
"prefix",
"+=",
"build_time_output_string",
"(",
"availabilities",
"[",
"0",
"]",
")",
"if",
"len",
"(",
"availabilities",
")",
"==",
"2",
":",
"return",
"'{} and {}'",
".",
"format",
"(",
"prefix",
",",
"build_time_output_string",
"(",
"availabilities",
"[",
"1",
"]",
")",
")",
"return",
"'{}, {} and {}'",
".",
"format",
"(",
"prefix",
",",
"build_time_output_string",
"(",
"availabilities",
"[",
"1",
"]",
")",
",",
"build_time_output_string",
"(",
"availabilities",
"[",
"2",
"]",
")",
")"
] |
Build a string eliciting for a possible time slot among at least two availabilities.
|
[
"Build",
"a",
"string",
"eliciting",
"for",
"a",
"possible",
"time",
"slot",
"among",
"at",
"least",
"two",
"availabilities",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/lex-make-appointment-python/lambda_function.py#L261-L273
|
train
|
Build a string eliciting for a possible time slot among at least two availabilities.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994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w4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101 + 0o142) + chr(0b110001) + chr(282 - 227) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(1096 - 1041) + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1028 - 977) + chr(0b1 + 0o57) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(1737 - 1689) + chr(111) + '\x33' + chr(0b110000) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(8141 - 8030) + '\x33' + chr(2776 - 2723) + chr(0b110011), 7197 - 7189), ehT0Px3KOsy9('\x30' + chr(4390 - 4279) + '\x32' + chr(48) + chr(0b101110 + 0o11), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(54) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b100110 + 0o111) + '\063' + chr(1954 - 1901) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(49) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b110000 + 0o77) + chr(0b100110 + 0o13) + chr(51) + chr(49), 0b1000), ehT0Px3KOsy9('\060' + chr(6812 - 6701) + chr(50) + '\x36' + chr(0b1 + 0o60), 32348 - 32340), ehT0Px3KOsy9(chr(718 - 670) + chr(111) + chr(1209 - 1158) + chr(0b110000) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(1718 - 1670) + '\x6f' + chr(516 - 465) + chr(0b1001 + 0o52) + chr(0b110111), 23201 - 23193), ehT0Px3KOsy9(chr(1788 - 1740) + chr(111) + chr(49) + '\063' + chr(49), 8), ehT0Px3KOsy9(chr(742 - 694) + chr(0b1101111) + '\062' + chr(55) + chr(52), 60860 - 60852), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(932 - 884) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(9348 - 9237) + chr(50) + '\067' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + chr(49) + '\x32' + chr(77 - 25), 0o10), ehT0Px3KOsy9(chr(58 - 10) + chr(8726 - 8615) + chr(2267 - 2217) + chr(1214 - 1166) + chr(1896 - 1847), 22894 - 22886), ehT0Px3KOsy9(chr(48) + chr(0b1101101 + 0o2) + '\062' + chr(0b1 + 0o66), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101000 + 0o7) + chr(50) + '\x37' + chr(2499 - 2444), 62813 - 62805), ehT0Px3KOsy9(chr(873 - 825) + '\157' + chr(0b110010) + chr(0b110111) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(923 - 875) + chr(0b1011010 + 0o25) + chr(395 - 341) + chr(0b101 + 0o55), 10434 - 10426), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b110111) + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + '\x32' + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1660 - 1609) + '\066' + '\x35', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(1025 - 974) + '\060', 0o10), ehT0Px3KOsy9(chr(1558 - 1510) + chr(111) + chr(0b110011) + chr(52) + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(1756 - 1645) + chr(0b11010 + 0o31) + '\062' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + '\x31' + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(9137 - 9026) + chr(0b100100 + 0o16) + '\063', 41894 - 41886), ehT0Px3KOsy9(chr(485 - 437) + chr(0b1101111) + chr(0b110010) + '\065' + '\064', 12785 - 12777), ehT0Px3KOsy9(chr(48) + chr(0b101010 + 0o105) + chr(49) + '\060' + chr(0b110001), 59172 - 59164), ehT0Px3KOsy9('\x30' + chr(111) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(53) + chr(0b110101), 12128 - 12120), ehT0Px3KOsy9(chr(0b110000) + chr(1238 - 1127) + chr(52), 8), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + chr(49) + chr(0b110001) + chr(0b1101 + 0o43), 22378 - 22370), ehT0Px3KOsy9(chr(0b110000) + chr(0b100 + 0o153) + chr(0b0 + 0o66) + chr(0b110010), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1762 - 1713) + chr(0b110100) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + '\065' + '\062', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + '\x35' + chr(48), 33503 - 33495)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'T'), chr(7198 - 7098) + chr(0b11010 + 0o113) + chr(0b1100011) + chr(111) + '\x64' + '\x65')(chr(117) + chr(0b1110100) + '\146' + '\055' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def F_c9K25Sy4kA(EZyAezyAzuci):
K1Ha0XjJTAE7 = xafqLlk3kkUe(SXOLrMavuUCe(b'-Y\xe7\xac\x8a\xf1\x13\xcal/\xd0\xaa\xb38\xde\xed\xd4=\xf5~\xda\xcd\x12\x1a\xe4\xd5'), chr(100) + chr(101) + chr(99) + chr(111) + '\x64' + chr(0b1001 + 0o134))('\165' + chr(116) + chr(9180 - 9078) + chr(45) + chr(0b111000))
if c2A0yzQpDQB3(EZyAezyAzuci) > ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101111 + 0o4), 0o10):
K1Ha0XjJTAE7 = xafqLlk3kkUe(SXOLrMavuUCe(b'-Y\xe7\xac\x8a\xf1\x13\xca}5\xd4\xad\xab \x9c\xeb\xdet\xe0a\xde\xd7^\x1a\xf2\x9c4\x8a\xa1\xf5?\x8c(j\x0eh=V\x0e\x84\x1d\x1c'), '\144' + chr(8533 - 8432) + chr(0b1100011) + chr(111) + chr(100) + '\x65')(chr(12784 - 12667) + chr(0b1011 + 0o151) + '\x66' + chr(0b10001 + 0o34) + chr(56))
K1Ha0XjJTAE7 += LdUoVgsCr5zp(EZyAezyAzuci[ehT0Px3KOsy9(chr(1013 - 965) + chr(111) + chr(0b1100 + 0o44), 18485 - 18477)])
if c2A0yzQpDQB3(EZyAezyAzuci) == ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101001 + 0o11), ord("\x08")):
return xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x01A\xe7\xa5\x85\xe3V\x91p'), chr(100) + chr(0b1 + 0o144) + '\143' + chr(111) + chr(100) + '\145')('\165' + '\164' + chr(5760 - 5658) + chr(985 - 940) + chr(0b1010 + 0o56)), xafqLlk3kkUe(SXOLrMavuUCe(b',\x08\xb5\xab\xa3\xe6%\xd9])\xd4\xa9'), chr(0b110000 + 0o64) + chr(101) + '\x63' + chr(4961 - 4850) + '\x64' + '\145')('\165' + chr(0b1110100) + '\x66' + '\x2d' + '\x38'))(K1Ha0XjJTAE7, LdUoVgsCr5zp(EZyAezyAzuci[ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + chr(49), 0b1000)]))
return xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\x01A\xeb\xe4\x90\xfaV\x8bc=\x91\xb8\xa2'), chr(3854 - 3754) + chr(0b11100 + 0o111) + chr(0b110100 + 0o57) + chr(0b1101111) + '\144' + chr(0b1001 + 0o134))(chr(0b100100 + 0o121) + '\x74' + '\146' + '\x2d' + chr(0b11000 + 0o40)), xafqLlk3kkUe(SXOLrMavuUCe(b',\x08\xb5\xab\xa3\xe6%\xd9])\xd4\xa9'), '\x64' + chr(1483 - 1382) + '\143' + chr(9793 - 9682) + chr(0b1001 + 0o133) + chr(6483 - 6382))(chr(117) + '\164' + '\x66' + '\055' + chr(0b10 + 0o66)))(K1Ha0XjJTAE7, LdUoVgsCr5zp(EZyAezyAzuci[ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1 + 0o60), 8)]), LdUoVgsCr5zp(EZyAezyAzuci[ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062', 8)]))
|
awslabs/serverless-application-model
|
examples/apps/lex-make-appointment-python/lambda_function.py
|
build_options
|
def build_options(slot, appointment_type, date, booking_map):
"""
Build a list of potential options for a given slot, to be used in responseCard generation.
"""
day_strings = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
if slot == 'AppointmentType':
return [
{'text': 'cleaning (30 min)', 'value': 'cleaning'},
{'text': 'root canal (60 min)', 'value': 'root canal'},
{'text': 'whitening (30 min)', 'value': 'whitening'}
]
elif slot == 'Date':
# Return the next five weekdays.
options = []
potential_date = datetime.datetime.today()
while len(options) < 5:
potential_date = potential_date + datetime.timedelta(days=1)
if potential_date.weekday() < 5:
options.append({'text': '{}-{} ({})'.format((potential_date.month), potential_date.day, day_strings[potential_date.weekday()]),
'value': potential_date.strftime('%A, %B %d, %Y')})
return options
elif slot == 'Time':
# Return the availabilities on the given date.
if not appointment_type or not date:
return None
availabilities = try_ex(lambda: booking_map[date])
if not availabilities:
return None
availabilities = get_availabilities_for_duration(get_duration(appointment_type), availabilities)
if len(availabilities) == 0:
return None
options = []
for i in range(min(len(availabilities), 5)):
options.append({'text': build_time_output_string(availabilities[i]), 'value': build_time_output_string(availabilities[i])})
return options
|
python
|
def build_options(slot, appointment_type, date, booking_map):
"""
Build a list of potential options for a given slot, to be used in responseCard generation.
"""
day_strings = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
if slot == 'AppointmentType':
return [
{'text': 'cleaning (30 min)', 'value': 'cleaning'},
{'text': 'root canal (60 min)', 'value': 'root canal'},
{'text': 'whitening (30 min)', 'value': 'whitening'}
]
elif slot == 'Date':
# Return the next five weekdays.
options = []
potential_date = datetime.datetime.today()
while len(options) < 5:
potential_date = potential_date + datetime.timedelta(days=1)
if potential_date.weekday() < 5:
options.append({'text': '{}-{} ({})'.format((potential_date.month), potential_date.day, day_strings[potential_date.weekday()]),
'value': potential_date.strftime('%A, %B %d, %Y')})
return options
elif slot == 'Time':
# Return the availabilities on the given date.
if not appointment_type or not date:
return None
availabilities = try_ex(lambda: booking_map[date])
if not availabilities:
return None
availabilities = get_availabilities_for_duration(get_duration(appointment_type), availabilities)
if len(availabilities) == 0:
return None
options = []
for i in range(min(len(availabilities), 5)):
options.append({'text': build_time_output_string(availabilities[i]), 'value': build_time_output_string(availabilities[i])})
return options
|
[
"def",
"build_options",
"(",
"slot",
",",
"appointment_type",
",",
"date",
",",
"booking_map",
")",
":",
"day_strings",
"=",
"[",
"'Mon'",
",",
"'Tue'",
",",
"'Wed'",
",",
"'Thu'",
",",
"'Fri'",
",",
"'Sat'",
",",
"'Sun'",
"]",
"if",
"slot",
"==",
"'AppointmentType'",
":",
"return",
"[",
"{",
"'text'",
":",
"'cleaning (30 min)'",
",",
"'value'",
":",
"'cleaning'",
"}",
",",
"{",
"'text'",
":",
"'root canal (60 min)'",
",",
"'value'",
":",
"'root canal'",
"}",
",",
"{",
"'text'",
":",
"'whitening (30 min)'",
",",
"'value'",
":",
"'whitening'",
"}",
"]",
"elif",
"slot",
"==",
"'Date'",
":",
"# Return the next five weekdays.",
"options",
"=",
"[",
"]",
"potential_date",
"=",
"datetime",
".",
"datetime",
".",
"today",
"(",
")",
"while",
"len",
"(",
"options",
")",
"<",
"5",
":",
"potential_date",
"=",
"potential_date",
"+",
"datetime",
".",
"timedelta",
"(",
"days",
"=",
"1",
")",
"if",
"potential_date",
".",
"weekday",
"(",
")",
"<",
"5",
":",
"options",
".",
"append",
"(",
"{",
"'text'",
":",
"'{}-{} ({})'",
".",
"format",
"(",
"(",
"potential_date",
".",
"month",
")",
",",
"potential_date",
".",
"day",
",",
"day_strings",
"[",
"potential_date",
".",
"weekday",
"(",
")",
"]",
")",
",",
"'value'",
":",
"potential_date",
".",
"strftime",
"(",
"'%A, %B %d, %Y'",
")",
"}",
")",
"return",
"options",
"elif",
"slot",
"==",
"'Time'",
":",
"# Return the availabilities on the given date.",
"if",
"not",
"appointment_type",
"or",
"not",
"date",
":",
"return",
"None",
"availabilities",
"=",
"try_ex",
"(",
"lambda",
":",
"booking_map",
"[",
"date",
"]",
")",
"if",
"not",
"availabilities",
":",
"return",
"None",
"availabilities",
"=",
"get_availabilities_for_duration",
"(",
"get_duration",
"(",
"appointment_type",
")",
",",
"availabilities",
")",
"if",
"len",
"(",
"availabilities",
")",
"==",
"0",
":",
"return",
"None",
"options",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"min",
"(",
"len",
"(",
"availabilities",
")",
",",
"5",
")",
")",
":",
"options",
".",
"append",
"(",
"{",
"'text'",
":",
"build_time_output_string",
"(",
"availabilities",
"[",
"i",
"]",
")",
",",
"'value'",
":",
"build_time_output_string",
"(",
"availabilities",
"[",
"i",
"]",
")",
"}",
")",
"return",
"options"
] |
Build a list of potential options for a given slot, to be used in responseCard generation.
|
[
"Build",
"a",
"list",
"of",
"potential",
"options",
"for",
"a",
"given",
"slot",
"to",
"be",
"used",
"in",
"responseCard",
"generation",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/lex-make-appointment-python/lambda_function.py#L276-L314
|
train
|
Builds a list of potential options for a given appointment type and date.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX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A97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + chr(877 - 827) + chr(0b11111 + 0o26) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1100100 + 0o13) + chr(0b110001) + '\x35' + chr(0b110101), 25651 - 25643), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + chr(713 - 662) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x34' + chr(52), 31798 - 31790), ehT0Px3KOsy9(chr(396 - 348) + chr(0b101110 + 0o101) + '\x33' + chr(1592 - 1540) + chr(2296 - 2242), ord("\x08")), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b11101 + 0o122) + '\x31' + '\064' + '\063', 0o10), ehT0Px3KOsy9(chr(1834 - 1786) + '\x6f' + chr(0b100011 + 0o20) + '\062' + chr(0b101110 + 0o10), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101010 + 0o5) + '\061' + chr(1154 - 1099) + chr(2613 - 2560), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b11011 + 0o124) + chr(51) + chr(0b110110) + chr(52), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(0b110001) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(7766 - 7655) + chr(0b11111 + 0o24) + chr(1767 - 1719) + chr(605 - 556), 6359 - 6351), ehT0Px3KOsy9(chr(0b110000) + chr(8916 - 8805) + chr(0b110010) + chr(0b11110 + 0o30) + chr(472 - 422), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + '\063' + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110110) + '\065', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(1108 - 1059) + '\x37' + chr(0b11001 + 0o35), 56804 - 56796), ehT0Px3KOsy9(chr(48) + chr(111) + '\x35' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(0b1111 + 0o44) + chr(843 - 791) + chr(0b110110), 8), ehT0Px3KOsy9('\060' + chr(5649 - 5538) + '\063' + chr(0b110001 + 0o5) + chr(0b110001), 37332 - 37324), ehT0Px3KOsy9(chr(1924 - 1876) + '\157' + chr(2095 - 2044) + '\063' + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\x31' + '\x32', 48913 - 48905), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + '\x33' + chr(0b110110) + chr(1336 - 1283), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(0b110110) + '\066', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(0b110101) + chr(1525 - 1472), 0o10), ehT0Px3KOsy9(chr(1833 - 1785) + chr(0b1101111) + chr(1223 - 1173) + chr(54) + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(687 - 636) + '\066' + '\065', 8), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(2713 - 2602) + '\063' + chr(0b1 + 0o60) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + '\x33' + chr(0b100100 + 0o14) + chr(0b101111 + 0o4), ord("\x08")), ehT0Px3KOsy9(chr(715 - 667) + chr(111) + chr(0b110001) + chr(162 - 114) + chr(0b110010), 63849 - 63841), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(1857 - 1806) + chr(0b110011), 29840 - 29832), ehT0Px3KOsy9('\x30' + chr(111) + chr(52) + chr(941 - 890), 0b1000), ehT0Px3KOsy9(chr(1105 - 1057) + chr(0b1101111) + '\061' + chr(0b110110) + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1011000 + 0o27) + '\x33' + '\067' + chr(55), 44309 - 44301), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1101111) + chr(635 - 581) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(7161 - 7050) + '\063' + chr(0b10000 + 0o41) + chr(0b11000 + 0o34), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1748 - 1699) + chr(0b1011 + 0o47) + chr(0b110100), 57282 - 57274), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(0b110010 + 0o0) + chr(0b101110 + 0o5), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(120 - 9) + '\x31' + chr(589 - 534) + chr(50), 31234 - 31226), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(2503 - 2449) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\x6f' + chr(51) + chr(0b1110 + 0o45) + chr(50), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\x6f' + chr(53) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x82'), '\x64' + chr(0b1000000 + 0o45) + '\x63' + chr(0b1101111) + '\144' + chr(0b0 + 0o145))('\165' + chr(2398 - 2282) + chr(0b110 + 0o140) + chr(0b101101) + chr(1506 - 1450)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def xkgqk8ZsKP3Z(Zj7Ukdv16wIW, xFbpm3qQSFuC, J4aeFOr3sjPo, S2541AGas87K):
GjF4oANTZXzf = [xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1\x02w'), chr(0b1010101 + 0o17) + chr(0b100001 + 0o104) + '\143' + chr(0b1101111) + chr(0b100100 + 0o100) + chr(0b1011000 + 0o15))(chr(117) + '\x74' + chr(0b1100110) + chr(45) + chr(0b101010 + 0o16)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\x18|'), chr(0b1100100) + chr(135 - 34) + chr(99) + '\x6f' + chr(100) + '\x65')('\165' + chr(0b1001001 + 0o53) + '\146' + chr(1846 - 1801) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb\x08}'), chr(0b1100100) + chr(0b110100 + 0o61) + '\x63' + chr(0b100011 + 0o114) + chr(0b111010 + 0o52) + '\x65')(chr(0b1110101) + chr(0b11101 + 0o127) + '\146' + chr(1169 - 1124) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\x05l'), chr(0b1100100) + chr(101) + '\143' + chr(7765 - 7654) + '\x64' + chr(0b1100101))('\x75' + '\x74' + '\x66' + chr(945 - 900) + chr(0b100111 + 0o21)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\x1fp'), chr(0b1011100 + 0o10) + chr(101) + chr(0b1100011) + chr(548 - 437) + chr(0b1000011 + 0o41) + '\x65')('\x75' + chr(382 - 266) + chr(4401 - 4299) + chr(159 - 114) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xff\x0cm'), '\x64' + chr(0b111101 + 0o50) + chr(99) + '\157' + '\144' + chr(101))(chr(12231 - 12114) + chr(0b1101 + 0o147) + '\x66' + '\055' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xff\x18w'), chr(5919 - 5819) + chr(101) + '\x63' + chr(111) + '\x64' + chr(0b110000 + 0o65))('\165' + chr(116) + '\x66' + chr(527 - 482) + chr(0b11100 + 0o34))]
if Zj7Ukdv16wIW == xafqLlk3kkUe(SXOLrMavuUCe(b'\xed\x1diK\x8f\r\xa2\x10\x91\xe6\xb5\xe6\xe6E\x1b'), chr(0b1100100) + '\145' + chr(0b1100011) + chr(0b1010111 + 0o30) + chr(1039 - 939) + chr(101))('\165' + chr(0b101100 + 0o110) + '\146' + chr(0b101101) + '\070'):
return [{xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\x08aP'), chr(9802 - 9702) + chr(7429 - 7328) + chr(0b1100011) + chr(0b1101111) + '\144' + '\145')(chr(0b1110001 + 0o4) + chr(116) + '\146' + chr(45) + chr(0b101010 + 0o16)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf\x01|E\x88\n\xb8\x1a\xd4\xa0\xf2\x82\xbfX\x17G\xcf'), chr(0b100001 + 0o103) + chr(101) + chr(0b10101 + 0o116) + '\157' + chr(926 - 826) + chr(216 - 115))('\x75' + chr(116) + chr(102) + chr(0b101101) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda\x0cuQ\x83'), chr(9279 - 9179) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b110000 + 0o64) + chr(7713 - 7612))('\x75' + chr(0b1100001 + 0o23) + chr(102) + chr(0b100011 + 0o12) + '\070'): xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf\x01|E\x88\n\xb8\x1a'), chr(0b1100100) + chr(8433 - 8332) + chr(6525 - 6426) + '\x6f' + chr(0b111 + 0o135) + chr(101))(chr(0b0 + 0o165) + '\164' + '\x66' + chr(0b10001 + 0o34) + chr(627 - 571))}, {xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\x08aP'), chr(4533 - 4433) + chr(101) + chr(6944 - 6845) + chr(0b1101111) + chr(3609 - 3509) + chr(0b10010 + 0o123))('\x75' + chr(4365 - 4249) + chr(6371 - 6269) + '\x2d' + chr(0b111000)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xde\x02vP\xc6\x00\xb7\x13\x95\xe4\xe1\x9a\xa9\x05^D\x8f\x9f\xf1'), chr(4301 - 4201) + chr(0b11 + 0o142) + chr(99) + '\x6f' + '\x64' + chr(4649 - 4548))(chr(0b11010 + 0o133) + chr(116) + chr(0b110001 + 0o65) + chr(45) + chr(732 - 676)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda\x0cuQ\x83'), '\144' + chr(0b1100101) + chr(99) + chr(0b1001000 + 0o47) + chr(6848 - 6748) + chr(0b1100101))(chr(0b111100 + 0o71) + chr(116) + chr(8460 - 8358) + chr(0b101101) + '\070'): xafqLlk3kkUe(SXOLrMavuUCe(b'\xde\x02vP\xc6\x00\xb7\x13\x95\xe4'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(100) + chr(0b100011 + 0o102))(chr(0b1001000 + 0o55) + '\x74' + chr(0b1100110) + '\x2d' + '\070')}, {xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\x08aP'), chr(1087 - 987) + '\145' + '\x63' + chr(11979 - 11868) + chr(0b1100100) + chr(5295 - 5194))('\165' + chr(11467 - 11351) + chr(5134 - 5032) + chr(1730 - 1685) + '\070'): xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\x05pP\x83\r\xbf\x13\x93\xa8\xe9\x81\xaf\x15\x13@\x88\xd8'), '\144' + chr(101) + '\143' + '\x6f' + chr(0b1100100) + chr(101))(chr(117) + '\x74' + chr(0b1000001 + 0o45) + chr(824 - 779) + chr(0b1011 + 0o55)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda\x0cuQ\x83'), '\x64' + chr(5815 - 5714) + chr(0b1100011) + chr(0b100001 + 0o116) + '\144' + '\x65')(chr(117) + '\164' + '\146' + '\x2d' + chr(56)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\x05pP\x83\r\xbf\x13\x93'), chr(8565 - 8465) + chr(5439 - 5338) + chr(9338 - 9239) + '\157' + chr(0b1100100) + chr(0b100111 + 0o76))(chr(117) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(56))}]
elif Zj7Ukdv16wIW == xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8\x0cmA'), chr(100) + chr(0b1011101 + 0o10) + chr(0b10000 + 0o123) + chr(0b1101111) + '\x64' + chr(0b1010110 + 0o17))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(0b101 + 0o50) + chr(2622 - 2566)):
vvlcdVOK7clu = []
QDov6qS2zIEn = zKdiQFzuryNR.datetime.today()
while c2A0yzQpDQB3(vvlcdVOK7clu) < ehT0Px3KOsy9('\060' + '\157' + chr(0b1111 + 0o46), 0o10):
QDov6qS2zIEn = QDov6qS2zIEn + zKdiQFzuryNR.timedelta(days=ehT0Px3KOsy9('\x30' + chr(11478 - 11367) + chr(2364 - 2315), 0b1000))
if xafqLlk3kkUe(QDov6qS2zIEn, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\x08|O\x82\x02\xaf'), '\x64' + '\145' + chr(0b1011001 + 0o12) + '\x6f' + chr(0b1011110 + 0o6) + '\x65')(chr(0b1011001 + 0o34) + chr(0b1110100) + chr(0b0 + 0o146) + chr(1204 - 1159) + chr(56)))() < ehT0Px3KOsy9('\x30' + '\157' + '\x35', 8):
xafqLlk3kkUe(vvlcdVOK7clu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd\x1diA\x88\x07'), '\144' + '\145' + chr(0b1100011) + chr(111) + '\144' + chr(101))(chr(117) + chr(3614 - 3498) + chr(0b100010 + 0o104) + chr(0b1011 + 0o42) + chr(0b11110 + 0o32)))({xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\x08aP'), '\x64' + chr(0b101111 + 0o66) + chr(99) + '\157' + chr(4300 - 4200) + '\x65')(chr(8956 - 8839) + '\164' + chr(0b1100110) + '\055' + chr(0b1011 + 0o55)): xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7\x104_\x9bC\xfe\x06\x89\xa1'), chr(0b1000101 + 0o37) + '\145' + '\x63' + '\x6f' + chr(0b1011001 + 0o13) + chr(101))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b101101) + chr(523 - 467)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xfaYkK\xae\x02\x85N\xa4\xf8\xa4\xd8'), '\144' + '\145' + chr(8553 - 8454) + chr(111) + '\x64' + chr(0b1100101))(chr(0b100000 + 0o125) + chr(0b1011110 + 0o26) + '\x66' + '\x2d' + chr(0b1 + 0o67)))(xafqLlk3kkUe(QDov6qS2zIEn, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1\x02wP\x8e'), chr(7515 - 7415) + chr(2237 - 2136) + chr(9040 - 8941) + chr(0b101111 + 0o100) + '\x64' + chr(0b1100101))(chr(13604 - 13487) + chr(0b10100 + 0o140) + chr(0b1100110) + '\x2d' + chr(0b101101 + 0o13))), xafqLlk3kkUe(QDov6qS2zIEn, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8\x0c`'), chr(100) + chr(0b101101 + 0o70) + '\143' + chr(0b1000 + 0o147) + '\144' + '\x65')('\165' + chr(0b1010 + 0o152) + '\146' + chr(45) + chr(2011 - 1955))), GjF4oANTZXzf[xafqLlk3kkUe(QDov6qS2zIEn, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\x08|O\x82\x02\xaf'), '\144' + chr(0b1100101) + chr(294 - 195) + '\157' + chr(0b101100 + 0o70) + chr(0b1001001 + 0o34))('\165' + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(0b100000 + 0o30)))()]), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda\x0cuQ\x83'), chr(100) + chr(0b1000011 + 0o42) + chr(0b1100011) + '\157' + '\144' + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b111000)): xafqLlk3kkUe(QDov6qS2zIEn, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf\x19kB\x92\n\xbb\x18'), chr(100) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b111001 + 0o53) + chr(0b1100101))('\165' + chr(116) + chr(0b111100 + 0o52) + chr(0b101101) + chr(2139 - 2083)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x89,5\x04\xc3!\xf6X\x90\xa4\xe1\x97\xc6'), '\144' + '\x65' + chr(0b101100 + 0o67) + chr(0b1001100 + 0o43) + chr(100) + '\145')(chr(8689 - 8572) + chr(0b1110100) + chr(0b101110 + 0o70) + chr(118 - 73) + chr(0b101010 + 0o16)))})
return vvlcdVOK7clu
elif Zj7Ukdv16wIW == xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\x04tA'), chr(0b1011001 + 0o13) + '\145' + '\x63' + chr(0b10011 + 0o134) + '\x64' + chr(0b1010101 + 0o20))(chr(1965 - 1848) + chr(116) + chr(0b1100110) + chr(0b101101) + '\x38'):
if not xFbpm3qQSFuC or not J4aeFOr3sjPo:
return None
EZyAezyAzuci = tAJLnEcSMM54(lambda : S2541AGas87K[J4aeFOr3sjPo])
if not EZyAezyAzuci:
return None
EZyAezyAzuci = hVWBInHmJPc1(oodVlKVP8DKH(xFbpm3qQSFuC), EZyAezyAzuci)
if c2A0yzQpDQB3(EZyAezyAzuci) == ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1527 - 1479), ord("\x08")):
return None
vvlcdVOK7clu = []
for WVxHKyX45z_L in vQr8gNKaIaWE(Dx22bkKPdt5d(c2A0yzQpDQB3(EZyAezyAzuci), ehT0Px3KOsy9('\060' + '\x6f' + chr(952 - 899), 8))):
xafqLlk3kkUe(vvlcdVOK7clu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcd\x1diA\x88\x07'), chr(0b1010111 + 0o15) + chr(101) + '\143' + chr(7834 - 7723) + '\x64' + chr(3909 - 3808))(chr(117) + chr(4637 - 4521) + chr(0b11110 + 0o110) + chr(0b101101) + chr(0b111 + 0o61)))({xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\x08aP'), chr(0b1100100) + chr(101) + chr(99) + chr(0b100101 + 0o112) + chr(100) + chr(0b100010 + 0o103))(chr(11433 - 11316) + chr(952 - 836) + chr(8427 - 8325) + chr(0b10011 + 0o32) + chr(0b1101 + 0o53)): LdUoVgsCr5zp(EZyAezyAzuci[WVxHKyX45z_L]), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda\x0cuQ\x83'), chr(100) + '\x65' + chr(99) + chr(0b1101111) + '\144' + '\145')(chr(117) + '\164' + '\x66' + chr(514 - 469) + chr(56)): LdUoVgsCr5zp(EZyAezyAzuci[WVxHKyX45z_L])})
return vvlcdVOK7clu
|
awslabs/serverless-application-model
|
examples/apps/lex-make-appointment-python/lambda_function.py
|
make_appointment
|
def make_appointment(intent_request):
"""
Performs dialog management and fulfillment for booking a dentists appointment.
Beyond fulfillment, the implementation for this intent demonstrates the following:
1) Use of elicitSlot in slot validation and re-prompting
2) Use of confirmIntent to support the confirmation of inferred slot values, when confirmation is required
on the bot model and the inferred slot values fully specify the intent.
"""
appointment_type = intent_request['currentIntent']['slots']['AppointmentType']
date = intent_request['currentIntent']['slots']['Date']
time = intent_request['currentIntent']['slots']['Time']
source = intent_request['invocationSource']
output_session_attributes = intent_request['sessionAttributes']
booking_map = json.loads(try_ex(lambda: output_session_attributes['bookingMap']) or '{}')
if source == 'DialogCodeHook':
# Perform basic validation on the supplied input slots.
slots = intent_request['currentIntent']['slots']
validation_result = validate_book_appointment(appointment_type, date, time)
if not validation_result['isValid']:
slots[validation_result['violatedSlot']] = None
return elicit_slot(
output_session_attributes,
intent_request['currentIntent']['name'],
slots,
validation_result['violatedSlot'],
validation_result['message'],
build_response_card(
'Specify {}'.format(validation_result['violatedSlot']),
validation_result['message']['content'],
build_options(validation_result['violatedSlot'], appointment_type, date, booking_map)
)
)
if not appointment_type:
return elicit_slot(
output_session_attributes,
intent_request['currentIntent']['name'],
intent_request['currentIntent']['slots'],
'AppointmentType',
{'contentType': 'PlainText', 'content': 'What type of appointment would you like to schedule?'},
build_response_card(
'Specify Appointment Type', 'What type of appointment would you like to schedule?',
build_options('AppointmentType', appointment_type, date, None)
)
)
if appointment_type and not date:
return elicit_slot(
output_session_attributes,
intent_request['currentIntent']['name'],
intent_request['currentIntent']['slots'],
'Date',
{'contentType': 'PlainText', 'content': 'When would you like to schedule your {}?'.format(appointment_type)},
build_response_card(
'Specify Date',
'When would you like to schedule your {}?'.format(appointment_type),
build_options('Date', appointment_type, date, None)
)
)
if appointment_type and date:
# Fetch or generate the availabilities for the given date.
booking_availabilities = try_ex(lambda: booking_map[date])
if booking_availabilities is None:
booking_availabilities = get_availabilities(date)
booking_map[date] = booking_availabilities
output_session_attributes['bookingMap'] = json.dumps(booking_map)
appointment_type_availabilities = get_availabilities_for_duration(get_duration(appointment_type), booking_availabilities)
if len(appointment_type_availabilities) == 0:
# No availability on this day at all; ask for a new date and time.
slots['Date'] = None
slots['Time'] = None
return elicit_slot(
output_session_attributes,
intent_request['currentIntent']['name'],
slots,
'Date',
{'contentType': 'PlainText', 'content': 'We do not have any availability on that date, is there another day which works for you?'},
build_response_card(
'Specify Date',
'What day works best for you?',
build_options('Date', appointment_type, date, booking_map)
)
)
message_content = 'What time on {} works for you? '.format(date)
if time:
output_session_attributes['formattedTime'] = build_time_output_string(time)
# Validate that proposed time for the appointment can be booked by first fetching the availabilities for the given day. To
# give consistent behavior in the sample, this is stored in sessionAttributes after the first lookup.
if is_available(time, get_duration(appointment_type), booking_availabilities):
return delegate(output_session_attributes, slots)
message_content = 'The time you requested is not available. '
if len(appointment_type_availabilities) == 1:
# If there is only one availability on the given date, try to confirm it.
slots['Time'] = appointment_type_availabilities[0]
return confirm_intent(
output_session_attributes,
intent_request['currentIntent']['name'],
slots,
{
'contentType': 'PlainText',
'content': '{}{} is our only availability, does that work for you?'.format
(message_content, build_time_output_string(appointment_type_availabilities[0]))
},
build_response_card(
'Confirm Appointment',
'Is {} on {} okay?'.format(build_time_output_string(appointment_type_availabilities[0]), date),
[{'text': 'yes', 'value': 'yes'}, {'text': 'no', 'value': 'no'}]
)
)
available_time_string = build_available_time_string(appointment_type_availabilities)
return elicit_slot(
output_session_attributes,
intent_request['currentIntent']['name'],
slots,
'Time',
{'contentType': 'PlainText', 'content': '{}{}'.format(message_content, available_time_string)},
build_response_card(
'Specify Time',
'What time works best for you?',
build_options('Time', appointment_type, date, booking_map)
)
)
return delegate(output_session_attributes, slots)
# Book the appointment. In a real bot, this would likely involve a call to a backend service.
duration = get_duration(appointment_type)
booking_availabilities = booking_map[date]
if booking_availabilities:
# Remove the availability slot for the given date as it has now been booked.
booking_availabilities.remove(time)
if duration == 60:
second_half_hour_time = increment_time_by_thirty_mins(time)
booking_availabilities.remove(second_half_hour_time)
booking_map[date] = booking_availabilities
output_session_attributes['bookingMap'] = json.dumps(booking_map)
else:
# This is not treated as an error as this code sample supports functionality either as fulfillment or dialog code hook.
logger.debug('Availabilities for {} were null at fulfillment time. '
'This should have been initialized if this function was configured as the dialog code hook'.format(date))
return close(
output_session_attributes,
'Fulfilled',
{
'contentType': 'PlainText',
'content': 'Okay, I have booked your appointment. We will see you at {} on {}'.format(build_time_output_string(time), date)
}
)
|
python
|
def make_appointment(intent_request):
"""
Performs dialog management and fulfillment for booking a dentists appointment.
Beyond fulfillment, the implementation for this intent demonstrates the following:
1) Use of elicitSlot in slot validation and re-prompting
2) Use of confirmIntent to support the confirmation of inferred slot values, when confirmation is required
on the bot model and the inferred slot values fully specify the intent.
"""
appointment_type = intent_request['currentIntent']['slots']['AppointmentType']
date = intent_request['currentIntent']['slots']['Date']
time = intent_request['currentIntent']['slots']['Time']
source = intent_request['invocationSource']
output_session_attributes = intent_request['sessionAttributes']
booking_map = json.loads(try_ex(lambda: output_session_attributes['bookingMap']) or '{}')
if source == 'DialogCodeHook':
# Perform basic validation on the supplied input slots.
slots = intent_request['currentIntent']['slots']
validation_result = validate_book_appointment(appointment_type, date, time)
if not validation_result['isValid']:
slots[validation_result['violatedSlot']] = None
return elicit_slot(
output_session_attributes,
intent_request['currentIntent']['name'],
slots,
validation_result['violatedSlot'],
validation_result['message'],
build_response_card(
'Specify {}'.format(validation_result['violatedSlot']),
validation_result['message']['content'],
build_options(validation_result['violatedSlot'], appointment_type, date, booking_map)
)
)
if not appointment_type:
return elicit_slot(
output_session_attributes,
intent_request['currentIntent']['name'],
intent_request['currentIntent']['slots'],
'AppointmentType',
{'contentType': 'PlainText', 'content': 'What type of appointment would you like to schedule?'},
build_response_card(
'Specify Appointment Type', 'What type of appointment would you like to schedule?',
build_options('AppointmentType', appointment_type, date, None)
)
)
if appointment_type and not date:
return elicit_slot(
output_session_attributes,
intent_request['currentIntent']['name'],
intent_request['currentIntent']['slots'],
'Date',
{'contentType': 'PlainText', 'content': 'When would you like to schedule your {}?'.format(appointment_type)},
build_response_card(
'Specify Date',
'When would you like to schedule your {}?'.format(appointment_type),
build_options('Date', appointment_type, date, None)
)
)
if appointment_type and date:
# Fetch or generate the availabilities for the given date.
booking_availabilities = try_ex(lambda: booking_map[date])
if booking_availabilities is None:
booking_availabilities = get_availabilities(date)
booking_map[date] = booking_availabilities
output_session_attributes['bookingMap'] = json.dumps(booking_map)
appointment_type_availabilities = get_availabilities_for_duration(get_duration(appointment_type), booking_availabilities)
if len(appointment_type_availabilities) == 0:
# No availability on this day at all; ask for a new date and time.
slots['Date'] = None
slots['Time'] = None
return elicit_slot(
output_session_attributes,
intent_request['currentIntent']['name'],
slots,
'Date',
{'contentType': 'PlainText', 'content': 'We do not have any availability on that date, is there another day which works for you?'},
build_response_card(
'Specify Date',
'What day works best for you?',
build_options('Date', appointment_type, date, booking_map)
)
)
message_content = 'What time on {} works for you? '.format(date)
if time:
output_session_attributes['formattedTime'] = build_time_output_string(time)
# Validate that proposed time for the appointment can be booked by first fetching the availabilities for the given day. To
# give consistent behavior in the sample, this is stored in sessionAttributes after the first lookup.
if is_available(time, get_duration(appointment_type), booking_availabilities):
return delegate(output_session_attributes, slots)
message_content = 'The time you requested is not available. '
if len(appointment_type_availabilities) == 1:
# If there is only one availability on the given date, try to confirm it.
slots['Time'] = appointment_type_availabilities[0]
return confirm_intent(
output_session_attributes,
intent_request['currentIntent']['name'],
slots,
{
'contentType': 'PlainText',
'content': '{}{} is our only availability, does that work for you?'.format
(message_content, build_time_output_string(appointment_type_availabilities[0]))
},
build_response_card(
'Confirm Appointment',
'Is {} on {} okay?'.format(build_time_output_string(appointment_type_availabilities[0]), date),
[{'text': 'yes', 'value': 'yes'}, {'text': 'no', 'value': 'no'}]
)
)
available_time_string = build_available_time_string(appointment_type_availabilities)
return elicit_slot(
output_session_attributes,
intent_request['currentIntent']['name'],
slots,
'Time',
{'contentType': 'PlainText', 'content': '{}{}'.format(message_content, available_time_string)},
build_response_card(
'Specify Time',
'What time works best for you?',
build_options('Time', appointment_type, date, booking_map)
)
)
return delegate(output_session_attributes, slots)
# Book the appointment. In a real bot, this would likely involve a call to a backend service.
duration = get_duration(appointment_type)
booking_availabilities = booking_map[date]
if booking_availabilities:
# Remove the availability slot for the given date as it has now been booked.
booking_availabilities.remove(time)
if duration == 60:
second_half_hour_time = increment_time_by_thirty_mins(time)
booking_availabilities.remove(second_half_hour_time)
booking_map[date] = booking_availabilities
output_session_attributes['bookingMap'] = json.dumps(booking_map)
else:
# This is not treated as an error as this code sample supports functionality either as fulfillment or dialog code hook.
logger.debug('Availabilities for {} were null at fulfillment time. '
'This should have been initialized if this function was configured as the dialog code hook'.format(date))
return close(
output_session_attributes,
'Fulfilled',
{
'contentType': 'PlainText',
'content': 'Okay, I have booked your appointment. We will see you at {} on {}'.format(build_time_output_string(time), date)
}
)
|
[
"def",
"make_appointment",
"(",
"intent_request",
")",
":",
"appointment_type",
"=",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'slots'",
"]",
"[",
"'AppointmentType'",
"]",
"date",
"=",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'slots'",
"]",
"[",
"'Date'",
"]",
"time",
"=",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'slots'",
"]",
"[",
"'Time'",
"]",
"source",
"=",
"intent_request",
"[",
"'invocationSource'",
"]",
"output_session_attributes",
"=",
"intent_request",
"[",
"'sessionAttributes'",
"]",
"booking_map",
"=",
"json",
".",
"loads",
"(",
"try_ex",
"(",
"lambda",
":",
"output_session_attributes",
"[",
"'bookingMap'",
"]",
")",
"or",
"'{}'",
")",
"if",
"source",
"==",
"'DialogCodeHook'",
":",
"# Perform basic validation on the supplied input slots.",
"slots",
"=",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'slots'",
"]",
"validation_result",
"=",
"validate_book_appointment",
"(",
"appointment_type",
",",
"date",
",",
"time",
")",
"if",
"not",
"validation_result",
"[",
"'isValid'",
"]",
":",
"slots",
"[",
"validation_result",
"[",
"'violatedSlot'",
"]",
"]",
"=",
"None",
"return",
"elicit_slot",
"(",
"output_session_attributes",
",",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'name'",
"]",
",",
"slots",
",",
"validation_result",
"[",
"'violatedSlot'",
"]",
",",
"validation_result",
"[",
"'message'",
"]",
",",
"build_response_card",
"(",
"'Specify {}'",
".",
"format",
"(",
"validation_result",
"[",
"'violatedSlot'",
"]",
")",
",",
"validation_result",
"[",
"'message'",
"]",
"[",
"'content'",
"]",
",",
"build_options",
"(",
"validation_result",
"[",
"'violatedSlot'",
"]",
",",
"appointment_type",
",",
"date",
",",
"booking_map",
")",
")",
")",
"if",
"not",
"appointment_type",
":",
"return",
"elicit_slot",
"(",
"output_session_attributes",
",",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'name'",
"]",
",",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'slots'",
"]",
",",
"'AppointmentType'",
",",
"{",
"'contentType'",
":",
"'PlainText'",
",",
"'content'",
":",
"'What type of appointment would you like to schedule?'",
"}",
",",
"build_response_card",
"(",
"'Specify Appointment Type'",
",",
"'What type of appointment would you like to schedule?'",
",",
"build_options",
"(",
"'AppointmentType'",
",",
"appointment_type",
",",
"date",
",",
"None",
")",
")",
")",
"if",
"appointment_type",
"and",
"not",
"date",
":",
"return",
"elicit_slot",
"(",
"output_session_attributes",
",",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'name'",
"]",
",",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'slots'",
"]",
",",
"'Date'",
",",
"{",
"'contentType'",
":",
"'PlainText'",
",",
"'content'",
":",
"'When would you like to schedule your {}?'",
".",
"format",
"(",
"appointment_type",
")",
"}",
",",
"build_response_card",
"(",
"'Specify Date'",
",",
"'When would you like to schedule your {}?'",
".",
"format",
"(",
"appointment_type",
")",
",",
"build_options",
"(",
"'Date'",
",",
"appointment_type",
",",
"date",
",",
"None",
")",
")",
")",
"if",
"appointment_type",
"and",
"date",
":",
"# Fetch or generate the availabilities for the given date.",
"booking_availabilities",
"=",
"try_ex",
"(",
"lambda",
":",
"booking_map",
"[",
"date",
"]",
")",
"if",
"booking_availabilities",
"is",
"None",
":",
"booking_availabilities",
"=",
"get_availabilities",
"(",
"date",
")",
"booking_map",
"[",
"date",
"]",
"=",
"booking_availabilities",
"output_session_attributes",
"[",
"'bookingMap'",
"]",
"=",
"json",
".",
"dumps",
"(",
"booking_map",
")",
"appointment_type_availabilities",
"=",
"get_availabilities_for_duration",
"(",
"get_duration",
"(",
"appointment_type",
")",
",",
"booking_availabilities",
")",
"if",
"len",
"(",
"appointment_type_availabilities",
")",
"==",
"0",
":",
"# No availability on this day at all; ask for a new date and time.",
"slots",
"[",
"'Date'",
"]",
"=",
"None",
"slots",
"[",
"'Time'",
"]",
"=",
"None",
"return",
"elicit_slot",
"(",
"output_session_attributes",
",",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'name'",
"]",
",",
"slots",
",",
"'Date'",
",",
"{",
"'contentType'",
":",
"'PlainText'",
",",
"'content'",
":",
"'We do not have any availability on that date, is there another day which works for you?'",
"}",
",",
"build_response_card",
"(",
"'Specify Date'",
",",
"'What day works best for you?'",
",",
"build_options",
"(",
"'Date'",
",",
"appointment_type",
",",
"date",
",",
"booking_map",
")",
")",
")",
"message_content",
"=",
"'What time on {} works for you? '",
".",
"format",
"(",
"date",
")",
"if",
"time",
":",
"output_session_attributes",
"[",
"'formattedTime'",
"]",
"=",
"build_time_output_string",
"(",
"time",
")",
"# Validate that proposed time for the appointment can be booked by first fetching the availabilities for the given day. To",
"# give consistent behavior in the sample, this is stored in sessionAttributes after the first lookup.",
"if",
"is_available",
"(",
"time",
",",
"get_duration",
"(",
"appointment_type",
")",
",",
"booking_availabilities",
")",
":",
"return",
"delegate",
"(",
"output_session_attributes",
",",
"slots",
")",
"message_content",
"=",
"'The time you requested is not available. '",
"if",
"len",
"(",
"appointment_type_availabilities",
")",
"==",
"1",
":",
"# If there is only one availability on the given date, try to confirm it.",
"slots",
"[",
"'Time'",
"]",
"=",
"appointment_type_availabilities",
"[",
"0",
"]",
"return",
"confirm_intent",
"(",
"output_session_attributes",
",",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'name'",
"]",
",",
"slots",
",",
"{",
"'contentType'",
":",
"'PlainText'",
",",
"'content'",
":",
"'{}{} is our only availability, does that work for you?'",
".",
"format",
"(",
"message_content",
",",
"build_time_output_string",
"(",
"appointment_type_availabilities",
"[",
"0",
"]",
")",
")",
"}",
",",
"build_response_card",
"(",
"'Confirm Appointment'",
",",
"'Is {} on {} okay?'",
".",
"format",
"(",
"build_time_output_string",
"(",
"appointment_type_availabilities",
"[",
"0",
"]",
")",
",",
"date",
")",
",",
"[",
"{",
"'text'",
":",
"'yes'",
",",
"'value'",
":",
"'yes'",
"}",
",",
"{",
"'text'",
":",
"'no'",
",",
"'value'",
":",
"'no'",
"}",
"]",
")",
")",
"available_time_string",
"=",
"build_available_time_string",
"(",
"appointment_type_availabilities",
")",
"return",
"elicit_slot",
"(",
"output_session_attributes",
",",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'name'",
"]",
",",
"slots",
",",
"'Time'",
",",
"{",
"'contentType'",
":",
"'PlainText'",
",",
"'content'",
":",
"'{}{}'",
".",
"format",
"(",
"message_content",
",",
"available_time_string",
")",
"}",
",",
"build_response_card",
"(",
"'Specify Time'",
",",
"'What time works best for you?'",
",",
"build_options",
"(",
"'Time'",
",",
"appointment_type",
",",
"date",
",",
"booking_map",
")",
")",
")",
"return",
"delegate",
"(",
"output_session_attributes",
",",
"slots",
")",
"# Book the appointment. In a real bot, this would likely involve a call to a backend service.",
"duration",
"=",
"get_duration",
"(",
"appointment_type",
")",
"booking_availabilities",
"=",
"booking_map",
"[",
"date",
"]",
"if",
"booking_availabilities",
":",
"# Remove the availability slot for the given date as it has now been booked.",
"booking_availabilities",
".",
"remove",
"(",
"time",
")",
"if",
"duration",
"==",
"60",
":",
"second_half_hour_time",
"=",
"increment_time_by_thirty_mins",
"(",
"time",
")",
"booking_availabilities",
".",
"remove",
"(",
"second_half_hour_time",
")",
"booking_map",
"[",
"date",
"]",
"=",
"booking_availabilities",
"output_session_attributes",
"[",
"'bookingMap'",
"]",
"=",
"json",
".",
"dumps",
"(",
"booking_map",
")",
"else",
":",
"# This is not treated as an error as this code sample supports functionality either as fulfillment or dialog code hook.",
"logger",
".",
"debug",
"(",
"'Availabilities for {} were null at fulfillment time. '",
"'This should have been initialized if this function was configured as the dialog code hook'",
".",
"format",
"(",
"date",
")",
")",
"return",
"close",
"(",
"output_session_attributes",
",",
"'Fulfilled'",
",",
"{",
"'contentType'",
":",
"'PlainText'",
",",
"'content'",
":",
"'Okay, I have booked your appointment. We will see you at {} on {}'",
".",
"format",
"(",
"build_time_output_string",
"(",
"time",
")",
",",
"date",
")",
"}",
")"
] |
Performs dialog management and fulfillment for booking a dentists appointment.
Beyond fulfillment, the implementation for this intent demonstrates the following:
1) Use of elicitSlot in slot validation and re-prompting
2) Use of confirmIntent to support the confirmation of inferred slot values, when confirmation is required
on the bot model and the inferred slot values fully specify the intent.
|
[
"Performs",
"dialog",
"management",
"and",
"fulfillment",
"for",
"booking",
"a",
"dentists",
"appointment",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/lex-make-appointment-python/lambda_function.py#L320-L476
|
train
|
Makes an appointment for the specified slot.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,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NiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + '\x31' + '\x34', 27388 - 27380), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11 + 0o57) + chr(998 - 946), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10111 + 0o34) + chr(0b101110 + 0o3) + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(1159 - 1109) + chr(1014 - 962) + chr(460 - 409), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + '\062', 0o10), ehT0Px3KOsy9(chr(1477 - 1429) + chr(9293 - 9182) + chr(52) + chr(0b1101 + 0o52), 0b1000), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + '\061' + '\x37' + chr(1204 - 1149), 0b1000), ehT0Px3KOsy9(chr(398 - 350) + chr(0b1101111) + '\062' + chr(0b110101) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(0b11011 + 0o33) + chr(2061 - 2006), 34360 - 34352), ehT0Px3KOsy9(chr(0b110000) + chr(5132 - 5021) + chr(0b110010) + chr(0b1110 + 0o42) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + chr(0b100000 + 0o21) + chr(0b1011 + 0o52) + chr(0b100001 + 0o24), 62705 - 62697), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(0b110100) + chr(1708 - 1656), 48538 - 48530), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10000 + 0o41) + '\x34' + chr(0b10011 + 0o44), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(2249 - 2201) + chr(0b100101 + 0o14), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + chr(697 - 647) + chr(0b110010) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(0b110001) + chr(2178 - 2128), 0b1000), ehT0Px3KOsy9(chr(188 - 140) + '\x6f' + chr(0b110001) + chr(0b110011) + chr(897 - 844), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(0b110010 + 0o1), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1010100 + 0o33) + chr(1955 - 1905) + chr(52) + chr(2246 - 2193), 51497 - 51489), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + '\062' + chr(48) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + chr(0b110100) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\x6f' + '\062' + '\060' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + '\x34' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10011 + 0o41) + '\060', 8), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + '\x33' + chr(55), 0o10), ehT0Px3KOsy9(chr(654 - 606) + chr(0b110001 + 0o76) + '\x32' + '\062' + chr(0b101 + 0o61), 50887 - 50879), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b11110 + 0o121) + '\x32' + '\065' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(6920 - 6809) + '\x33' + '\x35' + chr(51), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(54) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1100110 + 0o11) + chr(2207 - 2158) + '\065' + chr(705 - 653), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011101 + 0o22) + chr(0b100011 + 0o20) + '\064' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5580 - 5469) + chr(2377 - 2326) + chr(0b100101 + 0o16) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(9455 - 9344) + chr(2410 - 2359) + '\x35' + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + '\067' + chr(0b110011), 41055 - 41047), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + chr(49) + chr(1386 - 1337) + chr(0b100000 + 0o27), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + '\062' + chr(54), 24435 - 24427), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1110 - 1059) + chr(50) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(9117 - 9006) + '\063' + chr(1450 - 1397) + chr(1227 - 1178), 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + chr(0b10101 + 0o35) + chr(0b110111) + chr(0b11 + 0o56), 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1100101 + 0o12) + '\063' + chr(2093 - 2040) + chr(1436 - 1387), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(111) + chr(627 - 574) + chr(257 - 209), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2'), '\x64' + '\x65' + chr(0b1000011 + 0o40) + chr(5247 - 5136) + chr(0b10 + 0o142) + chr(0b11101 + 0o110))(chr(0b1110101) + chr(0b1110100) + '\146' + '\x2d' + chr(1670 - 1614)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def yEgqUTCsIN62(wVJBdhyINndp):
xFbpm3qQSFuC = wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), '\144' + chr(0b101100 + 0o71) + chr(99) + chr(10404 - 10293) + chr(100) + chr(101))('\x75' + chr(0b1110100) + chr(0b110000 + 0o66) + '\055' + chr(0b101 + 0o63))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xffx\xa7\xd7a'), '\x64' + chr(0b110011 + 0o62) + chr(0b1011010 + 0o11) + chr(0b101100 + 0o103) + chr(100) + '\x65')('\x75' + chr(116) + chr(102) + '\x2d' + chr(56))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xcdd\xb8\xcc{I\x0b\xc3R\xed\x190\x1e\xf1\xf5'), chr(0b1100100) + chr(6963 - 6862) + chr(99) + '\157' + '\144' + chr(0b1011010 + 0o13))('\165' + chr(0b1110100) + chr(0b1100110) + chr(1929 - 1884) + '\070')]
J4aeFOr3sjPo = wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), chr(2417 - 2317) + chr(101) + chr(6503 - 6404) + chr(0b1101111) + chr(100) + chr(101))('\x75' + chr(0b110010 + 0o102) + '\x66' + chr(1371 - 1326) + chr(0b111000))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xffx\xa7\xd7a'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + '\x6f' + chr(0b101101 + 0o67) + chr(625 - 524))(chr(0b11011 + 0o132) + '\164' + chr(0b1100110) + '\x2d' + chr(0b100000 + 0o30))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8u\xbc\xc6'), chr(7837 - 7737) + chr(0b1100100 + 0o1) + '\x63' + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(6333 - 6231) + chr(0b101101) + chr(0b110101 + 0o3))]
ltvhPP4VhXre = wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), '\144' + chr(0b1100101) + '\x63' + chr(3534 - 3423) + chr(100) + '\145')(chr(8590 - 8473) + '\x74' + '\146' + chr(0b101101) + chr(2515 - 2459))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xffx\xa7\xd7a'), chr(100) + chr(101) + '\143' + '\x6f' + chr(0b1100100) + chr(0b1100101))('\x75' + chr(0b1110100) + '\x66' + '\x2d' + chr(0b11011 + 0o35))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8}\xa5\xc6'), '\x64' + '\x65' + chr(99) + '\157' + chr(3614 - 3514) + chr(0b1100101))(chr(0b11110 + 0o127) + chr(0b1110100) + chr(102) + '\055' + chr(56))]
Qas9W3D0Xbzi = wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe5z\xbe\xccqF\x0b\xc7X\xed>\x0b\x12\xf3\xf3\xaf'), chr(3385 - 3285) + chr(0b111110 + 0o47) + chr(0b101010 + 0o71) + chr(2533 - 2422) + chr(0b110001 + 0o63) + '\145')(chr(0b1100000 + 0o25) + chr(9743 - 9627) + '\146' + chr(0b101101) + chr(56))]
E45heiPa87QS = wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xffq\xbb\xd0{H\x11\xefC\xf7\x1f\r\x05\xf4\xe4\xaf.'), chr(100) + chr(0b1100101) + chr(3556 - 3457) + chr(0b1101111) + chr(8238 - 8138) + chr(101))(chr(12907 - 12790) + chr(116) + chr(0b110011 + 0o63) + chr(45) + chr(56))]
S2541AGas87K = fXk443epxtd5.loads(tAJLnEcSMM54(lambda : E45heiPa87QS[xafqLlk3kkUe(SXOLrMavuUCe(b'\xee{\xa7\xc8{I\x18\xe3V\xf3'), '\144' + chr(0b100010 + 0o103) + chr(4119 - 4020) + chr(0b10000 + 0o137) + chr(0b111101 + 0o47) + chr(101))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(45) + chr(0b111000))]) or xafqLlk3kkUe(SXOLrMavuUCe(b'\xf7i'), chr(6939 - 6839) + chr(0b10000 + 0o125) + chr(99) + chr(0b1101111) + chr(100) + chr(1247 - 1146))(chr(8595 - 8478) + '\164' + chr(102) + chr(0b101101) + chr(1856 - 1800)))
if Qas9W3D0Xbzi == xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8}\xa9\xcf}@<\xc1S\xe6%\x0b\x08\xea'), '\x64' + chr(0b1100101) + chr(0b11 + 0o140) + chr(0b1101111) + chr(0b1000000 + 0o44) + '\x65')('\165' + '\164' + chr(0b100101 + 0o101) + chr(0b101101) + chr(801 - 745)):
QaGWUapnTsux = wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), '\144' + chr(4046 - 3945) + '\143' + chr(111) + chr(1267 - 1167) + chr(5802 - 5701))(chr(10557 - 10440) + '\164' + chr(0b1100 + 0o132) + '\055' + chr(933 - 877))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xffx\xa7\xd7a'), chr(100) + '\x65' + '\143' + '\157' + '\x64' + '\x65')(chr(0b1110101) + chr(0b1110010 + 0o2) + '\146' + '\x2d' + '\070')]
pOQG8Y1kF7u4 = PfFC7o0PYAhk(xFbpm3qQSFuC, J4aeFOr3sjPo, ltvhPP4VhXre)
if not pOQG8Y1kF7u4[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe5g\x9e\xc2~N\x1b'), chr(100) + chr(101) + chr(200 - 101) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(4101 - 3985) + '\146' + '\055' + chr(0b110000 + 0o10))]:
QaGWUapnTsux[pOQG8Y1kF7u4[xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa}\xa7\xcfsS\x1a\xcad\xef\x02\x10'), chr(4404 - 4304) + chr(0b101000 + 0o75) + chr(0b1001001 + 0o32) + chr(0b1101111) + '\144' + chr(0b1100101))('\165' + chr(6466 - 6350) + chr(102) + '\x2d' + chr(56))]] = None
return ENs5xz0M8SiT(E45heiPa87QS, wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), chr(2990 - 2890) + chr(101) + chr(0b1011001 + 0o12) + '\157' + '\144' + chr(0b1010011 + 0o22))(chr(117) + '\x74' + '\146' + chr(1358 - 1313) + chr(3001 - 2945))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2u\xa5\xc6'), '\x64' + chr(3622 - 3521) + chr(0b1100011) + chr(0b10 + 0o155) + '\144' + chr(0b1100101))(chr(0b110100 + 0o101) + '\164' + chr(0b1100110) + chr(0b101101) + chr(56))], QaGWUapnTsux, pOQG8Y1kF7u4[xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa}\xa7\xcfsS\x1a\xcad\xef\x02\x10'), chr(358 - 258) + chr(215 - 114) + chr(0b1100011) + '\157' + '\x64' + chr(0b1100101))('\x75' + chr(0b1110100) + chr(0b10010 + 0o124) + chr(45) + chr(56))], pOQG8Y1kF7u4[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1q\xbb\xd0s@\x1a'), chr(0b1100100) + '\x65' + chr(99) + chr(623 - 512) + '\x64' + '\x65')(chr(0b1110101) + chr(116) + chr(102) + '\055' + chr(0b111000))], DEotPGyanzgs(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdfd\xad\xc0{A\x06\x8eL\xfe'), chr(8782 - 8682) + chr(0b1011010 + 0o13) + chr(0b1000101 + 0o36) + '\x6f' + '\144' + '\145')(chr(13118 - 13001) + chr(0b1110100) + chr(0b1000001 + 0o45) + chr(0b10001 + 0o34) + chr(0b101110 + 0o12)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda \xba\xccZF,\x9dg\xf3\x08\x0e'), '\x64' + '\145' + chr(99) + '\157' + chr(0b1100100) + '\145')('\165' + chr(0b1001111 + 0o45) + chr(0b111100 + 0o52) + chr(0b101101) + chr(2597 - 2541)))(pOQG8Y1kF7u4[xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa}\xa7\xcfsS\x1a\xcad\xef\x02\x10'), chr(0b11101 + 0o107) + '\x65' + chr(5192 - 5093) + chr(111) + chr(6094 - 5994) + chr(0b111000 + 0o55))(chr(9248 - 9131) + '\x74' + chr(102) + chr(45) + '\070')]), pOQG8Y1kF7u4[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1q\xbb\xd0s@\x1a'), chr(0b1100100) + chr(0b1100101) + '\x63' + '\x6f' + '\144' + chr(7253 - 7152))('\x75' + chr(116) + chr(102) + chr(45) + chr(0b111000))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b'), chr(100) + chr(101) + '\143' + chr(7246 - 7135) + chr(0b1100100) + chr(101))(chr(0b1110011 + 0o2) + chr(4446 - 4330) + chr(0b1100110) + chr(45) + '\x38')], xkgqk8ZsKP3Z(pOQG8Y1kF7u4[xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa}\xa7\xcfsS\x1a\xcad\xef\x02\x10'), chr(6243 - 6143) + chr(493 - 392) + chr(0b1100011) + '\x6f' + '\144' + chr(9891 - 9790))(chr(0b1110101) + chr(0b1001001 + 0o53) + chr(9843 - 9741) + chr(0b101101) + chr(0b111000))], xFbpm3qQSFuC, J4aeFOr3sjPo, S2541AGas87K)))
if not xFbpm3qQSFuC:
return ENs5xz0M8SiT(E45heiPa87QS, wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), '\144' + chr(101) + chr(9255 - 9156) + chr(0b1101010 + 0o5) + chr(0b1100100 + 0o0) + chr(0b100110 + 0o77))(chr(117) + '\164' + '\146' + chr(0b101101) + chr(0b101001 + 0o17))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2u\xa5\xc6'), '\144' + chr(0b11100 + 0o111) + chr(4737 - 4638) + chr(11673 - 11562) + chr(0b1100100) + chr(5688 - 5587))(chr(0b1110101) + chr(7590 - 7474) + chr(0b1100110) + '\x2d' + chr(0b111000))], wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), '\144' + chr(7450 - 7349) + chr(7705 - 7606) + chr(0b1111 + 0o140) + chr(396 - 296) + chr(101))(chr(765 - 648) + chr(116) + chr(0b1100110) + chr(45) + chr(2077 - 2021))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xffx\xa7\xd7a'), chr(100) + '\x65' + '\x63' + chr(0b1000000 + 0o57) + chr(6950 - 6850) + chr(0b101000 + 0o75))(chr(0b1110101) + chr(0b11100 + 0o130) + '\x66' + '\x2d' + chr(2919 - 2863))], xafqLlk3kkUe(SXOLrMavuUCe(b'\xcdd\xb8\xcc{I\x0b\xc3R\xed\x190\x1e\xf1\xf5'), chr(8705 - 8605) + chr(0b1011000 + 0o15) + '\x63' + '\x6f' + '\x64' + chr(101))(chr(0b1110101) + chr(11751 - 11635) + '\146' + chr(0b10100 + 0o31) + chr(56)), {xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b\xfaN\xf3\x08'), chr(100) + '\145' + chr(0b1100011) + '\x6f' + chr(3628 - 3528) + chr(101))(chr(0b1110101) + chr(0b1100001 + 0o23) + chr(0b1100110) + chr(45) + chr(56)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xdcx\xa9\xca|s\x1a\xd6C'), chr(8784 - 8684) + '\145' + '\x63' + chr(0b1100001 + 0o16) + chr(9044 - 8944) + chr(101))(chr(117) + '\x74' + chr(0b1100110 + 0o0) + chr(45) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b'), '\x64' + chr(0b1100101) + '\143' + chr(0b1000010 + 0o55) + chr(0b110000 + 0o64) + '\145')(chr(0b1110101) + chr(11852 - 11736) + chr(0b1100110) + chr(0b101101) + chr(0b11101 + 0o33)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb|\xa9\xd72S\x06\xdeR\xa3\x02\x02G\xe0\xe0\xba2b\xcb\xf4\x8c\xe0NT\x7f\xe1\xc3\x9eZ\x08\xc6\xa3\x84\x0eo:\xbf\x82\xdc\xc9\xf8{\xe8\xd0qO\x1a\xcaB\xef\x08['), chr(0b1011101 + 0o7) + chr(0b1000110 + 0o37) + chr(99) + chr(0b1101111) + chr(0b1100100) + '\145')('\165' + '\164' + chr(102) + chr(1400 - 1355) + '\070')}, DEotPGyanzgs(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdfd\xad\xc0{A\x06\x8ev\xf3\x1d\x0b\x0e\xef\xe4\xa78e\xd1\xa0\xb5\xfcPE'), '\144' + '\x65' + chr(99) + chr(0b100011 + 0o114) + '\144' + '\145')('\x75' + chr(116) + chr(0b1100110) + '\055' + chr(0b1110 + 0o52)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb|\xa9\xd72S\x06\xdeR\xa3\x02\x02G\xe0\xe0\xba2b\xcb\xf4\x8c\xe0NT\x7f\xe1\xc3\x9eZ\x08\xc6\xa3\x84\x0eo:\xbf\x82\xdc\xc9\xf8{\xe8\xd0qO\x1a\xcaB\xef\x08['), chr(0b1100100) + '\145' + chr(0b1100000 + 0o3) + '\157' + chr(0b1100100) + '\x65')('\x75' + '\164' + '\x66' + chr(45) + chr(56)), xkgqk8ZsKP3Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\xcdd\xb8\xcc{I\x0b\xc3R\xed\x190\x1e\xf1\xf5'), '\x64' + chr(0b1100101) + chr(0b100 + 0o137) + chr(6319 - 6208) + chr(0b100011 + 0o101) + '\x65')('\165' + chr(0b1100000 + 0o24) + chr(2014 - 1912) + chr(905 - 860) + chr(56)), xFbpm3qQSFuC, J4aeFOr3sjPo, None)))
if xFbpm3qQSFuC and (not J4aeFOr3sjPo):
return ENs5xz0M8SiT(E45heiPa87QS, wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), chr(100) + chr(101) + '\143' + '\x6f' + chr(0b100 + 0o140) + chr(0b1100101))('\x75' + chr(0b1010010 + 0o42) + chr(0b1100110) + chr(45) + chr(0b111000))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2u\xa5\xc6'), chr(100) + chr(0b1100101) + '\143' + chr(3736 - 3625) + chr(6198 - 6098) + '\145')(chr(0b1011101 + 0o30) + '\x74' + chr(0b1001101 + 0o31) + chr(45) + chr(1583 - 1527))], wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), chr(1993 - 1893) + '\x65' + chr(0b1100000 + 0o3) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(102) + '\x2d' + '\070')][xafqLlk3kkUe(SXOLrMavuUCe(b'\xffx\xa7\xd7a'), chr(100) + '\x65' + chr(0b1100011) + chr(0b1010111 + 0o30) + chr(100) + chr(3208 - 3107))('\165' + chr(116) + chr(102) + '\055' + chr(0b111000))], xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8u\xbc\xc6'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(100) + chr(3129 - 3028))('\165' + '\164' + chr(102) + '\055' + chr(2875 - 2819)), {xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b\xfaN\xf3\x08'), chr(0b100011 + 0o101) + chr(101) + chr(0b1 + 0o142) + '\x6f' + '\x64' + '\x65')('\x75' + '\164' + chr(102) + chr(0b101101) + chr(56)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xdcx\xa9\xca|s\x1a\xd6C'), chr(0b0 + 0o144) + chr(1224 - 1123) + chr(0b11100 + 0o107) + '\157' + '\144' + '\x65')('\165' + chr(5339 - 5223) + chr(0b111000 + 0o56) + chr(45) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b'), '\144' + '\145' + '\x63' + '\157' + chr(8817 - 8717) + chr(3835 - 3734))(chr(0b1110101) + chr(1549 - 1433) + '\x66' + chr(461 - 416) + chr(56)): xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb|\xad\xcd2P\x10\xdb[\xe7M\x1d\x08\xf4\xb0\xa64`\xc0\xa0\x95\xea\x00S<\xfe\xc9\x8fC\x00\x83\xfa\x92\x14:$\xf6\x92\xc4\xd6'), '\144' + chr(4731 - 4630) + chr(0b1100011) + chr(0b1001 + 0o146) + chr(100) + chr(264 - 163))(chr(11350 - 11233) + '\164' + '\146' + '\055' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda \xba\xccZF,\x9dg\xf3\x08\x0e'), chr(7982 - 7882) + '\145' + chr(0b10100 + 0o117) + '\157' + chr(0b1000001 + 0o43) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b10111 + 0o117) + '\x2d' + chr(2273 - 2217)))(xFbpm3qQSFuC)}, DEotPGyanzgs(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdfd\xad\xc0{A\x06\x8es\xe2\x19\x01'), chr(3091 - 2991) + '\145' + chr(5501 - 5402) + chr(5893 - 5782) + chr(100) + '\x65')('\x75' + chr(0b101101 + 0o107) + chr(0b1100110) + chr(1418 - 1373) + '\x38'), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb|\xad\xcd2P\x10\xdb[\xe7M\x1d\x08\xf4\xb0\xa64`\xc0\xa0\x95\xea\x00S<\xfe\xc9\x8fC\x00\x83\xfa\x92\x14:$\xf6\x92\xc4\xd6'), chr(0b10110 + 0o116) + '\x65' + '\x63' + chr(2110 - 1999) + chr(0b100111 + 0o75) + '\x65')('\x75' + chr(0b1011111 + 0o25) + chr(0b111010 + 0o54) + chr(0b101101) + chr(0b1101 + 0o53)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda \xba\xccZF,\x9dg\xf3\x08\x0e'), chr(0b111011 + 0o51) + '\x65' + '\143' + chr(0b11011 + 0o124) + chr(0b100101 + 0o77) + chr(101))(chr(0b1110101) + '\x74' + '\x66' + chr(0b101101) + '\x38'))(xFbpm3qQSFuC), xkgqk8ZsKP3Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8u\xbc\xc6'), '\144' + chr(0b1100101) + chr(99) + chr(111) + chr(9759 - 9659) + '\x65')(chr(117) + chr(116) + chr(6884 - 6782) + chr(0b101101) + chr(0b111000)), xFbpm3qQSFuC, J4aeFOr3sjPo, None)))
if xFbpm3qQSFuC and J4aeFOr3sjPo:
cOtMRaXBoosk = tAJLnEcSMM54(lambda : S2541AGas87K[J4aeFOr3sjPo])
if cOtMRaXBoosk is None:
cOtMRaXBoosk = _6pmlEXqYTRf(J4aeFOr3sjPo)
S2541AGas87K[J4aeFOr3sjPo] = cOtMRaXBoosk
E45heiPa87QS[xafqLlk3kkUe(SXOLrMavuUCe(b'\xee{\xa7\xc8{I\x18\xe3V\xf3'), '\x64' + chr(1876 - 1775) + chr(3617 - 3518) + chr(0b1101111) + '\x64' + chr(0b1100101))('\165' + chr(0b101110 + 0o106) + chr(6713 - 6611) + chr(1553 - 1508) + chr(0b111000))] = fXk443epxtd5.dumps(S2541AGas87K)
hvvbzwuAo6wu = hVWBInHmJPc1(oodVlKVP8DKH(xFbpm3qQSFuC), cOtMRaXBoosk)
if c2A0yzQpDQB3(hvvbzwuAo6wu) == ehT0Px3KOsy9(chr(0b110000) + chr(11551 - 11440) + chr(0b110000), 0b1000):
QaGWUapnTsux[xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8u\xbc\xc6'), chr(100) + chr(0b1100101) + '\143' + '\157' + chr(0b1011110 + 0o6) + '\145')('\165' + chr(4946 - 4830) + '\146' + chr(0b100000 + 0o15) + chr(0b111000))] = None
QaGWUapnTsux[xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8}\xa5\xc6'), '\x64' + '\x65' + chr(6160 - 6061) + chr(111) + '\144' + '\145')('\x75' + '\x74' + chr(0b1100101 + 0o1) + chr(0b101101) + chr(56))] = None
return ENs5xz0M8SiT(E45heiPa87QS, wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), '\x64' + chr(0b1011100 + 0o11) + chr(0b1100011) + '\x6f' + '\x64' + chr(5495 - 5394))('\x75' + chr(3234 - 3118) + '\146' + '\x2d' + chr(0b111000))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2u\xa5\xc6'), chr(529 - 429) + '\x65' + chr(0b1100011) + chr(0b1001101 + 0o42) + chr(0b1010011 + 0o21) + '\145')(chr(117) + chr(0b1110100) + chr(476 - 374) + '\x2d' + chr(1354 - 1298))], QaGWUapnTsux, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8u\xbc\xc6'), chr(0b1010010 + 0o22) + '\x65' + '\x63' + chr(111) + '\144' + '\x65')('\165' + chr(0b100001 + 0o123) + '\x66' + chr(0b100101 + 0o10) + chr(300 - 244)), {xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b\xfaN\xf3\x08'), chr(0b1001011 + 0o31) + chr(0b1100101) + chr(450 - 351) + chr(111) + chr(100) + '\x65')(chr(9884 - 9767) + '\x74' + '\146' + chr(0b1 + 0o54) + chr(0b1111 + 0o51)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xdcx\xa9\xca|s\x1a\xd6C'), chr(0b1010110 + 0o16) + chr(101) + chr(0b1110 + 0o125) + '\157' + '\144' + chr(7400 - 7299))(chr(0b1110101) + chr(4627 - 4511) + chr(1951 - 1849) + chr(0b111 + 0o46) + chr(1629 - 1573)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b'), chr(100) + chr(0b1011010 + 0o13) + '\143' + chr(3169 - 3058) + chr(100) + '\x65')('\165' + '\164' + chr(0b1100110) + '\x2d' + chr(0b111000)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xdbq\xe8\xc7}\x07\x11\xc1C\xa3\x05\x05\x11\xe4\xb0\xab3r\x85\xe1\x97\xe4IL>\xf4\xc5\x87_\x18\x9f\xfa\x84\x15o"\xbe\x88\xcd\xc9\xe8u\xbc\xc6>\x07\x16\xdd\x17\xf7\x05\x01\x15\xe4\xb0\xab3d\xd1\xe8\x84\xf7\x00D>\xef\x8c\x9c^\x05\x85\xb2\xcb\x0c $\xbd\x9a\x99\x8f\xe3f\xe8\xda}R@'), chr(0b111100 + 0o50) + chr(0b1111 + 0o126) + '\x63' + chr(3652 - 3541) + '\x64' + chr(101))('\165' + '\164' + chr(0b1100110) + chr(0b10111 + 0o26) + chr(0b111000))}, DEotPGyanzgs(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdfd\xad\xc0{A\x06\x8es\xe2\x19\x01'), chr(7026 - 6926) + '\145' + '\x63' + '\x6f' + '\144' + chr(101))(chr(117) + '\x74' + '\x66' + '\055' + chr(836 - 780)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb|\xa9\xd72C\x1e\xd7\x17\xf4\x02\x16\x0c\xf2\xb0\xa88x\xd1\xa0\x87\xeaR\x00&\xf9\xd9\xd4'), chr(100) + chr(0b101000 + 0o75) + chr(0b1100011) + chr(111) + chr(8326 - 8226) + chr(101))('\165' + '\164' + '\146' + chr(0b10001 + 0o34) + chr(0b111000)), xkgqk8ZsKP3Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8u\xbc\xc6'), chr(9775 - 9675) + chr(0b1100101) + chr(0b1100011) + chr(0b1000 + 0o147) + chr(0b1011001 + 0o13) + chr(0b1100101))(chr(8513 - 8396) + chr(0b110 + 0o156) + chr(0b1100110) + '\055' + chr(2834 - 2778)), xFbpm3qQSFuC, J4aeFOr3sjPo, S2541AGas87K)))
YiukJCqUKu1O = xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb|\xa9\xd72S\x16\xc3R\xa3\x02\nG\xfa\xed\xea*d\xd7\xeb\x92\xa5FO-\xb6\xd5\x84CS\xc6'), chr(100) + '\145' + chr(1778 - 1679) + '\157' + chr(9312 - 9212) + '\145')('\x75' + chr(0b1110100) + '\x66' + chr(684 - 639) + chr(1496 - 1440)).V4roHaS3Ppej(J4aeFOr3sjPo)
if ltvhPP4VhXre:
E45heiPa87QS[xafqLlk3kkUe(SXOLrMavuUCe(b'\xea{\xba\xcesS\x0b\xcbS\xd7\x04\t\x02'), chr(0b1100100) + '\145' + '\143' + '\157' + chr(8367 - 8267) + '\145')('\165' + chr(116) + chr(0b1001010 + 0o34) + '\055' + chr(56))] = LdUoVgsCr5zp(ltvhPP4VhXre)
if RzCfARRZ6h00(ltvhPP4VhXre, oodVlKVP8DKH(xFbpm3qQSFuC), cOtMRaXBoosk):
return Mjt53xq6OyiN(E45heiPa87QS, QaGWUapnTsux)
YiukJCqUKu1O = xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8|\xad\x83fN\x12\xcb\x17\xfa\x02\x11G\xf3\xf5\xbb(n\xd6\xf4\x84\xe1\x00I,\xb6\xc2\x84BL\x87\xac\x8a\x12#7\xb4\x85\xdc\xc7\xac'), chr(0b1100100) + '\145' + chr(0b1000000 + 0o43) + '\157' + chr(0b101110 + 0o66) + chr(101))(chr(12821 - 12704) + '\x74' + chr(4754 - 4652) + chr(0b101101) + chr(1501 - 1445))
if c2A0yzQpDQB3(hvvbzwuAo6wu) == ehT0Px3KOsy9('\060' + chr(7964 - 7853) + '\x31', 0b1000):
QaGWUapnTsux[xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8}\xa5\xc6'), '\x64' + chr(101) + chr(0b101010 + 0o71) + '\157' + chr(8157 - 8057) + '\x65')(chr(779 - 662) + '\164' + '\x66' + '\x2d' + '\070')] = hvvbzwuAo6wu[ehT0Px3KOsy9(chr(1722 - 1674) + chr(4385 - 4274) + chr(0b0 + 0o60), 8)]
return PtK9nG_VEHeW(E45heiPa87QS, wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), '\144' + '\x65' + chr(7580 - 7481) + '\157' + '\144' + chr(101))('\165' + chr(0b1010 + 0o152) + chr(102) + chr(45) + chr(2876 - 2820))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2u\xa5\xc6'), chr(0b1100100) + chr(101) + chr(9047 - 8948) + chr(111) + chr(100) + '\x65')(chr(357 - 240) + '\164' + chr(0b1100110) + chr(0b101101) + chr(2398 - 2342))], QaGWUapnTsux, {xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b\xfaN\xf3\x08'), chr(0b1100100) + chr(2985 - 2884) + chr(9606 - 9507) + chr(0b1000101 + 0o52) + '\144' + '\x65')(chr(117) + '\x74' + chr(4250 - 4148) + '\x2d' + chr(0b111000)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xdcx\xa9\xca|s\x1a\xd6C'), '\144' + '\145' + chr(1342 - 1243) + chr(0b1100000 + 0o17) + '\x64' + chr(101))(chr(0b1110101) + chr(116) + '\x66' + '\x2d' + chr(1878 - 1822)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b'), '\x64' + chr(0b100010 + 0o103) + '\x63' + '\x6f' + chr(100) + chr(2984 - 2883))('\165' + '\164' + chr(2838 - 2736) + chr(0b10000 + 0o35) + chr(0b111000)): xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf7i\xb3\xde2N\x0c\x8eX\xf6\x1fD\x08\xef\xfc\xb3}j\xd3\xe1\x88\xe9AB6\xfa\xc5\x9fO@\xc6\xbe\x84\x1e<v\xa2\x81\xd8\x9d\xacc\xa7\xd1y\x07\x19\xc1E\xa3\x14\x0b\x12\xbe'), '\144' + '\x65' + chr(0b1001 + 0o132) + chr(6626 - 6515) + '\x64' + '\x65')(chr(12385 - 12268) + chr(0b1110100) + chr(0b10000 + 0o126) + '\x2d' + chr(2871 - 2815)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda \xba\xccZF,\x9dg\xf3\x08\x0e'), '\144' + '\145' + chr(0b1100011) + chr(111) + chr(100) + '\145')('\x75' + '\x74' + chr(0b0 + 0o146) + '\x2d' + chr(731 - 675)))(YiukJCqUKu1O, LdUoVgsCr5zp(hvvbzwuAo6wu[ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + '\060', 8)]))}, DEotPGyanzgs(xafqLlk3kkUe(SXOLrMavuUCe(b'\xcf{\xa6\xc5{U\x12\x8ev\xf3\x1d\x0b\x0e\xef\xe4\xa78e\xd1'), '\144' + chr(0b1001101 + 0o30) + chr(99) + '\157' + chr(100) + '\145')(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(576 - 531) + chr(0b111000)), xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5g\xe8\xd8o\x07\x10\xc0\x17\xf8\x10D\x08\xea\xf1\xb3b'), '\x64' + '\145' + '\143' + chr(0b1100010 + 0o15) + chr(6177 - 6077) + '\x65')('\165' + '\x74' + chr(102) + chr(45) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda \xba\xccZF,\x9dg\xf3\x08\x0e'), chr(5193 - 5093) + chr(0b111000 + 0o55) + '\143' + chr(0b1101111) + '\x64' + chr(101))(chr(7237 - 7120) + '\164' + chr(0b1100110) + chr(0b1 + 0o54) + chr(0b111000)))(LdUoVgsCr5zp(hvvbzwuAo6wu[ehT0Px3KOsy9('\x30' + '\157' + chr(0b1010 + 0o46), 8)]), J4aeFOr3sjPo), [{xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8q\xb0\xd7'), '\x64' + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(7494 - 7394) + '\145')(chr(0b101100 + 0o111) + chr(0b110011 + 0o101) + chr(0b1100011 + 0o3) + '\x2d' + chr(0b111000)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5q\xbb'), chr(1445 - 1345) + chr(9366 - 9265) + chr(99) + chr(111) + chr(0b1100100) + chr(0b1100101))('\165' + '\164' + chr(102) + chr(0b101101) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xfau\xa4\xd6w'), chr(0b1100100) + chr(4230 - 4129) + chr(648 - 549) + '\x6f' + chr(0b1001011 + 0o31) + chr(9154 - 9053))(chr(0b1110101) + chr(116) + '\x66' + '\x2d' + chr(56)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5q\xbb'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b1001001 + 0o46) + '\x64' + '\145')('\x75' + '\x74' + chr(0b110 + 0o140) + chr(492 - 447) + '\070')}, {xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8q\xb0\xd7'), '\144' + '\x65' + chr(0b111110 + 0o45) + '\x6f' + chr(100) + chr(0b1100101))(chr(0b1110101) + '\x74' + '\x66' + chr(371 - 326) + '\070'): xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2{'), chr(0b101110 + 0o66) + chr(0b1000101 + 0o40) + chr(0b1100011) + '\x6f' + chr(100) + chr(0b1100101))('\165' + chr(0b110101 + 0o77) + chr(1645 - 1543) + chr(1011 - 966) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xfau\xa4\xd6w'), chr(0b1100100) + chr(1535 - 1434) + '\x63' + chr(0b100010 + 0o115) + chr(100) + chr(0b1100101))(chr(0b1110101) + '\x74' + chr(0b1011111 + 0o7) + chr(1090 - 1045) + chr(0b111000)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2{'), '\x64' + chr(2834 - 2733) + chr(99) + chr(4680 - 4569) + chr(0b1001101 + 0o27) + '\145')(chr(0b1011110 + 0o27) + chr(116) + chr(0b1010011 + 0o23) + '\x2d' + '\x38')}]))
CYBAh7LqVey6 = F_c9K25Sy4kA(hvvbzwuAo6wu)
return ENs5xz0M8SiT(E45heiPa87QS, wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'\xefa\xba\xd1wI\x0b\xe7Y\xf7\x08\n\x13'), chr(9222 - 9122) + chr(101) + '\143' + chr(0b111001 + 0o66) + chr(0b1100100) + chr(0b1100101))(chr(117) + '\x74' + chr(0b1100110) + chr(0b101101) + chr(353 - 297))][xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2u\xa5\xc6'), '\144' + '\145' + chr(0b11010 + 0o111) + chr(111) + chr(0b110011 + 0o61) + '\145')(chr(0b1110101) + chr(0b100101 + 0o117) + chr(1961 - 1859) + chr(0b101101) + chr(864 - 808))], QaGWUapnTsux, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8}\xa5\xc6'), '\144' + chr(101) + '\143' + '\157' + chr(0b1001111 + 0o25) + chr(101))('\x75' + chr(0b1010110 + 0o36) + '\146' + chr(45) + chr(0b111000)), {xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b\xfaN\xf3\x08'), chr(0b1101 + 0o127) + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b1000110 + 0o37))(chr(0b1110101) + chr(0b1010011 + 0o41) + '\146' + '\055' + chr(0b111000)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xdcx\xa9\xca|s\x1a\xd6C'), chr(0b1100001 + 0o3) + '\x65' + chr(0b1100011) + chr(111) + '\x64' + chr(4760 - 4659))(chr(117) + '\x74' + chr(0b1010111 + 0o17) + chr(0b11101 + 0o20) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b'), '\x64' + '\x65' + '\x63' + chr(111) + chr(1908 - 1808) + chr(0b1100101))(chr(0b1000101 + 0o60) + chr(0b1000110 + 0o56) + chr(0b1100110) + chr(464 - 419) + chr(0b11011 + 0o35)): xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf7i\xb3\xde'), chr(100) + '\145' + chr(0b111100 + 0o47) + chr(6375 - 6264) + chr(100) + '\x65')(chr(117) + chr(116) + chr(0b111111 + 0o47) + chr(189 - 144) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda \xba\xccZF,\x9dg\xf3\x08\x0e'), chr(8777 - 8677) + chr(0b10111 + 0o116) + '\x63' + '\157' + chr(0b1100100) + chr(101))(chr(182 - 65) + chr(0b1110100) + chr(0b110011 + 0o63) + chr(1045 - 1000) + chr(2192 - 2136)))(YiukJCqUKu1O, CYBAh7LqVey6)}, DEotPGyanzgs(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdfd\xad\xc0{A\x06\x8ec\xea\x00\x01'), chr(0b111111 + 0o45) + chr(5004 - 4903) + chr(0b1100011) + '\157' + '\x64' + chr(0b1001101 + 0o30))(chr(0b1100001 + 0o24) + chr(0b1110100) + '\146' + chr(942 - 897) + chr(0b101 + 0o63)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb|\xa9\xd72S\x16\xc3R\xa3\x1a\x0b\x15\xea\xe3\xea?n\xd6\xf4\xc1\xe3OR\x7f\xef\xc3\x9e\t'), chr(100) + '\145' + chr(0b110000 + 0o63) + '\x6f' + chr(8339 - 8239) + '\145')(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(45) + chr(2437 - 2381)), xkgqk8ZsKP3Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8}\xa5\xc6'), '\x64' + chr(0b10111 + 0o116) + chr(0b11101 + 0o106) + chr(0b1101111) + '\144' + '\x65')('\165' + '\164' + '\x66' + chr(0b101000 + 0o5) + chr(0b110110 + 0o2)), xFbpm3qQSFuC, J4aeFOr3sjPo, S2541AGas87K)))
return Mjt53xq6OyiN(E45heiPa87QS, QaGWUapnTsux)
AW3Z20f3DKFA = oodVlKVP8DKH(xFbpm3qQSFuC)
cOtMRaXBoosk = S2541AGas87K[J4aeFOr3sjPo]
if cOtMRaXBoosk:
xafqLlk3kkUe(cOtMRaXBoosk, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfeq\xa5\xccdB'), chr(0b1000111 + 0o35) + '\x65' + chr(99) + chr(0b1101111) + chr(3612 - 3512) + '\145')('\x75' + '\x74' + chr(1795 - 1693) + chr(0b101000 + 0o5) + chr(2972 - 2916)))(ltvhPP4VhXre)
if AW3Z20f3DKFA == ehT0Px3KOsy9('\060' + chr(7295 - 7184) + chr(55) + chr(0b1010 + 0o52), ord("\x08")):
vtCsz6Jl8mBX = vZo_qEWa1g2D(ltvhPP4VhXre)
xafqLlk3kkUe(cOtMRaXBoosk, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfeq\xa5\xccdB'), chr(100) + '\145' + chr(0b1100011) + '\157' + chr(0b110110 + 0o56) + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(1255 - 1210) + chr(56)))(vtCsz6Jl8mBX)
S2541AGas87K[J4aeFOr3sjPo] = cOtMRaXBoosk
E45heiPa87QS[xafqLlk3kkUe(SXOLrMavuUCe(b'\xee{\xa7\xc8{I\x18\xe3V\xf3'), '\144' + chr(0b1010110 + 0o17) + chr(0b111110 + 0o45) + '\x6f' + chr(100) + chr(0b1001001 + 0o34))(chr(0b1110101) + '\x74' + chr(102) + chr(0b1010 + 0o43) + '\070')] = fXk443epxtd5.dumps(S2541AGas87K)
else:
xafqLlk3kkUe(hdK8qOUhR6Or, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8q\xaa\xd6u'), chr(0b1100100) + chr(9465 - 9364) + chr(99) + chr(111) + '\x64' + chr(0b10011 + 0o122))('\x75' + '\x74' + chr(6297 - 6195) + chr(45) + chr(2213 - 2157)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xcdb\xa9\xca~F\x1d\xc7[\xea\x19\r\x02\xf2\xb0\xac2y\x85\xfb\x9c\xa5WE-\xf3\x8c\x85C\x00\x8a\xfa\x8a\x0fo0\xa3\x85\xdf\x80\xe0x\xa5\xc6|S_\xda^\xee\x08JG\xa1\xc4\xa24x\x85\xf3\x89\xeaUL;\xb6\xc4\x8a@\t\xc6\xb8\x8e\x1e!v\xbf\x87\xd0\x9d\xe5u\xa4\xcahB\x1b\x8e^\xe5M\x10\x0f\xe8\xe3\xea;~\xcb\xe3\x95\xecON\x7f\xe1\xcd\x98\x16\x0f\x89\xb4\x8d\x12(#\xa4\x8c\xdd\xc9\xedg\xe8\xd7zB_\xca^\xe2\x01\x0b\x00\xa1\xf3\xa59n\x85\xe8\x8e\xeaK'), chr(9325 - 9225) + chr(101) + '\143' + chr(0b1101111) + chr(6143 - 6043) + chr(101))(chr(5859 - 5742) + chr(4251 - 4135) + '\146' + chr(45) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda \xba\xccZF,\x9dg\xf3\x08\x0e'), chr(0b1100100) + chr(0b1100000 + 0o5) + chr(0b1011010 + 0o11) + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b1010111 + 0o36) + chr(0b1110001 + 0o3) + '\146' + chr(308 - 263) + '\070'))(J4aeFOr3sjPo))
return MkcqzDT3iB5h(E45heiPa87QS, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcaa\xa4\xc5{K\x13\xcbS'), '\144' + '\x65' + chr(0b111110 + 0o45) + '\157' + '\144' + '\145')(chr(117) + '\164' + chr(4936 - 4834) + '\055' + chr(0b111000)), {xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b\xfaN\xf3\x08'), chr(100) + '\145' + '\x63' + chr(111) + chr(0b1100100) + '\145')(chr(0b1011000 + 0o35) + chr(11073 - 10957) + chr(0b1100110) + chr(0b101101) + chr(0b111000)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xdcx\xa9\xca|s\x1a\xd6C'), chr(0b1100100) + chr(3501 - 3400) + '\x63' + chr(0b1101111) + chr(0b110000 + 0o64) + chr(3044 - 2943))(chr(0b1011 + 0o152) + chr(116) + chr(102) + chr(0b10011 + 0o32) + chr(66 - 10)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xef{\xa6\xd7wI\x0b'), chr(6030 - 5930) + '\145' + chr(99) + '\157' + '\x64' + chr(0b1100101))(chr(117) + chr(0b1110100) + '\x66' + chr(0b101 + 0o50) + chr(0b110011 + 0o5)): xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3\x7f\xa9\xda>\x076\x8e_\xe2\x1b\x01G\xe3\xff\xa56n\xc1\xa0\x98\xeaUR\x7f\xf7\xdc\x9bY\x05\x88\xae\x86\x1e!"\xf8\xc9\x99\xbe\xe94\xbf\xca~K_\xddR\xe6M\x1d\x08\xf4\xb0\xab)+\xde\xfd\xc1\xeaN\x00$\xeb'), chr(0b110101 + 0o57) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1010000 + 0o25))('\x75' + '\x74' + chr(102) + '\055' + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xda \xba\xccZF,\x9dg\xf3\x08\x0e'), chr(100) + chr(101) + '\143' + '\x6f' + chr(1389 - 1289) + chr(0b1100101))(chr(0b1110101) + '\x74' + '\146' + chr(1462 - 1417) + chr(626 - 570)))(LdUoVgsCr5zp(ltvhPP4VhXre), J4aeFOr3sjPo)})
|
awslabs/serverless-application-model
|
examples/apps/lex-make-appointment-python/lambda_function.py
|
dispatch
|
def dispatch(intent_request):
"""
Called when the user specifies an intent for this bot.
"""
logger.debug('dispatch userId={}, intentName={}'.format(intent_request['userId'], intent_request['currentIntent']['name']))
intent_name = intent_request['currentIntent']['name']
# Dispatch to your bot's intent handlers
if intent_name == 'MakeAppointment':
return make_appointment(intent_request)
raise Exception('Intent with name ' + intent_name + ' not supported')
|
python
|
def dispatch(intent_request):
"""
Called when the user specifies an intent for this bot.
"""
logger.debug('dispatch userId={}, intentName={}'.format(intent_request['userId'], intent_request['currentIntent']['name']))
intent_name = intent_request['currentIntent']['name']
# Dispatch to your bot's intent handlers
if intent_name == 'MakeAppointment':
return make_appointment(intent_request)
raise Exception('Intent with name ' + intent_name + ' not supported')
|
[
"def",
"dispatch",
"(",
"intent_request",
")",
":",
"logger",
".",
"debug",
"(",
"'dispatch userId={}, intentName={}'",
".",
"format",
"(",
"intent_request",
"[",
"'userId'",
"]",
",",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'name'",
"]",
")",
")",
"intent_name",
"=",
"intent_request",
"[",
"'currentIntent'",
"]",
"[",
"'name'",
"]",
"# Dispatch to your bot's intent handlers",
"if",
"intent_name",
"==",
"'MakeAppointment'",
":",
"return",
"make_appointment",
"(",
"intent_request",
")",
"raise",
"Exception",
"(",
"'Intent with name '",
"+",
"intent_name",
"+",
"' not supported'",
")"
] |
Called when the user specifies an intent for this bot.
|
[
"Called",
"when",
"the",
"user",
"specifies",
"an",
"intent",
"for",
"this",
"bot",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/lex-make-appointment-python/lambda_function.py#L482-L494
|
train
|
Dispatches the intent request to the appropriate handler.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,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x22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(8805 - 8694) + chr(514 - 461) + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(57 - 6) + '\x35' + '\x35', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + '\x37' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + '\062' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(494 - 446) + '\x6f' + '\061' + chr(904 - 853) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(0b100000 + 0o25), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + chr(0b1011 + 0o54) + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + chr(7809 - 7698) + chr(0b110001) + chr(0b11100 + 0o30) + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + chr(11692 - 11581) + chr(974 - 923) + '\061' + chr(1173 - 1119), 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(3138 - 3027) + chr(0b101000 + 0o12) + chr(0b110001) + chr(872 - 820), 0o10), ehT0Px3KOsy9('\060' + chr(0b1000011 + 0o54) + '\061' + '\x33' + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b0 + 0o63) + '\x31' + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1001111 + 0o40) + '\x33' + chr(0b110100) + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(976 - 927) + chr(0b101001 + 0o14), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101110 + 0o3) + chr(0b1111 + 0o45) + chr(51), 8), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + chr(0b100111 + 0o13) + chr(0b110001) + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\x33' + '\063', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(0b1110 + 0o51) + '\x36', 27247 - 27239), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(54) + chr(0b110111), 26257 - 26249), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\x6f' + chr(0b110011) + chr(2273 - 2225) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(10043 - 9932) + chr(0b1100 + 0o46) + chr(53) + '\x32', 0o10), ehT0Px3KOsy9(chr(1296 - 1248) + chr(0b1111 + 0o140) + '\x31' + chr(2564 - 2511) + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b110001) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + '\x33' + chr(0b110000) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + chr(0b110001) + '\x31' + chr(334 - 283), 346 - 338), ehT0Px3KOsy9('\060' + '\157' + '\x36' + '\060', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(892 - 841) + chr(133 - 85) + chr(0b110001), 9231 - 9223), ehT0Px3KOsy9(chr(2297 - 2249) + chr(0b1001000 + 0o47) + '\x31' + '\067' + chr(0b11100 + 0o24), 20730 - 20722), ehT0Px3KOsy9(chr(860 - 812) + chr(111) + chr(49) + chr(49) + chr(2231 - 2177), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(2031 - 1980) + chr(54) + '\067', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + '\x31' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10 + 0o60) + chr(86 - 35) + chr(0b110100), 50942 - 50934), ehT0Px3KOsy9(chr(1449 - 1401) + '\157' + chr(55) + chr(55), 0o10), ehT0Px3KOsy9(chr(1010 - 962) + '\x6f' + chr(0b11011 + 0o26) + '\x30' + chr(0b0 + 0o60), 0o10), ehT0Px3KOsy9(chr(1992 - 1944) + chr(0b1101111) + chr(0b110110) + chr(1433 - 1381), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(554 - 502) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b11100 + 0o123) + chr(0b110010) + '\064' + chr(0b100010 + 0o20), 0b1000), ehT0Px3KOsy9(chr(1043 - 995) + chr(111) + chr(0b110010) + chr(54) + chr(0b1000 + 0o51), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + chr(828 - 779) + chr(0b100010 + 0o25) + chr(0b101010 + 0o11), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2468 - 2415) + chr(0b101101 + 0o3), 45765 - 45757)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x03'), chr(100) + '\145' + chr(1378 - 1279) + '\157' + chr(100) + chr(0b101111 + 0o66))(chr(117) + '\164' + '\x66' + chr(0b11000 + 0o25) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def UlFo0iP69moK(wVJBdhyINndp):
xafqLlk3kkUe(hdK8qOUhR6Or, xafqLlk3kkUe(SXOLrMavuUCe(b'I\x88\x1cd9'), chr(100) + chr(1956 - 1855) + chr(0b1100011) + chr(111) + '\x64' + chr(0b10000 + 0o125))(chr(0b110111 + 0o76) + chr(116) + chr(102) + chr(0b101101) + chr(0b111000)))(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'I\x84\ra?y\x9f\x0b\xee\xf9.\xae\x96\x84\x07\xb4 \x83\x9b\xe7z\xc4\x19+\xab?~\xa0\x15+\xca\xb4\xe1'), chr(100) + '\x65' + '\x63' + chr(111) + chr(0b1100100) + chr(0b10000 + 0o125))('\x75' + chr(0b1011111 + 0o25) + chr(0b101111 + 0o67) + '\x2d' + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'{\xd9\x0c~\x16l\xafP\x9e\xfc8\xa1'), chr(1811 - 1711) + '\x65' + '\x63' + '\x6f' + '\144' + chr(0b1100101))('\165' + chr(116) + '\x66' + chr(45) + '\x38'))(wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'X\x9e\x1bc\x17i'), '\x64' + '\145' + chr(5453 - 5354) + chr(5957 - 5846) + chr(0b1100100) + chr(3139 - 3038))(chr(0b1110101) + chr(3952 - 3836) + chr(102) + chr(0b101101) + chr(56))], wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'N\x98\x0cc;c\x88*\xa0\xf88\xa5\x90'), chr(0b1100100) + chr(101) + chr(99) + '\x6f' + chr(100) + chr(101))(chr(0b101011 + 0o112) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b100100 + 0o24))][xafqLlk3kkUe(SXOLrMavuUCe(b'C\x8c\x13t'), chr(0b1011100 + 0o10) + '\145' + '\x63' + chr(0b10111 + 0o130) + chr(0b1100100) + chr(101))(chr(9837 - 9720) + chr(116) + chr(0b10110 + 0o120) + chr(45) + chr(1474 - 1418))]))
Vsx90fqDFHAs = wVJBdhyINndp[xafqLlk3kkUe(SXOLrMavuUCe(b'N\x98\x0cc;c\x88*\xa0\xf88\xa5\x90'), chr(7257 - 7157) + '\x65' + chr(0b11110 + 0o105) + chr(0b1101111) + chr(344 - 244) + chr(4831 - 4730))('\165' + '\164' + chr(102) + chr(45) + chr(56))][xafqLlk3kkUe(SXOLrMavuUCe(b'C\x8c\x13t'), chr(0b1101 + 0o127) + chr(101) + chr(6173 - 6074) + chr(111) + '\144' + '\145')(chr(117) + chr(6910 - 6794) + chr(102) + chr(0b101101) + chr(0b100 + 0o64))]
if Vsx90fqDFHAs == xafqLlk3kkUe(SXOLrMavuUCe(b'`\x8c\x15t\x1f}\x8c\x0c\xa7\xe2)\xa6\x81\xa3\x17'), '\144' + '\x65' + chr(6542 - 6443) + chr(111) + '\144' + chr(8247 - 8146))(chr(7237 - 7120) + chr(116) + chr(102) + '\055' + chr(56)):
return yEgqUTCsIN62(wVJBdhyINndp)
raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'd\x83\nt0y\xdc\x14\xa7\xf85\xeb\x8a\xac\x0e\xec{'), chr(1735 - 1635) + chr(0b1010100 + 0o21) + '\143' + '\x6f' + chr(100) + '\145')(chr(12325 - 12208) + '\164' + chr(0b1100110) + chr(327 - 282) + '\x38') + Vsx90fqDFHAs + xafqLlk3kkUe(SXOLrMavuUCe(b'\r\x83\x11e~~\x89\x13\xbe\xe3/\xbf\x81\xa9'), chr(0b1001011 + 0o31) + '\145' + chr(99) + '\157' + chr(7424 - 7324) + '\145')(chr(0b110011 + 0o102) + chr(0b1110100) + chr(10128 - 10026) + chr(0b1010 + 0o43) + chr(0b1001 + 0o57)))
|
awslabs/serverless-application-model
|
examples/apps/microservice-http-endpoint-python3/lambda_function.py
|
lambda_handler
|
def lambda_handler(event, context):
'''Demonstrates a simple HTTP endpoint using API Gateway. You have full
access to the request and response payload, including headers and
status code.
TableName provided by template.yaml.
To scan a DynamoDB table, make a GET request with optional query string parameter.
To put, update, or delete an item, make a POST, PUT, or DELETE request respectively,
passing in the payload to the DynamoDB API as a JSON body.
'''
print("Received event: " + json.dumps(event, indent=2))
operations = {
'DELETE': lambda dynamo, x: dynamo.delete_item(TableName=table_name, **x),
'GET': lambda dynamo, x: dynamo.scan(TableName=table_name, **x) if x else dynamo.scan(TableName=table_name),
'POST': lambda dynamo, x: dynamo.put_item(TableName=table_name, **x),
'PUT': lambda dynamo, x: dynamo.update_item(TableName=table_name, **x),
}
operation = event['httpMethod']
if operation in operations:
payload = event['queryStringParameters'] if operation == 'GET' else json.loads(event['body'])
return respond(None, operations[operation](dynamo, payload))
else:
return respond(ValueError('Unsupported method "{}"'.format(operation)))
|
python
|
def lambda_handler(event, context):
'''Demonstrates a simple HTTP endpoint using API Gateway. You have full
access to the request and response payload, including headers and
status code.
TableName provided by template.yaml.
To scan a DynamoDB table, make a GET request with optional query string parameter.
To put, update, or delete an item, make a POST, PUT, or DELETE request respectively,
passing in the payload to the DynamoDB API as a JSON body.
'''
print("Received event: " + json.dumps(event, indent=2))
operations = {
'DELETE': lambda dynamo, x: dynamo.delete_item(TableName=table_name, **x),
'GET': lambda dynamo, x: dynamo.scan(TableName=table_name, **x) if x else dynamo.scan(TableName=table_name),
'POST': lambda dynamo, x: dynamo.put_item(TableName=table_name, **x),
'PUT': lambda dynamo, x: dynamo.update_item(TableName=table_name, **x),
}
operation = event['httpMethod']
if operation in operations:
payload = event['queryStringParameters'] if operation == 'GET' else json.loads(event['body'])
return respond(None, operations[operation](dynamo, payload))
else:
return respond(ValueError('Unsupported method "{}"'.format(operation)))
|
[
"def",
"lambda_handler",
"(",
"event",
",",
"context",
")",
":",
"print",
"(",
"\"Received event: \"",
"+",
"json",
".",
"dumps",
"(",
"event",
",",
"indent",
"=",
"2",
")",
")",
"operations",
"=",
"{",
"'DELETE'",
":",
"lambda",
"dynamo",
",",
"x",
":",
"dynamo",
".",
"delete_item",
"(",
"TableName",
"=",
"table_name",
",",
"*",
"*",
"x",
")",
",",
"'GET'",
":",
"lambda",
"dynamo",
",",
"x",
":",
"dynamo",
".",
"scan",
"(",
"TableName",
"=",
"table_name",
",",
"*",
"*",
"x",
")",
"if",
"x",
"else",
"dynamo",
".",
"scan",
"(",
"TableName",
"=",
"table_name",
")",
",",
"'POST'",
":",
"lambda",
"dynamo",
",",
"x",
":",
"dynamo",
".",
"put_item",
"(",
"TableName",
"=",
"table_name",
",",
"*",
"*",
"x",
")",
",",
"'PUT'",
":",
"lambda",
"dynamo",
",",
"x",
":",
"dynamo",
".",
"update_item",
"(",
"TableName",
"=",
"table_name",
",",
"*",
"*",
"x",
")",
",",
"}",
"operation",
"=",
"event",
"[",
"'httpMethod'",
"]",
"if",
"operation",
"in",
"operations",
":",
"payload",
"=",
"event",
"[",
"'queryStringParameters'",
"]",
"if",
"operation",
"==",
"'GET'",
"else",
"json",
".",
"loads",
"(",
"event",
"[",
"'body'",
"]",
")",
"return",
"respond",
"(",
"None",
",",
"operations",
"[",
"operation",
"]",
"(",
"dynamo",
",",
"payload",
")",
")",
"else",
":",
"return",
"respond",
"(",
"ValueError",
"(",
"'Unsupported method \"{}\"'",
".",
"format",
"(",
"operation",
")",
")",
")"
] |
Demonstrates a simple HTTP endpoint using API Gateway. You have full
access to the request and response payload, including headers and
status code.
TableName provided by template.yaml.
To scan a DynamoDB table, make a GET request with optional query string parameter.
To put, update, or delete an item, make a POST, PUT, or DELETE request respectively,
passing in the payload to the DynamoDB API as a JSON body.
|
[
"Demonstrates",
"a",
"simple",
"HTTP",
"endpoint",
"using",
"API",
"Gateway",
".",
"You",
"have",
"full",
"access",
"to",
"the",
"request",
"and",
"response",
"payload",
"including",
"headers",
"and",
"status",
"code",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/microservice-http-endpoint-python3/lambda_function.py#L21-L46
|
train
|
This function handles the event and returns a response.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYO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,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(2154 - 2106) + '\x6f' + '\x33' + '\065' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(1072 - 1024) + '\x6f' + chr(50) + chr(49) + chr(261 - 208), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b100 + 0o153) + chr(0b10100 + 0o35) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b110100) + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10100 + 0o35) + '\062' + chr(0b110010 + 0o0), 3984 - 3976), ehT0Px3KOsy9(chr(344 - 296) + '\157' + chr(129 - 80) + chr(0b100000 + 0o25), 41467 - 41459), ehT0Px3KOsy9(chr(936 - 888) + '\157' + chr(0b110001 + 0o5), 31512 - 31504), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(2059 - 2006) + '\063', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(1310 - 1256) + chr(0b1000 + 0o54), 0o10), ehT0Px3KOsy9(chr(277 - 229) + '\x6f' + chr(0b100111 + 0o14) + chr(52) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(1817 - 1769) + chr(0b1101111) + '\x31' + chr(0b110110) + '\x35', 0b1000), ehT0Px3KOsy9(chr(2293 - 2245) + chr(6045 - 5934) + chr(757 - 705) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + '\067' + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(3568 - 3457) + chr(0b110111) + chr(0b111 + 0o60), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110 + 0o53) + '\065' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + '\066' + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(0b101111 + 0o100) + '\063' + '\061' + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(0b110101), 49082 - 49074), ehT0Px3KOsy9('\060' + chr(0b1101111 + 0o0) + chr(0b110010) + '\062' + '\x31', 16464 - 16456), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + chr(0b101100 + 0o7) + chr(50) + chr(0b11110 + 0o27), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b100111 + 0o110) + chr(2216 - 2166) + chr(0b10 + 0o64), 8), ehT0Px3KOsy9('\x30' + chr(1560 - 1449) + chr(0b10010 + 0o44) + chr(0b10010 + 0o42), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b0 + 0o63) + chr(1583 - 1535), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10111 + 0o32) + chr(0b11011 + 0o27) + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + chr(3518 - 3407) + '\x37' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(10319 - 10208) + chr(0b10111 + 0o33) + chr(0b110101) + chr(48), 50819 - 50811), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(8734 - 8623) + '\x32' + chr(1234 - 1186) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(11343 - 11232) + chr(49) + '\x31' + chr(0b1110 + 0o42), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1101111) + chr(0b110001) + chr(0b1111 + 0o46) + chr(50), 8), ehT0Px3KOsy9(chr(2216 - 2168) + '\157' + chr(0b11001 + 0o30) + '\x30' + chr(0b110101), 10279 - 10271), ehT0Px3KOsy9(chr(1233 - 1185) + chr(111) + chr(0b1110 + 0o45) + chr(0b110111 + 0o0) + '\x32', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b111 + 0o57), 8), ehT0Px3KOsy9('\x30' + chr(0b1000 + 0o147) + chr(50) + chr(634 - 580), 8), ehT0Px3KOsy9(chr(0b110000) + chr(3529 - 3418) + '\x32' + chr(0b110100) + chr(48), 0b1000), ehT0Px3KOsy9('\060' + chr(0b10110 + 0o131) + chr(53) + chr(0b11100 + 0o33), ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(296 - 185) + chr(0b11110 + 0o23) + chr(0b110111) + chr(0b10 + 0o63), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + '\062' + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(8448 - 8337) + chr(0b11100 + 0o27) + chr(50) + chr(0b110000 + 0o5), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11011 + 0o27) + '\060' + '\060', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110101) + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc2'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(111) + chr(0b1100011 + 0o1) + '\145')(chr(3044 - 2927) + chr(0b1110100) + '\146' + chr(0b11 + 0o52) + chr(0b11100 + 0o34)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def G1tjmr_C39El(SGm65G84ZKM5, vUUG4_3aIqQC):
zLUzGokYBM2Z(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe\xe8l\x00;{c\x8f\xd4\x86\x03FRKP\x91'), chr(100) + chr(0b1100101) + chr(99) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(0b1011001 + 0o34) + '\164' + chr(0b1100110) + '\x2d' + chr(0b111000)) + xafqLlk3kkUe(fXk443epxtd5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x88\xf8b\x15!'), '\x64' + '\x65' + '\143' + '\x6f' + '\144' + chr(0b1100101))(chr(117) + chr(0b100 + 0o160) + chr(0b1100110) + chr(751 - 706) + chr(0b111000)))(SGm65G84ZKM5, indent=ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + chr(0b11000 + 0o32), ord("\x08"))))
uFRPLetUm3Ph = {xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8\xc8C \x06H'), chr(100) + chr(0b1100101) + '\x63' + '\157' + chr(0b1100000 + 0o4) + chr(0b1100101))(chr(1914 - 1797) + '\164' + chr(102) + chr(1950 - 1905) + '\x38'): lambda mGpyXQHwRli7, OeWW0F1dBPRQ: mGpyXQHwRli7.delete_item(TableName=NKKFbr2Z4sr1, **OeWW0F1dBPRQ), xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\xc8['), '\144' + chr(211 - 110) + '\143' + '\157' + chr(0b1100100) + chr(4361 - 4260))(chr(0b1110101) + '\164' + '\146' + chr(0b11100 + 0o21) + '\x38'): lambda mGpyXQHwRli7, OeWW0F1dBPRQ: mGpyXQHwRli7.scan(TableName=NKKFbr2Z4sr1, **OeWW0F1dBPRQ) if OeWW0F1dBPRQ else mGpyXQHwRli7.scan(TableName=NKKFbr2Z4sr1), xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xc2\\1'), '\x64' + chr(101) + chr(99) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(0b1000110 + 0o57) + '\164' + chr(0b1100110) + chr(45) + '\x38'): lambda mGpyXQHwRli7, OeWW0F1dBPRQ: mGpyXQHwRli7.put_item(TableName=NKKFbr2Z4sr1, **OeWW0F1dBPRQ), xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xd8['), chr(0b110100 + 0o60) + chr(0b1100101) + '\143' + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b111000 + 0o75) + chr(116) + chr(102) + chr(1984 - 1939) + '\x38'): lambda mGpyXQHwRli7, OeWW0F1dBPRQ: mGpyXQHwRli7.update_item(TableName=NKKFbr2Z4sr1, **OeWW0F1dBPRQ)}
OhZfTtIXfIah = SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x84\xf9{\x15\x1fhr\x83\x9b\x87'), chr(7995 - 7895) + chr(1097 - 996) + chr(0b1100011) + chr(0b1101001 + 0o6) + chr(2509 - 2409) + chr(0b110110 + 0o57))(chr(0b10101 + 0o140) + '\x74' + chr(0b1100110) + chr(45) + chr(1712 - 1656))]
if OhZfTtIXfIah in uFRPLetUm3Ph:
nOhAvpnA71Xj = SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\xf8j\x17+^r\x99\x9d\x8d\x12s]M\x0b\xdc\xa9bx\xe3\xa6'), chr(100) + '\x65' + chr(99) + chr(0b1101111) + '\x64' + chr(0b1100101))('\165' + '\x74' + chr(0b1100110) + chr(1796 - 1751) + '\x38')] if OhZfTtIXfIah == xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\xc8['), chr(0b1100100) + chr(0b1000100 + 0o41) + chr(0b1100011) + chr(111) + chr(0b1001111 + 0o25) + '\x65')(chr(0b101000 + 0o115) + chr(11399 - 11283) + chr(0b1100110) + '\x2d' + chr(2632 - 2576)) else fXk443epxtd5.loads(SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e\xe2k\x1c'), chr(0b111100 + 0o50) + chr(5078 - 4977) + '\143' + chr(0b111010 + 0o65) + chr(9127 - 9027) + chr(101))(chr(0b110001 + 0o104) + chr(0b11111 + 0o125) + chr(0b1100110) + chr(0b110 + 0o47) + chr(56))])
return S3BuO8NGW9Ar(None, uFRPLetUm3Ph[OhZfTtIXfIah](mGpyXQHwRli7, nOhAvpnA71Xj))
else:
return S3BuO8NGW9Ar(q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9\xe3|\x10"}i\x99\x80\x86\x11\x03QZ\x1e\xd9\xa3r=\xb3\xaek\x16'), '\x64' + chr(7439 - 7338) + chr(0b1100011) + chr(11784 - 11673) + chr(0b11000 + 0o114) + chr(0b111000 + 0o55))('\x75' + '\164' + '\146' + chr(216 - 171) + chr(0b100010 + 0o26)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xba\xb9}\n\x1alU\xd8\xa4\x93\x10I'), chr(100) + chr(101) + '\143' + chr(0b1101111) + chr(100) + '\x65')('\x75' + chr(0b1000101 + 0o57) + chr(0b1100110) + '\055' + chr(0b111000)))(OhZfTtIXfIah)))
|
awslabs/serverless-application-model
|
examples/apps/microservice-http-endpoint-python/lambda_function.py
|
lambda_handler
|
def lambda_handler(event, context):
'''Demonstrates a simple HTTP endpoint using API Gateway. You have full
access to the request and response payload, including headers and
status code.
To scan a DynamoDB table, make a GET request with the TableName as a
query string parameter. To put, update, or delete an item, make a POST,
PUT, or DELETE request respectively, passing in the payload to the
DynamoDB API as a JSON body.
'''
#print("Received event: " + json.dumps(event, indent=2))
operations = {
'DELETE': lambda dynamo, x: dynamo.delete_item(**x),
'GET': lambda dynamo, x: dynamo.scan(**x),
'POST': lambda dynamo, x: dynamo.put_item(**x),
'PUT': lambda dynamo, x: dynamo.update_item(**x),
}
operation = event['httpMethod']
if operation in operations:
payload = event['queryStringParameters'] if operation == 'GET' else json.loads(event['body'])
return respond(None, operations[operation](dynamo, payload))
else:
return respond(ValueError('Unsupported method "{}"'.format(operation)))
|
python
|
def lambda_handler(event, context):
'''Demonstrates a simple HTTP endpoint using API Gateway. You have full
access to the request and response payload, including headers and
status code.
To scan a DynamoDB table, make a GET request with the TableName as a
query string parameter. To put, update, or delete an item, make a POST,
PUT, or DELETE request respectively, passing in the payload to the
DynamoDB API as a JSON body.
'''
#print("Received event: " + json.dumps(event, indent=2))
operations = {
'DELETE': lambda dynamo, x: dynamo.delete_item(**x),
'GET': lambda dynamo, x: dynamo.scan(**x),
'POST': lambda dynamo, x: dynamo.put_item(**x),
'PUT': lambda dynamo, x: dynamo.update_item(**x),
}
operation = event['httpMethod']
if operation in operations:
payload = event['queryStringParameters'] if operation == 'GET' else json.loads(event['body'])
return respond(None, operations[operation](dynamo, payload))
else:
return respond(ValueError('Unsupported method "{}"'.format(operation)))
|
[
"def",
"lambda_handler",
"(",
"event",
",",
"context",
")",
":",
"#print(\"Received event: \" + json.dumps(event, indent=2))",
"operations",
"=",
"{",
"'DELETE'",
":",
"lambda",
"dynamo",
",",
"x",
":",
"dynamo",
".",
"delete_item",
"(",
"*",
"*",
"x",
")",
",",
"'GET'",
":",
"lambda",
"dynamo",
",",
"x",
":",
"dynamo",
".",
"scan",
"(",
"*",
"*",
"x",
")",
",",
"'POST'",
":",
"lambda",
"dynamo",
",",
"x",
":",
"dynamo",
".",
"put_item",
"(",
"*",
"*",
"x",
")",
",",
"'PUT'",
":",
"lambda",
"dynamo",
",",
"x",
":",
"dynamo",
".",
"update_item",
"(",
"*",
"*",
"x",
")",
",",
"}",
"operation",
"=",
"event",
"[",
"'httpMethod'",
"]",
"if",
"operation",
"in",
"operations",
":",
"payload",
"=",
"event",
"[",
"'queryStringParameters'",
"]",
"if",
"operation",
"==",
"'GET'",
"else",
"json",
".",
"loads",
"(",
"event",
"[",
"'body'",
"]",
")",
"return",
"respond",
"(",
"None",
",",
"operations",
"[",
"operation",
"]",
"(",
"dynamo",
",",
"payload",
")",
")",
"else",
":",
"return",
"respond",
"(",
"ValueError",
"(",
"'Unsupported method \"{}\"'",
".",
"format",
"(",
"operation",
")",
")",
")"
] |
Demonstrates a simple HTTP endpoint using API Gateway. You have full
access to the request and response payload, including headers and
status code.
To scan a DynamoDB table, make a GET request with the TableName as a
query string parameter. To put, update, or delete an item, make a POST,
PUT, or DELETE request respectively, passing in the payload to the
DynamoDB API as a JSON body.
|
[
"Demonstrates",
"a",
"simple",
"HTTP",
"endpoint",
"using",
"API",
"Gateway",
".",
"You",
"have",
"full",
"access",
"to",
"the",
"request",
"and",
"response",
"payload",
"including",
"headers",
"and",
"status",
"code",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/microservice-http-endpoint-python/lambda_function.py#L20-L44
|
train
|
This function handles the event and returns a response.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwE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ipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + chr(0b1101 + 0o46) + chr(55) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010111 + 0o30) + chr(51) + chr(0b11111 + 0o30) + chr(52), 16097 - 16089), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(2094 - 2042) + chr(538 - 490), 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + chr(0b110111) + chr(0b100010 + 0o24), 11918 - 11910), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10110 + 0o35), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(182 - 132) + '\062' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1010010 + 0o35) + chr(0b110010) + chr(55) + chr(0b1110 + 0o46), 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1010011 + 0o34) + chr(0b110011) + '\x37' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b111111 + 0o60) + chr(0b110001) + chr(0b110101) + chr(1965 - 1916), 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101000 + 0o7) + chr(1728 - 1677) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1100 + 0o143) + chr(0b10010 + 0o37) + '\x33' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11724 - 11613) + chr(0b110010) + chr(0b110111), 38426 - 38418), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b111 + 0o53) + chr(0b11011 + 0o32), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\063' + chr(0b1 + 0o66), 29966 - 29958), ehT0Px3KOsy9('\060' + '\x6f' + chr(2117 - 2066) + chr(0b101101 + 0o5) + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(1282 - 1234) + chr(1555 - 1504), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b110001 + 0o4) + chr(0b110001 + 0o5), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(0b10 + 0o63), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(2499 - 2448) + '\x31' + '\060', 63182 - 63174), ehT0Px3KOsy9('\x30' + chr(1477 - 1366) + chr(0b110001) + chr(0b110010) + chr(1053 - 1004), 31601 - 31593), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + '\x35' + chr(0b1 + 0o66), 56583 - 56575), ehT0Px3KOsy9('\x30' + '\157' + '\063' + '\x35' + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(53) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + '\x36' + '\063', 0o10), ehT0Px3KOsy9(chr(1736 - 1688) + chr(0b1010101 + 0o32) + chr(50) + chr(55) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(968 - 920) + '\x6f' + chr(0b1110 + 0o45) + chr(0b110110) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(2251 - 2203) + chr(0b1101111) + '\061' + '\x37' + chr(50), 42581 - 42573), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(0b110111) + chr(663 - 610), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + '\x32' + chr(2653 - 2601) + '\x30', 0o10), ehT0Px3KOsy9(chr(978 - 930) + chr(0b1101111) + chr(0b110011) + chr(54) + '\x32', 8), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + chr(425 - 376) + '\066', 11011 - 11003), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b110001) + chr(49), 4291 - 4283), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(55) + chr(1954 - 1899), 212 - 204), ehT0Px3KOsy9(chr(1165 - 1117) + '\x6f' + '\061' + chr(0b110101) + chr(0b110001), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(572 - 521) + chr(0b10100 + 0o41) + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(53) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5989 - 5878) + '\x31' + chr(2868 - 2813) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(10696 - 10585) + '\x32' + '\062' + chr(67 - 13), 0o10), ehT0Px3KOsy9('\060' + chr(671 - 560) + chr(0b110101) + '\x35', 39136 - 39128)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + '\x35' + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3'), chr(7949 - 7849) + '\145' + chr(430 - 331) + chr(0b1101111) + '\x64' + chr(0b1001001 + 0o34))(chr(4092 - 3975) + '\x74' + chr(0b1100110) + chr(96 - 51) + chr(0b1001 + 0o57)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def G1tjmr_C39El(SGm65G84ZKM5, vUUG4_3aIqQC):
uFRPLetUm3Ph = {xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9\xb9HejF'), chr(0b1100100) + '\145' + '\143' + chr(111) + chr(0b101010 + 0o72) + chr(0b1000010 + 0o43))(chr(117) + chr(0b111000 + 0o74) + chr(102) + chr(45) + chr(0b0 + 0o70)): lambda mGpyXQHwRli7, OeWW0F1dBPRQ: mGpyXQHwRli7.delete_item(**OeWW0F1dBPRQ), xafqLlk3kkUe(SXOLrMavuUCe(b'\xba\xb9P'), chr(100) + chr(101) + '\x63' + '\157' + chr(100) + chr(101))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(45) + chr(0b111000)): lambda mGpyXQHwRli7, OeWW0F1dBPRQ: mGpyXQHwRli7.scan(**OeWW0F1dBPRQ), xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xb3Wt'), chr(3904 - 3804) + chr(101) + chr(99) + '\157' + '\x64' + chr(101))(chr(117) + '\x74' + chr(937 - 835) + '\055' + chr(0b111000)): lambda mGpyXQHwRli7, OeWW0F1dBPRQ: mGpyXQHwRli7.put_item(**OeWW0F1dBPRQ), xafqLlk3kkUe(SXOLrMavuUCe(b'\xad\xa9P'), chr(0b1100100) + '\x65' + chr(99) + chr(111) + chr(3440 - 3340) + chr(0b1100101))('\x75' + '\164' + '\x66' + '\055' + '\070'): lambda mGpyXQHwRli7, OeWW0F1dBPRQ: mGpyXQHwRli7.update_item(**OeWW0F1dBPRQ)}
OhZfTtIXfIah = SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x95\x88pPsf\xe4\xd4\x95\r'), chr(0b110101 + 0o57) + '\145' + '\x63' + chr(111) + chr(0b1100011 + 0o1) + '\145')(chr(0b1001011 + 0o52) + chr(0b1000010 + 0o62) + chr(1799 - 1697) + chr(0b101100 + 0o1) + chr(111 - 55))]
if OhZfTtIXfIah in uFRPLetUm3Ph:
nOhAvpnA71Xj = SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c\x89aRGP\xe4\xce\x93\x07x\rvg\xfe\xbf\xe6\xdah\xba"'), chr(0b1011 + 0o131) + chr(101) + '\143' + chr(0b1101111) + chr(0b111110 + 0o46) + chr(0b1100001 + 0o4))(chr(117) + '\x74' + '\146' + chr(45) + chr(0b10001 + 0o47))] if OhZfTtIXfIah == xafqLlk3kkUe(SXOLrMavuUCe(b'\xba\xb9P'), '\x64' + '\x65' + '\x63' + '\157' + chr(0b1100100) + chr(8165 - 8064))(chr(8895 - 8778) + chr(9638 - 9522) + '\146' + '\x2d' + chr(2263 - 2207)) else fXk443epxtd5.loads(SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\x93`Y'), chr(8530 - 8430) + chr(2486 - 2385) + chr(0b1100000 + 0o3) + chr(0b110 + 0o151) + chr(0b1100100) + '\x65')(chr(0b1101010 + 0o13) + '\x74' + chr(102) + '\055' + chr(526 - 470))])
return S3BuO8NGW9Ar(None, uFRPLetUm3Ph[OhZfTtIXfIah](mGpyXQHwRli7, nOhAvpnA71Xj))
else:
return S3BuO8NGW9Ar(q1QCh3W88sgk(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8\x92wUNs\xff\xce\x8e\x0c{}zp\xeb\xba\xec\xca-\xea*\x12\xce'), chr(0b1100100) + chr(5626 - 5525) + chr(0b1100011) + '\157' + chr(100) + chr(101))(chr(117) + chr(0b1110100) + '\x66' + chr(0b10000 + 0o35) + chr(141 - 85)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\xc8vOvb\xc3\x8f\xaa\x19z7'), '\x64' + '\145' + chr(0b110100 + 0o57) + chr(6779 - 6668) + '\144' + '\x65')(chr(117) + chr(0b100 + 0o160) + chr(0b1100110) + '\055' + chr(1371 - 1315)))(OhZfTtIXfIah)))
|
awslabs/serverless-application-model
|
samtranslator/model/intrinsics.py
|
make_combined_condition
|
def make_combined_condition(conditions_list, condition_name):
"""
Makes a combined condition using Fn::Or. Since Fn::Or only accepts up to 10 conditions,
this method optionally creates multiple conditions. These conditions are named based on
the condition_name parameter that is passed into the method.
:param list conditions_list: list of conditions
:param string condition_name: base name desired for new condition
:return: dictionary of condition_name: condition_value
"""
if len(conditions_list) < 2:
# Can't make a condition if <2 conditions provided.
return None
# Total number of conditions allows in an Fn::Or statement. See docs:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html#intrinsic-function-reference-conditions-or
max_conditions = 10
conditions = {}
conditions_length = len(conditions_list)
# Get number of conditions needed, then minus one to use them as 0-based indices
zero_based_num_conditions = calculate_number_of_conditions(conditions_length, max_conditions) - 1
while len(conditions_list) > 1:
new_condition_name = condition_name
# If more than 1 new condition is needed, add a number to the end of the name
if zero_based_num_conditions > 0:
new_condition_name = '{}{}'.format(condition_name, zero_based_num_conditions)
zero_based_num_conditions -= 1
new_condition_content = make_or_condition(conditions_list[:max_conditions])
conditions_list = conditions_list[max_conditions:]
conditions_list.append(new_condition_name)
conditions[new_condition_name] = new_condition_content
return conditions
|
python
|
def make_combined_condition(conditions_list, condition_name):
"""
Makes a combined condition using Fn::Or. Since Fn::Or only accepts up to 10 conditions,
this method optionally creates multiple conditions. These conditions are named based on
the condition_name parameter that is passed into the method.
:param list conditions_list: list of conditions
:param string condition_name: base name desired for new condition
:return: dictionary of condition_name: condition_value
"""
if len(conditions_list) < 2:
# Can't make a condition if <2 conditions provided.
return None
# Total number of conditions allows in an Fn::Or statement. See docs:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html#intrinsic-function-reference-conditions-or
max_conditions = 10
conditions = {}
conditions_length = len(conditions_list)
# Get number of conditions needed, then minus one to use them as 0-based indices
zero_based_num_conditions = calculate_number_of_conditions(conditions_length, max_conditions) - 1
while len(conditions_list) > 1:
new_condition_name = condition_name
# If more than 1 new condition is needed, add a number to the end of the name
if zero_based_num_conditions > 0:
new_condition_name = '{}{}'.format(condition_name, zero_based_num_conditions)
zero_based_num_conditions -= 1
new_condition_content = make_or_condition(conditions_list[:max_conditions])
conditions_list = conditions_list[max_conditions:]
conditions_list.append(new_condition_name)
conditions[new_condition_name] = new_condition_content
return conditions
|
[
"def",
"make_combined_condition",
"(",
"conditions_list",
",",
"condition_name",
")",
":",
"if",
"len",
"(",
"conditions_list",
")",
"<",
"2",
":",
"# Can't make a condition if <2 conditions provided.",
"return",
"None",
"# Total number of conditions allows in an Fn::Or statement. See docs:",
"# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-conditions.html#intrinsic-function-reference-conditions-or",
"max_conditions",
"=",
"10",
"conditions",
"=",
"{",
"}",
"conditions_length",
"=",
"len",
"(",
"conditions_list",
")",
"# Get number of conditions needed, then minus one to use them as 0-based indices",
"zero_based_num_conditions",
"=",
"calculate_number_of_conditions",
"(",
"conditions_length",
",",
"max_conditions",
")",
"-",
"1",
"while",
"len",
"(",
"conditions_list",
")",
">",
"1",
":",
"new_condition_name",
"=",
"condition_name",
"# If more than 1 new condition is needed, add a number to the end of the name",
"if",
"zero_based_num_conditions",
">",
"0",
":",
"new_condition_name",
"=",
"'{}{}'",
".",
"format",
"(",
"condition_name",
",",
"zero_based_num_conditions",
")",
"zero_based_num_conditions",
"-=",
"1",
"new_condition_content",
"=",
"make_or_condition",
"(",
"conditions_list",
"[",
":",
"max_conditions",
"]",
")",
"conditions_list",
"=",
"conditions_list",
"[",
"max_conditions",
":",
"]",
"conditions_list",
".",
"append",
"(",
"new_condition_name",
")",
"conditions",
"[",
"new_condition_name",
"]",
"=",
"new_condition_content",
"return",
"conditions"
] |
Makes a combined condition using Fn::Or. Since Fn::Or only accepts up to 10 conditions,
this method optionally creates multiple conditions. These conditions are named based on
the condition_name parameter that is passed into the method.
:param list conditions_list: list of conditions
:param string condition_name: base name desired for new condition
:return: dictionary of condition_name: condition_value
|
[
"Makes",
"a",
"combined",
"condition",
"using",
"Fn",
"::",
"Or",
".",
"Since",
"Fn",
"::",
"Or",
"only",
"accepts",
"up",
"to",
"10",
"conditions",
"this",
"method",
"optionally",
"creates",
"multiple",
"conditions",
".",
"These",
"conditions",
"are",
"named",
"based",
"on",
"the",
"condition_name",
"parameter",
"that",
"is",
"passed",
"into",
"the",
"method",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/intrinsics.py#L66-L99
|
train
|
Makes a combined condition using Fn :: Or.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7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AZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111 + 0o0) + chr(0b110011) + '\062' + '\063', 14637 - 14629), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(781 - 727) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(111) + '\x31' + chr(0b110011) + chr(0b10001 + 0o42), 0o10), ehT0Px3KOsy9(chr(430 - 382) + '\x6f' + '\x31' + chr(0b110010 + 0o4) + chr(0b100100 + 0o21), 0b1000), ehT0Px3KOsy9(chr(1980 - 1932) + '\x6f' + chr(1888 - 1838) + '\060' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1011 + 0o46) + chr(53) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1110 + 0o141) + chr(100 - 51) + '\x32' + chr(0b10100 + 0o37), 0b1000), ehT0Px3KOsy9(chr(1629 - 1581) + chr(2169 - 2058) + '\x33' + '\063', 0b1000), ehT0Px3KOsy9(chr(682 - 634) + chr(0b100010 + 0o115) + '\062' + '\062' + chr(2601 - 2546), 0o10), ehT0Px3KOsy9('\x30' + chr(0b101011 + 0o104) + '\066' + chr(0b11101 + 0o31), 62129 - 62121), ehT0Px3KOsy9('\060' + chr(10650 - 10539) + chr(49) + '\x33' + '\065', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(0b110011) + '\x36', 2327 - 2319), ehT0Px3KOsy9('\x30' + chr(0b100101 + 0o112) + chr(0b110010) + '\065' + chr(0b10110 + 0o32), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010111 + 0o30) + '\x33' + chr(2533 - 2481) + '\x36', 0o10), ehT0Px3KOsy9(chr(1146 - 1098) + chr(0b101111 + 0o100) + chr(1241 - 1188) + chr(1776 - 1722), 8046 - 8038), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(151 - 102) + chr(0b10101 + 0o37), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5756 - 5645) + chr(0b110011) + chr(823 - 772) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1010010 + 0o35) + '\067' + chr(0b101110 + 0o10), 0b1000), ehT0Px3KOsy9('\060' + chr(7525 - 7414) + '\x32' + '\x31' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(111) + '\062' + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(354 - 305) + '\x36' + chr(0b10 + 0o57), 0b1000), ehT0Px3KOsy9(chr(292 - 244) + chr(0b1101111) + '\061' + chr(54) + '\061', 8), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b111 + 0o150) + chr(610 - 560) + chr(632 - 577) + chr(84 - 34), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + '\065' + chr(53), 0b1000), ehT0Px3KOsy9('\060' + chr(0b101110 + 0o101) + '\x34' + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(12112 - 12001) + chr(49) + '\x35' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + '\067' + '\x37', 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(111) + chr(50) + chr(50) + chr(0b110011), 20529 - 20521), ehT0Px3KOsy9('\060' + chr(1744 - 1633) + chr(0b1100 + 0o50) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1 + 0o156) + chr(49) + '\064' + chr(716 - 664), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062', 26749 - 26741), ehT0Px3KOsy9(chr(1222 - 1174) + '\x6f' + chr(50) + chr(0b110111) + chr(0b110010), 8), ehT0Px3KOsy9(chr(608 - 560) + chr(111) + chr(0b11000 + 0o37) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100110 + 0o111) + chr(0b1111 + 0o44) + chr(0b110001) + chr(0b1101 + 0o46), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1018 - 968) + '\063' + '\067', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100101 + 0o20) + chr(1412 - 1364), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(370 - 320) + chr(48) + '\060', 0o10), ehT0Px3KOsy9('\060' + chr(6462 - 6351) + chr(807 - 757) + chr(352 - 302) + chr(0b110100 + 0o0), 0o10), ehT0Px3KOsy9('\060' + chr(264 - 153) + chr(49) + chr(2387 - 2333) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + '\x32' + chr(52) + chr(0b1110 + 0o50), 52736 - 52728)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(5164 - 5053) + '\065' + '\060', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xfd'), chr(100) + chr(0b101011 + 0o72) + '\143' + chr(0b10100 + 0o133) + '\144' + '\x65')(chr(0b110011 + 0o102) + chr(0b1101001 + 0o13) + chr(0b1111 + 0o127) + '\x2d' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def gXpKBRJ8xT4P(o7QR2vU9JiFx, LatlulWW6yXk):
if c2A0yzQpDQB3(o7QR2vU9JiFx) < ehT0Px3KOsy9('\x30' + '\x6f' + chr(2029 - 1979), 8):
return None
w5QaKJgDsUYb = ehT0Px3KOsy9(chr(1759 - 1711) + chr(11058 - 10947) + '\061' + chr(0b1010 + 0o50), 93 - 85)
XtWBMBpK8Slj = {}
BcVvHsC2_EFJ = c2A0yzQpDQB3(o7QR2vU9JiFx)
clLpC9vH2BBz = czPqYE_qNkta(BcVvHsC2_EFJ, w5QaKJgDsUYb) - ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061', 27510 - 27502)
while c2A0yzQpDQB3(o7QR2vU9JiFx) > ehT0Px3KOsy9('\x30' + '\x6f' + '\x31', 8):
B7965wV3uP7Q = LatlulWW6yXk
if clLpC9vH2BBz > ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + chr(651 - 603), ord("\x08")):
B7965wV3uP7Q = xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8\n \x08'), chr(100) + '\145' + '\143' + chr(0b100010 + 0o115) + chr(0b1100100) + '\x65')(chr(4153 - 4036) + chr(116) + '\x66' + chr(0b11010 + 0o23) + chr(56)).V4roHaS3Ppej(LatlulWW6yXk, clLpC9vH2BBz)
clLpC9vH2BBz -= ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49), 8)
ykinSBknKs4D = rvIoy8wZj76R(o7QR2vU9JiFx[:w5QaKJgDsUYb])
o7QR2vU9JiFx = o7QR2vU9JiFx[w5QaKJgDsUYb:]
xafqLlk3kkUe(o7QR2vU9JiFx, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2\x07+\x10\xea\x0f'), chr(100) + chr(5251 - 5150) + chr(0b1 + 0o142) + chr(111) + '\x64' + chr(0b100100 + 0o101))('\x75' + '\x74' + chr(0b1100110) + chr(574 - 529) + chr(56)))(B7965wV3uP7Q)
XtWBMBpK8Slj[B7965wV3uP7Q] = ykinSBknKs4D
return XtWBMBpK8Slj
|
awslabs/serverless-application-model
|
samtranslator/model/intrinsics.py
|
is_instrinsic
|
def is_instrinsic(input):
"""
Checks if the given input is an intrinsic function dictionary. Intrinsic function is a dictionary with single
key that is the name of the intrinsics.
:param input: Input value to check if it is an intrinsic
:return: True, if yes
"""
if input is not None \
and isinstance(input, dict) \
and len(input) == 1:
key = list(input.keys())[0]
return key == "Ref" or key == "Condition" or key.startswith("Fn::")
return False
|
python
|
def is_instrinsic(input):
"""
Checks if the given input is an intrinsic function dictionary. Intrinsic function is a dictionary with single
key that is the name of the intrinsics.
:param input: Input value to check if it is an intrinsic
:return: True, if yes
"""
if input is not None \
and isinstance(input, dict) \
and len(input) == 1:
key = list(input.keys())[0]
return key == "Ref" or key == "Condition" or key.startswith("Fn::")
return False
|
[
"def",
"is_instrinsic",
"(",
"input",
")",
":",
"if",
"input",
"is",
"not",
"None",
"and",
"isinstance",
"(",
"input",
",",
"dict",
")",
"and",
"len",
"(",
"input",
")",
"==",
"1",
":",
"key",
"=",
"list",
"(",
"input",
".",
"keys",
"(",
")",
")",
"[",
"0",
"]",
"return",
"key",
"==",
"\"Ref\"",
"or",
"key",
"==",
"\"Condition\"",
"or",
"key",
".",
"startswith",
"(",
"\"Fn::\"",
")",
"return",
"False"
] |
Checks if the given input is an intrinsic function dictionary. Intrinsic function is a dictionary with single
key that is the name of the intrinsics.
:param input: Input value to check if it is an intrinsic
:return: True, if yes
|
[
"Checks",
"if",
"the",
"given",
"input",
"is",
"an",
"intrinsic",
"function",
"dictionary",
".",
"Intrinsic",
"function",
"is",
"a",
"dictionary",
"with",
"single",
"key",
"that",
"is",
"the",
"name",
"of",
"the",
"intrinsics",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/intrinsics.py#L124-L140
|
train
|
Checks if the given input is an intrinsic function dictionary.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf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,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1924 - 1876) + '\157' + chr(0b10011 + 0o36) + '\x32' + chr(0b101 + 0o57), 0o10), ehT0Px3KOsy9(chr(1119 - 1071) + chr(111) + '\063' + '\060', 11112 - 11104), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2143 - 2094) + chr(0b101010 + 0o11) + chr(2803 - 2749), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(416 - 365) + chr(0b11000 + 0o33) + chr(0b11101 + 0o25), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + chr(50) + '\061' + chr(0b10011 + 0o40), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1000011 + 0o54) + chr(0b110010) + chr(0b11101 + 0o25), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(0b110010) + chr(0b1100 + 0o47), 61698 - 61690), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b10101 + 0o132) + chr(50) + '\065' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(1700 - 1651), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(0b100101 + 0o16) + chr(1899 - 1846), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b101101 + 0o102) + '\x33' + chr(0b110100) + chr(0b0 + 0o62), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + '\x33' + chr(543 - 491) + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + chr(11274 - 11163) + chr(1423 - 1374) + chr(52) + chr(1426 - 1377), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(1703 - 1654) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101101 + 0o6) + chr(48) + chr(0b101111 + 0o4), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(0b11000 + 0o32) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001001 + 0o46) + '\x31' + '\x32' + chr(1653 - 1598), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(738 - 688) + chr(220 - 169) + chr(0b1000 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(1491 - 1443) + '\157' + chr(2723 - 2669) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(513 - 465) + chr(0b1101111) + '\062' + '\064' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001000 + 0o47) + '\063' + chr(53) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(0b110001) + '\061' + chr(50), 0b1000), ehT0Px3KOsy9(chr(1380 - 1332) + chr(12108 - 11997) + chr(0b1100 + 0o53) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\x6f' + '\063' + chr(52) + chr(983 - 932), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2311 - 2262) + '\066' + chr(0b110110), 65060 - 65052), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(4842 - 4731) + '\063' + '\061' + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(50) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(1150 - 1096) + '\064', 10566 - 10558), ehT0Px3KOsy9('\060' + chr(0b101100 + 0o103) + chr(0b101001 + 0o12) + '\066' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b111 + 0o150) + chr(0b101111 + 0o2) + chr(0b110010) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(508 - 460) + '\157' + '\062' + chr(1208 - 1155) + chr(0b101011 + 0o12), 15008 - 15000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10110 + 0o33) + chr(51) + chr(0b101011 + 0o13), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(1863 - 1813) + '\066', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(684 - 634) + chr(3013 - 2958) + chr(48), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + '\060' + chr(0b110100), 8237 - 8229), ehT0Px3KOsy9(chr(0b110000) + chr(0b11010 + 0o125) + '\063' + '\x36' + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + '\062' + chr(0b10111 + 0o33), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b11001 + 0o126) + '\062' + '\x36' + chr(0b110010), 35532 - 35524), ehT0Px3KOsy9('\x30' + chr(0b11101 + 0o122) + '\061' + '\x35' + '\x33', 36812 - 36804)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b110111 + 0o70) + '\065' + chr(790 - 742), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'z'), chr(0b1100100) + chr(7024 - 6923) + '\x63' + chr(0b1000100 + 0o53) + chr(9834 - 9734) + chr(0b1100101))(chr(117) + chr(0b100100 + 0o120) + '\x66' + '\x2d' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def cZ3QUDmab4zH(Y3jVKaC8LEDU):
if Y3jVKaC8LEDU is not None and PlSM16l2KDPD(Y3jVKaC8LEDU, wLqBDw8l0eIm) and (c2A0yzQpDQB3(Y3jVKaC8LEDU) == ehT0Px3KOsy9(chr(352 - 304) + '\157' + chr(0b10100 + 0o35), 0b1000)):
K3J4ZwSlE0sT = YyaZ4tpXu4lf(Y3jVKaC8LEDU.keys())[ehT0Px3KOsy9(chr(48) + '\157' + '\060', 8)]
return K3J4ZwSlE0sT == xafqLlk3kkUe(SXOLrMavuUCe(b'\x06}8'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(111) + chr(0b1001 + 0o133) + '\x65')('\x75' + '\164' + chr(0b1011011 + 0o13) + '\x2d' + '\070') or K3J4ZwSlE0sT == xafqLlk3kkUe(SXOLrMavuUCe(b'\x17w0\xbe\xe2f:\xc1g'), chr(0b110 + 0o136) + chr(0b1011 + 0o132) + '\x63' + chr(0b1101111) + '\x64' + '\x65')('\x75' + chr(116) + '\x66' + '\055' + '\070') or xafqLlk3kkUe(K3J4ZwSlE0sT, xafqLlk3kkUe(SXOLrMavuUCe(b"'l?\xa8\xffa$\xc7}\xf5"), '\x64' + chr(3998 - 3897) + chr(99) + chr(0b1101100 + 0o3) + '\144' + chr(6335 - 6234))(chr(117) + chr(0b1000011 + 0o61) + chr(102) + '\x2d' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x12vd\xe0'), chr(100) + chr(0b1100101 + 0o0) + '\143' + chr(9417 - 9306) + chr(0b1100000 + 0o4) + chr(0b1100100 + 0o1))(chr(0b1110101) + '\x74' + chr(0b1110 + 0o130) + chr(0b101001 + 0o4) + chr(2833 - 2777)))
return ehT0Px3KOsy9('\x30' + chr(2123 - 2012) + '\x30', 8)
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
Action.can_handle
|
def can_handle(self, input_dict):
"""
Validates that the input dictionary contains only one key and is of the given intrinsic_name
:param input_dict: Input dictionary representing the intrinsic function
:return: True if it matches expected structure, False otherwise
"""
return input_dict is not None \
and isinstance(input_dict, dict) \
and len(input_dict) == 1 \
and self.intrinsic_name in input_dict
|
python
|
def can_handle(self, input_dict):
"""
Validates that the input dictionary contains only one key and is of the given intrinsic_name
:param input_dict: Input dictionary representing the intrinsic function
:return: True if it matches expected structure, False otherwise
"""
return input_dict is not None \
and isinstance(input_dict, dict) \
and len(input_dict) == 1 \
and self.intrinsic_name in input_dict
|
[
"def",
"can_handle",
"(",
"self",
",",
"input_dict",
")",
":",
"return",
"input_dict",
"is",
"not",
"None",
"and",
"isinstance",
"(",
"input_dict",
",",
"dict",
")",
"and",
"len",
"(",
"input_dict",
")",
"==",
"1",
"and",
"self",
".",
"intrinsic_name",
"in",
"input_dict"
] |
Validates that the input dictionary contains only one key and is of the given intrinsic_name
:param input_dict: Input dictionary representing the intrinsic function
:return: True if it matches expected structure, False otherwise
|
[
"Validates",
"that",
"the",
"input",
"dictionary",
"contains",
"only",
"one",
"key",
"and",
"is",
"of",
"the",
"given",
"intrinsic_name"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L41-L52
|
train
|
Validates that the input dictionary contains only one key and is of the given intrinsic_name
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,V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YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b100 + 0o153) + chr(554 - 503) + chr(50) + chr(588 - 533), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x36' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(6285 - 6174) + chr(0b110001) + '\x36' + chr(53), 0b1000), ehT0Px3KOsy9('\060' + chr(5624 - 5513) + chr(0b1111 + 0o43) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(3171 - 3060) + chr(0b100 + 0o55) + chr(53) + chr(50), 48381 - 48373), ehT0Px3KOsy9('\060' + chr(0b110100 + 0o73) + chr(50) + '\062' + chr(0b11111 + 0o27), 0b1000), ehT0Px3KOsy9(chr(218 - 170) + chr(2878 - 2767) + chr(50) + chr(0b100110 + 0o13) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\x6f' + chr(0b110010) + '\x30' + chr(499 - 448), 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\157' + chr(49) + chr(0b110010) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + '\x33' + chr(932 - 881) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\x37' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001101 + 0o42) + chr(0b110011 + 0o0) + chr(0b110110 + 0o1), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(2045 - 1996) + '\066' + '\061', 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(0b100010 + 0o17) + chr(596 - 547) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1001 + 0o50) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(1960 - 1908) + chr(0b110 + 0o60), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001101 + 0o42) + chr(51) + '\061' + chr(0b110011), 8274 - 8266), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(0b101100 + 0o4) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(2459 - 2408) + chr(0b110000) + chr(2620 - 2567), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(52) + chr(54), 5991 - 5983), ehT0Px3KOsy9(chr(208 - 160) + chr(111) + '\x31' + chr(0b110000) + '\x36', 28959 - 28951), ehT0Px3KOsy9('\060' + '\157' + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + '\067' + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11001 + 0o31) + '\066' + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\067', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(0b10111 + 0o32) + '\x37' + chr(0b11000 + 0o35), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b100110 + 0o111) + '\x32' + chr(0b110100) + '\067', 1784 - 1776), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(0b10110 + 0o34) + chr(0b110011), 6721 - 6713), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111011 + 0o64) + '\x32' + chr(0b110100 + 0o3) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\060', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + '\065', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110000 + 0o3) + '\x32' + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(8380 - 8269) + '\063' + chr(0b10 + 0o62) + chr(0b100110 + 0o16), ord("\x08")), ehT0Px3KOsy9(chr(2119 - 2071) + chr(6727 - 6616) + chr(50) + chr(746 - 693) + chr(819 - 770), 35676 - 35668), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + '\066' + chr(2635 - 2580), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + chr(2185 - 2135) + '\063' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010 + 0o5) + chr(2314 - 2262), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11101 + 0o31) + '\064', 0b1000), ehT0Px3KOsy9(chr(1058 - 1010) + '\x6f' + chr(1630 - 1580) + chr(0b101001 + 0o10), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(133 - 85) + '\157' + '\x35' + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf9'), '\144' + '\145' + '\143' + chr(111) + '\144' + chr(101))(chr(0b1000011 + 0o62) + chr(0b1110100) + '\146' + chr(0b100001 + 0o14) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def MajNtwyD4eYd(oVre8I6UXc3b, fsKNe8onWqjT):
return fsKNe8onWqjT is not None and PlSM16l2KDPD(fsKNe8onWqjT, wLqBDw8l0eIm) and (c2A0yzQpDQB3(fsKNe8onWqjT) == ehT0Px3KOsy9('\060' + chr(12264 - 12153) + chr(2386 - 2337), 3674 - 3666)) and (xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe^\x01b\x03\xf8\xff\xea3\x83\x11~\x1c*'), chr(0b1100100) + chr(0b110110 + 0o57) + chr(5707 - 5608) + chr(111) + '\x64' + chr(0b1100101))(chr(3095 - 2978) + chr(0b1111 + 0o145) + chr(0b1100110) + '\x2d' + chr(2448 - 2392))) in fsKNe8onWqjT)
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
Action._parse_resource_reference
|
def _parse_resource_reference(cls, ref_value):
"""
Splits a resource reference of structure "LogicalId.Property" and returns the "LogicalId" and "Property"
separately.
:param string ref_value: Input reference value which *may* contain the structure "LogicalId.Property"
:return string, string: Returns two values - logical_id, property. If the input does not contain the structure,
then both `logical_id` and property will be None
"""
no_result = (None, None)
if not isinstance(ref_value, string_types):
return no_result
splits = ref_value.split(cls._resource_ref_separator, 1)
# Either there is no 'dot' (or) one of the values is empty string (Ex: when you split "LogicalId.")
if len(splits) != 2 or not all(splits):
return no_result
return splits[0], splits[1]
|
python
|
def _parse_resource_reference(cls, ref_value):
"""
Splits a resource reference of structure "LogicalId.Property" and returns the "LogicalId" and "Property"
separately.
:param string ref_value: Input reference value which *may* contain the structure "LogicalId.Property"
:return string, string: Returns two values - logical_id, property. If the input does not contain the structure,
then both `logical_id` and property will be None
"""
no_result = (None, None)
if not isinstance(ref_value, string_types):
return no_result
splits = ref_value.split(cls._resource_ref_separator, 1)
# Either there is no 'dot' (or) one of the values is empty string (Ex: when you split "LogicalId.")
if len(splits) != 2 or not all(splits):
return no_result
return splits[0], splits[1]
|
[
"def",
"_parse_resource_reference",
"(",
"cls",
",",
"ref_value",
")",
":",
"no_result",
"=",
"(",
"None",
",",
"None",
")",
"if",
"not",
"isinstance",
"(",
"ref_value",
",",
"string_types",
")",
":",
"return",
"no_result",
"splits",
"=",
"ref_value",
".",
"split",
"(",
"cls",
".",
"_resource_ref_separator",
",",
"1",
")",
"# Either there is no 'dot' (or) one of the values is empty string (Ex: when you split \"LogicalId.\")",
"if",
"len",
"(",
"splits",
")",
"!=",
"2",
"or",
"not",
"all",
"(",
"splits",
")",
":",
"return",
"no_result",
"return",
"splits",
"[",
"0",
"]",
",",
"splits",
"[",
"1",
"]"
] |
Splits a resource reference of structure "LogicalId.Property" and returns the "LogicalId" and "Property"
separately.
:param string ref_value: Input reference value which *may* contain the structure "LogicalId.Property"
:return string, string: Returns two values - logical_id, property. If the input does not contain the structure,
then both `logical_id` and property will be None
|
[
"Splits",
"a",
"resource",
"reference",
"of",
"structure",
"LogicalId",
".",
"Property",
"and",
"returns",
"the",
"LogicalId",
"and",
"Property",
"separately",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L55-L76
|
train
|
Splits a resource reference of structure LogicalId. Property and returns the LogicalId and Property separately.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICj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BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x36' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(8763 - 8652) + '\x33' + '\x32' + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(413 - 359) + chr(1193 - 1144), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(54) + chr(1093 - 1038), 42655 - 42647), ehT0Px3KOsy9('\x30' + '\157' + '\x37' + '\x33', 22104 - 22096), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(0b10110 + 0o35) + '\067', 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\157' + chr(0b100110 + 0o15) + chr(0b110000), 22665 - 22657), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(3361 - 3250) + '\061' + chr(50) + chr(0b101101 + 0o10), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(4901 - 4790) + chr(49) + chr(0b1010 + 0o54) + '\x37', 19181 - 19173), ehT0Px3KOsy9('\x30' + chr(7001 - 6890) + chr(804 - 754) + '\x30' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + '\061' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + '\x36' + chr(55), 8), ehT0Px3KOsy9('\060' + chr(5773 - 5662) + chr(0b110011) + '\x37' + chr(53), 35565 - 35557), ehT0Px3KOsy9(chr(1361 - 1313) + chr(0b1001010 + 0o45) + '\x32', 65254 - 65246), ehT0Px3KOsy9(chr(0b110000) + chr(7241 - 7130) + chr(2585 - 2534) + '\065' + '\062', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(502 - 452) + chr(0b110101), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(844 - 793) + chr(0b10100 + 0o34) + '\x31', 0b1000), ehT0Px3KOsy9(chr(1478 - 1430) + '\157' + chr(0b11111 + 0o24) + '\x35' + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10100 + 0o41) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(50) + chr(49), 58249 - 58241), ehT0Px3KOsy9('\x30' + chr(6960 - 6849) + chr(2226 - 2176) + chr(0b100000 + 0o23) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + chr(0b111 + 0o53) + chr(543 - 494) + chr(0b110101 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(3445 - 3334) + '\x33' + chr(1345 - 1292) + chr(0b11 + 0o56), 32556 - 32548), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1011 + 0o144) + '\061' + '\065' + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + '\x30' + chr(54), 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + chr(0b100100 + 0o15) + chr(48) + '\064', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + '\064' + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + '\x36' + '\x34', 13370 - 13362), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1670 - 1619) + '\x34' + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101 + 0o54) + '\x35' + chr(0b1110 + 0o50), 50390 - 50382), ehT0Px3KOsy9(chr(48) + chr(0b1010000 + 0o37) + chr(0b100011 + 0o20) + '\062' + chr(50), 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + chr(1490 - 1441) + chr(0b110011) + chr(2456 - 2404), 0b1000), ehT0Px3KOsy9(chr(1327 - 1279) + chr(0b1101111) + '\x35' + chr(0b110000 + 0o6), 0o10), ehT0Px3KOsy9(chr(1406 - 1358) + chr(11999 - 11888) + '\x37' + '\x31', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + '\060' + chr(650 - 598), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(55) + chr(1024 - 969), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + chr(0b100100 + 0o23) + chr(0b110100), 26129 - 26121), ehT0Px3KOsy9(chr(742 - 694) + chr(0b1011101 + 0o22) + chr(366 - 317) + chr(1769 - 1718) + chr(0b110100), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2406 - 2356) + chr(0b101001 + 0o15) + '\062', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(3938 - 3827) + '\065' + '\x30', 44024 - 44016)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x1c'), chr(0b110100 + 0o60) + chr(0b1100101) + chr(1282 - 1183) + '\157' + '\144' + '\145')('\165' + '\164' + '\146' + chr(45) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def TRYMegi7_RWf(NSstowUUZlxS, FihFP7vRO4zT):
tN582xbRnNHm = (None, None)
if not PlSM16l2KDPD(FihFP7vRO4zT, sInLJQno9SRQ):
return tN582xbRnNHm
uSBCRSw0LUmo = FihFP7vRO4zT.split(NSstowUUZlxS._resource_ref_separator, ehT0Px3KOsy9('\x30' + '\x6f' + '\061', 9668 - 9660))
if c2A0yzQpDQB3(uSBCRSw0LUmo) != ehT0Px3KOsy9('\060' + chr(6127 - 6016) + '\062', 8) or not Dl48nj1rbi23(uSBCRSw0LUmo):
return tN582xbRnNHm
return (uSBCRSw0LUmo[ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1001 + 0o47), 55919 - 55911)], uSBCRSw0LUmo[ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001), 8)])
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
RefAction.resolve_parameter_refs
|
def resolve_parameter_refs(self, input_dict, parameters):
"""
Resolves references that are present in the parameters and returns the value. If it is not in parameters,
this method simply returns the input unchanged.
:param input_dict: Dictionary representing the Ref function. Must contain only one key and it should be "Ref".
Ex: {Ref: "foo"}
:param parameters: Dictionary of parameter values for resolution
:return:
"""
if not self.can_handle(input_dict):
return input_dict
param_name = input_dict[self.intrinsic_name]
if not isinstance(param_name, string_types):
return input_dict
if param_name in parameters:
return parameters[param_name]
else:
return input_dict
|
python
|
def resolve_parameter_refs(self, input_dict, parameters):
"""
Resolves references that are present in the parameters and returns the value. If it is not in parameters,
this method simply returns the input unchanged.
:param input_dict: Dictionary representing the Ref function. Must contain only one key and it should be "Ref".
Ex: {Ref: "foo"}
:param parameters: Dictionary of parameter values for resolution
:return:
"""
if not self.can_handle(input_dict):
return input_dict
param_name = input_dict[self.intrinsic_name]
if not isinstance(param_name, string_types):
return input_dict
if param_name in parameters:
return parameters[param_name]
else:
return input_dict
|
[
"def",
"resolve_parameter_refs",
"(",
"self",
",",
"input_dict",
",",
"parameters",
")",
":",
"if",
"not",
"self",
".",
"can_handle",
"(",
"input_dict",
")",
":",
"return",
"input_dict",
"param_name",
"=",
"input_dict",
"[",
"self",
".",
"intrinsic_name",
"]",
"if",
"not",
"isinstance",
"(",
"param_name",
",",
"string_types",
")",
":",
"return",
"input_dict",
"if",
"param_name",
"in",
"parameters",
":",
"return",
"parameters",
"[",
"param_name",
"]",
"else",
":",
"return",
"input_dict"
] |
Resolves references that are present in the parameters and returns the value. If it is not in parameters,
this method simply returns the input unchanged.
:param input_dict: Dictionary representing the Ref function. Must contain only one key and it should be "Ref".
Ex: {Ref: "foo"}
:param parameters: Dictionary of parameter values for resolution
:return:
|
[
"Resolves",
"references",
"that",
"are",
"present",
"in",
"the",
"parameters",
"and",
"returns",
"the",
"value",
".",
"If",
"it",
"is",
"not",
"in",
"parameters",
"this",
"method",
"simply",
"returns",
"the",
"input",
"unchanged",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py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,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + '\064' + chr(1103 - 1048), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1822 - 1771) + chr(49) + chr(54), 53229 - 53221), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(0b110011) + chr(53) + chr(2181 - 2129), 37005 - 36997), ehT0Px3KOsy9(chr(322 - 274) + '\157' + '\x37' + chr(0b110100), 29762 - 29754), ehT0Px3KOsy9(chr(63 - 15) + chr(0b1101111) + chr(0b1010 + 0o50) + chr(55) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(8835 - 8724) + chr(0b100000 + 0o25) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6325 - 6214) + chr(0b110001) + '\066' + chr(0b100011 + 0o16), 51812 - 51804), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101010 + 0o10) + '\x35' + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001111 + 0o40) + chr(52) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101000 + 0o13) + chr(55) + chr(54), 0o10), ehT0Px3KOsy9(chr(196 - 148) + chr(1108 - 997) + '\061' + '\x32' + chr(1474 - 1422), 7430 - 7422), ehT0Px3KOsy9('\x30' + chr(0b1001110 + 0o41) + '\x32' + chr(0b1001 + 0o47) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1001101 + 0o42) + chr(50) + chr(0b110110) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b11100 + 0o123) + chr(49) + chr(0b111 + 0o54) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5962 - 5851) + '\x31' + chr(2482 - 2430) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(0b110101) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1000001 + 0o56) + '\061' + chr(2284 - 2234) + '\x37', 0b1000), ehT0Px3KOsy9(chr(1946 - 1898) + '\157' + chr(0b100111 + 0o14) + chr(0b10 + 0o56) + chr(0b1011 + 0o51), 0o10), ehT0Px3KOsy9('\x30' + chr(6804 - 6693) + chr(0b110011) + '\x35' + '\065', 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\157' + '\062' + chr(50) + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(0b110001) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b10101 + 0o132) + chr(0b110011) + chr(0b10101 + 0o40) + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111 + 0o150) + chr(0b11101 + 0o26) + '\x36', 22584 - 22576), ehT0Px3KOsy9(chr(1031 - 983) + chr(0b1101111) + chr(0b101011 + 0o7) + '\066' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(427 - 379) + '\x6f' + '\061' + chr(0b110100) + '\x35', 0o10), ehT0Px3KOsy9(chr(1925 - 1877) + chr(0b1011110 + 0o21) + chr(53) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(111) + chr(0b110001) + chr(0b100001 + 0o17) + chr(0b11111 + 0o30), 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\x6f' + chr(815 - 766) + '\065' + chr(0b1111 + 0o50), 16926 - 16918), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + '\066' + '\x37', 34545 - 34537), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + chr(50) + '\060' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + chr(54) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b100111 + 0o110) + chr(0b110010) + chr(642 - 588) + chr(1227 - 1175), 8), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + '\x34' + chr(53), 8), ehT0Px3KOsy9(chr(1850 - 1802) + '\x6f' + '\067', 53989 - 53981), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110100), 25282 - 25274), ehT0Px3KOsy9('\060' + chr(3851 - 3740) + '\062' + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110101) + chr(0b10011 + 0o44), 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b111100 + 0o63) + chr(0b101110 + 0o5) + chr(1985 - 1936) + chr(2320 - 2269), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(1225 - 1177) + chr(52), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(1439 - 1388) + chr(55) + '\063', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(10322 - 10211) + '\065' + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\t'), '\144' + '\x65' + chr(0b1100011) + chr(8104 - 7993) + '\144' + '\145')(chr(0b1110101) + chr(9320 - 9204) + chr(568 - 466) + chr(1822 - 1777) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Khlw9Xworg_f(oVre8I6UXc3b, fsKNe8onWqjT, YwMyLskbiCrd):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'D\xaf\x82c\xd1H\x1f\xcaO\x9b'), chr(0b1111 + 0o125) + chr(0b110110 + 0o57) + chr(0b1001010 + 0o31) + chr(0b1101111) + '\144' + chr(101))('\165' + '\x74' + chr(102) + '\x2d' + '\070'))(fsKNe8onWqjT):
return fsKNe8onWqjT
LwwoV1LmMhGU = fsKNe8onWqjT[oVre8I6UXc3b.intrinsic_name]
if not PlSM16l2KDPD(LwwoV1LmMhGU, sInLJQno9SRQ):
return fsKNe8onWqjT
if LwwoV1LmMhGU in YwMyLskbiCrd:
return YwMyLskbiCrd[LwwoV1LmMhGU]
else:
return fsKNe8onWqjT
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
RefAction.resolve_resource_refs
|
def resolve_resource_refs(self, input_dict, supported_resource_refs):
"""
Resolves references to some property of a resource. These are runtime properties which can't be converted
to a value here. Instead we output another reference that will more actually resolve to the value when
executed via CloudFormation
Example:
{"Ref": "LogicalId.Property"} => {"Ref": "SomeOtherLogicalId"}
:param dict input_dict: Dictionary representing the Ref function to be resolved.
:param samtranslator.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Instance of
an `SupportedResourceReferences` object that contain value of the property.
:return dict: Dictionary with resource references resolved.
"""
if not self.can_handle(input_dict):
return input_dict
ref_value = input_dict[self.intrinsic_name]
logical_id, property = self._parse_resource_reference(ref_value)
# ref_value could not be parsed
if not logical_id:
return input_dict
resolved_value = supported_resource_refs.get(logical_id, property)
if not resolved_value:
return input_dict
return {
self.intrinsic_name: resolved_value
}
|
python
|
def resolve_resource_refs(self, input_dict, supported_resource_refs):
"""
Resolves references to some property of a resource. These are runtime properties which can't be converted
to a value here. Instead we output another reference that will more actually resolve to the value when
executed via CloudFormation
Example:
{"Ref": "LogicalId.Property"} => {"Ref": "SomeOtherLogicalId"}
:param dict input_dict: Dictionary representing the Ref function to be resolved.
:param samtranslator.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Instance of
an `SupportedResourceReferences` object that contain value of the property.
:return dict: Dictionary with resource references resolved.
"""
if not self.can_handle(input_dict):
return input_dict
ref_value = input_dict[self.intrinsic_name]
logical_id, property = self._parse_resource_reference(ref_value)
# ref_value could not be parsed
if not logical_id:
return input_dict
resolved_value = supported_resource_refs.get(logical_id, property)
if not resolved_value:
return input_dict
return {
self.intrinsic_name: resolved_value
}
|
[
"def",
"resolve_resource_refs",
"(",
"self",
",",
"input_dict",
",",
"supported_resource_refs",
")",
":",
"if",
"not",
"self",
".",
"can_handle",
"(",
"input_dict",
")",
":",
"return",
"input_dict",
"ref_value",
"=",
"input_dict",
"[",
"self",
".",
"intrinsic_name",
"]",
"logical_id",
",",
"property",
"=",
"self",
".",
"_parse_resource_reference",
"(",
"ref_value",
")",
"# ref_value could not be parsed",
"if",
"not",
"logical_id",
":",
"return",
"input_dict",
"resolved_value",
"=",
"supported_resource_refs",
".",
"get",
"(",
"logical_id",
",",
"property",
")",
"if",
"not",
"resolved_value",
":",
"return",
"input_dict",
"return",
"{",
"self",
".",
"intrinsic_name",
":",
"resolved_value",
"}"
] |
Resolves references to some property of a resource. These are runtime properties which can't be converted
to a value here. Instead we output another reference that will more actually resolve to the value when
executed via CloudFormation
Example:
{"Ref": "LogicalId.Property"} => {"Ref": "SomeOtherLogicalId"}
:param dict input_dict: Dictionary representing the Ref function to be resolved.
:param samtranslator.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Instance of
an `SupportedResourceReferences` object that contain value of the property.
:return dict: Dictionary with resource references resolved.
|
[
"Resolves",
"references",
"to",
"some",
"property",
"of",
"a",
"resource",
".",
"These",
"are",
"runtime",
"properties",
"which",
"can",
"t",
"be",
"converted",
"to",
"a",
"value",
"here",
".",
"Instead",
"we",
"output",
"another",
"reference",
"that",
"will",
"more",
"actually",
"resolve",
"to",
"the",
"value",
"when",
"executed",
"via",
"CloudFormation"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L106-L137
|
train
|
Resolves references to some property of a resource.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1Ht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e,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + '\065' + chr(858 - 806), 0b1000), ehT0Px3KOsy9(chr(48) + chr(7251 - 7140) + chr(0b110011) + chr(0b101111 + 0o5) + '\062', 6603 - 6595), ehT0Px3KOsy9(chr(0b110000) + chr(0b111110 + 0o61) + '\x32' + chr(0b110000) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\157' + chr(0b11011 + 0o30) + chr(0b1110 + 0o50) + chr(50), 0b1000), ehT0Px3KOsy9(chr(1399 - 1351) + '\157' + chr(0b1011 + 0o46) + '\x30' + chr(0b110110), 45969 - 45961), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110110) + '\x37', 55863 - 55855), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + chr(914 - 861) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + chr(50) + chr(0b110010) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b101011 + 0o6) + chr(0b110100) + chr(0b10011 + 0o40), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(182 - 132) + chr(1974 - 1920) + chr(0b1001 + 0o47), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + '\x31' + '\064' + '\063', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\x35' + '\x36', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\067' + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1011 + 0o144) + chr(775 - 725) + chr(0b110000) + chr(0b110111), 59473 - 59465), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + '\x33' + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\157' + chr(78 - 28) + '\065' + chr(54), 8), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + '\063' + chr(0b110100) + '\062', 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + '\065' + chr(1027 - 979), 62207 - 62199), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + chr(0b110011) + '\x30' + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(52) + chr(0b1110 + 0o44), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101101 + 0o5) + '\x31' + chr(1063 - 1012), 35798 - 35790), ehT0Px3KOsy9('\060' + chr(0b111001 + 0o66) + '\x33' + chr(0b1100 + 0o51) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b10 + 0o155) + chr(1537 - 1488) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + chr(0b110010) + chr(0b110100) + chr(1043 - 992), 0b1000), ehT0Px3KOsy9(chr(225 - 177) + chr(0b1010011 + 0o34) + '\x34' + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(1751 - 1702) + '\066' + chr(1164 - 1115), 0o10), ehT0Px3KOsy9('\060' + chr(0b110000 + 0o77) + chr(0b10110 + 0o41), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + '\063' + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b111111 + 0o60) + '\x33' + '\x32' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + chr(48) + chr(0b110101), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\061' + chr(51), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110111) + chr(0b110111), 56975 - 56967), ehT0Px3KOsy9(chr(48) + chr(3722 - 3611) + chr(0b100111 + 0o13) + chr(2043 - 1989) + chr(0b100001 + 0o22), 0b1000), ehT0Px3KOsy9(chr(915 - 867) + '\157' + chr(1076 - 1025) + chr(0b110000) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b101010 + 0o13) + chr(54), 8), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + chr(5482 - 5371) + chr(0b1111 + 0o43) + '\064' + '\x32', 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(610 - 499) + chr(0b10010 + 0o40) + chr(709 - 658) + chr(2557 - 2504), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100101 + 0o16) + chr(0b110100) + chr(1924 - 1875), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + '\065' + '\x30', 4765 - 4757)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc2'), '\144' + '\x65' + '\x63' + chr(0b101100 + 0o103) + chr(0b1100100) + chr(0b1000000 + 0o45))(chr(0b1110011 + 0o2) + chr(3716 - 3600) + chr(8016 - 7914) + '\x2d' + chr(0b1 + 0o67)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Nf6VSyAHeUJI(oVre8I6UXc3b, fsKNe8onWqjT, KvSmPUitKt7D):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8f\x83\xeb\xad.VD\xf2\x0f\xd5'), chr(0b1010000 + 0o24) + chr(101) + '\143' + '\157' + '\x64' + '\x65')(chr(117) + '\164' + chr(0b100101 + 0o101) + chr(1552 - 1507) + chr(0b111000)))(fsKNe8onWqjT):
return fsKNe8onWqjT
FihFP7vRO4zT = fsKNe8onWqjT[oVre8I6UXc3b.intrinsic_name]
(NpZr66MdBhVG, FL7SmUoxlR9h) = oVre8I6UXc3b._parse_resource_reference(FihFP7vRO4zT)
if not NpZr66MdBhVG:
return fsKNe8onWqjT
ikyZID2DzuoC = KvSmPUitKt7D.get(NpZr66MdBhVG, FL7SmUoxlR9h)
if not ikyZID2DzuoC:
return fsKNe8onWqjT
return {xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\x8c\xf1\x80/YY\xff\x00\xefj\x02\xc3\\'), '\144' + chr(0b10000 + 0o125) + chr(99) + chr(0b1011000 + 0o27) + chr(3338 - 3238) + '\x65')('\165' + chr(116) + chr(0b1100100 + 0o2) + '\055' + '\x38')): ikyZID2DzuoC}
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
RefAction.resolve_resource_id_refs
|
def resolve_resource_id_refs(self, input_dict, supported_resource_id_refs):
"""
Updates references to the old logical id of a resource to the new (generated) logical id.
Example:
{"Ref": "MyLayer"} => {"Ref": "MyLayerABC123"}
:param dict input_dict: Dictionary representing the Ref function to be resolved.
:param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones.
:return dict: Dictionary with resource references resolved.
"""
if not self.can_handle(input_dict):
return input_dict
ref_value = input_dict[self.intrinsic_name]
if not isinstance(ref_value, string_types) or self._resource_ref_separator in ref_value:
return input_dict
logical_id = ref_value
resolved_value = supported_resource_id_refs.get(logical_id)
if not resolved_value:
return input_dict
return {
self.intrinsic_name: resolved_value
}
|
python
|
def resolve_resource_id_refs(self, input_dict, supported_resource_id_refs):
"""
Updates references to the old logical id of a resource to the new (generated) logical id.
Example:
{"Ref": "MyLayer"} => {"Ref": "MyLayerABC123"}
:param dict input_dict: Dictionary representing the Ref function to be resolved.
:param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones.
:return dict: Dictionary with resource references resolved.
"""
if not self.can_handle(input_dict):
return input_dict
ref_value = input_dict[self.intrinsic_name]
if not isinstance(ref_value, string_types) or self._resource_ref_separator in ref_value:
return input_dict
logical_id = ref_value
resolved_value = supported_resource_id_refs.get(logical_id)
if not resolved_value:
return input_dict
return {
self.intrinsic_name: resolved_value
}
|
[
"def",
"resolve_resource_id_refs",
"(",
"self",
",",
"input_dict",
",",
"supported_resource_id_refs",
")",
":",
"if",
"not",
"self",
".",
"can_handle",
"(",
"input_dict",
")",
":",
"return",
"input_dict",
"ref_value",
"=",
"input_dict",
"[",
"self",
".",
"intrinsic_name",
"]",
"if",
"not",
"isinstance",
"(",
"ref_value",
",",
"string_types",
")",
"or",
"self",
".",
"_resource_ref_separator",
"in",
"ref_value",
":",
"return",
"input_dict",
"logical_id",
"=",
"ref_value",
"resolved_value",
"=",
"supported_resource_id_refs",
".",
"get",
"(",
"logical_id",
")",
"if",
"not",
"resolved_value",
":",
"return",
"input_dict",
"return",
"{",
"self",
".",
"intrinsic_name",
":",
"resolved_value",
"}"
] |
Updates references to the old logical id of a resource to the new (generated) logical id.
Example:
{"Ref": "MyLayer"} => {"Ref": "MyLayerABC123"}
:param dict input_dict: Dictionary representing the Ref function to be resolved.
:param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones.
:return dict: Dictionary with resource references resolved.
|
[
"Updates",
"references",
"to",
"the",
"old",
"logical",
"id",
"of",
"a",
"resource",
"to",
"the",
"new",
"(",
"generated",
")",
"logical",
"id",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L139-L166
|
train
|
Resolves the Ref function to the new logical id of a resource.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_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7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(1321 - 1270) + chr(1670 - 1622), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(0b110011) + chr(48) + chr(1512 - 1464), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b111110 + 0o61) + '\x32' + '\064' + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + '\x34', 11680 - 11672), ehT0Px3KOsy9('\060' + chr(0b100011 + 0o114) + '\064' + chr(0b100111 + 0o14), 13290 - 13282), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + chr(0b110 + 0o53) + chr(0b10111 + 0o37) + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(2131 - 2020) + chr(53) + chr(0b1001 + 0o55), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(0b110101) + chr(0b110000), 57666 - 57658), ehT0Px3KOsy9(chr(1161 - 1113) + chr(0b10111 + 0o130) + chr(50) + chr(49) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(263 - 215) + '\157' + chr(0b110111) + chr(0b110010), 22585 - 22577), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + '\067' + '\063', 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + chr(0b110010) + chr(161 - 110) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(53) + chr(1265 - 1216), 0o10), ehT0Px3KOsy9('\060' + chr(11293 - 11182) + chr(0b110101) + '\063', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(0b110110) + chr(0b1111 + 0o46), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100011 + 0o16) + chr(49) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11819 - 11708) + chr(0b110011) + '\064' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(1762 - 1714) + chr(11795 - 11684) + '\065' + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b10100 + 0o133) + '\062' + chr(49) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(1880 - 1832) + chr(111) + chr(51) + chr(0b110101) + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(812 - 757) + chr(51), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(1081 - 1026) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + '\062' + '\x33' + chr(0b11100 + 0o25), 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + chr(50) + '\x31', 0b1000), ehT0Px3KOsy9(chr(1843 - 1795) + '\x6f' + chr(51) + '\x36' + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(54) + chr(0b110001 + 0o0), ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\x6f' + '\x35' + '\x37', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101101 + 0o2) + '\x31' + chr(0b100011 + 0o21) + '\x36', 42327 - 42319), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + chr(49) + chr(0b110011) + chr(0b10 + 0o63), 745 - 737), ehT0Px3KOsy9(chr(1688 - 1640) + chr(111) + chr(2207 - 2158) + chr(192 - 144) + chr(50), 25717 - 25709), ehT0Px3KOsy9(chr(48) + chr(0b100 + 0o153) + chr(0b110001) + chr(1642 - 1590) + chr(0b110100 + 0o1), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1110 + 0o141) + chr(0b110010) + chr(166 - 115) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\x6f' + '\063' + chr(0b110100) + chr(55), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(530 - 475) + '\x37', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(49) + '\064' + '\064', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + '\x32' + chr(0b100101 + 0o13), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x35' + chr(0b10010 + 0o41), 8), ehT0Px3KOsy9('\x30' + chr(0b11010 + 0o125) + chr(2059 - 2008) + chr(50) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(7492 - 7381) + chr(0b11100 + 0o26) + chr(54) + '\x33', 11838 - 11830), ehT0Px3KOsy9(chr(65 - 17) + chr(111) + chr(0b110010) + '\x31' + chr(0b110001), 34749 - 34741)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1763 - 1715) + chr(9821 - 9710) + chr(0b110101) + chr(0b100111 + 0o11), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'v'), '\144' + chr(101) + chr(0b10010 + 0o121) + chr(2993 - 2882) + chr(0b1100100) + chr(0b1100101))('\x75' + chr(0b11100 + 0o130) + '\146' + chr(0b101010 + 0o3) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def lvz_X3e0o7aG(oVre8I6UXc3b, fsKNe8onWqjT, Xwr_NWMclJnm):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b';\xa1\xc8[K\x16@\xcc\xe3_'), '\x64' + chr(0b1100101) + chr(0b1010001 + 0o22) + '\x6f' + chr(100) + chr(0b1100101))(chr(11207 - 11090) + '\x74' + '\x66' + '\055' + '\070'))(fsKNe8onWqjT):
return fsKNe8onWqjT
FihFP7vRO4zT = fsKNe8onWqjT[oVre8I6UXc3b.intrinsic_name]
if not PlSM16l2KDPD(FihFP7vRO4zT, sInLJQno9SRQ) or xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x07\xb2\xc3wL\x02\\\xcb\xeae\x89\xfb\xcft\x06,\x96N\xfa\x8fO\x15\xeb'), chr(1054 - 954) + chr(0b1100101) + chr(0b1000011 + 0o40) + '\x6f' + '\144' + '\145')(chr(0b1110 + 0o147) + chr(4243 - 4127) + '\x66' + chr(0b101101) + chr(0b111000))) in FihFP7vRO4zT:
return fsKNe8onWqjT
NpZr66MdBhVG = FihFP7vRO4zT
ikyZID2DzuoC = Xwr_NWMclJnm.get(NpZr66MdBhVG)
if not ikyZID2DzuoC:
return fsKNe8onWqjT
return {xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'1\xae\xd2vJ\x19]\xc1\xece\x95\xff\xc4N'), '\x64' + chr(10148 - 10047) + '\x63' + chr(111) + chr(0b1110 + 0o126) + '\145')(chr(0b101110 + 0o107) + '\164' + chr(0b1100110) + chr(45) + '\x38')): ikyZID2DzuoC}
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
SubAction.resolve_parameter_refs
|
def resolve_parameter_refs(self, input_dict, parameters):
"""
Substitute references found within the string of `Fn::Sub` intrinsic function
:param input_dict: Dictionary representing the Fn::Sub function. Must contain only one key and it should be
`Fn::Sub`. Ex: {"Fn::Sub": ...}
:param parameters: Dictionary of parameter values for substitution
:return: Resolved
"""
def do_replacement(full_ref, prop_name):
"""
Replace parameter references with actual value. Return value of this method is directly replaces the
reference structure
:param full_ref: => ${logicalId.property}
:param prop_name: => logicalId.property
:return: Either the value it resolves to. If not the original reference
"""
return parameters.get(prop_name, full_ref)
return self._handle_sub_action(input_dict, do_replacement)
|
python
|
def resolve_parameter_refs(self, input_dict, parameters):
"""
Substitute references found within the string of `Fn::Sub` intrinsic function
:param input_dict: Dictionary representing the Fn::Sub function. Must contain only one key and it should be
`Fn::Sub`. Ex: {"Fn::Sub": ...}
:param parameters: Dictionary of parameter values for substitution
:return: Resolved
"""
def do_replacement(full_ref, prop_name):
"""
Replace parameter references with actual value. Return value of this method is directly replaces the
reference structure
:param full_ref: => ${logicalId.property}
:param prop_name: => logicalId.property
:return: Either the value it resolves to. If not the original reference
"""
return parameters.get(prop_name, full_ref)
return self._handle_sub_action(input_dict, do_replacement)
|
[
"def",
"resolve_parameter_refs",
"(",
"self",
",",
"input_dict",
",",
"parameters",
")",
":",
"def",
"do_replacement",
"(",
"full_ref",
",",
"prop_name",
")",
":",
"\"\"\"\n Replace parameter references with actual value. Return value of this method is directly replaces the\n reference structure\n\n :param full_ref: => ${logicalId.property}\n :param prop_name: => logicalId.property\n :return: Either the value it resolves to. If not the original reference\n \"\"\"",
"return",
"parameters",
".",
"get",
"(",
"prop_name",
",",
"full_ref",
")",
"return",
"self",
".",
"_handle_sub_action",
"(",
"input_dict",
",",
"do_replacement",
")"
] |
Substitute references found within the string of `Fn::Sub` intrinsic function
:param input_dict: Dictionary representing the Fn::Sub function. Must contain only one key and it should be
`Fn::Sub`. Ex: {"Fn::Sub": ...}
:param parameters: Dictionary of parameter values for substitution
:return: Resolved
|
[
"Substitute",
"references",
"found",
"within",
"the",
"string",
"of",
"Fn",
"::",
"Sub",
"intrinsic",
"function"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L172-L194
|
train
|
Resolve the parameter references found within the string of Fn :: Sub intrinsic function
.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9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M0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(111) + chr(1040 - 987) + chr(1401 - 1346), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(0b110001 + 0o3) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b110110) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(1622 - 1571) + chr(0b110100) + chr(0b11000 + 0o35), 0o10), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(2734 - 2623) + chr(51) + chr(0b101011 + 0o10) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(8430 - 8319) + '\x32' + '\x31' + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(0b110000) + '\x34', 8716 - 8708), ehT0Px3KOsy9(chr(2283 - 2235) + chr(0b1101000 + 0o7) + chr(0b110001) + chr(53) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100001 + 0o22) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + chr(54) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(11459 - 11348) + chr(0b110011) + chr(2993 - 2938) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(5621 - 5510) + chr(0b1100 + 0o46) + chr(49) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(1187 - 1138) + '\063' + '\x31', 19107 - 19099), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + '\064' + chr(2103 - 2049), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + '\x33' + chr(0b1000 + 0o52) + '\060', 63101 - 63093), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + '\x34' + chr(2662 - 2607), 22914 - 22906), ehT0Px3KOsy9(chr(48) + chr(4903 - 4792) + '\x32' + chr(0b110010) + chr(54), 12308 - 12300), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + '\060', 0b1000), ehT0Px3KOsy9(chr(210 - 162) + chr(0b1101111) + chr(50) + chr(54) + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + chr(6508 - 6397) + '\062' + '\x31' + chr(0b10101 + 0o34), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(50) + '\063', 0b1000), ehT0Px3KOsy9(chr(204 - 156) + '\157' + '\x36' + chr(0b100011 + 0o22), 8), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1001011 + 0o44) + chr(2524 - 2470) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(0b110001) + chr(0b1010 + 0o46), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b101100 + 0o103) + '\063' + chr(0b110111) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7603 - 7492) + '\062' + chr(912 - 861) + chr(0b110110), 27642 - 27634), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(5291 - 5180) + chr(0b110001) + chr(0b110110) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001110 + 0o41) + '\061' + '\x35' + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + '\x30' + chr(0b11010 + 0o34), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1100 + 0o47) + chr(53) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(52) + '\x37', 25275 - 25267), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(48), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(1307 - 1252) + chr(0b110001), 15323 - 15315), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1727 - 1676) + chr(0b110001) + chr(55), 0o10), ehT0Px3KOsy9(chr(837 - 789) + '\157' + '\061' + chr(0b110100) + chr(0b100000 + 0o26), 8), ehT0Px3KOsy9(chr(758 - 710) + chr(0b1001100 + 0o43) + chr(0b110001) + chr(0b110100) + chr(54), 8), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\157' + chr(2232 - 2181) + chr(52) + '\063', 38242 - 38234), ehT0Px3KOsy9(chr(48) + chr(5387 - 5276) + '\063' + '\x31' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + '\x32' + chr(2407 - 2357) + chr(0b110001 + 0o0), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011000 + 0o27) + '\062' + '\065' + '\067', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1020 - 972) + chr(111) + '\x35' + chr(48), 24364 - 24356)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x01'), chr(100) + '\145' + '\x63' + chr(0b111100 + 0o63) + '\144' + '\145')(chr(0b1110101) + chr(12431 - 12315) + chr(102) + chr(0b11 + 0o52) + chr(0b11011 + 0o35)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Khlw9Xworg_f(oVre8I6UXc3b, fsKNe8onWqjT, YwMyLskbiCrd):
def JLS35bj2kwjB(mEN91FZ3yLGG, ODwwRTAposGD):
return xafqLlk3kkUe(YwMyLskbiCrd, xafqLlk3kkUe(SXOLrMavuUCe(b'H\x84\x04'), chr(6580 - 6480) + '\x65' + chr(99) + '\157' + '\144' + chr(101))('\165' + chr(8973 - 8857) + '\146' + chr(0b0 + 0o55) + chr(675 - 619)))(ODwwRTAposGD, mEN91FZ3yLGG)
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'p\x89\x11\x8b\xbc\xe7\xe12l@\x9e\xd18\x05\xa4\xce\xf9v'), chr(0b1100100) + chr(0b1011111 + 0o6) + chr(99) + '\x6f' + chr(0b110010 + 0o62) + chr(1574 - 1473))('\x75' + '\164' + chr(0b1100110) + chr(0b11100 + 0o21) + chr(1327 - 1271)))(fsKNe8onWqjT, JLS35bj2kwjB)
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
SubAction.resolve_resource_refs
|
def resolve_resource_refs(self, input_dict, supported_resource_refs):
"""
Resolves reference to some property of a resource. Inside string to be substituted, there could be either a
"Ref" or a "GetAtt" usage of this property. They have to be handled differently.
Ref usages are directly converted to a Ref on the resolved value. GetAtt usages are split under the assumption
that there can be only one property of resource referenced here. Everything else is an attribute reference.
Example:
Let's say `LogicalId.Property` will be resolved to `ResolvedValue`
Ref usage:
${LogicalId.Property} => ${ResolvedValue}
GetAtt usage:
${LogicalId.Property.Arn} => ${ResolvedValue.Arn}
${LogicalId.Property.Attr1.Attr2} => {ResolvedValue.Attr1.Attr2}
:param input_dict: Dictionary to be resolved
:param samtranslator.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Instance of
an `SupportedResourceReferences` object that contain value of the property.
:return: Resolved dictionary
"""
def do_replacement(full_ref, ref_value):
"""
Perform the appropriate replacement to handle ${LogicalId.Property} type references inside a Sub.
This method is called to get the replacement string for each reference within Sub's value
:param full_ref: Entire reference string such as "${LogicalId.Property}"
:param ref_value: Just the value of the reference such as "LogicalId.Property"
:return: Resolved reference of the structure "${SomeOtherLogicalId}". Result should always include the
${} structure since we are not resolving to final value, but just converting one reference to another
"""
# Split the value by separator, expecting to separate out LogicalId.Property
splits = ref_value.split(self._resource_ref_separator)
# If we don't find at least two parts, there is nothing to resolve
if len(splits) < 2:
return full_ref
logical_id = splits[0]
property = splits[1]
resolved_value = supported_resource_refs.get(logical_id, property)
if not resolved_value:
# This ID/property combination is not in the supported references
return full_ref
# We found a LogicalId.Property combination that can be resolved. Construct the output by replacing
# the part of the reference string and not constructing a new ref. This allows us to support GetAtt-like
# syntax and retain other attributes. Ex: ${LogicalId.Property.Arn} => ${SomeOtherLogicalId.Arn}
replacement = self._resource_ref_separator.join([logical_id, property])
return full_ref.replace(replacement, resolved_value)
return self._handle_sub_action(input_dict, do_replacement)
|
python
|
def resolve_resource_refs(self, input_dict, supported_resource_refs):
"""
Resolves reference to some property of a resource. Inside string to be substituted, there could be either a
"Ref" or a "GetAtt" usage of this property. They have to be handled differently.
Ref usages are directly converted to a Ref on the resolved value. GetAtt usages are split under the assumption
that there can be only one property of resource referenced here. Everything else is an attribute reference.
Example:
Let's say `LogicalId.Property` will be resolved to `ResolvedValue`
Ref usage:
${LogicalId.Property} => ${ResolvedValue}
GetAtt usage:
${LogicalId.Property.Arn} => ${ResolvedValue.Arn}
${LogicalId.Property.Attr1.Attr2} => {ResolvedValue.Attr1.Attr2}
:param input_dict: Dictionary to be resolved
:param samtranslator.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Instance of
an `SupportedResourceReferences` object that contain value of the property.
:return: Resolved dictionary
"""
def do_replacement(full_ref, ref_value):
"""
Perform the appropriate replacement to handle ${LogicalId.Property} type references inside a Sub.
This method is called to get the replacement string for each reference within Sub's value
:param full_ref: Entire reference string such as "${LogicalId.Property}"
:param ref_value: Just the value of the reference such as "LogicalId.Property"
:return: Resolved reference of the structure "${SomeOtherLogicalId}". Result should always include the
${} structure since we are not resolving to final value, but just converting one reference to another
"""
# Split the value by separator, expecting to separate out LogicalId.Property
splits = ref_value.split(self._resource_ref_separator)
# If we don't find at least two parts, there is nothing to resolve
if len(splits) < 2:
return full_ref
logical_id = splits[0]
property = splits[1]
resolved_value = supported_resource_refs.get(logical_id, property)
if not resolved_value:
# This ID/property combination is not in the supported references
return full_ref
# We found a LogicalId.Property combination that can be resolved. Construct the output by replacing
# the part of the reference string and not constructing a new ref. This allows us to support GetAtt-like
# syntax and retain other attributes. Ex: ${LogicalId.Property.Arn} => ${SomeOtherLogicalId.Arn}
replacement = self._resource_ref_separator.join([logical_id, property])
return full_ref.replace(replacement, resolved_value)
return self._handle_sub_action(input_dict, do_replacement)
|
[
"def",
"resolve_resource_refs",
"(",
"self",
",",
"input_dict",
",",
"supported_resource_refs",
")",
":",
"def",
"do_replacement",
"(",
"full_ref",
",",
"ref_value",
")",
":",
"\"\"\"\n Perform the appropriate replacement to handle ${LogicalId.Property} type references inside a Sub.\n This method is called to get the replacement string for each reference within Sub's value\n\n :param full_ref: Entire reference string such as \"${LogicalId.Property}\"\n :param ref_value: Just the value of the reference such as \"LogicalId.Property\"\n :return: Resolved reference of the structure \"${SomeOtherLogicalId}\". Result should always include the\n ${} structure since we are not resolving to final value, but just converting one reference to another\n \"\"\"",
"# Split the value by separator, expecting to separate out LogicalId.Property",
"splits",
"=",
"ref_value",
".",
"split",
"(",
"self",
".",
"_resource_ref_separator",
")",
"# If we don't find at least two parts, there is nothing to resolve",
"if",
"len",
"(",
"splits",
")",
"<",
"2",
":",
"return",
"full_ref",
"logical_id",
"=",
"splits",
"[",
"0",
"]",
"property",
"=",
"splits",
"[",
"1",
"]",
"resolved_value",
"=",
"supported_resource_refs",
".",
"get",
"(",
"logical_id",
",",
"property",
")",
"if",
"not",
"resolved_value",
":",
"# This ID/property combination is not in the supported references",
"return",
"full_ref",
"# We found a LogicalId.Property combination that can be resolved. Construct the output by replacing",
"# the part of the reference string and not constructing a new ref. This allows us to support GetAtt-like",
"# syntax and retain other attributes. Ex: ${LogicalId.Property.Arn} => ${SomeOtherLogicalId.Arn}",
"replacement",
"=",
"self",
".",
"_resource_ref_separator",
".",
"join",
"(",
"[",
"logical_id",
",",
"property",
"]",
")",
"return",
"full_ref",
".",
"replace",
"(",
"replacement",
",",
"resolved_value",
")",
"return",
"self",
".",
"_handle_sub_action",
"(",
"input_dict",
",",
"do_replacement",
")"
] |
Resolves reference to some property of a resource. Inside string to be substituted, there could be either a
"Ref" or a "GetAtt" usage of this property. They have to be handled differently.
Ref usages are directly converted to a Ref on the resolved value. GetAtt usages are split under the assumption
that there can be only one property of resource referenced here. Everything else is an attribute reference.
Example:
Let's say `LogicalId.Property` will be resolved to `ResolvedValue`
Ref usage:
${LogicalId.Property} => ${ResolvedValue}
GetAtt usage:
${LogicalId.Property.Arn} => ${ResolvedValue.Arn}
${LogicalId.Property.Attr1.Attr2} => {ResolvedValue.Attr1.Attr2}
:param input_dict: Dictionary to be resolved
:param samtranslator.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Instance of
an `SupportedResourceReferences` object that contain value of the property.
:return: Resolved dictionary
|
[
"Resolves",
"reference",
"to",
"some",
"property",
"of",
"a",
"resource",
".",
"Inside",
"string",
"to",
"be",
"substituted",
"there",
"could",
"be",
"either",
"a",
"Ref",
"or",
"a",
"GetAtt",
"usage",
"of",
"this",
"property",
".",
"They",
"have",
"to",
"be",
"handled",
"differently",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L196-L253
|
train
|
Resolves reference to some property of a resource.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFS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fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\x6f' + '\x33' + '\x30' + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(542 - 488) + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(0b110100) + chr(1046 - 992), 47885 - 47877), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1101 + 0o52) + chr(0b10001 + 0o40), 0o10), ehT0Px3KOsy9(chr(421 - 373) + chr(111) + chr(0b110001) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b1100 + 0o47), 0o10), ehT0Px3KOsy9(chr(85 - 37) + chr(111) + chr(0b11111 + 0o24) + '\064' + '\064', 44986 - 44978), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2193 - 2142) + chr(0b110101) + '\066', 30021 - 30013), ehT0Px3KOsy9(chr(48) + chr(6404 - 6293) + chr(0b1010 + 0o50) + chr(0b100000 + 0o23) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1892 - 1839) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(9277 - 9166) + chr(0b101100 + 0o7) + chr(2465 - 2415) + chr(0b11011 + 0o33), 0b1000), ehT0Px3KOsy9(chr(1713 - 1665) + '\x6f' + chr(0b1001 + 0o51) + chr(0b110000) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(0b110000) + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\065' + chr(52), 10791 - 10783), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b111101 + 0o62) + '\062' + chr(54) + chr(1099 - 1044), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2331 - 2280) + chr(0b10 + 0o56) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + '\062' + chr(0b11101 + 0o26) + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + chr(0b110001 + 0o76) + '\x32' + chr(0b110010 + 0o0) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\066' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(832 - 784) + '\x6f' + chr(0b110001) + chr(0b11011 + 0o32) + chr(847 - 797), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(9898 - 9787) + chr(1038 - 987) + '\x31' + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(52) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(0b110001) + chr(0b100000 + 0o27), 18729 - 18721), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(2737 - 2684) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b100101 + 0o112) + '\x32' + chr(48) + chr(48), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(0b1011 + 0o46), 0b1000), ehT0Px3KOsy9(chr(2077 - 2029) + chr(0b1000 + 0o147) + '\063' + chr(53) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + '\061' + chr(0b110100) + chr(50), 62893 - 62885), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\067' + '\066', 0b1000), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\157' + chr(0b10 + 0o61) + chr(51) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(2068 - 2020) + chr(111) + '\x32' + '\067' + '\x35', 37321 - 37313), ehT0Px3KOsy9('\060' + '\x6f' + '\066' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b100001 + 0o22) + chr(0b110010) + chr(2245 - 2191), 8), ehT0Px3KOsy9('\x30' + chr(6080 - 5969) + chr(50) + chr(52) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1001010 + 0o45) + chr(0b10101 + 0o35) + chr(53) + chr(2237 - 2183), 38831 - 38823), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + '\x34' + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\066' + chr(1034 - 984), 31106 - 31098), ehT0Px3KOsy9(chr(1972 - 1924) + chr(0b1101111) + chr(0b110011) + chr(0b110001 + 0o4), 55031 - 55023), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(1043 - 995) + chr(0b1101111) + chr(0b10010 + 0o41) + chr(1182 - 1128) + chr(0b110100), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + '\065' + chr(0b11010 + 0o26), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xee'), chr(2205 - 2105) + chr(0b1010011 + 0o22) + chr(0b1100011) + '\x6f' + chr(100) + chr(101))('\x75' + chr(0b1100111 + 0o15) + '\x66' + chr(1991 - 1946) + chr(1420 - 1364)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Nf6VSyAHeUJI(oVre8I6UXc3b, fsKNe8onWqjT, KvSmPUitKt7D):
def JLS35bj2kwjB(mEN91FZ3yLGG, FihFP7vRO4zT):
uSBCRSw0LUmo = FihFP7vRO4zT.split(oVre8I6UXc3b._resource_ref_separator)
if c2A0yzQpDQB3(uSBCRSw0LUmo) < ehT0Px3KOsy9('\x30' + chr(0b1011001 + 0o26) + '\062', 26635 - 26627):
return mEN91FZ3yLGG
NpZr66MdBhVG = uSBCRSw0LUmo[ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(48), ord("\x08"))]
FL7SmUoxlR9h = uSBCRSw0LUmo[ehT0Px3KOsy9('\060' + '\x6f' + chr(49), 18238 - 18230)]
ikyZID2DzuoC = KvSmPUitKt7D.get(NpZr66MdBhVG, FL7SmUoxlR9h)
if not ikyZID2DzuoC:
return mEN91FZ3yLGG
BurJ9iC99sVD = oVre8I6UXc3b._resource_ref_separator._oWXztVNnqHF([NpZr66MdBhVG, FL7SmUoxlR9h])
return xafqLlk3kkUe(mEN91FZ3yLGG, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2\x97\x96Uh`\x81'), '\x64' + '\145' + chr(0b1100011) + chr(0b1101111) + '\144' + chr(101))('\x75' + chr(116) + '\x66' + '\x2d' + chr(56)))(BurJ9iC99sVD, ikyZID2DzuoC)
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\x9a\x87Wmo\x81\xb1\xeb^\xb4\xdf\xa6O\xc3\xa9\xf1\xfe'), chr(0b1000100 + 0o40) + chr(0b1100101) + '\143' + chr(111) + '\144' + '\x65')(chr(0b10 + 0o163) + chr(10089 - 9973) + '\x66' + chr(0b101101) + chr(0b110101 + 0o3)))(fsKNe8onWqjT, JLS35bj2kwjB)
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
SubAction.resolve_resource_id_refs
|
def resolve_resource_id_refs(self, input_dict, supported_resource_id_refs):
"""
Resolves reference to some property of a resource. Inside string to be substituted, there could be either a
"Ref" or a "GetAtt" usage of this property. They have to be handled differently.
Ref usages are directly converted to a Ref on the resolved value. GetAtt usages are split under the assumption
that there can be only one property of resource referenced here. Everything else is an attribute reference.
Example:
Let's say `LogicalId` will be resolved to `NewLogicalId`
Ref usage:
${LogicalId} => ${NewLogicalId}
GetAtt usage:
${LogicalId.Arn} => ${NewLogicalId.Arn}
${LogicalId.Attr1.Attr2} => {NewLogicalId.Attr1.Attr2}
:param input_dict: Dictionary to be resolved
:param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones.
:return: Resolved dictionary
"""
def do_replacement(full_ref, ref_value):
"""
Perform the appropriate replacement to handle ${LogicalId} type references inside a Sub.
This method is called to get the replacement string for each reference within Sub's value
:param full_ref: Entire reference string such as "${LogicalId.Property}"
:param ref_value: Just the value of the reference such as "LogicalId.Property"
:return: Resolved reference of the structure "${SomeOtherLogicalId}". Result should always include the
${} structure since we are not resolving to final value, but just converting one reference to another
"""
# Split the value by separator, expecting to separate out LogicalId
splits = ref_value.split(self._resource_ref_separator)
# If we don't find at least one part, there is nothing to resolve
if len(splits) < 1:
return full_ref
logical_id = splits[0]
resolved_value = supported_resource_id_refs.get(logical_id)
if not resolved_value:
# This ID/property combination is not in the supported references
return full_ref
# We found a LogicalId.Property combination that can be resolved. Construct the output by replacing
# the part of the reference string and not constructing a new ref. This allows us to support GetAtt-like
# syntax and retain other attributes. Ex: ${LogicalId.Property.Arn} => ${SomeOtherLogicalId.Arn}
return full_ref.replace(logical_id, resolved_value)
return self._handle_sub_action(input_dict, do_replacement)
|
python
|
def resolve_resource_id_refs(self, input_dict, supported_resource_id_refs):
"""
Resolves reference to some property of a resource. Inside string to be substituted, there could be either a
"Ref" or a "GetAtt" usage of this property. They have to be handled differently.
Ref usages are directly converted to a Ref on the resolved value. GetAtt usages are split under the assumption
that there can be only one property of resource referenced here. Everything else is an attribute reference.
Example:
Let's say `LogicalId` will be resolved to `NewLogicalId`
Ref usage:
${LogicalId} => ${NewLogicalId}
GetAtt usage:
${LogicalId.Arn} => ${NewLogicalId.Arn}
${LogicalId.Attr1.Attr2} => {NewLogicalId.Attr1.Attr2}
:param input_dict: Dictionary to be resolved
:param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones.
:return: Resolved dictionary
"""
def do_replacement(full_ref, ref_value):
"""
Perform the appropriate replacement to handle ${LogicalId} type references inside a Sub.
This method is called to get the replacement string for each reference within Sub's value
:param full_ref: Entire reference string such as "${LogicalId.Property}"
:param ref_value: Just the value of the reference such as "LogicalId.Property"
:return: Resolved reference of the structure "${SomeOtherLogicalId}". Result should always include the
${} structure since we are not resolving to final value, but just converting one reference to another
"""
# Split the value by separator, expecting to separate out LogicalId
splits = ref_value.split(self._resource_ref_separator)
# If we don't find at least one part, there is nothing to resolve
if len(splits) < 1:
return full_ref
logical_id = splits[0]
resolved_value = supported_resource_id_refs.get(logical_id)
if not resolved_value:
# This ID/property combination is not in the supported references
return full_ref
# We found a LogicalId.Property combination that can be resolved. Construct the output by replacing
# the part of the reference string and not constructing a new ref. This allows us to support GetAtt-like
# syntax and retain other attributes. Ex: ${LogicalId.Property.Arn} => ${SomeOtherLogicalId.Arn}
return full_ref.replace(logical_id, resolved_value)
return self._handle_sub_action(input_dict, do_replacement)
|
[
"def",
"resolve_resource_id_refs",
"(",
"self",
",",
"input_dict",
",",
"supported_resource_id_refs",
")",
":",
"def",
"do_replacement",
"(",
"full_ref",
",",
"ref_value",
")",
":",
"\"\"\"\n Perform the appropriate replacement to handle ${LogicalId} type references inside a Sub.\n This method is called to get the replacement string for each reference within Sub's value\n\n :param full_ref: Entire reference string such as \"${LogicalId.Property}\"\n :param ref_value: Just the value of the reference such as \"LogicalId.Property\"\n :return: Resolved reference of the structure \"${SomeOtherLogicalId}\". Result should always include the\n ${} structure since we are not resolving to final value, but just converting one reference to another\n \"\"\"",
"# Split the value by separator, expecting to separate out LogicalId",
"splits",
"=",
"ref_value",
".",
"split",
"(",
"self",
".",
"_resource_ref_separator",
")",
"# If we don't find at least one part, there is nothing to resolve",
"if",
"len",
"(",
"splits",
")",
"<",
"1",
":",
"return",
"full_ref",
"logical_id",
"=",
"splits",
"[",
"0",
"]",
"resolved_value",
"=",
"supported_resource_id_refs",
".",
"get",
"(",
"logical_id",
")",
"if",
"not",
"resolved_value",
":",
"# This ID/property combination is not in the supported references",
"return",
"full_ref",
"# We found a LogicalId.Property combination that can be resolved. Construct the output by replacing",
"# the part of the reference string and not constructing a new ref. This allows us to support GetAtt-like",
"# syntax and retain other attributes. Ex: ${LogicalId.Property.Arn} => ${SomeOtherLogicalId.Arn}",
"return",
"full_ref",
".",
"replace",
"(",
"logical_id",
",",
"resolved_value",
")",
"return",
"self",
".",
"_handle_sub_action",
"(",
"input_dict",
",",
"do_replacement",
")"
] |
Resolves reference to some property of a resource. Inside string to be substituted, there could be either a
"Ref" or a "GetAtt" usage of this property. They have to be handled differently.
Ref usages are directly converted to a Ref on the resolved value. GetAtt usages are split under the assumption
that there can be only one property of resource referenced here. Everything else is an attribute reference.
Example:
Let's say `LogicalId` will be resolved to `NewLogicalId`
Ref usage:
${LogicalId} => ${NewLogicalId}
GetAtt usage:
${LogicalId.Arn} => ${NewLogicalId.Arn}
${LogicalId.Attr1.Attr2} => {NewLogicalId.Attr1.Attr2}
:param input_dict: Dictionary to be resolved
:param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones.
:return: Resolved dictionary
|
[
"Resolves",
"reference",
"to",
"some",
"property",
"of",
"a",
"resource",
".",
"Inside",
"string",
"to",
"be",
"substituted",
"there",
"could",
"be",
"either",
"a",
"Ref",
"or",
"a",
"GetAtt",
"usage",
"of",
"this",
"property",
".",
"They",
"have",
"to",
"be",
"handled",
"differently",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L255-L309
|
train
|
Resolves the resource id references in the given dictionary.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60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,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + chr(50) + '\x35' + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(53) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b110010 + 0o2), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1000110 + 0o51) + '\063' + '\x33' + '\061', 41860 - 41852), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(0b110111) + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + chr(885 - 833) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(102 - 54) + '\x6f' + '\x31' + chr(2332 - 2283) + chr(1368 - 1314), ord("\x08")), ehT0Px3KOsy9(chr(1022 - 974) + chr(1117 - 1006) + '\x32' + chr(0b10 + 0o56), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + '\061' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1971 - 1921) + chr(0b100101 + 0o20) + chr(53), 55470 - 55462), ehT0Px3KOsy9('\x30' + chr(0b110001 + 0o76) + '\061' + '\x36' + '\x37', 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + chr(0b110011) + chr(0b101101 + 0o5) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(0b100001 + 0o116) + chr(2212 - 2161) + chr(54) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + '\062' + chr(53) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\060' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + chr(0b1110 + 0o47) + chr(82 - 31), 0b1000), ehT0Px3KOsy9(chr(2155 - 2107) + chr(8713 - 8602) + chr(2496 - 2445) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1000010 + 0o55) + chr(0b110011) + chr(0b10101 + 0o35) + chr(48), 0o10), ehT0Px3KOsy9(chr(752 - 704) + chr(111) + chr(51) + '\065' + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100000 + 0o117) + chr(50) + chr(0b110100) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + '\067' + chr(55), 43458 - 43450), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110101) + chr(0b100011 + 0o24), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(780 - 729) + chr(51) + chr(1527 - 1472), 19940 - 19932), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11010 + 0o31) + chr(0b110101 + 0o0) + chr(860 - 811), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1000010 + 0o55) + chr(1586 - 1537) + chr(0b110001) + chr(0b1110 + 0o44), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\067' + '\x35', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(1962 - 1911) + chr(53) + '\062', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1110 + 0o43) + chr(54) + chr(2610 - 2556), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5218 - 5107) + '\061' + '\x34' + chr(54), 35404 - 35396), ehT0Px3KOsy9(chr(1457 - 1409) + chr(0b1101111) + chr(0b110010) + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + '\063' + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(10047 - 9936) + '\061' + chr(54) + chr(0b101110 + 0o10), 8), ehT0Px3KOsy9(chr(1777 - 1729) + '\157' + chr(52) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(0b110011) + chr(2177 - 2126), 61953 - 61945), ehT0Px3KOsy9(chr(0b110000) + chr(5604 - 5493) + '\x32' + chr(0b110010) + chr(2139 - 2087), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(55) + chr(0b10110 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + '\062' + chr(54) + chr(0b110100 + 0o1), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b0 + 0o157) + chr(0b110011) + '\065' + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + '\067' + '\065', 13107 - 13099)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1000101 + 0o52) + chr(0b110101) + '\060', 38509 - 38501)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x84'), '\144' + chr(0b1000001 + 0o44) + '\143' + '\157' + chr(0b1100100) + '\145')('\x75' + chr(3928 - 3812) + chr(319 - 217) + chr(0b10101 + 0o30) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def lvz_X3e0o7aG(oVre8I6UXc3b, fsKNe8onWqjT, Xwr_NWMclJnm):
def JLS35bj2kwjB(mEN91FZ3yLGG, FihFP7vRO4zT):
uSBCRSw0LUmo = FihFP7vRO4zT.split(oVre8I6UXc3b._resource_ref_separator)
if c2A0yzQpDQB3(uSBCRSw0LUmo) < ehT0Px3KOsy9('\x30' + chr(0b1010010 + 0o35) + '\061', ord("\x08")):
return mEN91FZ3yLGG
NpZr66MdBhVG = uSBCRSw0LUmo[ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x30', ord("\x08"))]
ikyZID2DzuoC = Xwr_NWMclJnm.get(NpZr66MdBhVG)
if not ikyZID2DzuoC:
return mEN91FZ3yLGG
return xafqLlk3kkUe(mEN91FZ3yLGG, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\x8dl\xb5\x1b{\x05'), chr(0b11101 + 0o107) + '\145' + chr(99) + '\x6f' + chr(0b1000011 + 0o41) + chr(9603 - 9502))(chr(117) + chr(0b1110100) + chr(102) + '\x2d' + chr(56)))(NpZr66MdBhVG, ikyZID2DzuoC)
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\x80}\xb7\x1et\x05\x11c\xbf\xcf(\xb6\x96\xdc\xadDu'), chr(0b1100100) + '\x65' + chr(339 - 240) + chr(0b1101111) + chr(0b1010110 + 0o16) + chr(0b1100101))('\165' + '\x74' + '\x66' + chr(45) + '\070'))(fsKNe8onWqjT, JLS35bj2kwjB)
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
SubAction._handle_sub_action
|
def _handle_sub_action(self, input_dict, handler):
"""
Handles resolving replacements in the Sub action based on the handler that is passed as an input.
:param input_dict: Dictionary to be resolved
:param supported_values: One of several different objects that contain the supported values that
need to be changed. See each method above for specifics on these objects.
:param handler: handler that is specific to each implementation.
:return: Resolved value of the Sub dictionary
"""
if not self.can_handle(input_dict):
return input_dict
key = self.intrinsic_name
sub_value = input_dict[key]
input_dict[key] = self._handle_sub_value(sub_value, handler)
return input_dict
|
python
|
def _handle_sub_action(self, input_dict, handler):
"""
Handles resolving replacements in the Sub action based on the handler that is passed as an input.
:param input_dict: Dictionary to be resolved
:param supported_values: One of several different objects that contain the supported values that
need to be changed. See each method above for specifics on these objects.
:param handler: handler that is specific to each implementation.
:return: Resolved value of the Sub dictionary
"""
if not self.can_handle(input_dict):
return input_dict
key = self.intrinsic_name
sub_value = input_dict[key]
input_dict[key] = self._handle_sub_value(sub_value, handler)
return input_dict
|
[
"def",
"_handle_sub_action",
"(",
"self",
",",
"input_dict",
",",
"handler",
")",
":",
"if",
"not",
"self",
".",
"can_handle",
"(",
"input_dict",
")",
":",
"return",
"input_dict",
"key",
"=",
"self",
".",
"intrinsic_name",
"sub_value",
"=",
"input_dict",
"[",
"key",
"]",
"input_dict",
"[",
"key",
"]",
"=",
"self",
".",
"_handle_sub_value",
"(",
"sub_value",
",",
"handler",
")",
"return",
"input_dict"
] |
Handles resolving replacements in the Sub action based on the handler that is passed as an input.
:param input_dict: Dictionary to be resolved
:param supported_values: One of several different objects that contain the supported values that
need to be changed. See each method above for specifics on these objects.
:param handler: handler that is specific to each implementation.
:return: Resolved value of the Sub dictionary
|
[
"Handles",
"resolving",
"replacements",
"in",
"the",
"Sub",
"action",
"based",
"on",
"the",
"handler",
"that",
"is",
"passed",
"as",
"an",
"input",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L311-L329
|
train
|
Handles resolving replacements in the Sub action based on the handler that is passed as an input.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7w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hgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(4754 - 4643) + chr(51) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010010 + 0o35) + chr(1525 - 1474) + chr(0b110001 + 0o2) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(0b10101 + 0o37) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4721 - 4610) + chr(0b101110 + 0o7), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + chr(0b1000 + 0o53) + '\062' + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(50) + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1010 + 0o50), 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + '\x33' + '\x36' + chr(52), 0b1000), ehT0Px3KOsy9(chr(1797 - 1749) + chr(111) + chr(0b100111 + 0o13) + chr(348 - 297) + '\063', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010001 + 0o36) + chr(2128 - 2079) + chr(51) + chr(0b11001 + 0o27), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\062' + '\062' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + '\065' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101000 + 0o7) + '\x33' + chr(0b110101) + '\x35', 8), ehT0Px3KOsy9('\060' + chr(2287 - 2176) + chr(0b110010) + chr(1104 - 1050) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + chr(0b110011) + '\066' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x37' + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + chr(0b10101 + 0o132) + chr(0b110110) + '\x33', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101001 + 0o12) + chr(0b110111) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(2919 - 2864) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + chr(0b110010) + chr(51), 56889 - 56881), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100000 + 0o21) + chr(0b110101) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(2315 - 2265) + chr(0b110111) + chr(2666 - 2611), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(53) + chr(1472 - 1423), 41739 - 41731), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + '\067' + '\x34', 0o10), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + '\x32' + chr(0b100011 + 0o21) + chr(0b110101), 34673 - 34665), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b100 + 0o61) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x35' + chr(52), 0b1000), ehT0Px3KOsy9(chr(48) + chr(5557 - 5446) + chr(50) + chr(0b11111 + 0o26) + chr(0b110111), 20711 - 20703), ehT0Px3KOsy9(chr(1885 - 1837) + '\x6f' + chr(0b11111 + 0o30) + '\x32', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10110 + 0o37) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\157' + chr(51) + '\x30' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + chr(2279 - 2230) + '\060' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1010011 + 0o34) + chr(51) + '\x31', 32448 - 32440), ehT0Px3KOsy9(chr(2194 - 2146) + chr(111) + chr(0b110010) + chr(0b1 + 0o65) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\063' + '\x35', 0o10), ehT0Px3KOsy9(chr(1811 - 1763) + '\x6f' + '\x33' + chr(53), 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b100111 + 0o14) + chr(921 - 873) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(893 - 845) + chr(11765 - 11654) + chr(0b110001) + chr(658 - 607) + chr(562 - 508), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b110000 + 0o77) + chr(54) + '\066', 62519 - 62511), ehT0Px3KOsy9(chr(1304 - 1256) + chr(0b11100 + 0o123) + '\x31' + chr(0b0 + 0o63) + '\x36', 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + chr(1871 - 1818) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'5'), chr(100) + chr(3159 - 3058) + chr(2333 - 2234) + chr(0b1000 + 0o147) + chr(0b1010 + 0o132) + '\145')(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(45) + chr(419 - 363)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def vDXOVoI1_BpF(oVre8I6UXc3b, fsKNe8onWqjT, I_GTmuOABRzI):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'x\xbf\x8eZ\xbe\xf3l\x90\xf7='), chr(100) + '\x65' + chr(0b1100010 + 0o1) + chr(0b111001 + 0o66) + chr(0b101011 + 0o71) + chr(0b101001 + 0o74))(chr(10993 - 10876) + chr(1475 - 1359) + chr(0b1000101 + 0o41) + '\x2d' + '\x38'))(fsKNe8onWqjT):
return fsKNe8onWqjT
K3J4ZwSlE0sT = oVre8I6UXc3b.intrinsic_name
BlZg_977Hom1 = fsKNe8onWqjT[K3J4ZwSlE0sT]
fsKNe8onWqjT[K3J4ZwSlE0sT] = oVre8I6UXc3b._handle_sub_value(BlZg_977Hom1, I_GTmuOABRzI)
return fsKNe8onWqjT
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
SubAction._handle_sub_value
|
def _handle_sub_value(self, sub_value, handler_method):
"""
Generic method to handle value to Fn::Sub key. We are interested in parsing the ${} syntaxes inside
the string portion of the value.
:param sub_value: Value of the Sub function
:param handler_method: Method to be called on every occurrence of `${LogicalId}` structure within the string.
Implementation could resolve and replace this structure with whatever they seem fit
:return: Resolved value of the Sub dictionary
"""
# Just handle known references within the string to be substituted and return the whole dictionary
# because that's the best we can do here.
if isinstance(sub_value, string_types):
# Ex: {Fn::Sub: "some string"}
sub_value = self._sub_all_refs(sub_value, handler_method)
elif isinstance(sub_value, list) and len(sub_value) > 0 and isinstance(sub_value[0], string_types):
# Ex: {Fn::Sub: ["some string", {a:b}] }
sub_value[0] = self._sub_all_refs(sub_value[0], handler_method)
return sub_value
|
python
|
def _handle_sub_value(self, sub_value, handler_method):
"""
Generic method to handle value to Fn::Sub key. We are interested in parsing the ${} syntaxes inside
the string portion of the value.
:param sub_value: Value of the Sub function
:param handler_method: Method to be called on every occurrence of `${LogicalId}` structure within the string.
Implementation could resolve and replace this structure with whatever they seem fit
:return: Resolved value of the Sub dictionary
"""
# Just handle known references within the string to be substituted and return the whole dictionary
# because that's the best we can do here.
if isinstance(sub_value, string_types):
# Ex: {Fn::Sub: "some string"}
sub_value = self._sub_all_refs(sub_value, handler_method)
elif isinstance(sub_value, list) and len(sub_value) > 0 and isinstance(sub_value[0], string_types):
# Ex: {Fn::Sub: ["some string", {a:b}] }
sub_value[0] = self._sub_all_refs(sub_value[0], handler_method)
return sub_value
|
[
"def",
"_handle_sub_value",
"(",
"self",
",",
"sub_value",
",",
"handler_method",
")",
":",
"# Just handle known references within the string to be substituted and return the whole dictionary",
"# because that's the best we can do here.",
"if",
"isinstance",
"(",
"sub_value",
",",
"string_types",
")",
":",
"# Ex: {Fn::Sub: \"some string\"}",
"sub_value",
"=",
"self",
".",
"_sub_all_refs",
"(",
"sub_value",
",",
"handler_method",
")",
"elif",
"isinstance",
"(",
"sub_value",
",",
"list",
")",
"and",
"len",
"(",
"sub_value",
")",
">",
"0",
"and",
"isinstance",
"(",
"sub_value",
"[",
"0",
"]",
",",
"string_types",
")",
":",
"# Ex: {Fn::Sub: [\"some string\", {a:b}] }",
"sub_value",
"[",
"0",
"]",
"=",
"self",
".",
"_sub_all_refs",
"(",
"sub_value",
"[",
"0",
"]",
",",
"handler_method",
")",
"return",
"sub_value"
] |
Generic method to handle value to Fn::Sub key. We are interested in parsing the ${} syntaxes inside
the string portion of the value.
:param sub_value: Value of the Sub function
:param handler_method: Method to be called on every occurrence of `${LogicalId}` structure within the string.
Implementation could resolve and replace this structure with whatever they seem fit
:return: Resolved value of the Sub dictionary
|
[
"Generic",
"method",
"to",
"handle",
"value",
"to",
"Fn",
"::",
"Sub",
"key",
".",
"We",
"are",
"interested",
"in",
"parsing",
"the",
"$",
"{}",
"syntaxes",
"inside",
"the",
"string",
"portion",
"of",
"the",
"value",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless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VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b111101 + 0o62) + chr(0b101001 + 0o10) + '\060' + '\062', 45805 - 45797), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\067' + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(1794 - 1743) + '\061', 23754 - 23746), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(3092 - 2981) + chr(0b110010) + '\066' + chr(2130 - 2075), 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(51) + '\061' + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + '\x32' + chr(0b100001 + 0o22), 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(1509 - 1398) + chr(0b10101 + 0o36) + '\065' + '\x31', 23486 - 23478), ehT0Px3KOsy9(chr(48) + chr(0b11 + 0o154) + chr(49) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + chr(51) + chr(0b110011) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11969 - 11858) + '\065' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4796 - 4685) + '\x33' + '\062' + chr(53), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10011 + 0o36) + chr(2065 - 2014) + chr(0b110010), 26578 - 26570), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\157' + chr(0b110001) + chr(1818 - 1764) + '\x36', 51580 - 51572), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(0b1100 + 0o47) + chr(0b1100 + 0o47) + chr(1727 - 1679), 8), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(0b110001) + chr(0b110101), 15458 - 15450), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(111) + chr(2451 - 2401) + '\x34' + chr(0b101111 + 0o3), 47508 - 47500), ehT0Px3KOsy9(chr(534 - 486) + '\x6f' + chr(0b110010) + '\064' + chr(1986 - 1937), 29334 - 29326), ehT0Px3KOsy9('\060' + chr(4025 - 3914) + chr(288 - 236) + '\064', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + '\x30' + chr(737 - 688), 32923 - 32915), ehT0Px3KOsy9(chr(915 - 867) + chr(0b1101110 + 0o1) + chr(1284 - 1231) + chr(1624 - 1570), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + '\x34' + chr(238 - 189), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(321 - 272) + '\x35' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101100 + 0o6) + chr(0b0 + 0o63) + chr(0b10 + 0o62), 55984 - 55976), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(103 - 54) + '\067', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(54) + chr(0b10101 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + '\063' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110010 + 0o75) + '\066' + chr(802 - 753), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8511 - 8400) + '\062' + '\x30' + chr(1522 - 1470), 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(7306 - 7195) + chr(0b1001 + 0o51) + chr(0b1000 + 0o50) + chr(1852 - 1804), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b0 + 0o62) + chr(0b11110 + 0o30), 0o10), ehT0Px3KOsy9(chr(1040 - 992) + chr(0b1101111) + '\061' + chr(0b110010) + '\x34', 0b1000), ehT0Px3KOsy9(chr(568 - 520) + chr(0b1101111) + chr(0b1001 + 0o52) + '\x35' + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49) + '\x35' + chr(2137 - 2086), 55926 - 55918), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1101111) + chr(1945 - 1895) + '\064' + chr(2253 - 2198), 0b1000), ehT0Px3KOsy9(chr(1997 - 1949) + '\x6f' + chr(0b100110 + 0o13) + chr(50) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + '\060' + chr(51), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + chr(1786 - 1737) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + '\x32' + '\x34', 59925 - 59917), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + chr(0b110110) + chr(1439 - 1388), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011100 + 0o23) + chr(1028 - 980), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\065' + chr(0b110000), 6592 - 6584)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'l'), chr(100) + chr(9967 - 9866) + chr(0b1010 + 0o131) + '\x6f' + chr(0b101101 + 0o67) + '\x65')(chr(0b1110101) + '\x74' + chr(10236 - 10134) + '\055' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ek4tsZEXlu5D(oVre8I6UXc3b, BlZg_977Hom1, whUqsIXToJNY):
if PlSM16l2KDPD(BlZg_977Hom1, sInLJQno9SRQ):
BlZg_977Hom1 = oVre8I6UXc3b._sub_all_refs(BlZg_977Hom1, whUqsIXToJNY)
elif PlSM16l2KDPD(BlZg_977Hom1, YyaZ4tpXu4lf) and c2A0yzQpDQB3(BlZg_977Hom1) > ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1111 + 0o41), 8) and PlSM16l2KDPD(BlZg_977Hom1[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110000), 8)], sInLJQno9SRQ):
BlZg_977Hom1[ehT0Px3KOsy9('\x30' + chr(111) + chr(48), 8)] = oVre8I6UXc3b._sub_all_refs(BlZg_977Hom1[ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101110 + 0o2), 8)], whUqsIXToJNY)
return BlZg_977Hom1
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
SubAction._sub_all_refs
|
def _sub_all_refs(self, text, handler_method):
"""
Substitute references within a string that is using ${key} syntax by calling the `handler_method` on every
occurrence of this structure. The value returned by this method directly replaces the reference structure.
Ex:
text = "${key1}-hello-${key2}
def handler_method(full_ref, ref_value):
return "foo"
_sub_all_refs(text, handler_method) will output "foo-hello-foo"
:param string text: Input text
:param handler_method: Method to be called to handle each occurrence of ${blah} reference structure.
First parameter to this method is the full reference structure Ex: ${LogicalId.Property}.
Second parameter is just the value of the reference such as "LogicalId.Property"
:return string: Text with all reference structures replaced as necessary
"""
# RegExp to find pattern "${logicalId.property}" and return the word inside bracket
logical_id_regex = '[A-Za-z0-9\.]+|AWS::[A-Z][A-Za-z]*'
ref_pattern = re.compile(r'\$\{(' + logical_id_regex + ')\}')
# Find all the pattern, and call the handler to decide how to substitute them.
# Do the substitution and return the final text
return re.sub(ref_pattern,
# Pass the handler entire string ${logicalId.property} as first parameter and "logicalId.property"
# as second parameter. Return value will be substituted
lambda match: handler_method(match.group(0), match.group(1)),
text)
|
python
|
def _sub_all_refs(self, text, handler_method):
"""
Substitute references within a string that is using ${key} syntax by calling the `handler_method` on every
occurrence of this structure. The value returned by this method directly replaces the reference structure.
Ex:
text = "${key1}-hello-${key2}
def handler_method(full_ref, ref_value):
return "foo"
_sub_all_refs(text, handler_method) will output "foo-hello-foo"
:param string text: Input text
:param handler_method: Method to be called to handle each occurrence of ${blah} reference structure.
First parameter to this method is the full reference structure Ex: ${LogicalId.Property}.
Second parameter is just the value of the reference such as "LogicalId.Property"
:return string: Text with all reference structures replaced as necessary
"""
# RegExp to find pattern "${logicalId.property}" and return the word inside bracket
logical_id_regex = '[A-Za-z0-9\.]+|AWS::[A-Z][A-Za-z]*'
ref_pattern = re.compile(r'\$\{(' + logical_id_regex + ')\}')
# Find all the pattern, and call the handler to decide how to substitute them.
# Do the substitution and return the final text
return re.sub(ref_pattern,
# Pass the handler entire string ${logicalId.property} as first parameter and "logicalId.property"
# as second parameter. Return value will be substituted
lambda match: handler_method(match.group(0), match.group(1)),
text)
|
[
"def",
"_sub_all_refs",
"(",
"self",
",",
"text",
",",
"handler_method",
")",
":",
"# RegExp to find pattern \"${logicalId.property}\" and return the word inside bracket",
"logical_id_regex",
"=",
"'[A-Za-z0-9\\.]+|AWS::[A-Z][A-Za-z]*'",
"ref_pattern",
"=",
"re",
".",
"compile",
"(",
"r'\\$\\{('",
"+",
"logical_id_regex",
"+",
"')\\}'",
")",
"# Find all the pattern, and call the handler to decide how to substitute them.",
"# Do the substitution and return the final text",
"return",
"re",
".",
"sub",
"(",
"ref_pattern",
",",
"# Pass the handler entire string ${logicalId.property} as first parameter and \"logicalId.property\"",
"# as second parameter. Return value will be substituted",
"lambda",
"match",
":",
"handler_method",
"(",
"match",
".",
"group",
"(",
"0",
")",
",",
"match",
".",
"group",
"(",
"1",
")",
")",
",",
"text",
")"
] |
Substitute references within a string that is using ${key} syntax by calling the `handler_method` on every
occurrence of this structure. The value returned by this method directly replaces the reference structure.
Ex:
text = "${key1}-hello-${key2}
def handler_method(full_ref, ref_value):
return "foo"
_sub_all_refs(text, handler_method) will output "foo-hello-foo"
:param string text: Input text
:param handler_method: Method to be called to handle each occurrence of ${blah} reference structure.
First parameter to this method is the full reference structure Ex: ${LogicalId.Property}.
Second parameter is just the value of the reference such as "LogicalId.Property"
:return string: Text with all reference structures replaced as necessary
|
[
"Substitute",
"references",
"within",
"a",
"string",
"that",
"is",
"using",
"$",
"{",
"key",
"}",
"syntax",
"by",
"calling",
"the",
"handler_method",
"on",
"every",
"occurrence",
"of",
"this",
"structure",
".",
"The",
"value",
"returned",
"by",
"this",
"method",
"directly",
"replaces",
"the",
"reference",
"structure",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L354-L384
|
train
|
Substitute references within a string that is using the syntax specified by handler_method.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HH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W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1440 - 1390) + chr(48) + '\066', 36824 - 36816), ehT0Px3KOsy9('\x30' + chr(0b110001 + 0o76) + chr(0b100011 + 0o16) + chr(55) + chr(0b10001 + 0o41), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(395 - 342) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101111) + '\x32' + chr(2056 - 2006) + chr(0b110011 + 0o4), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\x32' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + '\064' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(449 - 338) + chr(574 - 525) + chr(0b110000 + 0o7) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1608 - 1559) + chr(52) + '\x33', 41422 - 41414), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(0b11101 + 0o27), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1391 - 1340) + '\x31' + chr(0b110000 + 0o4), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(51), 44611 - 44603), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + chr(1002 - 953) + chr(48) + chr(0b10010 + 0o41), 41256 - 41248), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(0b110000) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + '\x32' + '\067' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + chr(1025 - 971) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(8902 - 8791) + chr(588 - 533) + chr(0b11111 + 0o24), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\067' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2209 - 2158) + chr(0b110000) + chr(1501 - 1453), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(6343 - 6232) + chr(1839 - 1790) + chr(0b0 + 0o67) + chr(55), 0o10), ehT0Px3KOsy9('\x30' + chr(4887 - 4776) + chr(1958 - 1907) + chr(0b100011 + 0o17) + chr(0b110100), 49345 - 49337), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(0b110011) + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(1530 - 1478) + chr(48), 27890 - 27882), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(0b11 + 0o55) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\x33' + chr(53), 15003 - 14995), ehT0Px3KOsy9(chr(954 - 906) + chr(111) + '\x32' + chr(0b110011) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1684 - 1635) + chr(0b110011) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(49) + chr(0b10110 + 0o33), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(49) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + chr(10302 - 10191) + chr(0b110011) + chr(741 - 689) + chr(0b110011), 16166 - 16158), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(50) + chr(0b11010 + 0o26), 0o10), ehT0Px3KOsy9(chr(48) + chr(9154 - 9043) + '\x33' + '\x35' + '\067', 0b1000), ehT0Px3KOsy9(chr(1920 - 1872) + chr(111) + '\x32' + chr(0b101111 + 0o10) + '\x31', 59882 - 59874), ehT0Px3KOsy9(chr(976 - 928) + chr(5322 - 5211) + chr(50) + chr(0b10111 + 0o37) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x33' + chr(52), 8), ehT0Px3KOsy9(chr(48) + chr(1544 - 1433) + chr(0b110001) + '\060' + chr(0b101110 + 0o6), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(2237 - 2187) + chr(1411 - 1356) + chr(0b110001), 8), ehT0Px3KOsy9(chr(584 - 536) + chr(111) + chr(51) + chr(54) + chr(318 - 266), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(787 - 738) + chr(0b110101), 1790 - 1782)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(53) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8'), chr(0b110 + 0o136) + chr(101) + '\143' + chr(111) + chr(2411 - 2311) + chr(0b1100101))(chr(2600 - 2483) + chr(976 - 860) + chr(3578 - 3476) + '\055' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def irY_wNw2FjtY(oVre8I6UXc3b, Ah1rInvg48Hb, whUqsIXToJNY):
ca_lP4SoCugM = xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd;@\xcd19\x9eHN%\x90%\x1e\xaa\xc6D\xe2hD\xfa$\x95\xf3z\x9f\x86\xddpS\xa8\xce\xaa\xb2\x93'), '\144' + chr(101) + chr(99) + chr(0b1011110 + 0o21) + chr(6875 - 6775) + '\x65')(chr(0b1110101) + chr(116) + chr(102) + chr(1581 - 1536) + chr(0b110101 + 0o3))
Wei6SdB_4Ud5 = _7u55U49WwX2.compile(xafqLlk3kkUe(SXOLrMavuUCe(b'\xda^1\xecx'), '\x64' + chr(8585 - 8484) + chr(0b1100011) + chr(2294 - 2183) + chr(0b1100100) + chr(0b11000 + 0o115))(chr(0b1110101) + chr(0b1110100) + chr(171 - 69) + '\x2d' + '\070') + ca_lP4SoCugM + xafqLlk3kkUe(SXOLrMavuUCe(b'\xaf&\x10'), chr(100) + chr(4073 - 3972) + chr(0b1001111 + 0o24) + chr(0b1101111) + '\144' + chr(0b1010001 + 0o24))(chr(117) + chr(0b1010010 + 0o42) + chr(5577 - 5475) + '\x2d' + chr(56)))
return xafqLlk3kkUe(_7u55U49WwX2, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\x0f\x0f'), '\144' + '\x65' + chr(0b11111 + 0o104) + '\x6f' + chr(0b1100100) + '\x65')(chr(117) + '\x74' + chr(0b10110 + 0o120) + chr(0b101101) + chr(56)))(Wei6SdB_4Ud5, lambda AZi1vqvu7T1_: whUqsIXToJNY(xafqLlk3kkUe(AZi1vqvu7T1_, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8C8\xf9=M\x92\x194-\xbcD'), chr(6357 - 6257) + '\145' + chr(0b1100011) + chr(9064 - 8953) + '\144' + '\x65')(chr(158 - 41) + '\164' + '\146' + chr(0b11 + 0o52) + chr(0b111000)))(ehT0Px3KOsy9('\x30' + chr(111) + chr(48), 0b1000)), xafqLlk3kkUe(AZi1vqvu7T1_, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8C8\xf9=M\x92\x194-\xbcD'), chr(100) + chr(0b110011 + 0o62) + chr(99) + '\157' + '\144' + chr(8338 - 8237))('\x75' + chr(10899 - 10783) + chr(0b1100110) + '\x2d' + chr(56)))(ehT0Px3KOsy9('\060' + chr(0b110011 + 0o74) + '\x31', ord("\x08")))), Ah1rInvg48Hb)
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
GetAttAction.resolve_resource_refs
|
def resolve_resource_refs(self, input_dict, supported_resource_refs):
"""
Resolve resource references within a GetAtt dict.
Example:
{ "Fn::GetAtt": ["LogicalId.Property", "Arn"] } => {"Fn::GetAtt": ["ResolvedLogicalId", "Arn"]}
Theoretically, only the first element of the array can contain reference to SAM resources. The second element
is name of an attribute (like Arn) of the resource.
However tools like AWS CLI apply the assumption that first element of the array is a LogicalId and cannot
contain a 'dot'. So they break at the first dot to convert YAML tag to JSON map like this:
`!GetAtt LogicalId.Property.Arn` => {"Fn::GetAtt": [ "LogicalId", "Property.Arn" ] }
Therefore to resolve the reference, we join the array into a string, break it back up to check if it contains
a known reference, and resolve it if we can.
:param input_dict: Dictionary to be resolved
:param samtransaltor.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Instance of
an `SupportedResourceReferences` object that contain value of the property.
:return: Resolved dictionary
"""
if not self.can_handle(input_dict):
return input_dict
key = self.intrinsic_name
value = input_dict[key]
# Value must be an array with *at least* two elements. If not, this is invalid GetAtt syntax. We just pass along
# the input to CFN for it to do the "official" validation.
if not isinstance(value, list) or len(value) < 2:
return input_dict
if (not all(isinstance(entry, string_types) for entry in value)):
raise InvalidDocumentException(
[InvalidTemplateException('Invalid GetAtt value {}. GetAtt expects an array with 2 strings.'
.format(value))])
# Value of GetAtt is an array. It can contain any number of elements, with first being the LogicalId of
# resource and rest being the attributes. In a SAM template, a reference to a resource can be used in the
# first parameter. However tools like AWS CLI might break them down as well. So let's just concatenate
# all elements, and break them into separate parts in a more standard way.
#
# Example:
# { Fn::GetAtt: ["LogicalId.Property", "Arn"] } is equivalent to { Fn::GetAtt: ["LogicalId", "Property.Arn"] }
# Former is the correct notation. However tools like AWS CLI can construct the later style.
# Let's normalize the value into "LogicalId.Property.Arn" to handle both scenarios
value_str = self._resource_ref_separator.join(value)
splits = value_str.split(self._resource_ref_separator)
logical_id = splits[0]
property = splits[1]
remaining = splits[2:] # if any
resolved_value = supported_resource_refs.get(logical_id, property)
return self._get_resolved_dictionary(input_dict, key, resolved_value, remaining)
|
python
|
def resolve_resource_refs(self, input_dict, supported_resource_refs):
"""
Resolve resource references within a GetAtt dict.
Example:
{ "Fn::GetAtt": ["LogicalId.Property", "Arn"] } => {"Fn::GetAtt": ["ResolvedLogicalId", "Arn"]}
Theoretically, only the first element of the array can contain reference to SAM resources. The second element
is name of an attribute (like Arn) of the resource.
However tools like AWS CLI apply the assumption that first element of the array is a LogicalId and cannot
contain a 'dot'. So they break at the first dot to convert YAML tag to JSON map like this:
`!GetAtt LogicalId.Property.Arn` => {"Fn::GetAtt": [ "LogicalId", "Property.Arn" ] }
Therefore to resolve the reference, we join the array into a string, break it back up to check if it contains
a known reference, and resolve it if we can.
:param input_dict: Dictionary to be resolved
:param samtransaltor.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Instance of
an `SupportedResourceReferences` object that contain value of the property.
:return: Resolved dictionary
"""
if not self.can_handle(input_dict):
return input_dict
key = self.intrinsic_name
value = input_dict[key]
# Value must be an array with *at least* two elements. If not, this is invalid GetAtt syntax. We just pass along
# the input to CFN for it to do the "official" validation.
if not isinstance(value, list) or len(value) < 2:
return input_dict
if (not all(isinstance(entry, string_types) for entry in value)):
raise InvalidDocumentException(
[InvalidTemplateException('Invalid GetAtt value {}. GetAtt expects an array with 2 strings.'
.format(value))])
# Value of GetAtt is an array. It can contain any number of elements, with first being the LogicalId of
# resource and rest being the attributes. In a SAM template, a reference to a resource can be used in the
# first parameter. However tools like AWS CLI might break them down as well. So let's just concatenate
# all elements, and break them into separate parts in a more standard way.
#
# Example:
# { Fn::GetAtt: ["LogicalId.Property", "Arn"] } is equivalent to { Fn::GetAtt: ["LogicalId", "Property.Arn"] }
# Former is the correct notation. However tools like AWS CLI can construct the later style.
# Let's normalize the value into "LogicalId.Property.Arn" to handle both scenarios
value_str = self._resource_ref_separator.join(value)
splits = value_str.split(self._resource_ref_separator)
logical_id = splits[0]
property = splits[1]
remaining = splits[2:] # if any
resolved_value = supported_resource_refs.get(logical_id, property)
return self._get_resolved_dictionary(input_dict, key, resolved_value, remaining)
|
[
"def",
"resolve_resource_refs",
"(",
"self",
",",
"input_dict",
",",
"supported_resource_refs",
")",
":",
"if",
"not",
"self",
".",
"can_handle",
"(",
"input_dict",
")",
":",
"return",
"input_dict",
"key",
"=",
"self",
".",
"intrinsic_name",
"value",
"=",
"input_dict",
"[",
"key",
"]",
"# Value must be an array with *at least* two elements. If not, this is invalid GetAtt syntax. We just pass along",
"# the input to CFN for it to do the \"official\" validation.",
"if",
"not",
"isinstance",
"(",
"value",
",",
"list",
")",
"or",
"len",
"(",
"value",
")",
"<",
"2",
":",
"return",
"input_dict",
"if",
"(",
"not",
"all",
"(",
"isinstance",
"(",
"entry",
",",
"string_types",
")",
"for",
"entry",
"in",
"value",
")",
")",
":",
"raise",
"InvalidDocumentException",
"(",
"[",
"InvalidTemplateException",
"(",
"'Invalid GetAtt value {}. GetAtt expects an array with 2 strings.'",
".",
"format",
"(",
"value",
")",
")",
"]",
")",
"# Value of GetAtt is an array. It can contain any number of elements, with first being the LogicalId of",
"# resource and rest being the attributes. In a SAM template, a reference to a resource can be used in the",
"# first parameter. However tools like AWS CLI might break them down as well. So let's just concatenate",
"# all elements, and break them into separate parts in a more standard way.",
"#",
"# Example:",
"# { Fn::GetAtt: [\"LogicalId.Property\", \"Arn\"] } is equivalent to { Fn::GetAtt: [\"LogicalId\", \"Property.Arn\"] }",
"# Former is the correct notation. However tools like AWS CLI can construct the later style.",
"# Let's normalize the value into \"LogicalId.Property.Arn\" to handle both scenarios",
"value_str",
"=",
"self",
".",
"_resource_ref_separator",
".",
"join",
"(",
"value",
")",
"splits",
"=",
"value_str",
".",
"split",
"(",
"self",
".",
"_resource_ref_separator",
")",
"logical_id",
"=",
"splits",
"[",
"0",
"]",
"property",
"=",
"splits",
"[",
"1",
"]",
"remaining",
"=",
"splits",
"[",
"2",
":",
"]",
"# if any",
"resolved_value",
"=",
"supported_resource_refs",
".",
"get",
"(",
"logical_id",
",",
"property",
")",
"return",
"self",
".",
"_get_resolved_dictionary",
"(",
"input_dict",
",",
"key",
",",
"resolved_value",
",",
"remaining",
")"
] |
Resolve resource references within a GetAtt dict.
Example:
{ "Fn::GetAtt": ["LogicalId.Property", "Arn"] } => {"Fn::GetAtt": ["ResolvedLogicalId", "Arn"]}
Theoretically, only the first element of the array can contain reference to SAM resources. The second element
is name of an attribute (like Arn) of the resource.
However tools like AWS CLI apply the assumption that first element of the array is a LogicalId and cannot
contain a 'dot'. So they break at the first dot to convert YAML tag to JSON map like this:
`!GetAtt LogicalId.Property.Arn` => {"Fn::GetAtt": [ "LogicalId", "Property.Arn" ] }
Therefore to resolve the reference, we join the array into a string, break it back up to check if it contains
a known reference, and resolve it if we can.
:param input_dict: Dictionary to be resolved
:param samtransaltor.intrinsics.resource_refs.SupportedResourceReferences supported_resource_refs: Instance of
an `SupportedResourceReferences` object that contain value of the property.
:return: Resolved dictionary
|
[
"Resolve",
"resource",
"references",
"within",
"a",
"GetAtt",
"dict",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L394-L452
|
train
|
Resolves resource references within a GetAtt dict.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_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ej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\x6f' + chr(0b110001) + chr(1225 - 1173) + chr(654 - 605), 0b1000), ehT0Px3KOsy9(chr(77 - 29) + '\x6f' + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100001 + 0o16) + chr(1210 - 1156) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(665 - 617) + chr(0b1010100 + 0o33) + '\061' + chr(0b1000 + 0o51) + chr(52), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(1763 - 1714) + chr(1327 - 1279) + chr(0b100010 + 0o24), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + chr(51) + chr(0b110110) + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(0b110000 + 0o2) + chr(1215 - 1167), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b101110 + 0o101) + chr(50) + chr(0b110111 + 0o0) + chr(347 - 299), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(4200 - 4089) + chr(0b10011 + 0o40) + '\x32' + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101011 + 0o10) + chr(0b110101) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(55) + chr(52), 40132 - 40124), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2573 - 2521) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(1258 - 1210) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(2259 - 2148) + '\x31' + chr(0b11000 + 0o30) + chr(0b10101 + 0o35), 48480 - 48472), ehT0Px3KOsy9(chr(48) + chr(1267 - 1156) + chr(51) + chr(0b110010), 42040 - 42032), ehT0Px3KOsy9(chr(767 - 719) + chr(0b110101 + 0o72) + chr(50) + '\x33' + '\060', 1677 - 1669), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(54) + chr(55), 59861 - 59853), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + '\x31' + chr(0b10100 + 0o40), 8), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1101111) + '\062' + chr(2407 - 2354) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b100011 + 0o114) + '\063' + chr(772 - 719) + '\x30', 8), ehT0Px3KOsy9(chr(348 - 300) + '\157' + '\063' + chr(50) + chr(0b101110 + 0o7), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b10000 + 0o137) + '\x31' + '\066' + chr(1751 - 1698), 20569 - 20561), ehT0Px3KOsy9(chr(0b110000) + chr(2725 - 2614) + chr(53) + chr(0b10001 + 0o45), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1632 - 1581) + chr(1723 - 1674) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(1526 - 1475) + '\064', 19378 - 19370), ehT0Px3KOsy9('\060' + chr(0b1011011 + 0o24) + '\x32' + chr(0b1010 + 0o47) + chr(55), 0o10), ehT0Px3KOsy9('\x30' + chr(4455 - 4344) + chr(0b110010) + chr(0b110110) + '\067', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(1946 - 1896) + '\063' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\157' + '\x32' + '\x37' + chr(0b100101 + 0o15), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(142 - 91) + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101010 + 0o5) + chr(1557 - 1507) + '\063' + chr(0b10010 + 0o44), 8), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(0b110011) + chr(0b1 + 0o57) + '\x34', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b111 + 0o54) + '\066' + '\066', 60086 - 60078), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + '\x35' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(1194 - 1146) + chr(0b1001010 + 0o45) + chr(425 - 374) + chr(0b1 + 0o63), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\064' + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(1201 - 1152) + chr(0b10001 + 0o43), 54472 - 54464), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(2565 - 2512) + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2143 - 2094) + '\x36' + chr(49), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(58 - 10) + chr(0b1101111) + '\065' + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'O'), '\x64' + chr(2497 - 2396) + chr(0b1100011) + chr(1911 - 1800) + chr(0b10000 + 0o124) + '\145')(chr(0b1100100 + 0o21) + '\x74' + chr(0b1100110) + '\055' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Nf6VSyAHeUJI(oVre8I6UXc3b, fsKNe8onWqjT, KvSmPUitKt7D):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x02b]\x13.\x93\xfe\xdc\xbd\x8d'), chr(2606 - 2506) + chr(5271 - 5170) + chr(99) + chr(3861 - 3750) + '\x64' + '\145')('\x75' + chr(116) + chr(0b1100110) + chr(45) + chr(0b111000)))(fsKNe8onWqjT):
return fsKNe8onWqjT
K3J4ZwSlE0sT = oVre8I6UXc3b.intrinsic_name
QmmgWUB13VCJ = fsKNe8onWqjT[K3J4ZwSlE0sT]
if not PlSM16l2KDPD(QmmgWUB13VCJ, YyaZ4tpXu4lf) or c2A0yzQpDQB3(QmmgWUB13VCJ) < ehT0Px3KOsy9(chr(48) + '\157' + '\x32', ord("\x08")):
return fsKNe8onWqjT
if not Dl48nj1rbi23((PlSM16l2KDPD(DuP5x7rEFa7R, sInLJQno9SRQ) for DuP5x7rEFa7R in QmmgWUB13VCJ)):
raise WAOffgnUIwTZ([pFZeGuJCK2EG(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'(mE-*\x9b\xf4\x98\x96\x8d\x88a\xb06:\xee\x96 \xdac\xc8\xae\x08\x00\xec\xdb\xea\xc3\xdf\xce(\xbe\xa1\x8e\x1byFx\xd8Q\x00m\x13-4\x80\xf1\xc1\xf1\x9f\x95T\xacb(\xb8\x848\xddo\x86\xb2\x06\x00'), chr(100) + chr(0b100 + 0o141) + chr(0b10110 + 0o115) + chr(111) + '\x64' + '\145')(chr(0b1110101) + chr(0b100 + 0o160) + chr(1847 - 1745) + chr(0b101101) + chr(0b100011 + 0o25)), xafqLlk3kkUe(SXOLrMavuUCe(b'77A#\x0e\x93\xc3\x8b\x81\x98\x99J'), '\144' + chr(0b1100101) + '\143' + '\x6f' + chr(100) + '\x65')(chr(117) + chr(12690 - 12574) + chr(0b1100100 + 0o2) + '\055' + '\x38'))(QmmgWUB13VCJ))])
dI8_yg4RJuV_ = oVre8I6UXc3b._resource_ref_separator._oWXztVNnqHF(QmmgWUB13VCJ)
uSBCRSw0LUmo = dI8_yg4RJuV_.split(oVre8I6UXc3b._resource_ref_separator)
NpZr66MdBhVG = uSBCRSw0LUmo[ehT0Px3KOsy9(chr(0b110000) + chr(11043 - 10932) + chr(0b101001 + 0o7), ord("\x08"))]
FL7SmUoxlR9h = uSBCRSw0LUmo[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001), 0o10)]
YMgVTlt59JZw = uSBCRSw0LUmo[ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + '\x32', 8):]
ikyZID2DzuoC = KvSmPUitKt7D.get(NpZr66MdBhVG, FL7SmUoxlR9h)
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'>dV8\x19\x80\xf5\xcb\xbe\x84\x8aE\xa0\x1d~\xf1\x948\xc6i\x86\xb4\x07W'), '\144' + '\145' + '\x63' + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1110101) + '\164' + chr(0b1010001 + 0o25) + '\055' + '\x38'))(fsKNe8onWqjT, K3J4ZwSlE0sT, ikyZID2DzuoC, YMgVTlt59JZw)
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
GetAttAction.resolve_resource_id_refs
|
def resolve_resource_id_refs(self, input_dict, supported_resource_id_refs):
"""
Resolve resource references within a GetAtt dict.
Example:
{ "Fn::GetAtt": ["LogicalId", "Arn"] } => {"Fn::GetAtt": ["ResolvedLogicalId", "Arn"]}
Theoretically, only the first element of the array can contain reference to SAM resources. The second element
is name of an attribute (like Arn) of the resource.
However tools like AWS CLI apply the assumption that first element of the array is a LogicalId and cannot
contain a 'dot'. So they break at the first dot to convert YAML tag to JSON map like this:
`!GetAtt LogicalId.Arn` => {"Fn::GetAtt": [ "LogicalId", "Arn" ] }
Therefore to resolve the reference, we join the array into a string, break it back up to check if it contains
a known reference, and resolve it if we can.
:param input_dict: Dictionary to be resolved
:param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones.
:return: Resolved dictionary
"""
if not self.can_handle(input_dict):
return input_dict
key = self.intrinsic_name
value = input_dict[key]
# Value must be an array with *at least* two elements. If not, this is invalid GetAtt syntax. We just pass along
# the input to CFN for it to do the "official" validation.
if not isinstance(value, list) or len(value) < 2:
return input_dict
value_str = self._resource_ref_separator.join(value)
splits = value_str.split(self._resource_ref_separator)
logical_id = splits[0]
remaining = splits[1:] # if any
resolved_value = supported_resource_id_refs.get(logical_id)
return self._get_resolved_dictionary(input_dict, key, resolved_value, remaining)
|
python
|
def resolve_resource_id_refs(self, input_dict, supported_resource_id_refs):
"""
Resolve resource references within a GetAtt dict.
Example:
{ "Fn::GetAtt": ["LogicalId", "Arn"] } => {"Fn::GetAtt": ["ResolvedLogicalId", "Arn"]}
Theoretically, only the first element of the array can contain reference to SAM resources. The second element
is name of an attribute (like Arn) of the resource.
However tools like AWS CLI apply the assumption that first element of the array is a LogicalId and cannot
contain a 'dot'. So they break at the first dot to convert YAML tag to JSON map like this:
`!GetAtt LogicalId.Arn` => {"Fn::GetAtt": [ "LogicalId", "Arn" ] }
Therefore to resolve the reference, we join the array into a string, break it back up to check if it contains
a known reference, and resolve it if we can.
:param input_dict: Dictionary to be resolved
:param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones.
:return: Resolved dictionary
"""
if not self.can_handle(input_dict):
return input_dict
key = self.intrinsic_name
value = input_dict[key]
# Value must be an array with *at least* two elements. If not, this is invalid GetAtt syntax. We just pass along
# the input to CFN for it to do the "official" validation.
if not isinstance(value, list) or len(value) < 2:
return input_dict
value_str = self._resource_ref_separator.join(value)
splits = value_str.split(self._resource_ref_separator)
logical_id = splits[0]
remaining = splits[1:] # if any
resolved_value = supported_resource_id_refs.get(logical_id)
return self._get_resolved_dictionary(input_dict, key, resolved_value, remaining)
|
[
"def",
"resolve_resource_id_refs",
"(",
"self",
",",
"input_dict",
",",
"supported_resource_id_refs",
")",
":",
"if",
"not",
"self",
".",
"can_handle",
"(",
"input_dict",
")",
":",
"return",
"input_dict",
"key",
"=",
"self",
".",
"intrinsic_name",
"value",
"=",
"input_dict",
"[",
"key",
"]",
"# Value must be an array with *at least* two elements. If not, this is invalid GetAtt syntax. We just pass along",
"# the input to CFN for it to do the \"official\" validation.",
"if",
"not",
"isinstance",
"(",
"value",
",",
"list",
")",
"or",
"len",
"(",
"value",
")",
"<",
"2",
":",
"return",
"input_dict",
"value_str",
"=",
"self",
".",
"_resource_ref_separator",
".",
"join",
"(",
"value",
")",
"splits",
"=",
"value_str",
".",
"split",
"(",
"self",
".",
"_resource_ref_separator",
")",
"logical_id",
"=",
"splits",
"[",
"0",
"]",
"remaining",
"=",
"splits",
"[",
"1",
":",
"]",
"# if any",
"resolved_value",
"=",
"supported_resource_id_refs",
".",
"get",
"(",
"logical_id",
")",
"return",
"self",
".",
"_get_resolved_dictionary",
"(",
"input_dict",
",",
"key",
",",
"resolved_value",
",",
"remaining",
")"
] |
Resolve resource references within a GetAtt dict.
Example:
{ "Fn::GetAtt": ["LogicalId", "Arn"] } => {"Fn::GetAtt": ["ResolvedLogicalId", "Arn"]}
Theoretically, only the first element of the array can contain reference to SAM resources. The second element
is name of an attribute (like Arn) of the resource.
However tools like AWS CLI apply the assumption that first element of the array is a LogicalId and cannot
contain a 'dot'. So they break at the first dot to convert YAML tag to JSON map like this:
`!GetAtt LogicalId.Arn` => {"Fn::GetAtt": [ "LogicalId", "Arn" ] }
Therefore to resolve the reference, we join the array into a string, break it back up to check if it contains
a known reference, and resolve it if we can.
:param input_dict: Dictionary to be resolved
:param dict supported_resource_id_refs: Dictionary that maps old logical ids to new ones.
:return: Resolved dictionary
|
[
"Resolve",
"resource",
"references",
"within",
"a",
"GetAtt",
"dict",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L454-L495
|
train
|
Resolve resource references within a GetAtt dict.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz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zGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + chr(643 - 592) + chr(1955 - 1906) + chr(88 - 36), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(0b110000) + '\066', 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b111000 + 0o67) + '\061' + chr(0b110110) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110100) + '\061', 1156 - 1148), ehT0Px3KOsy9(chr(80 - 32) + '\x6f' + chr(455 - 405) + chr(51) + chr(0b11111 + 0o30), 0o10), ehT0Px3KOsy9('\060' + chr(11939 - 11828) + '\x32' + '\060' + chr(0b101101 + 0o11), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1329 - 1275) + chr(520 - 470), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(0b110001) + '\066', 37468 - 37460), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + '\x30' + chr(0b101011 + 0o13), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010111 + 0o30) + chr(775 - 725) + chr(147 - 95) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + '\x32' + chr(50) + chr(0b110100), 57722 - 57714), ehT0Px3KOsy9(chr(48) + '\x6f' + '\064' + chr(2213 - 2162), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + '\x30' + '\065', 0o10), ehT0Px3KOsy9(chr(78 - 30) + chr(111) + chr(0b110101) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1283 - 1234) + chr(529 - 474) + chr(54 - 1), 14423 - 14415), ehT0Px3KOsy9('\x30' + chr(0b10011 + 0o134) + chr(1072 - 1023) + chr(0b110000 + 0o3) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b110000 + 0o77) + chr(0b110001 + 0o5) + '\061', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100111 + 0o14) + chr(2202 - 2152) + chr(0b11001 + 0o27), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10001 + 0o136) + chr(50) + chr(0b110000) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b10001 + 0o136) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + chr(1802 - 1752) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + chr(2291 - 2240) + chr(0b110000) + '\062', 20422 - 20414), ehT0Px3KOsy9(chr(48) + chr(1002 - 891) + '\063' + chr(0b110010) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1100 + 0o143) + chr(50) + '\065' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110100) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(1405 - 1294) + chr(49) + '\061' + chr(0b100000 + 0o26), 54571 - 54563), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(50) + chr(0b11100 + 0o32), 0b1000), ehT0Px3KOsy9(chr(141 - 93) + '\x6f' + '\063' + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\x6f' + chr(0b11101 + 0o25) + chr(54) + chr(2081 - 2029), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(2434 - 2323) + chr(0b1111 + 0o47) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(819 - 771) + chr(6592 - 6481) + '\x33' + '\x30' + chr(52), 12922 - 12914), ehT0Px3KOsy9('\060' + chr(0b100101 + 0o112) + chr(0b110110) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + '\062' + chr(48), 0b1000), ehT0Px3KOsy9(chr(701 - 653) + chr(0b1101111) + chr(1834 - 1780) + '\060', 8), ehT0Px3KOsy9(chr(295 - 247) + '\157' + '\x32' + '\063' + chr(468 - 420), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101010 + 0o13), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(1435 - 1387), 8), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(2232 - 2179) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(980 - 932) + '\061', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x35' + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2'), chr(6538 - 6438) + '\145' + '\x63' + chr(8492 - 8381) + chr(100) + chr(0b1011111 + 0o6))(chr(117) + chr(0b1011000 + 0o34) + '\x66' + chr(0b11001 + 0o24) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def lvz_X3e0o7aG(oVre8I6UXc3b, fsKNe8onWqjT, Xwr_NWMclJnm):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"\xaf'\x1d~\xf7\xe7\\\xaa\xaa\xc6"), chr(0b1001000 + 0o34) + chr(0b1100101) + chr(0b1010100 + 0o17) + chr(6384 - 6273) + chr(0b1100100) + chr(0b1100101))('\x75' + '\164' + chr(0b1100110) + chr(119 - 74) + chr(3108 - 3052)))(fsKNe8onWqjT):
return fsKNe8onWqjT
K3J4ZwSlE0sT = oVre8I6UXc3b.intrinsic_name
QmmgWUB13VCJ = fsKNe8onWqjT[K3J4ZwSlE0sT]
if not PlSM16l2KDPD(QmmgWUB13VCJ, YyaZ4tpXu4lf) or c2A0yzQpDQB3(QmmgWUB13VCJ) < ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b110000 + 0o77) + '\062', 7458 - 7450):
return fsKNe8onWqjT
dI8_yg4RJuV_ = oVre8I6UXc3b._resource_ref_separator._oWXztVNnqHF(QmmgWUB13VCJ)
uSBCRSw0LUmo = dI8_yg4RJuV_.split(oVre8I6UXc3b._resource_ref_separator)
NpZr66MdBhVG = uSBCRSw0LUmo[ehT0Px3KOsy9('\060' + chr(111) + chr(0b1101 + 0o43), 8)]
YMgVTlt59JZw = uSBCRSw0LUmo[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001), ord("\x08")):]
ikyZID2DzuoC = Xwr_NWMclJnm.get(NpZr66MdBhVG)
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x93!\x16U\xc0\xf4W\xbd\xa9\xcf\xe2F\xe1v\x195R\xa4\xebo9\xa3\xa7q'), chr(0b110101 + 0o57) + chr(0b11011 + 0o112) + chr(99) + chr(0b1101111) + '\144' + '\x65')(chr(0b1110101) + chr(116) + chr(9528 - 9426) + '\x2d' + '\x38'))(fsKNe8onWqjT, K3J4ZwSlE0sT, ikyZID2DzuoC, YMgVTlt59JZw)
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
GetAttAction._get_resolved_dictionary
|
def _get_resolved_dictionary(self, input_dict, key, resolved_value, remaining):
"""
Resolves the function and returns the updated dictionary
:param input_dict: Dictionary to be resolved
:param key: Name of this intrinsic.
:param resolved_value: Resolved or updated value for this action.
:param remaining: Remaining sections for the GetAtt action.
"""
if resolved_value:
# We resolved to a new resource logicalId. Use this as the first element and keep remaining elements intact
# This is the new value of Fn::GetAtt
input_dict[key] = [resolved_value] + remaining
return input_dict
|
python
|
def _get_resolved_dictionary(self, input_dict, key, resolved_value, remaining):
"""
Resolves the function and returns the updated dictionary
:param input_dict: Dictionary to be resolved
:param key: Name of this intrinsic.
:param resolved_value: Resolved or updated value for this action.
:param remaining: Remaining sections for the GetAtt action.
"""
if resolved_value:
# We resolved to a new resource logicalId. Use this as the first element and keep remaining elements intact
# This is the new value of Fn::GetAtt
input_dict[key] = [resolved_value] + remaining
return input_dict
|
[
"def",
"_get_resolved_dictionary",
"(",
"self",
",",
"input_dict",
",",
"key",
",",
"resolved_value",
",",
"remaining",
")",
":",
"if",
"resolved_value",
":",
"# We resolved to a new resource logicalId. Use this as the first element and keep remaining elements intact",
"# This is the new value of Fn::GetAtt",
"input_dict",
"[",
"key",
"]",
"=",
"[",
"resolved_value",
"]",
"+",
"remaining",
"return",
"input_dict"
] |
Resolves the function and returns the updated dictionary
:param input_dict: Dictionary to be resolved
:param key: Name of this intrinsic.
:param resolved_value: Resolved or updated value for this action.
:param remaining: Remaining sections for the GetAtt action.
|
[
"Resolves",
"the",
"function",
"and",
"returns",
"the",
"updated",
"dictionary"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L497-L511
|
train
|
Resolves the function and returns the updated dictionary with the new value
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJ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yh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(111) + '\061' + '\060' + '\064', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + '\064' + '\063', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(51) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b101010 + 0o105) + '\062' + chr(0b110010) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + chr(55) + '\x30', 62917 - 62909), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(51) + chr(55) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + chr(51) + chr(2703 - 2649) + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11010 + 0o26), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(0b101100 + 0o4) + chr(0b11000 + 0o31), ord("\x08")), ehT0Px3KOsy9(chr(2113 - 2065) + chr(0b1001100 + 0o43) + chr(50) + chr(706 - 655) + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(0b1111 + 0o44) + chr(0b100000 + 0o21), 8), ehT0Px3KOsy9(chr(48) + chr(0b11100 + 0o123) + chr(50) + chr(643 - 589) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(0b1000 + 0o55) + '\x32', 546 - 538), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(543 - 493) + '\x36' + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(9795 - 9684) + chr(55) + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + '\063' + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10110 + 0o131) + chr(0b100010 + 0o20) + '\061' + chr(48), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + '\067' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\157' + chr(0b110010 + 0o0) + '\064' + chr(50), 0o10), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\157' + '\063' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1686 - 1575) + chr(0b110001) + chr(48) + '\064', 8), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(1520 - 1465) + chr(0b110010 + 0o4), 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(111) + chr(2426 - 2375) + chr(52) + chr(0b110100 + 0o1), 0b1000), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\157' + chr(0b110001) + '\065' + chr(0b110101), 28647 - 28639), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + '\063' + chr(341 - 291), 27355 - 27347), ehT0Px3KOsy9(chr(48) + chr(111) + '\066' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(1489 - 1378) + '\061' + chr(0b110100 + 0o3) + '\061', 3985 - 3977), ehT0Px3KOsy9(chr(0b110000) + chr(9571 - 9460) + chr(0b110010) + chr(49) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10100 + 0o36) + '\066' + chr(0b10001 + 0o37), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1 + 0o60) + chr(1844 - 1793) + chr(0b100101 + 0o14), 8), ehT0Px3KOsy9(chr(396 - 348) + chr(6184 - 6073) + chr(117 - 68) + chr(1503 - 1454) + chr(54), 0o10), ehT0Px3KOsy9('\060' + chr(0b1100001 + 0o16) + chr(0b10010 + 0o43) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7382 - 7271) + chr(50) + chr(0b11100 + 0o30) + chr(0b101001 + 0o7), 62891 - 62883), ehT0Px3KOsy9(chr(73 - 25) + chr(6656 - 6545) + chr(1933 - 1880) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(55) + chr(2039 - 1985), 5997 - 5989), ehT0Px3KOsy9(chr(337 - 289) + chr(1825 - 1714) + '\x31' + chr(462 - 412) + chr(52), 0o10), ehT0Px3KOsy9('\060' + chr(0b101001 + 0o106) + '\063' + chr(0b11100 + 0o26) + chr(405 - 353), 54990 - 54982), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1252 - 1201) + chr(1746 - 1692), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11101 + 0o27) + '\x34', 0b1000), ehT0Px3KOsy9(chr(803 - 755) + '\x6f' + chr(0b100000 + 0o22) + chr(50) + '\060', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1172 - 1124) + chr(0b1001001 + 0o46) + '\x35' + chr(0b10 + 0o56), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'j'), '\x64' + '\145' + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(101))(chr(0b110010 + 0o103) + '\x74' + chr(1653 - 1551) + chr(45) + chr(99 - 43)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def NRRBC3X64kbv(oVre8I6UXc3b, fsKNe8onWqjT, K3J4ZwSlE0sT, ikyZID2DzuoC, YMgVTlt59JZw):
if ikyZID2DzuoC:
fsKNe8onWqjT[K3J4ZwSlE0sT] = [ikyZID2DzuoC] + YMgVTlt59JZw
return fsKNe8onWqjT
|
awslabs/serverless-application-model
|
samtranslator/intrinsics/actions.py
|
FindInMapAction.resolve_parameter_refs
|
def resolve_parameter_refs(self, input_dict, parameters):
"""
Recursively resolves "Fn::FindInMap"references that are present in the mappings and returns the value.
If it is not in mappings, this method simply returns the input unchanged.
:param input_dict: Dictionary representing the FindInMap function. Must contain only one key and it
should be "Fn::FindInMap".
:param parameters: Dictionary of mappings from the SAM template
"""
if not self.can_handle(input_dict):
return input_dict
value = input_dict[self.intrinsic_name]
# FindInMap expects an array with 3 values
if not isinstance(value, list) or len(value) != 3:
raise InvalidDocumentException(
[InvalidTemplateException('Invalid FindInMap value {}. FindInMap expects an array with 3 values.'
.format(value))])
map_name = self.resolve_parameter_refs(value[0], parameters)
top_level_key = self.resolve_parameter_refs(value[1], parameters)
second_level_key = self.resolve_parameter_refs(value[2], parameters)
if not isinstance(map_name, string_types) or \
not isinstance(top_level_key, string_types) or \
not isinstance(second_level_key, string_types):
return input_dict
if map_name not in parameters or \
top_level_key not in parameters[map_name] or \
second_level_key not in parameters[map_name][top_level_key]:
return input_dict
return parameters[map_name][top_level_key][second_level_key]
|
python
|
def resolve_parameter_refs(self, input_dict, parameters):
"""
Recursively resolves "Fn::FindInMap"references that are present in the mappings and returns the value.
If it is not in mappings, this method simply returns the input unchanged.
:param input_dict: Dictionary representing the FindInMap function. Must contain only one key and it
should be "Fn::FindInMap".
:param parameters: Dictionary of mappings from the SAM template
"""
if not self.can_handle(input_dict):
return input_dict
value = input_dict[self.intrinsic_name]
# FindInMap expects an array with 3 values
if not isinstance(value, list) or len(value) != 3:
raise InvalidDocumentException(
[InvalidTemplateException('Invalid FindInMap value {}. FindInMap expects an array with 3 values.'
.format(value))])
map_name = self.resolve_parameter_refs(value[0], parameters)
top_level_key = self.resolve_parameter_refs(value[1], parameters)
second_level_key = self.resolve_parameter_refs(value[2], parameters)
if not isinstance(map_name, string_types) or \
not isinstance(top_level_key, string_types) or \
not isinstance(second_level_key, string_types):
return input_dict
if map_name not in parameters or \
top_level_key not in parameters[map_name] or \
second_level_key not in parameters[map_name][top_level_key]:
return input_dict
return parameters[map_name][top_level_key][second_level_key]
|
[
"def",
"resolve_parameter_refs",
"(",
"self",
",",
"input_dict",
",",
"parameters",
")",
":",
"if",
"not",
"self",
".",
"can_handle",
"(",
"input_dict",
")",
":",
"return",
"input_dict",
"value",
"=",
"input_dict",
"[",
"self",
".",
"intrinsic_name",
"]",
"# FindInMap expects an array with 3 values",
"if",
"not",
"isinstance",
"(",
"value",
",",
"list",
")",
"or",
"len",
"(",
"value",
")",
"!=",
"3",
":",
"raise",
"InvalidDocumentException",
"(",
"[",
"InvalidTemplateException",
"(",
"'Invalid FindInMap value {}. FindInMap expects an array with 3 values.'",
".",
"format",
"(",
"value",
")",
")",
"]",
")",
"map_name",
"=",
"self",
".",
"resolve_parameter_refs",
"(",
"value",
"[",
"0",
"]",
",",
"parameters",
")",
"top_level_key",
"=",
"self",
".",
"resolve_parameter_refs",
"(",
"value",
"[",
"1",
"]",
",",
"parameters",
")",
"second_level_key",
"=",
"self",
".",
"resolve_parameter_refs",
"(",
"value",
"[",
"2",
"]",
",",
"parameters",
")",
"if",
"not",
"isinstance",
"(",
"map_name",
",",
"string_types",
")",
"or",
"not",
"isinstance",
"(",
"top_level_key",
",",
"string_types",
")",
"or",
"not",
"isinstance",
"(",
"second_level_key",
",",
"string_types",
")",
":",
"return",
"input_dict",
"if",
"map_name",
"not",
"in",
"parameters",
"or",
"top_level_key",
"not",
"in",
"parameters",
"[",
"map_name",
"]",
"or",
"second_level_key",
"not",
"in",
"parameters",
"[",
"map_name",
"]",
"[",
"top_level_key",
"]",
":",
"return",
"input_dict",
"return",
"parameters",
"[",
"map_name",
"]",
"[",
"top_level_key",
"]",
"[",
"second_level_key",
"]"
] |
Recursively resolves "Fn::FindInMap"references that are present in the mappings and returns the value.
If it is not in mappings, this method simply returns the input unchanged.
:param input_dict: Dictionary representing the FindInMap function. Must contain only one key and it
should be "Fn::FindInMap".
:param parameters: Dictionary of mappings from the SAM template
|
[
"Recursively",
"resolves",
"Fn",
"::",
"FindInMap",
"references",
"that",
"are",
"present",
"in",
"the",
"mappings",
"and",
"returns",
"the",
"value",
".",
"If",
"it",
"is",
"not",
"in",
"mappings",
"this",
"method",
"simply",
"returns",
"the",
"input",
"unchanged",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/intrinsics/actions.py#L520-L555
|
train
|
Resolves FindInMap references that are present in the SAM template and returns the value.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvx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m1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(111) + chr(1094 - 1044) + chr(68 - 17) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + '\x33' + '\067', 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(11294 - 11183) + chr(0b101111 + 0o1), ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\157' + '\061' + chr(0b110010) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(1226 - 1115) + chr(0b110011) + '\x34' + chr(892 - 837), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b110101) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010010 + 0o35) + chr(0b101010 + 0o12) + '\x32', 0o10), ehT0Px3KOsy9(chr(344 - 296) + chr(0b1101111) + '\062' + chr(0b110001) + '\x30', 60408 - 60400), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + '\x37' + chr(50), 0b1000), ehT0Px3KOsy9(chr(2207 - 2159) + chr(111) + chr(50) + '\063' + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b100001 + 0o116) + '\062' + '\x33' + chr(49), 0o10), ehT0Px3KOsy9(chr(70 - 22) + chr(543 - 432) + chr(0b100100 + 0o17) + chr(51) + chr(49), 59900 - 59892), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1101 + 0o45) + chr(48) + chr(0b110 + 0o61), 0b1000), ehT0Px3KOsy9(chr(688 - 640) + chr(11821 - 11710) + chr(2213 - 2164) + chr(49) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + chr(49) + chr(52), 0b1000), ehT0Px3KOsy9(chr(323 - 275) + '\x6f' + '\x33' + '\x34' + chr(1243 - 1195), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b100010 + 0o115) + chr(0b10101 + 0o40) + chr(49), 0b1000), ehT0Px3KOsy9(chr(1077 - 1029) + chr(6520 - 6409) + '\x32' + '\066' + chr(1979 - 1925), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(0b110110) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + '\x30' + '\066', 0o10), ehT0Px3KOsy9(chr(1822 - 1774) + '\157' + '\062' + '\x34' + chr(53), 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + chr(49) + chr(0b110001) + chr(2859 - 2805), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(48) + chr(716 - 668), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1244 - 1194) + chr(0b101010 + 0o12), ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + '\063' + chr(0b11 + 0o62) + chr(890 - 835), 30580 - 30572), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(0b110010) + chr(224 - 174), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\067' + '\x34', 64430 - 64422), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101000 + 0o7) + chr(53) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011010 + 0o25) + '\063' + '\062' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1010 + 0o145) + '\061' + '\x33' + chr(2538 - 2484), ord("\x08")), ehT0Px3KOsy9(chr(1916 - 1868) + chr(6369 - 6258) + chr(0b101100 + 0o5) + chr(52) + '\x31', 11193 - 11185), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(0b110111) + '\062', 8), ehT0Px3KOsy9(chr(48) + chr(4710 - 4599) + chr(50) + '\064' + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(197 - 143) + '\x32', 5555 - 5547), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + '\060' + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1010110 + 0o31) + chr(0b110010) + chr(0b10001 + 0o41) + chr(0b11001 + 0o32), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x34', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(0b110111) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1000111 + 0o50) + chr(458 - 407) + chr(0b101101 + 0o3) + chr(555 - 501), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\x32' + chr(0b110011), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + '\x35' + chr(0b110000), 26448 - 26440)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1'), chr(100) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(100) + '\145')(chr(0b1110001 + 0o4) + '\x74' + chr(0b110001 + 0o65) + chr(45) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Khlw9Xworg_f(oVre8I6UXc3b, fsKNe8onWqjT, YwMyLskbiCrd):
if not xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfc>n\x0f\x8f\x8bL\xec\xd6\xfd'), '\144' + chr(0b1100101) + chr(0b101001 + 0o72) + chr(6083 - 5972) + '\x64' + '\x65')('\165' + chr(585 - 469) + chr(102) + chr(0b11110 + 0o17) + '\x38'))(fsKNe8onWqjT):
return fsKNe8onWqjT
QmmgWUB13VCJ = fsKNe8onWqjT[oVre8I6UXc3b.intrinsic_name]
if not PlSM16l2KDPD(QmmgWUB13VCJ, YyaZ4tpXu4lf) or c2A0yzQpDQB3(QmmgWUB13VCJ) != ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11111 + 0o24), ord("\x08")):
raise WAOffgnUIwTZ([pFZeGuJCK2EG(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b"\xd61v1\x8b\x83F\xa8\xfc\xf1\xf7\xbd\xce$A\x81Y\x96\xc3'\xc9;\xa54\x94\xef\x12\x0e\x957\x0f\xde\xe9\x1c\x88\xf2t\xdb\xa3\xeb\xef:c$\x94\xcaC\xe6\x9a\xf9\xeb\xab\xe63,\x97@\xc2\xddf\x96n\xb6u\x83\xe7Y]\xfd"), chr(6316 - 6216) + '\145' + chr(0b100001 + 0o102) + chr(9756 - 9645) + '\144' + '\x65')(chr(117) + '\x74' + '\x66' + chr(1185 - 1140) + chr(825 - 769)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9kr?\xaf\x8bq\xbb\xea\xe8\xfc\xb3'), chr(8035 - 7935) + chr(0b1010100 + 0o21) + '\143' + chr(0b110111 + 0o70) + chr(0b100011 + 0o101) + '\x65')('\165' + chr(116) + chr(0b100100 + 0o102) + chr(0b11101 + 0o20) + chr(56)))(QmmgWUB13VCJ))])
nDrkiNwX9yWz = oVre8I6UXc3b.resolve_parameter_refs(QmmgWUB13VCJ[ehT0Px3KOsy9('\x30' + chr(0b100011 + 0o114) + chr(48), 8)], YwMyLskbiCrd)
QwIjE_Q2TcfX = oVre8I6UXc3b.resolve_parameter_refs(QmmgWUB13VCJ[ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49), 0b1000)], YwMyLskbiCrd)
muTwRo0m8JSn = oVre8I6UXc3b.resolve_parameter_refs(QmmgWUB13VCJ[ehT0Px3KOsy9(chr(0b110000) + chr(0b1001110 + 0o41) + '\062', 0b1000)], YwMyLskbiCrd)
if not PlSM16l2KDPD(nDrkiNwX9yWz, sInLJQno9SRQ) or not PlSM16l2KDPD(QwIjE_Q2TcfX, sInLJQno9SRQ) or (not PlSM16l2KDPD(muTwRo0m8JSn, sInLJQno9SRQ)):
return fsKNe8onWqjT
if nDrkiNwX9yWz not in YwMyLskbiCrd or QwIjE_Q2TcfX not in YwMyLskbiCrd[nDrkiNwX9yWz] or muTwRo0m8JSn not in YwMyLskbiCrd[nDrkiNwX9yWz][QwIjE_Q2TcfX]:
return fsKNe8onWqjT
return YwMyLskbiCrd[nDrkiNwX9yWz][QwIjE_Q2TcfX][muTwRo0m8JSn]
|
awslabs/serverless-application-model
|
examples/apps/datadog-process-rds-metrics/lambda_function.py
|
lambda_handler
|
def lambda_handler(event, context):
''' Process a RDS enhenced monitoring DATA_MESSAGE,
coming from CLOUDWATCH LOGS
'''
# event is a dict containing a base64 string gzipped
event = json.loads(gzip.GzipFile(fileobj=StringIO(event['awslogs']['data'].decode('base64'))).read())
account = event['owner']
region = context.invoked_function_arn.split(':', 4)[3]
log_events = event['logEvents']
for log_event in log_events:
message = json.loads(log_event['message'])
ts = log_event['timestamp'] / 1000
_process_rds_enhanced_monitoring_message(ts, message, account, region)
stats.flush()
return {'Status': 'OK'}
|
python
|
def lambda_handler(event, context):
''' Process a RDS enhenced monitoring DATA_MESSAGE,
coming from CLOUDWATCH LOGS
'''
# event is a dict containing a base64 string gzipped
event = json.loads(gzip.GzipFile(fileobj=StringIO(event['awslogs']['data'].decode('base64'))).read())
account = event['owner']
region = context.invoked_function_arn.split(':', 4)[3]
log_events = event['logEvents']
for log_event in log_events:
message = json.loads(log_event['message'])
ts = log_event['timestamp'] / 1000
_process_rds_enhanced_monitoring_message(ts, message, account, region)
stats.flush()
return {'Status': 'OK'}
|
[
"def",
"lambda_handler",
"(",
"event",
",",
"context",
")",
":",
"# event is a dict containing a base64 string gzipped",
"event",
"=",
"json",
".",
"loads",
"(",
"gzip",
".",
"GzipFile",
"(",
"fileobj",
"=",
"StringIO",
"(",
"event",
"[",
"'awslogs'",
"]",
"[",
"'data'",
"]",
".",
"decode",
"(",
"'base64'",
")",
")",
")",
".",
"read",
"(",
")",
")",
"account",
"=",
"event",
"[",
"'owner'",
"]",
"region",
"=",
"context",
".",
"invoked_function_arn",
".",
"split",
"(",
"':'",
",",
"4",
")",
"[",
"3",
"]",
"log_events",
"=",
"event",
"[",
"'logEvents'",
"]",
"for",
"log_event",
"in",
"log_events",
":",
"message",
"=",
"json",
".",
"loads",
"(",
"log_event",
"[",
"'message'",
"]",
")",
"ts",
"=",
"log_event",
"[",
"'timestamp'",
"]",
"/",
"1000",
"_process_rds_enhanced_monitoring_message",
"(",
"ts",
",",
"message",
",",
"account",
",",
"region",
")",
"stats",
".",
"flush",
"(",
")",
"return",
"{",
"'Status'",
":",
"'OK'",
"}"
] |
Process a RDS enhenced monitoring DATA_MESSAGE,
coming from CLOUDWATCH LOGS
|
[
"Process",
"a",
"RDS",
"enhenced",
"monitoring",
"DATA_MESSAGE",
"coming",
"from",
"CLOUDWATCH",
"LOGS"
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/examples/apps/datadog-process-rds-metrics/lambda_function.py#L104-L122
|
train
|
Process a RDS enhenced monitoring DATA_MESSAGE coming from CLOUDWATCH LOGS
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCS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VFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b10001 + 0o136) + chr(1735 - 1686) + '\x31' + '\063', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10101 + 0o132) + chr(51) + chr(0b1101 + 0o52) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(0b1010 + 0o47) + chr(1910 - 1856), 58694 - 58686), ehT0Px3KOsy9('\060' + chr(111) + '\061' + chr(0b110101) + chr(2393 - 2338), 28873 - 28865), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(52) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1001001 + 0o46) + chr(0b110 + 0o55) + chr(992 - 940) + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b100111 + 0o110) + chr(0b110011) + '\x34' + '\x37', 24312 - 24304), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\x6f' + chr(0b101100 + 0o6) + chr(0b100 + 0o55) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b111 + 0o53) + chr(0b110000) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b100010 + 0o115) + chr(2149 - 2101), 0o10), ehT0Px3KOsy9('\x30' + chr(9263 - 9152) + chr(51) + '\x34' + chr(1769 - 1714), 8), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(111) + chr(90 - 40) + chr(0b110110) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11110 + 0o25) + chr(0b10110 + 0o34) + chr(49), 25913 - 25905), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + '\x34' + '\x30', 17459 - 17451), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(0b11111 + 0o24) + chr(0b110010), 41070 - 41062), ehT0Px3KOsy9(chr(48) + chr(0b1000001 + 0o56) + chr(0b110010) + chr(2160 - 2112) + chr(1305 - 1257), 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(10549 - 10438) + chr(0b1100 + 0o45) + chr(51) + chr(2217 - 2165), 19641 - 19633), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b100 + 0o60) + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101 + 0o57), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1001011 + 0o44) + chr(936 - 882) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + chr(53) + chr(600 - 552), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + '\065', 4822 - 4814), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(54) + chr(235 - 183), 40472 - 40464), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + '\x33' + '\x34', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100110 + 0o14) + '\066' + chr(366 - 314), 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b111110 + 0o61) + '\062' + '\x30' + '\067', 8), ehT0Px3KOsy9(chr(1951 - 1903) + chr(8900 - 8789) + chr(0b110011) + chr(53) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011 + 0o0) + '\x34' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b1110 + 0o43) + chr(0b110000) + '\x30', 34219 - 34211), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1897 - 1846) + chr(0b110011) + chr(868 - 817), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100011 + 0o14) + chr(0b101110 + 0o3) + '\066' + chr(2134 - 2083), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100111 + 0o13) + '\x32' + '\x35', 0o10), ehT0Px3KOsy9(chr(2076 - 2028) + '\157' + '\x33' + chr(1717 - 1669) + chr(0b101 + 0o55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10111 + 0o32) + chr(443 - 392) + chr(2550 - 2496), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(159 - 108) + chr(372 - 319), 38854 - 38846), ehT0Px3KOsy9(chr(142 - 94) + chr(0b1000100 + 0o53) + '\061' + chr(0b11110 + 0o22) + '\x37', 16589 - 16581), ehT0Px3KOsy9(chr(48) + chr(0b100 + 0o153) + chr(61 - 7) + chr(0b110000), 8), ehT0Px3KOsy9('\x30' + chr(4305 - 4194) + chr(0b110011) + chr(0b11111 + 0o22) + chr(0b110010), 14548 - 14540), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1106 - 1055) + chr(2113 - 2059) + chr(1491 - 1440), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2202 - 2153) + '\x30', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(11445 - 11334) + chr(0b11111 + 0o26) + '\060', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'e'), chr(0b1100100) + chr(0b1110 + 0o127) + chr(0b1011111 + 0o4) + chr(9644 - 9533) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(45) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def G1tjmr_C39El(SGm65G84ZKM5, vUUG4_3aIqQC):
SGm65G84ZKM5 = fXk443epxtd5.loads(Sl9BQg7umixy.GzipFile(fileobj=dz4bgRiX_HNW(SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'*\x88=\x03\xcd\x87\x94'), '\144' + chr(0b1100101) + chr(0b111110 + 0o45) + chr(0b1000 + 0o147) + '\144' + chr(0b1100101))('\165' + '\164' + chr(102) + '\055' + chr(0b11111 + 0o31))][xafqLlk3kkUe(SXOLrMavuUCe(b'/\x9e:\x0e'), chr(9372 - 9272) + '\x65' + chr(5311 - 5212) + '\x6f' + '\144' + '\x65')(chr(117) + chr(4552 - 4436) + '\x66' + '\x2d' + '\070')].decode(xafqLlk3kkUe(SXOLrMavuUCe(b')\x9e=\n\x94\xd4'), '\x64' + chr(5878 - 5777) + '\x63' + chr(0b1101111) + chr(0b1010010 + 0o22) + chr(0b1100101))('\x75' + '\164' + chr(102) + chr(0b101101) + chr(853 - 797))))).U6MiWrhuCi2Y())
lB0YYt3npOjr = SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b'$\x88 \n\xd0'), '\x64' + '\x65' + chr(411 - 312) + chr(111) + chr(0b1100100) + '\x65')(chr(0b1100100 + 0o21) + '\164' + '\x66' + chr(0b101101) + '\x38')]
bgxypzqGSFYT = vUUG4_3aIqQC.invoked_function_arn.split(xafqLlk3kkUe(SXOLrMavuUCe(b'q'), '\144' + chr(4955 - 4854) + '\143' + chr(7689 - 7578) + chr(100) + '\145')(chr(0b1110101 + 0o0) + chr(0b111000 + 0o74) + chr(4069 - 3967) + chr(0b1011 + 0o42) + chr(0b111000)), ehT0Px3KOsy9(chr(300 - 252) + chr(4438 - 4327) + chr(0b110100), 8))[ehT0Px3KOsy9('\060' + '\157' + chr(0b11111 + 0o24), 32180 - 32172)]
GNzGrcQJuO5a = SGm65G84ZKM5[xafqLlk3kkUe(SXOLrMavuUCe(b"'\x90)*\xd4\x85\x89\xfc\xf4"), chr(100) + chr(0b111001 + 0o54) + '\x63' + chr(0b1101111) + chr(0b1011100 + 0o10) + chr(101))('\165' + chr(116) + '\146' + chr(45) + '\x38')]
for vIyZ8VbcRLRn in GNzGrcQJuO5a:
R2mbIkZzeu1B = fXk443epxtd5.loads(vIyZ8VbcRLRn[xafqLlk3kkUe(SXOLrMavuUCe(b'&\x9a=\x1c\xc3\x87\x82'), chr(0b1100100) + chr(101) + chr(662 - 563) + chr(111) + chr(0b11001 + 0o113) + '\x65')('\165' + '\164' + '\x66' + '\x2d' + chr(56))])
vRr8KUuV1pxu = vIyZ8VbcRLRn[xafqLlk3kkUe(SXOLrMavuUCe(b'?\x96#\n\xd1\x94\x86\xe5\xf7'), '\x64' + chr(0b0 + 0o145) + chr(0b1000101 + 0o36) + '\157' + chr(0b111010 + 0o52) + chr(9210 - 9109))(chr(0b10100 + 0o141) + chr(116) + chr(102) + chr(191 - 146) + '\x38')] / ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + '\061' + chr(1644 - 1589) + chr(959 - 906) + '\060', 53694 - 53686)
D4o5zE2PpUZU(vRr8KUuV1pxu, R2mbIkZzeu1B, lB0YYt3npOjr, bgxypzqGSFYT)
xafqLlk3kkUe(hkfs4IaeBuiq, xafqLlk3kkUe(SXOLrMavuUCe(b'-\x93;\x1c\xca'), chr(9377 - 9277) + chr(101) + chr(99) + '\157' + chr(0b1100100) + '\145')(chr(12473 - 12356) + chr(116) + chr(102) + '\055' + chr(0b111000)))()
return {xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\x8b/\x1b\xd7\x93'), chr(0b110010 + 0o62) + chr(101) + chr(8793 - 8694) + chr(0b111110 + 0o61) + chr(333 - 233) + chr(0b1100010 + 0o3))('\x75' + '\x74' + chr(0b11100 + 0o112) + '\x2d' + '\x38'): xafqLlk3kkUe(SXOLrMavuUCe(b'\x04\xb4'), chr(100) + chr(0b1001001 + 0o34) + chr(99) + chr(0b1101111) + '\x64' + chr(0b1100101))('\x75' + '\164' + '\x66' + chr(0b101101) + chr(0b111000))}
|
awslabs/serverless-application-model
|
samtranslator/model/api/api_generator.py
|
ApiGenerator._construct_rest_api
|
def _construct_rest_api(self):
"""Constructs and returns the ApiGateway RestApi.
:returns: the RestApi to which this SAM Api corresponds
:rtype: model.apigateway.ApiGatewayRestApi
"""
rest_api = ApiGatewayRestApi(self.logical_id, depends_on=self.depends_on, attributes=self.resource_attributes)
rest_api.BinaryMediaTypes = self.binary_media
rest_api.MinimumCompressionSize = self.minimum_compression_size
if self.endpoint_configuration:
self._set_endpoint_configuration(rest_api, self.endpoint_configuration)
elif not RegionConfiguration.is_apigw_edge_configuration_supported():
# Since this region does not support EDGE configuration, we explicitly set the endpoint type
# to Regional which is the only supported config.
self._set_endpoint_configuration(rest_api, "REGIONAL")
if self.definition_uri and self.definition_body:
raise InvalidResourceException(self.logical_id,
"Specify either 'DefinitionUri' or 'DefinitionBody' property and not both")
self._add_cors()
self._add_auth()
self._add_gateway_responses()
if self.definition_uri:
rest_api.BodyS3Location = self._construct_body_s3_dict()
elif self.definition_body:
rest_api.Body = self.definition_body
if self.name:
rest_api.Name = self.name
return rest_api
|
python
|
def _construct_rest_api(self):
"""Constructs and returns the ApiGateway RestApi.
:returns: the RestApi to which this SAM Api corresponds
:rtype: model.apigateway.ApiGatewayRestApi
"""
rest_api = ApiGatewayRestApi(self.logical_id, depends_on=self.depends_on, attributes=self.resource_attributes)
rest_api.BinaryMediaTypes = self.binary_media
rest_api.MinimumCompressionSize = self.minimum_compression_size
if self.endpoint_configuration:
self._set_endpoint_configuration(rest_api, self.endpoint_configuration)
elif not RegionConfiguration.is_apigw_edge_configuration_supported():
# Since this region does not support EDGE configuration, we explicitly set the endpoint type
# to Regional which is the only supported config.
self._set_endpoint_configuration(rest_api, "REGIONAL")
if self.definition_uri and self.definition_body:
raise InvalidResourceException(self.logical_id,
"Specify either 'DefinitionUri' or 'DefinitionBody' property and not both")
self._add_cors()
self._add_auth()
self._add_gateway_responses()
if self.definition_uri:
rest_api.BodyS3Location = self._construct_body_s3_dict()
elif self.definition_body:
rest_api.Body = self.definition_body
if self.name:
rest_api.Name = self.name
return rest_api
|
[
"def",
"_construct_rest_api",
"(",
"self",
")",
":",
"rest_api",
"=",
"ApiGatewayRestApi",
"(",
"self",
".",
"logical_id",
",",
"depends_on",
"=",
"self",
".",
"depends_on",
",",
"attributes",
"=",
"self",
".",
"resource_attributes",
")",
"rest_api",
".",
"BinaryMediaTypes",
"=",
"self",
".",
"binary_media",
"rest_api",
".",
"MinimumCompressionSize",
"=",
"self",
".",
"minimum_compression_size",
"if",
"self",
".",
"endpoint_configuration",
":",
"self",
".",
"_set_endpoint_configuration",
"(",
"rest_api",
",",
"self",
".",
"endpoint_configuration",
")",
"elif",
"not",
"RegionConfiguration",
".",
"is_apigw_edge_configuration_supported",
"(",
")",
":",
"# Since this region does not support EDGE configuration, we explicitly set the endpoint type",
"# to Regional which is the only supported config.",
"self",
".",
"_set_endpoint_configuration",
"(",
"rest_api",
",",
"\"REGIONAL\"",
")",
"if",
"self",
".",
"definition_uri",
"and",
"self",
".",
"definition_body",
":",
"raise",
"InvalidResourceException",
"(",
"self",
".",
"logical_id",
",",
"\"Specify either 'DefinitionUri' or 'DefinitionBody' property and not both\"",
")",
"self",
".",
"_add_cors",
"(",
")",
"self",
".",
"_add_auth",
"(",
")",
"self",
".",
"_add_gateway_responses",
"(",
")",
"if",
"self",
".",
"definition_uri",
":",
"rest_api",
".",
"BodyS3Location",
"=",
"self",
".",
"_construct_body_s3_dict",
"(",
")",
"elif",
"self",
".",
"definition_body",
":",
"rest_api",
".",
"Body",
"=",
"self",
".",
"definition_body",
"if",
"self",
".",
"name",
":",
"rest_api",
".",
"Name",
"=",
"self",
".",
"name",
"return",
"rest_api"
] |
Constructs and returns the ApiGateway RestApi.
:returns: the RestApi to which this SAM Api corresponds
:rtype: model.apigateway.ApiGatewayRestApi
|
[
"Constructs",
"and",
"returns",
"the",
"ApiGateway",
"RestApi",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/api/api_generator.py#L74-L108
|
train
|
Constructs and returns the ApiGateway RestApi object for this SAM Api.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QC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B2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1001110 + 0o41) + '\x32' + chr(0b100001 + 0o21) + chr(106 - 57), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(0b110001) + chr(0b10101 + 0o40), 19214 - 19206), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(84 - 34) + chr(55) + '\066', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(1467 - 1418) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(1646 - 1598) + '\x6f' + chr(1539 - 1489) + chr(49), 40555 - 40547), ehT0Px3KOsy9(chr(631 - 583) + chr(0b1101111) + '\x33' + '\x37' + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(0b110110) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + chr(1842 - 1793) + chr(0b100110 + 0o16) + chr(49), 22346 - 22338), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(0b1 + 0o57) + chr(1155 - 1105), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(999 - 951) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(1235 - 1187) + chr(111) + '\x31' + chr(0b110111) + chr(49), 57137 - 57129), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11011 + 0o26) + chr(0b11000 + 0o36) + chr(700 - 647), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111 + 0o0) + chr(716 - 661) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + '\x33' + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + '\x36' + chr(0b110100), 8836 - 8828), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + '\x33' + '\060', 24861 - 24853), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(0b110100) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(1053 - 1005) + chr(111) + chr(0b110001) + '\x35' + '\065', 24252 - 24244), ehT0Px3KOsy9(chr(48) + chr(7462 - 7351) + chr(0b10000 + 0o43) + '\063' + '\x33', 0b1000), ehT0Px3KOsy9(chr(742 - 694) + '\157' + chr(0b110001) + chr(0b10111 + 0o40) + chr(274 - 219), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b110001) + '\x31', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(51) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(4727 - 4616) + '\x33' + '\x37' + chr(363 - 310), 7625 - 7617), ehT0Px3KOsy9('\060' + chr(0b110111 + 0o70) + '\x37' + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1142 - 1091) + '\x35' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2571 - 2520) + chr(0b110011) + '\x35', 8), ehT0Px3KOsy9(chr(263 - 215) + chr(11161 - 11050) + '\x32' + '\x32' + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110111) + chr(53), 8), ehT0Px3KOsy9('\x30' + chr(1176 - 1065) + '\x31' + '\060' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(1803 - 1754) + chr(48), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + '\061' + chr(1173 - 1123), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(54) + '\065', 28050 - 28042), ehT0Px3KOsy9('\060' + chr(930 - 819) + '\x31' + '\062' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b110000), 8), ehT0Px3KOsy9(chr(48) + chr(0b11000 + 0o127) + chr(0b110001) + chr(0b100011 + 0o16) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101111) + chr(0b11 + 0o57) + chr(0b101100 + 0o5), 8), ehT0Px3KOsy9(chr(0b110000) + chr(9366 - 9255) + chr(0b1 + 0o62) + chr(1324 - 1276) + chr(2421 - 2366), ord("\x08")), ehT0Px3KOsy9('\060' + chr(11643 - 11532) + '\x37' + chr(0b110010 + 0o0), 34708 - 34700), ehT0Px3KOsy9(chr(480 - 432) + '\x6f' + '\x32' + chr(0b1 + 0o62) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100001 + 0o22) + chr(0b0 + 0o66) + chr(52), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1110 + 0o47) + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xbf'), chr(100) + '\145' + chr(99) + chr(111) + chr(4799 - 4699) + chr(0b1000101 + 0o40))('\x75' + chr(2835 - 2719) + chr(102) + chr(45) + chr(2766 - 2710)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Imx5zXb3VC6_(oVre8I6UXc3b):
zxUfyoBahbWI = E6kpDkEm8Siw(oVre8I6UXc3b.NpZr66MdBhVG, depends_on=oVre8I6UXc3b.oayEYOknteBp, attributes=oVre8I6UXc3b.x7ddN_ki5nGn)
zxUfyoBahbWI.wCNzsayNNjP8 = oVre8I6UXc3b.binary_media
zxUfyoBahbWI.M4WfvpvHpByE = oVre8I6UXc3b.minimum_compression_size
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf4\xe3\xda~~\x97\xd9\x15\x1d\xe2\x16\x1bZ\xb4\x93\xad\x93\x0c\xaf\x16&v'), '\144' + '\x65' + chr(7366 - 7267) + '\157' + chr(100) + chr(0b1100101))('\x75' + '\164' + '\x66' + '\x2d' + '\070')):
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xce\xfe\xdbzN\x9b\xd9\x052\xee\x10\x1bH\x82\x97\xb7\x8f\x0b\xb2\x18<j\x9cI\x85\xb2\xfa'), '\144' + '\145' + chr(6686 - 6587) + '\x6f' + chr(100) + chr(0b100001 + 0o104))('\165' + chr(0b1101101 + 0o7) + chr(0b1000110 + 0o40) + chr(0b101101) + '\070'))(zxUfyoBahbWI, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf4\xe3\xda~~\x97\xd9\x15\x1d\xe2\x16\x1bZ\xb4\x93\xad\x93\x0c\xaf\x16&v'), chr(0b1000 + 0o134) + chr(101) + '\x63' + chr(1148 - 1037) + '\144' + chr(101))(chr(0b1110010 + 0o3) + chr(4758 - 4642) + chr(0b1100110) + chr(45) + chr(0b110100 + 0o4))))
elif not xafqLlk3kkUe(fo2wmgICPblP, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf8\xfe\xe1oa\x97\xd0\x16\x1d\xe4\x1d\x12Y\x82\x97\xb7\x8f\x0b\xb2\x18<j\x9cI\x85\xb2\xfab2=\xfaE=j?t\xa3'), '\x64' + chr(0b1100101) + chr(2654 - 2555) + '\x6f' + chr(2373 - 2273) + chr(0b1100101))(chr(0b1101110 + 0o7) + '\164' + '\x66' + chr(45) + '\x38'))():
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xce\xfe\xdbzN\x9b\xd9\x052\xee\x10\x1bH\x82\x97\xb7\x8f\x0b\xb2\x18<j\x9cI\x85\xb2\xfa'), chr(0b1011111 + 0o5) + chr(101) + chr(99) + chr(0b110 + 0o151) + chr(0b1100100) + chr(3958 - 3857))(chr(6243 - 6126) + chr(5894 - 5778) + '\x66' + '\055' + chr(56)))(zxUfyoBahbWI, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3\xc8\xf9G^\xb0\xf6-'), chr(0b1100100) + '\145' + chr(4472 - 4373) + chr(111) + '\x64' + chr(0b1100101))(chr(13171 - 13054) + chr(2678 - 2562) + chr(0b1100110) + chr(813 - 768) + chr(0b111000)))
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\xe8\xd8g\x7f\x97\xc3\x08-\xef&\x00N\xb4'), '\x64' + '\145' + chr(0b1100011) + '\157' + chr(0b1100000 + 0o4) + chr(4475 - 4374))(chr(3522 - 3405) + chr(116) + chr(6132 - 6030) + '\055' + chr(56))) and xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\xe8\xd8g\x7f\x97\xc3\x08-\xef&\x17S\xb9\x8d'), chr(100) + chr(0b1100101) + '\143' + chr(111) + '\x64' + chr(0b101011 + 0o72))(chr(12488 - 12371) + chr(0b1110100) + chr(0b1011 + 0o133) + '\x2d' + chr(0b10101 + 0o43))):
raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"\xdf\xfd\xe4|'\xc8\xfa\x05\x00\xe9/2"), chr(0b111100 + 0o50) + chr(101) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(0b1100101))('\165' + '\x74' + '\146' + chr(0b101101) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b"\xc2\xfd\xdbmx\x98\xceA'\xe8\r\x1dY\xaf\xd4\xff\xa5\x08\xbd\x16'q\x89T\x83\xb3\xc1O(o\xaaZ 8lU\xa2\\\xf4\x9a\xf8\xf9\xd7a\x7f\xbc\xd8\x05;\xa6Y\x05N\xb2\x84\xbd\x93\x19\xa2_(v\x99\x1d\x82\xb2\xe0\x1d#'\xfe]"), chr(100) + '\x65' + '\x63' + chr(0b1101111) + chr(744 - 644) + '\x65')(chr(13138 - 13021) + '\x74' + chr(8910 - 8808) + chr(45) + chr(0b100110 + 0o22)))
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xce\xec\xdajN\x9d\xd8\x131'), chr(0b1000010 + 0o42) + chr(0b1100101) + chr(99) + chr(111) + chr(100) + chr(3213 - 3112))(chr(0b100011 + 0o122) + chr(116) + chr(0b1100110) + chr(45) + chr(805 - 749)))()
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xce\xec\xdajN\x9f\xc2\x15*'), '\x64' + '\145' + '\x63' + chr(0b100010 + 0o115) + '\x64' + chr(6982 - 6881))('\x75' + chr(7662 - 7546) + '\146' + chr(0b101101) + chr(56)))()
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b"\xce\xec\xdajN\x99\xd6\x15'\xf6\x18\x0cc\xaf\x91\xab\x91\x02\xb5\x0c,k"), '\144' + chr(0b11010 + 0o113) + '\x63' + chr(0b1101111) + chr(0b1100100) + '\x65')('\x75' + chr(9700 - 9584) + chr(0b1100110) + chr(0b10110 + 0o27) + '\x38'))()
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\xe8\xd8g\x7f\x97\xc3\x08-\xef&\x00N\xb4'), chr(100) + chr(101) + chr(0b101001 + 0o72) + chr(0b1100 + 0o143) + chr(100) + chr(0b101100 + 0o71))(chr(0b1000111 + 0o56) + chr(0b1110100) + '\146' + '\x2d' + '\070')):
zxUfyoBahbWI.IxqETGlKUVgk = oVre8I6UXc3b._construct_body_s3_dict()
elif xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\xe8\xd8g\x7f\x97\xc3\x08-\xef&\x17S\xb9\x8d'), chr(0b1100100) + '\145' + chr(99) + chr(0b1101111) + '\144' + '\145')('\x75' + '\x74' + chr(0b1100110) + chr(94 - 49) + chr(0b101010 + 0o16))):
zxUfyoBahbWI._fQLiCXXrepa = oVre8I6UXc3b.definition_body
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd0\xc4\xc8DC\x84\xfb\x05\x06\xe7\x1e3'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1101111) + '\144' + '\x65')(chr(12542 - 12425) + chr(0b111110 + 0o66) + chr(102) + chr(0b100010 + 0o13) + '\070')):
zxUfyoBahbWI.i0VlBfTP2Syn = oVre8I6UXc3b.AIvJRzLdDfgF
return zxUfyoBahbWI
|
awslabs/serverless-application-model
|
samtranslator/model/api/api_generator.py
|
ApiGenerator._construct_body_s3_dict
|
def _construct_body_s3_dict(self):
"""Constructs the RestApi's `BodyS3Location property`_, from the SAM Api's DefinitionUri property.
:returns: a BodyS3Location dict, containing the S3 Bucket, Key, and Version of the Swagger definition
:rtype: dict
"""
if isinstance(self.definition_uri, dict):
if not self.definition_uri.get("Bucket", None) or not self.definition_uri.get("Key", None):
# DefinitionUri is a dictionary but does not contain Bucket or Key property
raise InvalidResourceException(self.logical_id,
"'DefinitionUri' requires Bucket and Key properties to be specified")
s3_pointer = self.definition_uri
else:
# DefinitionUri is a string
s3_pointer = parse_s3_uri(self.definition_uri)
if s3_pointer is None:
raise InvalidResourceException(self.logical_id,
'\'DefinitionUri\' is not a valid S3 Uri of the form '
'"s3://bucket/key" with optional versionId query parameter.')
body_s3 = {
'Bucket': s3_pointer['Bucket'],
'Key': s3_pointer['Key']
}
if 'Version' in s3_pointer:
body_s3['Version'] = s3_pointer['Version']
return body_s3
|
python
|
def _construct_body_s3_dict(self):
"""Constructs the RestApi's `BodyS3Location property`_, from the SAM Api's DefinitionUri property.
:returns: a BodyS3Location dict, containing the S3 Bucket, Key, and Version of the Swagger definition
:rtype: dict
"""
if isinstance(self.definition_uri, dict):
if not self.definition_uri.get("Bucket", None) or not self.definition_uri.get("Key", None):
# DefinitionUri is a dictionary but does not contain Bucket or Key property
raise InvalidResourceException(self.logical_id,
"'DefinitionUri' requires Bucket and Key properties to be specified")
s3_pointer = self.definition_uri
else:
# DefinitionUri is a string
s3_pointer = parse_s3_uri(self.definition_uri)
if s3_pointer is None:
raise InvalidResourceException(self.logical_id,
'\'DefinitionUri\' is not a valid S3 Uri of the form '
'"s3://bucket/key" with optional versionId query parameter.')
body_s3 = {
'Bucket': s3_pointer['Bucket'],
'Key': s3_pointer['Key']
}
if 'Version' in s3_pointer:
body_s3['Version'] = s3_pointer['Version']
return body_s3
|
[
"def",
"_construct_body_s3_dict",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"definition_uri",
",",
"dict",
")",
":",
"if",
"not",
"self",
".",
"definition_uri",
".",
"get",
"(",
"\"Bucket\"",
",",
"None",
")",
"or",
"not",
"self",
".",
"definition_uri",
".",
"get",
"(",
"\"Key\"",
",",
"None",
")",
":",
"# DefinitionUri is a dictionary but does not contain Bucket or Key property",
"raise",
"InvalidResourceException",
"(",
"self",
".",
"logical_id",
",",
"\"'DefinitionUri' requires Bucket and Key properties to be specified\"",
")",
"s3_pointer",
"=",
"self",
".",
"definition_uri",
"else",
":",
"# DefinitionUri is a string",
"s3_pointer",
"=",
"parse_s3_uri",
"(",
"self",
".",
"definition_uri",
")",
"if",
"s3_pointer",
"is",
"None",
":",
"raise",
"InvalidResourceException",
"(",
"self",
".",
"logical_id",
",",
"'\\'DefinitionUri\\' is not a valid S3 Uri of the form '",
"'\"s3://bucket/key\" with optional versionId query parameter.'",
")",
"body_s3",
"=",
"{",
"'Bucket'",
":",
"s3_pointer",
"[",
"'Bucket'",
"]",
",",
"'Key'",
":",
"s3_pointer",
"[",
"'Key'",
"]",
"}",
"if",
"'Version'",
"in",
"s3_pointer",
":",
"body_s3",
"[",
"'Version'",
"]",
"=",
"s3_pointer",
"[",
"'Version'",
"]",
"return",
"body_s3"
] |
Constructs the RestApi's `BodyS3Location property`_, from the SAM Api's DefinitionUri property.
:returns: a BodyS3Location dict, containing the S3 Bucket, Key, and Version of the Swagger definition
:rtype: dict
|
[
"Constructs",
"the",
"RestApi",
"s",
"BodyS3Location",
"property",
"_",
"from",
"the",
"SAM",
"Api",
"s",
"DefinitionUri",
"property",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/api/api_generator.py#L110-L138
|
train
|
Constructs the RestApi s BodyS3Location property_ from the SAM Api s DefinitionUri property.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9Flf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BM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(967 - 919) + chr(111) + '\x31' + '\x37' + chr(0b101001 + 0o13), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1101 + 0o44) + chr(0b10011 + 0o35) + chr(53), 0b1000), ehT0Px3KOsy9(chr(133 - 85) + '\x6f' + chr(0b10000 + 0o41) + chr(53) + chr(0b1100 + 0o46), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1010010 + 0o35) + chr(2407 - 2356) + chr(2355 - 2304) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\063' + '\067' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110110 + 0o71) + chr(761 - 712) + '\062', 29493 - 29485), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b110111) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101111) + '\x37' + '\062', 43575 - 43567), ehT0Px3KOsy9(chr(956 - 908) + chr(0b101011 + 0o104) + '\061' + chr(0b101010 + 0o15) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(1203 - 1155) + '\157' + chr(0b10000 + 0o41) + chr(0b110011 + 0o3), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010 + 0o1) + chr(48) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + '\060' + chr(2685 - 2630), 55523 - 55515), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b101001 + 0o13) + chr(0b110000 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + chr(0b110001) + chr(338 - 285) + chr(0b10010 + 0o36), 25063 - 25055), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(1463 - 1352) + chr(1200 - 1151) + '\x32' + chr(172 - 122), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8733 - 8622) + chr(51) + chr(0b110100 + 0o2) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + '\061' + chr(462 - 412) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + '\x37' + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(0b110111) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + chr(5426 - 5315) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + '\063' + chr(1854 - 1805) + chr(86 - 31), 0b1000), ehT0Px3KOsy9(chr(48) + chr(2659 - 2548) + '\x31' + chr(50) + '\x36', 8), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + '\065' + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(10136 - 10025) + '\064' + '\060', 0o10), ehT0Px3KOsy9(chr(786 - 738) + chr(111) + chr(934 - 881) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100000 + 0o21) + chr(48) + chr(51), 60330 - 60322), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100000 + 0o22) + chr(48) + chr(2109 - 2056), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(2000 - 1951) + chr(2001 - 1950) + chr(1366 - 1314), 0b1000), ehT0Px3KOsy9('\060' + chr(9746 - 9635) + chr(0b110010) + '\064' + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\x37' + '\x33', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(0b110001) + '\x31', 44204 - 44196), ehT0Px3KOsy9(chr(0b110000) + chr(4168 - 4057) + chr(1892 - 1841) + '\x34' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10000 + 0o42) + chr(0b110001 + 0o0) + chr(111 - 62), 63540 - 63532), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(54) + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(0b110000 + 0o4) + chr(53), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(51) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(1153 - 1102) + '\x37' + '\x37', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(99 - 51), 15591 - 15583), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + '\064' + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + chr(49) + chr(2518 - 2465) + chr(49), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(378 - 330) + chr(111) + '\065' + chr(0b101101 + 0o3), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'R'), chr(0b1010011 + 0o21) + '\145' + chr(0b101010 + 0o71) + chr(0b1101000 + 0o7) + chr(0b1100100) + '\145')('\165' + chr(12589 - 12473) + chr(102) + chr(57 - 12) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def hPDgpeVJDS0w(oVre8I6UXc3b):
if PlSM16l2KDPD(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x18 \x0c\xb5\x91c\x0cS\x15`\x99\xf2\x90\x01'), chr(0b10101 + 0o117) + chr(0b1100101) + '\143' + '\x6f' + chr(0b1011101 + 0o7) + '\x65')(chr(0b1110101) + chr(9331 - 9215) + '\x66' + chr(0b101101) + chr(0b11000 + 0o40))), wLqBDw8l0eIm):
if not xafqLlk3kkUe(oVre8I6UXc3b.definition_uri, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1b \x1e'), '\144' + '\145' + chr(0b1000000 + 0o43) + '\157' + chr(100) + chr(0b1011010 + 0o13))(chr(0b1101110 + 0o7) + '\x74' + chr(198 - 96) + chr(1373 - 1328) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'>0\t\xb7\x9a~'), chr(0b1100001 + 0o3) + chr(101) + chr(99) + chr(0b1101111) + chr(0b1001000 + 0o34) + chr(101))(chr(117) + '\x74' + '\x66' + chr(0b101101) + chr(0b10101 + 0o43)), None) or not xafqLlk3kkUe(oVre8I6UXc3b.definition_uri, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1b \x1e'), chr(0b1100100) + chr(0b100001 + 0o104) + chr(981 - 882) + chr(111) + chr(5955 - 5855) + chr(0b101010 + 0o73))(chr(117) + chr(6588 - 6472) + '\146' + chr(0b1 + 0o54) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'7 \x13'), chr(0b1100100) + '\x65' + '\143' + chr(0b1000010 + 0o55) + chr(4940 - 4840) + chr(101))(chr(0b1001111 + 0o46) + chr(9282 - 9166) + '\146' + '\x2d' + '\x38'), None):
raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'250\xae\xc9<5^8f\x90\xc0'), chr(0b101111 + 0o65) + chr(101) + '\x63' + chr(111) + chr(100) + '\145')('\165' + chr(5269 - 5153) + chr(0b1100110) + chr(45) + '\070')), xafqLlk3kkUe(SXOLrMavuUCe(b"[\x01\x0f\xba\x96d\x11N\x13a\xa8\xd2\x90\x01u\xd5$\x1c\xcar\xa6$\x0cS\x0e\x01\xf0?\xce\xde\xbd\xc5\xe8\xda\xc1\xfb\xb4m\xdeI\x0c7\x05\xac\x9ax\x0cS\x1f}\xe6\xf3\x8dH0\x90v\n\xcbb\xac?\x0fIK'"), chr(0b110010 + 0o62) + '\x65' + chr(99) + chr(7545 - 7434) + chr(3198 - 3098) + '\x65')(chr(117) + '\x74' + chr(0b1100110) + '\055' + chr(0b1000 + 0o60)))
xNSeLJII_gIj = oVre8I6UXc3b.definition_uri
else:
xNSeLJII_gIj = V_yAcvAyhSH0(oVre8I6UXc3b.definition_uri)
if xNSeLJII_gIj is None:
raise ow8Lll3lwq0h(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'250\xae\xc9<5^8f\x90\xc0'), chr(0b1001011 + 0o31) + chr(0b1100101) + chr(8378 - 8279) + '\157' + '\144' + chr(0b1100101))('\165' + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b10101 + 0o43))), xafqLlk3kkUe(SXOLrMavuUCe(b'[\x01\x0f\xba\x96d\x11N\x13a\xa8\xd2\x90\x01u\xd5?\n\x9bi\xa0"IA\x0e5\xe40\xcc\xdf\xe9\xb6\xba\x94\xf0\xa9\x96(\xc8\x0f\\1\x02\xb9\xdfl\x17H\x17.\xe4\xf4\xd1R}\xda4\x0c\xd8l\xaa"FKK:\xa7|\xd2\xd2\xbd\x8d\xa9\xdb\xd5\xaf\x96g\xc9\x08\x10e\x1c\xb9\x8dy\x11U\x14G\xa2\xa7\x93\x1d7\x87/Y\xcbf\xbd7\x04EZ&\xf7r'), chr(100) + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(7145 - 7045) + '\x65')(chr(0b1110101) + chr(7048 - 6932) + '\x66' + '\055' + chr(0b111000)))
QR2r8byAFes0 = {xafqLlk3kkUe(SXOLrMavuUCe(b'>0\t\xb7\x9a~'), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(111) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(116) + '\146' + chr(45) + chr(105 - 49)): xNSeLJII_gIj[xafqLlk3kkUe(SXOLrMavuUCe(b'>0\t\xb7\x9a~'), chr(0b1100100) + chr(7783 - 7682) + '\143' + chr(111) + chr(3080 - 2980) + chr(0b1100101 + 0o0))(chr(0b0 + 0o165) + chr(116) + chr(0b1100110) + chr(45) + chr(0b111000))], xafqLlk3kkUe(SXOLrMavuUCe(b'7 \x13'), chr(8621 - 8521) + chr(0b1100101) + chr(5575 - 5476) + chr(0b1101111) + chr(0b10 + 0o142) + chr(2751 - 2650))('\x75' + '\164' + '\146' + chr(45) + chr(0b110000 + 0o10)): xNSeLJII_gIj[xafqLlk3kkUe(SXOLrMavuUCe(b'7 \x13'), chr(0b1100100) + chr(8023 - 7922) + chr(0b1011111 + 0o4) + chr(6711 - 6600) + chr(0b101000 + 0o74) + chr(0b10011 + 0o122))(chr(0b111111 + 0o66) + chr(0b1110100) + chr(0b1010000 + 0o26) + chr(0b101101) + chr(0b111000))]}
if xafqLlk3kkUe(SXOLrMavuUCe(b'* \x18\xaf\x96e\x16'), '\144' + '\x65' + '\143' + chr(0b110111 + 0o70) + '\x64' + chr(0b1100101))('\165' + chr(0b11011 + 0o131) + '\146' + chr(0b1011 + 0o42) + chr(0b100111 + 0o21)) in xNSeLJII_gIj:
QR2r8byAFes0[xafqLlk3kkUe(SXOLrMavuUCe(b'* \x18\xaf\x96e\x16'), chr(0b1100100) + chr(0b1100101) + '\143' + '\157' + '\x64' + chr(0b1100101))(chr(117) + chr(0b1110100) + '\146' + chr(45) + '\x38')] = xNSeLJII_gIj[xafqLlk3kkUe(SXOLrMavuUCe(b'* \x18\xaf\x96e\x16'), chr(4840 - 4740) + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(0b111011 + 0o51) + chr(101))(chr(0b11000 + 0o135) + chr(0b111101 + 0o67) + chr(0b1100110) + chr(1225 - 1180) + chr(0b110111 + 0o1))]
return QR2r8byAFes0
|
awslabs/serverless-application-model
|
samtranslator/model/api/api_generator.py
|
ApiGenerator._construct_deployment
|
def _construct_deployment(self, rest_api):
"""Constructs and returns the ApiGateway Deployment.
:param model.apigateway.ApiGatewayRestApi rest_api: the RestApi for this Deployment
:returns: the Deployment to which this SAM Api corresponds
:rtype: model.apigateway.ApiGatewayDeployment
"""
deployment = ApiGatewayDeployment(self.logical_id + 'Deployment',
attributes=self.passthrough_resource_attributes)
deployment.RestApiId = rest_api.get_runtime_attr('rest_api_id')
deployment.StageName = 'Stage'
return deployment
|
python
|
def _construct_deployment(self, rest_api):
"""Constructs and returns the ApiGateway Deployment.
:param model.apigateway.ApiGatewayRestApi rest_api: the RestApi for this Deployment
:returns: the Deployment to which this SAM Api corresponds
:rtype: model.apigateway.ApiGatewayDeployment
"""
deployment = ApiGatewayDeployment(self.logical_id + 'Deployment',
attributes=self.passthrough_resource_attributes)
deployment.RestApiId = rest_api.get_runtime_attr('rest_api_id')
deployment.StageName = 'Stage'
return deployment
|
[
"def",
"_construct_deployment",
"(",
"self",
",",
"rest_api",
")",
":",
"deployment",
"=",
"ApiGatewayDeployment",
"(",
"self",
".",
"logical_id",
"+",
"'Deployment'",
",",
"attributes",
"=",
"self",
".",
"passthrough_resource_attributes",
")",
"deployment",
".",
"RestApiId",
"=",
"rest_api",
".",
"get_runtime_attr",
"(",
"'rest_api_id'",
")",
"deployment",
".",
"StageName",
"=",
"'Stage'",
"return",
"deployment"
] |
Constructs and returns the ApiGateway Deployment.
:param model.apigateway.ApiGatewayRestApi rest_api: the RestApi for this Deployment
:returns: the Deployment to which this SAM Api corresponds
:rtype: model.apigateway.ApiGatewayDeployment
|
[
"Constructs",
"and",
"returns",
"the",
"ApiGateway",
"Deployment",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/api/api_generator.py#L140-L152
|
train
|
Constructs and returns the ApiGateway Deployment.
|
Pu7Z6IJCgH3a,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6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(0b110001) + chr(0b11010 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x35' + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(3111 - 3000) + chr(53) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(9789 - 9678) + chr(0b110010) + chr(0b110000) + chr(0b110001), 57496 - 57488), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(729 - 618) + chr(0b101010 + 0o7) + chr(0b110111) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + '\x33' + chr(0b100011 + 0o16), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(0b1111 + 0o41) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(874 - 825) + chr(131 - 78) + chr(0b10001 + 0o37), 14525 - 14517), ehT0Px3KOsy9('\x30' + chr(0b111110 + 0o61) + chr(51) + chr(0b1001 + 0o56) + chr(0b10000 + 0o46), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(1178 - 1067) + chr(0b110010 + 0o1) + '\067' + chr(51), 12539 - 12531), ehT0Px3KOsy9(chr(48) + chr(0b1001001 + 0o46) + chr(0b10111 + 0o36) + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + chr(10797 - 10686) + chr(54) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b101110 + 0o101) + '\x32' + chr(239 - 188) + chr(1985 - 1933), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + '\x35' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x37' + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1010 + 0o50) + chr(1258 - 1205) + chr(55), 61009 - 61001), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(9974 - 9863) + chr(51) + '\063' + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(10814 - 10703) + chr(1247 - 1196) + chr(79 - 31) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b101 + 0o55) + chr(0b1111 + 0o44), 25216 - 25208), ehT0Px3KOsy9(chr(0b110000) + chr(0b1 + 0o156) + '\061' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(1243 - 1190) + chr(0b110110), 53760 - 53752), ehT0Px3KOsy9('\060' + chr(10666 - 10555) + '\063' + chr(0b110111) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(607 - 556) + chr(49) + '\060', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(0b11110 + 0o23) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(111) + '\x31' + '\x30' + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1011001 + 0o26) + '\063' + '\x33' + chr(730 - 679), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11001 + 0o30) + chr(0b110100) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10001 + 0o40) + chr(0b10001 + 0o43) + chr(1857 - 1807), 0o10), ehT0Px3KOsy9(chr(977 - 929) + '\157' + '\x32' + chr(0b110001) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(8288 - 8177) + chr(49) + '\062' + '\064', 0o10), ehT0Px3KOsy9(chr(139 - 91) + chr(8666 - 8555) + '\x32' + chr(50) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\x6f' + chr(0b1001 + 0o50) + chr(0b110001) + chr(0b101011 + 0o5), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(48) + chr(53), 65010 - 65002), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1001010 + 0o45) + '\061' + chr(0b110001 + 0o3) + '\x37', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010111 + 0o30) + '\061' + '\064' + chr(2280 - 2229), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001001 + 0o46) + '\x31' + '\064' + '\x33', 8), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(10376 - 10265) + chr(0b110010) + '\066' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b111000 + 0o67) + chr(0b110011) + '\064' + chr(48), 41152 - 41144), ehT0Px3KOsy9(chr(0b110000) + chr(0b0 + 0o157) + '\062' + chr(49), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(53) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'g'), '\144' + chr(101) + chr(0b101111 + 0o64) + chr(0b1101111) + chr(0b1000 + 0o134) + chr(101))(chr(0b1011000 + 0o35) + chr(0b1111 + 0o145) + chr(7366 - 7264) + '\x2d' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def aS0PWrxMrxHX(oVre8I6UXc3b, zxUfyoBahbWI):
Gh86J6oCA0R0 = Y2ogjf33O4SV(oVre8I6UXc3b.NpZr66MdBhVG + xafqLlk3kkUe(SXOLrMavuUCe(b'\rI^\xed\x15\xe0\xaa\r\x90s'), '\144' + '\145' + '\x63' + chr(0b1101111) + chr(7749 - 7649) + chr(101))(chr(117) + chr(116) + chr(102) + '\055' + chr(56)), attributes=oVre8I6UXc3b.passthrough_resource_attributes)
Gh86J6oCA0R0.hxMeJnubhZib = zxUfyoBahbWI.get_runtime_attr(xafqLlk3kkUe(SXOLrMavuUCe(b';I]\xf5%\xf8\xb7\x01\xa1n\x9f'), chr(0b10100 + 0o120) + chr(0b1100101) + '\x63' + '\157' + '\x64' + chr(101))(chr(0b1000010 + 0o63) + '\x74' + chr(0b100011 + 0o103) + chr(45) + chr(56)))
Gh86J6oCA0R0.UBd8m151fyes = xafqLlk3kkUe(SXOLrMavuUCe(b'\x1aXO\xe6\x1f'), chr(100) + '\x65' + chr(99) + chr(2695 - 2584) + chr(0b1100100) + '\145')(chr(0b1110101) + '\164' + chr(0b1010010 + 0o24) + chr(0b101101) + chr(2467 - 2411))
return Gh86J6oCA0R0
|
awslabs/serverless-application-model
|
samtranslator/model/api/api_generator.py
|
ApiGenerator._construct_stage
|
def _construct_stage(self, deployment, swagger):
"""Constructs and returns the ApiGateway Stage.
:param model.apigateway.ApiGatewayDeployment deployment: the Deployment for this Stage
:returns: the Stage to which this SAM Api corresponds
:rtype: model.apigateway.ApiGatewayStage
"""
# If StageName is some intrinsic function, then don't prefix the Stage's logical ID
# This will NOT create duplicates because we allow only ONE stage per API resource
stage_name_prefix = self.stage_name if isinstance(self.stage_name, string_types) else ""
stage = ApiGatewayStage(self.logical_id + stage_name_prefix + 'Stage',
attributes=self.passthrough_resource_attributes)
stage.RestApiId = ref(self.logical_id)
stage.update_deployment_ref(deployment.logical_id)
stage.StageName = self.stage_name
stage.CacheClusterEnabled = self.cache_cluster_enabled
stage.CacheClusterSize = self.cache_cluster_size
stage.Variables = self.variables
stage.MethodSettings = self.method_settings
stage.AccessLogSetting = self.access_log_setting
stage.CanarySetting = self.canary_setting
stage.TracingEnabled = self.tracing_enabled
if swagger is not None:
deployment.make_auto_deployable(stage, swagger)
return stage
|
python
|
def _construct_stage(self, deployment, swagger):
"""Constructs and returns the ApiGateway Stage.
:param model.apigateway.ApiGatewayDeployment deployment: the Deployment for this Stage
:returns: the Stage to which this SAM Api corresponds
:rtype: model.apigateway.ApiGatewayStage
"""
# If StageName is some intrinsic function, then don't prefix the Stage's logical ID
# This will NOT create duplicates because we allow only ONE stage per API resource
stage_name_prefix = self.stage_name if isinstance(self.stage_name, string_types) else ""
stage = ApiGatewayStage(self.logical_id + stage_name_prefix + 'Stage',
attributes=self.passthrough_resource_attributes)
stage.RestApiId = ref(self.logical_id)
stage.update_deployment_ref(deployment.logical_id)
stage.StageName = self.stage_name
stage.CacheClusterEnabled = self.cache_cluster_enabled
stage.CacheClusterSize = self.cache_cluster_size
stage.Variables = self.variables
stage.MethodSettings = self.method_settings
stage.AccessLogSetting = self.access_log_setting
stage.CanarySetting = self.canary_setting
stage.TracingEnabled = self.tracing_enabled
if swagger is not None:
deployment.make_auto_deployable(stage, swagger)
return stage
|
[
"def",
"_construct_stage",
"(",
"self",
",",
"deployment",
",",
"swagger",
")",
":",
"# If StageName is some intrinsic function, then don't prefix the Stage's logical ID",
"# This will NOT create duplicates because we allow only ONE stage per API resource",
"stage_name_prefix",
"=",
"self",
".",
"stage_name",
"if",
"isinstance",
"(",
"self",
".",
"stage_name",
",",
"string_types",
")",
"else",
"\"\"",
"stage",
"=",
"ApiGatewayStage",
"(",
"self",
".",
"logical_id",
"+",
"stage_name_prefix",
"+",
"'Stage'",
",",
"attributes",
"=",
"self",
".",
"passthrough_resource_attributes",
")",
"stage",
".",
"RestApiId",
"=",
"ref",
"(",
"self",
".",
"logical_id",
")",
"stage",
".",
"update_deployment_ref",
"(",
"deployment",
".",
"logical_id",
")",
"stage",
".",
"StageName",
"=",
"self",
".",
"stage_name",
"stage",
".",
"CacheClusterEnabled",
"=",
"self",
".",
"cache_cluster_enabled",
"stage",
".",
"CacheClusterSize",
"=",
"self",
".",
"cache_cluster_size",
"stage",
".",
"Variables",
"=",
"self",
".",
"variables",
"stage",
".",
"MethodSettings",
"=",
"self",
".",
"method_settings",
"stage",
".",
"AccessLogSetting",
"=",
"self",
".",
"access_log_setting",
"stage",
".",
"CanarySetting",
"=",
"self",
".",
"canary_setting",
"stage",
".",
"TracingEnabled",
"=",
"self",
".",
"tracing_enabled",
"if",
"swagger",
"is",
"not",
"None",
":",
"deployment",
".",
"make_auto_deployable",
"(",
"stage",
",",
"swagger",
")",
"return",
"stage"
] |
Constructs and returns the ApiGateway Stage.
:param model.apigateway.ApiGatewayDeployment deployment: the Deployment for this Stage
:returns: the Stage to which this SAM Api corresponds
:rtype: model.apigateway.ApiGatewayStage
|
[
"Constructs",
"and",
"returns",
"the",
"ApiGateway",
"Stage",
"."
] |
cccb0c96b5c91e53355ebc07e542467303a5eedd
|
https://github.com/awslabs/serverless-application-model/blob/cccb0c96b5c91e53355ebc07e542467303a5eedd/samtranslator/model/api/api_generator.py#L154-L182
|
train
|
Constructs and returns the ApiGateway Stage.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz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zGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1011001 + 0o26) + chr(0b110010) + '\x34' + chr(1567 - 1515), ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b10 + 0o155) + chr(0b110011) + '\x35' + chr(178 - 126), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1100 + 0o47) + chr(50) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b1 + 0o63) + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(1111 - 1061) + chr(48) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(6573 - 6462) + chr(0b11101 + 0o25) + '\065' + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + '\063' + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b111101 + 0o62) + chr(0b10100 + 0o40) + chr(0b110000 + 0o4), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x34' + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(53) + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(54) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(884 - 836) + chr(0b1010001 + 0o36) + '\061' + chr(54) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\065' + '\x32', 8), ehT0Px3KOsy9(chr(977 - 929) + '\157' + chr(0b110001) + '\x36' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(9556 - 9445) + '\x33' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(1794 - 1746) + chr(0b100011 + 0o114) + chr(51) + chr(1526 - 1472) + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(0b101 + 0o152) + chr(544 - 493) + chr(50) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + '\066', 20849 - 20841), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + '\x32' + chr(0b100101 + 0o22) + '\x31', 28193 - 28185), ehT0Px3KOsy9('\x30' + chr(0b111100 + 0o63) + '\x33' + chr(49) + chr(2312 - 2259), 8851 - 8843), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b110100) + chr(1985 - 1935), ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(7082 - 6971) + '\063' + chr(0b1000 + 0o52) + chr(262 - 209), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(0b110011) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1549 - 1500) + chr(0b110010) + chr(2257 - 2204), 49117 - 49109), ehT0Px3KOsy9(chr(986 - 938) + chr(0b111001 + 0o66) + chr(585 - 531) + chr(0b1101 + 0o44), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(0b110100) + '\x32', 4912 - 4904), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + '\x30' + chr(0b100 + 0o54), 25925 - 25917), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010 + 0o0) + chr(0b110001) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(2025 - 1977) + chr(111) + '\063' + chr(975 - 923), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(609 - 560) + '\x30' + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110010 + 0o75) + '\x35' + '\067', 57119 - 57111), ehT0Px3KOsy9('\x30' + chr(6665 - 6554) + '\x33' + chr(1446 - 1396) + '\x34', 43825 - 43817), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(1158 - 1104) + '\x34', 8), ehT0Px3KOsy9(chr(67 - 19) + chr(111) + chr(660 - 609) + chr(592 - 544) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(0b100011 + 0o17) + '\x35', 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2352 - 2302) + '\062' + chr(0b11 + 0o63), 5817 - 5809), ehT0Px3KOsy9('\060' + chr(0b1100101 + 0o12) + chr(0b11010 + 0o27) + chr(0b101001 + 0o10) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(6393 - 6282) + chr(0b110011) + chr(0b10010 + 0o42), 8), ehT0Px3KOsy9('\x30' + chr(764 - 653) + chr(894 - 843) + chr(0b1010 + 0o46) + '\x30', 56925 - 56917), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(50) + chr(1738 - 1688), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b101011 + 0o104) + chr(0b110101) + chr(48), 14021 - 14013)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a'), chr(5123 - 5023) + chr(0b1011111 + 0o6) + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(0b111100 + 0o51))('\165' + '\164' + chr(0b1100110) + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def LFJrR4cxgW4y(oVre8I6UXc3b, Gh86J6oCA0R0, vKQLfCidaf7H):
JCF7f1PhZ_Mt = oVre8I6UXc3b.stage_name if PlSM16l2KDPD(oVre8I6UXc3b.stage_name, sInLJQno9SRQ) else xafqLlk3kkUe(SXOLrMavuUCe(b''), '\x64' + '\x65' + '\x63' + chr(111) + chr(0b1100100) + chr(0b0 + 0o145))('\x75' + chr(0b1110100) + '\146' + chr(0b10000 + 0o35) + '\x38')
VRrhsVxQMv59 = iyGl_nZY20Wj(oVre8I6UXc3b.NpZr66MdBhVG + JCF7f1PhZ_Mt + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf7\x98\xb6\xc6\xe7'), chr(100) + chr(0b1000100 + 0o41) + '\143' + chr(0b111110 + 0o61) + chr(0b1100100) + '\145')(chr(11738 - 11621) + chr(0b1110100) + chr(0b1011100 + 0o12) + chr(1914 - 1869) + chr(56)), attributes=oVre8I6UXc3b.passthrough_resource_attributes)
VRrhsVxQMv59.hxMeJnubhZib = X4s0pSydcnYR(oVre8I6UXc3b.NpZr66MdBhVG)
xafqLlk3kkUe(VRrhsVxQMv59, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd1\x9c\xb3\xc0\xf6\xcc\xc6@DZ\x1d\x1aS\x19\x7f\x99\xa6Y\xcb\xa8\x04'), chr(3941 - 3841) + chr(101) + '\x63' + chr(460 - 349) + chr(0b1100100) + chr(7617 - 7516))(chr(0b1110101) + chr(5132 - 5016) + chr(7779 - 7677) + '\x2d' + '\x38'))(xafqLlk3kkUe(Gh86J6oCA0R0, xafqLlk3kkUe(SXOLrMavuUCe(b"\xea\x9c\x8d\xd3\xb4\x9f\xd4@cB'2"), chr(0b1100100) + '\145' + chr(2512 - 2413) + chr(111) + '\x64' + '\x65')(chr(2912 - 2795) + chr(13313 - 13197) + '\x66' + chr(0b10001 + 0o34) + chr(0b111000))))
VRrhsVxQMv59.UBd8m151fyes = oVre8I6UXc3b.stage_name
VRrhsVxQMv59.sTRaBxaX7uma = oVre8I6UXc3b.cache_cluster_enabled
VRrhsVxQMv59.bx51LNChmmAb = oVre8I6UXc3b.cache_cluster_size
VRrhsVxQMv59.B4UP3bPuJwoE = oVre8I6UXc3b.variables
VRrhsVxQMv59.dzu6W3TCi9dY = oVre8I6UXc3b.method_settings
VRrhsVxQMv59.bgqKu5KPufqu = oVre8I6UXc3b.access_log_setting
VRrhsVxQMv59.QGY0EAHcILLB = oVre8I6UXc3b.canary_setting
VRrhsVxQMv59.SDUih2gtvtmh = oVre8I6UXc3b.tracing_enabled
if vKQLfCidaf7H is not None:
xafqLlk3kkUe(Gh86J6oCA0R0, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9\x8d\xbc\xc4\xdd\xc8\xecPNu\x15\x10Z\x18u\x8e\xb3d\xd5\xa8'), chr(0b1100100) + chr(101) + chr(0b1100011) + '\157' + '\x64' + chr(6054 - 5953))(chr(0b1110101) + '\x74' + chr(102) + chr(708 - 663) + '\x38'))(VRrhsVxQMv59, vKQLfCidaf7H)
return VRrhsVxQMv59
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.